diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 73fbff319..efbe37479 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -49,6 +49,7 @@ body: label: Mod Version description: The version of the mod you were using when the bug occured options: + - "0.5.0j" - "0.5.0i" - "0.5.0h" - "0.5.0g" diff --git a/src/main/java/com/simibubi/create/compat/curios/Curios.java b/src/main/java/com/simibubi/create/compat/curios/Curios.java index a595bb150..1b85d2f26 100644 --- a/src/main/java/com/simibubi/create/compat/curios/Curios.java +++ b/src/main/java/com/simibubi/create/compat/curios/Curios.java @@ -25,10 +25,13 @@ public class Curios { .get("head"); if (stacksHandler == null) return false; - if (stacksHandler.getSlots() == 0) - return false; - return AllItems.GOGGLES.isIn(stacksHandler.getStacks() - .getStackInSlot(0)); + int slots = stacksHandler.getSlots(); + for (int slot = 0; slot < slots; slot++) + if (AllItems.GOGGLES.isIn(stacksHandler.getStacks() + .getStackInSlot(slot))) + return true; + + return false; }) .orElse(false)); diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/GeneratingKineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/base/GeneratingKineticTileEntity.java index d9dfcb467..4236d8ae0 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/GeneratingKineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/GeneratingKineticTileEntity.java @@ -92,7 +92,7 @@ public abstract class GeneratingKineticTileEntity extends KineticTileEntity { float speed = getGeneratedSpeed(); float prevSpeed = this.speed; - if (level.isClientSide) + if (level == null || level.isClientSide) return; if (prevSpeed != speed) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MinecartContraptionItem.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MinecartContraptionItem.java index 3dd2ff7c1..89940f826 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MinecartContraptionItem.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MinecartContraptionItem.java @@ -67,6 +67,11 @@ public class MinecartContraptionItem extends Item { public static MinecartContraptionItem chest(Properties builder) { return new MinecartContraptionItem(Type.CHEST, builder); } + + @Override + public boolean canFitInsideContainerItems() { + return AllConfigs.SERVER.kinetics.minecartContraptionInContainers.get(); + } private MinecartContraptionItem(Type minecartTypeIn, Properties builder) { super(builder); diff --git a/src/main/java/com/simibubi/create/content/curiosities/ExperienceNuggetItem.java b/src/main/java/com/simibubi/create/content/curiosities/ExperienceNuggetItem.java index 53b91160e..4407cbd7b 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/ExperienceNuggetItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/ExperienceNuggetItem.java @@ -35,8 +35,9 @@ public class ExperienceNuggetItem extends Item { return InteractionResultHolder.consume(itemInHand); } - int total = Mth.ceil(3f * itemInHand.getCount()); - int maxOrbs = 5; + int amountUsed = pPlayer.isSteppingCarefully() ? 1 : itemInHand.getCount(); + int total = Mth.ceil(3f * amountUsed); + int maxOrbs = amountUsed == 1 ? 1 : 5; int valuePer = Math.max(1, 1 + total / maxOrbs); for (int i = 0; i < maxOrbs; i++) { @@ -61,6 +62,10 @@ public class ExperienceNuggetItem extends Item { pLevel.addFreshEntity(xp); } + itemInHand.shrink(amountUsed); + if (!itemInHand.isEmpty()) + return InteractionResultHolder.success(itemInHand); + pPlayer.setItemInHand(pUsedHand, ItemStack.EMPTY); return InteractionResultHolder.consume(itemInHand); } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/BeltFunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/BeltFunnelBlock.java index fcaafeae9..37d2bf5b7 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/BeltFunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/BeltFunnelBlock.java @@ -71,6 +71,17 @@ public class BeltFunnelBlock extends AbstractHorizontalFunnelBlock implements IS super.createBlockStateDefinition(p_206840_1_.add(SHAPE)); } + public boolean isOfSameType(FunnelBlock otherFunnel) { + return parent.get() == otherFunnel; + } + + @Override + public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean isMoving) { + if (newState.getBlock() instanceof FunnelBlock fb && isOfSameType(fb)) + return; + super.onRemove(state, world, pos, newState, isMoving); + } + @Override public VoxelShape getShape(BlockState state, BlockGetter p_220053_2_, BlockPos p_220053_3_, CollisionContext p_220053_4_) { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/BrassFunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/BrassFunnelBlock.java index 18a5fa81a..969f141dd 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/BrassFunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/BrassFunnelBlock.java @@ -12,7 +12,7 @@ public class BrassFunnelBlock extends FunnelBlock { public BrassFunnelBlock(Properties p_i48415_1_) { super(p_i48415_1_); } - + @Override public BlockState getEquivalentBeltFunnel(BlockGetter world, BlockPos pos, BlockState state) { Direction facing = getFacing(state); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java index 930da5e2d..9c7fe7430 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java @@ -64,6 +64,13 @@ public abstract class FunnelBlock extends AbstractDirectionalFunnelBlock { super.createBlockStateDefinition(builder.add(EXTRACTING)); } + @Override + public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean isMoving) { + if (newState.getBlock() instanceof BeltFunnelBlock bfb && bfb.isOfSameType(this)) + return; + super.onRemove(state, world, pos, newState, isMoving); + } + @Override public void setPlacedBy(Level pLevel, BlockPos pPos, BlockState pState, LivingEntity pPlacer, ItemStack pStack) { super.setPlacedBy(pLevel, pPos, pState, pPlacer, pStack); diff --git a/src/main/java/com/simibubi/create/foundation/config/CKinetics.java b/src/main/java/com/simibubi/create/foundation/config/CKinetics.java index d473b2777..2a81897f6 100644 --- a/src/main/java/com/simibubi/create/foundation/config/CKinetics.java +++ b/src/main/java/com/simibubi/create/foundation/config/CKinetics.java @@ -47,6 +47,8 @@ public class CKinetics extends ConfigBase { public final ConfigBool moveItemsToStorage = b(true, "moveItemsToStorage", Comments.moveItemsToStorage); public final ConfigBool harvestPartiallyGrown = b(false, "harvestPartiallyGrown", Comments.harvestPartiallyGrown); public final ConfigBool harvesterReplants = b(true, "harvesterReplants", Comments.harvesterReplants); + public final ConfigBool minecartContraptionInContainers = + b(false, "minecartContraptionInContainers", Comments.minecartContraptionInContainers); public final CStress stressValues = nested(1, CStress::new, Comments.stress); @@ -117,6 +119,7 @@ public class CKinetics extends ConfigBase { static String spawnerMovement = "Configure how Spawner blocks can be moved by contraptions."; static String amethystMovement = "Configure how Budding Amethyst can be moved by contraptions."; static String obsidianMovement = "Configure how Obsidian blocks can be moved by contraptions."; + static String minecartContraptionInContainers = "Whether minecart contraptions can be placed into container items."; } public enum DeployerAggroSetting {