Skip to content

Commit 8c61677

Browse files
committed
port: fix contraption types
1 parent 8eb48fd commit 8c61677

18 files changed

Lines changed: 73 additions & 38 deletions

src/main/java/rbasamoyai/createbigcannons/CreateBigCannons.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static void init() {
5959
CBCRecipeTypes.register();
6060
CBCCannonContraptionTypes.register();
6161

62-
CBCContraptionTypes.prepare();
62+
CBCContraptionTypes.init();
6363
CBCArmInteractionPointTypes.register();
6464
CBCChecks.register();
6565
CBCTags.register();

src/main/java/rbasamoyai/createbigcannons/cannon_control/contraption/MountedAutocannonContraption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ public void readNBT(Level level, CompoundTag tag, boolean clientData) {
531531

532532
@Override
533533
public ContraptionType getType() {
534-
return CBCContraptionTypes.MOUNTED_AUTOCANNON;
534+
return CBCContraptionTypes.MOUNTED_AUTOCANNON.value();
535535
}
536536

537537
@Override

src/main/java/rbasamoyai/createbigcannons/cannon_control/contraption/MountedBigCannonContraption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ public void readNBT(Level level, CompoundTag tag, boolean clientData) {
626626

627627
@Override
628628
public ContraptionType getType() {
629-
return CBCContraptionTypes.MOUNTED_CANNON;
629+
return CBCContraptionTypes.MOUNTED_CANNON.value();
630630
}
631631

632632
public boolean isDropMortar() {

src/main/java/rbasamoyai/createbigcannons/cannon_control/fixed_cannon_mount/FixedCannonMountBlockEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public BlockPos getControllerBlockPos() {
238238
}
239239

240240
@Override
241-
public void _delete() {
241+
public void remove() {
242242
this.remove = true;
243243
if (!this.level.isClientSide)
244244
this.disassemble();

src/main/java/rbasamoyai/createbigcannons/cannon_control/fixed_cannon_mount/FixedCannonMountValueScreen.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public class FixedCannonMountValueScreen extends ValueSettingsScreen {
1818
private final BlockPos posCopy;
1919

2020
public FixedCannonMountValueScreen(BlockPos pos, ValueSettingsBoard board, ValueSettings valueSettings,
21-
Consumer<ValueSettings> onHover, boolean pitch) {
22-
super(pos, board, valueSettings, onHover);
21+
Consumer<ValueSettings> onHover, boolean pitch, int netId) {
22+
super(pos, board, valueSettings, onHover, netId);
2323
this.pitch = pitch;
2424
this.posCopy = pos;
2525
}
@@ -29,7 +29,7 @@ protected void saveAndClose(double pMouseX, double pMouseY) {
2929
ValueSettings closest = getClosestCoordinate((int) pMouseX, (int) pMouseY);
3030
// FIXME: value settings may be face-sensitive on future components - taken from ValueSettingsScreen#saveAndClose
3131
NetworkPlatform.sendToServer(new ServerboundSetFixedCannonMountValuePacket(this.posCopy, closest.row(), closest.value(),
32-
null, Direction.UP, AllKeys.ctrlDown(), this.pitch));
32+
null, null, Direction.UP, AllKeys.ctrlDown(), this.pitch));
3333
this.onClose();
3434
}
3535

src/main/java/rbasamoyai/createbigcannons/cannon_loading/CBCModifiedContraptionRegistry.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package rbasamoyai.createbigcannons.cannon_loading;
22

3+
import com.simibubi.create.AllContraptionTypes;
34
import com.simibubi.create.api.contraption.ContraptionType;
45
import com.simibubi.create.content.contraptions.Contraption;
56

@@ -33,14 +34,14 @@ public static boolean isFragileContraption(Contraption contraption) {
3334
}
3435

3536
public static void registerDefaults() {
36-
registerCannonLoaderType(CBCContraptionTypes.CANNON_LOADER);
37-
registerCannonLoaderType(ContraptionType.PISTON);
38-
registerCannonLoaderType(ContraptionType.GANTRY);
39-
registerCannonLoaderType(ContraptionType.PULLEY);
40-
registerFragileType(CBCContraptionTypes.CANNON_LOADER);
41-
registerFragileType(ContraptionType.PISTON);
42-
registerFragileType(ContraptionType.GANTRY);
43-
registerFragileType(ContraptionType.PULLEY);
37+
registerCannonLoaderType(CBCContraptionTypes.CANNON_LOADER.value());
38+
registerCannonLoaderType(AllContraptionTypes.PISTON.value());
39+
registerCannonLoaderType(AllContraptionTypes.GANTRY.value());
40+
registerCannonLoaderType(AllContraptionTypes.PULLEY.value());
41+
registerFragileType(CBCContraptionTypes.CANNON_LOADER.value());
42+
registerFragileType(AllContraptionTypes.PISTON.value());
43+
registerFragileType(AllContraptionTypes.GANTRY.value());
44+
registerFragileType(AllContraptionTypes.PULLEY.value());
4445
}
4546

4647
}

src/main/java/rbasamoyai/createbigcannons/cannon_loading/CannonLoadingContraption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ public CompoundTag writeNBT(boolean spawnPacket) {
347347

348348
@Override
349349
public ContraptionType getType() {
350-
return CBCContraptionTypes.CANNON_LOADER;
350+
return CBCContraptionTypes.CANNON_LOADER.value();
351351
}
352352

353353
@Override

src/main/java/rbasamoyai/createbigcannons/cannons/autocannon/breech/AutocannonBreechRenderer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package rbasamoyai.createbigcannons.cannons.autocannon.breech;
22

3+
import dev.engine_room.flywheel.api.visualization.VisualizationManager;
4+
35
import org.joml.Quaternionf;
46
import org.joml.Vector3f;
57

src/main/java/rbasamoyai/createbigcannons/cannons/big_cannons/breeches/quickfiring_breech/QuickfiringBreechBlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public InteractionResult onWrenched(BlockState state, UseOnContext context) {
289289
}
290290
newBe.setChanged();
291291
}
292-
this.playRemoveSound(level, pos);
292+
// this.playRemoveSound(level, pos); todo: c6 fix
293293
}
294294
return InteractionResult.sidedSuccess(level.isClientSide);
295295
}

src/main/java/rbasamoyai/createbigcannons/cannons/big_cannons/breeches/quickfiring_breech/QuickfiringBreechBlockEntityRenderer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package rbasamoyai.createbigcannons.cannons.big_cannons.breeches.quickfiring_breech;
22

3+
import dev.engine_room.flywheel.api.visualization.VisualizationManager;
4+
35
import org.joml.Quaternionf;
46
import org.joml.Vector3f;
57

0 commit comments

Comments
 (0)