From 6d3cfbf04cc649ddda141600f82febd31f3e34eb Mon Sep 17 00:00:00 2001 From: Gordon-Frohman Date: Fri, 21 Jun 2024 00:56:39 +0700 Subject: [PATCH 1/2] Fix fiery metal block brightness --- .../blocks/RenderBlockTFFieryMetal.java | 26 +++---------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/src/main/java/twilightforest/client/renderer/blocks/RenderBlockTFFieryMetal.java b/src/main/java/twilightforest/client/renderer/blocks/RenderBlockTFFieryMetal.java index 1b3749c74f..c49a4d00df 100644 --- a/src/main/java/twilightforest/client/renderer/blocks/RenderBlockTFFieryMetal.java +++ b/src/main/java/twilightforest/client/renderer/blocks/RenderBlockTFFieryMetal.java @@ -46,29 +46,11 @@ public static boolean renderGlowingEdgeBlock(RenderBlocks renderblocks, IBlockAc float m = (1.0f - p) / 2; float s = 0.001f; - renderblocks.enableAO = true; - - renderblocks.aoBrightnessXYNP = 255; - renderblocks.aoBrightnessXYPP = 255; - renderblocks.aoBrightnessYZPN = 255; - renderblocks.aoBrightnessYZPP = 255; - renderblocks.aoLightValueScratchXYNP = 1.0F; - renderblocks.aoLightValueScratchXYPP = 1.0F; - renderblocks.aoLightValueScratchYZPN = 1.0F; - renderblocks.aoLightValueScratchYZPP = 1.0F; - - renderblocks.aoLightValueScratchXYZNPN = renderblocks.aoLightValueScratchXYNP; - renderblocks.aoBrightnessXYZNPN = renderblocks.aoBrightnessXYNP; - renderblocks.aoLightValueScratchXYZPPN = renderblocks.aoLightValueScratchXYPP; - renderblocks.aoBrightnessXYZPPN = renderblocks.aoBrightnessXYPP; - renderblocks.aoLightValueScratchXYZNPP = renderblocks.aoLightValueScratchXYNP; - renderblocks.aoBrightnessXYZNPP = renderblocks.aoBrightnessXYNP; - renderblocks.aoLightValueScratchXYZPPP = renderblocks.aoLightValueScratchXYPP; - renderblocks.aoBrightnessXYZPPP = renderblocks.aoBrightnessXYPP; + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(15 << 20 | 15 << 4); // full brightness + tessellator.setColorOpaque_F(1.0f, 1.0f, 1.0f); - renderblocks.colorRedTopLeft = renderblocks.colorRedBottomLeft = renderblocks.colorRedBottomRight = renderblocks.colorRedTopRight = 1.0f; - renderblocks.colorGreenTopLeft = renderblocks.colorGreenBottomLeft = renderblocks.colorGreenBottomRight = renderblocks.colorGreenTopRight = 1.0f; - renderblocks.colorBlueTopLeft = renderblocks.colorBlueBottomLeft = renderblocks.colorBlueBottomRight = renderblocks.colorBlueTopRight = 1.0f; + renderblocks.enableAO = false; // middle renderblocks.renderAllFaces = true; From ac19cb0d14727576e7dbe46e9b4ad8e937bcb4b2 Mon Sep 17 00:00:00 2001 From: Gordon-Frohman Date: Fri, 21 Jun 2024 02:03:09 +0700 Subject: [PATCH 2/2] Add GTNH check for recipes --- .../twilightforest/TwilightForestMod.java | 2 + .../TFTinkerConstructIntegration.java | 28 ++++++++ .../java/twilightforest/item/TFRecipes.java | 71 ++++++++++--------- 3 files changed, 68 insertions(+), 33 deletions(-) diff --git a/src/main/java/twilightforest/TwilightForestMod.java b/src/main/java/twilightforest/TwilightForestMod.java index e849ad06b1..43cef69d99 100644 --- a/src/main/java/twilightforest/TwilightForestMod.java +++ b/src/main/java/twilightforest/TwilightForestMod.java @@ -96,6 +96,7 @@ public class TwilightForestMod { public static String portalCreationItemString; // integration + public static boolean isGTNHLoaded = false; public static boolean isSkinportLoaded = false; public static boolean areBaublesLoaded = false; public static boolean isNeiLoaded = false; @@ -255,6 +256,7 @@ public void preInit(FMLPreInitializationEvent event) { } else { areBaublesLoaded = false; } + isGTNHLoaded = Loader.isModLoaded("dreamcraft"); // check for biome conflicts, load biomes TFBiomeBase.assignBlankBiomeIds(); diff --git a/src/main/java/twilightforest/integration/TFTinkerConstructIntegration.java b/src/main/java/twilightforest/integration/TFTinkerConstructIntegration.java index a604173315..23ede9ea0c 100644 --- a/src/main/java/twilightforest/integration/TFTinkerConstructIntegration.java +++ b/src/main/java/twilightforest/integration/TFTinkerConstructIntegration.java @@ -338,6 +338,34 @@ public static void registerTinkersConstructIntegration(FMLPostInitializationEven } } + // Fiery armor casting + if (!TwilightForestMod.isGTNHLoaded) { + tableCasting.addCastingRecipe( + new ItemStack(TFItems.fieryHelm), + new FluidStack(fieryEssenceFluid, TConstruct.ingotLiquidValue * 5), + new ItemStack(Items.iron_helmet, 1, 0), + true, + 50); + tableCasting.addCastingRecipe( + new ItemStack(TFItems.fieryPlate), + new FluidStack(fieryEssenceFluid, TConstruct.ingotLiquidValue * 8), + new ItemStack(Items.iron_chestplate, 1, 0), + true, + 50); + tableCasting.addCastingRecipe( + new ItemStack(TFItems.fieryLegs), + new FluidStack(fieryEssenceFluid, TConstruct.ingotLiquidValue * 7), + new ItemStack(Items.iron_leggings, 1, 0), + true, + 50); + tableCasting.addCastingRecipe( + new ItemStack(TFItems.fieryBoots), + new FluidStack(fieryEssenceFluid, TConstruct.ingotLiquidValue * 4), + new ItemStack(Items.iron_boots, 1, 0), + true, + 50); + } + // Fluids registry fluids[0] = fieryEssenceFluid; fluids[1] = moltenFieryMetalFluid; diff --git a/src/main/java/twilightforest/item/TFRecipes.java b/src/main/java/twilightforest/item/TFRecipes.java index 2f70b9319c..b1e581cd3d 100644 --- a/src/main/java/twilightforest/item/TFRecipes.java +++ b/src/main/java/twilightforest/item/TFRecipes.java @@ -128,24 +128,27 @@ public static void registerRecipes() { TFBlocks.trappedChestMangrove, TFBlocks.trappedChestDarkwood, TFBlocks.trappedChestTime, TFBlocks.trappedChestTrans, TFBlocks.trappedChestMine, TFBlocks.trappedChestSort }; for (int i = 0; i < doors.length; i++) { - GameRegistry.addRecipe( - new ItemStack(doors[i], 1, 0), - new Object[] { "##", "##", "##", '#', new ItemStack(TFBlocks.planks, 1, i) }); - GameRegistry - .addRecipe(trapdoors[i], new Object[] { "###", "###", '#', new ItemStack(TFBlocks.planks, 1, i) }); + if (!TwilightForestMod.isGTNHLoaded) { + GameRegistry.addRecipe( + new ItemStack(doors[i], 1, 0), + new Object[] { "##", "##", "##", '#', new ItemStack(TFBlocks.planks, 1, i) }); + GameRegistry.addRecipe( + trapdoors[i], + new Object[] { "###", "###", '#', new ItemStack(TFBlocks.planks, 1, i) }); + GameRegistry.addRecipe( + new ItemStack(chests[i], 2), + new Object[] { "###", "#0#", "###", '#', new ItemStack(TFBlocks.planks, 1, i), '0', + new ItemStack(Blocks.chest) }); + GameRegistry.addShapelessRecipe( + new ItemStack(trappedChests[i]), + new Object[] { new ItemStack(chests[i]), new ItemStack(Blocks.tripwire_hook) }); + } GameRegistry.addRecipe( stairs[i], new Object[] { "# ", "## ", "###", '#', new ItemStack(TFBlocks.planks, 1, i) }); GameRegistry.addRecipe( new ItemStack(TFBlocks.woodenSlab, 6, i), new Object[] { "###", '#', new ItemStack(TFBlocks.planks, 1, i) }); - GameRegistry.addRecipe( - new ItemStack(chests[i], 2), - new Object[] { "###", "#0#", "###", '#', new ItemStack(TFBlocks.planks, 1, i), '0', - new ItemStack(Blocks.chest) }); - GameRegistry.addShapelessRecipe( - new ItemStack(trappedChests[i]), - new Object[] { new ItemStack(chests[i]), new ItemStack(Blocks.tripwire_hook) }); } // Dyes from TF plants @@ -355,27 +358,29 @@ public static void registerRecipes() { .addRecipe(new ItemStack(TFItems.fieryBoots), new Object[] { "# #", "# #", '#', TFItems.fieryIngot }); // Direct Fiery armor crafting - GameRegistry.addRecipe( - new ShapelessOreRecipe( - new ItemStack(TFItems.fieryHelm), - new Object[] { new ItemStack(Items.iron_helmet, 1, 0), "fieryEssence", "fieryEssence", - "fieryEssence", "fieryEssence", "fieryEssence" })); - GameRegistry.addRecipe( - new ShapelessOreRecipe( - new ItemStack(TFItems.fieryPlate), - new Object[] { new ItemStack(Items.iron_chestplate, 1, 0), "fieryEssence", "fieryEssence", - "fieryEssence", "fieryEssence", "fieryEssence", "fieryEssence", "fieryEssence", - "fieryEssence" })); - GameRegistry.addRecipe( - new ShapelessOreRecipe( - new ItemStack(TFItems.fieryLegs), - new Object[] { new ItemStack(Items.iron_leggings, 1, 0), "fieryEssence", "fieryEssence", - "fieryEssence", "fieryEssence", "fieryEssence", "fieryEssence", "fieryEssence" })); - GameRegistry.addRecipe( - new ShapelessOreRecipe( - new ItemStack(TFItems.fieryBoots), - new Object[] { new ItemStack(Items.iron_boots, 1, 0), "fieryEssence", "fieryEssence", - "fieryEssence", "fieryEssence" })); + if (!TwilightForestMod.isGTNHLoaded) { + GameRegistry.addRecipe( + new ShapelessOreRecipe( + new ItemStack(TFItems.fieryHelm), + new Object[] { new ItemStack(Items.iron_helmet, 1, 0), "fieryEssence", "fieryEssence", + "fieryEssence", "fieryEssence", "fieryEssence" })); + GameRegistry.addRecipe( + new ShapelessOreRecipe( + new ItemStack(TFItems.fieryPlate), + new Object[] { new ItemStack(Items.iron_chestplate, 1, 0), "fieryEssence", "fieryEssence", + "fieryEssence", "fieryEssence", "fieryEssence", "fieryEssence", "fieryEssence", + "fieryEssence" })); + GameRegistry.addRecipe( + new ShapelessOreRecipe( + new ItemStack(TFItems.fieryLegs), + new Object[] { new ItemStack(Items.iron_leggings, 1, 0), "fieryEssence", "fieryEssence", + "fieryEssence", "fieryEssence", "fieryEssence", "fieryEssence", "fieryEssence" })); + GameRegistry.addRecipe( + new ShapelessOreRecipe( + new ItemStack(TFItems.fieryBoots), + new Object[] { new ItemStack(Items.iron_boots, 1, 0), "fieryEssence", "fieryEssence", + "fieryEssence", "fieryEssence" })); + } addEnchantedRecipe( TFItems.fierySword,