Add iron fence and fence gate

Cannot for the life of my figure out why the iron fence gate block won't render correctly. The blockstate isn't being called. Hopefully I can figure out in the morning
This commit is contained in:
TheDoctorSoda 2016-02-22 00:11:19 -08:00
parent 502fae9518
commit 90932acab9
23 changed files with 316 additions and 8 deletions

View file

@ -23,6 +23,7 @@ import techreborn.api.TechRebornAPI;
import techreborn.api.recipe.RecipeHandler;
import techreborn.api.recipe.recipeConfig.RecipeConfigManager;
import techreborn.client.GuiHandler;
import techreborn.client.RegisterItemJsons;
import techreborn.command.TechRebornDevCommand;
import techreborn.compat.CompatManager;
import techreborn.compat.ICompatModule;

View file

@ -0,0 +1,18 @@
package techreborn.blocks;
import net.minecraft.block.BlockFence;
import net.minecraft.block.material.Material;
import techreborn.client.TechRebornCreativeTabMisc;
public class BlockIronFence extends BlockFence {
public BlockIronFence() {
super(Material.iron);
setUnlocalizedName("techreborn.ironfence");
setCreativeTab(TechRebornCreativeTabMisc.instance);
setStepSound(soundTypeMetal);
setHardness(2.0F);
setHarvestLevel("pickaxe", 2);
}
}

View file

@ -0,0 +1,36 @@
package techreborn.blocks;
import net.minecraft.block.BlockFenceGate;
import net.minecraft.block.BlockPlanks;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import techreborn.client.TechRebornCreativeTabMisc;
public class BlockIronFenceGate extends BlockFenceGate {
public BlockIronFenceGate() {
super(BlockPlanks.EnumType.OAK);
setUnlocalizedName("techreborn.ironfencegate");
setCreativeTab(TechRebornCreativeTabMisc.instance);
setStepSound(soundTypeMetal);
setHardness(2.0F);
setHarvestLevel("pickaxe", 2);
}
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
return true;
}
@Override
public Material getMaterial(){
return Material.iron;
}
}

View file

@ -22,6 +22,7 @@ public class BlockRubberSapling extends BlockSapling {
public BlockRubberSapling() {
setUnlocalizedName("techreborn.rubbersapling");
setCreativeTab(TechRebornCreativeTabMisc.instance);
setStepSound(soundTypeGrass);
this.setDefaultState(this.blockState.getBaseState().withProperty(STAGE, Integer.valueOf(0)));
}

View file

@ -0,0 +1,26 @@
package techreborn.client;
import jline.internal.Log;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.oredict.OreDictionary;
import reborncore.common.util.LogHelper;
import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
public class RegisterItemJsons {
public static void registerModels() {
registerItems();
registerBlocks();
}
private static void registerItems() {
}
private static void registerBlocks() {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.ironFence), 0, new ModelResourceLocation("techreborn:ironFence", "inventory"));
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.ironFenceGate), 0, new ModelResourceLocation("techreborn:ironFenceGate", "inventory"));
}
}

View file

@ -1,7 +1,6 @@
package techreborn.init;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSapling;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
@ -9,9 +8,54 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.OreDictionary;
import reborncore.common.tile.TileMachineBase;
import techreborn.Core;
import techreborn.blocks.*;
import techreborn.blocks.generator.*;
import techreborn.blocks.machine.*;
import techreborn.blocks.BlockChunkLoader;
import techreborn.blocks.BlockComputerCube;
import techreborn.blocks.BlockDigitalChest;
import techreborn.blocks.BlockElectricCraftingTable;
import techreborn.blocks.BlockFusionCoil;
import techreborn.blocks.BlockFusionControlComputer;
import techreborn.blocks.BlockHighlyAdvancedMachine;
import techreborn.blocks.BlockIronFence;
import techreborn.blocks.BlockIronFenceGate;
import techreborn.blocks.BlockMachineCasing;
import techreborn.blocks.BlockMachineFrame;
import techreborn.blocks.BlockOre;
import techreborn.blocks.BlockPlayerDetector;
import techreborn.blocks.BlockQuantumChest;
import techreborn.blocks.BlockQuantumTank;
import techreborn.blocks.BlockRubberLeaves;
import techreborn.blocks.BlockRubberLog;
import techreborn.blocks.BlockRubberPlank;
import techreborn.blocks.BlockRubberSapling;
import techreborn.blocks.BlockStorage;
import techreborn.blocks.BlockStorage2;
import techreborn.blocks.BlockSupercondensator;
import techreborn.blocks.generator.BlockDieselGenerator;
import techreborn.blocks.generator.BlockDragonEggSiphoner;
import techreborn.blocks.generator.BlockGasTurbine;
import techreborn.blocks.generator.BlockGenerator;
import techreborn.blocks.generator.BlockHeatGenerator;
import techreborn.blocks.generator.BlockLightningRod;
import techreborn.blocks.generator.BlockMagicEnergyAbsorber;
import techreborn.blocks.generator.BlockMagicEnergyConverter;
import techreborn.blocks.generator.BlockPlasmaGenerator;
import techreborn.blocks.generator.BlockSemiFluidGenerator;
import techreborn.blocks.generator.BlockThermalGenerator;
import techreborn.blocks.machine.BlockAlloyFurnace;
import techreborn.blocks.machine.BlockAlloySmelter;
import techreborn.blocks.machine.BlockAssemblingMachine;
import techreborn.blocks.machine.BlockBlastFurnace;
import techreborn.blocks.machine.BlockCentrifuge;
import techreborn.blocks.machine.BlockChargeBench;
import techreborn.blocks.machine.BlockChemicalReactor;
import techreborn.blocks.machine.BlockDistillationTower;
import techreborn.blocks.machine.BlockImplosionCompressor;
import techreborn.blocks.machine.BlockIndustrialElectrolyzer;
import techreborn.blocks.machine.BlockIndustrialGrinder;
import techreborn.blocks.machine.BlockIndustrialSawmill;
import techreborn.blocks.machine.BlockMatterFabricator;
import techreborn.blocks.machine.BlockRollingMachine;
import techreborn.blocks.machine.BlockVacuumFreezer;
import techreborn.blocks.storage.BlockAesu;
import techreborn.blocks.storage.BlockIDSU;
import techreborn.blocks.storage.BlockLesu;
@ -20,8 +64,39 @@ import techreborn.blocks.teir1.BlockCompressor;
import techreborn.blocks.teir1.BlockElectricFurnace;
import techreborn.blocks.teir1.BlockExtractor;
import techreborn.blocks.teir1.BlockGrinder;
import techreborn.itemblocks.*;
import techreborn.tiles.*;
import techreborn.itemblocks.ItemBlockAesu;
import techreborn.itemblocks.ItemBlockDigitalChest;
import techreborn.itemblocks.ItemBlockMachineCasing;
import techreborn.itemblocks.ItemBlockMachineFrame;
import techreborn.itemblocks.ItemBlockOre;
import techreborn.itemblocks.ItemBlockPlayerDetector;
import techreborn.itemblocks.ItemBlockQuantumChest;
import techreborn.itemblocks.ItemBlockQuantumTank;
import techreborn.itemblocks.ItemBlockRubberSapling;
import techreborn.itemblocks.ItemBlockStorage;
import techreborn.itemblocks.ItemBlockStorage2;
import techreborn.tiles.TileAesu;
import techreborn.tiles.TileAlloyFurnace;
import techreborn.tiles.TileAlloySmelter;
import techreborn.tiles.TileAssemblingMachine;
import techreborn.tiles.TileBlastFurnace;
import techreborn.tiles.TileCentrifuge;
import techreborn.tiles.TileChargeBench;
import techreborn.tiles.TileChemicalReactor;
import techreborn.tiles.TileChunkLoader;
import techreborn.tiles.TileDigitalChest;
import techreborn.tiles.TileImplosionCompressor;
import techreborn.tiles.TileIndustrialElectrolyzer;
import techreborn.tiles.TileIndustrialGrinder;
import techreborn.tiles.TileIndustrialSawmill;
import techreborn.tiles.TileMachineCasing;
import techreborn.tiles.TileMatterFabricator;
import techreborn.tiles.TilePlayerDectector;
import techreborn.tiles.TileQuantumChest;
import techreborn.tiles.TileQuantumTank;
import techreborn.tiles.TileRollingMachine;
import techreborn.tiles.TileThermalGenerator;
import techreborn.tiles.TileVacuumFreezer;
import techreborn.tiles.fusionReactor.TileEntityFusionController;
import techreborn.tiles.generator.TileDieselGenerator;
import techreborn.tiles.generator.TileDragonEggSiphoner;
@ -96,6 +171,9 @@ public class ModBlocks {
public static Block rubberSapling;
public static Block rubberPlanks;
public static Block ironFence;
public static Block ironFenceGate;
public static void init() {
thermalGenerator = new BlockThermalGenerator();
GameRegistry.registerBlock(thermalGenerator, "techreborn.thermalGenerator");
@ -298,6 +376,11 @@ public class ModBlocks {
rubberSapling = new BlockRubberSapling();
GameRegistry.registerBlock(rubberSapling, ItemBlockRubberSapling.class, "rubberSapling");
ironFence = new BlockIronFence();
GameRegistry.registerBlock(ironFence, "ironFence");
ironFenceGate = new BlockIronFenceGate();
GameRegistry.registerBlock(ironFenceGate, "ironFenceGate");
registerOreDict();
Core.logHelper.info("TechReborns Blocks Loaded");
@ -354,9 +437,15 @@ public class ModBlocks {
OreDictionary.registerOre("machineBasic", new ItemStack(machineframe, 1));
OreDictionary.registerOre("treeSapling", rubberSapling);
OreDictionary.registerOre("saplingRubber", rubberSapling);
OreDictionary.registerOre("logWood", new ItemStack(rubberLog, 1 , OreDictionary.WILDCARD_VALUE));
OreDictionary.registerOre("logRubber", new ItemStack(rubberLog, 1 , OreDictionary.WILDCARD_VALUE));
OreDictionary.registerOre("plankWood", new ItemStack(rubberPlanks, 1 , OreDictionary.WILDCARD_VALUE));
OreDictionary.registerOre("plankRubber", new ItemStack(rubberPlanks, 1 , OreDictionary.WILDCARD_VALUE));
OreDictionary.registerOre("treeLeaves", new ItemStack(rubberLeaves, 1 , OreDictionary.WILDCARD_VALUE));
OreDictionary.registerOre("leavesRubber", new ItemStack(rubberLeaves, 1 , OreDictionary.WILDCARD_VALUE));
OreDictionary.registerOre("fenceIron", ironFence);
}
}

View file

@ -1,12 +1,11 @@
package techreborn.proxies;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.ModelLoaderRegistry;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import reborncore.client.multiblock.MultiblockRenderEvent;
import techreborn.client.ClientMultiBlocks;
import techreborn.client.IconSupplier;
import techreborn.client.RegisterItemJsons;
import techreborn.client.StackToolTipEvent;
import techreborn.client.VersionCheckerClient;
import techreborn.client.hud.ChargeHud;
@ -19,6 +18,7 @@ public class ClientProxy extends CommonProxy {
@Override
public void init() {
super.init();
RegisterItemJsons.registerModels();
MinecraftForge.EVENT_BUS.register(new IconSupplier());
MinecraftForge.EVENT_BUS.register(new ChargeHud());
MinecraftForge.EVENT_BUS.register(new VersionCheckerClient());