From d22c0349f787fd8413a382dc7d88f34a1f61f828 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 25 Jan 2018 15:32:25 +1100 Subject: [PATCH] * --- .../sponge/generator/SpongeAugmentedGenerator.java | 2 +- .../com/plotsquared/sponge/util/SpongeInventoryUtil.java | 2 +- .../main/java/com/plotsquared/sponge/util/SpongeUtil.java | 4 +++- .../java/com/plotsquared/sponge/util/block/GenChunk.java | 2 +- .../plotsquared/sponge/util/block/SpongeLocalQueue.java | 8 ++++---- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Sponge/src/main/java/com/plotsquared/sponge/generator/SpongeAugmentedGenerator.java b/Sponge/src/main/java/com/plotsquared/sponge/generator/SpongeAugmentedGenerator.java index a00c0eb0a..67593c8ce 100644 --- a/Sponge/src/main/java/com/plotsquared/sponge/generator/SpongeAugmentedGenerator.java +++ b/Sponge/src/main/java/com/plotsquared/sponge/generator/SpongeAugmentedGenerator.java @@ -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; } diff --git a/Sponge/src/main/java/com/plotsquared/sponge/util/SpongeInventoryUtil.java b/Sponge/src/main/java/com/plotsquared/sponge/util/SpongeInventoryUtil.java index a120048e7..f7baa148b 100644 --- a/Sponge/src/main/java/com/plotsquared/sponge/util/SpongeInventoryUtil.java +++ b/Sponge/src/main/java/com/plotsquared/sponge/util/SpongeInventoryUtil.java @@ -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 diff --git a/Sponge/src/main/java/com/plotsquared/sponge/util/SpongeUtil.java b/Sponge/src/main/java/com/plotsquared/sponge/util/SpongeUtil.java index a0e464adf..6a09c8916 100644 --- a/Sponge/src/main/java/com/plotsquared/sponge/util/SpongeUtil.java +++ b/Sponge/src/main/java/com/plotsquared/sponge/util/SpongeUtil.java @@ -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 biomeMap; private static Player lastPlayer = null; diff --git a/Sponge/src/main/java/com/plotsquared/sponge/util/block/GenChunk.java b/Sponge/src/main/java/com/plotsquared/sponge/util/block/GenChunk.java index 95c2edf04..06a567ab4 100644 --- a/Sponge/src/main/java/com/plotsquared/sponge/util/block/GenChunk.java +++ b/Sponge/src/main/java/com/plotsquared/sponge/util/block/GenChunk.java @@ -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; } diff --git a/Sponge/src/main/java/com/plotsquared/sponge/util/block/SpongeLocalQueue.java b/Sponge/src/main/java/com/plotsquared/sponge/util/block/SpongeLocalQueue.java index 8be262a71..b74b9f8d8 100644 --- a/Sponge/src/main/java/com/plotsquared/sponge/util/block/SpongeLocalQueue.java +++ b/Sponge/src/main/java/com/plotsquared/sponge/util/block/SpongeLocalQueue.java @@ -71,7 +71,7 @@ public class SpongeLocalQueue extends BasicLocalBlockQueue { 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 { } 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 { 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 { } } } - refreshChunk(nmsChunk.xPosition, nmsChunk.zPosition); + refreshChunk(nmsChunk.x, nmsChunk.z); } public void setBiomes(LocalChunk lc) {