More shit fixed, guava removed

This commit is contained in:
catfoolyou 2025-02-03 18:28:35 -05:00
parent d539693ddd
commit 792838ac19
13 changed files with 69 additions and 251 deletions

View File

@ -26,6 +26,6 @@ dependencies {
tasks.register('copyDebugJar', Copy) {
project.delete("lwjgl-rundir/eaglercraft.jar")
from layout.buildDirectory.file("build/libs/eaglercraft.jar")
into layout.buildDirectory.dir("lwjgl-rundir/")
from layout.buildDirectory.file("eaglercraft.jar")
into ("lwjgl-rundir/")
}

Binary file not shown.

Binary file not shown.

View File

@ -18,7 +18,7 @@ public class MinecraftMain {
byte[] b = EaglerAdapter.loadLocalStorage("forced");
if(b != null) {
//ServerList.loadDefaultServers(Base64.encodeBase64String(b)); // FIX THIS
ServerList.loadDefaultServers(Base64.encodeBase64String(b)); // FIX THIS
}
if(par0ArrayOfStr.length > 0) {
EaglerAdapter.setServerToJoinOnLaunch(par0ArrayOfStr[0]);

View File

@ -1,11 +1,8 @@
package net.minecraft.src;
import com.google.common.collect.Multimap;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
public abstract class BaseAttributeMap
{
@ -31,7 +28,7 @@ public abstract class BaseAttributeMap
public void func_111149_a(ModifiableAttributeInstance par1ModifiableAttributeInstance) {}
public void removeAttributeModifiers(Multimap par1Multimap)
/*public void removeAttributeModifiers(Multimap par1Multimap)
{
Iterator var2 = par1Multimap.entries().iterator();
@ -62,5 +59,5 @@ public abstract class BaseAttributeMap
var4.applyModifier((AttributeModifier)var3.getValue());
}
}
}
}*/
}

View File

@ -1,7 +1,5 @@
package net.minecraft.src;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import net.lax1dude.eaglercraft.TextureLocation;
import java.awt.image.BufferedImage;
@ -10,14 +8,13 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.Set;
import java.util.*;
import javax.imageio.ImageIO;
public class DefaultResourcePack implements ResourcePack
{
public static final Set defaultResourceDomains = ImmutableSet.of("minecraft");
private final Map mapResourceFiles = Maps.newHashMap();
public static final Set defaultResourceDomains = new HashSet<>(Arrays.asList("minecraft"));
private final Map mapResourceFiles = new HashMap<>();
private final File fileAssets;
public DefaultResourcePack(File par1File)

View File

@ -18,6 +18,8 @@ public abstract class EntityLivingBase extends Entity
/** The equipment this mob was previously wearing, used for syncing. */
private final ItemStack[] previousEquipment = new ItemStack[5];
protected float[] equipmentDropChances = new float[5];
/** Whether an arm swing is currently in progress. */
public boolean isSwingInProgress;
public int swingProgressInt;
@ -454,48 +456,42 @@ public abstract class EntityLivingBase extends Entity
par1NBTTagCompound.setShort("DeathTime", (short)this.deathTime);
par1NBTTagCompound.setShort("AttackTime", (short)this.attackTime);
par1NBTTagCompound.setFloat("AbsorptionAmount", this.getAbsorptionAmount());
ItemStack[] var2 = this.getLastActiveItems();
int var3 = var2.length;
int var4;
ItemStack var5;
NBTTagList var2 = new NBTTagList();
for (var4 = 0; var4 < var3; ++var4)
{
var5 = var2[var4];
for (int var3 = 0; var3 < this.previousEquipment.length; ++var3) {
NBTTagCompound var4 = new NBTTagCompound();
if (var5 != null)
{
this.attributeMap.removeAttributeModifiers(var5.getAttributeModifiers());
if (this.previousEquipment[var3] != null) {
this.previousEquipment[var3].writeToNBT(var4);
}
var2.appendTag(var4);
}
par1NBTTagCompound.setTag("Attributes", SharedMonsterAttributes.func_111257_a(this.getAttributeMap()));
var2 = this.getLastActiveItems();
var3 = var2.length;
par1NBTTagCompound.setTag("Equipment", var2);
NBTTagList var6;
for (var4 = 0; var4 < var3; ++var4)
{
var5 = var2[var4];
if (var5 != null)
{
this.attributeMap.applyAttributeModifiers(var5.getAttributeModifiers());
}
}
if (!this.activePotionsMap.isEmpty())
{
NBTTagList var6 = new NBTTagList();
if (!this.activePotionsMap.isEmpty()) {
var6 = new NBTTagList();
Iterator var7 = this.activePotionsMap.values().iterator();
while (var7.hasNext())
{
PotionEffect var8 = (PotionEffect)var7.next();
var6.appendTag(var8.writeCustomPotionEffectToNBT(new NBTTagCompound()));
while (var7.hasNext()) {
PotionEffect var5 = (PotionEffect) var7.next();
var6.appendTag(var5.writeCustomPotionEffectToNBT(new NBTTagCompound()));
}
par1NBTTagCompound.setTag("ActiveEffects", var6);
}
var6 = new NBTTagList();
for (int var8 = 0; var8 < this.equipmentDropChances.length; ++var8) {
var6.appendTag(new NBTTagFloat(var8 + "", this.equipmentDropChances[var8]));
}
par1NBTTagCompound.setTag("DropChances", var6);
par1NBTTagCompound.setString("CustomName", this.func_94057_bL());
par1NBTTagCompound.setBoolean("CustomNameVisible", this.func_94062_bN());
}
/**
@ -1721,7 +1717,7 @@ public abstract class EntityLivingBase extends Entity
{
((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet5PlayerInventory(this.entityId, var2, var4));
if (var3 != null)
/*if (var3 != null) // FIX THIS SHIT
{
this.attributeMap.removeAttributeModifiers(var3.getAttributeModifiers());
}
@ -1729,7 +1725,7 @@ public abstract class EntityLivingBase extends Entity
if (var4 != null)
{
this.attributeMap.applyAttributeModifiers(var4.getAttributeModifiers());
}
}*/
this.previousEquipment[var2] = var4 == null ? null : var4.copy();
}
@ -2212,6 +2208,14 @@ public abstract class EntityLivingBase extends Entity
return this.isOnTeam(par1EntityLivingBase.getTeam());
}
public String func_94057_bL() {
return this.dataWatcher.getWatchableObjectString(5);
}
public boolean func_94062_bN() {
return this.dataWatcher.getWatchableObjectByte(6) == 1;
}
/**
* Returns true if the entity is on a specific team.
*/

View File

@ -1,108 +0,0 @@
package net.minecraft.src;
import org.lwjgl.input.Keyboard;
public class GuiScreenServerList extends GuiScreen
{
/** Needed a change as a local variable was conflicting on construct */
private final GuiScreen guiScreen;
/** Instance of ServerData. */
private final ServerData theServerData;
private GuiTextField serverTextField;
public GuiScreenServerList(GuiScreen par1GuiScreen, ServerData par2ServerData)
{
this.guiScreen = par1GuiScreen;
this.theServerData = par2ServerData;
}
/**
* Called from the main game loop to update the screen.
*/
public void updateScreen()
{
this.serverTextField.updateCursorCounter();
}
/**
* Adds the buttons (and other controls) to the screen in question.
*/
public void initGui()
{
Keyboard.enableRepeatEvents(true);
this.buttonList.clear();
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, StatCollector.translateToLocal("selectServer.select")));
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, StatCollector.translateToLocal("gui.cancel")));
this.serverTextField = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 116, 200, 20);
this.serverTextField.setMaxStringLength(128);
this.serverTextField.setFocused(true);
this.serverTextField.setText(this.mc.gameSettings.lastServer);
((GuiButton)this.buttonList.get(0)).enabled = this.serverTextField.getText().length() > 0 && this.serverTextField.getText().split(":").length > 0;
}
/**
* Called when the screen is unloaded. Used to disable keyboard repeat events
*/
public void onGuiClosed()
{
Keyboard.enableRepeatEvents(false);
this.mc.gameSettings.lastServer = this.serverTextField.getText();
this.mc.gameSettings.saveOptions();
}
/**
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
*/
protected void actionPerformed(GuiButton par1GuiButton)
{
if (par1GuiButton.enabled)
{
if (par1GuiButton.id == 1)
{
this.guiScreen.confirmClicked(false, 0);
}
else if (par1GuiButton.id == 0)
{
this.theServerData.serverIP = this.serverTextField.getText();
this.guiScreen.confirmClicked(true, 0);
}
}
}
/**
* Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
*/
protected void keyTyped(char par1, int par2)
{
if (this.serverTextField.textboxKeyTyped(par1, par2))
{
((GuiButton)this.buttonList.get(0)).enabled = this.serverTextField.getText().length() > 0 && this.serverTextField.getText().split(":").length > 0;
}
else if (par2 == 28 || par2 == 156)
{
this.actionPerformed((GuiButton)this.buttonList.get(0));
}
}
/**
* Called when the mouse is clicked.
*/
protected void mouseClicked(int par1, int par2, int par3)
{
super.mouseClicked(par1, par2, par3);
this.serverTextField.mouseClicked(par1, par2, par3);
}
/**
* Draws the screen and all the components in it.
*/
public void drawScreen(int par1, int par2, float par3)
{
this.drawDefaultBackground();
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("selectServer.direct"), this.width / 2, 20, 16777215);
this.drawString(this.fontRenderer, StatCollector.translateToLocal("addServer.enterIp"), this.width / 2 - 100, 100, 10526880);
this.serverTextField.drawTextBox();
super.drawScreen(par1, par2, par3);
}
}

View File

@ -16,7 +16,7 @@ class GuiSlotServer extends GuiSlot {
public GuiSlotServer(GuiMultiplayer par1GuiMultiplayer) {
super(par1GuiMultiplayer.mc, par1GuiMultiplayer.width, par1GuiMultiplayer.height, 32, par1GuiMultiplayer.height - 64, 36);
this.parentGui = par1GuiMultiplayer;
this.width = 128;
//this.width = 128;
}
/**

View File

@ -1,13 +1,11 @@
package net.minecraft.src;
import com.google.common.collect.HashMultimap;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
public class ItemPotion extends Item
{
@ -266,96 +264,34 @@ public class ItemPotion extends Item
/**
* allows items to add custom lines of information to the mouseover description
*/
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
if (par1ItemStack.getItemDamage() != 0)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
if (par1ItemStack.getItemDamage() != 0) {
List var5 = Item.potion.getEffects(par1ItemStack);
HashMultimap var6 = HashMultimap.create();
Iterator var16;
if (var5 != null && !var5.isEmpty())
{
var16 = var5.iterator();
if (var5 != null && !var5.isEmpty()) {
Iterator var9 = var5.iterator();
while (var16.hasNext())
{
PotionEffect var8 = (PotionEffect)var16.next();
String var9 = StatCollector.translateToLocal(var8.getEffectName()).trim();
Potion var10 = Potion.potionTypes[var8.getPotionID()];
Map var11 = var10.func_111186_k();
while (var9.hasNext()) {
PotionEffect var7 = (PotionEffect) var9.next();
String var8 = StatCollector.translateToLocal(var7.getEffectName()).trim();
if (var11 != null && var11.size() > 0)
{
Iterator var12 = var11.entrySet().iterator();
while (var12.hasNext())
{
Entry var13 = (Entry)var12.next();
AttributeModifier var14 = (AttributeModifier)var13.getValue();
AttributeModifier var15 = new AttributeModifier(var14.getName(), var10.func_111183_a(var8.getAmplifier(), var14), var14.getOperation());
var6.put(((Attribute)var13.getKey()).getAttributeUnlocalizedName(), var15);
}
if (var7.getAmplifier() > 0) {
var8 = var8 + " " + StatCollector.translateToLocal("potion.potency." + var7.getAmplifier()).trim();
}
if (var8.getAmplifier() > 0)
{
var9 = var9 + " " + StatCollector.translateToLocal("potion.potency." + var8.getAmplifier()).trim();
if (var7.getDuration() > 20) {
var8 = var8 + " (" + Potion.getDurationString(var7) + ")";
}
if (var8.getDuration() > 20)
{
var9 = var9 + " (" + Potion.getDurationString(var8) + ")";
}
if (var10.isBadEffect())
{
par3List.add(EnumChatFormatting.RED + var9);
}
else
{
par3List.add(EnumChatFormatting.GRAY + var9);
}
}
}
else
{
String var7 = StatCollector.translateToLocal("potion.empty").trim();
par3List.add(EnumChatFormatting.GRAY + var7);
}
if (!var6.isEmpty())
{
par3List.add("");
par3List.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank"));
var16 = var6.entries().iterator();
while (var16.hasNext())
{
Entry var17 = (Entry)var16.next();
AttributeModifier var19 = (AttributeModifier)var17.getValue();
double var18 = var19.getAmount();
double var20;
if (var19.getOperation() != 1 && var19.getOperation() != 2)
{
var20 = var19.getAmount();
}
else
{
var20 = var19.getAmount() * 100.0D;
}
if (var18 > 0.0D)
{
par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var19.getOperation(), new Object[] {ItemStack.field_111284_a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())}));
}
else if (var18 < 0.0D)
{
var20 *= -1.0D;
par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var19.getOperation(), new Object[] {ItemStack.field_111284_a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())}));
if (Potion.potionTypes[var7.getPotionID()].isBadEffect()) {
par3List.add(EnumChatFormatting.RED + var8);
} else {
par3List.add(EnumChatFormatting.GRAY + var8);
}
}
} else {
String var6 = StatCollector.translateToLocal("potion.empty").trim();
par3List.add(EnumChatFormatting.GRAY + var6);
}
}
}

View File

@ -4,21 +4,14 @@ import net.lax1dude.eaglercraft.*;
import net.lax1dude.eaglercraft.IntegratedServer;
import net.lax1dude.eaglercraft.adapter.Tessellator;
import net.lax1dude.eaglercraft.glemu.FixedFunctionShader;
import com.google.common.collect.Lists;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.text.DecimalFormat;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.*;
import javax.imageio.ImageIO;
import net.minecraft.src.Item;
import net.minecraft.src.ItemRenderer;
import net.minecraft.src.ItemStack;
import org.lwjgl.LWJGLException;
import org.lwjgl.Sys;
import org.lwjgl.opengl.Display;
@ -30,7 +23,7 @@ public class Minecraft
{
/** A 10MiB preallocation to ensure the heap is reasonably sized. */
public static byte[] memoryReserve = new byte[10485760];
private static final List macDisplayModes = Lists.newArrayList(new DisplayMode[] {new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)});
private static final List macDisplayModes = new ArrayList<>(List.of(new DisplayMode[]{new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)}));
private ServerData currentServerData;
/** The RenderEngine instance used by Minecraft */
@ -149,7 +142,7 @@ public class Minecraft
private long field_83002_am = -1L;
private ReloadableResourceManager mcResourceManager;
private final MetadataSerializer metadataSerializer_ = new MetadataSerializer();
private List defaultResourcePacks = Lists.newArrayList();
private List defaultResourcePacks = new ArrayList<>();
private DefaultResourcePack mcDefaultResourcePack;
private ResourcePackRepository mcResourcePackRepository;

View File

@ -1429,7 +1429,7 @@ public class NetClientHandler extends NetHandler
}
else if ("MC|Brand".equals(par1Packet250CustomPayload.channel))
{
this.mc.thePlayer.func_142020_c(new String(par1Packet250CustomPayload.data, Charsets.UTF_8));
this.mc.thePlayer.func_142020_c(new String(par1Packet250CustomPayload.data));
}
}

View File

@ -1,6 +1,5 @@
package net.minecraft.src;
import com.google.common.collect.ImmutableList;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
@ -94,12 +93,12 @@ public class ResourcePackRepository
public List getRepositoryEntriesAll()
{
return ImmutableList.copyOf(this.repositoryEntriesAll);
return List.copyOf(this.repositoryEntriesAll);
}
public List getRepositoryEntries()
{
return ImmutableList.copyOf(this.repositoryEntries);
return List.copyOf(this.repositoryEntries);
}
public String getResourcePackName()