mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-17 23:01:01 +01:00
2f95e1a840
Fix empty `ench` tags being wiped by the meta system SpigotMC/Spigot@cc9a1a417f Add Hunger Config Values SpigotMC/Spigot@2cd515e224 Make debug logging togglable SpigotMC/Spigot@d31b1d616f Spigot has implemented a system of hunger exhaustion similar to ours, as such a lot of config values have been moved there. Our exhaustion patch has been trimmed and only a few values for exhaustion remain in paper.yml, the others now sit in spigot.yml
73 lines
No EOL
4.2 KiB
Diff
73 lines
No EOL
4.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: md_5 <git@md-5.net>
|
|
Date: Mon, 28 Jul 2014 16:55:51 +1000
|
|
Subject: [PATCH] Allow Attribute Capping.
|
|
|
|
Apply some sensible defaults and allow server owners to customize the maximum values of selected common attributes.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/AttributeRanged.java b/src/main/java/net/minecraft/server/AttributeRanged.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/AttributeRanged.java
|
|
+++ b/src/main/java/net/minecraft/server/AttributeRanged.java
|
|
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
|
public class AttributeRanged extends AttributeBase {
|
|
|
|
private final double a;
|
|
- private final double b;
|
|
+ public double b; // Spigot
|
|
private String c;
|
|
|
|
public AttributeRanged(String s, double d0, double d1, double d2) {
|
|
diff --git a/src/main/java/net/minecraft/server/GenericAttributes.java b/src/main/java/net/minecraft/server/GenericAttributes.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/GenericAttributes.java
|
|
+++ b/src/main/java/net/minecraft/server/GenericAttributes.java
|
|
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
|
public class GenericAttributes {
|
|
|
|
private static final Logger f = LogManager.getLogger();
|
|
- public static final IAttribute maxHealth = (new AttributeRanged("generic.maxHealth", 20.0D, 0.0D, Double.MAX_VALUE)).a("Max Health").a(true);
|
|
+ // Spigot Start
|
|
+ public static final IAttribute maxHealth = (new AttributeRanged("generic.maxHealth", 20.0D, 0.1D, org.spigotmc.SpigotConfig.maxHealth)).a("Max Health").a(true); // Spigot
|
|
public static final IAttribute b = (new AttributeRanged("generic.followRange", 32.0D, 0.0D, 2048.0D)).a("Follow Range");
|
|
public static final IAttribute c = (new AttributeRanged("generic.knockbackResistance", 0.0D, 0.0D, 1.0D)).a("Knockback Resistance");
|
|
- public static final IAttribute d = (new AttributeRanged("generic.movementSpeed", 0.699999988079071D, 0.0D, Double.MAX_VALUE)).a("Movement Speed").a(true);
|
|
- public static final IAttribute e = new AttributeRanged("generic.attackDamage", 2.0D, 0.0D, Double.MAX_VALUE);
|
|
+ public static final IAttribute d = (new AttributeRanged("generic.movementSpeed", 0.699999988079071D, 0.0D, org.spigotmc.SpigotConfig.movementSpeed)).a("Movement Speed").a(true);
|
|
+ public static final IAttribute e = new AttributeRanged("generic.attackDamage", 2.0D, 0.0D, org.spigotmc.SpigotConfig.attackDamage);
|
|
+ // Spigot End
|
|
|
|
public static NBTTagList a(AttributeMapBase attributemapbase) {
|
|
NBTTagList nbttaglist = new NBTTagList();
|
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
|
@@ -0,0 +0,0 @@ import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import java.util.logging.Level;
|
|
+import net.minecraft.server.AttributeRanged;
|
|
+import net.minecraft.server.GenericAttributes;
|
|
import net.minecraft.util.gnu.trove.map.hash.TObjectIntHashMap;
|
|
import net.minecraft.server.MinecraftServer;
|
|
import org.bukkit.Bukkit;
|
|
@@ -0,0 +0,0 @@ public class SpigotConfig
|
|
{
|
|
movedTooQuicklyThreshold = getDouble( "settings.moved-too-quickly-threshold", 100.0D );
|
|
}
|
|
+
|
|
+ public static double maxHealth = 2048;
|
|
+ public static double movementSpeed = 2048;
|
|
+ public static double attackDamage = 2048;
|
|
+ private static void attributeMaxes()
|
|
+ {
|
|
+ maxHealth = getDouble( "settings.attribute.maxHealth.max", maxHealth );
|
|
+ ( (AttributeRanged) GenericAttributes.maxHealth ).b = maxHealth;
|
|
+ movementSpeed = getDouble( "settings.attribute.movementSpeed.max", movementSpeed );
|
|
+ ( (AttributeRanged) GenericAttributes.d ).b = movementSpeed;
|
|
+ attackDamage = getDouble( "settings.attribute.attackDamage.max", attackDamage );
|
|
+ ( (AttributeRanged) GenericAttributes.e ).b = attackDamage;
|
|
+ }
|
|
}
|
|
--
|