Major Refactors
This commit is contained in:
parent
84fef1c4cf
commit
f293f55c6b
67 changed files with 431 additions and 937 deletions
|
|
@ -5,23 +5,20 @@ import com.oitsjustjose.criss_cross.lib.CreativeTab;
|
|||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.lib.LibBlocks;
|
||||
import com.oitsjustjose.criss_cross.lib.LibItems;
|
||||
import com.oitsjustjose.criss_cross.recipes.MachineRecipes;
|
||||
import com.oitsjustjose.criss_cross.recipes.CraftingRecipes;
|
||||
import com.oitsjustjose.criss_cross.recipes.MachineRecipes;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
import com.oitsjustjose.criss_cross.util.CommonProxy;
|
||||
import com.oitsjustjose.criss_cross.util.LogHelper;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
import net.minecraftforge.fml.common.Mod.Instance;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@Mod(modid = Lib.MODID, name = Lib.NAME, version = Lib.VERSION, guiFactory = Lib.GUI_FACTORY, acceptedMinecraftVersions = "1.8.8, 1.8.9")
|
||||
public class CrissCross
|
||||
|
|
@ -39,21 +36,21 @@ public class CrissCross
|
|||
{
|
||||
Config.init(event.getSuggestedConfigurationFile());
|
||||
MinecraftForge.EVENT_BUS.register(new Config());
|
||||
proxy.preInit();
|
||||
CommonProxy.preInit();
|
||||
|
||||
LibBlocks.init();
|
||||
LibItems.init();
|
||||
CraftingRecipes.init();
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
MachineRecipes.init();
|
||||
|
||||
|
||||
if (event.getSide().isClient())
|
||||
ClientProxy.init();
|
||||
|
||||
|
||||
LogHelper.info("Successfully loaded!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,30 +16,29 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
|||
public class BlockAtmosManipulator extends BlockMachineBase
|
||||
{
|
||||
private static String unlocName = "AtmosManipulator";
|
||||
|
||||
public BlockAtmosManipulator()
|
||||
{
|
||||
super(unlocName, Material.iron);
|
||||
GameRegistry.registerTileEntity(TileAtmosManipulator.class, unlocName);
|
||||
GameRegistry.registerBlock(this, unlocName.toLowerCase());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TileAtmosManipulator();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
if (world.isRemote)
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
TileAtmosManipulator tile = (TileAtmosManipulator) world.getTileEntity(pos);
|
||||
if(tile != null)
|
||||
if (tile != null)
|
||||
player.openGui(CrissCross.instance, GUIHandler.AtmosManipulator, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,18 @@
|
|||
package com.oitsjustjose.criss_cross.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileCobblegen;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockCobblegen extends BlockMachineBase
|
||||
{
|
||||
|
|
@ -60,9 +50,7 @@ public class BlockCobblegen extends BlockMachineBase
|
|||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
TileCobblegen tile = (TileCobblegen) world.getTileEntity(pos);
|
||||
|
|
|
|||
|
|
@ -1,29 +1,18 @@
|
|||
package com.oitsjustjose.criss_cross.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileCropomator;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockCropomator extends BlockMachineBase
|
||||
{
|
||||
|
|
@ -61,9 +50,7 @@ public class BlockCropomator extends BlockMachineBase
|
|||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
TileCropomator tile = (TileCropomator) world.getTileEntity(pos);
|
||||
|
|
|
|||
|
|
@ -1,28 +1,18 @@
|
|||
package com.oitsjustjose.criss_cross.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileElectroextractor;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockElectroextractor extends BlockMachineBase
|
||||
{
|
||||
|
|
@ -60,9 +50,7 @@ public class BlockElectroextractor extends BlockMachineBase
|
|||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
TileElectroextractor tile = (TileElectroextractor) world.getTileEntity(pos);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import net.minecraft.block.properties.PropertyDirection;
|
|||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
|
@ -36,7 +35,7 @@ public class BlockMachineBase extends BlockContainer
|
|||
this.setStepSound(soundTypeMetal);
|
||||
this.setUnlocalizedName(Lib.MODID + "." + unlocName);
|
||||
this.setCreativeTab(CrissCross.CCTab);
|
||||
this.unlocalizedName = unlocName;
|
||||
BlockMachineBase.unlocalizedName = unlocName;
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
|
||||
Lib.add(this);
|
||||
}
|
||||
|
|
@ -46,12 +45,12 @@ public class BlockMachineBase extends BlockContainer
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
|
|
@ -78,6 +77,7 @@ public class BlockMachineBase extends BlockContainer
|
|||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IBlockState getStateForEntityRender(IBlockState state)
|
||||
{
|
||||
|
|
@ -90,9 +90,7 @@ public class BlockMachineBase extends BlockContainer
|
|||
EnumFacing enumfacing = EnumFacing.getFront(meta);
|
||||
|
||||
if (enumfacing.getAxis() == EnumFacing.Axis.Y)
|
||||
{
|
||||
enumfacing = EnumFacing.NORTH;
|
||||
}
|
||||
|
||||
return this.getDefaultState().withProperty(FACING, enumfacing);
|
||||
}
|
||||
|
|
@ -100,7 +98,7 @@ public class BlockMachineBase extends BlockContainer
|
|||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return ((EnumFacing) state.getValue(FACING)).getIndex();
|
||||
return state.getValue(FACING).getIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -114,27 +112,19 @@ public class BlockMachineBase extends BlockContainer
|
|||
{
|
||||
world.setBlockState(pos, state.withProperty(FACING, entity.getHorizontalFacing().getOpposite()), 2);
|
||||
|
||||
int l = MathHelper.floor_double((double) (entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
int l = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if (l == 0)
|
||||
{
|
||||
world.setBlockState(pos, state.getBlock().getStateFromMeta(2), 2);
|
||||
}
|
||||
|
||||
if (l == 1)
|
||||
{
|
||||
world.setBlockState(pos, state.getBlock().getStateFromMeta(5), 2);
|
||||
}
|
||||
|
||||
if (l == 2)
|
||||
{
|
||||
world.setBlockState(pos, state.getBlock().getStateFromMeta(3), 2);
|
||||
}
|
||||
|
||||
if (l == 3)
|
||||
{
|
||||
world.setBlockState(pos, state.getBlock().getStateFromMeta(4), 2);
|
||||
}
|
||||
}
|
||||
|
||||
private void setDefaultFacing(World world, BlockPos pos, IBlockState state)
|
||||
|
|
@ -145,23 +135,15 @@ public class BlockMachineBase extends BlockContainer
|
|||
Block block1 = world.getBlockState(pos.south()).getBlock();
|
||||
Block block2 = world.getBlockState(pos.west()).getBlock();
|
||||
Block block3 = world.getBlockState(pos.east()).getBlock();
|
||||
EnumFacing enumfacing = (EnumFacing) state.getValue(FACING);
|
||||
EnumFacing enumfacing = state.getValue(FACING);
|
||||
if (enumfacing == EnumFacing.NORTH && block.isFullBlock() && !block1.isFullBlock())
|
||||
{
|
||||
enumfacing = EnumFacing.SOUTH;
|
||||
}
|
||||
else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock() && !block.isFullBlock())
|
||||
{
|
||||
enumfacing = EnumFacing.NORTH;
|
||||
}
|
||||
else if (enumfacing == EnumFacing.WEST && block2.isFullBlock() && !block3.isFullBlock())
|
||||
{
|
||||
enumfacing = EnumFacing.EAST;
|
||||
}
|
||||
else if (enumfacing == EnumFacing.EAST && block3.isFullBlock() && !block2.isFullBlock())
|
||||
{
|
||||
enumfacing = EnumFacing.WEST;
|
||||
}
|
||||
|
||||
world.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import com.oitsjustjose.criss_cross.tileentity.TileScribe;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
|
@ -31,31 +30,26 @@ public class BlockScribe extends BlockMachineBase
|
|||
GameRegistry.registerBlock(this, unlocName.toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
|
||||
{
|
||||
super.randomDisplayTick(worldIn, pos, state, rand);
|
||||
|
||||
for (int i = -2; i <= 2; ++i)
|
||||
{
|
||||
for (int j = -2; j <= 2; ++j)
|
||||
{
|
||||
if (i > -2 && i < 2 && j == -1)
|
||||
j = 2;
|
||||
|
||||
if (rand.nextInt(16) == 0)
|
||||
{
|
||||
for (int k = 0; k <= 1; ++k)
|
||||
{
|
||||
BlockPos blockpos = pos.add(i, k, j);
|
||||
|
||||
if (!worldIn.isAirBlock(pos.add(i / 2, 0, j / 2)))
|
||||
break;
|
||||
worldIn.spawnParticle(EnumParticleTypes.ENCHANTMENT_TABLE, (double) pos.getX() + 0.5D, (double) pos.getY() + 2.0D, (double) pos.getZ() + 0.5D, (double) ((float) i + rand.nextFloat()) - 0.5D, (double) ((float) k - rand.nextFloat() - 1.0F), (double) ((float) j + rand.nextFloat()) - 0.5D, new int[0]);
|
||||
worldIn.spawnParticle(EnumParticleTypes.ENCHANTMENT_TABLE, pos.getX() + 0.5D, pos.getY() + 2.0D, pos.getZ() + 0.5D, i + rand.nextFloat() - 0.5D, k - rand.nextFloat() - 1.0F, j + rand.nextFloat() - 0.5D, new int[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -83,9 +77,7 @@ public class BlockScribe extends BlockMachineBase
|
|||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
TileScribe tile = (TileScribe) world.getTileEntity(pos);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.oitsjustjose.criss_cross.blocks;
|
|||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileStonegen;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
@ -51,9 +50,7 @@ public class BlockStonegen extends BlockMachineBase
|
|||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
TileStonegen tile = (TileStonegen) world.getTileEntity(pos);
|
||||
|
|
|
|||
|
|
@ -1,28 +1,19 @@
|
|||
package com.oitsjustjose.criss_cross.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileWoodchipper;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockWoodchipper extends BlockMachineBase
|
||||
{
|
||||
|
|
@ -61,9 +52,7 @@ public class BlockWoodchipper extends BlockMachineBase
|
|||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
TileWoodchipper tile = (TileWoodchipper) world.getTileEntity(pos);
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
package com.oitsjustjose.criss_cross.container;
|
||||
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileAtmosManipulator;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileCobblegen;
|
||||
|
||||
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 ContainerAtmosManipulator extends Container
|
||||
{
|
||||
|
|
@ -22,7 +18,7 @@ public class ContainerAtmosManipulator extends Container
|
|||
this.player = player;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCraftGuiOpened(ICrafting crafting)
|
||||
{
|
||||
super.onCraftGuiOpened(crafting);
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ public class ContainerCobblegen extends Container
|
|||
this.addInventorySlots();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updateProgressBar(int timeType1, int timeType2)
|
||||
{
|
||||
|
|
@ -67,7 +68,7 @@ public class ContainerCobblegen extends Container
|
|||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.crafters.size(); ++i)
|
||||
{
|
||||
ICrafting crafting = (ICrafting) this.crafters.get(i);
|
||||
ICrafting crafting = this.crafters.get(i);
|
||||
|
||||
if (this.lastUseTime != this.cobblegen.processTime)
|
||||
crafting.sendProgressBarUpdate(this, 0, this.cobblegen.processTime);
|
||||
|
|
@ -85,7 +86,7 @@ public class ContainerCobblegen extends Container
|
|||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(slotID);
|
||||
Slot slot = this.inventorySlots.get(slotID);
|
||||
|
||||
if (slot != null && slot.getHasStack())
|
||||
{
|
||||
|
|
@ -95,9 +96,7 @@ public class ContainerCobblegen extends Container
|
|||
if (slotID == 2)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 3, 39, true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
}
|
||||
|
|
@ -106,47 +105,31 @@ public class ContainerCobblegen extends Container
|
|||
if (TileCobblegen.isValid(itemstack1))
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 0, 1, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (TileCobblegen.isItemFuel(itemstack1))
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (slotID >= 3 && slotID < 30)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(itemstack1, 3, 39, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == 0)
|
||||
{
|
||||
slot.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == itemstack.stackSize)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(player, itemstack1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,23 +35,18 @@ public class ContainerCropomator extends Container
|
|||
this.addInventorySlots();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updateProgressBar(int timeType1, int timeType2)
|
||||
{
|
||||
if (timeType1 == 0)
|
||||
{
|
||||
this.cropomator.processTime = timeType2;
|
||||
}
|
||||
|
||||
if (timeType1 == 1)
|
||||
{
|
||||
this.cropomator.catalystTime = timeType2;
|
||||
}
|
||||
|
||||
if (timeType1 == 2)
|
||||
{
|
||||
this.cropomator.catalystInUseTime = timeType2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -69,7 +64,7 @@ public class ContainerCropomator extends Container
|
|||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.crafters.size(); ++i)
|
||||
{
|
||||
ICrafting crafting = (ICrafting) this.crafters.get(i);
|
||||
ICrafting crafting = this.crafters.get(i);
|
||||
|
||||
if (this.lastUseTime != this.cropomator.processTime)
|
||||
crafting.sendProgressBarUpdate(this, 0, this.cropomator.processTime);
|
||||
|
|
@ -87,7 +82,7 @@ public class ContainerCropomator extends Container
|
|||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(slotID);
|
||||
Slot slot = this.inventorySlots.get(slotID);
|
||||
|
||||
if (slot != null && slot.getHasStack())
|
||||
{
|
||||
|
|
@ -97,9 +92,7 @@ public class ContainerCropomator extends Container
|
|||
if (slotID == 2)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 3, 39, true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
}
|
||||
|
|
@ -108,47 +101,31 @@ public class ContainerCropomator extends Container
|
|||
if (TileCropomator.isValid(itemstack1))
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 0, 1, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (TileCropomator.isItemCatalyst(itemstack1))
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (slotID >= 3 && slotID < 30)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(itemstack1, 3, 39, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == 0)
|
||||
{
|
||||
slot.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == itemstack.stackSize)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(player, itemstack1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,23 +35,18 @@ public class ContainerElectroextractor extends Container
|
|||
this.addInventorySlots();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updateProgressBar(int timeType1, int timeType2)
|
||||
{
|
||||
if (timeType1 == 0)
|
||||
{
|
||||
this.electroextractor.crushTime = timeType2;
|
||||
}
|
||||
|
||||
if (timeType1 == 1)
|
||||
{
|
||||
this.electroextractor.fuelTime = timeType2;
|
||||
}
|
||||
|
||||
if (timeType1 == 2)
|
||||
{
|
||||
this.electroextractor.fuelInUseTime = timeType2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -69,7 +64,7 @@ public class ContainerElectroextractor extends Container
|
|||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.crafters.size(); ++i)
|
||||
{
|
||||
ICrafting crafting = (ICrafting) this.crafters.get(i);
|
||||
ICrafting crafting = this.crafters.get(i);
|
||||
|
||||
if (this.lastUseTime != this.electroextractor.crushTime)
|
||||
crafting.sendProgressBarUpdate(this, 0, this.electroextractor.crushTime);
|
||||
|
|
@ -87,7 +82,7 @@ public class ContainerElectroextractor extends Container
|
|||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(slotID);
|
||||
Slot slot = this.inventorySlots.get(slotID);
|
||||
|
||||
if (slot != null && slot.getHasStack())
|
||||
{
|
||||
|
|
@ -97,9 +92,7 @@ public class ContainerElectroextractor extends Container
|
|||
if (slotID == 2)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 3, 39, true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
}
|
||||
|
|
@ -108,47 +101,31 @@ public class ContainerElectroextractor extends Container
|
|||
if (TileElectroextractor.isValid(itemstack1))
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 0, 1, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (TileElectroextractor.isItemEnergetic(itemstack1))
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (slotID >= 3 && slotID < 30)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(itemstack1, 3, 39, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == 0)
|
||||
{
|
||||
slot.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == itemstack.stackSize)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(player, itemstack1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,54 +22,39 @@ public class ContainerPouch extends Container
|
|||
|
||||
int i = 36;
|
||||
for (int j = 0; j < 6; j++)
|
||||
{
|
||||
for (int k = 0; k < 9; k++)
|
||||
{
|
||||
addSlotToContainer(new PouchSlot(player.inventory, k + j * 9, 8 + k * 18, 18 + j * 18, this.currentFilter));
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
for (int k = 0; k < 9; k++)
|
||||
{
|
||||
addSlotToContainer(new Slot(player.inventory, k + j * 9 + 9, 8 + k * 18, 104 + j * 18 + i));
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < 9; j++)
|
||||
{
|
||||
if (j == this.currentFilter)
|
||||
{
|
||||
addSlotToContainer(new PouchLockedSlot(player.inventory, j, 8 + j * 18, 162 + i));
|
||||
}
|
||||
else
|
||||
{
|
||||
addSlotToContainer(new Slot(player.inventory, j, 8 + j * 18, 162 + i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void retrySlotClick(int par1, int par2, boolean par3, EntityPlayer par4EntityPlayer)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer)
|
||||
{
|
||||
if ((par3 == 2) && (par2 == this.currentFilter))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
ItemStack filter = this.player.inventory.getStackInSlot(this.currentFilter);
|
||||
if ((filter == null) || (filter.getItem() != LibItems.pouch))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return super.slotClick(par1, par2, par3, par4EntityPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
||||
{
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(par2);
|
||||
Slot slot = this.inventorySlots.get(par2);
|
||||
if ((slot != null) && (slot.getHasStack()))
|
||||
{
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
|
|
@ -77,14 +62,10 @@ public class ContainerPouch extends Container
|
|||
if (par2 < 54)
|
||||
{
|
||||
if (!mergeItemStack(itemstack1, 54, this.inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!mergeItemStack(itemstack1, 0, 54, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (itemstack1.stackSize == 0)
|
||||
{
|
||||
slot.putStack(null);
|
||||
|
|
@ -95,6 +76,7 @@ public class ContainerPouch extends Container
|
|||
return itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
ItemStack filter = this.player.inventory.getStackInSlot(this.currentFilter);
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ public class ContainerScribe extends Container
|
|||
this.addInventorySlots();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updateProgressBar(int timeType1, int timeType2)
|
||||
{
|
||||
|
|
@ -67,7 +68,7 @@ public class ContainerScribe extends Container
|
|||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.crafters.size(); ++i)
|
||||
{
|
||||
ICrafting crafting = (ICrafting) this.crafters.get(i);
|
||||
ICrafting crafting = this.crafters.get(i);
|
||||
|
||||
if (this.lastUseTime != this.scribe.writingTime)
|
||||
crafting.sendProgressBarUpdate(this, 0, this.scribe.writingTime);
|
||||
|
|
@ -85,7 +86,7 @@ public class ContainerScribe extends Container
|
|||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(slotID);
|
||||
Slot slot = this.inventorySlots.get(slotID);
|
||||
|
||||
if (slot != null && slot.getHasStack())
|
||||
{
|
||||
|
|
@ -95,9 +96,7 @@ public class ContainerScribe extends Container
|
|||
if (slotID == 2)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 3, 39, true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
}
|
||||
|
|
@ -106,47 +105,31 @@ public class ContainerScribe extends Container
|
|||
if (TileScribe.isValidForScribe(itemstack1))
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 0, 1, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (TileScribe.isBook(itemstack1))
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (slotID >= 3 && slotID < 30)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(itemstack1, 3, 39, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == 0)
|
||||
{
|
||||
slot.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == itemstack.stackSize)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(player, itemstack1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ public class ContainerStonegen extends Container
|
|||
this.addInventorySlots();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updateProgressBar(int timeType1, int timeType2)
|
||||
{
|
||||
|
|
@ -67,7 +68,7 @@ public class ContainerStonegen extends Container
|
|||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.crafters.size(); ++i)
|
||||
{
|
||||
ICrafting crafting = (ICrafting) this.crafters.get(i);
|
||||
ICrafting crafting = this.crafters.get(i);
|
||||
|
||||
if (this.lastUseTime != this.Stonegen.processTime)
|
||||
crafting.sendProgressBarUpdate(this, 0, this.Stonegen.processTime);
|
||||
|
|
@ -85,7 +86,7 @@ public class ContainerStonegen extends Container
|
|||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(slotID);
|
||||
Slot slot = this.inventorySlots.get(slotID);
|
||||
|
||||
if (slot != null && slot.getHasStack())
|
||||
{
|
||||
|
|
@ -95,9 +96,7 @@ public class ContainerStonegen extends Container
|
|||
if (slotID == 2)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 3, 39, true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
}
|
||||
|
|
@ -106,47 +105,31 @@ public class ContainerStonegen extends Container
|
|||
if (TileStonegen.isValid(itemstack1))
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 0, 1, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (TileStonegen.isItemFuel(itemstack1))
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (slotID >= 3 && slotID < 30)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(itemstack1, 3, 39, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == 0)
|
||||
{
|
||||
slot.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == itemstack.stackSize)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(player, itemstack1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ public class ContainerWoodchipper extends Container
|
|||
this.addInventorySlots();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updateProgressBar(int timeType1, int timeType2)
|
||||
{
|
||||
|
|
@ -67,7 +68,7 @@ public class ContainerWoodchipper extends Container
|
|||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.crafters.size(); ++i)
|
||||
{
|
||||
ICrafting crafting = (ICrafting) this.crafters.get(i);
|
||||
ICrafting crafting = this.crafters.get(i);
|
||||
|
||||
if (this.lastUseTime != this.woodchipper.processTime)
|
||||
crafting.sendProgressBarUpdate(this, 0, this.woodchipper.processTime);
|
||||
|
|
@ -85,7 +86,7 @@ public class ContainerWoodchipper extends Container
|
|||
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
|
||||
{
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(slotID);
|
||||
Slot slot = this.inventorySlots.get(slotID);
|
||||
|
||||
if (slot != null && slot.getHasStack())
|
||||
{
|
||||
|
|
@ -95,9 +96,7 @@ public class ContainerWoodchipper extends Container
|
|||
if (slotID == 2)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 3, 39, true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
}
|
||||
|
|
@ -106,47 +105,31 @@ public class ContainerWoodchipper extends Container
|
|||
if (TileWoodchipper.isValidForWoodchipper(itemstack1))
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 0, 1, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (TileWoodchipper.isItemFuel(itemstack1))
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (slotID >= 3 && slotID < 30)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(itemstack1, 3, 39, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == 0)
|
||||
{
|
||||
slot.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == itemstack.stackSize)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(player, itemstack1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ public class MachineOutputSlot extends Slot
|
|||
public ItemStack decrStackSize(int slot)
|
||||
{
|
||||
if (this.getHasStack())
|
||||
{
|
||||
this.temp += Math.min(slot, this.getStack().stackSize);
|
||||
}
|
||||
|
||||
return super.decrStackSize(slot);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,11 +12,13 @@ public class PouchLockedSlot extends Slot
|
|||
super(par1iInventory, par2, par3, par4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack par1ItemStack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public class PouchSlot extends Slot
|
|||
this.filterIndex = filterIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack()
|
||||
{
|
||||
ItemStack filter = this.filterInv.getStackInSlot(this.filterIndex);
|
||||
|
|
@ -42,6 +43,7 @@ public class PouchSlot extends Slot
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int par1)
|
||||
{
|
||||
ItemStack curItem = getStack();
|
||||
|
|
@ -55,37 +57,31 @@ public class PouchSlot extends Slot
|
|||
}
|
||||
ItemStack itemstack = curItem.splitStack(par1);
|
||||
if (curItem.stackSize == 0)
|
||||
{
|
||||
putStack(null);
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getHasStack()
|
||||
{
|
||||
return getStack() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putStack(ItemStack par1ItemStack)
|
||||
{
|
||||
ItemStack filter = this.filterInv.getStackInSlot(this.filterIndex);
|
||||
if (filter == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
NBTTagCompound tags = filter.getTagCompound();
|
||||
if (par1ItemStack != null)
|
||||
{
|
||||
if (tags == null)
|
||||
{
|
||||
tags = new NBTTagCompound();
|
||||
}
|
||||
if (tags.hasKey("items_" + getSlotIndex()))
|
||||
{
|
||||
tags.removeTag("items_" + getSlotIndex());
|
||||
}
|
||||
NBTTagCompound itemTags = new NBTTagCompound();
|
||||
par1ItemStack.writeToNBT(itemTags);
|
||||
tags.setTag("items_" + getSlotIndex(), itemTags);
|
||||
|
|
@ -95,34 +91,24 @@ public class PouchSlot extends Slot
|
|||
{
|
||||
tags.removeTag("items_" + getSlotIndex());
|
||||
if (tags.hasNoTags())
|
||||
{
|
||||
filter.setTagCompound(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
filter.setTagCompound(tags);
|
||||
}
|
||||
}
|
||||
if (par1ItemStack != null)
|
||||
{
|
||||
this.curStack = par1ItemStack;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.curStack = null;
|
||||
}
|
||||
if (!iterating)
|
||||
{
|
||||
onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChanged()
|
||||
{
|
||||
checking = true;
|
||||
ItemStack oldItem = getStack();
|
||||
checking = false;
|
||||
boolean flag = false;
|
||||
if (!ItemStack.areItemStacksEqual(oldItem, this.curStack))
|
||||
{
|
||||
iterating = true;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ package com.oitsjustjose.criss_cross.event;
|
|||
import com.oitsjustjose.criss_cross.lib.LibItems;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.util.FoodStats;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
|
|
@ -18,12 +16,10 @@ public class InfiniAppleEvent
|
|||
EntityPlayer player = event.entityPlayer;
|
||||
|
||||
if (player.inventory.hasItem(LibItems.infiniApple))
|
||||
{
|
||||
if (player.getFoodStats() != null)
|
||||
{
|
||||
player.getFoodStats().setFoodLevel(20);
|
||||
player.getFoodStats().setFoodSaturationLevel(5.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
package com.oitsjustjose.criss_cross.event;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.oitsjustjose.criss_cross.items.ItemPouch;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class PouchCleanEvent
|
||||
|
|
@ -15,7 +14,7 @@ public class PouchCleanEvent
|
|||
@SubscribeEvent
|
||||
public void registerEvent(PlayerInteractEvent event)
|
||||
{
|
||||
if (event.action != event.action.RIGHT_CLICK_BLOCK || event.world.getBlockState(event.pos) == null)
|
||||
if (event.action != Action.RIGHT_CLICK_BLOCK || event.world.getBlockState(event.pos) == null)
|
||||
return;
|
||||
if (event.entityPlayer.getHeldItem() == null || !(event.entityPlayer.getHeldItem().getItem() instanceof ItemPouch))
|
||||
return;
|
||||
|
|
@ -23,17 +22,13 @@ public class PouchCleanEvent
|
|||
EntityPlayer player = event.entityPlayer;
|
||||
ItemPouch pouch = (ItemPouch) player.getHeldItem().getItem();
|
||||
World world = event.world;
|
||||
Random rand = world.rand;
|
||||
|
||||
if (world.getBlockState(event.pos).getBlock() != Blocks.cauldron || event.world.getBlockState(event.pos) == Blocks.cauldron.getStateFromMeta(0))
|
||||
return;
|
||||
else
|
||||
else if (pouch.hasColor(player.getHeldItem()))
|
||||
{
|
||||
if (pouch.hasColor(player.getHeldItem()))
|
||||
{
|
||||
pouch.removeColor(player.getHeldItem());
|
||||
world.setBlockState(event.pos, Blocks.cauldron.getStateFromMeta(Blocks.cauldron.getMetaFromState(world.getBlockState(event.pos)) - 1));
|
||||
}
|
||||
pouch.removeColor(player.getHeldItem());
|
||||
world.setBlockState(event.pos, Blocks.cauldron.getStateFromMeta(Blocks.cauldron.getMetaFromState(world.getBlockState(event.pos)) - 1));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import com.oitsjustjose.criss_cross.items.ItemMantleSmasher;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,13 +24,12 @@ public class ConfigGUI extends GuiConfig
|
|||
private static List<IConfigElement> getConfigElements()
|
||||
{
|
||||
List<IConfigElement> list = Lists.newArrayList();
|
||||
|
||||
|
||||
list.add(new ConfigElement(Config.Cropomator));
|
||||
list.add(new ConfigElement(Config.Electroextractor));
|
||||
list.add(new ConfigElement(Config.Woodchipper));
|
||||
list.add(new ConfigElement(Config.OtherMachines));
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,10 @@ import java.io.IOException;
|
|||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.ibm.icu.impl.ICUService.Key;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileAtmosManipulator;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
|
@ -55,17 +53,13 @@ public class GUIAtmosManipulator extends GuiScreen
|
|||
protected void keyTyped(char typedChar, int keyCode) throws IOException
|
||||
{
|
||||
if (keyCode == mc.gameSettings.keyBindInventory.getKeyCode())
|
||||
{
|
||||
this.mc.displayGuiScreen(null);
|
||||
}
|
||||
if (keyCode == 1)
|
||||
{
|
||||
this.mc.displayGuiScreen((GuiScreen) null);
|
||||
|
||||
if (this.mc.currentScreen == null)
|
||||
{
|
||||
this.mc.setIngameFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,12 +22,14 @@ public class GUICobblegen extends GuiContainer
|
|||
this.cobblegen = cobblegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.cobblegen"), 30, 7, 4210752);
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
|
|
|||
|
|
@ -3,11 +3,9 @@ package com.oitsjustjose.criss_cross.gui;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.oitsjustjose.criss_cross.container.ContainerCropomator;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileCropomator;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
|
@ -24,12 +22,14 @@ public class GUICropomator extends GuiContainer
|
|||
this.cropomator = cropomator;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.cropomator"), 55, 7, 4210752);
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
|
|
|||
|
|
@ -22,12 +22,14 @@ public class GUIElectroextractor extends GuiContainer
|
|||
this.electroextractor = electroextractor;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.electroextractor"), 50, 7, 4210752);
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
|
|
|||
|
|
@ -34,12 +34,12 @@ public class GUIHandler implements IGuiHandler
|
|||
public static final int Scribe = 6;
|
||||
public static final int AtmosManipulator = 7;
|
||||
|
||||
@Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
|
||||
|
||||
if (tile != null)
|
||||
{
|
||||
switch (ID)
|
||||
{
|
||||
case 0: // Cropomator
|
||||
|
|
@ -57,7 +57,6 @@ public class GUIHandler implements IGuiHandler
|
|||
case 7: // AtmosManipulator
|
||||
return new ContainerAtmosManipulator(player, ((TileAtmosManipulator) tile));
|
||||
}
|
||||
}
|
||||
|
||||
if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemPouch)
|
||||
return new ContainerPouch(player, player.inventory.currentItem);
|
||||
|
|
@ -71,7 +70,6 @@ public class GUIHandler implements IGuiHandler
|
|||
TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
|
||||
|
||||
if (tile != null)
|
||||
{
|
||||
switch (ID)
|
||||
{
|
||||
case 0: // Cropomator
|
||||
|
|
@ -89,7 +87,6 @@ public class GUIHandler implements IGuiHandler
|
|||
case 7: // AtmosManipulator
|
||||
return new GUIAtmosManipulator(player, ((TileAtmosManipulator) tile));
|
||||
}
|
||||
}
|
||||
|
||||
if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemPouch)
|
||||
return new GUIPouch(player, player.inventory.currentItem);
|
||||
|
|
|
|||
|
|
@ -29,12 +29,14 @@ public class GUIPouch extends GuiContainer
|
|||
this.ySize = 222;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
this.fontRendererObj.drawString(name, 7, 8, 4210752);
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
|
|
|||
|
|
@ -22,12 +22,14 @@ public class GUIScribe extends GuiContainer
|
|||
this.scribe = scribe;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.scribe"), 68, 7, 4210752);
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
|
|
|||
|
|
@ -22,12 +22,14 @@ public class GUIStonegen extends GuiContainer
|
|||
this.stonegen = stonegen;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.stonegen"), 30, 7, 4210752);
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
|
|
|||
|
|
@ -22,12 +22,14 @@ public class GUIWoodchipper extends GuiContainer
|
|||
this.woodchipper = woodchipper;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.woodchipper"), 55, 7, 4210752);
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import java.util.List;
|
|||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
|
|
|
|||
|
|
@ -15,10 +15,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldSettings;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ItemMantleSmasher extends ItemPickaxe
|
||||
|
|
@ -54,7 +51,6 @@ public class ItemMantleSmasher extends ItemPickaxe
|
|||
return super.onBlockStartBreak(itemstack, pos, player);
|
||||
|
||||
if (itemstack.getItem() instanceof ItemMantleSmasher)
|
||||
{
|
||||
if (side == EnumFacing.NORTH || side == EnumFacing.SOUTH)
|
||||
{
|
||||
breakBlock(world, player, pos.up().west());
|
||||
|
|
@ -88,7 +84,6 @@ public class ItemMantleSmasher extends ItemPickaxe
|
|||
breakBlock(world, player, pos.south());
|
||||
breakBlock(world, player, pos.south().west());
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onBlockStartBreak(itemstack, pos, player);
|
||||
}
|
||||
|
|
@ -104,7 +99,6 @@ public class ItemMantleSmasher extends ItemPickaxe
|
|||
Material m = block.getMaterial();
|
||||
|
||||
if (m == Material.ground || m == Material.grass || m == Material.sand || m == Material.rock)
|
||||
{
|
||||
if (block.getBlockHardness(world, pos) != -1.0F)
|
||||
{
|
||||
block.onBlockHarvested(world, pos, state, player);
|
||||
|
|
@ -118,7 +112,6 @@ public class ItemMantleSmasher extends ItemPickaxe
|
|||
}
|
||||
world.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,6 @@ import java.util.List;
|
|||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.util.ClientProxy;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
@ -51,65 +50,60 @@ public class ItemModBuckets extends Item
|
|||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, true);
|
||||
|
||||
if (movingobjectposition == null)
|
||||
{
|
||||
return itemstack;
|
||||
}
|
||||
else
|
||||
else if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
BlockPos blockpos = movingobjectposition.getBlockPos();
|
||||
IBlockState state = world.getBlockState(blockpos);
|
||||
BlockPos blockpos = movingobjectposition.getBlockPos();
|
||||
IBlockState state = world.getBlockState(blockpos);
|
||||
|
||||
if (!world.isBlockModifiable(player, blockpos))
|
||||
if (!world.isBlockModifiable(player, blockpos))
|
||||
return itemstack;
|
||||
|
||||
if (!player.canPlayerEdit(blockpos, movingobjectposition.sideHit, itemstack))
|
||||
return itemstack;
|
||||
|
||||
if (itemstack.getItemDamage() == 1)
|
||||
{
|
||||
Material material = state.getBlock().getMaterial();
|
||||
int meta = state.getBlock().getMetaFromState(state);
|
||||
|
||||
if (material.isLiquid() && meta == 0)
|
||||
world.setBlockToAir(blockpos);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (world.getBlockState(blockpos).getBlock().getMaterial() == Material.lava || world.getBlockState(blockpos).getBlock().getMaterial() == Material.water)
|
||||
return itemstack;
|
||||
|
||||
int x = blockpos.getX();
|
||||
int y = blockpos.getY();
|
||||
int z = blockpos.getZ();
|
||||
|
||||
if (movingobjectposition.sideHit == EnumFacing.DOWN)
|
||||
--y;
|
||||
|
||||
if (movingobjectposition.sideHit == EnumFacing.UP)
|
||||
++y;
|
||||
|
||||
if (movingobjectposition.sideHit == EnumFacing.WEST)
|
||||
--x;
|
||||
|
||||
if (movingobjectposition.sideHit == EnumFacing.EAST)
|
||||
++x;
|
||||
|
||||
if (movingobjectposition.sideHit == EnumFacing.NORTH)
|
||||
--z;
|
||||
|
||||
if (movingobjectposition.sideHit == EnumFacing.SOUTH)
|
||||
++z;
|
||||
|
||||
blockpos = new BlockPos(x, y, z);
|
||||
if (!player.canPlayerEdit(blockpos, movingobjectposition.sideHit, itemstack))
|
||||
return itemstack;
|
||||
|
||||
if (itemstack.getItemDamage() == 1)
|
||||
{
|
||||
Material material = state.getBlock().getMaterial();
|
||||
int meta = state.getBlock().getMetaFromState(state);
|
||||
|
||||
if (material.isLiquid() && meta == 0)
|
||||
world.setBlockToAir(blockpos);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (world.getBlockState(blockpos).getBlock().getMaterial() == Material.lava || world.getBlockState(blockpos).getBlock().getMaterial() == Material.water)
|
||||
return itemstack;
|
||||
|
||||
int x = blockpos.getX();
|
||||
int y = blockpos.getY();
|
||||
int z = blockpos.getZ();
|
||||
|
||||
if (movingobjectposition.sideHit == EnumFacing.DOWN)
|
||||
--y;
|
||||
|
||||
if (movingobjectposition.sideHit == EnumFacing.UP)
|
||||
++y;
|
||||
|
||||
if (movingobjectposition.sideHit == EnumFacing.WEST)
|
||||
--x;
|
||||
|
||||
if (movingobjectposition.sideHit == EnumFacing.EAST)
|
||||
++x;
|
||||
|
||||
if (movingobjectposition.sideHit == EnumFacing.NORTH)
|
||||
--z;
|
||||
|
||||
if (movingobjectposition.sideHit == EnumFacing.SOUTH)
|
||||
++z;
|
||||
|
||||
blockpos = new BlockPos(x, y, z);
|
||||
if (!player.canPlayerEdit(blockpos, movingobjectposition.sideHit, itemstack))
|
||||
return itemstack;
|
||||
|
||||
if (itemstack.getItemDamage() == 0)
|
||||
world.setBlockState(blockpos, Blocks.flowing_water.getDefaultState(), 3);
|
||||
}
|
||||
if (itemstack.getItemDamage() == 0)
|
||||
world.setBlockState(blockpos, Blocks.flowing_water.getDefaultState(), 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
|||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public class CropomatorCategory implements IRecipeCategory
|
|||
private static final int INPUT_SLOT = 0;
|
||||
private static final int OUTPUT_SLOT = 1;
|
||||
private static final int FUEL_SLOT = 2;
|
||||
|
||||
|
||||
IDrawableStatic fuelDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUICropomator.backgroundTexture, 176, 0, 14, 14);
|
||||
IDrawableStatic progressDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUICropomator.backgroundTexture, 177, 14, 23, 16);
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ public class CropomatorCategory implements IRecipeCategory
|
|||
protected final IDrawableAnimated progress = JEIPluginManager.jeiHelper.getGuiHelper().createAnimatedDrawable(progressDrawable, Config.cropomatorProcessTime, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
@Nonnull
|
||||
private final String localizedName = StatCollector.translateToLocal("recipe.cropomator");
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
|
|
|
|||
|
|
@ -10,30 +10,30 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
|||
public class CropomatorRecipeHandler implements IRecipeHandler<CropomatorRecipeJEI>
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<CropomatorRecipeJEI> getRecipeClass()
|
||||
{
|
||||
return CropomatorRecipeJEI.class;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<CropomatorRecipeJEI> getRecipeClass()
|
||||
{
|
||||
return CropomatorRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Lib.CROPOMATOR_UID;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Lib.CROPOMATOR_UID;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull CropomatorRecipeJEI recipe)
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull CropomatorRecipeJEI recipe)
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull CropomatorRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
|
||||
}
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull CropomatorRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -12,34 +12,33 @@ import net.minecraft.item.ItemStack;
|
|||
public class CropomatorRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack input;
|
||||
@Nonnull
|
||||
private final ItemStack input;
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
|
||||
public CropomatorRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack output)
|
||||
{
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
}
|
||||
public CropomatorRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack output)
|
||||
{
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs()
|
||||
{
|
||||
return Collections.singletonList(input);
|
||||
}
|
||||
@Override
|
||||
public List getInputs()
|
||||
{
|
||||
return Collections.singletonList(input);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getOutputs()
|
||||
{
|
||||
return Collections.singletonList(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
||||
}
|
||||
@Override
|
||||
public List getOutputs()
|
||||
{
|
||||
return Collections.singletonList(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -21,10 +21,10 @@ public class ElectroextractorCategory implements IRecipeCategory
|
|||
private static final int INPUT_SLOT = 0;
|
||||
private static final int OUTPUT_SLOT = 1;
|
||||
private static final int FUEL_SLOT = 2;
|
||||
|
||||
|
||||
IDrawableStatic fuelDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIElectroextractor.backgroundTexture, 176, 0, 14, 14);
|
||||
IDrawableStatic progressDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIElectroextractor.backgroundTexture, 177, 14, 23, 16);
|
||||
|
||||
|
||||
@Nonnull
|
||||
protected final IDrawableAnimated fuel = JEIPluginManager.jeiHelper.getGuiHelper().createAnimatedDrawable(fuelDrawable, Config.electroextractorProcessTime, IDrawableAnimated.StartDirection.TOP, true);
|
||||
@Nonnull
|
||||
|
|
|
|||
|
|
@ -10,30 +10,30 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
|||
public class ElectroextractorRecipeHandler implements IRecipeHandler<ElectroextractorRecipeJEI>
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ElectroextractorRecipeJEI> getRecipeClass()
|
||||
{
|
||||
return ElectroextractorRecipeJEI.class;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ElectroextractorRecipeJEI> getRecipeClass()
|
||||
{
|
||||
return ElectroextractorRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Lib.ELECTROEXTRACTOR_UID;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Lib.ELECTROEXTRACTOR_UID;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ElectroextractorRecipeJEI recipe)
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ElectroextractorRecipeJEI recipe)
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ElectroextractorRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
|
||||
}
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ElectroextractorRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -12,34 +12,33 @@ import net.minecraft.item.ItemStack;
|
|||
public class ElectroextractorRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack input;
|
||||
@Nonnull
|
||||
private final ItemStack input;
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
|
||||
public ElectroextractorRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack output)
|
||||
{
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
}
|
||||
public ElectroextractorRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack output)
|
||||
{
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs()
|
||||
{
|
||||
return Collections.singletonList(input);
|
||||
}
|
||||
@Override
|
||||
public List getInputs()
|
||||
{
|
||||
return Collections.singletonList(input);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getOutputs()
|
||||
{
|
||||
return Collections.singletonList(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
||||
}
|
||||
@Override
|
||||
public List getOutputs()
|
||||
{
|
||||
return Collections.singletonList(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -6,49 +6,48 @@ import mezz.jei.api.IModPlugin;
|
|||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.IRecipeRegistry;
|
||||
import mezz.jei.api.JEIPlugin;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@JEIPlugin
|
||||
public class JEIPluginManager implements IModPlugin
|
||||
{
|
||||
|
||||
public static IJeiHelpers jeiHelper;
|
||||
public static IJeiHelpers jeiHelper;
|
||||
|
||||
@Override
|
||||
public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers)
|
||||
{
|
||||
jeiHelper = jeiHelpers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(IModRegistry registry)
|
||||
{
|
||||
registry.addRecipeCategories(new CropomatorCategory());
|
||||
registry.addRecipeHandlers(new CropomatorRecipeHandler());
|
||||
registry.addRecipes(CropomatorRecipeMaker.getRecipes());
|
||||
|
||||
registry.addRecipeCategories(new ElectroextractorCategory());
|
||||
registry.addRecipeHandlers(new ElectroextractorRecipeHandler());
|
||||
registry.addRecipes(ElectroextractorRecipeMaker.getRecipes());
|
||||
@Override
|
||||
public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers)
|
||||
{
|
||||
jeiHelper = jeiHelpers;
|
||||
}
|
||||
|
||||
registry.addRecipeCategories(new WoodchipperCategory());
|
||||
registry.addRecipeHandlers(new WoodchipperRecipeHandler());
|
||||
registry.addRecipes(WoodchipperRecipeMaker.getRecipes());
|
||||
|
||||
registry.addRecipeCategories(new ScribeCategory());
|
||||
registry.addRecipeHandlers(new ScribeRecipeHandler());
|
||||
registry.addRecipes(ScribeRecipeMaker.getRecipes());
|
||||
}
|
||||
@Override
|
||||
public void register(IModRegistry registry)
|
||||
{
|
||||
registry.addRecipeCategories(new CropomatorCategory());
|
||||
registry.addRecipeHandlers(new CropomatorRecipeHandler());
|
||||
registry.addRecipes(CropomatorRecipeMaker.getRecipes());
|
||||
|
||||
@Override
|
||||
public void onItemRegistryAvailable(IItemRegistry itemRegistry)
|
||||
{
|
||||
registry.addRecipeCategories(new ElectroextractorCategory());
|
||||
registry.addRecipeHandlers(new ElectroextractorRecipeHandler());
|
||||
registry.addRecipes(ElectroextractorRecipeMaker.getRecipes());
|
||||
|
||||
}
|
||||
registry.addRecipeCategories(new WoodchipperCategory());
|
||||
registry.addRecipeHandlers(new WoodchipperRecipeHandler());
|
||||
registry.addRecipes(WoodchipperRecipeMaker.getRecipes());
|
||||
|
||||
@Override
|
||||
public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry)
|
||||
{
|
||||
registry.addRecipeCategories(new ScribeCategory());
|
||||
registry.addRecipeHandlers(new ScribeRecipeHandler());
|
||||
registry.addRecipes(ScribeRecipeMaker.getRecipes());
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onItemRegistryAvailable(IItemRegistry itemRegistry)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,9 @@
|
|||
package com.oitsjustjose.criss_cross.jei;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.oitsjustjose.criss_cross.gui.GUIScribe;
|
||||
import com.oitsjustjose.criss_cross.gui.GUIWoodchipper;
|
||||
import com.oitsjustjose.criss_cross.lib.Config;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
|
|
@ -28,11 +25,11 @@ public class ScribeCategory implements IRecipeCategory
|
|||
private static final int FUEL_SLOT = 2;
|
||||
|
||||
private final IDrawableStatic progressDrawable;
|
||||
|
||||
|
||||
private final IDrawableAnimated progress;
|
||||
private final IDrawable background;
|
||||
private final String localizedName;
|
||||
|
||||
|
||||
public ScribeCategory()
|
||||
{
|
||||
super();
|
||||
|
|
|
|||
|
|
@ -9,30 +9,30 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
|||
|
||||
public class ScribeRecipeHandler implements IRecipeHandler<ScribeRecipeJEI>
|
||||
{
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ScribeRecipeJEI> getRecipeClass()
|
||||
{
|
||||
return ScribeRecipeJEI.class;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ScribeRecipeJEI> getRecipeClass()
|
||||
{
|
||||
return ScribeRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Lib.SCRIBE_UID;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Lib.SCRIBE_UID;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ScribeRecipeJEI recipe)
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ScribeRecipeJEI recipe)
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ScribeRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() != 0 && recipe.getOutputs().size() > 0;
|
||||
}
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ScribeRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() != 0 && recipe.getOutputs().size() > 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -10,30 +10,30 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
|||
public class WoodchipperRecipeHandler implements IRecipeHandler<WoodchipperRecipeJEI>
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<WoodchipperRecipeJEI> getRecipeClass()
|
||||
{
|
||||
return WoodchipperRecipeJEI.class;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<WoodchipperRecipeJEI> getRecipeClass()
|
||||
{
|
||||
return WoodchipperRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Lib.WOODCHIPPER_UID;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Lib.WOODCHIPPER_UID;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull WoodchipperRecipeJEI recipe)
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull WoodchipperRecipeJEI recipe)
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull WoodchipperRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
|
||||
}
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull WoodchipperRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -12,34 +12,33 @@ import net.minecraft.item.ItemStack;
|
|||
public class WoodchipperRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack input;
|
||||
@Nonnull
|
||||
private final ItemStack input;
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
|
||||
public WoodchipperRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack output)
|
||||
{
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
}
|
||||
public WoodchipperRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack output)
|
||||
{
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs()
|
||||
{
|
||||
return Collections.singletonList(input);
|
||||
}
|
||||
@Override
|
||||
public List getInputs()
|
||||
{
|
||||
return Collections.singletonList(input);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getOutputs()
|
||||
{
|
||||
return Collections.singletonList(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
||||
}
|
||||
@Override
|
||||
public List getOutputs()
|
||||
{
|
||||
return Collections.singletonList(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -106,28 +106,28 @@ public class Config
|
|||
property = config.get(category, "Electroextractor OreDictionary Entries", defaultEEOreDictInputs, "Formatted as <OreDictName>:<DecimalColorYouWant>." + "\n" + " Remove the 'ore' part of the oredict name (i.e. 'oreIron' should be entered as 'Iron')" + "\n" + "Use http://www.colorpicker.com/ to find a color and http://bit.ly/1RhPhcX to convert it from Hex to Decimal.");
|
||||
eeOreDictInputs = property.getStringList();
|
||||
propertyOrder.add(property.getName());
|
||||
|
||||
|
||||
property = config.get(category, "Electroextractor's Fuel Items", defaultEEFuels, "Items considered as fuel for the Electroextractor. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
||||
eeFuels = property.getStringList();
|
||||
propertyOrder.add(property.getName());
|
||||
|
||||
|
||||
property = config.get(category, "Electroextractor Output Quantity", 2);
|
||||
property.comment = "Quantity output by the Electroextractor";
|
||||
eeOutput = property.getInt();
|
||||
propertyOrder.add(property.getName());
|
||||
|
||||
|
||||
property = config.get(category, "Electroextractor Crafting Item", "minecraft:diamond_block");
|
||||
property.comment = "Key crafting ingredient in Electroextractor's Recipe. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.";
|
||||
eeRecipeItem = property.getString();
|
||||
propertyOrder.add(property.getName());
|
||||
|
||||
|
||||
Electroextractor.setPropertyOrder(propertyOrder);
|
||||
|
||||
|
||||
category = "woodchipper";
|
||||
propertyOrder = Lists.newArrayList();
|
||||
Woodchipper = config.getCategory(category);
|
||||
config.setCategoryRequiresMcRestart(category, true);
|
||||
|
||||
|
||||
property = config.get(category, "Woodchipper Process Time", 400, "Amount of time for the Woodchipper to complete a process", 20, Short.MAX_VALUE);
|
||||
woodchipperProcessTime = property.getInt();
|
||||
propertyOrder.add(property.getName());
|
||||
|
|
@ -135,35 +135,33 @@ public class Config
|
|||
property = config.get(category, "Woodchipper Fuel Items", defaultWoodchipperFuels, "Items considered as fuel for the Woodchipper. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
||||
woodchipperFuels = property.getStringList();
|
||||
propertyOrder.add(property.getName());
|
||||
|
||||
|
||||
property = config.get(category, "Woodchipper Output Quantity", 6, "Amount of planks yielded from a log", 0, 64);
|
||||
woodchipperOutput = property.getInt();
|
||||
propertyOrder.add(property.getName());
|
||||
|
||||
|
||||
property = config.get(category, "Woodchipper Crafting Item", "minecraft:diamond_block");
|
||||
property.comment = "Key crafting ingredient in Woodchipper's Recipe. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.";
|
||||
woodchipperRecipeItem = property.getString();
|
||||
propertyOrder.add(property.getName());
|
||||
|
||||
|
||||
Woodchipper.setPropertyOrder(propertyOrder);
|
||||
|
||||
//Everything Else
|
||||
|
||||
// Everything Else
|
||||
category = "other machines";
|
||||
propertyOrder = Lists.newArrayList();
|
||||
OtherMachines = config.getCategory(category);
|
||||
config.setCategoryRequiresMcRestart(category, true);
|
||||
|
||||
|
||||
property = config.get(category, "Scribe Recipes", defaultScribeRecipes, "Formatted as <modid>:<item>:<metadata>*<qty>=<enchantment ID>" + "\n" + "Also can be <oreDict>*qty=<enchantment ID>");
|
||||
scribeRecipes = property.getStringList();
|
||||
propertyOrder.add(property.getName());
|
||||
|
||||
|
||||
property = config.get(category, "Block Generators' Process Times", 20, "Amount of time for Stone and Cobble Generators to produce a block", 20, Short.MAX_VALUE);
|
||||
blockGeneratorProcessTimes = property.getInt();
|
||||
propertyOrder.add(property.getName());
|
||||
|
||||
OtherMachines.setPropertyOrder(propertyOrder);
|
||||
|
||||
|
||||
|
||||
if (config.hasChanged())
|
||||
config.save();
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@ public class Lib
|
|||
public static final String GUI_FACTORY = "com.oitsjustjose.criss_cross.gui.ConfigGUI$GUIFactory";
|
||||
public static final String CLIENT_PROXY = "com.oitsjustjose.criss_cross.util.ClientProxy";
|
||||
public static final String COMMON_PROXY = "com.oitsjustjose.criss_cross.util.CommonProxy";
|
||||
|
||||
|
||||
public static final String CROPOMATOR_UID = MODID + ":Cropomator";
|
||||
public static final String ELECTROEXTRACTOR_UID = MODID + ":Electroextractor";
|
||||
public static final String WOODCHIPPER_UID = MODID + ":Woodchipper";
|
||||
public static final String SCRIBE_UID = MODID + ":Scribe";
|
||||
|
||||
|
||||
private static final ArrayList<Item> allItems = new ArrayList<Item>();
|
||||
private static final ArrayList<Block> allBlocks = new ArrayList<Block>();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.oitsjustjose.criss_cross.lib;
|
||||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockAtmosManipulator;
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockCobblegen;
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockCropomator;
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockElectroextractor;
|
||||
|
|
@ -31,7 +30,7 @@ public class LibBlocks
|
|||
cobblegen = new BlockCobblegen();
|
||||
stonegen = new BlockStonegen();
|
||||
scribe = new BlockScribe();
|
||||
//TODO: atmosManipulator = new BlockAtmosManipulator();
|
||||
// TODO: atmosManipulator = new BlockAtmosManipulator();
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(CrissCross.instance, new GUIHandler());
|
||||
}
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ public class LibItems
|
|||
public static Item pouch;
|
||||
public static Item mantleSmasherMkI;
|
||||
public static Item mantleSmasherMkII;
|
||||
|
||||
|
||||
public static ToolMaterial mkI;
|
||||
public static ToolMaterial mkII;
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class CraftingRecipes
|
|||
initUserRecipes();
|
||||
CraftingManager.getInstance().getRecipeList().add(new PouchColorRecipes());
|
||||
CraftingManager.getInstance().getRecipeList().add(new PouchRollbackRecipes());
|
||||
//Am I doing this correctly? I hope so, hard to tell w/o NEI :|
|
||||
// Am I doing this correctly? I hope so, hard to tell w/o NEI :|
|
||||
RecipeSorter.register("CrissCross:PouchColorRecipes", PouchColorRecipes.class, Category.SHAPELESS, "");
|
||||
RecipeSorter.register("CrissCross:PouchRollbackRecipes", PouchRollbackRecipes.class, Category.SHAPELESS, "");
|
||||
}
|
||||
|
|
@ -39,10 +39,10 @@ public class CraftingRecipes
|
|||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(LibItems.mantleSmasherMkII), "## ", "#PI", " IN", '#', "blockDiamond", 'I', "blockGold", 'P', LibItems.mantleSmasherMkI, 'N', Items.nether_star));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(LibItems.pouch), "SDS", "LCL", "LLL", 'S', Items.string, 'D', "gemDiamond", 'L', Items.leather, 'C', Blocks.chest));
|
||||
}
|
||||
|
||||
|
||||
static void initUserRecipes()
|
||||
{
|
||||
//Woodchipper Recipe
|
||||
// Woodchipper Recipe
|
||||
String[] unlocItem = Config.woodchipperRecipeItem.split(":");
|
||||
ItemStack centerItem = new ItemStack(Blocks.diamond_block);
|
||||
|
||||
|
|
@ -63,8 +63,8 @@ public class CraftingRecipes
|
|||
}
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(LibBlocks.woodchipper), new Object[] { "I#I", "SCS", "I#I", '#', Items.diamond_axe, 'I', Blocks.iron_bars, 'S', Items.golden_axe, 'C', centerItem });
|
||||
|
||||
//Electroextractor Recipe
|
||||
|
||||
// Electroextractor Recipe
|
||||
unlocItem = Config.eeRecipeItem.split(":");
|
||||
centerItem = new ItemStack(Blocks.diamond_block);
|
||||
|
||||
|
|
@ -85,8 +85,8 @@ public class CraftingRecipes
|
|||
}
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(LibBlocks.electroextractor), new Object[] { "I#I", "SCS", "I#I", '#', Blocks.piston, 'I', Blocks.iron_bars, 'S', Items.golden_pickaxe, 'C', centerItem });
|
||||
|
||||
//Cropomator Recipe
|
||||
|
||||
// Cropomator Recipe
|
||||
unlocItem = Config.cropomatorRecipeItem.split(":");
|
||||
centerItem = new ItemStack(Blocks.diamond_block);
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ public class MachineRecipes
|
|||
public static void initScribeRecipes()
|
||||
{
|
||||
for (int i = 0; i < Config.scribeRecipes.length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
String[] parts = Config.scribeRecipes[i].split("[\\W]");
|
||||
|
|
@ -91,9 +90,7 @@ public class MachineRecipes
|
|||
LogHelper.warn("Enchantment ID " + enchID + " does not appear to be valid. Skipping Scribe recipe addition.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.warn("Item " + (modid + " " + object) + " does not appear to be valid. Skipping Scribe recipe addition.");
|
||||
}
|
||||
}
|
||||
else if (parts.length == 3)
|
||||
{
|
||||
|
|
@ -120,18 +117,15 @@ public class MachineRecipes
|
|||
{
|
||||
LogHelper.warn("Error reading itemstack for Scribe from input file at item: " + (i + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void initCropomatorRecipes()
|
||||
{
|
||||
for (int i = 0; i < Config.cropomatorInputs.length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
String[] parts = Config.cropomatorInputs[i].split(":");
|
||||
if (parts.length == 2)
|
||||
{
|
||||
if (Config.findItemStack(parts[0], parts[1]) != null)
|
||||
{
|
||||
ItemStack newStack = Config.findItemStack(parts[0], parts[1]);
|
||||
|
|
@ -143,9 +137,7 @@ public class MachineRecipes
|
|||
LogHelper.warn("Please confirm you have the name and formatting correct.");
|
||||
|
||||
}
|
||||
}
|
||||
if (parts.length == 3)
|
||||
{
|
||||
if (Config.findItemStack(parts[0], parts[1]) != null)
|
||||
{
|
||||
ItemStack newStack = new ItemStack(Config.findItemStack(parts[0], parts[1]).getItem(), 1, Integer.parseInt(parts[2]));
|
||||
|
|
@ -157,25 +149,20 @@ public class MachineRecipes
|
|||
LogHelper.warn("Item " + Config.cropomatorInputs[i] + " could not be added to the Cropomator's recipe list.");
|
||||
LogHelper.warn("Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.warn("Error reading itemstack for Cropomator from input file at item: " + (i + 1));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void initCropomatorFuels()
|
||||
{
|
||||
for (int i = 0; i < Config.cropomatorCatalysts.length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
String[] parts = Config.cropomatorCatalysts[i].split(":");
|
||||
if (parts.length == 2)
|
||||
{
|
||||
if (Config.findItemStack(parts[0], parts[1]) != null)
|
||||
TileCropomator.addFuel(Config.findItemStack(parts[0], parts[1]));
|
||||
else
|
||||
|
|
@ -183,10 +170,8 @@ public class MachineRecipes
|
|||
LogHelper.warn("Item " + Config.cropomatorInputs[i] + " could not be added to the Cropomator's catalyst list.");
|
||||
LogHelper.warn("Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
}
|
||||
|
||||
if (parts.length == 3)
|
||||
{
|
||||
if (Config.findItemStack(parts[0], parts[1]) != null)
|
||||
{
|
||||
ItemStack newStack = new ItemStack(Config.findItemStack(parts[0], parts[1]).getItem(), 1, Integer.parseInt(parts[2]));
|
||||
|
|
@ -197,13 +182,11 @@ public class MachineRecipes
|
|||
LogHelper.warn("Item " + Config.cropomatorInputs[i] + " could not be added to the Cropomator's catalyst list.");
|
||||
LogHelper.warn("Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.warn("Error reading itemstack for Cropomator Cataylsts from input file at item: " + (i + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// All Credit goes to TeamCoFH for the code. After so many algorithms
|
||||
|
|
@ -213,6 +196,7 @@ public class MachineRecipes
|
|||
{
|
||||
Container local1 = new Container()
|
||||
{
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p)
|
||||
{
|
||||
return false;
|
||||
|
|
@ -220,17 +204,14 @@ public class MachineRecipes
|
|||
};
|
||||
InventoryCrafting localInventoryCrafting = new InventoryCrafting(local1, 3, 3);
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
localInventoryCrafting.setInventorySlotContents(i, null);
|
||||
}
|
||||
List<ItemStack> localArrayList = OreDictionary.getOres("logWood");
|
||||
for (int j = 0; j < localArrayList.size(); j++)
|
||||
{
|
||||
ItemStack localItemStack1 = (ItemStack) localArrayList.get(j);
|
||||
ItemStack localItemStack1 = localArrayList.get(j);
|
||||
ItemStack localItemStack3;
|
||||
ItemStack localItemStack4;
|
||||
if (ItemHelper.getItemDamage(localItemStack1) == 32767)
|
||||
{
|
||||
for (int k = 0; k < 16; k++)
|
||||
{
|
||||
localItemStack3 = ItemHelper.cloneStack(localItemStack1, 1);
|
||||
|
|
@ -245,7 +226,6 @@ public class MachineRecipes
|
|||
WoodchipperRecipes.getInstance().addRecipe(localItemStack3, localItemStack5);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemStack localItemStack2 = localItemStack1.copy();
|
||||
|
|
@ -265,12 +245,10 @@ public class MachineRecipes
|
|||
public static void initWoodchipperFuels()
|
||||
{
|
||||
for (int i = 0; i < Config.woodchipperFuels.length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
String[] parts = Config.woodchipperFuels[i].split(":");
|
||||
if (parts.length == 2)
|
||||
{
|
||||
if (Config.findItemStack(parts[0], parts[1]) != null)
|
||||
TileWoodchipper.addFuel(Config.findItemStack(parts[0], parts[1]));
|
||||
else
|
||||
|
|
@ -278,10 +256,8 @@ public class MachineRecipes
|
|||
LogHelper.warn("Item " + Config.woodchipperFuels[i] + " could not be added to the Woodchipper's fuel list.");
|
||||
LogHelper.warn("Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
}
|
||||
|
||||
if (parts.length == 3)
|
||||
{
|
||||
if (Config.findItemStack(parts[0], parts[1]) != null)
|
||||
{
|
||||
ItemStack newStack = new ItemStack(Config.findItemStack(parts[0], parts[1]).getItem(), 1, Integer.parseInt(parts[2]));
|
||||
|
|
@ -292,24 +268,20 @@ public class MachineRecipes
|
|||
LogHelper.warn("Item " + Config.woodchipperFuels[i] + " could not be added to the Woodchipper's fuel list.");
|
||||
LogHelper.warn("Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.warn("Error reading itemstack for Woodchipper's energy sources at item: " + (i + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void initElectroextractorFuels()
|
||||
{
|
||||
for (int i = 0; i < Config.eeFuels.length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
String[] parts = Config.eeFuels[i].split(":");
|
||||
if (parts.length == 2)
|
||||
{
|
||||
if (Config.findItemStack(parts[0], parts[1]) != null)
|
||||
TileElectroextractor.addFuel(Config.findItemStack(parts[0], parts[1]));
|
||||
else
|
||||
|
|
@ -317,10 +289,8 @@ public class MachineRecipes
|
|||
LogHelper.warn("Item " + Config.eeFuels[i] + " could not be added to the Electroextractor's fuel list.");
|
||||
LogHelper.warn("Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
}
|
||||
|
||||
if (parts.length == 3)
|
||||
{
|
||||
if (Config.findItemStack(parts[0], parts[1]) != null)
|
||||
{
|
||||
ItemStack newStack = new ItemStack(Config.findItemStack(parts[0], parts[1]).getItem(), 1, Integer.parseInt(parts[2]));
|
||||
|
|
@ -331,13 +301,11 @@ public class MachineRecipes
|
|||
LogHelper.warn("Item " + Config.eeFuels[i] + " could not be added to the Electroextractor's fuel list.");
|
||||
LogHelper.warn("Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.warn("Error reading itemstack for electroextractor's energy sources at item: " + (i + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void initElectroextractorOreDictionary()
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ public class PouchColorRecipes implements IRecipe
|
|||
ItemStack itemstack1 = invCraft.getStackInSlot(k);
|
||||
|
||||
if (itemstack1 != null)
|
||||
{
|
||||
if (itemstack1.getItem() instanceof ItemPouch)
|
||||
{
|
||||
pouch = (ItemPouch) itemstack1.getItem();
|
||||
|
|
@ -60,13 +59,13 @@ public class PouchColorRecipes implements IRecipe
|
|||
if (pouch.hasColor(itemstack1))
|
||||
{
|
||||
int l = pouch.getColor(itemstack);
|
||||
float f = (float) (l >> 16 & 255) / 255.0F;
|
||||
float f1 = (float) (l >> 8 & 255) / 255.0F;
|
||||
float f2 = (float) (l & 255) / 255.0F;
|
||||
i = (int) ((float) i + Math.max(f, Math.max(f1, f2)) * 255.0F);
|
||||
aint[0] = (int) ((float) aint[0] + f * 255.0F);
|
||||
aint[1] = (int) ((float) aint[1] + f1 * 255.0F);
|
||||
aint[2] = (int) ((float) aint[2] + f2 * 255.0F);
|
||||
float f = (l >> 16 & 255) / 255.0F;
|
||||
float f1 = (l >> 8 & 255) / 255.0F;
|
||||
float f2 = (l & 255) / 255.0F;
|
||||
i = (int) (i + Math.max(f, Math.max(f1, f2)) * 255.0F);
|
||||
aint[0] = (int) (aint[0] + f * 255.0F);
|
||||
aint[1] = (int) (aint[1] + f1 * 255.0F);
|
||||
aint[2] = (int) (aint[2] + f2 * 255.0F);
|
||||
++j;
|
||||
}
|
||||
}
|
||||
|
|
@ -85,7 +84,6 @@ public class PouchColorRecipes implements IRecipe
|
|||
aint[2] += j2;
|
||||
++j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pouch == null)
|
||||
|
|
@ -97,10 +95,10 @@ public class PouchColorRecipes implements IRecipe
|
|||
int j1 = aint[1] / j;
|
||||
int k1 = aint[2] / j;
|
||||
float f3 = (float) i / (float) j;
|
||||
float f4 = (float) Math.max(i1, Math.max(j1, k1));
|
||||
i1 = (int) ((float) i1 * f3 / f4);
|
||||
j1 = (int) ((float) j1 * f3 / f4);
|
||||
k1 = (int) ((float) k1 * f3 / f4);
|
||||
float f4 = Math.max(i1, Math.max(j1, k1));
|
||||
i1 = (int) (i1 * f3 / f4);
|
||||
j1 = (int) (j1 * f3 / f4);
|
||||
k1 = (int) (k1 * f3 / f4);
|
||||
int lvt_12_3_ = (i1 << 8) + j1;
|
||||
lvt_12_3_ = (lvt_12_3_ << 8) + k1;
|
||||
pouch.setColor(itemstack, lvt_12_3_);
|
||||
|
|
@ -124,7 +122,6 @@ public class PouchColorRecipes implements IRecipe
|
|||
public ItemStack[] getRemainingItems(InventoryCrafting invCraft)
|
||||
{
|
||||
ItemStack[] ret = new ItemStack[9];
|
||||
ItemStack stackToClear = null;
|
||||
|
||||
for (int i = 0; i < invCraft.getSizeInventory(); i++)
|
||||
if (invCraft.getStackInSlot(i) != null)
|
||||
|
|
|
|||
|
|
@ -32,20 +32,16 @@ public class PouchRollbackRecipes implements IRecipe
|
|||
ItemStack pouch = null;
|
||||
ItemStack newPouch = null;
|
||||
for (int i = 0; i < invCraft.getSizeInventory(); i++)
|
||||
{
|
||||
if (invCraft.getStackInSlot(i) != null)
|
||||
{
|
||||
if (invCraft.getStackInSlot(i).getItem() instanceof ItemPouch)
|
||||
pouch = invCraft.getStackInSlot(i);
|
||||
}
|
||||
}
|
||||
|
||||
if (pouch == null || pouch.getItemDamage() == 0)
|
||||
return null;
|
||||
|
||||
newPouch = pouch.copy();
|
||||
newPouch.setItemDamage(0);
|
||||
|
||||
|
||||
return newPouch;
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +61,6 @@ public class PouchRollbackRecipes implements IRecipe
|
|||
public ItemStack[] getRemainingItems(InventoryCrafting invCraft)
|
||||
{
|
||||
ItemStack[] ret = new ItemStack[9];
|
||||
ItemStack stackToClear = null;
|
||||
|
||||
for (int i = 0; i < invCraft.getSizeInventory(); i++)
|
||||
if (invCraft.getStackInSlot(i) != null)
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
package com.oitsjustjose.criss_cross.recipes.machine;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class ElectroextractorRecipes
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
package com.oitsjustjose.criss_cross.recipes.machine;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class WoodchipperRecipes
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,13 +3,12 @@ package com.oitsjustjose.criss_cross.tileentity;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
|
||||
public class TileAtmosManipulator extends TileEntity implements ITickable
|
||||
{
|
||||
public boolean isUseableByPlayer(EntityPlayer player)
|
||||
{
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, (double) this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq(this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -20,7 +19,6 @@ public class TileAtmosManipulator extends TileEntity implements ITickable
|
|||
|
||||
public void setRain()
|
||||
{
|
||||
EntityPlayer player = worldObj.getClosestPlayer(this.pos.getX(), this.pos.getY(), this.pos.getZ(), 3);
|
||||
worldObj.getWorldInfo().setRaining(true);
|
||||
|
||||
if (worldObj.isRemote)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.oitsjustjose.criss_cross.tileentity;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockStonegen;
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockMachineBase;
|
||||
import com.oitsjustjose.criss_cross.container.ContainerCobblegen;
|
||||
import com.oitsjustjose.criss_cross.lib.Config;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
|
|
@ -43,9 +43,7 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
boolean flag1 = false;
|
||||
|
||||
if (this.fuelTime > 0)
|
||||
{
|
||||
--this.fuelTime;
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
|
@ -60,12 +58,8 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
flag1 = true;
|
||||
|
||||
if (this.ItemStacks[1] != null)
|
||||
{
|
||||
if (this.ItemStacks[1].stackSize == 0)
|
||||
{
|
||||
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -81,22 +75,18 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.processTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag != this.fuelTime > 0)
|
||||
{
|
||||
flag1 = true;
|
||||
BlockStonegen.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||
BlockMachineBase.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (flag1)
|
||||
{
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
public static ArrayList<ItemStack> getFuels()
|
||||
|
|
@ -134,17 +124,13 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
||||
|
||||
if (this.ItemStacks[slot].stackSize == 0)
|
||||
{
|
||||
this.ItemStacks[slot] = null;
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -157,9 +143,7 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
return itemstack;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -168,9 +152,7 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
this.ItemStacks[slot] = itemstack;
|
||||
|
||||
if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit())
|
||||
{
|
||||
itemstack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -182,12 +164,12 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
@Override
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
return TileCobblegen.customName != null && TileCobblegen.customName.length() > 0;
|
||||
}
|
||||
|
||||
public void setCustomInventoryName(String newName)
|
||||
{
|
||||
this.customName = newName;
|
||||
TileCobblegen.customName = newName;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -203,9 +185,7 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
|
||||
if (b0 >= 0 && b0 < this.ItemStacks.length)
|
||||
{
|
||||
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
this.fuelTime = tag.getShort("FuelTime");
|
||||
|
|
@ -225,7 +205,6 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < this.ItemStacks.length; ++i)
|
||||
{
|
||||
if (this.ItemStacks[i] != null)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
|
|
@ -233,7 +212,6 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
this.ItemStacks[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
tag.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
|
@ -254,9 +232,7 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
public int getBurnTimeRemainingScaled(int par1)
|
||||
{
|
||||
if (this.fuelUsetime == 0)
|
||||
{
|
||||
this.fuelUsetime = proTicks;
|
||||
}
|
||||
|
||||
return this.fuelTime * par1 / this.fuelUsetime;
|
||||
}
|
||||
|
|
@ -291,13 +267,11 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
public static boolean removeFuel(ItemStack itemstack)
|
||||
{
|
||||
for (int i = 0; i < fuelItems.size(); i++)
|
||||
{
|
||||
if (fuelItems.get(i) == itemstack)
|
||||
{
|
||||
fuelItems.remove(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -317,18 +291,12 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
ItemStack output = new ItemStack(Blocks.cobblestone);
|
||||
ItemStack outputSlot = ItemStacks[2];
|
||||
if (outputSlot == null)
|
||||
{
|
||||
ItemStacks[2] = output.copy();
|
||||
}
|
||||
else if (outputSlot.isItemEqual(output))
|
||||
{
|
||||
outputSlot.stackSize += output.stackSize;
|
||||
}
|
||||
|
||||
if (input.stackSize <= 0)
|
||||
{
|
||||
ItemStacks[0] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -348,9 +316,10 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player)
|
||||
{
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, (double) this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq(this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -417,7 +386,7 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return this.hasCustomName() ? this.customName : "container.cobblegen";
|
||||
return this.hasCustomName() ? TileCobblegen.customName : "container.cobblegen";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.oitsjustjose.criss_cross.tileentity;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockCropomator;
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockMachineBase;
|
||||
import com.oitsjustjose.criss_cross.container.ContainerCropomator;
|
||||
import com.oitsjustjose.criss_cross.lib.Config;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
|
|
@ -44,9 +44,7 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
boolean flag1 = false;
|
||||
|
||||
if (this.catalystTime > 0)
|
||||
{
|
||||
--this.catalystTime;
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
|
@ -65,9 +63,7 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
--this.ItemStacks[1].stackSize;
|
||||
|
||||
if (this.ItemStacks[1].stackSize == 0)
|
||||
{
|
||||
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -84,22 +80,18 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.processTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag != this.catalystTime > 0)
|
||||
{
|
||||
flag1 = true;
|
||||
BlockCropomator.updateBlockState(this.catalystTime > 0, this.worldObj, this.pos);
|
||||
BlockMachineBase.updateBlockState(this.catalystTime > 0, this.worldObj, this.pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (flag1)
|
||||
{
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
public static ArrayList<ItemStack> getFuels()
|
||||
|
|
@ -137,17 +129,13 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
||||
|
||||
if (this.ItemStacks[slot].stackSize == 0)
|
||||
{
|
||||
this.ItemStacks[slot] = null;
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -160,9 +148,7 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
return itemstack;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -171,9 +157,7 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
this.ItemStacks[slot] = itemstack;
|
||||
|
||||
if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit())
|
||||
{
|
||||
itemstack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -185,7 +169,7 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
@Override
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
return TileCropomator.customName != null && TileCropomator.customName.length() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -201,9 +185,7 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
|
||||
if (b0 >= 0 && b0 < this.ItemStacks.length)
|
||||
{
|
||||
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
this.catalystTime = tag.getShort("BonemealTime");
|
||||
|
|
@ -223,7 +205,6 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < this.ItemStacks.length; ++i)
|
||||
{
|
||||
if (this.ItemStacks[i] != null)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
|
|
@ -231,7 +212,6 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
this.ItemStacks[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
tag.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
|
@ -252,9 +232,7 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
public int getBurnTimeRemainingScaled(int par1)
|
||||
{
|
||||
if (this.catalystInUseTime == 0)
|
||||
{
|
||||
this.catalystInUseTime = proTicks;
|
||||
}
|
||||
|
||||
return this.catalystTime * par1 / this.catalystInUseTime;
|
||||
}
|
||||
|
|
@ -291,13 +269,11 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
public static boolean removeFuel(ItemStack itemstack)
|
||||
{
|
||||
for (int i = 0; i < fuelItems.size(); i++)
|
||||
{
|
||||
if (fuelItems.get(i) == itemstack)
|
||||
{
|
||||
fuelItems.remove(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -317,19 +293,13 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
ItemStack output = CropomatorRecipes.getInstance().getResult(input);
|
||||
ItemStack outputSlot = ItemStacks[2];
|
||||
if (outputSlot == null)
|
||||
{
|
||||
ItemStacks[2] = output.copy();
|
||||
}
|
||||
else if (outputSlot.isItemEqual(output))
|
||||
{
|
||||
outputSlot.stackSize += output.stackSize;
|
||||
}
|
||||
|
||||
--input.stackSize;
|
||||
if (input.stackSize <= 0)
|
||||
{
|
||||
ItemStacks[0] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -349,9 +319,10 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player)
|
||||
{
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, (double) this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq(this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -413,7 +384,7 @@ public class TileCropomator extends TileEntityLockable implements ITickable, ISi
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return this.hasCustomName() ? this.customName : "container.cropomator";
|
||||
return this.hasCustomName() ? TileCropomator.customName : "container.cropomator";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.oitsjustjose.criss_cross.tileentity;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockElectroextractor;
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockMachineBase;
|
||||
import com.oitsjustjose.criss_cross.container.ContainerElectroextractor;
|
||||
import com.oitsjustjose.criss_cross.lib.Config;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
|
|
@ -43,9 +43,7 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
boolean flag1 = false;
|
||||
|
||||
if (this.fuelTime > 0)
|
||||
{
|
||||
--this.fuelTime;
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
|
@ -64,9 +62,7 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
--this.ItemStacks[1].stackSize;
|
||||
|
||||
if (this.ItemStacks[1].stackSize == 0)
|
||||
{
|
||||
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -83,22 +79,18 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.crushTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag != this.fuelTime > 0)
|
||||
{
|
||||
flag1 = true;
|
||||
BlockElectroextractor.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||
BlockMachineBase.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (flag1)
|
||||
{
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -131,17 +123,13 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
||||
|
||||
if (this.ItemStacks[slot].stackSize == 0)
|
||||
{
|
||||
this.ItemStacks[slot] = null;
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -154,9 +142,7 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
return itemstack;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -165,9 +151,7 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
this.ItemStacks[slot] = itemstack;
|
||||
|
||||
if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit())
|
||||
{
|
||||
itemstack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -183,9 +167,7 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
|
||||
if (b0 >= 0 && b0 < this.ItemStacks.length)
|
||||
{
|
||||
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
this.fuelTime = tag.getShort("Energy");
|
||||
|
|
@ -205,7 +187,6 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < this.ItemStacks.length; ++i)
|
||||
{
|
||||
if (this.ItemStacks[i] != null)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
|
|
@ -213,7 +194,6 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
this.ItemStacks[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
tag.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
|
@ -234,9 +214,7 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
public int getBurnTimeRemainingScaled(int par1)
|
||||
{
|
||||
if (this.fuelInUseTime == 0)
|
||||
{
|
||||
this.fuelInUseTime = proTicks;
|
||||
}
|
||||
|
||||
return this.fuelTime * par1 / this.fuelInUseTime;
|
||||
}
|
||||
|
|
@ -273,22 +251,20 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
public static boolean removeFuel(ItemStack itemstack)
|
||||
{
|
||||
for (int i = 0; i < fuelItems.size(); i++)
|
||||
{
|
||||
if (fuelItems.get(i) == itemstack)
|
||||
{
|
||||
fuelItems.remove(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static ArrayList<ItemStack> getFuels()
|
||||
{
|
||||
return fuelItems;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static boolean isValid(ItemStack itemstack)
|
||||
{
|
||||
if (ElectroextractorRecipes.getInstance().getResult(itemstack) != null)
|
||||
|
|
@ -305,19 +281,13 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
ItemStack output = ElectroextractorRecipes.getInstance().getResult(input);
|
||||
ItemStack outputSlot = ItemStacks[2];
|
||||
if (outputSlot == null)
|
||||
{
|
||||
ItemStacks[2] = output.copy();
|
||||
}
|
||||
else if (outputSlot.isItemEqual(output))
|
||||
{
|
||||
outputSlot.stackSize += output.stackSize;
|
||||
}
|
||||
|
||||
--input.stackSize;
|
||||
if (input.stackSize <= 0)
|
||||
{
|
||||
ItemStacks[0] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -339,9 +309,10 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player)
|
||||
{
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, (double) this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq(this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -408,7 +379,7 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return this.hasCustomName() ? this.customName : "container.cobblegen";
|
||||
return this.hasCustomName() ? TileElectroextractor.customName : "container.cobblegen";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -426,12 +397,12 @@ public class TileElectroextractor extends TileEntityLockable implements ITickabl
|
|||
@Override
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
return TileElectroextractor.customName != null && TileElectroextractor.customName.length() > 0;
|
||||
}
|
||||
|
||||
public void setCustomInventoryName(String newName)
|
||||
{
|
||||
this.customName = newName;
|
||||
TileElectroextractor.customName = newName;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package com.oitsjustjose.criss_cross.tileentity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockScribe;
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockMachineBase;
|
||||
import com.oitsjustjose.criss_cross.container.ContainerScribe;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.recipes.machine.ScribeRecipes;
|
||||
|
|
@ -37,9 +35,7 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
boolean flag1 = false;
|
||||
|
||||
if (this.fuelTime > 0)
|
||||
{
|
||||
--this.fuelTime;
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
|
@ -58,9 +54,7 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
--this.ItemStacks[1].stackSize;
|
||||
|
||||
if (this.ItemStacks[1].stackSize == 0)
|
||||
{
|
||||
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -78,22 +72,18 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.writingTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag != this.fuelTime > 0)
|
||||
{
|
||||
flag1 = true;
|
||||
BlockScribe.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||
BlockMachineBase.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (flag1)
|
||||
{
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -126,17 +116,13 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
||||
|
||||
if (this.ItemStacks[slot].stackSize == 0)
|
||||
{
|
||||
this.ItemStacks[slot] = null;
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -149,9 +135,7 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
return itemstack;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -160,9 +144,7 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
this.ItemStacks[slot] = itemstack;
|
||||
|
||||
if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit())
|
||||
{
|
||||
itemstack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -174,7 +156,7 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
@Override
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
return TileScribe.customName != null && TileScribe.customName.length() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -190,9 +172,7 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
|
||||
if (b0 >= 0 && b0 < this.ItemStacks.length)
|
||||
{
|
||||
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
this.fuelTime = tag.getShort("FuelTime");
|
||||
|
|
@ -212,7 +192,6 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < this.ItemStacks.length; ++i)
|
||||
{
|
||||
if (this.ItemStacks[i] != null)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
|
|
@ -220,7 +199,6 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
this.ItemStacks[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
tag.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
|
@ -241,9 +219,7 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
public int getBurnTimeRemainingScaled(int par1)
|
||||
{
|
||||
if (this.fuelUsetime == 0)
|
||||
{
|
||||
this.fuelUsetime = proTicks;
|
||||
}
|
||||
|
||||
return this.fuelTime * par1 / this.fuelUsetime;
|
||||
}
|
||||
|
|
@ -287,13 +263,9 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
ItemStack output = ScribeRecipes.getInstance().getResult(input);
|
||||
ItemStack outputSlot = ItemStacks[2];
|
||||
if (outputSlot == null)
|
||||
{
|
||||
ItemStacks[2] = output.copy();
|
||||
}
|
||||
else if (outputSlot.isItemEqual(output))
|
||||
{
|
||||
outputSlot.stackSize += output.stackSize;
|
||||
}
|
||||
ItemStacks[0] = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -311,9 +283,10 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player)
|
||||
{
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, (double) this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq(this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -380,7 +353,7 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return this.hasCustomName() ? this.customName : "container.scribe";
|
||||
return this.hasCustomName() ? TileScribe.customName : "container.scribe";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -398,7 +371,7 @@ public class TileScribe extends TileEntityLockable implements ITickable, ISidedI
|
|||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return new int[]{};
|
||||
return new int[] {};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.oitsjustjose.criss_cross.tileentity;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockStonegen;
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockMachineBase;
|
||||
import com.oitsjustjose.criss_cross.container.ContainerStonegen;
|
||||
import com.oitsjustjose.criss_cross.lib.Config;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
|
|
@ -43,9 +43,7 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
boolean flag1 = false;
|
||||
|
||||
if (this.fuelTime > 0)
|
||||
{
|
||||
--this.fuelTime;
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
|
@ -64,9 +62,7 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
--this.ItemStacks[1].stackSize;
|
||||
|
||||
if (this.ItemStacks[1].stackSize == 0)
|
||||
{
|
||||
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -83,22 +79,18 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.processTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag != this.fuelTime > 0)
|
||||
{
|
||||
flag1 = true;
|
||||
BlockStonegen.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||
BlockMachineBase.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (flag1)
|
||||
{
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
public static ArrayList<ItemStack> getFuels()
|
||||
|
|
@ -136,17 +128,13 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
||||
|
||||
if (this.ItemStacks[slot].stackSize == 0)
|
||||
{
|
||||
this.ItemStacks[slot] = null;
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -159,9 +147,7 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
return itemstack;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -170,9 +156,7 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
this.ItemStacks[slot] = itemstack;
|
||||
|
||||
if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit())
|
||||
{
|
||||
itemstack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -184,12 +168,12 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
@Override
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
return TileStonegen.customName != null && TileStonegen.customName.length() > 0;
|
||||
}
|
||||
|
||||
public void setCustomInventoryName(String newName)
|
||||
{
|
||||
this.customName = newName;
|
||||
TileStonegen.customName = newName;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -205,9 +189,7 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
|
||||
if (b0 >= 0 && b0 < this.ItemStacks.length)
|
||||
{
|
||||
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
this.fuelTime = tag.getShort("FuelTime");
|
||||
|
|
@ -227,7 +209,6 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < this.ItemStacks.length; ++i)
|
||||
{
|
||||
if (this.ItemStacks[i] != null)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
|
|
@ -235,7 +216,6 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
this.ItemStacks[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
tag.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
|
@ -256,9 +236,7 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
public int getBurnTimeRemainingScaled(int par1)
|
||||
{
|
||||
if (this.fuelUsetime == 0)
|
||||
{
|
||||
this.fuelUsetime = proTicks;
|
||||
}
|
||||
|
||||
return this.fuelTime * par1 / this.fuelUsetime;
|
||||
}
|
||||
|
|
@ -293,13 +271,11 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
public static boolean removeFuel(ItemStack itemstack)
|
||||
{
|
||||
for (int i = 0; i < fuelItems.size(); i++)
|
||||
{
|
||||
if (fuelItems.get(i) == itemstack)
|
||||
{
|
||||
fuelItems.remove(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -319,18 +295,12 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
ItemStack output = new ItemStack(Blocks.stone);
|
||||
ItemStack outputSlot = ItemStacks[2];
|
||||
if (outputSlot == null)
|
||||
{
|
||||
ItemStacks[2] = output.copy();
|
||||
}
|
||||
else if (outputSlot.isItemEqual(output))
|
||||
{
|
||||
outputSlot.stackSize += output.stackSize;
|
||||
}
|
||||
|
||||
if (input.stackSize <= 0)
|
||||
{
|
||||
ItemStacks[0] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -350,9 +320,10 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player)
|
||||
{
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, (double) this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq(this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -419,7 +390,7 @@ public class TileStonegen extends TileEntityLockable implements ITickable, ISide
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return this.hasCustomName() ? this.customName : "container.cobblegen";
|
||||
return this.hasCustomName() ? TileStonegen.customName : "container.cobblegen";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.oitsjustjose.criss_cross.tileentity;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockWoodchipper;
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockMachineBase;
|
||||
import com.oitsjustjose.criss_cross.container.ContainerWoodchipper;
|
||||
import com.oitsjustjose.criss_cross.lib.Config;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
|
|
@ -43,9 +43,7 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
boolean flag1 = false;
|
||||
|
||||
if (this.fuelTime > 0)
|
||||
{
|
||||
--this.fuelTime;
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
|
@ -64,9 +62,7 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
--this.ItemStacks[1].stackSize;
|
||||
|
||||
if (this.ItemStacks[1].stackSize == 0)
|
||||
{
|
||||
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -83,22 +79,18 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.processTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag != this.fuelTime > 0)
|
||||
{
|
||||
flag1 = true;
|
||||
BlockWoodchipper.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||
BlockMachineBase.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (flag1)
|
||||
{
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
public static ArrayList<ItemStack> getFuels()
|
||||
|
|
@ -136,17 +128,13 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
||||
|
||||
if (this.ItemStacks[slot].stackSize == 0)
|
||||
{
|
||||
this.ItemStacks[slot] = null;
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -159,9 +147,7 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
return itemstack;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -170,9 +156,7 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
this.ItemStacks[slot] = itemstack;
|
||||
|
||||
if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit())
|
||||
{
|
||||
itemstack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -184,7 +168,7 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
@Override
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
return TileWoodchipper.customName != null && TileWoodchipper.customName.length() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -200,9 +184,7 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
|
||||
if (b0 >= 0 && b0 < this.ItemStacks.length)
|
||||
{
|
||||
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
this.fuelTime = tag.getShort("FuelTime");
|
||||
|
|
@ -222,7 +204,6 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < this.ItemStacks.length; ++i)
|
||||
{
|
||||
if (this.ItemStacks[i] != null)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
|
|
@ -230,7 +211,6 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
this.ItemStacks[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
tag.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
|
@ -251,9 +231,7 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
public int getBurnTimeRemainingScaled(int par1)
|
||||
{
|
||||
if (this.fuelUsetime == 0)
|
||||
{
|
||||
this.fuelUsetime = proTicks;
|
||||
}
|
||||
|
||||
return this.fuelTime * par1 / this.fuelUsetime;
|
||||
}
|
||||
|
|
@ -290,13 +268,11 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
public static boolean removeFuel(ItemStack itemstack)
|
||||
{
|
||||
for (int i = 0; i < fuelItems.size(); i++)
|
||||
{
|
||||
if (fuelItems.get(i) == itemstack)
|
||||
{
|
||||
fuelItems.remove(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -316,19 +292,13 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
ItemStack output = WoodchipperRecipes.getInstance().getResult(input);
|
||||
ItemStack outputSlot = ItemStacks[2];
|
||||
if (outputSlot == null)
|
||||
{
|
||||
ItemStacks[2] = output.copy();
|
||||
}
|
||||
else if (outputSlot.isItemEqual(output))
|
||||
{
|
||||
outputSlot.stackSize += output.stackSize;
|
||||
}
|
||||
|
||||
--input.stackSize;
|
||||
if (input.stackSize <= 0)
|
||||
{
|
||||
ItemStacks[0] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -348,9 +318,10 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player)
|
||||
{
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, (double) this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq(this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -417,7 +388,7 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return this.hasCustomName() ? this.customName : "container.woodchipper";
|
||||
return this.hasCustomName() ? TileWoodchipper.customName : "container.woodchipper";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import net.minecraft.client.resources.model.ModelBakery;
|
|||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ public class ClientProxy extends CommonProxy
|
|||
for (ItemStack sub : subItems)
|
||||
{
|
||||
String name = item.getUnlocalizedName(sub).substring(16).toLowerCase();
|
||||
ModelBakery.addVariantName(item, Lib.MODID.toLowerCase() + ":" + name);
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation(Lib.MODID.toLowerCase(), name));
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(Lib.MODID.toLowerCase() + ":" + name, "inventory"));
|
||||
meta++;
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ public class ClientProxy extends CommonProxy
|
|||
for (ItemStack sub : subItems)
|
||||
{
|
||||
String name = itemBlock.getUnlocalizedName(sub).toLowerCase().replace("crisscross.", "").replace("tile.", "");
|
||||
ModelBakery.addVariantName(itemBlock, Lib.MODID.toLowerCase() + ":" + name);
|
||||
ModelBakery.registerItemVariants(itemBlock, new ResourceLocation(Lib.MODID.toLowerCase(), name));
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, meta, new ModelResourceLocation(Lib.MODID.toLowerCase() + ":" + name, "inventory"));
|
||||
meta++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@ public class ItemHelper
|
|||
public static ItemStack cloneStack(Item item, int stackSize)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
ItemStack stack = new ItemStack(item, stackSize);
|
||||
|
||||
return stack;
|
||||
|
|
@ -30,9 +28,7 @@ public class ItemHelper
|
|||
{
|
||||
|
||||
if (item == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
ItemStack stack = new ItemStack(item, stackSize);
|
||||
|
||||
return stack;
|
||||
|
|
@ -42,9 +38,7 @@ public class ItemHelper
|
|||
{
|
||||
|
||||
if (stack == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
ItemStack retStack = stack.copy();
|
||||
retStack.stackSize = stackSize;
|
||||
|
||||
|
|
@ -55,9 +49,7 @@ public class ItemHelper
|
|||
{
|
||||
|
||||
if (stack == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
ItemStack retStack = stack.copy();
|
||||
|
||||
return retStack;
|
||||
|
|
@ -72,24 +64,16 @@ public class ItemHelper
|
|||
{
|
||||
ItemStack[] dmgItems = new ItemStack[2];
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++)
|
||||
{
|
||||
if (inv.getStackInSlot(i) != null)
|
||||
{
|
||||
if (dmgItems[0] == null)
|
||||
{
|
||||
dmgItems[0] = inv.getStackInSlot(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
dmgItems[1] = inv.getStackInSlot(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dmgItems[0] == null || dmgItems[0].getItem() == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (dmgItems[1] != null && dmgItems[0].getItem() == dmgItems[1].getItem() && dmgItems[0].stackSize == 1 && dmgItems[1].stackSize == 1 && dmgItems[0].getItem().isRepairable())
|
||||
{
|
||||
Item theItem = dmgItems[0].getItem();
|
||||
|
|
@ -105,12 +89,10 @@ public class ItemHelper
|
|||
IRecipe recipe;
|
||||
for (int i = 0; i < CraftingManager.getInstance().getRecipeList().size(); i++)
|
||||
{
|
||||
recipe = (IRecipe) CraftingManager.getInstance().getRecipeList().get(i);
|
||||
recipe = CraftingManager.getInstance().getRecipeList().get(i);
|
||||
|
||||
if (recipe.matches(inv, world))
|
||||
{
|
||||
return recipe.getCraftingResult(inv);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue