backpack improvements
This commit is contained in:
parent
79f3ef13f5
commit
1b494e0668
@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
|
||||
loader_version=0.11.6
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.17.1.1
|
||||
mod_version = 1.17.1.2
|
||||
maven_group = de.jottyfan.minecraft
|
||||
archives_base_name = quickiefabric
|
||||
|
||||
|
@ -74,15 +74,35 @@ public class BackpackScreenHandler extends ScreenHandler {
|
||||
ItemStack stack = slot == null ? ItemStack.EMPTY : slot.getStack();
|
||||
if (actionType.equals(SlotActionType.PICKUP) || actionType.equals(SlotActionType.PICKUP_ALL)
|
||||
|| actionType.equals(SlotActionType.SWAP)) {
|
||||
super.onSlotClick(slotId, quickCraftData, actionType, playerEntity);
|
||||
} else if (actionType.equals(SlotActionType.THROW)) { // pickup from the active items line
|
||||
if (stack.getName().equals(thisStack.getName())) {
|
||||
return; // omit to put the backpack into itself; as a side effect, omits adding same
|
||||
// colored backpacks into this one
|
||||
} else {
|
||||
// do not throw but pickup
|
||||
super.onSlotClick(slotId, quickCraftData, SlotActionType.PICKUP, playerEntity);
|
||||
}
|
||||
} else if (actionType.equals(SlotActionType.QUICK_CRAFT)) { // drag - but does not drag the right slot content
|
||||
if (slotId < 0) {
|
||||
return; // do not execute anything if slotId is < 0 as sometimes -999
|
||||
}
|
||||
if (playerEntity.world.isClient) {
|
||||
LOGGER.debug("ignoring action type {} on slotId {} for {} x {}", actionType.toString(), slotId,
|
||||
stack.getCount(), stack.getItem().toString());
|
||||
}
|
||||
} else if (actionType.equals(SlotActionType.QUICK_MOVE)) { // shift click
|
||||
if (stack.getName().equals(thisStack.getName())) {
|
||||
return; // omit to put the backpack into itself; as a side effect, omits adding same
|
||||
// colored backpacks into this one
|
||||
} else {
|
||||
// do not move but pickup all
|
||||
super.onSlotClick(slotId, quickCraftData, SlotActionType.PICKUP_ALL, playerEntity);
|
||||
}
|
||||
super.onSlotClick(slotId, quickCraftData, actionType, playerEntity);
|
||||
} else {
|
||||
if (playerEntity.world.isClient) {
|
||||
LOGGER.debug("ignoring action type {} on slotId {} for {} x {}", actionType.toString(), slotId, stack.getCount(),
|
||||
stack.getItem().toString());
|
||||
LOGGER.debug("ignoring action type {} on slotId {} for {} x {}", actionType.toString(), slotId,
|
||||
stack.getCount(), stack.getItem().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user