25w11a fix chat bugs
This commit is contained in:
parent
e23f9bc9f0
commit
31da12c19f
|
@ -10,7 +10,7 @@ sourceSets {
|
||||||
java {
|
java {
|
||||||
srcDirs(
|
srcDirs(
|
||||||
"src/main/java",
|
"src/main/java",
|
||||||
"src/lwjgl/java",
|
"src/teavm/java",
|
||||||
"sp-server/src/ipc/java"
|
"sp-server/src/ipc/java"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,10 @@ tasks.withType(JavaCompile) {
|
||||||
options.compilerArgs << "-Xmaxerrs" << "1000"
|
options.compilerArgs << "-Xmaxerrs" << "1000"
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets.main.resources.srcDirs += 'src/lwjgl/java/javazoom/jl/decoder'
|
//sourceSets.main.resources.srcDirs += 'src/lwjgl/java/javazoom/jl/decoder'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: './lwjgl-rundir/', include: '*.jar')
|
//implementation fileTree(dir: './lwjgl-rundir/', include: '*.jar')
|
||||||
|
|
||||||
teavm(teavm.libs.jso)
|
teavm(teavm.libs.jso)
|
||||||
teavm(teavm.libs.jsoApis)
|
teavm(teavm.libs.jsoApis)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
58248
javascript/classes.js
58248
javascript/classes.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
|
@ -5,7 +5,7 @@ import java.util.List;
|
||||||
|
|
||||||
public class ConfigConstants {
|
public class ConfigConstants {
|
||||||
|
|
||||||
public static final String version = "25w10c";
|
public static final String version = "25w11a";
|
||||||
public static final String mainMenuString = "Eaglercraft " + version;
|
public static final String mainMenuString = "Eaglercraft " + version;
|
||||||
|
|
||||||
public static final String forkMe = "https://git.zelz.net/catfoolyou/Project164";
|
public static final String forkMe = "https://git.zelz.net/catfoolyou/Project164";
|
||||||
|
|
|
@ -1363,11 +1363,11 @@ public class EntityRenderer
|
||||||
|
|
||||||
if (var10 > var2.posY + 1.0D && var3.getPrecipitationHeight(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posZ)) > MathHelper.floor_double(var2.posY))
|
if (var10 > var2.posY + 1.0D && var3.getPrecipitationHeight(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posZ)) > MathHelper.floor_double(var2.posY))
|
||||||
{
|
{
|
||||||
this.mc.theWorld.playSound(var8, var10, var12, "ambient.weather.rain", 0.1F, 0.5F, false);
|
this.mc.theWorld.playSound(var8, var10, var12, "ambient.weather.rain", 0.4F, 0.5F, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.mc.theWorld.playSound(var8, var10, var12, "ambient.weather.rain", 0.2F, 1.0F, false);
|
this.mc.theWorld.playSound(var8, var10, var12, "ambient.weather.rain", 0.6F, 1.0F, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
package net.minecraft.src;
|
|
||||||
|
|
||||||
public class ExceptionMcoHttp extends RuntimeException
|
|
||||||
{
|
|
||||||
public ExceptionMcoHttp(String par1Str, Exception par2Exception)
|
|
||||||
{
|
|
||||||
super(par1Str, par2Exception);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
package net.minecraft.src;
|
|
||||||
|
|
||||||
public class ExceptionMcoService extends Exception
|
|
||||||
{
|
|
||||||
public final int field_96392_a;
|
|
||||||
public final String field_96391_b;
|
|
||||||
public final int field_130097_c;
|
|
||||||
|
|
||||||
public ExceptionMcoService(int par1, String par2Str, int par3)
|
|
||||||
{
|
|
||||||
super(par2Str);
|
|
||||||
this.field_96392_a = par1;
|
|
||||||
this.field_96391_b = par2Str;
|
|
||||||
this.field_130097_c = par3;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return this.field_130097_c != -1 ? "Realms ( ErrorCode: " + this.field_130097_c + " )" : "Realms: " + this.field_96391_b;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
package net.minecraft.src;
|
|
||||||
|
|
||||||
public class ExceptionRetryCall extends ExceptionMcoService
|
|
||||||
{
|
|
||||||
public final int field_96393_c;
|
|
||||||
|
|
||||||
public ExceptionRetryCall(int par1)
|
|
||||||
{
|
|
||||||
super(503, "Retry operation", -1);
|
|
||||||
this.field_96393_c = par1;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,159 +0,0 @@
|
||||||
package net.minecraft.src;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.DataOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.Proxy;
|
|
||||||
import java.net.ServerSocket;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
|
||||||
|
|
||||||
public class HttpUtil
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Builds an encoded HTTP POST content string from a string map
|
|
||||||
*/
|
|
||||||
public static String buildPostString(Map par0Map)
|
|
||||||
{
|
|
||||||
StringBuilder var1 = new StringBuilder();
|
|
||||||
Iterator var2 = par0Map.entrySet().iterator();
|
|
||||||
|
|
||||||
while (var2.hasNext())
|
|
||||||
{
|
|
||||||
Entry var3 = (Entry)var2.next();
|
|
||||||
|
|
||||||
if (var1.length() > 0)
|
|
||||||
{
|
|
||||||
var1.append('&');
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var1.append(URLEncoder.encode((String)var3.getKey(), "UTF-8"));
|
|
||||||
}
|
|
||||||
catch (UnsupportedEncodingException var6)
|
|
||||||
{
|
|
||||||
var6.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var3.getValue() != null)
|
|
||||||
{
|
|
||||||
var1.append('=');
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var1.append(URLEncoder.encode(var3.getValue().toString(), "UTF-8"));
|
|
||||||
}
|
|
||||||
catch (UnsupportedEncodingException var5)
|
|
||||||
{
|
|
||||||
var5.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return var1.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends a HTTP POST request to the given URL with data from a map
|
|
||||||
*/
|
|
||||||
public static String sendPost(ILogAgent par0ILogAgent, URL par1URL, Map par2Map, boolean par3)
|
|
||||||
{
|
|
||||||
return sendPost(par0ILogAgent, par1URL, buildPostString(par2Map), par3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends a HTTP POST request to the given URL with data from a string
|
|
||||||
*/
|
|
||||||
private static String sendPost(ILogAgent par0ILogAgent, URL par1URL, String par2Str, boolean par3)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Proxy var4 = MinecraftServer.getServer() == null ? null : MinecraftServer.getServer().getServerProxy();
|
|
||||||
|
|
||||||
if (var4 == null)
|
|
||||||
{
|
|
||||||
var4 = Proxy.NO_PROXY;
|
|
||||||
}
|
|
||||||
|
|
||||||
HttpURLConnection var5 = (HttpURLConnection)par1URL.openConnection(var4);
|
|
||||||
var5.setRequestMethod("POST");
|
|
||||||
var5.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
|
||||||
var5.setRequestProperty("Content-Length", "" + par2Str.getBytes().length);
|
|
||||||
var5.setRequestProperty("Content-Language", "en-US");
|
|
||||||
var5.setUseCaches(false);
|
|
||||||
var5.setDoInput(true);
|
|
||||||
var5.setDoOutput(true);
|
|
||||||
DataOutputStream var6 = new DataOutputStream(var5.getOutputStream());
|
|
||||||
var6.writeBytes(par2Str);
|
|
||||||
var6.flush();
|
|
||||||
var6.close();
|
|
||||||
BufferedReader var7 = new BufferedReader(new InputStreamReader(var5.getInputStream()));
|
|
||||||
StringBuffer var9 = new StringBuffer();
|
|
||||||
String var8;
|
|
||||||
|
|
||||||
while ((var8 = var7.readLine()) != null)
|
|
||||||
{
|
|
||||||
var9.append(var8);
|
|
||||||
var9.append('\r');
|
|
||||||
}
|
|
||||||
|
|
||||||
var7.close();
|
|
||||||
return var9.toString();
|
|
||||||
}
|
|
||||||
catch (Exception var10)
|
|
||||||
{
|
|
||||||
if (!par3)
|
|
||||||
{
|
|
||||||
if (par0ILogAgent != null)
|
|
||||||
{
|
|
||||||
par0ILogAgent.logSevereException("Could not post to " + par1URL, var10);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Logger.getAnonymousLogger().log(Level.SEVERE, "Could not post to " + par1URL, var10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int func_76181_a() throws IOException
|
|
||||||
{
|
|
||||||
ServerSocket var0 = null;
|
|
||||||
boolean var1 = true;
|
|
||||||
int var10;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var0 = new ServerSocket(0);
|
|
||||||
var10 = var0.getLocalPort();
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (var0 != null)
|
|
||||||
{
|
|
||||||
var0.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (IOException var8)
|
|
||||||
{
|
|
||||||
;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return var10;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -638,13 +638,16 @@ public class NetClientHandler extends NetHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleChat(Packet3Chat par1Packet3Chat)
|
public void handleChat(Packet3Chat par1Packet3Chat) // I'm actually retarded
|
||||||
{
|
{
|
||||||
JSONObject jsonObject = new JSONObject(par1Packet3Chat.message);
|
JSONObject jsonObject = new JSONObject(par1Packet3Chat.message);
|
||||||
if(par1Packet3Chat.message.contains("text")){
|
if(par1Packet3Chat.message.contains("text")){
|
||||||
this.mc.ingameGUI.getChatGUI().printChatMessage(jsonObject.getString("text"));
|
this.mc.ingameGUI.getChatGUI().printChatMessage(jsonObject.getString("text"));
|
||||||
}
|
}
|
||||||
if(par1Packet3Chat.message.contains("translate")){
|
if(par1Packet3Chat.message.contains("translate") && par1Packet3Chat.message.contains("using")){
|
||||||
|
this.mc.ingameGUI.getChatGUI().printChatMessage(StatCollector.translateToLocalFormatted(jsonObject.getString("translate"), jsonObject.getJSONArray("using").toList().toArray()));
|
||||||
|
}
|
||||||
|
else if(par1Packet3Chat.message.contains("translate")){
|
||||||
this.mc.ingameGUI.getChatGUI().printChatMessage(StatCollector.translateToLocal(jsonObject.getString("translate")));
|
this.mc.ingameGUI.getChatGUI().printChatMessage(StatCollector.translateToLocal(jsonObject.getString("translate")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import java.util.Properties;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
import net.lax1dude.eaglercraft.EaglerMisc;
|
import net.lax1dude.eaglercraft.EaglerMisc;
|
||||||
import net.minecraft.src.Minecraft;
|
|
||||||
|
|
||||||
public class StringTranslate {
|
public class StringTranslate {
|
||||||
/** Is the private singleton instance of StringTranslate. */
|
/** Is the private singleton instance of StringTranslate. */
|
||||||
|
|
Loading…
Reference in New Issue