Jump to content

Recommended Posts

Posted

Here is a few questions that I dont quite understand:

 

1. How to IO tileEntity data on world IO? (Do I need to call read/write NBT at any position?)

2. TileEntities act strange when reloaded. It always execute client-side. Is this related to Question 1?

Posted

Read and write nbt is only for saving data, like when the game is shutting down. It gets called by Minecraft ,no need to do it manually.

What exactly do you mean with acting strange? TE's execute on Server and client side

Posted

1. ALWAYS post your code.

2. ALWAYS define exact problem and situation, not "are acting weird".

3. ITS GOOD TO write what you are after (exactly, not "if it's possible", but "what i want")

(Trying to help in future :D)

 

As to problem - world calls NBT-saving automatically. Anything that has to be saved in TE, will be savedloaded if you put it in write/read NBT methods.

As to why it's not saving? - When you want TileEntity to save, you need to mark it as "dirty" to inform world that chunk TE is in needs to be saved to disk.

 

this.markDirty() in TE.class

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

Posted

OK, I'll go clear this time:

 

I want a TIleEntity that follows a block, and generates a counter per tick (or more).

That TileEntity generates counters per ticks. Which is fine.

When I load my world to see if it has any problems, it gave me this:

java.lang.InstantiationException: com.wwy.mod.te.techno.TETechnoReplenisher

 

Block class:

http://pastebin.com/3rH3qXnh

 

TE Class:

http://pastebin.com/uipjaJ7U

 

Interestingly, even the "heal and boost" ability does not activate, it still generates counters...

 

EDIT: So, my objective is, when the counter (datum variable) reaches 1000, find a random player with lowest health, and then heal him ,and boost him.

Posted

OK, that Block instance is solved.

 

BUT, problem is, updateEntity() does not go server-side after the world is reloaded...

WorldObj#isRemote always return true after the world is reloaded.

Posted

Like, everything is reset when I rejoin world.

"Datum" points get back to 0 instead of the value of the last load.

 

EDIT: Now I got some debug outputs.

It seems that NBT are read correctly, but somehow it is not properly processed in / into the TileENtity.

Posted

Try printing the datum field every time you changes the field.

Then please post the console log with the value of datum field printed.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

Weird, man, server said I have more datum points, but client responded with less.

http://pastebin.com/29nVSykc

 

Do I need any kind of syncing?

Ah that was the problem! As minecraft does not automatically sync your field, you should sync it yourself.

@see TileEntity#onDataPacket(Receive) and TileEntity#getDescriptionPacket(Send)

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

NBTTagCompound tag = new NBTTagCompound();

tag.setInteger("datum", this.datum);

tag.setInteger("currentCooldown", this.currentCountdown);

tag.setInteger("maxCountdown", this.maxCountdown);

 

Alright. I have the code. And then? How to return a Packet in getDescriptionPacket?

Posted

It seems that that 'data' parameter can be anything?

 

So, in onDataPacket i will be catching back that nbt again...

What about that "NetworkManager net"? Anything related to IMessage?

 

Do I need to check if getDescriptionPacket() is executed in server?

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I tried do download the essential mod to my mod pack but i didnt work. I paly on 1.21 and it should work. I use neoforge for my modding. The weird things is my friend somehow added the mod to his modpack and many others that I somehow can´t. Is there anything i can do? 
    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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