Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException: net.minecraft.client.entity.EntityClientPlayerMP cannot be cast to net.minecraft.entity.player.EntityPlayerMP #507

Open
kratz74 opened this issue Sep 13, 2016 · 5 comments

Comments

@kratz74
Copy link

kratz74 commented Sep 13, 2016

Used MyTown2{1.7.10-0.5.0b} with lotr{Beta v29.6 for Minecraft 1.7.10} and TConstruct{1.7.10-1.8.8.build988}. Latest 1.7.10 versions of all those mods were used.
An attempt to harvest whole tree using Lumber Axe (the big one) from TConstruct in LOTR world caused

java.lang.ClassCastException: net.minecraft.client.entity.EntityClientPlayerMP cannot be cast to net.minecraft.entity.player.EntityPlayerMP
    at mytown.handlers.Ticker.onPlayerBreaksBlock(Ticker.java:78)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler_93_Ticker_onPlayerBreaksBlock_BreakEvent.invoke(.dynamic)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
    at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
    at tconstruct.items.tools.LumberAxe.breakTree(LumberAxe.java:173)
    at tconstruct.items.tools.LumberAxe.onBlockStartBreak(LumberAxe.java:101)
    at net.minecraft.client.multiplayer.PlayerControllerMP.func_78751_a(PlayerControllerMP.java:96)
    at net.minecraft.client.multiplayer.PlayerControllerMP.func_78759_c(PlayerControllerMP.java:247)
    at net.minecraft.client.Minecraft.func_147115_a(Minecraft.java:1357)
    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1967)
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:973)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)
    at net.minecraft.client.main.Main.main(SourceFile:148)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

to be thrown on client side. This exception kills client.
This is not happening in vanilla worlds.

@kratz74
Copy link
Author

kratz74 commented Sep 13, 2016

fix.zip
Here is patch against 0.5.0b which works for me.

Looks like it was not expected in the code to recieve such an event on client side where EntityClientPlayerMP is used instead of EntityPlayerMP. Maybe this event can be ignored at all on client, but I did not have enough time to look into this code deeper.
Please fix this ASAP because it's a show stopper.

@Eufranio
Copy link

Eufranio commented Oct 2, 2016

I just banned Lumber Axe, because it causes a StackOverflow when cancelling break events (breaking a tree near a town)

@kratz74
Copy link
Author

kratz74 commented Nov 28, 2016

I'm still using Lumber Axe in my modpack. I'm fixing all MyTown2 issues myself. Maybe I'll create my own MyTown2 fork with all those changesets to make them public. Or project owners can give me rights to push them here. It's up to them.

@Eufranio
Copy link

You could create, I'm fixing stuff too, would be cool for server owners.

@kratz74
Copy link
Author

kratz74 commented Oct 7, 2017

https://github.com/kratz74/MyTown2 is my fork with few things fixed including this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants