Skip to content

Commit ed4ca00

Browse files
committed
preparing for release
1 parent 35bc770 commit ed4ca00

7 files changed

Lines changed: 85 additions & 20 deletions

File tree

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ mod_id=pipeorgans
2222
mod_name=Create: Sound of Steam
2323
mod_license=All Rights Reserved
2424
# The mod version. See https://semver.org/
25-
mod_version=0.6.2+1.20.1
25+
mod_version=0.7+1.20.1
2626

2727
mod_group_id=com.finchy.pipeorgans
28-
mod_authors=FinchyMcFinch, nacho
28+
mod_authors=FinchyMcFinch
2929
mod_description=Adds pipe organs to Create.
3030

3131
create_version = 6.0.4-79

src/main/java/com/finchy/pipeorgans/content/midi/keyboardRelay/KeyboardRelayBlock.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.finchy.pipeorgans.content.midi.stopMaster.StopMasterBlockItem;
44
import com.finchy.pipeorgans.init.AllBlockEntities;
5+
import com.finchy.pipeorgans.init.AllShapes;
56
import com.simibubi.create.content.equipment.wrench.IWrenchable;
67
import com.simibubi.create.foundation.block.IBE;
78
import net.minecraft.core.BlockPos;
@@ -10,6 +11,7 @@
1011
import net.minecraft.world.InteractionResult;
1112
import net.minecraft.world.entity.player.Player;
1213
import net.minecraft.world.item.context.BlockPlaceContext;
14+
import net.minecraft.world.level.BlockGetter;
1315
import net.minecraft.world.level.Level;
1416
import net.minecraft.world.level.block.Block;
1517
import net.minecraft.world.level.block.entity.BlockEntityType;
@@ -19,6 +21,8 @@
1921
import net.minecraft.world.level.block.state.properties.BooleanProperty;
2022
import net.minecraft.world.level.block.state.properties.DirectionProperty;
2123
import net.minecraft.world.phys.BlockHitResult;
24+
import net.minecraft.world.phys.shapes.CollisionContext;
25+
import net.minecraft.world.phys.shapes.VoxelShape;
2226
import org.jetbrains.annotations.Nullable;
2327

2428
import java.util.Objects;
@@ -31,6 +35,15 @@ public class KeyboardRelayBlock extends Block implements IBE<KeyboardRelayBlockE
3135

3236
public KeyboardRelayBlock(Properties pProperties) {
3337
super(pProperties);
38+
registerDefaultState(defaultBlockState()
39+
.setValue(FACING, Direction.NORTH)
40+
.setValue(POWERED, false)
41+
);
42+
}
43+
44+
@Override
45+
public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) {
46+
return AllShapes.KBR.get(pState.getValue(FACING));
3447
}
3548

3649
// define blockstate params

src/main/java/com/finchy/pipeorgans/content/midi/keyboardRelay/KeyboardRelayBlockEntity.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import net.minecraft.nbt.CompoundTag;
1111
import net.minecraft.nbt.ListTag;
1212
import net.minecraft.nbt.Tag;
13-
import net.minecraft.network.chat.Component;
1413
import net.minecraft.server.level.ServerLevel;
1514
import net.minecraft.world.entity.Entity;
1615
import net.minecraft.world.entity.player.Player;
@@ -138,7 +137,6 @@ public void tryStopUsing(Player player) {
138137

139138
private void startUsing(Player player) {
140139
user = player.getUUID();
141-
player.sendSystemMessage(Component.literal("START"));
142140
player.getPersistentData().putIntArray("UsingKBRelayPos", new int[]{worldPosition.getX(), worldPosition.getY(), worldPosition.getZ()});
143141

144142
level.setBlock(worldPosition, getBlockState().setValue(BlockStateProperties.POWERED, false), 3); // turn power off
@@ -150,7 +148,6 @@ private void stopUsing(Player player) {
150148
user = null;
151149
if (player != null) {
152150
player.getPersistentData().remove("UsingKBRelayPos");
153-
player.sendSystemMessage(Component.literal("STOP"));
154151
}
155152
level.setBlock(worldPosition, getBlockState().setValue(BlockStateProperties.POWERED, false), 3); // turn power off
156153
deactivatedThisTick = true;

src/main/java/com/finchy/pipeorgans/init/AllShapes.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@
44
import net.createmod.catnip.math.VoxelShaper;
55
import net.minecraft.core.Direction;
66
import net.minecraft.world.level.block.Block;
7-
import net.minecraft.world.phys.shapes.BooleanOp;
8-
import net.minecraft.world.phys.shapes.Shapes;
97
import net.minecraft.world.phys.shapes.VoxelShape;
108

119
public class AllShapes {
1210

13-
public static VoxelShape add(VoxelShape a, VoxelShape b) {
14-
return Shapes.join(a, b, BooleanOp.OR);
15-
}
16-
1711
public static VoxelShape getGenericPipeShape(GenericWhistleProperties.WhistleSize size) {
1812
return switch (size) {
1913
case TINY -> GENERIC_TINY_BASE;
@@ -23,7 +17,6 @@ public static VoxelShape getGenericPipeShape(GenericWhistleProperties.WhistleSiz
2317
case HUGE -> GENERIC_HUGE_BASE;
2418
};
2519
}
26-
2720
public static VoxelShape getGenericExtensionShape(GenericWhistleProperties.QuadrupleExtensionShape shape, GenericWhistleProperties.WhistleSize size) {
2821
return switch (shape) {
2922
case SINGLE -> switch (size) {
@@ -66,7 +59,6 @@ public static VoxelShape getSlimPipeShape(GenericWhistleProperties.WhistleSize s
6659
case HUGE -> SLIM_HUGE_BASE;
6760
};
6861
}
69-
7062
public static VoxelShape getSlimExtensionShape(GenericWhistleProperties.QuadrupleExtensionShape shape, GenericWhistleProperties.WhistleSize size) {
7163
return switch (shape) {
7264
case SINGLE -> switch (size) {
@@ -176,16 +168,23 @@ public static VoxelShape getCompleteWhistleShape(GenericWhistleProperties.Whistl
176168
GENERIC_EXTENSION_HUGE_TRIPLE = shape(1, 0, 1, 15, 12, 15).build(),
177169
GENERIC_EXTENSION_HUGE_QUADRUPLE = shape(1, 0, 1, 15, 16, 15).build();
178170

171+
// OTHER VOXELSHAPERS
172+
public static VoxelShaper
179173

180-
public static VoxelShaper BASE = shape(1, 0, 1, 15, 3, 15)
181-
.add(5, 3, 5, 11, 11, 11)
182-
.forDirectional(Direction.UP);
174+
BASE = shape(1, 0, 1, 15, 3, 15)
175+
.add(5, 3, 5, 11, 11, 11)
176+
.forDirectional(Direction.UP),
183177

184-
// shape for floor variant is BASE.get(UP)
185-
public static VoxelShaper BASE_BLOCK_WALL = shape(1, 1, 0, 15, 15, 3)
186-
.add(5, 3, 3, 11, 9, 11)
178+
// shape for floor variant is BASE.get(UP)
179+
BASE_BLOCK_WALL = shape(1, 1, 0, 15, 15, 3)
180+
.add(5, 3, 3, 11, 9, 11)
187181
.add(5, 9, 5, 11, 11, 11)
188-
.forDirectional(Direction.NORTH);
182+
.forHorizontal(Direction.NORTH),
183+
184+
KBR = shape(0, 0, 4, 16, 2, 16)
185+
.add(0, 2, 6, 16, 16, 16)
186+
.forHorizontal(Direction.NORTH);
187+
189188

190189

191190
private static com.simibubi.create.AllShapes.Builder shape(VoxelShape shape) {
-6 Bytes
Loading
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"type": "minecraft:crafting_shaped",
3+
"category": "misc",
4+
"pattern": [
5+
"TR",
6+
"IP",
7+
" C"
8+
],
9+
"key": {
10+
"T": {
11+
"item": "create:transmitter"
12+
},
13+
"C": {
14+
"item": "create:brass_casing"
15+
},
16+
"R": {
17+
"item": "minecraft:redstone"
18+
},
19+
"I": {
20+
"tag": "forge:ingots/iron"
21+
},
22+
"P": {
23+
"item": "create:precision_mechanism"
24+
}
25+
},
26+
"result": {
27+
"item": "pipeorgans:keyboard_relay",
28+
"count": 1
29+
}
30+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"type": "minecraft:crafting_shaped",
3+
"category": "misc",
4+
"pattern": [
5+
"TRT",
6+
"ICI"
7+
],
8+
"key": {
9+
"T": {
10+
"item": "create:transmitter"
11+
},
12+
"C": {
13+
"item": "create:brass_casing"
14+
},
15+
"R": {
16+
"item": "minecraft:redstone"
17+
},
18+
"I": {
19+
"tag": "forge:ingots/iron"
20+
}
21+
},
22+
"result": {
23+
"item": "pipeorgans:stop_master",
24+
"count": 1
25+
}
26+
}

0 commit comments

Comments
 (0)