Wings of icarus will become corrupted when in the nether

This commit is contained in:
Sollace 2021-02-27 22:35:07 +02:00
parent 1992a1fd53
commit 002ace1846
4 changed files with 14 additions and 5 deletions

View file

@ -20,6 +20,7 @@ import net.minecraft.util.Identifier;
public class WingsFeatureRenderer<E extends LivingEntity> implements AccessoryFeatureRenderer.Feature<E> {
private static final Identifier ICARUS_WINGS = new Identifier("unicopia", "textures/models/wings/icarus.png");
private static final Identifier ICARUS_WINGS_CORRUPTED = new Identifier("unicopia", "textures/models/wings/icarus_corrupted.png");
private static final Identifier PEGASUS_WINGS = new Identifier("unicopia", "textures/models/wings/pegasus.png");
private final WingsModel model = new WingsModel();
@ -37,7 +38,7 @@ public class WingsFeatureRenderer<E extends LivingEntity> implements AccessoryFe
boolean icarus = UItems.PEGASUS_AMULET.isApplicable(entity);
if (icarus || pegasus) {
Identifier texture = pegasus ? PEGASUS_WINGS : ICARUS_WINGS;
Identifier texture = pegasus ? PEGASUS_WINGS : entity.world.getDimension().isUltrawarm() ? ICARUS_WINGS_CORRUPTED : ICARUS_WINGS;
VertexConsumer consumer = ItemRenderer.getArmorGlintConsumer(renderContext, RenderLayer.getEntityTranslucent(texture), false, false);
model.setAngles(entity, context.getModel());

View file

@ -129,7 +129,7 @@ public class PlayerPhysics extends EntityPhysics<Pony> implements Tickable, Moti
if (type != lastFlightType && (lastFlightType.isArtifical() || type.isArtifical())) {
ParticleUtils.spawnParticles(ParticleTypes.CLOUD, entity, 10);
entity.world.playSound(entity.getX(), entity.getY(), entity.getZ(), SoundEvents.BLOCK_BELL_RESONATE, SoundCategory.PLAYERS, 0.1125F, 1.5F, true);
entity.world.playSound(entity.getX(), entity.getY(), entity.getZ(), entity.world.getDimension().isUltrawarm() ? SoundEvents.BLOCK_BELL_USE : SoundEvents.BLOCK_BELL_RESONATE, SoundCategory.PLAYERS, 0.1125F, 1.5F, true);
}
entity.abilities.allowFlying = type.canFlyCreative(entity);
@ -195,10 +195,18 @@ public class PlayerPhysics extends EntityPhysics<Pony> implements Tickable, Moti
if (ticksInAir % 10 == 0 && !entity.world.isClient) {
ItemStack stack = entity.getEquippedStack(EquipmentSlot.CHEST);
int damageInterval = 20;
int minDamage = 1;
float energyConsumed = 2 + (float)getHorizontalMotion(entity) / 10F;
if (entity.world.hasRain(entity.getBlockPos())) {
energyConsumed *= 3;
}
if (entity.world.getDimension().isUltrawarm()) {
energyConsumed *= 4;
damageInterval /= 2;
minDamage *= 3;
}
AmuletItem.consumeEnergy(stack, energyConsumed);
@ -206,8 +214,8 @@ public class PlayerPhysics extends EntityPhysics<Pony> implements Tickable, Moti
entity.world.playSoundFromEntity(null, entity, SoundEvents.BLOCK_CHAIN_STEP, SoundCategory.PLAYERS, 0.13F, 0.5F);
}
if (entity.world.random.nextInt(20) == 0) {
stack.damage(1 + entity.world.random.nextInt(50), entity, e -> e.sendEquipmentBreakStatus(EquipmentSlot.CHEST));
if (entity.world.random.nextInt(damageInterval) == 0) {
stack.damage(minDamage + entity.world.random.nextInt(50), entity, e -> e.sendEquipmentBreakStatus(EquipmentSlot.CHEST));
}
if (!getFlightType().canFly()) {

View file

@ -61,7 +61,7 @@ public class AmuletItem extends WearableItem {
&& entity instanceof LivingEntity
&& ((LivingEntity) entity).getEquippedStack(EquipmentSlot.CHEST) == stack
&& isApplicable((LivingEntity)entity)) {
ParticleUtils.spawnParticles(ParticleTypes.COMPOSTER, entity, 1);
ParticleUtils.spawnParticles(entity.world.getDimension().isUltrawarm() ? ParticleTypes.SOUL_FIRE_FLAME : ParticleTypes.COMPOSTER, entity, 1);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,002 B