1.21.5
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: MiniDigger | Martin <admin@minidigger.dev> Co-authored-by: Nassim Jahnke <nassim@njahnke.dev> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Shane Freeder <theboyetronic@gmail.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com> Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
This commit is contained in:
@@ -1,55 +1,54 @@
|
||||
package org.bukkit.craftbukkit;
|
||||
|
||||
import java.util.Objects;
|
||||
import org.bukkit.Input;
|
||||
|
||||
public class CraftInput implements Input {
|
||||
|
||||
private final net.minecraft.world.entity.player.Input handle;
|
||||
private final net.minecraft.world.entity.player.Input input;
|
||||
|
||||
public CraftInput(net.minecraft.world.entity.player.Input handle) {
|
||||
this.handle = handle;
|
||||
public CraftInput(net.minecraft.world.entity.player.Input input) {
|
||||
this.input = input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isForward() {
|
||||
return this.handle.forward();
|
||||
return this.input.forward();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBackward() {
|
||||
return this.handle.backward();
|
||||
return this.input.backward();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLeft() {
|
||||
return this.handle.left();
|
||||
return this.input.left();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRight() {
|
||||
return this.handle.right();
|
||||
return this.input.right();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isJump() {
|
||||
return this.handle.jump();
|
||||
return this.input.jump();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSneak() {
|
||||
return this.handle.shift();
|
||||
return this.input.shift();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSprint() {
|
||||
return this.handle.sprint();
|
||||
return this.input.sprint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 89 * hash + Objects.hashCode(this.handle);
|
||||
hash = 89 * hash + this.input.hashCode();
|
||||
return hash;
|
||||
}
|
||||
|
||||
@@ -58,18 +57,16 @@ public class CraftInput implements Input {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (this.getClass() != obj.getClass()) {
|
||||
if (obj == null || this.getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final CraftInput other = (CraftInput) obj;
|
||||
return Objects.equals(this.handle, other.handle);
|
||||
return this.input.equals(other.input);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CraftInput{" + this.handle + '}';
|
||||
return "CraftInput{" + this.input + '}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user