geforkt von Mirrors/AxiomPaperPlugin
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;
|
package com.moulberry.axiom.packet;
|
||||||
|
|
||||||
import com.moulberry.axiom.AxiomPaper;
|
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.ServerWorldPropertiesRegistry;
|
||||||
import com.moulberry.axiom.world_properties.server.ServerWorldPropertyHolder;
|
import com.moulberry.axiom.world_properties.server.ServerWorldPropertyHolder;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
@ -23,6 +24,16 @@ public class SetWorldPropertyListener implements PluginMessageListener {
|
|||||||
return;
|
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));
|
FriendlyByteBuf friendlyByteBuf = new FriendlyByteBuf(Unpooled.wrappedBuffer(message));
|
||||||
ResourceLocation id = friendlyByteBuf.readResourceLocation();
|
ResourceLocation id = friendlyByteBuf.readResourceLocation();
|
||||||
int type = friendlyByteBuf.readVarInt();
|
int type = friendlyByteBuf.readVarInt();
|
||||||
|
@ -60,7 +60,6 @@ public interface WorldPropertyWidgetType<T> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
WorldPropertyWidgetType<Void> BUTTON = new WorldPropertyWidgetType<>() {
|
WorldPropertyWidgetType<Void> BUTTON = new WorldPropertyWidgetType<>() {
|
||||||
@Override
|
@Override
|
||||||
public WorldPropertyDataType<Void> dataType() {
|
public WorldPropertyDataType<Void> dataType() {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren