IndustrialWires/src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java

293 lines
7.5 KiB
Java
Raw Normal View History

/*
* This file is part of Industrial Wires.
* Copyright (C) 2016-2017 malte0811
*
* Industrial Wires is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Industrial Wires is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
*/
package malte0811.industrialWires.controlpanel;
import malte0811.industrialWires.IndustrialWires;
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanel;
import malte0811.industrialWires.client.RawQuad;
import malte0811.industrialWires.client.gui.GuiPanelCreator;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagByte;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagInt;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.Vec3d;
import org.lwjgl.util.vector.Vector3f;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.function.BiConsumer;
public class LightedButton extends PanelComponent implements IConfigurableComponent {
public int color = 0xFF0000;
public boolean active;
public boolean latching;
public int rsOutputId;
public int rsOutputChannel;
private int ticksTillOff;
private Set<BiConsumer<Integer, Byte>> rsOut = new HashSet<>();
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
public LightedButton() {
super("lighted_button");
}
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
public LightedButton(int color, boolean active, boolean latching, int rsOutputId, int rsOutputChannel) {
this();
this.color = color;
this.active = active;
this.latching = latching;
this.rsOutputChannel = rsOutputChannel;
this.rsOutputId = rsOutputId;
}
@Override
protected void writeCustomNBT(NBTTagCompound nbt, boolean toItem) {
nbt.setInteger(COLOR, color);
if (!toItem) {
nbt.setInteger("timeout", ticksTillOff);
nbt.setBoolean("active", active);
}
nbt.setBoolean(LATCHING, latching);
nbt.setInteger(RS_CHANNEL, rsOutputChannel);
nbt.setInteger(RS_ID, rsOutputId);
}
@Override
protected void readCustomNBT(NBTTagCompound nbt) {
color = nbt.getInteger(COLOR);
ticksTillOff = nbt.getInteger("timeout");
active = nbt.getBoolean("active");
latching = nbt.getBoolean(LATCHING);
rsOutputChannel = nbt.getInteger(RS_CHANNEL);
rsOutputId = nbt.getInteger(RS_ID);
}
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
private final static float size = .0625F;
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
@Override
public List<RawQuad> getQuads() {
float[] color = PanelUtils.getFloatColor(active, this.color);
List<RawQuad> ret = new ArrayList<>(5);
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
PanelUtils.addColoredBox(color, GRAY, null, new Vector3f(0, 0, 0), new Vector3f(size, size / 2, size), ret, false);
if (active) {
ret.get(0).light = 0xff0ff;
}
return ret;
}
@Override
@Nonnull
public PanelComponent copyOf() {
LightedButton ret = new LightedButton(color, active, latching, rsOutputId, rsOutputChannel);
ret.setX(x);
ret.setY(y);
ret.panelHeight = panelHeight;
return ret;
}
@Nonnull
@Override
public AxisAlignedBB getBlockRelativeAABB() {
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
if (aabb == null) {
aabb = new AxisAlignedBB(x, 0, y, x + size, getHeight(), y + size);
}
return aabb;
}
@Override
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
public void interactWith(Vec3d hitRel, TileEntityPanel tile, EntityPlayerMP player) {
if (!latching && active) {
2017-05-26 17:02:07 +02:00
ticksTillOff = 10;
tile.markDirty();
tile.triggerRenderUpdate();
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
return;
}
setOut(!active, tile);
if (!latching) {
ticksTillOff = 10;
}
tile.markDirty();
tile.triggerRenderUpdate();
}
@Override
public void update(TileEntityPanel tile) {
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
if (!latching && ticksTillOff > 0) {
ticksTillOff--;
tile.markDirty();
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
if (ticksTillOff == 0) {
setOut(false, tile);
}
}
}
@Override
public void registerRSOutput(int id, @Nonnull BiConsumer<Integer, Byte> out) {
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
if (id == rsOutputId) {
rsOut.add(out);
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
out.accept(rsOutputChannel, (byte) (active ? 15 : 0));
}
}
@Override
public void unregisterRSOutput(int id, @Nonnull BiConsumer<Integer, Byte> out) {
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
if (id == rsOutputId) {
rsOut.remove(out);
}
}
@Override
public float getHeight() {
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
return size / 2;
}
@Override
public void renderInGUI(GuiPanelCreator gui) {
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
renderInGUIDefault(gui, 0xff000000 | color);
}
@Override
public void invalidate(TileEntityPanel te) {
setOut(false, te);
}
private void setOut(boolean on, TileEntityPanel tile) {
active = on;
tile.markDirty();
tile.triggerRenderUpdate();
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
for (BiConsumer<Integer, Byte> rs : rsOut) {
rs.accept(rsOutputChannel, (byte) (active ? 15 : 0));
}
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
LightedButton that = (LightedButton) o;
if (color != that.color) return false;
if (active != that.active) return false;
return latching == that.latching;
}
@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + color;
result = 31 * result + (active ? 1 : 0);
result = 31 * result + (latching ? 1 : 0);
return result;
}
@Override
public void applyConfigOption(ConfigType type, int id, NBTBase value) {
switch (type) {
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
case BOOL:
if (id == 0) {
latching = ((NBTTagByte) value).getByte() != 0;
}
break;
case RS_CHANNEL:
if (id == 0) {
rsOutputChannel = ((NBTTagByte) value).getByte();
}
break;
case INT:
if (id == 0) {
rsOutputId = ((NBTTagInt) value).getInt();
}
break;
case FLOAT:
color = PanelUtils.setColor(color, id, value);
break;
}
}
@Override
public String fomatConfigName(ConfigType type, int id) {
switch (type) {
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
case BOOL:
return I18n.format(IndustrialWires.MODID + ".desc.latching");
case RS_CHANNEL:
case INT:
return null;
case FLOAT:
return I18n.format(IndustrialWires.MODID + ".desc." + (id == 0 ? "red" : (id == 1 ? "green" : "blue")));
default:
return "INVALID";
}
}
@Override
public String fomatConfigDescription(ConfigType type, int id) {
switch (type) {
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
case BOOL:
return I18n.format(IndustrialWires.MODID + ".desc.latching_info");
case RS_CHANNEL:
return I18n.format(IndustrialWires.MODID + ".desc.rschannel_info");
case INT:
return I18n.format(IndustrialWires.MODID + ".desc.rsid_info");
case FLOAT:
return null;
default:
return "INVALID?";
}
}
@Override
public RSChannelConfig[] getRSChannelOptions() {
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
return new RSChannelConfig[]{new RSChannelConfig("channel", 0, 0, (byte) rsOutputChannel)};
}
@Override
public IntConfig[] getIntegerOptions() {
return new IntConfig[]{new IntConfig("rsId", 0, 50, rsOutputId, 2, false)};
}
@Override
public BoolConfig[] getBooleanOptions() {
return new BoolConfig[]{new BoolConfig("latching", 0, 70, latching)};
}
@Override
public FloatConfig[] getFloatOptions() {
float[] color = PanelUtils.getFloatColor(true, this.color);
int x = 70;
int yOffset = 10;
return new FloatConfig[]{
new FloatConfig("red", x, yOffset, color[0], 60),
Glowing components like the indicator light actuall glow in the dark now Some bugfixes Complete code reformatting (Cherry-picked) # Conflicts: # src/main/java/malte0811/industrialWires/IndustrialWires.java # src/main/java/malte0811/industrialWires/blocks/BlockIWBase.java # src/main/java/malte0811/industrialWires/blocks/EnergyAdapter.java # src/main/java/malte0811/industrialWires/blocks/ItemBlockIW.java # src/main/java/malte0811/industrialWires/blocks/TileEntityJacobsLadder.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanelCreator.java # src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityRSPanelConn.java # src/main/java/malte0811/industrialWires/blocks/converter/BlockMechanicalConverter.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityIEMotor.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechICtoIE.java # src/main/java/malte0811/industrialWires/blocks/converter/TileEntityMechIEtoIC.java # src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java # src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java # src/main/java/malte0811/industrialWires/client/ClientEventHandler.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelComponent.java # src/main/java/malte0811/industrialWires/client/gui/GuiPanelCreator.java # src/main/java/malte0811/industrialWires/client/gui/elements/GuiIntChooser.java # src/main/java/malte0811/industrialWires/containers/ContainerPanelCreator.java # src/main/java/malte0811/industrialWires/containers/ContainerRSPanelConn.java # src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java # src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java # src/main/java/malte0811/industrialWires/controlpanel/PanelComponent.java # src/main/java/malte0811/industrialWires/controlpanel/PanelUtils.java # src/main/java/malte0811/industrialWires/controlpanel/Slider.java # src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java # src/main/java/malte0811/industrialWires/items/ItemIC2Coil.java # src/main/java/malte0811/industrialWires/items/ItemPanelComponent.java # src/main/java/malte0811/industrialWires/network/MessageGUIInteract.java # src/main/java/malte0811/industrialWires/network/MessagePanelInteract.java # src/main/java/malte0811/industrialWires/util/MiscUtils.java
2017-05-11 16:39:20 +02:00
new FloatConfig("green", x, yOffset + 20, color[1], 60),
new FloatConfig("blue", x, yOffset + 40, color[2], 60)
};
}
@Override
public int getColor() {
return color;
}
}