forked from GeyserMC/Geyser
Fix comments
This commit is contained in:
parent
08eb99fa94
commit
3972cc7f87
2 changed files with 4 additions and 6 deletions
|
@ -22,12 +22,11 @@ public class SkullBlockEntityTranslator {
|
||||||
public static void checkForSkullVariant(GeyserSession session, BlockState blockState, Vector3i position) {
|
public static void checkForSkullVariant(GeyserSession session, BlockState blockState, Vector3i position) {
|
||||||
byte skullVariant = BlockTranslator.getSkullVariant(blockState);
|
byte skullVariant = BlockTranslator.getSkullVariant(blockState);
|
||||||
byte rotation = BlockTranslator.getSkullRotation(blockState);
|
byte rotation = BlockTranslator.getSkullRotation(blockState);
|
||||||
// If Bed Color is not -1 then it is indeed a bed with a color.
|
if (skullVariant > -1) {
|
||||||
if (skullVariant > 0) {
|
|
||||||
Position pos = new Position(position.getX(), position.getY(), position.getZ());
|
Position pos = new Position(position.getX(), position.getY(), position.getZ());
|
||||||
com.nukkitx.nbt.tag.CompoundTag finalSkullTag = getSkullTag(skullVariant, pos, rotation);
|
com.nukkitx.nbt.tag.CompoundTag finalSkullTag = getSkullTag(skullVariant, pos, rotation);
|
||||||
// Delay needed, otherwise newly placed beds will not get their color
|
// Delay needed, otherwise newly placed skulls will not appear
|
||||||
// Delay is not needed for beds already placed on login
|
// Delay is not needed for skulls already placed on login
|
||||||
session.getConnector().getGeneralThreadPool().schedule(() ->
|
session.getConnector().getGeneralThreadPool().schedule(() ->
|
||||||
BlockEntityUtils.updateBlockEntity(session, finalSkullTag, pos),
|
BlockEntityUtils.updateBlockEntity(session, finalSkullTag, pos),
|
||||||
500,
|
500,
|
||||||
|
|
|
@ -89,8 +89,7 @@ public class ChunkUtils {
|
||||||
chunkData.beds.put(pos, blockState);
|
chunkData.beds.put(pos, blockState);
|
||||||
} else if (BlockTranslator.getSkullVariant(blockState) > 0) {
|
} else if (BlockTranslator.getSkullVariant(blockState) > 0) {
|
||||||
Position pos = new ChunkPosition(column.getX(), column.getZ()).getBlock(x, (chunkY << 4) + y, z);
|
Position pos = new ChunkPosition(column.getX(), column.getZ()).getBlock(x, (chunkY << 4) + y, z);
|
||||||
// Beds need to be updated separately to add the bed color tag
|
//Doing the same stuff as beds
|
||||||
// Previously this was done by matching block state but this resulted in only one bed per color+orientation showing
|
|
||||||
chunkData.skulls.put(pos, blockState);
|
chunkData.skulls.put(pos, blockState);
|
||||||
} else {
|
} else {
|
||||||
section.getBlockStorageArray()[0].setFullBlock(ChunkSection.blockPosition(x, y, z), id);
|
section.getBlockStorageArray()[0].setFullBlock(ChunkSection.blockPosition(x, y, z), id);
|
||||||
|
|
Loading…
Reference in a new issue