mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-01 05:04:43 +02:00
Make Sponge compile
It doesn't work but it allows the project to compile.
This commit is contained in:
@ -8,11 +8,11 @@ import com.intellectualcrafters.plot.util.SetQueue;
|
||||
import com.intellectualcrafters.plot.util.SetQueue.ChunkWrapper;
|
||||
import com.intellectualcrafters.plot.util.TaskManager;
|
||||
import com.plotsquared.sponge.util.SpongeUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ClassInheritanceMultiMap;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.chunk.BlockStateContainer;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
import org.spongepowered.api.world.Chunk;
|
||||
import org.spongepowered.api.world.World;
|
||||
@ -132,11 +132,11 @@ public class FastQueue extends SlowQueue {
|
||||
ExtendedBlockStorage section = sections[j];
|
||||
if ((section == null) || (fs.getCount(j) >= 4096)) {
|
||||
section = new ExtendedBlockStorage(j << 4, flag);
|
||||
section.setData(newArray);
|
||||
//section.setData(newArray); //todo
|
||||
sections[j] = section;
|
||||
continue;
|
||||
}
|
||||
char[] currentArray = section.getData();
|
||||
BlockStateContainer currentArray = section.getData();
|
||||
boolean fill = true;
|
||||
for (int k = 0; k < newArray.length; k++) {
|
||||
char n = newArray[k];
|
||||
@ -146,10 +146,10 @@ public class FastQueue extends SlowQueue {
|
||||
continue;
|
||||
case 1:
|
||||
fill = false;
|
||||
currentArray[k] = 0;
|
||||
//currentArray[k] = 0; //todo
|
||||
continue;
|
||||
default:
|
||||
currentArray[k] = n;
|
||||
//currentArray[k] = n; //todo
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -226,10 +226,11 @@ public class FastQueue extends SlowQueue {
|
||||
if ((bc.getRelight(j) == 0 && !fixAll) || bc.getCount(j) == 0 || (bc.getCount(j) >= 4096 && bc.getAir(j) == 0)) {
|
||||
continue;
|
||||
}
|
||||
char[] array = section.getData();
|
||||
BlockStateContainer array = section.getData();
|
||||
int l = PseudoRandom.random.random(2);
|
||||
for (int k = 0; k < array.length; k++) {
|
||||
int i = array[k];
|
||||
for (int k = 0; k < array.getSerializedSize(); k++) {
|
||||
int i = 0;
|
||||
//i = array[k]; //todo
|
||||
if (i < 16) {
|
||||
continue;
|
||||
}
|
||||
@ -285,7 +286,8 @@ public class FastQueue extends SlowQueue {
|
||||
}
|
||||
|
||||
public boolean isSolid(int i) {
|
||||
return i != 0 && Block.getBlockById(i).isOpaqueCube();
|
||||
//return i != 0 && Block.getBlockById(i).isOpaqueCube();
|
||||
throw new UnsupportedOperationException("Unsupported");
|
||||
}
|
||||
|
||||
public int getId(ExtendedBlockStorage[] sections, int x, int y, int z) {
|
||||
@ -300,9 +302,10 @@ public class FastQueue extends SlowQueue {
|
||||
if (section == null) {
|
||||
return 0;
|
||||
}
|
||||
char[] array = section.getData();
|
||||
BlockStateContainer array = section.getData();
|
||||
int j = MainUtil.CACHE_J[y][x][z];
|
||||
return array[j] >> 4;
|
||||
//return array[j] >> 4; //todo: fix for 1.9.4
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,7 +13,7 @@ import com.plotsquared.sponge.util.SpongeUtil;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.NetHandlerPlayServer;
|
||||
import net.minecraft.network.play.server.S21PacketChunkData;
|
||||
import net.minecraft.network.play.server.SPacketChunkData;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.world.Chunk;
|
||||
import org.spongepowered.api.world.World;
|
||||
@ -81,9 +81,9 @@ public class SendChunk {
|
||||
continue;
|
||||
}
|
||||
chunks.remove(chunk);
|
||||
NetHandlerPlayServer con = nmsPlayerMP.playerNetServerHandler;
|
||||
NetHandlerPlayServer con = nmsPlayerMP.connection;
|
||||
net.minecraft.world.chunk.Chunk nmsChunk = (net.minecraft.world.chunk.Chunk) chunk;
|
||||
S21PacketChunkData packet = new S21PacketChunkData(nmsChunk, true, 65535);
|
||||
SPacketChunkData packet = new SPacketChunkData(nmsChunk, 65535);
|
||||
con.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user