Update upstream

This commit is contained in:
tr7zw 2020-04-02 01:02:22 +02:00
parent 8081a196d5
commit d6679a78e3
5 changed files with 14 additions and 195 deletions

@ -1 +1 @@
Subproject commit e5045a0384674b68508ac4d22e59f5584827e06e
Subproject commit c2ad42c69468a887a271291d56183c6b3a6c012d

View File

@ -1,4 +1,4 @@
From 9a15305f9ae99bdf29cc4ed4a3532c495cf4c5b4 Mon Sep 17 00:00:00 2001
From db45a9b1f78962fc0229097f645905cd92215182 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Wed, 26 Feb 2020 21:39:58 +0100
Subject: [PATCH] Don't save Fireworks and Arrows
@ -8,10 +8,10 @@ Subject: [PATCH] Don't save Fireworks and Arrows
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 22ceb99fd..edfb77fc3 100644
index 96d091e4b..71a14005f 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1650,7 +1650,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1691,7 +1691,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
public boolean c(NBTTagCompound nbttagcompound) {

View File

@ -1,4 +1,4 @@
From 42f070cdef94a25add267149abe75dbe6f077457 Mon Sep 17 00:00:00 2001
From d9fa2ee2e364ccac3437464113ad003c10a4ff2b Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Thu, 5 Mar 2020 22:31:50 +0100
Subject: [PATCH] Add config, yapfa command and basic settings
@ -396,10 +396,10 @@ index 610826c9e..2ed69f567 100644
this.setSpawnAnimals(dedicatedserverproperties.spawnAnimals);
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index edfb77fc3..68a887f1c 100644
index 71a14005f..c1e283406 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -795,6 +795,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -829,6 +829,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
try {
this.inLava = false;
@ -407,7 +407,7 @@ index edfb77fc3..68a887f1c 100644
this.checkBlockCollisions();
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Checking entity block collision");
@@ -919,7 +920,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -960,7 +961,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
VoxelShapeCollision voxelshapecollision = VoxelShapeCollision.a(this);
VoxelShape voxelshape = this.world.getWorldBorder().a();
Stream<VoxelShape> stream = VoxelShapes.c(voxelshape, VoxelShapes.a(axisalignedbb.shrink(1.0E-7D)), OperatorBoolean.AND) ? Stream.empty() : Stream.of(voxelshape);
@ -417,7 +417,7 @@ index edfb77fc3..68a887f1c 100644
Vec3D vec3d1 = vec3d.g() == 0.0D ? vec3d : a(this, vec3d, axisalignedbb, this.world, voxelshapecollision, streamaccumulator);
boolean flag = vec3d.x != vec3d1.x;
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index c474c3e09..384307a91 100644
index e0a61a0f7..bd3b9e898 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -246,6 +246,7 @@ public abstract class EntityLiving extends Entity {

View File

@ -1,4 +1,4 @@
From fe971f01c2ef8780f3bf164f915681761b9a0629 Mon Sep 17 00:00:00 2001
From da52e616bf5adb096dbaf5878980d8297f4540dc Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Mon, 23 Mar 2020 18:20:58 +0100
Subject: [PATCH] Remove Stream usage
@ -328,7 +328,7 @@ index 6def3616e..e1338f809 100644
public Stream<MinecraftKey> c() {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 68a887f1c..837044d96 100644
index c1e283406..f8e91008a 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -13,6 +13,7 @@ import java.util.Locale;
@ -339,7 +339,7 @@ index 68a887f1c..837044d96 100644
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Stream;
@@ -918,31 +919,60 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -959,31 +960,60 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
private Vec3D e(Vec3D vec3d) {
AxisAlignedBB axisalignedbb = this.getBoundingBox();
VoxelShapeCollision voxelshapecollision = VoxelShapeCollision.a(this);
@ -415,7 +415,7 @@ index 68a887f1c..837044d96 100644
}
return vec3d1;
@@ -965,6 +995,91 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1006,6 +1036,91 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return a(vec3d, axisalignedbb, world, voxelshapecollision, streamaccumulator);
}
}
@ -508,7 +508,7 @@ index 68a887f1c..837044d96 100644
public static Vec3D a(Vec3D vec3d, AxisAlignedBB axisalignedbb, StreamAccumulator<VoxelShape> streamaccumulator) {
double d0 = vec3d.x;
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 384307a91..4575498bb 100644
index bd3b9e898..eb8989d29 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2649,6 +2649,7 @@ public abstract class EntityLiving extends Entity {

View File

@ -1,181 +0,0 @@
From 502fb2bcff02682fffc83a505a9c6b49c6cae03a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 28 Mar 2020 18:18:03 -0400
Subject: [PATCH] EMC EAR improvements
---
.../java/net/minecraft/server/Entity.java | 1 +
.../net/minecraft/server/EntityLiving.java | 2 +-
.../java/org/spigotmc/ActivationRange.java | 45 +++++++++++--------
.../java/org/spigotmc/SpigotWorldConfig.java | 2 +
4 files changed, 31 insertions(+), 19 deletions(-)
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 837044d96..cee9fb29c 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -193,6 +193,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
public final boolean defaultActivationState;
public long activatedTick = Integer.MIN_VALUE;
+ public boolean isTemporarilyActive = false; // Paper
public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one
public boolean fromNetherPortal; // Paper
protected int numCollisions = 0; // Paper
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index dd92758a6..fe9d90ce5 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2400,7 +2400,7 @@ public abstract class EntityLiving extends Entity {
}
}
- this.movementTick();
+ if (!this.isTemporarilyActive || this.world.spigotConfig.moveInactiveEntities) this.movementTick(); // Paper - don't move if only temporarily active
double d0 = this.locX() - this.lastX;
double d1 = this.locZ() - this.lastZ;
float f = (float) (d0 * d0 + d1 * d1);
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index e160f03c1..381317f16 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -200,22 +200,22 @@ public class ActivationRange
* @param entity
* @return
*/
- public static boolean checkEntityImmunities(Entity entity)
+ public static int checkEntityImmunities(Entity entity)
{
// quick checks.
if ( entity.inWater || entity.fireTicks > 0 )
{
- return true;
+ return 1;
}
if ( !( entity instanceof EntityArrow ) )
{
if ( !entity.onGround || !entity.passengers.isEmpty() || entity.isPassenger() )
{
- return true;
+ return 10;
}
} else if ( !( (EntityArrow) entity ).inGround )
{
- return true;
+ return 1;
}
// special cases.
if ( entity instanceof EntityLiving )
@@ -223,20 +223,20 @@ public class ActivationRange
EntityLiving living = (EntityLiving) entity;
if ( /*TODO: Missed mapping? living.attackTicks > 0 || */ living.hurtTicks > 0 || living.effects.size() > 0 )
{
- return true;
+ return 1;
}
if ( entity instanceof EntityCreature && (( (EntityCreature) entity ).getGoalTarget() != null || ( (EntityCreature) entity ).getMovingTarget() != null)) // Paper
{
- return true;
+ return 20;
}
if ( entity instanceof EntityVillager && ( (EntityVillager) entity ).canBreed() )
{
- return true;
+ return 1;
}
// Paper start
if ( entity instanceof EntityLlama && ( (EntityLlama ) entity ).inCaravan() )
{
- return true;
+ return 0;
}
// Paper end
if ( entity instanceof EntityAnimal )
@@ -244,18 +244,23 @@ public class ActivationRange
EntityAnimal animal = (EntityAnimal) entity;
if ( animal.isBaby() || animal.isInLove() )
{
- return true;
+ return 1; // Paper
}
if ( entity instanceof EntitySheep && ( (EntitySheep) entity ).isSheared() )
{
- return true;
+ return 1; // Paper
}
}
if (entity instanceof EntityCreeper && ((EntityCreeper) entity).isIgnited()) { // isExplosive
- return true;
+ return 20; // Paper
+ }
+ // Paper start
+ if (entity instanceof EntityInsentient && ((EntityInsentient) entity).targetSelector.hasTasks() ) {
+ return 0;
}
+ // Paper end
}
- return false;
+ return -1; // Paper
}
/**
@@ -272,6 +277,7 @@ public class ActivationRange
}
boolean isActive = entity.activatedTick >= MinecraftServer.currentTick || entity.defaultActivationState;
+ entity.isTemporarilyActive = !isActive; // Paper
// Should this entity tick?
if ( !isActive )
@@ -279,11 +285,14 @@ public class ActivationRange
if ( ( MinecraftServer.currentTick - entity.activatedTick - 1 ) % 20 == 0 )
{
// Check immunities every 20 ticks.
- if ( checkEntityImmunities( entity ) )
- {
- // Triggered some sort of immunity, give 20 full ticks before we check again.
- entity.activatedTick = MinecraftServer.currentTick + 20;
- }
+ // Paper start
+ int immunity = checkEntityImmunities(entity);
+ if (immunity >= 0) {
+ entity.activatedTick = MinecraftServer.currentTick + immunity;
+ } else {
+ entity.isTemporarilyActive = true;
+ }
+ // Paper end
isActive = true;
// Paper start
} else if (entity instanceof EntityInsentient && ((EntityInsentient) entity).targetSelector.hasTasks()) {
@@ -291,7 +300,7 @@ public class ActivationRange
}
// Paper end
// Add a little performance juice to active entities. Skip 1/4 if not immune.
- } else if ( !entity.defaultActivationState && entity.ticksLived % 4 == 0 && !(entity instanceof EntityInsentient && ((EntityInsentient) entity).targetSelector.hasTasks()) && !checkEntityImmunities( entity ) ) // Paper - add targetSelector.hasTasks
+ } else if ( !entity.defaultActivationState && entity.ticksLived % 4 == 0 && checkEntityImmunities( entity) < 0 ) // Paper
{
isActive = false;
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 3ceeed3f9..1540afd80 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -181,6 +181,7 @@ public class SpigotWorldConfig
public int raiderActivationRange = 48;
public int miscActivationRange = 16;
public int waterActivationRange = 16; // Paper
+ public boolean moveInactiveEntities = false; // Paper
public boolean tickInactiveVillagers = true;
private void activationRange()
{
@@ -189,6 +190,7 @@ public class SpigotWorldConfig
raiderActivationRange = getInt( "entity-activation-range.raiders", raiderActivationRange );
miscActivationRange = getInt( "entity-activation-range.misc", miscActivationRange );
waterActivationRange = getInt( "entity-activation-range.water", waterActivationRange ); // Paper
+ moveInactiveEntities = getBoolean( "entity-activation-range.move-inactive-entities", moveInactiveEntities ); // Paper
tickInactiveVillagers = getBoolean( "entity-activation-range.tick-inactive-villagers", tickInactiveVillagers );
log( "Entity Activation Range: An " + animalActivationRange + " / Mo " + monsterActivationRange + " / Ra " + raiderActivationRange + " / Mi " + miscActivationRange + " / Tiv " + tickInactiveVillagers );
}
--
2.25.1.windows.1