diff --git a/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java b/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java index c549a775e..8425359c6 100644 --- a/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java +++ b/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java @@ -8,6 +8,7 @@ public class VehicleConfig { public static ForgeConfigSpec.BooleanValue COLLISION_DESTROY_BLOCKS; public static ForgeConfigSpec.BooleanValue COLLISION_DESTROY_HARD_BLOCKS; + public static ForgeConfigSpec.BooleanValue VEHICLE_ITEM_PICKUP; public static ForgeConfigSpec.ConfigValue> COLLISION_ENTITY_BLACKLIST; @@ -81,6 +82,9 @@ public class VehicleConfig { builder.comment("Allows vehicles to destroy hard blocks via collision"); COLLISION_DESTROY_HARD_BLOCKS = builder.define("collision_destroy_hard_blocks", false); + builder.comment("Allow vehicles to pick up items"); + VEHICLE_ITEM_PICKUP = builder.define("vehicle_item_pickup", true); + builder.comment("List of entities that cannot be damaged by collision"); COLLISION_ENTITY_BLACKLIST = builder.defineList("collision_entity_blacklist", DEFAULT_COLLISION_ENTITY_BLACKLIST, diff --git a/src/main/java/com/atsuishio/superbwarfare/event/LivingEventHandler.java b/src/main/java/com/atsuishio/superbwarfare/event/LivingEventHandler.java index 86824ac07..171b105a7 100644 --- a/src/main/java/com/atsuishio/superbwarfare/event/LivingEventHandler.java +++ b/src/main/java/com/atsuishio/superbwarfare/event/LivingEventHandler.java @@ -4,6 +4,7 @@ import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.capability.LaserCapability; import com.atsuishio.superbwarfare.capability.ModCapabilities; import com.atsuishio.superbwarfare.config.common.GameplayConfig; +import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.entity.ICustomKnockback; import com.atsuishio.superbwarfare.entity.TargetEntity; import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity; @@ -743,6 +744,7 @@ public class LivingEventHandler { @SubscribeEvent public static void onPickup(EntityItemPickupEvent event) { + if (!VehicleConfig.VEHICLE_ITEM_PICKUP.get()) return; if (event.getEntity().getVehicle() instanceof ContainerMobileVehicleEntity containerMobileVehicleEntity) { var pickUp = event.getItem(); if (!containerMobileVehicleEntity.level().isClientSide) {