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.
|
* 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) {
|
private void preRead(SPacketChunkData packetIn, CallbackInfo ci) {
|
||||||
|
packetIn.isFullChunk();
|
||||||
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
|
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
|
||||||
if (ibaritone.getPlayerContext().player().connection == (NetHandlerPlayClient) (Object) this) {
|
if (ibaritone.getPlayerContext().player().connection == (NetHandlerPlayClient) (Object) this) {
|
||||||
ibaritone.getGameEventHandler().onChunkEvent(
|
ibaritone.getGameEventHandler().onChunkEvent(
|
||||||
new ChunkEvent(
|
new ChunkEvent(
|
||||||
EventState.PRE,
|
EventState.PRE,
|
||||||
ChunkEvent.Type.POPULATE,
|
packetIn.isFullChunk() ? ChunkEvent.Type.POPULATE_FULL : ChunkEvent.Type.POPULATE_PARTIAL,
|
||||||
packetIn.getChunkX(),
|
packetIn.getChunkX(),
|
||||||
packetIn.getChunkZ()
|
packetIn.getChunkZ()
|
||||||
)
|
)
|
||||||
@ -68,7 +69,7 @@ public class MixinNetHandlerPlayClient {
|
|||||||
ibaritone.getGameEventHandler().onChunkEvent(
|
ibaritone.getGameEventHandler().onChunkEvent(
|
||||||
new ChunkEvent(
|
new ChunkEvent(
|
||||||
EventState.POST,
|
EventState.POST,
|
||||||
ChunkEvent.Type.POPULATE,
|
packetIn.isFullChunk() ? ChunkEvent.Type.POPULATE_FULL : ChunkEvent.Type.POPULATE_PARTIAL,
|
||||||
packetIn.getChunkX(),
|
packetIn.getChunkX(),
|
||||||
packetIn.getChunkZ()
|
packetIn.getChunkZ()
|
||||||
)
|
)
|
||||||
|
@ -70,7 +70,7 @@ public final class GameEventHandler implements IEventBus, Helper {
|
|||||||
ChunkEvent.Type type = event.getType();
|
ChunkEvent.Type type = event.getType();
|
||||||
|
|
||||||
boolean isPostPopulate = state == EventState.POST
|
boolean isPostPopulate = state == EventState.POST
|
||||||
&& type == ChunkEvent.Type.POPULATE;
|
&& (type == ChunkEvent.Type.POPULATE_FULL || type == ChunkEvent.Type.POPULATE_PARTIAL);
|
||||||
|
|
||||||
World world = baritone.getPlayerContext().world();
|
World world = baritone.getPlayerContext().world();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user