From 7c538de32ed149c45e173adfe54a995379aa4895 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Wed, 19 Feb 2025 18:41:16 -0500 Subject: [PATCH 1/4] Double arrows - Remove duplicate file --- .../block/factory_panel_arrows_animated.png | Bin 906 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/main/resources/assets/create/textures/block/factory_panel_arrows_animated.png diff --git a/src/main/resources/assets/create/textures/block/factory_panel_arrows_animated.png b/src/main/resources/assets/create/textures/block/factory_panel_arrows_animated.png deleted file mode 100644 index ca91d61b83914866bb5b7c02a0ba962ef0f04747..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 906 zcmeAS@N?(olHy`uVBq!ia0vp^0zllr!3-o#y(K{$#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6-A0X`wF4<9}}eE9H*6DOLQnl4?sv})C=ii(P!o}L8@7QBA_dgsoa&!0bE zyLRo}yLY#5-wxDtZRf=MKuVw_$S?RmDqwh^94iTw<1FxqEM{QfI|Ravq8eTeKtZt* z*NBqf{Irtt#G+J&fW*wa5 zP@RF1u>s=(h?yY!SQkLdnFM5m029zuCa}sNOA8{&803<6b6|wRhCu=S+sGoYe zIEHw5ubtXBsab)?MLB?Vz3spM`T6FGQ{t}PdTltl%lfR+d6y-pLQE|Rrb;DUeQ+Q& z>kx1AW24{*1p__PB~vCgNxN`_=ry~~GkyK;V$BjUotFy_88A6<-3j7gEnXwo<>TFR zS}2^u^5_n`B`HTVRQ{Fp3l%N8WVz@9($FIE@>#u)*Z4(hc+a@pktPwxI zuvE9RT+RL&%S*VAHNO{k^1J_0g#XI)t2ftvbf}G-8*Bgg;`f9Pn?!k>zrOQ)g0)rL)mh1 zuVv=4f4^91@V}Ei`-!sLw>-mgAfdSDpmTQ4lZB?=`1seCikemau-j1mdit}*s~2^4 z+px_~mb<3E_Pe3JMf`!qU+w-ke100U|H02I>dVg^u1PDE3y#{q<=*v;XOk<|*W1OL zRaVShX~6UJVLJ1(2xgl34Hd%F6$ JtaD0e0sybjT8#hz From 19f31e33d27cf8f18b26b382a8dd21d6628c1fc5 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Thu, 20 Feb 2025 07:08:43 -0500 Subject: [PATCH 2/4] Nicer drills - Implement a tag to allow people to specify blocks drills shouldn't break --- .../java/com/simibubi/create/AllTags.java | 36 +++++++++---------- .../base/BlockBreakingKineticBlockEntity.java | 3 +- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/simibubi/create/AllTags.java b/src/main/java/com/simibubi/create/AllTags.java index 92f278cbfe..7e86567f02 100644 --- a/src/main/java/com/simibubi/create/AllTags.java +++ b/src/main/java/com/simibubi/create/AllTags.java @@ -31,7 +31,7 @@ import net.minecraftforge.registries.IForgeRegistry; public class AllTags { public static TagKey optionalTag(IForgeRegistry registry, - ResourceLocation id) { + ResourceLocation id) { return registry.tags() .createOptionalTagKey(id, Collections.emptySet()); } @@ -59,9 +59,7 @@ public class AllTags { TIC("tconstruct"), QUARK("quark"), GS("galosphere"), - CURIOS("curios") - - ; + CURIOS("curios"); public final String id; public final boolean optionalDefault; @@ -92,6 +90,7 @@ public class AllTags { GIRDABLE_TRACKS, MOVABLE_EMPTY_COLLIDER, NON_MOVABLE, + NON_BREAKABLE, ORE_OVERRIDE_STONE, PASSIVE_BOILER_HEATERS, SAFE_NBT, @@ -163,7 +162,8 @@ public class AllTags { return state.is(tag); } - private static void init() {} + private static void init() { + } } @@ -199,17 +199,15 @@ public class AllTags { STRIPPED_LOGS(FORGE), STRIPPED_WOOD(FORGE), PLATES(FORGE), - OBSIDIAN_DUST(FORGE,"dusts/obsidian"), + OBSIDIAN_DUST(FORGE, "dusts/obsidian"), WRENCH(FORGE, "tools/wrench"), - ALLURITE(MOD,"stone_types/galosphere/allurite"), - AMETHYST(MOD,"stone_types/galosphere/amethyst"), + ALLURITE(MOD, "stone_types/galosphere/allurite"), + AMETHYST(MOD, "stone_types/galosphere/amethyst"), LUMIERE(MOD, "stone_types/galosphere/lumiere"), UA_CORAL(MOD, "upgrade_aquatic/coral"), - CURIOS_HEAD(CURIOS, "head") - - ; + CURIOS_HEAD(CURIOS, "head"); public final TagKey tag; public final boolean alwaysDatagen; @@ -250,7 +248,8 @@ public class AllTags { return stack.is(tag); } - private static void init() {} + private static void init() { + } } @@ -263,9 +262,7 @@ public class AllTags { FAN_PROCESSING_CATALYSTS_SMOKING(MOD, "fan_processing_catalysts/smoking"), FAN_PROCESSING_CATALYSTS_SPLASHING(MOD, "fan_processing_catalysts/splashing"), - HONEY(FORGE) - - ; + HONEY(FORGE); public final TagKey tag; public final boolean alwaysDatagen; @@ -305,7 +302,8 @@ public class AllTags { return state.is(tag); } - private static void init() {} + private static void init() { + } } @@ -353,7 +351,8 @@ public class AllTags { return matches(entity.getType()); } - private static void init() {} + private static void init() { + } } @@ -396,7 +395,8 @@ public class AllTags { return ForgeRegistries.RECIPE_SERIALIZERS.getHolder(recipeSerializer).orElseThrow().is(tag); } - private static void init() {} + private static void init() { + } } public static void init() { diff --git a/src/main/java/com/simibubi/create/content/kinetics/base/BlockBreakingKineticBlockEntity.java b/src/main/java/com/simibubi/create/content/kinetics/base/BlockBreakingKineticBlockEntity.java index f8f71efd59..7912468599 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/base/BlockBreakingKineticBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/kinetics/base/BlockBreakingKineticBlockEntity.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.kinetics.base; import java.util.concurrent.atomic.AtomicInteger; +import com.simibubi.create.AllTags.AllBlockTags; import com.simibubi.create.foundation.utility.BlockHelper; import net.createmod.catnip.math.VecHelper; @@ -129,7 +130,7 @@ public abstract class BlockBreakingKineticBlockEntity extends KineticBlockEntity } public static boolean isBreakable(BlockState stateToBreak, float blockHardness) { - return !(stateToBreak.liquid() || stateToBreak.getBlock() instanceof AirBlock || blockHardness == -1); + return !(stateToBreak.liquid() || stateToBreak.getBlock() instanceof AirBlock || blockHardness == -1 || stateToBreak.is(AllBlockTags.NON_BREAKABLE.tag)); } public void onBlockBroken(BlockState stateToBreak) { From be60c6ce5a51f5f36968469367d9a4f7035693be Mon Sep 17 00:00:00 2001 From: IThundxr Date: Thu, 20 Feb 2025 07:15:20 -0500 Subject: [PATCH 3/4] Misc fixes --- changelog.md | 1 + .../actors/harvester/HarvesterMovementBehaviour.java | 4 ++-- .../kinetics/base/BlockBreakingKineticBlockEntity.java | 2 +- .../logistics/tableCloth/TableClothBlockEntity.java | 5 ++--- .../create/content/trains/track/TrackPlacement.java | 3 ++- .../simibubi/create/foundation/utility/TreeCutter.java | 10 +++++----- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/changelog.md b/changelog.md index 77d30a46a8..e62e75725f 100644 --- a/changelog.md +++ b/changelog.md @@ -140,6 +140,7 @@ _Now using Flywheel 1.0_ - Added `#create:sugar_cane_variants` to allow the mechanical saw to work with custom sugarcane variants (#7263) - New API for custom storage block behaviour on contraptions. For simple cases, create provides the `#create:simple_mounted_storage` and `#create:chest_mounted_storage` block tags. +- Added `#create:non_breakable` to mark blocks that cannot be broken by block-breaking kinetics - Removed LangMerger and related classes - Implemented an api to allow mods to register schematic requirements, partial safe nbt and contraption transforms without implementing interfaces (#4702) diff --git a/src/main/java/com/simibubi/create/content/contraptions/actors/harvester/HarvesterMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/actors/harvester/HarvesterMovementBehaviour.java index 41b3d06928..02677cb2f5 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/actors/harvester/HarvesterMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/actors/harvester/HarvesterMovementBehaviour.java @@ -4,7 +4,7 @@ import javax.annotation.Nullable; import org.apache.commons.lang3.mutable.MutableBoolean; -import com.simibubi.create.AllTags; +import com.simibubi.create.AllTags.AllBlockTags; import com.simibubi.create.content.contraptions.behaviour.MovementBehaviour; import com.simibubi.create.content.contraptions.behaviour.MovementContext; import com.simibubi.create.content.contraptions.render.ActorVisual; @@ -172,7 +172,7 @@ public class HarvesterMovementBehaviour implements MovementBehaviour { if (block == Blocks.SWEET_BERRY_BUSH) { return state.setValue(BlockStateProperties.AGE_3, Integer.valueOf(1)); } - if (state.is(AllTags.AllBlockTags.SUGAR_CANE_VARIANTS.tag) || block instanceof GrowingPlantBlock) { + if (AllBlockTags.SUGAR_CANE_VARIANTS.matches(block) || block instanceof GrowingPlantBlock) { if (state.getFluidState() .isEmpty()) return Blocks.AIR.defaultBlockState(); diff --git a/src/main/java/com/simibubi/create/content/kinetics/base/BlockBreakingKineticBlockEntity.java b/src/main/java/com/simibubi/create/content/kinetics/base/BlockBreakingKineticBlockEntity.java index 7912468599..278440b658 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/base/BlockBreakingKineticBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/kinetics/base/BlockBreakingKineticBlockEntity.java @@ -130,7 +130,7 @@ public abstract class BlockBreakingKineticBlockEntity extends KineticBlockEntity } public static boolean isBreakable(BlockState stateToBreak, float blockHardness) { - return !(stateToBreak.liquid() || stateToBreak.getBlock() instanceof AirBlock || blockHardness == -1 || stateToBreak.is(AllBlockTags.NON_BREAKABLE.tag)); + return !(stateToBreak.liquid() || stateToBreak.getBlock() instanceof AirBlock || blockHardness == -1 || AllBlockTags.NON_BREAKABLE.matches(stateToBreak)); } public void onBlockBroken(BlockState stateToBreak) { diff --git a/src/main/java/com/simibubi/create/content/logistics/tableCloth/TableClothBlockEntity.java b/src/main/java/com/simibubi/create/content/logistics/tableCloth/TableClothBlockEntity.java index 37d2e07046..30bc0c4904 100644 --- a/src/main/java/com/simibubi/create/content/logistics/tableCloth/TableClothBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/tableCloth/TableClothBlockEntity.java @@ -86,10 +86,9 @@ public class TableClothBlockEntity extends SmartBlockEntity { public void lazyTick() { super.lazyTick(); BlockPos relativePos = worldPosition.relative(facing); - sideOccluded = level.getBlockState(relativePos) - .is(AllBlockTags.TABLE_CLOTHS.tag) + sideOccluded = AllBlockTags.TABLE_CLOTHS.matches(level.getBlockState(relativePos)) || Block.isFaceFull(level.getBlockState(relativePos.below()) - .getOcclusionShape(level, relativePos.below()), facing.getOpposite()); + .getOcclusionShape(level, relativePos.below()), facing.getOpposite()); } @Override diff --git a/src/main/java/com/simibubi/create/content/trains/track/TrackPlacement.java b/src/main/java/com/simibubi/create/content/trains/track/TrackPlacement.java index 68091ff151..37232bd94e 100644 --- a/src/main/java/com/simibubi/create/content/trains/track/TrackPlacement.java +++ b/src/main/java/com/simibubi/create/content/trains/track/TrackPlacement.java @@ -8,6 +8,7 @@ import java.util.Set; import com.simibubi.create.AllSpecialTextures; import com.simibubi.create.AllTags; +import com.simibubi.create.AllTags.AllItemTags; import com.simibubi.create.content.equipment.blueprint.BlueprintOverlayRenderer; import com.simibubi.create.foundation.block.ProperWaterloggedBlock; import com.simibubi.create.foundation.utility.BlockHelper; @@ -375,7 +376,7 @@ public class TrackPlacement { ItemStack offhandItem = player.getOffhandItem() .copy(); - boolean shouldPave = offhandItem.getItem() instanceof BlockItem && !offhandItem.is(AllTags.AllItemTags.INVALID_FOR_TRACK_PAVING.tag); + boolean shouldPave = offhandItem.getItem() instanceof BlockItem && !AllItemTags.INVALID_FOR_TRACK_PAVING.matches(offhandItem); if (shouldPave) { BlockItem paveItem = (BlockItem) offhandItem.getItem(); paveTracks(level, info, paveItem, true); diff --git a/src/main/java/com/simibubi/create/foundation/utility/TreeCutter.java b/src/main/java/com/simibubi/create/foundation/utility/TreeCutter.java index e77750e380..768facf68b 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/TreeCutter.java +++ b/src/main/java/com/simibubi/create/foundation/utility/TreeCutter.java @@ -62,8 +62,8 @@ public class TreeCutter { /** * Finds a tree at the given pos. Block at the position should be air * - * @param reader the level that will be searched for a tree - * @param pos position that the saw cut at + * @param reader the level that will be searched for a tree + * @param pos position that the saw cut at * @param brokenState block state what was broken by the saw */ @Nonnull @@ -288,14 +288,14 @@ public class TreeCutter { } private static void forNeighbours(BlockPos pos, Set visited, SearchDirection direction, - Consumer acceptor) { + Consumer acceptor) { BlockPos.betweenClosedStream(pos.offset(-1, direction.minY, -1), pos.offset(1, direction.maxY, 1)) .filter(((Predicate) visited::contains).negate()) .forEach(acceptor); } public static boolean isRoot(BlockState state) { - return state.is(AllBlockTags.ROOTS.tag); + return AllBlockTags.ROOTS.matches(state); } public static boolean isLog(BlockState state) { @@ -333,7 +333,7 @@ public class TreeCutter { @Override public void destroyBlocks(Level world, ItemStack toDamage, @Nullable Player playerEntity, - BiConsumer drop) { + BiConsumer drop) { attachments.forEach(makeCallbackFor(world, 1 / 32f, toDamage, playerEntity, drop)); logs.forEach(makeCallbackFor(world, 1 / 2f, toDamage, playerEntity, drop)); leaves.forEach(makeCallbackFor(world, 1 / 8f, toDamage, playerEntity, drop)); From 3fcb86965ed285eb17f99314d73f96681b53ff17 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Thu, 20 Feb 2025 08:38:03 -0500 Subject: [PATCH 4/4] Remove un-needed semi-colon --- .../create/api/behaviour/display/DisplaySource.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/com/simibubi/create/api/behaviour/display/DisplaySource.java b/src/main/java/com/simibubi/create/api/behaviour/display/DisplaySource.java index d950063d09..c1b6181ffb 100644 --- a/src/main/java/com/simibubi/create/api/behaviour/display/DisplaySource.java +++ b/src/main/java/com/simibubi/create/api/behaviour/display/DisplaySource.java @@ -70,19 +70,13 @@ public abstract class DisplaySource { public void onSignalReset(DisplayLinkContext context) { } - ; - public void populateData(DisplayLinkContext context) { } - ; - public int getPassiveRefreshTicks() { return 100; } - ; - public boolean shouldPassiveReset() { return true; }