Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

How to create a chunk loader?


Bedrock_Miner
 Share

Recommended Posts

Hey guys!

 

I want to create a chunk loader which keeps all the chunks in an adjustable radius round the block loaded. How can I do this?

I tried the following, but this didn't work:

In a tileEntity I overrode onChunkUnloading and added the method worldObj.getChunkProvider().loadChunk(...);

 

This only caused that the server fails to shut down. The commandBlock i placed there didn't write anything in the chat as it should.

 

So, how can I create a working chunk loader block?

Link to comment
Share on other sites

You need to use the Forge Chunk Loading System.

First you need to get a Ticket for your chunk loader. You do that with

ForgeChunkManager.requestTicket

or

ForgeChunkManager.requestPlayerTicket

. The difference is that the first Ticket is assigned to your Mod and the 2nd is assigned to the player. Both have adjustable maximum chunk load counts in the config and if they are exceeded you will get null back as a ticket, so check for that.

Then to actually keep the chunk loaded you use

ForgeChunkManager.forceChunk

.

You also need to register a

LoadingCallback

with

ForgeChunkManager.setForcedChunkLoadingCallback

. It can be empty, but usually you not only want the LoadingCallback but the

OrderedLoadingCallback

or the

PlayerOrderedLoadingCallback

(depending on if you use player forced chunks or not) to decide which chunks to keep in case your world was saved with let's say 20 forced chunks but then the server owner decides in the config that every mod can only force 10 chunks.

Link to comment
Share on other sites

Basically it works fine, thanks for that!

 

But I got two problems:

First, I don't understand how to use the LoadingCallback.

Second, if I reload a world and remove the chunkloader, I get this error:

 

[11:40:12] [server thread/ERROR]: Encountered an unexpected exception
net.minecraft.util.ReportedException: Ticking memory connection
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:206) ~[NetworkSystem.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762) ~[MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650) ~[MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) ~[integratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787) [MinecraftServer$2.class:?]
Caused by: java.lang.NullPointerException
at com.google.common.collect.LinkedHashMultimap.create(LinkedHashMultimap.java:119) ~[guava-15.0.jar:?]
at net.minecraftforge.common.ForgeChunkManager.unforceChunk(ForgeChunkManager.java:767) ~[ForgeChunkManager.class:?]
at com.bedrockminer.statuemod.blocks.BlockStatueBase.breakBlock(BlockStatueBase.java:70) ~[blockStatueBase.class:?]
at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:690) ~[Chunk.class:?]
at net.minecraft.world.World.setBlock(World.java:549) ~[World.class:?]
at net.minecraft.world.World.setBlockToAir(World.java:667) ~[World.class:?]
at net.minecraft.block.Block.removedByPlayer(Block.java:1686) ~[block.class:?]
at net.minecraft.server.management.ItemInWorldManager.removeBlock(ItemInWorldManager.java:272) ~[itemInWorldManager.class:?]
at net.minecraft.server.management.ItemInWorldManager.tryHarvestBlock(ItemInWorldManager.java:306) ~[itemInWorldManager.class:?]
at net.minecraft.server.management.ItemInWorldManager.onBlockClicked(ItemInWorldManager.java:174) ~[itemInWorldManager.class:?]
at net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(NetHandlerPlayServer.java:528) ~[NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:61) ~[C07PacketPlayerDigging.class:?]
at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:94) ~[C07PacketPlayerDigging.class:?]
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242) ~[NetworkManager.class:?]
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190) ~[NetworkSystem.class:?]
... 5 more
[11:40:12] [server thread/ERROR]: This crash report has been saved to: C:\Users\Julian\Desktop\Modding\StatueMod\StatueMod\.\crash-reports\crash-2014-04-08_11.40.12-server.txt
[11:40:12] [server thread/INFO]: Stopping server
[11:40:12] [server thread/INFO]: Saving players
[11:40:12] [server thread/INFO]: Saving worlds
[11:40:12] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
---- Minecraft Crash Report ----
// I let you down. Sorry 

Time: 08.04.14 11:40
Description: Ticking memory connection

java.lang.NullPointerException: Ticking memory connection
at com.google.common.collect.LinkedHashMultimap.create(LinkedHashMultimap.java:119)
at net.minecraftforge.common.ForgeChunkManager.unforceChunk(ForgeChunkManager.java:767)
at com.bedrockminer.statuemod.blocks.BlockStatueBase.breakBlock(BlockStatueBase.java:70)
at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:690)
at net.minecraft.world.World.setBlock(World.java:549)
at net.minecraft.world.World.setBlockToAir(World.java:667)
at net.minecraft.block.Block.removedByPlayer(Block.java:1686)
at net.minecraft.server.management.ItemInWorldManager.removeBlock(ItemInWorldManager.java:272)
at net.minecraft.server.management.ItemInWorldManager.tryHarvestBlock(ItemInWorldManager.java:306)
at net.minecraft.server.management.ItemInWorldManager.onBlockClicked(ItemInWorldManager.java:174)
at net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(NetHandlerPlayServer.java:528)
at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:61)
at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:94)
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242)
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
at com.google.common.collect.LinkedHashMultimap.create(LinkedHashMultimap.java:119)
at net.minecraftforge.common.ForgeChunkManager.unforceChunk(ForgeChunkManager.java:767)
at com.bedrockminer.statuemod.blocks.BlockStatueBase.breakBlock(BlockStatueBase.java:70)
at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:690)
at net.minecraft.world.World.setBlock(World.java:549)
at net.minecraft.world.World.setBlockToAir(World.java:667)
at net.minecraft.block.Block.removedByPlayer(Block.java:1686)
at net.minecraft.server.management.ItemInWorldManager.removeBlock(ItemInWorldManager.java:272)
at net.minecraft.server.management.ItemInWorldManager.tryHarvestBlock(ItemInWorldManager.java:306)
at net.minecraft.server.management.ItemInWorldManager.onBlockClicked(ItemInWorldManager.java:174)
at net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(NetHandlerPlayServer.java:528)
at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:61)
at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:94)
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242)

-- Ticking connection --
Details:
Connection: net.minecraft.network.NetworkManager@cd56091
Stacktrace:
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787)

-- System Details --
Details:
Minecraft Version: 1.7.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_60-ea, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 141752336 bytes (135 MB) / 482344960 bytes (460 MB) up to 943194112 bytes (899 MB)
JVM Flags: 0 total; 
AABB Pool Size: 6751 (378056 bytes; 0 MB) allocated, 6134 (343504 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
FML: MCP v9.01-pre FML v7.2.116.1024 Minecraft Forge 10.12.0.1024 4 mods loaded, 4 mods active
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
FML{7.2.116.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
modid{1.0.0} [ModName] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 2840 (159040 bytes; 0 MB) allocated, 2570 (143920 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['_Bedrock_Miner_'/4160, l='New World', x=1000,99, y=79,00, z=-2,99]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'
#@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2014-04-08_11.40.12-server.txt
[11:40:12] [Client Shutdown Thread/INFO]: Stopping server
Exception in thread "Client Shutdown Thread" java.util.ConcurrentModificationException
at java.util.Hashtable$Enumerator.next(Unknown Source)
at net.minecraftforge.common.DimensionManager.setWorld(DimensionManager.java:213)
at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:461)
at net.minecraft.server.integrated.IntegratedServer.stopServer(IntegratedServer.java:257)
at net.minecraft.client.Minecraft.stopIntegratedServer(Minecraft.java:2706)
at net.minecraft.client.main.Main$2.run(Main.java:102)
AL lib: (EE) alc_cleanup: 1 device not closed

 

 

The code of my chunkloader is this:

 

package com.bedrockminer.statuemod.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeChunkManager;
import net.minecraftforge.common.ForgeChunkManager.Ticket;
import net.minecraftforge.common.ForgeChunkManager.Type;

import com.bedrockminer.statuemod.Main;
import com.bedrockminer.statuemod.tileentities.TileEntityStatueBase;

import cpw.mods.fml.common.registry.GameRegistry;

public class BlockStatueBase extends Block {

private IIcon topIcon;
private IIcon botIcon;
private Ticket ticket;

protected BlockStatueBase(String unlocalizedName) {
	super(Material.iron);
	this.setBlockName(unlocalizedName);
	this.setBlockTextureName(Main.tex(unlocalizedName));
	this.setHardness(5.0F);
	this.setResistance(2000.0F);
	this.setHarvestLevel("pickaxe", 2);
	this.setStepSound(soundTypeMetal);
	this.setCreativeTab(Main.MAINTAB);
	this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F);
        this.setLightOpacity(0);

	GameRegistry.registerBlock(this, unlocalizedName);
}

@Override
public IIcon getIcon(int side, int meta) {
	switch (side) {
	case 0: return topIcon;
	case 1: return botIcon;
	default: return blockIcon;
	}
}

@Override
public void registerBlockIcons(IIconRegister reg) {
	this.blockIcon = reg.registerIcon(textureName + "_side");
	this.topIcon = reg.registerIcon(textureName + "_top");
	this.botIcon = reg.registerIcon(textureName + "_bottom");
}

@Override
public void onBlockAdded(World world, int x, int y, int z) {
	super.onBlockAdded(world, x, y, z);
	this.ticket = ForgeChunkManager.requestTicket(Main.instance, world, Type.NORMAL);
	if (this.ticket != null) {
		ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(x / 16, z / 16));
	}
}

@Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
	super.breakBlock(world, x, y, z, block, meta);
	if (this.ticket != null) {
		ForgeChunkManager.unforceChunk(ticket, new ChunkCoordIntPair(x / 16, z / 16));
	}
}
}

 

Link to comment
Share on other sites

Changed, but still get an error

(I think its the same, but I post it anyway)

[12:08:52] [server thread/ERROR]: Encountered an unexpected exception
net.minecraft.util.ReportedException: Ticking memory connection
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:206) ~[NetworkSystem.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762) ~[MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650) ~[MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) ~[integratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787) [MinecraftServer$2.class:?]
Caused by: java.lang.NullPointerException
at com.google.common.collect.LinkedHashMultimap.create(LinkedHashMultimap.java:119) ~[guava-15.0.jar:?]
at net.minecraftforge.common.ForgeChunkManager.unforceChunk(ForgeChunkManager.java:767) ~[ForgeChunkManager.class:?]
at com.bedrockminer.statuemod.blocks.BlockStatueBase.breakBlock(BlockStatueBase.java:70) ~[blockStatueBase.class:?]
at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:690) ~[Chunk.class:?]
at net.minecraft.world.World.setBlock(World.java:549) ~[World.class:?]
at net.minecraft.world.World.setBlockToAir(World.java:667) ~[World.class:?]
at net.minecraft.block.Block.removedByPlayer(Block.java:1686) ~[block.class:?]
at net.minecraft.server.management.ItemInWorldManager.removeBlock(ItemInWorldManager.java:272) ~[itemInWorldManager.class:?]
at net.minecraft.server.management.ItemInWorldManager.tryHarvestBlock(ItemInWorldManager.java:306) ~[itemInWorldManager.class:?]
at net.minecraft.server.management.ItemInWorldManager.onBlockClicked(ItemInWorldManager.java:174) ~[itemInWorldManager.class:?]
at net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(NetHandlerPlayServer.java:528) ~[NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:61) ~[C07PacketPlayerDigging.class:?]
at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:94) ~[C07PacketPlayerDigging.class:?]
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242) ~[NetworkManager.class:?]
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190) ~[NetworkSystem.class:?]
... 5 more
[12:08:52] [server thread/ERROR]: This crash report has been saved to: C:\Users\Julian\Desktop\Modding\StatueMod\StatueMod\.\crash-reports\crash-2014-04-08_12.08.52-server.txt
[12:08:52] [server thread/INFO]: Stopping server
[12:08:52] [server thread/INFO]: Saving players
[12:08:52] [server thread/INFO]: Saving worlds
[12:08:52] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
---- Minecraft Crash Report ----
// I let you down. Sorry 

Time: 08.04.14 12:08
Description: Ticking memory connection

java.lang.NullPointerException: Ticking memory connection
at com.google.common.collect.LinkedHashMultimap.create(LinkedHashMultimap.java:119)
at net.minecraftforge.common.ForgeChunkManager.unforceChunk(ForgeChunkManager.java:767)
at com.bedrockminer.statuemod.blocks.BlockStatueBase.breakBlock(BlockStatueBase.java:70)
at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:690)
at net.minecraft.world.World.setBlock(World.java:549)
at net.minecraft.world.World.setBlockToAir(World.java:667)
at net.minecraft.block.Block.removedByPlayer(Block.java:1686)
at net.minecraft.server.management.ItemInWorldManager.removeBlock(ItemInWorldManager.java:272)
at net.minecraft.server.management.ItemInWorldManager.tryHarvestBlock(ItemInWorldManager.java:306)
at net.minecraft.server.management.ItemInWorldManager.onBlockClicked(ItemInWorldManager.java:174)
at net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(NetHandlerPlayServer.java:528)
at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:61)
at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:94)
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242)
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
at com.google.common.collect.LinkedHashMultimap.create(LinkedHashMultimap.java:119)
at net.minecraftforge.common.ForgeChunkManager.unforceChunk(ForgeChunkManager.java:767)
at com.bedrockminer.statuemod.blocks.BlockStatueBase.breakBlock(BlockStatueBase.java:70)
at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:690)
at net.minecraft.world.World.setBlock(World.java:549)
at net.minecraft.world.World.setBlockToAir(World.java:667)
at net.minecraft.block.Block.removedByPlayer(Block.java:1686)
at net.minecraft.server.management.ItemInWorldManager.removeBlock(ItemInWorldManager.java:272)
at net.minecraft.server.management.ItemInWorldManager.tryHarvestBlock(ItemInWorldManager.java:306)
at net.minecraft.server.management.ItemInWorldManager.onBlockClicked(ItemInWorldManager.java:174)
at net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(NetHandlerPlayServer.java:528)
at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:61)
at net.minecraft.network.play.client.C07PacketPlayerDigging.processPacket(C07PacketPlayerDigging.java:94)
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242)

-- Ticking connection --
Details:
Connection: net.minecraft.network.NetworkManager@4efc646f
Stacktrace:
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787)

-- System Details --
Details:
Minecraft Version: 1.7.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_60-ea, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 242244712 bytes (231 MB) / 463470592 bytes (442 MB) up to 943194112 bytes (899 MB)
JVM Flags: 0 total; 
AABB Pool Size: 5127 (287112 bytes; 0 MB) allocated, 4514 (252784 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
FML: MCP v9.01-pre FML v7.2.116.1024 Minecraft Forge 10.12.0.1024 4 mods loaded, 4 mods active
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
FML{7.2.116.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
modid{1.0.0} [ModName] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 1724 (96544 bytes; 0 MB) allocated, 1678 (93968 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['_Bedrock_Miner_'/3844, l='New World', x=1000,50, y=84,00, z=0,50]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'
#@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2014-04-08_12.08.52-server.txt
AL lib: (EE) alc_cleanup: 1 device not closed

 

Link to comment
Share on other sites

I think it would be very useful if you can tell me how to use this ForcedChunkLoadingCallback, because I really have no Idea how to use it. Maybe this will fix this Error anyway.

It can be empty. It just has to be present.

Also: You cannot keep your Ticket between world unloads. So you need to set it to null when the world unloads.

Link to comment
Share on other sites

OK, but how can I find out if the world unloads?

WorldEvent.Unload

And when do I have to create the Ticket if i do so? Actually I do it every time a block of this type is placed

Actually, you don't :) I am not entirely sure when a new ticket should be created. I would say one per block type of yours.
Link to comment
Share on other sites

OK. I did this now, but actually it doesn't work any more.

 

I did it like this:

 

public class WorldEventHandler {

@SubscribeEvent
public void worldUnloadEvent(WorldEvent.Unload e) {
	BlockStatueBase.ticket = null;
}

@SubscribeEvent
public void worldLoadEvent(WorldEvent.Load e) {
	BlockStatueBase.ticket = ForgeChunkManager.requestTicket(Main.instance, e.world, Type.NORMAL);
}
}

 

In the block class:

@Override
public void onBlockAdded(World world, int x, int y, int z) {
	if (!world.isRemote && this.ticket != null) {
		ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(x / 16, z / 16));
	}
}

@Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
	if (!world.isRemote && this.ticket != null) {
		ForgeChunkManager.unforceChunk(ticket, new ChunkCoordIntPair(x / 16, z / 16));
	}
}

 

The ticket is not null, i tested it with debugging outputs

 

 

Link to comment
Share on other sites

Well, I now copied some if the code, but it is from 1.6 and I get some problems.

 

For example, this line of code is used very often:

world.theChunkProviderServer.loadedChunks

The problem is, that this is declared private in the class ChunkProviderServer.

 

How can I get acces to this field? Or do you know another way to get the actual loaded chunks?

Link to comment
Share on other sites

  • 4 weeks later...

When I created a chunkloader for 1.6.4, I created a class and had it implement 'net.minecraftforge.common.ForgeChunkManager.LoadingCallback'.

 

WorldEvents:

public class WorldEvents implements LoadingCallback {

@Override
public void ticketsLoaded(List<Ticket> tickets, World world) {
		//TODO: somthing when the tickets are loaded

}
}

 

Immobile Entity (Loading a block should be the same.  Note: this only loads on chunk):

...
if(!worldObj.isRemote) {
Ticket ticket = ForgeChunkManager.requestTicket(AdvancedRocketry.instance, this.worldObj, Type.NORMAL);
        if(ticket != null)
      ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair((int)this.posX / 16, (int)this.posZ / 16));
}
...

 

 

Hope this helps...

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
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.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • What I get is Error Game Crashed The game crashed whilst initializing game Error: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered Exit Code: -1 ---------------- Once I press "view crash report" I get   ---- Minecraft Crash Report ---- // Daisy, daisy... Time: 12/3/21, 10:14 PM Description: Initializing game org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered     at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:392) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:250) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.service.modlauncher.MixinTransformationHandler.processClass(MixinTransformationHandler.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.launch.MixinLaunchPluginLegacy.processClass(MixinLaunchPluginLegacy.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClassWithFlags(ILaunchPluginService.java:156) ~[modlauncher-9.0.7.jar:9.0.7+91+master.8569cdf] {}     at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88) ~[modlauncher-9.0.7.jar:?] {}     at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-9.0.7.jar:?] {}     at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-9.0.7.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:110) ~[securejarhandler-0.9.54.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.lambda$findClass$16(ModuleClassLoader.java:213) ~[securejarhandler-0.9.54.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:223) ~[securejarhandler-0.9.54.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:213) ~[securejarhandler-0.9.54.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:130) ~[securejarhandler-0.9.54.jar:?] {}     at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] {}     at net.minecraft.client.Minecraft.<init>(Minecraft.java:517) ~[client-1.18-20211130.085255-srg.jar%2371!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:169) ~[client-1.18-20211130.085255-srg.jar%2371!:?] {re:classloading,pl:runtimedistcleaner:A}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:45) ~[fmlloader-1.18-38.0.14.jar%2322!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:90) [bootstraplauncher-0.1.17.jar:?] {} Caused by: org.spongepowered.asm.mixin.throwables.ClassMetadataNotFoundException: net.minecraft.client.entity.player.ClientPlayerEntity     at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.transformMethod(MixinPreProcessorStandard.java:754) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.transform(MixinPreProcessorStandard.java:739) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attach(MixinPreProcessorStandard.java:310) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.createContextFor(MixinPreProcessorStandard.java:280) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.mixin.transformer.MixinInfo.createContextFor(MixinInfo.java:1288) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:292) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:383) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:365) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     ... 28 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace:     at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:392) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:250) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.service.modlauncher.MixinTransformationHandler.processClass(MixinTransformationHandler.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at org.spongepowered.asm.launch.MixinLaunchPluginLegacy.processClass(MixinLaunchPluginLegacy.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] {}     at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClassWithFlags(ILaunchPluginService.java:156) ~[modlauncher-9.0.7.jar:9.0.7+91+master.8569cdf] {}     at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88) ~[modlauncher-9.0.7.jar:?] {}     at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-9.0.7.jar:?] {}     at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-9.0.7.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:110) ~[securejarhandler-0.9.54.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.lambda$findClass$16(ModuleClassLoader.java:213) ~[securejarhandler-0.9.54.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:223) ~[securejarhandler-0.9.54.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:213) ~[securejarhandler-0.9.54.jar:?] {}     at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:130) ~[securejarhandler-0.9.54.jar:?] {}     at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] {}     at net.minecraft.client.Minecraft.<init>(Minecraft.java:517) ~[client-1.18-20211130.085255-srg.jar%2371!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A} -- Initialization -- Details:     Modules:          ADVAPI32.dll:Advanced Windows 32 Base API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         COMCTL32.dll:User Experience Controls Library:6.10 (WinBuild.160101.0800):Microsoft Corporation         CRYPT32.dll:Crypto API32:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         CRYPTBASE.dll:Base cryptographic API DLL:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         CRYPTSP.dll:Cryptographic Service Provider API:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         ColorAdapterClient.dll:Microsoft Color Adapter Client:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         CoreMessaging.dll:Microsoft CoreMessaging Dll:10.0.19041.746:Microsoft Corporation         CoreUIComponents.dll:Microsoft Core UI Components Dll:10.0.19041.546:Microsoft Corporation         DBGHELP.DLL:Windows Image Helper:10.0.19041.867 (WinBuild.160101.0800):Microsoft Corporation         DEVOBJ.dll:Device Information Set DLL:10.0.19041.1151 (WinBuild.160101.0800):Microsoft Corporation         DNSAPI.dll:DNS Client API DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         GDI32.dll:GDI Client DLL:10.0.19041.1202 (WinBuild.160101.0800):Microsoft Corporation         GLU32.dll:OpenGL Utility Library DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         HID.DLL:Hid User Library:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         IMM32.DLL:Multi-User Windows IMM32 API Client DLL:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         IPHLPAPI.DLL:IP Helper API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         KERNEL32.DLL:Windows NT BASE API Client DLL:10.0.19041.1348 (WinBuild.160101.0800):Microsoft Corporation         KERNELBASE.dll:Windows NT BASE API Client DLL:10.0.19041.1348 (WinBuild.160101.0800):Microsoft Corporation         MMDevApi.dll:MMDevice API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         MSACM32.dll:Microsoft ACM Audio Filter:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         MSASN1.dll:ASN.1 Runtime APIs:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         MSCTF.dll:MSCTF Server DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         NLAapi.dll:Network Location Awareness 2:10.0.19041.1151 (WinBuild.160101.0800):Microsoft Corporation         NSI.dll:NSI User-mode interface DLL:10.0.19041.610 (WinBuild.160101.0800):Microsoft Corporation         NTASN1.dll:Microsoft ASN.1 API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         Ole32.dll:Microsoft OLE for Windows:10.0.19041.1320 (WinBuild.160101.0800):Microsoft Corporation         OleAut32.dll:OLEAUT32.DLL:10.0.19041.985 (WinBuild.160101.0800):Microsoft Corporation         OpenAL.dll         PROPSYS.dll:Microsoft Property System:7.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         PSAPI.DLL:Process Status Helper:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         Pdh.dll:Windows Performance Data Helper DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         RPCRT4.dll:Remote Procedure Call Runtime:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         SAPIWrapper_x64.dll         SETUPAPI.DLL:Windows Setup API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         SHCORE.dll:SHCORE:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         SHELL32.dll:Windows Shell Common Dll:10.0.19041.964 (WinBuild.160101.0800):Microsoft Corporation         USER32.dll:Multi-User Windows USER API Client DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         USERENV.dll:Userenv:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         VCRUNTIME140.dll:Microsoft® C Runtime Library:14.29.30133.0 built by: vcwrkspc:Microsoft Corporation         VERSION.dll:Version Checking and File Installation Libraries:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         WINHTTP.dll:Windows HTTP Services:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         WINMM.dll:MCI API DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         WINTRUST.dll:Microsoft Trust Verification APIs:10.0.19041.1266 (WinBuild.160101.0800):Microsoft Corporation         WS2_32.dll:Windows Socket 2.0 32-Bit DLL:10.0.19041.1081 (WinBuild.160101.0800):Microsoft Corporation         WSOCK32.dll:Windows Socket 32-Bit DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         Wldp.dll:Windows Lockdown Policy:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         amsi.dll:Anti-Malware Scan Interface:10.0.19041.746 (WinBuild.160101.0800):Microsoft Corporation         atcuf64.dll:Bitdefender Active Threat Control Usermode Filter:1.42.307.0 #0xf81500a12:Bitdefender S.R.L. Bucharest, ROMANIA         atiadlxx.dll:ADL:7.20.40.1402:Advanced Micro Devices, Inc.         atig6pxx.dll:atiglpxx.dll:8.14.01.6564:Advanced Micro Devices, Inc.          atig6txx.dll:atigktxx.dll:8.14.01.6564:Advanced Micro Devices, Inc.          atio6axx.dll:AMD OpenGL driver:8.14.11000.14756:Advanced Micro Devices, Inc.         bcrypt.dll:Windows Cryptographic Primitives Library:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         bcryptPrimitives.dll:Windows Cryptographic Primitives Library:10.0.19041.1348 (WinBuild.160101.0800):Microsoft Corporation         cfgmgr32.dll:Configuration Manager DLL:10.0.19041.1151 (WinBuild.160101.0800):Microsoft Corporation         clbcatq.dll:COM+ Configuration Catalog:2001.12.10941.16384 (WinBuild.160101.0800):Microsoft Corporation         combase.dll:Microsoft COM for Windows:10.0.19041.1320 (WinBuild.160101.0800):Microsoft Corporation         dbgcore.DLL:Windows Core Debugging Helpers:10.0.19041.789 (WinBuild.160101.0800):Microsoft Corporation         dhcpcsvc.DLL:DHCP Client Service:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         dhcpcsvc6.DLL:DHCPv6 Client:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         dinput8.dll:Microsoft DirectInput:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         dwmapi.dll:Microsoft Desktop Window Manager API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         dxcore.dll:DXCore:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         dxva2.dll:DirectX Video Acceleration 2.0 DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         fastprox.dll:WMI Custom Marshaller:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         fwpuclnt.dll:FWP/IPsec User-Mode API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         gdi32full.dll:GDI Client DLL:10.0.19041.1110 (WinBuild.160101.0800):Microsoft Corporation         glfw.dll         icm32.dll:Microsoft Color Management Module (CMM):10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         inputhost.dll:InputHost:10.0.19041.906 (WinBuild.160101.0800):Microsoft Corporation         java.dll:OpenJDK Platform binary:17.0.1.0:Microsoft         javaw.exe:OpenJDK Platform binary:17.0.1.0:Microsoft         jemalloc.dll         jimage.dll:OpenJDK Platform binary:17.0.1.0:Microsoft         jli.dll:OpenJDK Platform binary:17.0.1.0:Microsoft         jna7138277671719183896.dll:JNA native library:6.1.1:Java(TM) Native Access (JNA)         jvm.dll:OpenJDK 64-Bit server VM:17.0.1.0:Microsoft         kernel.appcore.dll:AppModel API Host:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         lwjgl.dll         lwjgl_opengl.dll         lwjgl_stb.dll         management.dll:OpenJDK Platform binary:17.0.1.0:Microsoft         management_ext.dll:OpenJDK Platform binary:17.0.1.0:Microsoft         mscms.dll:Microsoft Color Matching System DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         msdmo.dll:DMO Runtime:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         msvcp140.dll:Microsoft® C Runtime Library:14.29.30133.0 built by: vcwrkspc:Microsoft Corporation         msvcp_win.dll:Microsoft® C Runtime Library:10.0.19041.789 (WinBuild.160101.0800):Microsoft Corporation         msvcrt.dll:Windows NT CRT DLL:7.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         mswsock.dll:Microsoft Windows Sockets 2.0 Service Provider:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         napinsp.dll:E-mail Naming Shim Provider:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         ncrypt.dll:Windows NCrypt Router:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         net.dll:OpenJDK Platform binary:17.0.1.0:Microsoft         nio.dll:OpenJDK Platform binary:17.0.1.0:Microsoft         ntdll.dll:NT Layer DLL:10.0.19041.1023 (WinBuild.160101.0800):Microsoft Corporation         ntmarta.dll:Windows NT MARTA provider:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         opengl32.dll:OpenGL Client DLL:10.0.19041.1081 (WinBuild.160101.0800):Microsoft Corporation         perfos.dll:Windows System Performance Objects DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         pnrpnsp.dll:PNRP Name Space Provider:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         profapi.dll:User Profile Basic API:10.0.19041.844 (WinBuild.160101.0800):Microsoft Corporation         rasadhlp.dll:Remote Access AutoDial Helper:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         rsaenh.dll:Microsoft Enhanced Cryptographic Provider:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         sapi.dll:Speech API:5.3.24006.00 (WinBuild.160101.0800):Microsoft Corporation         sechost.dll:Host for SCM/SDDL/LSA Lookup APIs:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         shlwapi.dll:Shell Light-weight Utility Library:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         sunmscapi.dll:OpenJDK Platform binary:17.0.1.0:Microsoft         svml.dll:OpenJDK Platform binary:17.0.1.0:Microsoft         textinputframework.dll:"TextInputFramework.DYNLINK":10.0.19041.1320 (WinBuild.160101.0800):Microsoft Corporation         ucrtbase.dll:Microsoft® C Runtime Library:10.0.19041.789 (WinBuild.160101.0800):Microsoft Corporation         uxtheme.dll:Microsoft UxTheme Library:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         vcruntime140_1.dll:Microsoft® C Runtime Library:14.29.30133.0 built by: vcwrkspc:Microsoft Corporation         verify.dll:OpenJDK Platform binary:17.0.1.0:Microsoft         wbemcomn.dll:WMI:10.0.19041.1081 (WinBuild.160101.0800):Microsoft Corporation         wbemprox.dll:WMI:10.0.19041.1320 (WinBuild.160101.0800):Microsoft Corporation         wbemsvc.dll:WMI:10.0.19041.1320 (WinBuild.160101.0800):Microsoft Corporation         win32u.dll:Win32u:10.0.19041.1320 (WinBuild.160101.0800):Microsoft Corporation         windows.storage.dll:Microsoft WinRT Storage API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         winmmbase.dll:Base Multimedia Extension API DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         winrnr.dll:LDAP RnR Provider DLL:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         wintypes.dll:Windows Base Types DLL:10.0.19041.1320 (WinBuild.160101.0800):Microsoft Corporation         wshbth.dll:Windows Sockets Helper DLL:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation         xinput1_4.dll:Microsoft Common Controller API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation         zip.dll:OpenJDK Platform binary:17.0.1.0:Microsoft Stacktrace:     at net.minecraft.client.main.Main.main(Main.java:169) ~[client-1.18-20211130.085255-srg.jar%2371!:?] {re:classloading,pl:runtimedistcleaner:A}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:45) ~[fmlloader-1.18-38.0.14.jar%2322!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:90) [bootstraplauncher-0.1.17.jar:?] {} -- System Details -- Details:     Minecraft Version: 1.18     Minecraft Version ID: 1.18     Operating System: Windows 10 (amd64) version 10.0     Java Version: 17.0.1, Microsoft     Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft     Memory: 623097272 bytes (594 MiB) / 1442840576 bytes (1376 MiB) up to 2147483648 bytes (2048 MiB)     CPUs: 16     Processor Vendor: AuthenticAMD     Processor Name: AMD Ryzen 9 5900HS with Radeon Graphics             Identifier: AuthenticAMD Family 25 Model 80 Stepping 0     Microarchitecture: Zen 3     Frequency (GHz): 3.29     Number of physical packages: 1     Number of physical CPUs: 8     Number of logical CPUs: 16     Graphics card #0 name: AMD Radeon(TM) Graphics     Graphics card #0 vendor: Advanced Micro Devices, Inc. (0x1002)     Graphics card #0 VRAM (MB): 512.00     Graphics card #0 deviceId: 0x1638     Graphics card #0 versionInfo: DriverVersion=27.20.14044.2001     Graphics card #1 name: NVIDIA GeForce RTX 3070 Laptop GPU     Graphics card #1 vendor: NVIDIA (0x10de)     Graphics card #1 VRAM (MB): 4095.00     Graphics card #1 deviceId: 0x249d     Graphics card #1 versionInfo: DriverVersion=27.21.14.6213     Memory slot #0 capacity (MB): 8192.00     Memory slot #0 clockSpeed (GHz): 3.20     Memory slot #0 type: DDR4     Memory slot #1 capacity (MB): 8192.00     Memory slot #1 clockSpeed (GHz): 3.20     Memory slot #1 type: DDR4     Virtual memory max (MB): 18208.38     Virtual memory used (MB): 10540.94     Swap memory total (MB): 2432.00     Swap memory used (MB): 29.15     JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     Launched Version: 1.18-forge-38.0.14     Backend library: LWJGL version 3.2.2 SNAPSHOT     Backend API: AMD Radeon(TM) Graphics GL version 3.2.14756 Core Profile Forward-Compatible Context 20.40.44.02 27.20.14044.2001, ATI Technologies Inc.     Window size: <not initialized>     GL Caps: Using framebuffer using OpenGL 3.2     GL debug messages:      Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'forge'     Type: Client (map_client.txt)     CPU: 16x AMD Ryzen 9 5900HS with Radeon Graphics      ModLauncher: 9.0.7+91+master.8569cdf     ModLauncher launch target: forgeclient     ModLauncher naming: srg     ModLauncher services:           mixin PLUGINSERVICE           eventbus PLUGINSERVICE           object_holder_definalize PLUGINSERVICE           runtime_enum_extender PLUGINSERVICE           capability_token_subclass PLUGINSERVICE           accesstransformer PLUGINSERVICE           runtimedistcleaner PLUGINSERVICE           mixin TRANSFORMATIONSERVICE           fml TRANSFORMATIONSERVICE      FML Language Providers:          minecraft@1.0         javafml@null     Mod List:          client-1.18-20211130.085255-srg.jar               |Minecraft                     |minecraft                     |1.18                |NONE      |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f         forge-1.18-38.0.14-universal.jar                  |Forge                         |forge                         |38.0.14             |NONE      |Manifest: 22:af:21:d8:19:82:7f:93:94:fe:2b:ac:b7:e4:41:57:68:39:87:b1:a7:5c:c6:44:f9:25:74:21:14:f5:0d:90
    • Join the newly started Battle Vortex Lifesteal SMP. we need new players to participate in the upcoming base wars. Newbies are welcome Veterans are appreciated. No swearing..... or atleast censor it a little. you can apply to join through this discord link: https://discord.gg/r3DBuvwQ
    • BATTLE VORTEX is a new lifesteal SMP we need new players so join today and take part in the upcoming base wars. Newbies are welcome. Veterans are appreciated. NO SWEARING......or atleast censor it a little. You can apply to join through this discord link(its me): https://discord.gg/r3DBuvwQ
    • It doesn't work even if I remove every mod Please help
    • Hi, so I was making an item that sends info to the server to do some work, and I want the server to send the client back the results? How do I do that? Here is my code:   The snippet that sends the packet to the server SimpleChannelNetwork.CHANNEL.sendToServer(new CreateStructureCompass("fortress"));   The file that manage the traffic package io.github.bossmania.NetherandEndMaps.core.network; import io.github.bossmania.NetherandEndMaps.NetherandEndMaps; import io.github.bossmania.NetherandEndMaps.core.network.message.CreateStructureCompass; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.network.NetworkRegistry; import net.minecraftforge.fml.network.simple.SimpleChannel; public class SimpleChannelNetwork { public static final String NETWORK_VERSION = "0.1.0"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(NetherandEndMaps.MOD_ID, "network"), () -> NETWORK_VERSION, version -> version.equals(NETWORK_VERSION), version -> version.equals(NETWORK_VERSION)); public static void init() { CHANNEL.registerMessage(0, CreateStructureCompass.class ,CreateStructureCompass::encode, CreateStructureCompass::decode, CreateStructureCompass::handle); } }   the code that handle the packet receive and where I want the server to send back a packet to the client package io.github.bossmania.NetherandEndMaps.core.network.message; import java.util.function.Supplier; import io.github.bossmania.NetherandEndMaps.common.items.TemporaryItem; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.gen.feature.structure.Structure; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.fml.network.NetworkEvent; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; public class CreateStructureCompass { public String structureType; public CreateStructureCompass() { } //create the constructor and store the structureType public CreateStructureCompass(String structureType) { this.structureType = structureType; } //encode the message public static void encode(CreateStructureCompass message, PacketBuffer buffer) { buffer.writeString(message.structureType); } //decode the message public static CreateStructureCompass decode(PacketBuffer buffer) { return new CreateStructureCompass(buffer.readString()); } //execute function when message is sent to server public static void handle(CreateStructureCompass message, Supplier<NetworkEvent.Context> contextSupplier) { NetworkEvent.Context context = contextSupplier.get(); context.enqueueWork(() -> { //get the player and the server ServerPlayerEntity player = context.getSender(); ServerWorld SEWorld = player.getServerWorld(); //get the location of the structure BlockPos structureLocation = SEWorld.func_241117_a_(Structure.FORTRESS, player.getPosition(),100, false); //this is where I want the server to send structureLocation back to the player }); context.setPacketHandled(true); } }  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.