Skip to content

Instantly share code, notes, and snippets.

@tomocrafter
Created March 21, 2016 07:59
Show Gist options
  • Save tomocrafter/2ca4eb4d92d740a5d8eb to your computer and use it in GitHub Desktop.
Save tomocrafter/2ca4eb4d92d740a5d8eb to your computer and use it in GitHub Desktop.
<?php
public function onPacketSend(DataPacketSendEvent $e){
$pk = $e->getPacket();
$p = $e->getPlayer();
if($pk->pid() == 0xbf){
list($minX, $minZ, $maxX, $maxZ) = [0, 100, 0, 100];//これだと、0から100chunkだけ読み込まれるようになる
if($pk->chunkX < $minX or $pk->chunkX > $maxX or $pk->chunkZ < $minZ or $pk->chunkZ > $maxZ){
$e->setCancelled(true);
}
}elseif($pk->pid() == 0x95){
$pk->generator = 0;
}
}
?>
@haniokasai
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment