mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
*
This commit is contained in:
parent
785ba10ca1
commit
d22c0349f7
@ -45,7 +45,7 @@ public class SpongeAugmentedGenerator implements GenerationPopulator {
|
|||||||
AugmentedUtils.generate(world.getName(), cx, cz, new DelegateLocalBlockQueue(null) {
|
AugmentedUtils.generate(world.getName(), cx, cz, new DelegateLocalBlockQueue(null) {
|
||||||
@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) {
|
||||||
terrain.setBlock(bx + x, y, bz + z, SpongeUtil.getBlockState(id, data), SpongeUtil.CAUSE);
|
terrain.setBlock(bx + x, y, bz + z, SpongeUtil.getBlockState(id, data));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public class SpongeInventoryUtil extends InventoryUtil {
|
|||||||
}
|
}
|
||||||
inv.player.deleteMeta("inventory");
|
inv.player.deleteMeta("inventory");
|
||||||
final SpongePlayer sp = (SpongePlayer) inv.player;
|
final SpongePlayer sp = (SpongePlayer) inv.player;
|
||||||
sp.player.closeInventory(SpongeUtil.CAUSE);
|
sp.player.closeInventory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -10,6 +10,7 @@ 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.*;
|
import com.intellectualcrafters.plot.util.*;
|
||||||
|
import com.plotsquared.sponge.SpongeMain;
|
||||||
import com.plotsquared.sponge.object.SpongePlayer;
|
import com.plotsquared.sponge.object.SpongePlayer;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@ -30,6 +31,7 @@ import org.spongepowered.api.data.value.mutable.ListValue;
|
|||||||
import org.spongepowered.api.entity.Entity;
|
import org.spongepowered.api.entity.Entity;
|
||||||
import org.spongepowered.api.entity.living.player.Player;
|
import org.spongepowered.api.entity.living.player.Player;
|
||||||
import org.spongepowered.api.event.cause.Cause;
|
import org.spongepowered.api.event.cause.Cause;
|
||||||
|
import org.spongepowered.api.event.cause.EventContext;
|
||||||
import org.spongepowered.api.text.Text;
|
import org.spongepowered.api.text.Text;
|
||||||
import org.spongepowered.api.text.serializer.TextSerializers;
|
import org.spongepowered.api.text.serializer.TextSerializers;
|
||||||
import org.spongepowered.api.text.translation.Translation;
|
import org.spongepowered.api.text.translation.Translation;
|
||||||
@ -40,7 +42,7 @@ import org.spongepowered.api.world.extent.Extent;
|
|||||||
|
|
||||||
public class SpongeUtil extends WorldUtil {
|
public class SpongeUtil extends WorldUtil {
|
||||||
|
|
||||||
// public static Cause CAUSE = Cause.of(NamedCause.source(Sponge.getPluginManager().fromInstance(SpongeMain.THIS).get()));
|
public static Cause CAUSE = Cause.builder().append(Sponge.getPluginManager().fromInstance(SpongeMain.THIS).get()).build(EventContext.empty());
|
||||||
private static BiomeType[] biomes;
|
private static BiomeType[] biomes;
|
||||||
private static HashMap<String, Integer> biomeMap;
|
private static HashMap<String, Integer> biomeMap;
|
||||||
private static Player lastPlayer = null;
|
private static Player lastPlayer = null;
|
||||||
|
@ -52,7 +52,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));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class SpongeLocalQueue extends BasicLocalBlockQueue<char[]> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
ChunkPos pos = nmsChunk.getChunkCoordIntPair();
|
ChunkPos pos = nmsChunk.getPos();
|
||||||
WorldServer w = (WorldServer) nmsChunk.getWorld();
|
WorldServer w = (WorldServer) nmsChunk.getWorld();
|
||||||
PlayerChunkMap chunkMap = w.getPlayerChunkMap();
|
PlayerChunkMap chunkMap = w.getPlayerChunkMap();
|
||||||
if (!chunkMap.contains(x, z)) {
|
if (!chunkMap.contains(x, z)) {
|
||||||
@ -320,7 +320,7 @@ public class SpongeLocalQueue extends BasicLocalBlockQueue<char[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSolid(int i) {
|
public boolean isSolid(int i) {
|
||||||
return i != 0 && Block.getBlockById(i).isFullyOpaque(Block.getBlockById(i).getDefaultState());
|
return i != 0 && Block.getBlockById(i).isOpaqueCube(Block.getBlockById(i).getDefaultState());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId(char[][] sections, int x, int y, int z) {
|
public int getId(char[][] sections, int x, int y, int z) {
|
||||||
@ -425,7 +425,7 @@ public class SpongeLocalQueue extends BasicLocalBlockQueue<char[]> {
|
|||||||
public Chunk getChunk(World world, int x, int z) {
|
public Chunk getChunk(World world, int x, int z) {
|
||||||
net.minecraft.world.chunk.Chunk chunk = ((net.minecraft.world.World) world).getChunkProvider().provideChunk(x, z);
|
net.minecraft.world.chunk.Chunk chunk = ((net.minecraft.world.World) world).getChunkProvider().provideChunk(x, z);
|
||||||
if (chunk != null && !chunk.isLoaded()) {
|
if (chunk != null && !chunk.isLoaded()) {
|
||||||
chunk.onChunkLoad();
|
chunk.onLoad();
|
||||||
}
|
}
|
||||||
return chunk;
|
return chunk;
|
||||||
}
|
}
|
||||||
@ -475,7 +475,7 @@ public class SpongeLocalQueue extends BasicLocalBlockQueue<char[]> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
refreshChunk(nmsChunk.xPosition, nmsChunk.zPosition);
|
refreshChunk(nmsChunk.x, nmsChunk.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBiomes(LocalChunk<char[]> lc) {
|
public void setBiomes(LocalChunk<char[]> lc) {
|
||||||
|
Loading…
Reference in New Issue
Block a user