-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicitly do not save temporary worlds
- Loading branch information
Showing
7 changed files
with
33 additions
and
43 deletions.
There are no files selected for viewing
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
23 changes: 0 additions & 23 deletions
23
src/main/java/dev/andante/bubble/mixin/DimensionOptionsMixin.java
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
src/main/java/dev/andante/bubble/mixin/EntityChunkDataAccessMixin.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,28 @@ | ||
package dev.andante.bubble.mixin; | ||
|
||
import dev.andante.bubble.world.TemporaryWorld; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.world.storage.ChunkDataList; | ||
import net.minecraft.world.storage.EntityChunkDataAccess; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(EntityChunkDataAccess.class) | ||
public class EntityChunkDataAccessMixin { | ||
@Shadow @Final private ServerWorld world; | ||
|
||
/** | ||
* Cancels saving of entities for temporary worlds. | ||
*/ | ||
@Inject(method = "writeChunkData", at = @At("HEAD"), cancellable = true) | ||
private void onWriteChunkData(ChunkDataList<Entity> dataList, CallbackInfo ci) { | ||
if (this.world instanceof TemporaryWorld) { | ||
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
10 changes: 0 additions & 10 deletions
10
src/main/java/dev/andante/bubble/world/BubbleDimensionOptionsAccess.java
This file was deleted.
Oops, something went wrong.
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