Perfected JEI plugins! :D

This commit is contained in:
oitsjustjose 2016-01-05 09:38:09 -06:00
commit b40af8eaa2
16 changed files with 35 additions and 27 deletions

View file

@ -4,6 +4,7 @@ import com.oitsjustjose.criss_cross.CrissCross;
import com.oitsjustjose.criss_cross.gui.GUIHandler;
import com.oitsjustjose.criss_cross.tileentity.TileAtmosManipulator;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
@ -17,7 +18,7 @@ public class BlockAtmosManipulator extends BlockMachineBase
private static String unlocName = "AtmosManipulator";
public BlockAtmosManipulator()
{
super(unlocName);
super(unlocName, Material.iron);
GameRegistry.registerTileEntity(TileAtmosManipulator.class, unlocName);
GameRegistry.registerBlock(this, unlocName.toLowerCase());
}

View file

@ -9,6 +9,7 @@ import com.oitsjustjose.criss_cross.tileentity.TileCobblegen;
import com.oitsjustjose.criss_cross.util.ClientProxy;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@ -29,7 +30,7 @@ public class BlockCobblegen extends BlockMachineBase
public BlockCobblegen()
{
super(unlocName);
super(unlocName, Material.iron);
GameRegistry.registerTileEntity(TileCobblegen.class, unlocName);
GameRegistry.registerBlock(this, unlocName.toLowerCase());
}

View file

@ -9,6 +9,7 @@ import com.oitsjustjose.criss_cross.tileentity.TileCropomator;
import com.oitsjustjose.criss_cross.util.ClientProxy;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@ -30,7 +31,7 @@ public class BlockCropomator extends BlockMachineBase
public BlockCropomator()
{
super(unlocName);
super(unlocName, Material.iron);
GameRegistry.registerTileEntity(TileCropomator.class, unlocName);
GameRegistry.registerBlock(this, unlocName.toLowerCase());
}

View file

@ -9,6 +9,7 @@ import com.oitsjustjose.criss_cross.tileentity.TileElectroextractor;
import com.oitsjustjose.criss_cross.util.ClientProxy;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@ -29,7 +30,7 @@ public class BlockElectroextractor extends BlockMachineBase
public BlockElectroextractor()
{
super(unlocName);
super(unlocName, Material.iron);
GameRegistry.registerTileEntity(TileElectroextractor.class, unlocName);
GameRegistry.registerBlock(this, unlocName.toLowerCase());
}

View file

@ -28,9 +28,9 @@ public class BlockMachineBase extends BlockContainer
private static String unlocalizedName;
private static boolean isActive = false;
public BlockMachineBase(String unlocName)
public BlockMachineBase(String unlocName, Material material)
{
super(Material.rock);
super(material);
this.setHardness(2.0F);
this.setResistance(2.0F);
this.setStepSound(soundTypeMetal);

View file

@ -6,6 +6,7 @@ import com.oitsjustjose.criss_cross.CrissCross;
import com.oitsjustjose.criss_cross.gui.GUIHandler;
import com.oitsjustjose.criss_cross.tileentity.TileScribe;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@ -25,7 +26,7 @@ public class BlockScribe extends BlockMachineBase
public BlockScribe()
{
super(unlocName);
super(unlocName, Material.iron);
GameRegistry.registerTileEntity(TileScribe.class, unlocName);
GameRegistry.registerBlock(this, unlocName.toLowerCase());
}

View file

@ -5,6 +5,7 @@ import com.oitsjustjose.criss_cross.gui.GUIHandler;
import com.oitsjustjose.criss_cross.tileentity.TileStonegen;
import com.oitsjustjose.criss_cross.util.ClientProxy;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.InventoryHelper;
@ -20,7 +21,7 @@ public class BlockStonegen extends BlockMachineBase
public BlockStonegen()
{
super(unlocName);
super(unlocName, Material.iron);
GameRegistry.registerTileEntity(TileStonegen.class, unlocName);
GameRegistry.registerBlock(this, unlocName.toLowerCase());
}

View file

@ -9,6 +9,7 @@ import com.oitsjustjose.criss_cross.tileentity.TileWoodchipper;
import com.oitsjustjose.criss_cross.util.ClientProxy;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@ -29,7 +30,7 @@ public class BlockWoodchipper extends BlockMachineBase
public BlockWoodchipper()
{
super(unlocName);
super(unlocName, Material.iron);
GameRegistry.registerTileEntity(TileWoodchipper.class, unlocName);
GameRegistry.registerBlock(this, unlocName.toLowerCase());
Lib.add(this);

View file

@ -15,7 +15,7 @@ public class ItemInfiniApple extends Item
this.setMaxStackSize(1);
this.setCreativeTab(CrissCross.CCTab);
this.setUnlocalizedName(Lib.MODID + ".infini_apple");
GameRegistry.registerItem(this, this.getUnlocalizedName());
GameRegistry.registerItem(this, "infiniapple");
MinecraftForge.EVENT_BUS.register(new InfiniAppleEvent());
Lib.add(this);
}

View file

@ -29,7 +29,7 @@ public class ItemMantleSmasher extends ItemPickaxe
this.setUnlocalizedName(Lib.MODID + ".mantle_smasher_" + material.name());
this.setCreativeTab(CrissCross.CCTab);
MinecraftForge.EVENT_BUS.register(new ToolEfficiencyEvent());
GameRegistry.registerItem(this, this.getUnlocalizedName());
GameRegistry.registerItem(this, "mantle_smasher_" + material.name());
Lib.add(this);
}

View file

@ -24,7 +24,7 @@ public class ItemPouch extends Item
this.setMaxStackSize(1);
this.setUnlocalizedName(Lib.MODID + ".pouch");
this.setCreativeTab(CrissCross.CCTab);
GameRegistry.registerItem(this, this.getUnlocalizedName());
GameRegistry.registerItem(this, "pouch");
MinecraftForge.EVENT_BUS.register(new PouchCleanEvent());
Lib.add(this);
}

View file

@ -23,7 +23,7 @@ public class CropomatorCategory implements IRecipeCategory
private static final int FUEL_SLOT = 2;
IDrawableStatic fuelDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUICropomator.backgroundTexture, 176, 0, 14, 14);
IDrawableStatic progressDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUICropomator.backgroundTexture, 176, 15, 24, 16);
IDrawableStatic progressDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUICropomator.backgroundTexture, 177, 14, 23, 16);
@Nonnull
private final IDrawable background = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUICropomator.backgroundTexture, 55, 16, 82, 54);
@ -65,7 +65,7 @@ public class CropomatorCategory implements IRecipeCategory
public void drawAnimations(Minecraft minecraft)
{
fuel.draw(minecraft, 1, 20);
progress.draw(minecraft, 25, 19);
progress.draw(minecraft, 25, 18);
}
@Override

View file

@ -2,13 +2,10 @@ package com.oitsjustjose.criss_cross.jei;
import javax.annotation.Nonnull;
import com.oitsjustjose.criss_cross.gui.GUICropomator;
import com.oitsjustjose.criss_cross.gui.GUIElectroextractor;
import com.oitsjustjose.criss_cross.gui.GUIElectroextractor;
import com.oitsjustjose.criss_cross.lib.Config;
import com.oitsjustjose.criss_cross.lib.Lib;
import com.oitsjustjose.criss_cross.tileentity.TileElectroextractor;
import com.sun.org.apache.bcel.internal.Constants;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IDrawableAnimated;
@ -17,7 +14,6 @@ import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
public class ElectroextractorCategory implements IRecipeCategory
@ -27,7 +23,7 @@ public class ElectroextractorCategory implements IRecipeCategory
private static final int FUEL_SLOT = 2;
IDrawableStatic fuelDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIElectroextractor.backgroundTexture, 176, 0, 14, 14);
IDrawableStatic progressDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIElectroextractor.backgroundTexture, 176, 15, 24, 16);
IDrawableStatic progressDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIElectroextractor.backgroundTexture, 177, 14, 23, 16);
@Nonnull
protected final IDrawableAnimated fuel = JEIPluginManager.jeiHelper.getGuiHelper().createAnimatedDrawable(fuelDrawable, Config.electroextractorProcessTime, IDrawableAnimated.StartDirection.TOP, true);
@ -69,7 +65,7 @@ public class ElectroextractorCategory implements IRecipeCategory
public void drawAnimations(Minecraft minecraft)
{
fuel.draw(minecraft, 1, 20);
progress.draw(minecraft, 25, 19);
progress.draw(minecraft, 25, 18);
}
@Override

View file

@ -1,13 +1,15 @@
package com.oitsjustjose.criss_cross.jei;
import java.util.List;
import javax.annotation.Nonnull;
import com.oitsjustjose.criss_cross.gui.GUICropomator;
import com.oitsjustjose.criss_cross.gui.GUIScribe;
import com.oitsjustjose.criss_cross.lib.Config;
import com.oitsjustjose.criss_cross.lib.Lib;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
@ -22,9 +24,13 @@ public class ScribeCategory implements IRecipeCategory
private static final int OUTPUT_SLOT = 1;
private static final int FUEL_SLOT = 2;
IDrawableStatic progressDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIScribe.backgroundTexture, 176, 14, 24, 17);
@Nonnull
private final IDrawable background = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIScribe.backgroundTexture, 33, 30, 110, 34);
@Nonnull
protected final IDrawableAnimated progress = JEIPluginManager.jeiHelper.getGuiHelper().createAnimatedDrawable(progressDrawable, 200, IDrawableAnimated.StartDirection.LEFT, false);
@Nonnull
private final String localizedName = StatCollector.translateToLocal("recipe.scribe");
@Nonnull
@ -57,7 +63,7 @@ public class ScribeCategory implements IRecipeCategory
@Override
public void drawAnimations(Minecraft minecraft)
{
progress.draw(minecraft, 56, 5);
}
@Override

View file

@ -26,7 +26,7 @@ public class WoodchipperCategory implements IRecipeCategory
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, 176, 15, 24, 16);
IDrawableStatic progressDrawable = JEIPluginManager.jeiHelper.getGuiHelper().createDrawable(GUIWoodchipper.backgroundTexture, 177, 14, 23, 16);
@Nonnull
protected final IDrawableAnimated fuel = JEIPluginManager.jeiHelper.getGuiHelper().createAnimatedDrawable(fuelDrawable, Config.woodchipperProcessTime, IDrawableAnimated.StartDirection.TOP, true);
@ -68,7 +68,7 @@ public class WoodchipperCategory implements IRecipeCategory
public void drawAnimations(Minecraft minecraft)
{
fuel.draw(minecraft, 1, 20);
progress.draw(minecraft, 25, 19);
progress.draw(minecraft, 25, 18);
}
@Override

View file

@ -20,8 +20,7 @@ public class LibItems
public static Item pouch;
public static Item mantleSmasherMkI;
public static Item mantleSmasherMkII;
public static Item timer;
public static ToolMaterial mkI;
public static ToolMaterial mkII;