Remove apache deps + fix MP gui (again)

This commit is contained in:
catfoolyou 2025-02-04 11:30:33 -05:00
parent c0a1dc5639
commit 5bb9a396f1
16 changed files with 47 additions and 42 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,16 +2,15 @@ package net.minecraft.src;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.imageio.ImageIO;
import net.lax1dude.eaglercraft.EaglerImage;
import net.lax1dude.eaglercraft.TextureLocation;
import org.apache.commons.io.IOUtils;
public abstract class AbstractResourcePack implements ResourcePack
{
@ -68,15 +67,14 @@ public abstract class AbstractResourcePack implements ResourcePack
}
finally
{
IOUtils.closeQuietly(var4);
}
return par0MetadataSerializer.parseMetadataSection(par2Str, var3);
}
public BufferedImage getPackImage() throws IOException
public EaglerImage getPackImage() throws IOException
{
return ImageIO.read(this.getInputStreamByName("pack.png"));
return null; //new EaglerImage("pack.png"); // FIX THIS SHIT
}
public String getPackName()

View File

@ -1,7 +1,6 @@
package net.minecraft.src;
import java.util.UUID;
import org.apache.commons.lang3.Validate;
public class AttributeModifier
{
@ -27,10 +26,27 @@ public class AttributeModifier
this.name = par2Str;
this.amount = par3;
this.operation = par5;
Validate.notEmpty(par2Str, "Modifier name cannot be empty", new Object[0]);
Validate.inclusiveBetween(Integer.valueOf(0), Integer.valueOf(2), Integer.valueOf(par5), "Invalid operation", new Object[0]);
notEmpty(par2Str);
inclusiveBetween(0, 2, par5);
}
private void notEmpty(String par2Str){
if (par2Str == null){
throw new NullPointerException();
}
else if (par2Str.equals("")){
throw new IllegalArgumentException("Modifier name cannot be empty");
}
}
private void inclusiveBetween(int start, int end, int par5){
if(par5 < start && par5 > end){
throw new IllegalArgumentException("Invalid operation");
}
}
public UUID getID()
{
return this.id;

View File

@ -242,7 +242,7 @@ public class ContainerRepair extends Container
}
}
if (org.apache.commons.lang3.StringUtils.isBlank(this.repairedItemName))
if (this.repairedItemName == null || this.repairedItemName.equals("") || this.repairedItemName.equals(" "))
{
if (var1.hasDisplayName())
{
@ -462,7 +462,7 @@ public class ContainerRepair extends Container
{
ItemStack var2 = this.getSlot(2).getStack();
if (org.apache.commons.lang3.StringUtils.isBlank(par1Str))
if (par1Str == null || par1Str == "" || par1Str == " ")
{
var2.func_135074_t();
}

View File

@ -1,8 +1,9 @@
package net.minecraft.src;
import net.lax1dude.eaglercraft.EaglerImage;
import net.lax1dude.eaglercraft.EaglerInputStream;
import net.lax1dude.eaglercraft.TextureLocation;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@ -90,9 +91,10 @@ public class DefaultResourcePack implements ResourcePack
return AbstractResourcePack.readMetadata(par1MetadataSerializer, DefaultResourcePack.class.getResourceAsStream("/" + (new TextureLocation("pack.mcmeta"))), par2Str);
}
public BufferedImage getPackImage() throws IOException
public EaglerImage getPackImage() throws IOException
{
return ImageIO.read(DefaultResourcePack.class.getResourceAsStream("/" + (new TextureLocation("pack.png"))));
//return ImageIO.read(DefaultResourcePack.class.getResourceAsStream("/" + (new TextureLocation("pack.png"))));
return null; // FIX THIS SHIT
}
public String getPackName()

View File

@ -127,7 +127,7 @@ public abstract class EntityAITarget extends EntityAIBase
}
else
{
if (this.taskOwner instanceof EntityOwnable && org.apache.commons.lang3.StringUtils.isNotEmpty(((EntityOwnable)this.taskOwner).getOwnerName()))
if (this.taskOwner instanceof EntityOwnable && ((EntityOwnable)this.taskOwner).getOwnerName() != null)
{
if (par1EntityLivingBase instanceof EntityOwnable && ((EntityOwnable)this.taskOwner).getOwnerName().equals(((EntityOwnable)par1EntityLivingBase).getOwnerName()))
{

View File

@ -7,7 +7,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.io.filefilter.DirectoryFileFilter;
public class FolderResourcePack extends AbstractResourcePack
{
@ -33,7 +32,7 @@ public class FolderResourcePack extends AbstractResourcePack
if (var2.isDirectory())
{
File[] var3 = var2.listFiles((java.io.FileFilter)DirectoryFileFilter.DIRECTORY);
File[] var3 = var2.listFiles();
int var4 = var3.length;
for (int var5 = 0; var5 < var4; ++var5)

View File

@ -321,8 +321,8 @@ public abstract class GuiSlot {
if (var20 <= this.bottom && var20 + var13 >= this.top) {
if (this.showSelectionBox && this.isSelected(var11)) {
var14 = this.width / 2 - elementWidth;
int var15 = this.width / 2 + elementWidth;
var14 = this.width / 2 - (elementWidth + 28);
int var15 = this.width / 2 + (elementWidth + 14);
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
EaglerAdapter.glDisable(EaglerAdapter.GL_TEXTURE_2D);
var18.startDrawingQuads();

View File

@ -8,7 +8,6 @@ import net.lax1dude.eaglercraft.EaglercraftRandom;
import net.lax1dude.eaglercraft.TextureLocation;
import net.lax1dude.eaglercraft.adapter.Tessellator;
import org.apache.commons.io.Charsets;
import net.lax1dude.eaglercraft.EaglerAdapter;
public class GuiWinGame extends GuiScreen
@ -80,7 +79,7 @@ public class GuiWinGame extends GuiScreen
String var1 = "";
String var2 = "" + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + EnumChatFormatting.GREEN + EnumChatFormatting.AQUA;
short var3 = 274;
BufferedReader var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new TextureLocation("texts/end.txt")).getInputStream(), Charsets.UTF_8));
BufferedReader var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new TextureLocation("texts/end.txt")).getInputStream()));
EaglercraftRandom var5 = new EaglercraftRandom(8124371L);
int var6;
@ -105,7 +104,7 @@ public class GuiWinGame extends GuiScreen
this.lines.add("");
}
var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new TextureLocation("texts/credits.txt")).getInputStream(), Charsets.UTF_8));
var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new TextureLocation("texts/credits.txt")).getInputStream()));
while ((var1 = var4.readLine()) != null)
{

View File

@ -607,7 +607,6 @@ public class NetServerHandler extends NetHandler
}
else
{
var2 = org.apache.commons.lang3.StringUtils.normalizeSpace(var2);
for (int var3 = 0; var3 < var2.length(); ++var3)
{

View File

@ -32,7 +32,7 @@ public class Packet203AutoComplete extends Packet
*/
public void writePacketData(DataOutput par1DataOutput) throws IOException
{
writeString(org.apache.commons.lang3.StringUtils.substring(this.text, 0, 32767), par1DataOutput);
writeString(this.text, par1DataOutput);
}
/**

View File

@ -1,8 +1,8 @@
package net.minecraft.src;
import net.lax1dude.eaglercraft.EaglerImage;
import net.lax1dude.eaglercraft.TextureLocation;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.util.Set;
@ -17,7 +17,7 @@ public interface ResourcePack
MetadataSection getPackMetadata(MetadataSerializer var1, String var2) throws IOException;
BufferedImage getPackImage() throws IOException;
EaglerImage getPackImage() throws IOException;
String getPackName();
}

View File

@ -1,18 +1,16 @@
package net.minecraft.src;
import java.awt.image.BufferedImage;
import java.io.Closeable;
import net.lax1dude.eaglercraft.EaglerImage;
import net.lax1dude.eaglercraft.TextureLocation;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.IOUtils;
public class ResourcePackRepositoryEntry
{
private final File resourcePackFile;
private ResourcePack reResourcePack;
private PackMetadataSection rePackMetadataSection;
private BufferedImage texturePackIcon;
//private TextureLocation locationTexturePackIcon;
private EaglerImage texturePackIcon;
final ResourcePackRepository reResourcePackRepository;
@ -56,10 +54,7 @@ public class ResourcePackRepositoryEntry
public void closeResourcePack()
{
if (this.reResourcePack instanceof Closeable)
{
IOUtils.closeQuietly((Closeable)this.reResourcePack);
}
}
public ResourcePack getResourcePack()

View File

@ -9,7 +9,6 @@ import java.util.HashMap;
import java.util.Map;
import net.lax1dude.eaglercraft.TextureLocation;
import org.apache.commons.io.IOUtils;
public class SimpleResource implements Resource
{
@ -52,15 +51,13 @@ public class SimpleResource implements Resource
this.mcmetaJsonChecked = true;
BufferedReader var2 = null;
try
{
try {
var2 = new BufferedReader(new InputStreamReader(this.mcmetaInputStream));
this.mcmetaJson = (new JsonParser()).parse(var2).getAsJsonObject();
} finally {
}
finally
{
IOUtils.closeQuietly(var2);
}
}
MetadataSection var6 = (MetadataSection)this.mapMetadataSections.get(par1Str);