Reduce seaponies' visibility on land and fix suppressed races not transferring when respawning

This commit is contained in:
Sollace 2023-11-10 18:15:09 +00:00
parent 2305775a55
commit 3f480b6664
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 14 additions and 0 deletions

View file

@ -55,6 +55,11 @@ public class WorldRenderDelegate {
RenderSystem.setShaderFogEnd(RenderSystem.getShaderFogEnd() + 190);
}
}
if (camera.getSubmersionType() == CameraSubmersionType.NONE) {
if (EquinePredicates.PLAYER_SEAPONY.test(MinecraftClient.getInstance().player)) {
RenderSystem.setShaderFogStart(-130);
}
}
}
public boolean beforeEntityRender(Entity entity,

View file

@ -57,6 +57,7 @@ import net.minecraft.registry.tag.DamageTypeTags;
import net.minecraft.registry.tag.FluidTags;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundEvents;
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
@ -464,6 +465,10 @@ public class Pony extends Living<PlayerEntity> implements Copyable<Pony>, Update
entity.setAir(entity.getAir() - 1);
}
if (entity.age % 60 == 0) {
entity.playSound(SoundEvents.ENTITY_TURTLE_AMBIENT_LAND, 1, 1);
}
if (entity.getAir() == -20) {
entity.setAir(0);
entity.damage(entity.getDamageSources().dryOut(), 2);
@ -872,10 +877,13 @@ public class Pony extends Living<PlayerEntity> implements Copyable<Pony>, Update
&& oldPlayer.respawnRace.isUnset())
|| oldPlayer.getSpecies().isUnset();
Race oldSuppressedRace = oldPlayer.getSuppressedRace();
if (alive) {
oldPlayer.getSpellSlot().stream(true).forEach(getSpellSlot()::put);
} else {
if (forcedSwap) {
oldSuppressedRace = Race.UNSET;
Channel.SERVER_SELECT_TRIBE.sendToPlayer(new MsgTribeSelect(Race.allPermitted(entity), "gui.unicopia.tribe_selection.respawn"), (ServerPlayerEntity)entity);
} else {
oldPlayer.getSpellSlot().stream(true).filter(SpellPredicate.IS_PLACED).forEach(getSpellSlot()::put);
@ -894,6 +902,7 @@ public class Pony extends Living<PlayerEntity> implements Copyable<Pony>, Update
}
setSpecies(oldPlayer.respawnRace != Race.UNSET && !alive ? oldPlayer.respawnRace : oldPlayer.getSpecies());
setSuppressedRace(oldSuppressedRace);
getDiscoveries().copyFrom(oldPlayer.getDiscoveries(), alive);
getPhysics().copyFrom(oldPlayer.getPhysics(), alive);
if (!forcedSwap) {