Added an option to toggle oredict substitutions for patterns. #1891
Conversation
@@ -158,6 +158,10 @@ else if( this.Name.equals( "PatternTerminal.Clear" ) ) | |||
{ | |||
cpt.clear(); | |||
} | |||
else if( this.Name.equals( "PatternTerminal.Substitute" ) ) |
@@ -158,6 +158,10 @@ else if( this.Name.equals( "PatternTerminal.Clear" ) ) | |||
{ | |||
cpt.clear(); | |||
} | |||
else if( this.Name.equals( "PatternTerminal.Substitute" ) ) | |||
{ | |||
cpt.ct.setSubstitution( this.Value.equals( "1" ) ); |
boolean sim; | ||
private int bytes = 0; | ||
private boolean canEmit = false; | ||
private boolean cannotUse = false; |
@@ -54,7 +54,7 @@ | |||
|
|||
LevelType, LevelType_Energy, LevelType_Item, InventoryTweaks, TerminalStyle, TerminalStyle_Full, TerminalStyle_Tall, TerminalStyle_Small, | |||
|
|||
Stash, StashDesc, Encode, EncodeDescription, Substitutions, SubstitutionsOn, SubstitutionsOff, SubstitutionsDesc, CraftOnly, CraftEither, | |||
Stash, StashDesc, Encode, EncodeDescription, Substitutions, SubstitutionsOn, SubstitutionsOff, SubstitutionsDescEnabled, SubstitutionsDescDisabled, CraftOnly, CraftEither, |
And, | ||
With, | ||
Substitute, | ||
Yes, |
With, | ||
Substitute, | ||
Yes, | ||
No, |
Yes, | ||
No, | ||
|
||
MolecularAssembler, |
I am also not fully convinced about how to handle the backward compatibility. |
I think oredict should be off by default. |
I also tend to this option, but will potentially cause more issues to players when upgrading and their tendency to ignore changelogs. |
ah, the old pattern did support oredict right, |
Old patterns are supporting oredict as it was the only option. But codewise it seems they should not. New patterns will now have a new nbttag, but nonexistant nbttags will by default fallback to Also there is already a |
I think new patterns should have ore dict off per default. Might be the cleanest solution from player perspective |
A transition item would be extremely intrusive to existing builds as this would mean update every single pattern. Disabling it would mean only recreate needed ones, but still will require some player interaction. Enabling will keep the current behaviour, but need like 5 lines of code extra to handle it. |
I slowly tend towards disabling it even for old patterns. The crafting system is already designed around precise items when calculating the crafting tree and most requests are about disabling this feature in general. I really cannot remember any real feedback regarding it is an actually used very frequently, But the positive feedback is way more rare then negative ones. |
sounds about right |
ceeface
to
9030fb6
package appeng.api.config; | ||
|
||
|
||
public enum Substitution |
thatsIch
Oct 6, 2015
Member
should probably state for what usage this is supposed to be used. Sometimes there are duplicate classes which do nearly the same but are used in different contextes and to obtain type-safety they use different ones.
should probably state for what usage this is supposed to be used. Sometimes there are duplicate classes which do nearly the same but are used in different contextes and to obtain type-safety they use different ones.
|
||
if( this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn == btn ) | ||
{ | ||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? "0" : "1" ) ); |
thatsIch
Oct 6, 2015
Member
should probably const
the 0
and the 1
out to clarify meaning
should probably const
the 0
and the 1
out to clarify meaning
yueh
Oct 6, 2015
Author
Member
Might be even an idea to refactor PacketValueConfig
to also accept an enum
instead of just a random string. Serialization probably still has to fall back to .ordinal()
or similar.
Might be even an idea to refactor PacketValueConfig
to also accept an enum
instead of just a random string. Serialization probably still has to fall back to .ordinal()
or similar.
this.substitutionsEnabledBtn.visible = false; | ||
this.substitutionsDisabledBtn.visible = true; | ||
} | ||
|
thatsIch
Oct 6, 2015
Member
just thinking as enhancement:
A class ToggleGroup
or so, and if you make 1 button visible, all others are disabled via listener. Would be probably interessting in other button groups, so adding a new state is far easier than hard-coding the state.
just thinking as enhancement:
A class ToggleGroup
or so, and if you make 1 button visible, all others are disabled via listener. Would be probably interessting in other button groups, so adding a new state is far easier than hard-coding the state.
yueh
Oct 6, 2015
Author
Member
Good idea. The whole gui could see some improvments. But simply not enough time currently to also refactor this.
Good idea. The whole gui could see some improvments. But simply not enough time currently to also refactor this.
if( this.substitute != this.ct.isSubstitution() ) | ||
{ | ||
this.substitute = this.ct.isSubstitution(); | ||
} |
thatsIch
Oct 6, 2015
Member
so its always this.substitute = this.ct.isSubstitution();
? any performance implications why the if
is used?
so its always this.substitute = this.ct.isSubstitution();
? any performance implications why the if
is used?
yueh
Oct 6, 2015
Author
Member
Hm yeah. Mostly pointless. I think I left it intentionally there in case it needed something similar to the crafting mode and updateOrderOfOutputSlots()
.
Hm yeah. Mostly pointless. I think I left it intentionally there in case it needed something similar to the crafting mode and updateOrderOfOutputSlots()
.
|
||
if( this.parent.details.canSubstitute() ) | ||
{ | ||
itemList = inv.getItemList().findFuzzy( this.what, FuzzyMode.IGNORE_ALL ); |
thatsIch
Oct 6, 2015
Member
inv.getItemList()
used in both branches
inv.getItemList()
used in both branches
{ | ||
ACCEPT, DECLINE, TEST | ||
} | ||
|
||
static class TestLookup | ||
private static class TestLookup |
thatsIch
Oct 6, 2015
Member
final
?
final
?
It adds a backward compatibility to convert current patterns to use oredict by default, which should be removed with rv4 stable. Closes #1156
SonarQube analysis reported 9 issues: Watch the comments in this conversation to review them. |
public final String Name; | ||
public final String Value; | ||
private final String Name; | ||
private final String Value; |
thatsIch
Oct 8, 2015
Member
vars should start lower case and not like classes
vars should start lower case and not like classes
yueh
Oct 8, 2015
Author
Member
I know.. There are a bunch of them. Probably something I will tackle should the PR for private fields be merged. Also the whole PacketValueConfig
is a bit cheesy. Something I want to address with the network refactoring.
I know.. There are a bunch of them. Probably something I will tackle should the PR for private fields be merged. Also the whole PacketValueConfig
is a bit cheesy. Something I want to address with the network refactoring.
Looks fine, I will live test it tomorrow |
A nice thing would be if you could see a difference in oredict vs not. This can be another FR though |
Upon crafting my client crashes |
Tried several times already, still failing |
This still crashes without NEI and CC |
Another thing is the place of the substitution button, not sure if this should be there, but maybe below the crafting/processing switch? |
The button was already there. Just hidden, so I simply kept it. Different icon? As the tooltip already shows if enabled or not and this is also visible inside an interface terminal. Regarding the crash see: https://bugs.mojang.com/browse/MC-32606 |
Attached the HS log |
Using the super latest driver fixes this issue or force not to use your 2D desktop application GFX-card |
I mean a direct indicator like upon shift show an iron ingot in the corner to indicate that these are oredictionaried. |
Hm. There is just the general issue with only 16x16 pixel large icons. But probably another FR. Also not sure if still possible with 1.8/1.9. I do not really want to add something, if we already know it needs to be reverted later. |
Added an option to toggle oredict substitutions for patterns.
It adds a backward compatibility to convert current patterns to use
oredict by default, which should be removed with rv4 stable.
Closes #1156