mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-04 06:34:42 +02:00
Cleanup
This commit is contained in:
@ -428,7 +428,6 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
||||
try {
|
||||
BukkitSetBlockManager.setBlockManager = new SetBlockFast();
|
||||
} catch (final Throwable e) {
|
||||
MainUtil.canSetFast = false;
|
||||
BukkitSetBlockManager.setBlockManager = new SetBlockSlow();
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ import com.intellectualcrafters.plot.object.Location;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.intellectualcrafters.plot.object.StringWrapper;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
|
||||
public class ClassicPlotMeConnector extends APlotMeConnector {
|
||||
@ -136,7 +135,7 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
|
||||
if (name.length() > 0) {
|
||||
owner = UUID.nameUUIDFromBytes(("OfflinePlayer:" + name.toLowerCase()).getBytes(Charsets.UTF_8));
|
||||
}
|
||||
MainUtil.sendConsoleMessage("&cCould not identify owner for plot: " + id + " -> '" + name + "'");
|
||||
PS.log("&cCould not identify owner for plot: " + id + " -> '" + name + "'");
|
||||
missing++;
|
||||
continue;
|
||||
}
|
||||
@ -148,11 +147,10 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
|
||||
plots.get(world).put(id, plot);
|
||||
}
|
||||
if (missing > 0) {
|
||||
MainUtil.sendConsoleMessage("&cSome names could not be identified:");
|
||||
MainUtil.sendConsoleMessage("&7 - Empty quotes mean PlotMe just stored an unowned plot in the database");
|
||||
MainUtil.sendConsoleMessage("&7 - Names you have never seen before could be from people mistyping commands");
|
||||
MainUtil
|
||||
.sendConsoleMessage("&7 - Converting from a non-uuid version of PlotMe can't identify owners if the playerdata files are deleted (these plots will remain unknown until the player connects)");
|
||||
PS.log("&cSome names could not be identified:");
|
||||
PS.log("&7 - Empty quotes mean PlotMe just stored an unowned plot in the database");
|
||||
PS.log("&7 - Names you have never seen before could be from people mistyping commands");
|
||||
PS.log("&7 - Converting from a non-uuid version of PlotMe can't identify owners if the playerdata files are deleted (these plots will remain unknown until the player connects)");
|
||||
}
|
||||
|
||||
for (final Entry<String, HashMap<PlotId, boolean[]>> entry : merges.entrySet()) {
|
||||
@ -171,7 +169,7 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
|
||||
|
||||
try {
|
||||
|
||||
MainUtil.sendConsoleMessage(" - " + prefix + "Denied");
|
||||
PS.log(" - " + prefix + "Denied");
|
||||
stmt = connection.prepareStatement("SELECT * FROM `" + prefix + "Denied`");
|
||||
r = stmt.executeQuery();
|
||||
|
||||
@ -207,7 +205,7 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
|
||||
}
|
||||
}
|
||||
if (denied == null) {
|
||||
MainUtil.sendConsoleMessage("&6Could not identify denied for plot: " + id);
|
||||
PS.log("&6Could not identify denied for plot: " + id);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -251,7 +249,7 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
|
||||
}
|
||||
}
|
||||
if (helper == null) {
|
||||
MainUtil.sendConsoleMessage("&6Could not identify helper for plot: " + id);
|
||||
PS.log("&6Could not identify helper for plot: " + id);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ import com.intellectualcrafters.plot.object.Location;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.intellectualcrafters.plot.object.StringWrapper;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
|
||||
public class PlotMeConnector_017 extends APlotMeConnector {
|
||||
@ -123,7 +122,7 @@ public class PlotMeConnector_017 extends APlotMeConnector {
|
||||
}
|
||||
}
|
||||
if (owner == null) {
|
||||
MainUtil.sendConsoleMessage("&cCould not identify owner for plot: " + id + " -> '" + name + "'");
|
||||
PS.log("&cCould not identify owner for plot: " + id + " -> '" + name + "'");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -145,7 +144,7 @@ public class PlotMeConnector_017 extends APlotMeConnector {
|
||||
r.close();
|
||||
stmt.close();
|
||||
try {
|
||||
MainUtil.sendConsoleMessage(" - " + plugin + "core_denied");
|
||||
PS.log(" - " + plugin + "core_denied");
|
||||
stmt = connection.prepareStatement("SELECT * FROM `" + plugin + "core_denied`");
|
||||
r = stmt.executeQuery();
|
||||
|
||||
@ -153,14 +152,14 @@ public class PlotMeConnector_017 extends APlotMeConnector {
|
||||
final int key = r.getInt("plot_id");
|
||||
final Plot plot = plots.get(key);
|
||||
if (plot == null) {
|
||||
MainUtil.sendConsoleMessage("&6Denied (" + key + ") references deleted plot; ignoring entry.");
|
||||
PS.log("&6Denied (" + key + ") references deleted plot; ignoring entry.");
|
||||
continue;
|
||||
}
|
||||
final UUID denied = UUID.fromString(r.getString("player"));
|
||||
plot.getDenied().add(denied);
|
||||
}
|
||||
|
||||
MainUtil.sendConsoleMessage(" - " + plugin + "core_allowed");
|
||||
PS.log(" - " + plugin + "core_allowed");
|
||||
stmt = connection.prepareStatement("SELECT * FROM `" + plugin + "core_allowed`");
|
||||
r = stmt.executeQuery();
|
||||
|
||||
@ -168,7 +167,7 @@ public class PlotMeConnector_017 extends APlotMeConnector {
|
||||
final int key = r.getInt("plot_id");
|
||||
final Plot plot = plots.get(key);
|
||||
if (plot == null) {
|
||||
MainUtil.sendConsoleMessage("&6Allowed (" + key + ") references deleted plot; ignoring entry.");
|
||||
PS.log("&6Allowed (" + key + ") references deleted plot; ignoring entry.");
|
||||
continue;
|
||||
}
|
||||
final UUID allowed = UUID.fromString(r.getString("player"));
|
||||
|
@ -2,6 +2,7 @@ package com.plotsquared.sponge;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Arrays;
|
||||
@ -28,7 +29,7 @@ import org.spongepowered.api.event.game.state.GameInitializationEvent;
|
||||
import org.spongepowered.api.event.game.state.GamePreInitializationEvent;
|
||||
import org.spongepowered.api.plugin.Plugin;
|
||||
import org.spongepowered.api.plugin.PluginContainer;
|
||||
import org.spongepowered.api.service.profile.GameProfileResolver;
|
||||
import org.spongepowered.api.profile.GameProfileManager;
|
||||
import org.spongepowered.api.text.Text;
|
||||
import org.spongepowered.api.text.Texts;
|
||||
import org.spongepowered.api.text.translation.Translatable;
|
||||
@ -36,6 +37,8 @@ import org.spongepowered.api.text.translation.Translation;
|
||||
import org.spongepowered.api.world.DimensionTypes;
|
||||
import org.spongepowered.api.world.GeneratorTypes;
|
||||
import org.spongepowered.api.world.World;
|
||||
import org.spongepowered.api.world.WorldBuilder;
|
||||
import org.spongepowered.api.world.gen.WorldGeneratorModifier;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.intellectualcrafters.configuration.ConfigurationSection;
|
||||
@ -80,13 +83,12 @@ 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 org.spongepowered.api.world.WorldBuilder;
|
||||
|
||||
/**
|
||||
* Created by robin on 01/11/2014
|
||||
*/
|
||||
|
||||
@Plugin(id = "PlotSquared", name = "PlotSquared", version = "3.0.0", dependencies = "before:WorldEdit")
|
||||
@Plugin(id = "PlotSquared", name = "PlotSquared", version = "3.0.0", dependencies = "before:WorldEdit,required-after:TotalEconomy")
|
||||
public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
public static SpongeMain THIS;
|
||||
|
||||
@ -96,13 +98,12 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
private Game game;
|
||||
private Server server;
|
||||
|
||||
private GameProfileResolver resolver;
|
||||
private GameProfileManager resolver;
|
||||
|
||||
private WorldModify modify;
|
||||
|
||||
private Object plugin;
|
||||
|
||||
// stuff //
|
||||
@Override
|
||||
public Logger getLogger() {
|
||||
return logger;
|
||||
}
|
||||
@ -115,12 +116,12 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
return server;
|
||||
}
|
||||
|
||||
public GameProfileResolver getResolver() {
|
||||
public GameProfileManager getResolver() {
|
||||
return resolver;
|
||||
}
|
||||
|
||||
public Object getPlugin() {
|
||||
return plugin;
|
||||
public SpongeMain getPlugin() {
|
||||
return THIS;
|
||||
}
|
||||
|
||||
public Text getText(final String m) {
|
||||
@ -192,8 +193,8 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getInstance() {
|
||||
return THIS;
|
||||
public Optional<Object> getInstance() {
|
||||
return Optional.<Object> of(THIS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -223,7 +224,24 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
|
||||
@Listener
|
||||
public void onInit(final GamePreInitializationEvent event) {
|
||||
log("P^2 PRE INIT");
|
||||
// Hook for Project Worlds
|
||||
hookProjectWorlds();
|
||||
}
|
||||
|
||||
public void hookProjectWorlds() {
|
||||
Optional<PluginContainer> plugin = game.getPluginManager().getPlugin("Project Worlds");
|
||||
if (plugin.isPresent()) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName("com.gmail.trentech.pjw.modifiers.Modifiers");
|
||||
Method method = clazz.getMethod("put", String.class, WorldGeneratorModifier.class);
|
||||
SpongeBasicGen generator = new SpongeBasicGen(null);
|
||||
method.invoke(null, "plotsquared", new WorldModify(generator, false));
|
||||
log("Adding plotsquared modifier to Project Worlds");
|
||||
}
|
||||
catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Listener
|
||||
@ -232,8 +250,7 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
THIS = this;
|
||||
|
||||
//
|
||||
resolver = game.getServiceManager().provide(GameProfileResolver.class).get();
|
||||
plugin = this;
|
||||
resolver = game.getServiceManager().provide(GameProfileManager.class).get();
|
||||
server = game.getServer();
|
||||
//
|
||||
|
||||
@ -318,7 +335,6 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
PS.get().copyFile("data.txt", "config");
|
||||
|
||||
try {
|
||||
|
||||
final File id_file = new File(getDirectory(), "config" + File.separator + "ids.txt");
|
||||
final List<String> id_lines = Files.readAllLines(id_file.toPath(), StandardCharsets.UTF_8);
|
||||
|
||||
@ -494,7 +510,7 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
|
||||
@Override
|
||||
public void registerCommands() {
|
||||
getGame().getCommandDispatcher().register(plugin, new SpongeCommand(), new String[] { "plots", "p", "plot", "ps", "plotsquared", "p2", "2" });
|
||||
getGame().getCommandManager().register(THIS, new SpongeCommand(), new String[] { "plots", "p", "plot", "ps", "plotsquared", "p2", "2" });
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -523,7 +539,6 @@ public class SpongeMain implements IPlotMain, PluginContainer {
|
||||
@Override
|
||||
public boolean initWorldEdit() {
|
||||
try {
|
||||
log("CHECKING FOR WORLDEDIT!?");
|
||||
Class.forName("com.sk89q.worldedit.WorldEdit");
|
||||
return true;
|
||||
} catch (final Throwable e) {
|
||||
|
@ -1,7 +1,8 @@
|
||||
package com.plotsquared.sponge.events;
|
||||
|
||||
import org.spongepowered.api.event.impl.AbstractEvent;
|
||||
import org.spongepowered.api.event.Cancellable;
|
||||
import org.spongepowered.api.event.cause.Cause;
|
||||
import org.spongepowered.api.event.impl.AbstractEvent;
|
||||
|
||||
import com.intellectualcrafters.plot.flag.Flag;
|
||||
import com.intellectualcrafters.plot.object.PlotCluster;
|
||||
@ -44,4 +45,9 @@ public class ClusterFlagRemoveEvent extends AbstractEvent implements Cancellable
|
||||
public void setCancelled(final boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cause getCause() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.plotsquared.sponge.events;
|
||||
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.event.Cancellable;
|
||||
import org.spongepowered.api.event.cause.Cause;
|
||||
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
|
||||
@ -48,4 +49,9 @@ public class PlayerClaimPlotEvent extends PlayerEvent implements Cancellable {
|
||||
public void setCancelled(final boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cause getCause() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.plotsquared.sponge.events;
|
||||
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.event.cause.Cause;
|
||||
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
|
||||
@ -27,4 +28,9 @@ public class PlayerEnterPlotEvent extends PlayerEvent {
|
||||
public Plot getPlot() {
|
||||
return plot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cause getCause() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.plotsquared.sponge.events;
|
||||
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.event.cause.Cause;
|
||||
import org.spongepowered.api.event.impl.AbstractEvent;
|
||||
|
||||
public abstract class PlayerEvent extends AbstractEvent {
|
||||
@ -15,4 +16,9 @@ public abstract class PlayerEvent extends AbstractEvent {
|
||||
return player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cause getCause() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
package com.plotsquared.sponge.events;
|
||||
|
||||
import org.spongepowered.api.event.impl.AbstractEvent;
|
||||
import org.spongepowered.api.event.Cancellable;
|
||||
import org.spongepowered.api.event.cause.Cause;
|
||||
import org.spongepowered.api.event.impl.AbstractEvent;
|
||||
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
|
||||
@ -48,4 +49,9 @@ public class PlotClearEvent extends AbstractEvent implements Cancellable {
|
||||
public void setCancelled(final boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cause getCause() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.plotsquared.sponge.events;
|
||||
|
||||
import org.spongepowered.api.event.cause.Cause;
|
||||
import org.spongepowered.api.event.impl.AbstractEvent;
|
||||
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
@ -36,4 +37,9 @@ public class PlotDeleteEvent extends AbstractEvent {
|
||||
public String getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cause getCause() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.plotsquared.sponge.events;
|
||||
|
||||
import org.spongepowered.api.event.cause.Cause;
|
||||
import org.spongepowered.api.event.impl.AbstractEvent;
|
||||
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
@ -16,4 +17,9 @@ public abstract class PlotEvent extends AbstractEvent {
|
||||
return plot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cause getCause() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,8 +2,9 @@ package com.plotsquared.sponge.events;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.spongepowered.api.event.impl.AbstractEvent;
|
||||
import org.spongepowered.api.event.Cancellable;
|
||||
import org.spongepowered.api.event.cause.Cause;
|
||||
import org.spongepowered.api.event.impl.AbstractEvent;
|
||||
import org.spongepowered.api.world.World;
|
||||
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
@ -57,4 +58,9 @@ public class PlotMergeEvent extends AbstractEvent implements Cancellable {
|
||||
public void setCancelled(final boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cause getCause() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,9 @@ package com.plotsquared.sponge.events;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.spongepowered.api.event.impl.AbstractEvent;
|
||||
import org.spongepowered.api.event.Cancellable;
|
||||
import org.spongepowered.api.event.cause.Cause;
|
||||
import org.spongepowered.api.event.impl.AbstractEvent;
|
||||
import org.spongepowered.api.world.World;
|
||||
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
@ -46,4 +47,9 @@ public class PlotUnlinkEvent extends AbstractEvent implements Cancellable {
|
||||
public void setCancelled(final boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cause getCause() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import org.spongepowered.api.world.extent.ImmutableBlockVolume;
|
||||
import org.spongepowered.api.world.extent.MutableBlockVolume;
|
||||
import org.spongepowered.api.world.extent.StorageType;
|
||||
import org.spongepowered.api.world.extent.UnmodifiableBlockVolume;
|
||||
import org.spongepowered.api.world.gen.GeneratorPopulator;
|
||||
import org.spongepowered.api.world.gen.GenerationPopulator;
|
||||
import org.spongepowered.api.world.gen.Populator;
|
||||
import org.spongepowered.api.world.gen.WorldGenerator;
|
||||
|
||||
@ -38,7 +38,7 @@ public class AugmentedPopulator implements Populator {
|
||||
public final PlotWorld plotworld;
|
||||
public final PlotManager manager;
|
||||
public final SpongePlotGenerator generator;
|
||||
public final GeneratorPopulator populator;
|
||||
public final GenerationPopulator populator;
|
||||
public final PlotCluster cluster;
|
||||
public final Random r = new Random();
|
||||
public final boolean p;
|
||||
@ -54,7 +54,7 @@ public class AugmentedPopulator implements Populator {
|
||||
// Initialize any chach that's needed
|
||||
this.cluster = cluster;
|
||||
this.generator = generator;
|
||||
populator = generator.getBaseGeneratorPopulator();
|
||||
populator = generator.getBaseGenerationPopulator();
|
||||
plotworld = generator.getNewPlotWorld(worldname);
|
||||
manager = generator.getPlotManager();
|
||||
this.p = p;
|
||||
|
@ -66,7 +66,6 @@ public class SpongeBasicGen extends SpongePlotGenerator {
|
||||
}
|
||||
pathWidthUpper = (short) (pathWidthLower + plotsize + 1);
|
||||
}
|
||||
|
||||
roadblock = SpongeMain.THIS.getBlockState(this.plotworld.ROAD_BLOCK);
|
||||
wallfilling = SpongeMain.THIS.getBlockState(this.plotworld.WALL_FILLING);
|
||||
wall = SpongeMain.THIS.getBlockState(this.plotworld.WALL_BLOCK);
|
||||
@ -127,5 +126,4 @@ public class SpongeBasicGen extends SpongePlotGenerator {
|
||||
}
|
||||
return biome;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,13 @@
|
||||
package com.plotsquared.sponge.generator;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.spongepowered.api.world.biome.BiomeGenerationSettings;
|
||||
import org.spongepowered.api.world.biome.BiomeType;
|
||||
import org.spongepowered.api.world.gen.BiomeGenerator;
|
||||
import org.spongepowered.api.world.gen.GeneratorPopulator;
|
||||
import org.spongepowered.api.world.gen.GenerationPopulator;
|
||||
import org.spongepowered.api.world.gen.Populator;
|
||||
import org.spongepowered.api.world.gen.WorldGenerator;
|
||||
|
||||
@ -14,14 +17,14 @@ import com.intellectualcrafters.plot.object.SetupObject;
|
||||
|
||||
public abstract class SpongePlotGenerator implements WorldGenerator {
|
||||
|
||||
public final String world;
|
||||
public String world;
|
||||
|
||||
public SpongePlotGenerator(final String world) {
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeneratorPopulator getBaseGeneratorPopulator() {
|
||||
public GenerationPopulator getBaseGenerationPopulator() {
|
||||
return getGenerator();
|
||||
}
|
||||
|
||||
@ -30,31 +33,55 @@ public abstract class SpongePlotGenerator implements WorldGenerator {
|
||||
return getPlotBiomeProvider();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GeneratorPopulator> getGeneratorPopulators() {
|
||||
final List<GeneratorPopulator> pops = new ArrayList<>();
|
||||
pops.addAll(getPlotPopulators());
|
||||
return pops;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Populator> getPopulators() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBaseGeneratorPopulator(final GeneratorPopulator arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("NOT IMPLEMENTED YET");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBiomeGenerator(final BiomeGenerator biomeGenerator) {
|
||||
// TODO
|
||||
throw new UnsupportedOperationException("NOT IMPLEMENTED YET");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeGenerationSettings getBiomeSettings(BiomeType type) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("NOT IMPLEMENTED YET");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GenerationPopulator> getGenerationPopulators() {
|
||||
final List<GenerationPopulator> pops = new ArrayList<>();
|
||||
pops.addAll(getPlotPopulators());
|
||||
return pops;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GenerationPopulator> getGenerationPopulators(Class<? extends GenerationPopulator> clazz) {
|
||||
List<GenerationPopulator> list = getGenerationPopulators();
|
||||
Iterator<GenerationPopulator> iter = list.iterator();
|
||||
while (iter.hasNext()) {
|
||||
GenerationPopulator pop = iter.next();
|
||||
if (!clazz.isInstance(pop)) {
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Populator> getPopulators(Class<? extends Populator> arg0) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBaseGenerationPopulator(GenerationPopulator arg0) {
|
||||
// TODO
|
||||
throw new UnsupportedOperationException("NOT IMPLEMENTED YET");
|
||||
|
||||
}
|
||||
|
||||
public abstract SpongePlotPopulator getGenerator();
|
||||
|
||||
public abstract BiomeGenerator getPlotBiomeProvider();
|
||||
|
@ -22,7 +22,8 @@ public class WorldModify implements WorldGeneratorModifier {
|
||||
@Override
|
||||
public void modifyWorldGenerator(final WorldCreationSettings world, final DataContainer settings, final WorldGenerator gen) {
|
||||
if (augment) {
|
||||
final String worldname = plotgen.world;
|
||||
final String worldname = world.getWorldName();
|
||||
plotgen.world = worldname;
|
||||
final PlotWorld plotworld = plotgen.getNewPlotWorld(worldname);
|
||||
if (plotworld.TYPE == 2) {
|
||||
for (final PlotCluster cluster : ClusterManager.getClusters(worldname)) {
|
||||
@ -32,9 +33,9 @@ public class WorldModify implements WorldGeneratorModifier {
|
||||
new AugmentedPopulator(worldname, gen, plotgen, null, plotworld.TERRAIN == 2, plotworld.TERRAIN != 2);
|
||||
}
|
||||
} else {
|
||||
gen.getGeneratorPopulators().clear();
|
||||
gen.getGenerationPopulators().clear();
|
||||
gen.getPopulators().clear();
|
||||
gen.setBaseGeneratorPopulator(plotgen.getBaseGeneratorPopulator());
|
||||
gen.setBaseGenerationPopulator(plotgen.getBaseGenerationPopulator());
|
||||
gen.setBiomeGenerator(plotgen.getBiomeGenerator());
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ public class SpongeBlockManager extends BlockManager {
|
||||
@Override
|
||||
public StringComparison<PlotBlock>.ComparisonResult getClosestBlock(String name) {
|
||||
try {
|
||||
|
||||
double match;
|
||||
short id;
|
||||
byte data;
|
||||
@ -94,6 +95,7 @@ public class SpongeBlockManager extends BlockManager {
|
||||
|
||||
@Override
|
||||
public PlotBlock getPlotBlockFromString(final String block) {
|
||||
dsa
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
@ -3,17 +3,17 @@ package com.plotsquared.sponge.util;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.spongepowered.api.command.CommandCallable;
|
||||
import org.spongepowered.api.command.CommandException;
|
||||
import org.spongepowered.api.command.CommandResult;
|
||||
import org.spongepowered.api.command.CommandSource;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.text.Text;
|
||||
import org.spongepowered.api.text.Texts;
|
||||
import org.spongepowered.api.util.command.CommandCallable;
|
||||
import org.spongepowered.api.util.command.CommandException;
|
||||
import org.spongepowered.api.util.command.CommandResult;
|
||||
import org.spongepowered.api.util.command.CommandSource;
|
||||
|
||||
import java.util.Optional;
|
||||
import com.intellectualcrafters.plot.commands.MainCommand;
|
||||
import com.intellectualcrafters.plot.object.ConsolePlayer;
|
||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
|
@ -1,34 +1,57 @@
|
||||
package com.plotsquared.sponge.util;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.lang.NotImplementedException;
|
||||
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
|
||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
import com.intellectualcrafters.plot.util.EconHandler;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
import com.plotsquared.sponge.SpongeMain;
|
||||
import com.plotsquared.sponge.object.SpongePlayer;
|
||||
|
||||
public class SpongeEconHandler extends EconHandler {
|
||||
|
||||
private Object TE_SERVICE;
|
||||
private Object EL_SERVICE;
|
||||
|
||||
public SpongeEconHandler() {
|
||||
try {
|
||||
Class<?> clazz = Class.forName("com.erigitic.service.TEService");
|
||||
this.TE_SERVICE = SpongeMain.THIS.getGame().getServiceManager().provide(clazz).get();
|
||||
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName("me.Flibio.EconomyLite.API.EconomyLiteAPI");
|
||||
this.EL_SERVICE = SpongeMain.THIS.getGame().getServiceManager().provide(clazz).get();
|
||||
} catch (Exception e2) {
|
||||
PS.log("No economy service found! (EconomyLite, TotalEconomy)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void withdrawMoney(PlotPlayer player, double amount) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
UUID uuid = ((SpongePlayer) player).player.getUniqueId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void depositMoney(PlotPlayer player, double amount) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
UUID uuid = ((SpongePlayer) player).player.getUniqueId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void depositMoney(OfflinePlotPlayer player, double amount) {
|
||||
// TODO Auto-generated method stub
|
||||
UUID uuid = player.getUUID();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPermission(String world, String player, String perm, boolean value) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new NotImplementedException("TODO/WIP/NOT IMPLEMENTED!");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.spongepowered.api.event.Event;
|
||||
import org.spongepowered.api.service.event.EventManager;
|
||||
import org.spongepowered.api.event.EventManager;
|
||||
|
||||
import com.intellectualcrafters.plot.flag.Flag;
|
||||
import com.intellectualcrafters.plot.object.Location;
|
||||
|
@ -51,7 +51,7 @@ import ninja.leaping.configurate.loader.ConfigurationLoader;
|
||||
|
||||
import org.spongepowered.api.Game;
|
||||
import org.spongepowered.api.plugin.PluginContainer;
|
||||
import org.spongepowered.api.service.scheduler.Task;
|
||||
import org.spongepowered.api.scheduler.Task;
|
||||
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
|
||||
|
@ -3,7 +3,7 @@ package com.plotsquared.sponge.util;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.spongepowered.api.service.scheduler.Task;
|
||||
import org.spongepowered.api.scheduler.Task;
|
||||
|
||||
import com.intellectualcrafters.plot.util.TaskManager;
|
||||
import com.plotsquared.sponge.SpongeMain;
|
||||
|
@ -2,8 +2,8 @@ package com.plotsquared.sponge.uuid;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.spongepowered.api.GameProfile;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.profile.GameProfile;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
|
||||
|
@ -2,7 +2,7 @@ package com.plotsquared.sponge.uuid;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.spongepowered.api.GameProfile;
|
||||
import org.spongepowered.api.profile.GameProfile;
|
||||
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.object.RunnableVal;
|
||||
|
Reference in New Issue
Block a user