Migrate the Carpet codebase to Mojang Mappings

This commit is contained in:
altrisi committed 2022-01-24 20:33:16 +01:00
1 parent a1a2488bc3
commit 06af9ce8b1
346 files changed
+8353 -8492

No files matched your search

@@ -1,10 +1,10 @@
package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.block.entity.ShulkerBoxBlockEntity;
import net.minecraft.block.piston.PistonBehavior;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.block.entity.ShulkerBoxBlockEntity;
import net.minecraft.world.level.material.PushReaction;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@@ -12,14 +12,14 @@ import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(ShulkerBoxBlockEntity.class)
public class ShulkerBoxBlockEntity_creativeNoClipMixin
{
@Redirect(method = "pushEntities", at = @At(
@Redirect(method = "moveCollidedEntities", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/entity/Entity;getPistonBehavior()Lnet/minecraft/block/piston/PistonBehavior;"
target = "Lnet/minecraft/world/entity/Entity;getPistonPushReaction()Lnet/minecraft/world/level/material/PushReaction;"
))
private PistonBehavior getPistonBehaviourOfNoClipPlayers(Entity entity)
private PushReaction getPistonBehaviourOfNoClipPlayers(Entity entity)
{
if (CarpetSettings.creativeNoClip && entity instanceof PlayerEntity && (((PlayerEntity) entity).isCreative()) && ((PlayerEntity) entity).getAbilities().flying)
return PistonBehavior.IGNORE;
return entity.getPistonBehavior();
if (CarpetSettings.creativeNoClip && entity instanceof Player && (((Player) entity).isCreative()) && ((Player) entity).getAbilities().flying)
return PushReaction.IGNORE;
return entity.getPistonPushReaction();
}
}