From 6d76ac6545e8ef50e440690dcd5f43c2134e0e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=81=AA=E8=81=AA?= <178666380@qq.com> Date: Tue, 27 Jun 2017 14:16:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E5=BA=94=E7=94=A8=E7=9A=84=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../net/minecraftforge/common/util/EntitySnapshot.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraftforge/common/util/EntitySnapshot.java b/src/main/java/net/minecraftforge/common/util/EntitySnapshot.java index 0e702d8..ddaa33f 100644 --- a/src/main/java/net/minecraftforge/common/util/EntitySnapshot.java +++ b/src/main/java/net/minecraftforge/common/util/EntitySnapshot.java @@ -10,6 +10,8 @@ public class EntitySnapshot{ public final Entity mEntity; public final SpawnReason mReason; + private boolean mApply=false; + public EntitySnapshot(World pWorld,Entity pEntity,SpawnReason pReason){ this.mWorld=pWorld; this.mEntity=pEntity; @@ -17,7 +19,11 @@ public class EntitySnapshot{ } public boolean apply(){ - return this.mWorld.addEntity(this.mEntity,this.mReason); + if(!this.mApply){ + this.mApply=true; + return this.mWorld.addEntity(this.mEntity,this.mReason); + } + return true; } public void cancel(){