mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: b79bc31 Fix MerchantOffer BuyB Only AssertionError (#6206) d6c81c8 Don't apply cramming damage to players (#5903) 12942dc Add rate options and timings for sensors and behaviors (#6027) fc47872 Use mapped names for sensor and behavior timings/config (#6228) c75a837 Don't expose ASM in API (#6229) c225bf9 Fix book title and author being improperly serialized as components (#6190) f25facb Update email & name (DenWav) 44516b1 [ci skip] Put mappings util in a separate class to the stacktrace deobfuscator
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Fourmisain <8464472+Fourmisain@users.noreply.github.com>
|
||||
Date: Fri, 5 Mar 2021 17:42:35 -0500
|
||||
Subject: [PATCH] One Punch Man!
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 11abf0df677a9d609d82cbcb8e3967fc4b613362..59e4e240420a11b19b6da199092590ebe9096383 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -2123,6 +2123,20 @@ public abstract class LivingEntity extends Entity {
|
||||
((ServerPlayer) damagesource.getEntity()).awardStat(Stats.DAMAGE_DEALT_ABSORBED, Math.round(f2 * 10.0F));
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (damagesource.getEntity() instanceof net.minecraft.world.entity.player.Player player && damagesource.getEntity().level.purpurConfig.creativeOnePunch) {
|
||||
+ if (player.isCreative()) {
|
||||
+ double attackDamage = 0;
|
||||
+ for (AttributeModifier modifier : player.getMainHandItem().getAttributeModifiers(EquipmentSlot.MAINHAND).get(Attributes.ATTACK_DAMAGE)) {
|
||||
+ attackDamage += modifier.getAmount();
|
||||
+ }
|
||||
+ if (attackDamage == 0) {
|
||||
+ this.setHealth(0);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
if (f > 0 || !human) {
|
||||
if (human) {
|
||||
// PAIL: Be sure to drag all this code from the EntityHuman subclass each update.
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index e26f95fcc3fd1300af9a9101bf127d2418a4cb31..0c86785e1cb7b323f3ca9542662acc43fd85c994 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -301,6 +301,7 @@ public class PurpurWorldConfig {
|
||||
public boolean teleportIfOutsideBorder = false;
|
||||
public boolean totemOfUndyingWorksInInventory = false;
|
||||
public boolean playerFixStuckPortal = false;
|
||||
+ public boolean creativeOnePunch = false;
|
||||
private void playerSettings() {
|
||||
idleTimeoutKick = getBoolean("gameplay-mechanics.player.idle-timeout.kick-if-idle", idleTimeoutKick);
|
||||
idleTimeoutTickNearbyEntities = getBoolean("gameplay-mechanics.player.idle-timeout.tick-nearby-entities", idleTimeoutTickNearbyEntities);
|
||||
@@ -314,6 +315,7 @@ public class PurpurWorldConfig {
|
||||
teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder);
|
||||
totemOfUndyingWorksInInventory = getBoolean("gameplay-mechanics.player.totem-of-undying-works-in-inventory", totemOfUndyingWorksInInventory);
|
||||
playerFixStuckPortal = getBoolean("gameplay-mechanics.player.fix-stuck-in-portal", playerFixStuckPortal);
|
||||
+ creativeOnePunch = getBoolean("gameplay-mechanics.player.one-punch-in-creative", creativeOnePunch);
|
||||
}
|
||||
|
||||
public int snowballDamage = -1;
|
||||
Reference in New Issue
Block a user