Skip to content

Commit

Permalink
Removed blindness effect (1.21 only)
Browse files Browse the repository at this point in the history
  • Loading branch information
WenXin20 committed Sep 2, 2024
1 parent e6ed27e commit 7bba4ae
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/main/java/com/wenxin2/warp_pipes/blocks/WarpPipeBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -629,83 +629,69 @@ public static void warp(Entity entity, BlockPos warpPos, Level world, BlockState
if (state.getBlock() instanceof ClearWarpPipeBlock && !state.getValue(ENTRANCE)) {
if (entity instanceof Player) {
entity.teleportTo(warpPos.getX() + 0.5, warpPos.getY() - 1.0, warpPos.getZ() + 0.5);
((Player) entity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
} else {
entity.teleportTo(warpPos.getX() + 0.5, warpPos.getY() - 1.0, warpPos.getZ() + 0.5);
if (passengerEntity instanceof Player) {
((Player) passengerEntity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
entity.unRide();
}
}
}
if (world.getBlockState(warpPos).getValue(FACING) == Direction.UP && state.getValue(ENTRANCE)) {
if (entity instanceof Player) {
entity.teleportTo(warpPos.getX() + 0.5, warpPos.getY() + 1.0, warpPos.getZ() + 0.5);
((Player) entity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
} else {
entity.teleportTo(warpPos.getX() + 0.5, warpPos.getY() + 1.0, warpPos.getZ() + 0.5);
if (passengerEntity instanceof Player) {
((Player) passengerEntity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
entity.unRide();
}
}
}
if (world.getBlockState(warpPos).getValue(FACING) == Direction.DOWN && state.getValue(ENTRANCE)) {
if (entity instanceof Player) {
entity.teleportTo(warpPos.getX() + 0.5, warpPos.getY() - entity.getBbHeight(), warpPos.getZ() + 0.5);
((Player) entity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
} else {
entity.teleportTo(warpPos.getX() + 0.5, warpPos.getY() - entity.getBbHeight(), warpPos.getZ() + 0.5);
if (passengerEntity instanceof Player) {
((Player) passengerEntity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
entity.unRide();
}
}
}
if (world.getBlockState(warpPos).getValue(FACING) == Direction.NORTH && state.getValue(ENTRANCE)) {
if (entity instanceof Player) {
entity.teleportTo(warpPos.getX() + 0.5, warpPos.getY(), warpPos.getZ() - entity.getBbWidth());
((Player) entity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
} else {
entity.teleportTo(warpPos.getX() + 0.5, warpPos.getY(), warpPos.getZ() - entity.getBbWidth());
if (passengerEntity instanceof Player) {
((Player) passengerEntity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
entity.unRide();
}
}
}
if (world.getBlockState(warpPos).getValue(FACING) == Direction.SOUTH && state.getValue(ENTRANCE)) {
if (entity instanceof Player) {
entity.teleportTo(warpPos.getX() + 0.5, warpPos.getY(), warpPos.getZ() + entity.getBbWidth() + 1.0);
((Player) entity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
} else {
entity.teleportTo(warpPos.getX() + 0.5, warpPos.getY(), warpPos.getZ() + entity.getBbWidth() + 1.0);
if (passengerEntity instanceof Player) {
((Player) passengerEntity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
entity.unRide();
}
}
}
if (world.getBlockState(warpPos).getValue(FACING) == Direction.EAST && state.getValue(ENTRANCE)) {
if (entity instanceof Player) {
entity.teleportTo(warpPos.getX() + entity.getBbWidth() + 1.0, warpPos.getY(), warpPos.getZ() + 0.5);
((Player) entity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
} else {
entity.teleportTo(warpPos.getX() + entity.getBbWidth() + 1.0, warpPos.getY(), warpPos.getZ() + 0.5);
if (passengerEntity instanceof Player) {
((Player) passengerEntity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
entity.unRide();
}
}
}
if (world.getBlockState(warpPos).getValue(FACING) == Direction.WEST && state.getValue(ENTRANCE)) {
if (entity instanceof Player) {
entity.teleportTo(warpPos.getX() - entity.getBbWidth(), warpPos.getY(), warpPos.getZ() + 0.5);
((Player) entity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
} else {
entity.teleportTo(warpPos.getX() - entity.getBbWidth(), warpPos.getY(), warpPos.getZ() + 0.5);
if (passengerEntity instanceof Player) {
((Player) passengerEntity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 1, 0));
entity.unRide();
}
}
Expand Down

0 comments on commit 7bba4ae

Please sign in to comment.