mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 04:56:50 +01:00
Save ticks lived to nbttag
This commit is contained in:
parent
06233ce472
commit
78bc1384a7
1 changed files with 30 additions and 0 deletions
30
CraftBukkit-Patches/0081-Save-ticks-lived-to-nbttag.patch
Normal file
30
CraftBukkit-Patches/0081-Save-ticks-lived-to-nbttag.patch
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
From 48d9eefecf34d6223d07925b1646edf9e88c2399 Mon Sep 17 00:00:00 2001
|
||||||
|
From: DerFlash <bte@freenet.de>
|
||||||
|
Date: Tue, 9 Jul 2013 00:11:12 +0200
|
||||||
|
Subject: [PATCH] Save ticks lived to nbttag
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||||
|
index 9ef9f88..84bac83 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||||
|
@@ -1131,6 +1131,7 @@ public abstract class Entity {
|
||||||
|
nbttagcompound.setLong("WorldUUIDLeast", this.world.getDataManager().getUUID().getLeastSignificantBits());
|
||||||
|
nbttagcompound.setLong("WorldUUIDMost", this.world.getDataManager().getUUID().getMostSignificantBits());
|
||||||
|
nbttagcompound.setInt("Bukkit.updateLevel", CURRENT_LEVEL);
|
||||||
|
+ nbttagcompound.setInt("Spigot.ticksLived", this.ticksLived);
|
||||||
|
// CraftBukkit end
|
||||||
|
this.b(nbttagcompound);
|
||||||
|
if (this.vehicle != null) {
|
||||||
|
@@ -1199,6 +1200,8 @@ public abstract class Entity {
|
||||||
|
if (this instanceof EntityLiving) {
|
||||||
|
EntityLiving entity = (EntityLiving) this;
|
||||||
|
|
||||||
|
+ this.ticksLived = nbttagcompound.getInt("Spigot.ticksLived");
|
||||||
|
+
|
||||||
|
// Reset the persistence for tamed animals
|
||||||
|
if (entity instanceof EntityTameableAnimal && !isLevelAtLeast(nbttagcompound, 2) && !nbttagcompound.getBoolean("PersistenceRequired")) {
|
||||||
|
EntityInsentient entityinsentient = (EntityInsentient) entity;
|
||||||
|
--
|
||||||
|
1.8.3.2
|
||||||
|
|
Loading…
Reference in a new issue