Misc fixes

This commit is contained in:
IThundxr 2025-02-20 07:15:20 -05:00
parent 19f31e33d2
commit be60c6ce5a
Failed to generate hash of commit
6 changed files with 13 additions and 12 deletions

View file

@ -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) - 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. - 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. 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 - Removed LangMerger and related classes
- Implemented an api to allow mods to register schematic requirements, partial safe nbt and contraption transforms - Implemented an api to allow mods to register schematic requirements, partial safe nbt and contraption transforms
without implementing interfaces (#4702) without implementing interfaces (#4702)

View file

@ -4,7 +4,7 @@ import javax.annotation.Nullable;
import org.apache.commons.lang3.mutable.MutableBoolean; 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.MovementBehaviour;
import com.simibubi.create.content.contraptions.behaviour.MovementContext; import com.simibubi.create.content.contraptions.behaviour.MovementContext;
import com.simibubi.create.content.contraptions.render.ActorVisual; import com.simibubi.create.content.contraptions.render.ActorVisual;
@ -172,7 +172,7 @@ public class HarvesterMovementBehaviour implements MovementBehaviour {
if (block == Blocks.SWEET_BERRY_BUSH) { if (block == Blocks.SWEET_BERRY_BUSH) {
return state.setValue(BlockStateProperties.AGE_3, Integer.valueOf(1)); 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() if (state.getFluidState()
.isEmpty()) .isEmpty())
return Blocks.AIR.defaultBlockState(); return Blocks.AIR.defaultBlockState();

View file

@ -130,7 +130,7 @@ public abstract class BlockBreakingKineticBlockEntity extends KineticBlockEntity
} }
public static boolean isBreakable(BlockState stateToBreak, float blockHardness) { 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) { public void onBlockBroken(BlockState stateToBreak) {

View file

@ -86,10 +86,9 @@ public class TableClothBlockEntity extends SmartBlockEntity {
public void lazyTick() { public void lazyTick() {
super.lazyTick(); super.lazyTick();
BlockPos relativePos = worldPosition.relative(facing); BlockPos relativePos = worldPosition.relative(facing);
sideOccluded = level.getBlockState(relativePos) sideOccluded = AllBlockTags.TABLE_CLOTHS.matches(level.getBlockState(relativePos))
.is(AllBlockTags.TABLE_CLOTHS.tag)
|| Block.isFaceFull(level.getBlockState(relativePos.below()) || Block.isFaceFull(level.getBlockState(relativePos.below())
.getOcclusionShape(level, relativePos.below()), facing.getOpposite()); .getOcclusionShape(level, relativePos.below()), facing.getOpposite());
} }
@Override @Override

View file

@ -8,6 +8,7 @@ import java.util.Set;
import com.simibubi.create.AllSpecialTextures; import com.simibubi.create.AllSpecialTextures;
import com.simibubi.create.AllTags; import com.simibubi.create.AllTags;
import com.simibubi.create.AllTags.AllItemTags;
import com.simibubi.create.content.equipment.blueprint.BlueprintOverlayRenderer; import com.simibubi.create.content.equipment.blueprint.BlueprintOverlayRenderer;
import com.simibubi.create.foundation.block.ProperWaterloggedBlock; import com.simibubi.create.foundation.block.ProperWaterloggedBlock;
import com.simibubi.create.foundation.utility.BlockHelper; import com.simibubi.create.foundation.utility.BlockHelper;
@ -375,7 +376,7 @@ public class TrackPlacement {
ItemStack offhandItem = player.getOffhandItem() ItemStack offhandItem = player.getOffhandItem()
.copy(); .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) { if (shouldPave) {
BlockItem paveItem = (BlockItem) offhandItem.getItem(); BlockItem paveItem = (BlockItem) offhandItem.getItem();
paveTracks(level, info, paveItem, true); paveTracks(level, info, paveItem, true);

View file

@ -62,8 +62,8 @@ public class TreeCutter {
/** /**
* Finds a tree at the given pos. Block at the position should be air * 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 reader the level that will be searched for a tree
* @param pos position that the saw cut at * @param pos position that the saw cut at
* @param brokenState block state what was broken by the saw * @param brokenState block state what was broken by the saw
*/ */
@Nonnull @Nonnull
@ -288,14 +288,14 @@ public class TreeCutter {
} }
private static void forNeighbours(BlockPos pos, Set<BlockPos> visited, SearchDirection direction, private static void forNeighbours(BlockPos pos, Set<BlockPos> visited, SearchDirection direction,
Consumer<BlockPos> acceptor) { Consumer<BlockPos> acceptor) {
BlockPos.betweenClosedStream(pos.offset(-1, direction.minY, -1), pos.offset(1, direction.maxY, 1)) BlockPos.betweenClosedStream(pos.offset(-1, direction.minY, -1), pos.offset(1, direction.maxY, 1))
.filter(((Predicate<BlockPos>) visited::contains).negate()) .filter(((Predicate<BlockPos>) visited::contains).negate())
.forEach(acceptor); .forEach(acceptor);
} }
public static boolean isRoot(BlockState state) { public static boolean isRoot(BlockState state) {
return state.is(AllBlockTags.ROOTS.tag); return AllBlockTags.ROOTS.matches(state);
} }
public static boolean isLog(BlockState state) { public static boolean isLog(BlockState state) {
@ -333,7 +333,7 @@ public class TreeCutter {
@Override @Override
public void destroyBlocks(Level world, ItemStack toDamage, @Nullable Player playerEntity, public void destroyBlocks(Level world, ItemStack toDamage, @Nullable Player playerEntity,
BiConsumer<BlockPos, ItemStack> drop) { BiConsumer<BlockPos, ItemStack> drop) {
attachments.forEach(makeCallbackFor(world, 1 / 32f, toDamage, playerEntity, drop)); attachments.forEach(makeCallbackFor(world, 1 / 32f, toDamage, playerEntity, drop));
logs.forEach(makeCallbackFor(world, 1 / 2f, toDamage, playerEntity, drop)); logs.forEach(makeCallbackFor(world, 1 / 2f, toDamage, playerEntity, drop));
leaves.forEach(makeCallbackFor(world, 1 / 8f, toDamage, playerEntity, drop)); leaves.forEach(makeCallbackFor(world, 1 / 8f, toDamage, playerEntity, drop));