Skip to content

Commit

Permalink
Update SpongeCommon for chunk unload fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodmc committed Sep 6, 2016
1 parent a4e322a commit c9fdd43
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 54 deletions.
2 changes: 1 addition & 1 deletion SpongeCommon
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import net.minecraft.server.management.PlayerChunkMap;
import net.minecraft.server.management.PlayerChunkMapEntry;
import net.minecraft.world.chunk.Chunk;
import org.spongepowered.common.interfaces.world.gen.IMixinChunkProviderServer;
import org.spongepowered.mod.interfaces.IMixinPlayerChunkMapEntry;

public class PlayerChunkRunnable implements Runnable {
Expand All @@ -44,7 +43,7 @@ public PlayerChunkRunnable(PlayerChunkMap playerChunkMap, PlayerChunkMapEntry pl
@Override
public void run() {
IMixinPlayerChunkMapEntry spongePlayerChunkMapEntry = (IMixinPlayerChunkMapEntry) this.playerChunkMapEntry;
Chunk chunk = ((IMixinChunkProviderServer) this.playerChunkMap.getWorldServer().getChunkProvider()).getChunkIfLoaded(this.playerChunkMapEntry.pos.chunkXPos, this.playerChunkMapEntry.pos.chunkZPos);
Chunk chunk = this.playerChunkMap.getWorldServer().getChunkProvider().getLoadedChunk(this.playerChunkMapEntry.pos.chunkXPos, this.playerChunkMapEntry.pos.chunkZPos);
if (chunk != null) {
spongePlayerChunkMapEntry.setChunk(chunk);
return;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.common.interfaces.IMixinChunk;
import org.spongepowered.common.interfaces.world.gen.IMixinChunkProviderServer;

@NonnullByDefault
@Mixin(net.minecraft.world.chunk.Chunk.class)
Expand Down Expand Up @@ -74,7 +73,7 @@ public void onSetChunkLoaded(boolean loaded, CallbackInfo ci) {
Direction[] directions = {Direction.NORTH, Direction.SOUTH, Direction.EAST, Direction.WEST};
for (Direction direction : directions) {
Vector3i neighborPosition = this.getPosition().add(direction.asBlockOffset());
net.minecraft.world.chunk.Chunk neighbor = ((IMixinChunkProviderServer) this.worldObj.getChunkProvider()).getChunkIfLoaded
net.minecraft.world.chunk.Chunk neighbor = this.worldObj.getChunkProvider().getLoadedChunk
(neighborPosition.getX(), neighborPosition.getZ());
if (neighbor != null) {
this.setNeighbor(direction, (Chunk) neighbor);
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/mixins.forge.core.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
"client": [
"client.MixinMinecraft",
"client.gui.MixinGuiOverlayDebug",
"client.multiplayer.MixinChunkProviderClient",
"client.network.MixinNetHandlerPlayClient",
"client.server.MixinIntegratedServer",
"server.MixinIntegratedServerAnonInner3"
Expand Down

0 comments on commit c9fdd43

Please sign in to comment.