mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-18 05:14:42 +02:00
Fixes for sponge + minor tweaks for spigot
- Updated to sponge 591 - Added optional WorldEdit restriction - several fixes (including greeting/farewell flag)
This commit is contained in:
@ -21,7 +21,9 @@ import org.spongepowered.api.block.BlockState;
|
||||
import org.spongepowered.api.block.BlockType;
|
||||
import org.spongepowered.api.block.BlockTypes;
|
||||
import org.spongepowered.api.entity.player.Player;
|
||||
import org.spongepowered.api.event.Subscribe;
|
||||
import org.spongepowered.api.event.entity.player.PlayerChatEvent;
|
||||
import org.spongepowered.api.event.state.InitializationEvent;
|
||||
import org.spongepowered.api.event.state.PreInitializationEvent;
|
||||
import org.spongepowered.api.event.state.ServerAboutToStartEvent;
|
||||
import org.spongepowered.api.plugin.Plugin;
|
||||
@ -36,7 +38,6 @@ import org.spongepowered.api.world.GeneratorTypes;
|
||||
import org.spongepowered.api.world.World;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Inject;
|
||||
import com.intellectualcrafters.configuration.ConfigurationSection;
|
||||
import com.intellectualcrafters.plot.IPlotMain;
|
||||
@ -79,12 +80,13 @@ import com.plotsquared.sponge.util.SpongeUtil;
|
||||
import com.plotsquared.sponge.uuid.SpongeLowerOfflineUUIDWrapper;
|
||||
import com.plotsquared.sponge.uuid.SpongeOnlineUUIDWrapper;
|
||||
import com.plotsquared.sponge.uuid.SpongeUUIDHandler;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
|
||||
/**
|
||||
* Created by robin on 01/11/2014
|
||||
*/
|
||||
|
||||
@Plugin(id = "PlotSquared", name = "PlotSquared", version = "3.0.0")
|
||||
@Plugin(id = "PlotSquared", name = "PlotSquared", version = "3.0.0", dependencies="before:WorldEdit")
|
||||
public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
public static SpongeMain THIS;
|
||||
|
||||
@ -210,7 +212,12 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////// ON ENABLE /////////////////////
|
||||
///////////////////// ON ENABLE /////////////////////
|
||||
@Subscribe
|
||||
public void init(InitializationEvent event) {
|
||||
log("INIT");
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onInit(PreInitializationEvent event) {
|
||||
log("PRE INIT");
|
||||
@ -218,13 +225,11 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
|
||||
@Subscribe
|
||||
public void onServerAboutToStart(ServerAboutToStartEvent event) {
|
||||
log("INIT");
|
||||
log("ABOUT START");
|
||||
THIS = this;
|
||||
|
||||
//
|
||||
resolver = game.getServiceManager().provide(GameProfileResolver.class).get();
|
||||
plugin = game.getPluginManager().getPlugin("PlotSquared").get().getInstance();
|
||||
log("PLUGIN IS THIS: " + (plugin == this));
|
||||
plugin = this;
|
||||
server = game.getServer();
|
||||
//
|
||||
@ -514,7 +519,7 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
|
||||
@Override
|
||||
public void registerCommands() {
|
||||
getGame().getCommandDispatcher().register(plugin, new SpongeCommand(), "plots", "p", "plot", "ps", "plotsquared", "p2", "2");
|
||||
getGame().getCommandDispatcher().register(plugin, new SpongeCommand(), new String[] {"plots", "p", "plot", "ps", "plotsquared", "p2", "2"});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -541,9 +546,15 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerWorldEditEvents() {
|
||||
// TODO Auto-generated method stub
|
||||
log("registerWorldEditEvents is not implemented!");
|
||||
public boolean initWorldEdit() {
|
||||
try {
|
||||
log("CHECKING FOR WORLDEDIT!?");
|
||||
Class.forName("com.sk89q.worldedit.WorldEdit");
|
||||
return true;
|
||||
}
|
||||
catch (Throwable e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -43,11 +43,11 @@ public class WorldModify implements WorldGeneratorModifier {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "PlotSquared";
|
||||
return "plotsquared";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return "PlotSquared";
|
||||
return "plotsquared";
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ import org.spongepowered.api.entity.living.monster.Monster;
|
||||
import org.spongepowered.api.entity.player.Player;
|
||||
import org.spongepowered.api.entity.vehicle.Boat;
|
||||
import org.spongepowered.api.entity.vehicle.minecart.Minecart;
|
||||
import org.spongepowered.api.event.Subscribe;
|
||||
import org.spongepowered.api.event.block.BlockMoveEvent;
|
||||
import org.spongepowered.api.event.block.BlockRedstoneUpdateEvent;
|
||||
import org.spongepowered.api.event.block.FloraGrowEvent;
|
||||
@ -45,7 +46,6 @@ import org.spongepowered.api.world.extent.Extent;
|
||||
import com.flowpowered.math.vector.Vector3d;
|
||||
import com.flowpowered.math.vector.Vector3i;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.config.Settings;
|
||||
|
@ -98,9 +98,6 @@ public class SpongePlayer extends PlotPlayer {
|
||||
return true;
|
||||
}
|
||||
boolean value = this.player.hasPermission(perm);
|
||||
|
||||
// TODO check children
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user