Jump to content

Recommended Posts

Posted

I have a block, that have TileEntity. When I "re-log" to the world, all my Blocks-with-tileEntity are rotated to 0(South)

Can you help me with fixing it?

Sorry, if you find mistaches in my posts.

I am not EN.

And when I post anything on Modder support, it means, I can't help myself and I need your help. And when you decide to delete my topic, just PM me with the reason, please.

Posted

Likely you need these two functions:

 

	@Override
    public void readFromNBT(NBTTagCompound tc) {
        super.readFromNBT(tc);
        //load your variables
    }

    @Override
    public void writeToNBT(NBTTagCompound tc) {
        super.writeToNBT(tc);
        //save your variables
    }

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.

Posted

Oh, sorry.

I forgot to place my code inside of my post.

 

Here is it:

 

  Reveal hidden contents

 

 

And, how can I notify this block of neighbour change (Make this block update or update its texture)?

Sorry, if you find mistaches in my posts.

I am not EN.

And when I post anything on Modder support, it means, I can't help myself and I need your help. And when you decide to delete my topic, just PM me with the reason, please.

Posted
  On 1/24/2015 at 6:28 PM, Enginecrafter said:

Oh, sorry.

I forgot to place my code inside of my post.

 

Here is it:

 

  Reveal hidden contents

 

 

And, how can I notify this block of neighbour change (Make this block update or update its texture)?

 

You need these two functions in your class:

public Packet getDescriptionPacket() {

NBTTagCompound tag = new NBTTagCompound();
writeToNBT(tag);
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, tag);

}

public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {

readFromNBT(packet.func_148857_g());

}

 

This will send data updates to the client when the chunk with the TE is loaded. It will work on singleplayer and multiplayer.

Romejanic

 

Creator of Witch Hats, Explosive Chickens and Battlefield!

Posted

I explain, why I think they are not saved. But I am not sure, because of this:

1. I place one block (from my mod:excavator) and when I placed it, it created tileentity and writes to it a INT direction. Then, is writed in code: every tick check if is powered by redstone. If true, set BOOLEAN active to true. This boolean is used only for texture. This block will check every tick, if behind it is any block, if true, then drops it on this(machine) block.

2. I leave(exit from) the world and again join (play) the world.

3. I looked at the blocks. All are rotated to the default direction-South(0).

When I place a block next to it's back texture side, and power it with redstone, nothing happens, but when I place a block at side, where back texture side was rototated before, it destroy the block and drop it.

And about the block update.

I made this block react to redstone-when I turn the power ON, the block must change it's texture. But nothing happens while I place or destroy block next to it. I wanted when is redstone on, update or notify block.

 

Sorry, if you find any mistakes, I am writing from mobile now and the keyboard is too small.

Sorry, if you find mistaches in my posts.

I am not EN.

And when I post anything on Modder support, it means, I can't help myself and I need your help. And when you decide to delete my topic, just PM me with the reason, please.

Posted

But, to what class? To my TileEntity class or my block's class?

Sorry, if you find mistaches in my posts.

I am not EN.

And when I post anything on Modder support, it means, I can't help myself and I need your help. And when you decide to delete my topic, just PM me with the reason, please.

Posted

OK, it worked. :D

And...

Can you explainme, what does this packet? Or how this packet work? It worked, but I don't understand it.

Sorry, if you find mistaches in my posts.

I am not EN.

And when I post anything on Modder support, it means, I can't help myself and I need your help. And when you decide to delete my topic, just PM me with the reason, please.

Posted

On the server side, the

getDescriptionPacket

method is called, and that method returns a

S35PacketUpdateTileEntity

containing and

NBTTagCompound

containing the data you have written to it. Then it sends the packet to the client side and it calls the

onDataPacket

with the packet returned from the

getDescriptionPacket

, in which you read all the data from the

NBTTagCompound

in the packet.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

Well, I understood. :D

Sorry, I am going off topic...

Do you know about good tutorial for leanring TileEntities, that implement IInventory?

I never made them, but I want to learn how-to them.

Sorry, if you find mistaches in my posts.

I am not EN.

And when I post anything on Modder support, it means, I can't help myself and I need your help. And when you decide to delete my topic, just PM me with the reason, please.

Posted

But this tutorial you recommend for me is outdated.

Sorry, if you find mistaches in my posts.

I am not EN.

And when I post anything on Modder support, it means, I can't help myself and I need your help. And when you decide to delete my topic, just PM me with the reason, please.

Posted

1.7? Should be pretty similar. Just follow the tutorial and should an error turn up compare your code with the furnace code.

Thats how I created some of my first Machines.

Here could be your advertisement!

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

    • Same issue without voicechat?
    • Start by following the docs to get a workspace setup: https://docs.minecraftforge.net/en/latest/gettingstarted/ Then poke around some of the tutorials, https://www.mcjty.eu/docs/1.20/ used to be the goto, but not sure if there are any updates for regular forge or not, but if you've brushed up on Java, it will be enough to get you started. Poke around the Minecraft and Forge sources to see how things are done. Read the FAQ for information on how to post code/logs when you run into issues. Share as much info on issues you have as possible. Use github to host projects, chances of someone helping are higher when they can actually see all your code and/or build it themselves. And finally, keep it on the forums, don't direct message people with questions, most people do not provide personal support like that. Also keep in mind forums posts are not always immediately answered, if you're looking for a quicker response, you can always try the Minecraft Forge discord server.
    • Hello, I have a Forge Minecraft sever (I host it at g-portal.com) which has always worked fine and I had no problems, but today it doesn't wanna work anymore. Today I started the server and the status said online, but after a few seconds it said this: "Start failed". And then out of nowhere it restarted itself and the same thing happened again and again and now it's in an infinite loop where it just keeps failing and then restarts. Here's the download link for the server logs: https://www.mediafire.com/file/sq30dgoonjevib1/2025-07-06-1.log/file Does anyone know how to fix this? If yes I would really appreciate help. Best wishes, Gabs1107
    • I'm experiencing a critical issue on a dedicated Arch Linux server running the latest Forge for Minecraft 1.20.1. When a player exits a Nether portal (not enters, and not via /tp) or teleports into the End via portal, the server completely freezes for 1–10 minutes. During this time, all commands are unresponsive, and the game world essentially locks up. This is with watchdog disabled. Environment: OS: Arch Linux (latest packages) Java: OpenJDK 17 (up to date) Forge Version: Latest 1.20.1 (tested multiple versions from the past ~3 months) Mods: None (issue occurs on a clean install) Server Type: Proxmox VM with: 4 virtual cores 64 GB RAM (63 GB allocated via -Xmx and -Xms flags) Observed Behavior: Observed Behavior: The server freezes for 1–10 minutes when: Exiting a Nether portal (entering does not trigger the issue) Entering or exiting the End using a portal Teleporting using commands (e.g., /tp) works only for the Nether; teleporting to the End via command also causes a freeze The issue occurs anywhere in the world, not tied to specific coordinates or builds During the freeze: The server becomes completely unresponsive to all commands and player actions No crash reports, no errors, and no warnings are logged CPU usage remains under 50%, and RAM usage stays around 6–14 GB After 1–10 minutes, the server recovers automatically and resumes normal operation
  • Topics

×
×
  • Create New...

Important Information

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