mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Merge remote-tracking branch 'origin/master' into 3.4.5
# Conflicts: # Sponge/src/main/java/com/plotsquared/sponge/SpongeMain.java # Sponge/src/main/java/com/plotsquared/sponge/generator/SpongeAugmentedGenerator.java # Sponge/src/main/java/com/plotsquared/sponge/util/SpongeSetupUtils.java # Sponge/src/main/java/com/plotsquared/sponge/util/SpongeUtil.java # Sponge/src/main/java/com/plotsquared/sponge/util/block/GenChunk.java # build.gradle
This commit is contained in:
commit
1f341e6ba9
@ -1376,6 +1376,9 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean checkEntity(Plot plot, IntegerFlag... flags) {
|
public static boolean checkEntity(Plot plot, IntegerFlag... flags) {
|
||||||
|
if (Settings.Done.RESTRICT_BUILDING && Flags.DONE.isSet(plot)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
int[] mobs = null;
|
int[] mobs = null;
|
||||||
for (IntegerFlag flag : flags) {
|
for (IntegerFlag flag : flags) {
|
||||||
int i;
|
int i;
|
||||||
|
@ -97,7 +97,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
|||||||
ByteSource is = com.google.common.io.Files.asByteSource(file);
|
ByteSource is = com.google.common.io.Files.asByteSource(file);
|
||||||
NbtFactory.NbtCompound compound = NbtFactory.fromStream(is, NbtFactory.StreamOptions.GZIP_COMPRESSION);
|
NbtFactory.NbtCompound compound = NbtFactory.fromStream(is, NbtFactory.StreamOptions.GZIP_COMPRESSION);
|
||||||
if (!compound.containsKey("bukkit")) {
|
if (!compound.containsKey("bukkit")) {
|
||||||
PS.debug("ERROR: Player data does not contain the the key \"bukkit\"");
|
PS.debug("ERROR: Player data (" + uuid.toString() + ".dat) does not contain the the key \"bukkit\"");
|
||||||
} else {
|
} else {
|
||||||
NbtFactory.NbtCompound bukkit = (NbtFactory.NbtCompound) compound.get("bukkit");
|
NbtFactory.NbtCompound bukkit = (NbtFactory.NbtCompound) compound.get("bukkit");
|
||||||
String name = (String) bukkit.get("lastKnownName");
|
String name = (String) bukkit.get("lastKnownName");
|
||||||
|
@ -1,81 +0,0 @@
|
|||||||
package com.plotsquared.sponge;
|
|
||||||
|
|
||||||
import com.intellectualcrafters.plot.PS;
|
|
||||||
import com.intellectualcrafters.plot.config.ConfigurationNode;
|
|
||||||
import com.intellectualcrafters.plot.generator.GeneratorWrapper;
|
|
||||||
import com.intellectualcrafters.plot.generator.HybridGen;
|
|
||||||
import com.intellectualcrafters.plot.generator.PlotGenerator;
|
|
||||||
import com.intellectualcrafters.plot.object.PlotArea;
|
|
||||||
import com.intellectualcrafters.plot.object.SetupObject;
|
|
||||||
import com.intellectualcrafters.plot.util.SetupUtils;
|
|
||||||
import com.plotsquared.sponge.generator.SpongePlotGenerator;
|
|
||||||
import com.plotsquared.sponge.util.SpongeUtil;
|
|
||||||
import org.spongepowered.api.world.World;
|
|
||||||
import org.spongepowered.api.world.gen.WorldGenerator;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class SpongeSetupUtils extends SetupUtils {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateGenerators() {
|
|
||||||
if (!SetupUtils.generators.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SetupUtils.generators.put("PlotSquared", new SpongePlotGenerator(new HybridGen()));
|
|
||||||
throw new UnsupportedOperationException("TODO FETCH EXTERNAL WorldGenerationModifiers");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getGenerator(final PlotArea plotArea) {
|
|
||||||
if (SetupUtils.generators.isEmpty()) {
|
|
||||||
updateGenerators();
|
|
||||||
}
|
|
||||||
final World world = SpongeUtil.getWorld(plotArea.worldname);
|
|
||||||
if (world == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final WorldGenerator generator = world.getWorldGenerator();
|
|
||||||
if (!(generator instanceof SpongePlotGenerator)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
for (final Map.Entry<String, GeneratorWrapper<?>> entry : generators.entrySet()) {
|
|
||||||
GeneratorWrapper<?> current = entry.getValue();
|
|
||||||
if (current.equals(generator)) {
|
|
||||||
return entry.getKey();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String setupWorld(final SetupObject object) {
|
|
||||||
SetupUtils.manager.updateGenerators();
|
|
||||||
final ConfigurationNode[] steps = object.step;
|
|
||||||
final String world = object.world;
|
|
||||||
for (final ConfigurationNode step : steps) {
|
|
||||||
PS.get().worlds.set("worlds." + world + "." + step.getConstant(), step.getValue());
|
|
||||||
}
|
|
||||||
if (object.type != 0) {
|
|
||||||
PS.get().worlds.set("worlds." + world + ".generator.type", object.type);
|
|
||||||
PS.get().worlds.set("worlds." + world + ".generator.terrain", object.terrain);
|
|
||||||
PS.get().worlds.set("worlds." + world + ".generator.plugin", object.plotManager);
|
|
||||||
if ((object.setupGenerator != null) && !object.setupGenerator.equals(object.plotManager)) {
|
|
||||||
PS.get().worlds.set("worlds." + world + ".generator.init", object.setupGenerator);
|
|
||||||
}
|
|
||||||
final PlotGenerator<WorldGenerator> gen = (PlotGenerator<WorldGenerator>) generators.get(object.setupGenerator);
|
|
||||||
if ((gen != null) && (gen.generator instanceof SpongePlotGenerator)) {
|
|
||||||
object.setupGenerator = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
PS.get().worlds.save(PS.get().worldsFile);
|
|
||||||
} catch (final IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
// TODO FIXME
|
|
||||||
throw new UnsupportedOperationException("NOT IMPLEMENTED YET: Create a new world here");
|
|
||||||
// return object.world;
|
|
||||||
}
|
|
||||||
}
|
|
@ -35,8 +35,6 @@ public class SpongeAugmentedGenerator implements GenerationPopulator {
|
|||||||
return generator;
|
return generator;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Cause cause = Cause.of(NamedCause.of("PlotSquared", SpongeMain.THIS));
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void populate(World world, MutableBlockVolume terrain, ImmutableBiomeArea biome) {
|
public void populate(World world, MutableBlockVolume terrain, ImmutableBiomeArea biome) {
|
||||||
Vector3i min = terrain.getBlockMin();
|
Vector3i min = terrain.getBlockMin();
|
||||||
|
@ -141,7 +141,7 @@ public class SpongeSetupUtils extends SetupUtils {
|
|||||||
// create world with generator
|
// create world with generator
|
||||||
GeneratorWrapper<?> gw = SetupUtils.generators.get(object.setupGenerator);
|
GeneratorWrapper<?> gw = SetupUtils.generators.get(object.setupGenerator);
|
||||||
WorldGeneratorModifier wgm = (WorldGeneratorModifier) gw.getPlatformGenerator();
|
WorldGeneratorModifier wgm = (WorldGeneratorModifier) gw.getPlatformGenerator();
|
||||||
|
|
||||||
WorldArchetype settings = WorldArchetype.builder()
|
WorldArchetype settings = WorldArchetype.builder()
|
||||||
.loadsOnStartup(true)
|
.loadsOnStartup(true)
|
||||||
.keepsSpawnLoaded(true)
|
.keepsSpawnLoaded(true)
|
||||||
|
@ -430,7 +430,7 @@ public class SpongeUtil extends WorldUtil {
|
|||||||
@Override
|
@Override
|
||||||
public void setSign(String worldName, int x, int y, int z, String[] lines) {
|
public void setSign(String worldName, int x, int y, int z, String[] lines) {
|
||||||
World world = SpongeUtil.getWorld(worldName);
|
World world = SpongeUtil.getWorld(worldName);
|
||||||
world.setBlock(x, y, z, BlockTypes.WALL_SIGN.getDefaultState(), BlockChangeFlag.NONE, CAUSE);
|
world.setBlock(x, y, z, BlockTypes.WALL_SIGN.getDefaultState(), CAUSE);
|
||||||
Optional<TileEntity> block = world.getTileEntity(x, y, z);
|
Optional<TileEntity> block = world.getTileEntity(x, y, z);
|
||||||
if (!block.isPresent()) {
|
if (!block.isPresent()) {
|
||||||
return;
|
return;
|
||||||
|
@ -53,7 +53,7 @@ public class GenChunk extends ScopedLocalBlockQueue {
|
|||||||
@Override
|
@Override
|
||||||
public boolean setBlock(int x, int y, int z, int id, int data) {
|
public boolean setBlock(int x, int y, int z, int id, int data) {
|
||||||
modified = true;
|
modified = true;
|
||||||
this.terrain.setBlock(this.bx + x, y, this.bz + z, SpongeUtil.getBlockState(id, data),SpongeUtil.CAUSE);
|
this.terrain.setBlock(this.bx + x, y, this.bz + z, SpongeUtil.getBlockState(id, data), SpongeUtil.CAUSE);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,8 +18,7 @@ ext {
|
|||||||
git = Grgit.open()
|
git = Grgit.open()
|
||||||
revision = "${git.head().abbreviatedId}"
|
revision = "${git.head().abbreviatedId}"
|
||||||
}
|
}
|
||||||
|
version = "3.4.5-SNAPSHOT${revision}"
|
||||||
version = "3.5.0-SNAPSHOT-${revision}"
|
|
||||||
description = """PlotSquared"""
|
description = """PlotSquared"""
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
|
2
pom.xml
2
pom.xml
@ -7,7 +7,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<artifactId>PlotSquared</artifactId>
|
<artifactId>PlotSquared</artifactId>
|
||||||
<version>3.4.4-SNAPSHOT</version>
|
<version>3.4.5-SNAPSHOT</version>
|
||||||
<name>PlotSquared</name>
|
<name>PlotSquared</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<build>
|
<build>
|
||||||
|
Loading…
Reference in New Issue
Block a user