mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
parent
68c13c08fa
commit
b70e2645c8
1 changed files with 22 additions and 1 deletions
|
@ -401,7 +401,6 @@ public class PlayerInventoryTranslator extends InventoryTranslator {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CRAFT_RESULTS_DEPRECATED: {
|
case CRAFT_RESULTS_DEPRECATED: {
|
||||||
CraftResultsDeprecatedStackRequestActionData deprecatedCraftAction = (CraftResultsDeprecatedStackRequestActionData) action;
|
|
||||||
if (craftState != CraftState.RECIPE_ID) {
|
if (craftState != CraftState.RECIPE_ID) {
|
||||||
return rejectRequest(request);
|
return rejectRequest(request);
|
||||||
}
|
}
|
||||||
|
@ -453,6 +452,28 @@ public class PlayerInventoryTranslator extends InventoryTranslator {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case DROP: {
|
||||||
|
// Can be replicated as of 1.18.2 Bedrock on mobile by clicking from the creative menu to outside it
|
||||||
|
if (craftState != CraftState.DEPRECATED) {
|
||||||
|
return rejectRequest(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
DropStackRequestActionData dropAction = (DropStackRequestActionData) action;
|
||||||
|
if (dropAction.getSource().getContainer() != ContainerSlotType.CREATIVE_OUTPUT || dropAction.getSource().getSlot() != 50) {
|
||||||
|
return rejectRequest(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack dropStack;
|
||||||
|
if (dropAction.getCount() == javaCreativeItem.getAmount()) {
|
||||||
|
dropStack = javaCreativeItem;
|
||||||
|
} else {
|
||||||
|
// Specify custom count
|
||||||
|
dropStack = new ItemStack(javaCreativeItem.getId(), dropAction.getCount(), javaCreativeItem.getNbt());
|
||||||
|
}
|
||||||
|
ServerboundSetCreativeModeSlotPacket creativeDropPacket = new ServerboundSetCreativeModeSlotPacket(-1, dropStack);
|
||||||
|
session.sendDownstreamPacket(creativeDropPacket);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return rejectRequest(request);
|
return rejectRequest(request);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue