Improvements to cables.
This commit is contained in:
parent
7a8a152911
commit
007e8714fa
3 changed files with 35 additions and 3 deletions
|
@ -47,6 +47,7 @@ import techreborn.blocks.transformers.BlockHVTransformer;
|
|||
import techreborn.blocks.transformers.BlockLVTransformer;
|
||||
import techreborn.blocks.transformers.BlockMVTransformer;
|
||||
import techreborn.itemblocks.*;
|
||||
import techreborn.parts.powerCables.EnumCableType;
|
||||
import techreborn.tiles.*;
|
||||
import techreborn.tiles.cable.TileCable;
|
||||
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
||||
|
@ -210,9 +211,12 @@ public class ModBlocks {
|
|||
GameRegistry.registerTileEntity(TilePlayerDectector.class, "TilePlayerDectectorTR");
|
||||
|
||||
CABLE = new BlockCable();
|
||||
registerBlock(CABLE,"cable");
|
||||
registerBlock(CABLE, ItemBlockCable.class, "cable");
|
||||
GameRegistry.registerTileEntity(TileCable.class, "TileCableTR");
|
||||
Core.proxy.registerCustomBlockStateLocation(CABLE, "cable");
|
||||
for (EnumCableType cableType : EnumCableType.values()) {
|
||||
Core.proxy.registerSubBlockInventoryLocation(CABLE, cableType.ordinal(), "techreborn:cable", "inventory");//"type=" + cableType.getName().toLowerCase());
|
||||
}
|
||||
|
||||
MACHINE_CASINGS = new BlockMachineCasing(Material.ROCK);
|
||||
registerBlock(MACHINE_CASINGS, ItemBlockMachineCasing.class, "machinecasing");
|
||||
|
|
27
src/main/java/techreborn/itemblocks/ItemBlockCable.java
Normal file
27
src/main/java/techreborn/itemblocks/ItemBlockCable.java
Normal file
|
@ -0,0 +1,27 @@
|
|||
package techreborn.itemblocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.parts.powerCables.EnumCableType;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 12/06/2017.
|
||||
*/
|
||||
public class ItemBlockCable extends ItemBlock {
|
||||
|
||||
public ItemBlockCable(Block block) {
|
||||
super(block);
|
||||
}
|
||||
|
||||
public int getMetadata(int damage)
|
||||
{
|
||||
return damage;
|
||||
}
|
||||
|
||||
|
||||
public String getUnlocalizedName(ItemStack stack)
|
||||
{
|
||||
return super.getUnlocalizedName() + "." + EnumCableType.values()[stack.getItemDamage()].getName();
|
||||
}
|
||||
}
|
|
@ -4,8 +4,8 @@
|
|||
"transform": "forge:default-block",
|
||||
"model": "techreborn:cable_thin",
|
||||
"textures": {
|
||||
"cable": "techreborn:block/cable",
|
||||
"particle": "#cable"
|
||||
"cable": "techreborn:block/blocks/cables/copper_cable",
|
||||
"particle": "techreborn:block/blocks/cables/copper_cable"
|
||||
}
|
||||
},
|
||||
"variants": {
|
||||
|
@ -14,6 +14,7 @@
|
|||
"transform": "forge:default-block",
|
||||
"model": "techreborn:cable",
|
||||
"textures": {
|
||||
"cable": "techreborn:blocks/cables/copper_cable"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue