Skip to content

Commit

Permalink
Quick fix and update to 1.12.2
Browse files Browse the repository at this point in the history
Mapping: 20171014 Forge: 1.12.2-14.23.0.2512
  • Loading branch information
liushuyu committed Oct 14, 2017
1 parent e23fbd6 commit 232e8b6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ plugins {
*/
version = "1.5.5.%s"
group= "com.zyin.zyinhud" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "ZyinsHUD-1.12"
archivesBaseName = "ZyinsHUD-1.12.2"

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.12-14.21.1.2387"
version = "1.12.2-14.23.0.2512"
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_20170630"
mappings = "snapshot_20171014"
// 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 Expand Up @@ -94,8 +94,8 @@ processResources
}
}

def getBuildTime() {
static def getBuildTime() {
def date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z")
date.setTimeZone(TimeZone.getTimeZone("UTC"))
return date.format(new Date())
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/zyin/zyinhud/mods/AnimalInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public static void RenderEntityInfoInWorld(Entity entity, float partialTickTime)
}

//only show entities that are close by
double distanceFromMe = mc.player.getDistanceToEntity(animal);
double distanceFromMe = mc.player.getDistance(animal);

if (distanceFromMe > maxViewDistanceCutoff
|| distanceFromMe > viewDistanceCutoff) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/zyin/zyinhud/mods/PlayerLocator.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ public String GetFriendlyName() {
/**
* Get the type of the horse armor in int type
*
* @param armor_list
* @param armor_list List of the armors that player's horse currently have
* @return Horse Armor Type
*/
public static int getHorseArmorType(Iterable<ItemStack> armor_list) {
if (armor_list == null) {
return 0;
} else {
while (armor_list.iterator().hasNext()) {
if (armor_list.iterator().hasNext()) {
Item armor_single_item;
try {
armor_single_item = armor_list.iterator().next().getItem();
Expand Down Expand Up @@ -204,7 +204,7 @@ public static void RenderEntityInfoOnHUD(Entity entity, int x, int y) {
&& !mc.gameSettings.showDebugInfo) {

//only show entities that are close by
float distanceFromMe = mc.player.getDistanceToEntity(entity);
float distanceFromMe = mc.player.getDistance(entity);

if (distanceFromMe > maxViewDistanceCutoff
|| distanceFromMe < viewDistanceCutoff
Expand Down Expand Up @@ -289,7 +289,7 @@ public static void RenderEntityInfoOnHUD(Entity entity, int x, int y) {
//also render whatever the player is currently riding on
if (entity.getRidingEntity() instanceof EntityHorse) {
//armor is 0 when no horse armor is equipped
Iterable<ItemStack> armor_list = ((EntityHorse) entity.getRidingEntity()).getArmorInventoryList();
Iterable<ItemStack> armor_list = entity.getRidingEntity().getArmorInventoryList();
int armor = getHorseArmorType(armor_list);

if (armor == 1)
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/zyin/zyinhud/util/ZyinHUDUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static boolean IsBlockRightClickable(Block block)
* @param <E> The class the field is in
* @param classToAccess The ".class" of the class the field is in
* @param instance The instance of the class
* @param fieldNames comma seperated names the field may have (i.e. obfuscated, non obfuscated). Obfustated field names can be found in %USERPROFILE%\.gradle\caches\minecraft\de\oceanlabs\mcp\...\fields.csv
* @param fieldNames comma separated names the field may have (i.e. obfuscated, non obfuscated). Obfustated field names can be found in %USERPROFILE%\.gradle\caches\minecraft\de\oceanlabs\mcp\...\fields.csv
* @return t
*/
public static <T, E> T GetFieldByReflection(Class<? super E> classToAccess, E instance, String... fieldNames) {
Expand All @@ -108,8 +108,7 @@ public static <T, E> T GetFieldByReflection(Class<? super E> classToAccess, E in
T fieldT = null;
try {
fieldT = (T) field.get(instance);
} catch (IllegalArgumentException ignored) {
} catch (IllegalAccessException ignored) {
} catch (IllegalArgumentException | IllegalAccessException ignored) {
}

return fieldT;
Expand Down

2 comments on commit 232e8b6

@b12arr0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much!!!

@liushuyu
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@b12arr0 You're welcome. If you encounter any problem, just open an issue. I didn't have enough time to test this thoroughly.

Please sign in to comment.