Trying to work out an NEI handler...
This commit is contained in:
parent
6850f0bfc9
commit
c50eaf8263
35 changed files with 2905 additions and 2266 deletions
|
|
@ -23,6 +23,7 @@ import net.minecraft.world.World;
|
||||||
public class BlockCropomator extends BlockMachineBase
|
public class BlockCropomator extends BlockMachineBase
|
||||||
{
|
{
|
||||||
private static String unlocName = "Cropomator";
|
private static String unlocName = "Cropomator";
|
||||||
|
|
||||||
public BlockCropomator()
|
public BlockCropomator()
|
||||||
{
|
{
|
||||||
super(unlocName);
|
super(unlocName);
|
||||||
|
|
@ -68,11 +69,14 @@ public class BlockCropomator extends BlockMachineBase
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack.stackSize -= j;
|
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()));
|
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())
|
if (itemstack.hasTagCompound())
|
||||||
{
|
{
|
||||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
entityitem.getEntityItem()
|
||||||
|
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||||
}
|
}
|
||||||
|
|
||||||
float f3 = 0.05F;
|
float f3 = 0.05F;
|
||||||
|
|
@ -98,13 +102,13 @@ public class BlockCropomator extends BlockMachineBase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||||
|
float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
if (world.isRemote)
|
if (world.isRemote)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
TileEntityCropomator tilecropomator = (TileEntityCropomator) world.getTileEntity(x, y, z);
|
TileEntityCropomator tilecropomator = (TileEntityCropomator) world.getTileEntity(x, y, z);
|
||||||
if (tilecropomator != null)
|
if (tilecropomator != null)
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import net.minecraft.world.World;
|
||||||
public class BlockElectroextractor extends BlockMachineBase
|
public class BlockElectroextractor extends BlockMachineBase
|
||||||
{
|
{
|
||||||
private static String unlocName = "ElectroExtractor";
|
private static String unlocName = "ElectroExtractor";
|
||||||
|
|
||||||
public BlockElectroextractor()
|
public BlockElectroextractor()
|
||||||
{
|
{
|
||||||
super(unlocName);
|
super(unlocName);
|
||||||
|
|
@ -74,11 +75,14 @@ public class BlockElectroextractor extends BlockMachineBase
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack.stackSize -= j;
|
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()));
|
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())
|
if (itemstack.hasTagCompound())
|
||||||
{
|
{
|
||||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
entityitem.getEntityItem()
|
||||||
|
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||||
}
|
}
|
||||||
|
|
||||||
float f3 = 0.05F;
|
float f3 = 0.05F;
|
||||||
|
|
@ -98,13 +102,13 @@ public class BlockElectroextractor extends BlockMachineBase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||||
|
float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
if (world.isRemote)
|
if (world.isRemote)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
TileEntityElectroextractor tileext = (TileEntityElectroextractor) world.getTileEntity(x, y, z);
|
TileEntityElectroextractor tileext = (TileEntityElectroextractor) world.getTileEntity(x, y, z);
|
||||||
if (tileext != null)
|
if (tileext != null)
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import net.minecraft.world.World;
|
||||||
public class BlockWoodchipper extends BlockMachineBase
|
public class BlockWoodchipper extends BlockMachineBase
|
||||||
{
|
{
|
||||||
private static String unlocName = "WoodChipper";
|
private static String unlocName = "WoodChipper";
|
||||||
|
|
||||||
public BlockWoodchipper()
|
public BlockWoodchipper()
|
||||||
{
|
{
|
||||||
super(unlocName);
|
super(unlocName);
|
||||||
|
|
@ -73,11 +74,14 @@ public class BlockWoodchipper extends BlockMachineBase
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack.stackSize -= j;
|
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()));
|
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())
|
if (itemstack.hasTagCompound())
|
||||||
{
|
{
|
||||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
entityitem.getEntityItem()
|
||||||
|
.setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||||
}
|
}
|
||||||
|
|
||||||
float f3 = 0.05F;
|
float f3 = 0.05F;
|
||||||
|
|
@ -97,13 +101,13 @@ public class BlockWoodchipper extends BlockMachineBase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||||
|
float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
if (world.isRemote)
|
if (world.isRemote)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
TileEntityWoodchipper tileext = (TileEntityWoodchipper) world.getTileEntity(x, y, z);
|
TileEntityWoodchipper tileext = (TileEntityWoodchipper) world.getTileEntity(x, y, z);
|
||||||
if (tileext != null)
|
if (tileext != null)
|
||||||
|
|
|
||||||
|
|
@ -104,8 +104,7 @@ 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.isValidForCropomator(itemstack1))
|
if (TileEntityCropomator.isValidForCropomator(itemstack1))
|
||||||
{
|
{
|
||||||
|
|
@ -113,27 +112,23 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
@ -141,8 +136,7 @@ public class ContainerCropomator extends Container
|
||||||
if (itemstack1.stackSize == 0)
|
if (itemstack1.stackSize == 0)
|
||||||
{
|
{
|
||||||
slot.putStack((ItemStack) null);
|
slot.putStack((ItemStack) null);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
slot.onSlotChanged();
|
slot.onSlotChanged();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,8 +102,7 @@ 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.isValidForElectroextractor(itemstack1))
|
if (TileEntityElectroextractor.isValidForElectroextractor(itemstack1))
|
||||||
{
|
{
|
||||||
|
|
@ -111,27 +110,23 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
@ -139,8 +134,7 @@ public class ContainerElectroextractor extends Container
|
||||||
if (itemstack1.stackSize == 0)
|
if (itemstack1.stackSize == 0)
|
||||||
{
|
{
|
||||||
slot.putStack((ItemStack) null);
|
slot.putStack((ItemStack) null);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
slot.onSlotChanged();
|
slot.onSlotChanged();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,11 +40,14 @@ public class ContainerWoodchipper extends Container
|
||||||
{
|
{
|
||||||
switch (timeType1)
|
switch (timeType1)
|
||||||
{
|
{
|
||||||
case 0:this.woodchipper.processTime = timeType2;
|
case 0:
|
||||||
|
this.woodchipper.processTime = timeType2;
|
||||||
break;
|
break;
|
||||||
case 1:this.woodchipper.fuelTime = timeType2;
|
case 1:
|
||||||
|
this.woodchipper.fuelTime = timeType2;
|
||||||
break;
|
break;
|
||||||
case 2:this.woodchipper.fuelUsetime = timeType2;
|
case 2:
|
||||||
|
this.woodchipper.fuelUsetime = timeType2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -97,8 +100,7 @@ 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))
|
||||||
{
|
{
|
||||||
|
|
@ -106,27 +108,23 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
@ -134,8 +132,7 @@ public class ContainerWoodchipper extends Container
|
||||||
if (itemstack1.stackSize == 0)
|
if (itemstack1.stackSize == 0)
|
||||||
{
|
{
|
||||||
slot.putStack((ItemStack) null);
|
slot.putStack((ItemStack) null);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
slot.onSlotChanged();
|
slot.onSlotChanged();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ 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.Recipes.CRecipes;
|
import com.oitsjustjose.criss_cross.Recipes.CCRecipes;
|
||||||
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;
|
||||||
|
|
@ -43,7 +43,7 @@ public class CrissCross
|
||||||
{
|
{
|
||||||
CCBlocks.init();
|
CCBlocks.init();
|
||||||
CCItems.init();
|
CCItems.init();
|
||||||
CRecipes.init();
|
CCRecipes.init();
|
||||||
OreDictionaryAdder.init();
|
OreDictionaryAdder.init();
|
||||||
proxy.init();
|
proxy.init();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,8 @@ 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, 4210752);
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92,
|
||||||
|
4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@ import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
public class GUIElectroextractor extends GuiContainer
|
public class GUIElectroextractor extends GuiContainer
|
||||||
{
|
{
|
||||||
public static final ResourceLocation texture = new ResourceLocation("crisscross", "textures/gui/electroextractor.png");
|
public static final ResourceLocation texture = new ResourceLocation("crisscross",
|
||||||
|
"textures/gui/electroextractor.png");
|
||||||
|
|
||||||
private TileEntityElectroextractor electroextractor;
|
private TileEntityElectroextractor electroextractor;
|
||||||
|
|
||||||
|
|
@ -25,7 +26,8 @@ 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, 4210752);
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92,
|
||||||
|
4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ 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, 4210752);
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, this.ySize - 92,
|
||||||
|
4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,6 @@ public class ModGUIConfig extends GuiConfig
|
||||||
{
|
{
|
||||||
super(guiScreen,
|
super(guiScreen,
|
||||||
new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
|
new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
|
||||||
Reference.modid,
|
Reference.modid, false, true, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
|
||||||
false,
|
|
||||||
true,
|
|
||||||
GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,6 +5,7 @@ import net.minecraft.item.Item;
|
||||||
public class CCItems
|
public class CCItems
|
||||||
{
|
{
|
||||||
public static Item dusts;
|
public static Item dusts;
|
||||||
|
|
||||||
public static void init()
|
public static void init()
|
||||||
{
|
{
|
||||||
dusts = new ItemDust();
|
dusts = new ItemDust();
|
||||||
|
|
|
||||||
|
|
@ -88,8 +88,7 @@ public class ItemDust extends Item
|
||||||
if (stack.getItemDamage() >= colors.size())
|
if (stack.getItemDamage() >= colors.size())
|
||||||
return 0;
|
return 0;
|
||||||
return colors.get(stack.getItemDamage());
|
return colors.get(stack.getItemDamage());
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
return 16777215;
|
return 16777215;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.oitsjustjose.criss_cross.NEI;
|
||||||
|
|
||||||
|
import com.oitsjustjose.criss_cross.Util.Reference;
|
||||||
|
|
||||||
|
import codechicken.nei.api.API;
|
||||||
|
import codechicken.nei.api.IConfigureNEI;
|
||||||
|
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||||
|
|
||||||
|
public class CCNEIIntegration implements IConfigureNEI
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void loadConfig()
|
||||||
|
{
|
||||||
|
registerHandler(new RecipeHandlerWoodchipper());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return Reference.modid + " built-in NEI plugin.";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getVersion()
|
||||||
|
{
|
||||||
|
return Reference.version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registerHandler(RecipeHandlerBase handler)
|
||||||
|
{
|
||||||
|
API.registerRecipeHandler(handler);
|
||||||
|
API.registerUsageHandler(handler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,358 @@
|
||||||
|
package com.oitsjustjose.criss_cross.NEI;
|
||||||
|
|
||||||
|
import java.awt.Point;
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import codechicken.lib.gui.GuiDraw;
|
||||||
|
import codechicken.nei.NEIClientConfig;
|
||||||
|
import codechicken.nei.guihook.GuiContainerManager;
|
||||||
|
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||||
|
import codechicken.nei.recipe.GuiRecipe;
|
||||||
|
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||||
|
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraftforge.fluids.Fluid;
|
||||||
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
import net.minecraftforge.fluids.IFluidBlock;
|
||||||
|
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||||
|
|
||||||
|
public abstract class RecipeHandlerBase extends TemplateRecipeHandler
|
||||||
|
{
|
||||||
|
|
||||||
|
public abstract class CachedBaseRecipe extends CachedRecipe
|
||||||
|
{
|
||||||
|
public List<FluidTankElement> getFluidTanks()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract String getRecipeID();
|
||||||
|
|
||||||
|
public void loadCraftingRecipes(FluidStack result)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadUsageRecipes(FluidStack ingredient)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawForeground(int recipe)
|
||||||
|
{
|
||||||
|
super.drawForeground(recipe);
|
||||||
|
this.drawFluidTanks(recipe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadCraftingRecipes(String outputId, Object... results)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (outputId.equals("liquid") && results.length == 1 && results[0] instanceof FluidStack)
|
||||||
|
{
|
||||||
|
this.loadCraftingRecipes((FluidStack) results[0]);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
super.loadCraftingRecipes(outputId, results);
|
||||||
|
}
|
||||||
|
} catch (Throwable ex)
|
||||||
|
{
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadCraftingRecipes(ItemStack result)
|
||||||
|
{
|
||||||
|
FluidStack fluid = getFluidStack(result);
|
||||||
|
if (fluid != null)
|
||||||
|
{
|
||||||
|
this.loadCraftingRecipes(fluid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadUsageRecipes(String inputId, Object... ingredients)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (inputId.equals("liquid") && ingredients.length == 1 && ingredients[0] instanceof FluidStack)
|
||||||
|
{
|
||||||
|
this.loadUsageRecipes((FluidStack) ingredients[0]);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
super.loadUsageRecipes(inputId, ingredients);
|
||||||
|
}
|
||||||
|
} catch (Throwable ex)
|
||||||
|
{
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadUsageRecipes(ItemStack ingred)
|
||||||
|
{
|
||||||
|
FluidStack fluid = getFluidStack(ingred);
|
||||||
|
if (fluid != null)
|
||||||
|
{
|
||||||
|
this.loadUsageRecipes(fluid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> handleTooltip(GuiRecipe guiRecipe, List<String> currenttip, int recipe)
|
||||||
|
{
|
||||||
|
super.handleTooltip(guiRecipe, currenttip, recipe);
|
||||||
|
CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
|
||||||
|
if (GuiContainerManager.shouldShowTooltip(guiRecipe))
|
||||||
|
{
|
||||||
|
Point mouse = GuiDraw.getMousePosition();
|
||||||
|
Point offset = guiRecipe.getRecipePosition(recipe);
|
||||||
|
Point relMouse = new Point(mouse.x - ((guiRecipe.width - 176) / 2) - offset.x,
|
||||||
|
mouse.y - ((guiRecipe.height - 166) / 2) - offset.y);
|
||||||
|
|
||||||
|
if (crecipe.getFluidTanks() != null)
|
||||||
|
{
|
||||||
|
for (FluidTankElement tank : crecipe.getFluidTanks())
|
||||||
|
{
|
||||||
|
if (tank.position.contains(relMouse))
|
||||||
|
{
|
||||||
|
tank.handleTooltip(currenttip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe)
|
||||||
|
{
|
||||||
|
if (keyCode == NEIClientConfig.getKeyBinding("gui.recipe"))
|
||||||
|
{
|
||||||
|
if (this.transferFluidTank(gui, recipe, false))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else if (keyCode == NEIClientConfig.getKeyBinding("gui.usage"))
|
||||||
|
{
|
||||||
|
if (this.transferFluidTank(gui, recipe, true))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.keyTyped(gui, keyChar, keyCode, recipe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean mouseClicked(GuiRecipe gui, int button, int recipe)
|
||||||
|
{
|
||||||
|
if (button == 0)
|
||||||
|
{
|
||||||
|
if (this.transferFluidTank(gui, recipe, false))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else if (button == 1)
|
||||||
|
{
|
||||||
|
if (this.transferFluidTank(gui, recipe, true))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.mouseClicked(gui, button, recipe);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean transferFluidTank(GuiRecipe guiRecipe, int recipe, boolean usage)
|
||||||
|
{
|
||||||
|
CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
|
||||||
|
Point mousepos = GuiDraw.getMousePosition();
|
||||||
|
Point offset = guiRecipe.getRecipePosition(recipe);
|
||||||
|
Point relMouse = new Point(mousepos.x - ((guiRecipe.width - 176) / 2) - offset.x,
|
||||||
|
mousepos.y - ((guiRecipe.height - 166) / 2) - offset.y);
|
||||||
|
|
||||||
|
if (crecipe.getFluidTanks() != null)
|
||||||
|
{
|
||||||
|
for (FluidTankElement tank : crecipe.getFluidTanks())
|
||||||
|
{
|
||||||
|
if (tank.position.contains(relMouse))
|
||||||
|
{
|
||||||
|
if ((tank.fluid != null) && tank.fluid.amount > 0)
|
||||||
|
{
|
||||||
|
if (usage)
|
||||||
|
{
|
||||||
|
if (!GuiUsageRecipe.openRecipeGui("liquid", new Object[]
|
||||||
|
{ tank.fluid }))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
if (!GuiCraftingRecipe.openRecipeGui("liquid", new Object[]
|
||||||
|
{ tank.fluid }))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void drawFluidTanks(int recipe)
|
||||||
|
{
|
||||||
|
CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
|
||||||
|
if (crecipe.getFluidTanks() != null)
|
||||||
|
{
|
||||||
|
for (FluidTankElement fluidTank : crecipe.getFluidTanks())
|
||||||
|
{
|
||||||
|
fluidTank.draw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List getSingleList(Object o)
|
||||||
|
{
|
||||||
|
List list = new ArrayList();
|
||||||
|
list.add(o);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FluidStack getFluidStack(ItemStack stack)
|
||||||
|
{
|
||||||
|
if (stack == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Item item = stack.getItem();
|
||||||
|
FluidStack fluidStack = null;
|
||||||
|
if ((item instanceof IFluidContainerItem))
|
||||||
|
{
|
||||||
|
fluidStack = ((IFluidContainerItem) item).getFluid(stack);
|
||||||
|
}
|
||||||
|
if (fluidStack == null)
|
||||||
|
{
|
||||||
|
fluidStack = FluidContainerRegistry.getFluidForFilledItem(stack);
|
||||||
|
}
|
||||||
|
if ((fluidStack == null) && (Block.getBlockFromItem(stack.getItem()) instanceof IFluidBlock))
|
||||||
|
{
|
||||||
|
Fluid fluid = ((IFluidBlock) Block.getBlockFromItem(stack.getItem())).getFluid();
|
||||||
|
if (fluid != null)
|
||||||
|
{
|
||||||
|
return new FluidStack(fluid, 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fluidStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean areFluidsEqual(FluidStack fluidStack1, FluidStack fluidStack2)
|
||||||
|
{
|
||||||
|
if (fluidStack1 == null || fluidStack2 == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return fluidStack1.isFluidEqual(fluidStack2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class FluidTankElement
|
||||||
|
{
|
||||||
|
public Rectangle position;
|
||||||
|
public FluidStack fluid;
|
||||||
|
public int capacity;
|
||||||
|
public boolean flowingTexture = false;
|
||||||
|
|
||||||
|
public FluidTankElement(Rectangle position, int capacity, FluidStack fluid)
|
||||||
|
{
|
||||||
|
this.position = position;
|
||||||
|
this.capacity = capacity;
|
||||||
|
this.fluid = fluid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> handleTooltip(List<String> currenttip)
|
||||||
|
{
|
||||||
|
if (this.fluid == null || this.fluid.getFluid() == null || this.fluid.amount <= 0)
|
||||||
|
{
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
currenttip.add(this.fluid.getLocalizedName());
|
||||||
|
currenttip.add(EnumChatFormatting.GRAY.toString() + this.fluid.amount + " mB");
|
||||||
|
return currenttip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void draw()
|
||||||
|
{
|
||||||
|
if (this.fluid == null || this.fluid.getFluid() == null || this.fluid.amount <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
IIcon fluidIcon = null;
|
||||||
|
if (this.flowingTexture && this.fluid.getFluid().getFlowingIcon() != null)
|
||||||
|
{
|
||||||
|
fluidIcon = this.fluid.getFluid().getFlowingIcon();
|
||||||
|
} else if (this.fluid.getFluid().getStillIcon() != null)
|
||||||
|
{
|
||||||
|
fluidIcon = this.fluid.getFluid().getStillIcon();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GuiDraw.changeTexture(TextureMap.locationBlocksTexture);
|
||||||
|
int color = this.fluid.getFluid().getColor(this.fluid);
|
||||||
|
GL11.glColor3ub((byte) (color >> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF));
|
||||||
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
|
||||||
|
int amount = Math
|
||||||
|
.max(Math.min(this.position.height, this.fluid.amount * this.position.height / this.capacity), 1);
|
||||||
|
int posY = this.position.y + this.position.height - amount;
|
||||||
|
|
||||||
|
for (int i = 0; i < this.position.width; i += 16)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < amount; j += 16)
|
||||||
|
{
|
||||||
|
int drawWidth = Math.min(this.position.width - i, 16);
|
||||||
|
int drawHeight = Math.min(amount - j, 16);
|
||||||
|
|
||||||
|
int drawX = this.position.x + i;
|
||||||
|
int drawY = posY + j;
|
||||||
|
|
||||||
|
double minU = fluidIcon.getMinU();
|
||||||
|
double maxU = fluidIcon.getMaxU();
|
||||||
|
double minV = fluidIcon.getMinV();
|
||||||
|
double maxV = fluidIcon.getMaxV();
|
||||||
|
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.addVertexWithUV(drawX, drawY + drawHeight, 0, minU,
|
||||||
|
minV + (maxV - minV) * drawHeight / 16F);
|
||||||
|
tessellator.addVertexWithUV(drawX + drawWidth, drawY + drawHeight, 0,
|
||||||
|
minU + (maxU - minU) * drawWidth / 16F, minV + (maxV - minV) * drawHeight / 16F);
|
||||||
|
tessellator.addVertexWithUV(drawX + drawWidth, drawY, 0, minU + (maxU - minU) * drawWidth / 16F,
|
||||||
|
minV);
|
||||||
|
tessellator.addVertexWithUV(drawX, drawY, 0, minU, minV);
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
package com.oitsjustjose.criss_cross.NEI;
|
||||||
|
|
||||||
|
public class RecipeHandlerElectroextractor
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,130 @@
|
||||||
|
package com.oitsjustjose.criss_cross.NEI;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityWoodchipper;
|
||||||
|
import com.oitsjustjose.criss_cross.TileEntity.TileEntityWoodchipper.WoodchipperRecipe;
|
||||||
|
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||||
|
|
||||||
|
import codechicken.lib.gui.GuiDraw;
|
||||||
|
import codechicken.nei.NEIServerUtils;
|
||||||
|
import codechicken.nei.PositionedStack;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
|
public class RecipeHandlerWoodchipper extends RecipeHandlerBase
|
||||||
|
{
|
||||||
|
|
||||||
|
public class CachedWoodchipperRecipe extends CachedBaseRecipe
|
||||||
|
{
|
||||||
|
|
||||||
|
public PositionedStack input;
|
||||||
|
public PositionedStack output;
|
||||||
|
public int time = ConfigHandler.woodchipperProcessTime;
|
||||||
|
|
||||||
|
public CachedWoodchipperRecipe(WoodchipperRecipe chipper)
|
||||||
|
{
|
||||||
|
this.input = new PositionedStack(chipper.input, 44, 18);
|
||||||
|
this.output = new PositionedStack(chipper.result, 98, 18);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PositionedStack getIngredient()
|
||||||
|
{
|
||||||
|
return this.input;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PositionedStack getResult()
|
||||||
|
{
|
||||||
|
return this.output;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRecipeName()
|
||||||
|
{
|
||||||
|
return StatCollector.translateToLocal("crisscross.nei.woodchipper");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRecipeID()
|
||||||
|
{
|
||||||
|
return "crisscross.woodchipper";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadTransferRects()
|
||||||
|
{
|
||||||
|
this.transferRects
|
||||||
|
.add(new RecipeTransferRect(new Rectangle(68, 20, 22, 15), this.getRecipeID(), new Object[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGuiTexture()
|
||||||
|
{
|
||||||
|
return "crisscross:textures/gui/woodchipper.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawBackground(int recipe)
|
||||||
|
{
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
GuiDraw.changeTexture(this.getGuiTexture());
|
||||||
|
GuiDraw.drawTexturedModalRect(0, 0, 0, 0, 160, 65);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawExtras(int recipe)
|
||||||
|
{
|
||||||
|
int time = ((CachedWoodchipperRecipe) this.arecipes.get(recipe)).time;
|
||||||
|
int seconds = time / 20;
|
||||||
|
GuiDraw.drawStringC(time + " ticks (" + seconds + " secs)", 81, 40, 0x808080, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadCraftingRecipes(String outputId, Object... results)
|
||||||
|
{
|
||||||
|
if (outputId.equals(this.getRecipeID()))
|
||||||
|
{
|
||||||
|
ArrayList<ItemStack> inputs = TileEntityWoodchipper.getInputs();
|
||||||
|
ArrayList<ItemStack> outputs = TileEntityWoodchipper.getOutputs();
|
||||||
|
|
||||||
|
for (int i = 0; i < inputs.size(); i++)
|
||||||
|
{
|
||||||
|
WoodchipperRecipe recipe = new WoodchipperRecipe(inputs.get(i), outputs.get(i));
|
||||||
|
this.arecipes.add(new CachedWoodchipperRecipe(recipe));
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
super.loadCraftingRecipes(outputId, results);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadCraftingRecipes(ItemStack result)
|
||||||
|
{
|
||||||
|
WoodchipperRecipe recipe = new WoodchipperRecipe(TileEntityWoodchipper.getItemFromResult(result), result);
|
||||||
|
|
||||||
|
if (NEIServerUtils.areStacksSameTypeCrafting(recipe.result, result))
|
||||||
|
{
|
||||||
|
this.arecipes.add(new CachedWoodchipperRecipe(recipe));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadUsageRecipes(ItemStack ingred)
|
||||||
|
{
|
||||||
|
WoodchipperRecipe recipe = new WoodchipperRecipe(ingred, TileEntityWoodchipper.getResult(ingred));
|
||||||
|
|
||||||
|
if (NEIServerUtils.areStacksSameTypeCrafting(recipe.input, ingred))
|
||||||
|
{
|
||||||
|
this.arecipes.add(new CachedWoodchipperRecipe(recipe));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -13,7 +13,7 @@ import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||||
|
|
||||||
public class CRecipes
|
public class CCRecipes
|
||||||
{
|
{
|
||||||
public static void init()
|
public static void init()
|
||||||
{
|
{
|
||||||
|
|
@ -34,20 +34,15 @@ public class CRecipes
|
||||||
centerItem = newStack;
|
centerItem = newStack;
|
||||||
if (unlocItem.length == 3)
|
if (unlocItem.length == 3)
|
||||||
centerItem = new ItemStack(newStack.getItem(), 1, Integer.parseInt(unlocItem[2]));
|
centerItem = new ItemStack(newStack.getItem(), 1, Integer.parseInt(unlocItem[2]));
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.woodchipperRecipeItem + "could not be added as part of the recipe of the Woodchipper.");
|
CCLog.warn("Item " + ConfigHandler.woodchipperRecipeItem
|
||||||
|
+ "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()
|
||||||
|
|
@ -62,21 +57,16 @@ public class CRecipes
|
||||||
centerItem = newStack;
|
centerItem = newStack;
|
||||||
if (unlocItem.length == 3)
|
if (unlocItem.length == 3)
|
||||||
centerItem = new ItemStack(newStack.getItem(), 1, Integer.parseInt(unlocItem[2]));
|
centerItem = new ItemStack(newStack.getItem(), 1, Integer.parseInt(unlocItem[2]));
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.electroextractorRecipeItem + " could not be added as part of the recipe of the electroextractor.");
|
CCLog.warn("Item " + ConfigHandler.electroextractorRecipeItem
|
||||||
|
+ " 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()
|
||||||
|
|
@ -91,19 +81,14 @@ public class CRecipes
|
||||||
centerItem = newStack;
|
centerItem = newStack;
|
||||||
if (unlocItem.length == 3)
|
if (unlocItem.length == 3)
|
||||||
centerItem = new ItemStack(newStack.getItem(), 1, Integer.parseInt(unlocItem[2]));
|
centerItem = new ItemStack(newStack.getItem(), 1, Integer.parseInt(unlocItem[2]));
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.cropomatorRecipeItem + " could not be added as part of the recipe of the cropomator.");
|
CCLog.warn("Item " + ConfigHandler.cropomatorRecipeItem
|
||||||
|
+ " 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
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -20,10 +20,12 @@ public class CropomatorRecipes
|
||||||
if (unlocStack.length == 2)
|
if (unlocStack.length == 2)
|
||||||
{
|
{
|
||||||
if (GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
||||||
TileEntityCropomator.addItemStackToOutputs(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1));
|
TileEntityCropomator
|
||||||
|
.addItemStackToOutputs(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i] + " could not be added to the Cropomator's recipe list.");
|
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i]
|
||||||
|
+ " 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.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -32,18 +34,19 @@ public class CropomatorRecipes
|
||||||
{
|
{
|
||||||
if (GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
||||||
{
|
{
|
||||||
ItemStack newStack = new ItemStack(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1).getItem(), 1, Integer.parseInt(unlocStack[2]));
|
ItemStack newStack = new ItemStack(
|
||||||
|
GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1).getItem(), 1,
|
||||||
|
Integer.parseInt(unlocStack[2]));
|
||||||
TileEntityCropomator.addItemStackToOutputs(newStack);
|
TileEntityCropomator.addItemStackToOutputs(newStack);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i] + " could not be added to the Cropomator's recipe list.");
|
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i]
|
||||||
|
+ " 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("[CrissCross]: Error reading itemstack for inputs from input file at item: " + (i + 1));
|
||||||
}
|
}
|
||||||
|
|
@ -61,10 +64,12 @@ public class CropomatorRecipes
|
||||||
if (unlocStack.length == 2)
|
if (unlocStack.length == 2)
|
||||||
{
|
{
|
||||||
if (GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
||||||
TileEntityCropomator.addItemStackToCatalysts(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1));
|
TileEntityCropomator
|
||||||
|
.addItemStackToCatalysts(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i] + " could not be added to the Cropomator's catalyst list.");
|
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i]
|
||||||
|
+ " 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.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -73,17 +78,18 @@ public class CropomatorRecipes
|
||||||
{
|
{
|
||||||
if (GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
||||||
{
|
{
|
||||||
ItemStack newStack = new ItemStack(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1).getItem(), 1, Integer.parseInt(unlocStack[2]));
|
ItemStack newStack = new ItemStack(
|
||||||
|
GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1).getItem(), 1,
|
||||||
|
Integer.parseInt(unlocStack[2]));
|
||||||
TileEntityCropomator.addItemStackToCatalysts(newStack);
|
TileEntityCropomator.addItemStackToCatalysts(newStack);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i] + " could not be added to the Cropomator's catalyst list.");
|
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i]
|
||||||
|
+ " 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.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e)
|
||||||
catch(Exception e)
|
|
||||||
{
|
{
|
||||||
CCLog.warn("Error reading itemstack for catalysts from input file at item: " + (i + 1));
|
CCLog.warn("Error reading itemstack for catalysts from input file at item: " + (i + 1));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,13 +36,15 @@ public class ElectroextractorRecipes
|
||||||
ArrayList<ItemStack> ores = OreDictionary.getOres("ore" + entry[0]);
|
ArrayList<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++)
|
||||||
TileEntityElectroextractor.addRecipe(ores.get(j), new ItemStack(CCItems.dusts, 1, dustNames.size() - 1));
|
TileEntityElectroextractor.addRecipe(ores.get(j),
|
||||||
}
|
new ItemStack(CCItems.dusts, 1, dustNames.size() - 1));
|
||||||
else
|
} else
|
||||||
{
|
{
|
||||||
CCLog.warn("Your oreDictionary Entry " + ConfigHandler.electroextractorOreDictInputs[i] + " could not be registered.");
|
CCLog.warn("Your oreDictionary Entry " + ConfigHandler.electroextractorOreDictInputs[i]
|
||||||
|
+ " could not be registered.");
|
||||||
if (!OreDictionary.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 (!OreDictionary.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] + ".");
|
||||||
}
|
}
|
||||||
|
|
@ -71,7 +73,8 @@ public class ElectroextractorRecipes
|
||||||
TileEntityElectroextractor.addFuel(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 0));
|
TileEntityElectroextractor.addFuel(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 0));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.electroextractorEnergySources[i] + " could not be added to the Electroextractor's fuel list.");
|
CCLog.warn("Item " + ConfigHandler.electroextractorEnergySources[i]
|
||||||
|
+ " could not be added to the Electroextractor'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.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -80,17 +83,18 @@ public class ElectroextractorRecipes
|
||||||
{
|
{
|
||||||
if (GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
||||||
{
|
{
|
||||||
ItemStack newStack = new ItemStack(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1).getItem(), 1, Integer.parseInt(unlocStack[2]));
|
ItemStack newStack = new ItemStack(
|
||||||
|
GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1).getItem(), 1,
|
||||||
|
Integer.parseInt(unlocStack[2]));
|
||||||
TileEntityElectroextractor.addFuel(newStack);
|
TileEntityElectroextractor.addFuel(newStack);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.electroextractorEnergySources[i] + " could not be added to the Electroextractor's fuel list.");
|
CCLog.warn("Item " + ConfigHandler.electroextractorEnergySources[i]
|
||||||
|
+ " could not be added to the Electroextractor'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.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e)
|
||||||
catch(Exception e)
|
|
||||||
{
|
{
|
||||||
CCLog.warn("Error reading itemstack for electroextractor's energy sources at item: " + (i + 1));
|
CCLog.warn("Error reading itemstack for electroextractor's energy sources at item: " + (i + 1));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,8 @@ public class WoodchipperRecipes
|
||||||
TileEntityWoodchipper.addFuel(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 0));
|
TileEntityWoodchipper.addFuel(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 0));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.woodchipperFuels[i] + " could not be added to the Woodchipper's fuel list.");
|
CCLog.warn("Item " + ConfigHandler.woodchipperFuels[i]
|
||||||
|
+ " 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.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -73,17 +74,18 @@ public class WoodchipperRecipes
|
||||||
{
|
{
|
||||||
if (GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
if (GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
||||||
{
|
{
|
||||||
ItemStack newStack = new ItemStack(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1).getItem(), 1, Integer.parseInt(unlocStack[2]));
|
ItemStack newStack = new ItemStack(
|
||||||
|
GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1).getItem(), 1,
|
||||||
|
Integer.parseInt(unlocStack[2]));
|
||||||
TileEntityWoodchipper.addFuel(newStack);
|
TileEntityWoodchipper.addFuel(newStack);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
CCLog.warn("Item " + ConfigHandler.woodchipperFuels[i] + " could not be added to the Woodchipper's fuel list.");
|
CCLog.warn("Item " + ConfigHandler.woodchipperFuels[i]
|
||||||
|
+ " 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.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e)
|
||||||
catch(Exception e)
|
|
||||||
{
|
{
|
||||||
CCLog.warn("Error reading itemstack for Woodchipper's energy sources at item: " + (i + 1));
|
CCLog.warn("Error reading itemstack for Woodchipper's energy sources at item: " + (i + 1));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,12 @@ public class TileEntityCropomator extends TileEntity implements 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;
|
||||||
private static final int[] slotsTop = new int[] {0};
|
private static final int[] slotsTop = new int[]
|
||||||
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> recipeItems = new ArrayList<ItemStack>();
|
private static ArrayList<ItemStack> recipeItems = new ArrayList<ItemStack>();
|
||||||
private static ArrayList<ItemStack> catalystItems = new ArrayList<ItemStack>();
|
private static ArrayList<ItemStack> catalystItems = new ArrayList<ItemStack>();
|
||||||
|
|
||||||
|
|
@ -32,6 +35,17 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
public int processTime;
|
public int processTime;
|
||||||
public int catalystInUseTime;
|
public int catalystInUseTime;
|
||||||
|
|
||||||
|
public static ItemStack getResult(ItemStack input)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < recipeItems.size(); i++)
|
||||||
|
{
|
||||||
|
ItemStack temp = recipeItems.get(i);
|
||||||
|
if (ItemStack.areItemStacksEqual(temp, input))
|
||||||
|
return new ItemStack(temp.getItem(), qty, temp.getItemDamage());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSizeInventory()
|
public int getSizeInventory()
|
||||||
{
|
{
|
||||||
|
|
@ -56,8 +70,7 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
itemstack = this.ItemStacks[slot];
|
itemstack = this.ItemStacks[slot];
|
||||||
this.ItemStacks[slot] = null;
|
this.ItemStacks[slot] = null;
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
||||||
|
|
||||||
|
|
@ -68,8 +81,7 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -83,8 +95,7 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
ItemStack itemstack = this.ItemStacks[slot];
|
ItemStack itemstack = this.ItemStacks[slot];
|
||||||
this.ItemStacks[slot] = null;
|
this.ItemStacks[slot] = null;
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -230,8 +241,7 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
this.fertilizeItem();
|
this.fertilizeItem();
|
||||||
flag1 = true;
|
flag1 = true;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
this.processTime = 0;
|
this.processTime = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -240,7 +250,8 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
if (flag != this.catalystTime > 0)
|
if (flag != this.catalystTime > 0)
|
||||||
{
|
{
|
||||||
flag1 = true;
|
flag1 = true;
|
||||||
BlockCropomator.updateBlockState(this.catalystTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
|
BlockCropomator.updateBlockState(this.catalystTime > 0, this.worldObj, this.xCoord, this.yCoord,
|
||||||
|
this.zCoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -255,8 +266,7 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
if (this.ItemStacks[0] == null)
|
if (this.ItemStacks[0] == null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
ItemStack itemstack = new ItemStack(this.ItemStacks[0].getItem(), qty, this.ItemStacks[0].getItemDamage());
|
ItemStack itemstack = new ItemStack(this.ItemStacks[0].getItem(), qty, this.ItemStacks[0].getItemDamage());
|
||||||
|
|
||||||
|
|
@ -337,8 +347,7 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
if (this.ItemStacks[2] == null)
|
if (this.ItemStacks[2] == null)
|
||||||
{
|
{
|
||||||
this.ItemStacks[2] = output.copy();
|
this.ItemStacks[2] = output.copy();
|
||||||
}
|
} else if (this.ItemStacks[2].getItem() == output.getItem())
|
||||||
else if (this.ItemStacks[2].getItem() == output.getItem())
|
|
||||||
{
|
{
|
||||||
this.ItemStacks[2].stackSize += output.stackSize;
|
this.ItemStacks[2].stackSize += output.stackSize;
|
||||||
}
|
}
|
||||||
|
|
@ -370,12 +379,18 @@ 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 : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;
|
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 openInventory()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void closeInventory(){}
|
public void closeInventory()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
||||||
|
|
@ -402,5 +417,7 @@ public class TileEntityCropomator extends TileEntity implements ISidedInventory
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void markDirty(){}
|
public void markDirty()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -21,9 +21,12 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
{
|
{
|
||||||
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[] {0};
|
private static final int[] slotsTop = new int[]
|
||||||
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> inputItems = new ArrayList<ItemStack>();
|
private static ArrayList<ItemStack> inputItems = new ArrayList<ItemStack>();
|
||||||
private static ArrayList<ItemStack> outputItems = new ArrayList<ItemStack>();
|
private static ArrayList<ItemStack> outputItems = new ArrayList<ItemStack>();
|
||||||
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
||||||
|
|
@ -34,6 +37,16 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
public int crushTime;
|
public int crushTime;
|
||||||
public int fuelInUseTime;
|
public int fuelInUseTime;
|
||||||
|
|
||||||
|
public static ItemStack getResult(ItemStack input)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < inputItems.size(); i++)
|
||||||
|
{
|
||||||
|
ItemStack temp = inputItems.get(i);
|
||||||
|
if (ItemStack.areItemStacksEqual(temp, input))
|
||||||
|
return new ItemStack(outputItems.get(i).getItem(), qty, outputItems.get(i).getItemDamage());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSizeInventory()
|
public int getSizeInventory()
|
||||||
|
|
@ -59,8 +72,7 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
itemstack = this.ItemStacks[slot];
|
itemstack = this.ItemStacks[slot];
|
||||||
this.ItemStacks[slot] = null;
|
this.ItemStacks[slot] = null;
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
||||||
|
|
||||||
|
|
@ -71,8 +83,7 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -86,8 +97,7 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
ItemStack itemstack = this.ItemStacks[slot];
|
ItemStack itemstack = this.ItemStacks[slot];
|
||||||
this.ItemStacks[slot] = null;
|
this.ItemStacks[slot] = null;
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -233,8 +243,7 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
this.crushItem();
|
this.crushItem();
|
||||||
flag1 = true;
|
flag1 = true;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
this.crushTime = 0;
|
this.crushTime = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -243,7 +252,8 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
if (flag != this.fuelTime > 0)
|
if (flag != this.fuelTime > 0)
|
||||||
{
|
{
|
||||||
flag1 = true;
|
flag1 = true;
|
||||||
BlockElectroextractor.updateBlockState(this.fuelTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
|
BlockElectroextractor.updateBlockState(this.fuelTime > 0, this.worldObj, this.xCoord, this.yCoord,
|
||||||
|
this.zCoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -258,13 +268,13 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
if (this.ItemStacks[0] == null)
|
if (this.ItemStacks[0] == null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
ItemStack output = null;
|
ItemStack output = null;
|
||||||
for (int i = 0; i < inputItems.size(); i++)
|
for (int i = 0; i < inputItems.size(); i++)
|
||||||
{
|
{
|
||||||
if(inputItems.get(i).getItem() == ItemStacks[0].getItem() && inputItems.get(i).getItemDamage() == ItemStacks[0].getItemDamage())
|
if (inputItems.get(i).getItem() == ItemStacks[0].getItem()
|
||||||
|
&& inputItems.get(i).getItemDamage() == ItemStacks[0].getItemDamage())
|
||||||
{
|
{
|
||||||
output = new ItemStack(outputItems.get(i).getItem(), qty, outputItems.get(i).getItemDamage());
|
output = new ItemStack(outputItems.get(i).getItem(), qty, outputItems.get(i).getItemDamage());
|
||||||
}
|
}
|
||||||
|
|
@ -353,11 +363,13 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
|
|
||||||
for (int i = 0; i < inputItems.size(); i++)
|
for (int i = 0; i < inputItems.size(); i++)
|
||||||
{
|
{
|
||||||
if(inputItems.get(i).getItem() == ItemStacks[0].getItem() && inputItems.get(i).getItemDamage() == ItemStacks[0].getItemDamage())
|
if (inputItems.get(i).getItem() == ItemStacks[0].getItem()
|
||||||
|
&& inputItems.get(i).getItemDamage() == ItemStacks[0].getItemDamage())
|
||||||
{
|
{
|
||||||
output = new ItemStack(outputItems.get(i).getItem(), qty, outputItems.get(i).getItemDamage());
|
output = new ItemStack(outputItems.get(i).getItem(), qty, outputItems.get(i).getItemDamage());
|
||||||
if (output.getItem() instanceof ItemDust)
|
if (output.getItem() instanceof ItemDust)
|
||||||
output.setStackDisplayName("Electrolytic " + ItemDust.getName(outputItems.get(i).getItemDamage()) + " Dust");
|
output.setStackDisplayName(
|
||||||
|
"Electrolytic " + ItemDust.getName(outputItems.get(i).getItemDamage()) + " Dust");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -367,8 +379,7 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
if (this.ItemStacks[2] == null)
|
if (this.ItemStacks[2] == null)
|
||||||
{
|
{
|
||||||
this.ItemStacks[2] = output.copy();
|
this.ItemStacks[2] = output.copy();
|
||||||
}
|
} else if (this.ItemStacks[2].getItem() == output.getItem())
|
||||||
else if (this.ItemStacks[2].getItem() == output.getItem())
|
|
||||||
{
|
{
|
||||||
this.ItemStacks[2].stackSize += output.stackSize;
|
this.ItemStacks[2].stackSize += output.stackSize;
|
||||||
}
|
}
|
||||||
|
|
@ -400,12 +411,18 @@ 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 : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;
|
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 openInventory()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void closeInventory(){}
|
public void closeInventory()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
||||||
|
|
@ -432,5 +449,7 @@ public class TileEntityElectroextractor extends TileEntity implements ISidedInve
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void markDirty(){}
|
public void markDirty()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -20,9 +20,12 @@ public class TileEntityWoodchipper extends TileEntity implements 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[] {0};
|
private static final int[] slotsTop = new int[]
|
||||||
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> inputItems = new ArrayList<ItemStack>();
|
private static ArrayList<ItemStack> inputItems = new ArrayList<ItemStack>();
|
||||||
private static ArrayList<ItemStack> outputItems = new ArrayList<ItemStack>();
|
private static ArrayList<ItemStack> outputItems = new ArrayList<ItemStack>();
|
||||||
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
private static ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
||||||
|
|
@ -33,6 +36,43 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
public int processTime;
|
public int processTime;
|
||||||
public int fuelUsetime;
|
public int fuelUsetime;
|
||||||
|
|
||||||
|
public static ItemStack getItemFromResult(ItemStack output)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < outputItems.size(); i++)
|
||||||
|
{
|
||||||
|
ItemStack temp = outputItems.get(i);
|
||||||
|
if (ItemStack.areItemStacksEqual(temp, output))
|
||||||
|
return new ItemStack(inputItems.get(i).getItem(), qty, inputItems.get(i).getItemDamage());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ItemStack getResult(ItemStack input)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < inputItems.size(); i++)
|
||||||
|
{
|
||||||
|
ItemStack temp = inputItems.get(i);
|
||||||
|
if (ItemStack.areItemStacksEqual(temp, input))
|
||||||
|
return new ItemStack(outputItems.get(i).getItem(), qty, outputItems.get(i).getItemDamage());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ArrayList<ItemStack> getInputs()
|
||||||
|
{
|
||||||
|
return inputItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ArrayList<ItemStack> getOutputs()
|
||||||
|
{
|
||||||
|
return outputItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ArrayList<ItemStack> getFuels()
|
||||||
|
{
|
||||||
|
return fuelItems;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSizeInventory()
|
public int getSizeInventory()
|
||||||
{
|
{
|
||||||
|
|
@ -57,8 +97,7 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
itemstack = this.ItemStacks[slot];
|
itemstack = this.ItemStacks[slot];
|
||||||
this.ItemStacks[slot] = null;
|
this.ItemStacks[slot] = null;
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
itemstack = this.ItemStacks[slot].splitStack(qtyToDecr);
|
||||||
|
|
||||||
|
|
@ -69,8 +108,7 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -84,8 +122,7 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
ItemStack itemstack = this.ItemStacks[slot];
|
ItemStack itemstack = this.ItemStacks[slot];
|
||||||
this.ItemStacks[slot] = null;
|
this.ItemStacks[slot] = null;
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -231,8 +268,7 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
this.processItem();
|
this.processItem();
|
||||||
flag1 = true;
|
flag1 = true;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
this.processTime = 0;
|
this.processTime = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -241,7 +277,8 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
if (flag != this.fuelTime > 0)
|
if (flag != this.fuelTime > 0)
|
||||||
{
|
{
|
||||||
flag1 = true;
|
flag1 = true;
|
||||||
BlockWoodchipper.updateBlockState(this.fuelTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
|
BlockWoodchipper.updateBlockState(this.fuelTime > 0, this.worldObj, this.xCoord, this.yCoord,
|
||||||
|
this.zCoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -256,13 +293,13 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
if (this.ItemStacks[0] == null)
|
if (this.ItemStacks[0] == null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
ItemStack output = null;
|
ItemStack output = null;
|
||||||
for (int i = 0; i < inputItems.size(); i++)
|
for (int i = 0; i < inputItems.size(); i++)
|
||||||
{
|
{
|
||||||
if(inputItems.get(i).getItem() == ItemStacks[0].getItem() && inputItems.get(i).getItemDamage() == ItemStacks[0].getItemDamage())
|
if (inputItems.get(i).getItem() == ItemStacks[0].getItem()
|
||||||
|
&& inputItems.get(i).getItemDamage() == ItemStacks[0].getItemDamage())
|
||||||
{
|
{
|
||||||
output = new ItemStack(outputItems.get(i).getItem(), qty, outputItems.get(i).getItemDamage());
|
output = new ItemStack(outputItems.get(i).getItem(), qty, outputItems.get(i).getItemDamage());
|
||||||
}
|
}
|
||||||
|
|
@ -350,7 +387,8 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
ItemStack output = null;
|
ItemStack output = null;
|
||||||
for (int i = 0; i < inputItems.size(); i++)
|
for (int i = 0; i < inputItems.size(); i++)
|
||||||
{
|
{
|
||||||
if(inputItems.get(i).getItem() == ItemStacks[0].getItem() && inputItems.get(i).getItemDamage() == ItemStacks[0].getItemDamage())
|
if (inputItems.get(i).getItem() == ItemStacks[0].getItem()
|
||||||
|
&& inputItems.get(i).getItemDamage() == ItemStacks[0].getItemDamage())
|
||||||
{
|
{
|
||||||
output = new ItemStack(outputItems.get(i).getItem(), qty, outputItems.get(i).getItemDamage());
|
output = new ItemStack(outputItems.get(i).getItem(), qty, outputItems.get(i).getItemDamage());
|
||||||
}
|
}
|
||||||
|
|
@ -362,8 +400,7 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
if (this.ItemStacks[2] == null)
|
if (this.ItemStacks[2] == null)
|
||||||
{
|
{
|
||||||
this.ItemStacks[2] = output.copy();
|
this.ItemStacks[2] = output.copy();
|
||||||
}
|
} else if (this.ItemStacks[2].getItem() == output.getItem())
|
||||||
else if (this.ItemStacks[2].getItem() == output.getItem())
|
|
||||||
{
|
{
|
||||||
this.ItemStacks[2].stackSize += output.stackSize;
|
this.ItemStacks[2].stackSize += output.stackSize;
|
||||||
}
|
}
|
||||||
|
|
@ -396,12 +433,18 @@ public class TileEntityWoodchipper 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 : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;
|
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 openInventory()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void closeInventory(){}
|
public void closeInventory()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
public boolean isItemValidForSlot(int slot, ItemStack itemstack)
|
||||||
|
|
@ -428,5 +471,31 @@ public class TileEntityWoodchipper extends TileEntity implements ISidedInventory
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void markDirty(){}
|
public void markDirty()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class WoodchipperRecipe
|
||||||
|
{
|
||||||
|
public final int time;
|
||||||
|
public final ItemStack input;
|
||||||
|
public final ItemStack result;
|
||||||
|
|
||||||
|
public WoodchipperRecipe(ItemStack input, ItemStack result)
|
||||||
|
{
|
||||||
|
this.time = ConfigHandler.woodchipperProcessTime;
|
||||||
|
this.input = input;
|
||||||
|
this.result = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean matches(ItemStack input)
|
||||||
|
{
|
||||||
|
return ItemStack.areItemStacksEqual(this.input, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getResult()
|
||||||
|
{
|
||||||
|
return result.copy();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2,6 +2,11 @@ package com.oitsjustjose.criss_cross.Util;
|
||||||
|
|
||||||
public class CommonProxy
|
public class CommonProxy
|
||||||
{
|
{
|
||||||
public void preInit(){};
|
public void preInit()
|
||||||
public void init(){};
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
public void init()
|
||||||
|
{
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -16,19 +16,13 @@ public class ConfigHandler
|
||||||
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:apple", "minecraft:reeds", "minecraft:nether_wart",
|
"minecraft:potato", "minecraft:sapling:0", "minecraft:sapling:1", "minecraft:sapling:2",
|
||||||
"minecraft:carrot", "minecraft:cactus", "minecraft:potato",
|
"minecraft:sapling:3", "minecraft:sapling:4", "minecraft:sapling:5", "minecraft:melon",
|
||||||
"minecraft:sapling:0", "minecraft:sapling:1", "minecraft:sapling:2",
|
"minecraft:brown_mushroom", "minecraft:red_mushroom", "minecraft:cocoa", "minecraft:pumpkin",
|
||||||
"minecraft:sapling:3", "minecraft:sapling:4", "minecraft:sapling:5",
|
"minecraft:wheat", "minecraft:wheat_seeds" };
|
||||||
"minecraft:melon", "minecraft:brown_mushroom", "minecraft:red_mushroom",
|
|
||||||
"minecraft:cocoa", "minecraft:pumpkin", "minecraft:wheat",
|
|
||||||
"minecraft:wheat_seeds"
|
|
||||||
};
|
|
||||||
public static String[] defaultCropomatorCatalystItems = new String[]
|
public static String[] defaultCropomatorCatalystItems = new String[]
|
||||||
{
|
{ "minecraft:dye:15" };
|
||||||
"minecraft:dye:15"
|
|
||||||
};
|
|
||||||
|
|
||||||
public static int electroextractorProcessTime;
|
public static int electroextractorProcessTime;
|
||||||
public static int electroextractorOutput;
|
public static int electroextractorOutput;
|
||||||
|
|
@ -36,25 +30,18 @@ public class ConfigHandler
|
||||||
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",
|
||||||
"Iron:12428902", "Gold:15400704", "Aluminum:15987699",
|
"Tin:15132390", "Silver:13297640", "Lead:5722979", "Platinum:11067903", "Mithril:4433113",
|
||||||
"Cobalt:17663", "Ardite:13938485", "Copper:16751872",
|
"Nickel:16580553" };
|
||||||
"Tin:15132390", "Silver:13297640", "Lead:5722979",
|
|
||||||
"Platinum:11067903", "Mithril:4433113", "Nickel:16580553"
|
|
||||||
};
|
|
||||||
public static String[] defaultElectroextractorEnergySources = new String[]
|
public static String[] defaultElectroextractorEnergySources = new String[]
|
||||||
{
|
{ "minecraft:redstone_block" };
|
||||||
"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" };
|
||||||
"minecraft:water_bucket", "minecraft:potion:0"
|
|
||||||
};
|
|
||||||
|
|
||||||
public static void init(File configFile)
|
public static void init(File configFile)
|
||||||
{
|
{
|
||||||
|
|
@ -69,49 +56,68 @@ public class ConfigHandler
|
||||||
private static void loadConfiguration()
|
private static void loadConfiguration()
|
||||||
{
|
{
|
||||||
// Cropomator Configs
|
// Cropomator Configs
|
||||||
cropomatorInputs = config.get(config.CATEGORY_GENERAL, "Cropomator's Recipe Items.", defaultCropomatorInputs,
|
cropomatorInputs = config
|
||||||
"A list of items to be added to the Cropomator's recipe list. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.").getStringList();
|
.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>.")
|
||||||
|
.getStringList();
|
||||||
|
|
||||||
cropomatorCatalysts = config.get(config.CATEGORY_GENERAL, "Cropomator's Catalyst Items.", defaultCropomatorCatalystItems,
|
cropomatorCatalysts = config
|
||||||
"A list of items to be added to the Cropomator's catalyst list. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.").getStringList();
|
.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>.")
|
||||||
|
.getStringList();
|
||||||
|
|
||||||
cropomatorProcessTime = config.getInt("Cropomator Processing Time", config.CATEGORY_GENERAL, 150, 1, Short.MAX_VALUE,
|
cropomatorProcessTime = config.getInt("Cropomator Processing Time", config.CATEGORY_GENERAL, 150, 1,
|
||||||
|
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, "minecraft:diamond_block",
|
cropomatorRecipeItem = config.getString("Cropomator Crafting Item.", config.CATEGORY_GENERAL,
|
||||||
|
"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.get(config.CATEGORY_GENERAL, "Electroextractor's Fuel Items.", defaultElectroextractorEnergySources,
|
electroextractorEnergySources = config
|
||||||
"A list of items to be added as the Electroextractor's energy sources. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.").getStringList();
|
.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>.")
|
||||||
|
.getStringList();
|
||||||
|
|
||||||
electroextractorProcessTime = config.getInt("Electroextractor Processing Time", config.CATEGORY_GENERAL, 250, 0, Short.MAX_VALUE,
|
electroextractorProcessTime = config.getInt("Electroextractor Processing Time", config.CATEGORY_GENERAL, 250, 0,
|
||||||
|
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, "minecraft:diamond_block",
|
electroextractorRecipeItem = config.getString("Electroextractor Crafting Item.", config.CATEGORY_GENERAL,
|
||||||
|
"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.get(config.CATEGORY_GENERAL, "Electroextractor OreDictionary Entries.", defaultElectroextractorOreDictInputs,
|
electroextractorOreDictInputs = config
|
||||||
"Formatted as <OreDictName>:<DecimalColorYouWant>." + "\n" + " Remove the 'ore' part of the oredict name (i.e. 'oreIron' should be entered as 'Iron')" + "\n"
|
.get(config.CATEGORY_GENERAL, "Electroextractor OreDictionary Entries.",
|
||||||
+ "Use http://www.colorpicker.com/ to find a color and http://bit.ly/1RhPhcX to convert it from Hex to Decimal.").getStringList();
|
defaultElectroextractorOreDictInputs,
|
||||||
|
"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.")
|
||||||
|
.getStringList();
|
||||||
|
|
||||||
// Woodchipper's Configs
|
// Woodchipper's Configs
|
||||||
woodchipperFuels = config.get(config.CATEGORY_GENERAL, "Woodchipper Fuel Items", defaultWoodchipperFuels,
|
woodchipperFuels = config
|
||||||
"A list of items to be added as the Woodchipper's 'fuels'. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.").getStringList();
|
.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();
|
||||||
|
|
||||||
woodchipperProcessTime = config.getInt("Woodchipper Process Time", config.CATEGORY_GENERAL, 400, 0, Short.MAX_VALUE,
|
woodchipperProcessTime = config.getInt("Woodchipper Process Time", config.CATEGORY_GENERAL, 400, 0,
|
||||||
|
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, "minecraft:diamond_block",
|
woodchipperRecipeItem = config.getString("Woodchipper Crafting Item", config.CATEGORY_GENERAL,
|
||||||
|
"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>.");
|
||||||
|
|
||||||
if (config.hasChanged())
|
if (config.hasChanged())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue