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.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cyilin committed Dec 29, 2016
1 parent 1253f77 commit 5a9c1c0
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 54 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-1.5.3.${TRAVIS_BUILD_NUMBER}
- git tag ZyinsHUD-1.11.2-1.5.4.${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-1.5.3.${TRAVIS_BUILD_NUMBER}.jar
- build/libs/ZyinsHUD-1.11.2-1.5.4.${TRAVIS_BUILD_NUMBER}.jar
on:
repo: cyilin/zyinhud
tags: false
Expand Down
32 changes: 14 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import java.text.SimpleDateFormat

// For those who want the bleeding edge
buildscript {
Expand All @@ -23,9 +24,9 @@ plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "1.5.3.%s"
version = "1.5.4.%s"
group= "com.zyin.zyinhud" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "ZyinsHUD-1.11"
archivesBaseName = "ZyinsHUD-1.11.2"

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

minecraft {
version = "1.11-13.19.0.2160"
version = "1.11.2-13.20.0.2201"
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_20161124"
mappings = "snapshot_20161228"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}

// https://github.com/MinecraftForge/MinecraftForge/blob/1.10.x/build.gradle#L219
if (System.getenv("TRAVIS_BUILD_NUMBER") != null) {
def file = file("src/main/java/com/zyin/zyinhud/ZyinHUD.java");
def outfile = "";
file.eachLine { String s ->
if (s.matches('^ public static final String VERSION = "[^\\"]+";\$')){
s = " public static final String VERSION = \"${version}\";";
}
outfile += s;
outfile += "\n";
}
file.write(outfile);
replaceIn "com/zyin/zyinhud/ZyinHUD.java"
replace "@VERSION@", project.version
replace "@BUILD_TIME@", buildTime
}

dependencies {
Expand Down Expand Up @@ -103,3 +93,9 @@ processResources
exclude 'mcmod.info'
}
}

def getBuildTime() {
def date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z")
date.setTimeZone(TimeZone.getTimeZone("UTC"))
return date.format(new Date())
}
13 changes: 11 additions & 2 deletions src/main/java/com/zyin/zyinhud/ZyinHUD.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.*;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;

import java.io.File;

Expand All @@ -54,7 +56,7 @@ public class ZyinHUD {
* </ol>
* If incrementing the Minecraft version, also update "curseFilenameParser" in AddVersionChecker()
*/
public static final String VERSION = "1.5.3.0";
public static final String VERSION = "@VERSION@";
/**
* The constant MODID.
*/
Expand All @@ -66,7 +68,9 @@ 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.19.0.2160,);";
public static final String dependencies = "required-after:forge@[13.20.0.2201,);";

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

/**
* The constant proxy.
Expand Down Expand Up @@ -109,6 +113,7 @@ public void preInit(FMLPreInitializationEvent event) {
*/
@EventHandler
public void init(FMLInitializationEvent event) {
log(String.format("version: %s (%s)", VERSION, buildTime));
//load all our Key Handlers
//FMLCommonHandler.instance().bus().register(ZyinHUDKeyHandlers.instance);
MinecraftForge.EVENT_BUS.register(ZyinHUDKeyHandlers.instance);
Expand Down Expand Up @@ -162,5 +167,9 @@ public void AddVersionChecker() {
FMLInterModComms.sendRuntimeMessage(ZyinHUD.MODID, "VersionChecker", "addCurseCheck", compound);
}

public static void log(String msg) {
LogManager.getLogger(MODID).log(Level.INFO, msg);
}

}

2 changes: 1 addition & 1 deletion src/main/java/com/zyin/zyinhud/gui/GuiTooltipScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected boolean IsButtonMouseovered(int mouseX, int mouseY, GuiButton button)
{
//for some god-forsaken reason they made GuiButton.getButtonWidth() public but not height,
//so use reflection to grab it
int buttonHeight = ZyinHUDUtil.GetFieldByReflection(GuiButton.class, button, "height","field_146121_g");
int buttonHeight = button.height;
if(mouseY <= button.yPosition + buttonHeight)
return true;
}
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 @@ -984,9 +984,9 @@ protected void actionPerformed(GuiButton button, int mouseButton) {
button.displayString = GetButtonLabel_Boolean("potiontimers.options.showpotionicons", PotionTimers.ShowPotionIcons);
break;
case 1005: //Toggle text mode
System.out.println("MODE:" + PotionTimers.TextMode);
ZyinHUD.log("MODE:" + PotionTimers.TextMode);
PotionTimers.TextMode.ToggleMode(mouseButton == 0);
System.out.println("MODE:" + PotionTimers.TextMode);
ZyinHUD.log("MODE:" + PotionTimers.TextMode);
button.displayString = GetButtonLabel_String("potiontimers.options.textmode", PotionTimers.TextMode.GetFriendlyName());
break;
case 1007: //Hide default potion effects in inventory
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/zyin/zyinhud/mods/DurabilityInfo.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.zyin.zyinhud.mods;

import com.zyin.zyinhud.ZyinHUD;
import com.zyin.zyinhud.ZyinHUDRenderer;
import com.zyin.zyinhud.ZyinHUDSound;
import com.zyin.zyinhud.gui.GuiZyinHUDOptions;
Expand Down Expand Up @@ -549,7 +550,7 @@ private static void UnequipDamagedArmor()
InventoryUtil.MoveArmorIntoPlayerInventory(i);
ZyinHUDSound.PlayPlopSound();
ZyinHUDRenderer.DisplayNotification(Localization.get("durabilityinfo.name") + Localization.get("durabilityinfo.unequippeditem") + itemStack.getDisplayName());
System.out.println("Unequipped " + itemStack.getDisplayName() + " because it was at low durability (" + itemDamage + "/" + maxDamage + ")");
ZyinHUD.log("Unequipped " + itemStack.getDisplayName() + " because it was at low durability (" + itemDamage + "/" + maxDamage + ")");
}
}
}
Expand Down Expand Up @@ -584,7 +585,7 @@ private static void UnequipDamagedTool()
InventoryUtil.MoveHeldItemIntoPlayerInventory();
ZyinHUDSound.PlayPlopSound();
ZyinHUDRenderer.DisplayNotification(Localization.get("durabilityinfo.name") + Localization.get("durabilityinfo.unequippeditem") + item.getItemStackDisplayName(itemStack));
System.out.println("Unequipped " + item.getItemStackDisplayName(itemStack) + " because it was at low durability (" + itemDamage + "/" + maxDamage + ")");
ZyinHUD.log("Unequipped " + item.getItemStackDisplayName(itemStack) + " because it was at low durability (" + itemDamage + "/" + maxDamage + ")");
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/com/zyin/zyinhud/mods/ItemSelector.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.zyin.zyinhud.mods;

import com.zyin.zyinhud.util.ZyinHUDUtil;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
Expand All @@ -19,8 +18,6 @@
import com.zyin.zyinhud.util.InventoryUtil;
import com.zyin.zyinhud.util.Localization;

import java.util.ArrayList;

/**
* Item Selector allows the player to conveniently swap their currently selected
* hotbar item with something in their inventory.
Expand Down Expand Up @@ -367,7 +364,7 @@ public static void RenderOntoHUD(float partialTicks)

if (!itemStack.isEmpty())
{
float anim = (int) ZyinHUDUtil.GetFieldByReflection(ItemStack.class, itemStack, "animationsToGo", "field_77992_b") - partialTicks;
float anim = itemStack.getAnimationsToGo() - partialTicks;
int dimX = originX + (x * 20) + 3;
int dimZ = originZ + (z * 22) + 3;

Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/zyin/zyinhud/mods/Miscellaneous.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.zyin.zyinhud.mods;

import com.zyin.zyinhud.ZyinHUD;
import net.minecraft.client.gui.GuiRepair;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.inventory.GuiEditSign;
import net.minecraft.inventory.ContainerRepair;
import net.minecraft.inventory.IInventory;
Expand Down Expand Up @@ -81,8 +81,8 @@ public void DrawGuiRepairCounts(GuiRepair guiRepair) {
ContainerRepair anvil = ZyinHUDUtil.GetFieldByReflection(GuiRepair.class, guiRepair, "anvil", "field_147092_v");
IInventory inputSlots = ZyinHUDUtil.GetFieldByReflection(ContainerRepair.class, anvil, "inputSlots", "field_82853_g");

int xSize = ZyinHUDUtil.GetFieldByReflection(GuiContainer.class, guiRepair, "xSize", "field_146999_f");
int ySize = ZyinHUDUtil.GetFieldByReflection(GuiContainer.class, guiRepair, "ySize", "field_147000_g");
int xSize = guiRepair.getXSize();
int ySize = guiRepair.getYSize();

int guiRepairXOrigin = guiRepair.width/2 - xSize/2;
int guiRepairYOrigin = guiRepair.height/2 - ySize/2;
Expand Down Expand Up @@ -181,19 +181,19 @@ public static void MoveMouseoveredBlockIntoHotbar() {
//Item blockItem = Item.getItemFromBlock(block);

//first, scan the hotbar to see if the mouseovered block already exists on the hotbar
System.out.println("checking hotbar...");
ZyinHUD.log("checking hotbar...");
int itemIndexInHotbar = InventoryUtil.GetItemIndexFromHotbar(blockPos);
System.out.println("returned "+itemIndexInHotbar);
ZyinHUD.log("returned "+itemIndexInHotbar);
if(itemIndexInHotbar > 0)
{
//if it does then do nothing since Minecraft takes care of it already
}
else
{
//if it is not on the hotbar, check to see if it is in our inventory
System.out.println("checking inventory...");
ZyinHUD.log("checking inventory...");
int itemIndexInInventory = InventoryUtil.GetItemIndexFromInventory(blockPos);
System.out.println("returned "+itemIndexInInventory);
ZyinHUD.log("returned "+itemIndexInInventory);
if(itemIndexInInventory > 0)
{
//if it is in our inventory, swap it out to the hotbar
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/zyin/zyinhud/mods/PlayerLocator.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.minecraft.entity.item.EntityBoat;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntityWitherSkeleton;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntityPig;
Expand Down
17 changes: 7 additions & 10 deletions src/main/java/com/zyin/zyinhud/mods/SafeOverlay.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.zyin.zyinhud.util.Localization;
import com.zyin.zyinhud.util.ZyinHUDUtil;
import net.minecraft.block.*;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
Expand All @@ -14,10 +15,6 @@
import java.util.Collections;
import java.util.List;

//import net.minecraft.block.BlockFluid;
//import net.minecraft.block.BlockHalfSlab;
//import net.minecraftforge.event.ForgeSubscribe;

/**
* The Safe Overlay renders an overlay onto the game world showing which areas
* mobs can spawn on.
Expand Down Expand Up @@ -305,8 +302,8 @@ public void RenderAllUnsafePositionsMultithreaded(float partialTickTime) {

GL11.glPushMatrix();
GL11.glTranslated(-x, -y, -z); //go from cartesian x,y,z coordinates to in-world x,y,z coordinates
GL11.glDisable(GL11.GL_TEXTURE_2D); //fixes color rendering bug (we aren't rendering textures)
GL11.glDisable(GL11.GL_LIGHTING);
GlStateManager.disableTexture2D(); //fixes color rendering bug (we aren't rendering textures)
GlStateManager.disableLighting();

//BLEND and ALPHA allow for color transparency
GL11.glEnable(GL11.GL_BLEND);
Expand All @@ -324,10 +321,10 @@ public void RenderAllUnsafePositionsMultithreaded(float partialTickTime) {
for (Position position : unsafePositions) {
RenderUnsafeMarker(position);
}
GL11.glColor4f(0, 0, 0, 1); //change alpha back to 100% after we're done rendering

//GL11.glColor4f(0, 0, 0, 1); //change alpha back to 100% after we're done rendering
GL11.glEnd();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GlStateManager.enableTexture2D();
GlStateManager.enableLighting();
//GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ZERO); //puts blending back to normal, fixes bad HD texture rendering
GL11.glDisable(GL11.GL_BLEND); //fixes [Journeymap] beacons being x-rayed as well
GL11.glPopMatrix();
Expand Down Expand Up @@ -417,7 +414,7 @@ protected void RenderUnsafeMarker(Position position) {
//since we are using doubles it causes the marks to 'flicker' when very far from spawn (~5000 blocks)
//if we use GL11.glVertex3i(int, int, int) it fixes the issue but then we can't render the marks
//precisely where we want to
GL11.glColor4f(r, g, b, alpha); //alpha must be > 0.1
GlStateManager.color(r, g, b, alpha); //alpha must be > 0.1
GL11.glVertex3d(maxX, maxY, maxZ);
GL11.glVertex3d(minX, maxY, minZ);
GL11.glVertex3d(maxX, maxY, minZ);
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/zyin/zyinhud/util/InventoryUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -822,16 +822,16 @@ public static boolean DepositAllMatchingItemsInBrewingStand() {
if (!handStack.isEmpty()) {
if (!inputStack.isEmpty() && handStack.isItemEqual(inputStack)) {
LeftClickContainerSlot(3);
} else if (handStack.getItemDamage() == 0 && Items.POTIONITEM == handStack.getItem()) {
} else if (Items.POTIONITEM == handStack.getItem() && !handStack.hasEffect()) {
//if handStack is a "Water Bottle"
//then deposit the water bottle in an empty output slot
if (outputStack1 == null) {
if (outputStack1.isEmpty()) {
LeftClickContainerSlot(0);
outputStack1 = mc.player.openContainer.inventorySlots.get(0).getStack();
} else if (outputStack2 == null) {
} else if (outputStack2.isEmpty()) {
LeftClickContainerSlot(1);
outputStack2 = mc.player.openContainer.inventorySlots.get(1).getStack();
} else if (outputStack3 == null) {
} else if (outputStack3.isEmpty()) {
LeftClickContainerSlot(2);
outputStack3 = mc.player.openContainer.inventorySlots.get(2).getStack();
}
Expand All @@ -848,7 +848,7 @@ public static boolean DepositAllMatchingItemsInBrewingStand() {
if (!itemStack.isEmpty()) {
if (!inputStack.isEmpty() && itemStack.isItemEqual(inputStack)) {
DepositItemInBrewingStand(i, 3);
} else if (itemStack.getItemDamage() == 0 && Items.POTIONITEM == itemStack.getItem()) {
} else if (Items.POTIONITEM == itemStack.getItem() && !itemStack.hasEffect()) {
//if itemStack is a "Water Bottle"
//then deposit the water bottle in an empty output slot
if (outputStack1.isEmpty()) {
Expand Down

0 comments on commit 5a9c1c0

Please sign in to comment.