mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Wings of icarus will become corrupted when in the nether
This commit is contained in:
parent
1992a1fd53
commit
002ace1846
4 changed files with 14 additions and 5 deletions
|
@ -20,6 +20,7 @@ import net.minecraft.util.Identifier;
|
||||||
public class WingsFeatureRenderer<E extends LivingEntity> implements AccessoryFeatureRenderer.Feature<E> {
|
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 = 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 static final Identifier PEGASUS_WINGS = new Identifier("unicopia", "textures/models/wings/pegasus.png");
|
||||||
|
|
||||||
private final WingsModel model = new WingsModel();
|
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);
|
boolean icarus = UItems.PEGASUS_AMULET.isApplicable(entity);
|
||||||
|
|
||||||
if (icarus || pegasus) {
|
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);
|
VertexConsumer consumer = ItemRenderer.getArmorGlintConsumer(renderContext, RenderLayer.getEntityTranslucent(texture), false, false);
|
||||||
|
|
||||||
model.setAngles(entity, context.getModel());
|
model.setAngles(entity, context.getModel());
|
||||||
|
|
|
@ -129,7 +129,7 @@ public class PlayerPhysics extends EntityPhysics<Pony> implements Tickable, Moti
|
||||||
if (type != lastFlightType && (lastFlightType.isArtifical() || type.isArtifical())) {
|
if (type != lastFlightType && (lastFlightType.isArtifical() || type.isArtifical())) {
|
||||||
ParticleUtils.spawnParticles(ParticleTypes.CLOUD, entity, 10);
|
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);
|
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) {
|
if (ticksInAir % 10 == 0 && !entity.world.isClient) {
|
||||||
ItemStack stack = entity.getEquippedStack(EquipmentSlot.CHEST);
|
ItemStack stack = entity.getEquippedStack(EquipmentSlot.CHEST);
|
||||||
|
|
||||||
|
int damageInterval = 20;
|
||||||
|
int minDamage = 1;
|
||||||
|
|
||||||
float energyConsumed = 2 + (float)getHorizontalMotion(entity) / 10F;
|
float energyConsumed = 2 + (float)getHorizontalMotion(entity) / 10F;
|
||||||
if (entity.world.hasRain(entity.getBlockPos())) {
|
if (entity.world.hasRain(entity.getBlockPos())) {
|
||||||
energyConsumed *= 3;
|
energyConsumed *= 3;
|
||||||
}
|
}
|
||||||
|
if (entity.world.getDimension().isUltrawarm()) {
|
||||||
|
energyConsumed *= 4;
|
||||||
|
damageInterval /= 2;
|
||||||
|
minDamage *= 3;
|
||||||
|
}
|
||||||
|
|
||||||
AmuletItem.consumeEnergy(stack, energyConsumed);
|
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);
|
entity.world.playSoundFromEntity(null, entity, SoundEvents.BLOCK_CHAIN_STEP, SoundCategory.PLAYERS, 0.13F, 0.5F);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entity.world.random.nextInt(20) == 0) {
|
if (entity.world.random.nextInt(damageInterval) == 0) {
|
||||||
stack.damage(1 + entity.world.random.nextInt(50), entity, e -> e.sendEquipmentBreakStatus(EquipmentSlot.CHEST));
|
stack.damage(minDamage + entity.world.random.nextInt(50), entity, e -> e.sendEquipmentBreakStatus(EquipmentSlot.CHEST));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getFlightType().canFly()) {
|
if (!getFlightType().canFly()) {
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class AmuletItem extends WearableItem {
|
||||||
&& entity instanceof LivingEntity
|
&& entity instanceof LivingEntity
|
||||||
&& ((LivingEntity) entity).getEquippedStack(EquipmentSlot.CHEST) == stack
|
&& ((LivingEntity) entity).getEquippedStack(EquipmentSlot.CHEST) == stack
|
||||||
&& isApplicable((LivingEntity)entity)) {
|
&& 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 |
Loading…
Reference in a new issue