final patches from remapped and unmapped

keep in mind many patches in the removed folder still need to be updated
This commit is contained in:
Jason Penilla 2021-06-14 21:55:46 -07:00
parent 654d29f3a9
commit 995348f469
5 changed files with 33 additions and 32 deletions

View file

@ -9,13 +9,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ());
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ());
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
+ // Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists
return this.level.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this)).getType() == HitResult.Type.MISS;
+ // Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists
return vec3d1.distanceTo(vec3d) > 128.0D ? false : this.level.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this)).getType() == HitResult.Type.MISS;
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@ -32,6 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (from.getWorld() != to.getWorld()) return false;
+ Vec3 vec3d = new Vec3(from.getX(), from.getY(), from.getZ());
+ Vec3 vec3d1 = new Vec3(to.getX(), to.getY(), to.getZ());
+ if (vec3d1.distanceTo(vec3d) > 128.0D) return false;
+
+ return this.getHandle().clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, null)).getType() == HitResult.Type.MISS;
+ }
@ -42,8 +43,18 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ import net.minecraft.world.entity.projectile.ThrownEgg;
import net.minecraft.world.entity.projectile.ThrownEnderpearl;
import net.minecraft.world.entity.projectile.ThrownExperienceBottle;
import net.minecraft.world.entity.projectile.ThrownTrident;
+import net.minecraft.world.level.ClipContext;
+import net.minecraft.world.phys.HitResult;
+import net.minecraft.world.phys.Vec3;
import org.apache.commons.lang.Validate;
import org.bukkit.FluidCollisionMode;
import org.bukkit.Location;
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return getHandle().canSee(((CraftEntity) other).getHandle());
return this.getHandle().hasLineOfSight(((CraftEntity) other).getHandle());
}
+ // Paper start
@ -52,6 +63,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (this.getHandle().level != ((CraftWorld) loc.getWorld()).getHandle()) return false;
+ Vec3 vec3d = new Vec3(this.getHandle().getX(), this.getHandle().getEyeY(), this.getHandle().getZ());
+ Vec3 vec3d1 = new Vec3(loc.getX(), loc.getY(), loc.getZ());
+ if (vec3d1.distanceTo(vec3d) > 128.0D) return false;
+
+ return this.getHandle().level.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this.getHandle())).getType() == HitResult.Type.MISS;
+ }
@ -59,4 +71,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
@Override
public boolean getRemoveWhenFarAway() {
return getHandle() instanceof Mob && !((Mob) getHandle()).persistenceRequired;
return this.getHandle() instanceof Mob && !((Mob) this.getHandle()).persistenceRequired;

View file

@ -5,23 +5,11 @@ Subject: [PATCH] Fix PotionSplashEvent for water splash potions
Fixes SPIGOT-6221: https://hub.spigotmc.org/jira/projects/SPIGOT/issues/SPIGOT-6221
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
@@ -0,0 +0,0 @@ public class DamageSource {
return (new IndirectEntityDamageSource("thrown", projectile, attacker)).setProjectile();
}
+ public static DamageSource indirectMagic(Entity target, Entity cause) { return indirectMagic(target, cause); } // Paper - OBFHELPER
public static DamageSource indirectMagic(Entity magic, @Nullable Entity attacker) {
return (new IndirectEntityDamageSource("indirectMagic", magic, attacker)).bypassArmor().setMagic();
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
@@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile {
@@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
private void applyWater() {
AABB axisalignedbb = this.getBoundingBox().inflate(4.0D, 2.0D, 4.0D);
List<net.minecraft.world.entity.LivingEntity> list = this.level.getEntitiesOfClass(net.minecraft.world.entity.LivingEntity.class, axisalignedbb, ThrownPotion.WATER_SENSITIVE);
@ -29,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (!list.isEmpty()) {
Iterator iterator = list.iterator();
@@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile {
@@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
double d0 = this.distanceToSqr(entityliving);
if (d0 < 16.0D && entityliving.isSensitiveToWater()) {
@ -50,10 +38,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ }
+ // Paper end
}
+
List<Axolotl> list1 = this.level.getEntitiesOfClass(Axolotl.class, axisalignedbb);
Iterator iterator1 = list1.iterator();
private void applySplash(List<MobEffectInstance> statusEffects, @Nullable Entity entity) {
@@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile {
@@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
double d0 = this.distanceToSqr(entityliving);
if (d0 < 16.0D) {

View file

@ -48,7 +48,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (tag.contains(RESOLVED.NBT)) {
@@ -0,0 +0,0 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta {
} else {
page = validatePage(page);
page = this.validatePage(page);
}
- this.pages.add( limit( page, 16384 ) ); // Spigot
+ this.pages.add( limit( page, com.destroystokyo.paper.PaperConfig.itemValidationBookPageLength ) ); // Spigot // Paper - make configurable
@ -63,21 +63,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
CompoundTag display = tag.getCompound(DISPLAY.NBT);
if (display.contains(NAME.NBT)) {
- displayName = limit( display.getString(NAME.NBT), 8192 ); // Spigot
+ displayName = limit( display.getString(NAME.NBT), com.destroystokyo.paper.PaperConfig.itemValidationDisplayNameLength); // Spigot // Paper - make configurable
- this.displayName = limit( display.getString(NAME.NBT), 8192 ); // Spigot
+ this.displayName = limit( display.getString(NAME.NBT), com.destroystokyo.paper.PaperConfig.itemValidationDisplayNameLength ); // Spigot // Paper - make configurable
}
if (display.contains(LOCNAME.NBT)) {
- locName = limit( display.getString(LOCNAME.NBT), 8192 ); // Spigot
+ locName = limit( display.getString(LOCNAME.NBT), com.destroystokyo.paper.PaperConfig.itemValidationLocNameLength ); // Spigot // Paper - make configurable
- this.locName = limit( display.getString(LOCNAME.NBT), 8192 ); // Spigot
+ this.locName = limit( display.getString(LOCNAME.NBT), com.destroystokyo.paper.PaperConfig.itemValidationLocNameLength ); // Spigot // Paper - make configurable
}
if (display.contains(LORE.NBT)) {
ListTag list = display.getList(LORE.NBT, CraftMagicNumbers.NBT.TAG_STRING);
lore = new ArrayList<String>(list.size());
this.lore = new ArrayList<String>(list.size());
for (int index = 0; index < list.size(); index++) {
- String line = limit( list.getString(index), 8192 ); // Spigot
+ String line = limit( list.getString(index), com.destroystokyo.paper.PaperConfig.itemValidationLoreLineLength ); // Spigot // Paper - make configurable
lore.add(line);
this.lore.add(line);
}
}

View file

@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
this.generator = gen;
environment = env;
this.environment = env;
+ // Paper start - per world spawn limits
+ this.monsterSpawn = this.world.paperConfig.spawnLimitMonsters;
+ this.animalSpawn = this.world.paperConfig.spawnLimitAnimals;