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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"defaults": {
|
||||
"model": "cube_all",
|
||||
"textures": {
|
||||
"all": "refinedstorage:blocks/casing"
|
||||
"all": "refinedstorage:blocks/machine_casing"
|
||||
}
|
||||
},
|
||||
"variants": {
|
||||
|
||||
42
src/main/resources/assets/refinedstorage/blockstates/security_manager.json
Executable file
42
src/main/resources/assets/refinedstorage/blockstates/security_manager.json
Executable 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
6
src/main/resources/assets/refinedstorage/models/item/security_card.json
Executable file
6
src/main/resources/assets/refinedstorage/models/item/security_card.json
Executable file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "refinedstorage:items/security_card"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
BIN
src/main/resources/assets/refinedstorage/textures/items/security_card.png
Executable file
BIN
src/main/resources/assets/refinedstorage/textures/items/security_card.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 231 B |
Reference in New Issue
Block a user