-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix entities not saving when chunk was unloaded
- Loading branch information
1 parent
1c32be3
commit cf7f0fd
Showing
3 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
common/src/main/java/org/waste/of/time/mixin/EntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.waste.of.time.mixin; | ||
|
||
import net.minecraft.entity.Entity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import org.waste.of.time.WorldTools; | ||
|
||
@Mixin(Entity.class) | ||
public class EntityMixin { | ||
@Inject(method = "setRemoved", at = @At("HEAD"), cancellable = true) | ||
private void cancelMarkRemoved(Entity.RemovalReason reason, CallbackInfo ci) { | ||
if (WorldTools.INSTANCE.getCaching() && reason == Entity.RemovalReason.DISCARDED) ci.cancel(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters