Mirror von
https://github.com/Moulberry/AxiomPaperPlugin.git
synchronisiert 2024-11-17 13:50:05 +01:00
PlotSquared: Don't allow loading chunks outside render distance for plot worlds
Dieser Commit ist enthalten in:
Ursprung
63d04d3656
Commit
83b60d3c6f
@ -4,6 +4,7 @@ import com.moulberry.axiom.AxiomConstants;
|
|||||||
import com.moulberry.axiom.AxiomPaper;
|
import com.moulberry.axiom.AxiomPaper;
|
||||||
import com.moulberry.axiom.buffer.CompressedBlockEntity;
|
import com.moulberry.axiom.buffer.CompressedBlockEntity;
|
||||||
import com.moulberry.axiom.event.AxiomModifyWorldEvent;
|
import com.moulberry.axiom.event.AxiomModifyWorldEvent;
|
||||||
|
import com.moulberry.axiom.integration.plotsquared.PlotSquaredIntegration;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import it.unimi.dsi.fastutil.longs.*;
|
import it.unimi.dsi.fastutil.longs.*;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
@ -92,6 +93,12 @@ public class RequestChunkDataPacketListener implements PluginMessageListener {
|
|||||||
Long2ObjectMap<PalettedContainer<BlockState>> sections = new Long2ObjectOpenHashMap<>();
|
Long2ObjectMap<PalettedContainer<BlockState>> sections = new Long2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
int maxChunkLoadDistance = this.plugin.configuration.getInt("max-chunk-load-distance");
|
int maxChunkLoadDistance = this.plugin.configuration.getInt("max-chunk-load-distance");
|
||||||
|
|
||||||
|
// Don't allow loading chunks outside render distance for plot worlds
|
||||||
|
if (PlotSquaredIntegration.isPlotWorld(level.getWorld())) {
|
||||||
|
maxChunkLoadDistance = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (maxChunkLoadDistance > 0) {
|
if (maxChunkLoadDistance > 0) {
|
||||||
count = friendlyByteBuf.readVarInt();
|
count = friendlyByteBuf.readVarInt();
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren