Fix random world gen crash - Fix electric furnace and version bump

This commit is contained in:
modmuss50 2016-06-04 17:03:22 +01:00
parent 207d42d81b
commit d80280b110
4 changed files with 10 additions and 15 deletions

View file

@ -60,7 +60,7 @@ configurations {
}
version = "1.3.0"
version = "1.3.1"
def ENV = System.getenv()
if (ENV.BUILD_NUMBER) {

View file

@ -15,7 +15,7 @@ import techreborn.init.ModBlocks;
public class TileGenerator extends TilePowerAcceptor implements IWrenchable,IInventoryProvider
{
public static int outputAmount = 5; // This is in line with BC engines rf,
public static int outputAmount = 10; // This is in line with BC engines rf,
public Inventory inventory = new Inventory(2, "TileGenerator", 64, this);
public int fuelSlot = 0;
public int burnTime;
@ -33,7 +33,7 @@ public class TileGenerator extends TilePowerAcceptor implements IWrenchable,IInv
public static int getItemBurnTime(ItemStack stack)
{
return TileEntityFurnace.getItemBurnTime(stack) / 2;
return TileEntityFurnace.getItemBurnTime(stack) / 4;
}
@Override

View file

@ -21,7 +21,7 @@ public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchabl
public int capacity = 1000;
public int progress;
public int fuelScale = 100;
public int cost = 10;
public int cost = 8;
int input1 = 0;
int output = 1;
private static final int[] SLOTS_TOP = new int[] {0};
@ -43,18 +43,14 @@ public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchabl
{
boolean burning = isBurning();
boolean updateInventory = false;
if (getEnergy() <= cost && canSmelt())
{
if (getEnergy() > cost)
{
updateInventory = true;
}
}
if (isBurning() && canSmelt())
{
updateState();
progress++;
if(progress % 10 == 0){
useEnergy(cost);
}
if (progress >= fuelScale)
{
progress = 0;
@ -84,20 +80,16 @@ public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchabl
if (getStackInSlot(output) == null)
{
useEnergy(cost);
setInventorySlotContents(output, itemstack.copy());
} else if (getStackInSlot(output).isItemEqual(itemstack))
{
useEnergy(cost);
getStackInSlot(output).stackSize += itemstack.stackSize;
}
if (getStackInSlot(input1).stackSize > 1)
{
useEnergy(cost);
this.decrStackSize(input1, 1);
} else
{
useEnergy(cost);
setInventorySlotContents(input1, null);
}
}

View file

@ -259,6 +259,9 @@ public class TechRebornWorldGen implements IWorldGenerator
{
return;
}
if(chance <0){
chance = 0;
}
if (random.nextInt(chance) == 0)
{
int x = (chunkX * 16) + random.nextInt(15);