-
Notifications
You must be signed in to change notification settings - Fork 17
Fixes + tunnel colors + transparent latch outputs #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
evg-zhabotinsky
wants to merge
9
commits into
Victorious3:master
Choose a base branch
from
evg-zhabotinsky:f20160118
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
410c5e8
Fixed IOBits getting stuck in CAD and enhanced their tooltips. Closes…
evg-zhabotinsky 9450ef8
Fixed #174.
evg-zhabotinsky a2b63d6
Fixed textures to make connections less abrupt.
evg-zhabotinsky c2354b3
Made tunnels be a kind of wire. Closes #160
evg-zhabotinsky c83b6d1
Stopped part chooser dropdowns being partially off-screen
evg-zhabotinsky 3daee2d
Refactoring.
evg-zhabotinsky 13eeb15
Added ability to mirror transparent latches and disable their outputs.
evg-zhabotinsky 1ce2ee9
Added transparent latches to legacy loader
evg-zhabotinsky 869ac47
Allow replacing tunnels by tunnels. Even with the same color (clears …
evg-zhabotinsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
src/main/java/moe/nightfall/vic/integratedcircuits/cp/legacy/LegacyLoader1.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| package moe.nightfall.vic.integratedcircuits.cp.legacy; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.BitSet; | ||
| import java.util.Collections; | ||
| import java.util.HashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| import moe.nightfall.vic.integratedcircuits.cp.CircuitData; | ||
| import moe.nightfall.vic.integratedcircuits.cp.legacy.LegacyLoader; | ||
| import moe.nightfall.vic.integratedcircuits.misc.MiscUtils; | ||
| import moe.nightfall.vic.integratedcircuits.misc.Vec2; | ||
| import net.minecraft.nbt.NBTTagCompound; | ||
| import net.minecraftforge.common.util.ForgeDirection; | ||
|
|
||
| public final class LegacyLoader1 extends LegacyLoader { | ||
| @Override | ||
| public int getVersion() { | ||
| return 1; | ||
| } | ||
|
|
||
| { | ||
| addTransformer(new PartTransparentLatchTransformer(), 18); | ||
| addTransformer(new PartTunnelTransformer(), 27); | ||
| } | ||
|
|
||
| private static class PartTransparentLatchTransformer extends PartTransformer { | ||
| protected final int oldBits = old.allocate(4 + 2 + 1); | ||
| protected final int newBits = transformed.allocate(4 + 2 + 1); | ||
| protected final int newConfig = transformed.allocate(3); | ||
|
|
||
| @Override | ||
| public void transformImpl() { | ||
| setInt(newBits, getInt(oldBits)); | ||
| setInt(newConfig, 0); | ||
| } | ||
| } | ||
|
|
||
| private static class PartTunnelTransformer extends PartTransformer { | ||
| // The old PartTunnel property map | ||
| // PartCPGate: | ||
| protected final int oldInput = old.allocate(4); | ||
| // PartTunnel: | ||
| protected final int oldPosX = old.allocate(8); | ||
| protected final int oldPosY = old.allocate(8); | ||
| protected final int oldIn = old.allocate(); | ||
|
|
||
| // Tunnels are now derived from wires | ||
| // PartCPGate: | ||
| protected final int newInput = transformed.allocate(4); | ||
| // PartWire: | ||
| protected final int newColor = transformed.allocate(2); | ||
| // PartTunnel: | ||
| protected final int newPosX = transformed.allocate(8); | ||
| protected final int newPosY = transformed.allocate(8); | ||
| protected final int newIn = transformed.allocate(); | ||
|
|
||
| @Override | ||
| public void transformImpl() { | ||
| setInt(newInput, getInt(oldInput)); | ||
| // Old tunnels are converted to green tunnels | ||
| setInt(newColor, 0); // 0 is green | ||
| setInt(newPosX, getInt(oldPosX)); | ||
| setInt(newPosY, getInt(oldPosY)); | ||
| setBit(newIn, getBit(oldIn)); | ||
| } | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the legacy loader doesn't work at all (because it doesn't do the steps in sequence, there's a big TODO on it), so if you decide to change the version it should probably be fixed first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These steps are NBT, transform and postTransform. For what I did this is fine.
Anyway, the proper solution is to do conversion using separate "frozen" codebase that will never have to be changed. That is, no
CircuitDataor any other such classes. It should receive NBT and produce new NBT.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess... Still would like to see that get fixed though