Mirror von
https://github.com/Moulberry/AxiomPaperPlugin.git
synchronisiert 2024-11-08 17:40:04 +01:00
Don't allow World Properties to change on worlds you don't have permission to build
Dieser Commit ist enthalten in:
Ursprung
8a17605969
Commit
970678f8b1
@ -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();
|
||||
|
@ -60,7 +60,6 @@ public interface WorldPropertyWidgetType<T> {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
WorldPropertyWidgetType<Void> BUTTON = new WorldPropertyWidgetType<>() {
|
||||
@Override
|
||||
public WorldPropertyDataType<Void> dataType() {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren