More review things

This commit is contained in:
Brady 2018-11-13 16:53:13 -06:00
parent 5e2f40a322
commit 94bf8d4bbd
No known key found for this signature in database
GPG Key ID: 73A788379A197567
3 changed files with 9 additions and 45 deletions

View File

@ -89,6 +89,14 @@ public enum Input {
private final KeyBinding keyBinding; private final KeyBinding keyBinding;
Input(Function<GameSettings, KeyBinding> keyBindingMapper) { Input(Function<GameSettings, KeyBinding> keyBindingMapper) {
/*
Here, a Function is used because referring to a static field in this enum for the game instance,
as it was before, wouldn't be possible in an Enum constructor unless the static field was in an
interface that this class implemented. (Helper acted as this interface) I didn't feel like making
an interface with a game instance field just to not have to do this.
*/
this.keyBinding = keyBindingMapper.apply(Minecraft.getMinecraft().gameSettings); this.keyBinding = keyBindingMapper.apply(Minecraft.getMinecraft().gameSettings);
} }

View File

@ -45,7 +45,7 @@ import java.util.Objects;
public class MovementParkour extends Movement { public class MovementParkour extends Movement {
private static final EnumFacing[] HORIZONTALS_BUT_ALSO_DOWN____SO_EVERY_DIRECTION_EXCEPT_UP = { EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.EAST, EnumFacing.WEST, EnumFacing.DOWN }; private static final EnumFacing[] HORIZONTALS_BUT_ALSO_DOWN____SO_EVERY_DIRECTION_EXCEPT_UP = { EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.EAST, EnumFacing.WEST, EnumFacing.DOWN };
private static final BetterBlockPos[] EMPTY = new BetterBlockPos[]{}; private static final BetterBlockPos[] EMPTY = new BetterBlockPos[]{};
private final EnumFacing direction; private final EnumFacing direction;

View File

@ -44,50 +44,6 @@ public interface Helper {
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
/*
default EntityPlayerSP player() {
if (!mc.isCallingFromMinecraftThread()) {
throw new IllegalStateException("h00000000");
}
return mc.player;
}
default PlayerControllerMP playerController() { // idk
if (!mc.isCallingFromMinecraftThread()) {
throw new IllegalStateException("h00000000");
}
return mc.playerController;
}
default WorldClient world() {
if (!mc.isCallingFromMinecraftThread()) {
throw new IllegalStateException("h00000000");
}
return mc.world;
}
default BetterBlockPos playerFeet() {
// TODO find a better way to deal with soul sand!!!!!
BetterBlockPos feet = new BetterBlockPos(player().posX, player().posY + 0.1251, player().posZ);
if (BlockStateInterface.get(feet).getBlock() instanceof BlockSlab) {
return feet.up();
}
return feet;
}
default Vec3d playerFeetAsVec() {
return new Vec3d(player().posX, player().posY, player().posZ);
}
default Vec3d playerHead() {
return new Vec3d(player().posX, player().posY + player().getEyeHeight(), player().posZ);
}
default Rotation playerRotations() {
return new Rotation(player().rotationYaw, player().rotationPitch);
}
*/
/** /**
* Send a message to chat only if chatDebug is on * Send a message to chat only if chatDebug is on
* *