Fixes #556 and fixes #550

This commit is contained in:
modmuss50 2016-05-08 09:34:52 +01:00
parent 140b03960e
commit e71953dc2a
2 changed files with 13 additions and 62 deletions

View file

@ -7,6 +7,9 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.*; import net.minecraft.item.*;
import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.registry.GameRegistry;
import reborncore.api.tile.IInventoryProvider; import reborncore.api.tile.IInventoryProvider;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
@ -27,60 +30,6 @@ public class TileIronFurnace extends TileMachineBase implements IInventoryProvid
int fuelslot = 2; int fuelslot = 2;
boolean active = false; boolean active = false;
public static int getItemBurnTime(ItemStack stack)
{
if (stack == null)
{
return 0;
} else
{
Item item = stack.getItem();
if (stack.getItem() instanceof ItemBlock && Block.getBlockFromItem(item) != null)
{
Block block = Block.getBlockFromItem(item);
if (block == Blocks.WOODEN_SLAB)
{
return 150;
}
if (block == Blocks.LOG)
{
return 1200;
}
if (block.getMaterial(block.getDefaultState()) == Material.WOOD)
{
return 300;
}
if (block == Blocks.COAL_BLOCK)
{
return 16000;
}
}
if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD"))
return 200;
if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD"))
return 200;
if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD"))
return 200;
if (item == Items.STICK)
return 100;
if (item == Items.COAL)
return 1600;
if (item == Items.LAVA_BUCKET)
return 20000;
if (item == new ItemStack(Blocks.SAPLING).getItem())
return 100;
if (item == Items.BLAZE_ROD)
return 2400;
return GameRegistry.getFuelValue(stack);
}
}
public int gaugeProgressScaled(int scale) public int gaugeProgressScaled(int scale)
{ {
return (progress * scale) / fuelScale; return (progress * scale) / fuelScale;
@ -111,7 +60,7 @@ public class TileIronFurnace extends TileMachineBase implements IInventoryProvid
} }
if (fuel <= 0 && canSmelt()) if (fuel <= 0 && canSmelt())
{ {
fuel = fuelGague = getItemBurnTime(getStackInSlot(fuelslot)); fuel = fuelGague = (int) (TileEntityFurnace.getItemBurnTime(getStackInSlot(fuelslot)) * 1.25);
if (fuel > 0) if (fuel > 0)
{ {
if (getStackInSlot(fuelslot).getItem().hasContainerItem()) // Fuel if (getStackInSlot(fuelslot).getItem().hasContainerItem()) // Fuel

View file

@ -213,13 +213,15 @@ public class TechRebornWorldGen implements IWorldGenerator
for (OreConfig ore : list) for (OreConfig ore : list)
{ {
WorldGenMinable worldGenMinable = new WorldGenMinable(ore.state, ore.veinSize); WorldGenMinable worldGenMinable = new WorldGenMinable(ore.state, ore.veinSize);
for (int i = 0; i < ore.veinsPerChunk; i++) if(ore.state != null){
{ for (int i = 0; i < ore.veinsPerChunk; i++)
xPos = chunkX * 16 + random.nextInt(16); {
yPos = 10 + random.nextInt(ore.maxYHeight - ore.minYHeight); xPos = chunkX * 16 + random.nextInt(16);
zPos = chunkZ * 16 + random.nextInt(16); yPos = 10 + random.nextInt(ore.maxYHeight - ore.minYHeight);
BlockPos pos = new BlockPos(xPos, yPos, zPos); zPos = chunkZ * 16 + random.nextInt(16);
worldGenMinable.generate(world, random, pos); BlockPos pos = new BlockPos(xPos, yPos, zPos);
worldGenMinable.generate(world, random, pos);
}
} }
} }
} }