Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.mojang.blaze3d.platform.InputConstants;
import com.mojang.datafixers.util.Either;
import net.minecraft.ChatFormatting;
import net.minecraft.util.Util;
Expand Down Expand Up @@ -212,7 +213,7 @@ protected int getCellY(int index) {

@Override
public boolean mouseClicked(MouseButtonEvent mouse, boolean isDoubleClick) {
if (mouse.button() == 0) {
if (mouse.button() == InputConstants.MOUSE_BUTTON_LEFT) {
IRecipeDefinition recipe = getRecipeAt(mouse.x(), mouse.y());
if (recipe != null) {
// The recipe that is clicked first determines the state that the whole drag applies,
Expand All @@ -228,7 +229,7 @@ public boolean mouseClicked(MouseButtonEvent mouse, boolean isDoubleClick) {

@Override
public boolean mouseDragged(MouseButtonEvent mouse, double dragX, double dragY) {
if (this.draggedRecipes != null && mouse.button() == 0) {
if (this.draggedRecipes != null && mouse.button() == InputConstants.MOUSE_BUTTON_LEFT) {
// The mouse can move over several cells between two events,
// so the whole path since the previous position is walked over.
int steps = Mth.clamp((int) Math.ceil(Math.max(Math.abs(dragX), Math.abs(dragY)) / DRAG_STEP),
Expand All @@ -243,7 +244,7 @@ public boolean mouseDragged(MouseButtonEvent mouse, double dragX, double dragY)

@Override
public boolean mouseReleased(MouseButtonEvent mouse) {
if (this.draggedRecipes != null && mouse.button() == 0) {
if (this.draggedRecipes != null && mouse.button() == InputConstants.MOUSE_BUTTON_LEFT) {
this.draggedRecipes = null;
return true;
}
Expand Down
Loading