Skip to content

Commit

Permalink
Insert balloon directly to inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
voidsong-dragonfly committed Dec 31, 2023
1 parent 084b8f8 commit 0619039
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.minecraft.nbt.Tag;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.ItemStack;
Expand Down Expand Up @@ -145,7 +146,19 @@ public Vec3 getConnectionOffset(ConnectionPoint here, ConnectionPoint other, Wir
@Override
public boolean interact(Direction side, Player player, InteractionHand hand, ItemStack heldItem, float hitX, float hitY, float hitZ)
{
if(!heldItem.isEmpty()&&heldItem.getItem() instanceof IShaderItem)
if(player.isShiftKeyDown())
{
if(!level.isClientSide)
{
ItemEntity entityitem = new ItemEntity(level, player.getX(), player.getY(), player.getZ(),
new ItemStack(level.getBlockState(getBlockPos()).getBlock()),
0, 0, 0);
level.removeBlock(getBlockPos(), false);
level.addFreshEntity(entityitem);
}
return true;
}
else if(!heldItem.isEmpty()&&heldItem.getItem() instanceof IShaderItem)
{
this.shader.setShaderItem(ItemHandlerHelper.copyStackWithSize(heldItem, 1));
markContainingBlockForUpdate(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Balloon
<&recipe>Balloons are sacks of fabric with a heatsource below to keep them afloat. They will emit light, but despite the torch, they are not a fire hazard.
Balloons can be placed like normal blocks, or when no block is targeted, they will be placed in the air infront of you.
Similar to <link;metalconstruction;Structural Connectors;connector_recipes> you can attach Hemp Rope and Steel Wire to the balloon.
Sneak-clicking allows you to set a height offset for the balloon, allowing you to place it up to 5 blocks above the target.
Sneak-clicking while placing allows you to set a height offset for the balloon, allowing you to place it up to 5 blocks above the target. Sneaking and right-clicking will pick the balloon up.
You can also use dyes on a placed balloon; which part you dye depends on where you target it.
Rightclicking with an Engineer's Hammer will toggle the balloon's design between horizontal or vertical stripes.

0 comments on commit 0619039

Please sign in to comment.