use of net.silentchaos512.utils.Color in project SilentGems by SilentChaos512.
the class ModParts method init.
public static void init() {
// Head and deco
ToolPartRegistry.putPart(new ToolPartFlint());
// ToolPartRegistry.putPart(new ToolPartGlass());
for (EnumGem gem : EnumGem.values()) ToolPartRegistry.putPart(new ToolPartGem(gem, false));
for (EnumGem gem : EnumGem.values()) ToolPartRegistry.putPart(new ToolPartGem(gem, true));
// Rods @formatter:off
ToolPartRegistry.putPart(new ToolPartRodGems("RodWood", EnumMaterialTier.MUNDANE, new ItemStack(Items.STICK), 0x896727, "stickWood", 1.0f, 1.0f, 1.0f, 1.0f, 0.8f));
ToolPartRegistry.putPart(new ToolPartRodGems("RodBone", EnumMaterialTier.MUNDANE, new ItemStack(Items.BONE), 0xFFFDE9, 1.1f, 1.0f, 1.1f, 0.9f, 1.0f));
ToolPartRegistry.putPart(new ToolPartRodGems("RodIron", EnumMaterialTier.REGULAR, ModItems.craftingMaterial.toolRodIron, 0xA2A2A2, "stickIron", 1.25f, 1.0f, 1.0f, 1.0f, 0.9f));
ToolPartRegistry.putPart(new ToolPartRodGems("RodGold", EnumMaterialTier.SUPER, ModItems.craftingMaterial.toolRodGold, 0xC8AE09, "stickGold", 1.15f, 1.0f, 1.15f, 1.0f, 1.0f));
ToolPartRegistry.putPart(new ToolPartRodGems("RodSilver", EnumMaterialTier.SUPER, ModItems.craftingMaterial.toolRodSilver, 0xF2F2F2, "stickSilver", 1.0f, 1.15f, 1.0f, 1.15f, // @formatter:on
1.0f));
// Tips
ToolPartRegistry.putPart(new ToolPartTipGems("TipIron", EnumTipUpgrade.IRON));
ToolPartRegistry.putPart(new ToolPartTipGems("TipGold", EnumTipUpgrade.GOLD));
ToolPartRegistry.putPart(new ToolPartTipGems("TipDiamond", EnumTipUpgrade.DIAMOND));
ToolPartRegistry.putPart(new ToolPartTipGems("TipEmerald", EnumTipUpgrade.EMERALD));
// Wool
for (EnumDyeColor color : EnumDyeColor.values()) {
ToolPartRegistry.putPart(new ToolPartWool(color));
}
}
use of net.silentchaos512.utils.Color in project SilentGems by SilentChaos512.
the class ItemTeleporterLinker method renderGameOverlay.
@SideOnly(Side.CLIENT)
public void renderGameOverlay(RenderGameOverlayEvent event) {
if (event.getType() != ElementType.TEXT) {
return;
}
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.player;
ItemStack heldItem = mc.player.getHeldItem(EnumHand.MAIN_HAND);
if (StackHelper.isEmpty(heldItem)) {
heldItem = mc.player.getHeldItem(EnumHand.OFF_HAND);
}
if (StackHelper.isValid(heldItem) && heldItem.getItem() == this) {
ScaledResolution res = new ScaledResolution(mc);
FontRenderer fontRender = mc.fontRendererObj;
int width = res.getScaledWidth();
int height = res.getScaledHeight();
String str;
if (isLinked(heldItem)) {
DimensionalPosition pos = getLinkedPosition(heldItem);
double x = pos.x - player.posX;
double z = pos.z - player.posZ;
int distance = (int) Math.sqrt(x * x + z * z);
LocalizationHelper loc = SilentGems.instance.localizationHelper;
str = loc.getItemSubText(itemName, "Distance", distance);
int textX = width / 2 - fontRender.getStringWidth(str) / 2;
int textY = height * 3 / 5;
// Text colored differently depending on situation.
// Outside free range, same dimension
int color = 0xffff00;
if (pos.dim != player.dimension) {
// Different dimension
color = 0xff6600;
str = loc.getItemSubText(itemName, "DifferentDimension");
} else if (distance < GemsConfig.TELEPORTER_FREE_RANGE) {
// Inside free range
color = 0x00aaff;
}
fontRender.drawStringWithShadow(str, textX, textY, color);
}
}
}
use of net.silentchaos512.utils.Color in project SilentGems by SilentChaos512.
the class GuiMaterialGrader method drawDebugInfo.
private void drawDebugInfo() {
if (!(tileInventory instanceof TileMaterialGrader)) {
return;
}
TileMaterialGrader tile = (TileMaterialGrader) tileInventory;
FontRenderer fontRender = mc.fontRendererObj;
int x = 5;
int y = 5;
int yIncrement = 10;
int color = 0xFFFFFF;
GlStateManager.pushMatrix();
float scale = 1f;
GlStateManager.scale(scale, scale, 1f);
for (String str : tile.getDebugLines()) {
fontRender.drawStringWithShadow(str, x, y, color);
y += yIncrement;
}
GlStateManager.popMatrix();
}
use of net.silentchaos512.utils.Color in project SilentGems by SilentChaos512.
the class ArmorModelRenderer method setRenderColor.
protected void setRenderColor(int color) {
Color c = new Color(color);
GlStateManager.color(c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha());
}
use of net.silentchaos512.utils.Color in project SilentGems by SilentChaos512.
the class GuiChaosBar method onRenderGameOverlay.
@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent event) {
if (event.isCancelable() || event.getType() != ElementType.TEXT) {
return;
}
currentTime = ClientTickHandler.ticksInGame;
if (currentTime > lastUpdateTime + POPUP_TIME) {
return;
}
ScaledResolution res = new ScaledResolution(mc);
int posX, posY;
float scale;
final Color color = new Color(1f, 1f, 1f, 0.75f);
final int barWidth = 80;
final int barHeight = 8;
final float xOffset = 0.5f;
final float yOffset = 0.15f;
final float fraction = (float) currentChaos / maxChaos;
GlStateManager.disableLighting();
GlStateManager.enableBlend();
scale = 1.0f;
if (scale > 0f) {
GlStateManager.pushMatrix();
posX = (int) (res.getScaledWidth() / scale * xOffset - barWidth / 2);
posY = (int) (res.getScaledHeight() / scale * yOffset);
GlStateManager.scale(scale, scale, 1);
drawBar(posX, posY + 0.5f, barWidth, barHeight - 1f, color, fraction);
drawBarFrame(posX, posY, barWidth, barHeight, new Color(1f, 1f, 1f, 1f));
// String line = "" + currentChaos;
// int lineWidth = mc.fontRendererObj.getStringWidth(line);
// mc.fontRendererObj.drawStringWithShadow(line, res.getScaledWidth() * xOffset - lineWidth / 2,
// res.getScaledHeight() * (yOffset + 0.025f), 0xFFFFFF);
GlStateManager.popMatrix();
}
// GlStateManager.disableBlend();
// GlStateManager.enableLighting();
}
Aggregations