Add some stuff, that does things

This commit is contained in:
modmuss50 2016-02-20 19:46:18 +00:00
parent 0ac86ff303
commit 1f59226e01
12 changed files with 102 additions and 13 deletions

View file

@ -7,6 +7,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,8 +17,10 @@ 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.
@ -57,6 +60,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 +128,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);
}
}

View file

@ -156,10 +156,4 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
}
return false;
}
@Override
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) {
super.getSubBlocks(itemIn, tab, list);
list.add(new ItemStack(itemIn, 1, 5));
}
}

View file

@ -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;
}
}

View file

@ -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

View file

@ -32,9 +32,6 @@ public abstract class BaseRecipeWrapper<T extends BaseRecipe> extends BlankRecip
}
private static List<ItemStack> expandOreDict(ItemStack itemStack) {
if(itemStack == null || itemStack.getItem() == null){
return new ArrayList<ItemStack>();
}
int[] oreIds = OreDictionary.getOreIDs(itemStack);
if (oreIds.length == 0) {
return Collections.singletonList(itemStack);

View file

@ -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");

View file

@ -23,7 +23,9 @@ public class RecipeCompact implements IRecipeCompact {
ArrayList<String> 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);

View file

@ -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;
}
}

View file

@ -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;

View file

@ -1,9 +1,9 @@
{
"variants": {
"stage=0": {
"stage=0,type=oak": {
"model": "techreborn:rubberSapling"
},
"stage=1": {
"stage=1,type=oak": {
"model": "techreborn:rubberSapling"
}
}

View file

@ -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