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

Commit

Permalink
update to forge1.11-13.19.0.2141
Browse files Browse the repository at this point in the history
  • Loading branch information
cyilin committed Nov 17, 2016
1 parent 61b97b6 commit dd43937
Show file tree
Hide file tree
Showing 37 changed files with 200 additions and 173 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.10.2-1.5.2.${TRAVIS_BUILD_NUMBER}
- git tag ZyinsHUD-1.11-1.5.3.${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.10.2-1.5.2.${TRAVIS_BUILD_NUMBER}.jar
- build/libs/ZyinsHUD-1.11-1.5.3.${TRAVIS_BUILD_NUMBER}.jar
on:
repo: cyilin/zyinhud
tags: false
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "1.5.2.%s"
version = "1.5.3.%s"
group= "com.zyin.zyinhud" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "ZyinsHUD-1.10.2"
archivesBaseName = "ZyinsHUD-1.11"

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

minecraft {
version = "1.10.2-12.18.2.2125"
version = "1.11-13.19.0.2141"
runDir = "run"

// the mappings can be changed at any time, and must be in the following format.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/zyin/zyinhud/ZyinHUD.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class ZyinHUD {
* </ol>
* If incrementing the Minecraft version, also update "curseFilenameParser" in AddVersionChecker()
*/
public static final String VERSION = "1.5.2.0";
public static final String VERSION = "1.5.3.0";
/**
* The constant MODID.
*/
Expand All @@ -66,7 +66,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@[12.18.1.2094,);";
public static final String dependencies = "required-after:forge@[13.19.0.2141,);";

/**
* The constant proxy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import net.minecraft.client.entity.EntityOtherPlayerMP;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.SkeletonType;
import net.minecraft.entity.monster.EntityWitherSkeleton;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.Vec3d;
Expand Down Expand Up @@ -107,7 +106,7 @@ public static void RenderEntityInfo(float partialTickTime)
//only track entities that we are tracking (i.e. other players/wolves/witherskeletons)
if(!(object instanceof EntityOtherPlayerMP ||
object instanceof EntityWolf ||
(object instanceof EntitySkeleton) && ((EntitySkeleton)object).getSkeletonType() == SkeletonType.WITHER))
object instanceof EntityWitherSkeleton))
continue;

Entity entity = (Entity)object;
Expand Down
68 changes: 40 additions & 28 deletions src/main/java/com/zyin/zyinhud/mods/AnimalInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

/**
* Shows information about horses in the F3 menu.
Expand Down Expand Up @@ -208,26 +207,26 @@ public static void SetNumberOfDecimalsDisplayed(int numDecimals) {
public static void RenderOntoDebugMenu() {
//if F3 is shown
if (AnimalInfo.Enabled && ShowHorseStatsOnF3Menu && mc.gameSettings.showDebugInfo) {
if (mc.thePlayer.isRidingHorse()) {
EntityHorse horse = (EntityHorse) mc.thePlayer.getRidingEntity();
if (mc.thePlayer.isRidingHorse() ||
mc.thePlayer.isRiding() && mc.thePlayer.getRidingEntity() instanceof EntityLlama) {
AbstractHorse horse = (AbstractHorse) mc.thePlayer.getRidingEntity();
String horseSpeedMessage = Localization.get("animalinfo.debug.speed") + " " + GetHorseSpeedText(horse) + " m/s";
String horseJumpMessage = Localization.get("animalinfo.debug.jump") + " " + GetHorseJumpText(horse) + " blocks";
String horseHPMessage = Localization.get("animalinfo.debug.hp") + " " + GetHorseHPText(horse);
String horseColor = Localization.get("animalinfo.debug.color") + " " + GetHorseColoringText(horse);
String horseMarking = Localization.get("animalinfo.debug.markings") + " " + GetHorseMarkingText(horse);

List list = new ArrayList<String>(5);

ArrayList<String> list = new ArrayList<String>();
list.add(horseSpeedMessage);
list.add(horseJumpMessage);
list.add(horseHPMessage);

if (horse.getHorseVariant() != 0) //not a donkey
{
if (horse instanceof EntityLlama) {
String llamaStrength = Localization.get("animalinfo.debug.strength") + " " + GetLlamaStrength((EntityLlama) horse);
list.add(llamaStrength);
} else if (horse instanceof EntityHorse) {
String horseColor = Localization.get("animalinfo.debug.color") + " " + GetHorseColoringText(horse);
String horseMarking = Localization.get("animalinfo.debug.markings") + " " + GetHorseMarkingText(horse);
list.add(horseColor);
list.add(horseMarking);
}

for (int i = 0; i < list.size(); ++i) {
String s = (String) list.get(i);

Expand Down Expand Up @@ -299,17 +298,20 @@ protected static void RenderAnimalOverlay(EntityAgeable animal, float partialTic
//a positive value means the horse has bred recently
int animalGrowingAge = animal.getGrowingAge();

ArrayList multilineOverlayArrayList = new ArrayList(4);
ArrayList<String> multilineOverlayArrayList = new ArrayList();

if (ShowHorseStatsOverlay && animal instanceof EntityHorse) {
EntityHorse horse = (EntityHorse) animal;
if (ShowHorseStatsOverlay && animal instanceof AbstractHorse) {
AbstractHorse horse = (AbstractHorse) animal;

multilineOverlayArrayList.add(GetHorseSpeedText(horse) + " " + Localization.get("animalinfo.overlay.speed"));
multilineOverlayArrayList.add(GetHorseHPText(horse) + " " + Localization.get("animalinfo.overlay.hp"));
multilineOverlayArrayList.add(GetHorseJumpText(horse) + " " + Localization.get("animalinfo.overlay.jump"));
if (animal instanceof EntityLlama) {
multilineOverlayArrayList.add(GetLlamaStrength((EntityLlama) animal) + " " + Localization.get("animalinfo.overlay.strength"));
}

if (animalGrowingAge < 0)
multilineOverlayArrayList.add(GetHorseBabyGrowingAgeAsPercent(horse) + "%");
//if (animalGrowingAge < 0)
// multilineOverlayArrayList.add(GetHorseBabyGrowingAgeAsPercent(horse) + "%");
}
/* Breeding timer info no longer available on client in 1.8
if(ShowBreedingTimers && animal instanceof EntityAgeable)
Expand All @@ -333,7 +335,7 @@ protected static void RenderAnimalOverlay(EntityAgeable animal, float partialTic
!((EntityAnimal) animal).isInLove()) //animal is not currently breeding
{
//render the overlay icon
if (animal instanceof EntityHorse && ((EntityHorse) animal).isTame())
if (animal instanceof AbstractHorse && ((AbstractHorse) animal).isTame())
ZyinHUDRenderer.RenderFloatingItemIcon(x, y + animal.height, z, Items.GOLDEN_CARROT, partialTickTime);
else if (animal instanceof EntityCow)
ZyinHUDRenderer.RenderFloatingItemIcon(x, y + animal.height, z, Items.WHEAT, partialTickTime);
Expand Down Expand Up @@ -385,7 +387,7 @@ public static String CalculateMessageForInfoLine() {
* @param horse
* @return
*/
private static int GetHorseBabyGrowingAgeAsPercent(EntityHorse horse) {
private static int GetHorseBabyGrowingAgeAsPercent(AbstractHorse horse) {
float horseGrowingAge = horse.getHorseSize(); //horse size ranges from 0.5 to 1
return (int) ((horseGrowingAge - 0.5f) * 2.0f * 100f);
}
Expand Down Expand Up @@ -414,7 +416,7 @@ private static String GetTimeUntilBreedAgain(EntityAgeable animal) {
* @param horse
* @return e.x.:<br>aqua "13.5"<br>green "12.5"<br>white "11.3"<br>red "7.0"
*/
private static String GetHorseSpeedText(EntityHorse horse) {
private static String GetHorseSpeedText(AbstractHorse horse) {
double horseSpeed = GetEntityMaxSpeed(horse);
String horseSpeedString = decimalFormat.format(horseSpeed);

Expand All @@ -434,7 +436,7 @@ else if (horseSpeed < badHorseSpeedThreshold)
* @param horse
* @return e.x.:<br>aqua "28"<br>green "26"<br>white "22"<br>red "18"
*/
private static String GetHorseHPText(EntityHorse horse) {
private static String GetHorseHPText(AbstractHorse horse) {
int horseHP = GetEntityMaxHP(horse);
String horseHPString = decimalFormat.format(GetEntityMaxHP(horse));

Expand All @@ -454,7 +456,7 @@ else if (horseHP < badHorseHPThreshold)
* @param horse
* @return e.x.:<br>aqua "15"<br>green "13"<br>white "11"<br>red "9"
*/
private static String GetHorseHeartsText(EntityHorse horse) {
private static String GetHorseHeartsText(AbstractHorse horse) {
int horseHP = GetEntityMaxHP(horse);
int horseHearts = GetEntityMaxHearts(horse);
String horseHeartsString = "" + horseHearts;
Expand All @@ -475,7 +477,7 @@ else if (horseHP < badHorseHPThreshold)
* @param horse
* @return e.x.:<br>aqua "5.4"<br>green "4"<br>white "3"<br>red "1.5"
*/
private static String GetHorseJumpText(EntityHorse horse) {
private static String GetHorseJumpText(AbstractHorse horse) {
double horseJump = GetHorseMaxJump(horse);
String horseJumpString = decimalFormat.format(horseJump);

Expand All @@ -495,8 +497,11 @@ else if (horseJump < badHorseJumpThreshold)
* @param horse
* @return empty string if there is no coloring (for donkeys)
*/
private static String GetHorseColoringText(EntityHorse horse) {
String texture = horse.getVariantTexturePaths()[0];
private static String GetHorseColoringText(AbstractHorse horse) {
String texture = "";
if (horse instanceof EntityHorse) {
texture = ((EntityHorse) horse).getVariantTexturePaths()[0];
}

if (texture == null || texture.isEmpty())
return "";
Expand All @@ -515,9 +520,11 @@ private static String GetHorseColoringText(EntityHorse horse) {
* @param horse
* @return empty string if there is no secondary coloring (for donkeys)
*/
private static String GetHorseMarkingText(EntityHorse horse) {
String texture = horse.getVariantTexturePaths()[1];

private static String GetHorseMarkingText(AbstractHorse horse) {
String texture = "";
if (horse instanceof EntityHorse) {
texture = ((EntityHorse) horse).getVariantTexturePaths()[1];
}
if (texture == null || texture.isEmpty())
return "";

Expand All @@ -535,7 +542,7 @@ private static String GetHorseMarkingText(EntityHorse horse) {
* @param horse
* @return e.x. 1.2?-5.5?
*/
private static double GetHorseMaxJump(EntityHorse horse) {
private static double GetHorseMaxJump(AbstractHorse horse) {
//simulate gravity and air resistance to determine the jump height
double yVelocity = horse.getHorseJumpStrength(); //horses's jump strength attribute
double jumpHeight = 0;
Expand All @@ -546,6 +553,11 @@ private static double GetHorseMaxJump(EntityHorse horse) {
}
return jumpHeight;
}

private static int GetLlamaStrength(EntityLlama llama) {
int strength = llama.func_190707_dL();
return strength;
}

/**
* Gets an entity's max hit points
Expand Down
30 changes: 16 additions & 14 deletions src/main/java/com/zyin/zyinhud/mods/DurabilityInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
import com.zyin.zyinhud.util.ModCompatibility;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.item.*;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import org.lwjgl.opengl.GL11;

import java.util.ArrayList;
import java.util.List;

/**
* Durability Info checks to see if any equipment (items in the hotbar, and armor) is damaged
Expand Down Expand Up @@ -444,21 +446,21 @@ protected static void CalculateDurabilityIcons()
*/
private static void CalculateDurabilityIconsForTools()
{
ItemStack[] items = mc.thePlayer.inventory.mainInventory;
ItemStack[] offhanditems = mc.thePlayer.inventory.offHandInventory;
NonNullList<ItemStack> items = mc.thePlayer.inventory.mainInventory;
NonNullList<ItemStack> offhanditems = mc.thePlayer.inventory.offHandInventory;

for (int i = 0; i < 10; i++)
{
ItemStack itemStack;
if (i < 9)
{
itemStack = items[i];
itemStack = items.get(i);
}else{
itemStack = offhanditems[0];//There will be only one item here
itemStack = offhanditems.get(0);//There will be only one item here
}


if (itemStack != null)
if (!itemStack.func_190926_b())
{
Item item = itemStack.getItem();
if (IsTool(item))
Expand All @@ -482,13 +484,13 @@ private static void CalculateDurabilityIconsForTools()
*/
private static void CalculateDurabilityIconsForArmor()
{
ItemStack[] armorStacks = mc.thePlayer.inventory.armorInventory;
NonNullList<ItemStack> armorStacks = mc.thePlayer.inventory.armorInventory;

//iterate backwards over the armor the user is wearing so the helm is displayed first
for(int i = armorStacks.length-1; i >= 0 ; i--)
for(int i = armorStacks.size()-1; i >= 0 ; i--)
{
ItemStack armorStack = armorStacks[i];
if (armorStack != null)
ItemStack armorStack = armorStacks.get(i);
if (!armorStack.func_190926_b())
{
int itemDamage = armorStack.getItemDamage();
int maxDamage = armorStack.getMaxDamage();
Expand Down Expand Up @@ -529,13 +531,13 @@ private static void UnequipDamagedArmor()
{
if(AutoUnequipArmor)
{
ItemStack[] itemStacks = mc.thePlayer.inventory.armorInventory;
NonNullList<ItemStack> itemStacks = mc.thePlayer.inventory.armorInventory;

//iterate over the armor the user is wearing
for(int i = 0; i < itemStacks.length; i++)
for(int i = 0; i < itemStacks.size(); i++)
{
ItemStack itemStack = itemStacks[i];
if (itemStack != null && !(itemStack.getItem() instanceof ItemElytra))
ItemStack itemStack = itemStacks.get(i);
if (!itemStack.func_190926_b() && !(itemStack.getItem() instanceof ItemElytra))
{
int itemDamage = itemStack.getItemDamage();
int maxDamage = itemStack.getMaxDamage();
Expand Down Expand Up @@ -563,7 +565,7 @@ private static void UnequipDamagedTool()
{
ItemStack itemStack = mc.thePlayer.inventory.getCurrentItem();

if (itemStack != null)
if (!itemStack.func_190926_b())
{
Item item = itemStack.getItem();

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/zyin/zyinhud/mods/EatingAid.java
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public int GetStrongestFoodItemIndexFromInventory()
Slot slot = (Slot)inventorySlots.get(i);
ItemStack itemStack = slot.getStack();

if (itemStack == null)
if (itemStack.func_190926_b())
{
continue;
}
Expand Down Expand Up @@ -489,7 +489,7 @@ public int GetBestFoodItemIndexFromInventory()
Slot slot = (Slot)inventorySlots.get(i);
ItemStack itemStack = slot.getStack();

if (itemStack == null)
if (itemStack.func_190926_b())
{
continue;
}
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/zyin/zyinhud/mods/HealthMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,27 @@ public static enum Modes {
/**
* Oot modes.
*/
OOT(Localization.get("healthmonitor.mode.oot"), "lowhealth_OoT"),
OOT(Localization.get("healthmonitor.mode.oot"), "lowhealth_oot"),
/**
* Lttp modes.
*/
LTTP(Localization.get("healthmonitor.mode.lttp"), "lowhealth_LttP"),
LTTP(Localization.get("healthmonitor.mode.lttp"), "lowhealth_lttp"),
/**
* Oracle modes.
*/
ORACLE(Localization.get("healthmonitor.mode.oracle"), "lowhealth_Oracle"),
ORACLE(Localization.get("healthmonitor.mode.oracle"), "lowhealth_oracle"),
/**
* La modes.
*/
LA(Localization.get("healthmonitor.mode.la"), "lowhealth_LA"),
LA(Localization.get("healthmonitor.mode.la"), "lowhealth_la"),
/**
* Loz modes.
*/
LOZ(Localization.get("healthmonitor.mode.loz"), "lowhealth_LoZ"),
LOZ(Localization.get("healthmonitor.mode.loz"), "lowhealth_loz"),
/**
* Aol modes.
*/
AOL(Localization.get("healthmonitor.mode.aol"), "lowhealth_AoL");
AOL(Localization.get("healthmonitor.mode.aol"), "lowhealth_aol");

private String friendlyName;
/**
Expand Down
Loading

0 comments on commit dd43937

Please sign in to comment.