mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Disable loot drops on death by cramming
This commit is contained in:
committed by
granny
parent
a631cb7756
commit
188c30fff8
@@ -1,42 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
||||||
Date: Wed, 3 Jul 2019 23:58:31 -0500
|
|
||||||
Subject: [PATCH] Disable loot drops on death by cramming
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
|
||||||
index 6884475a5217acb8073dc38e5f7a7b341c8b1dd1..34f2c17831c6edd16b6dc32f3d344b3c209244fc 100644
|
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
|
||||||
@@ -1925,6 +1925,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
||||||
|
|
||||||
this.dropEquipment(world); // CraftBukkit - from below
|
|
||||||
if (this.shouldDropLoot() && world.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
|
||||||
+ if (!(damageSource.is(net.minecraft.world.damagesource.DamageTypes.CRAMMING) && level().purpurConfig.disableDropsOnCrammingDeath)) { // Purpur
|
|
||||||
this.dropFromLootTable(world, damageSource, flag);
|
|
||||||
// Paper start
|
|
||||||
final boolean prev = this.clearEquipmentSlots;
|
|
||||||
@@ -1933,6 +1934,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
||||||
// Paper end
|
|
||||||
this.dropCustomDeathLoot(world, damageSource, flag);
|
|
||||||
this.clearEquipmentSlots = prev; // Paper
|
|
||||||
+ } // Purpur
|
|
||||||
}
|
|
||||||
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
|
|
||||||
org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, damageSource, this.drops, () -> {
|
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
index 21e3931d64d32e69b8ba6f7e6d1a9bf044c7c9a8..983523dfff2773799640347ff047e600fb25044e 100644
|
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -96,6 +96,11 @@ public class PurpurWorldConfig {
|
|
||||||
armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public boolean disableDropsOnCrammingDeath = false;
|
|
||||||
+ private void miscGameplayMechanicsSettings() {
|
|
||||||
+ disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public double minecartMaxSpeed = 0.4D;
|
|
||||||
public boolean minecartPlaceAnywhere = false;
|
|
||||||
public boolean minecartControllable = false;
|
|
||||||
@@ -177,7 +177,7 @@ index efee812785240c1ab1fd47514cfb236a3548f9cf..666455fff2b391b637cf1c07091e8810
|
|||||||
protected ParticleOptions getInkParticle() {
|
protected ParticleOptions getInkParticle() {
|
||||||
return ParticleTypes.GLOW_SQUID_INK;
|
return ParticleTypes.GLOW_SQUID_INK;
|
||||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 195e1151f7b2a32d6c4eb67edd1952e38f58b266..67c99e33642964a1756d48e029e00f2676f07fbb 100644
|
index affdbc8b60ad9ec34e1065dcbe00fd449979177b..b8f38aefd15fda2ff4326c0ea1a06af4189edc60 100644
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -250,9 +250,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -250,9 +250,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
@@ -210,7 +210,7 @@ index 195e1151f7b2a32d6c4eb67edd1952e38f58b266..67c99e33642964a1756d48e029e00f26
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void checkFallDamage(double y, boolean onGround, BlockState state, BlockPos pos) {
|
protected void checkFallDamage(double y, boolean onGround, BlockState state, BlockPos pos) {
|
||||||
@@ -3477,8 +3478,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -3479,8 +3480,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
this.pushEntities();
|
this.pushEntities();
|
||||||
profilerFiller.pop();
|
profilerFiller.pop();
|
||||||
// Paper start - Add EntityMoveEvent
|
// Paper start - Add EntityMoveEvent
|
||||||
@@ -223,7 +223,7 @@ index 195e1151f7b2a32d6c4eb67edd1952e38f58b266..67c99e33642964a1756d48e029e00f26
|
|||||||
Location from = new Location(this.level().getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO);
|
Location from = new Location(this.level().getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO);
|
||||||
Location to = new Location(this.level().getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
|
Location to = new Location(this.level().getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
|
||||||
io.papermc.paper.event.entity.EntityMoveEvent event = new io.papermc.paper.event.entity.EntityMoveEvent(this.getBukkitLivingEntity(), from, to.clone());
|
io.papermc.paper.event.entity.EntityMoveEvent event = new io.papermc.paper.event.entity.EntityMoveEvent(this.getBukkitLivingEntity(), from, to.clone());
|
||||||
@@ -3488,6 +3491,21 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -3490,6 +3493,21 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
this.absMoveTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch());
|
this.absMoveTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2638,7 +2638,7 @@ index 31f064267514e590944ad809c95915b481e65aaa..c8bc09c3fe27e69360027698c41fd51a
|
|||||||
protected void defineSynchedData(SynchedEntityData.Builder builder) {
|
protected void defineSynchedData(SynchedEntityData.Builder builder) {
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
diff --git a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||||
index 403bcd056bf9c385599383983bf7a0cc117a1881..e2b2a091a5aa7de47cea512ed1dbb80d8b3ca202 100644
|
index ef3571155ee5757f6eaab67df0fe530408770071..ca9cca5b1eb8549e99d7a594cb96945594678dd4 100644
|
||||||
--- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
--- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||||
+++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
+++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||||
@@ -90,6 +90,7 @@ public class EnderDragon extends Mob implements Enemy {
|
@@ -90,6 +90,7 @@ public class EnderDragon extends Mob implements Enemy {
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
@@ -1788,6 +_,7 @@
|
||||||
|
boolean flag = this.lastHurtByPlayerTime > 0;
|
||||||
|
this.dropEquipment(level); // CraftBukkit - from below
|
||||||
|
if (this.shouldDropLoot() && level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
||||||
|
+ if (!(damageSource.is(net.minecraft.world.damagesource.DamageTypes.CRAMMING) && level().purpurConfig.disableDropsOnCrammingDeath)) { // Purpur - Disable loot drops on death by cramming
|
||||||
|
this.dropFromLootTable(level, damageSource, flag);
|
||||||
|
// Paper start
|
||||||
|
final boolean prev = this.clearEquipmentSlots;
|
||||||
|
@@ -1796,6 +_,7 @@
|
||||||
|
// Paper end
|
||||||
|
this.dropCustomDeathLoot(level, damageSource, flag);
|
||||||
|
this.clearEquipmentSlots = prev; // Paper
|
||||||
|
+ } // Purpur - Disable loot drops on death by cramming
|
||||||
|
}
|
||||||
|
|
||||||
|
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
|
||||||
@@ -84,6 +84,11 @@ public class PurpurWorldConfig {
|
|||||||
armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
|
armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean disableDropsOnCrammingDeath = false;
|
||||||
|
private void miscGameplayMechanicsSettings() {
|
||||||
|
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||||
|
}
|
||||||
|
|
||||||
public double minecartMaxSpeed = 0.4D;
|
public double minecartMaxSpeed = 0.4D;
|
||||||
public boolean minecartPlaceAnywhere = false;
|
public boolean minecartPlaceAnywhere = false;
|
||||||
public boolean minecartControllable = false;
|
public boolean minecartControllable = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user