3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

Made Block.setType/Block.setData functional

Dieser Commit ist enthalten in:
Dinnerbone 2010-12-29 01:07:57 +00:00
Ursprung 36b95edc0c
Commit 6d28eb0111
2 geänderte Dateien mit 10 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -4,22 +4,22 @@ package org.bukkit.craftbukkit;
import org.bukkit.*; import org.bukkit.*;
public class CraftBlock implements Block { public class CraftBlock implements Block {
private final World world; private final CraftWorld world;
private final Chunk chunk; private final CraftChunk chunk;
private final int x; private final int x;
private final int y; private final int y;
private final int z; private final int z;
protected int type; protected int type;
protected byte data; protected byte data;
protected CraftBlock(final World world, final int x, final int y, final int z, final int type, final byte data) { protected CraftBlock(final CraftWorld world, final int x, final int y, final int z, final int type, final byte data) {
this.world = world; this.world = world;
this.x = x; this.x = x;
this.y = y; this.y = y;
this.z = z; this.z = z;
this.type = type; this.type = type;
this.data = data; this.data = data;
this.chunk = world.getChunkAt(x << 4, z << 4); this.chunk = (CraftChunk)world.getChunkAt(x << 4, z << 4);
} }
/** /**
@ -74,6 +74,7 @@ public class CraftBlock implements Block {
*/ */
public void setData(final byte data) { public void setData(final byte data) {
this.data = data; this.data = data;
world.getHandle().c(x, y, z, data);
} }
/** /**
@ -92,6 +93,7 @@ public class CraftBlock implements Block {
*/ */
public void setType(final int type) { public void setType(final int type) {
this.type = type; this.type = type;
world.getHandle().d(x, y, z, type);
} }
/** /**

Datei anzeigen

@ -66,6 +66,10 @@ public class CraftWorld implements World {
return block; return block;
} }
public WorldServer getHandle() {
return world;
}
private final class ChunkCoordinate { private final class ChunkCoordinate {
public final int x; public final int x;
public final int z; public final int z;