mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
fixed boxduct color, leftover teleporter GUI, telepad mapping
This commit is contained in:
parent
08076885cf
commit
6733698a6b
@ -267,13 +267,6 @@ public class GUIHandler implements IGuiHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_machine_teleporter: {
|
||||
if(entity instanceof TileEntityMachineTeleporter) {
|
||||
// return new ContainerMachineTeleporter(player.inventory, (TileEntityMachineTeleporter) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_nuke_custom: {
|
||||
if(entity instanceof TileEntityNukeCustom) {
|
||||
return new ContainerNukeCustom(player.inventory, (TileEntityNukeCustom) entity);
|
||||
@ -1057,13 +1050,6 @@ public class GUIHandler implements IGuiHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_machine_teleporter: {
|
||||
if(entity instanceof TileEntityMachineTeleporter) {
|
||||
return new GUIMachineTeleporter(player.inventory, (TileEntityMachineTeleporter) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_nuke_custom: {
|
||||
if(entity instanceof TileEntityNukeCustom) {
|
||||
return new GUINukeCustom(player.inventory, (TileEntityNukeCustom) entity);
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerMachineTeleporter;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineTeleporter;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineTeleporter extends GuiContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(
|
||||
RefStrings.MODID + ":textures/gui/gui_teleporter.png");
|
||||
private TileEntityMachineTeleporter diFurnace;
|
||||
|
||||
public GUIMachineTeleporter(InventoryPlayer invPlayer, TileEntityMachineTeleporter tedf) {
|
||||
super(new ContainerMachineTeleporter(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 86;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = I18n.format("container.teleporter");
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString("Power: " + diFurnace.power + "HE/" + TileEntityMachineTeleporter.maxPower + "HE", 10, 20,
|
||||
13882323);
|
||||
this.fontRendererObj.drawString("Mode: " + (diFurnace.mode ? "Send" : "Receive"), 10, 29, 13882323);
|
||||
if (diFurnace.mode) {
|
||||
this.fontRendererObj.drawString("Destination X: " + diFurnace.targetX, 10, 38, 13882323);
|
||||
this.fontRendererObj.drawString("Destination Y: " + diFurnace.targetY, 10, 47, 13882323);
|
||||
this.fontRendererObj.drawString("Destination Z: " + diFurnace.targetZ, 10, 56, 13882323);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
}
|
||||
@ -991,6 +991,7 @@ public class MainRegistry {
|
||||
ignoreMappings.add("hbm:tile.test_conductor");
|
||||
ignoreMappings.add("hbm:tile.dummy_block_fluidtank");
|
||||
ignoreMappings.add("hbm:tile.dummy_port_fluidtank");
|
||||
ignoreMappings.add("hbm:item.telepad");
|
||||
|
||||
/// REMAP ///
|
||||
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.network.TileEntityPipeBaseNT;
|
||||
import com.hbm.util.ColorUtil;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
@ -69,7 +70,7 @@ public class RenderBoxDuct implements ISimpleBlockRenderingHandler {
|
||||
TileEntityPipeBaseNT pipe = (TileEntityPipeBaseNT) te;
|
||||
type = pipe.getType();
|
||||
if(meta % 3 == 2) {
|
||||
FluidDuctBox.cachedColor = type.getColor();
|
||||
FluidDuctBox.cachedColor = ColorUtil.lightenColor(type.getColor(), 0.25D); //making very dark things not vantablack
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ public class RBMKDials {
|
||||
* @return [0;1]
|
||||
*/
|
||||
public static double getColumnHeatFlow(World world) {
|
||||
return MathHelper.clamp_double(GameRuleHelper.parseDouble(world.getGameRules().getGameRuleStringValue(KEY_COLUMN_HEAT_FLOW), 5.0D), 0.0D, 1.0D);
|
||||
return MathHelper.clamp_double(GameRuleHelper.parseDouble(world.getGameRules().getGameRuleStringValue(KEY_COLUMN_HEAT_FLOW), 0.2D), 0.0D, 1.0D);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -156,4 +156,30 @@ public class ColorUtil {
|
||||
public static int amplifyColor(int hex) {
|
||||
return amplifyColor(hex, 255);
|
||||
}
|
||||
|
||||
/**
|
||||
* Amplifies a given color by approaching all components to maximum by a given percentage. A percentage of 1 (100%) should always yield white.
|
||||
* @param hex
|
||||
* @param percent
|
||||
* @return
|
||||
*/
|
||||
public static int lightenColor(int hex, double percent) {
|
||||
Color color = new Color(hex);
|
||||
int r = color.getRed();
|
||||
int g = color.getGreen();
|
||||
int b = color.getBlue();
|
||||
|
||||
r = (int) (r + (255 - r) * percent);
|
||||
g = (int) (g + (255 - g) * percent);
|
||||
b = (int) (b + (255 - b) * percent);
|
||||
|
||||
return new Color(r, g, b).getRGB();
|
||||
}
|
||||
|
||||
/** Converts a color into HSB and then returns the brightness component [] */
|
||||
public static double getColorBrightness(int hex) {
|
||||
Color color = new Color(hex);
|
||||
float[] hsb = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), new float[3]);
|
||||
return hsb[2];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user