diff options
author | Senmori <thesenmori@gmail.com> | 2018-08-12 18:39:51 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-08-12 18:40:03 +1000 |
commit | c0df4b82d380bea4fd66cc887a1476468e2301c4 (patch) | |
tree | 0fa0d8db07d29c0f1c53bb9a70568eb42e9a9c7d /nms-patches/LootTableInfo.patch | |
parent | 15da7067067a0786d221f2ad3cd060acd4dd3431 (diff) | |
download | craftbukkit-c0df4b82d380bea4fd66cc887a1476468e2301c4.tar craftbukkit-c0df4b82d380bea4fd66cc887a1476468e2301c4.tar.gz craftbukkit-c0df4b82d380bea4fd66cc887a1476468e2301c4.tar.lz craftbukkit-c0df4b82d380bea4fd66cc887a1476468e2301c4.tar.xz craftbukkit-c0df4b82d380bea4fd66cc887a1476468e2301c4.zip |
SPIGOT-1936: LootTable API
Diffstat (limited to 'nms-patches/LootTableInfo.patch')
-rw-r--r-- | nms-patches/LootTableInfo.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/nms-patches/LootTableInfo.patch b/nms-patches/LootTableInfo.patch new file mode 100644 index 00000000..21221c0c --- /dev/null +++ b/nms-patches/LootTableInfo.patch @@ -0,0 +1,67 @@ +--- a/net/minecraft/server/LootTableInfo.java ++++ b/net/minecraft/server/LootTableInfo.java +@@ -11,6 +11,7 @@ + public class LootTableInfo { + + private final float a; ++ public final int lootingMod; // CraftBukkit - add field + private final WorldServer b; + private final LootTableRegistry c; + @Nullable +@@ -23,7 +24,8 @@ + private final BlockPosition g; + private final Set<LootTable> h = Sets.newLinkedHashSet(); + +- public LootTableInfo(float f, WorldServer worldserver, LootTableRegistry loottableregistry, @Nullable Entity entity, @Nullable EntityHuman entityhuman, @Nullable DamageSource damagesource, @Nullable BlockPosition blockposition) { ++ // CraftBukkit - add looting modifier to constructor ++ public LootTableInfo(float f, WorldServer worldserver, LootTableRegistry loottableregistry, @Nullable Entity entity, @Nullable EntityHuman entityhuman, @Nullable DamageSource damagesource, @Nullable BlockPosition blockposition, int lootingModifier) { + this.a = f; + this.b = worldserver; + this.c = loottableregistry; +@@ -31,6 +33,7 @@ + this.e = entityhuman; + this.f = damagesource; + this.g = blockposition; ++ this.lootingMod = lootingModifier; // CraftBukkit + } + + @Nullable +@@ -127,11 +130,11 @@ + return LootTableInfo.EntityTarget.a(jsonreader.nextString()); + } + +- public Object read(JsonReader jsonreader) throws IOException { ++ public LootTableInfo.EntityTarget read(JsonReader jsonreader) throws IOException { // CraftBukkit - decompile error + return this.a(jsonreader); + } + +- public void write(JsonWriter jsonwriter, Object object) throws IOException { ++ public void write(JsonWriter jsonwriter, LootTableInfo.EntityTarget object) throws IOException { // CraftBukkit - decompile error + this.a(jsonwriter, (LootTableInfo.EntityTarget) object); + } + } +@@ -141,6 +144,7 @@ + + private final WorldServer a; + private float b; ++ private int lootingMod; // CraftBukkit + private Entity c; + private EntityHuman d; + private DamageSource e; +@@ -175,8 +179,15 @@ + return this; + } + ++ // CraftBukkit start - add looting modifier ++ public LootTableInfo.a lootingModifier(int modifier) { ++ this.lootingMod = modifier; ++ return this; ++ } ++ // CraftBukkit end ++ + public LootTableInfo a() { +- return new LootTableInfo(this.b, this.a, this.a.getMinecraftServer().aP(), this.c, this.d, this.e, this.f); ++ return new LootTableInfo(this.b, this.a, this.a.getMinecraftServer().aP(), this.c, this.d, this.e, this.f, this.lootingMod); // CraftBukkit add looting modifier + } + } + } |