diff --git a/src/main/java/net/minecraft/command/CommandKill.java b/src/main/java/net/minecraft/command/CommandKill.java index 88ecb68..32df6d2 100644 --- a/src/main/java/net/minecraft/command/CommandKill.java +++ b/src/main/java/net/minecraft/command/CommandKill.java @@ -26,7 +26,7 @@ public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { EntityPlayerMP entityplayermp = getCommandSenderAsPlayer(p_71515_1_); - entityplayermp.attackEntityFrom(DamageSource.outOfWorld, Float.MAX_VALUE); + entityplayermp.attackEntityFrom(DamageSource.command, Float.MAX_VALUE); p_71515_1_.addChatMessage(new ChatComponentTranslation("commands.kill.success", new Object[0])); } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java b/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java index 2072bfb..e0a3d8f 100644 --- a/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java +++ b/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java @@ -355,9 +355,11 @@ public void onDeath(DamageSource p_70645_1_) { if (ForgeHooks.onLivingDeath(this, p_70645_1_)) return; - this.mcServer.getConfigurationManager().sendChatMsg(this.func_110142_aN().func_151521_b()); + if(p_70645_1_ != DamageSource.command) + this.mcServer.getConfigurationManager().sendChatMsg(this.func_110142_aN().func_151521_b()); - if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) + if (p_70645_1_ != DamageSource.outOfWorld && !this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory") && + !PermissionHandler.getInstance().has(this, "ability.admin.keepinventory")) { captureDrops = true; capturedDrops.clear(); diff --git a/src/main/java/net/minecraft/util/DamageSource.java b/src/main/java/net/minecraft/util/DamageSource.java index b2cf64b..6aa2a77 100644 --- a/src/main/java/net/minecraft/util/DamageSource.java +++ b/src/main/java/net/minecraft/util/DamageSource.java @@ -23,6 +23,7 @@ public static DamageSource wither = (new DamageSource("wither")).setDamageBypassesArmor(); public static DamageSource anvil = new DamageSource("anvil"); public static DamageSource fallingBlock = new DamageSource("fallingBlock"); + public static DamageSource command = new DamageSource("command").setDamageBypassesArmor().setDamageAllowedInCreativeMode(); private boolean isUnblockable; private boolean isDamageAllowedInCreativeMode; private boolean damageIsAbsolute;