Skip to content

Commit 6124c03

Browse files
committed
some more iotic dial + update build workflow
1 parent dee7414 commit 6124c03

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

.github/workflows/build_docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ permissions:
3131

3232
jobs:
3333
hexdoc:
34-
uses: object-Object/hexdoc/.github/workflows/hexdoc.yml@v1!0.dev
34+
uses: hexdoc-dev/hexdoc/.github/workflows/hexdoc.yml@v1!0.dev
3535
permissions:
3636
contents: write
3737
pages: read

common/src/main/java/com/samsthenerd/hexgloop/blocks/BlockIoticDial.java

+15
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
import net.minecraft.block.BlockWithEntity;
1616
import net.minecraft.block.ShapeContext;
1717
import net.minecraft.block.entity.BlockEntity;
18+
import net.minecraft.entity.ItemEntity;
1819
import net.minecraft.entity.player.PlayerEntity;
1920
import net.minecraft.item.ItemPlacementContext;
2021
import net.minecraft.item.ItemStack;
22+
import net.minecraft.server.world.ServerWorld;
2123
import net.minecraft.state.StateManager;
2224
import net.minecraft.state.property.DirectionProperty;
2325
import net.minecraft.state.property.IntProperty;
@@ -98,6 +100,19 @@ public BlockRenderType getRenderType( @Nonnull BlockState state )
98100
return BlockRenderType.MODEL;
99101
}
100102

103+
@Override
104+
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) {
105+
if(world.getBlockEntity(pos) instanceof BlockEntityDial dialBE
106+
// make sure it's not just changing something with the blockstate
107+
&& newState.getBlock() != this && world instanceof ServerWorld sWorld){
108+
ItemStack stack = dialBE.getInnerMultiFocus().copy();
109+
if(!stack.isEmpty()){
110+
sWorld.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), stack));
111+
}
112+
}
113+
super.onStateReplaced(state, world, pos, newState, moved);
114+
}
115+
101116
private static Map<Direction.Axis, FaceCalcinator> faceCalcs = new HashMap<Direction.Axis, FaceCalcinator>();
102117

103118
static {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"type": "minecraft:block",
3+
"pools": [
4+
{
5+
"rolls": 1,
6+
"entries": [
7+
{
8+
"type": "minecraft:item",
9+
"name": "hexgloop:iotic_dial"
10+
}
11+
]
12+
}
13+
]
14+
}

common/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"hexgloop:wave_locus",
1414
"hexgloop:slate_lamp",
1515
"hexgloop:enlightenment_bridge",
16-
"hexgloop:syncetrix"
16+
"hexgloop:syncetrix",
17+
"hexgloop:iotic_dial"
1718
]
1819
}
1920

0 commit comments

Comments
 (0)