Skip to content

Commit

Permalink
Fix API submodule havint the wrong history.
Browse files Browse the repository at this point in the history
Theoretically fix #3970.
  • Loading branch information
AlexIIL committed Jan 10, 2018
1 parent 3de2a8e commit 7dfe9d9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion BuildCraftAPI
Submodule BuildCraftAPI updated 0 files
10 changes: 8 additions & 2 deletions common/buildcraft/lib/chunkload/ChunkLoaderManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import javax.annotation.Nonnull;

import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.World;

Expand Down Expand Up @@ -96,9 +97,14 @@ public static <T extends TileEntity & IChunkLoadingTile> void rebindTickets(List
World world) {
if (BCLibConfig.chunkLoadingLevel != BCLibConfig.ChunkLoaderLevel.NONE) {
for (ForgeChunkManager.Ticket ticket : tickets) {
TileEntity tile = world.getTileEntity(NBTUtilBC.readBlockPos(ticket.getModData().getTag("location")));
if (tile == null || !(tile instanceof IChunkLoadingTile) || !canLoadFor((IChunkLoadingTile) tile))
BlockPos pos = NBTUtilBC.readBlockPos(ticket.getModData().getTag("location"));
if (pos == null) {
continue;
}
TileEntity tile = world.getTileEntity(pos);
if (tile == null || !(tile instanceof IChunkLoadingTile) || !canLoadFor((IChunkLoadingTile) tile)) {
continue;
}
for (ChunkPos chunkPos : getChunksToLoad((T) tile)) {
ForgeChunkManager.forceChunk(ticket, chunkPos);
}
Expand Down
3 changes: 2 additions & 1 deletion common/buildcraft/lib/chunkload/IChunkLoadingTile.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.annotation.Nullable;

import net.minecraft.tileentity.TileEntity;
Expand All @@ -20,7 +21,7 @@
import buildcraft.lib.BCLibConfig.ChunkLoaderLevel;

/** This should be implemented by {@link TileEntity}'s that wish to be chunkloaded by buildcraft lib. Note that tiles
* should add themselves to the chunkloading list in {@link ChunkLoaderManager#loadChunksForTile(TileEntity)} */
* should add themselves to the chunkloading list in {@link ChunkLoaderManager#loadChunksForTile(TileEntity)} */
public interface IChunkLoadingTile {
/** @return The chunkloading type, or null if this tile doesn't want to be chunkloaded. */
@Nullable
Expand Down

0 comments on commit 7dfe9d9

Please sign in to comment.