diff --git a/src/main/java/com/github/vfyjxf/nee/client/NEEContainerDrawHandler.java b/src/main/java/com/github/vfyjxf/nee/client/NEEContainerDrawHandler.java index f6d7b88..ba8a84b 100644 --- a/src/main/java/com/github/vfyjxf/nee/client/NEEContainerDrawHandler.java +++ b/src/main/java/com/github/vfyjxf/nee/client/NEEContainerDrawHandler.java @@ -112,8 +112,8 @@ public class NEEContainerDrawHandler implements IContainerDrawHandler { } } else { overlayButtons = new ArrayList<>(); - GuiButton overlay1 = ReflectionHelper.getPrivateValue(GuiRecipe.class,guiRecipe,"overlay1"); - GuiButton overlay2 = ReflectionHelper.getPrivateValue(GuiRecipe.class,guiRecipe,"overlay2"); + GuiButton overlay1 = ReflectionHelper.getPrivateValue(GuiRecipe.class, guiRecipe, "overlay1"); + GuiButton overlay2 = ReflectionHelper.getPrivateValue(GuiRecipe.class, guiRecipe, "overlay2"); overlayButtons.add(overlay1); overlayButtons.add(overlay2); } @@ -180,8 +180,8 @@ public class NEEContainerDrawHandler implements IContainerDrawHandler { } } else { overlayButtons = new ArrayList<>(); - GuiButton overlay1 = ReflectionHelper.getPrivateValue(GuiRecipe.class,guiRecipe,"overlay1"); - GuiButton overlay2 = ReflectionHelper.getPrivateValue(GuiRecipe.class,guiRecipe,"overlay2"); + GuiButton overlay1 = ReflectionHelper.getPrivateValue(GuiRecipe.class, guiRecipe, "overlay1"); + GuiButton overlay2 = ReflectionHelper.getPrivateValue(GuiRecipe.class, guiRecipe, "overlay2"); overlayButtons.add(overlay1); overlayButtons.add(overlay2); } @@ -203,12 +203,12 @@ public class NEEContainerDrawHandler implements IContainerDrawHandler { List tooltips = new ArrayList<>(); boolean isCraftingTerm = guiRecipe.firstGui instanceof GuiCraftingTerm || GuiUtils.isGuiWirelessCrafting(guiRecipe.firstGui); if (isCraftingTerm) { - if(this.drawRequestTooltip) { + if (this.drawRequestTooltip) { tooltips.add(String.format("%s" + EnumChatFormatting.GRAY + " + " + EnumChatFormatting.BLUE + I18n.format("neenergistics.gui.tooltip.helper.crafting"), EnumChatFormatting.YELLOW + Keyboard.getKeyName(NEIClientConfig.getKeyBinding("nee.preview")))); } - if(this.drawMissingTooltip){ + if (this.drawMissingTooltip) { tooltips.add(EnumChatFormatting.RED + I18n.format("neenergistics.gui.tooltip.missing")); } } diff --git a/src/main/java/com/github/vfyjxf/nee/config/NEEConfig.java b/src/main/java/com/github/vfyjxf/nee/config/NEEConfig.java index 0cd31b3..6b5f10f 100644 --- a/src/main/java/com/github/vfyjxf/nee/config/NEEConfig.java +++ b/src/main/java/com/github/vfyjxf/nee/config/NEEConfig.java @@ -53,7 +53,7 @@ public class NEEConfig { allowSynchronousSwitchIngredient = config.get("client", "allowSynchronousSwitchIngredient", true, "If true, it will make all similar ingredient switch at the same time").getBoolean(true); - useStackSizeFromNEI = config.get("client","useStackSizeFromNEI",false, + useStackSizeFromNEI = config.get("client", "useStackSizeFromNEI", false, "Use the StackSize set by NEI").getBoolean(); draggedStackDefaultSize = config.get("client", "draggedStackDefaultSize", 1, @@ -80,7 +80,7 @@ public class NEEConfig { allowSynchronousSwitchIngredient = config.get("client", "allowSynchronousSwitchIngredient", true, "If true, it will make all similar ingredient switch at the same time").getBoolean(true); - useStackSizeFromNEI = config.get("client","useStackSizeFromNEI",false, + useStackSizeFromNEI = config.get("client", "useStackSizeFromNEI", false, "Use the StackSize set by NEI").getBoolean(); draggedStackDefaultSize = config.get("client", "draggedStackDefaultSize", 1, diff --git a/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingHandler.java b/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingHandler.java index 7407484..292e26a 100644 --- a/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingHandler.java +++ b/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingHandler.java @@ -17,7 +17,6 @@ import com.github.vfyjxf.nee.utils.ItemUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; import java.util.HashMap; @@ -32,6 +31,12 @@ public class NEECraftingHandler implements IOverlayHandler { public static final String OUTPUT_KEY = "Outputs"; public static Map ingredients = new HashMap<>(); + public static boolean isCraftingTableRecipe(IRecipeHandler recipe) { + TemplateRecipeHandler templateRecipeHandler = (TemplateRecipeHandler) recipe; + String overlayIdentifier = templateRecipeHandler.getOverlayIdentifier(); + return "crafting".equals(overlayIdentifier) || "crafting2x2".equals(overlayIdentifier); + } + @Override public void overlayRecipe(GuiContainer firstGui, IRecipeHandler recipe, int recipeIndex, boolean shift) { if (firstGui instanceof GuiPatternTerm || GuiUtils.isPatternTermExGui(firstGui)) { @@ -102,7 +107,7 @@ public class NEECraftingHandler implements IOverlayHandler { } //Fix ItemStack with wrong meta - if (currentStack.getItemDamage() == OreDictionary.WILDCARD_VALUE) { + if (currentStack.getItemDamage() == 32767) { currentStack.setItemDamage(0); } @@ -118,7 +123,7 @@ public class NEECraftingHandler implements IOverlayHandler { ItemStack outputStack = positionedStack.item.copy(); //Fix ItemStack with wrong meta(maybe ?) - if (outputStack.getItemDamage() == OreDictionary.WILDCARD_VALUE) { + if (outputStack.getItemDamage() == 32767) { outputStack.setItemDamage(0); } @@ -155,7 +160,7 @@ public class NEECraftingHandler implements IOverlayHandler { } //Fix ItemStack with wrong meta - if (stack.getItemDamage() == OreDictionary.WILDCARD_VALUE) { + if (stack.getItemDamage() == 32767) { stack.setItemDamage(0); } @@ -271,10 +276,4 @@ public class NEECraftingHandler implements IOverlayHandler { } } - public static boolean isCraftingTableRecipe(IRecipeHandler recipe) { - TemplateRecipeHandler templateRecipeHandler = (TemplateRecipeHandler) recipe; - String overlayIdentifier = templateRecipeHandler.getOverlayIdentifier(); - return "crafting".equals(overlayIdentifier) || "crafting2x2".equals(overlayIdentifier); - } - } diff --git a/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingHelper.java b/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingHelper.java index 7495187..f060669 100644 --- a/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingHelper.java +++ b/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingHelper.java @@ -48,12 +48,11 @@ import java.util.List; public class NEECraftingHelper implements IOverlayHandler { + public static final NEECraftingHelper INSTANCE = new NEECraftingHelper(); public static IngredientTracker tracker = null; public static int stackIndex = 1; public static boolean noPreview = false; - public static final NEECraftingHelper INSTANCE = new NEECraftingHelper(); - @Override public void overlayRecipe(GuiContainer firstGui, IRecipeHandler recipe, int recipeIndex, boolean shift) { boolean isCraftingGuiTerm = firstGui instanceof GuiCraftingTerm || GuiUtils.isGuiWirelessCrafting(firstGui); @@ -214,8 +213,8 @@ public class NEECraftingHelper implements IOverlayHandler { } if (!isGtnhNei) { overlayButtons = new ArrayList<>(); - GuiButton overlay1 = ReflectionHelper.getPrivateValue(GuiRecipe.class,guiRecipe,"overlay1"); - GuiButton overlay2 = ReflectionHelper.getPrivateValue(GuiRecipe.class,guiRecipe,"overlay2"); + GuiButton overlay1 = ReflectionHelper.getPrivateValue(GuiRecipe.class, guiRecipe, "overlay1"); + GuiButton overlay2 = ReflectionHelper.getPrivateValue(GuiRecipe.class, guiRecipe, "overlay2"); overlayButtons.add(overlay1); overlayButtons.add(overlay2); } diff --git a/src/main/java/com/github/vfyjxf/nee/network/packet/PacketArcaneRecipe.java b/src/main/java/com/github/vfyjxf/nee/network/packet/PacketArcaneRecipe.java index ff3331d..de1b22e 100644 --- a/src/main/java/com/github/vfyjxf/nee/network/packet/PacketArcaneRecipe.java +++ b/src/main/java/com/github/vfyjxf/nee/network/packet/PacketArcaneRecipe.java @@ -22,7 +22,8 @@ public class PacketArcaneRecipe implements IMessage, IMessageHandler= 0; + } + @Nonnull @Override public Set getAllOverlayIdentifier() { @@ -88,22 +106,4 @@ public class GregTech5RecipeProcessor implements IRecipeProcessor { return recipeOutputs; } - /** - * For resolving NoSuchMethodError - * Copied from GTNewHorizons/GT5-Unofficial. - */ - public static FluidStack getFluidFromDisplayStack(ItemStack aDisplayStack) { - if (!isStackValid(aDisplayStack) || - aDisplayStack.getItem() != ItemList.Display_Fluid.getItem() || - !aDisplayStack.hasTagCompound()) { - return null; - } - Fluid tFluid = FluidRegistry.getFluid(ItemList.Display_Fluid.getItem().getDamage(aDisplayStack)); - return new FluidStack(tFluid, (int) aDisplayStack.getTagCompound().getLong("mFluidDisplayAmount")); - } - - public static boolean isStackValid(Object aStack) { - return (aStack instanceof ItemStack) && ((ItemStack) aStack).getItem() != null && ((ItemStack) aStack).stackSize >= 0; - } - } diff --git a/src/main/java/com/github/vfyjxf/nee/processor/IRecipeProcessor.java b/src/main/java/com/github/vfyjxf/nee/processor/IRecipeProcessor.java index 76ada52..ead82f6 100644 --- a/src/main/java/com/github/vfyjxf/nee/processor/IRecipeProcessor.java +++ b/src/main/java/com/github/vfyjxf/nee/processor/IRecipeProcessor.java @@ -14,7 +14,7 @@ import java.util.Set; public interface IRecipeProcessor { @Nonnull - default Set getAllOverlayIdentifier(){ + default Set getAllOverlayIdentifier() { return Collections.emptySet(); } diff --git a/src/main/java/com/github/vfyjxf/nee/proxy/ServerProxy.java b/src/main/java/com/github/vfyjxf/nee/proxy/ServerProxy.java index 5ee77ea..ee54955 100644 --- a/src/main/java/com/github/vfyjxf/nee/proxy/ServerProxy.java +++ b/src/main/java/com/github/vfyjxf/nee/proxy/ServerProxy.java @@ -2,7 +2,7 @@ package com.github.vfyjxf.nee.proxy; import cpw.mods.fml.common.event.FMLInitializationEvent; -public class ServerProxy extends CommonProxy{ +public class ServerProxy extends CommonProxy { @Override public void init(FMLInitializationEvent event) { // NO-OP diff --git a/src/main/java/com/github/vfyjxf/nee/utils/Ingredient.java b/src/main/java/com/github/vfyjxf/nee/utils/Ingredient.java index ff0dbe9..f1e3ee4 100644 --- a/src/main/java/com/github/vfyjxf/nee/utils/Ingredient.java +++ b/src/main/java/com/github/vfyjxf/nee/utils/Ingredient.java @@ -5,9 +5,9 @@ import net.minecraft.item.ItemStack; public class Ingredient { - private PositionedStack ingredients; - private ItemStack craftableIngredient; private final long requireCount; + private final PositionedStack ingredients; + private ItemStack craftableIngredient; private long currentCount = 0; public Ingredient(PositionedStack ingredients) { @@ -15,10 +15,6 @@ public class Ingredient { this.requireCount = ingredients.items[0].stackSize; } - public void setCraftableIngredient(ItemStack craftableIngredient) { - this.craftableIngredient = craftableIngredient; - } - public PositionedStack getIngredients() { return ingredients; } @@ -27,7 +23,11 @@ public class Ingredient { return craftableIngredient; } - public long getMissingCount(){ + public void setCraftableIngredient(ItemStack craftableIngredient) { + this.craftableIngredient = craftableIngredient; + } + + public long getMissingCount() { return requireCount - currentCount; } @@ -35,15 +35,15 @@ public class Ingredient { return requireCount; } - public boolean isCraftable(){ + public boolean isCraftable() { return this.craftableIngredient != null; } - public boolean requiresToCraft(){ + public boolean requiresToCraft() { return this.getMissingCount() > 0; } - public void addCurrentCount(long count){ + public void addCurrentCount(long count) { currentCount += count; } diff --git a/src/main/java/com/github/vfyjxf/nee/utils/StackProcessor.java b/src/main/java/com/github/vfyjxf/nee/utils/StackProcessor.java index 58bb93f..cc8e717 100644 --- a/src/main/java/com/github/vfyjxf/nee/utils/StackProcessor.java +++ b/src/main/java/com/github/vfyjxf/nee/utils/StackProcessor.java @@ -13,23 +13,25 @@ public class StackProcessor { public String recipeProcessor; public String identifier; - public StackProcessor(String modid, String name, String meta, String nbt){ + public StackProcessor(String modid, String name, String meta, String nbt) { this.modid = modid; this.name = name; this.meta = meta; this.nbt = nbt; } - public StackProcessor(String modid, String name, String meta){ + + public StackProcessor(String modid, String name, String meta) { this.modid = modid; this.name = name; this.meta = meta; } - public StackProcessor(String modid, String name){ + + public StackProcessor(String modid, String name) { this.modid = modid; this.name = name; } - public StackProcessor(ItemStack itemStack, Item item, String recipeProcessor, String identifier){ + public StackProcessor(ItemStack itemStack, Item item, String recipeProcessor, String identifier) { this.itemStack = itemStack; this.item = item; this.recipeProcessor = recipeProcessor; diff --git a/src/main/resources/assets/neenergistics/lang/ru_RU.lang b/src/main/resources/assets/neenergistics/lang/ru_RU.lang new file mode 100644 index 0000000..ee5fc63 --- /dev/null +++ b/src/main/resources/assets/neenergistics/lang/ru_RU.lang @@ -0,0 +1,8 @@ +neenergistics.gui.tooltip.helper.crafting=Нажмите, чтобы запоросить отсутсвующие предметы +neenergistics.gui.tooltip.missing=Отсутствуют требуемые предметы +neenergistics.gui.tooltip.helper.pattern=Автокрафт доступен +nei.options.keys.nee=NotEnoughEnergistics +nei.options.keys.nee.count=Изменить кол-во +nei.options.keys.nee.ingredient=Выбрать ингредиент +nei.options.keys.nee.preview=Помощь по крафту +nei.options.keys.nee.nopreview=Помощь по крафту(без превью) \ No newline at end of file diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 8847af2..3e47525 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,14 +1,18 @@ -[{ - "modid": "${mod_id}", - "name": "${mod_name}", - "description": "${mod_description}", - "version": "${mod_version}", - "mcversion": "${mc_version}", - "url": "", - "updateUrl": "", - "authorList": ["${mod_author}"], - "credits": "${mod_credits}", - "logoFile":"${mod_logo}", - "screenshots": [], - "dependencies": [] -}] +[ + { + "modid": "${mod_id}", + "name": "${mod_name}", + "description": "${mod_description}", + "version": "${mod_version}", + "mcversion": "${mc_version}", + "url": "", + "updateUrl": "", + "authorList": [ + "${mod_author}" + ], + "credits": "${mod_credits}", + "logoFile": "${mod_logo}", + "screenshots": [], + "dependencies": [] + } +]