Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-09-06 16:12:51 +02:00
Additional cleanup for the Sponge implementation
Dieser Commit ist enthalten in:
Ursprung
7dc9a9aece
Commit
bc29bff072
@ -57,6 +57,7 @@
|
||||
<allow pkg="com.google.inject" />
|
||||
<allow pkg="com.flowpowered.math" />
|
||||
<allow pkg="org.spongepowered.api" />
|
||||
<allow pkg="org.slf4j" />
|
||||
<allow pkg="ninja.leaping.configurate" />
|
||||
</subpackage>
|
||||
</subpackage>
|
||||
|
@ -31,7 +31,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Provides access to biome data in Forge.
|
||||
* Provides access to biome data in Sponge.
|
||||
*/
|
||||
class SpongeBiomeRegistry implements BiomeRegistry {
|
||||
|
||||
@ -56,9 +56,6 @@ class SpongeBiomeRegistry implements BiomeRegistry {
|
||||
return new SpongeBiomeData(IDHelper.resolveBiome(biome.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Cached biome data information.
|
||||
*/
|
||||
private static class SpongeBiomeData implements BiomeData {
|
||||
private final BiomeType biome;
|
||||
|
||||
|
@ -170,7 +170,7 @@ class SpongePlatform extends AbstractPlatform implements MultiUserPlatform {
|
||||
@Override
|
||||
public Map<Capability, Preference> getCapabilities() {
|
||||
Map<Capability, Preference> capabilities = new EnumMap<>(Capability.class);
|
||||
capabilities.put(Capability.CONFIGURATION, Preference.PREFER_OTHERS);
|
||||
capabilities.put(Capability.CONFIGURATION, Preference.NORMAL);
|
||||
capabilities.put(Capability.WORLDEDIT_CUI, Preference.NORMAL);
|
||||
capabilities.put(Capability.GAME_HOOKS, Preference.NORMAL);
|
||||
capabilities.put(Capability.PERMISSIONS, Preference.NORMAL);
|
||||
|
@ -154,14 +154,7 @@ public class SpongePlayer extends AbstractPlayerActor {
|
||||
this.player.getWorld(), pos.getX(), pos.getY(), pos.getZ()
|
||||
);
|
||||
|
||||
this.player.setLocationAndRotation(
|
||||
loc,
|
||||
new Vector3d(
|
||||
pitch,
|
||||
yaw,
|
||||
0
|
||||
)
|
||||
);
|
||||
this.player.setLocationAndRotation(loc, new Vector3d(pitch, yaw, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,6 +45,7 @@ import org.spongepowered.api.data.property.block.SkyLuminanceProperty;
|
||||
import org.spongepowered.api.entity.EntityType;
|
||||
import org.spongepowered.api.entity.EntityTypes;
|
||||
import org.spongepowered.api.event.cause.Cause;
|
||||
import org.spongepowered.api.event.cause.NamedCause;
|
||||
import org.spongepowered.api.event.cause.entity.spawn.SpawnCause;
|
||||
import org.spongepowered.api.event.cause.entity.spawn.SpawnTypes;
|
||||
import org.spongepowered.api.world.World;
|
||||
@ -262,7 +263,10 @@ public abstract class SpongeWorld extends AbstractWorld {
|
||||
|
||||
protected abstract void applyEntityData(org.spongepowered.api.entity.Entity entity, BaseEntity data);
|
||||
|
||||
private static final Cause ENTITY_SPAWN_CAUSE = Cause.source(SpawnCause.builder().type(SpawnTypes.PLUGIN).build()).build();
|
||||
private static final Cause ENTITY_SPAWN_CAUSE = Cause
|
||||
.source(SpawnCause.builder().type(SpawnTypes.PLUGIN).build())
|
||||
.suggestNamed(NamedCause.SOURCE, SpongeWorldEdit.inst())
|
||||
.build();
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
|
@ -23,7 +23,7 @@ import com.sk89q.worldedit.world.registry.BiomeRegistry;
|
||||
import com.sk89q.worldedit.world.registry.LegacyWorldData;
|
||||
|
||||
/**
|
||||
* World data for the Forge platform.
|
||||
* World data for the Sponge platform.
|
||||
*/
|
||||
class SpongeWorldData extends LegacyWorldData {
|
||||
|
||||
|
@ -31,6 +31,7 @@ import com.sk89q.worldedit.internal.LocalWorldAdapter;
|
||||
import com.sk89q.worldedit.sponge.config.SpongeConfiguration;
|
||||
import com.sk89q.worldedit.sponge.nms.NMSHelper;
|
||||
import com.sk89q.worldedit.sponge.nms.SpongeNMSWorld;
|
||||
import org.slf4j.Logger;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.block.BlockSnapshot;
|
||||
import org.spongepowered.api.block.BlockType;
|
||||
@ -62,10 +63,9 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
public class SpongeWorldEdit {
|
||||
|
||||
@Inject
|
||||
private java.util.logging.Logger logger;
|
||||
private Logger logger;
|
||||
|
||||
public static final String MOD_ID = "worldedit";
|
||||
public static final String CUI_PLUGIN_CHANNEL = "WECUI";
|
||||
|
||||
private SpongePermissionsProvider provider;
|
||||
|
||||
@ -118,7 +118,7 @@ public class SpongeWorldEdit {
|
||||
@Listener
|
||||
public void serverAboutToStart(GameAboutToStartServerEvent event) {
|
||||
if (this.platform != null) {
|
||||
logger.warning("FMLServerStartingEvent occurred when FMLServerStoppingEvent hasn't");
|
||||
logger.warn("GameAboutToStartServerEvent occurred when GameStoppingServerEvent hasn't");
|
||||
WorldEdit.getInstance().getPlatformManager().unregister(platform);
|
||||
}
|
||||
|
||||
@ -226,7 +226,7 @@ public class SpongeWorldEdit {
|
||||
/**
|
||||
* Get the configuration.
|
||||
*
|
||||
* @return the Forge configuration
|
||||
* @return the Sponge configuration
|
||||
*/
|
||||
SpongeConfiguration getConfig() {
|
||||
return this.config;
|
||||
@ -292,7 +292,7 @@ public class SpongeWorldEdit {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the version of the WorldEdit-for-Forge implementation.
|
||||
* Get the version of the WorldEdit Sponge implementation.
|
||||
*
|
||||
* @return a version string
|
||||
*/
|
||||
|
@ -22,8 +22,8 @@ package com.sk89q.worldedit.sponge;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
@ -34,7 +34,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||
public class ThreadSafeCache implements Runnable {
|
||||
|
||||
private static final ThreadSafeCache INSTANCE = new ThreadSafeCache();
|
||||
private Set<UUID> onlineIds = Collections.emptySet();
|
||||
private Set<UUID> onlineIds = new CopyOnWriteArraySet<>();
|
||||
|
||||
/**
|
||||
* Get an concurrent-safe set of UUIDs of online players.
|
||||
@ -47,7 +47,7 @@ public class ThreadSafeCache implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Set<UUID> onlineIds = new HashSet<>();
|
||||
List<UUID> onlineIds = new ArrayList<>();
|
||||
|
||||
for (Player player : Sponge.getServer().getOnlinePlayers()) {
|
||||
onlineIds.add(player.getUniqueId());
|
||||
|
@ -28,11 +28,10 @@ import ninja.leaping.configurate.ConfigurationOptions;
|
||||
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
|
||||
import ninja.leaping.configurate.loader.ConfigurationLoader;
|
||||
import ninja.leaping.configurate.objectmapping.ObjectMappingException;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class ConfigurateConfiguration extends LocalConfiguration {
|
||||
|
||||
@ -54,7 +53,7 @@ public class ConfigurateConfiguration extends LocalConfiguration {
|
||||
|
||||
node = config.load(options);
|
||||
} catch (IOException e) {
|
||||
logger.log(Level.WARNING, "Error loading WorldEdit configuration", e);
|
||||
logger.warn("Error loading WorldEdit configuration", e);
|
||||
}
|
||||
|
||||
profile = node.getNode("debug").getBoolean(profile);
|
||||
@ -76,12 +75,12 @@ public class ConfigurateConfiguration extends LocalConfiguration {
|
||||
try {
|
||||
disallowedBlocks = new HashSet<>(node.getNode("limits", "disallowed-blocks").getList(TypeToken.of(Integer.class)));
|
||||
} catch (ObjectMappingException e) {
|
||||
logger.log(Level.WARNING, "Error loading WorldEdit configuration", e);
|
||||
logger.warn("Error loading WorldEdit configuration", e);
|
||||
}
|
||||
try {
|
||||
allowedDataCycleBlocks = new HashSet<>(node.getNode("limits", "allowed-data-cycle-blocks").getList(TypeToken.of(Integer.class)));
|
||||
} catch (ObjectMappingException e) {
|
||||
logger.log(Level.WARNING, "Error loading WorldEdit configuration", e);
|
||||
logger.warn("Error loading WorldEdit configuration", e);
|
||||
}
|
||||
|
||||
registerHelp = node.getNode("register-help").getBoolean(true);
|
||||
|
@ -22,11 +22,10 @@ package com.sk89q.worldedit.sponge.config;
|
||||
import com.sk89q.worldedit.sponge.SpongeWorldEdit;
|
||||
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
|
||||
import ninja.leaping.configurate.loader.ConfigurationLoader;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class SpongeConfiguration extends ConfigurateConfiguration {
|
||||
|
||||
@ -47,7 +46,7 @@ public class SpongeConfiguration extends ConfigurateConfiguration {
|
||||
try {
|
||||
config.save(node);
|
||||
} catch (IOException e) {
|
||||
logger.log(Level.WARNING, "Error loading WorldEdit configuration", e);
|
||||
logger.warn("Error loading WorldEdit configuration", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
public net.minecraft.world.gen.ChunkProviderServer field_73248_b # droppedChunksSet
|
||||
public net.minecraft.world.gen.ChunkProviderServer field_73244_f # id2ChunkMap
|
||||
public net.minecraft.world.gen.ChunkProviderServer field_73245_g # loadedChunks
|
||||
public net.minecraft.world.gen.ChunkProviderServer field_73246_d # serverChunkGenerator
|
@ -1,32 +0,0 @@
|
||||
#Don't put comments; they get removed
|
||||
default-max-polygon-points=-1
|
||||
schematic-save-dir=schematics
|
||||
allow-extra-data-values=false
|
||||
super-pickaxe-many-drop-items=true
|
||||
register-help=true
|
||||
nav-wand-item=345
|
||||
profile=false
|
||||
super-pickaxe-drop-items=true
|
||||
disallowed-blocks=6,26,27,28,31,32,34,36,37,38,39,40,46,50,51,55,59,66,69,75,76,93,94,77,81,83,7,14,15,16,56
|
||||
max-super-pickaxe-size=5
|
||||
max-brush-radius=10
|
||||
craftscript-dir=craftscripts
|
||||
no-double-slash=false
|
||||
wand-item=271
|
||||
shell-save-type=
|
||||
scripting-timeout=3000
|
||||
snapshots-dir=
|
||||
use-inventory-creative-override=false
|
||||
log-file=worldedit.log
|
||||
max-changed-blocks=-1
|
||||
nav-wand-distance=50
|
||||
butcher-default-radius=-1
|
||||
default-max-changed-blocks=-1
|
||||
history-size=15
|
||||
use-inventory=false
|
||||
allow-symbolic-links=false
|
||||
use-inventory-override=false
|
||||
log-commands=false
|
||||
butcher-max-radius=-1
|
||||
max-polygon-points=20
|
||||
max-radius=-1
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren