Don't drop experience capsules when keepInventory is enabled
This commit is contained in:
parent
df5c8dc6aa
commit
9a5614de65
@ -3,6 +3,7 @@ package ru.dbotthepony.mc.otm.mixin;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.neoforged.neoforge.event.EventHooks;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@ -28,7 +29,7 @@ public class MixinLivingEntity {
|
||||
at = @At("HEAD"),
|
||||
cancellable = true)
|
||||
public void dropExperience(@Nullable Entity killer, CallbackInfo hook) {
|
||||
if (((Object) this) instanceof Player player && ServerConfig.INSTANCE.getDROP_EXPERIENCE_CAPSULES()) {
|
||||
if (((Object) this) instanceof Player player && ServerConfig.INSTANCE.getDROP_EXPERIENCE_CAPSULES() && !player.level().getGameRules().getBoolean(GameRules.RULE_KEEPINVENTORY)) {
|
||||
hook.cancel();
|
||||
|
||||
var android = ((IMatteryPlayer) player).getOtmPlayer();
|
||||
|
Loading…
Reference in New Issue
Block a user