Properly Updating to 1.8.8 :D
|
|
@ -1,5 +0,0 @@
|
||||||
I'm a simple guy. And as it happens, as a student, right now I've got some spare time!! If you have a request, just stick it down below this line, PM me, or you can always do it yourself and send me a PR!
|
|
||||||
|
|
||||||
If you want me to add an ore to the Electroextractor's item list, let me know. I can do this quite easily (so can you if you just know the GameRegistry and how to pick the right number for your color!). Preesh as always guys, don't forget, requests below!:
|
|
||||||
|
|
||||||
_____________________________________________________________________________________________________________________________
|
|
||||||
|
|
@ -5,19 +5,24 @@ import java.util.Random;
|
||||||
import com.oitsjustjose.criss_cross.CrissCross;
|
import com.oitsjustjose.criss_cross.CrissCross;
|
||||||
import com.oitsjustjose.criss_cross.GUI.GUIHandler;
|
import com.oitsjustjose.criss_cross.GUI.GUIHandler;
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityCobblegen;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityCobblegen;
|
||||||
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityCobblegen;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.ClientProxy;
|
||||||
import com.oitsjustjose.criss_cross.Util.Reference;
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.InventoryHelper;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.world.World;
|
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
|
public class BlockCobblegen extends BlockMachineBase
|
||||||
{
|
{
|
||||||
|
|
@ -27,17 +32,7 @@ public class BlockCobblegen extends BlockMachineBase
|
||||||
{
|
{
|
||||||
super(unlocName);
|
super(unlocName);
|
||||||
GameRegistry.registerTileEntity(TileEntityCobblegen.class, unlocName);
|
GameRegistry.registerTileEntity(TileEntityCobblegen.class, unlocName);
|
||||||
GameRegistry.registerBlock(this, unlocName);
|
GameRegistry.registerBlock(this, unlocName.toLowerCase());
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister register)
|
|
||||||
{
|
|
||||||
blockTextures[0] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Bottom");
|
|
||||||
blockTextures[1] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Top");
|
|
||||||
blockTextures[2] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Front");
|
|
||||||
blockTextures[3] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Sides");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -47,62 +42,23 @@ public class BlockCobblegen extends BlockMachineBase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta)
|
public void breakBlock(World world, BlockPos pos, IBlockState state)
|
||||||
{
|
{
|
||||||
Random random = new Random();
|
|
||||||
TileEntityCobblegen tile = (TileEntityCobblegen) world.getTileEntity(x, y, z);
|
|
||||||
|
|
||||||
if(tile != null)
|
TileEntity tileentity = world.getTileEntity(pos);
|
||||||
{
|
|
||||||
for(int i = 0; i < tile.getSizeInventory(); ++i)
|
|
||||||
{
|
|
||||||
ItemStack itemstack = tile.getStackInSlot(i);
|
|
||||||
|
|
||||||
if(itemstack != null)
|
if (tileentity instanceof TileEntityCobblegen)
|
||||||
{
|
{
|
||||||
float f = random.nextFloat() * 0.8F + 0.1F;
|
InventoryHelper.dropInventoryItems(world, pos, (TileEntityCobblegen) tileentity);
|
||||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
world.updateComparatorOutputLevel(pos, this);
|
||||||
float f2 = random.nextFloat() * 0.8F + 0.1F;
|
|
||||||
|
|
||||||
while(itemstack.stackSize > 0)
|
|
||||||
{
|
|
||||||
int j = random.nextInt(21) + 10;
|
|
||||||
|
|
||||||
if(j > itemstack.stackSize)
|
|
||||||
{
|
|
||||||
j = itemstack.stackSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack.stackSize -= j;
|
super.breakBlock(world, pos, state);
|
||||||
EntityItem entityitem = new EntityItem(world, (double) ((float) x + f),
|
|
||||||
(double) ((float) y + f1), (double) ((float) z + f2),
|
|
||||||
new ItemStack(itemstack.getItem(), j, itemstack.getItemDamage()));
|
|
||||||
|
|
||||||
if(itemstack.hasTagCompound())
|
|
||||||
{
|
|
||||||
entityitem.getEntityItem()
|
|
||||||
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
|
||||||
}
|
|
||||||
|
|
||||||
float f3 = 0.05F;
|
|
||||||
entityitem.motionX = (double) ((float) random.nextGaussian() * f3);
|
|
||||||
entityitem.motionY = (double) ((float) random.nextGaussian() * f3 + 0.2F);
|
|
||||||
entityitem.motionZ = (double) ((float) random.nextGaussian() * f3);
|
|
||||||
world.spawnEntityInWorld(entityitem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
world.func_147453_f(x, y, z, block);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
super.breakBlock(world, x, y, z, block, meta);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY,
|
||||||
float hitY, float hitZ)
|
float hitZ)
|
||||||
{
|
{
|
||||||
if (world.isRemote)
|
if (world.isRemote)
|
||||||
{
|
{
|
||||||
|
|
@ -110,9 +66,9 @@ public class BlockCobblegen extends BlockMachineBase
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TileEntityCobblegen tile = (TileEntityCobblegen) world.getTileEntity(x, y, z);
|
TileEntityCobblegen tile = (TileEntityCobblegen) world.getTileEntity(pos);
|
||||||
if (tile != null)
|
if (tile != null)
|
||||||
player.openGui(CrissCross.instance, GUIHandler.Cobblegen, world, x, y, z);
|
player.openGui(CrissCross.instance, GUIHandler.Cobblegen, world, pos.getX(), pos.getY(), pos.getZ());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,20 +5,25 @@ import java.util.Random;
|
||||||
import com.oitsjustjose.criss_cross.CrissCross;
|
import com.oitsjustjose.criss_cross.CrissCross;
|
||||||
import com.oitsjustjose.criss_cross.GUI.GUIHandler;
|
import com.oitsjustjose.criss_cross.GUI.GUIHandler;
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityCropomator;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityCropomator;
|
||||||
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityCropomator;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.ClientProxy;
|
||||||
import com.oitsjustjose.criss_cross.Util.Reference;
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.inventory.InventoryHelper;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.world.World;
|
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
|
public class BlockCropomator extends BlockMachineBase
|
||||||
{
|
{
|
||||||
|
|
@ -28,71 +33,7 @@ public class BlockCropomator extends BlockMachineBase
|
||||||
{
|
{
|
||||||
super(unlocName);
|
super(unlocName);
|
||||||
GameRegistry.registerTileEntity(TileEntityCropomator.class, unlocName);
|
GameRegistry.registerTileEntity(TileEntityCropomator.class, unlocName);
|
||||||
GameRegistry.registerBlock(this, unlocName);
|
GameRegistry.registerBlock(this, unlocName.toLowerCase());
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister register)
|
|
||||||
{
|
|
||||||
blockTextures[0] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Bottom");
|
|
||||||
blockTextures[1] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Top");
|
|
||||||
blockTextures[2] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Front");
|
|
||||||
blockTextures[3] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Sides");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta)
|
|
||||||
{
|
|
||||||
Random random = new Random();
|
|
||||||
TileEntityCropomator tile = (TileEntityCropomator) world.getTileEntity(x, y, z);
|
|
||||||
|
|
||||||
if(tile != null)
|
|
||||||
{
|
|
||||||
for(int i = 0; i < tile.getSizeInventory(); ++i)
|
|
||||||
{
|
|
||||||
ItemStack itemstack = tile.getStackInSlot(i);
|
|
||||||
|
|
||||||
if(itemstack != null)
|
|
||||||
{
|
|
||||||
float f = random.nextFloat() * 0.8F + 0.1F;
|
|
||||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
|
||||||
float f2 = random.nextFloat() * 0.8F + 0.1F;
|
|
||||||
|
|
||||||
while(itemstack.stackSize > 0)
|
|
||||||
{
|
|
||||||
int j = random.nextInt(21) + 10;
|
|
||||||
|
|
||||||
if(j > itemstack.stackSize)
|
|
||||||
{
|
|
||||||
j = itemstack.stackSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
itemstack.stackSize -= j;
|
|
||||||
EntityItem entityitem = new EntityItem(world, (double) ((float) x + f),
|
|
||||||
(double) ((float) y + f1), (double) ((float) z + f2),
|
|
||||||
new ItemStack(itemstack.getItem(), j, itemstack.getItemDamage()));
|
|
||||||
|
|
||||||
if(itemstack.hasTagCompound())
|
|
||||||
{
|
|
||||||
entityitem.getEntityItem()
|
|
||||||
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
|
||||||
}
|
|
||||||
|
|
||||||
float f3 = 0.05F;
|
|
||||||
entityitem.motionX = (double) ((float) random.nextGaussian() * f3);
|
|
||||||
entityitem.motionY = (double) ((float) random.nextGaussian() * f3 + 0.2F);
|
|
||||||
entityitem.motionZ = (double) ((float) random.nextGaussian() * f3);
|
|
||||||
world.spawnEntityInWorld(entityitem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
world.func_147453_f(x, y, z, block);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
super.breakBlock(world, x, y, z, block, meta);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -102,8 +43,23 @@ public class BlockCropomator extends BlockMachineBase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public void breakBlock(World world, BlockPos pos, IBlockState state)
|
||||||
float hitY, float hitZ)
|
{
|
||||||
|
|
||||||
|
TileEntity tileentity = world.getTileEntity(pos);
|
||||||
|
|
||||||
|
if (tileentity instanceof TileEntityCropomator)
|
||||||
|
{
|
||||||
|
InventoryHelper.dropInventoryItems(world, pos, (TileEntityCropomator) tileentity);
|
||||||
|
world.updateComparatorOutputLevel(pos, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
super.breakBlock(world, pos, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
@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)
|
||||||
{
|
{
|
||||||
|
|
@ -111,9 +67,9 @@ public class BlockCropomator extends BlockMachineBase
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TileEntityCropomator tile = (TileEntityCropomator) world.getTileEntity(x, y, z);
|
TileEntityCropomator tile = (TileEntityCropomator) world.getTileEntity(pos);
|
||||||
if (tile != null)
|
if (tile != null)
|
||||||
player.openGui(CrissCross.instance, GUIHandler.Cropomator, world, x, y, z);
|
player.openGui(CrissCross.instance, GUIHandler.Stonegen, world, pos.getX(), pos.getY(), pos.getZ());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,19 +6,23 @@ import com.oitsjustjose.criss_cross.CrissCross;
|
||||||
import com.oitsjustjose.criss_cross.GUI.GUIHandler;
|
import com.oitsjustjose.criss_cross.GUI.GUIHandler;
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityElectroextractor;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityElectroextractor;
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityElectroextractor;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityElectroextractor;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.ClientProxy;
|
||||||
import com.oitsjustjose.criss_cross.Util.Reference;
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.InventoryHelper;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.world.World;
|
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
|
public class BlockElectroextractor extends BlockMachineBase
|
||||||
{
|
{
|
||||||
|
|
@ -28,17 +32,7 @@ public class BlockElectroextractor extends BlockMachineBase
|
||||||
{
|
{
|
||||||
super(unlocName);
|
super(unlocName);
|
||||||
GameRegistry.registerTileEntity(TileEntityElectroextractor.class, unlocName);
|
GameRegistry.registerTileEntity(TileEntityElectroextractor.class, unlocName);
|
||||||
GameRegistry.registerBlock(this, unlocName);
|
GameRegistry.registerBlock(this, unlocName.toLowerCase());
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister register)
|
|
||||||
{
|
|
||||||
blockTextures[0] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Bottom");
|
|
||||||
blockTextures[1] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Top");
|
|
||||||
blockTextures[2] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Front");
|
|
||||||
blockTextures[3] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Sides");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -48,62 +42,23 @@ public class BlockElectroextractor extends BlockMachineBase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta)
|
public void breakBlock(World world, BlockPos pos, IBlockState state)
|
||||||
{
|
{
|
||||||
Random random = new Random();
|
|
||||||
TileEntityElectroextractor tile = (TileEntityElectroextractor) world.getTileEntity(x, y, z);
|
|
||||||
|
|
||||||
if(tile != null)
|
TileEntity tileentity = world.getTileEntity(pos);
|
||||||
{
|
|
||||||
for(int i = 0; i < tile.getSizeInventory(); ++i)
|
|
||||||
{
|
|
||||||
ItemStack itemstack = tile.getStackInSlot(i);
|
|
||||||
|
|
||||||
if(itemstack != null)
|
if (tileentity instanceof TileEntityElectroextractor)
|
||||||
{
|
{
|
||||||
float f = random.nextFloat() * 0.8F + 0.1F;
|
InventoryHelper.dropInventoryItems(world, pos, (TileEntityElectroextractor) tileentity);
|
||||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
world.updateComparatorOutputLevel(pos, this);
|
||||||
float f2 = random.nextFloat() * 0.8F + 0.1F;
|
|
||||||
|
|
||||||
while(itemstack.stackSize > 0)
|
|
||||||
{
|
|
||||||
int j = random.nextInt(21) + 10;
|
|
||||||
|
|
||||||
if(j > itemstack.stackSize)
|
|
||||||
{
|
|
||||||
j = itemstack.stackSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack.stackSize -= j;
|
super.breakBlock(world, pos, state);
|
||||||
EntityItem entityitem = new EntityItem(world, (double) ((float) x + f),
|
|
||||||
(double) ((float) y + f1), (double) ((float) z + f2),
|
|
||||||
new ItemStack(itemstack.getItem(), j, itemstack.getItemDamage()));
|
|
||||||
|
|
||||||
if(itemstack.hasTagCompound())
|
|
||||||
{
|
|
||||||
entityitem.getEntityItem()
|
|
||||||
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
|
||||||
}
|
|
||||||
|
|
||||||
float f3 = 0.05F;
|
|
||||||
entityitem.motionX = (double) ((float) random.nextGaussian() * f3);
|
|
||||||
entityitem.motionY = (double) ((float) random.nextGaussian() * f3 + 0.2F);
|
|
||||||
entityitem.motionZ = (double) ((float) random.nextGaussian() * f3);
|
|
||||||
world.spawnEntityInWorld(entityitem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
world.func_147453_f(x, y, z, block);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
super.breakBlock(world, x, y, z, block, meta);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY,
|
||||||
float hitY, float hitZ)
|
float hitZ)
|
||||||
{
|
{
|
||||||
if (world.isRemote)
|
if (world.isRemote)
|
||||||
{
|
{
|
||||||
|
|
@ -111,9 +66,9 @@ public class BlockElectroextractor extends BlockMachineBase
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TileEntityElectroextractor tile = (TileEntityElectroextractor) world.getTileEntity(x, y, z);
|
TileEntityElectroextractor tile = (TileEntityElectroextractor) world.getTileEntity(pos);
|
||||||
if (tile != null)
|
if (tile != null)
|
||||||
player.openGui(CrissCross.instance, GUIHandler.Electroextractor, world, x, y, z);
|
player.openGui(CrissCross.instance, GUIHandler.Stonegen, world, pos.getX(), pos.getY(), pos.getZ());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,136 +3,162 @@ package com.oitsjustjose.criss_cross.Blocks;
|
||||||
import com.oitsjustjose.criss_cross.CrissCross;
|
import com.oitsjustjose.criss_cross.CrissCross;
|
||||||
import com.oitsjustjose.criss_cross.Util.Reference;
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.block.properties.IProperty;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
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.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.BlockPos;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.EnumWorldBlockLayer;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class BlockMachineBase extends BlockContainer
|
public class BlockMachineBase extends BlockContainer
|
||||||
{
|
{
|
||||||
IIcon[] blockTextures = new IIcon[4];
|
public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
|
||||||
private static String unlocalizedName;
|
private static String unlocalizedName;
|
||||||
private static boolean isActive = false;
|
private static boolean isActive = false;
|
||||||
|
|
||||||
public BlockMachineBase(String unlocName)
|
public BlockMachineBase(String unlocName)
|
||||||
{
|
{
|
||||||
super(Material.rock); // 0 - Top
|
super(Material.rock);
|
||||||
this.setHardness(2.0F); // 1 - Bottom
|
this.setHardness(2.0F);
|
||||||
this.setResistance(2.0F); // 3 - Front
|
this.setResistance(2.0F);
|
||||||
this.setStepSound(soundTypeMetal); // 4 - Sides
|
this.setStepSound(soundTypeMetal);
|
||||||
this.setBlockName(Reference.modid + "." + unlocName);
|
this.setUnlocalizedName(Reference.modid + "." + unlocName);
|
||||||
this.setCreativeTab(CrissCross.CCTab);
|
this.setCreativeTab(CrissCross.CCTab);
|
||||||
|
|
||||||
this.unlocalizedName = unlocName;
|
this.unlocalizedName = unlocName;
|
||||||
|
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
|
||||||
|
Reference.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used for the ItemStack vs. In-world Rendering
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int side, int meta)
|
@Override
|
||||||
|
public EnumWorldBlockLayer getBlockLayer()
|
||||||
{
|
{
|
||||||
if(side == 0)
|
return EnumWorldBlockLayer.CUTOUT;
|
||||||
return blockTextures[0];
|
|
||||||
if(side == 1)
|
|
||||||
return blockTextures[1];
|
|
||||||
if(side == 3)
|
|
||||||
return blockTextures[2];
|
|
||||||
|
|
||||||
return blockTextures[3];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
public void onBlockAdded(World world, BlockPos pos, IBlockState state)
|
||||||
|
{
|
||||||
|
setDefaultFacing(world, pos, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||||
|
{
|
||||||
|
return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderType()
|
||||||
|
{
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side)
|
public IBlockState getStateForEntityRender(IBlockState state)
|
||||||
{
|
{
|
||||||
if(side == 0)
|
return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH);
|
||||||
return blockTextures[0];
|
|
||||||
if(side == 1)
|
|
||||||
return blockTextures[1];
|
|
||||||
if(side == access.getBlockMetadata(x, y, z))
|
|
||||||
return blockTextures[2];
|
|
||||||
|
|
||||||
return blockTextures[3];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockAdded(World world, int x, int y, int z)
|
public IBlockState getStateFromMeta(int meta)
|
||||||
{
|
{
|
||||||
super.onBlockAdded(world, x, y, z);
|
EnumFacing enumfacing = EnumFacing.getFront(meta);
|
||||||
setMetadataForFront(world, x, y, z);
|
|
||||||
|
if (enumfacing.getAxis() == EnumFacing.Axis.Y)
|
||||||
|
{
|
||||||
|
enumfacing = EnumFacing.NORTH;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.getDefaultState().withProperty(FACING, enumfacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemstack)
|
public int getMetaFromState(IBlockState state)
|
||||||
{
|
{
|
||||||
|
return ((EnumFacing)state.getValue(FACING)).getIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected BlockState createBlockState()
|
||||||
|
{
|
||||||
|
return new BlockState(this, new IProperty[] {FACING});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase entity, ItemStack itemstack)
|
||||||
|
{
|
||||||
|
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((double) (entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||||
|
|
||||||
if (l == 0)
|
if (l == 0)
|
||||||
{
|
{
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
world.setBlockState(pos, state.getBlock().getStateFromMeta(2), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l == 1)
|
if (l == 1)
|
||||||
{
|
{
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
world.setBlockState(pos, state.getBlock().getStateFromMeta(5), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l == 2)
|
if (l == 2)
|
||||||
{
|
{
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
world.setBlockState(pos, state.getBlock().getStateFromMeta(3), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l == 3)
|
if (l == 3)
|
||||||
{
|
{
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
world.setBlockState(pos, state.getBlock().getStateFromMeta(4), 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMetadataForFront(World world, int x, int y, int z)
|
private void setDefaultFacing(World world, BlockPos pos, IBlockState state)
|
||||||
{
|
{
|
||||||
if (!world.isRemote)
|
if (!world.isRemote)
|
||||||
{
|
{
|
||||||
Block block = world.getBlock(x, y, z - 1);
|
Block block = world.getBlockState(pos.north()).getBlock();
|
||||||
Block block1 = world.getBlock(x, y, z + 1);
|
Block block1 = world.getBlockState(pos.south()).getBlock();
|
||||||
Block block2 = world.getBlock(x - 1, y, z);
|
Block block2 = world.getBlockState(pos.west()).getBlock();
|
||||||
Block block3 = world.getBlock(x + 1, y, z);
|
Block block3 = world.getBlockState(pos.east()).getBlock();
|
||||||
byte b0 = 3;
|
EnumFacing enumfacing = (EnumFacing) state.getValue(FACING);
|
||||||
|
if (enumfacing == EnumFacing.NORTH && block.isFullBlock() && !block1.isFullBlock())
|
||||||
if(block.func_149730_j() && !block1.func_149730_j())
|
|
||||||
{
|
{
|
||||||
b0 = 3;
|
enumfacing = EnumFacing.SOUTH;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if(block1.func_149730_j() && !block.func_149730_j())
|
if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock() && !block.isFullBlock())
|
||||||
{
|
{
|
||||||
b0 = 2;
|
enumfacing = EnumFacing.NORTH;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if(block2.func_149730_j() && !block3.func_149730_j())
|
if (enumfacing == EnumFacing.WEST && block2.isFullBlock() && !block3.isFullBlock())
|
||||||
{
|
{
|
||||||
b0 = 5;
|
enumfacing = EnumFacing.EAST;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if(block3.func_149730_j() && !block2.func_149730_j())
|
if (enumfacing == EnumFacing.EAST && block3.isFullBlock() && !block2.isFullBlock())
|
||||||
{
|
{
|
||||||
b0 = 4;
|
enumfacing = EnumFacing.WEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, b0, 2);
|
world.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateBlockState(boolean active, World world, int x, int y, int z)
|
public static void updateBlockState(boolean active, World world, BlockPos pos)
|
||||||
{
|
{
|
||||||
isActive = active;
|
isActive = active;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,18 @@
|
||||||
package com.oitsjustjose.criss_cross.Blocks;
|
package com.oitsjustjose.criss_cross.Blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.CrissCross;
|
import com.oitsjustjose.criss_cross.CrissCross;
|
||||||
import com.oitsjustjose.criss_cross.GUI.GUIHandler;
|
import com.oitsjustjose.criss_cross.GUI.GUIHandler;
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityStonegen;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityStonegen;
|
||||||
import com.oitsjustjose.criss_cross.Util.Reference;
|
import com.oitsjustjose.criss_cross.Util.ClientProxy;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import net.minecraft.entity.item.EntityItem;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.inventory.InventoryHelper;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public class BlockStonegen extends BlockMachineBase
|
public class BlockStonegen extends BlockMachineBase
|
||||||
{
|
{
|
||||||
|
|
@ -27,17 +22,7 @@ public class BlockStonegen extends BlockMachineBase
|
||||||
{
|
{
|
||||||
super(unlocName);
|
super(unlocName);
|
||||||
GameRegistry.registerTileEntity(TileEntityStonegen.class, unlocName);
|
GameRegistry.registerTileEntity(TileEntityStonegen.class, unlocName);
|
||||||
GameRegistry.registerBlock(this, unlocName);
|
GameRegistry.registerBlock(this, unlocName.toLowerCase());
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister register)
|
|
||||||
{
|
|
||||||
blockTextures[0] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Bottom");
|
|
||||||
blockTextures[1] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Top");
|
|
||||||
blockTextures[2] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Front");
|
|
||||||
blockTextures[3] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Sides");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -47,62 +32,23 @@ public class BlockStonegen extends BlockMachineBase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta)
|
public void breakBlock(World world, BlockPos pos, IBlockState state)
|
||||||
{
|
{
|
||||||
Random random = new Random();
|
|
||||||
TileEntityStonegen tile = (TileEntityStonegen) world.getTileEntity(x, y, z);
|
|
||||||
|
|
||||||
if(tile != null)
|
TileEntity tileentity = world.getTileEntity(pos);
|
||||||
{
|
|
||||||
for(int i = 0; i < tile.getSizeInventory(); ++i)
|
|
||||||
{
|
|
||||||
ItemStack itemstack = tile.getStackInSlot(i);
|
|
||||||
|
|
||||||
if(itemstack != null)
|
if (tileentity instanceof TileEntityStonegen)
|
||||||
{
|
{
|
||||||
float f = random.nextFloat() * 0.8F + 0.1F;
|
InventoryHelper.dropInventoryItems(world, pos, (TileEntityStonegen) tileentity);
|
||||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
world.updateComparatorOutputLevel(pos, this);
|
||||||
float f2 = random.nextFloat() * 0.8F + 0.1F;
|
|
||||||
|
|
||||||
while(itemstack.stackSize > 0)
|
|
||||||
{
|
|
||||||
int j = random.nextInt(21) + 10;
|
|
||||||
|
|
||||||
if(j > itemstack.stackSize)
|
|
||||||
{
|
|
||||||
j = itemstack.stackSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack.stackSize -= j;
|
super.breakBlock(world, pos, state);
|
||||||
EntityItem entityitem = new EntityItem(world, (double) ((float) x + f),
|
|
||||||
(double) ((float) y + f1), (double) ((float) z + f2),
|
|
||||||
new ItemStack(itemstack.getItem(), j, itemstack.getItemDamage()));
|
|
||||||
|
|
||||||
if(itemstack.hasTagCompound())
|
|
||||||
{
|
|
||||||
entityitem.getEntityItem()
|
|
||||||
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
|
||||||
}
|
|
||||||
|
|
||||||
float f3 = 0.05F;
|
|
||||||
entityitem.motionX = (double) ((float) random.nextGaussian() * f3);
|
|
||||||
entityitem.motionY = (double) ((float) random.nextGaussian() * f3 + 0.2F);
|
|
||||||
entityitem.motionZ = (double) ((float) random.nextGaussian() * f3);
|
|
||||||
world.spawnEntityInWorld(entityitem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
world.func_147453_f(x, y, z, block);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
super.breakBlock(world, x, y, z, block, meta);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY,
|
||||||
float hitY, float hitZ)
|
float hitZ)
|
||||||
{
|
{
|
||||||
if (world.isRemote)
|
if (world.isRemote)
|
||||||
{
|
{
|
||||||
|
|
@ -110,9 +56,9 @@ public class BlockStonegen extends BlockMachineBase
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TileEntityStonegen tile = (TileEntityStonegen) world.getTileEntity(x, y, z);
|
TileEntityStonegen tile = (TileEntityStonegen) world.getTileEntity(pos);
|
||||||
if (tile != null)
|
if (tile != null)
|
||||||
player.openGui(CrissCross.instance, GUIHandler.Stonegen, world, x, y, z);
|
player.openGui(CrissCross.instance, GUIHandler.Stonegen, world, pos.getX(), pos.getY(), pos.getZ());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,19 +5,24 @@ import java.util.Random;
|
||||||
import com.oitsjustjose.criss_cross.CrissCross;
|
import com.oitsjustjose.criss_cross.CrissCross;
|
||||||
import com.oitsjustjose.criss_cross.GUI.GUIHandler;
|
import com.oitsjustjose.criss_cross.GUI.GUIHandler;
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityWoodchipper;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityWoodchipper;
|
||||||
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityWoodchipper;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.ClientProxy;
|
||||||
import com.oitsjustjose.criss_cross.Util.Reference;
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.InventoryHelper;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.world.World;
|
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
|
public class BlockWoodchipper extends BlockMachineBase
|
||||||
{
|
{
|
||||||
|
|
@ -27,17 +32,8 @@ public class BlockWoodchipper extends BlockMachineBase
|
||||||
{
|
{
|
||||||
super(unlocName);
|
super(unlocName);
|
||||||
GameRegistry.registerTileEntity(TileEntityWoodchipper.class, unlocName);
|
GameRegistry.registerTileEntity(TileEntityWoodchipper.class, unlocName);
|
||||||
GameRegistry.registerBlock(this, unlocName);
|
GameRegistry.registerBlock(this, unlocName.toLowerCase());
|
||||||
}
|
Reference.add(this);
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister register)
|
|
||||||
{
|
|
||||||
blockTextures[0] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Bottom");
|
|
||||||
blockTextures[1] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Top");
|
|
||||||
blockTextures[2] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Front");
|
|
||||||
blockTextures[3] = register.registerIcon(Reference.modid + ":" + this.unlocName + "/" + unlocName + "_Sides");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -47,62 +43,23 @@ public class BlockWoodchipper extends BlockMachineBase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta)
|
public void breakBlock(World world, BlockPos pos, IBlockState state)
|
||||||
{
|
{
|
||||||
Random random = new Random();
|
|
||||||
TileEntityWoodchipper tile = (TileEntityWoodchipper) world.getTileEntity(x, y, z);
|
|
||||||
|
|
||||||
if(tile != null)
|
TileEntity tileentity = world.getTileEntity(pos);
|
||||||
{
|
|
||||||
for(int i = 0; i < tile.getSizeInventory(); ++i)
|
|
||||||
{
|
|
||||||
ItemStack itemstack = tile.getStackInSlot(i);
|
|
||||||
|
|
||||||
if(itemstack != null)
|
if (tileentity instanceof TileEntityWoodchipper)
|
||||||
{
|
{
|
||||||
float f = random.nextFloat() * 0.8F + 0.1F;
|
InventoryHelper.dropInventoryItems(world, pos, (TileEntityWoodchipper) tileentity);
|
||||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
world.updateComparatorOutputLevel(pos, this);
|
||||||
float f2 = random.nextFloat() * 0.8F + 0.1F;
|
|
||||||
|
|
||||||
while(itemstack.stackSize > 0)
|
|
||||||
{
|
|
||||||
int j = random.nextInt(21) + 10;
|
|
||||||
|
|
||||||
if(j > itemstack.stackSize)
|
|
||||||
{
|
|
||||||
j = itemstack.stackSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack.stackSize -= j;
|
super.breakBlock(world, pos, state);
|
||||||
EntityItem entityitem = new EntityItem(world, (double) ((float) x + f),
|
|
||||||
(double) ((float) y + f1), (double) ((float) z + f2),
|
|
||||||
new ItemStack(itemstack.getItem(), j, itemstack.getItemDamage()));
|
|
||||||
|
|
||||||
if(itemstack.hasTagCompound())
|
|
||||||
{
|
|
||||||
entityitem.getEntityItem()
|
|
||||||
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
|
||||||
}
|
|
||||||
|
|
||||||
float f3 = 0.05F;
|
|
||||||
entityitem.motionX = (double) ((float) random.nextGaussian() * f3);
|
|
||||||
entityitem.motionY = (double) ((float) random.nextGaussian() * f3 + 0.2F);
|
|
||||||
entityitem.motionZ = (double) ((float) random.nextGaussian() * f3);
|
|
||||||
world.spawnEntityInWorld(entityitem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
world.func_147453_f(x, y, z, block);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
super.breakBlock(world, x, y, z, block, meta);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY,
|
||||||
float hitY, float hitZ)
|
float hitZ)
|
||||||
{
|
{
|
||||||
if (world.isRemote)
|
if (world.isRemote)
|
||||||
{
|
{
|
||||||
|
|
@ -110,9 +67,9 @@ public class BlockWoodchipper extends BlockMachineBase
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TileEntityWoodchipper tile = (TileEntityWoodchipper) world.getTileEntity(x, y, z);
|
TileEntityWoodchipper tile = (TileEntityWoodchipper) world.getTileEntity(pos);
|
||||||
if (tile != null)
|
if (tile != null)
|
||||||
player.openGui(CrissCross.instance, GUIHandler.Woodchipper, world, x, y, z);
|
player.openGui(CrissCross.instance, GUIHandler.Stonegen, world, pos.getX(), pos.getY(), pos.getZ());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,10 @@ package com.oitsjustjose.criss_cross.Blocks;
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.CrissCross;
|
import com.oitsjustjose.criss_cross.CrissCross;
|
||||||
import com.oitsjustjose.criss_cross.GUI.GUIHandler;
|
import com.oitsjustjose.criss_cross.GUI.GUIHandler;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||||
|
|
||||||
public class CCBlocks
|
public class CCBlocks
|
||||||
{
|
{
|
||||||
|
|
@ -21,7 +22,6 @@ public class CCBlocks
|
||||||
woodchipper = new BlockWoodchipper();
|
woodchipper = new BlockWoodchipper();
|
||||||
cobblegen = new BlockCobblegen();
|
cobblegen = new BlockCobblegen();
|
||||||
stonegen = new BlockStonegen();
|
stonegen = new BlockStonegen();
|
||||||
|
|
||||||
NetworkRegistry.INSTANCE.registerGuiHandler(CrissCross.instance, new GUIHandler());
|
NetworkRegistry.INSTANCE.registerGuiHandler(CrissCross.instance, new GUIHandler());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
package com.oitsjustjose.criss_cross.Container;
|
package com.oitsjustjose.criss_cross.Container;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityCobblegen;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityCobblegen;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.ICrafting;
|
import net.minecraft.inventory.ICrafting;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ContainerCobblegen extends Container
|
public class ContainerCobblegen extends Container
|
||||||
{
|
{
|
||||||
|
|
@ -52,9 +53,9 @@ public class ContainerCobblegen extends Container
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addCraftingToCrafters(ICrafting crafting)
|
public void onCraftGuiOpened(ICrafting crafting)
|
||||||
{
|
{
|
||||||
super.addCraftingToCrafters(crafting);
|
super.onCraftGuiOpened(crafting);
|
||||||
crafting.sendProgressBarUpdate(this, 0, this.cobblegen.processTime);
|
crafting.sendProgressBarUpdate(this, 0, this.cobblegen.processTime);
|
||||||
crafting.sendProgressBarUpdate(this, 1, this.cobblegen.fuelTime);
|
crafting.sendProgressBarUpdate(this, 1, this.cobblegen.fuelTime);
|
||||||
crafting.sendProgressBarUpdate(this, 2, this.cobblegen.fuelUsetime);
|
crafting.sendProgressBarUpdate(this, 2, this.cobblegen.fuelUsetime);
|
||||||
|
|
@ -100,7 +101,8 @@ public class ContainerCobblegen extends Container
|
||||||
|
|
||||||
slot.onSlotChange(itemstack1, itemstack);
|
slot.onSlotChange(itemstack1, itemstack);
|
||||||
}
|
}
|
||||||
else if(slotID != 1 && slotID != 0)
|
else
|
||||||
|
if (slotID != 1 && slotID != 0)
|
||||||
{
|
{
|
||||||
if (TileEntityCobblegen.isValid(itemstack1))
|
if (TileEntityCobblegen.isValid(itemstack1))
|
||||||
{
|
{
|
||||||
|
|
@ -109,26 +111,30 @@ public class ContainerCobblegen extends Container
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(TileEntityCobblegen.isItemFuel(itemstack1))
|
else
|
||||||
|
if (TileEntityCobblegen.isItemFuel(itemstack1))
|
||||||
{
|
{
|
||||||
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(slotID >= 3 && slotID < 30)
|
else
|
||||||
|
if (slotID >= 3 && slotID < 30)
|
||||||
{
|
{
|
||||||
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
else
|
||||||
|
if (slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(!this.mergeItemStack(itemstack1, 3, 39, false))
|
else
|
||||||
|
if (!this.mergeItemStack(itemstack1, 3, 39, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,14 @@ package com.oitsjustjose.criss_cross.Container;
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityCropomator;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityCropomator;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.ICrafting;
|
import net.minecraft.inventory.ICrafting;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraft.tileentity.TileEntityFurnace;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ContainerCropomator extends Container
|
public class ContainerCropomator extends Container
|
||||||
{
|
{
|
||||||
|
|
@ -57,9 +55,9 @@ public class ContainerCropomator extends Container
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addCraftingToCrafters(ICrafting crafting)
|
public void onCraftGuiOpened(ICrafting crafting)
|
||||||
{
|
{
|
||||||
super.addCraftingToCrafters(crafting);
|
super.onCraftGuiOpened(crafting);
|
||||||
crafting.sendProgressBarUpdate(this, 0, this.cropomator.processTime);
|
crafting.sendProgressBarUpdate(this, 0, this.cropomator.processTime);
|
||||||
crafting.sendProgressBarUpdate(this, 1, this.cropomator.catalystTime);
|
crafting.sendProgressBarUpdate(this, 1, this.cropomator.catalystTime);
|
||||||
crafting.sendProgressBarUpdate(this, 2, this.cropomator.catalystInUseTime);
|
crafting.sendProgressBarUpdate(this, 2, this.cropomator.catalystInUseTime);
|
||||||
|
|
@ -105,7 +103,8 @@ public class ContainerCropomator extends Container
|
||||||
|
|
||||||
slot.onSlotChange(itemstack1, itemstack);
|
slot.onSlotChange(itemstack1, itemstack);
|
||||||
}
|
}
|
||||||
else if(slotID != 1 && slotID != 0)
|
else
|
||||||
|
if (slotID != 1 && slotID != 0)
|
||||||
{
|
{
|
||||||
if (TileEntityCropomator.isValid(itemstack1))
|
if (TileEntityCropomator.isValid(itemstack1))
|
||||||
{
|
{
|
||||||
|
|
@ -114,26 +113,30 @@ public class ContainerCropomator extends Container
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(TileEntityCropomator.isItemCatalyst(itemstack1))
|
else
|
||||||
|
if (TileEntityCropomator.isItemCatalyst(itemstack1))
|
||||||
{
|
{
|
||||||
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(slotID >= 3 && slotID < 30)
|
else
|
||||||
|
if (slotID >= 3 && slotID < 30)
|
||||||
{
|
{
|
||||||
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
else
|
||||||
|
if (slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(!this.mergeItemStack(itemstack1, 3, 39, false))
|
else
|
||||||
|
if (!this.mergeItemStack(itemstack1, 3, 39, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,14 @@ package com.oitsjustjose.criss_cross.Container;
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityElectroextractor;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityElectroextractor;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.ICrafting;
|
import net.minecraft.inventory.ICrafting;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ContainerElectroextractor extends Container
|
public class ContainerElectroextractor extends Container
|
||||||
{
|
{
|
||||||
|
|
@ -55,9 +55,9 @@ public class ContainerElectroextractor extends Container
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addCraftingToCrafters(ICrafting crafting)
|
public void onCraftGuiOpened(ICrafting crafting)
|
||||||
{
|
{
|
||||||
super.addCraftingToCrafters(crafting);
|
super.onCraftGuiOpened(crafting);
|
||||||
crafting.sendProgressBarUpdate(this, 0, this.electroextractor.crushTime);
|
crafting.sendProgressBarUpdate(this, 0, this.electroextractor.crushTime);
|
||||||
crafting.sendProgressBarUpdate(this, 1, this.electroextractor.fuelTime);
|
crafting.sendProgressBarUpdate(this, 1, this.electroextractor.fuelTime);
|
||||||
crafting.sendProgressBarUpdate(this, 2, this.electroextractor.fuelInUseTime);
|
crafting.sendProgressBarUpdate(this, 2, this.electroextractor.fuelInUseTime);
|
||||||
|
|
@ -103,7 +103,8 @@ public class ContainerElectroextractor extends Container
|
||||||
|
|
||||||
slot.onSlotChange(itemstack1, itemstack);
|
slot.onSlotChange(itemstack1, itemstack);
|
||||||
}
|
}
|
||||||
else if(slotID != 1 && slotID != 0)
|
else
|
||||||
|
if (slotID != 1 && slotID != 0)
|
||||||
{
|
{
|
||||||
if (TileEntityElectroextractor.isValid(itemstack1))
|
if (TileEntityElectroextractor.isValid(itemstack1))
|
||||||
{
|
{
|
||||||
|
|
@ -112,26 +113,30 @@ public class ContainerElectroextractor extends Container
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(TileEntityElectroextractor.isItemEnergetic(itemstack1))
|
else
|
||||||
|
if (TileEntityElectroextractor.isItemEnergetic(itemstack1))
|
||||||
{
|
{
|
||||||
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(slotID >= 3 && slotID < 30)
|
else
|
||||||
|
if (slotID >= 3 && slotID < 30)
|
||||||
{
|
{
|
||||||
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
else
|
||||||
|
if (slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(!this.mergeItemStack(itemstack1, 3, 39, false))
|
else
|
||||||
|
if (!this.mergeItemStack(itemstack1, 3, 39, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
package com.oitsjustjose.criss_cross.Container;
|
package com.oitsjustjose.criss_cross.Container;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityStonegen;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityStonegen;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.ICrafting;
|
import net.minecraft.inventory.ICrafting;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ContainerStonegen extends Container
|
public class ContainerStonegen extends Container
|
||||||
{
|
{
|
||||||
|
|
@ -52,9 +53,9 @@ public class ContainerStonegen extends Container
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addCraftingToCrafters(ICrafting crafting)
|
public void onCraftGuiOpened(ICrafting crafting)
|
||||||
{
|
{
|
||||||
super.addCraftingToCrafters(crafting);
|
super.onCraftGuiOpened(crafting);
|
||||||
crafting.sendProgressBarUpdate(this, 0, this.Stonegen.processTime);
|
crafting.sendProgressBarUpdate(this, 0, this.Stonegen.processTime);
|
||||||
crafting.sendProgressBarUpdate(this, 1, this.Stonegen.fuelTime);
|
crafting.sendProgressBarUpdate(this, 1, this.Stonegen.fuelTime);
|
||||||
crafting.sendProgressBarUpdate(this, 2, this.Stonegen.fuelUsetime);
|
crafting.sendProgressBarUpdate(this, 2, this.Stonegen.fuelUsetime);
|
||||||
|
|
@ -100,7 +101,8 @@ public class ContainerStonegen extends Container
|
||||||
|
|
||||||
slot.onSlotChange(itemstack1, itemstack);
|
slot.onSlotChange(itemstack1, itemstack);
|
||||||
}
|
}
|
||||||
else if(slotID != 1 && slotID != 0)
|
else
|
||||||
|
if (slotID != 1 && slotID != 0)
|
||||||
{
|
{
|
||||||
if (TileEntityStonegen.isValid(itemstack1))
|
if (TileEntityStonegen.isValid(itemstack1))
|
||||||
{
|
{
|
||||||
|
|
@ -109,26 +111,30 @@ public class ContainerStonegen extends Container
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(TileEntityStonegen.isItemFuel(itemstack1))
|
else
|
||||||
|
if (TileEntityStonegen.isItemFuel(itemstack1))
|
||||||
{
|
{
|
||||||
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(slotID >= 3 && slotID < 30)
|
else
|
||||||
|
if (slotID >= 3 && slotID < 30)
|
||||||
{
|
{
|
||||||
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
else
|
||||||
|
if (slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(!this.mergeItemStack(itemstack1, 3, 39, false))
|
else
|
||||||
|
if (!this.mergeItemStack(itemstack1, 3, 39, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,14 @@ package com.oitsjustjose.criss_cross.Container;
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityWoodchipper;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityWoodchipper;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.ICrafting;
|
import net.minecraft.inventory.ICrafting;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ContainerWoodchipper extends Container
|
public class ContainerWoodchipper extends Container
|
||||||
{
|
{
|
||||||
|
|
@ -53,9 +53,9 @@ public class ContainerWoodchipper extends Container
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addCraftingToCrafters(ICrafting crafting)
|
public void onCraftGuiOpened(ICrafting crafting)
|
||||||
{
|
{
|
||||||
super.addCraftingToCrafters(crafting);
|
super.onCraftGuiOpened(crafting);
|
||||||
crafting.sendProgressBarUpdate(this, 0, this.woodchipper.processTime);
|
crafting.sendProgressBarUpdate(this, 0, this.woodchipper.processTime);
|
||||||
crafting.sendProgressBarUpdate(this, 1, this.woodchipper.fuelTime);
|
crafting.sendProgressBarUpdate(this, 1, this.woodchipper.fuelTime);
|
||||||
crafting.sendProgressBarUpdate(this, 2, this.woodchipper.fuelUsetime);
|
crafting.sendProgressBarUpdate(this, 2, this.woodchipper.fuelUsetime);
|
||||||
|
|
@ -101,7 +101,8 @@ public class ContainerWoodchipper extends Container
|
||||||
|
|
||||||
slot.onSlotChange(itemstack1, itemstack);
|
slot.onSlotChange(itemstack1, itemstack);
|
||||||
}
|
}
|
||||||
else if(slotID != 1 && slotID != 0)
|
else
|
||||||
|
if (slotID != 1 && slotID != 0)
|
||||||
{
|
{
|
||||||
if (TileEntityWoodchipper.isValidForWoodchipper(itemstack1))
|
if (TileEntityWoodchipper.isValidForWoodchipper(itemstack1))
|
||||||
{
|
{
|
||||||
|
|
@ -110,26 +111,30 @@ public class ContainerWoodchipper extends Container
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(TileEntityWoodchipper.isItemFuel(itemstack1))
|
else
|
||||||
|
if (TileEntityWoodchipper.isItemFuel(itemstack1))
|
||||||
{
|
{
|
||||||
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
if (!this.mergeItemStack(itemstack1, 1, 2, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(slotID >= 3 && slotID < 30)
|
else
|
||||||
|
if (slotID >= 3 && slotID < 30)
|
||||||
{
|
{
|
||||||
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
if (!this.mergeItemStack(itemstack1, 30, 39, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
else
|
||||||
|
if (slotID >= 30 && slotID < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(!this.mergeItemStack(itemstack1, 3, 39, false))
|
else
|
||||||
|
if (!this.mergeItemStack(itemstack1, 3, 39, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,9 @@
|
||||||
package com.oitsjustjose.criss_cross.Container;
|
package com.oitsjustjose.criss_cross.Container;
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
|
||||||
import net.minecraft.entity.item.EntityXPOrb;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Items;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
|
||||||
import net.minecraft.stats.AchievementList;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
|
|
||||||
public class MachineOutputSlot extends Slot
|
public class MachineOutputSlot extends Slot
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,23 +2,27 @@ package com.oitsjustjose.criss_cross;
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.Blocks.CCBlocks;
|
import com.oitsjustjose.criss_cross.Blocks.CCBlocks;
|
||||||
import com.oitsjustjose.criss_cross.Items.CCItems;
|
import com.oitsjustjose.criss_cross.Items.CCItems;
|
||||||
|
import com.oitsjustjose.criss_cross.Items.ItemDust;
|
||||||
import com.oitsjustjose.criss_cross.Recipes.CCCraftingRecipes;
|
import com.oitsjustjose.criss_cross.Recipes.CCCraftingRecipes;
|
||||||
import com.oitsjustjose.criss_cross.Recipes.CCMachineRecipes;
|
import com.oitsjustjose.criss_cross.Recipes.CCMachineRecipes;
|
||||||
import com.oitsjustjose.criss_cross.Util.CCTab;
|
import com.oitsjustjose.criss_cross.Util.CCTab;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.ClientProxy;
|
||||||
import com.oitsjustjose.criss_cross.Util.CommonProxy;
|
import com.oitsjustjose.criss_cross.Util.CommonProxy;
|
||||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||||
import com.oitsjustjose.criss_cross.Util.OreDictionaryAdder;
|
import com.oitsjustjose.criss_cross.Util.OreDictionaryAdder;
|
||||||
import com.oitsjustjose.criss_cross.Util.Reference;
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import net.minecraft.client.Minecraft;
|
||||||
import cpw.mods.fml.common.Mod;
|
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||||
import cpw.mods.fml.common.Mod.EventHandler;
|
|
||||||
import cpw.mods.fml.common.Mod.Instance;
|
|
||||||
import cpw.mods.fml.common.SidedProxy;
|
|
||||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
|
||||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
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.FMLPreInitializationEvent;
|
||||||
|
|
||||||
@Mod(modid = Reference.modid, version = Reference.version, guiFactory = Reference.guifactory)
|
@Mod(modid = Reference.modid, version = Reference.version, guiFactory = Reference.guifactory)
|
||||||
public class CrissCross
|
public class CrissCross
|
||||||
|
|
@ -35,19 +39,21 @@ public class CrissCross
|
||||||
public static void preInit(FMLPreInitializationEvent event)
|
public static void preInit(FMLPreInitializationEvent event)
|
||||||
{
|
{
|
||||||
ConfigHandler.init(event.getSuggestedConfigurationFile());
|
ConfigHandler.init(event.getSuggestedConfigurationFile());
|
||||||
FMLCommonHandler.instance().bus().register(new ConfigHandler());
|
MinecraftForge.EVENT_BUS.register(new ConfigHandler());
|
||||||
CCTab = new CCTab();
|
CCTab = new CCTab();
|
||||||
proxy.preInit();
|
proxy.preInit();
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public static void init(FMLInitializationEvent event)
|
|
||||||
{
|
|
||||||
CCBlocks.init();
|
CCBlocks.init();
|
||||||
CCItems.init();
|
CCItems.init();
|
||||||
CCCraftingRecipes.init();
|
CCCraftingRecipes.init();
|
||||||
CCMachineRecipes.init();
|
CCMachineRecipes.init();
|
||||||
OreDictionaryAdder.init();
|
OreDictionaryAdder.init();
|
||||||
proxy.init();
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public static void init(FMLInitializationEvent event)
|
||||||
|
{
|
||||||
|
if(event.getSide().isClient())
|
||||||
|
ClientProxy.init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -25,8 +25,7 @@ public class GUICobblegen extends GuiContainer
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.cobblegen"), 30, 7, 4210752);
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.cobblegen"), 30, 7, 4210752);
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92,
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
||||||
4210752);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,7 @@ public class GUICropomator extends GuiContainer
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.cropomator"), 55, 7, 4210752);
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.cropomator"), 55, 7, 4210752);
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92,
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
||||||
4210752);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,7 @@ import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
public class GUIElectroextractor extends GuiContainer
|
public class GUIElectroextractor extends GuiContainer
|
||||||
{
|
{
|
||||||
public static final ResourceLocation texture = new ResourceLocation("crisscross",
|
public static final ResourceLocation texture = new ResourceLocation("crisscross", "textures/gui/electroextractor.png");
|
||||||
"textures/gui/electroextractor.png");
|
|
||||||
|
|
||||||
private TileEntityElectroextractor electroextractor;
|
private TileEntityElectroextractor electroextractor;
|
||||||
|
|
||||||
|
|
@ -26,8 +25,7 @@ public class GUIElectroextractor extends GuiContainer
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.electroextractor"), 50, 7, 4210752);
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.electroextractor"), 50, 7, 4210752);
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92,
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
||||||
4210752);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,11 @@ package com.oitsjustjose.criss_cross.GUI;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import cpw.mods.fml.client.IModGuiFactory;
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
import net.minecraftforge.fml.client.IModGuiFactory;
|
||||||
|
import net.minecraftforge.fml.client.IModGuiFactory.RuntimeOptionCategoryElement;
|
||||||
|
import net.minecraftforge.fml.client.IModGuiFactory.RuntimeOptionGuiHandler;
|
||||||
|
|
||||||
public class GUIFactory implements IModGuiFactory
|
public class GUIFactory implements IModGuiFactory
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.oitsjustjose.criss_cross.GUI;
|
package com.oitsjustjose.criss_cross.GUI;
|
||||||
|
|
||||||
|
import com.oitsjustjose.criss_cross.Container.ContainerCobblegen;
|
||||||
import com.oitsjustjose.criss_cross.Container.ContainerCropomator;
|
import com.oitsjustjose.criss_cross.Container.ContainerCropomator;
|
||||||
import com.oitsjustjose.criss_cross.Container.ContainerElectroextractor;
|
import com.oitsjustjose.criss_cross.Container.ContainerElectroextractor;
|
||||||
import com.oitsjustjose.criss_cross.Container.ContainerStonegen;
|
import com.oitsjustjose.criss_cross.Container.ContainerStonegen;
|
||||||
|
|
@ -10,11 +11,12 @@ import com.oitsjustjose.criss_cross.TileEntity.TileEntityElectroextractor;
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityStonegen;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityStonegen;
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityWoodchipper;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityWoodchipper;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.IGuiHandler;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import com.oitsjustjose.criss_cross.Container.ContainerCobblegen;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.fml.common.network.IGuiHandler;
|
||||||
|
|
||||||
public class GUIHandler implements IGuiHandler
|
public class GUIHandler implements IGuiHandler
|
||||||
{
|
{
|
||||||
|
|
@ -27,7 +29,7 @@ public class GUIHandler implements IGuiHandler
|
||||||
@Override
|
@Override
|
||||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||||
{
|
{
|
||||||
TileEntity tile = world.getTileEntity(x, y, z);
|
TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
|
||||||
|
|
||||||
if (tile instanceof TileEntityCropomator)
|
if (tile instanceof TileEntityCropomator)
|
||||||
{
|
{
|
||||||
|
|
@ -66,7 +68,7 @@ public class GUIHandler implements IGuiHandler
|
||||||
@Override
|
@Override
|
||||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||||
{
|
{
|
||||||
TileEntity tile = world.getTileEntity(x, y, z);
|
TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
|
||||||
|
|
||||||
if (tile instanceof TileEntityCropomator)
|
if (tile instanceof TileEntityCropomator)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,7 @@ public class GUIStonegen extends GuiContainer
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.stonegen"), 30, 7, 4210752);
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.stonegen"), 30, 7, 4210752);
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92,
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
||||||
4210752);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,7 @@ public class GUIWoodchipper extends GuiContainer
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.woodchipper"), 55, 7, 4210752);
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.woodchipper"), 55, 7, 4210752);
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92,
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92, 4210752);
|
||||||
4210752);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,16 @@ package com.oitsjustjose.criss_cross.GUI;
|
||||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||||
import com.oitsjustjose.criss_cross.Util.Reference;
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import cpw.mods.fml.client.config.GuiConfig;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraftforge.common.config.ConfigElement;
|
import net.minecraftforge.common.config.ConfigElement;
|
||||||
import net.minecraftforge.common.config.Configuration;
|
import net.minecraftforge.common.config.Configuration;
|
||||||
|
import net.minecraftforge.fml.client.config.GuiConfig;
|
||||||
|
|
||||||
public class ModGUIConfig extends GuiConfig
|
public class ModGUIConfig extends GuiConfig
|
||||||
{
|
{
|
||||||
public ModGUIConfig(GuiScreen guiScreen)
|
public ModGUIConfig(GuiScreen guiScreen)
|
||||||
{
|
{
|
||||||
super(guiScreen,
|
super(guiScreen, new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), Reference.modid,
|
||||||
new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
|
false, true, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
|
||||||
Reference.modid, false, true, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,16 +1,17 @@
|
||||||
package com.oitsjustjose.criss_cross.Items;
|
package com.oitsjustjose.criss_cross.Items;
|
||||||
|
|
||||||
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
|
||||||
|
|
||||||
public class CCItems
|
public class CCItems
|
||||||
{
|
{
|
||||||
public static Item dusts;
|
public static Item dusts;
|
||||||
public static Item magicBucket;
|
public static Item buckets;
|
||||||
|
|
||||||
public static void init()
|
public static void init()
|
||||||
{
|
{
|
||||||
dusts = new ItemDust();
|
dusts = new ItemDust();
|
||||||
magicBucket = new ItemMagicBuckets();
|
buckets = new ItemModBuckets();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,35 +4,28 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.CrissCross;
|
import com.oitsjustjose.criss_cross.CrissCross;
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityElectroextractor;
|
import com.oitsjustjose.criss_cross.Util.ClientProxy;
|
||||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
|
||||||
import com.oitsjustjose.criss_cross.Util.Reference;
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ItemDust extends Item
|
public class ItemDust extends Item
|
||||||
{
|
{
|
||||||
private static ArrayList<String> dustNames = new ArrayList<String>();
|
private static ArrayList<String> dustNames = new ArrayList<String>();
|
||||||
private static ArrayList<Integer> colors = new ArrayList<Integer>();
|
private static ArrayList<Integer> colors = new ArrayList<Integer>();
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public static IIcon overlay;
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public static IIcon base;
|
|
||||||
|
|
||||||
public ItemDust()
|
public ItemDust()
|
||||||
{
|
{
|
||||||
this.setHasSubtypes(true);
|
this.setHasSubtypes(true);
|
||||||
this.setCreativeTab(CrissCross.CCTab);
|
this.setCreativeTab(CrissCross.CCTab);
|
||||||
GameRegistry.registerItem(this, "itemDust");
|
GameRegistry.registerItem(this, "dust");
|
||||||
|
Reference.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<String> getDusts()
|
public static ArrayList<String> getDusts()
|
||||||
|
|
@ -51,37 +44,6 @@ public class ItemDust extends Item
|
||||||
return dustNames.get(meta);
|
return dustNames.get(meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean requiresMultipleRenderPasses()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IIcon getIconFromDamageForRenderPass(int meta, int pass)
|
|
||||||
{
|
|
||||||
return pass == 0 ? base : overlay;
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public String getUnlocalizedName(ItemStack itemStack)
|
|
||||||
// {
|
|
||||||
// if(itemStack.getItemDamage() >= colors.size() || itemStack.getItemDamage() >= dustNames.size())
|
|
||||||
// {
|
|
||||||
// itemStack.setStackDisplayName(StatCollector.translateToLocal("item.CrissCross.trash.name"));
|
|
||||||
// return("item." + Reference.modid + ".trash");
|
|
||||||
// }
|
|
||||||
// return "item." + Reference.modid + "." + dustNames.get(itemStack.getItemDamage());
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerIcons(IIconRegister register)
|
|
||||||
{
|
|
||||||
overlay = register.registerIcon(Reference.modid + ":dust_overlay");
|
|
||||||
base = register.registerIcon(Reference.modid + ":dust_base");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public int getColorFromItemStack(ItemStack stack, int pass)
|
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||||
|
|
@ -100,7 +62,8 @@ public class ItemDust extends Item
|
||||||
public String getUnlocalizedNameInefficiently(ItemStack itemstack)
|
public String getUnlocalizedNameInefficiently(ItemStack itemstack)
|
||||||
{
|
{
|
||||||
int meta = itemstack.getItemDamage();
|
int meta = itemstack.getItemDamage();
|
||||||
return (StatCollector.translateToLocal("item.CrissCross.dustPrefix") + " " + ItemDust.getName(meta) + " " + StatCollector.translateToLocal("item.CrissCross.dustPostfix"));
|
return (StatCollector.translateToLocal("item.CrissCross.dustPrefix") + " " + ItemDust.getName(meta) + " " + StatCollector.translateToLocal(
|
||||||
|
"item.CrissCross.dustPostfix"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -109,6 +72,12 @@ public class ItemDust extends Item
|
||||||
return this.getUnlocalizedNameInefficiently(itemstack);
|
return this.getUnlocalizedNameInefficiently(itemstack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
return "item." + Reference.modid + ".dust";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item item, CreativeTabs tab, List list)
|
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||||
|
|
|
||||||
|
|
@ -1,135 +0,0 @@
|
||||||
package com.oitsjustjose.criss_cross.Items;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.CrissCross;
|
|
||||||
import com.oitsjustjose.criss_cross.Util.Reference;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class ItemMagicBuckets extends Item
|
|
||||||
{
|
|
||||||
String[] types = new String[]
|
|
||||||
{
|
|
||||||
"everfulBucket", "voidBucket"
|
|
||||||
};
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
IIcon[] icons = new IIcon[types.length];
|
|
||||||
|
|
||||||
public ItemMagicBuckets()
|
|
||||||
{
|
|
||||||
this.setHasSubtypes(true);
|
|
||||||
this.maxStackSize = 1;
|
|
||||||
this.setCreativeTab(CrissCross.CCTab);
|
|
||||||
GameRegistry.registerItem(this, "magicBucket");
|
|
||||||
this.setContainerItem(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public IIcon getIconFromDamage(int meta)
|
|
||||||
{
|
|
||||||
return icons[meta];
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerIcons(IIconRegister register)
|
|
||||||
{
|
|
||||||
for(int i = 0; i < icons.length; i++)
|
|
||||||
icons[i] = register.registerIcon(Reference.modid + ":" + types[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
|
|
||||||
{
|
|
||||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, true);
|
|
||||||
|
|
||||||
if(movingobjectposition == null)
|
|
||||||
{
|
|
||||||
return itemstack;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
|
||||||
{
|
|
||||||
int x = movingobjectposition.blockX;
|
|
||||||
int y = movingobjectposition.blockY;
|
|
||||||
int z = movingobjectposition.blockZ;
|
|
||||||
|
|
||||||
if(!world.canMineBlock(player, x, y, z))
|
|
||||||
return itemstack;
|
|
||||||
|
|
||||||
if(!player.canPlayerEdit(x, y, z, movingobjectposition.sideHit, itemstack))
|
|
||||||
return itemstack;
|
|
||||||
|
|
||||||
if(itemstack.getItemDamage() == 1)
|
|
||||||
{
|
|
||||||
Material material = world.getBlock(x, y, z).getMaterial();
|
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
|
||||||
|
|
||||||
if(material.isLiquid() && meta == 0)
|
|
||||||
world.setBlockToAir(x, y, z);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(world.getBlock(x, y, z).getMaterial() == Material.lava
|
|
||||||
|| world.getBlock(x, y, z).getMaterial() == Material.water)
|
|
||||||
return itemstack;
|
|
||||||
|
|
||||||
if(movingobjectposition.sideHit == 0)
|
|
||||||
--y;
|
|
||||||
|
|
||||||
if(movingobjectposition.sideHit == 1)
|
|
||||||
++y;
|
|
||||||
|
|
||||||
if(movingobjectposition.sideHit == 2)
|
|
||||||
--z;
|
|
||||||
|
|
||||||
if(movingobjectposition.sideHit == 3)
|
|
||||||
++z;
|
|
||||||
|
|
||||||
if(movingobjectposition.sideHit == 4)
|
|
||||||
--x;
|
|
||||||
|
|
||||||
if(movingobjectposition.sideHit == 5)
|
|
||||||
++x;
|
|
||||||
|
|
||||||
if(!player.canPlayerEdit(x, y, z, movingobjectposition.sideHit, itemstack))
|
|
||||||
return itemstack;
|
|
||||||
|
|
||||||
if(itemstack.getItemDamage() == 0)
|
|
||||||
world.setBlock(x, y, z, Blocks.flowing_water);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return itemstack;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getUnlocalizedName(ItemStack itemStack)
|
|
||||||
{
|
|
||||||
return "item." + Reference.modid + "." + types[itemStack.getItemDamage()];
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void getSubItems(Item item, CreativeTabs tab, List list)
|
|
||||||
{
|
|
||||||
for(int i = 0; i < types.length; i++)
|
|
||||||
list.add(new ItemStack(item, 1, i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,123 @@
|
||||||
|
package com.oitsjustjose.criss_cross.Items;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.oitsjustjose.criss_cross.CrissCross;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.ClientProxy;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
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 ItemModBuckets extends Item
|
||||||
|
{
|
||||||
|
String[] types = new String[] { "everfulBucket", "voidBucket" };
|
||||||
|
|
||||||
|
public ItemModBuckets()
|
||||||
|
{
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
this.maxStackSize = 1;
|
||||||
|
this.setCreativeTab(CrissCross.CCTab);
|
||||||
|
this.setContainerItem(this);
|
||||||
|
GameRegistry.registerItem(this, "magicBucket");
|
||||||
|
Reference.add(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
|
||||||
|
{
|
||||||
|
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, true);
|
||||||
|
|
||||||
|
if (movingobjectposition == null)
|
||||||
|
{
|
||||||
|
return itemstack;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||||
|
{
|
||||||
|
BlockPos blockpos = movingobjectposition.getBlockPos();
|
||||||
|
IBlockState state = world.getBlockState(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() == 0)
|
||||||
|
world.setBlockState(blockpos, Blocks.flowing_water.getDefaultState(), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return itemstack;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
return "item." + Reference.modid + "." + types[itemStack.getItemDamage()];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < types.length; i++)
|
||||||
|
list.add(new ItemStack(item, 1, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -5,10 +5,10 @@ import com.oitsjustjose.criss_cross.Items.CCItems;
|
||||||
import com.oitsjustjose.criss_cross.Util.CCLog;
|
import com.oitsjustjose.criss_cross.Util.CCLog;
|
||||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||||
|
|
||||||
public class CCCraftingRecipes
|
public class CCCraftingRecipes
|
||||||
|
|
@ -24,33 +24,20 @@ public class CCCraftingRecipes
|
||||||
|
|
||||||
static void initBlockGeneratorRecipes()
|
static void initBlockGeneratorRecipes()
|
||||||
{
|
{
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(CCBlocks.cobblegen),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(CCBlocks.cobblegen), "CPC", "#$#", "CPC", '$', "blockIron", 'C', "cobblestone", 'P',
|
||||||
"CPC",
|
Blocks.piston, '#', Items.stone_pickaxe));
|
||||||
"#$#",
|
|
||||||
"CPC",
|
|
||||||
'$', "blockIron", 'C', "cobblestone", 'P', Blocks.piston, '#', Items.stone_pickaxe
|
|
||||||
));
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(CCBlocks.stonegen),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(CCBlocks.stonegen), "CPC", "#$#", "CPC", '$', "blockIron", 'C', "stone", 'P',
|
||||||
"CPC",
|
Blocks.piston, '#', Items.stone_pickaxe));
|
||||||
"#$#",
|
|
||||||
"CPC",
|
|
||||||
'$', "blockIron", 'C', "stone", 'P', Blocks.piston, '#', Items.stone_pickaxe
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void initBucketRecipes()
|
static void initBucketRecipes()
|
||||||
{
|
{
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(CCItems.magicBucket, 1, 0),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(CCItems.buckets, 1, 0), "DFD", "WBW", "DFD", 'W', Items.water_bucket, 'B',
|
||||||
"DFD", "WBW", "DFD", 'W', Items.water_bucket, 'B', Items.bucket, 'D', "gemDiamond", 'F', "blockDiamond"
|
Items.bucket, 'D', "gemDiamond", 'F', "blockDiamond"));
|
||||||
));
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(CCItems.magicBucket, 1, 1),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(CCItems.buckets, 1, 1), "OGO", "GBG", "OGO", 'B', Items.bucket, 'G',
|
||||||
"OGO",
|
"blockGlass", 'O', Blocks.obsidian));
|
||||||
"GBG",
|
|
||||||
"OGO",
|
|
||||||
'B', Items.bucket, 'G', "blockGlass", 'O', Blocks.obsidian
|
|
||||||
));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,9 +46,9 @@ public class CCCraftingRecipes
|
||||||
String[] unlocItem = ConfigHandler.woodchipperRecipeItem.split(":");
|
String[] unlocItem = ConfigHandler.woodchipperRecipeItem.split(":");
|
||||||
ItemStack centerItem = new ItemStack(Blocks.diamond_block);
|
ItemStack centerItem = new ItemStack(Blocks.diamond_block);
|
||||||
|
|
||||||
if(GameRegistry.findItemStack(unlocItem[0], unlocItem[1], 1) != null)
|
if (ConfigHandler.findItemStack(unlocItem[0], unlocItem[1]) != null)
|
||||||
{
|
{
|
||||||
ItemStack newStack = GameRegistry.findItemStack(unlocItem[0], unlocItem[1], 1);
|
ItemStack newStack = ConfigHandler.findItemStack(unlocItem[0], unlocItem[1]);
|
||||||
if (unlocItem.length == 2)
|
if (unlocItem.length == 2)
|
||||||
centerItem = newStack;
|
centerItem = newStack;
|
||||||
if (unlocItem.length == 3)
|
if (unlocItem.length == 3)
|
||||||
|
|
@ -69,16 +56,12 @@ public class CCCraftingRecipes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.woodchipperRecipeItem
|
CCLog.warn("Item " + ConfigHandler.woodchipperRecipeItem + "could not be added as part of the recipe of the Woodchipper.");
|
||||||
+ "could not be added as part of the recipe of the Woodchipper.");
|
|
||||||
CCLog.warn("Please confirm you have the name and formatting correct.");
|
CCLog.warn("Please confirm you have the name and formatting correct.");
|
||||||
}
|
}
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(CCBlocks.woodchipper), new Object[]
|
GameRegistry.addRecipe(new ItemStack(CCBlocks.woodchipper), new Object[] { "I#I", "SCS", "I#I", '#', Items.diamond_axe, 'I', Blocks.iron_bars,
|
||||||
{
|
'S', Items.golden_axe, 'C', centerItem });
|
||||||
"I#I", "SCS", "I#I", '#', Items.diamond_axe, 'I', Blocks.iron_bars, 'S', Items.golden_axe, 'C',
|
|
||||||
centerItem
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void electroextractorRecipe()
|
static void electroextractorRecipe()
|
||||||
|
|
@ -86,9 +69,9 @@ public class CCCraftingRecipes
|
||||||
String[] unlocItem = ConfigHandler.electroextractorRecipeItem.split(":");
|
String[] unlocItem = ConfigHandler.electroextractorRecipeItem.split(":");
|
||||||
ItemStack centerItem = new ItemStack(Blocks.diamond_block);
|
ItemStack centerItem = new ItemStack(Blocks.diamond_block);
|
||||||
|
|
||||||
if(GameRegistry.findItemStack(unlocItem[0], unlocItem[1], 1) != null)
|
if (ConfigHandler.findItemStack(unlocItem[0], unlocItem[1]) != null)
|
||||||
{
|
{
|
||||||
ItemStack newStack = GameRegistry.findItemStack(unlocItem[0], unlocItem[1], 1);
|
ItemStack newStack = ConfigHandler.findItemStack(unlocItem[0], unlocItem[1]);
|
||||||
if (unlocItem.length == 2)
|
if (unlocItem.length == 2)
|
||||||
centerItem = newStack;
|
centerItem = newStack;
|
||||||
if (unlocItem.length == 3)
|
if (unlocItem.length == 3)
|
||||||
|
|
@ -96,17 +79,13 @@ public class CCCraftingRecipes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.electroextractorRecipeItem
|
CCLog.warn("Item " + ConfigHandler.electroextractorRecipeItem + " could not be added as part of the recipe of the electroextractor.");
|
||||||
+ " could not be added as part of the recipe of the electroextractor.");
|
|
||||||
CCLog.warn("Please confirm you have the name and formatting correct.");
|
CCLog.warn("Please confirm you have the name and formatting correct.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(CCBlocks.electroextractor), new Object[]
|
GameRegistry.addRecipe(new ItemStack(CCBlocks.electroextractor), new Object[] { "I#I", "SCS", "I#I", '#', Blocks.piston, 'I',
|
||||||
{
|
Blocks.iron_bars, 'S', Items.golden_pickaxe, 'C', centerItem });
|
||||||
"I#I", "SCS", "I#I", '#', Blocks.piston, 'I', Blocks.iron_bars, 'S', Items.golden_pickaxe, 'C',
|
|
||||||
centerItem
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cropomatorRecipe()
|
static void cropomatorRecipe()
|
||||||
|
|
@ -114,9 +93,9 @@ public class CCCraftingRecipes
|
||||||
String[] unlocItem = ConfigHandler.cropomatorRecipeItem.split(":");
|
String[] unlocItem = ConfigHandler.cropomatorRecipeItem.split(":");
|
||||||
ItemStack centerItem = new ItemStack(Blocks.diamond_block);
|
ItemStack centerItem = new ItemStack(Blocks.diamond_block);
|
||||||
|
|
||||||
if(GameRegistry.findItemStack(unlocItem[0], unlocItem[1], 1) != null)
|
if (ConfigHandler.findItemStack(unlocItem[0], unlocItem[1]) != null)
|
||||||
{
|
{
|
||||||
ItemStack newStack = GameRegistry.findItemStack(unlocItem[0], unlocItem[1], 1);
|
ItemStack newStack = ConfigHandler.findItemStack(unlocItem[0], unlocItem[1]);
|
||||||
if (unlocItem.length == 2)
|
if (unlocItem.length == 2)
|
||||||
centerItem = newStack;
|
centerItem = newStack;
|
||||||
if (unlocItem.length == 3)
|
if (unlocItem.length == 3)
|
||||||
|
|
@ -124,15 +103,12 @@ public class CCCraftingRecipes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.cropomatorRecipeItem
|
CCLog.warn("Item " + ConfigHandler.cropomatorRecipeItem + " could not be added as part of the recipe of the cropomator.");
|
||||||
+ " could not be added as part of the recipe of the cropomator.");
|
|
||||||
CCLog.warn("Please confirm you have the name and formatting correct.");
|
CCLog.warn("Please confirm you have the name and formatting correct.");
|
||||||
}
|
}
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(CCBlocks.cropomator), new Object[]
|
GameRegistry.addRecipe(new ItemStack(CCBlocks.cropomator), new Object[] { "I#I", "SCS", "I#I", '#', Blocks.hay_block, 'I', Items.iron_ingot,
|
||||||
{
|
'S', Items.golden_hoe, 'C', centerItem });
|
||||||
"I#I", "SCS", "I#I", '#', Blocks.hay_block, 'I', Items.iron_ingot, 'S', Items.golden_hoe, 'C',
|
|
||||||
centerItem
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.oitsjustjose.criss_cross.Recipes;
|
package com.oitsjustjose.criss_cross.Recipes;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.Items.CCItems;
|
import com.oitsjustjose.criss_cross.Items.CCItems;
|
||||||
import com.oitsjustjose.criss_cross.Items.ItemDust;
|
import com.oitsjustjose.criss_cross.Items.ItemDust;
|
||||||
|
|
@ -8,10 +9,10 @@ import com.oitsjustjose.criss_cross.TileEntity.TileEntityCropomator;
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityElectroextractor;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityElectroextractor;
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityWoodchipper;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityWoodchipper;
|
||||||
import com.oitsjustjose.criss_cross.Util.CCLog;
|
import com.oitsjustjose.criss_cross.Util.CCLog;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.ClientProxy;
|
||||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||||
import com.oitsjustjose.criss_cross.Util.ItemHelper;
|
import com.oitsjustjose.criss_cross.Util.ItemHelper;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
|
|
@ -19,6 +20,7 @@ import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.InventoryCrafting;
|
import net.minecraft.inventory.InventoryCrafting;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
public class CCMachineRecipes
|
public class CCMachineRecipes
|
||||||
|
|
@ -36,30 +38,9 @@ public class CCMachineRecipes
|
||||||
initWoodchipperFuels();
|
initWoodchipperFuels();
|
||||||
initWoodchipperOreDictionary();
|
initWoodchipperOreDictionary();
|
||||||
|
|
||||||
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.diamond_ore),
|
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.diamond_ore), new ItemStack(Items.diamond, electroQTY));
|
||||||
new ItemStack(Items.diamond, electroQTY));
|
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.emerald_ore), new ItemStack(Items.emerald, electroQTY));
|
||||||
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.emerald_ore),
|
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.coal_ore), new ItemStack(Items.coal, electroQTY));
|
||||||
new ItemStack(Items.emerald, electroQTY));
|
|
||||||
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.coal_ore),
|
|
||||||
new ItemStack(Items.coal, electroQTY));
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: Finish this, it's pretty important
|
|
||||||
|
|
||||||
public static void initAutosmithRecipes()
|
|
||||||
{
|
|
||||||
for(int i = 0; i < Item.itemRegistry.getKeys().size(); i++)
|
|
||||||
{
|
|
||||||
Item item = Item.getItemById(i);
|
|
||||||
if(item != null && item.isItemTool(new ItemStack(item, 1, Short.MAX_VALUE)) && item.isRepairable())
|
|
||||||
{
|
|
||||||
for(int j = 0; j < Item.ToolMaterial.values().length; j++)
|
|
||||||
{
|
|
||||||
ItemStack repairItem = Item.ToolMaterial.values()[j].getRepairItemStack();
|
|
||||||
if(repairItem.getDisplayName().contains(""));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initCropomatorRecipes()
|
public static void initCropomatorRecipes()
|
||||||
|
|
@ -71,42 +52,39 @@ public class CCMachineRecipes
|
||||||
String[] unlocStack = ConfigHandler.cropomatorInputs[i].split(":");
|
String[] unlocStack = ConfigHandler.cropomatorInputs[i].split(":");
|
||||||
if (unlocStack.length == 2)
|
if (unlocStack.length == 2)
|
||||||
{
|
{
|
||||||
if(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]) != null)
|
||||||
{
|
{
|
||||||
ItemStack newStack = GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1);
|
ItemStack newStack = ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]);
|
||||||
CropomatorRecipes.getInstance().addRecipe(newStack,
|
CropomatorRecipes.getInstance().addRecipe(newStack, new ItemStack(newStack.getItem(), cropomatorQTY, newStack
|
||||||
new ItemStack(newStack.getItem(), cropomatorQTY, newStack.getItemDamage()));
|
.getItemDamage()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i]
|
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i] + " could not be added to the Cropomator's recipe list.");
|
||||||
+ " could not be added to the Cropomator's recipe list.");
|
|
||||||
CCLog.warn("Please confirm you have the name and formatting correct.");
|
CCLog.warn("Please confirm you have the name and formatting correct.");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (unlocStack.length == 3)
|
if (unlocStack.length == 3)
|
||||||
{
|
{
|
||||||
if(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]) != null)
|
||||||
{
|
{
|
||||||
ItemStack newStack = new ItemStack(
|
ItemStack newStack = new ItemStack(ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]).getItem(), 1, Integer.parseInt(
|
||||||
GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1).getItem(), 1,
|
unlocStack[2]));
|
||||||
Integer.parseInt(unlocStack[2]));
|
|
||||||
newStack.stackSize = cropomatorQTY;
|
newStack.stackSize = cropomatorQTY;
|
||||||
CropomatorRecipes.getInstance().addRecipe(newStack,
|
CropomatorRecipes.getInstance().addRecipe(newStack, new ItemStack(newStack.getItem(), cropomatorQTY, newStack
|
||||||
new ItemStack(newStack.getItem(), cropomatorQTY, newStack.getItemDamage()));
|
.getItemDamage()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i]
|
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i] + " could not be added to the Cropomator's recipe list.");
|
||||||
+ " could not be added to the Cropomator's recipe list.");
|
|
||||||
CCLog.warn("Please confirm you have the name and formatting correct.");
|
CCLog.warn("Please confirm you have the name and formatting correct.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
CCLog.warn("[CrissCross]: Error reading itemstack for inputs from input file at item: " + (i + 1));
|
CCLog.warn("Error reading itemstack for inputs from input file at item: " + (i + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -121,29 +99,26 @@ public class CCMachineRecipes
|
||||||
String[] unlocStack = ConfigHandler.cropomatorCatalysts[i].split(":");
|
String[] unlocStack = ConfigHandler.cropomatorCatalysts[i].split(":");
|
||||||
if (unlocStack.length == 2)
|
if (unlocStack.length == 2)
|
||||||
{
|
{
|
||||||
if(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]) != null)
|
||||||
TileEntityCropomator.addFuel(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1));
|
TileEntityCropomator.addFuel(ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i]
|
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i] + " could not be added to the Cropomator's catalyst list.");
|
||||||
+ " could not be added to the Cropomator's catalyst list.");
|
|
||||||
CCLog.warn("Please confirm you have the name and formatting correct.");
|
CCLog.warn("Please confirm you have the name and formatting correct.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlocStack.length == 3)
|
if (unlocStack.length == 3)
|
||||||
{
|
{
|
||||||
if(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]) != null)
|
||||||
{
|
{
|
||||||
ItemStack newStack = new ItemStack(
|
ItemStack newStack = new ItemStack(ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]).getItem(), 1, Integer.parseInt(
|
||||||
GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1).getItem(), 1,
|
unlocStack[2]));
|
||||||
Integer.parseInt(unlocStack[2]));
|
|
||||||
TileEntityCropomator.addFuel(newStack);
|
TileEntityCropomator.addFuel(newStack);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i]
|
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i] + " could not be added to the Cropomator's catalyst list.");
|
||||||
+ " could not be added to the Cropomator's catalyst list.");
|
|
||||||
CCLog.warn("Please confirm you have the name and formatting correct.");
|
CCLog.warn("Please confirm you have the name and formatting correct.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -172,7 +147,7 @@ public class CCMachineRecipes
|
||||||
{
|
{
|
||||||
localInventoryCrafting.setInventorySlotContents(i, null);
|
localInventoryCrafting.setInventorySlotContents(i, null);
|
||||||
}
|
}
|
||||||
ArrayList localArrayList = OreDictionary.getOres("logWood");
|
List<ItemStack> localArrayList = OreDictionary.getOres("logWood");
|
||||||
for (int j = 0; j < localArrayList.size(); j++)
|
for (int j = 0; j < localArrayList.size(); j++)
|
||||||
{
|
{
|
||||||
ItemStack localItemStack1 = (ItemStack) localArrayList.get(j);
|
ItemStack localItemStack1 = (ItemStack) localArrayList.get(j);
|
||||||
|
|
@ -220,29 +195,26 @@ public class CCMachineRecipes
|
||||||
String[] unlocStack = ConfigHandler.woodchipperFuels[i].split(":");
|
String[] unlocStack = ConfigHandler.woodchipperFuels[i].split(":");
|
||||||
if (unlocStack.length == 2)
|
if (unlocStack.length == 2)
|
||||||
{
|
{
|
||||||
if(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]) != null)
|
||||||
TileEntityWoodchipper.addFuel(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 0));
|
TileEntityWoodchipper.addFuel(ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.woodchipperFuels[i]
|
CCLog.warn("Item " + ConfigHandler.woodchipperFuels[i] + " could not be added to the Woodchipper's fuel list.");
|
||||||
+ " could not be added to the Woodchipper's fuel list.");
|
|
||||||
CCLog.warn("Please confirm you have the name and formatting correct.");
|
CCLog.warn("Please confirm you have the name and formatting correct.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlocStack.length == 3)
|
if (unlocStack.length == 3)
|
||||||
{
|
{
|
||||||
if(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]) != null)
|
||||||
{
|
{
|
||||||
ItemStack newStack = new ItemStack(
|
ItemStack newStack = new ItemStack(ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]).getItem(), 1, Integer.parseInt(
|
||||||
GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1).getItem(), 1,
|
unlocStack[2]));
|
||||||
Integer.parseInt(unlocStack[2]));
|
|
||||||
TileEntityWoodchipper.addFuel(newStack);
|
TileEntityWoodchipper.addFuel(newStack);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.woodchipperFuels[i]
|
CCLog.warn("Item " + ConfigHandler.woodchipperFuels[i] + " could not be added to the Woodchipper's fuel list.");
|
||||||
+ " could not be added to the Woodchipper's fuel list.");
|
|
||||||
CCLog.warn("Please confirm you have the name and formatting correct.");
|
CCLog.warn("Please confirm you have the name and formatting correct.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -263,8 +235,8 @@ public class CCMachineRecipes
|
||||||
String[] unlocStack = ConfigHandler.electroextractorEnergySources[i].split(":");
|
String[] unlocStack = ConfigHandler.electroextractorEnergySources[i].split(":");
|
||||||
if (unlocStack.length == 2)
|
if (unlocStack.length == 2)
|
||||||
{
|
{
|
||||||
if(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]) != null)
|
||||||
TileEntityElectroextractor.addFuel(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 0));
|
TileEntityElectroextractor.addFuel(ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.electroextractorEnergySources[i]
|
CCLog.warn("Item " + ConfigHandler.electroextractorEnergySources[i]
|
||||||
|
|
@ -275,11 +247,10 @@ public class CCMachineRecipes
|
||||||
|
|
||||||
if (unlocStack.length == 3)
|
if (unlocStack.length == 3)
|
||||||
{
|
{
|
||||||
if(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]) != null)
|
||||||
{
|
{
|
||||||
ItemStack newStack = new ItemStack(
|
ItemStack newStack = new ItemStack(ConfigHandler.findItemStack(unlocStack[0], unlocStack[1]).getItem(), 1, Integer.parseInt(
|
||||||
GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1).getItem(), 1,
|
unlocStack[2]));
|
||||||
Integer.parseInt(unlocStack[2]));
|
|
||||||
TileEntityElectroextractor.addFuel(newStack);
|
TileEntityElectroextractor.addFuel(newStack);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -303,22 +274,20 @@ public class CCMachineRecipes
|
||||||
for (int i = 0; i < ConfigHandler.electroextractorOreDictInputs.length; i++)
|
for (int i = 0; i < ConfigHandler.electroextractorOreDictInputs.length; i++)
|
||||||
{
|
{
|
||||||
String[] entry = ConfigHandler.electroextractorOreDictInputs[i].split(":");
|
String[] entry = ConfigHandler.electroextractorOreDictInputs[i].split(":");
|
||||||
if(OreDictionary.doesOreNameExist("ore" + entry[0]) && OreDictionary.doesOreNameExist("ingot" + entry[0]))
|
if (doesOreNameExist("ore" + entry[0]) && doesOreNameExist("ingot" + entry[0]))
|
||||||
{
|
{
|
||||||
ArrayList<ItemStack> ores = OreDictionary.getOres("ore" + entry[0]);
|
List<ItemStack> ores = OreDictionary.getOres("ore" + entry[0]);
|
||||||
ItemDust.addDustType(entry[0], Integer.parseInt(entry[1]));
|
ItemDust.addDustType(entry[0], Integer.parseInt(entry[1]));
|
||||||
for (int j = 0; j < ores.size(); j++)
|
for (int j = 0; j < ores.size(); j++)
|
||||||
ElectroextractorRecipes.getInstance().addRecipe(ores.get(j),
|
ElectroextractorRecipes.getInstance().addRecipe(ores.get(j), new ItemStack(CCItems.dusts, electroQTY, dustNames.size() - 1));
|
||||||
new ItemStack(CCItems.dusts, electroQTY, dustNames.size() - 1));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Your oreDictionary Entry " + ConfigHandler.electroextractorOreDictInputs[i]
|
CCLog.warn("Your oreDictionary Entry " + ConfigHandler.electroextractorOreDictInputs[i] + " could not be registered.");
|
||||||
+ " could not be registered.");
|
if (!doesOreNameExist("ore" + entry[0]))
|
||||||
if(!OreDictionary.doesOreNameExist("ore" + entry[0]))
|
CCLog.warn("This is because your oreDictionary Entry was not valid or registered as " + entry[0] + ".");
|
||||||
CCLog.warn("This is because your oreDictionary Entry was not valid or registered as " + entry[0]
|
else
|
||||||
+ ".");
|
if (!doesOreNameExist("ingot" + entry[0]))
|
||||||
else if(!OreDictionary.doesOreNameExist("ingot" + entry[0]))
|
|
||||||
CCLog.warn("This is because your oreDictionary Entry does not have an ingot for " + entry[0] + ".");
|
CCLog.warn("This is because your oreDictionary Entry does not have an ingot for " + entry[0] + ".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -326,10 +295,16 @@ public class CCMachineRecipes
|
||||||
for (int i = 0; i < dustNames.size(); i++)
|
for (int i = 0; i < dustNames.size(); i++)
|
||||||
{
|
{
|
||||||
ItemStack ingot = null;
|
ItemStack ingot = null;
|
||||||
if(OreDictionary.doesOreNameExist("ingot" + dustNames.get(i)))
|
if (doesOreNameExist("ingot" + dustNames.get(i)))
|
||||||
ingot = OreDictionary.getOres("ingot" + dustNames.get(i)).get(0);
|
ingot = OreDictionary.getOres("ingot" + dustNames.get(i)).get(0);
|
||||||
if (ingot != null)
|
if (ingot != null)
|
||||||
GameRegistry.addSmelting(new ItemStack(CCItems.dusts, 1, i), ingot, 0.0F);
|
GameRegistry.addSmelting(new ItemStack(CCItems.dusts, 1, i), ingot, 0.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean doesOreNameExist(String oreName)
|
||||||
|
{
|
||||||
|
List<ItemStack> ores = OreDictionary.getOres(oreName);
|
||||||
|
return ores.size() > 0 ? true : false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.oitsjustjose.criss_cross.Recipes;
|
package com.oitsjustjose.criss_cross.Recipes;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
@ -8,13 +7,11 @@ import java.util.Map.Entry;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.oitsjustjose.criss_cross.Items.CCItems;
|
import com.oitsjustjose.criss_cross.Items.CCItems;
|
||||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityCobblegen;
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityCobblegen;
|
||||||
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityStonegen;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
|
||||||
|
|
||||||
public class CobblegenRecipes
|
public class CobblegenRecipes
|
||||||
{
|
{
|
||||||
|
|
@ -25,7 +22,7 @@ public class CobblegenRecipes
|
||||||
{
|
{
|
||||||
this.addRecipe(new ItemStack(Items.lava_bucket), new ItemStack(Blocks.cobblestone));
|
this.addRecipe(new ItemStack(Items.lava_bucket), new ItemStack(Blocks.cobblestone));
|
||||||
TileEntityCobblegen.addFuel(new ItemStack(Items.water_bucket));
|
TileEntityCobblegen.addFuel(new ItemStack(Items.water_bucket));
|
||||||
TileEntityCobblegen.addFuel(new ItemStack(CCItems.magicBucket));
|
TileEntityCobblegen.addFuel(new ItemStack(CCItems.buckets));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CobblegenRecipes getInstance()
|
public static CobblegenRecipes getInstance()
|
||||||
|
|
@ -57,8 +54,7 @@ public class CobblegenRecipes
|
||||||
|
|
||||||
private boolean compareItemStacks(ItemStack stack1, ItemStack stack2)
|
private boolean compareItemStacks(ItemStack stack1, ItemStack stack2)
|
||||||
{
|
{
|
||||||
return stack2.getItem() == stack1.getItem()
|
return stack2.getItem() == stack1.getItem() && (stack2.getItemDamage() == 32767 || stack2.getItemDamage() == stack1.getItemDamage());
|
||||||
&& (stack2.getItemDamage() == 32767 || stack2.getItemDamage() == stack1.getItemDamage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map getRecipeList()
|
public Map getRecipeList()
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,7 @@ public class CropomatorRecipes
|
||||||
|
|
||||||
private boolean compareItemStacks(ItemStack stack1, ItemStack stack2)
|
private boolean compareItemStacks(ItemStack stack1, ItemStack stack2)
|
||||||
{
|
{
|
||||||
return stack2.getItem() == stack1.getItem()
|
return stack2.getItem() == stack1.getItem() && (stack2.getItemDamage() == 32767 || stack2.getItemDamage() == stack1.getItemDamage());
|
||||||
&& (stack2.getItemDamage() == 32767 || stack2.getItemDamage() == stack1.getItemDamage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map getRecipeList()
|
public Map getRecipeList()
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,7 @@ public class ElectroextractorRecipes
|
||||||
|
|
||||||
private boolean compareItemStacks(ItemStack stack1, ItemStack stack2)
|
private boolean compareItemStacks(ItemStack stack1, ItemStack stack2)
|
||||||
{
|
{
|
||||||
return stack2.getItem() == stack1.getItem()
|
return stack2.getItem() == stack1.getItem() && (stack2.getItemDamage() == 32767 || stack2.getItemDamage() == stack1.getItemDamage());
|
||||||
&& (stack2.getItemDamage() == 32767 || stack2.getItemDamage() == stack1.getItemDamage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map getRecipeList()
|
public Map getRecipeList()
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ public class StonegenRecipes
|
||||||
{
|
{
|
||||||
this.addRecipe(new ItemStack(Items.lava_bucket), new ItemStack(Blocks.stone));
|
this.addRecipe(new ItemStack(Items.lava_bucket), new ItemStack(Blocks.stone));
|
||||||
TileEntityStonegen.addFuel(new ItemStack(Items.water_bucket));
|
TileEntityStonegen.addFuel(new ItemStack(Items.water_bucket));
|
||||||
TileEntityStonegen.addFuel(new ItemStack(CCItems.magicBucket));
|
TileEntityStonegen.addFuel(new ItemStack(CCItems.buckets));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static StonegenRecipes getInstance()
|
public static StonegenRecipes getInstance()
|
||||||
|
|
@ -53,8 +53,7 @@ public class StonegenRecipes
|
||||||
|
|
||||||
private boolean compareItemStacks(ItemStack stack1, ItemStack stack2)
|
private boolean compareItemStacks(ItemStack stack1, ItemStack stack2)
|
||||||
{
|
{
|
||||||
return stack2.getItem() == stack1.getItem()
|
return stack2.getItem() == stack1.getItem() && (stack2.getItemDamage() == 32767 || stack2.getItemDamage() == stack1.getItemDamage());
|
||||||
&& (stack2.getItemDamage() == 32767 || stack2.getItemDamage() == stack1.getItemDamage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map getRecipeList()
|
public Map getRecipeList()
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,7 @@ public class WoodchipperRecipes
|
||||||
|
|
||||||
private boolean compareItemStacks(ItemStack stack1, ItemStack stack2)
|
private boolean compareItemStacks(ItemStack stack1, ItemStack stack2)
|
||||||
{
|
{
|
||||||
return stack2.getItem() == stack1.getItem()
|
return stack2.getItem() == stack1.getItem() && (stack2.getItemDamage() == 32767 || stack2.getItemDamage() == stack1.getItemDamage());
|
||||||
&& (stack2.getItemDamage() == 32767 || stack2.getItemDamage() == stack1.getItemDamage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map getRecipeList()
|
public Map getRecipeList()
|
||||||
|
|
|
||||||
|
|
@ -2,203 +2,37 @@ package com.oitsjustjose.criss_cross.TileEntity;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import com.oitsjustjose.criss_cross.Blocks.BlockCobblegen;
|
||||||
|
import com.oitsjustjose.criss_cross.Container.ContainerCobblegen;
|
||||||
|
import com.oitsjustjose.criss_cross.Recipes.CobblegenRecipes;
|
||||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import com.oitsjustjose.criss_cross.Blocks.BlockCobblegen;
|
|
||||||
import com.oitsjustjose.criss_cross.Recipes.CobblegenRecipes;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.nbt.NBTTagList;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
|
|
||||||
public class TileEntityCobblegen extends TileEntity implements ISidedInventory
|
public class TileEntityCobblegen extends TileEntityGeneric
|
||||||
{
|
{
|
||||||
private static int proTicks = ConfigHandler.blockGeneratorProcessTimes;
|
private static int proTicks = ConfigHandler.blockGeneratorProcessTimes;
|
||||||
private static final int[] slotsTop = new int[]
|
private static final int[] slotsTop = new int[] { 0 };
|
||||||
{
|
private static final int[] slotsBottom = new int[] { 2, 1 };
|
||||||
0
|
private static final int[] slotsSides = new int[] { 1 };
|
||||||
};
|
|
||||||
private static final int[] slotsBottom = new int[]
|
|
||||||
{
|
|
||||||
2, 1
|
|
||||||
};
|
|
||||||
private static final int[] slotsSides = new int[]
|
|
||||||
{
|
|
||||||
1
|
|
||||||
};
|
|
||||||
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
||||||
|
private static String customName;
|
||||||
private ItemStack[] ItemStacks = new ItemStack[3];
|
private ItemStack[] ItemStacks = new ItemStack[3];
|
||||||
|
|
||||||
public int fuelTime;
|
public int fuelTime;
|
||||||
public int processTime;
|
public int processTime;
|
||||||
public int fuelUsetime;
|
public int fuelUsetime;
|
||||||
|
|
||||||
public static ArrayList<ItemStack> getFuels()
|
public TileEntityCobblegen()
|
||||||
{
|
{
|
||||||
return fuelItems;
|
super("Cobblegen", proTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSizeInventory()
|
public void update()
|
||||||
{
|
|
||||||
return this.ItemStacks.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getStackInSlot(int slot)
|
|
||||||
{
|
|
||||||
return this.ItemStacks[slot];
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack decrStackSize(int slot, int qtyToDecr)
|
|
||||||
{
|
|
||||||
if(this.ItemStacks[slot] != null)
|
|
||||||
{
|
|
||||||
ItemStack itemstack;
|
|
||||||
|
|
||||||
if(this.ItemStacks[slot].stackSize <= qtyToDecr)
|
|
||||||
{
|
|
||||||
itemstack = this.ItemStacks[slot];
|
|
||||||
this.ItemStacks[slot] = null;
|
|
||||||
return itemstack;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
|
||||||
|
|
||||||
if(this.ItemStacks[slot].stackSize == 0)
|
|
||||||
{
|
|
||||||
this.ItemStacks[slot] = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return itemstack;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getStackInSlotOnClosing(int slot)
|
|
||||||
{
|
|
||||||
if(this.ItemStacks[slot] != null)
|
|
||||||
{
|
|
||||||
ItemStack itemstack = this.ItemStacks[slot];
|
|
||||||
this.ItemStacks[slot] = null;
|
|
||||||
return itemstack;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setInventorySlotContents(int slot, ItemStack itemstack)
|
|
||||||
{
|
|
||||||
this.ItemStacks[slot] = itemstack;
|
|
||||||
|
|
||||||
if(itemstack != null && itemstack.stackSize > this.getInventoryStackLimit())
|
|
||||||
{
|
|
||||||
itemstack.stackSize = this.getInventoryStackLimit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getInventoryName()
|
|
||||||
{
|
|
||||||
return "container.cobblegen";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasCustomInventoryName()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readFromNBT(NBTTagCompound tag)
|
|
||||||
{
|
|
||||||
super.readFromNBT(tag);
|
|
||||||
NBTTagList nbttaglist = tag.getTagList("Items", 10);
|
|
||||||
this.ItemStacks = new ItemStack[this.getSizeInventory()];
|
|
||||||
|
|
||||||
for(int i = 0; i < nbttaglist.tagCount(); ++i)
|
|
||||||
{
|
|
||||||
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
|
|
||||||
byte b0 = nbttagcompound1.getByte("Slot");
|
|
||||||
|
|
||||||
if(b0 >= 0 && b0 < this.ItemStacks.length)
|
|
||||||
{
|
|
||||||
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.fuelTime = tag.getShort("FuelTime");
|
|
||||||
this.processTime = tag.getShort("WorkTime");
|
|
||||||
this.fuelUsetime = getItemBurnTime(this.ItemStacks[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToNBT(NBTTagCompound tag)
|
|
||||||
{
|
|
||||||
super.writeToNBT(tag);
|
|
||||||
tag.setShort("FuelTime", (short) this.fuelTime);
|
|
||||||
tag.setShort("WorkTime", (short) this.processTime);
|
|
||||||
NBTTagList nbttaglist = new NBTTagList();
|
|
||||||
|
|
||||||
for(int i = 0; i < this.ItemStacks.length; ++i)
|
|
||||||
{
|
|
||||||
if(this.ItemStacks[i] != null)
|
|
||||||
{
|
|
||||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
|
||||||
nbttagcompound1.setByte("Slot", (byte) i);
|
|
||||||
this.ItemStacks[i].writeToNBT(nbttagcompound1);
|
|
||||||
nbttaglist.appendTag(nbttagcompound1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tag.setTag("Items", nbttaglist);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getInventoryStackLimit()
|
|
||||||
{
|
|
||||||
return 64;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public int getProgressScaled(int par1)
|
|
||||||
{
|
|
||||||
return this.processTime * par1 / proTicks;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public int getBurnTimeRemainingScaled(int par1)
|
|
||||||
{
|
|
||||||
if(this.fuelUsetime == 0)
|
|
||||||
{
|
|
||||||
this.fuelUsetime = proTicks;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.fuelTime * par1 / this.fuelUsetime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUsingFuel()
|
|
||||||
{
|
|
||||||
return this.fuelTime > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateEntity()
|
|
||||||
{
|
{
|
||||||
boolean flag = this.fuelTime > 0;
|
boolean flag = this.fuelTime > 0;
|
||||||
boolean flag1 = false;
|
boolean flag1 = false;
|
||||||
|
|
@ -250,8 +84,7 @@ public class TileEntityCobblegen extends TileEntity implements ISidedInventory
|
||||||
if (flag != this.fuelTime > 0)
|
if (flag != this.fuelTime > 0)
|
||||||
{
|
{
|
||||||
flag1 = true;
|
flag1 = true;
|
||||||
BlockCobblegen.updateBlockState(this.fuelTime > 0, this.worldObj, this.xCoord, this.yCoord,
|
BlockCobblegen.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||||
this.zCoord);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -280,24 +113,6 @@ public class TileEntityCobblegen extends TileEntity implements ISidedInventory
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addFuel(ItemStack itemstack)
|
|
||||||
{
|
|
||||||
fuelItems.add(itemstack);
|
|
||||||
}
|
|
||||||
|
|
||||||
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 boolean isValid(ItemStack itemstack)
|
public static boolean isValid(ItemStack itemstack)
|
||||||
{
|
{
|
||||||
if (CobblegenRecipes.getInstance().getResult(itemstack) != null)
|
if (CobblegenRecipes.getInstance().getResult(itemstack) != null)
|
||||||
|
|
@ -317,7 +132,8 @@ public class TileEntityCobblegen extends TileEntity implements ISidedInventory
|
||||||
{
|
{
|
||||||
ItemStacks[2] = output.copy();
|
ItemStacks[2] = output.copy();
|
||||||
}
|
}
|
||||||
else if(outputSlot.isItemEqual(output))
|
else
|
||||||
|
if (outputSlot.isItemEqual(output))
|
||||||
{
|
{
|
||||||
outputSlot.stackSize += output.stackSize;
|
outputSlot.stackSize += output.stackSize;
|
||||||
}
|
}
|
||||||
|
|
@ -329,64 +145,10 @@ public class TileEntityCobblegen extends TileEntity implements ISidedInventory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getItemBurnTime(ItemStack itemstack)
|
|
||||||
{
|
|
||||||
return isItemFuel(itemstack) ? proTicks : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isItemFuel(ItemStack itemstack)
|
|
||||||
{
|
|
||||||
for(int i = 0; i < fuelItems.size(); i++)
|
|
||||||
{
|
|
||||||
ItemStack temp = fuelItems.get(i);
|
|
||||||
if(temp.getItem() == itemstack.getItem() && temp.getItemDamage() == itemstack.getItemDamage())
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUseableByPlayer(EntityPlayer player)
|
|
||||||
{
|
|
||||||
|
|
||||||
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false
|
|
||||||
: player.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D,
|
|
||||||
(double) this.zCoord + 0.5D) <= 64.0D;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void openInventory()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void closeInventory()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
|
||||||
{
|
{
|
||||||
return slot == 2 ? false : (slot == 1 ? isItemFuel(itemstack) : true);
|
return new ContainerCobblegen(playerInventory.player, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getAccessibleSlotsFromSide(int slot)
|
|
||||||
{
|
|
||||||
return slot == 0 ? slotsBottom : (slot == 1 ? slotsTop : slotsSides);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInsertItem(int slot, ItemStack itemstack, int side)
|
|
||||||
{
|
|
||||||
return this.isItemValidForSlot(slot, itemstack);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canExtractItem(int slot, ItemStack itemstack, int side)
|
|
||||||
{
|
|
||||||
return side != 0 || slot != 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void markDirty()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,20 +3,25 @@ package com.oitsjustjose.criss_cross.TileEntity;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.Blocks.BlockCropomator;
|
import com.oitsjustjose.criss_cross.Blocks.BlockCropomator;
|
||||||
|
import com.oitsjustjose.criss_cross.Container.ContainerCropomator;
|
||||||
import com.oitsjustjose.criss_cross.Recipes.CropomatorRecipes;
|
import com.oitsjustjose.criss_cross.Recipes.CropomatorRecipes;
|
||||||
import com.oitsjustjose.criss_cross.Recipes.ElectroextractorRecipes;
|
|
||||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntityLockable;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.ITickable;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
public class TileEntityCropomator extends TileEntityLockable implements ITickable, ISidedInventory
|
||||||
{
|
{
|
||||||
private static int proTicks = ConfigHandler.cropomatorProcessTime;
|
private static int proTicks = ConfigHandler.cropomatorProcessTime;
|
||||||
private static int qty = ConfigHandler.cropomatorOutput;
|
private static int qty = ConfigHandler.cropomatorOutput;
|
||||||
|
|
@ -24,6 +29,7 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
private static final int[] slotsBottom = new int[] { 2, 1 };
|
private static final int[] slotsBottom = new int[] { 2, 1 };
|
||||||
private static final int[] slotsSides = new int[] { 1 };
|
private static final int[] slotsSides = new int[] { 1 };
|
||||||
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
||||||
|
private static String customName;
|
||||||
|
|
||||||
private ItemStack[] ItemStacks = new ItemStack[3];
|
private ItemStack[] ItemStacks = new ItemStack[3];
|
||||||
|
|
||||||
|
|
@ -31,6 +37,71 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
public int processTime;
|
public int processTime;
|
||||||
public int catalystInUseTime;
|
public int catalystInUseTime;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update()
|
||||||
|
{
|
||||||
|
boolean flag = this.catalystTime > 0;
|
||||||
|
boolean flag1 = false;
|
||||||
|
|
||||||
|
if (this.catalystTime > 0)
|
||||||
|
{
|
||||||
|
--this.catalystTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.worldObj.isRemote)
|
||||||
|
{
|
||||||
|
if (this.catalystTime != 0 || this.ItemStacks[1] != null && this.ItemStacks[0] != null)
|
||||||
|
{
|
||||||
|
if (this.catalystTime == 0 && this.canProcess())
|
||||||
|
{
|
||||||
|
this.catalystInUseTime = this.catalystTime = getItemBurnTime(this.ItemStacks[1]);
|
||||||
|
|
||||||
|
if (this.catalystTime > 0)
|
||||||
|
{
|
||||||
|
flag1 = true;
|
||||||
|
|
||||||
|
if (this.ItemStacks[1] != null)
|
||||||
|
{
|
||||||
|
--this.ItemStacks[1].stackSize;
|
||||||
|
|
||||||
|
if (this.ItemStacks[1].stackSize == 0)
|
||||||
|
{
|
||||||
|
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isUsingFuel() && this.canProcess())
|
||||||
|
{
|
||||||
|
++this.processTime;
|
||||||
|
|
||||||
|
if (this.processTime == proTicks)
|
||||||
|
{
|
||||||
|
this.processTime = 0;
|
||||||
|
this.processItem();
|
||||||
|
flag1 = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.processTime = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag != this.catalystTime > 0)
|
||||||
|
{
|
||||||
|
flag1 = true;
|
||||||
|
BlockCropomator.updateBlockState(this.catalystTime > 0, this.worldObj, this.pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag1)
|
||||||
|
{
|
||||||
|
this.markDirty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static ArrayList<ItemStack> getFuels()
|
public static ArrayList<ItemStack> getFuels()
|
||||||
{
|
{
|
||||||
return fuelItems;
|
return fuelItems;
|
||||||
|
|
@ -106,15 +177,15 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getInventoryName()
|
public String getGuiID()
|
||||||
{
|
{
|
||||||
return "container.cropomator";
|
return Reference.modid + ":container.cropomator";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCustomInventoryName()
|
public boolean hasCustomName()
|
||||||
{
|
{
|
||||||
return true;
|
return this.customName != null && this.customName.length() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -137,7 +208,10 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
|
|
||||||
this.catalystTime = tag.getShort("BonemealTime");
|
this.catalystTime = tag.getShort("BonemealTime");
|
||||||
this.processTime = tag.getShort("ProcessTime");
|
this.processTime = tag.getShort("ProcessTime");
|
||||||
|
if(this.ItemStacks[1] != null)
|
||||||
this.catalystInUseTime = getItemBurnTime(this.ItemStacks[1]);
|
this.catalystInUseTime = getItemBurnTime(this.ItemStacks[1]);
|
||||||
|
else
|
||||||
|
this.catalystInUseTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -190,71 +264,6 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
return this.catalystTime > 0;
|
return this.catalystTime > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateEntity()
|
|
||||||
{
|
|
||||||
boolean flag = this.catalystTime > 0;
|
|
||||||
boolean flag1 = false;
|
|
||||||
|
|
||||||
if(this.catalystTime > 0)
|
|
||||||
{
|
|
||||||
--this.catalystTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!this.worldObj.isRemote)
|
|
||||||
{
|
|
||||||
if(this.catalystTime != 0 || this.ItemStacks[1] != null && this.ItemStacks[0] != null)
|
|
||||||
{
|
|
||||||
if(this.catalystTime == 0 && this.canProcess())
|
|
||||||
{
|
|
||||||
this.catalystInUseTime = this.catalystTime = getItemBurnTime(this.ItemStacks[1]);
|
|
||||||
|
|
||||||
if(this.catalystTime > 0)
|
|
||||||
{
|
|
||||||
flag1 = true;
|
|
||||||
|
|
||||||
if(this.ItemStacks[1] != null)
|
|
||||||
{
|
|
||||||
--this.ItemStacks[1].stackSize;
|
|
||||||
|
|
||||||
if(this.ItemStacks[1].stackSize == 0)
|
|
||||||
{
|
|
||||||
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.isUsingFuel() && this.canProcess())
|
|
||||||
{
|
|
||||||
++this.processTime;
|
|
||||||
|
|
||||||
if(this.processTime == proTicks)
|
|
||||||
{
|
|
||||||
this.processTime = 0;
|
|
||||||
this.processItem();
|
|
||||||
flag1 = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.processTime = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(flag != this.catalystTime > 0)
|
|
||||||
{
|
|
||||||
flag1 = true;
|
|
||||||
BlockCropomator.updateBlockState(this.catalystTime > 0, this.worldObj, this.xCoord, this.yCoord,
|
|
||||||
this.zCoord);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(flag1)
|
|
||||||
{
|
|
||||||
this.markDirty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean canProcess()
|
private boolean canProcess()
|
||||||
{
|
{
|
||||||
ItemStack input = this.ItemStacks[0];
|
ItemStack input = this.ItemStacks[0];
|
||||||
|
|
@ -311,7 +320,8 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
{
|
{
|
||||||
ItemStacks[2] = output.copy();
|
ItemStacks[2] = output.copy();
|
||||||
}
|
}
|
||||||
else if(outputSlot.isItemEqual(output))
|
else
|
||||||
|
if (outputSlot.isItemEqual(output))
|
||||||
{
|
{
|
||||||
outputSlot.stackSize += output.stackSize;
|
outputSlot.stackSize += output.stackSize;
|
||||||
}
|
}
|
||||||
|
|
@ -342,19 +352,78 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
|
|
||||||
public boolean isUseableByPlayer(EntityPlayer player)
|
public boolean isUseableByPlayer(EntityPlayer player)
|
||||||
{
|
{
|
||||||
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false
|
return this.worldObj.getTileEntity(this.pos) != this ? false
|
||||||
: player.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D,
|
: player.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, (double) this.pos.getZ() + 0.5D) <= 64.0D;
|
||||||
(double) this.zCoord + 0.5D) <= 64.0D;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openInventory()
|
@Override
|
||||||
|
public void openInventory(EntityPlayer player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void closeInventory()
|
@Override
|
||||||
|
public void closeInventory(EntityPlayer player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getField(int id)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return this.catalystTime;
|
||||||
|
case 1:
|
||||||
|
return this.catalystInUseTime;
|
||||||
|
case 2:
|
||||||
|
return this.processTime;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setField(int id, int value)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
this.catalystTime = value;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this.catalystInUseTime = value;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.processTime = value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getFieldCount()
|
||||||
|
{
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clear()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < this.ItemStacks.length; ++i)
|
||||||
|
this.ItemStacks[i] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCommandSenderName()
|
||||||
|
{
|
||||||
|
return this.hasCustomName() ? this.customName : "container.cropomator";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
|
||||||
|
{
|
||||||
|
return new ContainerCropomator(playerInventory.player, this);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
||||||
{
|
{
|
||||||
|
|
@ -362,25 +431,21 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getAccessibleSlotsFromSide(int slot)
|
public int[] getSlotsForFace(EnumFacing side)
|
||||||
{
|
{
|
||||||
return slot == 0 ? slotsBottom : (slot == 1 ? slotsTop : slotsSides);
|
return side == EnumFacing.DOWN ? slotsBottom : (side == EnumFacing.UP ? slotsTop : slotsSides);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canInsertItem(int slot, ItemStack itemstack, int side)
|
public boolean canInsertItem(int slot, ItemStack itemstack, EnumFacing direction)
|
||||||
{
|
{
|
||||||
return this.isItemValidForSlot(slot, itemstack);
|
return this.isItemValidForSlot(slot, itemstack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canExtractItem(int slot, ItemStack itemstack, int side)
|
public boolean canExtractItem(int slot, ItemStack itemstack, EnumFacing direction)
|
||||||
{
|
{
|
||||||
return side != 0 || slot != 1;
|
return direction != EnumFacing.DOWN || slot != 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void markDirty()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -3,45 +3,104 @@ package com.oitsjustjose.criss_cross.TileEntity;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.Blocks.BlockElectroextractor;
|
import com.oitsjustjose.criss_cross.Blocks.BlockElectroextractor;
|
||||||
import com.oitsjustjose.criss_cross.Items.ItemDust;
|
import com.oitsjustjose.criss_cross.Container.ContainerElectroextractor;
|
||||||
import com.oitsjustjose.criss_cross.Recipes.ElectroextractorRecipes;
|
import com.oitsjustjose.criss_cross.Recipes.ElectroextractorRecipes;
|
||||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntityLockable;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.ITickable;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class TileEntityElectroextractor extends TileEntity implements ISidedInventory
|
public class TileEntityElectroextractor extends TileEntityLockable implements ITickable, ISidedInventory
|
||||||
{
|
{
|
||||||
private static int proTicks = ConfigHandler.electroextractorProcessTime;
|
private static int proTicks = ConfigHandler.electroextractorProcessTime;
|
||||||
private static int qty = ConfigHandler.electroextractorOutput;
|
private static int qty = ConfigHandler.electroextractorOutput;
|
||||||
private static final int[] slotsTop = new int[]
|
private static final int[] slotsTop = new int[] { 0 };
|
||||||
{
|
private static final int[] slotsBottom = new int[] { 2, 1 };
|
||||||
0
|
private static final int[] slotsSides = new int[] { 1 };
|
||||||
};
|
|
||||||
private static final int[] slotsBottom = new int[]
|
|
||||||
{
|
|
||||||
2, 1
|
|
||||||
};
|
|
||||||
private static final int[] slotsSides = new int[]
|
|
||||||
{
|
|
||||||
1
|
|
||||||
};
|
|
||||||
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
||||||
|
private static String customName;
|
||||||
private ItemStack[] ItemStacks = new ItemStack[3];
|
private ItemStack[] ItemStacks = new ItemStack[3];
|
||||||
|
|
||||||
public int fuelTime;
|
public int fuelTime;
|
||||||
public int crushTime;
|
public int crushTime;
|
||||||
public int fuelInUseTime;
|
public int fuelInUseTime;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update()
|
||||||
|
{
|
||||||
|
boolean flag = this.fuelTime > 0;
|
||||||
|
boolean flag1 = false;
|
||||||
|
|
||||||
|
if (this.fuelTime > 0)
|
||||||
|
{
|
||||||
|
--this.fuelTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.worldObj.isRemote)
|
||||||
|
{
|
||||||
|
if (this.fuelTime != 0 || this.ItemStacks[1] != null && this.ItemStacks[0] != null)
|
||||||
|
{
|
||||||
|
if (this.fuelTime == 0 && this.canProcess())
|
||||||
|
{
|
||||||
|
this.fuelInUseTime = this.fuelTime = getItemBurnTime(this.ItemStacks[1]);
|
||||||
|
|
||||||
|
if (this.fuelTime > 0)
|
||||||
|
{
|
||||||
|
flag1 = true;
|
||||||
|
|
||||||
|
if (this.ItemStacks[1] != null)
|
||||||
|
{
|
||||||
|
--this.ItemStacks[1].stackSize;
|
||||||
|
|
||||||
|
if (this.ItemStacks[1].stackSize == 0)
|
||||||
|
{
|
||||||
|
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isUsingFuel() && this.canProcess())
|
||||||
|
{
|
||||||
|
++this.crushTime;
|
||||||
|
|
||||||
|
if (this.crushTime == proTicks)
|
||||||
|
{
|
||||||
|
this.crushTime = 0;
|
||||||
|
this.processItem();
|
||||||
|
flag1 = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.crushTime = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag != this.fuelTime > 0)
|
||||||
|
{
|
||||||
|
flag1 = true;
|
||||||
|
BlockElectroextractor.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag1)
|
||||||
|
{
|
||||||
|
this.markDirty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSizeInventory()
|
public int getSizeInventory()
|
||||||
{
|
{
|
||||||
|
|
@ -111,18 +170,6 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getInventoryName()
|
|
||||||
{
|
|
||||||
return "container.electroextractor";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasCustomInventoryName()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound tag)
|
public void readFromNBT(NBTTagCompound tag)
|
||||||
{
|
{
|
||||||
|
|
@ -143,7 +190,10 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
|
|
||||||
this.fuelTime = tag.getShort("Energy");
|
this.fuelTime = tag.getShort("Energy");
|
||||||
this.crushTime = tag.getShort("CrushTime");
|
this.crushTime = tag.getShort("CrushTime");
|
||||||
|
if(this.ItemStacks[1] != null)
|
||||||
this.fuelInUseTime = getItemBurnTime(this.ItemStacks[1]);
|
this.fuelInUseTime = getItemBurnTime(this.ItemStacks[1]);
|
||||||
|
else
|
||||||
|
this.fuelInUseTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -196,71 +246,6 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
return this.fuelTime > 0;
|
return this.fuelTime > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateEntity()
|
|
||||||
{
|
|
||||||
boolean flag = this.fuelTime > 0;
|
|
||||||
boolean flag1 = false;
|
|
||||||
|
|
||||||
if(this.fuelTime > 0)
|
|
||||||
{
|
|
||||||
--this.fuelTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!this.worldObj.isRemote)
|
|
||||||
{
|
|
||||||
if(this.fuelTime != 0 || this.ItemStacks[1] != null && this.ItemStacks[0] != null)
|
|
||||||
{
|
|
||||||
if(this.fuelTime == 0 && this.canProcess())
|
|
||||||
{
|
|
||||||
this.fuelInUseTime = this.fuelTime = getItemBurnTime(this.ItemStacks[1]);
|
|
||||||
|
|
||||||
if(this.fuelTime > 0)
|
|
||||||
{
|
|
||||||
flag1 = true;
|
|
||||||
|
|
||||||
if(this.ItemStacks[1] != null)
|
|
||||||
{
|
|
||||||
--this.ItemStacks[1].stackSize;
|
|
||||||
|
|
||||||
if(this.ItemStacks[1].stackSize == 0)
|
|
||||||
{
|
|
||||||
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.isUsingFuel() && this.canProcess())
|
|
||||||
{
|
|
||||||
++this.crushTime;
|
|
||||||
|
|
||||||
if(this.crushTime == proTicks)
|
|
||||||
{
|
|
||||||
this.crushTime = 0;
|
|
||||||
this.processItem();
|
|
||||||
flag1 = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.crushTime = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(flag != this.fuelTime > 0)
|
|
||||||
{
|
|
||||||
flag1 = true;
|
|
||||||
BlockElectroextractor.updateBlockState(this.fuelTime > 0, this.worldObj, this.xCoord, this.yCoord,
|
|
||||||
this.zCoord);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(flag1)
|
|
||||||
{
|
|
||||||
this.markDirty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean canProcess()
|
private boolean canProcess()
|
||||||
{
|
{
|
||||||
ItemStack input = this.ItemStacks[0];
|
ItemStack input = this.ItemStacks[0];
|
||||||
|
|
@ -317,7 +302,8 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
{
|
{
|
||||||
ItemStacks[2] = output.copy();
|
ItemStacks[2] = output.copy();
|
||||||
}
|
}
|
||||||
else if(outputSlot.isItemEqual(output))
|
else
|
||||||
|
if (outputSlot.isItemEqual(output))
|
||||||
{
|
{
|
||||||
outputSlot.stackSize += output.stackSize;
|
outputSlot.stackSize += output.stackSize;
|
||||||
}
|
}
|
||||||
|
|
@ -337,6 +323,8 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
|
|
||||||
public static boolean isItemEnergetic(ItemStack itemstack)
|
public static boolean isItemEnergetic(ItemStack itemstack)
|
||||||
{
|
{
|
||||||
|
if(fuelItems == null || fuelItems.size() <= 0)
|
||||||
|
return false;
|
||||||
for (int i = 0; i < fuelItems.size(); i++)
|
for (int i = 0; i < fuelItems.size(); i++)
|
||||||
{
|
{
|
||||||
ItemStack temp = fuelItems.get(i);
|
ItemStack temp = fuelItems.get(i);
|
||||||
|
|
@ -348,19 +336,100 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
|
|
||||||
public boolean isUseableByPlayer(EntityPlayer player)
|
public boolean isUseableByPlayer(EntityPlayer player)
|
||||||
{
|
{
|
||||||
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false
|
return this.worldObj.getTileEntity(this.pos) != this ? false
|
||||||
: player.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D,
|
: player.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, (double) this.pos.getZ() + 0.5D) <= 64.0D;
|
||||||
(double) this.zCoord + 0.5D) <= 64.0D;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openInventory()
|
@Override
|
||||||
|
public void markDirty()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void closeInventory()
|
@Override
|
||||||
|
public void openInventory(EntityPlayer player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void closeInventory(EntityPlayer player)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getField(int id)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return this.fuelTime;
|
||||||
|
case 1:
|
||||||
|
return this.fuelInUseTime;
|
||||||
|
case 2:
|
||||||
|
return this.crushTime;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setField(int id, int value)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
this.fuelTime = value;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this.fuelInUseTime = value;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.crushTime = value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getFieldCount()
|
||||||
|
{
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clear()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < this.ItemStacks.length; ++i)
|
||||||
|
this.ItemStacks[i] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCommandSenderName()
|
||||||
|
{
|
||||||
|
return this.hasCustomName() ? this.customName : "container.cobblegen";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
|
||||||
|
{
|
||||||
|
return new ContainerElectroextractor(playerInventory.player, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGuiID()
|
||||||
|
{
|
||||||
|
return Reference.modid + ":container.electroextractor";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCustomName()
|
||||||
|
{
|
||||||
|
return this.customName != null && this.customName.length() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomInventoryName(String newName)
|
||||||
|
{
|
||||||
|
this.customName = newName;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
||||||
{
|
{
|
||||||
|
|
@ -368,25 +437,20 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getAccessibleSlotsFromSide(int slot)
|
public int[] getSlotsForFace(EnumFacing side)
|
||||||
{
|
{
|
||||||
return slot == 0 ? slotsBottom : (slot == 1 ? slotsTop : slotsSides);
|
return side == EnumFacing.DOWN ? slotsBottom : (side == EnumFacing.UP ? slotsTop : slotsSides);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canInsertItem(int slot, ItemStack itemstack, int side)
|
public boolean canInsertItem(int slot, ItemStack itemstack, EnumFacing direction)
|
||||||
{
|
{
|
||||||
return this.isItemValidForSlot(slot, itemstack);
|
return this.isItemValidForSlot(slot, itemstack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canExtractItem(int slot, ItemStack itemstack, int side)
|
public boolean canExtractItem(int slot, ItemStack itemstack, EnumFacing direction)
|
||||||
{
|
|
||||||
return side != 0 || slot != 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void markDirty()
|
|
||||||
{
|
{
|
||||||
|
return direction != EnumFacing.DOWN || slot != 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,343 @@
|
||||||
|
package com.oitsjustjose.criss_cross.TileEntity;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.nbt.NBTTagList;
|
||||||
|
import net.minecraft.tileentity.TileEntityLockable;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.ITickable;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public abstract class TileEntityGeneric extends TileEntityLockable implements ITickable, ISidedInventory
|
||||||
|
{
|
||||||
|
private static int proTicks = 0;
|
||||||
|
private static final int[] slotsTop = new int[] { 0 };
|
||||||
|
private static final int[] slotsBottom = new int[] { 2, 1 };
|
||||||
|
private static final int[] slotsSides = new int[] { 1 };
|
||||||
|
private static String defaultName;
|
||||||
|
private static String customName;
|
||||||
|
private ItemStack[] ItemStacks = new ItemStack[3];
|
||||||
|
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
||||||
|
|
||||||
|
public int fuelTime;
|
||||||
|
public int processTime;
|
||||||
|
public int fuelUsetime;
|
||||||
|
|
||||||
|
public TileEntityGeneric(String tileName, int processTicks)
|
||||||
|
{
|
||||||
|
this.defaultName = tileName;
|
||||||
|
this.proTicks = processTicks;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Any Tile Entity extending this TE must implement its own update(),
|
||||||
|
* canProcess(), isValid(), processItem(), and createContainer()
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ArrayList<ItemStack> getFuels()
|
||||||
|
{
|
||||||
|
return fuelItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getSizeInventory()
|
||||||
|
{
|
||||||
|
return this.ItemStacks.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getStackInSlot(int slot)
|
||||||
|
{
|
||||||
|
return this.ItemStacks[slot];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack decrStackSize(int slot, int qtyToDecr)
|
||||||
|
{
|
||||||
|
if (this.ItemStacks[slot] != null)
|
||||||
|
{
|
||||||
|
ItemStack itemstack;
|
||||||
|
|
||||||
|
if (this.ItemStacks[slot].stackSize <= qtyToDecr)
|
||||||
|
{
|
||||||
|
itemstack = this.ItemStacks[slot];
|
||||||
|
this.ItemStacks[slot] = null;
|
||||||
|
return itemstack;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
||||||
|
|
||||||
|
if (this.ItemStacks[slot].stackSize == 0)
|
||||||
|
{
|
||||||
|
this.ItemStacks[slot] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return itemstack;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getStackInSlotOnClosing(int slot)
|
||||||
|
{
|
||||||
|
if (this.ItemStacks[slot] != null)
|
||||||
|
{
|
||||||
|
ItemStack itemstack = this.ItemStacks[slot];
|
||||||
|
this.ItemStacks[slot] = null;
|
||||||
|
return itemstack;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setInventorySlotContents(int slot, ItemStack itemstack)
|
||||||
|
{
|
||||||
|
this.ItemStacks[slot] = itemstack;
|
||||||
|
|
||||||
|
if (itemstack != null && itemstack.stackSize > this.getInventoryStackLimit())
|
||||||
|
{
|
||||||
|
itemstack.stackSize = this.getInventoryStackLimit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGuiID()
|
||||||
|
{
|
||||||
|
return Reference.modid + ":container." + this.defaultName.toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCustomName()
|
||||||
|
{
|
||||||
|
return this.customName != null && this.customName.length() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomInventoryName(String newName)
|
||||||
|
{
|
||||||
|
this.customName = newName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readFromNBT(NBTTagCompound tag)
|
||||||
|
{
|
||||||
|
super.readFromNBT(tag);
|
||||||
|
NBTTagList nbttaglist = tag.getTagList("Items", 10);
|
||||||
|
this.ItemStacks = new ItemStack[this.getSizeInventory()];
|
||||||
|
|
||||||
|
for (int i = 0; i < nbttaglist.tagCount(); ++i)
|
||||||
|
{
|
||||||
|
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
|
||||||
|
byte b0 = nbttagcompound1.getByte("Slot");
|
||||||
|
|
||||||
|
if (b0 >= 0 && b0 < this.ItemStacks.length)
|
||||||
|
{
|
||||||
|
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.fuelTime = tag.getShort("FuelTime");
|
||||||
|
this.processTime = tag.getShort("WorkTime");
|
||||||
|
if (this.ItemStacks[1] != null)
|
||||||
|
this.fuelUsetime = getItemBurnTime(this.ItemStacks[1]);
|
||||||
|
else
|
||||||
|
this.fuelUsetime = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToNBT(NBTTagCompound tag)
|
||||||
|
{
|
||||||
|
super.writeToNBT(tag);
|
||||||
|
tag.setShort("FuelTime", (short) this.fuelTime);
|
||||||
|
tag.setShort("WorkTime", (short) this.processTime);
|
||||||
|
NBTTagList nbttaglist = new NBTTagList();
|
||||||
|
|
||||||
|
for (int i = 0; i < this.ItemStacks.length; ++i)
|
||||||
|
{
|
||||||
|
if (this.ItemStacks[i] != null)
|
||||||
|
{
|
||||||
|
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||||
|
nbttagcompound1.setByte("Slot", (byte) i);
|
||||||
|
this.ItemStacks[i].writeToNBT(nbttagcompound1);
|
||||||
|
nbttaglist.appendTag(nbttagcompound1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tag.setTag("Items", nbttaglist);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getInventoryStackLimit()
|
||||||
|
{
|
||||||
|
return 64;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getProgressScaled(int par1)
|
||||||
|
{
|
||||||
|
return this.processTime * par1 / proTicks;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getBurnTimeRemainingScaled(int par1)
|
||||||
|
{
|
||||||
|
if (this.fuelUsetime == 0)
|
||||||
|
{
|
||||||
|
this.fuelUsetime = proTicks;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.fuelTime * par1 / this.fuelUsetime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUsingFuel()
|
||||||
|
{
|
||||||
|
return this.fuelTime > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addFuel(ItemStack itemstack)
|
||||||
|
{
|
||||||
|
fuelItems.add(itemstack);
|
||||||
|
}
|
||||||
|
|
||||||
|
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 int getItemBurnTime(ItemStack itemstack)
|
||||||
|
{
|
||||||
|
return isItemFuel(itemstack) ? proTicks : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isItemFuel(ItemStack itemstack)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < fuelItems.size(); i++)
|
||||||
|
{
|
||||||
|
ItemStack temp = fuelItems.get(i);
|
||||||
|
if (temp.getItem() == itemstack.getItem() && temp.getItemDamage() == itemstack.getItemDamage())
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
||||||
|
{
|
||||||
|
return slot == 2 ? false : (slot == 1 ? isItemFuel(itemstack) : true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] getSlotsForFace(EnumFacing side)
|
||||||
|
{
|
||||||
|
return side == EnumFacing.DOWN ? slotsBottom : (side == EnumFacing.UP ? slotsTop : slotsSides);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInsertItem(int slot, ItemStack itemstack, EnumFacing direction)
|
||||||
|
{
|
||||||
|
return this.isItemValidForSlot(slot, itemstack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canExtractItem(int slot, ItemStack itemstack, EnumFacing direction)
|
||||||
|
{
|
||||||
|
return direction != EnumFacing.DOWN || slot != 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void markDirty()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void openInventory(EntityPlayer player)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void closeInventory(EntityPlayer player)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getField(int id)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return this.fuelTime;
|
||||||
|
case 1:
|
||||||
|
return this.fuelUsetime;
|
||||||
|
case 2:
|
||||||
|
return this.processTime;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setField(int id, int value)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
this.fuelTime = value;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this.fuelUsetime = value;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.processTime = value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getFieldCount()
|
||||||
|
{
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clear()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < this.ItemStacks.length; ++i)
|
||||||
|
this.ItemStacks[i] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCommandSenderName()
|
||||||
|
{
|
||||||
|
return this.hasCustomName() ? this.customName : "container." + this.defaultName.toLowerCase();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,41 +3,103 @@ package com.oitsjustjose.criss_cross.TileEntity;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.Blocks.BlockStonegen;
|
import com.oitsjustjose.criss_cross.Blocks.BlockStonegen;
|
||||||
|
import com.oitsjustjose.criss_cross.Container.ContainerStonegen;
|
||||||
import com.oitsjustjose.criss_cross.Recipes.StonegenRecipes;
|
import com.oitsjustjose.criss_cross.Recipes.StonegenRecipes;
|
||||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntityLockable;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.ITickable;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class TileEntityStonegen extends TileEntity implements ISidedInventory
|
public class TileEntityStonegen extends TileEntityLockable implements ITickable, ISidedInventory
|
||||||
{
|
{
|
||||||
private static int proTicks = ConfigHandler.blockGeneratorProcessTimes;
|
private static int proTicks = ConfigHandler.blockGeneratorProcessTimes;
|
||||||
private static final int[] slotsTop = new int[]
|
private static final int[] slotsTop = new int[] { 0 };
|
||||||
{
|
private static final int[] slotsBottom = new int[] { 2, 1 };
|
||||||
0
|
private static final int[] slotsSides = new int[] { 1 };
|
||||||
};
|
|
||||||
private static final int[] slotsBottom = new int[]
|
|
||||||
{
|
|
||||||
2, 1
|
|
||||||
};
|
|
||||||
private static final int[] slotsSides = new int[]
|
|
||||||
{
|
|
||||||
1
|
|
||||||
};
|
|
||||||
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
||||||
|
private static String customName;
|
||||||
private ItemStack[] ItemStacks = new ItemStack[3];
|
private ItemStack[] ItemStacks = new ItemStack[3];
|
||||||
|
|
||||||
public int fuelTime;
|
public int fuelTime;
|
||||||
public int processTime;
|
public int processTime;
|
||||||
public int fuelUsetime;
|
public int fuelUsetime;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update()
|
||||||
|
{
|
||||||
|
boolean flag = this.fuelTime > 0;
|
||||||
|
boolean flag1 = false;
|
||||||
|
|
||||||
|
if (this.fuelTime > 0)
|
||||||
|
{
|
||||||
|
--this.fuelTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.worldObj.isRemote)
|
||||||
|
{
|
||||||
|
if (this.fuelTime != 0 || this.ItemStacks[1] != null && this.ItemStacks[0] != null)
|
||||||
|
{
|
||||||
|
if (this.fuelTime == 0 && this.canProcess())
|
||||||
|
{
|
||||||
|
this.fuelUsetime = this.fuelTime = getItemBurnTime(this.ItemStacks[1]);
|
||||||
|
|
||||||
|
if (this.fuelTime > 0)
|
||||||
|
{
|
||||||
|
flag1 = true;
|
||||||
|
|
||||||
|
if (this.ItemStacks[1] != null)
|
||||||
|
{
|
||||||
|
--this.ItemStacks[1].stackSize;
|
||||||
|
|
||||||
|
if (this.ItemStacks[1].stackSize == 0)
|
||||||
|
{
|
||||||
|
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isUsingFuel() && this.canProcess())
|
||||||
|
{
|
||||||
|
++this.processTime;
|
||||||
|
|
||||||
|
if (this.processTime == proTicks)
|
||||||
|
{
|
||||||
|
this.processTime = 0;
|
||||||
|
this.processItem();
|
||||||
|
flag1 = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.processTime = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag != this.fuelTime > 0)
|
||||||
|
{
|
||||||
|
flag1 = true;
|
||||||
|
BlockStonegen.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag1)
|
||||||
|
{
|
||||||
|
this.markDirty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static ArrayList<ItemStack> getFuels()
|
public static ArrayList<ItemStack> getFuels()
|
||||||
{
|
{
|
||||||
return fuelItems;
|
return fuelItems;
|
||||||
|
|
@ -113,15 +175,20 @@ public class TileEntityStonegen extends TileEntity implements ISidedInventory
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getInventoryName()
|
public String getGuiID()
|
||||||
{
|
{
|
||||||
return "container.stonegen";
|
return Reference.modid + ":container.stonegen";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCustomInventoryName()
|
public boolean hasCustomName()
|
||||||
{
|
{
|
||||||
return true;
|
return this.customName != null && this.customName.length() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomInventoryName(String newName)
|
||||||
|
{
|
||||||
|
this.customName = newName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -144,7 +211,10 @@ public class TileEntityStonegen extends TileEntity implements ISidedInventory
|
||||||
|
|
||||||
this.fuelTime = tag.getShort("FuelTime");
|
this.fuelTime = tag.getShort("FuelTime");
|
||||||
this.processTime = tag.getShort("WorkTime");
|
this.processTime = tag.getShort("WorkTime");
|
||||||
|
if(this.ItemStacks[1] != null)
|
||||||
this.fuelUsetime = getItemBurnTime(this.ItemStacks[1]);
|
this.fuelUsetime = getItemBurnTime(this.ItemStacks[1]);
|
||||||
|
else
|
||||||
|
this.fuelUsetime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -197,71 +267,6 @@ public class TileEntityStonegen extends TileEntity implements ISidedInventory
|
||||||
return this.fuelTime > 0;
|
return this.fuelTime > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateEntity()
|
|
||||||
{
|
|
||||||
boolean flag = this.fuelTime > 0;
|
|
||||||
boolean flag1 = false;
|
|
||||||
|
|
||||||
if(this.fuelTime > 0)
|
|
||||||
{
|
|
||||||
--this.fuelTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!this.worldObj.isRemote)
|
|
||||||
{
|
|
||||||
if(this.fuelTime != 0 || this.ItemStacks[1] != null && this.ItemStacks[0] != null)
|
|
||||||
{
|
|
||||||
if(this.fuelTime == 0 && this.canProcess())
|
|
||||||
{
|
|
||||||
this.fuelUsetime = this.fuelTime = getItemBurnTime(this.ItemStacks[1]);
|
|
||||||
|
|
||||||
if(this.fuelTime > 0)
|
|
||||||
{
|
|
||||||
flag1 = true;
|
|
||||||
|
|
||||||
if(this.ItemStacks[1] != null)
|
|
||||||
{
|
|
||||||
--this.ItemStacks[1].stackSize;
|
|
||||||
|
|
||||||
if(this.ItemStacks[1].stackSize == 0)
|
|
||||||
{
|
|
||||||
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.isUsingFuel() && this.canProcess())
|
|
||||||
{
|
|
||||||
++this.processTime;
|
|
||||||
|
|
||||||
if(this.processTime == proTicks)
|
|
||||||
{
|
|
||||||
this.processTime = 0;
|
|
||||||
this.processItem();
|
|
||||||
flag1 = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.processTime = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(flag != this.fuelTime > 0)
|
|
||||||
{
|
|
||||||
flag1 = true;
|
|
||||||
BlockStonegen.updateBlockState(this.fuelTime > 0, this.worldObj, this.xCoord, this.yCoord,
|
|
||||||
this.zCoord);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(flag1)
|
|
||||||
{
|
|
||||||
this.markDirty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean canProcess()
|
private boolean canProcess()
|
||||||
{
|
{
|
||||||
ItemStack input = this.ItemStacks[0];
|
ItemStack input = this.ItemStacks[0];
|
||||||
|
|
@ -318,7 +323,8 @@ public class TileEntityStonegen extends TileEntity implements ISidedInventory
|
||||||
{
|
{
|
||||||
ItemStacks[2] = output.copy();
|
ItemStacks[2] = output.copy();
|
||||||
}
|
}
|
||||||
else if(outputSlot.isItemEqual(output))
|
else
|
||||||
|
if (outputSlot.isItemEqual(output))
|
||||||
{
|
{
|
||||||
outputSlot.stackSize += output.stackSize;
|
outputSlot.stackSize += output.stackSize;
|
||||||
}
|
}
|
||||||
|
|
@ -348,20 +354,83 @@ public class TileEntityStonegen extends TileEntity implements ISidedInventory
|
||||||
|
|
||||||
public boolean isUseableByPlayer(EntityPlayer player)
|
public boolean isUseableByPlayer(EntityPlayer player)
|
||||||
{
|
{
|
||||||
|
return this.worldObj.getTileEntity(this.pos) != this ? false
|
||||||
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false
|
: player.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, (double) this.pos.getZ() + 0.5D) <= 64.0D;
|
||||||
: player.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D,
|
|
||||||
(double) this.zCoord + 0.5D) <= 64.0D;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openInventory()
|
@Override
|
||||||
|
public void markDirty()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void closeInventory()
|
@Override
|
||||||
|
public void openInventory(EntityPlayer player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void closeInventory(EntityPlayer player)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getField(int id)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return this.fuelTime;
|
||||||
|
case 1:
|
||||||
|
return this.fuelUsetime;
|
||||||
|
case 2:
|
||||||
|
return this.processTime;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setField(int id, int value)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
this.fuelTime = value;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this.fuelUsetime = value;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.processTime = value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getFieldCount()
|
||||||
|
{
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clear()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < this.ItemStacks.length; ++i)
|
||||||
|
this.ItemStacks[i] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCommandSenderName()
|
||||||
|
{
|
||||||
|
return this.hasCustomName() ? this.customName : "container.cobblegen";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
|
||||||
|
{
|
||||||
|
return new ContainerStonegen(playerInventory.player, this);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
||||||
{
|
{
|
||||||
|
|
@ -369,25 +438,20 @@ public class TileEntityStonegen extends TileEntity implements ISidedInventory
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getAccessibleSlotsFromSide(int slot)
|
public int[] getSlotsForFace(EnumFacing side)
|
||||||
{
|
{
|
||||||
return slot == 0 ? slotsBottom : (slot == 1 ? slotsTop : slotsSides);
|
return side == EnumFacing.DOWN ? slotsBottom : (side == EnumFacing.UP ? slotsTop : slotsSides);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canInsertItem(int slot, ItemStack itemstack, int side)
|
public boolean canInsertItem(int slot, ItemStack itemstack, EnumFacing direction)
|
||||||
{
|
{
|
||||||
return this.isItemValidForSlot(slot, itemstack);
|
return this.isItemValidForSlot(slot, itemstack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canExtractItem(int slot, ItemStack itemstack, int side)
|
public boolean canExtractItem(int slot, ItemStack itemstack, EnumFacing direction)
|
||||||
{
|
|
||||||
return side != 0 || slot != 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void markDirty()
|
|
||||||
{
|
{
|
||||||
|
return direction != EnumFacing.DOWN || slot != 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,42 +3,104 @@ package com.oitsjustjose.criss_cross.TileEntity;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.Blocks.BlockWoodchipper;
|
import com.oitsjustjose.criss_cross.Blocks.BlockWoodchipper;
|
||||||
|
import com.oitsjustjose.criss_cross.Container.ContainerWoodchipper;
|
||||||
import com.oitsjustjose.criss_cross.Recipes.WoodchipperRecipes;
|
import com.oitsjustjose.criss_cross.Recipes.WoodchipperRecipes;
|
||||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntityLockable;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.ITickable;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
public class TileEntityWoodchipper extends TileEntityLockable implements ITickable, ISidedInventory
|
||||||
{
|
{
|
||||||
private static int proTicks = ConfigHandler.woodchipperProcessTime;
|
private static int proTicks = ConfigHandler.woodchipperProcessTime;
|
||||||
private static int qty = ConfigHandler.woodchipperOutput;
|
private static int qty = ConfigHandler.woodchipperOutput;
|
||||||
private static final int[] slotsTop = new int[]
|
private static final int[] slotsTop = new int[] { 0 };
|
||||||
{
|
private static final int[] slotsBottom = new int[] { 2, 1 };
|
||||||
0
|
private static final int[] slotsSides = new int[] { 1 };
|
||||||
};
|
|
||||||
private static final int[] slotsBottom = new int[]
|
|
||||||
{
|
|
||||||
2, 1
|
|
||||||
};
|
|
||||||
private static final int[] slotsSides = new int[]
|
|
||||||
{
|
|
||||||
1
|
|
||||||
};
|
|
||||||
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
||||||
|
private static String customName;
|
||||||
private ItemStack[] ItemStacks = new ItemStack[3];
|
private ItemStack[] ItemStacks = new ItemStack[3];
|
||||||
|
|
||||||
public int fuelTime;
|
public int fuelTime;
|
||||||
public int processTime;
|
public int processTime;
|
||||||
public int fuelUsetime;
|
public int fuelUsetime;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update()
|
||||||
|
{
|
||||||
|
boolean flag = this.fuelTime > 0;
|
||||||
|
boolean flag1 = false;
|
||||||
|
|
||||||
|
if (this.fuelTime > 0)
|
||||||
|
{
|
||||||
|
--this.fuelTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.worldObj.isRemote)
|
||||||
|
{
|
||||||
|
if (this.fuelTime != 0 || this.ItemStacks[1] != null && this.ItemStacks[0] != null)
|
||||||
|
{
|
||||||
|
if (this.fuelTime == 0 && this.canProcess())
|
||||||
|
{
|
||||||
|
this.fuelUsetime = this.fuelTime = getItemBurnTime(this.ItemStacks[1]);
|
||||||
|
|
||||||
|
if (this.fuelTime > 0)
|
||||||
|
{
|
||||||
|
flag1 = true;
|
||||||
|
|
||||||
|
if (this.ItemStacks[1] != null)
|
||||||
|
{
|
||||||
|
--this.ItemStacks[1].stackSize;
|
||||||
|
|
||||||
|
if (this.ItemStacks[1].stackSize == 0)
|
||||||
|
{
|
||||||
|
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isUsingFuel() && this.canProcess())
|
||||||
|
{
|
||||||
|
++this.processTime;
|
||||||
|
|
||||||
|
if (this.processTime == proTicks)
|
||||||
|
{
|
||||||
|
this.processTime = 0;
|
||||||
|
this.processItem();
|
||||||
|
flag1 = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.processTime = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag != this.fuelTime > 0)
|
||||||
|
{
|
||||||
|
flag1 = true;
|
||||||
|
BlockWoodchipper.updateBlockState(this.fuelTime > 0, this.worldObj, this.pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag1)
|
||||||
|
{
|
||||||
|
this.markDirty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static ArrayList<ItemStack> getFuels()
|
public static ArrayList<ItemStack> getFuels()
|
||||||
{
|
{
|
||||||
return fuelItems;
|
return fuelItems;
|
||||||
|
|
@ -114,15 +176,15 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getInventoryName()
|
public String getGuiID()
|
||||||
{
|
{
|
||||||
return "container.woodchipper";
|
return Reference.modid + ":container.woodchipper";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCustomInventoryName()
|
public boolean hasCustomName()
|
||||||
{
|
{
|
||||||
return true;
|
return this.customName != null && this.customName.length() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -145,7 +207,10 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
|
|
||||||
this.fuelTime = tag.getShort("FuelTime");
|
this.fuelTime = tag.getShort("FuelTime");
|
||||||
this.processTime = tag.getShort("WorkTime");
|
this.processTime = tag.getShort("WorkTime");
|
||||||
|
if(this.ItemStacks[1] != null)
|
||||||
this.fuelUsetime = getItemBurnTime(this.ItemStacks[1]);
|
this.fuelUsetime = getItemBurnTime(this.ItemStacks[1]);
|
||||||
|
else
|
||||||
|
this.fuelUsetime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -198,71 +263,6 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
return this.fuelTime > 0;
|
return this.fuelTime > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateEntity()
|
|
||||||
{
|
|
||||||
boolean flag = this.fuelTime > 0;
|
|
||||||
boolean flag1 = false;
|
|
||||||
|
|
||||||
if(this.fuelTime > 0)
|
|
||||||
{
|
|
||||||
--this.fuelTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!this.worldObj.isRemote)
|
|
||||||
{
|
|
||||||
if(this.fuelTime != 0 || this.ItemStacks[1] != null && this.ItemStacks[0] != null)
|
|
||||||
{
|
|
||||||
if(this.fuelTime == 0 && this.canProcess())
|
|
||||||
{
|
|
||||||
this.fuelUsetime = this.fuelTime = getItemBurnTime(this.ItemStacks[1]);
|
|
||||||
|
|
||||||
if(this.fuelTime > 0)
|
|
||||||
{
|
|
||||||
flag1 = true;
|
|
||||||
|
|
||||||
if(this.ItemStacks[1] != null)
|
|
||||||
{
|
|
||||||
--this.ItemStacks[1].stackSize;
|
|
||||||
|
|
||||||
if(this.ItemStacks[1].stackSize == 0)
|
|
||||||
{
|
|
||||||
this.ItemStacks[1] = ItemStacks[1].getItem().getContainerItem(ItemStacks[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.isUsingFuel() && this.canProcess())
|
|
||||||
{
|
|
||||||
++this.processTime;
|
|
||||||
|
|
||||||
if(this.processTime == proTicks)
|
|
||||||
{
|
|
||||||
this.processTime = 0;
|
|
||||||
this.processItem();
|
|
||||||
flag1 = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.processTime = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(flag != this.fuelTime > 0)
|
|
||||||
{
|
|
||||||
flag1 = true;
|
|
||||||
BlockWoodchipper.updateBlockState(this.fuelTime > 0, this.worldObj, this.xCoord, this.yCoord,
|
|
||||||
this.zCoord);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(flag1)
|
|
||||||
{
|
|
||||||
this.markDirty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean canProcess()
|
private boolean canProcess()
|
||||||
{
|
{
|
||||||
ItemStack input = this.ItemStacks[0];
|
ItemStack input = this.ItemStacks[0];
|
||||||
|
|
@ -319,7 +319,8 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
{
|
{
|
||||||
ItemStacks[2] = output.copy();
|
ItemStacks[2] = output.copy();
|
||||||
}
|
}
|
||||||
else if(outputSlot.isItemEqual(output))
|
else
|
||||||
|
if (outputSlot.isItemEqual(output))
|
||||||
{
|
{
|
||||||
outputSlot.stackSize += output.stackSize;
|
outputSlot.stackSize += output.stackSize;
|
||||||
}
|
}
|
||||||
|
|
@ -350,20 +351,83 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
|
|
||||||
public boolean isUseableByPlayer(EntityPlayer player)
|
public boolean isUseableByPlayer(EntityPlayer player)
|
||||||
{
|
{
|
||||||
|
return this.worldObj.getTileEntity(this.pos) != this ? false
|
||||||
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false
|
: player.getDistanceSq((double) this.pos.getX() + 0.5D, (double) this.pos.getY() + 0.5D, (double) this.pos.getZ() + 0.5D) <= 64.0D;
|
||||||
: player.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D,
|
|
||||||
(double) this.zCoord + 0.5D) <= 64.0D;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openInventory()
|
@Override
|
||||||
|
public void markDirty()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void closeInventory()
|
@Override
|
||||||
|
public void openInventory(EntityPlayer player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void closeInventory(EntityPlayer player)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getField(int id)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return this.fuelTime;
|
||||||
|
case 1:
|
||||||
|
return this.fuelUsetime;
|
||||||
|
case 2:
|
||||||
|
return this.processTime;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setField(int id, int value)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
this.fuelTime = value;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this.fuelUsetime = value;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.processTime = value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getFieldCount()
|
||||||
|
{
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clear()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < this.ItemStacks.length; ++i)
|
||||||
|
this.ItemStacks[i] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCommandSenderName()
|
||||||
|
{
|
||||||
|
return this.hasCustomName() ? this.customName : "container.woodchipper";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
|
||||||
|
{
|
||||||
|
return new ContainerWoodchipper(playerInventory.player, this);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
||||||
{
|
{
|
||||||
|
|
@ -371,25 +435,20 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getAccessibleSlotsFromSide(int slot)
|
public int[] getSlotsForFace(EnumFacing side)
|
||||||
{
|
{
|
||||||
return slot == 0 ? slotsBottom : (slot == 1 ? slotsTop : slotsSides);
|
return side == EnumFacing.DOWN ? slotsBottom : (side == EnumFacing.UP ? slotsTop : slotsSides);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canInsertItem(int slot, ItemStack itemstack, int side)
|
public boolean canInsertItem(int slot, ItemStack itemstack, EnumFacing direction)
|
||||||
{
|
{
|
||||||
return this.isItemValidForSlot(slot, itemstack);
|
return this.isItemValidForSlot(slot, itemstack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canExtractItem(int slot, ItemStack itemstack, int side)
|
public boolean canExtractItem(int slot, ItemStack itemstack, EnumFacing direction)
|
||||||
{
|
|
||||||
return side != 0 || slot != 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void markDirty()
|
|
||||||
{
|
{
|
||||||
|
return direction != EnumFacing.DOWN || slot != 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,78 @@
|
||||||
package com.oitsjustjose.criss_cross.Util;
|
package com.oitsjustjose.criss_cross.Util;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.oitsjustjose.criss_cross.CrissCross;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
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.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ClientProxy extends CommonProxy
|
public class ClientProxy extends CommonProxy
|
||||||
{
|
{
|
||||||
@Override
|
@SideOnly(Side.CLIENT)
|
||||||
public void preInit()
|
public static void init()
|
||||||
{
|
{
|
||||||
|
ArrayList<Block> blocks = Reference.getModBlocks();
|
||||||
|
ArrayList<Item> items = Reference.getModItems();
|
||||||
|
|
||||||
|
for(Block b : blocks)
|
||||||
|
register(b, "");
|
||||||
|
for(Item i : items)
|
||||||
|
register(i, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init()
|
//WARNING: The following code is BULLSHIT and should be handled by FORGE. But it isn't. So sorry if you can't understand much. Just remember kids:
|
||||||
|
//EVERYTHING HAS TO BE IN LOWER CASE. NOTHING YOU LEARNED IN SCHOOL ABOUT CAPITALIZATION MATTERS ANYMORE.
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private static void register(Item item, String customName)
|
||||||
{
|
{
|
||||||
|
int meta = 0;
|
||||||
|
if(item.getHasSubtypes())
|
||||||
|
{
|
||||||
|
List<ItemStack> subItems = new ArrayList<ItemStack>();
|
||||||
|
item.getSubItems(item, CrissCross.CCTab, subItems);
|
||||||
|
for(ItemStack sub : subItems)
|
||||||
|
{
|
||||||
|
String name = item.getUnlocalizedName(sub).substring(16).toLowerCase();
|
||||||
|
ModelBakery.addVariantName(item, Reference.modid.toLowerCase() + ":" + name);
|
||||||
|
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(Reference.modid.toLowerCase() + ":" + name, "inventory"));
|
||||||
|
meta++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(customName == "")
|
||||||
|
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(Reference.modid.toLowerCase() + ":" + item.getUnlocalizedName().substring(16).toLowerCase(), "inventory"));
|
||||||
|
else
|
||||||
|
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(Reference.modid.toLowerCase() + ":" + customName, "inventory"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private static void register(Block block, String customName)
|
||||||
|
{
|
||||||
|
int meta = 0;
|
||||||
|
Item itemBlock = Item.getItemFromBlock(block);
|
||||||
|
if(itemBlock.getHasSubtypes())
|
||||||
|
{
|
||||||
|
List<ItemStack> subItems = new ArrayList<ItemStack>();
|
||||||
|
itemBlock.getSubItems(itemBlock, CrissCross.CCTab, subItems);
|
||||||
|
for(ItemStack sub : subItems)
|
||||||
|
{
|
||||||
|
String name = itemBlock.getUnlocalizedName(sub).substring(16).toLowerCase();
|
||||||
|
ModelBakery.addVariantName(itemBlock, Reference.modid.toLowerCase() + ":" + name);
|
||||||
|
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, meta, new ModelResourceLocation(Reference.modid.toLowerCase() + ":" + name, "inventory"));
|
||||||
|
meta++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(customName == "")
|
||||||
|
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, meta, new ModelResourceLocation(Reference.modid.toLowerCase() + ":" + block.getUnlocalizedName().substring(16).toLowerCase(), "inventory"));
|
||||||
|
else
|
||||||
|
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlock, meta, new ModelResourceLocation(Reference.modid.toLowerCase() + ":" + customName, "inventory"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package com.oitsjustjose.criss_cross.Util;
|
package com.oitsjustjose.criss_cross.Util;
|
||||||
|
|
||||||
public class CommonProxy
|
public abstract class CommonProxy
|
||||||
{
|
{
|
||||||
public void preInit()
|
public static void preInit()
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
public void init()
|
public static void init()
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
package com.oitsjustjose.criss_cross.Util;
|
package com.oitsjustjose.criss_cross.Util;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
import net.minecraft.item.ItemStack;
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
import net.minecraftforge.common.config.Configuration;
|
import net.minecraftforge.common.config.Configuration;
|
||||||
|
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public class ConfigHandler
|
public class ConfigHandler
|
||||||
{
|
{
|
||||||
|
|
@ -15,42 +16,27 @@ public class ConfigHandler
|
||||||
public static String cropomatorRecipeItem;
|
public static String cropomatorRecipeItem;
|
||||||
public static String[] cropomatorInputs;
|
public static String[] cropomatorInputs;
|
||||||
public static String[] cropomatorCatalysts;
|
public static String[] cropomatorCatalysts;
|
||||||
public static String[] defaultCropomatorInputs = new String[]
|
public static String[] defaultCropomatorInputs = new String[] { "minecraft:apple", "minecraft:reeds", "minecraft:nether_wart", "minecraft:carrot",
|
||||||
{
|
"minecraft:cactus", "minecraft:potato", "minecraft:sapling:0", "minecraft:sapling:1", "minecraft:sapling:2", "minecraft:sapling:3",
|
||||||
"minecraft:apple", "minecraft:reeds", "minecraft:nether_wart", "minecraft:carrot", "minecraft:cactus",
|
"minecraft:sapling:4", "minecraft:sapling:5", "minecraft:melon", "minecraft:brown_mushroom", "minecraft:red_mushroom", "minecraft:dye:3",
|
||||||
"minecraft:potato", "minecraft:sapling:0", "minecraft:sapling:1", "minecraft:sapling:2",
|
"minecraft:pumpkin", "minecraft:wheat", "minecraft:wheat_seeds" };
|
||||||
"minecraft:sapling:3", "minecraft:sapling:4", "minecraft:sapling:5", "minecraft:melon",
|
public static String[] defaultCropomatorCatalystItems = new String[] { "minecraft:dye:15" };
|
||||||
"minecraft:brown_mushroom", "minecraft:red_mushroom", "minecraft:dye:3", "minecraft:pumpkin",
|
|
||||||
"minecraft:wheat", "minecraft:wheat_seeds"
|
|
||||||
};
|
|
||||||
public static String[] defaultCropomatorCatalystItems = new String[]
|
|
||||||
{
|
|
||||||
"minecraft:dye:15"
|
|
||||||
};
|
|
||||||
|
|
||||||
public static int electroextractorProcessTime;
|
public static int electroextractorProcessTime;
|
||||||
public static int electroextractorOutput;
|
public static int electroextractorOutput;
|
||||||
public static String electroextractorRecipeItem;
|
public static String electroextractorRecipeItem;
|
||||||
public static String[] electroextractorEnergySources;
|
public static String[] electroextractorEnergySources;
|
||||||
public static String[] electroextractorOreDictInputs;
|
public static String[] electroextractorOreDictInputs;
|
||||||
public static String[] defaultElectroextractorOreDictInputs = new String[]
|
public static String[] defaultElectroextractorOreDictInputs = new String[] { "Iron:12428902", "Gold:15400704", "Aluminum:15987699",
|
||||||
{
|
"Cobalt:17663", "Ardite:13938485", "Copper:16751872", "Tin:15132390", "Silver:13297640", "Lead:5722979", "Platinum:11067903",
|
||||||
"Iron:12428902", "Gold:15400704", "Aluminum:15987699", "Cobalt:17663", "Ardite:13938485", "Copper:16751872",
|
"Mithril:4433113", "Nickel:16580553" };
|
||||||
"Tin:15132390", "Silver:13297640", "Lead:5722979", "Platinum:11067903", "Mithril:4433113", "Nickel:16580553"
|
public static String[] defaultElectroextractorEnergySources = new String[] { "minecraft:redstone_block" };
|
||||||
};
|
|
||||||
public static String[] defaultElectroextractorEnergySources = new String[]
|
|
||||||
{
|
|
||||||
"minecraft:redstone_block"
|
|
||||||
};
|
|
||||||
|
|
||||||
public static int woodchipperProcessTime;
|
public static int woodchipperProcessTime;
|
||||||
public static int woodchipperOutput;
|
public static int woodchipperOutput;
|
||||||
public static String woodchipperRecipeItem;
|
public static String woodchipperRecipeItem;
|
||||||
public static String[] woodchipperFuels;
|
public static String[] woodchipperFuels;
|
||||||
public static String[] defaultWoodchipperFuels = new String[]
|
public static String[] defaultWoodchipperFuels = new String[] { "minecraft:water_bucket", "minecraft:potion:0", "CrissCross:magicBucket:0" };
|
||||||
{
|
|
||||||
"minecraft:water_bucket", "minecraft:potion:0", "CrissCross:magicBucket:0"
|
|
||||||
};
|
|
||||||
|
|
||||||
public static int blockGeneratorProcessTimes;
|
public static int blockGeneratorProcessTimes;
|
||||||
|
|
||||||
|
|
@ -67,71 +53,56 @@ public class ConfigHandler
|
||||||
private static void loadConfiguration()
|
private static void loadConfiguration()
|
||||||
{
|
{
|
||||||
// Cropomator Configs
|
// Cropomator Configs
|
||||||
cropomatorInputs = config
|
cropomatorInputs = config.get(config.CATEGORY_GENERAL, "Cropomator's Recipe Items.", defaultCropomatorInputs,
|
||||||
.get(config.CATEGORY_GENERAL, "Cropomator's Recipe Items.", defaultCropomatorInputs,
|
|
||||||
"A list of items to be added to the Cropomator's recipe list. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.")
|
"A list of items to be added to the Cropomator's recipe list. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.")
|
||||||
.getStringList();
|
.getStringList();
|
||||||
|
|
||||||
cropomatorCatalysts = config
|
cropomatorCatalysts = config.get(config.CATEGORY_GENERAL, "Cropomator's Catalyst Items.", defaultCropomatorCatalystItems,
|
||||||
.get(config.CATEGORY_GENERAL, "Cropomator's Catalyst Items.", defaultCropomatorCatalystItems,
|
|
||||||
"A list of items to be added to the Cropomator's catalyst list. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.")
|
"A list of items to be added to the Cropomator's catalyst list. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.")
|
||||||
.getStringList();
|
.getStringList();
|
||||||
|
|
||||||
cropomatorProcessTime = config.getInt("Cropomator Processing Time", config.CATEGORY_GENERAL, 150, 1,
|
cropomatorProcessTime = config.getInt("Cropomator Processing Time", config.CATEGORY_GENERAL, 150, 1, Short.MAX_VALUE,
|
||||||
Short.MAX_VALUE,
|
|
||||||
"Control how many ticks it takes the Cropomator to process an item. Default is 150; furnaces are 200.");
|
"Control how many ticks it takes the Cropomator to process an item. Default is 150; furnaces are 200.");
|
||||||
|
|
||||||
cropomatorOutput = config.getInt("Cropomator Output Quantity", config.CATEGORY_GENERAL, 3, 0, 64,
|
cropomatorOutput = config.getInt("Cropomator Output Quantity", config.CATEGORY_GENERAL, 3, 0, 64,
|
||||||
"Control how many of the input item you get as the output item. Default is 3.");
|
"Control how many of the input item you get as the output item. Default is 3.");
|
||||||
|
|
||||||
cropomatorRecipeItem = config.getString("Cropomator Crafting Item.", config.CATEGORY_GENERAL,
|
cropomatorRecipeItem = config.getString("Cropomator Crafting Item.", config.CATEGORY_GENERAL, "minecraft:diamond_block",
|
||||||
"minecraft:diamond_block",
|
|
||||||
"This is the item located in the center of the crafting recipe for the Cropomator. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
"This is the item located in the center of the crafting recipe for the Cropomator. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
||||||
|
|
||||||
// Electroextractor's Configs
|
// Electroextractor's Configs
|
||||||
electroextractorEnergySources = config
|
electroextractorEnergySources = config.get(config.CATEGORY_GENERAL, "Electroextractor's Fuel Items.", defaultElectroextractorEnergySources,
|
||||||
.get(config.CATEGORY_GENERAL, "Electroextractor's Fuel Items.", defaultElectroextractorEnergySources,
|
|
||||||
"A list of items to be added as the Electroextractor's energy sources. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.")
|
"A list of items to be added as the Electroextractor's energy sources. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.")
|
||||||
.getStringList();
|
.getStringList();
|
||||||
|
|
||||||
electroextractorProcessTime = config.getInt("Electroextractor Processing Time", config.CATEGORY_GENERAL, 250, 0,
|
electroextractorProcessTime = config.getInt("Electroextractor Processing Time", config.CATEGORY_GENERAL, 250, 0, Short.MAX_VALUE,
|
||||||
Short.MAX_VALUE,
|
|
||||||
"Control how many ticks it takes the Electroextractor to process an item. Default is 250; furnaces are 200.");
|
"Control how many ticks it takes the Electroextractor to process an item. Default is 250; furnaces are 200.");
|
||||||
|
|
||||||
electroextractorOutput = config.getInt("Electroextractor Output Quantity", config.CATEGORY_GENERAL, 2, 0, 64,
|
electroextractorOutput = config.getInt("Electroextractor Output Quantity", config.CATEGORY_GENERAL, 2, 0, 64,
|
||||||
"Control how many dusts you get as the output. Default is 2.");
|
"Control how many dusts you get as the output. Default is 2.");
|
||||||
|
|
||||||
electroextractorRecipeItem = config.getString("Electroextractor Crafting Item.", config.CATEGORY_GENERAL,
|
electroextractorRecipeItem = config.getString("Electroextractor Crafting Item.", config.CATEGORY_GENERAL, "minecraft:diamond_block",
|
||||||
"minecraft:diamond_block",
|
|
||||||
"This is the item located in the center of the crafting recipe for the Electroextractor. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
"This is the item located in the center of the crafting recipe for the Electroextractor. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
||||||
|
|
||||||
electroextractorOreDictInputs = config
|
electroextractorOreDictInputs = config.get(config.CATEGORY_GENERAL, "Electroextractor OreDictionary Entries.",
|
||||||
.get(config.CATEGORY_GENERAL, "Electroextractor OreDictionary Entries.",
|
defaultElectroextractorOreDictInputs, "Formatted as <OreDictName>:<DecimalColorYouWant>." + "\n"
|
||||||
defaultElectroextractorOreDictInputs,
|
+ " Remove the 'ore' part of the oredict name (i.e. 'oreIron' should be entered as 'Iron')" + "\n"
|
||||||
"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.")
|
+ "Use http://www.colorpicker.com/ to find a color and http://bit.ly/1RhPhcX to convert it from Hex to Decimal.")
|
||||||
.getStringList();
|
.getStringList();
|
||||||
|
|
||||||
// Woodchipper's Configs
|
// Woodchipper's Configs
|
||||||
woodchipperFuels = config
|
woodchipperFuels = config.get(config.CATEGORY_GENERAL, "Woodchipper Fuel Items", defaultWoodchipperFuels,
|
||||||
.get(config.CATEGORY_GENERAL, "Woodchipper Fuel Items", defaultWoodchipperFuels,
|
"A list of items to be added as the Woodchipper's 'fuels'. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.").getStringList();
|
||||||
"A list of items to be added as the Woodchipper's 'fuels'. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.")
|
|
||||||
.getStringList();
|
|
||||||
|
|
||||||
woodchipperProcessTime = config.getInt("Woodchipper Process Time", config.CATEGORY_GENERAL, 400, 0,
|
woodchipperProcessTime = config.getInt("Woodchipper Process Time", config.CATEGORY_GENERAL, 400, 0, Short.MAX_VALUE,
|
||||||
Short.MAX_VALUE,
|
|
||||||
"Control how many ticks it takes the Woodchipper to process an item. Default is 400; furnaces are 200.");
|
"Control how many ticks it takes the Woodchipper to process an item. Default is 400; furnaces are 200.");
|
||||||
|
|
||||||
woodchipperOutput = config.getInt("Woodchipper Output Quantity", config.CATEGORY_GENERAL, 6, 0, 64,
|
woodchipperOutput = config.getInt("Woodchipper Output Quantity", config.CATEGORY_GENERAL, 6, 0, 64,
|
||||||
"Control how many planks are yielded from processing a log. Default is 6.");
|
"Control how many planks are yielded from processing a log. Default is 6.");
|
||||||
|
|
||||||
woodchipperRecipeItem = config.getString("Woodchipper Crafting Item", config.CATEGORY_GENERAL,
|
woodchipperRecipeItem = config.getString("Woodchipper Crafting Item", config.CATEGORY_GENERAL, "minecraft:diamond_block",
|
||||||
"minecraft:diamond_block",
|
|
||||||
"This is the item located in the center of the crafting recipe for the Woodchipper. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
"This is the item located in the center of the crafting recipe for the Woodchipper. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
||||||
|
|
||||||
|
|
||||||
// Autosmith's Configs
|
// Autosmith's Configs
|
||||||
blockGeneratorProcessTimes = config.getInt("Stone Generators' Process Times", config.CATEGORY_GENERAL, 20, 0, Short.MAX_VALUE,
|
blockGeneratorProcessTimes = config.getInt("Stone Generators' Process Times", config.CATEGORY_GENERAL, 20, 0, Short.MAX_VALUE,
|
||||||
"Control how many ticks it takes a stone generator to process an item. Default is 20; furnaces are 200.");
|
"Control how many ticks it takes a stone generator to process an item. Default is 20; furnaces are 200.");
|
||||||
|
|
@ -146,4 +117,15 @@ public class ConfigHandler
|
||||||
if (event.modID.equalsIgnoreCase(Reference.modid))
|
if (event.modID.equalsIgnoreCase(Reference.modid))
|
||||||
loadConfiguration();
|
loadConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// put this here because most references to finditemstack are due to this confighandler
|
||||||
|
public static ItemStack findItemStack(String modid, String name)
|
||||||
|
{
|
||||||
|
if (GameRegistry.findItem(modid, name) != null)
|
||||||
|
return new ItemStack(GameRegistry.findItem(modid, name));
|
||||||
|
else
|
||||||
|
if (GameRegistry.findBlock(modid, name) != null)
|
||||||
|
return new ItemStack(GameRegistry.findBlock(modid, name));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,7 @@ import net.minecraft.world.World;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author TeamCoFH All credit goes to TeamCoFH, this was required for proper
|
* @author TeamCoFH All credit goes to TeamCoFH, this was required for proper woodchipper recipes :)
|
||||||
* woodchipper recipes :)
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -96,12 +95,13 @@ public class ItemHelper
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else if(dmgItems[1] != null && dmgItems[0].getItem() == dmgItems[1].getItem() && dmgItems[0].stackSize == 1
|
else
|
||||||
&& dmgItems[1].stackSize == 1 && dmgItems[0].getItem().isRepairable())
|
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();
|
Item theItem = dmgItems[0].getItem();
|
||||||
int var13 = theItem.getMaxDamage() - dmgItems[0].getItemDamageForDisplay();
|
int var13 = theItem.getMaxDamage() - dmgItems[0].getItemDamage();
|
||||||
int var8 = theItem.getMaxDamage() - dmgItems[1].getItemDamageForDisplay();
|
int var8 = theItem.getMaxDamage() - dmgItems[1].getItemDamage();
|
||||||
int var9 = var13 + var8 + theItem.getMaxDamage() * 5 / 100;
|
int var9 = var13 + var8 + theItem.getMaxDamage() * 5 / 100;
|
||||||
int var10 = Math.max(0, theItem.getMaxDamage() - var9);
|
int var10 = Math.max(0, theItem.getMaxDamage() - var9);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,36 @@
|
||||||
package com.oitsjustjose.criss_cross.Util;
|
package com.oitsjustjose.criss_cross.Util;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
public class Reference
|
public class Reference
|
||||||
{
|
{
|
||||||
public static final String modid = "CrissCross";
|
public static final String modid = "CrissCross";
|
||||||
public static final String version = "1.3";
|
public static final String version = "1.3";
|
||||||
public static final String guifactory = "com.oitsjustjose.criss_cross.GUI.GUIFactory";
|
public static final String guifactory = "com.oitsjustjose.criss_cross.GUI.GUIFactory";
|
||||||
|
|
||||||
|
private static final ArrayList<Item> allItems = new ArrayList<Item>();
|
||||||
|
private static final ArrayList<Block> allBlocks = new ArrayList<Block>();
|
||||||
|
|
||||||
|
public static ArrayList<Item> getModItems()
|
||||||
|
{
|
||||||
|
return allItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ArrayList<Block> getModBlocks()
|
||||||
|
{
|
||||||
|
return allBlocks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void add(Item item)
|
||||||
|
{
|
||||||
|
allItems.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void add(Block block)
|
||||||
|
{
|
||||||
|
allBlocks.add(block);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"facing=north": { "model": "crisscross:cobblestonegenerator" },
|
||||||
|
"facing=south": { "model": "crisscross:cobblestonegenerator", "y": 180 },
|
||||||
|
"facing=west": { "model": "crisscross:cobblestonegenerator", "y": 270 },
|
||||||
|
"facing=east": { "model": "crisscross:cobblestonegenerator", "y": 90 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"facing=north": { "model": "crisscross:cropomator" },
|
||||||
|
"facing=south": { "model": "crisscross:cropomator", "y": 180 },
|
||||||
|
"facing=west": { "model": "crisscross:cropomator", "y": 270 },
|
||||||
|
"facing=east": { "model": "crisscross:cropomator", "y": 90 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"facing=north": { "model": "crisscross:electroextractor" },
|
||||||
|
"facing=south": { "model": "crisscross:electroextractor", "y": 180 },
|
||||||
|
"facing=west": { "model": "crisscross:electroextractor", "y": 270 },
|
||||||
|
"facing=east": { "model": "crisscross:electroextractor", "y": 90 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"facing=north": { "model": "crisscross:stonegenerator" },
|
||||||
|
"facing=south": { "model": "crisscross:stonegenerator", "y": 180 },
|
||||||
|
"facing=west": { "model": "crisscross:stonegenerator", "y": 270 },
|
||||||
|
"facing=east": { "model": "crisscross:stonegenerator", "y": 90 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"facing=north": { "model": "crisscross:woodchipper" },
|
||||||
|
"facing=south": { "model": "crisscross:woodchipper", "y": 180 },
|
||||||
|
"facing=west": { "model": "crisscross:woodchipper", "y": 270 },
|
||||||
|
"facing=east": { "model": "crisscross:woodchipper", "y": 90 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"parent": "block/orientable",
|
||||||
|
"textures": {
|
||||||
|
"top": "crisscross:blocks/cobblestone_generator/cobblestone_generator_top",
|
||||||
|
"front": "crisscross:blocks/cobblestone_generator/cobblestone_generator_front",
|
||||||
|
"side": "crisscross:blocks/cobblestone_generator/cobblestone_generator_sides",
|
||||||
|
"bottom": "crisscross:blocks/cobblestone_generator/cobblestone_generator_bottom"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"parent": "block/orientable",
|
||||||
|
"textures": {
|
||||||
|
"top": "crisscross:blocks/cropomator/cropomator_top",
|
||||||
|
"front": "crisscross:blocks/cropomator/cropomator_front",
|
||||||
|
"side": "crisscross:blocks/cropomator/cropomator_sides",
|
||||||
|
"bottom": "crisscross:blocks/cropomator/cropomator_bottom"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"parent": "block/orientable",
|
||||||
|
"textures": {
|
||||||
|
"top": "crisscross:blocks/electroextractor/electroextractor_top",
|
||||||
|
"front": "crisscross:blocks/electroextractor/electroextractor_front",
|
||||||
|
"side": "crisscross:blocks/electroextractor/electroextractor_sides",
|
||||||
|
"bottom": "crisscross:blocks/electroextractor/electroextractor_bottom"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"parent": "block/orientable",
|
||||||
|
"textures": {
|
||||||
|
"top": "crisscross:blocks/stone_generator/stone_generator_top",
|
||||||
|
"front": "crisscross:blocks/stone_generator/stone_generator_front",
|
||||||
|
"side": "crisscross:blocks/stone_generator/stone_generator_sides",
|
||||||
|
"bottom": "crisscross:blocks/stone_generator/stone_generator_bottom"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"parent": "block/orientable",
|
||||||
|
"textures": {
|
||||||
|
"top": "crisscross:blocks/wood_chipper/wood_chipper_top",
|
||||||
|
"front": "crisscross:blocks/wood_chipper/wood_chipper_front",
|
||||||
|
"side": "crisscross:blocks/wood_chipper/wood_chipper_sides",
|
||||||
|
"bottom": "crisscross:blocks/wood_chipper/wood_chipper_bottom"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"parent": "crisscross:block/cobblestonegenerator",
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ 10, -45, 170 ],
|
||||||
|
"translation": [ 0, 1.5, -2.75 ],
|
||||||
|
"scale": [ 0.375, 0.375, 0.375 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"parent": "crisscross:block/cropomator",
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ 10, -45, 170 ],
|
||||||
|
"translation": [ 0, 1.5, -2.75 ],
|
||||||
|
"scale": [ 0.375, 0.375, 0.375 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
src/main/resources/assets/crisscross/models/item/dust.json
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "crisscross:items/dust_base",
|
||||||
|
"layer1": "crisscross:items/dust_overlay"
|
||||||
|
},
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ 0, 90, -35 ],
|
||||||
|
"translation": [ 0, 1.25, -3.5 ],
|
||||||
|
"scale": [ 0.85, 0.85, 0.85 ]
|
||||||
|
},
|
||||||
|
"firstperson": {
|
||||||
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
"translation": [ 0, 4, 2 ],
|
||||||
|
"scale": [ 1.7, 1.7, 1.7 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"parent": "crisscross:block/electroextractor",
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ 10, -45, 170 ],
|
||||||
|
"translation": [ 0, 1.5, -2.75 ],
|
||||||
|
"scale": [ 0.375, 0.375, 0.375 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "crisscross:items/everfulBucket"
|
||||||
|
},
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ 0, 90, -35 ],
|
||||||
|
"translation": [ 0, 1.25, -3.5 ],
|
||||||
|
"scale": [ 0.85, 0.85, 0.85 ]
|
||||||
|
},
|
||||||
|
"firstperson": {
|
||||||
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
"translation": [ 0, 4, 2 ],
|
||||||
|
"scale": [ 1.7, 1.7, 1.7 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"parent": "crisscross:block/stonegenerator",
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ 10, -45, 170 ],
|
||||||
|
"translation": [ 0, 1.5, -2.75 ],
|
||||||
|
"scale": [ 0.375, 0.375, 0.375 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "crisscross:items/voidBucket"
|
||||||
|
},
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ 0, 90, -35 ],
|
||||||
|
"translation": [ 0, 1.25, -3.5 ],
|
||||||
|
"scale": [ 0.85, 0.85, 0.85 ]
|
||||||
|
},
|
||||||
|
"firstperson": {
|
||||||
|
"rotation": [ 0, -135, 25 ],
|
||||||
|
"translation": [ 0, 4, 2 ],
|
||||||
|
"scale": [ 1.7, 1.7, 1.7 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"parent": "crisscross:block/woodchipper",
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ 10, -45, 170 ],
|
||||||
|
"translation": [ 0, 1.5, -2.75 ],
|
||||||
|
"scale": [ 0.375, 0.375, 0.375 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 403 B |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 944 B After Width: | Height: | Size: 944 B |
|
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 403 B |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 944 B After Width: | Height: | Size: 944 B |
|
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 403 B |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 738 B After Width: | Height: | Size: 738 B |
|
|
@ -4,7 +4,7 @@
|
||||||
"name": "CrissCross",
|
"name": "CrissCross",
|
||||||
"description": "A Criss-Cross of Vanilla-Styled Machinery!",
|
"description": "A Criss-Cross of Vanilla-Styled Machinery!",
|
||||||
"version": "1.3",
|
"version": "1.3",
|
||||||
"mcversion": "1.7.10",
|
"mcversion": "1.8.8",
|
||||||
"url": "",
|
"url": "",
|
||||||
"updateUrl": "",
|
"updateUrl": "",
|
||||||
"authorList": ["oitsjustjose"],
|
"authorList": ["oitsjustjose"],
|
||||||
|
|
|
||||||