Jump to content

Recommended Posts

Posted

Apparently the EntityPlayerExtended class that I have created is not updating the data properly. I only have it sync whenever data changes so it's not due to the data in a state of change. For some reason the client never recieves the data. Here are a few classes to look into. I'm not really sure where the issue could be. (Also ignore my bad server packet system)

EventManager# http://bit.ly/1UeWkGP

EntityPlayerExtended# http://bit.ly/1GT6lPQ

ClientPacketAndManager# http://bit.ly/1LYoTCs

 

You can view the rest of the source if you click one of the links above. I have uploaded the entire source into a git repo. Thanks to anyone who can help, this really is something that I don't understand too well.

Posted

I will note out all "bad" things in your code and ofc the issue with packets.

 

1. First things 1st - Java Name Convention (don't use capitals on non-static stuff, etc.)

2. In your player tick event ("public void onPlayerTick(TickEvent.PlayerTickEvent event)");

You are not setting phase - Every tick even has 2 phases - START and END - pick one, otherwise code runs twice per tick.

Also - you used static 500 ticks globally, but then you are using them for every player (player tick even is for every player), therefore faster decrementstion ("tick --;") Don't forget to settle that (I know it's beta).

3.

EntityPlayerExtended.get(player).sync();
	if(!player.worldObj.isRemote){

You could put sync() after check (and remove sync's check) jsut saying :D

 

4.

if(FMLCommonHandler.instance().getSide() == Side.CLIENT){
		BetaManager.doBetaCheck();
		network.registerMessage(PacketUpdateClientIEEPData.Handler.class, PacketUpdateClientIEEPData.class, 0, Side.CLIENT);
		MinecraftForge.EVENT_BUS.register(new OverlayInGame());
	}

This will not work on dedic, but I guess it is supposed to be that way? (I was checking if you registered msg).

 

5. I'd also like to note out: "playerLoginEvent(EntityJoinWorldEvent" - don't confuse those - there is separate PlayerLoggedInEvent. Just pointing out.

 

6. In packet's code: (not static)

    private static int XP, Level, difficulty;

 

I have no idea for 1.7.10, if it was 1.8 it would be threads problem (thread safety with netty).

 

I had a glance on those ServerPacketManager and events - you are doing some packet reading there, but I don't really get what's the point, could you explain? YOu might be breaking something somewhere where I don't (can't) see it.

1.7.10 is no longer supported by forge, you are on your own.

Posted

@Ernio

Ok, so i've went through and changed a good bit of code to match your recommendations(Other than the variable naming, I just don't care to change those atm.). I am still getting the issue but I have noticed that it doesn't seem to sync the player data when you login. After I set the difficulty in the gui it works fine but for some reason it isn't actually syncing properly before then. Oh, as for the server packet thingy, basically it sends the player difficulty to the server so that the server can update the player on it's end.

If it were my guess i'd say the issue was in the entity created or the entity constructed event but I can't really be sure. I've updated my new code so that you can get a better idea as to where i'm at now.

 

EDIT: I did move network.registerMessage() out of only being called on the client side. It is now called on both.

Also, you can see here that the data is correct on the server side but on the client side it's still reverted to it's defaults... https://i.pitter.us/khANHQv4e/jgxunwzGC.png

 

EDIT: I have tried tracing the issue to it's root cause and I think that I may have found it but i'm not sure how to fix it. I was able to trace it back into the packet itself. The packet can send the data but it seems the client never recieves it to begin with. You can see where I am pointing these out here. http://bit.ly/1HAiZrI

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I can't figure out if you're looking for help trying to steal someone elses work, or cheat at the game....
    • Title: Why Is It So Hard to Rename and Restructure Mods Like Xray or AntiXray? 🤔 Post text: Hey everyone! I’ve been digging into Minecraft modding for a while and have one big question that I can’t figure out on my own. Maybe someone with more experience could help or give me some advice. Here’s the issue: When I take a “normal” Minecraft mod — for example, one that just adds some blocks or new items — I can easily change its structure, package names, or even rebrand it entirely. It’s straightforward. But as soon as I try this with cheat-type mods like XrayMod or AntiXray, everything falls apart. Even if I just rename the classes, refactor the packages, or hide its identity somehow, the mod either breaks or stops working properly. XrayMod in particular is proving to be a nightmare to modify without losing its core function. So my question is — why is this so much harder with cheat mods like Xray? Is there something fundamentally different about how they’re coded, loaded, or protected that prevents simple renaming or restructuring? And if so, how can I actually learn to understand someone else’s cheat mod enough to safely refactor it without breaking the core features? I’ve already been spending over two months trying to figure this out and haven’t gotten anywhere. It feels like there must be some trick or knowledge I’m missing. Would really appreciate any thoughts, tips, or references — maybe there are guides or techniques for understanding cheat-mod internals? Or if you’ve successfully “disguised” a cheat mod like Xray before, I’d love to hear how you did it. Thanks in advance for any help or discussion. ✌️
    • just started making cinamatic contect check it out on my channel or check out my facebook page    Humbug City Minecraft Youtube https://www.youtube.com/watch?v=v2N6OveKwno https://www.facebook.com/profile.php?id=61575866982337  
    • Where did you get the schematic? Source/Link? And do use an own modpack or a pre-configured from curseforge? If yes, which one On a later time, I can make some tests on my own - but I need the schematic and the modpack name
  • Topics

×
×
  • Create New...

Important Information

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