mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-30 16:28:00 +01:00
Add additional balloon designs (based on submissions by CryGhast #186 )
This commit is contained in:
parent
5cc2bcc0e4
commit
3798d69e7c
5 changed files with 20 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
package com.minelittlepony.unicopia.entity.mob;
|
||||
|
||||
import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.entity.*;
|
||||
|
@ -47,6 +48,7 @@ import com.minelittlepony.unicopia.entity.collision.MultiBox;
|
|||
import com.minelittlepony.unicopia.entity.duck.EntityDuck;
|
||||
import com.minelittlepony.unicopia.item.BasketItem;
|
||||
import com.minelittlepony.unicopia.item.HotAirBalloonItem;
|
||||
import com.minelittlepony.unicopia.item.UItems;
|
||||
import com.minelittlepony.unicopia.server.world.WeatherConditions;
|
||||
import com.terraformersmc.terraform.boat.api.TerraformBoatType;
|
||||
|
||||
|
@ -336,7 +338,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
|
|||
if (isAscending()) {
|
||||
playSound(USounds.ENTITY_HOT_AIR_BALLOON_BOOST, 1, 1);
|
||||
}
|
||||
stack.damage(1, player, p -> p.sendEquipmentBreakStatus(hand == Hand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND));
|
||||
stack.damage(1, player, p -> p.sendToolBreakStatus(hand));
|
||||
playSound(USounds.Vanilla.ITEM_FLINTANDSTEEL_USE, 1, 1);
|
||||
getWorld().emitGameEvent(this, GameEvent.ENTITY_INTERACT, getBlockPos());
|
||||
return ActionResult.SUCCESS;
|
||||
|
@ -372,6 +374,17 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
|
|||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
if (stack.isIn(ConventionalItemTags.SHEARS) && hasBalloon()) {
|
||||
if (!player.getAbilities().creativeMode) {
|
||||
stack.damage(1, player, p -> p.sendToolBreakStatus(hand));
|
||||
}
|
||||
setDesign(BalloonDesign.NONE);
|
||||
dropItem(UItems.GIANT_BALLOON);
|
||||
playSound(USounds.ENTITY_HOT_AIR_BALLOON_EQUIP_CANOPY, 1, 1);
|
||||
getWorld().emitGameEvent(this, GameEvent.ENTITY_INTERACT, getBlockPos());
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
if ((stack.isOf(Items.LANTERN) || stack.isOf(Items.SOUL_LANTERN)) && !hasBurner()) {
|
||||
setStackInHand(Hand.MAIN_HAND, stack.copyWithCount(1));
|
||||
if (!player.getAbilities().creativeMode) {
|
||||
|
@ -532,9 +545,13 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp
|
|||
@SuppressWarnings("deprecation")
|
||||
public enum BalloonDesign implements StringIdentifiable {
|
||||
NONE,
|
||||
LUNA;
|
||||
LUNA,
|
||||
DAWN,
|
||||
EQUALITY,
|
||||
STORM,
|
||||
TALE;
|
||||
|
||||
public static final StringIdentifiable.Codec<BalloonDesign> CODEC = StringIdentifiable.createCodec(BalloonDesign::values);
|
||||
public static final Codec<BalloonDesign> CODEC = StringIdentifiable.createCodec(BalloonDesign::values);
|
||||
private static final IntFunction<BalloonDesign> BY_ID = ValueLists.<BalloonDesign>createIdToValueFunction(Enum::ordinal, values(), ValueLists.OutOfBoundsHandling.ZERO);
|
||||
|
||||
private final String name = name().toLowerCase(Locale.ROOT);
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
Binary file not shown.
After Width: | Height: | Size: 53 KiB |
Loading…
Reference in a new issue