Jump to content

Recommended Posts

Posted

Hi.

 

I added forge 1.12.2 item which teleport any entity to specific position and block that determine the position. The data of teleportation is saved NBT of item.

However, NBT data is lost.

 

The scene is when I picked item on block's gui (without Shift).

 

additionally, an entity does not teleport to the place set without opening the inventory at once.

 

anyone help me ?

 

https://github.com/nihotamor/pipocraft/tree/master/

Posted

Various other things I'm noticing while looking for your problem:

1) These three classes are identical, you don't need three identical classes, you can call new() and just give them different names.

https://github.com/nihotamor/pipocraft/blob/master/src/main/java/doph/pipocraft/item/ItemGachaChip.java

https://github.com/nihotamor/pipocraft/blob/master/src/main/java/doph/pipocraft/item/ItemGoldGachaChip.java

https://github.com/nihotamor/pipocraft/blob/master/src/main/java/doph/pipocraft/item/ItemSilverGachaChip.java

 

2) Ditto all of these classes:

https://github.com/nihotamor/pipocraft/tree/master/src/main/java/doph/pipocraft/item/itemblock

Heck, what was wrong with the original ItemBlock class? Looks like you did this just so you could call your Utils.setName method (which I feel you don't need at all, see #3)

 

3) What is this nonsense:
https://github.com/nihotamor/pipocraft/blob/master/src/main/java/doph/pipocraft/system/Utils.java#L20-L26

You call this from inside the item or block class and it doesn't do anything particularly necessary. You could have at least had it use item.getRegistryName() instead of reconstructing it from string bits a second time. Besides, you don't need this at all, you can just call setRegistryName and setUnlocalized name from anywhere (as evidenced by how the utility function works), it doesn't need to call from inside the block or item.

 

4) Why does this class (and its compatriots) exist? Why are they not static if you insist?

https://github.com/nihotamor/pipocraft/blob/master/src/main/java/doph/pipocraft/init/register/BlockRegister.java

 

Code Style Issue #1

 

Now, your actual problem:

https://github.com/nihotamor/pipocraft/blob/master/src/main/java/doph/pipocraft/gui/GuiContainerTransferMachine.java#L44-L64

Congrats, you set the NBT on the client inside the GUI class. No wonder you have a problem. You need to send a packet to the server that tells the server "this button was clicked" and have the server add the NBT (after making sure the user was allowed to do that action!)

 

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.

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 was trying to find a mod that added something specific, and was unable to find it with what limited memory I had of seeing it. I don't know why there isn't an option to include words in overviews of mods. I could see it being in the sort tab near filters on the app in my opinion. It might help someone trying to find something specific, only based off something from the overview tab, but idk
    • Please read the FAQ and post logs as described there.   Also, do not just add a post onto someone else's thread with your issue, create a new one please.
    • I am creating a server with mods but when i try tostart it it say in the logs:   [29Jan2025 20:36:50.715] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/fmlcore/1.20.1-47.3.27/fmlcore-1.20.1-47.3.27.jar is missing mods.toml file 159[29Jan2025 20:36:50.717] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate /server/libraries/net/minecraftforge/javafmllanguage/1.20.1-47.3.27/javafmllanguage-1.20.1-47.3.27.jar 160[29Jan2025 20:36:50.717] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/javafmllanguage/1.20.1-47.3.27/javafmllanguage-1.20.1-47.3.27.jar is missing mods.toml file 161[29Jan2025 20:36:50.718] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate /server/libraries/net/minecraftforge/lowcodelanguage/1.20.1-47.3.27/lowcodelanguage-1.20.1-47.3.27.jar 162[29Jan2025 20:36:50.718] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/lowcodelanguage/1.20.1-47.3.27/lowcodelanguage-1.20.1-47.3.27.jar is missing mods.toml file 163[29Jan2025 20:36:50.719] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate /server/libraries/net/minecraftforge/mclanguage/1.20.1-47.3.27/mclanguage-1.20.1-47.3.27.jar 164[29Jan2025 20:36:50.719] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /server/libraries/net/minecraftforge/mclanguage/1.20.1-47.3.27/mclanguage-1.20.1-47.3.27.jar is missing mods.toml file
    • How do you configure the entity reach of a custom weapon? Asking for 1.21 Minecraft parchment
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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