mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Various changes
This commit is contained in:
@ -623,10 +623,8 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
||||
PS.get().loadWorld(worldname, (BukkitPlotGenerator) gen);
|
||||
} else if (gen != null) {
|
||||
PS.get().loadWorld(worldname, new BukkitPlotGenerator(worldname, gen));
|
||||
} else {
|
||||
if (PS.get().config.contains("worlds." + worldname)) {
|
||||
PS.get().loadWorld(worldname, null);
|
||||
}
|
||||
} else if (PS.get().config.contains("worlds." + worldname)) {
|
||||
PS.get().loadWorld(worldname, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,12 +51,12 @@ final class MessagePart implements JsonRepresentedObject, ConfigurationSerializa
|
||||
}
|
||||
|
||||
ChatColor color = ChatColor.WHITE;
|
||||
ArrayList<ChatColor> styles = new ArrayList<ChatColor>();
|
||||
ArrayList<ChatColor> styles = new ArrayList<>();
|
||||
String clickActionName = null, clickActionData = null, hoverActionName = null;
|
||||
JsonRepresentedObject hoverActionData = null;
|
||||
TextualComponent text = null;
|
||||
String insertionData = null;
|
||||
ArrayList<JsonRepresentedObject> translationReplacements = new ArrayList<JsonRepresentedObject>();
|
||||
ArrayList<JsonRepresentedObject> translationReplacements = new ArrayList<>();
|
||||
|
||||
MessagePart(final TextualComponent text) {
|
||||
this.text = text;
|
||||
@ -134,7 +134,7 @@ final class MessagePart implements JsonRepresentedObject, ConfigurationSerializa
|
||||
|
||||
@Override
|
||||
public Map<String, Object> serialize() {
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("text", text);
|
||||
map.put("styles", styles);
|
||||
map.put("color", color.getChar());
|
||||
|
@ -1,18 +1,17 @@
|
||||
package com.plotsquared.bukkit.database.plotme;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
|
||||
import com.intellectualcrafters.configuration.file.FileConfiguration;
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.object.Location;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
||||
public abstract class APlotMeConnector {
|
||||
public abstract Connection getPlotMeConnection(final String plugin, final FileConfiguration plotConfig, final String dataFolder);
|
||||
@ -69,35 +68,14 @@ public abstract class APlotMeConnector {
|
||||
|
||||
public void setMerged(final HashMap<String, HashMap<PlotId, boolean[]>> merges, final String world, final PlotId id, final int direction) {
|
||||
final HashMap<PlotId, boolean[]> plots = merges.get(world);
|
||||
PlotId id2;
|
||||
switch (direction) {
|
||||
case 0: {
|
||||
id2 = new PlotId(id.x, id.y);
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
id2 = new PlotId(id.x, id.y);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
id2 = new PlotId(id.x, id.y);
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
id2 = new PlotId(id.x, id.y);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
return;
|
||||
}
|
||||
}
|
||||
PlotId id2 = new PlotId(id.x, id.y);
|
||||
boolean[] merge1;
|
||||
boolean[] merge2;
|
||||
if (plots.containsKey(id)) {
|
||||
merge1 = plots.get(id);
|
||||
} else {
|
||||
merge1 = new boolean[] { false, false, false, false };
|
||||
}
|
||||
boolean[] merge2;
|
||||
if (plots.containsKey(id2)) {
|
||||
merge2 = plots.get(id2);
|
||||
} else {
|
||||
|
@ -24,7 +24,11 @@ import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.generator.GeneratorWrapper;
|
||||
import com.intellectualcrafters.plot.generator.HybridGen;
|
||||
import com.intellectualcrafters.plot.generator.IndependentPlotGenerator;
|
||||
import com.intellectualcrafters.plot.object.*;
|
||||
import com.intellectualcrafters.plot.object.PlotArea;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.intellectualcrafters.plot.object.PlotManager;
|
||||
import com.intellectualcrafters.plot.object.PseudoRandom;
|
||||
import com.intellectualcrafters.plot.object.SetupObject;
|
||||
import com.intellectualcrafters.plot.util.ChunkManager;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.PlotChunk;
|
||||
@ -48,9 +52,9 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
|
||||
private final PseudoRandom random = new PseudoRandom();
|
||||
private final IndependentPlotGenerator plotGenerator;
|
||||
private final List<BlockPopulator> populators = new ArrayList<>();
|
||||
private final ChunkGenerator platformGenerator;
|
||||
private final boolean full;
|
||||
private boolean loaded = false;
|
||||
private ChunkGenerator platformGenerator;
|
||||
private boolean full;
|
||||
|
||||
public BukkitPlotGenerator(IndependentPlotGenerator generator) {
|
||||
this.plotGenerator = generator;
|
||||
@ -58,11 +62,6 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
|
||||
populators.add(new BlockPopulator() {
|
||||
@Override
|
||||
public void populate(World world, Random r, Chunk c) {
|
||||
if (!(chunkSetter instanceof GenChunk)) {
|
||||
PS.debug("Current PlotChunk is not relevant to population?");
|
||||
PS.stacktrace();
|
||||
return;
|
||||
}
|
||||
GenChunk result = (GenChunk) chunkSetter;
|
||||
if (result.result_data != null) {
|
||||
for (int i = 0; i < result.result_data.length; i++) {
|
||||
@ -90,7 +89,7 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
|
||||
throw new IllegalArgumentException("ChunkGenerator: " + cg.getClass().getName() + " is already a BukkitPlotGenerator!");
|
||||
}
|
||||
this.full = false;
|
||||
PS.get().debug("BukkitPlotGenerator does not fully support: " + cg);
|
||||
PS.debug("BukkitPlotGenerator does not fully support: " + cg);
|
||||
platformGenerator = cg;
|
||||
plotGenerator = new IndependentPlotGenerator() {
|
||||
@Override
|
||||
@ -229,11 +228,6 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
|
||||
|
||||
@Override
|
||||
public ChunkData generateChunkData(World world, Random random, int cx, int cz, BiomeGrid grid) {
|
||||
if (!(chunkSetter instanceof GenChunk)) {
|
||||
PS.debug("Current PlotChunk is not relevant to generation?");
|
||||
PS.stacktrace();
|
||||
return null;
|
||||
}
|
||||
GenChunk result = (GenChunk) chunkSetter;
|
||||
// Set the chunk location
|
||||
result.setChunkWrapper(SetQueue.IMP.new ChunkWrapper(world.getName(), cx, cz));
|
||||
@ -278,10 +272,6 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
|
||||
|
||||
@Override
|
||||
public short[][] generateExtBlockSections(final World world, final Random r, final int cx, final int cz, final BiomeGrid grid) {
|
||||
if (!(chunkSetter instanceof GenChunk)) {
|
||||
PS.stacktrace();
|
||||
return new short[16][];
|
||||
}
|
||||
GenChunk result = (GenChunk) chunkSetter;
|
||||
// Set the chunk location
|
||||
result.setChunkWrapper(SetQueue.IMP.new ChunkWrapper(world.getName(), cx, cz));
|
||||
|
@ -27,16 +27,6 @@ import com.plotsquared.bukkit.object.BukkitLazyBlock;
|
||||
import com.plotsquared.bukkit.object.BukkitPlayer;
|
||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.plotsquared.listener.PlayerBlockEventType;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Pattern;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -115,11 +105,21 @@ import org.bukkit.projectiles.BlockProjectileSource;
|
||||
import org.bukkit.projectiles.ProjectileSource;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Player Events involving plots
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings({ "deprecation", "unchecked" })
|
||||
public class PlayerEvents extends com.plotsquared.listener.PlotListener implements Listener {
|
||||
|
||||
private boolean pistonBlocks = true;
|
||||
@ -353,11 +353,11 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
|
||||
if (c.equals(cmdLabel.getName())) {
|
||||
break;
|
||||
}
|
||||
PluginCommand p;
|
||||
final String label = cmdLabel.getName().replaceFirst("/", "");
|
||||
if (aliases.contains(label)) {
|
||||
continue;
|
||||
}
|
||||
PluginCommand p;
|
||||
if ((p = Bukkit.getPluginCommand(label)) != null) {
|
||||
for (String a : p.getAliases()) {
|
||||
if (aliases.contains(a)) {
|
||||
|
@ -34,6 +34,7 @@ import org.bukkit.util.Vector;
|
||||
|
||||
public class EntityWrapper {
|
||||
|
||||
private final int hash;
|
||||
public EntityType type;
|
||||
public float yaw;
|
||||
public float pitch;
|
||||
@ -54,8 +55,6 @@ public class EntityWrapper {
|
||||
private HorseStats horse;
|
||||
private ArmorStandStats stand;
|
||||
|
||||
private int hash;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public EntityWrapper(final org.bukkit.entity.Entity entity, final short depth) {
|
||||
hash = entity.getEntityId();
|
||||
@ -153,10 +152,7 @@ public class EntityWrapper {
|
||||
}
|
||||
// END MISC //
|
||||
// INVENTORY HOLDER //
|
||||
case MINECART_CHEST: {
|
||||
storeInventory((InventoryHolder) entity);
|
||||
return;
|
||||
}
|
||||
case MINECART_CHEST:
|
||||
case MINECART_HOPPER: {
|
||||
storeInventory((InventoryHolder) entity);
|
||||
return;
|
||||
@ -508,10 +504,7 @@ public class EntityWrapper {
|
||||
}
|
||||
// END MISC //
|
||||
// INVENTORY HOLDER //
|
||||
case MINECART_CHEST: {
|
||||
restoreInventory((InventoryHolder) entity);
|
||||
return entity;
|
||||
}
|
||||
case MINECART_CHEST:
|
||||
case MINECART_HOPPER: {
|
||||
restoreInventory((InventoryHolder) entity);
|
||||
return entity;
|
||||
|
Reference in New Issue
Block a user