fixed generation ofo elytrarace
This commit is contained in:
@@ -62,3 +62,7 @@ tasks.register('copyJarToServer', Exec) {
|
|||||||
|
|
||||||
commandLine 'scp', 'build/libs/Minigames-1.0-SNAPSHOT.jar', 'root@10.20.6.5:/root/minigames'
|
commandLine 'scp', 'build/libs/Minigames-1.0-SNAPSHOT.jar', 'root@10.20.6.5:/root/minigames'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
|||||||
+10
@@ -24,6 +24,7 @@ import net.minestom.server.event.player.PlayerMoveEvent;
|
|||||||
import net.minestom.server.event.player.PlayerStartFlyingWithElytraEvent;
|
import net.minestom.server.event.player.PlayerStartFlyingWithElytraEvent;
|
||||||
import net.minestom.server.event.player.PlayerStopFlyingWithElytraEvent;
|
import net.minestom.server.event.player.PlayerStopFlyingWithElytraEvent;
|
||||||
import net.minestom.server.event.player.PlayerUseItemEvent;
|
import net.minestom.server.event.player.PlayerUseItemEvent;
|
||||||
|
import net.minestom.server.instance.Chunk;
|
||||||
import net.minestom.server.instance.batch.AbsoluteBlockBatch;
|
import net.minestom.server.instance.batch.AbsoluteBlockBatch;
|
||||||
import net.minestom.server.instance.block.Block;
|
import net.minestom.server.instance.block.Block;
|
||||||
import net.minestom.server.item.ItemStack;
|
import net.minestom.server.item.ItemStack;
|
||||||
@@ -209,7 +210,16 @@ public class ElytraRace extends StatelessGame {
|
|||||||
point -> batch.setBlock(point, Block.AIR)
|
point -> batch.setBlock(point, Block.AIR)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
int minChunkX = (ringPos.blockX() - 100) >> 4;
|
||||||
|
int maxChunkX = (ringPos.blockX() + 100) >> 4;
|
||||||
|
int chunkZ = ringPos.blockZ() >> 4;
|
||||||
|
|
||||||
BatchUtil.loadAndApplyBatch(batch, this, () -> {
|
BatchUtil.loadAndApplyBatch(batch, this, () -> {
|
||||||
|
for(int cx = minChunkX; cx <= maxChunkX; cx++) {
|
||||||
|
Chunk chunk = this.getChunk(cx, chunkZ);
|
||||||
|
if(chunk == null) continue;
|
||||||
|
this.getPlayers().forEach(chunk::sendChunk);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user