use of net.minecraft.screen.PlayerScreenHandler in project Polymorph by TheIllusiveC4.
the class FastBenchModule method selectRecipe.
@Override
public boolean selectRecipe(ScreenHandler screenHandler, Recipe<?> recipe) {
if (recipe instanceof CraftingRecipe) {
CraftingResultInventory result = null;
if (screenHandler instanceof CraftingScreenHandler) {
AccessorCraftingScreenHandler accessor = (AccessorCraftingScreenHandler) screenHandler;
result = accessor.getResult();
} else if (screenHandler instanceof PlayerScreenHandler) {
AccessorPlayerScreenHandler accessor = (AccessorPlayerScreenHandler) screenHandler;
result = accessor.getCraftingResult();
}
if (result != null) {
result.setLastRecipe(recipe);
}
}
return false;
}
use of net.minecraft.screen.PlayerScreenHandler in project Hypnotic-Client by Hypnotic-Development.
the class InventoryScreenMixin method dupe.
// Credits to Duper Trooper for publishing the dupe
// Original video https://www.youtube.com/watch?v=8Xd7DcApFbM
private void dupe() {
Slot outputSlot = (Slot) ((PlayerScreenHandler) this.handler).slots.get(0);
this.onMouseClick(outputSlot, outputSlot.id, 0, SlotActionType.THROW);
}
Aggregations