forked from RepoMirrors/baritone
hehe
This commit is contained in:
parent
8db26af36c
commit
aed8dae175
|
@ -94,7 +94,16 @@ public final class ChunkEvent {
|
|||
|
||||
/**
|
||||
* When the chunk is being populated with blocks, tile entities, etc.
|
||||
* <p>
|
||||
* And it's a full chunk
|
||||
*/
|
||||
POPULATE
|
||||
POPULATE_FULL,
|
||||
|
||||
/**
|
||||
* When the chunk is being populated with blocks, tile entities, etc.
|
||||
* <p>
|
||||
* And it's a partial chunk
|
||||
*/
|
||||
POPULATE_PARTIAL
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,12 +44,13 @@ public class MixinNetHandlerPlayClient {
|
|||
)
|
||||
)
|
||||
private void preRead(SPacketChunkData packetIn, CallbackInfo ci) {
|
||||
packetIn.isFullChunk();
|
||||
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
|
||||
if (ibaritone.getPlayerContext().player().connection == (NetHandlerPlayClient) (Object) this) {
|
||||
ibaritone.getGameEventHandler().onChunkEvent(
|
||||
new ChunkEvent(
|
||||
EventState.PRE,
|
||||
ChunkEvent.Type.POPULATE,
|
||||
packetIn.isFullChunk() ? ChunkEvent.Type.POPULATE_FULL : ChunkEvent.Type.POPULATE_PARTIAL,
|
||||
packetIn.getChunkX(),
|
||||
packetIn.getChunkZ()
|
||||
)
|
||||
|
@ -68,7 +69,7 @@ public class MixinNetHandlerPlayClient {
|
|||
ibaritone.getGameEventHandler().onChunkEvent(
|
||||
new ChunkEvent(
|
||||
EventState.POST,
|
||||
ChunkEvent.Type.POPULATE,
|
||||
packetIn.isFullChunk() ? ChunkEvent.Type.POPULATE_FULL : ChunkEvent.Type.POPULATE_PARTIAL,
|
||||
packetIn.getChunkX(),
|
||||
packetIn.getChunkZ()
|
||||
)
|
||||
|
|
|
@ -70,7 +70,7 @@ public final class GameEventHandler implements IEventBus, Helper {
|
|||
ChunkEvent.Type type = event.getType();
|
||||
|
||||
boolean isPostPopulate = state == EventState.POST
|
||||
&& type == ChunkEvent.Type.POPULATE;
|
||||
&& (type == ChunkEvent.Type.POPULATE_FULL || type == ChunkEvent.Type.POPULATE_PARTIAL);
|
||||
|
||||
World world = baritone.getPlayerContext().world();
|
||||
|
||||
|
|
Loading…
Reference in New Issue