Jump to content

[1.7.10] ExtendedEntityProperties


sosoh

Recommended Posts

Hi, I'm french so sorry for my English I'll do my best, I'v done some ExtendedEntityProperties but they aren't saved when I die or leave the game. My event work 'cause I've put some System.out in different parts and it worked. There is my code:

http://pastebin.com/LaGZ5sbb http://pastebin.com/2HLcpyQ7 http://pastebin.com/tsWihcuM Ask me if you want more class. I hope you will help me! :) PS: I've already done a post on the french forum: http://www.minecraftforgefrance.fr/showthread.php?tid=2023

I'm a Potterhead.

Link to comment
Share on other sites

I don't quite have time to look super-deep in your code, but for one I can tell - you are either doing very oldschool stuff, or simply learned from old tutorial.

 

Going through all you got:

- your IEEP is cool, your nbtLoad and wirte are cool.

- remove your whole joined world, and whatever else stuff (like your storage-proxy) - this is the old school I've been talking about.

 

Now what you're gonna do:

Use:

@SubscribeEvent
public void playerClone(PlayerEvent.Clone event)
{
IEEP epNew = IEEP.get(event.entityPlayer);
IEEP epOld = IEEP.get(event.original);
//copy your data
}

Above will copy IEEP data from old dead entity to new one constructed after death.

 

This is all you need, you should NEVER EVER have to call neither load or save methods in your IEEP, just make sure they work, and leave them.

 

Note: In Clone event - don't write and read, you can transfer data directly like intFromNew = intFromOld (just saying because many do that).

 

EDIT:

To just ensure you write your stuff well - you can paste it here when you're done or have problems.

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

Link to comment
Share on other sites

Thanks for your help, so I delete all my old stuff (events, stuffs in the Common Proxy ect) and i just put your code? Eclipse doesn't find the event PlayerEvent.Clone :/ May I change in PlayerEvent.PlayerRespawnEvent?

I'm a Potterhead.

Link to comment
Share on other sites

net.minecraftforge.event.entity.player.PlayerEvent.Clone

 

You sure? It might have been added in 1.8. If it is the reason, there is still better workaround than what you are doing now. Just check if you didn't import FML events (there are two PlayerEvent.class)

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

Link to comment
Share on other sites

Oh yeah thanks, bad PlayerEvent.class, I've done that, it's working but not when I disconnect/reconnect :/

@SubscribeEvent

  public void playerClone(PlayerEvent.Clone event)

  {

      ExtendedEntityProps epNew = ExtendedEntityProps.get(event.entityPlayer);

      ExtendedEntityProps epOld = ExtendedEntityProps.get(event.original);

      epNew.mana = epOld.mana;

      epNew.maxMana = epOld.maxMana;

      epNew.spellLeft = epOld.spellLeft;

      epNew.spellRight = epOld.spellRight;

      epNew.spellsList = epOld.spellsList;

  }

I'm a Potterhead.

Link to comment
Share on other sites

Post new code. You can try making prints in write/read methods (print whole NBT).

 

 

EDIT NOTE

For future - I've noticed you are doing side-checking in events that are only server-sided (e.g LoggedOut). Remember that not all events are sided. One more important thing is some events (tick mostly) have Phases, have that in mind.

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

Link to comment
Share on other sites

Well my code is the same as the code at the top, but I'd to put the PlayerEvent.Clone on an other class because I need both imports. The other class:

[embed=425,349]package fr.sosoh.hogsmod.common.event;

 

import net.minecraftforge.event.entity.player.PlayerEvent;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.eventhandler.SubscribeEvent;

import fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps;

 

public class EventHandlerMain {

 

  @SubscribeEvent

  public void playerClone(PlayerEvent.Clone event)

  {

      ExtendedEntityProps epNew = ExtendedEntityProps.get(event.entityPlayer);

      ExtendedEntityProps epOld = ExtendedEntityProps.get(event.original);

     

      epNew.maxMana = epOld.maxMana;

      epNew.spellLeft = epOld.spellLeft;

      epNew.spellRight = epOld.spellRight;

      epNew.spellsList = epOld.spellsList;

  }

   

}[/embed] And I've already put some system.out and it appeares that my saveNBTData is used when nothing happend:

 

[01:07:15] [server thread/INFO] [sTDOUT]: [fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps:saveNBTData:79]: saveNBT

[01:07:15] [server thread/INFO] [sTDOUT]: [fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps:saveNBTData:79]: saveNBT

[01:08:00] [server thread/INFO] [sTDOUT]: [fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps:saveNBTData:79]: saveNBT

[01:08:00] [server thread/INFO] [sTDOUT]: [fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps:saveNBTData:79]: saveNBT

[01:08:45] [server thread/INFO] [sTDOUT]: [fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps:saveNBTData:79]: saveNBT

[01:08:45] [server thread/INFO] [sTDOUT]: [fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps:saveNBTData:79]: saveNBT

[01:09:30] [server thread/INFO] [sTDOUT]: [fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps:saveNBTData:79]: saveNBT

[01:09:30] [server thread/INFO] [sTDOUT]: [fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps:saveNBTData:79]: saveNBT

 

 

Maybe I can send you my source folder ?

I'm a Potterhead.

Link to comment
Share on other sites

When someone can't find the problem, the problem is most likely elsewhere. Post everything related to your IEEP in pastebin or <code>.

 

Nbt saving is almost "random", it happens when you stop game, every some time (in ticks) and few other ocasions (loggionOut).

 

EDIT

(print whole NBT).

Literally, you can print NBTTag, see what you get.

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

Link to comment
Share on other sites

There is what I've got:

[14:14:38] [server thread/INFO] [sTDOUT]: [fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps:saveNBTData:79]: save{spellRight:"",Mana:0.0d,spellLeft:"",Spells:[0:"Accio",1:"Repulso",2:"Protego",],MaxMana:1000.0d,}

[14:14:38] [server thread/INFO] [sTDOUT]: [fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps:saveNBTData:79]: save{spellRight:"",Mana:0.0d,spellLeft:"",Spells:[0:"Accio",1:"Repulso",2:"Protego",],MaxMana:1000.0d,}

[14:14:38] [server thread/INFO]: Saving worlds

[14:14:38] [server thread/INFO]: Saving chunks for level 'Nouveau monde'/Overworld

[14:14:38] [server thread/INFO]: Saving chunks for level 'Nouveau monde'/Nether

[14:14:38] [server thread/INFO]: Saving chunks for level 'Nouveau monde'/The End

[14:14:38] [server thread/INFO] [FML]: Unloading dimension 0

[14:14:38] [server thread/INFO] [FML]: Unloading dimension -1

[14:14:38] [server thread/INFO] [FML]: Unloading dimension 1

[14:14:38] [server thread/INFO] [FML]: Applying holder lookups

[14:14:38] [server thread/INFO] [FML]: Holder lookups applied

[14:15:08] [server thread/INFO]: Starting integrated minecraft server version 1.7.10

[14:15:08] [server thread/INFO]: Generating keypair

[14:15:08] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance

[14:15:08] [server thread/INFO] [FML]: Applying holder lookups

[14:15:08] [server thread/INFO] [FML]: Holder lookups applied

[14:15:08] [server thread/INFO] [FML]: Loading dimension 0 (Nouveau monde) (net.minecraft.server.integrated.IntegratedServer@4a85f46d)

[14:15:08] [server thread/INFO] [FML]: Loading dimension 1 (Nouveau monde) (net.minecraft.server.integrated.IntegratedServer@4a85f46d)

[14:15:09] [server thread/INFO] [FML]: Loading dimension -1 (Nouveau monde) (net.minecraft.server.integrated.IntegratedServer@4a85f46d)

[14:15:09] [server thread/INFO]: Preparing start region for level 0

[14:15:10] [server thread/INFO]: Preparing spawn area: 96%

[14:15:10] [server thread/INFO]: Changing view distance to 8, from 10

[14:15:10] [Netty Client IO #1/INFO] [FML]: Server protocol version 1

[14:15:10] [Netty IO #3/INFO] [FML]: Client protocol version 1

[14:15:10] [Netty IO #3/INFO] [FML]: Client attempting to join with 4 mods : [email protected],[email protected],[email protected],[email protected]

[14:15:10] [Netty IO #3/INFO] [FML]: Attempting connection with missing mods [] at CLIENT

[14:15:10] [Netty Client IO #1/INFO] [FML]: Attempting connection with missing mods [] at SERVER

[14:15:10] [server thread/INFO] [FML]: [server thread] Server side modded connection established

[14:15:10] [Client thread/INFO] [FML]: [Client thread] Client side modded connection established

[14:15:11] [server thread/INFO] [sTDOUT]: [fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps:loadNBTData:94]: load{spellRight:"",Mana:0.0d,spellLeft:"",Spells:[0:"Accio",1:"Repulso",2:"Protego",],MaxMana:1000.0d,}

[14:15:11] [server thread/INFO]: sosoh[local:E:7def91e3] logged in with entity id 190710 at (289.5, 4.0, 244.5)

[14:15:11] [server thread/INFO]: sosoh joined the game

[14:15:12] [server thread/INFO]: Saving and pausing game...

[14:15:12] [server thread/INFO] [sTDOUT]: [fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps:saveNBTData:79]: save{spellRight:"",Mana:0.0d,spellLeft:"",Spells:[],MaxMana:1000.0d,}

[14:15:12] [server thread/INFO] [sTDOUT]: [fr.sosoh.hogsmod.common.entity.props.ExtendedEntityProps:saveNBTData:79]: save{spellRight:"",Mana:0.0d,spellLeft:"",Spells:[],MaxMana:1000.0d,}

I'm a Potterhead.

Link to comment
Share on other sites

OH MY GOD. (note - previous shit I wrote was totally wrong):

 

NBTTagList list = compound.getTagList("Spells", Constants.NBT.TAG_STRING);

 

compound != properties

 

This is like 3rd same mistake I see this week. How could I miss it :P

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Does it work without natures_spirit and/or spectrum / adventurez?
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system
    • (i originally submitted this report to CurseForge but since we localized the issue to the modloader they pointed us here)  I am the partner of the user, GalaxyReach, assisting them as they are not as tech savvy. We have spent days troubleshooting a very weird issue that none of our other friends have with a certain modloader.  On a curse-forge launched instance of the Minecraft Launcher, clicking "play" throws an error code 1: crash log says EXCEPTION_ACCESS_VIOLATION. This exception happens in a blank, no-mods test pack as well as manually installing Forge. This issue also happens on NeoForge. We tried All of the steps withing this guide: https://support.curseforge.com/en/support/solutions/articles/9000218027-issues-related-to-the-forge-modloader namely: reinstalling the modpack reinstalling minecraft & curseforge deleting curseforge appdata updating the drivers updating the firewall the computer has been restarted several times we have tried running it on different networks manually installing & selecting java manually installing forge I don't think it is a specs/hardware issue, its a pretty good laptop (HP Omen), 16GB RAM & a 3060. It runs windows 11. Further, launching minecraft like normal through the Microsoft Store runs the game just fine. It is solely with trying to use a modded launch with Forge & NeoForge. I also tried different versions of Forge, though the specific instance I am trying to get running is 47.3.0 Is there anything else we can do here or does Forge just truly not work on this laptop?   Thank you MINECRAFT LAUNCHER GAME OUTPUT LOG 10:07:33.755 launcher main Version does not support log configuration, will assume one plaintext entry per line 10:07:36.419 game 2024-08-31 10:07:36,408 main WARN Advanced terminal features are not available in this environment 10:07:36.586 game [10:07:36] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, GalaxyReach, --version, forge-47.3.0, --gameDir, C:\Users\Micha\curseforge\minecraft\Instances\Liminal Server, --assetsDir, C:\Users\Micha\curseforge\minecraft\Install\assets, --assetIndex, 5, --uuid, 7f099235327e4206afdfbc22c7712328, --accessToken, ????????, --clientId, OWEyZTE3Y2MtOTZiOC00MWMwLWFkZjYtNmY2MDU2NmIxNDAz, --xuid, 2535442900827884, --userType, msa, --versionType, release, --width, 854, --height, 480, --quickPlayPath, C:\Users\Micha\curseforge\minecraft\Install\quickPlay\java\1725124053749.json, --launchTarget, forgeclient, --fml.forgeVersion, 47.3.0, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] 10:07:36.593 game [10:07:36] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.11 by Oracle Corporation; OS Windows 11 arch amd64 version 10.0 10:07:37.363 game [10:07:37] [main/INFO] [ne.mi.fm.lo.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow 10:07:37.452 game [10:07:37] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6 10:07:37.503 game # 10:07:37.503 game # A fatal error has been detected by the Java Runtime Environment: 10:07:37.503 game # 10:07:37.503 game # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff8a76f59f0, pid=13980, tid=12732 10:07:37.503 game # 10:07:37.503 game # JRE version: Java(TM) SE Runtime Environment (17.0.11+7) (build 17.0.11+7-LTS-207) 10:07:37.503 game # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.11+7-LTS-207, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) 10:07:37.503 game # Problematic frame: 10:07:37.506 game # C [atio6axx.dll+0x1759f0] 10:07:37.507 game # 10:07:37.507 game # No core dump will be written. Minidumps are not enabled by default on client versions of Windows 10:07:37.507 game #   Debug txt:  [31Aug2024 10:07:36.584] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, GalaxyReach, --version, forge-47.3.0, --gameDir, C:\Users\Micha\curseforge\minecraft\Instances\Liminal Server, --assetsDir, C:\Users\Micha\curseforge\minecraft\Install\assets, --assetIndex, 5, --uuid, 7f099235327e4206afdfbc22c7712328, --accessToken, ????????, --clientId, OWEyZTE3Y2MtOTZiOC00MWMwLWFkZjYtNmY2MDU2NmIxNDAz, --xuid, 2535442900827884, --userType, msa, --versionType, release, --width, 854, --height, 480, --quickPlayPath, C:\Users\Micha\curseforge\minecraft\Install\quickPlay\java\1725124053749.json, --launchTarget, forgeclient, --fml.forgeVersion, 47.3.0, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [31Aug2024 10:07:36.592] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.11 by Oracle Corporation; OS Windows 11 arch amd64 version 10.0 [31Aug2024 10:07:36.640] [main/DEBUG] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Found launch services [fmlclientdev,forgeclient,minecraft,forgegametestserverdev,fmlserveruserdev,fmlclient,fmldatauserdev,forgeserverdev,forgeserveruserdev,forgeclientdev,forgeclientuserdev,forgeserver,forgedatadev,fmlserver,fmlclientuserdev,fmlserverdev,forgedatauserdev,testharness,forgegametestserveruserdev] [31Aug2024 10:07:36.648] [main/DEBUG] [cpw.mods.modlauncher.NameMappingServiceHandler/MODLAUNCHER]: Found naming services : [srgtomcp] [31Aug2024 10:07:36.664] [main/DEBUG] [cpw.mods.modlauncher.LaunchPluginHandler/MODLAUNCHER]: Found launch plugins: [mixin,eventbus,slf4jfixer,object_holder_definalize,runtime_enum_extender,capability_token_subclass,accesstransformer,runtimedistcleaner] [31Aug2024 10:07:36.672] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Discovering transformation services [31Aug2024 10:07:36.680] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path GAMEDIR is C:\Users\Micha\curseforge\minecraft\Instances\Liminal Server [31Aug2024 10:07:36.680] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path MODSDIR is C:\Users\Micha\curseforge\minecraft\Instances\Liminal Server\mods [31Aug2024 10:07:36.680] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path CONFIGDIR is C:\Users\Micha\curseforge\minecraft\Instances\Liminal Server\config [31Aug2024 10:07:36.680] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path FMLCONFIG is C:\Users\Micha\curseforge\minecraft\Instances\Liminal Server\config\fml.toml [31Aug2024 10:07:37.354] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Found additional transformation services from discovery services: [31Aug2024 10:07:37.362] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow [31Aug2024 10:07:37.450] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6  
    • https://paste.gg/p/anonymous/248d684303f44baaa4ca3aa6fb214643
  • Topics

×
×
  • Create New...

Important Information

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