Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Solved][1.7.10]Why is this check for armor always returning true?


jabelar
 Share

Recommended Posts

Okay, I simply want to check if certain armor is being worn, but for some reason this statement is returning true even with nothing equipped at all.  I'm not sure why the null check doesn't return false in the first place, and even more confused why it considers the unlocalized name matched.  I know there is nothing equipped because I check but also am doing fresh world where I don't even have the armor anywhere in my inventory (equipped or not).

 

    		if (thePlayer.getCurrentArmor(0) != null && thePlayer.getCurrentArmor(0).getUnlocalizedName().equals(MagicBeans.bootsOfSafeFalling.getUnlocalizedName()));
    		{
    			// DEBUG
    			System.out.println(MagicBeans.bootsOfSafeFalling.getUnlocalizedName()+" equipped.");
                }

 

The console prints out: item.boots_of_safe_falling equipped.

 

Maybe I'm just going cross-eyed from 3 days straight programming, but shouldn't the the null check return false if nothing is equipped?  And how could the string equals return true with nothing in the armor slot?

 

Another weird thing is that if I change the println to thePlayer.getCurrentArmor(0).getUnlocalizedName()+" equipped." I get a null pointer exception on that line.  But that seems strange because the expression in the if expression evaluated without an exception.

 

Note I've tried many other variations on this check.  I've tried checking if the item itself was equals (using both == and .equals() method).  I tried comparing methods from items and itemstacks.

 

Help!

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

For Items, it is much more efficient to check identity:

ItemStack stack = thePlayer.getCurrentArmor(0);
if (stack != null && stack.getItem() == MagicBeans.bootsOfSafeFalling) {
System.out.println(stack.getDisplayName() + " equipped.");
}

 

If I may ask, where are you getting 'thePlayer' from, and in what context is your code being run (e.g. Item#onUpdate, packet, etc.) ?

Link to comment
Share on other sites

Why do you compare unlocalized names?!

And that line you said causes an exception does not exist in the snippet you posted.

 

unlocalized names was the last thing I tried.  I first tried to equate the items with:

if (thePlayer.getCurrentArmor(0) != null && thePlayer.getCurrentArmor(0).getItem() != null && thePlayer.getCurrentArmor(0).getItem() == MagicBeans.bootsOfSafeFalling);

And also using .equals

if (thePlayer.getCurrentArmor(0) != null && thePlayer.getCurrentArmor(0).getItem() != null && thePlayer.getCurrentArmor(0).getItem().equals(MagicBeans.bootsOfSafeFalling));

 

I guess I can try instanceof but I have several similar items using same class so not really cleanest way.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

For Items, it is much more efficient to check identity:

ItemStack stack = thePlayer.getCurrentArmor(0);
if (stack != null && stack.getItem() == MagicBeans.bootsOfSafeFalling) {
System.out.println(stack.getDisplayName() + " equipped.");
}

 

If I may ask, where are you getting 'thePlayer' from, and in what context is your code being run (e.g. Item#onUpdate, packet, etc.) ?

 

Yeah, I actually started with using == as i just replied to diesieben07.

 

This is in LivingFallEvent so thePlayer is from the event parameter.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

You should never need to check if an ItemStack's getItem() method returns null - if the stack itself is not null, it is guaranteed to have a valid Item.

 

Can you show your full LivingFallEvent code? (another btw, LivingFallEvent is not posted in creative mode - for that, you must also subscribe to PlayerFlyableFallEvent).

Link to comment
Share on other sites

You should never need to check if an ItemStack's getItem() method returns null - if the stack itself is not null, it is guaranteed to have a valid Item.

 

I added the additional check while debugging.  Initially I simply had

if (thePlayer.getCurrentArmor(0) != null && thePlayer.getCurrentArmor(0) == MagicBeans.bootsOfSafeFalling);

 

And to prove that my armor is not actually equipped, here is screenshot during testing just now:

http://s13.postimg.org/8r6wpp8tz/Capture4.png

 

Regarding the creative mode, yeah the way I'm testing the fall event is to go to creative and then fly up kinda high then switch game mode to 0 which causes me to drop.

 

My full method for the fall event is:

 @SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true)
    public void onEvent(LivingFallEvent event)
    {
    	if (!event.entityLiving.worldObj.isRemote && event.entityLiving instanceof EntityPlayer)
    	{
    		EntityPlayer thePlayer = (EntityPlayer) event.entityLiving;
    		if (thePlayer.getCurrentArmor(0) != null && thePlayer.getCurrentArmor(0).getItem() == MagicBeans.bootsOfSafeFalling);
    		{
    			// DEBUG
    			System.out.println("LivingFallEvent handled due to having safe falling armor equipped");
    			event.distance = 0.0F ;
    		}
    	}
        
    }

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

That's pretty bizarre.

 

What do you get if you put 'System.out.println("CurrentArmor(0): " + thePlayer.getCurrentArmor(0));' ?

 

EDIT: Just tried it myself, and it is completely inexplicable:

if (!event.entityLiving.worldObj.isRemote && event.entityLiving instanceof EntityPlayer)
    	{
    		EntityPlayer thePlayer = (EntityPlayer) event.entityLiving;
    		ItemStack stack = thePlayer.getCurrentArmor(0);
    		System.out.println("Stack = " + stack);
    		if (stack != null && stack.getItem() == ZSSItems.bootsHeavy);
    		{
    			// DEBUG
    			System.out.println("LivingFallEvent handled due to having safe falling armor equipped: " + stack);
    			event.distance = 0.0F ;
    		}
    	}

 

Output:

[14:59:58] [server thread/INFO] [sTDOUT]: [zeldaswordskills.handler.ZSSEntityEvents:onFall:78]: Stack = null
[14:59:58] [server thread/INFO] [sTDOUT]: [zeldaswordskills.handler.ZSSEntityEvents:onFall:82]: LivingFallEvent handled due to having safe falling armor equipped: null

Link to comment
Share on other sites

Hmm, I went back to my original code (from github, so is same as I started with exactly) but it seems to be working now for some reason!  If I have nothing in boot slot then there is no console output, if I put vanilla boots in slot there is no console output, and if I put in my boots it has console output.  So, yeah, working...

 

Maybe I overlooked something when testing originally.  I'll do a bit more testing before I consider it solved.

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

That's pretty bizarre.

 

What do you get if you put 'System.out.println("CurrentArmor(0): " + thePlayer.getCurrentArmor(0));' ?

 

EDIT: Just tried it myself, and it is completely inexplicable:

if (!event.entityLiving.worldObj.isRemote && event.entityLiving instanceof EntityPlayer)
    	{
    		EntityPlayer thePlayer = (EntityPlayer) event.entityLiving;
    		ItemStack stack = thePlayer.getCurrentArmor(0);
    		System.out.println("Stack = " + stack);
    		if (stack != null && stack.getItem() == ZSSItems.bootsHeavy);
    		{
    			// DEBUG
    			System.out.println("LivingFallEvent handled due to having safe falling armor equipped: " + stack);
    			event.distance = 0.0F ;
    		}
    	}

 

Output:

[14:59:58] [server thread/INFO] [sTDOUT]: [zeldaswordskills.handler.ZSSEntityEvents:onFall:78]: Stack = null
[14:59:58] [server thread/INFO] [sTDOUT]: [zeldaswordskills.handler.ZSSEntityEvents:onFall:82]: LivingFallEvent handled due to having safe falling armor equipped: null

 

Doh, I figured it out.  There is actually a typo in the code.  You want me to tell you what it is, or do you want the satisfaction of finding it yourself?  It is kinda a silly mistake but also the type of thing that could be dangerous if you miss it...

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

I see the typo :D i had a similar problem a few weeks ago.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

[me=diesieben07]mumbles something about braces on newlines being stupid[/me]

 

Yeah well, I've never understood the aversion to it though.  I find code much more readable if it is spaced out generally (I'll even put whitespace in my code).  I'm a touch typist so it takes me no extra time to go to next line.  In the old days, vertical screen resolution was low so it was important to compress the vertical space, and I know some people have problem with understanding code that goes more than one screen, but I find that space helps me more.  Anyway, this is one argument that has been around since dawn of languages like C and I can't find any compelling argument for either way.

 

Anyway, back to the thread topic: the error is of course that there is semicolon after the if expression thereby terminating it and letting code execution fall through to next block always.  This happened because I cut and past from another line where I had previously been assigning it to a boolean.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

[me=diesieben07]mumbles something about braces on newlines being stupid[/me]

 

I agree and so does (at least one of) my friends.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

[me=diesieben07]mumbles something about braces on newlines being stupid[/me]

LOL!!! Nice one. Well, I DID copy / paste your code to make sure I could replicate the problem, and... <smacks forehead>.

 

Personally, I usually only use a newline before a brace in my class declarations; everywhere else they get inlined.

Link to comment
Share on other sites

CUDDLE THOSE BRACES! *Shakes a fist*

Then again, the place I had it happen had the semi-colon hiding next to the curly brace anyway.  Took a while to find. ^..^;

Fortunately I knew where the code was going wrong, so it made the problem easier to locate (specifically, I knew a loop was running forever because the content was never executing and if it did, even once, it was guaranteed to cause an exit condition).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I want to remove or off all what connected with a health bar, that means I want to off showing of getting damage (all damage) on health bar. That will give invincibility. Then I want to off showing of health bar. And (that moment you shouldn't comment, but must to consider) finally I want to create 2 new bars, which will be connected with getting damage and some others. How to do it? Version 1.19.2
    • Hello I have no Idea What to do but Uhh I want a minecraft server. Yeah. please respond to this with some instructions because i am very confused and dont know what to do
    • That's because the item renderer is handled different than the block renderer. The block renderer, for TNT, uses the rendertype_entity_cutout shader, which applies the overlay texture. The item renderer, on the other hand, for a standard item would use rendertype_item_entity_translucent_cull, which while having the field for the overlay texture (denoted as texCoord1), is never used in the fragment shader. You would need to implement part of the rendering code yourself to use a render type or shader with the overlay texture applied. However, if you are only doing this for one model, this could be simply achieved using item properties by having an all white texture.
    • I'm making my own MOD using Geckolib, but when I start it as a test, it works fine, but when I put it in the Minecraft app, it doesn't start and crashes. crash report ---- Minecraft Crash Report ---- // Who set us up the TNT? Time: 22/09/27 13:38 Description: Mod loading error has occurred java.lang.Exception: Mod Loading has failed     at net.minecraftforge.fml.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:71) [?:?] {re:classloading}     at net.minecraftforge.fml.client.ClientModLoader.completeModLoading(ClientModLoader.java:174) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.lambda$null$1(Minecraft.java:508) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft$$Lambda$4172/899120039.run(Unknown Source) [?:?] {}     at net.minecraft.util.Util.func_215077_a(Util.java:320) [?:?] {re:classloading}     at net.minecraft.client.Minecraft.lambda$new$2(Minecraft.java:504) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft$$Lambda$3963/1223907812.accept(Unknown Source) [?:?] {}     at net.minecraft.client.gui.ResourceLoadProgressGui.func_230430_a_(ResourceLoadProgressGui.java:113) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.func_195458_a(GameRenderer.java:481) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:977) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:184) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:37) [forge-1.16.5-36.2.39.jar:36.2] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$457/2095970915.call(Unknown Source) [forge-1.16.5-36.2.39.jar:36.2] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace:     at com.Kujira.minepiece.Items.SeaStoneIngot.<init>(SeaStoneIngot.java:8) ~[?:?] {re:classloading} -- MOD minepiece -- Details:     Mod File: MinePiece.jar     Failure message: MinePiece Mod (minepiece) encountered an error during the load_registries event phase         java.lang.NoSuchMethodError: net.minecraft.item.Item$Properties.tab(Lnet/minecraft/item/ItemGroup;)Lnet/minecraft/item/Item$Properties;     Mod Version: 1.0.0     Mod Issue URL: NOT PROVIDED     Exception message: java.lang.NoSuchMethodError: net.minecraft.item.Item$Properties.tab(Lnet/minecraft/item/ItemGroup;)Lnet/minecraft/item/Item$Properties; Stacktrace:     at com.Kujira.minepiece.Items.SeaStoneIngot.<init>(SeaStoneIngot.java:8) ~[?:?] {re:classloading}     at com.Kujira.minepiece.regi.MinePieceItems$Register.registerItems(MinePieceItems.java:25) ~[?:?] {re:classloading}     at net.minecraftforge.eventbus.ASMEventHandler_17_Register_registerItems_Register.invoke(.dynamic) ~[?:?] {}     at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.eventbus.EventBus$$Lambda$3476/1916974029.invoke(Unknown Source) ~[?:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:106) ~[?:36.2] {re:classloading}     at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:107) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModContainer$$Lambda$3105/752772379.run(Unknown Source) ~[?:?] {}     at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1618) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:42) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:26) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:235) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:222) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:188) ~[?:?] {re:classloading}     at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$1(ClientModLoader.java:89) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2920/168398198.run(Unknown Source) ~[?:?] {}     at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:109) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2921/1088649990.run(Unknown Source) ~[?:?] {}     at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:89) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.<init>(Minecraft.java:437) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:149) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:37) [forge-1.16.5-36.2.39.jar:36.2] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$457/2095970915.call(Unknown Source) [forge-1.16.5-36.2.39.jar:36.2] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {} -- MOD minepiece -- Details:     Mod File: MinePiece.jar     Failure message: MinePiece Mod (minepiece) encountered an error during the error event phase         java.lang.NoSuchMethodError: net.minecraft.entity.EntityType$Builder.of(Lnet/minecraft/entity/EntityType$IFactory;Lnet/minecraft/entity/EntityClassification;)Lnet/minecraft/entity/EntityType$Builder;     Mod Version: 1.0.0     Mod Issue URL: NOT PROVIDED     Exception message: java.lang.NoSuchMethodError: net.minecraft.entity.EntityType$Builder.of(Lnet/minecraft/entity/EntityType$IFactory;Lnet/minecraft/entity/EntityClassification;)Lnet/minecraft/entity/EntityType$Builder; Stacktrace:     at com.Kujira.minepiece.entity.ModEntityTypes.lambda$static$0(ModEntityTypes.java:19) ~[?:?] {re:classloading}     at com.Kujira.minepiece.entity.ModEntityTypes$$Lambda$3118/1730752382.get(Unknown Source) ~[?:?] {}     at net.minecraftforge.registries.DeferredRegister.lambda$register$0(DeferredRegister.java:110) ~[?:?] {re:classloading}     at net.minecraftforge.registries.DeferredRegister$$Lambda$3090/1983063045.get(Unknown Source) ~[?:?] {}     at net.minecraftforge.registries.DeferredRegister.addEntries(DeferredRegister.java:186) ~[?:?] {re:classloading}     at net.minecraftforge.registries.DeferredRegister.access$000(DeferredRegister.java:47) ~[?:?] {re:classloading}     at net.minecraftforge.registries.DeferredRegister$EventDispatcher.handleEvent(DeferredRegister.java:158) ~[?:?] {re:classloading}     at net.minecraftforge.eventbus.ASMEventHandler_0_EventDispatcher_handleEvent_Register.invoke(.dynamic) ~[?:?] {}     at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.eventbus.EventBus$$Lambda$3476/1916974029.invoke(Unknown Source) ~[?:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:106) ~[?:36.2] {re:classloading}     at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:107) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModContainer$$Lambda$3105/752772379.run(Unknown Source) ~[?:?] {}     at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1618) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:42) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:26) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:235) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:222) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:188) ~[?:?] {re:classloading}     at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$1(ClientModLoader.java:89) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2920/168398198.run(Unknown Source) ~[?:?] {}     at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:109) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2921/1088649990.run(Unknown Source) ~[?:?] {}     at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:89) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.<init>(Minecraft.java:437) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:149) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:37) [forge-1.16.5-36.2.39.jar:36.2] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$457/2095970915.call(Unknown Source) [forge-1.16.5-36.2.39.jar:36.2] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {} -- System Details -- Details:     Minecraft Version: 1.16.5     Minecraft Version ID: 1.16.5     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 886955560 bytes (845 MB) / 2147483648 bytes (2048 MB) up to 2147483648 bytes (2048 MB)     CPUs: 8     JVM Flags: 10 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -XX:+IgnoreUnrecognizedVMOptions -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     ModLauncher: 8.1.3+8.1.3+main-8.1.x.c94d18ec     ModLauncher launch target: fmlclient     ModLauncher naming: srg     ModLauncher services:          /mixin-0.8.4.jar mixin PLUGINSERVICE          /eventbus-4.0.0.jar eventbus PLUGINSERVICE          /forge-1.16.5-36.2.39.jar object_holder_definalize PLUGINSERVICE          /forge-1.16.5-36.2.39.jar runtime_enum_extender PLUGINSERVICE          /accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE          /forge-1.16.5-36.2.39.jar capability_inject_definalize PLUGINSERVICE          /forge-1.16.5-36.2.39.jar runtimedistcleaner PLUGINSERVICE          /mixin-0.8.4.jar mixin TRANSFORMATIONSERVICE          /forge-1.16.5-36.2.39.jar fml TRANSFORMATIONSERVICE      FML: 36.2     Forge: net.minecraftforge:36.2.39     FML Language Providers:          javafml@36.2         minecraft@1
    • Ok so the game has run but when I create world, after loading terrain and joining the world,  the screen went gray and after a few minutes it kicked me out and say "Invalid player data". Could you help me?
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.