diff options
| author | GWYOG <jjn1jjn2@163.com> | 2016-11-06 14:34:17 +0800 |
|---|---|---|
| committer | GWYOG <jjn1jjn2@163.com> | 2016-11-06 14:34:17 +0800 |
| commit | 10f86d028093566285f9500da84961c86c8552a1 (patch) | |
| tree | bad9802537ed61f77185429b37b9ddfde71f395f /src/main/java/pers | |
| parent | 980f64738347a74416187001c53b5544960949a3 (diff) | |
| download | GT5-Unofficial-10f86d028093566285f9500da84961c86c8552a1.tar.gz GT5-Unofficial-10f86d028093566285f9500da84961c86c8552a1.tar.bz2 GT5-Unofficial-10f86d028093566285f9500da84961c86c8552a1.zip | |
Change code formatter - change tab to 4 spaces
Diffstat (limited to 'src/main/java/pers')
8 files changed, 600 insertions, 600 deletions
diff --git a/src/main/java/pers/gwyog/gtneioreplugin/GTNEIOrePlugin.java b/src/main/java/pers/gwyog/gtneioreplugin/GTNEIOrePlugin.java index 09e2a99e7c..37ba99addf 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/GTNEIOrePlugin.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/GTNEIOrePlugin.java @@ -15,19 +15,19 @@ import pers.gwyog.gtneioreplugin.util.GTSmallOreHelper; @Mod(modid = GTNEIOrePlugin.MODID, name = GTNEIOrePlugin.NAME, version = GTNEIOrePlugin.VERSION, dependencies = "required-after:gregtech;required-after:NotEnoughItems") public class GTNEIOrePlugin { - public static final String MODID = "gtneioreplugin"; - public static final String NAME = "GT NEI Ore Plugin"; - public static final String VERSION = "1.0.1"; - + public static final String MODID = "gtneioreplugin"; + public static final String NAME = "GT NEI Ore Plugin"; + public static final String VERSION = "1.0.1"; + @Mod.Instance(MODID) public static GTNEIOrePlugin instance; @EventHandler - public void onLoadComplete(FMLLoadCompleteEvent event) { - if (event.getSide() == Side.CLIENT) { - new GTOreLayerHelper(); - new GTSmallOreHelper(); - } - } + public void onLoadComplete(FMLLoadCompleteEvent event) { + if (event.getSide() == Side.CLIENT) { + new GTOreLayerHelper(); + new GTSmallOreHelper(); + } + } } diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/NEIPluginConfig.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/NEIPluginConfig.java index a4813c746b..0f1b0210b5 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/NEIPluginConfig.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/NEIPluginConfig.java @@ -6,27 +6,27 @@ import pers.gwyog.gtneioreplugin.GTNEIOrePlugin; public class NEIPluginConfig implements IConfigureNEI { - @Override - public String getName() { - return "GregTech Ore Plugin"; - } + @Override + public String getName() { + return "GregTech Ore Plugin"; + } - @Override - public String getVersion() { - return GTNEIOrePlugin.VERSION; - } + @Override + public String getVersion() { + return GTNEIOrePlugin.VERSION; + } - @Override - public void loadConfig() { - PluginVeinStat pluginVeinStat = new PluginVeinStat(); - PluginAsteroidStat pluginAsteriodStat = new PluginAsteroidStat(); - PluginSmallOreStat pluginSmallOreStat = new PluginSmallOreStat(); + @Override + public void loadConfig() { + PluginVeinStat pluginVeinStat = new PluginVeinStat(); + PluginAsteroidStat pluginAsteriodStat = new PluginAsteroidStat(); + PluginSmallOreStat pluginSmallOreStat = new PluginSmallOreStat(); API.registerRecipeHandler(pluginVeinStat); API.registerUsageHandler(pluginVeinStat); API.registerRecipeHandler(pluginAsteriodStat); API.registerUsageHandler(pluginAsteriodStat); API.registerRecipeHandler(pluginSmallOreStat); API.registerUsageHandler(pluginSmallOreStat); - } + } } diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginAsteroidStat.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginAsteroidStat.java index 027d4fa035..acc00c01ef 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginAsteroidStat.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginAsteroidStat.java @@ -19,117 +19,117 @@ import pers.gwyog.gtneioreplugin.util.GTOreLayerHelper.OreLayerWrapper; public class PluginAsteroidStat extends PluginBase { - public class CachedAsteroidStatRecipe extends CachedRecipe { - public String veinName; - public PositionedStack positionedStackPrimary; - public PositionedStack positionedStackSecondary; - public PositionedStack positionedStackBetween; - public PositionedStack positionedStackSporadic; - - public CachedAsteroidStatRecipe(String veinName, ItemStack stackListPrimary, ItemStack stackListSecondary, - ItemStack stackListBetween, ItemStack stackListSporadic) { - this.veinName = veinName; - positionedStackPrimary = new PositionedStack(stackListPrimary, 2, 0); - positionedStackSecondary = new PositionedStack(stackListSecondary, 22, 0); - positionedStackBetween = new PositionedStack(stackListBetween, 42, 0); - positionedStackSporadic = new PositionedStack(stackListSporadic, 62, 0); - } - - @Override - public List<PositionedStack> getIngredients() { - List<PositionedStack> ingredientsList = new ArrayList<PositionedStack>(); - ingredientsList.add(positionedStackPrimary); - ingredientsList.add(positionedStackSecondary); - ingredientsList.add(positionedStackBetween); - ingredientsList.add(positionedStackSporadic); - return ingredientsList; - } - - @Override - public PositionedStack getResult() { - return null; - } - - } - - @Override - public void drawExtras(int recipe) { - CachedAsteroidStatRecipe crecipe = (CachedAsteroidStatRecipe) this.arecipes.get(recipe); - OreLayerWrapper oreLayer = GTOreLayerHelper.mapOreLayerWrapper.get(crecipe.veinName); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + I18n.format("gtnop." + oreLayer.veinName) + I18n.format("gtnop.ore.asteroid.name"), 2, 18, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidPrimary") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.primaryMeta)), 2, 31, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidSecondary") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.secondaryMeta)), 2, 44, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidBetween") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.betweenMeta)), 2, 57, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidSporadic") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.sporadicMeta)), 2, 70, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.worldNames") + ": " + getWorldNameTranslated(oreLayer.genEndAsteroid, oreLayer.genGCAsteroid), 2, 83, 0x404040, false); - GuiDraw.drawStringR(EnumChatFormatting.BOLD + I18n.format("gtnop.gui.nei.seeAll"), getGuiWidth()-3, 5, 0x404040, false); - } - - public String getWorldNameTranslated(boolean genEndAsteroid, boolean genGCAsteroid) { - String worldNameTranslatedAsteroid = ""; - if (genEndAsteroid) { - if (!worldNameTranslatedAsteroid.isEmpty()) - worldNameTranslatedAsteroid += ", "; - worldNameTranslatedAsteroid += I18n.format("gtnop.world.end.name"); - } - if (genGCAsteroid) { - if (!worldNameTranslatedAsteroid.isEmpty()) - worldNameTranslatedAsteroid += ", "; - worldNameTranslatedAsteroid += I18n.format("gtnop.world.asteroid.name"); - } - return worldNameTranslatedAsteroid; - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results) { - if (outputId.equals(getOutputId())) { - OreLayerWrapper oreLayerWrapper; - for (String veinName: GTOreLayerHelper.mapOreLayerWrapper.keySet()) { - oreLayerWrapper = GTOreLayerHelper.mapOreLayerWrapper.get(veinName); - if (oreLayerWrapper.genEndAsteroid || oreLayerWrapper.genGCAsteroid) { - ItemStack stackPrimary = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.primaryMeta+2000); - ItemStack stackSecondary = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.secondaryMeta+2000); - ItemStack stackBetween = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.betweenMeta+2000); - ItemStack stackSporadic = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.sporadicMeta+2000); - this.arecipes.add(new CachedAsteroidStatRecipe(veinName, stackPrimary, stackSecondary, stackBetween, stackSporadic)); - } - } - } - else - super.loadCraftingRecipes(outputId, results); - } - - @Override - public void loadCraftingRecipes(ItemStack stack) { - if (stack.getUnlocalizedName().startsWith("gt.blockores")) { - if (stack.getItemDamage()>16000) { - super.loadCraftingRecipes(stack); - return; - } - short baseMeta = (short)(stack.getItemDamage() % 1000); - for (OreLayerWrapper worldGen: GTOreLayerHelper.mapOreLayerWrapper.values()) { - if (worldGen.primaryMeta == baseMeta || worldGen.secondaryMeta == baseMeta || worldGen.betweenMeta == baseMeta || worldGen.sporadicMeta == baseMeta) { - if (worldGen.genEndAsteroid || worldGen.genGCAsteroid) { - ItemStack stackPrimary = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.primaryMeta+2000); - ItemStack stackSecondary = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.secondaryMeta+2000); - ItemStack stackBetween = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.betweenMeta+2000); - ItemStack stackSporadic = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.sporadicMeta+2000); - this.arecipes.add(new CachedAsteroidStatRecipe(worldGen.veinName, stackPrimary, stackSecondary, stackBetween, stackSporadic)); - } - } - } - } - else - super.loadCraftingRecipes(stack); - } - - @Override - public String getOutputId() { - return "GTOrePluginAsteroid"; - } - - @Override - public String getRecipeName() { - return I18n.format("gtnop.gui.asteroidStat.name"); - } + public class CachedAsteroidStatRecipe extends CachedRecipe { + public String veinName; + public PositionedStack positionedStackPrimary; + public PositionedStack positionedStackSecondary; + public PositionedStack positionedStackBetween; + public PositionedStack positionedStackSporadic; + + public CachedAsteroidStatRecipe(String veinName, ItemStack stackListPrimary, ItemStack stackListSecondary, + ItemStack stackListBetween, ItemStack stackListSporadic) { + this.veinName = veinName; + positionedStackPrimary = new PositionedStack(stackListPrimary, 2, 0); + positionedStackSecondary = new PositionedStack(stackListSecondary, 22, 0); + positionedStackBetween = new PositionedStack(stackListBetween, 42, 0); + positionedStackSporadic = new PositionedStack(stackListSporadic, 62, 0); + } + + @Override + public List<PositionedStack> getIngredients() { + List<PositionedStack> ingredientsList = new ArrayList<PositionedStack>(); + ingredientsList.add(positionedStackPrimary); + ingredientsList.add(positionedStackSecondary); + ingredientsList.add(positionedStackBetween); + ingredientsList.add(positionedStackSporadic); + return ingredientsList; + } + + @Override + public PositionedStack getResult() { + return null; + } + + } + + @Override + public void drawExtras(int recipe) { + CachedAsteroidStatRecipe crecipe = (CachedAsteroidStatRecipe) this.arecipes.get(recipe); + OreLayerWrapper oreLayer = GTOreLayerHelper.mapOreLayerWrapper.get(crecipe.veinName); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + I18n.format("gtnop." + oreLayer.veinName) + I18n.format("gtnop.ore.asteroid.name"), 2, 18, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidPrimary") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.primaryMeta)), 2, 31, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidSecondary") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.secondaryMeta)), 2, 44, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidBetween") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.betweenMeta)), 2, 57, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidSporadic") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.sporadicMeta)), 2, 70, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.worldNames") + ": " + getWorldNameTranslated(oreLayer.genEndAsteroid, oreLayer.genGCAsteroid), 2, 83, 0x404040, false); + GuiDraw.drawStringR(EnumChatFormatting.BOLD + I18n.format("gtnop.gui.nei.seeAll"), getGuiWidth()-3, 5, 0x404040, false); + } + + public String getWorldNameTranslated(boolean genEndAsteroid, boolean genGCAsteroid) { + String worldNameTranslatedAsteroid = ""; + if (genEndAsteroid) { + if (!worldNameTranslatedAsteroid.isEmpty()) + worldNameTranslatedAsteroid += ", "; + worldNameTranslatedAsteroid += I18n.format("gtnop.world.end.name"); + } + if (genGCAsteroid) { + if (!worldNameTranslatedAsteroid.isEmpty()) + worldNameTranslatedAsteroid += ", "; + worldNameTranslatedAsteroid += I18n.format("gtnop.world.asteroid.name"); + } + return worldNameTranslatedAsteroid; + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals(getOutputId())) { + OreLayerWrapper oreLayerWrapper; + for (String veinName: GTOreLayerHelper.mapOreLayerWrapper.keySet()) { + oreLayerWrapper = GTOreLayerHelper.mapOreLayerWrapper.get(veinName); + if (oreLayerWrapper.genEndAsteroid || oreLayerWrapper.genGCAsteroid) { + ItemStack stackPrimary = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.primaryMeta+2000); + ItemStack stackSecondary = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.secondaryMeta+2000); + ItemStack stackBetween = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.betweenMeta+2000); + ItemStack stackSporadic = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.sporadicMeta+2000); + this.arecipes.add(new CachedAsteroidStatRecipe(veinName, stackPrimary, stackSecondary, stackBetween, stackSporadic)); + } + } + } + else + super.loadCraftingRecipes(outputId, results); + } + + @Override + public void loadCraftingRecipes(ItemStack stack) { + if (stack.getUnlocalizedName().startsWith("gt.blockores")) { + if (stack.getItemDamage()>16000) { + super.loadCraftingRecipes(stack); + return; + } + short baseMeta = (short)(stack.getItemDamage() % 1000); + for (OreLayerWrapper worldGen: GTOreLayerHelper.mapOreLayerWrapper.values()) { + if (worldGen.primaryMeta == baseMeta || worldGen.secondaryMeta == baseMeta || worldGen.betweenMeta == baseMeta || worldGen.sporadicMeta == baseMeta) { + if (worldGen.genEndAsteroid || worldGen.genGCAsteroid) { + ItemStack stackPrimary = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.primaryMeta+2000); + ItemStack stackSecondary = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.secondaryMeta+2000); + ItemStack stackBetween = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.betweenMeta+2000); + ItemStack stackSporadic = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.sporadicMeta+2000); + this.arecipes.add(new CachedAsteroidStatRecipe(worldGen.veinName, stackPrimary, stackSecondary, stackBetween, stackSporadic)); + } + } + } + } + else + super.loadCraftingRecipes(stack); + } + + @Override + public String getOutputId() { + return "GTOrePluginAsteroid"; + } + + @Override + public String getRecipeName() { + return I18n.format("gtnop.gui.asteroidStat.name"); + } } diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginBase.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginBase.java index 0fbe12a597..33102a8248 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginBase.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginBase.java @@ -11,85 +11,85 @@ import net.minecraft.util.EnumChatFormatting; public class PluginBase extends TemplateRecipeHandler { - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - return null; - } + @Override + public int recipiesPerPage() { + return 1; + } + + @Override + public String getRecipeName() { + return null; + } - @Override - public String getGuiTexture() { - return "gtneioreplugin:textures/gui/nei/guiBase.png"; - } - + @Override + public String getGuiTexture() { + return "gtneioreplugin:textures/gui/nei/guiBase.png"; + } + @Override public void loadTransferRects() { - int stringLength = GuiDraw.getStringWidth(EnumChatFormatting.BOLD + I18n.format("gui.nei.seeAll")); - transferRects.add(new RecipeTransferRect(new Rectangle(getGuiWidth()-stringLength-3, 5, stringLength, 9), getOutputId())); + int stringLength = GuiDraw.getStringWidth(EnumChatFormatting.BOLD + I18n.format("gui.nei.seeAll")); + transferRects.add(new RecipeTransferRect(new Rectangle(getGuiWidth()-stringLength-3, 5, stringLength, 9), getOutputId())); } - + public String getOutputId() { - return null; + return null; } public int getMaximumMaterialIndex(short meta, boolean smallOre) { - int offset = smallOre? 16000: 0; - if (!getGTOreLocalizedName((short)(meta+offset+5000)).equals(getGTOreUnlocalizedName((short)(meta+offset+5000)))) - return 7; - else if (!getGTOreLocalizedName((short)(meta+offset+5000)).equals(getGTOreUnlocalizedName((short)(meta+offset+5000)))) - return 6; - else - return 5; + int offset = smallOre? 16000: 0; + if (!getGTOreLocalizedName((short)(meta+offset+5000)).equals(getGTOreUnlocalizedName((short)(meta+offset+5000)))) + return 7; + else if (!getGTOreLocalizedName((short)(meta+offset+5000)).equals(getGTOreUnlocalizedName((short)(meta+offset+5000)))) + return 6; + else + return 5; } public String getGTOreLocalizedName(short index) { - return GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(index)); + return GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(index)); + } + + public String getGTOreUnlocalizedName(short index) { + return "gt.blockores." + index + ".name"; + } + + public String getBiomeTranslated(String unlocalizedBiome) { + return unlocalizedBiome.equals("None")? I18n.format("gtnop.biome.none.name"): unlocalizedBiome; + } + + public String getWorldNameTranslated(boolean genOverworld, boolean genNether, boolean genEnd, boolean genMoon, boolean genMars) { + String worldNameTranslated = ""; + if (genOverworld) { + if (!worldNameTranslated.isEmpty()) + worldNameTranslated += ", "; + worldNameTranslated += I18n.format("gtnop.world.overworld.name"); + } + if (genNether) { + if (!worldNameTranslated.isEmpty()) + worldNameTranslated += ", "; + worldNameTranslated += I18n.format("gtnop.world.nether.name"); + } + if (genEnd) { + if (!worldNameTranslated.isEmpty()) + worldNameTranslated += ", "; + worldNameTranslated += I18n.format("gtnop.world.end.name"); + } + if (genMoon) { + if (!worldNameTranslated.isEmpty()) + worldNameTranslated += ", "; + worldNameTranslated += I18n.format("gtnop.world.moon.name"); + } + if (genMars) { + if (!worldNameTranslated.isEmpty()) + worldNameTranslated += ", "; + worldNameTranslated += I18n.format("gtnop.world.mars.name"); + } + return worldNameTranslated; } - public String getGTOreUnlocalizedName(short index) { - return "gt.blockores." + index + ".name"; - } - - public String getBiomeTranslated(String unlocalizedBiome) { - return unlocalizedBiome.equals("None")? I18n.format("gtnop.biome.none.name"): unlocalizedBiome; - } - - public String getWorldNameTranslated(boolean genOverworld, boolean genNether, boolean genEnd, boolean genMoon, boolean genMars) { - String worldNameTranslated = ""; - if (genOverworld) { - if (!worldNameTranslated.isEmpty()) - worldNameTranslated += ", "; - worldNameTranslated += I18n.format("gtnop.world.overworld.name"); - } - if (genNether) { - if (!worldNameTranslated.isEmpty()) - worldNameTranslated += ", "; - worldNameTranslated += I18n.format("gtnop.world.nether.name"); - } - if (genEnd) { - if (!worldNameTranslated.isEmpty()) - worldNameTranslated += ", "; - worldNameTranslated += I18n.format("gtnop.world.end.name"); - } - if (genMoon) { - if (!worldNameTranslated.isEmpty()) - worldNameTranslated += ", "; - worldNameTranslated += I18n.format("gtnop.world.moon.name"); - } - if (genMars) { - if (!worldNameTranslated.isEmpty()) - worldNameTranslated += ", "; - worldNameTranslated += I18n.format("gtnop.world.mars.name"); - } - return worldNameTranslated; - } - - public int getGuiWidth() { - return 166; - } + public int getGuiWidth() { + return 166; + } } diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginSmallOreStat.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginSmallOreStat.java index e68c9ac8ee..1aba8c8992 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginSmallOreStat.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginSmallOreStat.java @@ -23,114 +23,114 @@ import pers.gwyog.gtneioreplugin.util.GTOreLayerHelper.OreLayerWrapper; import pers.gwyog.gtneioreplugin.util.GTSmallOreHelper.SmallOreWrapper; public class PluginSmallOreStat extends PluginBase { - - public class CachedSmallOreRecipe extends CachedRecipe { - public String oreGenName; - public PositionedStack positionedStackSmallOre; - public PositionedStack positionedStackMaterialDust; - public List<PositionedStack> positionedDropStackList; + + public class CachedSmallOreRecipe extends CachedRecipe { + public String oreGenName; + public PositionedStack positionedStackSmallOre; + public PositionedStack positionedStackMaterialDust; + public List<PositionedStack> positionedDropStackList; - public CachedSmallOreRecipe(String oreGenName, List<ItemStack> stackList, List<ItemStack> materialDustStackList, List<ItemStack> dropStackList) { - this.oreGenName = oreGenName; - this.positionedStackSmallOre = new PositionedStack(stackList, 2, 0); - this.positionedStackMaterialDust = new PositionedStack(materialDustStackList, 43, 79+getRestrictBiomeOffset()); - List<PositionedStack> positionedDropStackList = new ArrayList<PositionedStack>(); - int i = 1; - for (ItemStack stackDrop: dropStackList) - positionedDropStackList.add(new PositionedStack(stackDrop, 43+20*(i%4), 79+16*((i++)/4)+getRestrictBiomeOffset())); - this.positionedDropStackList = positionedDropStackList; - } + public CachedSmallOreRecipe(String oreGenName, List<ItemStack> stackList, List<ItemStack> materialDustStackList, List<ItemStack> dropStackList) { + this.oreGenName = oreGenName; + this.positionedStackSmallOre = new PositionedStack(stackList, 2, 0); + this.positionedStackMaterialDust = new PositionedStack(materialDustStackList, 43, 79+getRestrictBiomeOffset()); + List<PositionedStack> positionedDropStackList = new ArrayList<PositionedStack>(); + int i = 1; + for (ItemStack stackDrop: dropStackList) + positionedDropStackList.add(new PositionedStack(stackDrop, 43+20*(i%4), 79+16*((i++)/4)+getRestrictBiomeOffset())); + this.positionedDropStackList = positionedDropStackList; + } - @Override - public List<PositionedStack> getIngredients() { - positionedStackSmallOre.setPermutationToRender((cycleticks / 20) % positionedStackSmallOre.items.length); - positionedStackMaterialDust.setPermutationToRender((cycleticks / 20) % positionedStackMaterialDust.items.length); - positionedDropStackList.add(positionedStackSmallOre); - positionedDropStackList.add(positionedStackMaterialDust); - return positionedDropStackList; - - } - - @Override - public PositionedStack getResult() { - return null; - } - - } - - @Override - public void drawExtras(int recipe) { - CachedSmallOreRecipe crecipe = (CachedSmallOreRecipe) this.arecipes.get(recipe); - SmallOreWrapper smallOre = GTSmallOreHelper.mapSmallOreWrapper.get(crecipe.oreGenName); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.oreName") + ": " + getGTOreLocalizedName((short)(smallOre.oreMeta+16000)), 2, 18, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.genHeight") + ": " + smallOre.worldGenHeightRange, 2, 31, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.amount") + ": " + smallOre.amountPerChunk, 2, 44, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.worldNames") + ": " + getWorldNameTranslated(smallOre.genOverworld, smallOre.genNether, smallOre.genEnd, smallOre.genMoon, smallOre.genMars), 2, 57, 0x404040, false); - if (GTSmallOreHelper.restrictBiomeSupport) GuiDraw.drawString(I18n.format("gtnop.gui.nei.restrictBiome") + ": " + getBiomeTranslated(smallOre.restrictBiome), 2, 70, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.chanceDrops") + ": ", 2, 83+getRestrictBiomeOffset(), 0x404040, false); - GuiDraw.drawStringR(EnumChatFormatting.BOLD + I18n.format("gtnop.gui.nei.seeAll"), getGuiWidth()-3, 5, 0x404040, false); - } - - public int getRestrictBiomeOffset() { - return GTSmallOreHelper.restrictBiomeSupport? 0: -13; - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results) { - if (outputId.equals(getOutputId())) - for (ItemStack stack: GTSmallOreHelper.smallOreList) - loadCraftingRecipes(stack); - else - super.loadCraftingRecipes(outputId, results); - } - - @Override - public void loadCraftingRecipes(ItemStack stack) { - if (stack.getUnlocalizedName().startsWith("gt.blockores")) { - if (stack.getItemDamage()<16000) { - super.loadCraftingRecipes(stack); - return; - } - short baseMeta = (short)(stack.getItemDamage() % 1000); - for (SmallOreWrapper smallOreWorldGen: GTSmallOreHelper.mapSmallOreWrapper.values()) { - if (smallOreWorldGen.oreMeta == baseMeta) { - List<ItemStack> stackList = new ArrayList<ItemStack>(); - int maximumIndex = getMaximumMaterialIndex(baseMeta, true); - for (int i=0;i<maximumIndex;i++) - stackList.add(new ItemStack(GregTech_API.sBlockOres1, 1, smallOreWorldGen.oreMeta+16000+i*1000)); - List<ItemStack> materialDustStackList = new ArrayList<ItemStack>(); - for (int i=0;i<maximumIndex;i++) - materialDustStackList.add(GT_OreDictUnificator.get(OrePrefixes.dust, GTSmallOreHelper.getDroppedDusts()[i], 1L)); - this.arecipes.add(new CachedSmallOreRecipe(smallOreWorldGen.oreGenName, stackList, materialDustStackList, GTSmallOreHelper.mapOreMetaToOreDrops.get(baseMeta))); - } - } - } - else if (GTSmallOreHelper.mapOreDropUnlocalizedNameToOreMeta.keySet().contains(stack.getUnlocalizedName())) { - short baseMeta = GTSmallOreHelper.mapOreDropUnlocalizedNameToOreMeta.get(stack.getUnlocalizedName()); - for (String oreGenName: GTSmallOreHelper.mapSmallOreWrapper.keySet()) { - SmallOreWrapper smallOreWrapper = GTSmallOreHelper.mapSmallOreWrapper.get(oreGenName); - if (smallOreWrapper.oreMeta == baseMeta) { - List<ItemStack> stackList = new ArrayList<ItemStack>(); - for (int i=0;i<7;i++) - stackList.add(new ItemStack(GregTech_API.sBlockOres1, 1, baseMeta+16000+i*1000)); - List<ItemStack> materialDustStackList = new ArrayList<ItemStack>(); - for (int i=0;i<7;i++) - materialDustStackList.add(GT_OreDictUnificator.get(OrePrefixes.dust, GTSmallOreHelper.getDroppedDusts()[i], 1L)); - this.arecipes.add(new CachedSmallOreRecipe(GTSmallOreHelper.mapSmallOreWrapper.get(oreGenName).oreGenName, stackList, materialDustStackList, GTSmallOreHelper.mapOreMetaToOreDrops.get(baseMeta))); - } - } - } - else - super.loadCraftingRecipes(stack); - } - - @Override - public String getOutputId() { - return "GTOrePluginSmallOre"; - } + @Override + public List<PositionedStack> getIngredients() { + positionedStackSmallOre.setPermutationToRender((cycleticks / 20) % positionedStackSmallOre.items.length); + positionedStackMaterialDust.setPermutationToRender((cycleticks / 20) % positionedStackMaterialDust.items.length); + positionedDropStackList.add(positionedStackSmallOre); + positionedDropStackList.add(positionedStackMaterialDust); + return positionedDropStackList; + + } - @Override - public String getRecipeName() { - return I18n.format("gtnop.gui.smallOreStat.name"); - } + @Override + public PositionedStack getResult() { + return null; + } + + } + + @Override + public void drawExtras(int recipe) { + CachedSmallOreRecipe crecipe = (CachedSmallOreRecipe) this.arecipes.get(recipe); + SmallOreWrapper smallOre = GTSmallOreHelper.mapSmallOreWrapper.get(crecipe.oreGenName); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.oreName") + ": " + getGTOreLocalizedName((short)(smallOre.oreMeta+16000)), 2, 18, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.genHeight") + ": " + smallOre.worldGenHeightRange, 2, 31, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.amount") + ": " + smallOre.amountPerChunk, 2, 44, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.worldNames") + ": " + getWorldNameTranslated(smallOre.genOverworld, smallOre.genNether, smallOre.genEnd, smallOre.genMoon, smallOre.genMars), 2, 57, 0x404040, false); + if (GTSmallOreHelper.restrictBiomeSupport) GuiDraw.drawString(I18n.format("gtnop.gui.nei.restrictBiome") + ": " + getBiomeTranslated(smallOre.restrictBiome), 2, 70, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.chanceDrops") + ": ", 2, 83+getRestrictBiomeOffset(), 0x404040, false); + GuiDraw.drawStringR(EnumChatFormatting.BOLD + I18n.format("gtnop.gui.nei.seeAll"), getGuiWidth()-3, 5, 0x404040, false); + } + + public int getRestrictBiomeOffset() { + return GTSmallOreHelper.restrictBiomeSupport? 0: -13; + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals(getOutputId())) + for (ItemStack stack: GTSmallOreHelper.smallOreList) + loadCraftingRecipes(stack); + else + super.loadCraftingRecipes(outputId, results); + } + + @Override + public void loadCraftingRecipes(ItemStack stack) { + if (stack.getUnlocalizedName().startsWith("gt.blockores")) { + if (stack.getItemDamage()<16000) { + super.loadCraftingRecipes(stack); + return; + } + short baseMeta = (short)(stack.getItemDamage() % 1000); + for (SmallOreWrapper smallOreWorldGen: GTSmallOreHelper.mapSmallOreWrapper.values()) { + if (smallOreWorldGen.oreMeta == baseMeta) { + List<ItemStack> stackList = new ArrayList<ItemStack>(); + int maximumIndex = getMaximumMaterialIndex(baseMeta, true); + for (int i=0;i<maximumIndex;i++) + stackList.add(new ItemStack(GregTech_API.sBlockOres1, 1, smallOreWorldGen.oreMeta+16000+i*1000)); + List<ItemStack> materialDustStackList = new ArrayList<ItemStack>(); + for (int i=0;i<maximumIndex;i++) + materialDustStackList.add(GT_OreDictUnificator.get(OrePrefixes.dust, GTSmallOreHelper.getDroppedDusts()[i], 1L)); + this.arecipes.add(new CachedSmallOreRecipe(smallOreWorldGen.oreGenName, stackList, materialDustStackList, GTSmallOreHelper.mapOreMetaToOreDrops.get(baseMeta))); + } + } + } + else if (GTSmallOreHelper.mapOreDropUnlocalizedNameToOreMeta.keySet().contains(stack.getUnlocalizedName())) { + short baseMeta = GTSmallOreHelper.mapOreDropUnlocalizedNameToOreMeta.get(stack.getUnlocalizedName()); + for (String oreGenName: GTSmallOreHelper.mapSmallOreWrapper.keySet()) { + SmallOreWrapper smallOreWrapper = GTSmallOreHelper.mapSmallOreWrapper.get(oreGenName); + if (smallOreWrapper.oreMeta == baseMeta) { + List<ItemStack> stackList = new ArrayList<ItemStack>(); + for (int i=0;i<7;i++) + stackList.add(new ItemStack(GregTech_API.sBlockOres1, 1, baseMeta+16000+i*1000)); + List<ItemStack> materialDustStackList = new ArrayList<ItemStack>(); + for (int i=0;i<7;i++) + materialDustStackList.add(GT_OreDictUnificator.get(OrePrefixes.dust, GTSmallOreHelper.getDroppedDusts()[i], 1L)); + this.arecipes.add(new CachedSmallOreRecipe(GTSmallOreHelper.mapSmallOreWrapper.get(oreGenName).oreGenName, stackList, materialDustStackList, GTSmallOreHelper.mapOreMetaToOreDrops.get(baseMeta))); + } + } + } + else + super.loadCraftingRecipes(stack); + } + + @Override + public String getOutputId() { + return "GTOrePluginSmallOre"; + } + + @Override + public String getRecipeName() { + return I18n.format("gtnop.gui.smallOreStat.name"); + } } diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginVeinStat.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginVeinStat.java index 84ad4d4cb2..8182233c9b 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginVeinStat.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginVeinStat.java @@ -23,118 +23,118 @@ import pers.gwyog.gtneioreplugin.util.GTOreLayerHelper.OreLayerWrapper; public class PluginVeinStat extends PluginBase { - public class CachedVeinStatRecipe extends CachedRecipe { - public String veinName; - public PositionedStack positionedStackPrimary; - public PositionedStack positionedStackSecondary; - public PositionedStack positionedStackBetween; - public PositionedStack positionedStackSporadic; - - public CachedVeinStatRecipe(String veinName, List<ItemStack> stackListPrimary, List<ItemStack> stackListSecondary, - List<ItemStack> stackListBetween, List<ItemStack> stackListSporadic) { - this.veinName = veinName; - positionedStackPrimary = new PositionedStack(stackListPrimary, 2, 0); - positionedStackSecondary = new PositionedStack(stackListSecondary, 22, 0); - positionedStackBetween = new PositionedStack(stackListBetween, 42, 0); - positionedStackSporadic = new PositionedStack(stackListSporadic, 62, 0); - } - - @Override - public List<PositionedStack> getIngredients() { - List<PositionedStack> ingredientsList = new ArrayList<PositionedStack>(); - positionedStackPrimary.setPermutationToRender((cycleticks / 20) % positionedStackPrimary.items.length);; - positionedStackSecondary.setPermutationToRender((3 + cycleticks / 20) % positionedStackPrimary.items.length);; - positionedStackBetween.setPermutationToRender((2 + cycleticks / 20) % positionedStackPrimary.items.length);; - positionedStackSporadic.setPermutationToRender((1 + cycleticks / 20) % positionedStackPrimary.items.length);; - ingredientsList.add(positionedStackPrimary); - ingredientsList.add(positionedStackSecondary); - ingredientsList.add(positionedStackBetween); - ingredientsList.add(positionedStackSporadic); - return ingredientsList; - } - - @Override - public PositionedStack getResult() { |
