Add models for security manager / security card

This commit is contained in:
Raoul Van den Berge
2016-12-18 00:23:39 +01:00
parent 3f34e8f869
commit 600c62c48b
9 changed files with 81 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.Item;
@@ -158,6 +159,25 @@ public abstract class BlockBase extends Block {
return true;
}
@Override
public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity) {
TileEntity tile = world.getTileEntity(pos);
if (tile != null && tile.hasCapability(CapabilityNetworkNode.NETWORK_NODE_CAPABILITY, null)) {
INetworkNode node = tile.getCapability(CapabilityNetworkNode.NETWORK_NODE_CAPABILITY, null);
if (node.getNetwork() != null) {
if (!(entity instanceof EntityPlayer)) {
return false;
}
return node.getNetwork().getSecurityManager().hasPermission(Permission.BUILD, (EntityPlayer) entity);
}
}
return super.canEntityDestroy(state, world, pos, entity);
}
public EnumPlacementType getPlacementType() {
return EnumPlacementType.HORIZONTAL;
}

View File

@@ -45,4 +45,9 @@ public class BlockSecurityManager extends BlockNode {
return true;
}
@Override
public boolean hasConnectivityState() {
return true;
}
}

View File

@@ -153,6 +153,7 @@ public class ProxyClient extends ProxyCommon {
ModelLoader.setCustomModelResourceLocation(RSItems.GRID_FILTER, 0, new ModelResourceLocation("refinedstorage:grid_filter", "inventory"));
ModelLoader.setCustomModelResourceLocation(RSItems.NETWORK_CARD, 0, new ModelResourceLocation("refinedstorage:network_card", "inventory"));
ModelLoader.setCustomModelResourceLocation(RSItems.WRENCH, 0, new ModelResourceLocation("refinedstorage:wrench", "inventory"));
ModelLoader.setCustomModelResourceLocation(RSItems.SECURITY_CARD, 0, new ModelResourceLocation("refinedstorage:security_card", "inventory"));
ModelLoader.setCustomModelResourceLocation(RSItems.UPGRADE, 0, new ModelResourceLocation("refinedstorage:upgrade", "inventory"));
ModelLoader.setCustomModelResourceLocation(RSItems.UPGRADE, ItemUpgrade.TYPE_RANGE, new ModelResourceLocation("refinedstorage:range_upgrade", "inventory"));
@@ -204,6 +205,7 @@ public class ProxyClient extends ProxyCommon {
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_512K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=512k"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_CREATIVE.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=creative"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.DISK_MANIPULATOR), 0, new ModelResourceLocation("refinedstorage:disk_manipulator", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.SECURITY_MANAGER), 0, new ModelResourceLocation("refinedstorage:security_manager", "inventory"));
ModelLoaderRegistry.registerLoader(new ICustomModelLoader() {
@Override

View File

@@ -163,4 +163,9 @@ public class TileSecurityManager extends TileNode implements ISecurityCardContai
public IItemHandler getDrops() {
return new CombinedInvWrapper(cards, editCard);
}
@Override
public boolean hasConnectivityState() {
return true;
}
}

View File

@@ -3,7 +3,7 @@
"defaults": {
"model": "cube_all",
"textures": {
"all": "refinedstorage:blocks/casing"
"all": "refinedstorage:blocks/machine_casing"
}
},
"variants": {

View File

@@ -0,0 +1,42 @@
{
"forge_marker": 1,
"defaults": {
"model": "cube_all",
"textures": {
"all": "refinedstorage:blocks/machine_casing"
}
},
"variants": {
"inventory": [
{
"transform": "forge:default-block"
}
],
"connected": {
"true": {
},
"false": {
}
},
"direction": {
"north": {
"y": 0
},
"east": {
"y": 90
},
"south": {
"y": 180
},
"west": {
"y": 270
},
"up": {
"x": 270
},
"down": {
"x": 90
}
}
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "refinedstorage:items/security_card"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B