diff --git a/src/main/java/techreborn/blocks/BlockRubberLeaves.java b/src/main/java/techreborn/blocks/BlockRubberLeaves.java index 86652fc82..fad2afebd 100644 --- a/src/main/java/techreborn/blocks/BlockRubberLeaves.java +++ b/src/main/java/techreborn/blocks/BlockRubberLeaves.java @@ -1,5 +1,6 @@ package techreborn.blocks; +import me.modmuss50.jsonDestroyer.api.IOpaqueBlock; import me.modmuss50.jsonDestroyer.api.ITexturedBlock; import net.minecraft.block.BlockLeaves; import net.minecraft.block.BlockPlanks; @@ -7,6 +8,7 @@ import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; @@ -16,13 +18,15 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.RebornCore; import techreborn.client.TechRebornCreativeTabMisc; +import techreborn.init.ModBlocks; import java.util.List; +import java.util.Random; /** * Created by mark on 20/02/2016. */ -public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock { +public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock, IOpaqueBlock { public BlockRubberLeaves() { super(); @@ -57,6 +61,13 @@ public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock { return Blocks.leaves.isOpaqueCube(); } + public boolean isFullCube() + { + return false; + } + + + @Override protected ItemStack createStackedBlock(IBlockState state) { @@ -118,4 +129,9 @@ public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock { { return 16777215; } + + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + return Item.getItemFromBlock(ModBlocks.rubberSapling); + } } diff --git a/src/main/java/techreborn/blocks/BlockRubberLog.java b/src/main/java/techreborn/blocks/BlockRubberLog.java index 49c862728..9f3cc0a97 100644 --- a/src/main/java/techreborn/blocks/BlockRubberLog.java +++ b/src/main/java/techreborn/blocks/BlockRubberLog.java @@ -156,10 +156,4 @@ public class BlockRubberLog extends Block implements ITexturedBlock { } return false; } - - @Override - public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) { - super.getSubBlocks(itemIn, tab, list); - list.add(new ItemStack(itemIn, 1, 5)); - } } diff --git a/src/main/java/techreborn/blocks/BlockRubberPlank.java b/src/main/java/techreborn/blocks/BlockRubberPlank.java new file mode 100644 index 000000000..ec89a3660 --- /dev/null +++ b/src/main/java/techreborn/blocks/BlockRubberPlank.java @@ -0,0 +1,34 @@ +package techreborn.blocks; + +import me.modmuss50.jsonDestroyer.api.ITexturedBlock; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumFacing; +import reborncore.RebornCore; +import techreborn.client.TechRebornCreativeTabMisc; + +/** + * Created by Mark on 20/02/2016. + */ +public class BlockRubberPlank extends Block implements ITexturedBlock { + + public BlockRubberPlank() { + super(Material.wood); + RebornCore.jsonDestroyer.registerObject(this); + setUnlocalizedName("techreborn.rubberplank"); + setCreativeTab(TechRebornCreativeTabMisc.instance); + this.setHardness(2.0F); + this.setStepSound(soundTypeWood); + } + + @Override + public String getTextureNameFromState(IBlockState state, EnumFacing side) { + return "techreborn:blocks/rubber_planks"; + } + + @Override + public int amountOfStates() { + return 1; + } +} diff --git a/src/main/java/techreborn/blocks/BlockRubberSapling.java b/src/main/java/techreborn/blocks/BlockRubberSapling.java index 6ece3440c..9251b3dfc 100644 --- a/src/main/java/techreborn/blocks/BlockRubberSapling.java +++ b/src/main/java/techreborn/blocks/BlockRubberSapling.java @@ -21,6 +21,7 @@ public class BlockRubberSapling extends BlockSapling { public BlockRubberSapling() { setUnlocalizedName("techreborn.rubbersapling"); setCreativeTab(TechRebornCreativeTabMisc.instance); + this.setDefaultState(this.blockState.getBaseState().withProperty(STAGE, Integer.valueOf(0))); } @Override diff --git a/src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java b/src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java index d09672b4d..df1d97216 100644 --- a/src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java @@ -32,9 +32,6 @@ public abstract class BaseRecipeWrapper extends BlankRecip } private static List expandOreDict(ItemStack itemStack) { - if(itemStack == null || itemStack.getItem() == null){ - return new ArrayList(); - } int[] oreIds = OreDictionary.getOreIDs(itemStack); if (oreIds.length == 0) { return Collections.singletonList(itemStack); diff --git a/src/main/java/techreborn/compat/minetweaker/MTGenerator.java b/src/main/java/techreborn/compat/minetweaker/MTGenerator.java new file mode 100644 index 000000000..717fb6f79 --- /dev/null +++ b/src/main/java/techreborn/compat/minetweaker/MTGenerator.java @@ -0,0 +1,13 @@ +package techreborn.compat.minetweaker; + +import minetweaker.api.liquid.ILiquidStack; +import reborncore.api.fuel.FluidPowerManager; +import stanhebben.zenscript.annotations.ZenClass; + +@ZenClass("mods.techreborn.generator") +public class MTGenerator { + public static void addFluidPower(ILiquidStack fluid, double value){ + FluidPowerManager.fluidPowerValues.put(MinetweakerCompat.toFluidStack(fluid).getFluid(), value); + } + +} diff --git a/src/main/java/techreborn/compat/minetweaker/MinetweakerCompat.java b/src/main/java/techreborn/compat/minetweaker/MinetweakerCompat.java index 341f936a7..ae260758c 100644 --- a/src/main/java/techreborn/compat/minetweaker/MinetweakerCompat.java +++ b/src/main/java/techreborn/compat/minetweaker/MinetweakerCompat.java @@ -44,6 +44,7 @@ public class MinetweakerCompat implements ICompatModule { MineTweakerAPI.registerClass(MTPlateCuttingMachine.class); MineTweakerAPI.registerClass(MTFusionReactor.class); MineTweakerAPI.registerClass(MTVacuumFreezer.class); + MineTweakerAPI.registerClass(MTGenerator.class); } @Override diff --git a/src/main/java/techreborn/init/ModBlocks.java b/src/main/java/techreborn/init/ModBlocks.java index b3b72cf33..bde7b89e7 100644 --- a/src/main/java/techreborn/init/ModBlocks.java +++ b/src/main/java/techreborn/init/ModBlocks.java @@ -90,9 +90,11 @@ public class ModBlocks { public static Block storage; public static Block storage2; public static Block machineframe; + public static Block rubberLog; public static Block rubberLeaves; public static Block rubberSapling; + public static Block rubberPlanks; public static void init() { thermalGenerator = new BlockThermalGenerator(); @@ -286,10 +288,16 @@ public class ModBlocks { rubberLog = new BlockRubberLog(); GameRegistry.registerBlock(rubberLog, "rubberLog"); + + rubberPlanks = new BlockRubberPlank(); + GameRegistry.registerBlock(rubberPlanks, "rubberPlanks"); + rubberLeaves = new BlockRubberLeaves(); GameRegistry.registerBlock(rubberLeaves, "rubberLeaves"); + rubberSapling = new BlockRubberSapling(); - GameRegistry.registerBlock(rubberSapling, "rubberSapling"); + GameRegistry.registerBlock(rubberSapling, ItemBlockRubberSapling.class, "rubberSapling"); + registerOreDict(); Core.logHelper.info("TechReborns Blocks Loaded"); diff --git a/src/main/java/techreborn/init/RecipeCompact.java b/src/main/java/techreborn/init/RecipeCompact.java index 0f09ff96a..5d035d666 100644 --- a/src/main/java/techreborn/init/RecipeCompact.java +++ b/src/main/java/techreborn/init/RecipeCompact.java @@ -23,7 +23,9 @@ public class RecipeCompact implements IRecipeCompact { ArrayList missingItems = new ArrayList<>(); - public RecipeCompact() { + boolean inited = false; + + public void init(){ recipes.put("industrialDiamond", new ItemStack(Items.diamond)); recipes.put("industrialTnt", new ItemStack(Blocks.tnt)); recipes.put("copperIngot", ItemIngots.getIngotByName("copper")); @@ -44,10 +46,15 @@ public class RecipeCompact implements IRecipeCompact { recipes.put("reBattery", new ItemStack(ModItems.reBattery)); recipes.put("machine", BlockMachineFrame.getFrameByName("machine", 1)); recipes.put("advancedMachine", BlockMachineFrame.getFrameByName("advancedMachine", 1)); + inited = false; } + @Override public ItemStack getItem(String name) { + if(!inited){ + init(); + } if(!recipes.containsKey(name)){ if(!missingItems.contains(name)){ missingItems.add(name); diff --git a/src/main/java/techreborn/itemblocks/ItemBlockRubberSapling.java b/src/main/java/techreborn/itemblocks/ItemBlockRubberSapling.java new file mode 100644 index 000000000..2f5f9672a --- /dev/null +++ b/src/main/java/techreborn/itemblocks/ItemBlockRubberSapling.java @@ -0,0 +1,30 @@ +package techreborn.itemblocks; + +import me.modmuss50.jsonDestroyer.api.ITexturedItem; +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import reborncore.RebornCore; +import techreborn.client.TechRebornCreativeTabMisc; + +/** + * Created by Mark on 20/02/2016. + */ +public class ItemBlockRubberSapling extends ItemBlock implements ITexturedItem { + + public ItemBlockRubberSapling(Block block) { + super(block); + setCreativeTab(TechRebornCreativeTabMisc.instance); + setUnlocalizedName("techreborn.uuMatter"); + RebornCore.jsonDestroyer.registerObject(this); + } + + @Override + public String getTextureName(int damage) { + return "techreborn:blocks/rubber_sapling"; + } + + @Override + public int getMaxMeta() { + return 1; + } +} diff --git a/src/main/java/techreborn/proxies/ClientProxy.java b/src/main/java/techreborn/proxies/ClientProxy.java index 5aa986a0a..b978b5c25 100644 --- a/src/main/java/techreborn/proxies/ClientProxy.java +++ b/src/main/java/techreborn/proxies/ClientProxy.java @@ -1,5 +1,7 @@ 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; diff --git a/src/main/resources/assets/techreborn/blockstates/rubberSapling.json b/src/main/resources/assets/techreborn/blockstates/rubberSapling.json index 0b7c95f87..dcac7cb32 100644 --- a/src/main/resources/assets/techreborn/blockstates/rubberSapling.json +++ b/src/main/resources/assets/techreborn/blockstates/rubberSapling.json @@ -1,9 +1,9 @@ { "variants": { - "stage=0": { + "stage=0,type=oak": { "model": "techreborn:rubberSapling" }, - "stage=1": { + "stage=1,type=oak": { "model": "techreborn:rubberSapling" } } diff --git a/src/main/resources/assets/techreborn/lang/en_US.lang b/src/main/resources/assets/techreborn/lang/en_US.lang index 377ee8ee4..2c112f894 100644 --- a/src/main/resources/assets/techreborn/lang/en_US.lang +++ b/src/main/resources/assets/techreborn/lang/en_US.lang @@ -62,6 +62,7 @@ tile.techreborn.machineFrame.machine.name=Machine Block #Blocks tile.techreborn.rubberlog.name=Rubber log tile.techreborn.rubberleaves.name=Rubber Leaves +tile.techreborn.rubbersapling.name=Rubber Sapling #Ores tile.techreborn.ore.Galena.name=Galena Ore diff --git a/src/main/resources/assets/techreborn/models/rubberSapling.json b/src/main/resources/assets/techreborn/models/block/rubberSapling.json similarity index 100% rename from src/main/resources/assets/techreborn/models/rubberSapling.json rename to src/main/resources/assets/techreborn/models/block/rubberSapling.json