Jump to content

[1.7.2][Solved]Chunk Loading?


Nimbleguy

Recommended Posts

My block needs to be ticked all the time, but chunk loading it just unloads the chunk. I am using this.worldObj.getChunkProvider()

.loadChunk(

this.worldObj.getChunkFromBlockCoords(this.xCoord,

this.zCoord).xPosition,

this.worldObj.getChunkFromBlockCoords(this.xCoord,

this.zCoord).zPosition);

to chunkload. Also, how would I make the chunk loading continue after server restart?

Link to comment
Share on other sites

Your chunk loader is a class which implements IChunkLoader, right? And you can add it with ChunkLoaderManager.addChunkLoader.

Remove it with .remChunkLoader and update it with .updateChunkLoader.

The chunks are forced to be loaded in the TicketManager (in the ChunkLoaderManager) with the methods ForgeChunkManager.forceChunk and .unforceChunk. (ChunkLoaderManager lines 93-144)

Link to comment
Share on other sites

Now it gives me this error:

 

 

[16:26:53] [server thread/ERROR] [FML]: The mod nullvoid has attempted to request a ticket without a listener in place

[16:26:53] [server thread/ERROR]: Encountered an unexpected exception

net.minecraft.util.ReportedException: Ticking memory connection

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:198) ~[NetworkSystem.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:716) ~[MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:604) ~[MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:742) [MinecraftServer$2.class:?]

Caused by: java.lang.RuntimeException: Invalid ticket request

at net.minecraftforge.common.ForgeChunkManager.requestTicket(ForgeChunkManager.java:649) ~[ForgeChunkManager.class:?]

at aj.Java.Nullvoid.tileentity.TileEntityVoidWalker.onPlace(TileEntityVoidWalker.java:467) ~[TileEntityVoidWalker.class:?]

at aj.Java.Nullvoid.block.BlockVoidWalker.onBlockPlacedBy(BlockVoidWalker.java:40) ~[blockVoidWalker.class:?]

at net.minecraft.item.ItemBlock.placeBlockAt(ItemBlock.java:239) ~[itemBlock.class:?]

at net.minecraft.item.ItemBlock.onItemUse(ItemBlock.java:116) ~[itemBlock.class:?]

at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:144) ~[itemStack.class:?]

at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:418) ~[itemInWorldManager.class:?]

at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:588) ~[NetHandlerPlayServer.class:?]

at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) ~[C08PacketPlayerBlockPlacement.class:?]

at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) ~[C08PacketPlayerBlockPlacement.class:?]

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:232) ~[NetworkManager.class:?]

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) ~[NetworkSystem.class:?]

... 5 more

 

 

What listeners do I need?

EDIT: Nvm, I just had to add ForgeChunkManager.setForcedChunkLoadingCallback(VoidMod.me, null); to my main class.

Thanks!

Link to comment
Share on other sites

  • 1 month later...

The code is for 1.6 but you can edit it to use it on 1.7.2.

 

If you have problems, I can post some working code.

 

Hi Bedrock_Miner.

Your proposition is interesting me a lot. Could you make it working for 1.7.2 please? I'm not a programmer or a creative modder (just a mod modder and translator) but if there's some byte to modify, I think I can follow your instructions

 

Thanks you

Link to comment
Share on other sites

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.