Jump to content

Recommended Posts

Posted

Hi

 

This is a little over the place, but I'm going to try and summarize to the best of my ability:

 

I have a block which affects a whole chunk (a Chunkloader to be exact), and I have made so additional Chunkloaders placed in the same chunk will simply "turn off".

 

  Reveal hidden contents
 

 

The TileEntities tick, and should only do the stuff if the canLoad variable is true. So if I place a second Chunkloader in the same chunk it will make it disabled. I want when it has one of the other Chunkloaders removed it should check if it is the last one there, and if it is disabled it should be allowed to be turned back on:

 

BlockChunkloader.java

  Reveal hidden contents
 

 

The strange part is that when I do this the first time it works fine, but after I've reloaded the game the canLoad variable has reverted back being disabled and doesn't seem to be affected by having a new Chunkloader placed in the chunk and then removed. The only way of fixing it is to remove the block and place a new one. Which doesn't make any sense. Not sure if it's a logic error I've missed or some other thing.

Posted
  On 9/1/2019 at 6:05 PM, Simon_kungen said:

but after I've reloaded the game the canLoad variable has reverted back being disabled

Expand  

How did you test this? Could it have been a client server desync? Have you tried stepping through the debugger in the read and write methods along with your onBlockPlacedBy and onHarvestBlock? I'd not do so find out how the code is executing.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
  On 9/1/2019 at 6:58 PM, Animefan8888 said:

How did you test this? Could it have been a client server desync? Have you tried stepping through the debugger in the read and write methods along with your onBlockPlacedBy and onHarvestBlock? I'd not do so find out how the code is executing.

Expand  

I have a visual blockstate changing whenever it is on or not. Then I have the variable whenever it CAN load that chunk in the TileEntity.

Posted
  On 9/1/2019 at 7:03 PM, Simon_kungen said:

Using things such as the Debug Stick to change the blockstate imminently changes it back again.

Expand  

I wasnt talking about the debug stick I was talking about the debugger in your IDE that allows you to step through the code.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
  On 9/1/2019 at 7:05 PM, Animefan8888 said:

I wasnt talking about the debug stick I was talking about the debugger in your IDE that allows you to step through the code.

Expand  

Umm, I haven't used that before. I tried the "Debug" button instead of the "Run" button in IntelliJ idea and didn't see any differences between that and the regular run mode.

Posted
  On 9/1/2019 at 7:12 PM, Simon_kungen said:

differences between that and the regular run mode.

Expand  

You need to setup breakpoints to tell intellij where you want it to stop. Look up how to use the debugger in intellij for more information.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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



×
×
  • Create New...

Important Information

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