Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-20 01:40:06 +01:00
Fix tests
Dieser Commit ist enthalten in:
Ursprung
36857a5064
Commit
3ec1912046
@ -0,0 +1,113 @@
|
||||
package com.fastasyncworldedit.util;
|
||||
|
||||
import com.fastasyncworldedit.core.extent.processor.lighting.RelighterFactory;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.AbstractPlatform;
|
||||
import com.sk89q.worldedit.extension.platform.Capability;
|
||||
import com.sk89q.worldedit.extension.platform.Preference;
|
||||
import com.sk89q.worldedit.internal.Constants;
|
||||
import com.sk89q.worldedit.util.SideEffect;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.registry.Registries;
|
||||
import org.enginehub.piston.CommandManager;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class StubPlatform extends AbstractPlatform {
|
||||
|
||||
@Override
|
||||
public Registries getRegistries() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDataVersion() {
|
||||
return Constants.DATA_VERSION_MC_1_18;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidMobType(final String type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reload() {
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Player matchPlayer(final Player player) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public World matchWorld(final World world) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCommands(final CommandManager commandManager) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGameHooksEnabled(final boolean enabled) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalConfiguration getConfiguration() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "TEST";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlatformName() {
|
||||
return "TEST";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlatformVersion() {
|
||||
return "TEST";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Capability, Preference> getCapabilities() {
|
||||
Map<Capability, Preference> capabilities = new EnumMap<>(Capability.class);
|
||||
capabilities.put(Capability.WORLD_EDITING, Preference.PREFER_OTHERS);
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<SideEffect> getSupportedSideEffects() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RelighterFactory getRelighterFactory() {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Use most "extreme" value
|
||||
@Override
|
||||
public int getVersionMinY() {
|
||||
return -64;
|
||||
}
|
||||
|
||||
// Use most "extreme" value
|
||||
@Override
|
||||
public int getVersionMaxY() {
|
||||
return 319;
|
||||
}
|
||||
|
||||
}
|
@ -19,7 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit.internal.util;
|
||||
|
||||
import com.fastasyncworldedit.util.StubPlatform;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import it.unimi.dsi.fastutil.ints.IntRBTreeSet;
|
||||
@ -71,6 +73,10 @@ public class RegionOptimizedVectorSorterTest {
|
||||
0, 1, 10, 100, 1_000, 10_000, 100_000, 1_000_000, 10_000_000
|
||||
})
|
||||
void checkSorted(int size) {
|
||||
//FAWE start - required for AbstractRegion recalculation testing height limits with null world
|
||||
WorldEdit.getInstance().getPlatformManager().register(new StubPlatform());
|
||||
WorldEdit.getInstance().getPlatformManager().handlePlatformsRegistered(null);
|
||||
//FAWE end
|
||||
Random rng = new Random(size);
|
||||
List<BlockVector3> toSort;
|
||||
if (size == 0) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren