Skip to content

Commit a45863a

Browse files
committed
port: misc
1 parent 8d9a355 commit a45863a

12 files changed

Lines changed: 36 additions & 28 deletions

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package rbasamoyai.createbigcannons;
22

3+
import net.createmod.catnip.lang.FontHelper;
4+
35
import org.apache.logging.log4j.LogManager;
46
import org.apache.logging.log4j.Logger;
57

@@ -66,7 +68,7 @@ public static void init() {
6668
}
6769

6870
static {
69-
REGISTRATE.setTooltipModifierFactory(item -> new ItemDescription.Modifier(item, TooltipHelper.Palette.STANDARD_CREATE)
71+
REGISTRATE.setTooltipModifierFactory(item -> new ItemDescription.Modifier(item, FontHelper.Palette.STANDARD_CREATE)
7072
.andThen(TooltipModifier.mapNull(KineticStats.create(item))));
7173
}
7274

src/main/java/rbasamoyai/createbigcannons/base/goggles/IDisplayEntityAssemblyExceptions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.simibubi.create.foundation.item.TooltipHelper;
88
import com.simibubi.create.foundation.utility.CreateLang;
99

10+
import net.createmod.catnip.lang.FontHelper;
1011
import net.minecraft.ChatFormatting;
1112
import net.minecraft.network.chat.Component;
1213

@@ -23,7 +24,7 @@ default boolean addExceptionToTooltip(List<Component> tooltip) {
2324

2425
String text = e.component.getString();
2526
Arrays.stream(text.split("\n"))
26-
.forEach(l -> TooltipHelper.cutStringTextComponent(l, TooltipHelper.Palette.GRAY_AND_WHITE)
27+
.forEach(l -> TooltipHelper.cutStringTextComponent(l, FontHelper.Palette.GRAY_AND_WHITE)
2728
.forEach(c -> CreateLang.builder().add(c.copy()).forGoggles(tooltip)));
2829

2930
return true;

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import net.minecraft.server.level.ServerLevel;
3333
import net.minecraft.world.InteractionHand;
3434
import net.minecraft.world.entity.player.Player;
35+
import net.minecraft.world.level.Level;
3536
import net.minecraft.world.level.block.entity.BlockEntityType;
3637
import net.minecraft.world.level.block.state.BlockState;
3738
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
@@ -304,9 +305,11 @@ public FixedCannonMountScrollValueBehaviour(SmartBlockEntity be, boolean pitch)
304305

305306
@Override
306307
public boolean testHit(Vec3 hit) {
308+
Level level = this.blockEntity.getLevel();
309+
BlockPos pos = this.blockEntity.getBlockPos();
307310
BlockState state = this.blockEntity.getBlockState();
308311
Vec3 localHit = hit.subtract(Vec3.atLowerCornerOf(this.blockEntity.getBlockPos()));
309-
return this.newSlotPositioning.testHit(state, localHit);
312+
return this.newSlotPositioning.testHit(level, pos, state, localHit);
310313
}
311314

312315
@Override
@@ -317,10 +320,6 @@ public MutableComponent formatValue(ValueSettings settings) {
317320
.component();
318321
}
319322

320-
@Override
321-
public void onShortInteract(Player player, InteractionHand hand, Direction side) {
322-
}
323-
324323
@Override
325324
public void setValueSettings(Player player, ValueSettings valueSetting, boolean ctrlHeld) {
326325
int value = valueSetting.value();

src/main/java/rbasamoyai/createbigcannons/crafting/casting/InvalidCastingError.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import net.minecraft.nbt.CompoundTag;
88
import net.minecraft.nbt.NbtUtils;
99
import net.minecraft.nbt.Tag;
10+
import net.minecraft.network.chat.Component;
1011
import net.minecraft.network.chat.MutableComponent;
1112
import net.minecraft.world.level.material.Fluid;
1213
import rbasamoyai.createbigcannons.base.CBCRegistries;

src/main/java/rbasamoyai/createbigcannons/index/CBCBlockEntities.java

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

33
import static rbasamoyai.createbigcannons.CreateBigCannons.REGISTRATE;
44

5-
import com.simibubi.create.content.kinetics.base.ShaftInstance;
5+
import com.simibubi.create.content.kinetics.base.ShaftVisual;
66
import com.simibubi.create.content.kinetics.base.ShaftRenderer;
77
import com.tterrag.registrate.util.entry.BlockEntityEntry;
88

@@ -65,14 +65,14 @@ public class CBCBlockEntities {
6565

6666
public static final BlockEntityEntry<SlidingBreechBlockEntity> SLIDING_BREECH = REGISTRATE
6767
.blockEntity("sliding_breech", SlidingBreechBlockEntity::new)
68-
.instance(() -> SlidingBreechInstance::new, false)
68+
.visual(() -> SlidingBreechInstance::new, false)
6969
.renderer(() -> SlidingBreechBlockEntityRenderer::new)
7070
.validBlocks(CBCBlocks.CAST_IRON_SLIDING_BREECH, CBCBlocks.BRONZE_SLIDING_BREECH, CBCBlocks.STEEL_SLIDING_BREECH)
7171
.register();
7272

7373
public static final BlockEntityEntry<ScrewBreechBlockEntity> SCREW_BREECH = REGISTRATE
7474
.blockEntity("screw_breech", ScrewBreechBlockEntity::new)
75-
.instance(() -> ScrewBreechInstance::new, false)
75+
.visual(() -> ScrewBreechInstance::new, false)
7676
.renderer(() -> ScrewBreechBlockEntityRenderer::new)
7777
.validBlocks(CBCBlocks.STEEL_SCREW_BREECH, CBCBlocks.NETHERSTEEL_SCREW_BREECH)
7878
.register();
@@ -91,35 +91,35 @@ public class CBCBlockEntities {
9191

9292
public static final BlockEntityEntry<QuickfiringBreechBlockEntity> QUICKFIRING_BREECH = REGISTRATE
9393
.blockEntity("quickfiring_breech", QuickfiringBreechBlockEntity::new)
94-
.instance(() -> QuickfiringBreechInstance::new)
94+
.visual(() -> QuickfiringBreechInstance::new)
9595
.renderer(() -> QuickfiringBreechBlockEntityRenderer::new)
9696
.validBlocks(CBCBlocks.CAST_IRON_QUICKFIRING_BREECH, CBCBlocks.BRONZE_QUICKFIRING_BREECH, CBCBlocks.STEEL_QUICKFIRING_BREECH)
9797
.register();
9898

9999
public static final BlockEntityEntry<CannonLoaderBlockEntity> CANNON_LOADER = REGISTRATE
100100
.blockEntity("cannon_loader", CannonLoaderBlockEntity::new)
101-
.instance(() -> ShaftInstance::new, false)
101+
.visual(() -> ShaftVisual::new, false)
102102
.renderer(() -> ShaftRenderer::new)
103103
.validBlock(CBCBlocks.CANNON_LOADER)
104104
.register();
105105

106106
public static final BlockEntityEntry<CannonMountBlockEntity> CANNON_MOUNT = REGISTRATE
107107
.blockEntity("cannon_mount", CannonMountBlockEntity::new)
108-
.instance(() -> CannonMountInstance::new)
108+
.visual(() -> CannonMountInstance::new)
109109
.renderer(() -> CannonMountBlockEntityRenderer::new)
110110
.validBlock(CBCBlocks.CANNON_MOUNT)
111111
.register();
112112

113113
public static final BlockEntityEntry<YawControllerBlockEntity> YAW_CONTROLLER = REGISTRATE
114114
.blockEntity("yaw_controller", YawControllerBlockEntity::new)
115-
.instance(() -> ShaftInstance::new)
115+
.visual(() -> ShaftVisual::new)
116116
.renderer(() -> ShaftRenderer::new)
117117
.validBlock(CBCBlocks.YAW_CONTROLLER)
118118
.register();
119119

120120
public static final BlockEntityEntry<CannonMountExtensionBlockEntity> CANNON_MOUNT_EXTENSION = REGISTRATE
121121
.blockEntity("cannon_mount_extension", CannonMountExtensionBlockEntity::new)
122-
.instance(() -> ShaftInstance::new)
122+
.visual(() -> ShaftInstance::new)
123123
.renderer(() -> ShaftRenderer::new)
124124
.validBlock(CBCBlocks.CANNON_MOUNT_EXTENSION)
125125
.register();
@@ -136,14 +136,14 @@ public class CBCBlockEntities {
136136

137137
public static final BlockEntityEntry<FuzedBlockEntity> FUZED_BLOCK = REGISTRATE
138138
.blockEntity("fuzed_block", FuzedBlockEntity::new)
139-
.instance(() -> FuzedBlockInstance::new)
139+
.visual(() -> FuzedBlockInstance::new)
140140
.renderer(() -> FuzedBlockEntityRenderer::new)
141141
.validBlocks(CBCBlocks.HE_SHELL, CBCBlocks.SHRAPNEL_SHELL, CBCBlocks.AP_SHELL, CBCBlocks.DROP_MORTAR_SHELL, CBCBlocks.SMOKE_SHELL)
142142
.register();
143143

144144
public static final BlockEntityEntry<AbstractFluidShellBlockEntity> FLUID_SHELL = REGISTRATE
145145
.blockEntity("fluid_shell", IndexPlatform::makeFluidShellBlockEntity)
146-
.instance(() -> FuzedBlockInstance::new)
146+
.visual(() -> FuzedBlockInstance::new)
147147
.renderer(() -> FuzedBlockEntityRenderer::new)
148148
.validBlock(CBCBlocks.FLUID_SHELL)
149149
.register();
@@ -162,7 +162,7 @@ public class CBCBlockEntities {
162162

163163
public static final BlockEntityEntry<AbstractCannonDrillBlockEntity> CANNON_DRILL = REGISTRATE
164164
.blockEntity("cannon_drill", IndexPlatform::makeDrill)
165-
.instance(() -> ShaftInstance::new)
165+
.visual(() -> ShaftVisual::new)
166166
.renderer(() -> ShaftRenderer::new)
167167
.validBlock(CBCBlocks.CANNON_DRILL)
168168
.register();
@@ -175,7 +175,7 @@ public class CBCBlockEntities {
175175

176176
public static final BlockEntityEntry<CannonBuilderBlockEntity> CANNON_BUILDER = REGISTRATE
177177
.blockEntity("cannon_builder", CannonBuilderBlockEntity::new)
178-
.instance(() -> ShaftInstance::new)
178+
.visual(() -> ShaftVisual::new)
179179
.renderer(() -> ShaftRenderer::new)
180180
.validBlock(CBCBlocks.CANNON_BUILDER)
181181
.register();
@@ -200,14 +200,14 @@ public class CBCBlockEntities {
200200

201201
public static final BlockEntityEntry<AbstractAutocannonBreechBlockEntity> AUTOCANNON_BREECH = REGISTRATE
202202
.blockEntity("autocannon_breech", IndexPlatform::makeAutocannonBreech)
203-
.instance(() -> AutocannonBreechInstance::new)
203+
.visual(() -> AutocannonBreechInstance::new)
204204
.renderer(() -> AutocannonBreechRenderer::new)
205205
.validBlocks(CBCBlocks.CAST_IRON_AUTOCANNON_BREECH, CBCBlocks.BRONZE_AUTOCANNON_BREECH, CBCBlocks.STEEL_AUTOCANNON_BREECH)
206206
.register();
207207

208208
public static final BlockEntityEntry<AutocannonRecoilSpringBlockEntity> AUTOCANNON_RECOIL_SPRING = REGISTRATE
209209
.blockEntity("autocannon_recoil_spring", AutocannonRecoilSpringBlockEntity::new)
210-
.instance(() -> AutocannonRecoilSpringInstance::new)
210+
.visual(() -> AutocannonRecoilSpringInstance::new)
211211
.renderer(() -> AutocannonRecoilSpringRenderer::new)
212212
.validBlocks(CBCBlocks.CAST_IRON_AUTOCANNON_RECOIL_SPRING, CBCBlocks.BRONZE_AUTOCANNON_RECOIL_SPRING, CBCBlocks.STEEL_AUTOCANNON_RECOIL_SPRING)
213213
.register();

src/main/java/rbasamoyai/createbigcannons/index/CBCBlocks.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import java.util.function.Supplier;
66

7-
import com.simibubi.create.content.redstone.displayLink.AllDisplayBehaviours;
87
import com.simibubi.create.foundation.data.CreateRegistrate;
98
import com.simibubi.create.foundation.data.SharedProperties;
109
import com.tterrag.registrate.builders.BlockBuilder;
@@ -855,7 +854,7 @@ private static NonNullSupplier<? extends Block> steelSlidingBreech() {
855854
.properties(p -> p.isRedstoneConductor(CBCBlocks::never))
856855
.transform(axeOrPickaxe())
857856
.transform(CBCBuilderTransformers.cannonMount())
858-
.onRegister(AllDisplayBehaviours.assignDataBehaviour(new CannonMountDisplaySource()))
857+
// .onRegister(AllDisplayBehaviours.assignDataBehaviour(new CannonMountDisplaySource())) todo: fix DisplayLinks. see create AllBlocks
859858
.register();
860859

861860
public static final BlockEntry<YawControllerBlock> YAW_CONTROLLER = REGISTRATE
@@ -864,7 +863,7 @@ private static NonNullSupplier<? extends Block> steelSlidingBreech() {
864863
.properties(p -> p.isRedstoneConductor(CBCBlocks::never))
865864
.transform(axeOrPickaxe())
866865
.transform(CBCBuilderTransformers.yawController())
867-
.onRegister(AllDisplayBehaviours.assignDataBehaviour(new CannonMountDisplaySource()))
866+
// .onRegister(AllDisplayBehaviours.assignDataBehaviour(new CannonMountDisplaySource()))
868867
.register();
869868

870869
public static final BlockEntry<CannonMountExtensionBlock> CANNON_MOUNT_EXTENSION = REGISTRATE
@@ -873,7 +872,7 @@ private static NonNullSupplier<? extends Block> steelSlidingBreech() {
873872
.properties(p -> p.isRedstoneConductor(CBCBlocks::never))
874873
.transform(axeOrPickaxe())
875874
.transform(CBCBuilderTransformers.cannonMountExtension())
876-
.onRegister(AllDisplayBehaviours.assignDataBehaviour(new CannonMountDisplaySource()))
875+
// .onRegister(AllDisplayBehaviours.assignDataBehaviour(new CannonMountDisplaySource()))
877876
.register();
878877

879878
public static final BlockEntry<FixedCannonMountBlock> FIXED_CANNON_MOUNT = REGISTRATE
@@ -882,7 +881,7 @@ private static NonNullSupplier<? extends Block> steelSlidingBreech() {
882881
.properties(p -> p.isRedstoneConductor(CBCBlocks::never))
883882
.transform(axeOrPickaxe())
884883
.transform(CBCBuilderTransformers.fixedCannonMount())
885-
.onRegister(AllDisplayBehaviours.assignDataBehaviour(new CannonMountDisplaySource()))
884+
// .onRegister(AllDisplayBehaviours.assignDataBehaviour(new CannonMountDisplaySource()))
886885
.register();
887886

888887
public static final BlockEntry<CannonCarriageBlock> CANNON_CARRIAGE = REGISTRATE

src/main/java/rbasamoyai/createbigcannons/index/CBCCTTypes.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import com.simibubi.create.foundation.block.connected.ConnectedTextureBehaviour.CTContext;
66
import com.simibubi.create.foundation.block.connected.ConnectedTextureBehaviour.ContextRequirement;
77

8+
import com.simibubi.create.foundation.utility.CreateLang;
9+
810
import net.minecraft.resources.ResourceLocation;
911
import rbasamoyai.createbigcannons.CreateBigCannons;
1012

src/main/java/rbasamoyai/createbigcannons/index/CBCChecks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package rbasamoyai.createbigcannons.index;
22

33
import com.simibubi.create.AllBlocks;
4-
import com.simibubi.create.content.contraptions.BlockMovementChecks;
4+
import com.simibubi.create.api.contraption.BlockMovementChecks;
55

66
import net.minecraft.core.BlockPos;
77
import net.minecraft.core.Direction;

src/main/java/rbasamoyai/createbigcannons/index/CBCGuiTextures.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package rbasamoyai.createbigcannons.index;
22

3-
import com.simibubi.create.foundation.gui.element.ScreenElement;
3+
import net.createmod.catnip.gui.element.ScreenElement;
44

55
import net.minecraft.client.gui.GuiGraphics;
66
import net.minecraft.resources.ResourceLocation;

src/main/java/rbasamoyai/createbigcannons/index/CBCParticleTypes.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import com.simibubi.create.foundation.particle.ICustomParticleData;
66

7+
import com.simibubi.create.foundation.utility.CreateLang;
8+
79
import net.fabricmc.api.EnvType;
810
import net.fabricmc.api.Environment;
911
import net.minecraft.client.Minecraft;

0 commit comments

Comments
 (0)