Fix Server GrS Errors (#869)

[SKIP]
This commit is contained in:
Integer Limit 2024-08-06 22:11:18 +10:00 committed by GitHub
parent ec84cf911e
commit 18eac7898f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 16 deletions

View File

@ -43,6 +43,19 @@ advanced {
# Many Client Side Only modifications, on the same class, may be inefficient. # Many Client Side Only modifications, on the same class, may be inefficient.
# [default: ] # [default: ]
S:clientSideMethods < S:clientSideMethods <
eutros/framedcompactdrawers/item/ItemSlaveCustom@func_77624_a@(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Ljava/util/List;Lnet/minecraft/client/util/ITooltipFlag;)V
gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityMultiblockPart@getParticleTexture@()Lorg/apache/commons/lang3/tuple/Pair;
gregtech/api/recipes/recipeproperties/CleanroomProperty@drawInfo@(Lnet/minecraft/client/Minecraft;IIILjava/lang/Object;)V
gregtech/api/recipes/recipeproperties/ComputationProperty@drawInfo@(Lnet/minecraft/client/Minecraft;IIILjava/lang/Object;)V
gregtech/api/recipes/recipeproperties/DefaultProperty@drawInfo@(Lnet/minecraft/client/Minecraft;IIILjava/lang/Object;)V
gregtech/api/recipes/recipeproperties/FusionEUToStartProperty@drawInfo@(Lnet/minecraft/client/Minecraft;IIILjava/lang/Object;)V
gregtech/api/recipes/recipeproperties/GasCollectorDimensionProperty@drawInfo@(Lnet/minecraft/client/Minecraft;IIILjava/lang/Object;)V
gregtech/api/recipes/recipeproperties/ImplosionExplosiveProperty@drawInfo@(Lnet/minecraft/client/Minecraft;IIILjava/lang/Object;)V
gregtech/api/recipes/recipeproperties/PrimitiveProperty@drawInfo@(Lnet/minecraft/client/Minecraft;IIILjava/lang/Object;)V
gregtech/api/recipes/recipeproperties/ResearchProperty@drawInfo@(Lnet/minecraft/client/Minecraft;IIILjava/lang/Object;)V
gregtech/api/recipes/recipeproperties/ScanProperty@drawInfo@(Lnet/minecraft/client/Minecraft;IIILjava/lang/Object;)V
gregtech/api/recipes/recipeproperties/TemperatureProperty@drawInfo@(Lnet/minecraft/client/Minecraft;IIILjava/lang/Object;)V
gregtech/api/recipes/recipeproperties/TotalComputationProperty@drawInfo@(Lnet/minecraft/client/Minecraft;IIILjava/lang/Object;)V
> >
# Whether to disable the Narrator. # Whether to disable the Narrator.

View File

@ -1,13 +1,11 @@
import com.cleanroommc.groovyscript.api.IIngredient import com.cleanroommc.groovyscript.api.IIngredient
import gregtech.api.items.metaitem.MetaItem import gregtech.api.items.metaitem.MetaItem
import gregtech.api.metatileentity.MetaTileEntity
import gregtech.api.unification.OreDictUnifier import gregtech.api.unification.OreDictUnifier
import gregtech.api.unification.ore.OrePrefix import gregtech.api.unification.ore.OrePrefix
import gregtech.api.unification.stack.UnificationEntry import gregtech.api.unification.stack.UnificationEntry
import gregtech.common.metatileentities.MetaTileEntities import gregtech.common.metatileentities.MetaTileEntities
import net.minecraft.item.ItemStack import net.minecraft.item.ItemStack
import static com.nomiceu.nomilabs.groovy.GroovyHelpers.SafeMethodHelpers.callInstanceMethodOfClass
import static gregtech.loaders.recipe.CraftingComponent.*; import static gregtech.loaders.recipe.CraftingComponent.*;
import static gregtech.api.GTValues.* import static gregtech.api.GTValues.*
@ -27,11 +25,7 @@ void replaceRecipe(int minTier, int maxTier, IIngredient oreDict) {
def hull = getIngredientFromGTComponent(HULL, tier) def hull = getIngredientFromGTComponent(HULL, tier)
def plate = getIngredientFromGTComponent(PLATE, tier) def plate = getIngredientFromGTComponent(PLATE, tier)
def cable = getIngredientFromGTComponent(CABLE_QUAD, tier) def cable = getIngredientFromGTComponent(CABLE_QUAD, tier)
def diode = MetaTileEntities.DIODES[tier].getStackForm()
// We must use Safe Method Helpers
// MetaTileEntityMultiblockPart has a method with TextureAtlasSprite not labelled as @SideOnly(Side.CLIENT)
// Direct call to MetaTileEntity
def diode = callInstanceMethodOfClass(MetaTileEntity.class, MetaTileEntities.DIODES[tier], "getStackForm", null)
crafting.shapedBuilder() crafting.shapedBuilder()
.output(diode) .output(diode)

View File

@ -2,14 +2,10 @@ import com.cleanroommc.groovyscript.api.IIngredient
import com.jaquadro.minecraft.storagedrawers.api.storage.attribute.IFrameable import com.jaquadro.minecraft.storagedrawers.api.storage.attribute.IFrameable
import com.nomiceu.nomilabs.groovy.ShapedDummyRecipe import com.nomiceu.nomilabs.groovy.ShapedDummyRecipe
import com.nomiceu.nomilabs.util.ItemMeta import com.nomiceu.nomilabs.util.ItemMeta
import net.minecraft.item.Item
import net.minecraft.item.ItemStack import net.minecraft.item.ItemStack
import net.minecraft.util.ResourceLocation
import net.minecraftforge.registries.IForgeRegistryEntry
import static com.nomiceu.nomilabs.groovy.GroovyHelpers.JEIHelpers.addRecipeOutputTooltip import static com.nomiceu.nomilabs.groovy.GroovyHelpers.JEIHelpers.addRecipeOutputTooltip
import static com.nomiceu.nomilabs.groovy.GroovyHelpers.TranslationHelpers.translatable import static com.nomiceu.nomilabs.groovy.GroovyHelpers.TranslationHelpers.translatable
import static com.nomiceu.nomilabs.groovy.GroovyHelpers.SafeMethodHelpers.callInstanceMethodOfClass
// Hand Framing Tool // Hand Framing Tool
crafting.addShaped("hand_framing_tool_recipe", item("nomilabs:hand_framing_tool"), [ crafting.addShaped("hand_framing_tool_recipe", item("nomilabs:hand_framing_tool"), [
@ -73,7 +69,7 @@ static String getRecipeName(ItemStack stack, boolean trim, boolean front) {
// We have to use safe method helpers, because some items from Framed Compacting Drawers mislabel addInformation, // We have to use safe method helpers, because some items from Framed Compacting Drawers mislabel addInformation,
// Without SideOnly, so it crashes. // Without SideOnly, so it crashes.
// Use the special of class type so the addInformation method isn't loaded. // Use the special of class type so the addInformation method isn't loaded.
def rl = (ResourceLocation) callInstanceMethodOfClass(IForgeRegistryEntry<Item>.class, stack.getItem(), "getRegistryName", null) def rl = stack.getItem().getRegistryName()
if (rl != null) if (rl != null)
baseName = baseName + rl.getNamespace() + "_" + rl.getPath() baseName = baseName + rl.getNamespace() + "_" + rl.getPath()
@ -88,11 +84,8 @@ static ItemStack addNBT(ItemStack stack, boolean trim, boolean front) {
def trimStack = trim ? item("extendedcrafting:storage", 4) : ItemStack.EMPTY def trimStack = trim ? item("extendedcrafting:storage", 4) : ItemStack.EMPTY
def frontStack = front ? item("xtones:zane", 15) : ItemStack.EMPTY def frontStack = front ? item("xtones:zane", 15) : ItemStack.EMPTY
// We have to use safe method helpers, because some items from Framed Compacting Drawers mislabel addInformation,
// Without SideOnly, so it crashes.
// Use the special of class type so the addInformation method isn't loaded.
def frameable = (IFrameable) stack.getItem() def frameable = (IFrameable) stack.getItem()
stack = (ItemStack) callInstanceMethodOfClass(IFrameable.class, frameable, "decorate", [stack.copy(), sideStack, trimStack, frontStack]) stack = frameable.decorate(stack.copy(), sideStack, trimStack, frontStack)
if (stack == null) if (stack == null)
return stack return stack