Updated AdvancedPlateCraftPage to reflect the latest changes

Removed some magic numbers
This commit is contained in:
Alexander Anishin committed 2024-03-16 12:56:44 +03:00
1 parent 269e1ed6c7
commit 0a18e85b91
2 files changed
+22 -10

No files matched your search

@@ -10,6 +10,7 @@ import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraftforge.oredict.OreDictionary;
import org.lwjgl.opengl.GL11;
@@ -68,14 +69,24 @@ public class AdvancedPlateCraftPage extends PageRecipe {
TextureManager render = (Minecraft.getMinecraft()).renderEngine;
renderItemAtGridPos(gui, 3, 0, recipe.getOutput(), false);
renderItemAtGridPos(gui, 2, 1, new ItemStack(BlockListAB.blockABPlate), false);
List<ItemStack> inputs = recipe.getInputs();
List<Object> inputs = recipe.getInputs();
int degreePerInput = (int) (360.0F / inputs.size());
float currentDegree = ConfigHandler.lexiconRotatingItems ? (GuiScreen.isShiftKeyDown() ? this.ticksElapsed
: (this.ticksElapsed + ClientTickHandler.partialTicks)) : 0.0F;
for (ItemStack obj : inputs) {
ItemStack copy = obj.copy();
if (copy.getItemDamage() == 32767) copy.setItemDamage(0);
renderItemAtAngle(gui, currentDegree, copy);
for (Object obj : inputs) {
ItemStack copy = null;
if (obj instanceof String oreName) {
List<ItemStack> ores = OreDictionary.getOres(oreName);
if (!ores.isEmpty()) {
copy = ores.get(0).copy();
}
} else if (obj instanceof ItemStack itemStack) {
copy = itemStack.copy();
}
if (copy != null) {
if (copy.getItemDamage() == OreDictionary.WILDCARD_VALUE) copy.setItemDamage(0);
renderItemAtAngle(gui, currentDegree, copy);
}
currentDegree += degreePerInput;
}
renderManaBar(gui, mx, my);
@@ -116,7 +127,7 @@ public class AdvancedPlateCraftPage extends PageRecipe {
}
public List<ItemStack> getDisplayedRecipes() {
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
ArrayList<ItemStack> list = new ArrayList<>();
list.add(recipe.getOutput());
return list;
}
@@ -11,6 +11,7 @@ import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
@@ -173,7 +174,7 @@ public class RecipeListAB implements IModHelper {
11);
manaFlowerRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(
new ItemStack(ItemListAB.itemABResource, 1, 4),
new ItemStack(ModBlocks.flower, 1, 32767),
new ItemStack(ModBlocks.flower, 1, OreDictionary.WILDCARD_VALUE),
32);
hopperRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(
new ItemStack(BlockListAB.blockEngineerHopper),
@@ -475,7 +476,7 @@ public class RecipeListAB implements IModHelper {
'G',
new ItemStack(ModBlocks.manaGlass),
'W',
new ItemStack(ModItems.twigWand, 1, 32767),
new ItemStack(ModItems.twigWand, 1, OreDictionary.WILDCARD_VALUE),
'D',
new ItemStack(ModBlocks.dreamwood),
'M',
@@ -597,7 +598,7 @@ public class RecipeListAB implements IModHelper {
'G',
new ItemStack(ModBlocks.elfGlass),
'D',
new ItemStack(ModBlocks.floatingFlower, 1, 32767),
new ItemStack(ModBlocks.floatingFlower, 1, OreDictionary.WILDCARD_VALUE),
'E',
"plateElvenElementium",
'R',
@@ -740,7 +741,7 @@ public class RecipeListAB implements IModHelper {
" WS",
"W ",
'S',
new ItemStack(ModItems.grassSeeds, 1, 32767),
new ItemStack(ModItems.grassSeeds, 1, OreDictionary.WILDCARD_VALUE),
'C',
new ItemStack(BlockListAB.blockLebethron, 1, 4),
'W',