Fixed ChunkWatchEvent.(Un)Watch not firing correctly (#6453)

This commit is contained in:
malte0811 authored and GitHub committed 2020-02-14 12:02:47 -08:00
1 parent 886e89ccb2
commit 3f292d5d42
6 files changed
+53 -27

No files matched your search

@@ -694,6 +694,12 @@ public class ForgeEventFactory
MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.UnWatch(entity, chunkpos, world));
}
public static void fireChunkWatch(boolean wasLoaded, boolean load, ServerPlayerEntity entity, ChunkPos chunkpos, ServerWorld world)
{
if (wasLoaded != load)
fireChunkWatch(load, entity, chunkpos, world);
}
public static boolean onPistonMovePre(World world, BlockPos pos, Direction direction, boolean extending)
{
return MinecraftForge.EVENT_BUS.post(new PistonEvent.Pre(world, pos, direction, extending ? PistonEvent.PistonMoveType.EXTEND : PistonEvent.PistonMoveType.RETRACT));
@@ -29,7 +29,8 @@ import net.minecraftforge.eventbus.api.Event;
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* {@link #chunk} contains the ChunkPos of the Chunk this event is affecting.<br>
* {@link #pos} contains the ChunkPos of the Chunk this event is affecting.<br>
* {@link #world} contains the World of the Chunk this event is affecting.<br>
* {@link #player} contains the EntityPlayer that is involved with this chunk being watched. <br>
* <br>
* The {@link #player}'s world may not be the same as the world of the chunk
@@ -68,7 +69,7 @@ public class ChunkWatchEvent extends Event
/**
* ChunkWatchEvent.Watch is fired when an EntityPlayer begins watching a chunk.<br>
* This event is fired when a chunk is added to the watched chunks of an EntityPlayer in
* {@link PlayerChunkMapEntry#addPlayer(EntityPlayerMP)} and {@link PlayerChunkMapEntry#sendToPlayers()}. <br>
* {@link net.minecraft.world.server.ChunkManager#setChunkLoadedAtClient}. <br>
* <br>
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
* <br>
@@ -84,7 +85,7 @@ public class ChunkWatchEvent extends Event
/**
* ChunkWatchEvent.UnWatch is fired when an EntityPlayer stops watching a chunk.<br>
* This event is fired when a chunk is removed from the watched chunks of an EntityPlayer in
* {@link PlayerChunkMapEntry#removePlayer(EntityPlayerMP)}. <br>
* {@link net.minecraft.world.server.ChunkManager#setChunkLoadedAtClient}. <br>
* <br>
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.<br>
* <br>