Working on stuff! :D
This commit is contained in:
parent
a41153b221
commit
6d3f9b9b30
18 changed files with 101 additions and 127 deletions
|
|
@ -3,6 +3,7 @@ package com.oitsjustjose.criss_cross;
|
|||
import com.oitsjustjose.criss_cross.gui.GUIHandler;
|
||||
import com.oitsjustjose.criss_cross.lib.Config;
|
||||
import com.oitsjustjose.criss_cross.lib.CreativeTab;
|
||||
import com.oitsjustjose.criss_cross.lib.FluidHandler;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.lib.LibBlocks;
|
||||
import com.oitsjustjose.criss_cross.lib.LibItems;
|
||||
|
|
@ -43,7 +44,7 @@ public class CrissCross
|
|||
LibBlocks.init();
|
||||
LibItems.init();
|
||||
CraftingRecipes.init();
|
||||
|
||||
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, new GUIHandler());
|
||||
}
|
||||
|
||||
|
|
@ -51,10 +52,11 @@ public class CrissCross
|
|||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
MachineRecipes.init();
|
||||
FluidHandler.init();
|
||||
|
||||
if (event.getSide().isClient())
|
||||
ClientProxy.init();
|
||||
|
||||
|
||||
LogHelper.info("Successfully loaded!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import java.io.IOException;
|
|||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileAtmosManipulator;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
|
@ -18,7 +19,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class GUIAtmosManipulator extends GuiScreen
|
||||
{
|
||||
static final ResourceLocation texture = new ResourceLocation("crisscross", "textures/gui/atmosmanipulator.png");
|
||||
static final ResourceLocation texture = new ResourceLocation(Lib.MODID.toLowerCase(), "textures/gui/atmosmanipulator.png");
|
||||
final EntityPlayer player;
|
||||
final int RAINID = 0;
|
||||
final int SUNID = 1;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import net.minecraftforge.common.ForgeModContainer;
|
|||
|
||||
public class GUICobblegen extends GuiContainer
|
||||
{
|
||||
public static final ResourceLocation texture = new ResourceLocation("crisscross", "textures/gui/cobblegen.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation(Lib.MODID.toLowerCase(), "textures/gui/cobblegen.png");
|
||||
public static final ResourceLocation altTexture = new ResourceLocation(Lib.MODID.toLowerCase(), "textures/gui/cobblegen_alt.png");
|
||||
|
||||
private TileCobblegen cobblegen;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.oitsjustjose.criss_cross.gui;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.oitsjustjose.criss_cross.container.ContainerCropomator;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileCropomator;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
|
|
@ -12,7 +13,7 @@ import net.minecraft.util.StatCollector;
|
|||
|
||||
public class GUICropomator extends GuiContainer
|
||||
{
|
||||
public static final ResourceLocation backgroundTexture = new ResourceLocation("crisscross", "textures/gui/cropomator.png");
|
||||
public static final ResourceLocation backgroundTexture = new ResourceLocation(Lib.MODID.toLowerCase(), "textures/gui/cropomator.png");
|
||||
|
||||
private TileCropomator cropomator;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.oitsjustjose.criss_cross.gui;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.oitsjustjose.criss_cross.container.ContainerElectroextractor;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileElectroextractor;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
|
|
@ -12,7 +13,7 @@ import net.minecraft.util.StatCollector;
|
|||
|
||||
public class GUIElectroextractor extends GuiContainer
|
||||
{
|
||||
public static final ResourceLocation backgroundTexture = new ResourceLocation("crisscross", "textures/gui/electroextractor.png");
|
||||
public static final ResourceLocation backgroundTexture = new ResourceLocation(Lib.MODID.toLowerCase(), "textures/gui/electroextractor.png");
|
||||
|
||||
private TileElectroextractor electroextractor;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.oitsjustjose.criss_cross.gui;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.oitsjustjose.criss_cross.container.ContainerScribe;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileScribe;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
|
|
@ -12,7 +13,7 @@ import net.minecraft.util.StatCollector;
|
|||
|
||||
public class GUIScribe extends GuiContainer
|
||||
{
|
||||
public static final ResourceLocation backgroundTexture = new ResourceLocation("crisscross", "textures/gui/scribe.png");
|
||||
public static final ResourceLocation backgroundTexture = new ResourceLocation(Lib.MODID.toLowerCase(), "textures/gui/scribe.png");
|
||||
|
||||
private TileScribe scribe;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,16 +3,19 @@ package com.oitsjustjose.criss_cross.gui;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.oitsjustjose.criss_cross.container.ContainerWoodchipper;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileWoodchipper;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
|
||||
public class GUIWoodchipper extends GuiContainer
|
||||
{
|
||||
public static final ResourceLocation backgroundTexture = new ResourceLocation("crisscross", "textures/gui/woodchipper.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation(Lib.MODID.toLowerCase(), "textures/gui/woodchipper.png");
|
||||
public static final ResourceLocation altTexture = new ResourceLocation(Lib.MODID.toLowerCase(), "textures/gui/woodchipper_alt.png");
|
||||
|
||||
private TileWoodchipper woodchipper;
|
||||
|
||||
|
|
@ -22,6 +25,13 @@ public class GUIWoodchipper extends GuiContainer
|
|||
this.woodchipper = woodchipper;
|
||||
}
|
||||
|
||||
public static ResourceLocation getBackground()
|
||||
{
|
||||
if (ForgeModContainer.replaceVanillaBucketModel)
|
||||
return altTexture;
|
||||
return texture;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
|
|
@ -33,7 +43,7 @@ public class GUIWoodchipper extends GuiContainer
|
|||
protected void drawGuiContainerBackgroundLayer(float partialTickTime, int mouseX, int mouseY)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.renderEngine.bindTexture(backgroundTexture);
|
||||
this.mc.renderEngine.bindTexture(getBackground());
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
package com.oitsjustjose.criss_cross.jei;
|
||||
|
||||
import com.oitsjustjose.criss_cross.gui.GUICropomator;
|
||||
import com.oitsjustjose.criss_cross.gui.GUIElectroextractor;
|
||||
import com.oitsjustjose.criss_cross.gui.GUIScribe;
|
||||
import com.oitsjustjose.criss_cross.gui.GUIWoodchipper;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
|
||||
import mezz.jei.api.IItemRegistry;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.IModPlugin;
|
||||
|
|
@ -37,6 +43,11 @@ public class JEIPluginManager implements IModPlugin
|
|||
registry.addRecipeCategories(new ScribeCategory());
|
||||
registry.addRecipeHandlers(new ScribeRecipeHandler());
|
||||
registry.addRecipes(ScribeRecipeMaker.getRecipes());
|
||||
|
||||
registry.addRecipeClickArea(GUICropomator.class, 78, 32, 28, 23, Lib.CROPOMATOR_UID);
|
||||
registry.addRecipeClickArea(GUIElectroextractor.class, 78, 32, 28, 23, Lib.ELECTROEXTRACTOR_UID);
|
||||
registry.addRecipeClickArea(GUIWoodchipper.class, 78, 32, 28, 23, Lib.WOODCHIPPER_UID);
|
||||
registry.addRecipeClickArea(GUIScribe.class, 88, 32, 28, 23, Lib.SCRIBE_UID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class ScribeCategory implements IRecipeCategory
|
|||
public ScribeCategory()
|
||||
{
|
||||
super();
|
||||
progressDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIWoodchipper.backgroundTexture, 177, 14, 23, 16);
|
||||
progressDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIWoodchipper.texture, 177, 14, 23, 16);
|
||||
progress = JEIPluginManager.jeiHelper.getGuiHelper().createAnimatedDrawable(progressDrawable, 700, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
background = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIScribe.backgroundTexture, 33, 30, 110, 34);
|
||||
localizedName = StatCollector.translateToLocal("recipe.scribe");
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import javax.annotation.Nonnull;
|
|||
|
||||
import com.oitsjustjose.criss_cross.gui.GUIWoodchipper;
|
||||
import com.oitsjustjose.criss_cross.lib.Config;
|
||||
import com.oitsjustjose.criss_cross.lib.FluidHandler;
|
||||
import com.oitsjustjose.criss_cross.lib.Lib;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileWoodchipper;
|
||||
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
|
|
@ -22,33 +22,26 @@ public class WoodchipperCategory implements IRecipeCategory
|
|||
private static final int OUTPUT_SLOT = 1;
|
||||
private static final int FUEL_SLOT = 2;
|
||||
|
||||
IDrawableStatic fuelDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIWoodchipper.backgroundTexture, 176, 0, 14, 14);
|
||||
IDrawableStatic progressDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIWoodchipper.backgroundTexture, 177, 14, 23, 16);
|
||||
IDrawableStatic fuelDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIWoodchipper.getBackground(), 176, 0, 14, 14);
|
||||
IDrawableStatic progressDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIWoodchipper.getBackground(), 177, 14, 23, 16);
|
||||
|
||||
@Nonnull
|
||||
protected final IDrawableAnimated fuel = JEIPluginManager.jeiHelper.getGuiHelper().createAnimatedDrawable(fuelDrawable, Config.woodchipperProcessTime, IDrawableAnimated.StartDirection.TOP, true);
|
||||
@Nonnull
|
||||
protected final IDrawableAnimated progress = JEIPluginManager.jeiHelper.getGuiHelper().createAnimatedDrawable(progressDrawable, Config.woodchipperProcessTime, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
@Nonnull
|
||||
private final IDrawable background = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIWoodchipper.backgroundTexture, 55, 16, 82, 54);
|
||||
@Nonnull
|
||||
private final IDrawable background = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIWoodchipper.getBackground(), 55, 16, 82, 54);
|
||||
private final String localizedName = StatCollector.translateToLocal("recipe.woodchipper");
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
return Lib.WOODCHIPPER_UID;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
|
|
@ -69,10 +62,8 @@ public class WoodchipperCategory implements IRecipeCategory
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
|
||||
{
|
||||
|
||||
{
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 0);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 60, 18);
|
||||
recipeLayout.getItemStacks().init(FUEL_SLOT, true, 0, 36);
|
||||
|
|
@ -82,7 +73,7 @@ public class WoodchipperCategory implements IRecipeCategory
|
|||
WoodchipperRecipeJEI woodchipperRecipeWrapper = (WoodchipperRecipeJEI) recipeWrapper;
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, woodchipperRecipeWrapper.getInputs());
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, woodchipperRecipeWrapper.getOutputs());
|
||||
recipeLayout.getItemStacks().set(FUEL_SLOT, TileWoodchipper.getFuels());
|
||||
recipeLayout.getItemStacks().set(FUEL_SLOT, FluidHandler.waterContainers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,9 +41,7 @@ public class Config
|
|||
public static int woodchipperProcessTime;
|
||||
public static int woodchipperOutput;
|
||||
public static String woodchipperRecipeItem;
|
||||
public static String[] woodchipperFuels;
|
||||
public static String[] defaultWoodchipperFuels = new String[] { "minecraft:water_bucket", "minecraft:potion:0", "crisscross:special_bucket:0" };
|
||||
// Scribe Configs
|
||||
// Scribe Configs
|
||||
public static String[] scribeRecipes;
|
||||
public static String[] defaultScribeRecipes = new String[] { "minecraft:fish:3*16=6", "minecraft:spider_eye:0*8=18", "minecraft:obsidian:0*8=3", "minecraft:prismarine_shard:0*16=8", "minecraft:feather:0*32=2", "minecraft:blaze_rod:0*8=20", "minecraft:blaze_powder:0*16=50", "minecraft:piston:0*4=19", "minecraft:prismarine_crystals:0*16=61", "minecraft:fish:0*16=62", "minecraft:potion:8269*1=5", "minecraft:slime:0*8=33", "minecraft:rotten_flesh:0*48=17", "minecraft:double_plant:4*64=7", "ingotIron*24=34", "ingotGold*12=49", "gemQuartz*16=48", "gemDiamond*8=51", "gemEmerald*3=21", "logWood*16=4", "blockIron*4=0", "blockQuartz*16=16", "blockLapis*12=35", "blockRedstone*8=32" };
|
||||
// Block Generator Configs (stone and cobble)
|
||||
|
|
@ -131,10 +129,6 @@ public class Config
|
|||
woodchipperProcessTime = property.getInt();
|
||||
propertyOrder.add(property.getName());
|
||||
|
||||
property = config.get(category, "Woodchipper Fuel Items", defaultWoodchipperFuels, "Items considered as fuel for the Woodchipper. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
|
||||
woodchipperFuels = property.getStringList();
|
||||
propertyOrder.add(property.getName());
|
||||
|
||||
property = config.get(category, "Woodchipper Output Quantity", 6, "Amount of planks yielded from a log", 0, 64);
|
||||
woodchipperOutput = property.getInt();
|
||||
propertyOrder.add(property.getName());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.oitsjustjose.criss_cross.lib;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class FluidHandler
|
||||
{
|
||||
public static ArrayList<ItemStack> waterContainers = new ArrayList<ItemStack>();
|
||||
|
||||
public static void init()
|
||||
{
|
||||
FluidContainerData[] fluidC = FluidContainerRegistry.getRegisteredFluidContainerData();
|
||||
for (FluidContainerData f : fluidC)
|
||||
if (f.fluid.isFluidEqual(new FluidStack(FluidRegistry.WATER, 1000)) && f.fluid.amount == 1000)
|
||||
waterContainers.add(f.filledContainer);
|
||||
}
|
||||
}
|
||||
|
|
@ -11,6 +11,9 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class LibItems
|
||||
{
|
||||
|
|
@ -37,5 +40,7 @@ public class LibItems
|
|||
|
||||
mantleSmasherMkI = new ItemMantleSmasher(mkI);
|
||||
mantleSmasherMkII = new ItemMantleSmasher(mkII);
|
||||
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidStack(FluidRegistry.WATER, 4000), new ItemStack(buckets, 1, 0), new ItemStack(buckets, 1, 0));
|
||||
}
|
||||
}
|
||||
|
|
@ -12,7 +12,6 @@ import com.oitsjustjose.criss_cross.recipes.machine.ScribeRecipes;
|
|||
import com.oitsjustjose.criss_cross.recipes.machine.WoodchipperRecipes;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileCropomator;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileElectroextractor;
|
||||
import com.oitsjustjose.criss_cross.tileentity.TileWoodchipper;
|
||||
import com.oitsjustjose.criss_cross.util.ItemHelper;
|
||||
import com.oitsjustjose.criss_cross.util.LogHelper;
|
||||
|
||||
|
|
@ -36,7 +35,6 @@ public class MachineRecipes
|
|||
parseCropomatorFuels();
|
||||
parseElectroextractorFuels();
|
||||
parseElectroextractorRecipes();
|
||||
parseWoodchipperFuels();
|
||||
parseWoodchipperRecipes();
|
||||
parseScribeRecipes();
|
||||
|
||||
|
|
@ -238,39 +236,6 @@ public class MachineRecipes
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void parseWoodchipperFuels()
|
||||
{
|
||||
for (int i = 0; i < Config.woodchipperFuels.length; i++)
|
||||
try
|
||||
{
|
||||
String[] parts = Config.woodchipperFuels[i].split(":");
|
||||
if (parts.length == 2)
|
||||
if (Config.findItemStack(parts[0], parts[1]) != null)
|
||||
TileWoodchipper.addFuel(Config.findItemStack(parts[0], parts[1]));
|
||||
else
|
||||
{
|
||||
LogHelper.warn("Item " + Config.woodchipperFuels[i] + " could not be added to the Woodchipper's fuel list.");
|
||||
LogHelper.warn("Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
|
||||
if (parts.length == 3)
|
||||
if (Config.findItemStack(parts[0], parts[1]) != null)
|
||||
{
|
||||
ItemStack newStack = new ItemStack(Config.findItemStack(parts[0], parts[1]).getItem(), 1, Integer.parseInt(parts[2]));
|
||||
TileWoodchipper.addFuel(newStack);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.warn("Item " + Config.woodchipperFuels[i] + " could not be added to the Woodchipper's fuel list.");
|
||||
LogHelper.warn("Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.warn("Error reading itemstack for Woodchipper's energy sources at item: " + (i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
static void parseElectroextractorRecipes()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
|
|
@ -41,7 +44,6 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
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 String customName;
|
||||
private ItemStack[] ItemStacks = new ItemStack[3];
|
||||
public int fuelTime;
|
||||
public int processTime;
|
||||
|
|
@ -173,12 +175,7 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
@Override
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return TileCobblegen.customName != null && TileCobblegen.customName.length() > 0;
|
||||
}
|
||||
|
||||
public void setCustomInventoryName(String newName)
|
||||
{
|
||||
TileCobblegen.customName = newName;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -201,9 +198,6 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
this.processTime = tag.getShort("WorkTime");
|
||||
this.totalTime = tag.getShort("WorkTimeTotal");
|
||||
this.currentFuelBuffer = getFuelAmount(this.ItemStacks[1]);
|
||||
|
||||
if (tag.hasKey("CustomName", 8))
|
||||
this.customName = tag.getString("CustomName");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -226,9 +220,6 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
}
|
||||
|
||||
tag.setTag("Items", nbttaglist);
|
||||
|
||||
if (this.hasCustomName())
|
||||
tag.setString("CustomName", this.customName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -292,16 +283,14 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
|
||||
public static boolean isValid(ItemStack itemstack)
|
||||
{
|
||||
if (itemstack.getItem() == Items.lava_bucket)
|
||||
return true;
|
||||
return false;
|
||||
return FluidContainerRegistry.containsFluid(itemstack, new FluidStack(FluidRegistry.LAVA, 1000));
|
||||
|
||||
}
|
||||
|
||||
public void processItem()
|
||||
{
|
||||
if (this.canProcess())
|
||||
{
|
||||
|
||||
ItemStack input = ItemStacks[0];
|
||||
ItemStack output = new ItemStack(Blocks.cobblestone);
|
||||
ItemStack outputSlot = ItemStacks[2];
|
||||
|
|
@ -324,13 +313,7 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
|
||||
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;
|
||||
return FluidContainerRegistry.containsFluid(itemstack, new FluidStack(FluidRegistry.WATER, 1000));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -407,7 +390,7 @@ public class TileCobblegen extends TileEntityLockable implements ITickable, ISid
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return this.hasCustomName() ? TileCobblegen.customName : "container.cobblegen";
|
||||
return "container.cobblegen";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
package com.oitsjustjose.criss_cross.tileentity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.oitsjustjose.criss_cross.blocks.BlockWoodchipper;
|
||||
import com.oitsjustjose.criss_cross.container.ContainerWoodchipper;
|
||||
import com.oitsjustjose.criss_cross.lib.Config;
|
||||
|
|
@ -20,6 +18,9 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
|
|
@ -33,7 +34,6 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
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 ArrayList<ItemStack> fuelItems = new ArrayList<ItemStack>();
|
||||
private static String customName;
|
||||
private ItemStack[] ItemStacks = new ItemStack[3];
|
||||
public int fuelTime;
|
||||
|
|
@ -101,11 +101,6 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
this.markDirty();
|
||||
}
|
||||
|
||||
public static ArrayList<ItemStack> getFuels()
|
||||
{
|
||||
return fuelItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory()
|
||||
{
|
||||
|
|
@ -274,22 +269,6 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
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 isValidForWoodchipper(ItemStack itemstack)
|
||||
{
|
||||
if (WoodchipperRecipes.getInstance().getResult(itemstack) != null)
|
||||
|
|
@ -317,20 +296,14 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
|
||||
public static int getFuelAmount(ItemStack itemstack)
|
||||
{
|
||||
if(itemstack == null)
|
||||
if (itemstack == null)
|
||||
return 0;
|
||||
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;
|
||||
return FluidContainerRegistry.containsFluid(itemstack, new FluidStack(FluidRegistry.WATER, 1000));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -439,7 +412,7 @@ public class TileWoodchipper extends TileEntityLockable implements ITickable, IS
|
|||
{
|
||||
return direction != EnumFacing.DOWN || slot != 1;
|
||||
}
|
||||
|
||||
|
||||
IItemHandler handlerTop = new SidedInvWrapper(this, EnumFacing.UP);
|
||||
IItemHandler handlerBottom = new SidedInvWrapper(this, EnumFacing.DOWN);
|
||||
IItemHandler handlerSide = new SidedInvWrapper(this, EnumFacing.WEST);
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
Loading…
Reference in a new issue