13
0

Fix block Place in World

Dieser Commit ist enthalten in:
jojo 2020-08-22 15:47:10 +02:00
Ursprung e40371338c
Commit ff4332e064

Datei anzeigen

@ -11,6 +11,7 @@ import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_15_R1.block.data.CraftBlockData;
import java.io.EOFException;
import java.io.IOException;
import java.util.logging.Level;
@ -69,10 +70,12 @@ class PacketProcessor {
byte y = source.rByte();
int z = source.rInt();
short blockState = source.rShort();
int blockState = source.rInt();
CraftBlockData craftBlockData = CraftBlockData.fromData(Block.REGISTRY_ID.fromId(blockState));
world.getBlockAt(x, y, z).setBlockData(craftBlockData);
Bukkit.getScheduler().runTask(SpectateSystem.get(), () -> {
world.getBlockAt(x, y, z).setBlockData(craftBlockData);
});
}
private void process(){
@ -105,7 +108,10 @@ class PacketProcessor {
source.close();
}
}
}catch(IOException e){
} catch (EOFException e) {
Bukkit.getLogger().log(Level.INFO, "End of file", e);
source.close();
} catch(IOException e){
Bukkit.getLogger().log(Level.WARNING, "Could not recieve packet", e);
source.close();
}