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

Commit

Permalink
update MCP mappings & bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cyilin committed Nov 25, 2016
1 parent dd43937 commit abd26c1
Show file tree
Hide file tree
Showing 28 changed files with 287 additions and 287 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ if (System.getenv("TRAVIS_BUILD_NUMBER") != null) {
}

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

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 @@ -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@[13.19.0.2141,);";
public static final String dependencies = "required-after:forge@[13.19.0.2160,);";

/**
* The constant proxy.
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/zyin/zyinhud/ZyinHUDRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ public static void RenderFloatingItemIcon(float x, float y, float z, Item item,
{
RenderManager renderManager = mc.getRenderManager();

float playerX = (float) (mc.thePlayer.lastTickPosX + (mc.thePlayer.posX - mc.thePlayer.lastTickPosX) * partialTickTime);
float playerY = (float) (mc.thePlayer.lastTickPosY + (mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * partialTickTime);
float playerZ = (float) (mc.thePlayer.lastTickPosZ + (mc.thePlayer.posZ - mc.thePlayer.lastTickPosZ) * partialTickTime);
float playerX = (float) (mc.player.lastTickPosX + (mc.player.posX - mc.player.lastTickPosX) * partialTickTime);
float playerY = (float) (mc.player.lastTickPosY + (mc.player.posY - mc.player.lastTickPosY) * partialTickTime);
float playerZ = (float) (mc.player.lastTickPosZ + (mc.player.posZ - mc.player.lastTickPosZ) * partialTickTime);

float dx = x-playerX;
float dy = y-playerY;
Expand Down Expand Up @@ -272,9 +272,9 @@ public static void RenderFloatingText(String[] text, float x, float y, float z,

RenderManager renderManager = mc.getRenderManager();

float playerX = (float) (mc.thePlayer.lastTickPosX + (mc.thePlayer.posX - mc.thePlayer.lastTickPosX) * partialTickTime);
float playerY = (float) (mc.thePlayer.lastTickPosY + (mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * partialTickTime);
float playerZ = (float) (mc.thePlayer.lastTickPosZ + (mc.thePlayer.posZ - mc.thePlayer.lastTickPosZ) * partialTickTime);
float playerX = (float) (mc.player.lastTickPosX + (mc.player.posX - mc.player.lastTickPosX) * partialTickTime);
float playerY = (float) (mc.player.lastTickPosY + (mc.player.posY - mc.player.lastTickPosY) * partialTickTime);
float playerZ = (float) (mc.player.lastTickPosZ + (mc.player.posZ - mc.player.lastTickPosZ) * partialTickTime);

float dx = x-playerX;
float dy = y-playerY;
Expand Down Expand Up @@ -364,7 +364,7 @@ public static void RenderFloatingText(String[] text, float x, float y, float z,
*/
public static void DisplayNotification(String message)
{
mc.ingameGUI.setRecordPlaying(message, false);
mc.ingameGUI.setOverlayMessage(message, false);
}


Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/zyin/zyinhud/ZyinHUDSound.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static void PlaySound(String name)
*/
public static void PlaySound(String name, float volume)
{
mc.getSoundHandler().playSound(new PositionedSoundRecord(new ResourceLocation("zyinhud:" + name), SoundCategory.MASTER, volume, 1.0F, false, 0, ISound.AttenuationType.LINEAR, (float) mc.thePlayer.posX, (float) mc.thePlayer.posY, (float) mc.thePlayer.posZ));
mc.getSoundHandler().playSound(new PositionedSoundRecord(new ResourceLocation("zyinhud:" + name), SoundCategory.MASTER, volume, 1.0F, false, 0, ISound.AttenuationType.LINEAR, (float) mc.player.posX, (float) mc.player.posY, (float) mc.player.posZ));
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/zyin/zyinhud/command/CommandFps.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
public class CommandFps extends CommandBase
{
@Override
public String getCommandName()
public String getName()
{
return "fps";
}

@Override
public List getCommandAliases()
public List getAliases()
{
List list = new ArrayList();
list.add("f");
Expand All @@ -42,7 +42,7 @@ public void execute(MinecraftServer minecraftServer, ICommandSender iCommandSend
}

@Override
public String getCommandUsage(ICommandSender iCommandSender)
public String getUsage(ICommandSender iCommandSender)
{
return "commands.zyinhudfps.usage";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ public class CommandZyinHUDOptions extends CommandBase
private static Minecraft mc = Minecraft.getMinecraft();

@Override
public String getCommandName()
public String getName()
{
return "zyinhud";
}

@Override
public List getCommandAliases()
public List getAliases()
{
List list = new ArrayList();
list.add("zh");
Expand All @@ -51,7 +51,7 @@ public void execute(MinecraftServer minecraftServer, ICommandSender iCommandSend
}

@Override
public String getCommandUsage(ICommandSender iCommandSender)
public String getUsage(ICommandSender iCommandSender)
{
return "commands.zyinhudoptions.usage";
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/zyin/zyinhud/gui/GuiZyinHUDOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public static void InitGuiEventPost(InitGuiEvent.Post event) {
int width = event.getGui().width;
int height = event.getGui().height;

if (event.getGui() instanceof GuiOptions && Minecraft.getMinecraft().theWorld != null) {
if (event.getGui() instanceof GuiOptions && Minecraft.getMinecraft().world != null) {
zyinHudOptionsButton = new GuiButton(1337, width / 2 + 5, height / 6 + 24 - 6, 150, 20, Localization.get("gui.override.options.buttons.options"));
event.getButtonList().add(zyinHudOptionsButton);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static void RenderEntityInfo(float partialTickTime)
if (PlayerLocator.Enabled && PlayerLocator.Mode == PlayerLocator.Modes.ON
&& mc.inGameHasFocus)
{
EntityPlayer me = mc.thePlayer;
EntityPlayer me = mc.player;

double meX = me.lastTickPosX + (me.posX - me.lastTickPosX) * partialTickTime;
double meY = me.lastTickPosY + (me.posY - me.lastTickPosY) * partialTickTime;
Expand All @@ -96,9 +96,9 @@ public static void RenderEntityInfo(float partialTickTime)
GL11.glGetInteger(GL11.GL_VIEWPORT, viewport);

//iterate over all the loaded Entity objects and find just the entities we are tracking
for (int i = 0; i < mc.theWorld.loadedEntityList.size(); i++)
for (int i = 0; i < mc.world.loadedEntityList.size(); i++)
{
Object object = mc.theWorld.loadedEntityList.get(i);
Object object = mc.world.loadedEntityList.get(i);

if(object == null)
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public static void RenderEntityInfo(float partialTickTime)
&& mc.inGameHasFocus)
{
//iterate over all the loaded Entity objects and find just the players
for (int i = 0; i < mc.theWorld.loadedEntityList.size(); i++)
for (int i = 0; i < mc.world.loadedEntityList.size(); i++)
{
Object object = mc.theWorld.loadedEntityList.get(i);
Object object = mc.world.loadedEntityList.get(i);

if(object == null
|| !(object instanceof EntityAnimal || object instanceof EntityVillager))
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/zyin/zyinhud/mods/AnimalInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ 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() ||
mc.thePlayer.isRiding() && mc.thePlayer.getRidingEntity() instanceof EntityLlama) {
AbstractHorse horse = (AbstractHorse) mc.thePlayer.getRidingEntity();
if (mc.player.isRidingHorse() ||
mc.player.isRiding() && mc.player.getRidingEntity() instanceof EntityLlama) {
AbstractHorse horse = (AbstractHorse) mc.player.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);
Expand Down Expand Up @@ -271,7 +271,7 @@ public static void RenderEntityInfoInWorld(Entity entity, float partialTickTime)
}

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

if (distanceFromMe > maxViewDistanceCutoff
|| distanceFromMe > viewDistanceCutoff) {
Expand Down Expand Up @@ -555,7 +555,7 @@ private static double GetHorseMaxJump(AbstractHorse horse) {
}

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

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/zyin/zyinhud/mods/Clock.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static String CalculateMessageForInfoLine(String infoLineMessageUpToThisP
{
if(Clock.Mode == Modes.STANDARD)
{
long time = (mc.theWorld.getWorldTime()) % 24000;
long time = (mc.world.getWorldTime()) % 24000;

//0 game time is 6am, so add 6000
long hours = (time + 6000) / 1000;
Expand Down Expand Up @@ -152,7 +152,7 @@ public static String CalculateMessageForInfoLine(String infoLineMessageUpToThisP
}
else if(Clock.Mode == Modes.COUNTDOWN)
{
long time = (mc.theWorld.getWorldTime()) % 24000;
long time = (mc.world.getWorldTime()) % 24000;

if(IsNight())
{
Expand Down Expand Up @@ -208,7 +208,7 @@ else if(Clock.Mode == Modes.GRAPHIC)
* @return the boolean
*/
public static boolean IsNight() {
long time = (mc.theWorld.getWorldTime()) % 24000;
long time = (mc.world.getWorldTime()) % 24000;
return time >= mobSpawningStartTime && time < mobSpawningStopTime;
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/zyin/zyinhud/mods/Compass.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static String CalculateMessageForInfoLine(String infoLineMessageUpToThisP
{
if (Compass.Enabled)
{
int yaw = (int)mc.thePlayer.rotationYaw;
int yaw = (int)mc.player.rotationYaw;
yaw += 22; //+22 centers the compass (45degrees/2)
yaw %= 360;

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/zyin/zyinhud/mods/DistanceMeasurer.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ public static void RenderOntoHUD()
*/
protected static String CalculateDistanceString()
{
RayTraceResult objectMouseOver = mc.thePlayer.rayTrace(300, 1);
RayTraceResult objectMouseOver = mc.player.rayTrace(300, 1);

if (objectMouseOver != null && objectMouseOver.typeOfHit == RayTraceResult.Type.BLOCK)
{
if (Mode == Modes.SIMPLE)
{
double playerX = mc.thePlayer.posX;
double playerY = mc.thePlayer.posY + mc.thePlayer.getEyeHeight();
double playerZ = mc.thePlayer.posZ;
double playerX = mc.player.posX;
double playerY = mc.player.posY + mc.player.getEyeHeight();
double playerZ = mc.player.posZ;

double blockX = objectMouseOver.hitVec.xCoord;
double blockY = objectMouseOver.hitVec.yCoord;
Expand Down
25 changes: 13 additions & 12 deletions src/main/java/com/zyin/zyinhud/mods/DurabilityInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
import com.zyin.zyinhud.util.Localization;
import com.zyin.zyinhud.util.ModCompatibility;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.enchantment.EnchantmentHelper;
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 @@ -446,8 +446,8 @@ protected static void CalculateDurabilityIcons()
*/
private static void CalculateDurabilityIconsForTools()
{
NonNullList<ItemStack> items = mc.thePlayer.inventory.mainInventory;
NonNullList<ItemStack> offhanditems = mc.thePlayer.inventory.offHandInventory;
NonNullList<ItemStack> items = mc.player.inventory.mainInventory;
NonNullList<ItemStack> offhanditems = mc.player.inventory.offHandInventory;

for (int i = 0; i < 10; i++)
{
Expand All @@ -460,7 +460,7 @@ private static void CalculateDurabilityIconsForTools()
}


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

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

//iterate over the armor the user is wearing
for(int i = 0; i < itemStacks.size(); i++)
{
ItemStack itemStack = itemStacks.get(i);
if (!itemStack.func_190926_b() && !(itemStack.getItem() instanceof ItemElytra))
if (!itemStack.isEmpty() && !(itemStack.getItem() instanceof ItemElytra) &&
!(itemStack.isItemEnchanted() && EnchantmentHelper.hasBindingCurse(itemStack)))
{
int itemDamage = itemStack.getItemDamage();
int maxDamage = itemStack.getMaxDamage();
Expand All @@ -563,9 +564,9 @@ private static void UnequipDamagedTool()
{
if(AutoUnequipTools)
{
ItemStack itemStack = mc.thePlayer.inventory.getCurrentItem();
ItemStack itemStack = mc.player.inventory.getCurrentItem();

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

Expand Down Expand Up @@ -659,7 +660,7 @@ public static int GetHorizontalLocation()
*/
public static int SetHorizontalLocation(int x)
{
durabalityLocX = MathHelper.clamp_int(x, 0, mc.displayWidth);
durabalityLocX = MathHelper.clamp(x, 0, mc.displayWidth);
equipmentLocX = durabalityLocX + armorDurabilityIconX;
return durabalityLocX;
}
Expand All @@ -682,7 +683,7 @@ public static int GetVerticalLocation()
*/
public static int SetVerticalLocation(int y)
{
durabalityLocY = MathHelper.clamp_int(y, 0, mc.displayHeight);
durabalityLocY = MathHelper.clamp(y, 0, mc.displayHeight);
equipmentLocY = durabalityLocY;
return durabalityLocY;
}
Expand Down
Loading

0 comments on commit abd26c1

Please sign in to comment.