mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Access world manager instead of chunk cache to fix particles on Bukkit version
This commit is contained in:
parent
364aac7e1a
commit
4d32f6ab70
3 changed files with 4 additions and 4 deletions
|
@ -116,7 +116,7 @@ public class BedrockInventoryTransactionTranslator extends PacketTranslator<Inve
|
|||
session.getDownstream().getSession().send(useItemPacket);
|
||||
break;
|
||||
case 2:
|
||||
BlockState blockState = session.getChunkCache().getBlockAt(new Position(packet.getBlockPosition().getX(), packet.getBlockPosition().getY(), packet.getBlockPosition().getZ()));
|
||||
BlockState blockState = session.getConnector().getWorldManager().getBlockAt(session, packet.getBlockPosition().getX(), packet.getBlockPosition().getY(), packet.getBlockPosition().getZ());
|
||||
double blockHardness = BlockTranslator.JAVA_RUNTIME_ID_TO_HARDNESS.get(blockState.getId());
|
||||
if (session.getGameMode() == GameMode.CREATIVE || (session.getConnector().getConfig().isCacheChunks() && blockHardness == 0)) {
|
||||
session.setLastBlockPlacedId(null);
|
||||
|
|
|
@ -112,7 +112,7 @@ public class DoubleChestInventoryTranslator extends BaseInventoryTranslator {
|
|||
public void closeInventory(GeyserSession session, Inventory inventory) {
|
||||
Vector3i holderPos = inventory.getHolderPosition();
|
||||
Position pos = new Position(holderPos.getX(), holderPos.getY(), holderPos.getZ());
|
||||
BlockState realBlock = session.getChunkCache().getBlockAt(pos);
|
||||
BlockState realBlock = session.getConnector().getWorldManager().getBlockAt(session, pos.getX(), pos.getY(), pos.getZ());
|
||||
UpdateBlockPacket blockPacket = new UpdateBlockPacket();
|
||||
blockPacket.setDataLayer(0);
|
||||
blockPacket.setBlockPosition(holderPos);
|
||||
|
@ -121,7 +121,7 @@ public class DoubleChestInventoryTranslator extends BaseInventoryTranslator {
|
|||
|
||||
holderPos = holderPos.add(Vector3i.UNIT_X);
|
||||
pos = new Position(holderPos.getX(), holderPos.getY(), holderPos.getZ());
|
||||
realBlock = session.getChunkCache().getBlockAt(pos);
|
||||
realBlock = session.getConnector().getWorldManager().getBlockAt(session, pos.getX(), pos.getY(), pos.getZ());
|
||||
blockPacket = new UpdateBlockPacket();
|
||||
blockPacket.setDataLayer(0);
|
||||
blockPacket.setBlockPosition(holderPos);
|
||||
|
|
|
@ -82,7 +82,7 @@ public class BlockInventoryHolder extends InventoryHolder {
|
|||
public void closeInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) {
|
||||
Vector3i holderPos = inventory.getHolderPosition();
|
||||
Position pos = new Position(holderPos.getX(), holderPos.getY(), holderPos.getZ());
|
||||
BlockState realBlock = session.getChunkCache().getBlockAt(pos);
|
||||
BlockState realBlock = session.getConnector().getWorldManager().getBlockAt(session, pos.getX(), pos.getY(), pos.getZ());
|
||||
UpdateBlockPacket blockPacket = new UpdateBlockPacket();
|
||||
blockPacket.setDataLayer(0);
|
||||
blockPacket.setBlockPosition(holderPos);
|
||||
|
|
Loading…
Reference in a new issue