fixed forge's broken ass item stats

This commit is contained in:
Boblet 2023-03-20 10:59:12 +01:00
parent 2c0c57d174
commit 109b6714a8
79 changed files with 457 additions and 1118 deletions

View File

@ -28,7 +28,6 @@ import net.minecraft.world.World;
public class MachineArcFurnace extends BlockContainer {
private final Random field_149933_a = new Random();
private Random rand;
private final boolean isActive;
private static boolean keepInventory;
@ -43,7 +42,6 @@ public class MachineArcFurnace extends BlockContainer {
public MachineArcFurnace(boolean blockState) {
super(Material.iron);
rand = new Random();
isActive = blockState;
}

View File

@ -1,144 +0,0 @@
package com.hbm.blocks.machine;
import java.util.Random;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityMachineDeuterium;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class MachineDeuterium extends BlockContainer {
private final Random field_149933_a = new Random();
private static boolean keepInventory;
@SideOnly(Side.CLIENT)
private IIcon iconTop;
public MachineDeuterium(Material p_i45386_1_) {
super(p_i45386_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":machine_deuterium_side");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_deuterium_front");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityMachineDeuterium();
}
/*@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Item.getItemFromBlock(ModBlocks.machine_deuterium);
}*/
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
return true;
} else if(!player.isSneaking())
{
TileEntityMachineDeuterium entity = (TileEntityMachineDeuterium) world.getTileEntity(x, y, z);
if(entity != null)
{
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
}
return true;
} else {
return false;
}
}
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{
if (!keepInventory)
{
TileEntityMachineDeuterium tileentityfurnace = (TileEntityMachineDeuterium)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
if (tileentityfurnace != null)
{
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
{
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
if (itemstack != null)
{
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
while (itemstack.stackSize > 0)
{
int j1 = this.field_149933_a.nextInt(21) + 10;
if (j1 > itemstack.stackSize)
{
j1 = itemstack.stackSize;
}
itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound())
{
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
}
float f3 = 0.05F;
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem);
}
}
}
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
}
}
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
{
if (((TileEntityMachineDeuterium) p_149734_1_.getTileEntity(x, y, z)).isProcessing())
{
float f = x + 0.5F;
float f1 = y + 1.0F;
float f2 = z + 0.5F;
p_149734_1_.spawnParticle("cloud", f, f1, f2, 0.0D, 0.1D, 0.0D);
}
}
}

View File

@ -28,7 +28,6 @@ import net.minecraft.world.World;
public class MachineElectricFurnace extends BlockContainer {
private final Random field_149933_a = new Random();
private Random rand;
private final boolean isActive;
private static boolean keepInventory;
@ -39,7 +38,6 @@ public class MachineElectricFurnace extends BlockContainer {
public MachineElectricFurnace(boolean blockState) {
super(Material.iron);
rand = new Random();
isActive = blockState;
}

View File

@ -28,7 +28,6 @@ import net.minecraft.world.World;
public class MachineNukeFurnace extends BlockContainer {
private final Random field_149933_a = new Random();
private Random rand;
private final boolean isActive;
private static boolean keepInventory;
@ -39,7 +38,6 @@ public class MachineNukeFurnace extends BlockContainer {
public MachineNukeFurnace(boolean blockState) {
super(Material.iron);
rand = new Random();
isActive = blockState;
}

View File

@ -72,37 +72,6 @@ public class MachineReactorControl extends BlockContainer {
return blockIcon;
}
private void setDefaultDirection(World world, int x, int y, int z) {
if(!world.isRemote)
{
Block block1 = world.getBlock(x, y, z - 1);
Block block2 = world.getBlock(x, y, z + 1);
Block block3 = world.getBlock(x - 1, y, z);
Block block4 = world.getBlock(x + 1, y, z);
byte b0 = 3;
if(block1.func_149730_j() && !block2.func_149730_j())
{
b0 = 3;
}
if(block2.func_149730_j() && !block1.func_149730_j())
{
b0 = 2;
}
if(block3.func_149730_j() && !block4.func_149730_j())
{
b0 = 5;
}
if(block4.func_149730_j() && !block3.func_149730_j())
{
b0 = 4;
}
world.setBlockMetadataWithNotify(x, y, z, b0, 2);
}
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;

View File

@ -1,45 +0,0 @@
package com.hbm.blocks.machine;
import java.util.Random;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class MachineReiXMainframe extends BlockContainer {
private final Random field_149933_a = new Random();
@SideOnly(Side.CLIENT)
private IIcon iconTop;
private IIcon iconBottom;
public MachineReiXMainframe(Material p_i45386_1_) {
super(p_i45386_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (":reix_top"));
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + (":reix_bottom"));
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":reix_side");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
return side == 1 ? this.iconTop : (side == 0 ? this.iconBottom : this.blockIcon);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return null;
}
}

View File

@ -30,7 +30,6 @@ import cpw.mods.fml.relauncher.SideOnly;
public class MachineRtgFurnace extends BlockContainer {
private final Random field_149933_a = new Random();
private Random rand;
private final boolean isActive;
private static boolean keepInventory;
@ -41,7 +40,6 @@ public class MachineRtgFurnace extends BlockContainer {
public MachineRtgFurnace(boolean blockState) {
super(Material.iron);
rand = new Random();
isActive = blockState;
}

View File

@ -26,7 +26,6 @@ import net.minecraft.world.World;
public class MachineSchrabidiumTransmutator extends BlockContainer {
private final Random field_149933_a = new Random();
private Random rand;
private static boolean keepInventory;
@SideOnly(Side.CLIENT)
@ -50,7 +49,6 @@ public class MachineSchrabidiumTransmutator extends BlockContainer {
public MachineSchrabidiumTransmutator(Material p_i45386_1_) {
super(p_i45386_1_);
rand = new Random();
}
@Override

View File

@ -60,37 +60,6 @@ public class ReactorHatch extends Block implements IFluidConnectorBlock {
//this.setDefaultDirection(world, x, y, z);
}
private void setDefaultDirection(World world, int x, int y, int z) {
if(!world.isRemote)
{
Block block1 = world.getBlock(x, y, z - 1);
Block block2 = world.getBlock(x, y, z + 1);
Block block3 = world.getBlock(x - 1, y, z);
Block block4 = world.getBlock(x + 1, y, z);
byte b0 = 3;
if(block1.func_149730_j() && !block2.func_149730_j())
{
b0 = 3;
}
if(block2.func_149730_j() && !block1.func_149730_j())
{
b0 = 2;
}
if(block3.func_149730_j() && !block4.func_149730_j())
{
b0 = 5;
}
if(block4.func_149730_j() && !block3.func_149730_j())
{
b0 = 4;
}
world.setBlockMetadataWithNotify(x, y, z, b0, 2);
}
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;

View File

@ -30,6 +30,7 @@ public class GeneralConfig {
public static boolean enableChunkyNEIHandler = true;
public static boolean enableSkyboxes = true;
public static boolean enableImpactWorldProvider = true;
public static boolean enableStatReRegistering = true;
public static int hintPos = 0;
public static boolean enable528 = false;
@ -87,6 +88,7 @@ public class GeneralConfig {
enableChunkyNEIHandler = config.get(CATEGORY_GENERAL, "1.30_enableChunkyNEIHandler", true, "If enabled, registers a NEI handler that will show the chosen item in a larger view.").getBoolean(true);
enableSkyboxes = config.get(CATEGORY_GENERAL, "1.31_enableSkyboxes", true, "If enabled, will try to use NTM's custom skyboxes.").getBoolean(true);
enableImpactWorldProvider = config.get(CATEGORY_GENERAL, "1.32_enableImpactWorldProvider", true, "If enabled, registers custom world provider which modifies lighting and sky colors for post impact effects.").getBoolean(true);
enableStatReRegistering = config.get(CATEGORY_GENERAL, "1.33_enableStatReRegistering", true, "If enabled, will re-register item crafting/breaking/usage stats in order to fix a forge bug where modded items just won't show up.").getBoolean(true);
final String CATEGORY_528 = CommonConfig.CATEGORY_528;

View File

@ -65,7 +65,7 @@ public abstract class EntityMinecartModBase extends EntityMinecart
private static IMinecartCollisionHandler collisionHandler = null;
/* Instance versions of the above physics properties */
private float currentSpeedRail = getMaxCartSpeedOnRail();
//private float currentSpeedRail = getMaxCartSpeedOnRail();
protected float maxSpeedAirLateral = defaultMaxSpeedAirLateral;
protected float maxSpeedAirVertical = defaultMaxSpeedAirVertical;
protected double dragAir = defaultDragAir;

View File

@ -2,6 +2,7 @@ package com.hbm.handler;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.GeneralConfig;
import com.hbm.config.MobConfig;
import com.hbm.config.WorldConfig;
@ -18,7 +19,11 @@ import com.hbm.util.ContaminationUtil;
import cpw.mods.fml.common.eventhandler.Event.Result;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.StatBase;
import net.minecraft.stats.StatList;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
@ -41,7 +46,10 @@ public class BossSpawnHandler {
EntityPlayer player = (EntityPlayer) world.playerEntities.get(world.rand.nextInt(world.playerEntities.size())); //choose a random player
if(ContaminationUtil.getRads(player) >= MobConfig.maskmanMinRad && (world.getHeightValue((int)player.posX, (int)player.posZ) > player.posY + 3 || !MobConfig.maskmanUnderground)) { //if the player has more than 50 RAD and is underground
StatBase statBase = StatList.objectCraftStats[Item.getIdFromItem(Item.getItemFromBlock(ModBlocks.machine_crystallizer))];
boolean acidizerStat = !GeneralConfig.enableStatReRegistering || (statBase != null && player instanceof EntityPlayerMP && ((EntityPlayerMP)player).func_147099_x().writeStat(statBase) > 0);
if(acidizerStat && ContaminationUtil.getRads(player) >= MobConfig.maskmanMinRad && (world.getHeightValue((int)player.posX, (int)player.posZ) > player.posY + 3 || !MobConfig.maskmanUnderground)) { //if the player has more than 50 RAD and is underground
player.addChatComponentMessage(new ChatComponentText("The mask man is about to claim another victim.").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));

View File

@ -173,6 +173,7 @@ public class GunNPCFactory {
bullet.velocity = 1.0F;
bullet.dmgMin = 20;
bullet.dmgMax = 30;
bullet.blockDamage = false;
bullet.incendiary = 3;
bullet.explosive = 2.5F;
bullet.style = BulletConfiguration.STYLE_METEOR;

View File

@ -10,10 +10,14 @@ import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class SlotMachineOutput extends Slot {
public class SlotCraftingOutput extends Slot {
private EntityPlayer player;
private int craftBuffer;
public SlotMachineOutput(IInventory inventory, int i, int j, int k) {
public SlotCraftingOutput(EntityPlayer player, IInventory inventory, int i, int j, int k) {
super(inventory, i, j, k);
this.player = player;
}
@Override
@ -59,10 +63,30 @@ public class SlotMachineOutput extends Slot {
player.triggerAchievement(MainRegistry.achFusion);
}
@Override
@Override
public ItemStack decrStackSize(int amount) {
if(this.getHasStack()) {
this.craftBuffer += Math.min(amount, this.getStack().stackSize);
}
return super.decrStackSize(amount);
}
@Override
public void onPickupFromSlot(EntityPlayer player, ItemStack stack) {
checkAchievements(player, stack);
this.onSlotChanged();
}
this.onCrafting(stack);
super.onPickupFromSlot(player, stack);
}
@Override
protected void onCrafting(ItemStack stack, int amount) {
this.craftBuffer += amount;
this.onCrafting(stack);
}
@Override
protected void onCrafting(ItemStack stack) {
stack.onCrafting(this.player.worldObj, this.player, this.craftBuffer);
checkAchievements(this.player, stack);
this.craftBuffer = 0;
}
}

View File

@ -0,0 +1,17 @@
package com.hbm.inventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class SlotTakeOnly extends Slot {
public SlotTakeOnly(IInventory inventory, int i, int j, int k) {
super(inventory, i, j, k);
}
@Override
public boolean isItemValid(ItemStack stack) {
return false;
}
}

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.inventory.recipes.anvil.AnvilRecipes;
import com.hbm.inventory.recipes.anvil.AnvilSmithingRecipe;
@ -25,7 +25,7 @@ public class ContainerAnvil extends Container {
this.addSlotToContainer(new SmithingSlot(input, 0, 17, 27));
this.addSlotToContainer(new SmithingSlot(input, 1, 53, 27));
this.addSlotToContainer(new SlotMachineOutput(output, 0, 89, 27) {
this.addSlotToContainer(new SlotCraftingOutput(inventory.player, output, 0, 89, 27) {
@Override
public void onPickupFromSlot(EntityPlayer player, ItemStack stack) {

View File

@ -1,5 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.inventory.SlotUpgrade;
import com.hbm.tileentity.machine.TileEntityMachineAssemfac;
@ -39,7 +40,7 @@ public class ContainerAssemfac extends Container {
for(int i = 0; i < 8; i++) {
this.addSlotToContainer(new Slot(tile, 17 + i * 14, 106, 13 + i * 19 - (i % 2 == 1 ? 1 : 0)));
this.addSlotToContainer(new Slot(tile, 18 + i * 14, 234, 13 + i * 16));
this.addSlotToContainer(new SlotCraftingOutput(playerInv.player, tile, 18 + i * 14, 234, 13 + i * 16));
}
for(int i = 0; i < 3; i++) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.inventory.SlotUpgrade;
import com.hbm.tileentity.machine.TileEntityMachineCentrifuge;
@ -20,10 +20,10 @@ public class ContainerCentrifuge extends Container {
this.addSlotToContainer(new Slot(tedf, 0, 36, 50));
this.addSlotToContainer(new Slot(tedf, 1, 9, 50));
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 63, 50));
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 83, 50));
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 103, 50));
this.addSlotToContainer(new SlotMachineOutput(tedf, 5, 123, 50));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 2, 63, 50));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 3, 83, 50));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 4, 103, 50));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 5, 123, 50));
this.addSlotToContainer(new SlotUpgrade(tedf, 6, 149, 22));
this.addSlotToContainer(new SlotUpgrade(tedf, 7, 149, 40));
@ -46,7 +46,7 @@ public class ContainerCentrifuge extends Container {
if(var4 != null && var4.getHasStack()) {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
SlotMachineOutput.checkAchievements(p_82846_1_, var5);
SlotCraftingOutput.checkAchievements(p_82846_1_, var5);
if(par2 <= 6) {
if(!this.mergeItemStack(var5, 6, this.inventorySlots.size(), true)) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.items.ModItems;
import com.hbm.items.machine.IItemFluidIdentifier;
import com.hbm.tileentity.machine.TileEntityMachineCombustionEngine;
@ -21,7 +21,7 @@ public class ContainerCombustionEngine extends Container {
this.engine.openInventory();
this.addSlotToContainer(new Slot(tedf, 0, 17, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 17, 53));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 1, 17, 53));
this.addSlotToContainer(new Slot(tedf, 2, 88, 71));
this.addSlotToContainer(new Slot(tedf, 3, 143, 71));
this.addSlotToContainer(new Slot(tedf, 4, 35, 71));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.TileEntityCoreInjector;
import net.minecraft.entity.player.EntityPlayer;
@ -18,9 +18,9 @@ public class ContainerCoreInjector extends Container {
nukeBoy = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 26, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 26, 53));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 1, 26, 53));
this.addSlotToContainer(new Slot(tedf, 2, 134, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 134, 53));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 3, 134, 53));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.inventory.SlotUpgrade;
import com.hbm.items.machine.IItemFluidIdentifier;
import com.hbm.tileentity.machine.TileEntityMachineCrystallizer;
@ -24,10 +24,10 @@ public class ContainerCrystallizer extends Container {
//Battery
this.addSlotToContainer(new Slot(tedf, 1, 152, 72));
//Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 113, 45));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 2, 113, 45));
//Fluid slots
this.addSlotToContainer(new Slot(tedf, 3, 17, 18));
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 17, 54));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 4, 17, 54));
//Upgrades
this.addSlotToContainer(new SlotUpgrade(tedf, 5, 80, 18));
this.addSlotToContainer(new SlotUpgrade(tedf, 6, 98, 18));
@ -53,7 +53,7 @@ public class ContainerCrystallizer extends Container {
if(var4 != null && var4.getHasStack()) {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
SlotMachineOutput.checkAchievements(p_82846_1_, var5);
SlotCraftingOutput.checkAchievements(p_82846_1_, var5);
if(par2 <= diFurnace.getSizeInventory() - 1) {
if(!this.mergeItemStack(var5, diFurnace.getSizeInventory(), this.inventorySlots.size(), true)) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.TileEntityDiFurnace;
import net.minecraft.entity.player.EntityPlayer;
@ -20,7 +20,7 @@ public class ContainerDiFurnace extends Container {
this.addSlotToContainer(new Slot(tedf, 0, 80, 18));
this.addSlotToContainer(new Slot(tedf, 1, 80, 54));
this.addSlotToContainer(new Slot(tedf, 2, 8, 36));
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 134, 36));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 3, 134, 36));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.TileEntityElectrolyser;
import net.minecraft.entity.player.EntityPlayer;
@ -35,31 +35,31 @@ public class ContainerElectrolyser extends Container {
this.addSlotToContainer(new Slot(tile, 2, 186, 158));
this.addSlotToContainer(new Slot(tile, 3, 6, 18));
this.addSlotToContainer(new SlotMachineOutput(tile, 4, 6, 54));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tile, 4, 6, 54));
this.addSlotToContainer(new Slot(tile, 5, 24, 18));
this.addSlotToContainer(new SlotMachineOutput(tile, 6, 24, 54));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tile, 6, 24, 54));
this.addSlotToContainer(new Slot(tile, 7, 78, 18));
this.addSlotToContainer(new SlotMachineOutput(tile, 8, 78, 54));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tile, 8, 78, 54));
this.addSlotToContainer(new Slot(tile, 9, 134, 18));
this.addSlotToContainer(new SlotMachineOutput(tile, 10, 134, 54));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tile, 10, 134, 54));
for(int i = 0; i < 3; i++) {
this.addSlotToContainer(new SlotMachineOutput(tile, 11+i, 154, 18+(18*i)));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tile, 11+i, 154, 18+(18*i)));
}
this.addSlotToContainer(new Slot(tile, 14, 10, 90));
this.addSlotToContainer(new Slot(tile, 15, 37, 122));
this.addSlotToContainer(new SlotMachineOutput(tile, 16, 60, 112));
this.addSlotToContainer(new SlotMachineOutput(tile, 16, 98, 112));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tile, 16, 60, 112));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tile, 16, 98, 112));
for(int i = 0; i < 2; i++) {
for(int j = 0; j < 3; j++) {
this.addSlotToContainer(new SlotMachineOutput(tile, 17+(i*3)+j, 136+(18*i), 86+(18*j)));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tile, 17+(i*3)+j, 136+(18*i), 86+(18*j)));
}
}

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.inventory.SlotSmelting;
import com.hbm.tileentity.machine.TileEntityFurnaceCombination;
@ -22,7 +22,7 @@ public class ContainerFurnaceCombo extends Container {
//output
this.addSlotToContainer(new SlotSmelting(invPlayer.player, furnace, 1, 89, 36));
this.addSlotToContainer(new Slot(furnace, 2, 136, 18));
this.addSlotToContainer(new SlotMachineOutput(furnace, 3, 136, 54));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, furnace, 3, 136, 54));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.TileEntityHadron;
import net.minecraft.entity.player.EntityPlayer;
@ -22,8 +22,8 @@ public class ContainerHadron extends Container {
this.addSlotToContainer(new Slot(tedf, 0, 17, 36));
this.addSlotToContainer(new Slot(tedf, 1, 35, 36));
//Outputs
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 125, 36));
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 143, 36));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 2, 125, 36));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 3, 143, 36));
//Battery
this.addSlotToContainer(new Slot(tedf, 4, 44, 108));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.TileEntityMachineIGenerator;
import net.minecraft.entity.player.EntityPlayer;
@ -21,7 +21,7 @@ public class ContainerIGenerator extends Container {
this.addSlotToContainer(new Slot(te, 0, 8, 134));
//Water
this.addSlotToContainer(new Slot(te, 1, 62, 112));
this.addSlotToContainer(new SlotMachineOutput(te, 2, 154, 112));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, te, 2, 154, 112));
//Solid Fuel
this.addSlotToContainer(new Slot(te, 3, 67, 51));
this.addSlotToContainer(new Slot(te, 4, 85, 51));
@ -29,10 +29,10 @@ public class ContainerIGenerator extends Container {
this.addSlotToContainer(new Slot(te, 6, 85, 87));
//Lubricant
this.addSlotToContainer(new Slot(te, 7, 132, 33));
this.addSlotToContainer(new SlotMachineOutput(te, 8, 132, 51));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, te, 8, 132, 51));
//Fuel
this.addSlotToContainer(new Slot(te, 9, 132, 69));
this.addSlotToContainer(new SlotMachineOutput(te, 10, 132, 87));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, te, 10, 132, 87));
//RTG
for(int i = 0; i < 5; i++) {
for(int j = 0; j < 2; j++) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityITER;
import net.minecraft.entity.player.EntityPlayer;
@ -22,11 +22,11 @@ private TileEntityITER iter;
//Breeder In
this.addSlotToContainer(new Slot(tedf, 1, 26, 18));
//Breeder Out
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 62, 18));
this.addSlotToContainer(new SlotTakeOnly(tedf, 2, 62, 18));
//Plasma Shield
this.addSlotToContainer(new Slot(tedf, 3, 98, 18));
//Byproduct
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 134, 18));
this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 134, 18));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
import net.minecraft.entity.player.EntityPlayer;
@ -25,7 +25,7 @@ private TileEntityMachineAssembler assembler;
//Schematic
this.addSlotToContainer(new Slot(te, 4, 80, 54));
//Output
this.addSlotToContainer(new SlotMachineOutput(te, 5, 134, 90));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, te, 5, 134, 90));
//Input
this.addSlotToContainer(new Slot(te, 6, 8, 18));
this.addSlotToContainer(new Slot(te, 7, 26, 18));
@ -64,7 +64,7 @@ private TileEntityMachineAssembler assembler;
{
ItemStack var5 = var4.getStack();
var3 = var5.copy();
SlotMachineOutput.checkAchievements(p_82846_1_, var5);
SlotCraftingOutput.checkAchievements(p_82846_1_, var5);
if (par2 <= 17) {
if (!this.mergeItemStack(var5, 18, this.inventorySlots.size(), true))

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachineBoiler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
@ -19,15 +19,15 @@ public class ContainerMachineBoiler extends Container {
//Fluid ID
this.addSlotToContainer(new Slot(tedf, 0, 8, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 8, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 8, 53));
//Input IO
this.addSlotToContainer(new Slot(tedf, 2, 44, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 44, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 3, 44, 53));
//Fuel
this.addSlotToContainer(new Slot(tedf, 4, 98, 53));
//Output IO
this.addSlotToContainer(new Slot(tedf, 5, 152, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 6, 152, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 6, 152, 53));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachineBoilerElectric;
import net.minecraft.entity.player.EntityPlayer;
@ -20,15 +20,15 @@ public class ContainerMachineBoilerElectric extends Container {
//Fluid ID
this.addSlotToContainer(new Slot(tedf, 0, 8, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 8, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 8, 53));
//Input IO
this.addSlotToContainer(new Slot(tedf, 2, 44, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 44, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 3, 44, 53));
//Battery
this.addSlotToContainer(new Slot(tedf, 4, 98, 53));
//Output IO
this.addSlotToContainer(new Slot(tedf, 5, 152, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 6, 152, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 6, 152, 53));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,7 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachineCMBFactory;
import net.minecraft.entity.player.EntityPlayer;
@ -23,8 +24,8 @@ public class ContainerMachineCMBFactory extends Container {
this.addSlotToContainer(new Slot(tedf, 1, 80 + 9, 17));
this.addSlotToContainer(new Slot(tedf, 2, 62 + 9, 53));
this.addSlotToContainer(new Slot(tedf, 3, 80 + 9, 53));
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 134 + 9, 35));
this.addSlotToContainer(new SlotMachineOutput(tedf, 5, 62 - 9, 53));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 4, 134 + 9, 35));
this.addSlotToContainer(new SlotTakeOnly(tedf, 5, 62 - 9, 53));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.items.ModItems;
import com.hbm.items.machine.IItemFluidIdentifier;
import com.hbm.tileentity.machine.oil.TileEntityMachineCatalyticReformer;
@ -26,19 +26,19 @@ public class ContainerMachineCatalyticReformer extends Container {
//Canister Input
this.addSlotToContainer(new Slot(tedf, 1, 35, 90));
//Canister Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 35, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 2, 35, 108));
//Reformate Input
this.addSlotToContainer(new Slot(tedf, 3, 107, 90));
//Reformate Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 107, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 107, 108));
//Gas Input
this.addSlotToContainer(new Slot(tedf, 5, 125, 90));
//Gas Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 6, 125, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 6, 125, 108));
//Hydrogen Input
this.addSlotToContainer(new Slot(tedf, 7, 143, 90));
//Hydrogen Oil Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 8, 143, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 8, 143, 108));
//Fluid ID
this.addSlotToContainer(new Slot(tedf, 9, 17, 108));
//Catalyst

View File

@ -1,6 +1,7 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachineChemplant;
import net.minecraft.entity.player.EntityPlayer;
@ -25,16 +26,16 @@ public class ContainerMachineChemplant extends Container {
// Schematic
this.addSlotToContainer(new Slot(tedf, 4, 80, 54));
// Outputs
this.addSlotToContainer(new SlotMachineOutput(tedf, 5, 134, 90));
this.addSlotToContainer(new SlotMachineOutput(tedf, 6, 152, 90));
this.addSlotToContainer(new SlotMachineOutput(tedf, 7, 134, 108));
this.addSlotToContainer(new SlotMachineOutput(tedf, 8, 152, 108));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 5, 134, 90));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 6, 152, 90));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 7, 134, 108));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 8, 152, 108));
// Fluid Output In
this.addSlotToContainer(new Slot(tedf, 9, 134, 54));
this.addSlotToContainer(new Slot(tedf, 10, 152, 54));
// Fluid Outputs Out
this.addSlotToContainer(new SlotMachineOutput(tedf, 11, 134, 72));
this.addSlotToContainer(new SlotMachineOutput(tedf, 12, 152, 72));
this.addSlotToContainer(new SlotTakeOnly(tedf, 11, 134, 72));
this.addSlotToContainer(new SlotTakeOnly(tedf, 12, 152, 72));
// Input
this.addSlotToContainer(new Slot(tedf, 13, 8, 90));
this.addSlotToContainer(new Slot(tedf, 14, 26, 90));
@ -44,8 +45,8 @@ public class ContainerMachineChemplant extends Container {
this.addSlotToContainer(new Slot(tedf, 17, 8, 54));
this.addSlotToContainer(new Slot(tedf, 18, 26, 54));
// Fluid Input Out
this.addSlotToContainer(new SlotMachineOutput(tedf, 19, 8, 72));
this.addSlotToContainer(new SlotMachineOutput(tedf, 20, 26, 72));
this.addSlotToContainer(new SlotTakeOnly(tedf, 19, 8, 72));
this.addSlotToContainer(new SlotTakeOnly(tedf, 20, 26, 72));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {
@ -66,7 +67,7 @@ public class ContainerMachineChemplant extends Container {
if(var4 != null && var4.getHasStack()) {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
SlotMachineOutput.checkAchievements(p_82846_1_, var5);
SlotCraftingOutput.checkAchievements(p_82846_1_, var5);
if(par2 <= 20) {
if(!this.mergeItemStack(var5, 21, this.inventorySlots.size(), true)) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachineCoal;
import net.minecraft.entity.player.EntityPlayer;
@ -20,7 +20,7 @@ public class ContainerMachineCoal extends Container {
this.addSlotToContainer(new Slot(tedf, 0, 44, 53 - 36));
this.addSlotToContainer(new Slot(tedf, 1, 80, 53));
this.addSlotToContainer(new Slot(tedf, 2, 116, 53));
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 44, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 3, 44, 53));
for(int i = 0; i < 3; i++)
{

View File

@ -1,7 +1,8 @@
package com.hbm.inventory.container;
import com.hbm.inventory.FluidContainerRegistry;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.inventory.SlotUpgrade;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ModItems;
@ -32,17 +33,17 @@ public class ContainerMachineCyclotron extends Container {
this.addSlotToContainer(new Slot(tile, 4, 107, 36));
this.addSlotToContainer(new Slot(tile, 5, 107, 54));
//Output
this.addSlotToContainer(new SlotMachineOutput(tile, 6, 143, 18));
this.addSlotToContainer(new SlotMachineOutput(tile, 7, 143, 36));
this.addSlotToContainer(new SlotMachineOutput(tile, 8, 143, 54));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tile, 6, 143, 18));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tile, 7, 143, 36));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tile, 8, 143, 54));
//AMAT In
this.addSlotToContainer(new Slot(tile, 9, 143, 90));
//AMAT Out
this.addSlotToContainer(new SlotMachineOutput(tile, 10, 143, 108));
this.addSlotToContainer(new SlotTakeOnly(tile, 10, 143, 108));
//Coolant In
this.addSlotToContainer(new Slot(tile, 11, 62, 72));
//Coolant Out
this.addSlotToContainer(new SlotMachineOutput(tile, 12, 62, 90));
this.addSlotToContainer(new SlotTakeOnly(tile, 12, 62, 90));
//Battery
this.addSlotToContainer(new Slot(tile, 13, 62, 108));
//Upgrades

View File

@ -1,134 +0,0 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.machine.TileEntityMachineDeuterium;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerMachineDeuterium extends Container {
private TileEntityMachineDeuterium nukeBoy;
private int water;
private int sulfur;
private int progress;
public ContainerMachineDeuterium(InventoryPlayer invPlayer, TileEntityMachineDeuterium tedf) {
nukeBoy = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 8, 90));
this.addSlotToContainer(new Slot(tedf, 1, 26, 90));
this.addSlotToContainer(new Slot(tedf, 2, 44, 90));
this.addSlotToContainer(new Slot(tedf, 3, 80, 54));
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 140, 54));
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < 9; j++)
{
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 56));
}
}
for(int i = 0; i < 9; i++)
{
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56));
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
{
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack())
{
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (par2 <= 4) {
if (!this.mergeItemStack(var5, 5, this.inventorySlots.size(), true))
{
return null;
}
}
else if (!this.mergeItemStack(var5, 3, 4, false))
{
if (!this.mergeItemStack(var5, 0, 3, false))
return null;
}
if (var5.stackSize == 0)
{
var4.putStack((ItemStack) null);
}
else
{
var4.onSlotChanged();
}
}
return var3;
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return nukeBoy.isUseableByPlayer(player);
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for(int i = 0; i < this.crafters.size(); i++)
{
ICrafting par1 = (ICrafting)this.crafters.get(i);
if(this.progress != this.nukeBoy.process)
{
par1.sendProgressBarUpdate(this, 0, this.nukeBoy.process);
}
if(this.water != this.nukeBoy.water)
{
par1.sendProgressBarUpdate(this, 1, this.nukeBoy.water);
}
if(this.sulfur != this.nukeBoy.sulfur)
{
par1.sendProgressBarUpdate(this, 2, this.nukeBoy.sulfur);
}
}
this.progress = this.nukeBoy.process;
this.water = this.nukeBoy.water;
this.sulfur = this.nukeBoy.sulfur;
}
@Override
public void updateProgressBar(int i, int j) {
if(i == 0)
{
nukeBoy.process = j;
}
if(i == 1)
{
nukeBoy.water = j;
}
if(i == 2)
{
nukeBoy.sulfur = j;
}
if(i == 3)
{
nukeBoy.power = j;
}
}
}

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.IRadioisotopeFuel;
import com.hbm.tileentity.machine.TileEntityDiFurnaceRTG;
@ -20,7 +20,7 @@ public class ContainerMachineDiFurnaceRTG extends Container {
this.addSlotToContainer(new Slot(teIn, 0, 80, 18));
this.addSlotToContainer(new Slot(teIn, 1, 80, 54));
// Output
this.addSlotToContainer(new SlotMachineOutput(teIn, 2, 134, 36));
this.addSlotToContainer(new SlotCraftingOutput(playerInv.player, teIn, 2, 134, 36));
// RTG pellets
this.addSlotToContainer(new Slot(teIn, 3, 22, 18));
this.addSlotToContainer(new Slot(teIn, 4, 40, 18));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachineDiesel;
import net.minecraft.entity.player.EntityPlayer;
@ -19,10 +19,10 @@ public class ContainerMachineDiesel extends Container {
diFurnace = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 44, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 44, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 44, 53));
this.addSlotToContainer(new Slot(tedf, 2, 116, 53));
this.addSlotToContainer(new Slot(tedf, 3, 8, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 8, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 8, 53));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.inventory.SlotUpgrade;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemMachineUpgrade;
@ -29,7 +29,7 @@ private TileEntityMachineEPress nukeBoy;
//Input
this.addSlotToContainer(new Slot(tedf, 2, 80, 53));
//Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 140, 35));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 3, 140, 35));
//Upgrade
this.addSlotToContainer(new SlotUpgrade(tedf, 4, 44, 21));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.items.machine.IItemFluidIdentifier;
import com.hbm.tileentity.machine.TileEntityMachineExcavator;
@ -30,7 +30,7 @@ public class ContainerMachineExcavator extends Container {
//Buffer: 5-13
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 3; j++) {
this.addSlotToContainer(new SlotMachineOutput(tile, 5 + j + i * 3, 136 + j * 18, 5 + i * 18));
this.addSlotToContainer(new SlotTakeOnly(tile, 5 + j + i * 3, 136 + j * 18, 5 + i * 18));
}
}

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.TileEntityMachineGasCent;
import net.minecraft.entity.player.EntityPlayer;
@ -21,7 +21,7 @@ public class ContainerMachineGasCent extends Container {
//Output
for(int i = 0; i < 2; i++) {
for(int j = 0; j < 2; j++) {
this.addSlotToContainer(new SlotMachineOutput(tedf, j + i * 2, 71 + j * 18, 53 + i * 18));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, j + i * 2, 71 + j * 18, 53 + i * 18));
}
}

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.items.machine.IItemFluidIdentifier;
import com.hbm.items.machine.ItemMachineUpgrade;
import com.hbm.tileentity.machine.oil.TileEntityMachineGasFlare;
@ -26,7 +26,7 @@ public class ContainerMachineGasFlare extends Container {
//Fluid in
this.addSlotToContainer(new Slot(tedf, 1, 17, 17));
//Fluid out
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 17, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 2, 17, 53));
//Fluid ID
this.addSlotToContainer(new Slot(tedf, 3, 35, 71));
//Upgrades

View File

@ -1,81 +0,0 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.machine.TileEntityMachineInserter;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerMachineInserter extends Container {
private TileEntityMachineInserter diFurnace;
public ContainerMachineInserter(InventoryPlayer invPlayer, TileEntityMachineInserter tedf) {
diFurnace = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 8, 17));
this.addSlotToContainer(new Slot(tedf, 1, 26, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 26, 53));
this.addSlotToContainer(new Slot(tedf, 3, 62, 17));
this.addSlotToContainer(new Slot(tedf, 4, 80, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 5, 80, 53));
this.addSlotToContainer(new Slot(tedf, 6, 116, 17));
this.addSlotToContainer(new Slot(tedf, 7, 134, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 8, 134, 53));
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < 9; j++)
{
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
for(int i = 0; i < 9; i++)
{
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
{
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack())
{
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (par2 <= 8) {
if (!this.mergeItemStack(var5, 9, this.inventorySlots.size(), true))
{
return null;
}
}
else if (!this.mergeItemStack(var5, 0, 9, false))
{
return null;
}
if (var5.stackSize == 0)
{
var4.putStack((ItemStack) null);
}
else
{
var4.onSlotChanged();
}
}
return var3;
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return diFurnace.isUseableByPlayer(player);
}
}

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachineLargeTurbine;
import net.minecraft.entity.player.EntityPlayer;
@ -20,15 +20,15 @@ public class ContainerMachineLargeTurbine extends Container {
//Fluid ID
this.addSlotToContainer(new Slot(tedf, 0, 8, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 8, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 8, 53));
//Input IO
this.addSlotToContainer(new Slot(tedf, 2, 44, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 44, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 3, 44, 53));
//Battery
this.addSlotToContainer(new Slot(tedf, 4, 98, 53));
//Output IO
this.addSlotToContainer(new Slot(tedf, 5, 152, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 6, 152, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 6, 152, 53));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachineMissileAssembly;
import net.minecraft.entity.player.EntityPlayer;
@ -22,7 +22,7 @@ public class ContainerMachineMissileAssembly extends Container {
this.addSlotToContainer(new Slot(tedf, 2, 44, 36));
this.addSlotToContainer(new Slot(tedf, 3, 62, 36));
this.addSlotToContainer(new Slot(tedf, 4, 80, 36));
this.addSlotToContainer(new SlotMachineOutput(tedf, 5, 152, 36));
this.addSlotToContainer(new SlotTakeOnly(tedf, 5, 152, 36));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.items.machine.ItemMachineUpgrade;
import com.hbm.tileentity.machine.oil.TileEntityOilDrillBase;
@ -23,11 +23,11 @@ public class ContainerMachineOilWell extends Container {
// Canister Input
this.addSlotToContainer(new Slot(tedf, 1, 80, 17));
// Canister Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 80, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 2, 80, 53));
// Gas Input
this.addSlotToContainer(new Slot(tedf, 3, 125, 17));
// Gas Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 125, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 125, 53));
//Upgrades
this.addSlotToContainer(new Slot(tedf, 5, 152, 17));
this.addSlotToContainer(new Slot(tedf, 6, 152, 35));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.items.machine.ItemStamp;
import com.hbm.tileentity.machine.TileEntityMachinePress;
@ -25,7 +25,7 @@ public class ContainerMachinePress extends Container {
// Input
this.addSlotToContainer(new Slot(tedf, 2, 80, 53));
// Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 140, 35));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 3, 140, 35));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.TileEntityMachineRadGen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
@ -23,7 +23,7 @@ public class ContainerMachineRadGen extends Container {
}
for(int i = 0; i < 4; i++) {
for(int j = 0; j < 3; j++) {
this.addSlotToContainer(new SlotMachineOutput(tedf, j + i * 3 + 12, 116 + j * 18, 17 + i * 18));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, j + i * 3 + 12, 116 + j * 18, 17 + i * 18));
}
}

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.items.machine.ItemBreedingRod;
import com.hbm.tileentity.machine.TileEntityMachineReactorBreeding;
@ -19,7 +19,7 @@ public class ContainerMachineReactorBreeding extends Container {
reactor = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 35, 35));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 125, 35));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 1, 125, 35));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery;
import net.minecraft.entity.player.EntityPlayer;
@ -23,25 +23,25 @@ public class ContainerMachineRefinery extends Container {
//Canister Input
this.addSlotToContainer(new Slot(tedf, 1, 35, 90));
//Canister Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 35, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 2, 35, 108));
//Heavy Oil Input
this.addSlotToContainer(new Slot(tedf, 3, 80, 90));
//Heavy Oil Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 80, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 80, 108));
//Naphtha Input
this.addSlotToContainer(new Slot(tedf, 5, 98, 90));
//Naphtha Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 6, 98, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 6, 98, 108));
//Light Oil Input
this.addSlotToContainer(new Slot(tedf, 7, 116, 90));
//Light Oil Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 8, 116, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 8, 116, 108));
//Petroleum Input
this.addSlotToContainer(new Slot(tedf, 9, 134, 90));
//Petroleum Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 10, 134, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 10, 134, 108));
//Sulfur Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 11, 152, 36));
this.addSlotToContainer(new SlotTakeOnly(tedf, 11, 152, 36));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.TileEntityMachineSchrabidiumTransmutator;
import net.minecraft.entity.player.EntityPlayer;
@ -18,7 +18,7 @@ private TileEntityMachineSchrabidiumTransmutator nukeBoy;
nukeBoy = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 44, 63));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 134, 63));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 1, 134, 63));
this.addSlotToContainer(new Slot(tedf, 2, 26, 18));
this.addSlotToContainer(new Slot(tedf, 3, 8, 108));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachineSeleniumEngine;
import net.minecraft.entity.player.EntityPlayer;
@ -30,11 +30,11 @@ private TileEntityMachineSeleniumEngine seleniumEngine;
//Fluid IO
this.addSlotToContainer(new Slot(tedf, 9, 80, 18));
this.addSlotToContainer(new SlotMachineOutput(tedf, 10, 80, 54));
this.addSlotToContainer(new SlotTakeOnly(tedf, 10, 80, 54));
//Fluid IDs
this.addSlotToContainer(new Slot(tedf, 11, 152, 18));
this.addSlotToContainer(new SlotMachineOutput(tedf, 12, 152, 54));
this.addSlotToContainer(new SlotTakeOnly(tedf, 12, 152, 54));
//Battery
this.addSlotToContainer(new Slot(tedf, 13, 116, 90));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.TileEntityMachineShredder;
import net.minecraft.entity.player.EntityPlayer;
@ -28,24 +28,24 @@ public class ContainerMachineShredder extends Container {
this.addSlotToContainer(new Slot(tedf, 6, 44, 54));
this.addSlotToContainer(new Slot(tedf, 7, 62, 54));
this.addSlotToContainer(new Slot(tedf, 8, 80, 54));
this.addSlotToContainer(new SlotMachineOutput(tedf, 9, 116, 18));
this.addSlotToContainer(new SlotMachineOutput(tedf, 10, 134, 18));
this.addSlotToContainer(new SlotMachineOutput(tedf, 11, 152, 18));
this.addSlotToContainer(new SlotMachineOutput(tedf, 12, 116, 36));
this.addSlotToContainer(new SlotMachineOutput(tedf, 13, 134, 36));
this.addSlotToContainer(new SlotMachineOutput(tedf, 14, 152, 36));
this.addSlotToContainer(new SlotMachineOutput(tedf, 15, 116, 54));
this.addSlotToContainer(new SlotMachineOutput(tedf, 16, 134, 54));
this.addSlotToContainer(new SlotMachineOutput(tedf, 17, 152, 54));
this.addSlotToContainer(new SlotMachineOutput(tedf, 18, 116, 72));
this.addSlotToContainer(new SlotMachineOutput(tedf, 19, 134, 72));
this.addSlotToContainer(new SlotMachineOutput(tedf, 20, 152, 72));
this.addSlotToContainer(new SlotMachineOutput(tedf, 21, 116, 90));
this.addSlotToContainer(new SlotMachineOutput(tedf, 22, 134, 90));
this.addSlotToContainer(new SlotMachineOutput(tedf, 23, 152, 90));
this.addSlotToContainer(new SlotMachineOutput(tedf, 24, 116, 108));
this.addSlotToContainer(new SlotMachineOutput(tedf, 25, 134, 108));
this.addSlotToContainer(new SlotMachineOutput(tedf, 26, 152, 108));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 9, 116, 18));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 10, 134, 18));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 11, 152, 18));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 12, 116, 36));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 13, 134, 36));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 14, 152, 36));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 15, 116, 54));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 16, 134, 54));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 17, 152, 54));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 18, 116, 72));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 19, 134, 72));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 20, 152, 72));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 21, 116, 90));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 22, 134, 90));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 23, 152, 90));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 24, 116, 108));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 25, 134, 108));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 26, 152, 108));
this.addSlotToContainer(new Slot(tedf, 27, 44, 108));
this.addSlotToContainer(new Slot(tedf, 28, 80, 108));
this.addSlotToContainer(new Slot(tedf, 29, 8, 108));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachineTurbine;
import net.minecraft.entity.player.EntityPlayer;
@ -20,15 +20,15 @@ public class ContainerMachineTurbine extends Container {
//Fluid ID
this.addSlotToContainer(new Slot(tedf, 0, 8, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 8, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 8, 53));
//Input IO
this.addSlotToContainer(new Slot(tedf, 2, 44, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 44, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 3, 44, 53));
//Battery
this.addSlotToContainer(new Slot(tedf, 4, 98, 53));
//Output IO
this.addSlotToContainer(new Slot(tedf, 5, 152, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 6, 152, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 6, 152, 53));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
import net.minecraft.entity.player.EntityPlayer;
@ -21,7 +21,7 @@ public class ContainerMachineTurbofan extends Container {
diFurnace = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 17, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 17, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 17, 53));
this.addSlotToContainer(new Slot(tedf, 2, 98, 71));
this.addSlotToContainer(new Slot(tedf, 3, 143, 71));
this.addSlotToContainer(new Slot(tedf, 4, 44, 71));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.oil.TileEntityMachineVacuumDistill;
import net.minecraft.entity.player.EntityPlayer;
@ -23,23 +23,23 @@ public class ContainerMachineVacuumDistill extends Container {
//Canister Input
this.addSlotToContainer(new Slot(tedf, 1, 44, 90));
//Canister Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 44, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 2, 44, 108));
//Heavy Oil Input
this.addSlotToContainer(new Slot(tedf, 3, 80, 90));
//Heavy Oil Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 80, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 80, 108));
//Nahptha Input
this.addSlotToContainer(new Slot(tedf, 5, 98, 90));
//Nahptha Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 6, 98, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 6, 98, 108));
//Light Oil Input
this.addSlotToContainer(new Slot(tedf, 7, 116, 90));
//Light Oil Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 8, 116, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 8, 116, 108));
//Petroleum Input
this.addSlotToContainer(new Slot(tedf, 9, 134, 90));
//Petroleum Output
this.addSlotToContainer(new SlotMachineOutput(tedf, 10, 134, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 10, 134, 108));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.inventory.SlotPattern;
import com.hbm.tileentity.machine.storage.TileEntityMassStorage;
@ -20,7 +20,7 @@ public class ContainerMassStorage extends Container {
this.addSlotToContainer(new Slot(storage, 0, 61, 17));
this.addSlotToContainer(new SlotPattern(storage, 1, 61, 53));
this.addSlotToContainer(new SlotMachineOutput(storage, 2, 61, 89));
this.addSlotToContainer(new SlotTakeOnly(storage, 2, 61, 89));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.TileEntityMicrowave;
import net.minecraft.entity.player.EntityPlayer;
@ -18,7 +18,7 @@ private TileEntityMicrowave microwave;
microwave = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 80, 35));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 140, 35));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 1, 140, 35));
this.addSlotToContainer(new Slot(tedf, 2, 8, 53));
for(int i = 0; i < 3; i++)

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.TileEntityNukeFurnace;
import com.hbm.util.InventoryUtil;
@ -31,7 +31,7 @@ public class ContainerNukeFurnace extends Container {
});
this.addSlotToContainer(new Slot(tedf, 1, 56, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 116, 35));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 2, 116, 35));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.items.machine.IItemFluidIdentifier;
import com.hbm.tileentity.machine.TileEntityHeaterOilburner;
@ -21,7 +21,7 @@ public class ContainerOilburner extends Container {
//In
this.addSlotToContainer(new Slot(tedf, 0, 26, 17));
//Out
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 26, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 26, 53));
//Fluid ID
this.addSlotToContainer(new Slot(tedf, 2, 44, 71));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachinePlasmaHeater;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
@ -18,9 +18,9 @@ public class ContainerPlasmaHeater extends Container {
this.addSlotToContainer(new Slot(tedf, 0, 8, 53));
this.addSlotToContainer(new Slot(tedf, 1, 44, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 44, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 2, 44, 53));
this.addSlotToContainer(new Slot(tedf, 3, 152, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 152, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 152, 53));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.storage.TileEntityMachinePuF6Tank;
import net.minecraft.entity.player.EntityPlayer;
@ -18,9 +18,9 @@ public class ContainerPuF6Tank extends Container {
testNuke = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 44, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 44, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 44, 53));
this.addSlotToContainer(new Slot(tedf, 2, 116, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 116, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 3, 116, 53));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKOutgasser;
import net.minecraft.entity.player.EntityPlayer;
@ -17,7 +17,7 @@ public class ContainerRBMKOutgasser extends Container {
rbmk = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 48, 45));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 112, 69));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 1, 112, 69));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachineRadiolysis;
import net.minecraft.entity.player.EntityPlayer;
@ -25,11 +25,11 @@ public class ContainerRadiolysis extends Container {
//Fluid IO
this.addSlotToContainer(new Slot(tile, 10, 34, 17));
this.addSlotToContainer(new SlotMachineOutput(tile, 11, 34, 53));
this.addSlotToContainer(new SlotTakeOnly(tile, 11, 34, 53));
//Sterilization
this.addSlotToContainer(new Slot(tile, 12, 148, 17));
this.addSlotToContainer(new SlotMachineOutput(tile, 13, 148, 53));
this.addSlotToContainer(new SlotTakeOnly(tile, 13, 148, 53));
//Battery
this.addSlotToContainer(new Slot(tile, 14, 8, 53));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
@ -19,20 +19,20 @@ public class ContainerReactorMultiblock extends Container {
//Water in
this.addSlotToContainer(new Slot(tedf, 0, 8, 90));
//Water out
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 8, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 8, 108));
//Coolant in
this.addSlotToContainer(new Slot(tedf, 2, 26, 90));
//Coolant out
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 26, 108));
this.addSlotToContainer(new SlotTakeOnly(tedf, 3, 26, 108));
//Fuel in
this.addSlotToContainer(new Slot(tedf, 4, 80, 36));
//Fuel out
this.addSlotToContainer(new SlotMachineOutput(tedf, 5, 80, 72));
this.addSlotToContainer(new SlotTakeOnly(tedf, 5, 80, 72));
//Waste in
this.addSlotToContainer(new Slot(tedf, 6, 152, 36));
//Waste out
this.addSlotToContainer(new SlotMachineOutput(tedf, 7, 152, 72));
this.addSlotToContainer(new SlotTakeOnly(tedf, 7, 152, 72));
for(int i = 0; i < 3; i++)
{

View File

@ -1,7 +1,7 @@
package com.hbm.inventory.container;
import com.hbm.inventory.FluidContainerRegistry;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.machine.ItemZirnoxRod;
import com.hbm.tileentity.machine.TileEntityReactorZirnox;
@ -47,9 +47,9 @@ public class ContainerReactorZirnox extends Container {
// Fluid IO
this.addSlotToContainer(new Slot(te, 24, 143, 124));
this.addSlotToContainer(new SlotMachineOutput(te, 26, 143, 142));
this.addSlotToContainer(new SlotTakeOnly(te, 26, 143, 142));
this.addSlotToContainer(new Slot(te, 25, 179, 124));
this.addSlotToContainer(new SlotMachineOutput(te, 27, 179, 142));
this.addSlotToContainer(new SlotTakeOnly(te, 27, 179, 142));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.tileentity.machine.TileEntityRtgFurnace;
import net.minecraft.entity.player.EntityPlayer;
@ -22,7 +22,7 @@ public class ContainerRtgFurnace extends Container {
this.addSlotToContainer(new Slot(tedf, 1, 38, 53));
this.addSlotToContainer(new Slot(tedf, 2, 56, 53));
this.addSlotToContainer(new Slot(tedf, 3, 74, 53));
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 116, 35));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 4, 116, 35));
for(int i = 0; i < 3; i++)
{

View File

@ -1,7 +1,8 @@
package com.hbm.inventory.container;
import com.hbm.inventory.FluidContainerRegistry;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.items.machine.IItemFluidIdentifier;
import com.hbm.tileentity.machine.TileEntitySILEX;
@ -24,16 +25,16 @@ public class ContainerSILEX extends Container {
this.addSlotToContainer(new Slot(te, 1, 8, 24));
//Fluid Container
this.addSlotToContainer(new Slot(te, 2, 8 + 18, 24));
this.addSlotToContainer(new Slot(te, 3, 8 + 18*2, 24));
this.addSlotToContainer(new SlotTakeOnly(te, 3, 8 + 18*2, 24));
//Output
this.addSlotToContainer(new SlotMachineOutput(te, 4, 116, 90));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, te, 4, 116, 90));
//Output Queue
this.addSlotToContainer(new SlotMachineOutput(te, 5, 134, 72));
this.addSlotToContainer(new SlotMachineOutput(te, 6, 152, 72));
this.addSlotToContainer(new SlotMachineOutput(te, 7, 134, 90));
this.addSlotToContainer(new SlotMachineOutput(te, 8, 152, 90));
this.addSlotToContainer(new SlotMachineOutput(te, 9, 134, 108));
this.addSlotToContainer(new SlotMachineOutput(te, 10, 152, 108));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, te, 5, 134, 72));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, te, 6, 152, 72));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, te, 7, 134, 90));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, te, 8, 152, 90));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, te, 9, 134, 108));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, te, 10, 152, 108));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.tileentity.machine.storage.TileEntityMachineUF6Tank;
import net.minecraft.entity.player.EntityPlayer;
@ -18,9 +18,9 @@ public class ContainerUF6Tank extends Container {
testNuke = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 44, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 44, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 44, 53));
this.addSlotToContainer(new Slot(tedf, 2, 116, 17));
this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 116, 53));
this.addSlotToContainer(new SlotTakeOnly(tedf, 3, 116, 53));
for(int i = 0; i < 3; i++)
{

View File

@ -1,65 +0,0 @@
package com.hbm.inventory.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerMachineDeuterium;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.TileEntityMachineDeuterium;
public class GUIMachineDeuterium extends GuiContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_deuterium.png");
private TileEntityMachineDeuterium diFurnace;
public GUIMachineDeuterium(InventoryPlayer invPlayer, TileEntityMachineDeuterium tedf) {
super(new ContainerMachineDeuterium(invPlayer, tedf));
diFurnace = tedf;
this.xSize = 176;
this.ySize = 222;
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(diFurnace.water > 0) {
int i = diFurnace.getWaterScaled(52);
drawTexturedModalRect(guiLeft + 26, guiTop + 88 - i, 192, 52 - i, 16, i);
}
if(diFurnace.sulfur > 0) {
int i = diFurnace.getSulfurScaled(52);
drawTexturedModalRect(guiLeft + 44, guiTop + 88 - i, 208, 52 - i, 16, i);
}
if(diFurnace.power > 0) {
int i = (int)diFurnace.getPowerScaled(52);
drawTexturedModalRect(guiLeft + 8, guiTop + 88 - i, 176, 52 - i, 16, i);
}
int j1 = diFurnace.getProgressScaled(24);
drawTexturedModalRect(guiLeft + 103, guiTop + 53, 224, 14, j1 + 1, 17);
if(diFurnace.canProcess())
{
drawTexturedModalRect(guiLeft + 81, guiTop + 73, 224, 0, 14, 14);
}
}
}

View File

@ -1,53 +0,0 @@
package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerMachineInserter;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.TileEntityMachineInserter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUIMachineInserter extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_inserter.png");
private TileEntityMachineInserter diFurnace;
public GUIMachineInserter(InventoryPlayer invPlayer, TileEntityMachineInserter tedf) {
super(new ContainerMachineInserter(invPlayer, tedf));
diFurnace = tedf;
this.xSize = 176;
this.ySize = 166;
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
diFurnace.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 44, guiTop + 69 - 52, 16, 52);
diFurnace.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 98, guiTop + 69 - 52, 16, 52);
diFurnace.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 69 - 52, 16, 52);
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
diFurnace.tanks[0].renderTank(guiLeft + 44, guiTop + 69, this.zLevel, 16, 52);
diFurnace.tanks[1].renderTank(guiLeft + 98, guiTop + 69, this.zLevel, 16, 52);
diFurnace.tanks[2].renderTank(guiLeft + 152, guiTop + 69, this.zLevel, 16, 52);
}
}

View File

@ -3,12 +3,9 @@ package com.hbm.items.tool;
import java.util.List;
import com.hbm.lib.Library;
import com.hbm.saveddata.TomSaveData;
import com.hbm.util.TimeAnalyzer;
import com.hbm.world.feature.OilSpot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;

View File

@ -77,6 +77,7 @@ import com.hbm.tileentity.machine.*;
import com.hbm.tileentity.machine.rbmk.RBMKDials;
import com.hbm.util.ArmorUtil;
import com.hbm.util.Compat;
import com.hbm.util.StatHelper;
import com.hbm.util.SuicideThreadDump;
import com.hbm.world.feature.*;
import com.hbm.world.generator.CellularDungeonFactory;
@ -89,6 +90,7 @@ import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartedEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
@ -885,6 +887,15 @@ public class MainRegistry {
event.registerServerCommand(new CommandReloadRecipes());
}
@EventHandler
public void serverStart(FMLServerStartedEvent event) {
if(GeneralConfig.enableStatReRegistering) {
logger.info("Attempting to re-register item stats...");
StatHelper.resetStatShitFuck(); //shit yourself
}
}
private void loadConfig(FMLPreInitializationEvent event) {
Configuration config = new Configuration(event.getSuggestedConfigurationFile());

View File

@ -55,7 +55,6 @@ public class TileMappings {
put(TileEntityDecoSteelPoles.class, "tileentity_steelpoles");
put(TileEntityDecoPoleTop.class, "tileentity_poletop");
put(TileEntityDecoPoleSatelliteReceiver.class, "tileentity_satellitereceicer");
put(TileEntityMachineDeuterium.class, "tileentity_deuterium");
put(TileEntityMachineBattery.class, "tileentity_battery");
put(TileEntityMachineCoal.class, "tileentity_coal");
put(TileEntityRedBarrel.class, "tileentity_barrel");

View File

@ -261,7 +261,7 @@ public abstract class TileEntityMachineAssemblerBase extends TileEntityMachineBa
/**
* @param index
* @return A size 4 int array containing min input, max input and output indices in that order.
* @return A size 3 int array containing min input, max input and output indices in that order.
*/
public abstract int[] getSlotIndicesFromIndex(int index);
public abstract ChunkCoordinates[] getInputPositions();

View File

@ -1,318 +0,0 @@
package com.hbm.tileentity.machine;
import com.hbm.inventory.container.ContainerMachineDeuterium;
import com.hbm.inventory.gui.GUIMachineDeuterium;
import com.hbm.items.ModItems;
import com.hbm.lib.Library;
import com.hbm.tileentity.IGUIProvider;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class TileEntityMachineDeuterium extends TileEntity implements ISidedInventory, IGUIProvider {
private ItemStack slots[];
public long power = 0;
public int water = 0;
public int sulfur = 0;
public int process = 0;
public static final int maxFill = 1000;
public static final long maxPower = 100000;
public static final int processSpeed = 200;
private static final int[] slots_top = new int[] {3};
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;
public TileEntityMachineDeuterium() {
slots = new ItemStack[5];
}
@Override
public int getSizeInventory() {
return slots.length;
}
@Override
public ItemStack getStackInSlot(int i) {
return slots[i];
}
@Override
public ItemStack getStackInSlotOnClosing(int i) {
if(slots[i] != null)
{
ItemStack itemStack = slots[i];
slots[i] = null;
return itemStack;
} else {
return null;
}
}
@Override
public void setInventorySlotContents(int i, ItemStack itemStack) {
slots[i] = itemStack;
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit())
{
itemStack.stackSize = getInventoryStackLimit();
}
}
@Override
public String getInventoryName() {
return this.hasCustomInventoryName() ? this.customName : "container.machine_deuterium";
}
@Override
public boolean hasCustomInventoryName() {
return this.customName != null && this.customName.length() > 0;
}
public void setCustomName(String name) {
this.customName = name;
}
@Override
public int getInventoryStackLimit() {
return 64;
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this)
{
return false;
}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 i, ItemStack stack) {
switch(i)
{
case 1:
if(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;
}
@Override
public ItemStack decrStackSize(int i, int 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)
{
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.getLong("power");
water = nbt.getInteger("water");
sulfur = nbt.getInteger("sulfur");
process = nbt.getInteger("process");
slots = new ItemStack[getSizeInventory()];
for(int i = 0; i < list.tagCount(); i++)
{
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setLong("power", power);
nbt.setInteger("water", water);
nbt.setInteger("sulfur", sulfur);
nbt.setInteger("process", process);
NBTTagList list = new NBTTagList();
for(int i = 0; i < slots.length; i++)
{
if(slots[i] != null)
{
NBTTagCompound nbt1 = new NBTTagCompound();
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);
}
@Override
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
return this.isItemValidForSlot(i, itemStack);
}
@Override
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
if(i == 4)
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 long getPowerScaled(long i) {
return (power * i) / maxPower;
}
public int getWaterScaled(int i) {
return (water * i) / maxFill;
}
public int getSulfurScaled(int i) {
return (sulfur * i) / maxFill;
}
public int getProgressScaled(int i) {
return (process * i) / processSpeed;
}
public boolean canProcess() {
if(water != 0 && power != 0 && sulfur != 0 && slots[3] != null && slots[3].getItem() == ModItems.cell_empty && (slots[4] == null || (slots[4] != null && slots[4].stackSize < 64)))
{
return true;
}
return false;
}
public boolean isProcessing() {
return process > 0;
}
public void process() {
water -= 2;
sulfur -= 1;
power -= 25;
process++;
if(process >= processSpeed) {
slots[3].stackSize--;
if(slots[3].stackSize == 0)
{
slots[3] = null;
}
if(slots[4] == null)
{
slots[4] = new ItemStack(ModItems.cell_deuterium);
} else {
slots[4].stackSize++;
}
process = 0;
}
}
@Override
public void updateEntity() {
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[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.inf_water) {
water = maxFill;
}
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
if (canProcess()) {
process();
} else {
process = 0;
}
}
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new ContainerMachineDeuterium(player.inventory, this);
}
@Override
@SideOnly(Side.CLIENT)
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new GUIMachineDeuterium(player.inventory, this);
}
}

View File

@ -14,7 +14,6 @@ import com.hbm.tileentity.TileEntityTickingBase;
import api.hbm.energy.IEnergyUser;
import api.hbm.entity.IRadarDetectable;
import api.hbm.entity.IRadarDetectable.RadarTargetType;
import cpw.mods.fml.client.config.GuiEditArrayEntries;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

View File

@ -19,7 +19,6 @@ import cpw.mods.fml.common.Optional;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.SimpleComponent;
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidAcceptor, IFluidStandardReceiver, SimpleComponent {

View File

@ -0,0 +1,189 @@
package com.hbm.util;
import java.util.Iterator;
import java.util.Map;
import cpw.mods.fml.relauncher.ReflectionHelper;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.StatBase;
import net.minecraft.stats.StatCrafting;
import net.minecraft.stats.StatList;
import net.minecraft.util.ChatComponentTranslation;
public class StatHelper {
public static Map publicReferenceToOneshotStatListPleaseAllPointAndLaugh;
/**
* This is probably the worst fucking way of doing this, but it's the only one I could think of that works.
* In short: stats are hilariously broken.
* Minecraft registers them at the earliest point during startup right after blocks and items are registered.
* The problem in that? Item remapping. Modded items probably don't even exist at that point and even if they did,
* the system would break because modded items have dynamic IDs and the stats register fixed IDs instead of item instances.
* What did forge do to solve this issue? Well nothing, of course! The injected bits comment on that in vanilla's stat
* registering code, but instead of fixing anything it jsut slaps a fat "TODO" onto it. Wow! Really helpful!
*
* So what do we do? Every time the world starts and we know the IDs are now correct, we smack that fucker up nice and good.
* All ID-bound stats get deep-cleaned out of this mess and registered 1:1 again. Is this terrible and prine to breaking with
* mods that do their own stat handling? Hard to say, but the possibility is there.
*/
public static void resetStatShitFuck() {
publicReferenceToOneshotStatListPleaseAllPointAndLaugh = ReflectionHelper.getPrivateValue(StatList.class, null, "oneShotStats");
for(int i = 0; i < StatList.objectCraftStats.length; i++) StatList.objectCraftStats[i] = null;
for(int i = 0; i < StatList.mineBlockStatArray.length; i++) StatList.mineBlockStatArray[i] = null;
for(int i = 0; i < StatList.objectUseStats.length; i++) StatList.objectUseStats[i] = null;
for(int i = 0; i < StatList.objectBreakStats.length; i++) StatList.objectBreakStats[i] = null;
StatList.objectMineStats.clear();
StatList.itemStats.clear();
initCraftItemStats();
initBlockMineStats();
initItemUseStats();
initItemBreakStats();
}
private static void initCraftItemStats() {
/*HashSet hashset = new HashSet();
Iterator iterator = CraftingManager.getInstance().getRecipeList().iterator();
while(iterator.hasNext()) {
IRecipe irecipe = (IRecipe) iterator.next();
if(irecipe.getRecipeOutput() != null) {
hashset.add(irecipe.getRecipeOutput().getItem());
}
}
iterator = FurnaceRecipes.smelting().getSmeltingList().values().iterator();
while(iterator.hasNext()) {
ItemStack itemstack = (ItemStack) iterator.next();
hashset.add(itemstack.getItem());
}
iterator = hashset.iterator();
while(iterator.hasNext()) {
Item item = (Item) iterator.next();
if(item != null) {
int i = Item.getIdFromItem(item);
StatList.objectCraftStats[i] = registerStat(new StatCrafting("stat.craftItem." + i, new ChatComponentTranslation("stat.craftItem", new Object[] { (new ItemStack(item)).func_151000_E() }), item));
}
}*/
Iterator iterator = Item.itemRegistry.iterator();
while(iterator.hasNext()) {
Item item = (Item) iterator.next();
if(item != null) {
int i = Item.getIdFromItem(item);
StatList.objectCraftStats[i] = registerStat(new StatCrafting("stat.craftItem." + i, new ChatComponentTranslation("stat.craftItem", new Object[] { (new ItemStack(item)).func_151000_E() }), item));
}
}
replaceAllSimilarBlocks(StatList.objectCraftStats);
}
private static void initBlockMineStats() {
Iterator iterator = Block.blockRegistry.iterator();
while(iterator.hasNext()) {
Block block = (Block) iterator.next();
if(Item.getItemFromBlock(block) != null) {
int i = Block.getIdFromBlock(block);
if(block.getEnableStats()) {
StatList.mineBlockStatArray[i] = registerStat(new StatCrafting("stat.mineBlock." + i, new ChatComponentTranslation("stat.mineBlock", new Object[] { (new ItemStack(block)).func_151000_E() }), Item.getItemFromBlock(block)));
StatList.objectMineStats.add((StatCrafting) StatList.mineBlockStatArray[i]);
}
}
}
replaceAllSimilarBlocks(StatList.mineBlockStatArray);
}
private static void initItemUseStats() {
Iterator iterator = Item.itemRegistry.iterator();
while(iterator.hasNext()) {
Item item = (Item) iterator.next();
if(item != null) {
int i = Item.getIdFromItem(item);
StatList.objectUseStats[i] = registerStat(new StatCrafting("stat.useItem." + i, new ChatComponentTranslation("stat.useItem", new Object[] { (new ItemStack(item)).func_151000_E() }), item));
if(!(item instanceof ItemBlock)) {
StatList.itemStats.add((StatCrafting) StatList.objectUseStats[i]);
}
}
}
replaceAllSimilarBlocks(StatList.objectUseStats);
}
private static void initItemBreakStats() {
Iterator iterator = Item.itemRegistry.iterator();
while(iterator.hasNext()) {
Item item = (Item) iterator.next();
if(item != null) {
int i = Item.getIdFromItem(item);
if(item.isDamageable()) {
StatList.objectBreakStats[i] = registerStat(new StatCrafting("stat.breakItem." + i, new ChatComponentTranslation("stat.breakItem", new Object[] { (new ItemStack(item)).func_151000_E() }), item));
}
}
}
replaceAllSimilarBlocks(StatList.objectBreakStats);
}
private static void replaceAllSimilarBlocks(StatBase[] stats) {
func_151180_a(stats, Blocks.water, Blocks.flowing_water);
func_151180_a(stats, Blocks.lava, Blocks.flowing_lava);
func_151180_a(stats, Blocks.lit_pumpkin, Blocks.pumpkin);
func_151180_a(stats, Blocks.lit_furnace, Blocks.furnace);
func_151180_a(stats, Blocks.lit_redstone_ore, Blocks.redstone_ore);
func_151180_a(stats, Blocks.powered_repeater, Blocks.unpowered_repeater);
func_151180_a(stats, Blocks.powered_comparator, Blocks.unpowered_comparator);
func_151180_a(stats, Blocks.redstone_torch, Blocks.unlit_redstone_torch);
func_151180_a(stats, Blocks.lit_redstone_lamp, Blocks.redstone_lamp);
func_151180_a(stats, Blocks.red_mushroom, Blocks.brown_mushroom);
func_151180_a(stats, Blocks.double_stone_slab, Blocks.stone_slab);
func_151180_a(stats, Blocks.double_wooden_slab, Blocks.wooden_slab);
func_151180_a(stats, Blocks.grass, Blocks.dirt);
func_151180_a(stats, Blocks.farmland, Blocks.dirt);
}
private static void func_151180_a(StatBase[] stats, Block block, Block similarBlock) {
int i = Block.getIdFromBlock(block);
int j = Block.getIdFromBlock(similarBlock);
if(stats[i] != null && stats[j] == null) {
stats[j] = stats[i];
} else {
StatList.allStats.remove(stats[i]);
StatList.objectMineStats.remove(stats[i]);
StatList.generalStats.remove(stats[i]);
stats[i] = stats[j];
}
}
private static StatBase registerStat(StatBase stat) {
if(publicReferenceToOneshotStatListPleaseAllPointAndLaugh.containsKey(stat.statId)) {
publicReferenceToOneshotStatListPleaseAllPointAndLaugh.remove(stat.statId);
}
StatList.allStats.add(stat);
publicReferenceToOneshotStatListPleaseAllPointAndLaugh.put(stat.statId, stat);
return stat;
}
}