mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 13:05:41 +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) {
|
||||
@Override
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class SpongeInventoryUtil extends InventoryUtil {
|
||||
}
|
||||
inv.player.deleteMeta("inventory");
|
||||
final SpongePlayer sp = (SpongePlayer) inv.player;
|
||||
sp.player.closeInventory(SpongeUtil.CAUSE);
|
||||
sp.player.closeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,6 +10,7 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
import com.intellectualcrafters.plot.object.RegionWrapper;
|
||||
import com.intellectualcrafters.plot.object.schematic.PlotItem;
|
||||
import com.intellectualcrafters.plot.util.*;
|
||||
import com.plotsquared.sponge.SpongeMain;
|
||||
import com.plotsquared.sponge.object.SpongePlayer;
|
||||
import java.io.IOException;
|
||||
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.living.player.Player;
|
||||
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.serializer.TextSerializers;
|
||||
import org.spongepowered.api.text.translation.Translation;
|
||||
@ -40,7 +42,7 @@ import org.spongepowered.api.world.extent.Extent;
|
||||
|
||||
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 HashMap<String, Integer> biomeMap;
|
||||
private static Player lastPlayer = null;
|
||||
|
@ -52,7 +52,7 @@ public class GenChunk extends ScopedLocalBlockQueue {
|
||||
@Override
|
||||
public boolean setBlock(int x, int y, int z, int id, int data) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ public class SpongeLocalQueue extends BasicLocalBlockQueue<char[]> {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
ChunkPos pos = nmsChunk.getChunkCoordIntPair();
|
||||
ChunkPos pos = nmsChunk.getPos();
|
||||
WorldServer w = (WorldServer) nmsChunk.getWorld();
|
||||
PlayerChunkMap chunkMap = w.getPlayerChunkMap();
|
||||
if (!chunkMap.contains(x, z)) {
|
||||
@ -320,7 +320,7 @@ public class SpongeLocalQueue extends BasicLocalBlockQueue<char[]> {
|
||||
}
|
||||
|
||||
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) {
|
||||
@ -425,7 +425,7 @@ public class SpongeLocalQueue extends BasicLocalBlockQueue<char[]> {
|
||||
public Chunk getChunk(World world, int x, int z) {
|
||||
net.minecraft.world.chunk.Chunk chunk = ((net.minecraft.world.World) world).getChunkProvider().provideChunk(x, z);
|
||||
if (chunk != null && !chunk.isLoaded()) {
|
||||
chunk.onChunkLoad();
|
||||
chunk.onLoad();
|
||||
}
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user