Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit 3358500

Browse files
committed
Update to mc 1.11
1 parent 435b8d4 commit 3358500

File tree

9 files changed

+48
-65
lines changed

9 files changed

+48
-65
lines changed

MnM-Utils

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ext {
2020
}
2121
apply plugin: 'net.minecraftforge.gradle.liteloader'
2222
apply plugin: 'org.spongepowered.mixin'
23-
version = '2.1.2'
23+
version = '2.1.3'
2424

2525
apply from: utils.file('gradle/minecraft.gradle')
2626

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sat Aug 13 00:27:46 EDT 2016
1+
#Thu Dec 22 21:44:35 EST 2016
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

src/main/java/mnm/mods/tabbychat/TabbyChat.java

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
11
package mnm.mods.tabbychat;
22

3-
import java.io.File;
4-
import java.net.InetSocketAddress;
5-
import java.net.SocketAddress;
6-
import java.util.List;
7-
import java.util.regex.Pattern;
8-
9-
import javax.annotation.Nullable;
10-
11-
import org.apache.logging.log4j.LogManager;
12-
import org.apache.logging.log4j.Logger;
13-
143
import com.google.common.base.Function;
154
import com.google.common.base.Joiner;
165
import com.google.common.collect.Lists;
176
import com.google.common.eventbus.EventBus;
187
import com.mumfrey.liteloader.core.LiteLoader;
19-
20-
import mnm.mods.tabbychat.api.AddonManager;
21-
import mnm.mods.tabbychat.api.ChannelStatus;
22-
import mnm.mods.tabbychat.api.Chat;
23-
import mnm.mods.tabbychat.api.TabbyAPI;
24-
import mnm.mods.tabbychat.api.VersionData;
8+
import mnm.mods.tabbychat.api.*;
259
import mnm.mods.tabbychat.core.GuiNewChatTC;
2610
import mnm.mods.tabbychat.core.api.TabbyAddonManager;
2711
import mnm.mods.tabbychat.core.overlays.IGuiIngame;
@@ -39,6 +23,15 @@
3923
import net.minecraft.client.gui.GuiIngame;
4024
import net.minecraft.client.resources.IReloadableResourceManager;
4125
import net.minecraft.entity.player.EntityPlayer;
26+
import org.apache.logging.log4j.LogManager;
27+
import org.apache.logging.log4j.Logger;
28+
29+
import javax.annotation.Nullable;
30+
import java.io.File;
31+
import java.net.InetSocketAddress;
32+
import java.net.SocketAddress;
33+
import java.util.List;
34+
import java.util.regex.Pattern;
4235

4336
public class TabbyChat extends TabbyAPI {
4437

@@ -147,7 +140,7 @@ private void addFilterVariables() {
147140
addonManager.setFilterConstant("player", mc.getSession().getUsername());
148141
final Function<EntityPlayer, String> names = player -> Pattern.quote(player.getName());
149142
addonManager.setFilterVariable("onlineplayer", () -> {
150-
List<String> playerNames = Lists.transform(mc.theWorld.playerEntities, names);
143+
List<String> playerNames = Lists.transform(mc.world.playerEntities, names);
151144
return Joiner.on('|').appendTo(new StringBuilder("(?:"), playerNames).append(')').toString();
152145
});
153146
}

src/main/java/mnm/mods/tabbychat/core/GuiNewChatTC.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
package mnm.mods.tabbychat.core;
22

3-
import java.util.List;
4-
import java.util.Set;
5-
import java.util.stream.Collectors;
6-
7-
import org.lwjgl.input.Mouse;
8-
93
import com.google.common.collect.Sets;
104
import com.google.common.eventbus.EventBus;
11-
125
import mnm.mods.tabbychat.ChatChannel;
136
import mnm.mods.tabbychat.ChatManager;
147
import mnm.mods.tabbychat.TabbyChat;
@@ -21,6 +14,11 @@
2114
import net.minecraft.client.gui.GuiNewChat;
2215
import net.minecraft.client.renderer.GlStateManager;
2316
import net.minecraft.util.text.ITextComponent;
17+
import org.lwjgl.input.Mouse;
18+
19+
import java.util.List;
20+
import java.util.Set;
21+
import java.util.stream.Collectors;
2422

2523
public class GuiNewChatTC extends GuiNewChat implements ChatScreen {
2624

@@ -55,8 +53,11 @@ public void refreshChat() {
5553
}
5654

5755
@Override
58-
public void clearChatMessages() {
56+
public void clearChatMessages(boolean sent) {
5957
chat.clearMessages();
58+
if (sent) {
59+
this.getSentMessages().clear();
60+
}
6061
}
6162

6263
@Override

src/main/java/mnm/mods/tabbychat/core/mixin/MixinGuiChat.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
package mnm.mods.tabbychat.core.mixin;
22

3-
import java.io.IOException;
4-
import java.util.List;
5-
6-
import org.spongepowered.asm.mixin.Mixin;
7-
import org.spongepowered.asm.mixin.Shadow;
8-
import org.spongepowered.asm.mixin.injection.At;
9-
import org.spongepowered.asm.mixin.injection.Inject;
10-
import org.spongepowered.asm.mixin.injection.Redirect;
11-
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12-
133
import com.google.common.collect.Lists;
14-
154
import mnm.mods.tabbychat.ChatManager;
165
import mnm.mods.tabbychat.TabbyChat;
176
import mnm.mods.tabbychat.api.Channel;
@@ -28,6 +17,15 @@
2817
import net.minecraft.client.gui.GuiTextField;
2918
import net.minecraft.util.ITabCompleter;
3019
import net.minecraft.util.TabCompleter;
20+
import org.spongepowered.asm.mixin.Mixin;
21+
import org.spongepowered.asm.mixin.Shadow;
22+
import org.spongepowered.asm.mixin.injection.At;
23+
import org.spongepowered.asm.mixin.injection.Inject;
24+
import org.spongepowered.asm.mixin.injection.Redirect;
25+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
26+
27+
import java.io.IOException;
28+
import java.util.List;
3129

3230
@Mixin(GuiChat.class)
3331
public abstract class MixinGuiChat extends GuiScreen implements ITabCompleter {

src/main/java/mnm/mods/tabbychat/gui/ChatArea.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
package mnm.mods.tabbychat.gui;
22

3-
import java.awt.Dimension;
4-
import java.awt.Point;
5-
import java.awt.Rectangle;
6-
import java.util.Iterator;
7-
import java.util.List;
8-
import java.util.Set;
9-
103
import com.google.common.collect.Lists;
11-
import com.google.common.collect.Sets;
124
import com.google.common.eventbus.Subscribe;
13-
145
import mnm.mods.tabbychat.ChatChannel;
156
import mnm.mods.tabbychat.TabbyChat;
16-
import mnm.mods.tabbychat.api.Channel;
177
import mnm.mods.tabbychat.api.Message;
188
import mnm.mods.tabbychat.api.gui.ReceivedChat;
199
import mnm.mods.tabbychat.core.GuiNewChatTC;
@@ -33,6 +23,10 @@
3323
import net.minecraft.util.text.ITextComponent;
3424
import net.minecraft.util.text.TextComponentString;
3525

26+
import java.awt.*;
27+
import java.util.Iterator;
28+
import java.util.List;
29+
3630
public class ChatArea extends GuiComponent implements ReceivedChat {
3731

3832
private ChatChannel channel;
@@ -219,7 +213,7 @@ public ITextComponent getChatComponent(int clickX, int clickY) {
219213
float bottom = (actual.getYPos() + actual.getHeight());
220214

221215
// The line to get
222-
int linePos = MathHelper.floor_float((point.y - bottom) / -size) + scrollPos;
216+
int linePos = MathHelper.floor((point.y - bottom) / -size) + scrollPos;
223217

224218
// Iterate through the chat component, stopping when the desired
225219
// x is reached.

src/main/java/mnm/mods/tabbychat/gui/ChatBox.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
package mnm.mods.tabbychat.gui;
22

3-
import java.awt.Point;
4-
import java.awt.Rectangle;
5-
6-
import org.lwjgl.input.Mouse;
7-
83
import com.google.common.eventbus.Subscribe;
94
import com.mumfrey.liteloader.core.LiteLoader;
10-
115
import mnm.mods.tabbychat.TabbyChat;
126
import mnm.mods.tabbychat.api.gui.ChatGui;
137
import mnm.mods.tabbychat.settings.ColorSettings;
@@ -23,6 +17,9 @@
2317
import net.minecraft.client.gui.GuiScreen;
2418
import net.minecraft.client.gui.ScaledResolution;
2519
import net.minecraft.util.math.MathHelper;
20+
import org.lwjgl.input.Mouse;
21+
22+
import java.awt.*;
2623

2724
public class ChatBox extends GuiPanel implements ChatGui {
2825

@@ -126,10 +123,10 @@ public void updateComponent() {
126123

127124
if (x1 != x || y1 != y || w1 != w || h1 != h) {
128125
setLocation(new Location(
129-
MathHelper.ceiling_double_int(x1 / scale),
130-
MathHelper.ceiling_double_int(y1 / scale),
131-
MathHelper.ceiling_double_int(w1 / scale),
132-
MathHelper.ceiling_double_int(h1 / scale)));
126+
MathHelper.ceil(x1 / scale),
127+
MathHelper.ceil(y1 / scale),
128+
MathHelper.ceil(w1 / scale),
129+
MathHelper.ceil(h1 / scale)));
133130
}
134131
super.updateComponent();
135132
}

src/main/java/mnm/mods/tabbychat/util/ScaledDimension.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public ScaledDimension(int width, int height) {
3838

3939
this.scaledWidthD = (double) this.scaledWidth / (double) this.scaleFactor;
4040
this.scaledHeightD = (double) this.scaledHeight / (double) this.scaleFactor;
41-
this.scaledWidth = MathHelper.ceiling_double_int(this.scaledWidthD);
42-
this.scaledHeight = MathHelper.ceiling_double_int(this.scaledHeightD);
41+
this.scaledWidth = MathHelper.ceil(this.scaledWidthD);
42+
this.scaledHeight = MathHelper.ceil(this.scaledHeightD);
4343
}
4444

4545
public int getScaledWidth() {
@@ -61,4 +61,4 @@ public double getScaledHeight_double() {
6161
public int getScaleFactor() {
6262
return this.scaleFactor;
6363
}
64-
}
64+
}

0 commit comments

Comments
 (0)