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

+2 -2
View File
@@ -4,8 +4,8 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
# or better: https://modmuss50.me/fabric.html # or better: https://modmuss50.me/fabric.html
minecraft_version=19w41a minecraft_version=19w42a
yarn_mappings=19w41a+build.5 yarn_mappings=19w42a+build.1
loader_version=0.6.3+build.167 loader_version=0.6.3+build.167
# Mod Properties # Mod Properties
@@ -17,6 +17,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture; import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
@Mixin(PistonBlock.class) @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, @Inject(method = "move", at = @At(value = "INVOKE", shift = At.Shift.BEFORE,
target = "Ljava/util/List;size()I", ordinal = 4),locals = LocalCapture.CAPTURE_FAILHARD) 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, 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[], 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 //Get the blockEntities and remove them from the world before any magic starts to happen
if (CarpetSettings.movableBlockEntities) if (CarpetSettings.movableBlockEntities)
@@ -93,8 +94,8 @@ public abstract class PistonBlock_movableTEMixin extends FacingBlock
"Lnet/minecraft/block/entity/BlockEntity;)V", ordinal = 0), "Lnet/minecraft/block/entity/BlockEntity;)V", ordinal = 0),
locals = LocalCapture.CAPTURE_FAILHARD) locals = LocalCapture.CAPTURE_FAILHARD)
private void setBlockEntityWithCarried(World world_1, BlockPos blockPos_1, Direction direction_1, boolean boolean_1, 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, 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, Set set_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) int int_3, BlockPos blockPos_4, BlockState blockState_1)
{ {
BlockEntity blockEntityPiston = PistonExtensionBlock.createBlockEntityPiston((BlockState) list_2.get(int_3), BlockEntity blockEntityPiston = PistonExtensionBlock.createBlockEntityPiston((BlockState) list_2.get(int_3),
@@ -53,26 +53,4 @@ public abstract class ServerPlayNetworkHandler_antiCheatDisabledMixin
{ {
return CarpetSettings.antiCheatDisabled || serverPlayerEntity.isInTeleportationState(); 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( @Inject(method = "onClientCommand", at = @At(
value = "INVOKE", value = "INVOKE",
target = "Lnet/minecraft/server/network/ServerPlayerEntity;isFallFlying()Z", target = "Lnet/minecraft/server/network/ServerPlayerEntity;method_23668()Z",
shift = At.Shift.BEFORE shift = At.Shift.BEFORE
)) ))
private void onElytraEngage(ClientCommandC2SPacket clientCommandC2SPacket_1, CallbackInfo ci) private void onElytraEngage(ClientCommandC2SPacket clientCommandC2SPacket_1, CallbackInfo ci)
@@ -4,6 +4,7 @@ import carpet.helpers.BlockRotator;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.network.ServerPlayerInteractionManager; import net.minecraft.server.network.ServerPlayerInteractionManager;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -17,13 +18,13 @@ public class ServerPlayerInteractionManager_cactusMixin
@Redirect(method = "interactBlock", at = @At( @Redirect(method = "interactBlock", at = @At(
value = "INVOKE", 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); Boolean flipped = BlockRotator.flipBlockWithCactus(blockState, world_1, playerEntity_1, hand_1, blockHitResult_1);
if (flipped) if (flipped)
return true; return ActionResult.SUCCESS;
return blockState.onUse(world_1, playerEntity_1, hand_1, blockHitResult_1); return blockState.onUse(world_1, playerEntity_1, hand_1, blockHitResult_1);
} }