3
0
Mirror von https://github.com/Moulberry/AxiomPaperPlugin.git synchronisiert 2024-11-17 05:40:06 +01:00

Don't allow World Properties to change on worlds you don't have permission to build

Dieser Commit ist enthalten in:
Moulberry 2023-11-16 19:59:04 +08:00
Ursprung 8a17605969
Commit 970678f8b1
2 geänderte Dateien mit 11 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -1,6 +1,7 @@
package com.moulberry.axiom.packet;
import com.moulberry.axiom.AxiomPaper;
import com.moulberry.axiom.integration.plotsquared.PlotSquaredIntegration;
import com.moulberry.axiom.world_properties.server.ServerWorldPropertiesRegistry;
import com.moulberry.axiom.world_properties.server.ServerWorldPropertyHolder;
import io.netty.buffer.Unpooled;
@ -23,6 +24,16 @@ public class SetWorldPropertyListener implements PluginMessageListener {
return;
}
// Call modify world
if (!this.plugin.canModifyWorld(player, player.getWorld())) {
return;
}
// Don't allow on plot worlds
if (PlotSquaredIntegration.isPlotWorld(player.getWorld())) {
return;
}
FriendlyByteBuf friendlyByteBuf = new FriendlyByteBuf(Unpooled.wrappedBuffer(message));
ResourceLocation id = friendlyByteBuf.readResourceLocation();
int type = friendlyByteBuf.readVarInt();

Datei anzeigen

@ -60,7 +60,6 @@ public interface WorldPropertyWidgetType<T> {
}
};
WorldPropertyWidgetType<Void> BUTTON = new WorldPropertyWidgetType<>() {
@Override
public WorldPropertyDataType<Void> dataType() {