Migrate the Carpet codebase to Mojang Mappings
This commit is contained in:
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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user