Plusieurs problèmes de mise à jour [v2]
-
La seule solution que je vois est de modifier la valeur de enableSnow via réflexion.
-
Salut
J’ai essayé de modifier la valeur de base de enableSnow dans la classe BiomeProperties en utilisantjava ObfuscationReflectionHelper.setPrivateValue(BiomeProperties.class, biomeInstance, true, "enableSnow");biomeInstance est déclaré plus haut par ```java
public static BiomeProperties biomeInstance;[14:25:59] [Client thread/ERROR] [FML]: Unable to set any field [enableSnow] on type net.minecraft.world.biome.Biome$BiomeProperties
net.minecraftforge.fml.relauncher.ReflectionHelper$UnableToAccessFieldException: java.lang.NullPointerException
at net.minecraftforge.fml.relauncher.ReflectionHelper.setPrivateValue(ReflectionHelper.java:143) ~[forgeSrc-1.9.4-12.17.0.1976.jar:?]
at net.minecraftforge.fml.common.ObfuscationReflectionHelper.setPrivateValue(ObfuscationReflectionHelper.java:92) [ObfuscationReflectionHelper.class:?]
at This_is_Christmas.ThisisChristmas.load(ThisisChristmas.java:135) [ThisisChristmas.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_92]
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:568) [FMLModContainer.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_92]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) [guava-17.0.jar:?]
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:228) [LoadController.class:?]
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:206) [LoadController.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_92]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) [guava-17.0.jar:?]
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) [LoadController.class:?]
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:767) [Loader.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:316) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:559) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:384) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_92]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_92]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.NullPointerException
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source) ~[?:1.8.0_92]
at sun.reflect.UnsafeBooleanFieldAccessorImpl.set(Unknown Source) ~[?:1.8.0_92]
at java.lang.reflect.Field.set(Unknown Source) ~[?:1.8.0_92]
at net.minecraftforge.fml.relauncher.ReflectionHelper.setPrivateValue(ReflectionHelper.java:139) ~[forgeSrc-1.9.4-12.17.0.1976.jar:?]
… 45 more
[14:25:59] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue
[14:25:59] [Client thread/ERROR] [FML]:
States: ‘U’ = Unloaded ‘L’ = Loaded ‘C’ = Constructed ‘H’ = Pre-initialized ‘I’ = Initialized ‘J’ = Post-initialized ‘A’ = Available ‘D’ = Disabled ‘E’ = Errored
UCHI mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
UCHI FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.9.4-12.17.0.1976.jar)
UCHI Forge{12.17.0.1976} [Minecraft Forge] (forgeSrc-1.9.4-12.17.0.1976.jar)
UCHE This_is_Christmas{1.2} [This is Christmas] (bin)
[14:25:59] [Client thread/ERROR] [FML]: The following problems were captured during this phase
[14:25:59] [Client thread/ERROR] [FML]: Caught exception from This_is_Christmas
net.minecraftforge.fml.relauncher.ReflectionHelper$UnableToAccessFieldException: java.lang.NullPointerException
at net.minecraftforge.fml.relauncher.ReflectionHelper.setPrivateValue(ReflectionHelper.java:143) ~[forgeSrc-1.9.4-12.17.0.1976.jar:?]
at net.minecraftforge.fml.common.ObfuscationReflectionHelper.setPrivateValue(ObfuscationReflectionHelper.java:92) ~[forgeSrc-1.9.4-12.17.0.1976.jar:?]
at This_is_Christmas.ThisisChristmas.load(ThisisChristmas.java:135) ~[bin/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_92]
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:568) ~[forgeSrc-1.9.4-12.17.0.1976.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_92]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:228) ~[forgeSrc-1.9.4-12.17.0.1976.jar:?]
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:206) ~[forgeSrc-1.9.4-12.17.0.1976.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_92]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) [LoadController.class:?]
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:767) [Loader.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:316) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:559) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:384) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_92]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_92]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_92]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.NullPointerException
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source) ~[?:1.8.0_92]
at sun.reflect.UnsafeBooleanFieldAccessorImpl.set(Unknown Source) ~[?:1.8.0_92]
at java.lang.reflect.Field.set(Unknown Source) ~[?:1.8.0_92]
at net.minecraftforge.fml.relauncher.ReflectionHelper.setPrivateValue(ReflectionHelper.java:139) ~[forgeSrc-1.9.4-12.17.0.1976.jar:?]
… 45 more
[14:25:59] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: –-- Minecraft Crash Report ----
// Would you like a cupcake?Time: 28/10/16 14:25
Description: Initializing gamenet.minecraftforge.fml.relauncher.ReflectionHelper$UnableToAccessFieldException: java.lang.NullPointerException
at net.minecraftforge.fml.relauncher.ReflectionHelper.setPrivateValue(ReflectionHelper.java:143)
at net.minecraftforge.fml.common.ObfuscationReflectionHelper.setPrivateValue(ObfuscationReflectionHelper.java:92)
at This_is_Christmas.ThisisChristmas.load(ThisisChristmas.java:135)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:568)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:228)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:206)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:767)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:316)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:559)
at net.minecraft.client.Minecraft.run(Minecraft.java:384)
at net.minecraft.client.main.Main.main(Main.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)
Caused by: java.lang.NullPointerException
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source)
at sun.reflect.UnsafeBooleanFieldAccessorImpl.set(Unknown Source)
at java.lang.reflect.Field.set(Unknown Source)
at net.minecraftforge.fml.relauncher.ReflectionHelper.setPrivateValue(ReflectionHelper.java:139)
… 45 moreA detailed walkthrough of the error, its code path and all known details is as follows:
– Head –
Thread: Client thread
Stacktrace:
at net.minecraftforge.fml.relauncher.ReflectionHelper.setPrivateValue(ReflectionHelper.java:143)
at net.minecraftforge.fml.common.ObfuscationReflectionHelper.setPrivateValue(ObfuscationReflectionHelper.java:92)
at This_is_Christmas.ThisisChristmas.load(ThisisChristmas.java:135)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:568)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:228)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:206)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:767)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:316)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:559)– Initialization –
Details:
Stacktrace:
at net.minecraft.client.Minecraft.run(Minecraft.java:384)
at net.minecraft.client.main.Main.main(Main.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)– System Details –
Details:
Minecraft Version: 1.9.4
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_92, Oracle Corporation
Java VM Version: Java HotSpot
64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 607713008 bytes (579 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP 9.28 Powered by Forge 12.17.0.1976 4 mods loaded, 4 mods active
States: ‘U’ = Unloaded ‘L’ = Loaded ‘C’ = Constructed ‘H’ = Pre-initialized ‘I’ = Initialized ‘J’ = Post-initialized ‘A’ = Available ‘D’ = Disabled ‘E’ = Errored
UCHI mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
UCHI FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.9.4-12.17.0.1976.jar)
UCHI Forge{12.17.0.1976} [Minecraft Forge] (forgeSrc-1.9.4-12.17.0.1976.jar)
UCHE This_is_Christmas{1.2} [This is Christmas] (bin)
Loaded coremods (and transformers):
GL info: ’ Vendor: ‘ATI Technologies Inc.’ Version: ‘4.5.14009 Compatibility Profile Context 21.19.151.3’ Renderer: ‘AMD Radeon R9 200 Series’
Launched Version: 1.9.4
LWJGL: 2.9.4
OpenGL: AMD Radeon R9 200 Series GL version 4.5.14009 Compatibility Profile Context 21.19.151.3, ATI Technologies Inc.
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.Using VBOs: No
Is Modded: Definitely; Client brand changed to ‘fml,forge’
Type: Client (map_client.txt)
Resource Packs:
Current Language: English (US)
Profiler Position: N/A (disabled)
CPU: net.minecraft.client.Minecraft$15@5bf8d583
[14:25:59] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: #@!@# Game crashed! Crash report saved to: #@!@# G:\Codage\Minecraft\This_is_Christmas\v1.3\MC1.9.4\run.\crash-reports\crash-2016-10-28_14.25.59-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed
Java HotSpot
64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future releaseEt pis j'ai eu peur d'un autre truc. J'ai testé dans un autre src en 1.8 où on peut modifier dirctement, et ma crainte s'est confirmé : il faut aussi modifier la température pour qu'il puisse neiger. Sauf que là, c'est tendu : chaque biome utilise une température différente défini dans son initialisation. Si on peut aussi modifier ça avec la reflection, ça serait bien mais je ne pense pas qu'on puisse. Sinon, j'avais pensé à un autre truc : j'avais pensé à supprimer les biomes existants et les recréer. Est-ce une bonne idée ? Y'aura t-il des problèmes de performance ? Des problèmes avec ce qui utilise ces biomes ? Des bugs ? J'attends vos réponses. Merci d'avance -
Il faut que ton instance de BiomeProperties ne soit pas null, la réflection marche avec à peu près tout
-
Je dois mal m’y prendre, ça ne marche pas.
Pour instancier BiomeProperties, il fallait un String. Du coup, j’ai fait ça :
java BiomeProperties plains = new BiomeProperties("Plains");et je pensais faire ça pour chaque biome si ça marche. J’ai essayé de modifier la température et de l’afficher, mais ça ne marche pas, elle reste comme elle a été mise par défaut. J’ai fait ```java
ObfuscationReflectionHelper.setPrivateValue(BiomeProperties.class, plains, 5.0F, “temperature”); -
Ça ne le modifie que pour cette instance, je ne sais pas si c’est celle-là qui est utilisée dans ton monde,j’ai pas regardé tout le poste
-
C’est la valeur enableSnow de Biome qu’il faut modifier et non de BiomeProperties.
-
Biome est une classe abstraite et on ne peux pas en instancier. Comme alternative, j’ai testé de faire :
[java] @EventHandler
public void load(FMLInitializationEvent event)
{
[…] testb a = new testb();
Biome b = a.biome;
ObfuscationReflectionHelper.setPrivateValue(Biome.class, b, true, “enableSnow”);
} -
Biome est une classe abstraite et on ne peut pas instancier de classe abstraite. J’ai essayer des alternatives :
testb a = new testb(); Biome b = a.biome; ObfuscationReflectionHelper.setPrivateValue(Biome.class, b, true, "enableSnow"); } public class testb { Biome biome; public Biome test1() { return biome; } }mais ça crash au lancement, NPE.
J’ai ensuite testé ```java
BiomeProperties bp = new BiomeProperties(“”);
Biome biome1 = new test(bp);
ObfuscationReflectionHelper.setPrivateValue(Biome.class, biome1, true, “enableSnow”);```java package This_is_Christmas; import net.minecraft.world.biome.Biome; public class test extends Biome{ public test(BiomeProperties properties) { super(properties); } }Là Minecraft se lance bien mais la neige n’est pas activée. Je le sais, pas parce qu’il pleut mais parce que dans ma classe d’évent j’ai mis
System.out.println("snow enable ? " + Biomes.PLAINS.getEnableSnow()); ``` et ça me met false, alors que j'ai testé sur un src en 1.8 d'activer la neige, et ça me met true, même s'il pleut. Si vous avez une idée, … Et pis même si on arrive à activée la neige, il ne neigera pas tant qu'on ne modifie pas la température. Et pour modifier la température, il faut modifier l'initialisation de chaque biome. Et là, ça devient tendu :/ C'est pas une critique mais je trouve que c'est bizarre que Forge n'est pas prévu ça. -
Tu ne dois pas créer une nouvelle instance mais modifier les instance existante.
Sinon ça ne risque pas de fonctionner.ObfuscationReflectionHelper.setPrivateValue(Biome.class, Biomes.PLAINS, true, “enableSnow”);
-
Salut
J’avais cru qu’il fallait prendre l’instance de Biome et modifier la valeur par défaut de enableSnow. C’est pour ça que je ne savais pas comment faire pour la tempérautre. Mais en fait, il faut prendre l’instance de chaque biome et les modifier. Merci
Du coup, j’ai fait comme ça :
ObfuscationReflectionHelper.setPrivateValue(Biome.class, Biomes.PLAINS, true, "enableSnow"); ObfuscationReflectionHelper.setPrivateValue(Biome.class, Biomes.PLAINS, 0.0F, "temperature");Je pense que tu seras d’accord avec moi sur le fait qu’avant c’était plus simple de modifier un biome.
Du coup, mes deux problèmes sont résolus. Merci à tous
-
Bah là, deux lignes, c’est pas très compliqué
-
Oui, c’est vrai, une fois qu’on a compris comment faire. Mais avant y’avais juste à faire ```java
BiomeGenBase.forest.temperature = 0.0F;
BiomeGenBase.forest.setEnableSnow(); -
Par contre ce que tu as fait là ne fonctionnera que sur eclipse.
Sur le jeu lancé depuis le launcher les variables sont obfusqué et ont comme nom field_xxx
Du-coup :ObfuscationReflectionHelper.setPrivateValue(Biome.class, Biomes.PLAINS, true, "enableSnow", "field_76766_R"); ObfuscationReflectionHelper.setPrivateValue(Biome.class, Biomes.PLAINS, 0.0F, "temperature", "field_76750_F"); -
A ce propos, j’ai ça :
GuiScreen parent = (GuiScreen)ObfuscationReflectionHelper.getPrivateValue(GuiModList.class, gui, "mainMenu");GuiModList.class étant une classe de fml, ses variables seront-elles obusquées aussi, et si oui, comment avoir le nom obfusqué ?
EDIT : Ou alors j’utilise la méthode avec le fieldIndex
-
Non les variables de fml/forge ne sont pas obfusqué.
-
@‘robin4002’:
Par contre ce que tu as fait là ne fonctionnera que sur eclipse.
Sur le jeu lancé depuis le launcher les variables sont obfusqué et ont comme nom field_xxx
Du-coup :ObfuscationReflectionHelper.setPrivateValue(Biome.class, Biomes.PLAINS, true, "enableSnow", "field_76766_R"); ObfuscationReflectionHelper.setPrivateValue(Biome.class, Biomes.PLAINS, 0.0F, "temperature", "field_76750_F");Ok merci, mais comment as-tu fait pour trouver les noms obfusqués ? Y’a t-il un fichier où sont inscrit les correspondances des noms obfusqués-déobfusqués ?
-
Soit tu utilise le logiciel de SCAREX : https://www.minecraftforgefrance.fr/showthread.php?tid=2774
Soit tu va ici : .gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\ -
Ok merci
