This commit is contained in:
gnembon committed 2019-10-16 15:00:53 -03:00
1 parent 89b3cd8352
commit cb900f638f
5 files changed
+12 -32

No files matched your search

@@ -17,6 +17,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Mixin(PistonBlock.class)
@@ -64,9 +65,9 @@ public abstract class PistonBlock_movableTEMixin extends FacingBlock
@Inject(method = "move", at = @At(value = "INVOKE", shift = At.Shift.BEFORE,
target = "Ljava/util/List;size()I", ordinal = 4),locals = LocalCapture.CAPTURE_FAILHARD)
private void onMove(World world_1, BlockPos blockPos_1, Direction direction_1, boolean boolean_1,
CallbackInfoReturnable<Boolean> cir, BlockPos blockPos_2, PistonHandler pistonHandler_1,
CallbackInfoReturnable<Boolean> cir, BlockPos blockPos_2, PistonHandler pistonHandler_1, Map map_1,
List<BlockPos> list_1, List<BlockState> list_2, List list_3, int int_2, BlockState blockStates_1[],
Direction direction_2, Set set_1)
Direction direction_2)
{
//Get the blockEntities and remove them from the world before any magic starts to happen
if (CarpetSettings.movableBlockEntities)
@@ -93,8 +94,8 @@ public abstract class PistonBlock_movableTEMixin extends FacingBlock
"Lnet/minecraft/block/entity/BlockEntity;)V", ordinal = 0),
locals = LocalCapture.CAPTURE_FAILHARD)
private void setBlockEntityWithCarried(World world_1, BlockPos blockPos_1, Direction direction_1, boolean boolean_1,
CallbackInfoReturnable<Boolean> cir, BlockPos blockPos_2, PistonHandler pistonHandler_1, List list_1,
List list_2, List list_3, int int_2, BlockState blockStates_1[], Direction direction_2, Set set_1,
CallbackInfoReturnable<Boolean> cir, BlockPos blockPos_2, PistonHandler pistonHandler_1, Map map_1, List list_1,
List list_2, List list_3, int int_2, BlockState blockStates_1[], Direction direction_2,
int int_3, BlockPos blockPos_4, BlockState blockState_1)
{
BlockEntity blockEntityPiston = PistonExtensionBlock.createBlockEntityPiston((BlockState) list_2.get(int_3),
@@ -53,26 +53,4 @@ public abstract class ServerPlayNetworkHandler_antiCheatDisabledMixin
{
return CarpetSettings.antiCheatDisabled || serverPlayerEntity.isInTeleportationState();
}
@Redirect(method = "onClientCommand", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/network/ServerPlayerEntity;getVelocity()Lnet/minecraft/util/math/Vec3d;"
))
private Vec3d getFallingVelocity(ServerPlayerEntity serverPlayerEntity)
{
if (CarpetSettings.antiCheatDisabled)
return new Vec3d(0,-1,0);
return serverPlayerEntity.getVelocity();
}
@Redirect(method = "onClientCommand", at = @At(
value = "FIELD",
target = "Lnet/minecraft/server/network/ServerPlayerEntity;onGround:Z"
))
private boolean getNotOnGround(ServerPlayerEntity serverPlayerEntity)
{
if (CarpetSettings.antiCheatDisabled)
return false;
return serverPlayerEntity.onGround;
}
}
@@ -193,7 +193,7 @@ public class ServerPlayNetworkHandler_scarpetEventsMixin
@Inject(method = "onClientCommand", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/network/ServerPlayerEntity;isFallFlying()Z",
target = "Lnet/minecraft/server/network/ServerPlayerEntity;method_23668()Z",
shift = At.Shift.BEFORE
))
private void onElytraEngage(ClientCommandC2SPacket clientCommandC2SPacket_1, CallbackInfo ci)
@@ -4,6 +4,7 @@ import carpet.helpers.BlockRotator;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.network.ServerPlayerInteractionManager;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.world.World;
@@ -17,13 +18,13 @@ public class ServerPlayerInteractionManager_cactusMixin
@Redirect(method = "interactBlock", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/block/BlockState;onUse(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/util/hit/BlockHitResult;)Z"
target = "Lnet/minecraft/block/BlockState;onUse(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/util/hit/BlockHitResult;)Lnet/minecraft/util/ActionResult;"
))
private boolean activateWithOptionalCactus(BlockState blockState, World world_1, PlayerEntity playerEntity_1, Hand hand_1, BlockHitResult blockHitResult_1)
private ActionResult activateWithOptionalCactus(BlockState blockState, World world_1, PlayerEntity playerEntity_1, Hand hand_1, BlockHitResult blockHitResult_1)
{
Boolean flipped = BlockRotator.flipBlockWithCactus(blockState, world_1, playerEntity_1, hand_1, blockHitResult_1);
if (flipped)
return true;
return ActionResult.SUCCESS;
return blockState.onUse(world_1, playerEntity_1, hand_1, blockHitResult_1);
}