Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

Commit

Permalink
update to 1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
cyilin committed Jun 11, 2017
1 parent 74fe387 commit ca4fbad
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ jdk:
before_deploy:
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"
- git tag ZyinsHUD-1.11.2-1.5.4.${TRAVIS_BUILD_NUMBER}
- git tag ZyinsHUD-1.12-1.5.5.${TRAVIS_BUILD_NUMBER}
- git push -q ${GITHUB_REPO} --tags
deploy:
provider: releases
api_key:
secure: HXomfzSScNHsqKBlgV4mLYrEoo/+19lIWoYtnngdq1S3kyKllbDrDGuw8jchpUD5PsFE42KMia6qOKWUXvcBNN6ZFH7WTlr+Tm9JvcmF/y5U1WmXyTTodmJggIG8SqCAt9hlwLapYY+b2X38U0BDDgv7886Kje4EhDr2jP4v9voSHLEJjI+U5SmtkRsehTJ73P3X2L3K12b6MDr/zGZ6QlWoS6gcBqC62Bm4Uyr+XcxSSU/Z1Wgh/qnQRBbz+sFfXWuzJhJig1jqFws7nJFBxDpai6I+5kOrZ0efZMDgR/tQVw6erZ58J4rxozfdCX9a05PFOeX5ddaeNmUqtm3r97+49I4fzZMHoDwX8gXrxO6k5LYixYYIUZfkLV/kvFll8aSL9UBVtEr3geVpicQ7J7lb2NLhNBdf3kmU9KT6XYDvzQjYrNd8F0e39YbW4pAhi7zVjbNbwcSkkxrDkE5vM9gFYX8VoAwHbRISXGBEVowNkokumSvv29QUyp1+Tcvxz5D+jDoo9QvTTHuJ4eWEaKxGlZi61FQQptqvTx2DqV6PiNsl7r/HPpPtjWofWVdYbxfZ8V0uGLI4h7sCg4GU2axKKp84wLXyosQHpEm2KGE61fSLfATLDLmnnfxLo40D21R5lzxTPNdJUyUMzA6+vgRvF709YXeu1cA5TRqekCg=
file:
- build/libs/ZyinsHUD-1.11.2-1.5.4.${TRAVIS_BUILD_NUMBER}.jar
- build/libs/ZyinsHUD-1.12-1.5.5.${TRAVIS_BUILD_NUMBER}.jar
on:
repo: cyilin/zyinhud
tags: false
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
Expand All @@ -24,9 +24,9 @@ plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "1.5.4.%s"
version = "1.5.5.%s"
group= "com.zyin.zyinhud" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "ZyinsHUD-1.11.2"
archivesBaseName = "ZyinsHUD-1.12"

if (System.getenv("TRAVIS_BUILD_NUMBER") != null) {
version = String.format(version, System.getenv("TRAVIS_BUILD_NUMBER"))
Expand All @@ -35,15 +35,15 @@ if (System.getenv("TRAVIS_BUILD_NUMBER") != null) {
}

minecraft {
version = "1.11.2-13.20.0.2252"
version = "1.12-14.21.0.2321"
runDir = "run"

// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not allways work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20170304"
mappings = "snapshot_20170610"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
replaceIn "com/zyin/zyinhud/ZyinHUD.java"
replace "@VERSION@", project.version
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/zyin/zyinhud/ZyinHUD.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class ZyinHUD {

public static final String updateJSON = "https://raw.githubusercontent.com/cyilin/zyinhud-update/master/update.json";

public static final String dependencies = "required-after:forge@[13.20.0.2201,);";
public static final String dependencies = "required-after:forge@[14.21.0.2321,);";

public static final String buildTime = "@BUILD_TIME@";

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/zyin/zyinhud/ZyinHUDRenderer.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.zyin.zyinhud;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.InventoryEffectRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
Expand Down Expand Up @@ -216,7 +216,7 @@ public static void RenderCustomTexture(int x, int y, int u, int v, int width, in
private static void RenderTexture(int x, int y, TextureAtlasSprite textureAtlasSprite, int width, int height, double zLevel)
{
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer worldrenderer = tessellator.getBuffer();
BufferBuilder worldrenderer = tessellator.getBuffer();

//worldrenderer.startDrawingQuads();
worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); //I have no clue what the DefaultVertexFormats are, but field_181707_g works
Expand Down Expand Up @@ -312,7 +312,7 @@ public static void RenderFloatingText(String[] text, float x, float y, float z,
int stringMiddle = textWidth / 2;

Tessellator tessellator = Tessellator.getInstance();
VertexBuffer worldrenderer = tessellator.getBuffer();
BufferBuilder worldrenderer = tessellator.getBuffer();

//GL11.glDisable(GL11.GL_TEXTURE_2D);
GlStateManager.disableTexture2D();
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/zyin/zyinhud/gui/GuiTooltipScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ protected void DrawTooltipScreen(int mouseX, int mouseY)
*/
protected boolean IsButtonMouseovered(int mouseX, int mouseY, GuiButton button)
{
if(mouseX >= button.xPosition && mouseX <= button.xPosition + button.getButtonWidth() &&
mouseY >= button.yPosition)
if(mouseX >= button.x && mouseX <= button.x + button.getButtonWidth() &&
mouseY >= button.y)
{
//for some god-forsaken reason they made GuiButton.getButtonWidth() public but not height,
//so use reflection to grab it
int buttonHeight = button.height;
if(mouseY <= button.yPosition + buttonHeight)
if(mouseY <= button.y + buttonHeight)
return true;
}
return false;
Expand All @@ -154,7 +154,7 @@ protected void RenderTooltipButtonEffect() {
if (GetButtonTooltip(button.id) != null) {
boolean flag = mc.fontRenderer.getUnicodeFlag();
mc.fontRenderer.setUnicodeFlag(true);
mc.fontRenderer.drawString("?", button.xPosition + button.getButtonWidth() - 5, button.yPosition, 0x99FFFFFF);
mc.fontRenderer.drawString("?", button.x + button.getButtonWidth() - 5, button.y, 0x99FFFFFF);
mc.fontRenderer.setUnicodeFlag(flag);
}
}
Expand All @@ -169,7 +169,7 @@ protected void RenderTooltipButtonMouseoverEffect(GuiButton button)
{
boolean flag = mc.fontRenderer.getUnicodeFlag();
mc.fontRenderer.setUnicodeFlag(true);
mc.fontRenderer.drawString(TextFormatting.AQUA + "?", button.xPosition + button.getButtonWidth() - 5, button.yPosition, 0xFFFFFF);
mc.fontRenderer.drawString(TextFormatting.AQUA + "?", button.x + button.getButtonWidth() - 5, button.y, 0xFFFFFF);
mc.fontRenderer.setUnicodeFlag(flag);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/zyin/zyinhud/gui/GuiZyinHUDOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ else if (tabbedPage == tabbedMaxPages - 1)
* @param button
*/
private void AddButtonAt(int column, int row, GuiButton button) {
button.xPosition = tabbedButtonWidth + tabbedButtonX + buttonSpacing * 2 + (buttonWidth + buttonSpacing * 2) * column;
button.yPosition = buttonY + (buttonHeight + buttonSpacing) * row;
button.x = tabbedButtonWidth + tabbedButtonX + buttonSpacing * 2 + (buttonWidth + buttonSpacing * 2) * column;
button.y = buttonY + (buttonHeight + buttonSpacing) * row;

buttonList.add(button);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ public GuiLabeledButton(int buttonId, int x, int y, int widthIn, int heightIn, S
this.buttonLabel = buttonLabel;
}

public void drawButton(Minecraft mc, int mouseX, int mouseY)
@Override
public void func_191745_a(Minecraft mc, int mouseX, int mouseY, float partialTicks)
{
super.drawButton(mc, mouseX, mouseY);
super.func_191745_a(mc, mouseX, mouseY, partialTicks);

if(buttonLabel != null)
mc.fontRenderer.drawStringWithShadow(buttonLabel, this.xPosition + 3, this.yPosition + (height-mc.fontRenderer.FONT_HEIGHT)/2 + 1, 0x55ffffff); //func_175063_a() is drawStringWithShadow()
mc.fontRenderer.drawStringWithShadow(buttonLabel, this.x + 3, this.y + (height-mc.fontRenderer.FONT_HEIGHT)/2 + 1, 0x55ffffff); //func_175063_a() is drawStringWithShadow()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ protected void mouseDragged(Minecraft mc, int x, int y)
{
if (dragging)
{
sliderValue = (float)(x - (xPosition + 4)) / (float)(width - 8);
sliderValue = (float)(x - (this.x + 4)) / (float)(width - 8);

if (sliderValue < 0.0F)
{
Expand All @@ -182,8 +182,8 @@ protected void mouseDragged(Minecraft mc, int x, int y)
}

GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.drawTexturedModalRect(xPosition + (int)(sliderValue * (float)(width - 8)), yPosition, 0, 66, 4, 20);
this.drawTexturedModalRect(xPosition + (int)(sliderValue * (float)(width - 8)) + 4, yPosition, 196, 66, 4, 20);
this.drawTexturedModalRect(this.x + (int)(sliderValue * (float)(width - 8)), this.y, 0, 66, 4, 20);
this.drawTexturedModalRect(this.x + (int)(sliderValue * (float)(width - 8)) + 4, this.y, 196, 66, 4, 20);
}
}

Expand All @@ -195,7 +195,7 @@ public boolean mousePressed(Minecraft mc, int x, int y)
{
if (super.mousePressed(mc, x, y))
{
sliderValue = (float)(x - (xPosition + 4)) / (float)(width - 8);
sliderValue = (float)(x - (this.x + 4)) / (float)(width - 8);

if (sliderValue < 0.0F)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ public GuiNumberSliderWithUndo(int id, int x, int y, int width, int height, Stri
this.defaultValue = defaultValue;
}

public void drawButton(Minecraft mc, int mouseX, int mouseY)
@Override
public void func_191745_a(Minecraft mc, int mouseX, int mouseY, float partialTicks)
{
super.drawButton(mc, mouseX, mouseY);
super.func_191745_a(mc, mouseX, mouseY, partialTicks);

int undoSymbolColor = 0xffffff;
undoSymbolX = xPosition + width - (undoSymbolWidth+1);
undoSymbolY = yPosition + height - (undoSymbolHeight+1);
undoSymbolX = this.x + width - (undoSymbolWidth+1);
undoSymbolY = this.y + height - (undoSymbolHeight+1);

//if mouseovered the undo symbol
if(IsUndoMouseovered(mouseX, mouseY))
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/com/zyin/zyinhud/helper/HUDEntityTrackerHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static void RenderEntityInfo(float partialTickTime)
if (mc.gameSettings.thirdPersonView == 2)
{
// reversed 3rd-person view; flip the look direction
lookDir = new Vec3d(lookDir.xCoord * -1, lookDir.yCoord * -1, lookDir.zCoord * -1);
lookDir = new Vec3d(lookDir.x * -1, lookDir.y * -1, lookDir.z * -1);
}

ScaledResolution res = new ScaledResolution(mc);
Expand Down Expand Up @@ -118,9 +118,9 @@ public static void RenderEntityInfo(float partialTickTime)
// direction to target entity
Vec3d toEntity = new Vec3d(entityX - meX, entityY - meY, entityZ - meZ);

float x = (float)toEntity.xCoord;
float y = (float)toEntity.yCoord;
float z = (float)toEntity.zCoord;
float x = (float)toEntity.x;
float y = (float)toEntity.y;
float z = (float)toEntity.z;

double dist = toEntity.lengthVector();
toEntity = toEntity.normalize();
Expand All @@ -136,9 +136,9 @@ public static void RenderEntityInfo(float partialTickTime)
final double cos = Math.cos(angle);

Vec3d ortho = lookDir.crossProduct(toEntity); // vector orthogonal to look direction and direction to target entity
double ox = ortho.xCoord;
double oy = ortho.yCoord;
double oz = ortho.zCoord;
double ox = ortho.x;
double oy = ortho.y;
double oz = ortho.z;

// build a rotation matrix to rotate around a vector (ortho) by an angle (89 degrees)
// from http://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle
Expand All @@ -154,9 +154,9 @@ public static void RenderEntityInfo(float partialTickTime)

// transform (multiply) look direction vector with rotation matrix and scale by distance to target entity;
// this produces the coordinates for the dummy target
x = (float)(dist * (m00*lookDir.xCoord + m01*lookDir.yCoord + m02*lookDir.zCoord));
y = (float)(dist * (m10*lookDir.xCoord + m11*lookDir.yCoord + m12*lookDir.zCoord));
z = (float)(dist * (m20*lookDir.xCoord + m21*lookDir.yCoord + m22*lookDir.zCoord));
x = (float)(dist * (m00*lookDir.x + m01*lookDir.y + m02*lookDir.z));
y = (float)(dist * (m10*lookDir.x + m11*lookDir.y + m12*lookDir.z));
z = (float)(dist * (m20*lookDir.x + m21*lookDir.y + m22*lookDir.z));
}

FloatBuffer screenCoords = BufferUtils.createFloatBuffer(3);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/zyin/zyinhud/mods/DistanceMeasurer.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ protected static String CalculateDistanceString()
double playerY = mc.player.posY + mc.player.getEyeHeight();
double playerZ = mc.player.posZ;

double blockX = objectMouseOver.hitVec.xCoord;
double blockY = objectMouseOver.hitVec.yCoord;
double blockZ = objectMouseOver.hitVec.zCoord;
double blockX = objectMouseOver.hitVec.x;
double blockY = objectMouseOver.hitVec.y;
double blockZ = objectMouseOver.hitVec.z;

double deltaX;
double deltaY;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/zyin/zyinhud/mods/PotionTimers.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,13 @@ protected static void DrawPotionIcon(int x, int y, Potion potion) {
public static void DisableInventoryPotionEffects(InventoryEffectRenderer guiScreen) {
if (PotionTimers.Enabled && HidePotionEffectsInInventory) {
//Note for future Forge versions: field "field_147045_u" will probably be renamed to something like "playerHasPotionEffects"
boolean playerHasPotionEffects = ObfuscationReflectionHelper.getPrivateValue(InventoryEffectRenderer.class, (InventoryEffectRenderer) guiScreen, "field_147045_u");
boolean playerHasPotionEffects = ObfuscationReflectionHelper.getPrivateValue(InventoryEffectRenderer.class, (InventoryEffectRenderer) guiScreen, "field_147045_u", "hasActivePotionEffects");

if (playerHasPotionEffects) {
int guiLeftPx = (guiScreen.width - 176) / 2;

ObfuscationReflectionHelper.setPrivateValue(GuiContainer.class, (GuiContainer) guiScreen, guiLeftPx, "field_147003_i", "guiLeft");
ObfuscationReflectionHelper.setPrivateValue(InventoryEffectRenderer.class, (InventoryEffectRenderer) guiScreen, false, "field_147045_u");
ObfuscationReflectionHelper.setPrivateValue(InventoryEffectRenderer.class, (InventoryEffectRenderer) guiScreen, false, "field_147045_u", "hasActivePotionEffects");
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/zyin/zyinhud/util/InventoryUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ public static boolean SendUseBlock() {
//boolean
EnumActionResult sendUseBlock_result = mc.playerController.processRightClickBlock(mc.player,
mc.world,
new BlockPos(mc.objectMouseOver.hitVec.xCoord, mc.objectMouseOver.hitVec.yCoord, mc.objectMouseOver.hitVec.zCoord),
new BlockPos(mc.objectMouseOver.hitVec.x, mc.objectMouseOver.hitVec.y, mc.objectMouseOver.hitVec.z),
mc.objectMouseOver.sideHit,
mc.objectMouseOver.hitVec,
EnumHand.MAIN_HAND);
BlockPos pos = new BlockPos(mc.objectMouseOver.hitVec.xCoord, mc.objectMouseOver.hitVec.yCoord, mc.objectMouseOver.hitVec.zCoord);
BlockPos pos = new BlockPos(mc.objectMouseOver.hitVec.x, mc.objectMouseOver.hitVec.y, mc.objectMouseOver.hitVec.z);
boolean sendUseBlock = (sendUseBlock_result == EnumActionResult.SUCCESS);
return sendUseBlock;
}
Expand Down

0 comments on commit ca4fbad

Please sign in to comment.