Clear network registry on world unload
This commit is contained in:
@@ -17,7 +17,7 @@ group = "refinedstorage"
|
|||||||
archivesBaseName = "refinedstorage"
|
archivesBaseName = "refinedstorage"
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "1.9.4-12.17.0.1968"
|
version = "1.9.4-12.17.0.1969"
|
||||||
runDir = "run"
|
runDir = "run"
|
||||||
useDepAts = true
|
useDepAts = true
|
||||||
mappings = "snapshot_20160518"
|
mappings = "snapshot_20160518"
|
||||||
@@ -30,7 +30,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
deobfCompile "mezz.jei:jei_1.9.4:3.4.+"
|
deobfCompile "mezz.jei:jei_1.9.4:3.6.+"
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
|
|||||||
@@ -27,4 +27,9 @@ public class NetworkMasterEventHandler {
|
|||||||
public void onWorldLoad(WorldEvent.Load e) {
|
public void onWorldLoad(WorldEvent.Load e) {
|
||||||
NetworkMasterSavedData.getOrLoad(e.getWorld());
|
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) {
|
public static Map<BlockPos, NetworkMaster> get(int dimension) {
|
||||||
return NETWORKS.get(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.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.text.TextComponentTranslation;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import refinedstorage.RefinedStorage;
|
import refinedstorage.RefinedStorage;
|
||||||
@@ -83,7 +84,11 @@ public class BlockController extends BlockBase {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
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) {
|
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;
|
return true;
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package refinedstorage.jei;
|
|||||||
import mezz.jei.api.recipe.IRecipeHandler;
|
import mezz.jei.api.recipe.IRecipeHandler;
|
||||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
public class SoldererRecipeHandler implements IRecipeHandler<SoldererRecipeWrapper> {
|
public class SoldererRecipeHandler implements IRecipeHandler<SoldererRecipeWrapper> {
|
||||||
@Override
|
@Override
|
||||||
public Class<SoldererRecipeWrapper> getRecipeClass() {
|
public Class<SoldererRecipeWrapper> getRecipeClass() {
|
||||||
@@ -14,6 +16,12 @@ public class SoldererRecipeHandler implements IRecipeHandler<SoldererRecipeWrapp
|
|||||||
return SoldererRecipeCategory.ID;
|
return SoldererRecipeCategory.ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
@Override
|
||||||
|
public String getRecipeCategoryUid(@Nonnull SoldererRecipeWrapper recipe) {
|
||||||
|
return SoldererRecipeCategory.ID;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IRecipeWrapper getRecipeWrapper(SoldererRecipeWrapper recipe) {
|
public IRecipeWrapper getRecipeWrapper(SoldererRecipeWrapper recipe) {
|
||||||
return recipe;
|
return recipe;
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public class TileImporter extends TileSlave implements ICompareConfig, IModeConf
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateSlave() {
|
public void updateSlave() {
|
||||||
|
System.out.println("Update: " + System.currentTimeMillis());
|
||||||
IItemHandler handler = RefinedStorageUtils.getItemHandler(getFacingTile(), getDirection().getOpposite());
|
IItemHandler handler = RefinedStorageUtils.getItemHandler(getFacingTile(), getDirection().getOpposite());
|
||||||
|
|
||||||
if (getFacingTile() instanceof TileDiskDrive || handler == null) {
|
if (getFacingTile() instanceof TileDiskDrive || handler == null) {
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ misc.refinedstorage:clear=Clear
|
|||||||
misc.refinedstorage:cancel_all=Cancel All
|
misc.refinedstorage:cancel_all=Cancel All
|
||||||
misc.refinedstorage:priority=Priority
|
misc.refinedstorage:priority=Priority
|
||||||
|
|
||||||
|
misc.refinedstorage:no_network=This Controller isn't associated with any storage network. If you just upgraded to 0.7.17, this is absolutely normal. In that case, a simple one-time break and replace should fix the issue.
|
||||||
|
|
||||||
sidebutton.refinedstorage:compare.1=Compare Damage
|
sidebutton.refinedstorage:compare.1=Compare Damage
|
||||||
sidebutton.refinedstorage:compare.2=Compare NBT
|
sidebutton.refinedstorage:compare.2=Compare NBT
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user