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>
73 lines
1.4 KiB
Java
73 lines
1.4 KiB
Java
package org.bukkit.craftbukkit;
|
|
|
|
import org.bukkit.Input;
|
|
|
|
public class CraftInput implements Input {
|
|
|
|
private final net.minecraft.world.entity.player.Input input;
|
|
|
|
public CraftInput(net.minecraft.world.entity.player.Input input) {
|
|
this.input = input;
|
|
}
|
|
|
|
@Override
|
|
public boolean isForward() {
|
|
return this.input.forward();
|
|
}
|
|
|
|
@Override
|
|
public boolean isBackward() {
|
|
return this.input.backward();
|
|
}
|
|
|
|
@Override
|
|
public boolean isLeft() {
|
|
return this.input.left();
|
|
}
|
|
|
|
@Override
|
|
public boolean isRight() {
|
|
return this.input.right();
|
|
}
|
|
|
|
@Override
|
|
public boolean isJump() {
|
|
return this.input.jump();
|
|
}
|
|
|
|
@Override
|
|
public boolean isSneak() {
|
|
return this.input.shift();
|
|
}
|
|
|
|
@Override
|
|
public boolean isSprint() {
|
|
return this.input.sprint();
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
int hash = 7;
|
|
hash = 89 * hash + this.input.hashCode();
|
|
return hash;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (obj == null || this.getClass() != obj.getClass()) {
|
|
return false;
|
|
}
|
|
|
|
final CraftInput other = (CraftInput) obj;
|
|
return this.input.equals(other.input);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "CraftInput{" + this.input + '}';
|
|
}
|
|
}
|