Add models for security manager / security card
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -45,4 +45,9 @@ public class BlockSecurityManager extends BlockNode {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasConnectivityState() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user