Skip to content

Commit

Permalink
Fix actual 1.12.2 update and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
DenWav committed Jan 5, 2018
1 parent 58c4e2d commit 1d4313b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ modVersion=1.1.4
modGroup=com.demonwav
modBaseName=extendedhotbar
mcVersion=1.12.2
mcpMappings=snapshot_20180104
mcpMappings=snapshot_20170919
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ public String getName() {

@Override
public String getVersion() {
return "1.1.3";
return "1.1.4";
}

@Override
public void init(File configPath) {
public void init(final File configPath) {
LiteLoader.getInput().registerKeyBinding(swapKeyBinding);
LiteLoader.getInput().registerKeyBinding(toggleKeyBinding);
}

@Override
public void upgradeSettings(String version, File configPath, File oldConfigPath) {
public void upgradeSettings(final String version, final File configPath, final File oldConfigPath) {
}

@Override
public void onTick(Minecraft minecraft, float partialTicks, boolean inGame, boolean clock) {
public void onTick(final Minecraft minecraft, final float partialTicks, final boolean inGame, final boolean clock) {
if (toggleKeyBinding.isPressed()) {
enabled = !enabled;
LiteLoader.getInstance().writeConfig(this);
Expand All @@ -69,7 +69,7 @@ public void onTick(Minecraft minecraft, float partialTicks, boolean inGame, bool
final int windowId = inventory.inventorySlots.windowId;

if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
int currentItem = minecraft.player.inventory.currentItem;
final int currentItem = minecraft.player.inventory.currentItem;
swapItem(minecraft, windowId, currentItem);
} else {
for (int i = 0; i < 9; i++) {
Expand All @@ -81,7 +81,7 @@ public void onTick(Minecraft minecraft, float partialTicks, boolean inGame, bool
}
}

private void swapItem(Minecraft minecraft, int windowId, int slotId) {
private void swapItem(final Minecraft minecraft, final int windowId, final int slotId) {
minecraft.playerController.windowClick(windowId, slotId + 36, 0, ClickType.PICKUP, minecraft.player);
minecraft.playerController.windowClick(windowId, 4, 0, ClickType.PICKUP, minecraft.player);
minecraft.playerController.windowClick(windowId, slotId + 27, 0, ClickType.PICKUP, minecraft.player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
@Mixin(GuiIngame.class)
public abstract class MixinGuiInGame extends Gui {

private static final int distance = -22;
private static final int DISTANCE = -22;

@Shadow @Final private static ResourceLocation WIDGETS_TEX_PATH;

@Shadow @Final private Minecraft mc;
@Shadow protected abstract void renderHotbarItem(int p_184044_1_, int p_184044_2_, float p_184044_3_, EntityPlayer player, ItemStack stack);

@Inject(method = "renderHotbar", at = @At("RETURN"))
private void drawTopHotbar(ScaledResolution sr, float partialTicks, CallbackInfo info) {
private void drawTopHotbar(final ScaledResolution sr, final float partialTicks, final CallbackInfo info) {
if (!LiteLoader.getInstance().getMod(LiteModExtendedHotbar.class).isEnabled()) {
return;
}
Expand All @@ -47,16 +47,16 @@ private void drawTopHotbar(ScaledResolution sr, float partialTicks, CallbackInfo
glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(WIDGETS_TEX_PATH);
glEnableBlend();
drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22 + distance, 0, 0, 182, 22);
drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22 + DISTANCE, 0, 0, 182, 22);

glEnableRescaleNormal();
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO);
RenderHelper.enableGUIStandardItemLighting();

for (int l = 0; l < 9; ++l) {
// Anyone like magic numbers?
int i1 = i - 90 + l * 20 + 2;
int j1 = sr.getScaledHeight() - 16 - 3 + distance;
final int i1 = i - 90 + l * 20 + 2;
final int j1 = sr.getScaledHeight() - 16 - 3 + DISTANCE;
this.renderHotbarItem(i1, j1, partialTicks, entityplayer, entityplayer.inventory.mainInventory.get(l + 27));
}

Expand All @@ -68,7 +68,7 @@ private void drawTopHotbar(ScaledResolution sr, float partialTicks, CallbackInfo
private void moveUp() {
if (LiteLoader.getInstance().getMod(LiteModExtendedHotbar.class).isEnabled()) {
glPushMatrix();
glTranslated(0, distance, 0);
glTranslated(0, DISTANCE, 0);
}
}

Expand Down Expand Up @@ -99,9 +99,9 @@ private void moveGui(final CallbackInfo info) {
}

@ModifyArg(method = "renderGameOverlay", index = 2, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawString(Ljava/lang/String;III)I"))
private int moveActionBarText(int y) {
private int moveActionBarText(final int y) {
if (LiteLoader.getInstance().getMod(LiteModExtendedHotbar.class).isEnabled()) {
return y + distance;
return y + DISTANCE;
} else {
return y;
}
Expand Down

0 comments on commit 1d4313b

Please sign in to comment.