mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
1.0.20 I
This commit is contained in:
parent
380c863ef3
commit
f082076960
@ -17,6 +17,7 @@ public class TileEntityCoreAdvanced extends TileEntity implements ISidedInventor
|
||||
|
||||
public int progress = 0;
|
||||
public int power = 0;
|
||||
public int soundCycle = 0;
|
||||
public final static int processTime = 100;
|
||||
public final static int maxPower = ModItems.factory_core_advanced.getMaxDamage();
|
||||
private ItemStack slots[];
|
||||
@ -369,6 +370,12 @@ public class TileEntityCoreAdvanced extends TileEntity implements ISidedInventor
|
||||
{
|
||||
this.progress += 1;
|
||||
this.slots[22].setItemDamage(this.slots[22].getItemDamage() + 1);
|
||||
if(soundCycle == 0)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "minecart.base", 1.0F, 0.75F);
|
||||
soundCycle++;
|
||||
|
||||
if(soundCycle >= 50)
|
||||
soundCycle = 0;
|
||||
} else {
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
@ -18,6 +18,7 @@ public class TileEntityCoreTitanium extends TileEntity implements ISidedInventor
|
||||
|
||||
public int progress = 0;
|
||||
public int power = 0;
|
||||
public int soundCycle = 0;
|
||||
public final static int processTime = 200;
|
||||
public final static int maxPower = ModItems.factory_core_titanium.getMaxDamage();
|
||||
private ItemStack slots[];
|
||||
@ -304,6 +305,12 @@ public class TileEntityCoreTitanium extends TileEntity implements ISidedInventor
|
||||
{
|
||||
this.progress += 1;
|
||||
this.slots[22].setItemDamage(this.slots[22].getItemDamage() + 1);
|
||||
if(soundCycle == 0)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "minecart.base", 1.0F, 0.75F);
|
||||
soundCycle++;
|
||||
|
||||
if(soundCycle >= 50)
|
||||
soundCycle = 0;
|
||||
} else {
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
@ -23,9 +23,9 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
|
||||
public static final int processingSpeed = 100;
|
||||
public boolean runsOnRtg = false;
|
||||
|
||||
private static final int[] slots_top = new int[] {0, 1};
|
||||
private static final int[] slots_top = new int[] {0};
|
||||
private static final int[] slots_bottom = new int[] {3};
|
||||
private static final int[] slots_side = new int[] {2};
|
||||
private static final int[] slots_side = new int[] {1};
|
||||
|
||||
private String customName;
|
||||
|
||||
@ -101,7 +101,12 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
return i == 2 ? false : (i == 1 ? hasItemPower(itemStack) : true);
|
||||
if(i == 3)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasItemPower(ItemStack itemStack) {
|
||||
@ -205,7 +210,7 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory {
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getDiFurnaceProgressScaled(int i) {
|
||||
|
||||
@ -20,13 +20,14 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
|
||||
|
||||
public int dualCookTime;
|
||||
public int dualPower;
|
||||
public int soundCycle = 0;
|
||||
public static final int maxPower = 100000;
|
||||
public static final int processingSpeed = 500;
|
||||
public boolean runsOnRtg = false;
|
||||
|
||||
private static final int[] slots_top = new int[] {0, 1};
|
||||
private static final int[] slots_bottom = new int[] {3};
|
||||
private static final int[] slots_side = new int[] {2};
|
||||
private static final int[] slots_top = new int[] {0};
|
||||
private static final int[] slots_bottom = new int[] {2, 3, 4, 5};
|
||||
private static final int[] slots_side = new int[] {1};
|
||||
|
||||
private String customName;
|
||||
|
||||
@ -102,7 +103,17 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
return i == 2 ? false : (i == 1 ? hasItemPower(itemStack) : true);
|
||||
if(i == 2 || i == 3 || i == 4 || i == 5)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(i == 1 && hasItemPower(itemStack))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasItemPower(ItemStack itemStack) {
|
||||
@ -219,6 +230,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
|
||||
|
||||
|
||||
public boolean canProcess() {
|
||||
|
||||
if(slots[0] == null)
|
||||
{
|
||||
return false;
|
||||
@ -354,19 +366,6 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
|
||||
this.runsOnRtg = true;
|
||||
}
|
||||
|
||||
if(hasPower() && canProcess())
|
||||
{
|
||||
dualCookTime++;
|
||||
|
||||
if(this.dualCookTime >= TileEntityMachineCentrifuge.processingSpeed)
|
||||
{
|
||||
this.dualCookTime = 0;
|
||||
this.processItem();
|
||||
}
|
||||
}else{
|
||||
dualCookTime = 0;
|
||||
}
|
||||
|
||||
boolean trigger = true;
|
||||
|
||||
if(hasPower() && canProcess() && this.dualCookTime == 0)
|
||||
@ -380,6 +379,25 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
|
||||
}
|
||||
}
|
||||
|
||||
if(hasPower() && canProcess())
|
||||
{
|
||||
dualCookTime++;
|
||||
if(soundCycle == 0)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "minecart.base", 1.0F, 1.5F);
|
||||
soundCycle++;
|
||||
|
||||
if(soundCycle >= 25)
|
||||
soundCycle = 0;
|
||||
|
||||
if(this.dualCookTime >= TileEntityMachineCentrifuge.processingSpeed)
|
||||
{
|
||||
this.dualCookTime = 0;
|
||||
this.processItem();
|
||||
}
|
||||
}else{
|
||||
dualCookTime = 0;
|
||||
}
|
||||
|
||||
if(flag1)
|
||||
{
|
||||
this.markDirty();
|
||||
|
||||
@ -18,6 +18,7 @@ import com.hbm.calc.UnionOfTileEntitiesAndBooleans;
|
||||
import com.hbm.interfaces.IConductor;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.items.ItemBattery;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
@ -34,8 +35,8 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
|
||||
public List<IConsumer> list = new ArrayList();
|
||||
|
||||
private static final int[] slots_top = new int[] {1};
|
||||
private static final int[] slots_bottom = new int[] {2};
|
||||
private static final int[] slots_side = new int[] {0};
|
||||
private static final int[] slots_bottom = new int[] {0, 2};
|
||||
private static final int[] slots_side = new int[] {0, 2};
|
||||
|
||||
private String customName;
|
||||
|
||||
@ -110,8 +111,18 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
return true;
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
if(i == 0)
|
||||
if(stack.getItem() == ModItems.rod_water || stack.getItem() == ModItems.rod_dual_water || stack.getItem() == ModItems.rod_quad_water || stack.getItem() == Items.water_bucket)
|
||||
return true;
|
||||
if(i == 2)
|
||||
if(stack.getItem() instanceof ItemBattery)
|
||||
return true;
|
||||
if(i == 1)
|
||||
if(stack.getItem() == Items.coal || stack.getItem() == Item.getItemFromBlock(Blocks.coal_block))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -189,7 +200,14 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
|
||||
if(i == 0)
|
||||
if(itemStack.getItem() == Items.bucket || itemStack.getItem() == ModItems.rod_empty || itemStack.getItem() == ModItems.rod_dual_empty || itemStack.getItem() == ModItems.rod_quad_empty)
|
||||
return true;
|
||||
if(i == 2)
|
||||
if(itemStack.getItemDamage() == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getWaterScaled(int i) {
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks;
|
||||
|
||||
import com.hbm.interfaces.IConductor;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.items.ItemBattery;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -25,7 +26,7 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
|
||||
public static final int processSpeed = 200;
|
||||
|
||||
private static final int[] slots_top = new int[] {3};
|
||||
private static final int[] slots_bottom = new int[] {4};
|
||||
private static final int[] slots_bottom = new int[] {4, 0, 1};
|
||||
private static final int[] slots_side = new int[] {0, 1, 2};
|
||||
|
||||
private String customName;
|
||||
@ -100,7 +101,27 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
switch(i)
|
||||
{
|
||||
case 0:
|
||||
if(stack.getItem() instanceof ItemBattery)
|
||||
return true;
|
||||
break;
|
||||
case 1:
|
||||
if(stack.getItem() == ModItems.rod_water || stack.getItem() == ModItems.rod_dual_water || stack.getItem() == ModItems.rod_quad_water || stack.getItem() == Items.water_bucket)
|
||||
return true;
|
||||
break;
|
||||
case 2:
|
||||
if(stack.getItem() == ModItems.sulfur)
|
||||
return true;
|
||||
break;
|
||||
case 3:
|
||||
if(stack.getItem() == ModItems.cell_empty)
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -183,7 +204,16 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
|
||||
if(i == 4)
|
||||
return true;
|
||||
if(i == 0 && itemStack.getItem() instanceof ItemBattery)
|
||||
if(itemStack.getItemDamage() == itemStack.getMaxDamage())
|
||||
return true;
|
||||
if(i == 1)
|
||||
if(itemStack.getItem() == Items.bucket || itemStack.getItem() == ModItems.rod_empty || itemStack.getItem() == ModItems.rod_dual_empty || itemStack.getItem() == ModItems.rod_quad_empty)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getPowerScaled(int i) {
|
||||
@ -244,105 +274,94 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(slots[2] != null && slots[2].getItem() == ModItems.sulfur && sulfur + 125 <= maxFill)
|
||||
{
|
||||
sulfur += 125;
|
||||
slots[2].stackSize--;
|
||||
if(slots[2].stackSize == 0)
|
||||
{
|
||||
slots[2] = null;
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
if (slots[2] != null && slots[2].getItem() == ModItems.sulfur && sulfur + 125 <= maxFill) {
|
||||
sulfur += 125;
|
||||
slots[2].stackSize--;
|
||||
if (slots[2].stackSize == 0) {
|
||||
slots[2] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(slots[2] != null && slots[2].getItem() == ModItems.inf_sulfur)
|
||||
{
|
||||
sulfur = maxFill;
|
||||
}
|
||||
|
||||
if(slots[1] != null && slots[1].getItem() == Items.water_bucket && water + 250 <= maxFill)
|
||||
{
|
||||
water += 250;
|
||||
slots[1].stackSize--;
|
||||
if(slots[1].stackSize == 0)
|
||||
{
|
||||
this.slots[1] = this.slots[1].getItem().getContainerItem(this.slots[1]);
|
||||
if (slots[2] != null && slots[2].getItem() == ModItems.inf_sulfur) {
|
||||
sulfur = maxFill;
|
||||
}
|
||||
}
|
||||
|
||||
if(slots[1] != null && slots[1].getItem() == ModItems.rod_water && water + 250 <= maxFill)
|
||||
{
|
||||
water += 250;
|
||||
slots[1].stackSize--;
|
||||
if(slots[1].stackSize == 0)
|
||||
{
|
||||
this.slots[1] = this.slots[1].getItem().getContainerItem(this.slots[1]);
|
||||
|
||||
if (slots[1] != null && slots[1].getItem() == Items.water_bucket && water + 250 <= maxFill) {
|
||||
water += 250;
|
||||
slots[1].stackSize--;
|
||||
if (slots[1].stackSize == 0) {
|
||||
this.slots[1] = this.slots[1].getItem().getContainerItem(this.slots[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(slots[1] != null && slots[1].getItem() == ModItems.rod_dual_water && water + 500 <= maxFill)
|
||||
{
|
||||
water += 500;
|
||||
slots[1].stackSize--;
|
||||
if(slots[1].stackSize == 0)
|
||||
{
|
||||
this.slots[1] = this.slots[1].getItem().getContainerItem(this.slots[1]);
|
||||
|
||||
if (slots[1] != null && slots[1].getItem() == ModItems.rod_water && water + 250 <= maxFill) {
|
||||
water += 250;
|
||||
slots[1].stackSize--;
|
||||
if (slots[1].stackSize == 0) {
|
||||
this.slots[1] = this.slots[1].getItem().getContainerItem(this.slots[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(slots[1] != null && slots[1].getItem() == ModItems.rod_quad_water && water + 1000 <= maxFill)
|
||||
{
|
||||
water += 1000;
|
||||
slots[1].stackSize--;
|
||||
if(slots[1].stackSize == 0)
|
||||
{
|
||||
this.slots[1] = this.slots[1].getItem().getContainerItem(this.slots[1]);
|
||||
|
||||
if (slots[1] != null && slots[1].getItem() == ModItems.rod_dual_water && water + 500 <= maxFill) {
|
||||
water += 500;
|
||||
slots[1].stackSize--;
|
||||
if (slots[1].stackSize == 0) {
|
||||
this.slots[1] = this.slots[1].getItem().getContainerItem(this.slots[1]);
|
||||
}
|
||||
}
|
||||
|
||||
if (slots[1] != null && slots[1].getItem() == ModItems.rod_quad_water && water + 1000 <= maxFill) {
|
||||
water += 1000;
|
||||
slots[1].stackSize--;
|
||||
if (slots[1].stackSize == 0) {
|
||||
this.slots[1] = this.slots[1].getItem().getContainerItem(this.slots[1]);
|
||||
}
|
||||
}
|
||||
|
||||
if (slots[1] != null && slots[1].getItem() == ModItems.inf_water) {
|
||||
water = maxFill;
|
||||
}
|
||||
|
||||
if (/* power + 100 <= maxPower && */slots[0] != null && slots[0].getItem() == ModItems.battery_creative) {
|
||||
power = maxPower;
|
||||
}
|
||||
|
||||
if (power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.battery_generic
|
||||
&& slots[0].getItemDamage() < 50) {
|
||||
power += 100;
|
||||
slots[0].setItemDamage(slots[0].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if (power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.battery_advanced
|
||||
&& slots[0].getItemDamage() < 200) {
|
||||
power += 100;
|
||||
slots[0].setItemDamage(slots[0].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if (power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.battery_schrabidium
|
||||
&& slots[0].getItemDamage() < 1000) {
|
||||
power += 100;
|
||||
slots[0].setItemDamage(slots[0].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if (power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.fusion_core
|
||||
&& slots[0].getItemDamage() < 5000) {
|
||||
power += 100;
|
||||
slots[0].setItemDamage(slots[0].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if (power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.energy_core
|
||||
&& slots[0].getItemDamage() < 5000) {
|
||||
power += 100;
|
||||
slots[0].setItemDamage(slots[0].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if (canProcess()) {
|
||||
process();
|
||||
} else {
|
||||
process = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(slots[1] != null && slots[1].getItem() == ModItems.inf_water)
|
||||
{
|
||||
water = maxFill;
|
||||
}
|
||||
|
||||
if(/*power + 100 <= maxPower && */slots[0] != null && slots[0].getItem() == ModItems.battery_creative)
|
||||
{
|
||||
power = maxPower;
|
||||
}
|
||||
|
||||
if(power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.battery_generic && slots[0].getItemDamage() < 50)
|
||||
{
|
||||
power += 100;
|
||||
slots[0].setItemDamage(slots[0].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if(power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.battery_advanced && slots[0].getItemDamage() < 200)
|
||||
{
|
||||
power += 100;
|
||||
slots[0].setItemDamage(slots[0].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if(power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.battery_schrabidium && slots[0].getItemDamage() < 1000)
|
||||
{
|
||||
power += 100;
|
||||
slots[0].setItemDamage(slots[0].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if(power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.fusion_core && slots[0].getItemDamage() < 5000)
|
||||
{
|
||||
power += 100;
|
||||
slots[0].setItemDamage(slots[0].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if(power + 100 <= maxPower && slots[0] != null && slots[0].getItem() == ModItems.energy_core && slots[0].getItemDamage() < 5000)
|
||||
{
|
||||
power += 100;
|
||||
slots[0].setItemDamage(slots[0].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if(canProcess())
|
||||
{
|
||||
process();
|
||||
} else {
|
||||
process = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks;
|
||||
|
||||
import com.hbm.interfaces.IConductor;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.items.ItemBattery;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -23,7 +24,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
|
||||
public static final int processingSpeed = 100;
|
||||
|
||||
private static final int[] slots_top = new int[] {1};
|
||||
private static final int[] slots_bottom = new int[] {2};
|
||||
private static final int[] slots_bottom = new int[] {2, 0};
|
||||
private static final int[] slots_side = new int[] {0};
|
||||
|
||||
private String customName;
|
||||
@ -100,7 +101,14 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
return true;
|
||||
if(i == 0)
|
||||
if(itemStack.getItem() instanceof ItemBattery)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -178,7 +186,13 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
|
||||
if(i == 0)
|
||||
if(itemStack.getItemDamage() == itemStack.getMaxDamage())
|
||||
return true;
|
||||
if(i == 2)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getDiFurnaceProgressScaled(int i) {
|
||||
|
||||
@ -9,6 +9,7 @@ import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.interfaces.IConductor;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.items.ItemBattery;
|
||||
import com.hbm.items.ItemFuelRod;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
@ -39,9 +40,9 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
|
||||
public int age = 0;
|
||||
public List<IConsumer> list = new ArrayList();
|
||||
|
||||
private static final int[] slots_top = new int[] {};
|
||||
private static final int[] slots_top = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8};
|
||||
private static final int[] slots_bottom = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
|
||||
private static final int[] slots_side = new int[] {};
|
||||
private static final int[] slots_side = new int[] {9, 10, 11};
|
||||
|
||||
private String customName;
|
||||
|
||||
@ -117,7 +118,27 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
return true;
|
||||
if(i == 0 ||
|
||||
i == 1 ||
|
||||
i == 2 ||
|
||||
i == 3 ||
|
||||
i == 4 ||
|
||||
i == 5 ||
|
||||
i == 6 ||
|
||||
i == 7 ||
|
||||
i == 8)
|
||||
if(itemStack.getItem() instanceof ItemFuelRod)
|
||||
return true;
|
||||
if(i == 9)
|
||||
if(itemStack.getItem() == ModItems.rod_water || itemStack.getItem() == ModItems.rod_dual_water || itemStack.getItem() == ModItems.rod_quad_water || itemStack.getItem() == Items.water_bucket)
|
||||
return true;
|
||||
if(i == 10)
|
||||
if(itemStack.getItem() == ModItems.rod_coolant || itemStack.getItem() == ModItems.rod_dual_coolant || itemStack.getItem() == ModItems.rod_quad_coolant)
|
||||
return true;
|
||||
if(i == 11)
|
||||
if(itemStack.getItem() instanceof ItemBattery)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -199,8 +220,36 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
//return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
|
||||
return true;
|
||||
if(i == 0 ||
|
||||
i == 1 ||
|
||||
i == 2 ||
|
||||
i == 3 ||
|
||||
i == 4 ||
|
||||
i == 5 ||
|
||||
i == 6 ||
|
||||
i == 7 ||
|
||||
i == 8)
|
||||
if(itemStack.getItem() == ModItems.rod_uranium_fuel_depleted ||
|
||||
itemStack.getItem() == ModItems.rod_dual_uranium_fuel_depleted ||
|
||||
itemStack.getItem() == ModItems.rod_quad_uranium_fuel_depleted ||
|
||||
itemStack.getItem() == ModItems.rod_plutonium_fuel_depleted ||
|
||||
itemStack.getItem() == ModItems.rod_dual_plutonium_fuel_depleted ||
|
||||
itemStack.getItem() == ModItems.rod_quad_plutonium_fuel_depleted ||
|
||||
itemStack.getItem() == ModItems.rod_mox_fuel_depleted ||
|
||||
itemStack.getItem() == ModItems.rod_dual_mox_fuel_depleted ||
|
||||
itemStack.getItem() == ModItems.rod_quad_mox_fuel_depleted ||
|
||||
itemStack.getItem() == ModItems.rod_schrabidium_fuel_depleted ||
|
||||
itemStack.getItem() == ModItems.rod_dual_schrabidium_fuel_depleted ||
|
||||
itemStack.getItem() == ModItems.rod_quad_schrabidium_fuel_depleted)
|
||||
return true;
|
||||
if(i == 9 || i == 10)
|
||||
if(itemStack.getItem() == Items.bucket || itemStack.getItem() == ModItems.rod_empty || itemStack.getItem() == ModItems.rod_dual_empty || itemStack.getItem() == ModItems.rod_quad_empty)
|
||||
return true;
|
||||
if(i == 11)
|
||||
if(itemStack.getItemDamage() == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getWaterScaled(int i) {
|
||||
|
||||
@ -94,7 +94,12 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
if(i == 0 && stack.getItem() == ModItems.cell_puf6)
|
||||
return true;
|
||||
if(i == 2 && stack.getItem() == ModItems.cell_empty)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -171,7 +176,7 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getFillStateScaled(int i) {
|
||||
|
||||
@ -23,7 +23,7 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
|
||||
public boolean runsOnRtg = false;
|
||||
|
||||
private static final int[] slots_top = new int[] {1};
|
||||
private static final int[] slots_bottom = new int[] {2};
|
||||
private static final int[] slots_bottom = new int[] {2, 0};
|
||||
private static final int[] slots_side = new int[] {0};
|
||||
|
||||
private String customName;
|
||||
@ -217,7 +217,17 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
|
||||
if(i == 0)
|
||||
{
|
||||
if(itemStack.getItem() == ModItems.rod_empty || itemStack.getItem() == ModItems.rod_dual_empty || itemStack.getItem() == ModItems.rod_quad_empty)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getDiFurnaceProgressScaled(int i) {
|
||||
|
||||
@ -3,10 +3,10 @@ package com.hbm.blocks;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.items.ItemBattery;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@ -16,19 +16,20 @@ import net.minecraft.tileentity.TileEntity;
|
||||
public class TileEntityMachineSchrabidiumTransmutator extends TileEntity implements ISidedInventory, IConsumer {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
public int power = 0;
|
||||
public int process = 0;
|
||||
public int soundCycle = 0;
|
||||
public static final int maxPower = 500000000;
|
||||
public static final int processSpeed = 60;
|
||||
Random rand = new Random();
|
||||
|
||||
private static final int[] slots_top = new int[] {0};
|
||||
private static final int[] slots_bottom = new int[] {1};
|
||||
private static final int[] slots_side = new int[] {3};
|
||||
|
||||
private static final int[] slots_top = new int[] { 0 };
|
||||
private static final int[] slots_bottom = new int[] { 1, 2 };
|
||||
private static final int[] slots_side = new int[] { 3, 2 };
|
||||
|
||||
private String customName;
|
||||
|
||||
|
||||
public TileEntityMachineSchrabidiumTransmutator() {
|
||||
slots = new ItemStack[4];
|
||||
}
|
||||
@ -45,21 +46,19 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if (slots[i] != null) {
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
} else {
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemStack) {
|
||||
slots[i] = itemStack;
|
||||
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit())
|
||||
{
|
||||
if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) {
|
||||
itemStack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
@ -73,7 +72,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
public boolean hasCustomInventoryName() {
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
}
|
||||
|
||||
|
||||
public void setCustomName(String name) {
|
||||
this.customName = name;
|
||||
}
|
||||
@ -85,91 +84,99 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this)
|
||||
{
|
||||
if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
|
||||
return false;
|
||||
}else{
|
||||
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
|
||||
} else {
|
||||
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
|
||||
public void openInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
if (stack.getItem() == ModItems.ingot_uranium)
|
||||
return true;
|
||||
break;
|
||||
case 2:
|
||||
if (stack.getItem() == ModItems.redcoil_capacitor)
|
||||
return true;
|
||||
break;
|
||||
case 3:
|
||||
if (stack.getItem() instanceof ItemBattery)
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if(slots[i].stackSize <= j)
|
||||
{
|
||||
if (slots[i] != null) {
|
||||
if (slots[i].stackSize <= j) {
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
}
|
||||
ItemStack itemStack1 = slots[i].splitStack(j);
|
||||
if (slots[i].stackSize == 0)
|
||||
{
|
||||
if (slots[i].stackSize == 0) {
|
||||
slots[i] = null;
|
||||
}
|
||||
|
||||
|
||||
return itemStack1;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
|
||||
|
||||
power = nbt.getShort("power") * 50000;
|
||||
process = nbt.getShort("process");
|
||||
slots = new ItemStack[getSizeInventory()];
|
||||
|
||||
for(int i = 0; i < list.tagCount(); i++)
|
||||
{
|
||||
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
|
||||
byte b0 = nbt1.getByte("slot");
|
||||
if(b0 >= 0 && b0 < slots.length)
|
||||
{
|
||||
if (b0 >= 0 && b0 < slots.length) {
|
||||
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setShort("power", (short) (power/50000));
|
||||
nbt.setShort("power", (short) (power / 50000));
|
||||
nbt.setShort("process", (short) process);
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
for(int i = 0; i < slots.length; i++)
|
||||
{
|
||||
if(slots[i] != null)
|
||||
{
|
||||
|
||||
for (int i = 0; i < slots.length; i++) {
|
||||
if (slots[i] != null) {
|
||||
NBTTagCompound nbt1 = new NBTTagCompound();
|
||||
nbt1.setByte("slot", (byte)i);
|
||||
nbt1.setByte("slot", (byte) i);
|
||||
slots[i].writeToNBT(nbt1);
|
||||
list.appendTag(nbt1);
|
||||
}
|
||||
}
|
||||
nbt.setTag("items", list);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_)
|
||||
{
|
||||
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
|
||||
}
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
@ -177,120 +184,144 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
|
||||
public boolean canExtractItem(int i, ItemStack stack, int j) {
|
||||
if (i == 2 && stack.getItem() != null && stack.getItem() == ModItems.redcoil_capacitor
|
||||
&& stack.getItemDamage() == stack.getMaxDamage()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (i == 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (i == 3 && stack.getItemDamage() == stack.getMaxDamage()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public int getPowerScaled(int i) {
|
||||
int p = (int)(power / 50000);
|
||||
int m = (int)(maxPower / 50000);
|
||||
int p = (int) (power / 50000);
|
||||
int m = (int) (maxPower / 50000);
|
||||
int r = (p * i) / m;
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
public int getProgressScaled(int i) {
|
||||
return (process * i) / processSpeed;
|
||||
}
|
||||
|
||||
|
||||
public boolean canProcess() {
|
||||
if(power >= 499000000 && slots[0] != null && slots[0].getItem() == ModItems.ingot_uranium &&
|
||||
slots[2] != null && slots[2].getItem() == ModItems.redcoil_capacitor &&
|
||||
slots[2].getItemDamage() < slots[2].getMaxDamage() &&
|
||||
(slots[1] == null || (slots[1] != null && slots[1].getItem() == ModItems.ingot_schrabidium && slots[1].stackSize < slots[1].getMaxStackSize())))
|
||||
{
|
||||
if (power >= 499000000 && slots[0] != null && slots[0].getItem() == ModItems.ingot_uranium && slots[2] != null
|
||||
&& slots[2].getItem() == ModItems.redcoil_capacitor
|
||||
&& slots[2].getItemDamage() < slots[2].getMaxDamage()
|
||||
&& (slots[1] == null || (slots[1] != null && slots[1].getItem() == ModItems.ingot_schrabidium
|
||||
&& slots[1].stackSize < slots[1].getMaxStackSize()))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public boolean isProcessing() {
|
||||
return process > 0;
|
||||
}
|
||||
|
||||
|
||||
public void process() {
|
||||
process++;
|
||||
|
||||
if(process >= processSpeed) {
|
||||
|
||||
|
||||
if (isProcessing()) {
|
||||
if (soundCycle == 0)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "minecart.base", 1.0F, 1.0F);
|
||||
soundCycle++;
|
||||
|
||||
if (soundCycle >= 38)
|
||||
soundCycle = 0;
|
||||
}
|
||||
|
||||
if (process >= processSpeed) {
|
||||
|
||||
power = 0;
|
||||
process = 0;
|
||||
|
||||
|
||||
slots[0].stackSize--;
|
||||
if(slots[0].stackSize <= 0)
|
||||
{
|
||||
if (slots[0].stackSize <= 0) {
|
||||
slots[0] = null;
|
||||
}
|
||||
|
||||
if(slots[1] == null)
|
||||
{
|
||||
|
||||
if (slots[1] == null) {
|
||||
slots[1] = new ItemStack(ModItems.ingot_schrabidium);
|
||||
} else {
|
||||
slots[1].stackSize++;
|
||||
}
|
||||
if(slots[2] != null) {
|
||||
if (slots[2] != null) {
|
||||
slots[2].setItemDamage(slots[2].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "ambient.weather.thunder", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F);
|
||||
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "ambient.weather.thunder", 10000.0F,
|
||||
0.8F + this.rand.nextFloat() * 0.2F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(slots[3] != null && slots[3].getItem() == ModItems.battery_creative)
|
||||
{
|
||||
power = maxPower;
|
||||
}
|
||||
|
||||
if(power + 100 <= maxPower && slots[3] != null && slots[3].getItem() == ModItems.battery_generic && slots[3].getItemDamage() < 50)
|
||||
{
|
||||
power += 100;
|
||||
slots[3].setItemDamage(slots[3].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if(power + 100 <= maxPower && slots[3] != null && slots[3].getItem() == ModItems.battery_advanced && slots[3].getItemDamage() < 200)
|
||||
{
|
||||
power += 100;
|
||||
slots[3].setItemDamage(slots[3].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if(power + 100 <= maxPower && slots[3] != null && slots[3].getItem() == ModItems.battery_schrabidium && slots[3].getItemDamage() < 1000)
|
||||
{
|
||||
power += 100;
|
||||
slots[0].setItemDamage(slots[0].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if(power + 100 <= maxPower && slots[3] != null && slots[3].getItem() == ModItems.fusion_core && slots[3].getItemDamage() < 5000)
|
||||
{
|
||||
power += 100;
|
||||
slots[3].setItemDamage(slots[3].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if(power + 100 <= maxPower && slots[3] != null && slots[3].getItem() == ModItems.energy_core && slots[3].getItemDamage() < 5000)
|
||||
{
|
||||
power += 100;
|
||||
slots[3].setItemDamage(slots[3].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if(canProcess())
|
||||
{
|
||||
process();
|
||||
} else {
|
||||
process = 0;
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
if (slots[3] != null && slots[3].getItem() == ModItems.battery_creative) {
|
||||
power = maxPower;
|
||||
}
|
||||
|
||||
if (power + 100 <= maxPower && slots[3] != null && slots[3].getItem() == ModItems.battery_generic
|
||||
&& slots[3].getItemDamage() < 50) {
|
||||
power += 100;
|
||||
slots[3].setItemDamage(slots[3].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if (power + 100 <= maxPower && slots[3] != null && slots[3].getItem() == ModItems.battery_advanced
|
||||
&& slots[3].getItemDamage() < 200) {
|
||||
power += 100;
|
||||
slots[3].setItemDamage(slots[3].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if (power + 100 <= maxPower && slots[3] != null && slots[3].getItem() == ModItems.battery_schrabidium
|
||||
&& slots[3].getItemDamage() < 1000) {
|
||||
power += 100;
|
||||
slots[0].setItemDamage(slots[0].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if (power + 100 <= maxPower && slots[3] != null && slots[3].getItem() == ModItems.fusion_core
|
||||
&& slots[3].getItemDamage() < 5000) {
|
||||
power += 100;
|
||||
slots[3].setItemDamage(slots[3].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
if (power + 100 <= maxPower && slots[3] != null && slots[3].getItem() == ModItems.energy_core
|
||||
&& slots[3].getItemDamage() < 5000) {
|
||||
power += 100;
|
||||
slots[3].setItemDamage(slots[3].getItemDamage() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (canProcess()) {
|
||||
|
||||
//if (!worldObj.isRemote) {
|
||||
process();
|
||||
//}
|
||||
} else {
|
||||
process = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(int i) {
|
||||
power = i;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPower() {
|
||||
return power;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -94,7 +94,12 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
if(i == 0 && stack.getItem() == ModItems.cell_uf6)
|
||||
return true;
|
||||
if(i == 2 && stack.getItem() == ModItems.cell_empty)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -171,7 +176,7 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getFillStateScaled(int i) {
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import com.hbm.items.ItemCustomLore;
|
||||
import com.hbm.items.ItemFuelRod;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -21,7 +23,7 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
|
||||
public static final int processingSpeed = 30;
|
||||
|
||||
private static final int[] slots_top = new int[] {1};
|
||||
private static final int[] slots_bottom = new int[] {2};
|
||||
private static final int[] slots_bottom = new int[] {2, 0};
|
||||
private static final int[] slots_side = new int[] {0};
|
||||
|
||||
private String customName;
|
||||
@ -208,13 +210,31 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
//return this.isItemValidForSlot(i, itemStack);
|
||||
if(i == 0)
|
||||
{
|
||||
if(itemStack.getItem() instanceof ItemCustomLore)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
//return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
|
||||
if(i == 0)
|
||||
{
|
||||
if(itemStack.getItem() == ModItems.rod_empty || itemStack.getItem() == ModItems.rod_dual_empty || itemStack.getItem() == ModItems.rod_quad_empty)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -95,8 +95,10 @@ public class ExplosionNukeAdvanced
|
||||
dist = (int) Math.sqrt(dist);
|
||||
for (int y = dist; y > -dist; y--)
|
||||
{
|
||||
|
||||
ExplosionNukeGeneric.wasteDest(this.worldObj, this.posX + x, this.posY + y, this.posZ + z);
|
||||
if(radius >= 95)
|
||||
ExplosionNukeGeneric.wasteDest(this.worldObj, this.posX + x, this.posY + y, this.posZ + z);
|
||||
else
|
||||
ExplosionNukeGeneric.wasteDestNoSchrab(this.worldObj, this.posX + x, this.posY + y, this.posZ + z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,8 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
|
||||
public class ContainerDiFurnace extends Container {
|
||||
|
||||
@ -50,8 +52,9 @@ public class ContainerDiFurnace extends Container {
|
||||
/**=====We are entering the magic realm of broken shit.=====**/
|
||||
}
|
||||
|
||||
//What is this!?
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_)
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_)
|
||||
{
|
||||
/*ItemStack itemstack = null;
|
||||
Slot slot = (Slot)this.inventorySlots.get(p_82846_2_);
|
||||
@ -65,7 +68,7 @@ public class ContainerDiFurnace extends Container {
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 3, 39, true))
|
||||
{
|
||||
*/return null;/*
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
@ -121,6 +124,8 @@ public class ContainerDiFurnace extends Container {
|
||||
}
|
||||
|
||||
return itemstack;*/
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -391,7 +391,8 @@ public class MachineRecipes {
|
||||
if(MainRegistry.enableDebugMode) {
|
||||
recipes.put(new ItemStack(Item.getItemFromBlock(ModBlocks.test_render)), getCentrifugeOutput(Item.getItemFromBlock(ModBlocks.test_render)));
|
||||
}
|
||||
recipes.put(new ItemStack(ModItems.rod_quad_euphemium), getCentrifugeOutput(ModItems.rod_quad_euphemium));
|
||||
//[REDACTED]
|
||||
//recipes.put(new ItemStack(ModItems.rod_quad_euphemium), getCentrifugeOutput(ModItems.rod_quad_euphemium));
|
||||
recipes.put(new ItemStack(ModItems.cell_sas3), getCentrifugeOutput(ModItems.cell_sas3));
|
||||
recipes.put(new ItemStack(Item.getItemFromBlock(Blocks.stone)), getCentrifugeOutput(Item.getItemFromBlock(Blocks.stone)));
|
||||
recipes.put(new ItemStack(Item.getItemFromBlock(Blocks.cobblestone)), getCentrifugeOutput(Item.getItemFromBlock(Blocks.cobblestone)));
|
||||
@ -406,7 +407,8 @@ public class MachineRecipes {
|
||||
recipes.put(new ItemStack(ModItems.rod_quad_mox_fuel_depleted), getCentrifugeOutput(ModItems.rod_quad_mox_fuel_depleted));
|
||||
recipes.put(new ItemStack(ModItems.rod_schrabidium_fuel_depleted), getCentrifugeOutput(ModItems.rod_schrabidium_fuel_depleted));
|
||||
recipes.put(new ItemStack(ModItems.rod_dual_schrabidium_fuel_depleted), getCentrifugeOutput(ModItems.rod_dual_schrabidium_fuel_depleted));
|
||||
recipes.put(new ItemStack(ModItems.rod_quad_schrabidium_fuel_depleted), getCentrifugeOutput(ModItems.rod_quad_schrabidium_fuel_depleted));
|
||||
//[REDACTED]
|
||||
//recipes.put(new ItemStack(ModItems.rod_quad_schrabidium_fuel_depleted), getCentrifugeOutput(ModItems.rod_quad_schrabidium_fuel_depleted));
|
||||
recipes.put(new ItemStack(Item.getItemFromBlock(Blocks.quartz_block)), getCentrifugeOutput(Item.getItemFromBlock(Blocks.quartz_block)));
|
||||
recipes.put(new ItemStack(Items.quartz), getCentrifugeOutput(Items.quartz));
|
||||
return recipes;
|
||||
@ -451,7 +453,8 @@ public class MachineRecipes {
|
||||
recipes.put(new ItemStack(ModItems.rod_neptunium), getReactorOutput(ModItems.rod_neptunium));
|
||||
recipes.put(new ItemStack(ModItems.rod_dual_neptunium), getReactorOutput(ModItems.rod_dual_neptunium));
|
||||
recipes.put(new ItemStack(ModItems.rod_quad_neptunium), getReactorOutput(ModItems.rod_quad_neptunium));
|
||||
recipes.put(new ItemStack(ModItems.rod_quad_schrabidium), getReactorOutput(ModItems.rod_quad_schrabidium));
|
||||
//[REDACTED]
|
||||
//recipes.put(new ItemStack(ModItems.rod_quad_schrabidium), getReactorOutput(ModItems.rod_quad_schrabidium));
|
||||
recipes.put(new ItemStack(ModItems.rod_lithium), getReactorOutput(ModItems.rod_lithium));
|
||||
recipes.put(new ItemStack(ModItems.rod_dual_lithium), getReactorOutput(ModItems.rod_dual_lithium));
|
||||
recipes.put(new ItemStack(ModItems.rod_quad_lithium), getReactorOutput(ModItems.rod_quad_lithium));
|
||||
|
||||
@ -647,7 +647,7 @@ public class ModItems {
|
||||
circuit_gold = new Item().setUnlocalizedName("circuit_gold").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":circuit_gold");
|
||||
circuit_schrabidium = new ItemCustomLore().setUnlocalizedName("circuit_schrabidium").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":circuit_schrabidium");
|
||||
|
||||
pellet_rtg = new ItemCustomLore().setUnlocalizedName("pellet_rtg").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":pellet_rtg");
|
||||
pellet_rtg = new ItemCustomLore().setUnlocalizedName("pellet_rtg").setCreativeTab(MainRegistry.tabParts).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg");
|
||||
|
||||
cell_empty = new ItemCell().setUnlocalizedName("cell_empty").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":cell_empty");
|
||||
cell_uf6 = new Item().setUnlocalizedName("cell_uf6").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_uf6");
|
||||
|
||||
@ -1,13 +1,17 @@
|
||||
package com.hbm.main;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.gui.GUITestDiFurnace;
|
||||
import com.hbm.handler.AlloyFurnaceRecipeHandler;
|
||||
import com.hbm.handler.CentrifugeRecipeHandler;
|
||||
import com.hbm.handler.ReactorRecipeHandler;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class NEIConfig implements IConfigureNEI {
|
||||
|
||||
@ -19,7 +23,29 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.registerUsageHandler(new CentrifugeRecipeHandler());
|
||||
API.registerRecipeHandler(new ReactorRecipeHandler());
|
||||
API.registerUsageHandler(new ReactorRecipeHandler());
|
||||
|
||||
|
||||
//Some things are even beyond my control...or are they?
|
||||
API.hideItem(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_coal_on)));
|
||||
API.hideItem(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_electric_furnace_on)));
|
||||
API.hideItem(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_difurnace_on)));
|
||||
API.hideItem(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_on)));
|
||||
API.hideItem(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_rtg_furnace_on)));
|
||||
API.hideItem(new ItemStack(Item.getItemFromBlock(ModBlocks.reinforced_lamp_on)));
|
||||
API.hideItem(new ItemStack(Item.getItemFromBlock(ModBlocks.statue_elb)));
|
||||
API.hideItem(new ItemStack(Item.getItemFromBlock(ModBlocks.statue_elb_g)));
|
||||
API.hideItem(new ItemStack(Item.getItemFromBlock(ModBlocks.statue_elb_w)));
|
||||
API.hideItem(new ItemStack(Item.getItemFromBlock(ModBlocks.statue_elb_f)));
|
||||
API.hideItem(new ItemStack(ModItems.euphemium_helmet));
|
||||
API.hideItem(new ItemStack(ModItems.euphemium_plate));
|
||||
API.hideItem(new ItemStack(ModItems.euphemium_legs));
|
||||
API.hideItem(new ItemStack(ModItems.euphemium_boots));
|
||||
API.hideItem(new ItemStack(ModItems.apple_euphemium));
|
||||
API.hideItem(new ItemStack(ModItems.ingot_euphemium));
|
||||
API.hideItem(new ItemStack(ModItems.nugget_euphemium));
|
||||
API.hideItem(new ItemStack(ModItems.euphemium_kit));
|
||||
API.hideItem(new ItemStack(ModItems.euphemium_stopper));
|
||||
API.hideItem(new ItemStack(ModItems.watch));
|
||||
API.hideItem(new ItemStack(ModItems.rod_quad_euphemium));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user