This is way better naming

This commit is contained in:
Ellpeck 2015-11-27 15:22:44 +01:00
parent 25401df669
commit 117fc49a15
12 changed files with 62 additions and 62 deletions

View file

@ -12,7 +12,7 @@ package ellpeck.actuallyadditions.event;
import cpw.mods.fml.common.Loader;
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
import ellpeck.actuallyadditions.nei.NeiScreenEvents;
import ellpeck.actuallyadditions.nei.NEIScreenEvents;
import ellpeck.actuallyadditions.update.UpdateCheckerClientNotificationEvent;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.Util;
@ -36,7 +36,7 @@ public class InitEvents{
Util.registerEvent(new TooltipEvent());
if(Loader.isModLoaded("NotEnoughItems")){
Util.registerEvent(new NeiScreenEvents());
Util.registerEvent(new NEIScreenEvents());
}
if(ConfigBoolValues.DO_UPDATE_CHECK.isEnabled()){

View file

@ -12,7 +12,7 @@ package ellpeck.actuallyadditions.nei;
import net.minecraft.item.ItemStack;
public interface INeiRecipeHandler{
public interface INEIRecipeHandler{
ItemStack getStackForInfo(int page);
}

View file

@ -28,41 +28,41 @@ public class NEIActuallyAdditionsConfig implements IConfigureNEI{
API.registerGuiOverlay(GuiCrafter.class, "crafting");
API.registerGuiOverlayHandler(GuiCrafter.class, new DefaultOverlayHandler(), "crafting");
CrusherRecipeHandler crusherRecipeHandler = new CrusherRecipeHandler();
API.registerRecipeHandler(crusherRecipeHandler);
API.registerUsageHandler(crusherRecipeHandler);
NEICrusherRecipe crusherRecipe = new NEICrusherRecipe();
API.registerRecipeHandler(crusherRecipe);
API.registerUsageHandler(crusherRecipe);
CrusherRecipeHandler.CrusherDoubleRecipeHandler crusherDoubleRecipeHandler = new CrusherRecipeHandler.CrusherDoubleRecipeHandler();
API.registerRecipeHandler(crusherDoubleRecipeHandler);
API.registerUsageHandler(crusherDoubleRecipeHandler);
NEICrusherRecipe.Double crusherDoubleRecipe = new NEICrusherRecipe.Double();
API.registerRecipeHandler(crusherDoubleRecipe);
API.registerUsageHandler(crusherDoubleRecipe);
FurnaceDoubleRecipeHandler furnaceDoubleRecipeHandler = new FurnaceDoubleRecipeHandler();
API.registerRecipeHandler(furnaceDoubleRecipeHandler);
API.registerUsageHandler(furnaceDoubleRecipeHandler);
NEIFurnaceDoubleRecipe furnaceDoubleRecipe = new NEIFurnaceDoubleRecipe();
API.registerRecipeHandler(furnaceDoubleRecipe);
API.registerUsageHandler(furnaceDoubleRecipe);
HairyBallRecipeHandler ballRecipeHandler = new HairyBallRecipeHandler();
API.registerRecipeHandler(ballRecipeHandler);
API.registerUsageHandler(ballRecipeHandler);
NEIHairyBallRecipe ballRecipe = new NEIHairyBallRecipe();
API.registerRecipeHandler(ballRecipe);
API.registerUsageHandler(ballRecipe);
TreasureChestRecipeHandler treasureRecipeHandler = new TreasureChestRecipeHandler();
API.registerRecipeHandler(treasureRecipeHandler);
API.registerUsageHandler(treasureRecipeHandler);
NEITreasureChestRecipe treasureChestRecipe = new NEITreasureChestRecipe();
API.registerRecipeHandler(treasureChestRecipe);
API.registerUsageHandler(treasureChestRecipe);
CompostRecipeHandler compostRecipeHandler = new CompostRecipeHandler();
API.registerRecipeHandler(compostRecipeHandler);
API.registerUsageHandler(compostRecipeHandler);
NEICompostRecipe compostRecipe = new NEICompostRecipe();
API.registerRecipeHandler(compostRecipe);
API.registerUsageHandler(compostRecipe);
CoffeeMachineRecipeHandler coffeeMachineRecipeHandler = new CoffeeMachineRecipeHandler();
API.registerRecipeHandler(coffeeMachineRecipeHandler);
API.registerUsageHandler(coffeeMachineRecipeHandler);
NEICoffeeMachineRecipe coffeeMachineRecipe = new NEICoffeeMachineRecipe();
API.registerRecipeHandler(coffeeMachineRecipe);
API.registerUsageHandler(coffeeMachineRecipe);
AtomicReconstructorRecipeHandler atomicReconstructorRecipeHandler = new AtomicReconstructorRecipeHandler();
API.registerRecipeHandler(atomicReconstructorRecipeHandler);
API.registerUsageHandler(atomicReconstructorRecipeHandler);
NEIReconstructorRecipe reconstructorRecipe = new NEIReconstructorRecipe();
API.registerRecipeHandler(reconstructorRecipe);
API.registerUsageHandler(reconstructorRecipe);
BookletInfoRecipeHandler bookletInfoRecipeHandler = new BookletInfoRecipeHandler();
API.registerRecipeHandler(bookletInfoRecipeHandler);
API.registerUsageHandler(bookletInfoRecipeHandler);
NEIBookletRecipe bookletRecipe = new NEIBookletRecipe();
API.registerRecipeHandler(bookletRecipe);
API.registerUsageHandler(bookletRecipe);
API.hideItem(new ItemStack(InitBlocks.blockRice));
API.hideItem(new ItemStack(InitBlocks.blockCanola));

View file

@ -30,11 +30,11 @@ import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.util.List;
public class BookletInfoRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{
public class NEIBookletRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.booklet";
public BookletInfoRecipeHandler(){
public NEIBookletRecipe(){
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
}
@ -51,7 +51,7 @@ public class BookletInfoRecipeHandler extends TemplateRecipeHandler implements I
@SuppressWarnings("unchecked")
@Override
public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == BookletInfoRecipeHandler.class){
if(outputId.equals(NAME) && getClass() == NEIBookletRecipe.class){
for(BookletPage page : InitBooklet.pagesWithItemStackData){
for(ItemStack stack : page.getItemStacksForPage()){
arecipes.add(new CachedInfoStack(stack));

View file

@ -32,11 +32,11 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{
public class NEICoffeeMachineRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.coffee";
public CoffeeMachineRecipeHandler(){
public NEICoffeeMachineRecipe(){
super();
RecipeInfo.setGuiOffset(this.getGuiClass(), 35, 3);
}
@ -54,7 +54,7 @@ public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler implements
@Override
public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == CoffeeMachineRecipeHandler.class){
if(outputId.equals(NAME) && getClass() == NEICoffeeMachineRecipe.class){
ArrayList<ItemCoffee.Ingredient> ingredients = ItemCoffee.ingredients;
for(ItemCoffee.Ingredient ingredient : ingredients){
arecipes.add(new CachedCoffee(ingredient));

View file

@ -28,11 +28,11 @@ import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.util.Collections;
public class CompostRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{
public class NEICompostRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.compost";
public CompostRecipeHandler(){
public NEICompostRecipe(){
super();
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
}
@ -54,7 +54,7 @@ public class CompostRecipeHandler extends TemplateRecipeHandler implements INeiR
@Override
public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == CompostRecipeHandler.class){
if(outputId.equals(NAME) && getClass() == NEICompostRecipe.class){
arecipes.add(new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, ConfigIntValues.COMPOST_AMOUNT.getValue(), TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, ConfigIntValues.COMPOST_AMOUNT.getValue())));
}
else{

View file

@ -29,9 +29,9 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class CrusherRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{
public class NEICrusherRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public CrusherRecipeHandler(){
public NEICrusherRecipe(){
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
}
@ -47,7 +47,7 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler implements INeiR
@Override
public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(this.getName()) && (getClass() == CrusherRecipeHandler.class || getClass() == CrusherDoubleRecipeHandler.class)){
if(outputId.equals(this.getName()) && (getClass() == NEICrusherRecipe.class || getClass() == Double.class)){
for(CrusherRecipeRegistry.CrusherRecipe recipe : CrusherRecipeRegistry.recipes){
arecipes.add(new CachedCrush(recipe.getRecipeInputs(), recipe.getRecipeOutputOnes(), recipe.getRecipeOutputTwos(), recipe.outputTwoChance, this));
}
@ -120,7 +120,7 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler implements INeiR
}
protected String getName(){
return "actuallyadditions."+(this instanceof CrusherDoubleRecipeHandler ? "crushingDouble" : "crushing");
return "actuallyadditions."+(this instanceof Double ? "crushingDouble" : "crushing");
}
@Override
@ -128,7 +128,7 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler implements INeiR
return StringUtil.localize("container.nei."+this.getName()+".name");
}
public static class CrusherDoubleRecipeHandler extends CrusherRecipeHandler{
public static class Double extends NEICrusherRecipe{
@Override
public ItemStack getStackForInfo(int page){
@ -172,8 +172,8 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler implements INeiR
public PositionedStack resultTwo;
public int secondChance;
public CachedCrush(List<ItemStack> in, List<ItemStack> outOne, List<ItemStack> outTwo, int secondChance, CrusherRecipeHandler handler){
boolean isDouble = handler instanceof CrusherDoubleRecipeHandler;
public CachedCrush(List<ItemStack> in, List<ItemStack> outOne, List<ItemStack> outTwo, int secondChance, NEICrusherRecipe handler){
boolean isDouble = handler instanceof Double;
this.ingredient = new PositionedStack(in, isDouble ? 51 : 80, 21);
this.resultOne = new PositionedStack(outOne, isDouble ? 38 : 66, 69);
if(outTwo != null && !outTwo.isEmpty()){

View file

@ -29,11 +29,11 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
public class FurnaceDoubleRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{
public class NEIFurnaceDoubleRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.furnaceDouble";
public FurnaceDoubleRecipeHandler(){
public NEIFurnaceDoubleRecipe(){
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
}
@ -51,7 +51,7 @@ public class FurnaceDoubleRecipeHandler extends TemplateRecipeHandler implements
@SuppressWarnings("unchecked")
@Override
public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == FurnaceDoubleRecipeHandler.class){
if(outputId.equals(NAME) && getClass() == NEIFurnaceDoubleRecipe.class){
Map<ItemStack, ItemStack> recipes = (Map<ItemStack, ItemStack>)FurnaceRecipes.smelting().getSmeltingList();
for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()){
arecipes.add(new CachedFurn(recipe.getKey(), recipe.getValue()));

View file

@ -27,11 +27,11 @@ import java.awt.*;
import java.util.ArrayList;
import java.util.Collections;
public class HairyBallRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{
public class NEIHairyBallRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.ballOfHair";
public HairyBallRecipeHandler(){
public NEIHairyBallRecipe(){
super();
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
}
@ -53,7 +53,7 @@ public class HairyBallRecipeHandler extends TemplateRecipeHandler implements INe
@Override
public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == HairyBallRecipeHandler.class){
if(outputId.equals(NAME) && getClass() == NEIHairyBallRecipe.class){
ArrayList<HairyBallHandler.Return> recipes = HairyBallHandler.returns;
for(HairyBallHandler.Return recipe : recipes){
arecipes.add(new CachedBallRecipe(recipe.inputItem, recipe.returnItem, recipe.itemWeight));

View file

@ -31,11 +31,11 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{
public class NEIReconstructorRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.reconstructor";
public AtomicReconstructorRecipeHandler(){
public NEIReconstructorRecipe(){
super();
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
}
@ -57,7 +57,7 @@ public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler impl
@Override
public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == AtomicReconstructorRecipeHandler.class){
if(outputId.equals(NAME) && getClass() == NEIReconstructorRecipe.class){
ArrayList<ReconstructorRecipeHandler.Recipe> recipes = ReconstructorRecipeHandler.recipes;
for(ReconstructorRecipeHandler.Recipe recipe : recipes){
arecipes.add(new CachedReconstructorRecipe(recipe.input, recipe.output, recipe.type.lens));

View file

@ -27,11 +27,11 @@ import java.awt.*;
import java.util.ArrayList;
import java.util.Collections;
public class TreasureChestRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{
public class NEITreasureChestRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.treasureChest";
public TreasureChestRecipeHandler(){
public NEITreasureChestRecipe(){
super();
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
}
@ -53,7 +53,7 @@ public class TreasureChestRecipeHandler extends TemplateRecipeHandler implements
@Override
public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == TreasureChestRecipeHandler.class){
if(outputId.equals(NAME) && getClass() == NEITreasureChestRecipe.class){
ArrayList<TreasureChestHandler.Return> recipes = TreasureChestHandler.returns;
for(TreasureChestHandler.Return recipe : recipes){
arecipes.add(new CachedTreasure(recipe.input, recipe.returnItem, recipe.itemWeight, recipe.minAmount, recipe.maxAmount));

View file

@ -23,7 +23,7 @@ import ellpeck.actuallyadditions.util.StringUtil;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.event.GuiScreenEvent;
public class NeiScreenEvents{
public class NEIScreenEvents{
private static final int NEI_BUTTON_ID = 123782;
private BookletUtils.TexturedButton neiButton;
@ -52,7 +52,7 @@ public class NeiScreenEvents{
event.buttonList.add(this.neiButton);
IRecipeHandler handler = theGui.getCurrentRecipeHandlers().get(theGui.recipetype);
this.neiButton.visible = handler instanceof INeiRecipeHandler && ((INeiRecipeHandler)handler).getStackForInfo(theGui.page) != null;
this.neiButton.visible = handler instanceof INEIRecipeHandler && ((INEIRecipeHandler)handler).getStackForInfo(theGui.page) != null;
}
}
@ -62,12 +62,12 @@ public class NeiScreenEvents{
GuiRecipe theGui = (GuiRecipe)event.gui;
IRecipeHandler handler = theGui.getCurrentRecipeHandlers().get(theGui.recipetype);
boolean isPage = handler instanceof INeiRecipeHandler && ((INeiRecipeHandler)handler).getStackForInfo(theGui.page) != null;
boolean isPage = handler instanceof INEIRecipeHandler && ((INEIRecipeHandler)handler).getStackForInfo(theGui.page) != null;
this.neiButton.visible = isPage;
if(isPage && event.button.id == NEI_BUTTON_ID){
for(BookletPage page : InitBooklet.pagesWithItemStackData){
if(ItemUtil.contains(page.getItemStacksForPage(), ((INeiRecipeHandler)handler).getStackForInfo(theGui.page), true)){
if(ItemUtil.contains(page.getItemStacksForPage(), ((INEIRecipeHandler)handler).getStackForInfo(theGui.page), true)){
GuiBooklet book = new GuiBooklet(Minecraft.getMinecraft().currentScreen, false, true);
Minecraft.getMinecraft().displayGuiScreen(book);
BookletUtils.openIndexEntry(book, page.getChapter().entry, InitBooklet.entries.indexOf(page.getChapter().entry)/GuiBooklet.CHAPTER_BUTTONS_AMOUNT+1, true);