• Recently Browsing

    No registered users viewing this page.

  • Posts

    • So I've dived a bit more into the source code.   First off, there seem to be 3 ways to obtain an instance of FishingPredicate: A private constructor and a public static factory method (func_234640_a_) that seems to just invoke this constructor (whatever the reason for this particular design pattern might be). A serialization (func_234637_a_) and deserialization (func_234639_a_) method that handle JSONification of the object. An instance field (field_234635_a_) which seems to just be a fallback placeholder (similar to ANY in many other Predicates). Of these three only the 1st one (func_234640_a_) seems relevant to me, since I don't know where I'd get the required JSON for 2, and 3 just simply always returns true in the test method, which probably isn't what I want. The 1st one is also used in FishingLootTables, namely with the argument true.   Additionally the class contains the boolean field_234636_b_, which seems to determine what value of in_open_water the predicate is looking for. Given the call in FishingLootTables I mentioned above, this would make sense, since treasure loot should only be added if in_open_water is true.   Last, the class contains the test method (func_234638_a_), which for a FishingBobberEntity argument (such as mc.player.fishingBobber in my code) returns whether the above field_234636_b_ is equal to the result of a call to the argument's func_234605_g_(). This method simply returns the value of a private boolean field (FishingBobberEntity#field_234595_aq_), which in turn gets set in FishingBobberEntity#tick with a check that seems like it could be for open water. Unfortunately I can't access the function FishingBobberEntity#func_234603_b_ (which is part of this check) in my code, as it's private, but I believe that performs the open water check for a specific block. The most sensible explanation for me would therefore be that FishingBobberEntity#func_234605_g_ returns whether the player is currently fishing.   However, I decided to display the results of the test method in-game, and it didn't work as expected. Namely, my mod now contains the following code: @SubscribeEvent public void onRenderOverlay(RenderGameOverlayEvent.Text event) { if (mc.gameSettings.showDebugInfo) { ArrayList<String> leftText = event.getLeft(); ArrayList<String> rightText = event.getRight(); if (mc.player.fishingBobber != null) { // if player is currently fishing FishingPredicate alwaysTrue = FishingPredicate.field_234635_a_; // this will just always return true FishingPredicate notIOW = FishingPredicate.func_234640_a_(false); // this checks if in_open_water is false FishingPredicate isIOW = FishingPredicate.func_234640_a_(true); // this checks if in_open_water is true rightText.add(Boolean.toString(mc.player.fishingBobber.func_234605_g_())); // is bobber currently in open water? rightText.add(Boolean.toString(alwaysTrue.func_234638_a_(mc.player.fishingBobber))); rightText.add(Boolean.toString(notIOW.func_234640_a_(false).func_234638_a_(mc.player.fishingBobber))); rightText.add(Boolean.toString(isIOW.func_234640_a_(true).func_234638_a_(mc.player.fishingBobber))); } } } which checks the values of the methods I described. Unfortunately, func_234605_g_ just always returns true in-game, regardless of whether I'm fishing out in deep open water, or in a 2x2x1 pool I dug, or even on land. The predicates return values that fit this (so always returning true, false, true in the above code).
    • So i was playing on my modpack and one time the world just dosen;t load and crashes the game i dont know why pls help me latest.log crash-2021-01-25_18.56.20-server.txt
    • Hello, when I run runClient (or server) it shows this output. It was on first start (never  started without problems before). I was reinstalling JDK and googling it but I didn't find anything. I didn't find anybody with this errror. [2021-01-25 18:47:55] [INFO ] Natives: C:\Users\Jakub\Desktop\testing\build\natives [2021-01-25 18:47:55] [INFO ] Main Class: net.minecraft.launchwrapper.Launch [2021-01-25 18:47:55] [INFO ] Srg2Mcp: C:\Users\Jakub\Desktop\testing\build\createSrgToMcp\output.srg [2021-01-25 18:47:55] [INFO ] Extra: [] [2021-01-25 18:47:55] [INFO ] Running with arguments: [--version, 1.12, --assetIndex, 1.12, --assetsDir, C:\Users\Jakub\.gradle\caches\forge_gradle\assets, --accessToken, {REDACTED}, --userProperties, [], --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker] Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at net.minecraftforge.legacydev.Main.start(Main.java:86) at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap') at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) ... 6 more have I attach some files? I'm relatively new to programming (I was programming some basic MC plugins), so I will be grateful for any help.
    • Ok. Sorry for wasting your time if you came here to help. The issue was something gradle-related. I hadn't added a Gradle Nature to my project in eclipse so it just didn't work properly. If you're having this issue on eclipse, try right-clicking your project, clicking "add gradle nature", and then building it again. I'll mark this as solved now.
    • Ah. Thank you!
  • Topics

  • Who's Online (See full list)