Migrate Carpet Mixin names to mojang mappings
This commit is contained in:
1 parent
2c3871b90e
commit
a547677597
154 files changed
+422
-501
No files matched your search
@@ -0,0 +1,47 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.level.Level;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(Player.class)
|
||||
public abstract class Player_creativeNoClipMixin extends LivingEntity
|
||||
{
|
||||
protected Player_creativeNoClipMixin(EntityType<? extends LivingEntity> type, Level world)
|
||||
{
|
||||
super(type, world);
|
||||
}
|
||||
|
||||
@Redirect(method = "tick", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/entity/player/Player;isSpectator()Z")
|
||||
)
|
||||
private boolean canClipTroughWorld(Player playerEntity)
|
||||
{
|
||||
return playerEntity.isSpectator() || (CarpetSettings.creativeNoClip && playerEntity.isCreative() && playerEntity.getAbilities().flying);
|
||||
|
||||
}
|
||||
|
||||
@Redirect(method = "aiStep", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/entity/player/Player;isSpectator()Z")
|
||||
)
|
||||
private boolean collidesWithEntities(Player playerEntity)
|
||||
{
|
||||
return playerEntity.isSpectator() || (CarpetSettings.creativeNoClip && playerEntity.isCreative() && playerEntity.getAbilities().flying);
|
||||
}
|
||||
|
||||
@Redirect(method = "updatePlayerPose", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/entity/player/Player;isSpectator()Z")
|
||||
)
|
||||
private boolean spectatorsDontPose(Player playerEntity)
|
||||
{
|
||||
return playerEntity.isSpectator() || (CarpetSettings.creativeNoClip && playerEntity.isCreative() && playerEntity.getAbilities().flying);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user