Upload files to "src/openonyx/features/player/internal/group_m"
This commit is contained in:
1 parent
b3f99151fb
commit
5e035a3cee
5 files changed
+333
No files matched your search
@@ -0,0 +1,31 @@
|
|||||||
|
package openonyx.features.player.internal.group_m;
|
||||||
|
|
||||||
|
import openonyx.history.DisplayNamed;
|
||||||
|
|
||||||
|
public enum ModesMode implements DisplayNamed {
|
||||||
|
JUMP("Jump"),
|
||||||
|
SNEAK("Sneak"),
|
||||||
|
BACKWARDS("Backwards"),
|
||||||
|
STOP_INPUT("Stop input");
|
||||||
|
|
||||||
|
private final String e;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDisplayName() {
|
||||||
|
return this.e;
|
||||||
|
}
|
||||||
|
|
||||||
|
ModesMode(String string1) {
|
||||||
|
this.e = string1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ModesMode[] L() {
|
||||||
|
ModesMode[] modesModes = new ModesMode[4];
|
||||||
|
boolean bl = true;
|
||||||
|
modesModes[0] = JUMP;
|
||||||
|
modesModes[1] = SNEAK;
|
||||||
|
modesModes[2] = STOP_INPUT;
|
||||||
|
modesModes[3] = BACKWARDS;
|
||||||
|
return modesModes;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package openonyx.features.player.internal.group_m;
|
||||||
|
|
||||||
|
import openonyx.history.DisplayNamed;
|
||||||
|
|
||||||
|
public enum RotationStyle implements DisplayNamed {
|
||||||
|
NORMAL("Normal"),
|
||||||
|
DIAGONAL("Diagonal"),
|
||||||
|
OFFSET("Offset"),
|
||||||
|
BACK("Back");
|
||||||
|
|
||||||
|
private final String f;
|
||||||
|
|
||||||
|
private static RotationStyle[] L() {
|
||||||
|
RotationStyle[] rotationStyles = new RotationStyle[4];
|
||||||
|
boolean bl = true;
|
||||||
|
rotationStyles[0] = DIAGONAL;
|
||||||
|
rotationStyles[1] = BACK;
|
||||||
|
rotationStyles[2] = NORMAL;
|
||||||
|
rotationStyles[3] = OFFSET;
|
||||||
|
return rotationStyles;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDisplayName() {
|
||||||
|
return this.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
RotationStyle(String string1) {
|
||||||
|
this.f = string1;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
package openonyx.features.player.internal.group_m;
|
||||||
|
|
||||||
|
import meteordevelopment.orbit.EventHandler;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
import openonyx.configuration.internal.MovementInputEvent;
|
||||||
|
import openonyx.features.player.Scaffold;
|
||||||
|
import openonyx.history.internal.RangeSetting;
|
||||||
|
import openonyx.interaction.BlockUtils;
|
||||||
|
import openonyx.interaction.internal.AimPointOption;
|
||||||
|
import openonyx.interaction.internal.BlockPlacementContext;
|
||||||
|
import openonyx.interaction.internal.CenterAimPoint;
|
||||||
|
import openonyx.interaction.internal.EyePosition;
|
||||||
|
import openonyx.interaction.internal.PlacementOffset;
|
||||||
|
import openonyx.interaction.internal.PlacementResult;
|
||||||
|
import openonyx.interaction.internal.PlacementSearchPattern;
|
||||||
|
import openonyx.interaction.internal.PlacementSolver;
|
||||||
|
import openonyx.protocol.group_m.Angles;
|
||||||
|
import openonyx.utilities.MovementInputState;
|
||||||
|
import openonyx.utilities.PlayerUtils;
|
||||||
|
import openonyx.utilities.VecUtils;
|
||||||
|
import openonyx.utilities.internal.Line3;
|
||||||
|
|
||||||
|
public class ScaffoldBreezily extends ScaffoldMode {
|
||||||
|
private transient double d;
|
||||||
|
public RangeSetting blocks = RangeSetting.of("Edge distance", 0.45, 0.5, 0.25, 0.5).withSuffix(" blocks");
|
||||||
|
private transient long f;
|
||||||
|
private transient float H;
|
||||||
|
public static final ScaffoldBreezily INSTANCE = new ScaffoldBreezily();
|
||||||
|
|
||||||
|
private ScaffoldBreezily() {
|
||||||
|
super("Breezily");
|
||||||
|
this.d = 0.45;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Angles d(float f) {
|
||||||
|
return new Angles(fx, 80.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean L(BlockPos blockPos) {
|
||||||
|
BlockPos blockPos1 = blockPos;
|
||||||
|
IBlockState iBlockState;
|
||||||
|
return (iBlockState = BlockUtils.L(blockPos1)) == null || iBlockState.getBlock().getMaterial() == Material.air;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = -50)
|
||||||
|
private void onMovementInput(MovementInputEvent movementInputEvent) {
|
||||||
|
ScaffoldBreezily scaffoldBreezily1 = this;
|
||||||
|
if (mc.thePlayer != null) {
|
||||||
|
if (movementInputEvent.getMovementInputState().forwards() && !mc.thePlayer.isSneaking()) {
|
||||||
|
if (L(new BlockPos(mc.thePlayer).add(0, -1, 0))) {
|
||||||
|
scaffoldBreezily1.f = System.currentTimeMillis();
|
||||||
|
} else if (System.currentTimeMillis() - scaffoldBreezily1.f > 500L) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ScaffoldBreezily scaffoldBreezily2;
|
||||||
|
label74: {
|
||||||
|
double dx = mc.thePlayer.posX - Math.floor(mc.thePlayer.posX);
|
||||||
|
double e = mc.thePlayer.posZ - Math.floor(mc.thePlayer.posZ);
|
||||||
|
double fx = 1.0 - scaffoldBreezily1.d;
|
||||||
|
g = 0.0F;
|
||||||
|
switch (EnumFacing.fromAngle(mc.thePlayer.rotationYaw)) {
|
||||||
|
case SOUTH:
|
||||||
|
while (false) {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dx > fx) {
|
||||||
|
g = 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dx < scaffoldBreezily1.d) {
|
||||||
|
g = -1.0F;
|
||||||
|
scaffoldBreezily2 = scaffoldBreezily1;
|
||||||
|
break label74;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case NORTH:
|
||||||
|
if (dx > fx) {
|
||||||
|
g = -1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dx < scaffoldBreezily1.d) {
|
||||||
|
g = 1.0F;
|
||||||
|
scaffoldBreezily2 = scaffoldBreezily1;
|
||||||
|
break label74;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EAST:
|
||||||
|
if (e > fx) {
|
||||||
|
g = -1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e < scaffoldBreezily1.d) {
|
||||||
|
g = 1.0F;
|
||||||
|
scaffoldBreezily2 = scaffoldBreezily1;
|
||||||
|
break label74;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case WEST:
|
||||||
|
if (e > fx) {
|
||||||
|
g = 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e < scaffoldBreezily1.d) {
|
||||||
|
g = -1.0F;
|
||||||
|
scaffoldBreezily2 = scaffoldBreezily1;
|
||||||
|
break label74;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scaffoldBreezily2 = scaffoldBreezily1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (scaffoldBreezily2.H != g && g != 0.0F) {
|
||||||
|
scaffoldBreezily1.H = g;
|
||||||
|
scaffoldBreezily1.d = scaffoldBreezily1.blocks.random();
|
||||||
|
}
|
||||||
|
|
||||||
|
MovementInputState movementInputState = new MovementInputState;
|
||||||
|
boolean bl = movementInputEvent.getMovementInputState().forwards();
|
||||||
|
boolean bl1 = movementInputEvent.getMovementInputState().backwards();
|
||||||
|
boolean bl2;
|
||||||
|
ScaffoldBreezily scaffoldBreezily3;
|
||||||
|
if (scaffoldBreezily1.H == -1.0F) {
|
||||||
|
bl2 = true;
|
||||||
|
scaffoldBreezily3 = scaffoldBreezily1;
|
||||||
|
} else {
|
||||||
|
bl2 = false;
|
||||||
|
scaffoldBreezily3 = scaffoldBreezily1;
|
||||||
|
}
|
||||||
|
|
||||||
|
movementInputState./* $VF: Unable to resugar constructor */<init>(bl, bl1, bl2, scaffoldBreezily3.H == 1.0F);
|
||||||
|
movementInputEvent.L(movementInputState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Angles L(float f) {
|
||||||
|
return new Angles(fx, 75.6F);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Angles d(PlacementResult placementResult) {
|
||||||
|
float fx = (float)(Math.floor(placementResult.rotation().yaw2() / 90.0F) * 90.0);
|
||||||
|
return new Angles(fx + 45.0F, 75.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PlacementResult L(Vec3 vec3, boolean bl, Line3 line3, ItemStack itemStack) {
|
||||||
|
BlockPlacementContext blockPlacementContext = new BlockPlacementContext(
|
||||||
|
new PlacementSearchPattern(PlacementOffset.NORMAL.getBlockPosList(), BlockPlacementContext.L(vec3)),
|
||||||
|
new AimPointOption(CenterAimPoint.INSTANCE),
|
||||||
|
itemStack,
|
||||||
|
new EyePosition(vec3, bl)
|
||||||
|
);
|
||||||
|
return PlacementSolver.L(Scaffold.INSTANCE.L(VecUtils.L(vec3)), blockPlacementContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Angles L(PlacementResult placementResult) {
|
||||||
|
if (Scaffold.INSTANCE.getMovementInputState().equals(MovementInputState.INSTANCE8)) {
|
||||||
|
return placementResult == null ? null : this.d(placementResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
float fx;
|
||||||
|
boolean bl = (fx = (float)(Math.rint((PlayerUtils.L(mc.thePlayer, Scaffold.INSTANCE.getMovementInputState()) + 180.0F) / 45.0F) * 45.0)) % 90.0F == 0.0F;
|
||||||
|
return bl ? this.d(fx) : this.L(fx);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package openonyx.features.player.internal.group_m;
|
||||||
|
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
|
||||||
|
// $VF: synthetic class
|
||||||
|
class ScaffoldBreezilyPart {
|
||||||
|
static {
|
||||||
|
int[] i = new int[EnumFacing.values().length];
|
||||||
|
boolean bl = true;
|
||||||
|
e = i;
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[EnumFacing.SOUTH.ordinal()] = 1;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError3) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[EnumFacing.NORTH.ordinal()] = 2;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError2) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[EnumFacing.EAST.ordinal()] = 3;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError1) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[EnumFacing.WEST.ordinal()] = 4;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package openonyx.features.player.internal.group_m;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
import openonyx.features.player.Scaffold;
|
||||||
|
import openonyx.history.internal.NumberSetting;
|
||||||
|
import openonyx.interaction.internal.AimPointOption;
|
||||||
|
import openonyx.interaction.internal.BlockPlacementContext;
|
||||||
|
import openonyx.interaction.internal.CenterAimPoint;
|
||||||
|
import openonyx.interaction.internal.EyePosition;
|
||||||
|
import openonyx.interaction.internal.PlacementResult;
|
||||||
|
import openonyx.interaction.internal.PlacementSearchPattern;
|
||||||
|
import openonyx.interaction.internal.PlacementSolver;
|
||||||
|
import openonyx.protocol.group_m.Angles;
|
||||||
|
import openonyx.utilities.VecUtils;
|
||||||
|
import openonyx.utilities.internal.Line3;
|
||||||
|
|
||||||
|
public class ScaffoldExpand extends ScaffoldMode {
|
||||||
|
public NumberSetting length = new NumberSetting("Length", 4.0, 1.0, 10.0, 1.0).withSuffix(" blocks");
|
||||||
|
public static final ScaffoldExpand INSTANCE = new ScaffoldExpand();
|
||||||
|
private static final float e = (float) (Math.PI / 180.0);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MovingObjectPosition L(PlacementResult placementResult, Angles angles) {
|
||||||
|
if (placementResult == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
MovingObjectPosition movingObjectPosition;
|
||||||
|
return (movingObjectPosition = super.L(placementResult, angles)) != null && placementResult.L(movingObjectPosition)
|
||||||
|
? movingObjectPosition
|
||||||
|
: placementResult.L();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ScaffoldExpand() {
|
||||||
|
super("Expand");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Angles L(PlacementResult placementResult) {
|
||||||
|
return placementResult == null ? null : Angles.L(VecUtils.L(placementResult.placedBlock()), mc.thePlayer.getPositionEyes(1.0F));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PlacementResult L(Vec3 vec3, boolean bl, Line3 line3, ItemStack itemStack) {
|
||||||
|
BlockPlacementContext blockPlacementContext = new BlockPlacementContext(
|
||||||
|
PlacementSearchPattern.L(), new AimPointOption(CenterAimPoint.INSTANCE, true), itemStack, new EyePosition(vec3, bl)
|
||||||
|
);
|
||||||
|
|
||||||
|
for (int j = i = 0; j <= this.length.getInt(); j = ++i) {
|
||||||
|
PlacementResult placementResult;
|
||||||
|
if ((placementResult = PlacementSolver.L(Scaffold.INSTANCE.L(this.L(vec3, i)), blockPlacementContext)) != null) {
|
||||||
|
return placementResult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private BlockPos L(Vec3 vec3, int i) {
|
||||||
|
float f = mc.thePlayer.rotationYaw;
|
||||||
|
return VecUtils.L(vec3).add((int)(-((float)Math.sin(f * (float) (Math.PI / 180.0))) * i), 0, (int)((float)Math.cos(f * (float) (Math.PI / 180.0)) * i));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user