From 12065c6b0984de8821df797fcd3dfe404294a35d Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Mon, 12 Dec 2022 13:12:39 +0100 Subject: [PATCH] Stronk in Description, guard isCreative from NPE --- .../mounted/MinecartContraptionItem.java | 8 +++----- .../com/simibubi/create/foundation/config/CKinetics.java | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) 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 fe061a5fe..71123c191 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 @@ -5,8 +5,6 @@ import java.util.List; import javax.annotation.Nullable; -import com.simibubi.create.foundation.config.AllConfigs; - import org.apache.commons.lang3.tuple.MutablePair; import com.google.common.io.ByteArrayDataOutput; @@ -20,6 +18,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Con import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.OrientedContraptionEntity; import com.simibubi.create.foundation.advancement.AllAdvancements; +import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.config.ContraptionMovementSetting; import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.NBTHelper; @@ -205,11 +204,10 @@ public class MinecartContraptionItem extends Item { public static void wrenchCanBeUsedToPickUpMinecartContraptions(PlayerInteractEvent.EntityInteract event) { Entity entity = event.getTarget(); Player player = event.getPlayer(); - if (!AllConfigs.SERVER.kinetics.survivalContraptionPickup.get() && !player.isCreative()) { - return; - } if (player == null || entity == null) return; + if (!AllConfigs.SERVER.kinetics.survivalContraptionPickup.get() && !player.isCreative()) + return; ItemStack wrench = player.getItemInHand(event.getHand()); if (!AllItems.WRENCH.isIn(wrench)) 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 7bc195cf0..3e02181f1 100644 --- a/src/main/java/com/simibubi/create/foundation/config/CKinetics.java +++ b/src/main/java/com/simibubi/create/foundation/config/CKinetics.java @@ -106,7 +106,7 @@ public class CKinetics extends ConfigBase { static String maxEjectorDistance = "Max Distance in blocks a Weighted Ejector can throw"; static String ejectorScanInterval = "Time in ticks until the next item launched by an ejector scans blocks for potential collisions"; - static String survivalContraptionPickup = "Allow for minecart contartaption pickup in survival mode."; + static String survivalContraptionPickup = "Whether minecart contraptions can be picked up in survival mode."; 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.";