mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-09-06 00:58:26 +02:00
Minor sponge fixes
This commit is contained in:
parent
770b9be160
commit
b91eab2f0c
@ -14,7 +14,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'net.minecrell.vanilla.server.library'
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
|
||||
dependencies {
|
||||
compile project(':Core')
|
||||
@ -35,7 +35,7 @@ repositories {
|
||||
}
|
||||
}
|
||||
minecraft {
|
||||
version = "1.10.2"
|
||||
version = "2014"
|
||||
mappings = "snapshot_20160629"
|
||||
runDir = 'run'
|
||||
}
|
||||
|
@ -58,6 +58,8 @@ import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.config.ConfigDir;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.event.Listener;
|
||||
import org.spongepowered.api.event.cause.Cause;
|
||||
import org.spongepowered.api.event.cause.NamedCause;
|
||||
import org.spongepowered.api.event.game.state.GameAboutToStartServerEvent;
|
||||
import org.spongepowered.api.plugin.Plugin;
|
||||
import org.spongepowered.api.plugin.PluginContainer;
|
||||
@ -80,6 +82,7 @@ import java.util.stream.Collectors;
|
||||
public class SpongeMain implements IPlotMain {
|
||||
|
||||
public static SpongeMain THIS;
|
||||
public static final Cause CAUSE = Cause.of(NamedCause.of("PlotSquared", SpongeMain.THIS));
|
||||
|
||||
@Inject
|
||||
public PluginContainer plugin;
|
||||
|
@ -8,8 +8,6 @@ import com.plotsquared.sponge.SpongeMain;
|
||||
import com.plotsquared.sponge.util.SpongeUtil;
|
||||
import java.util.List;
|
||||
import org.spongepowered.api.block.BlockState;
|
||||
import org.spongepowered.api.event.cause.Cause;
|
||||
import org.spongepowered.api.event.cause.NamedCause;
|
||||
import org.spongepowered.api.world.World;
|
||||
import org.spongepowered.api.world.extent.ImmutableBiomeArea;
|
||||
import org.spongepowered.api.world.extent.MutableBlockVolume;
|
||||
@ -37,8 +35,6 @@ public class SpongeAugmentedGenerator implements GenerationPopulator {
|
||||
return generator;
|
||||
}
|
||||
|
||||
private Cause cause = Cause.of(NamedCause.of("PlotSquared", SpongeMain.THIS));
|
||||
|
||||
@Override
|
||||
public void populate(World world, MutableBlockVolume terrain, ImmutableBiomeArea biome) {
|
||||
Vector3i min = terrain.getBlockMin();
|
||||
@ -49,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), cause);
|
||||
terrain.setBlock(bx + x, y, bz + z, SpongeUtil.getBlockState(id, data), SpongeMain.CAUSE);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,7 @@ 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.sponge.SpongeMain;
|
||||
import com.plotsquared.sponge.object.SpongePlayer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
@ -429,7 +430,7 @@ public class SpongeUtil extends WorldUtil {
|
||||
@Override
|
||||
public void setSign(String worldName, int x, int y, int z, String[] lines) {
|
||||
World world = SpongeUtil.getWorld(worldName);
|
||||
world.setBlock(x, y, z, BlockTypes.WALL_SIGN.getDefaultState());
|
||||
world.setBlock(x, y, z, BlockTypes.WALL_SIGN.getDefaultState(), SpongeMain.CAUSE);
|
||||
Optional<TileEntity> block = world.getTileEntity(x, y, z);
|
||||
if (!block.isPresent()) {
|
||||
return;
|
||||
|
@ -4,6 +4,7 @@ import com.intellectualcrafters.plot.object.ChunkWrapper;
|
||||
import com.intellectualcrafters.plot.object.Location;
|
||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||
import com.intellectualcrafters.plot.util.block.ScopedLocalBlockQueue;
|
||||
import com.plotsquared.sponge.SpongeMain;
|
||||
import com.plotsquared.sponge.util.SpongeUtil;
|
||||
import org.spongepowered.api.world.biome.BiomeType;
|
||||
import org.spongepowered.api.world.extent.MutableBiomeArea;
|
||||
@ -52,7 +53,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));
|
||||
this.terrain.setBlock(this.bx + x, y, this.bz + z, SpongeUtil.getBlockState(id, data), SpongeMain.CAUSE);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.StringMan;
|
||||
import com.intellectualcrafters.plot.util.TaskManager;
|
||||
import com.intellectualcrafters.plot.util.block.BasicLocalBlockQueue;
|
||||
import com.plotsquared.sponge.SpongeMain;
|
||||
import com.plotsquared.sponge.util.SpongeUtil;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Arrays;
|
||||
@ -441,7 +442,7 @@ public class SpongeLocalQueue extends BasicLocalBlockQueue<char[]> {
|
||||
World worldObj = getSpongeWorld();
|
||||
org.spongepowered.api.world.Chunk spongeChunk = (org.spongepowered.api.world.Chunk) getChunk(worldObj, lc.getX(), lc.getZ());
|
||||
char[][] ids = ((CharLocalChunk) lc).blocks;
|
||||
MutableBlockVolumeWorker<? extends org.spongepowered.api.world.Chunk> blockWorker = spongeChunk.getBlockWorker();
|
||||
MutableBlockVolumeWorker<? extends org.spongepowered.api.world.Chunk> blockWorker = spongeChunk.getBlockWorker(SpongeMain.CAUSE);
|
||||
blockWorker.map(new BlockVolumeMapper() {
|
||||
@Override
|
||||
public BlockState map(UnmodifiableBlockVolume volume, int xx, int y, int zz) {
|
||||
|
Loading…
Reference in New Issue
Block a user