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);
|
session.getDownstream().getSession().send(useItemPacket);
|
||||||
break;
|
break;
|
||||||
case 2:
|
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());
|
double blockHardness = BlockTranslator.JAVA_RUNTIME_ID_TO_HARDNESS.get(blockState.getId());
|
||||||
if (session.getGameMode() == GameMode.CREATIVE || (session.getConnector().getConfig().isCacheChunks() && blockHardness == 0)) {
|
if (session.getGameMode() == GameMode.CREATIVE || (session.getConnector().getConfig().isCacheChunks() && blockHardness == 0)) {
|
||||||
session.setLastBlockPlacedId(null);
|
session.setLastBlockPlacedId(null);
|
||||||
|
|
|
@ -112,7 +112,7 @@ public class DoubleChestInventoryTranslator extends BaseInventoryTranslator {
|
||||||
public void closeInventory(GeyserSession session, Inventory inventory) {
|
public void closeInventory(GeyserSession session, Inventory inventory) {
|
||||||
Vector3i holderPos = inventory.getHolderPosition();
|
Vector3i holderPos = inventory.getHolderPosition();
|
||||||
Position pos = new Position(holderPos.getX(), holderPos.getY(), holderPos.getZ());
|
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();
|
UpdateBlockPacket blockPacket = new UpdateBlockPacket();
|
||||||
blockPacket.setDataLayer(0);
|
blockPacket.setDataLayer(0);
|
||||||
blockPacket.setBlockPosition(holderPos);
|
blockPacket.setBlockPosition(holderPos);
|
||||||
|
@ -121,7 +121,7 @@ public class DoubleChestInventoryTranslator extends BaseInventoryTranslator {
|
||||||
|
|
||||||
holderPos = holderPos.add(Vector3i.UNIT_X);
|
holderPos = holderPos.add(Vector3i.UNIT_X);
|
||||||
pos = new Position(holderPos.getX(), holderPos.getY(), holderPos.getZ());
|
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 = new UpdateBlockPacket();
|
||||||
blockPacket.setDataLayer(0);
|
blockPacket.setDataLayer(0);
|
||||||
blockPacket.setBlockPosition(holderPos);
|
blockPacket.setBlockPosition(holderPos);
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class BlockInventoryHolder extends InventoryHolder {
|
||||||
public void closeInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) {
|
public void closeInventory(InventoryTranslator translator, GeyserSession session, Inventory inventory) {
|
||||||
Vector3i holderPos = inventory.getHolderPosition();
|
Vector3i holderPos = inventory.getHolderPosition();
|
||||||
Position pos = new Position(holderPos.getX(), holderPos.getY(), holderPos.getZ());
|
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();
|
UpdateBlockPacket blockPacket = new UpdateBlockPacket();
|
||||||
blockPacket.setDataLayer(0);
|
blockPacket.setDataLayer(0);
|
||||||
blockPacket.setBlockPosition(holderPos);
|
blockPacket.setBlockPosition(holderPos);
|
||||||
|
|
Loading…
Reference in a new issue