mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-20 12:19:47 +00:00
port to forestry 4.2
This commit is contained in:
1 parent
dbc5c1a564
commit
f969f63b66
3697 files changed
+78372
No files matched your search
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.carpentry;
|
||||
|
||||
import net.minecraft.util.IIcon;
|
||||
import binnie.extratrees.api.IDesignSystem;
|
||||
import binnie.extratrees.api.IPattern;
|
||||
import binnie.extratrees.api.ILayout;
|
||||
|
||||
public class Layout implements ILayout
|
||||
{
|
||||
IPattern pattern;
|
||||
boolean inverted;
|
||||
|
||||
@Override
|
||||
public IPattern getPattern() {
|
||||
return this.pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInverted() {
|
||||
return this.inverted;
|
||||
}
|
||||
|
||||
private Layout(final IPattern pattern, final boolean inverted) {
|
||||
this.pattern = pattern;
|
||||
this.inverted = inverted;
|
||||
}
|
||||
|
||||
private Layout(final IPattern pattern) {
|
||||
this(pattern, false);
|
||||
}
|
||||
|
||||
ILayout newLayout(final ILayout newLayout) {
|
||||
return new Layout(newLayout.getPattern(), this.inverted ^ newLayout.isInverted());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout rotateRight() {
|
||||
return this.rotateLeft().rotateLeft().rotateLeft();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout rotateLeft() {
|
||||
return this.newLayout(this.pattern.getRotation());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout flipHorizontal() {
|
||||
return this.newLayout(this.pattern.getHorizontalFlip());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout flipVertical() {
|
||||
return this.newLayout(this.pattern.getHorizontalFlip().rotateLeft().rotateLeft());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getPrimaryIcon(final IDesignSystem system) {
|
||||
return this.inverted ? this.pattern.getSecondaryIcon(system) : this.pattern.getPrimaryIcon(system);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getSecondaryIcon(final IDesignSystem system) {
|
||||
return this.inverted ? this.pattern.getPrimaryIcon(system) : this.pattern.getSecondaryIcon(system);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout invert() {
|
||||
return new Layout(this.pattern, !this.inverted);
|
||||
}
|
||||
|
||||
public static ILayout get(final IPattern pattern, final boolean inverted) {
|
||||
return new Layout(pattern, inverted);
|
||||
}
|
||||
|
||||
public static ILayout get(final IPattern pattern) {
|
||||
return new Layout(pattern, false);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user