Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-19 14:30:17 +01:00
Fix Merchant Inventory Transaction (#1017)
Dieser Commit ist enthalten in:
Ursprung
5c2a225533
Commit
d03f56e7e8
@ -60,7 +60,8 @@ public class MerchantInventoryTranslator extends BaseInventoryTranslator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bedrockSlotToJava(InventoryActionData action) {
|
public int bedrockSlotToJava(InventoryActionData action) {
|
||||||
if (action.getSource().getContainerId() == ContainerId.UI) {
|
switch (action.getSource().getContainerId()) {
|
||||||
|
case ContainerId.UI:
|
||||||
switch (action.getSlot()) {
|
switch (action.getSlot()) {
|
||||||
case 4:
|
case 4:
|
||||||
return 0;
|
return 0;
|
||||||
@ -69,6 +70,13 @@ public class MerchantInventoryTranslator extends BaseInventoryTranslator {
|
|||||||
case 50:
|
case 50:
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case -28: // Trading 1?
|
||||||
|
return 0;
|
||||||
|
case -29: // Trading 2?
|
||||||
|
return 1;
|
||||||
|
case -30: // Trading Output?
|
||||||
|
return 2;
|
||||||
}
|
}
|
||||||
return super.bedrockSlotToJava(action);
|
return super.bedrockSlotToJava(action);
|
||||||
}
|
}
|
||||||
@ -109,11 +117,9 @@ public class MerchantInventoryTranslator extends BaseInventoryTranslator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void translateActions(GeyserSession session, Inventory inventory, List<InventoryActionData> actions) {
|
public void translateActions(GeyserSession session, Inventory inventory, List<InventoryActionData> actions) {
|
||||||
for (InventoryActionData action : actions) {
|
if (actions.stream().anyMatch(a -> a.getSource().getContainerId() == -31)) {
|
||||||
if (action.getSource().getType() == InventorySource.Type.NON_IMPLEMENTED_TODO) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
super.translateActions(session, inventory, actions);
|
super.translateActions(session, inventory, actions);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren