mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-22 21:19:49 +00:00
Update buildscript & spotlessApply (#78)
* Update buildscript & spotlessApply * Add mapping version
This commit is contained in:
1 parent
f272840987
commit
cf41b89ae4
851 files changed
+95348
-92599
No files matched your search
@@ -1,82 +1,77 @@
|
||||
package crazypants.enderio.machine;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import com.enderio.core.api.client.render.IWidgetIcon;
|
||||
import com.enderio.core.client.gui.button.CycleButton.ICycleEnum;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public enum RedstoneControlMode implements ICycleEnum {
|
||||
IGNORE(IconEIO.REDSTONE_MODE_ALWAYS),
|
||||
ON(IconEIO.REDSTONE_MODE_WITH_SIGNAL),
|
||||
OFF(IconEIO.REDSTONE_MODE_WITHOUT_SIGNAL),
|
||||
NEVER(IconEIO.REDSTONE_MODE_NEVER);
|
||||
|
||||
IGNORE(IconEIO.REDSTONE_MODE_ALWAYS),
|
||||
ON(IconEIO.REDSTONE_MODE_WITH_SIGNAL),
|
||||
OFF(IconEIO.REDSTONE_MODE_WITHOUT_SIGNAL),
|
||||
NEVER(IconEIO.REDSTONE_MODE_NEVER);
|
||||
private IWidgetIcon icon;
|
||||
|
||||
|
||||
private IWidgetIcon icon;
|
||||
|
||||
RedstoneControlMode(IWidgetIcon icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getTooltip() {
|
||||
return EnderIO.lang.localize("gui.tooltip.redstoneControlMode." + name().toLowerCase(Locale.US));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IWidgetIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTooltipLines() {
|
||||
return Lists.newArrayList(getTooltip());
|
||||
}
|
||||
|
||||
public static boolean isConditionMet(RedstoneControlMode redstoneControlMode, int powerLevel) {
|
||||
boolean redstoneCheckPassed = true;
|
||||
if(redstoneControlMode == RedstoneControlMode.NEVER) {
|
||||
redstoneCheckPassed = false;
|
||||
} else if(redstoneControlMode == RedstoneControlMode.ON) {
|
||||
if(powerLevel < 1) {
|
||||
redstoneCheckPassed = false;
|
||||
}
|
||||
} else if(redstoneControlMode == RedstoneControlMode.OFF) {
|
||||
if(powerLevel > 0) {
|
||||
redstoneCheckPassed = false;
|
||||
}
|
||||
RedstoneControlMode(IWidgetIcon icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
return redstoneCheckPassed;
|
||||
}
|
||||
|
||||
public static boolean isConditionMet(RedstoneControlMode redstoneControlMode, TileEntity te) {
|
||||
return isConditionMet(redstoneControlMode, te.getWorldObj().getStrongestIndirectPower(te.xCoord, te.yCoord, te.zCoord));
|
||||
}
|
||||
|
||||
public RedstoneControlMode next() {
|
||||
int ord = ordinal();
|
||||
if(ord == values().length - 1) {
|
||||
ord = 0;
|
||||
} else {
|
||||
ord++;
|
||||
public String getTooltip() {
|
||||
return EnderIO.lang.localize("gui.tooltip.redstoneControlMode." + name().toLowerCase(Locale.US));
|
||||
}
|
||||
return values()[ord];
|
||||
}
|
||||
|
||||
public RedstoneControlMode previous() {
|
||||
int ord = ordinal();
|
||||
ord--;
|
||||
if(ord < 0) {
|
||||
ord = values().length - 1;
|
||||
}
|
||||
return values()[ord];
|
||||
}
|
||||
@Override
|
||||
public IWidgetIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTooltipLines() {
|
||||
return Lists.newArrayList(getTooltip());
|
||||
}
|
||||
|
||||
public static boolean isConditionMet(RedstoneControlMode redstoneControlMode, int powerLevel) {
|
||||
boolean redstoneCheckPassed = true;
|
||||
if (redstoneControlMode == RedstoneControlMode.NEVER) {
|
||||
redstoneCheckPassed = false;
|
||||
} else if (redstoneControlMode == RedstoneControlMode.ON) {
|
||||
if (powerLevel < 1) {
|
||||
redstoneCheckPassed = false;
|
||||
}
|
||||
} else if (redstoneControlMode == RedstoneControlMode.OFF) {
|
||||
if (powerLevel > 0) {
|
||||
redstoneCheckPassed = false;
|
||||
}
|
||||
}
|
||||
return redstoneCheckPassed;
|
||||
}
|
||||
|
||||
public static boolean isConditionMet(RedstoneControlMode redstoneControlMode, TileEntity te) {
|
||||
return isConditionMet(
|
||||
redstoneControlMode, te.getWorldObj().getStrongestIndirectPower(te.xCoord, te.yCoord, te.zCoord));
|
||||
}
|
||||
|
||||
public RedstoneControlMode next() {
|
||||
int ord = ordinal();
|
||||
if (ord == values().length - 1) {
|
||||
ord = 0;
|
||||
} else {
|
||||
ord++;
|
||||
}
|
||||
return values()[ord];
|
||||
}
|
||||
|
||||
public RedstoneControlMode previous() {
|
||||
int ord = ordinal();
|
||||
ord--;
|
||||
if (ord < 0) {
|
||||
ord = values().length - 1;
|
||||
}
|
||||
return values()[ord];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user