geforkt von Mirrors/Paper
SPIGOT-5797: Zombie(Villagers) Instant Convert based on their lifetime
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
33a09c7f27
Commit
0af0259050
@ -24,19 +24,26 @@
|
|||||||
|
|
||||||
public EntityZombie(EntityTypes<? extends EntityZombie> entitytypes, World world) {
|
public EntityZombie(EntityTypes<? extends EntityZombie> entitytypes, World world) {
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
@@ -144,7 +154,11 @@
|
@@ -144,7 +154,10 @@
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (!this.world.isClientSide && this.isAlive()) {
|
if (!this.world.isClientSide && this.isAlive()) {
|
||||||
if (this.isDrownConverting()) {
|
if (this.isDrownConverting()) {
|
||||||
- --this.drownedConversionTime;
|
- --this.drownedConversionTime;
|
||||||
+ // CraftBukkit start - Use wall time instead of ticks for conversion
|
+ // CraftBukkit start - Use wall time instead of ticks for conversion
|
||||||
+ int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
|
+ int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
|
||||||
+ this.lastTick = MinecraftServer.currentTick;
|
|
||||||
+ this.drownedConversionTime -= elapsedTicks;
|
+ this.drownedConversionTime -= elapsedTicks;
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
if (this.drownedConversionTime < 0) {
|
if (this.drownedConversionTime < 0) {
|
||||||
this.ev();
|
this.ev();
|
||||||
}
|
}
|
||||||
|
@@ -161,6 +174,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
super.tick();
|
||||||
|
+ this.lastTick = MinecraftServer.currentTick; // CraftBukkit
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@@ -193,6 +207,7 @@
|
@@ -193,6 +207,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,18 +20,25 @@
|
|||||||
|
|
||||||
public EntityZombieVillager(EntityTypes<? extends EntityZombieVillager> entitytypes, World world) {
|
public EntityZombieVillager(EntityTypes<? extends EntityZombieVillager> entitytypes, World world) {
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
@@ -75,6 +81,11 @@
|
@@ -75,6 +81,10 @@
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (!this.world.isClientSide && this.isAlive() && this.isConverting()) {
|
if (!this.world.isClientSide && this.isAlive() && this.isConverting()) {
|
||||||
int i = this.getConversionProgress();
|
int i = this.getConversionProgress();
|
||||||
+ // CraftBukkit start - Use wall time instead of ticks for villager conversion
|
+ // CraftBukkit start - Use wall time instead of ticks for villager conversion
|
||||||
+ int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
|
+ int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
|
||||||
+ this.lastTick = MinecraftServer.currentTick;
|
|
||||||
+ i *= elapsedTicks;
|
+ i *= elapsedTicks;
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
|
||||||
this.conversionTime -= i;
|
this.conversionTime -= i;
|
||||||
if (this.conversionTime <= 0) {
|
if (this.conversionTime <= 0) {
|
||||||
|
@@ -83,6 +93,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
super.tick();
|
||||||
|
+ this.lastTick = MinecraftServer.currentTick; // CraftBukkit
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@@ -123,8 +134,11 @@
|
@@ -123,8 +134,11 @@
|
||||||
this.conversionPlayer = uuid;
|
this.conversionPlayer = uuid;
|
||||||
this.conversionTime = i;
|
this.conversionTime = i;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren