mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 16:46:45 +01:00
Fix nukkit compile
This commit is contained in:
parent
ded33aa9be
commit
39084be791
@ -10,18 +10,15 @@ import cn.nukkit.entity.Entity;
|
|||||||
import cn.nukkit.item.Item;
|
import cn.nukkit.item.Item;
|
||||||
import cn.nukkit.level.Level;
|
import cn.nukkit.level.Level;
|
||||||
import cn.nukkit.level.Position;
|
import cn.nukkit.level.Position;
|
||||||
import cn.nukkit.level.generator.biome.Biome;
|
import cn.nukkit.level.biome.Biome;
|
||||||
|
import cn.nukkit.level.biome.EnumBiome;
|
||||||
import cn.nukkit.math.Vector3;
|
import cn.nukkit.math.Vector3;
|
||||||
import com.intellectualcrafters.plot.object.Location;
|
import com.intellectualcrafters.plot.object.Location;
|
||||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||||
import com.intellectualcrafters.plot.object.RegionWrapper;
|
import com.intellectualcrafters.plot.object.RegionWrapper;
|
||||||
import com.intellectualcrafters.plot.object.schematic.PlotItem;
|
import com.intellectualcrafters.plot.object.schematic.PlotItem;
|
||||||
import com.intellectualcrafters.plot.util.MathMan;
|
import com.intellectualcrafters.plot.util.*;
|
||||||
import com.intellectualcrafters.plot.util.StringComparison;
|
|
||||||
import com.intellectualcrafters.plot.util.StringMan;
|
|
||||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
|
||||||
import com.intellectualcrafters.plot.util.WorldUtil;
|
|
||||||
import com.plotsquared.nukkit.NukkitMain;
|
import com.plotsquared.nukkit.NukkitMain;
|
||||||
import com.plotsquared.nukkit.object.NukkitPlayer;
|
import com.plotsquared.nukkit.object.NukkitPlayer;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@ -121,7 +118,7 @@ public class NukkitUtil extends WorldUtil {
|
|||||||
@Override
|
@Override
|
||||||
public String getBiome(String world, int x, int z) {
|
public String getBiome(String world, int x, int z) {
|
||||||
int id = getWorld(world).getBiomeId(x, z);
|
int id = getWorld(world).getBiomeId(x, z);
|
||||||
return Biome.getBiome(id).getName();
|
return EnumBiome.getBiome(id).getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -183,7 +180,7 @@ public class NukkitUtil extends WorldUtil {
|
|||||||
@Override
|
@Override
|
||||||
public int getBiomeFromString(String biomeString) {
|
public int getBiomeFromString(String biomeString) {
|
||||||
try {
|
try {
|
||||||
Biome biome = Biome.getBiome(biomeString.toUpperCase());
|
Biome biome = EnumBiome.getBiome(biomeString.toUpperCase());
|
||||||
return biome.getId();
|
return biome.getId();
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
return -1;
|
return -1;
|
||||||
@ -266,7 +263,7 @@ public class NukkitUtil extends WorldUtil {
|
|||||||
int biome = (int) Biome.class.getDeclaredField(biomeString.toUpperCase()).get(null);
|
int biome = (int) Biome.class.getDeclaredField(biomeString.toUpperCase()).get(null);
|
||||||
for (int x = region.minX; x <= region.maxX; x++) {
|
for (int x = region.minX; x <= region.maxX; x++) {
|
||||||
for (int z = region.minZ; z <= region.maxZ; z++) {
|
for (int z = region.minZ; z <= region.maxZ; z++) {
|
||||||
world.setBiomeId(x, z, biome);
|
world.setBiomeId(x, z, (byte) biome);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
@ -2,9 +2,9 @@ package com.plotsquared.nukkit.util.block;
|
|||||||
|
|
||||||
import cn.nukkit.block.Block;
|
import cn.nukkit.block.Block;
|
||||||
import cn.nukkit.level.Level;
|
import cn.nukkit.level.Level;
|
||||||
|
import cn.nukkit.level.biome.EnumBiome;
|
||||||
import cn.nukkit.level.format.FullChunk;
|
import cn.nukkit.level.format.FullChunk;
|
||||||
import cn.nukkit.level.format.generic.BaseFullChunk;
|
import cn.nukkit.level.format.generic.BaseFullChunk;
|
||||||
import cn.nukkit.level.generator.biome.Biome;
|
|
||||||
import cn.nukkit.math.Vector3;
|
import cn.nukkit.math.Vector3;
|
||||||
import com.intellectualcrafters.plot.PS;
|
import com.intellectualcrafters.plot.PS;
|
||||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||||
@ -111,8 +111,8 @@ public class NukkitLocalQueue<T> extends BasicLocalBlockQueue<T> {
|
|||||||
for (int y = 0; y < biomes2.length; y++) {
|
for (int y = 0; y < biomes2.length; y++) {
|
||||||
String biomeStr = biomes2[y];
|
String biomeStr = biomes2[y];
|
||||||
if (biomeStr != null) {
|
if (biomeStr != null) {
|
||||||
biome = Biome.getBiome(biomeStr.toUpperCase()).getId();
|
biome = EnumBiome.getBiome(biomeStr.toUpperCase()).getId();
|
||||||
level.setBiomeId(bx + x, bz + y, biome);
|
level.setBiomeId(bx + x, bz + y, (byte) biome);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package com.plotsquared.nukkit.util.block;
|
package com.plotsquared.nukkit.util.block;
|
||||||
|
|
||||||
|
import cn.nukkit.level.biome.Biome;
|
||||||
|
import cn.nukkit.level.biome.EnumBiome;
|
||||||
import cn.nukkit.level.format.generic.BaseFullChunk;
|
import cn.nukkit.level.format.generic.BaseFullChunk;
|
||||||
import cn.nukkit.level.generator.biome.Biome;
|
|
||||||
import com.intellectualcrafters.plot.object.Location;
|
import com.intellectualcrafters.plot.object.Location;
|
||||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||||
import com.intellectualcrafters.plot.util.block.ScopedLocalBlockQueue;
|
import com.intellectualcrafters.plot.util.block.ScopedLocalBlockQueue;
|
||||||
import java.awt.Color;
|
|
||||||
|
|
||||||
public class NukkitWrappedChunk extends ScopedLocalBlockQueue {
|
public class NukkitWrappedChunk extends ScopedLocalBlockQueue {
|
||||||
private final String world;
|
private final String world;
|
||||||
@ -39,23 +39,19 @@ public class NukkitWrappedChunk extends ScopedLocalBlockQueue {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(int x, int z, String biome) {
|
public boolean setBiome(int x, int z, String biome) {
|
||||||
Biome b = Biome.getBiome(biome);
|
Biome b = EnumBiome.getBiome(biome);
|
||||||
int id = b.getId();
|
int id = b.getId();
|
||||||
Color color = new Color(b.getColor());
|
|
||||||
chunk.setBiomeId(x, z, id);
|
chunk.setBiomeId(x, z, id);
|
||||||
chunk.setBiomeColor(x, z, color.getRed(), color.getGreen(), color.getBlue());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fillBiome(String biome) {
|
public void fillBiome(String biome) {
|
||||||
Biome b = Biome.getBiome(biome);
|
Biome b = EnumBiome.getBiome(biome);
|
||||||
int id = b.getId();
|
int id = b.getId();
|
||||||
Color color = new Color(b.getColor());
|
|
||||||
for (int x = 0; x < 16; x++) {
|
for (int x = 0; x < 16; x++) {
|
||||||
for (int z = 0; z < 16; z++) {
|
for (int z = 0; z < 16; z++) {
|
||||||
chunk.setBiomeId(x, z, id);
|
chunk.setBiomeId(x, z, id);
|
||||||
chunk.setBiomeColor(x, z, color.getRed(), color.getGreen(), color.getBlue());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user