Add separate icons for backwards and forwards kicks

This commit is contained in:
Sollace 2023-09-12 12:26:42 +01:00
parent a37c2d660d
commit 92cb78dc94
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
6 changed files with 15 additions and 1 deletions

View file

@ -63,6 +63,7 @@ public class EarthPonyKickAbility implements Ability<Pos> {
Identifier id = Abilities.REGISTRY.getId(this);
return new Identifier(id.getNamespace(), "textures/gui/ability/" + id.getPath()
+ "_" + player.getObservedSpecies().getId().getPath()
+ "_" + (getKickDirection(player) > 0 ? "forward" : "backward")
+ ".png");
}
@ -89,7 +90,7 @@ public class EarthPonyKickAbility implements Ability<Pos> {
player.asEntity().addExhaustion(3);
for (var e : VecHelper.findInRange(player.asEntity(), w, kickLocation.vec(), 2, EntityPredicates.EXCEPT_CREATIVE_OR_SPECTATOR)) {
for (var e : VecHelper.findInRange(player.asEntity(), w, kickLocation.vec(), 2.5, EntityPredicates.EXCEPT_CREATIVE_OR_SPECTATOR)) {
if (e instanceof LivingEntity entity) {
float calculatedStrength = 0.5F * (1 + player.getLevel().getScaled(9));

View file

@ -39,6 +39,19 @@ public class BaseZapAppleLeavesBlock extends LeavesBlock implements TintedBlock
tryAdvanceStage(state, world, pos, random);
}
@Override
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
if (world instanceof ServerWorld sw) {
ZapAppleStageStore store = ZapAppleStageStore.get(sw);
ZapAppleStageStore.Stage currentStage = store.getStage();
if (currentStage == ZapAppleStageStore.Stage.HIBERNATING) {
return currentStage.getNewState(state);
}
}
return state;
}
@Override
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) {
super.scheduledTick(state, world, pos, random);

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB