Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-17 05:20:05 +01:00
Code cleanup, fixed doors, chunk entity fetching
Dieser Commit ist enthalten in:
Ursprung
786fdfb9fe
Commit
078f48c0fb
@ -175,10 +175,13 @@ public class BlockDoor extends Block {
|
||||
CraftWorld craftWorld = ((WorldServer) world).getWorld();
|
||||
CraftServer server = ((WorldServer) world).getServer();
|
||||
org.bukkit.block.Block block = craftWorld.getBlockAt(i, j, k);
|
||||
org.bukkit.block.Block blockTop = craftWorld.getBlockAt(i, j + 1, k);
|
||||
int power = block.getBlockPower();
|
||||
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, (world.getData(i, j, k) & 4) > 0 ? 15: 0, flag1 ? 15 : 0);
|
||||
int powerTop = blockTop.getBlockPower();
|
||||
if (powerTop > power) power = powerTop;
|
||||
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, (world.getData(i, j, k) & 4) > 0 ? 15: 0, power);
|
||||
server.getPluginManager().callEvent(eventRedstone);
|
||||
this.a(world, i, j, k, eventRedstone.getNewCurrent());
|
||||
this.a(world, i, j, k, eventRedstone.getNewCurrent() > 0);
|
||||
// Craftbukkit end
|
||||
}
|
||||
}
|
||||
|
@ -280,7 +280,9 @@ public class BlockRedstoneWire extends Block {
|
||||
if (!flag) {
|
||||
this.b_(world, i, j, k, i1);
|
||||
world.e(i, j, k, 0);
|
||||
} else if((Block.byId[l] != null && Block.byId[l].c()) || Block.DIODE_OFF.id == l && Block.DIODE_ON.id == l) { //condition added by Craftbukkit
|
||||
} else
|
||||
// Craftbukkit
|
||||
if ((Block.byId[l] != null && Block.byId[l].c()) || Block.DIODE_OFF.id == l && Block.DIODE_ON.id == l) {
|
||||
this.g(world, i, j, k);
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,9 @@ public class CraftChunk implements Chunk {
|
||||
}
|
||||
Entity[] entities = new Entity[count];
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (net.minecraft.server.Entity entity : (net.minecraft.server.Entity[])chunk.m[i].toArray()) {
|
||||
for (Object obj : (net.minecraft.server.Entity[])chunk.m[i].toArray()) {
|
||||
if (!(obj instanceof net.minecraft.server.Entity)) continue;
|
||||
net.minecraft.server.Entity entity = (net.minecraft.server.Entity) obj;
|
||||
entities[index++] = entity.getBukkitEntity();
|
||||
}
|
||||
}
|
||||
@ -84,7 +86,9 @@ public class CraftChunk implements Chunk {
|
||||
int index = 0;
|
||||
net.minecraft.server.Chunk chunk = getHandle();
|
||||
BlockState[] entities = new BlockState[chunk.l.size()];
|
||||
for (ChunkPosition position : (ChunkPosition[])chunk.l.keySet().toArray()) {
|
||||
for (Object obj : chunk.l.keySet().toArray()) {
|
||||
if (!(obj instanceof ChunkPosition)) continue;
|
||||
ChunkPosition position = (ChunkPosition) obj;
|
||||
entities[index++] = worldServer.getWorld().getBlockAt(position.a, position.b, position.c).getState();
|
||||
}
|
||||
return entities;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren