添加载具拾取物品配置
This commit is contained in:
parent
08af375dc8
commit
45e99ab220
2 changed files with 6 additions and 0 deletions
|
@ -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<List<? extends String>> 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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue