Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 04:20:08 +01:00
SPIGOT-2824: Llama Strength API
Dieser Commit ist enthalten in:
Ursprung
b5b0a97d44
Commit
7691c87df6
20
nms-patches/EntityLlama.patch
Normale Datei
20
nms-patches/EntityLlama.patch
Normale Datei
@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/server/EntityLlama.java
|
||||
+++ b/net/minecraft/server/EntityLlama.java
|
||||
@@ -20,7 +20,7 @@
|
||||
this.setSize(0.9F, 1.87F);
|
||||
}
|
||||
|
||||
- private void p(int i) {
|
||||
+ public void p(int i) { // PAIL: private-> public, rename
|
||||
this.datawatcher.set(EntityLlama.bG, Integer.valueOf(Math.max(1, Math.min(5, i))));
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
this.p(1 + this.random.nextInt(i));
|
||||
}
|
||||
|
||||
- public int dL() {
|
||||
+ public int dL() { // PAIL: rename
|
||||
return ((Integer) this.datawatcher.get(EntityLlama.bG)).intValue();
|
||||
}
|
||||
|
@ -37,6 +37,19 @@ public class CraftLlama extends CraftChestedHorse implements Llama {
|
||||
return new CraftInventoryLlama(getHandle().inventoryChest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStrength() {
|
||||
return getHandle().dL();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStrength(int strength) {
|
||||
Preconditions.checkArgument(1 <= strength && strength <= 5, "strength must be [1,5]");
|
||||
if (strength == getStrength()) return;
|
||||
getHandle().p(strength);
|
||||
getHandle().dx();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Horse.Variant getVariant() {
|
||||
return Horse.Variant.LLAMA;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren