Clear network registry on world unload
This commit is contained in:
@@ -27,4 +27,9 @@ public class NetworkMasterEventHandler {
|
||||
public void onWorldLoad(WorldEvent.Load e) {
|
||||
NetworkMasterSavedData.getOrLoad(e.getWorld());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload e) {
|
||||
NetworkMasterRegistry.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,4 +35,8 @@ public class NetworkMasterRegistry {
|
||||
public static Map<BlockPos, NetworkMaster> get(int dimension) {
|
||||
return NETWORKS.get(dimension);
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
NETWORKS.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import refinedstorage.RefinedStorage;
|
||||
@@ -83,7 +84,11 @@ public class BlockController extends BlockBase {
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
if (!world.isRemote) {
|
||||
player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.CONTROLLER, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
if (((TileController) world.getTileEntity(pos)).getNetwork() == null) {
|
||||
player.addChatComponentMessage(new TextComponentTranslation("misc.refinedstorage:no_network"));
|
||||
} else {
|
||||
player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.CONTROLLER, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -3,6 +3,8 @@ package refinedstorage.jei;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class SoldererRecipeHandler implements IRecipeHandler<SoldererRecipeWrapper> {
|
||||
@Override
|
||||
public Class<SoldererRecipeWrapper> getRecipeClass() {
|
||||
@@ -14,6 +16,12 @@ public class SoldererRecipeHandler implements IRecipeHandler<SoldererRecipeWrapp
|
||||
return SoldererRecipeCategory.ID;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull SoldererRecipeWrapper recipe) {
|
||||
return SoldererRecipeCategory.ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(SoldererRecipeWrapper recipe) {
|
||||
return recipe;
|
||||
|
||||
@@ -43,6 +43,7 @@ public class TileImporter extends TileSlave implements ICompareConfig, IModeConf
|
||||
|
||||
@Override
|
||||
public void updateSlave() {
|
||||
System.out.println("Update: " + System.currentTimeMillis());
|
||||
IItemHandler handler = RefinedStorageUtils.getItemHandler(getFacingTile(), getDirection().getOpposite());
|
||||
|
||||
if (getFacingTile() instanceof TileDiskDrive || handler == null) {
|
||||
|
||||
Reference in New Issue
Block a user