Add race-specific icons for common abilities

This commit is contained in:
Sollace 2023-09-03 22:44:26 +01:00
parent 930d473fe8
commit ace98dcf00
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
16 changed files with 19 additions and 1 deletions

View file

@ -31,6 +31,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.predicate.entity.EntityPredicates;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Vec3d;
@ -57,6 +58,14 @@ public class EarthPonyKickAbility implements Ability<Pos> {
return race.canUseEarth();
}
@Override
public Identifier getIcon(Pony player) {
Identifier id = Abilities.REGISTRY.getId(this);
return new Identifier(id.getNamespace(), "textures/gui/ability/" + id.getPath()
+ "_" + player.getObservedSpecies().getId().getPath()
+ ".png");
}
@Override
public double getCostEstimate(Pony player) {
return TraceHelper.findBlock(player.asEntity(), getKickDirection(player) * 6, 1)

View file

@ -27,6 +27,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockBox;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
@ -61,6 +62,14 @@ public class EarthPonyStompAbility implements Ability<Hit> {
return race.canUseEarth();
}
@Override
public Identifier getIcon(Pony player) {
Identifier id = Abilities.REGISTRY.getId(this);
return new Identifier(id.getNamespace(), "textures/gui/ability/" + id.getPath()
+ "_" + player.getObservedSpecies().getId().getPath()
+ ".png");
}
@Override
public double getCostEstimate(Pony player) {
return rad;

View file

@ -45,7 +45,7 @@ public class PegasusFlightToggleAbility implements Ability<Hit> {
Identifier id = Abilities.REGISTRY.getId(this);
return new Identifier(id.getNamespace(), "textures/gui/ability/" + id.getPath()
+ (player.getPhysics().isFlying() ? "_land" : "_takeoff")
+ (player.getObservedSpecies() == Race.CHANGELING ? "_changeling" : "")
+ "_" + player.getObservedSpecies().getId().getPath()
+ ".png");
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB