1.21.5
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: MiniDigger | Martin <admin@minidigger.dev> Co-authored-by: Nassim Jahnke <nassim@njahnke.dev> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Shane Freeder <theboyetronic@gmail.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com> Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
This commit is contained in:
@@ -107,7 +107,7 @@ public class CraftLootTable implements org.bukkit.loot.LootTable {
|
||||
ServerLevel handle = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
|
||||
LootParams.Builder builder = new LootParams.Builder(handle);
|
||||
this.setMaybe(builder, LootContextParams.ORIGIN, CraftLocation.toVec3D(loc));
|
||||
this.setMaybe(builder, LootContextParams.ORIGIN, CraftLocation.toVec3(loc));
|
||||
if (this.getHandle() != LootTable.EMPTY) {
|
||||
builder.withLuck(context.getLuck());
|
||||
|
||||
@@ -128,7 +128,7 @@ public class CraftLootTable implements org.bukkit.loot.LootTable {
|
||||
}
|
||||
}
|
||||
|
||||
// SPIGOT-5603 - Avoid IllegalArgumentException in LootTableInfo#build()
|
||||
// SPIGOT-5603 - Avoid IllegalArgumentException in ContextKeySet.Builder#create
|
||||
ContextKeySet.Builder nmsBuilder = new ContextKeySet.Builder();
|
||||
for (ContextKey<?> param : this.getHandle().getParamSet().required()) {
|
||||
nmsBuilder.required(param);
|
||||
@@ -151,7 +151,7 @@ public class CraftLootTable implements org.bukkit.loot.LootTable {
|
||||
public static LootContext convertContext(net.minecraft.world.level.storage.loot.LootContext info) {
|
||||
Vec3 position = info.getOptionalParameter(LootContextParams.ORIGIN);
|
||||
if (position == null) {
|
||||
position = info.getOptionalParameter(LootContextParams.THIS_ENTITY).position(); // Every vanilla context has origin or this_entity, see LootContextParameterSets
|
||||
position = info.getOptionalParameter(LootContextParams.THIS_ENTITY).position(); // Every vanilla context has origin or this_entity, see LootContextParamSets
|
||||
}
|
||||
Location location = CraftLocation.toBukkit(position, info.getLevel().getWorld());
|
||||
LootContext.Builder contextBuilder = new LootContext.Builder(location);
|
||||
@@ -173,7 +173,7 @@ public class CraftLootTable implements org.bukkit.loot.LootTable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getKey().toString();
|
||||
return this.key.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -183,13 +183,11 @@ public class CraftLootTable implements org.bukkit.loot.LootTable {
|
||||
}
|
||||
|
||||
org.bukkit.loot.LootTable table = (org.bukkit.loot.LootTable) obj;
|
||||
return table.getKey().equals(this.getKey());
|
||||
return table.getKey().equals(this.key);
|
||||
}
|
||||
|
||||
// Paper start - satisfy equals/hashCode contract
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return java.util.Objects.hash(key);
|
||||
return this.key.hashCode();
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user