Remove old 1.10 legacy migration code
This commit is contained in:
		@@ -77,28 +77,6 @@ public class ItemPattern extends ItemBase implements ICraftingPatternProvider {
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            tooltip.add(TextFormatting.RED + I18n.format("misc.refinedstorage:pattern.invalid") + TextFormatting.RESET);
 | 
			
		||||
 | 
			
		||||
            // @todo: Removal in a future version
 | 
			
		||||
            // Display a helpful message stating the outputs if this is a legacy pattern
 | 
			
		||||
            if (stack.hasTagCompound() && stack.getTagCompound().hasKey("Inputs") && stack.getTagCompound().hasKey("Outputs")) {
 | 
			
		||||
                tooltip.add(TextFormatting.WHITE + "This pattern is a legacy pattern made before RS 1.0, please re-make!" + TextFormatting.RESET);
 | 
			
		||||
 | 
			
		||||
                tooltip.add("This pattern used to output:");
 | 
			
		||||
 | 
			
		||||
                NBTTagList outputsTag = stack.getTagCompound().getTagList("Outputs", Constants.NBT.TAG_COMPOUND);
 | 
			
		||||
 | 
			
		||||
                NonNullList<ItemStack> outputs = NonNullList.create();
 | 
			
		||||
 | 
			
		||||
                for (int i = 0; i < outputsTag.tagCount(); ++i) {
 | 
			
		||||
                    outputs.add(new ItemStack(outputsTag.getCompoundTagAt(i)));
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                combineItems(tooltip, true, outputs);
 | 
			
		||||
 | 
			
		||||
                if (stack.getTagCompound().hasKey("Processing") && stack.getTagCompound().getBoolean("Processing")) {
 | 
			
		||||
                    tooltip.add(TextFormatting.GREEN + "This pattern was a processing pattern!" + TextFormatting.RESET);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -24,9 +24,6 @@ public abstract class TileNode<N extends NetworkNode> extends TileBase implement
 | 
			
		||||
 | 
			
		||||
    protected static final String NBT_ACTIVE = "Active";
 | 
			
		||||
 | 
			
		||||
    // @todo: Remove in a later version
 | 
			
		||||
    private NBTTagCompound legacyTag;
 | 
			
		||||
 | 
			
		||||
    private N clientNode;
 | 
			
		||||
 | 
			
		||||
    public TileNode() {
 | 
			
		||||
@@ -61,13 +58,6 @@ public abstract class TileNode<N extends NetworkNode> extends TileBase implement
 | 
			
		||||
        getNode().markDirty();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void read(NBTTagCompound tag) {
 | 
			
		||||
        super.read(tag);
 | 
			
		||||
 | 
			
		||||
        this.legacyTag = tag;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public NBTTagCompound writeUpdate(NBTTagCompound tag) {
 | 
			
		||||
        super.writeUpdate(tag);
 | 
			
		||||
 | 
			
		||||
@@ -109,36 +99,9 @@ public abstract class TileNode<N extends NetworkNode> extends TileBase implement
 | 
			
		||||
            manager.markForSaving();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (legacyTag != null) {
 | 
			
		||||
            doLegacyCheck(node);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return (N) node;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void doLegacyCheck(NetworkNode node) {
 | 
			
		||||
        // Ugly code for checking if this is a legacy tile. Sue me.
 | 
			
		||||
        boolean hasMeta = legacyTag.hasKey("x") && legacyTag.hasKey("y") && legacyTag.hasKey("z") && legacyTag.hasKey("id");
 | 
			
		||||
        boolean hasForgeData = legacyTag.hasKey("ForgeData");
 | 
			
		||||
        boolean hasForgeCaps = legacyTag.hasKey("ForgeCaps");
 | 
			
		||||
 | 
			
		||||
        // + 1 because of "Direction".
 | 
			
		||||
        if (legacyTag.getSize() == 4 + 1 && hasMeta) {
 | 
			
		||||
            // NO OP
 | 
			
		||||
        } else if (legacyTag.getSize() == 5 + 1 && hasMeta && (hasForgeData || hasForgeCaps)) {
 | 
			
		||||
            // NO OP
 | 
			
		||||
        } else if (legacyTag.getSize() == 6 + 1 && hasMeta && hasForgeData && hasForgeCaps) {
 | 
			
		||||
            // NO OP
 | 
			
		||||
        } else {
 | 
			
		||||
            node.read(legacyTag);
 | 
			
		||||
            node.markDirty();
 | 
			
		||||
 | 
			
		||||
            markDirty();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        this.legacyTag = null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public abstract N createNode(World world, BlockPos pos);
 | 
			
		||||
 | 
			
		||||
    public abstract String getNodeId();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user