u24
This commit is contained in:
parent
401ebe2324
commit
573420e1b8
613 changed files with 5708 additions and 4445 deletions
|
|
@ -34,6 +34,7 @@ import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType;
|
|||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFontRenderer;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
|
|
@ -74,7 +75,6 @@ import net.minecraft.client.gui.GuiGameOver;
|
|||
import net.minecraft.client.gui.GuiIngame;
|
||||
import net.minecraft.client.gui.GuiIngameMenu;
|
||||
import net.minecraft.client.gui.GuiMainMenu;
|
||||
import net.minecraft.client.gui.GuiMemoryErrorScreen;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiSleepMP;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
|
|
@ -384,6 +384,7 @@ public class Minecraft implements IThreadListener {
|
|||
logger.info("EagRuntime Version: " + EagRuntime.getVersion());
|
||||
this.createDisplay();
|
||||
this.registerMetadataSerializers();
|
||||
EaglerFolderResourcePack.deleteOldResourcePacks(EaglerFolderResourcePack.SERVER_RESOURCE_PACKS, 604800000L);
|
||||
this.mcResourcePackRepository = new ResourcePackRepository(this.mcDefaultResourcePack, this.metadataSerializer_,
|
||||
this.gameSettings);
|
||||
this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_);
|
||||
|
|
@ -696,7 +697,7 @@ public class Minecraft implements IThreadListener {
|
|||
if (SingleplayerServerController.shutdownEaglercraftServer()
|
||||
|| SingleplayerServerController.getStatusState() == IntegratedServerState.WORLD_UNLOADING) {
|
||||
displayGuiScreen(new GuiScreenIntegratedServerBusy(cont, "singleplayer.busy.stoppingIntegratedServer",
|
||||
"singleplayer.failed.stoppingIntegratedServer", () -> SingleplayerServerController.isReady()));
|
||||
"singleplayer.failed.stoppingIntegratedServer", SingleplayerServerController::isReady));
|
||||
} else {
|
||||
displayGuiScreen(cont);
|
||||
}
|
||||
|
|
@ -1703,8 +1704,7 @@ public class Minecraft implements IThreadListener {
|
|||
if (SingleplayerServerController.hangupEaglercraftServer()) {
|
||||
this.displayGuiScreen(new GuiScreenIntegratedServerBusy(currentScreen,
|
||||
"singleplayer.busy.stoppingIntegratedServer",
|
||||
"singleplayer.failed.stoppingIntegratedServer",
|
||||
() -> SingleplayerServerController.isReady()));
|
||||
"singleplayer.failed.stoppingIntegratedServer", SingleplayerServerController::isReady));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ public enum SoundCategory {
|
|||
MASTER("master", 0), MUSIC("music", 1), RECORDS("record", 2), WEATHER("weather", 3), BLOCKS("block", 4),
|
||||
MOBS("hostile", 5), ANIMALS("neutral", 6), PLAYERS("player", 7), AMBIENT("ambient", 8), VOICE("voice", 9);
|
||||
|
||||
public static final SoundCategory[] _VALUES = values();
|
||||
|
||||
private static final Map<String, SoundCategory> NAME_CATEGORY_MAP = Maps.newHashMap();
|
||||
private static final Map<Integer, SoundCategory> ID_CATEGORY_MAP = Maps.newHashMap();
|
||||
private final String categoryName;
|
||||
|
|
@ -51,7 +53,9 @@ public enum SoundCategory {
|
|||
}
|
||||
|
||||
static {
|
||||
for (SoundCategory soundcategory : values()) {
|
||||
SoundCategory[] categories = _VALUES;
|
||||
for (int i = 0; i < categories.length; ++i) {
|
||||
SoundCategory soundcategory = categories[i];
|
||||
if (NAME_CATEGORY_MAP.containsKey(soundcategory.getCategoryName())
|
||||
|| ID_CATEGORY_MAP.containsKey(Integer.valueOf(soundcategory.getCategoryId()))) {
|
||||
throw new Error("Clash in Sound Category ID & Name pools! Cannot insert " + soundcategory);
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ public class SoundEventAccessorComposite implements ISoundEventAccessor<SoundPoo
|
|||
public int getWeight() {
|
||||
int i = 0;
|
||||
|
||||
for (ISoundEventAccessor isoundeventaccessor : this.soundPool) {
|
||||
i += isoundeventaccessor.getWeight();
|
||||
for (int j = 0, l = this.soundPool.size(); j < l; ++j) {
|
||||
i += this.soundPool.get(j).getWeight();
|
||||
}
|
||||
|
||||
return i;
|
||||
|
|
@ -61,7 +61,8 @@ public class SoundEventAccessorComposite implements ISoundEventAccessor<SoundPoo
|
|||
if (!this.soundPool.isEmpty() && i != 0) {
|
||||
int j = this.rnd.nextInt(i);
|
||||
|
||||
for (ISoundEventAccessor isoundeventaccessor : this.soundPool) {
|
||||
for (int k = 0, l = this.soundPool.size(); k < l; ++k) {
|
||||
ISoundEventAccessor isoundeventaccessor = this.soundPool.get(k);
|
||||
j -= isoundeventaccessor.getWeight();
|
||||
if (j < 0) {
|
||||
SoundPoolEntry soundpoolentry = (SoundPoolEntry) isoundeventaccessor.cloneEntry();
|
||||
|
|
|
|||
|
|
@ -115,9 +115,10 @@ public class SoundList {
|
|||
}
|
||||
|
||||
public static SoundList.SoundEntry.Type getType(String parString1) {
|
||||
for (SoundList.SoundEntry.Type soundlist$soundentry$type : values()) {
|
||||
if (soundlist$soundentry$type.field_148583_c.equals(parString1)) {
|
||||
return soundlist$soundentry$type;
|
||||
SoundList.SoundEntry.Type[] types = values();
|
||||
for (int i = 0; i < types.length; ++i) {
|
||||
if (types[i].field_148583_c.equals(parString1)) {
|
||||
return types[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package net.minecraft.client.entity;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANClientNetworkManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.socket.ClientIntegratedServerNetworkManager;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.MovingSoundMinecartRiding;
|
||||
|
|
|
|||
|
|
@ -680,8 +680,9 @@ public class FontRenderer implements IResourceManagerReloadListener {
|
|||
* wordwrap and with darker drop shadow color if flag is set
|
||||
*/
|
||||
private void renderSplitString(String str, int x, int y, int wrapWidth, boolean addShadow) {
|
||||
for (String s : this.listFormattedStringToWidth(str, wrapWidth)) {
|
||||
this.renderStringAligned(s, x, y, wrapWidth, this.textColor, addShadow);
|
||||
List<String> lst = this.listFormattedStringToWidth(str, wrapWidth);
|
||||
for (int i = 0, l = lst.size(); i < l; ++i) {
|
||||
this.renderStringAligned(lst.get(i), x, y, wrapWidth, this.textColor, addShadow);
|
||||
y += this.FONT_HEIGHT;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -226,15 +226,16 @@ public class GuiChat extends GuiScreen {
|
|||
this.inputField.deleteFromCursor(i - this.inputField.getCursorPosition());
|
||||
}
|
||||
|
||||
if (this.foundPlayerNames.size() > 1) {
|
||||
int l = this.foundPlayerNames.size();
|
||||
if (l > 1) {
|
||||
StringBuilder stringbuilder = new StringBuilder();
|
||||
|
||||
for (String s2 : this.foundPlayerNames) {
|
||||
for (int i = 0; i < l; ++i) {
|
||||
if (stringbuilder.length() > 0) {
|
||||
stringbuilder.append(", ");
|
||||
}
|
||||
|
||||
stringbuilder.append(s2);
|
||||
stringbuilder.append(this.foundPlayerNames.get(i));
|
||||
}
|
||||
|
||||
this.mc.ingameGUI.getChatGUI()
|
||||
|
|
@ -306,7 +307,8 @@ public class GuiChat extends GuiScreen {
|
|||
this.playerNamesFound = false;
|
||||
this.foundPlayerNames.clear();
|
||||
|
||||
for (String s : parArrayOfString) {
|
||||
for (int i = 0; i < parArrayOfString.length; ++i) {
|
||||
String s = parArrayOfString[i];
|
||||
if (s.length() > 0) {
|
||||
this.foundPlayerNames.add(s);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,8 +91,9 @@ public class GuiControls extends GuiScreen {
|
|||
if (parGuiButton.id == 200) {
|
||||
this.mc.displayGuiScreen(this.parentScreen);
|
||||
} else if (parGuiButton.id == 201) {
|
||||
for (KeyBinding keybinding : this.mc.gameSettings.keyBindings) {
|
||||
keybinding.setKeyCode(keybinding.getKeyCodeDefault());
|
||||
KeyBinding[] arr = this.mc.gameSettings.keyBindings;
|
||||
for (int i = 0; i < arr.length; ++i) {
|
||||
arr[i].setKeyCode(arr[i].getKeyCodeDefault());
|
||||
}
|
||||
|
||||
KeyBinding.resetKeyBindingArrayAndHash();
|
||||
|
|
@ -165,8 +166,9 @@ public class GuiControls extends GuiScreen {
|
|||
this.drawCenteredString(this.fontRendererObj, this.screenTitle, this.width / 2, 8, 16777215);
|
||||
boolean flag = true;
|
||||
|
||||
for (KeyBinding keybinding : this.options.keyBindings) {
|
||||
if (keybinding.getKeyCode() != keybinding.getKeyCodeDefault()) {
|
||||
KeyBinding[] arr = this.options.keyBindings;
|
||||
for (int k = 0; k < arr.length; ++k) {
|
||||
if (arr[k].getKeyCode() != arr[k].getKeyCodeDefault()) {
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,12 +6,6 @@ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiCreateWorld;
|
||||
import net.minecraft.client.gui.GuiFlatPresets;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiSlot;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,8 @@
|
|||
package net.minecraft.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Random;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.Keyboard;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiCreateFlatWorld;
|
||||
import net.minecraft.client.gui.GuiCustomizeWorldScreen;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.ChatAllowedCharacters;
|
||||
import net.minecraft.world.WorldSettings;
|
||||
|
|
@ -130,8 +124,8 @@ public class GuiCreateWorld extends GuiScreen {
|
|||
private void func_146314_g() {
|
||||
this.field_146336_i = this.field_146333_g.getText().trim();
|
||||
|
||||
for (char c0 : ChatAllowedCharacters.allowedCharactersArray) {
|
||||
this.field_146336_i = this.field_146336_i.replace(c0, '_');
|
||||
for (int i = 0; i < ChatAllowedCharacters.allowedCharactersArray.length; ++i) {
|
||||
this.field_146336_i = this.field_146336_i.replace(ChatAllowedCharacters.allowedCharactersArray[i], '_');
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(this.field_146336_i)) {
|
||||
|
|
@ -180,8 +174,8 @@ public class GuiCreateWorld extends GuiScreen {
|
|||
public static String func_146317_a(ISaveFormat parISaveFormat, String parString1) {
|
||||
parString1 = parString1.replaceAll("[\\./\"]", "_");
|
||||
|
||||
for (String s : disallowedFilenames) {
|
||||
if (parString1.equalsIgnoreCase(s)) {
|
||||
for (int i = 0; i < disallowedFilenames.length; ++i) {
|
||||
if (parString1.equalsIgnoreCase(disallowedFilenames[i])) {
|
||||
parString1 = "_" + parString1 + "_";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@ public class GuiCustomizeSkin extends GuiScreen {
|
|||
int i = 0;
|
||||
this.title = I18n.format("options.skinCustomisation.title", new Object[0]);
|
||||
|
||||
for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts.values()) {
|
||||
EnumPlayerModelParts[] parts = EnumPlayerModelParts._VALUES;
|
||||
for (int k = 0; k < parts.length; ++k) {
|
||||
EnumPlayerModelParts enumplayermodelparts = parts[k];
|
||||
this.buttonList.add(new GuiCustomizeSkin.ButtonPart(enumplayermodelparts.getPartId(),
|
||||
this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20,
|
||||
enumplayermodelparts));
|
||||
|
|
|
|||
|
|
@ -8,15 +8,6 @@ import java.util.Random;
|
|||
import net.lax1dude.eaglercraft.v1_8.HString;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiCreateWorld;
|
||||
import net.minecraft.client.gui.GuiListButton;
|
||||
import net.minecraft.client.gui.GuiPageButtonList;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiScreenCustomizePresets;
|
||||
import net.minecraft.client.gui.GuiSlider;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
|
|
|||
|
|
@ -87,8 +87,9 @@ public class GuiDisconnected extends GuiScreen {
|
|||
this.height / 2 - this.field_175353_i / 2 - this.fontRendererObj.FONT_HEIGHT * 2, 11184810);
|
||||
int k = this.height / 2 - this.field_175353_i / 2;
|
||||
if (this.multilineMessage != null) {
|
||||
for (String s : this.multilineMessage) {
|
||||
this.drawCenteredString(this.fontRendererObj, s, this.width / 2, k, 16777215);
|
||||
for (int l = 0, m = this.multilineMessage.size(); l < m; ++l) {
|
||||
this.drawCenteredString(this.fontRendererObj, this.multilineMessage.get(l), this.width / 2, k,
|
||||
16777215);
|
||||
k += this.fontRendererObj.FONT_HEIGHT;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,6 @@ import net.lax1dude.eaglercraft.v1_8.Keyboard;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.minecraft.block.BlockTallGrass;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiCreateFlatWorld;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiSlot;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
|
|
@ -189,8 +183,8 @@ public class GuiFlatPresets extends GuiScreen {
|
|||
flatgeneratorinfo.setBiome(parBiomeGenBase.biomeID);
|
||||
flatgeneratorinfo.func_82645_d();
|
||||
if (parList != null) {
|
||||
for (String s : parList) {
|
||||
flatgeneratorinfo.getWorldFeatures().put(s, Maps.newHashMap());
|
||||
for (int i = 0, l = parList.size(); i < l; ++i) {
|
||||
flatgeneratorinfo.getWorldFeatures().put(parList.get(i), Maps.newHashMap());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ public class GuiGameOver extends GuiScreen implements GuiYesNoCallback {
|
|||
}
|
||||
}
|
||||
|
||||
for (GuiButton guibutton : this.buttonList) {
|
||||
guibutton.enabled = false;
|
||||
for (int i = 0, l = this.buttonList.size(); i < l; ++i) {
|
||||
this.buttonList.get(i).enabled = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -150,8 +150,8 @@ public class GuiGameOver extends GuiScreen implements GuiYesNoCallback {
|
|||
super.updateScreen();
|
||||
++this.enableButtonsTimer;
|
||||
if (this.enableButtonsTimer == 20) {
|
||||
for (GuiButton guibutton : this.buttonList) {
|
||||
guibutton.enabled = true;
|
||||
for (int i = 0, l = this.buttonList.size(); i < l; ++i) {
|
||||
this.buttonList.get(i).enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
|
||||
|
||||
|
|
@ -487,7 +486,8 @@ public class GuiIngame extends Gui {
|
|||
|
||||
int i = this.getFontRenderer().getStringWidth(parScoreObjective.getDisplayName());
|
||||
|
||||
for (Score score : (List<Score>) arraylist1) {
|
||||
for (int m = 0, n = arraylist1.size(); m < n; ++m) {
|
||||
Score score = (Score) arraylist1.get(m);
|
||||
ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(score.getPlayerName());
|
||||
String s = ScorePlayerTeam.formatPlayerName(scoreplayerteam, score.getPlayerName()) + ": "
|
||||
+ EnumChatFormatting.RED + score.getScorePoints();
|
||||
|
|
@ -500,7 +500,8 @@ public class GuiIngame extends Gui {
|
|||
int k1 = parScaledResolution.getScaledWidth() - i - b0;
|
||||
int j = 0;
|
||||
|
||||
for (Score score1 : (List<Score>) arraylist1) {
|
||||
for (int m = 0, n = arraylist1.size(); m < n; ++m) {
|
||||
Score score1 = (Score) arraylist1.get(m);
|
||||
++j;
|
||||
ScorePlayerTeam scoreplayerteam1 = scoreboard.getPlayersTeam(score1.getPlayerName());
|
||||
String s1 = ScorePlayerTeam.formatPlayerName(scoreplayerteam1, score1.getPlayerName());
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ public class GuiKeyBindingList extends GuiListExtended {
|
|||
int i = 0;
|
||||
String s = null;
|
||||
|
||||
for (KeyBinding keybinding : akeybinding) {
|
||||
for (int l = 0; l < akeybinding.length; ++l) {
|
||||
KeyBinding keybinding = akeybinding[l];
|
||||
String s1 = keybinding.getKeyCategory();
|
||||
if (!s1.equals(s)) {
|
||||
s = s1;
|
||||
|
|
@ -138,7 +139,9 @@ public class GuiKeyBindingList extends GuiListExtended {
|
|||
this.btnChangeKeyBinding.displayString = GameSettings.getKeyDisplayString(this.keybinding.getKeyCode());
|
||||
boolean flag1 = false;
|
||||
if (this.keybinding.getKeyCode() != 0) {
|
||||
for (KeyBinding keybindingx : GuiKeyBindingList.this.mc.gameSettings.keyBindings) {
|
||||
KeyBinding[] kb = GuiKeyBindingList.this.mc.gameSettings.keyBindings;
|
||||
for (int m = 0; m < kb.length; ++m) {
|
||||
KeyBinding keybindingx = kb[m];
|
||||
if (keybindingx != this.keybinding && keybindingx.getKeyCode() == this.keybinding.getKeyCode()) {
|
||||
flag1 = true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.demo.DemoWorldServer;
|
||||
import net.minecraft.world.storage.ISaveFormat;
|
||||
|
||||
/**+
|
||||
|
|
@ -358,7 +357,7 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback {
|
|||
ISaveFormat isaveformat = this.mc.getSaveLoader();
|
||||
isaveformat.deleteWorldDirectory("Demo World");
|
||||
this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.deleting",
|
||||
"singleplayer.failed.deleting", () -> SingleplayerServerController.isReady()));
|
||||
"singleplayer.failed.deleting", SingleplayerServerController::isReady));
|
||||
} else {
|
||||
this.mc.displayGuiScreen(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -264,6 +264,10 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback {
|
|||
}
|
||||
}
|
||||
|
||||
public void cancelDirectConnect() {
|
||||
this.directConnect = false;
|
||||
}
|
||||
|
||||
/**+
|
||||
* Fired when a key is typed (except F11 which toggles full
|
||||
* screen). This is the equivalent of
|
||||
|
|
@ -329,11 +333,11 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback {
|
|||
this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.title", new Object[0]), this.width / 2,
|
||||
20, 16777215);
|
||||
super.drawScreen(i, j, f);
|
||||
relaysButton.drawScreen(i, j);
|
||||
drawPluginDownloadLink(i, j);
|
||||
if (this.hoveringText != null) {
|
||||
this.drawHoveringText(Lists.newArrayList(Splitter.on("\n").split(this.hoveringText)), i, j);
|
||||
}
|
||||
relaysButton.drawScreen(i, j);
|
||||
drawPluginDownloadLink(i, j);
|
||||
}
|
||||
|
||||
private void drawPluginDownloadLink(int xx, int yy) {
|
||||
|
|
|
|||
|
|
@ -154,13 +154,13 @@ public class GuiNewChat extends Gui {
|
|||
List list = GuiUtilRenderComponents.func_178908_a(parIChatComponent, i, this.mc.fontRendererObj, false, false);
|
||||
boolean flag = this.getChatOpen();
|
||||
|
||||
for (IChatComponent ichatcomponent : (List<IChatComponent>) list) {
|
||||
for (int j = 0, l = list.size(); j < l; ++j) {
|
||||
if (flag && this.scrollPos > 0) {
|
||||
this.isScrolled = true;
|
||||
this.scroll(1);
|
||||
}
|
||||
|
||||
this.field_146253_i.add(0, new ChatLine(parInt2, ichatcomponent, parInt1));
|
||||
this.field_146253_i.add(0, new ChatLine(parInt2, (IChatComponent) list.get(j), parInt1));
|
||||
}
|
||||
|
||||
while (this.field_146253_i.size() > 100) {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,23 @@
|
|||
package net.minecraft.client.gui;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.Mouse;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.EaglerDeferredPipeline;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.gui.GuiShaderConfig;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.gui.GuiShadersNotSupported;
|
||||
import net.lax1dude.eaglercraft.v1_8.profile.GuiScreenImportExportProfile;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController;
|
||||
import net.lax1dude.eaglercraft.v1_8.vfs.SYS;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.EnumDifficulty;
|
||||
|
||||
/**+
|
||||
|
|
@ -57,7 +64,8 @@ public class GuiOptions extends GuiScreen implements GuiYesNoCallback {
|
|||
int i = 0;
|
||||
this.field_146442_a = I18n.format("options.title", new Object[0]);
|
||||
|
||||
for (GameSettings.Options gamesettings$options : field_146440_f) {
|
||||
for (int j = 0; j < field_146440_f.length; ++j) {
|
||||
GameSettings.Options gamesettings$options = field_146440_f[j];
|
||||
if (gamesettings$options.getEnumFloat()) {
|
||||
this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(),
|
||||
this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1),
|
||||
|
|
@ -108,17 +116,15 @@ public class GuiOptions extends GuiScreen implements GuiYesNoCallback {
|
|||
I18n.format("options.language", new Object[0])));
|
||||
this.buttonList.add(new GuiButton(103, this.width / 2 + 5, this.height / 6 + 120 - 6, 150, 20,
|
||||
I18n.format("options.chat.title", new Object[0])));
|
||||
GuiButton rp;
|
||||
this.buttonList.add(rp = new GuiButton(105, this.width / 2 - 155, this.height / 6 + 144 - 6, 150, 20,
|
||||
GuiButton btn;
|
||||
this.buttonList.add(btn = new GuiButton(105, this.width / 2 - 155, this.height / 6 + 144 - 6, 150, 20,
|
||||
I18n.format("options.resourcepack", new Object[0])));
|
||||
GuiButton dbg;
|
||||
this.buttonList.add(dbg = new GuiButton(104, this.width / 2 + 5, this.height / 6 + 144 - 6, 150, 20,
|
||||
btn.enabled = EaglerFolderResourcePack.isSupported();
|
||||
this.buttonList.add(btn = new GuiButton(104, this.width / 2 + 5, this.height / 6 + 144 - 6, 150, 20,
|
||||
I18n.format("options.debugConsoleButton", new Object[0])));
|
||||
dbg.enabled = EagRuntime.getPlatformType() != EnumPlatformType.DESKTOP;
|
||||
btn.enabled = EagRuntime.getPlatformType() != EnumPlatformType.DESKTOP;
|
||||
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168,
|
||||
I18n.format("gui.done", new Object[0])));
|
||||
|
||||
rp.enabled = SYS.VFS != null;
|
||||
}
|
||||
|
||||
public String func_175355_a(EnumDifficulty parEnumDifficulty) {
|
||||
|
|
@ -241,6 +247,36 @@ public class GuiOptions extends GuiScreen implements GuiYesNoCallback {
|
|||
public void drawScreen(int i, int j, float f) {
|
||||
this.drawDefaultBackground();
|
||||
this.drawCenteredString(this.fontRendererObj, this.field_146442_a, this.width / 2, 15, 16777215);
|
||||
|
||||
if (mc.theWorld == null && !EagRuntime.getConfiguration().isDemo()) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scale(0.75f, 0.75f, 0.75f);
|
||||
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
String text = I18n.format("editProfile.importExport");
|
||||
|
||||
int w = mc.fontRendererObj.getStringWidth(text);
|
||||
boolean hover = i > 1 && j > 1 && i < (w * 3 / 4) + 7 && j < 12;
|
||||
if (hover) {
|
||||
Mouse.showCursor(EnumCursorType.HAND);
|
||||
}
|
||||
|
||||
drawString(mc.fontRendererObj, EnumChatFormatting.UNDERLINE + text, 5, 5, hover ? 0xFFEEEE22 : 0xFFCCCCCC);
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
super.drawScreen(i, j, f);
|
||||
}
|
||||
|
||||
protected void mouseClicked(int mx, int my, int button) {
|
||||
super.mouseClicked(mx, my, button);
|
||||
if (mc.theWorld == null && !EagRuntime.getConfiguration().isDemo()) {
|
||||
int w = mc.fontRendererObj.getStringWidth(I18n.format("editProfile.importExport"));
|
||||
if (mx > 1 && my > 1 && mx < (w * 3 / 4) + 7 && my < 12) {
|
||||
mc.displayGuiScreen(new GuiScreenImportExportProfile(this));
|
||||
mc.getSoundHandler()
|
||||
.playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -20,18 +20,14 @@ import net.lax1dude.eaglercraft.v1_8.HString;
|
|||
import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.ClientBrandRetriever;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
|
@ -284,7 +280,8 @@ public class GuiOverlayDebug extends Gui {
|
|||
List<String> strs = SingleplayerServerController.getTPS();
|
||||
int l;
|
||||
boolean first = true;
|
||||
for (String str : strs) {
|
||||
for (int j = 0, m = strs.size(); j < m; ++j) {
|
||||
String str = strs.get(j);
|
||||
l = (int) (this.fontRenderer.getStringWidth(str) * (!first ? 0.5f : 1.0f));
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(parScaledResolution.getScaledWidth() - 2 - l, i + 2, 0.0f);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ public class GuiPageButtonList extends GuiListExtended {
|
|||
}
|
||||
|
||||
private void func_178069_s() {
|
||||
for (GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry : this.field_178078_x) {
|
||||
for (int n = 0; n < this.field_178078_x.length; ++n) {
|
||||
GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry = this.field_178078_x[n];
|
||||
for (int i = 0; i < aguipagebuttonlist$guilistentry.length; i += 2) {
|
||||
GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry = aguipagebuttonlist$guilistentry[i];
|
||||
GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry1 = i < aguipagebuttonlist$guilistentry.length
|
||||
|
|
@ -137,17 +138,18 @@ public class GuiPageButtonList extends GuiListExtended {
|
|||
}
|
||||
|
||||
private void func_178060_e(int parInt1, int parInt2) {
|
||||
for (GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry : this.field_178078_x[parInt1]) {
|
||||
if (guipagebuttonlist$guilistentry != null) {
|
||||
this.func_178066_a((Gui) this.field_178073_v.lookup(guipagebuttonlist$guilistentry.func_178935_b()),
|
||||
false);
|
||||
|
||||
GuiListEntry[] etr = this.field_178078_x[parInt1];
|
||||
for (int i = 0; i < etr.length; ++i) {
|
||||
if (etr[i] != null) {
|
||||
this.func_178066_a((Gui) this.field_178073_v.lookup(etr[i].func_178935_b()), false);
|
||||
}
|
||||
}
|
||||
|
||||
for (GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry1 : this.field_178078_x[parInt2]) {
|
||||
if (guipagebuttonlist$guilistentry1 != null) {
|
||||
this.func_178066_a((Gui) this.field_178073_v.lookup(guipagebuttonlist$guilistentry1.func_178935_b()),
|
||||
true);
|
||||
etr = this.field_178078_x[parInt2];
|
||||
for (int i = 0; i < etr.length; ++i) {
|
||||
if (etr[i] != null) {
|
||||
this.func_178066_a((Gui) this.field_178073_v.lookup(etr[i].func_178935_b()), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -181,7 +183,8 @@ public class GuiPageButtonList extends GuiListExtended {
|
|||
}
|
||||
|
||||
public void func_181155_a(boolean parFlag) {
|
||||
for (GuiPageButtonList.GuiEntry guipagebuttonlist$guientry : this.field_178074_u) {
|
||||
for (int i = 0, l = this.field_178074_u.size(); i < l; ++i) {
|
||||
GuiPageButtonList.GuiEntry guipagebuttonlist$guientry = this.field_178074_u.get(i);
|
||||
if (guipagebuttonlist$guientry.field_178029_b instanceof GuiButton) {
|
||||
((GuiButton) guipagebuttonlist$guientry.field_178029_b).enabled = parFlag;
|
||||
}
|
||||
|
|
@ -290,8 +293,8 @@ public class GuiPageButtonList extends GuiListExtended {
|
|||
int i = this.field_178072_w.indexOf(this.field_178075_A);
|
||||
int j = i;
|
||||
|
||||
for (String s1 : astring) {
|
||||
((GuiTextField) this.field_178072_w.get(j)).setText(s1);
|
||||
for (int k = 0; k < astring.length; ++k) {
|
||||
((GuiTextField) this.field_178072_w.get(j)).setText(astring[k]);
|
||||
if (j == this.field_178072_w.size() - 1) {
|
||||
j = 0;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,8 @@ public class GuiPlayerTabOverlay extends Gui {
|
|||
int i = 0;
|
||||
int j = 0;
|
||||
|
||||
for (NetworkPlayerInfo networkplayerinfo : (List<NetworkPlayerInfo>) list) {
|
||||
for (int m = 0, n = list.size(); m < n; ++m) {
|
||||
NetworkPlayerInfo networkplayerinfo = (NetworkPlayerInfo) list.get(m);
|
||||
int k = this.mc.fontRendererObj.getStringWidth(this.getPlayerName(networkplayerinfo));
|
||||
i = Math.max(i, k);
|
||||
if (scoreObjectiveIn != null
|
||||
|
|
@ -127,21 +128,21 @@ public class GuiPlayerTabOverlay extends Gui {
|
|||
int j1 = width / 2 - (i1 * j4 + (j4 - 1) * 5) / 2;
|
||||
int k1 = 10;
|
||||
int l1 = i1 * j4 + (j4 - 1) * 5;
|
||||
List list1 = null;
|
||||
List list2 = null;
|
||||
List<String> list1 = null;
|
||||
List<String> list2 = null;
|
||||
if (this.header != null) {
|
||||
list1 = this.mc.fontRendererObj.listFormattedStringToWidth(this.header.getFormattedText(), width - 50);
|
||||
|
||||
for (String s : (List<String>) list1) {
|
||||
l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(s));
|
||||
for (int m = 0, n = list1.size(); m < n; ++m) {
|
||||
l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(list1.get(m)));
|
||||
}
|
||||
}
|
||||
|
||||
if (this.footer != null) {
|
||||
list2 = this.mc.fontRendererObj.listFormattedStringToWidth(this.footer.getFormattedText(), width - 50);
|
||||
|
||||
for (String s2 : (List<String>) list2) {
|
||||
l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(s2));
|
||||
for (int m = 0, n = list2.size(); m < n; ++m) {
|
||||
l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(list2.get(m)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -149,7 +150,8 @@ public class GuiPlayerTabOverlay extends Gui {
|
|||
drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1,
|
||||
k1 + list1.size() * this.mc.fontRendererObj.FONT_HEIGHT, Integer.MIN_VALUE);
|
||||
|
||||
for (String s3 : (List<String>) list1) {
|
||||
for (int m = 0, n = list1.size(); m < n; ++m) {
|
||||
String s3 = list1.get(m);
|
||||
int i2 = this.mc.fontRendererObj.getStringWidth(s3);
|
||||
this.mc.fontRendererObj.drawStringWithShadow(s3, (float) (width / 2 - i2 / 2), (float) k1, -1);
|
||||
k1 += this.mc.fontRendererObj.FONT_HEIGHT;
|
||||
|
|
@ -216,7 +218,8 @@ public class GuiPlayerTabOverlay extends Gui {
|
|||
drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1,
|
||||
k1 + list2.size() * this.mc.fontRendererObj.FONT_HEIGHT, Integer.MIN_VALUE);
|
||||
|
||||
for (String s4 : (List<String>) list2) {
|
||||
for (int m = 0, n = list2.size(); m < n; ++m) {
|
||||
String s4 = list2.get(m);
|
||||
int j5 = this.mc.fontRendererObj.getStringWidth(s4);
|
||||
this.mc.fontRendererObj.drawStringWithShadow(s4, (float) (width / 2 - j5 / 2), (float) k1, -1);
|
||||
k1 += this.mc.fontRendererObj.FONT_HEIGHT;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,8 @@
|
|||
package net.minecraft.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.Keyboard;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenIntegratedServerBusy;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.world.storage.ISaveFormat;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
|
|
@ -101,13 +96,13 @@ public class GuiRenameWorld extends GuiScreen {
|
|||
SingleplayerServerController.duplicateWorld(this.saveName, this.field_146583_f.getText().trim());
|
||||
this.mc.displayGuiScreen(
|
||||
new GuiScreenIntegratedServerBusy(this.parentScreen, "singleplayer.busy.duplicating",
|
||||
"singleplayer.failed.duplicating", () -> SingleplayerServerController.isReady()));
|
||||
"singleplayer.failed.duplicating", SingleplayerServerController::isReady));
|
||||
} else {
|
||||
ISaveFormat isaveformat = this.mc.getSaveLoader();
|
||||
isaveformat.renameWorld(this.saveName, this.field_146583_f.getText().trim());
|
||||
this.mc.displayGuiScreen(
|
||||
new GuiScreenIntegratedServerBusy(this.parentScreen, "singleplayer.busy.renaming",
|
||||
"singleplayer.failed.renaming", () -> SingleplayerServerController.isReady()));
|
||||
"singleplayer.failed.renaming", SingleplayerServerController::isReady));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,11 +92,11 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback {
|
|||
* mouseY, renderPartialTicks
|
||||
*/
|
||||
public void drawScreen(int i, int j, float var3) {
|
||||
for (int k = 0; k < this.buttonList.size(); ++k) {
|
||||
for (int k = 0, l = this.buttonList.size(); k < l; ++k) {
|
||||
((GuiButton) this.buttonList.get(k)).drawButton(this.mc, i, j);
|
||||
}
|
||||
|
||||
for (int l = 0; l < this.labelList.size(); ++l) {
|
||||
for (int l = 0, m = this.labelList.size(); l < m; ++l) {
|
||||
((GuiLabel) this.labelList.get(l)).drawLabel(this.mc, i, j);
|
||||
}
|
||||
|
||||
|
|
@ -178,7 +178,7 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback {
|
|||
protected void renderToolTip(ItemStack itemstack, int i, int j) {
|
||||
List list = itemstack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips);
|
||||
|
||||
for (int k = 0; k < list.size(); ++k) {
|
||||
for (int k = 0, l = list.size(); k < l; ++k) {
|
||||
if (k == 0) {
|
||||
list.set(k, itemstack.getRarity().rarityColor + (String) list.get(k));
|
||||
} else {
|
||||
|
|
@ -210,8 +210,8 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback {
|
|||
GlStateManager.disableDepth();
|
||||
int k = 0;
|
||||
|
||||
for (String s : list) {
|
||||
int l = this.fontRendererObj.getStringWidth(s);
|
||||
for (int m = 0, n = list.size(); m < n; ++m) {
|
||||
int l = this.fontRendererObj.getStringWidth(list.get(m));
|
||||
if (l > k) {
|
||||
k = l;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,8 +102,8 @@ public class GuiScreenAddServer extends GuiScreen {
|
|||
+ I18n.format(this.serverData.hideAddress ? "gui.yes" : "gui.no", new Object[0]);
|
||||
} else if (parGuiButton.id == 2) {
|
||||
this.serverData.setResourceMode(
|
||||
ServerData.ServerResourceMode.values()[(this.serverData.getResourceMode().ordinal() + 1)
|
||||
% ServerData.ServerResourceMode.values().length]);
|
||||
ServerData.ServerResourceMode._VALUES[(this.serverData.getResourceMode().ordinal() + 1)
|
||||
% ServerData.ServerResourceMode._VALUES.length]);
|
||||
this.serverResourcePacks.displayString = I18n.format("addServer.resourcePack", new Object[0]) + ": "
|
||||
+ this.serverData.getResourceMode().getMotd().getFormattedText();
|
||||
} else if (parGuiButton.id == 1) {
|
||||
|
|
|
|||
|
|
@ -7,11 +7,6 @@ import java.util.List;
|
|||
import net.lax1dude.eaglercraft.v1_8.Keyboard;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiCustomizeWorldScreen;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiSlot;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,9 @@ public class GuiScreenOptionsSounds extends GuiScreen {
|
|||
this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), SoundCategory.MASTER, true));
|
||||
i = i + 2;
|
||||
|
||||
for (SoundCategory soundcategory : SoundCategory.values()) {
|
||||
SoundCategory[] cats = SoundCategory._VALUES;
|
||||
for (int j = 0; j < cats.length; ++j) {
|
||||
SoundCategory soundcategory = cats[j];
|
||||
if (soundcategory != SoundCategory.MASTER) {
|
||||
this.buttonList.add(new GuiScreenOptionsSounds.Button(soundcategory.getCategoryId(),
|
||||
this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), soundcategory,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package net.minecraft.client.gui;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
|
@ -9,10 +8,11 @@ import java.util.List;
|
|||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.vfs.SYS;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.FileChooserResult;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.GuiScreenGenericErrorMessage;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.resources.ResourcePackListEntry;
|
||||
import net.minecraft.client.resources.ResourcePackListEntryDefault;
|
||||
|
|
@ -58,10 +58,8 @@ public class GuiScreenResourcePacks extends GuiScreen {
|
|||
* window resizes, the buttonList is cleared beforehand.
|
||||
*/
|
||||
public void initGui() {
|
||||
GuiButton btn;
|
||||
this.buttonList.add(btn = new GuiOptionButton(2, this.width / 2 - 154, this.height - 48,
|
||||
this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48,
|
||||
I18n.format("resourcePack.openFolder", new Object[0])));
|
||||
btn.enabled = SYS.VFS != null;
|
||||
this.buttonList.add(
|
||||
new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0])));
|
||||
if (!this.changed) {
|
||||
|
|
@ -69,16 +67,18 @@ public class GuiScreenResourcePacks extends GuiScreen {
|
|||
this.selectedResourcePacks = Lists.newArrayList();
|
||||
ResourcePackRepository resourcepackrepository = this.mc.getResourcePackRepository();
|
||||
resourcepackrepository.updateRepositoryEntriesAll();
|
||||
ArrayList arraylist = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll());
|
||||
List arraylist = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll());
|
||||
arraylist.removeAll(resourcepackrepository.getRepositoryEntries());
|
||||
|
||||
for (ResourcePackRepository.Entry resourcepackrepository$entry : (List<ResourcePackRepository.Entry>) arraylist) {
|
||||
this.availableResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry));
|
||||
for (int i = 0, l = arraylist.size(); i < l; ++i) {
|
||||
this.availableResourcePacks
|
||||
.add(new ResourcePackListEntryFound(this, (ResourcePackRepository.Entry) arraylist.get(i)));
|
||||
}
|
||||
|
||||
for (ResourcePackRepository.Entry resourcepackrepository$entry1 : Lists
|
||||
.reverse(resourcepackrepository.getRepositoryEntries())) {
|
||||
this.selectedResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry1));
|
||||
arraylist = Lists.reverse(resourcepackrepository.getRepositoryEntries());
|
||||
for (int i = 0, l = arraylist.size(); i < l; ++i) {
|
||||
this.selectedResourcePacks
|
||||
.add(new ResourcePackListEntryFound(this, (ResourcePackRepository.Entry) arraylist.get(i)));
|
||||
}
|
||||
|
||||
this.selectedResourcePacks.add(new ResourcePackListEntryDefault(this));
|
||||
|
|
@ -138,14 +138,13 @@ public class GuiScreenResourcePacks extends GuiScreen {
|
|||
protected void actionPerformed(GuiButton parGuiButton) {
|
||||
if (parGuiButton.enabled) {
|
||||
if (parGuiButton.id == 2) {
|
||||
if (SYS.VFS == null)
|
||||
return;
|
||||
EagRuntime.displayFileChooser("application/zip", "zip");
|
||||
} else if (parGuiButton.id == 1) {
|
||||
if (this.changed) {
|
||||
ArrayList arraylist = Lists.newArrayList();
|
||||
ArrayList<ResourcePackRepository.Entry> arraylist = Lists.newArrayList();
|
||||
|
||||
for (ResourcePackListEntry resourcepacklistentry : this.selectedResourcePacks) {
|
||||
for (int i = 0, l = this.selectedResourcePacks.size(); i < l; ++i) {
|
||||
ResourcePackListEntry resourcepacklistentry = this.selectedResourcePacks.get(i);
|
||||
if (resourcepacklistentry instanceof ResourcePackListEntryFound) {
|
||||
arraylist.add(((ResourcePackListEntryFound) resourcepacklistentry).func_148318_i());
|
||||
}
|
||||
|
|
@ -156,7 +155,8 @@ public class GuiScreenResourcePacks extends GuiScreen {
|
|||
this.mc.gameSettings.resourcePacks.clear();
|
||||
this.mc.gameSettings.field_183018_l.clear();
|
||||
|
||||
for (ResourcePackRepository.Entry resourcepackrepository$entry : (List<ResourcePackRepository.Entry>) arraylist) {
|
||||
for (int i = 0, l = arraylist.size(); i < l; ++i) {
|
||||
ResourcePackRepository.Entry resourcepackrepository$entry = arraylist.get(i);
|
||||
this.mc.gameSettings.resourcePacks.add(resourcepackrepository$entry.getResourcePackName());
|
||||
if (resourcepackrepository$entry.func_183027_f() != 1) {
|
||||
this.mc.gameSettings.field_183018_l.add(resourcepackrepository$entry.getResourcePackName());
|
||||
|
|
@ -179,15 +179,25 @@ public class GuiScreenResourcePacks extends GuiScreen {
|
|||
if (EagRuntime.fileChooserHasResult()) {
|
||||
packFile = EagRuntime.getFileChooserResult();
|
||||
}
|
||||
if (packFile == null)
|
||||
if (packFile == null) {
|
||||
return;
|
||||
logger.info("Loading resource pack: {}", packFile.fileName);
|
||||
}
|
||||
mc.loadingScreen.eaglerShow(I18n.format("resourcePack.load.loading"), packFile.fileName);
|
||||
SYS.loadResourcePack(packFile.fileName, new ByteArrayInputStream(packFile.fileData), null);
|
||||
try {
|
||||
EaglerFolderResourcePack.importResourcePack(packFile.fileName, EaglerFolderResourcePack.RESOURCE_PACKS,
|
||||
packFile.fileData);
|
||||
} catch (IOException e) {
|
||||
logger.error("Could not load resource pack: {}", packFile.fileName);
|
||||
logger.error(e);
|
||||
mc.displayGuiScreen(new GuiScreenGenericErrorMessage("resourcePack.importFailed.1",
|
||||
"resourcePack.importFailed.2", parentScreen));
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList arraylist = Lists.newArrayList();
|
||||
ArrayList<ResourcePackRepository.Entry> arraylist = Lists.newArrayList();
|
||||
|
||||
for (ResourcePackListEntry resourcepacklistentry : this.selectedResourcePacks) {
|
||||
for (int i = 0, l = this.selectedResourcePacks.size(); i < l; ++i) {
|
||||
ResourcePackListEntry resourcepacklistentry = this.selectedResourcePacks.get(i);
|
||||
if (resourcepacklistentry instanceof ResourcePackListEntryFound) {
|
||||
arraylist.add(((ResourcePackListEntryFound) resourcepacklistentry).func_148318_i());
|
||||
}
|
||||
|
|
@ -198,7 +208,8 @@ public class GuiScreenResourcePacks extends GuiScreen {
|
|||
this.mc.gameSettings.resourcePacks.clear();
|
||||
this.mc.gameSettings.field_183018_l.clear();
|
||||
|
||||
for (ResourcePackRepository.Entry resourcepackrepository$entry : (List<ResourcePackRepository.Entry>) arraylist) {
|
||||
for (int i = 0, l = arraylist.size(); i < l; ++i) {
|
||||
ResourcePackRepository.Entry resourcepackrepository$entry = arraylist.get(i);
|
||||
this.mc.gameSettings.resourcePacks.add(resourcepackrepository$entry.getResourcePackName());
|
||||
if (resourcepackrepository$entry.func_183027_f() != 1) {
|
||||
this.mc.gameSettings.field_183018_l.add(resourcepackrepository$entry.getResourcePackName());
|
||||
|
|
|
|||
|
|
@ -13,14 +13,6 @@ import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenLANNotSupported;
|
|||
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiCreateWorld;
|
||||
import net.minecraft.client.gui.GuiErrorScreen;
|
||||
import net.minecraft.client.gui.GuiRenameWorld;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiSlot;
|
||||
import net.minecraft.client.gui.GuiYesNo;
|
||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
|
@ -110,7 +102,7 @@ public class GuiSelectWorld extends GuiScreen implements GuiYesNoCallback {
|
|||
waitingForWorlds = true;
|
||||
this.mc.getSaveLoader().flushCache();
|
||||
this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.listingworlds",
|
||||
"singleplayer.failed.listingworlds", () -> SingleplayerServerController.isReady(), (t, u) -> {
|
||||
"singleplayer.failed.listingworlds", SingleplayerServerController::isReady, (t, u) -> {
|
||||
GuiScreenIntegratedServerBusy tt = (GuiScreenIntegratedServerBusy) t;
|
||||
Minecraft.getMinecraft().displayGuiScreen(
|
||||
GuiScreenIntegratedServerBusy.createException(parentScreen, tt.failMessage, u));
|
||||
|
|
@ -232,7 +224,7 @@ public class GuiSelectWorld extends GuiScreen implements GuiYesNoCallback {
|
|||
ISaveFormat isaveformat = this.mc.getSaveLoader();
|
||||
isaveformat.deleteWorldDirectory(this.func_146621_a(i));
|
||||
this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.deleting",
|
||||
"singleplayer.failed.deleting", () -> SingleplayerServerController.isReady()));
|
||||
"singleplayer.failed.deleting", SingleplayerServerController::isReady));
|
||||
} else {
|
||||
this.mc.displayGuiScreen(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,17 +58,8 @@ public class GuiVideoSettings extends GuiScreen {
|
|||
this.buttonList.clear();
|
||||
this.buttonList.add(
|
||||
new GuiButton(200, this.width / 2 - 100, this.height - 27, I18n.format("gui.done", new Object[0])));
|
||||
GameSettings.Options[] agamesettings$options = new GameSettings.Options[videoOptions.length];
|
||||
int i = 0;
|
||||
|
||||
for (GameSettings.Options gamesettings$options : videoOptions) {
|
||||
agamesettings$options[i] = gamesettings$options;
|
||||
++i;
|
||||
}
|
||||
|
||||
this.optionsRowList = new GuiOptionsRowList(this.mc, this.width, this.height, 32, this.height - 32, 25,
|
||||
agamesettings$options);
|
||||
|
||||
videoOptions);
|
||||
}
|
||||
|
||||
/**+
|
||||
|
|
|
|||
|
|
@ -90,8 +90,8 @@ public class GuiYesNo extends GuiScreen {
|
|||
this.drawCenteredString(this.fontRendererObj, this.messageLine1, this.width / 2, 70, 16777215);
|
||||
int k = 90;
|
||||
|
||||
for (String s : this.field_175298_s) {
|
||||
this.drawCenteredString(this.fontRendererObj, s, this.width / 2, k, 16777215);
|
||||
for (int l = 0, m = this.field_175298_s.size(); l < m; ++l) {
|
||||
this.drawCenteredString(this.fontRendererObj, this.field_175298_s.get(l), this.width / 2, k, 16777215);
|
||||
k += this.fontRendererObj.FONT_HEIGHT;
|
||||
}
|
||||
|
||||
|
|
@ -104,8 +104,8 @@ public class GuiYesNo extends GuiScreen {
|
|||
public void setButtonDelay(int parInt1) {
|
||||
this.ticksUntilEnable = parInt1;
|
||||
|
||||
for (GuiButton guibutton : this.buttonList) {
|
||||
guibutton.enabled = false;
|
||||
for (int l = 0, m = this.buttonList.size(); l < m; ++l) {
|
||||
this.buttonList.get(l).enabled = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -116,8 +116,8 @@ public class GuiYesNo extends GuiScreen {
|
|||
public void updateScreen() {
|
||||
super.updateScreen();
|
||||
if (--this.ticksUntilEnable == 0) {
|
||||
for (GuiButton guibutton : this.buttonList) {
|
||||
guibutton.enabled = true;
|
||||
for (int l = 0, m = this.buttonList.size(); l < m; ++l) {
|
||||
this.buttonList.get(l).enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ public class ScreenChatOptions extends GuiScreen {
|
|||
int i = 0;
|
||||
this.field_146401_i = I18n.format("options.chat.title", new Object[0]);
|
||||
|
||||
for (GameSettings.Options gamesettings$options : field_146399_a) {
|
||||
for (int j = 0; j < field_146399_a.length; ++j) {
|
||||
GameSettings.Options gamesettings$options = field_146399_a[j];
|
||||
if (gamesettings$options.getEnumFloat()) {
|
||||
this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(),
|
||||
this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options));
|
||||
|
|
|
|||
|
|
@ -421,7 +421,8 @@ public class GuiStats extends GuiScreen implements IProgressMeter {
|
|||
super(mcIn);
|
||||
this.statsHolder = Lists.newArrayList();
|
||||
|
||||
for (StatCrafting statcrafting : StatList.objectMineStats) {
|
||||
for (int m = 0, l = StatList.objectMineStats.size(); m < l; ++m) {
|
||||
StatCrafting statcrafting = StatList.objectMineStats.get(m);
|
||||
boolean flag = false;
|
||||
int i = Item.getIdFromItem(statcrafting.func_150959_a());
|
||||
if (GuiStats.this.field_146546_t.readStat(statcrafting) > 0) {
|
||||
|
|
@ -555,7 +556,8 @@ public class GuiStats extends GuiScreen implements IProgressMeter {
|
|||
super(mcIn);
|
||||
this.statsHolder = Lists.newArrayList();
|
||||
|
||||
for (StatCrafting statcrafting : StatList.itemStats) {
|
||||
for (int m = 0, l = StatList.itemStats.size(); m < l; ++m) {
|
||||
StatCrafting statcrafting = StatList.itemStats.get(m);
|
||||
boolean flag = false;
|
||||
int i = Item.getIdFromItem(statcrafting.func_150959_a());
|
||||
if (GuiStats.this.field_146546_t.readStat(statcrafting) > 0) {
|
||||
|
|
|
|||
|
|
@ -175,7 +175,8 @@ public class GuiBeacon extends GuiContainer {
|
|||
this.drawCenteredString(this.fontRendererObj, I18n.format("tile.beacon.secondary", new Object[0]), 169, 10,
|
||||
14737632);
|
||||
|
||||
for (GuiButton guibutton : this.buttonList) {
|
||||
for (int k = 0, l = this.buttonList.size(); k < l; ++k) {
|
||||
GuiButton guibutton = this.buttonList.get(k);
|
||||
if (guibutton.isMouseOver()) {
|
||||
guibutton.drawButtonForegroundLayer(i - this.guiLeft, j - this.guiTop);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
package net.minecraft.client.gui.inventory;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.Keyboard;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
|
||||
|
|
@ -455,7 +455,9 @@ public abstract class GuiContainer extends GuiScreen {
|
|||
if (this.doubleClick && slot != null && k == 0 && this.inventorySlots.canMergeSlot((ItemStack) null, slot)) {
|
||||
if (isShiftKeyDown()) {
|
||||
if (slot != null && slot.inventory != null && this.shiftClickedSlot != null) {
|
||||
for (Slot slot2 : this.inventorySlots.inventorySlots) {
|
||||
List<Slot> lst = this.inventorySlots.inventorySlots;
|
||||
for (int n = 0, m = lst.size(); n < m; ++n) {
|
||||
Slot slot2 = lst.get(n);
|
||||
if (slot2 != null && slot2.canTakeStack(this.mc.thePlayer) && slot2.getHasStack()
|
||||
&& slot2.inventory == slot.inventory
|
||||
&& Container.canAddItemToSlot(slot2, this.shiftClickedSlot, true)) {
|
||||
|
|
|
|||
|
|
@ -310,7 +310,8 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
for (Enchantment enchantment : Enchantment.enchantmentsBookList) {
|
||||
for (int i = 0; i < Enchantment.enchantmentsBookList.length; ++i) {
|
||||
Enchantment enchantment = Enchantment.enchantmentsBookList[i];
|
||||
if (enchantment != null && enchantment.type != null) {
|
||||
Items.enchanted_book.getAll(enchantment, guicontainercreative$containercreative.itemList);
|
||||
}
|
||||
|
|
@ -323,8 +324,9 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
|
|||
ItemStack itemstack = (ItemStack) iterator.next();
|
||||
boolean flag = false;
|
||||
|
||||
for (String s : itemstack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips)) {
|
||||
if (EnumChatFormatting.getTextWithoutFormattingCodes(s).toLowerCase().contains(s1)) {
|
||||
List<String> lst = itemstack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips);
|
||||
for (int i = 0, l = lst.size(); i < l; ++i) {
|
||||
if (EnumChatFormatting.getTextWithoutFormattingCodes(lst.get(i)).toLowerCase().contains(s1)) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -362,8 +364,8 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
|
|||
int i = parInt1 - this.guiLeft;
|
||||
int j = parInt2 - this.guiTop;
|
||||
|
||||
for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray) {
|
||||
if (this.func_147049_a(creativetabs, i, j)) {
|
||||
for (int k = 0; k < CreativeTabs.creativeTabArray.length; ++k) {
|
||||
if (this.func_147049_a(CreativeTabs.creativeTabArray[k], i, j)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -381,7 +383,8 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
|
|||
int l = i - this.guiLeft;
|
||||
int i1 = j - this.guiTop;
|
||||
|
||||
for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray) {
|
||||
for (int m = 0; m < CreativeTabs.creativeTabArray.length; ++m) {
|
||||
CreativeTabs creativetabs = CreativeTabs.creativeTabArray[m];
|
||||
if (this.func_147049_a(creativetabs, l, i1)) {
|
||||
this.setCurrentCreativeTab(creativetabs);
|
||||
return;
|
||||
|
|
@ -520,8 +523,8 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
|
|||
|
||||
super.drawScreen(i, j, f);
|
||||
|
||||
for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray) {
|
||||
if (this.renderCreativeInventoryHoveringText(creativetabs, i, j)) {
|
||||
for (int m = 0; m < CreativeTabs.creativeTabArray.length; ++m) {
|
||||
if (this.renderCreativeInventoryHoveringText(CreativeTabs.creativeTabArray[m], i, j)) {
|
||||
Mouse.showCursor(EnumCursorType.HAND);
|
||||
break;
|
||||
}
|
||||
|
|
@ -547,7 +550,8 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
|
|||
Enchantment enchantment = Enchantment
|
||||
.getEnchantmentById(((Integer) map.keySet().iterator().next()).intValue());
|
||||
|
||||
for (CreativeTabs creativetabs1 : CreativeTabs.creativeTabArray) {
|
||||
for (int m = 0; m < CreativeTabs.creativeTabArray.length; ++m) {
|
||||
CreativeTabs creativetabs1 = CreativeTabs.creativeTabArray[m];
|
||||
if (creativetabs1.hasRelevantEnchantmentType(enchantment.type)) {
|
||||
creativetabs = creativetabs1;
|
||||
break;
|
||||
|
|
@ -584,7 +588,8 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
|
|||
RenderHelper.enableGUIStandardItemLighting();
|
||||
CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex];
|
||||
|
||||
for (CreativeTabs creativetabs1 : CreativeTabs.creativeTabArray) {
|
||||
for (int m = 0; m < CreativeTabs.creativeTabArray.length; ++m) {
|
||||
CreativeTabs creativetabs1 = CreativeTabs.creativeTabArray[m];
|
||||
this.mc.getTextureManager().bindTexture(creativeInventoryTabs);
|
||||
if (creativetabs1.getTabIndex() != selectedTabIndex) {
|
||||
this.func_147051_a(creativetabs1);
|
||||
|
|
|
|||
|
|
@ -3,12 +3,10 @@ package net.minecraft.client.gui.spectator;
|
|||
import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.network.play.client.C18PacketSpectate;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**+
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
|
|
|
|||
|
|
@ -57,7 +57,9 @@ public class TeleportToPlayer implements ISpectatorMenuView, ISpectatorMenuObjec
|
|||
public TeleportToPlayer(Collection<NetworkPlayerInfo> parCollection) {
|
||||
this.field_178673_b = Lists.newArrayList();
|
||||
|
||||
for (NetworkPlayerInfo networkplayerinfo : field_178674_a.sortedCopy(parCollection)) {
|
||||
List<NetworkPlayerInfo> lst = field_178674_a.sortedCopy(parCollection);
|
||||
for (int i = 0, l = lst.size(); i < l; ++i) {
|
||||
NetworkPlayerInfo networkplayerinfo = lst.get(i);
|
||||
if (networkplayerinfo.getGameType() != WorldSettings.GameType.SPECTATOR) {
|
||||
this.field_178673_b.add(new PlayerMenuObject(networkplayerinfo.getGameProfile()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
package net.minecraft.client.gui.spectator.categories;
|
||||
|
||||
import java.util.List;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiSpectator;
|
||||
|
|
@ -76,8 +73,8 @@ public class TeleportToTeam implements ISpectatorMenuView, ISpectatorMenuObject
|
|||
}
|
||||
|
||||
public boolean func_178662_A_() {
|
||||
for (ISpectatorMenuObject ispectatormenuobject : this.field_178672_a) {
|
||||
if (ispectatormenuobject.func_178662_A_()) {
|
||||
for (int i = 0, l = this.field_178672_a.size(); i < l; ++i) {
|
||||
if (this.field_178672_a.get(i).func_178662_A_()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ import net.minecraft.util.Session;
|
|||
*/
|
||||
public class Main {
|
||||
public static void appMain(String[] astring) {
|
||||
System.setProperty("java.net.preferIPv4Stack", "true");
|
||||
|
||||
System.setProperty("java.net.preferIPv6Addresses", "true");
|
||||
GameConfiguration gameconfiguration = new GameConfiguration(
|
||||
new GameConfiguration.UserInformation(new Session()),
|
||||
new GameConfiguration.DisplayInformation(854, 480, false, true),
|
||||
|
|
|
|||
|
|
@ -74,8 +74,8 @@ public class ModelGhast extends ModelBase {
|
|||
GlStateManager.translate(0.0F, 0.6F, 0.0F);
|
||||
this.body.render(f5);
|
||||
|
||||
for (ModelRenderer modelrenderer : this.tentacles) {
|
||||
modelrenderer.render(f5);
|
||||
for (int i = 0; i < this.tentacles.length; ++i) {
|
||||
this.tentacles[i].render(f5);
|
||||
}
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ public class ModelSquid extends ModelBase {
|
|||
* legs can swing at most.
|
||||
*/
|
||||
public void setRotationAngles(float var1, float var2, float f, float var4, float var5, float var6, Entity var7) {
|
||||
for (ModelRenderer modelrenderer : this.squidTentacles) {
|
||||
modelrenderer.rotateAngleX = f;
|
||||
for (int i = 0; i < this.squidTentacles.length; ++i) {
|
||||
this.squidTentacles[i].rotateAngleX = f;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,12 +63,12 @@ public class ModelWither extends ModelBase {
|
|||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
|
||||
for (ModelRenderer modelrenderer : this.field_82904_b) {
|
||||
modelrenderer.render(f5);
|
||||
for (int i = 0; i < this.field_82904_b.length; ++i) {
|
||||
this.field_82904_b[i].render(f5);
|
||||
}
|
||||
|
||||
for (ModelRenderer modelrenderer1 : this.field_82905_a) {
|
||||
modelrenderer1.render(f5);
|
||||
for (int i = 0; i < this.field_82905_a.length; ++i) {
|
||||
this.field_82905_a[i].render(f5);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,8 +126,8 @@ public class ChunkProviderClient implements IChunkProvider {
|
|||
public boolean unloadQueuedChunks() {
|
||||
long i = System.currentTimeMillis();
|
||||
|
||||
for (Chunk chunk : this.chunkListing) {
|
||||
chunk.func_150804_b(System.currentTimeMillis() - i > 5L);
|
||||
for (int j = 0, k = this.chunkListing.size(); j < k; ++j) {
|
||||
this.chunkListing.get(j).func_150804_b(System.currentTimeMillis() - i > 5L);
|
||||
}
|
||||
|
||||
if (System.currentTimeMillis() - i > 100L) {
|
||||
|
|
|
|||
|
|
@ -153,6 +153,8 @@ public class ServerData {
|
|||
public static enum ServerResourceMode {
|
||||
ENABLED("enabled"), DISABLED("disabled"), PROMPT("prompt");
|
||||
|
||||
public static final ServerResourceMode[] _VALUES = values();
|
||||
|
||||
private final IChatComponent motd;
|
||||
|
||||
private ServerResourceMode(String parString2) {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
package net.minecraft.client.multiplayer;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.EnumServerRateLimit;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter.DefaultServer;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.QueryResponse;
|
||||
|
|
@ -16,7 +15,6 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
|||
import net.lax1dude.eaglercraft.v1_8.socket.AddressResolver;
|
||||
import net.lax1dude.eaglercraft.v1_8.socket.RateLimitTracker;
|
||||
import net.lax1dude.eaglercraft.v1_8.socket.ServerQueryDispatch;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
|
|
@ -74,6 +72,15 @@ public class ServerList {
|
|||
* found in the "servers" tag list.
|
||||
*/
|
||||
public void loadServerList() {
|
||||
loadServerList(EagRuntime.getStorage("s"));
|
||||
}
|
||||
|
||||
/**+
|
||||
* Loads a list of servers from servers.dat, by running
|
||||
* ServerData.getServerDataFromNBTCompound on each NBT compound
|
||||
* found in the "servers" tag list.
|
||||
*/
|
||||
public void loadServerList(byte[] localStorage) {
|
||||
try {
|
||||
freeServerIcons();
|
||||
|
||||
|
|
@ -84,8 +91,6 @@ public class ServerList {
|
|||
this.allServers.add(dat);
|
||||
}
|
||||
|
||||
byte[] localStorage = EagRuntime.getStorage("s");
|
||||
|
||||
if (localStorage != null) {
|
||||
NBTTagCompound nbttagcompound = CompressedStreamTools
|
||||
.readCompressed(new EaglerInputStream(localStorage));
|
||||
|
|
@ -115,10 +120,18 @@ public class ServerList {
|
|||
* servers.dat.
|
||||
*/
|
||||
public void saveServerList() {
|
||||
byte[] data = writeServerList();
|
||||
if (data != null) {
|
||||
EagRuntime.setStorage("s", data);
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] writeServerList() {
|
||||
try {
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for (ServerData serverdata : this.servers) {
|
||||
for (int i = 0, l = this.servers.size(); i < l; ++i) {
|
||||
ServerData serverdata = this.servers.get(i);
|
||||
if (!serverdata.isDefault) {
|
||||
nbttaglist.appendTag(serverdata.getNBTCompound());
|
||||
}
|
||||
|
|
@ -127,12 +140,13 @@ public class ServerList {
|
|||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
nbttagcompound.setTag("servers", nbttaglist);
|
||||
|
||||
ByteArrayOutputStream bao = new ByteArrayOutputStream();
|
||||
EaglerOutputStream bao = new EaglerOutputStream();
|
||||
CompressedStreamTools.writeCompressed(nbttagcompound, bao);
|
||||
EagRuntime.setStorage("s", bao.toByteArray());
|
||||
return bao.toByteArray();
|
||||
|
||||
} catch (Exception exception) {
|
||||
logger.error("Couldn\'t save server list", exception);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -215,7 +229,8 @@ public class ServerList {
|
|||
public void refreshServerPing() {
|
||||
this.servers.clear();
|
||||
this.servers.addAll(this.allServers);
|
||||
for (ServerData dat : servers) {
|
||||
for (int i = 0, l = this.servers.size(); i < l; ++i) {
|
||||
ServerData dat = this.servers.get(i);
|
||||
if (dat.currentQuery != null) {
|
||||
if (dat.currentQuery.isOpen()) {
|
||||
dat.currentQuery.close();
|
||||
|
|
@ -229,9 +244,8 @@ public class ServerList {
|
|||
|
||||
public void updateServerPing() {
|
||||
int total = 0;
|
||||
Iterator<ServerData> itr = servers.iterator();
|
||||
while (itr.hasNext()) {
|
||||
ServerData dat = itr.next();
|
||||
for (int i = 0, l = this.servers.size(); i < l; ++i) {
|
||||
ServerData dat = this.servers.get(i);
|
||||
if (dat.pingSentTime <= 0l) {
|
||||
dat.pingSentTime = System.currentTimeMillis();
|
||||
if (RateLimitTracker.isLockedOut(dat.serverIP)) {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import net.lax1dude.eaglercraft.v1_8.sp.socket.ClientIntegratedServerNetworkMana
|
|||
import net.lax1dude.eaglercraft.v1_8.update.UpdateService;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack;
|
||||
import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.ClientBrandRetriever;
|
||||
|
|
@ -135,8 +136,10 @@ import net.minecraft.network.play.server.S1DPacketEntityEffect;
|
|||
import net.minecraft.network.play.server.S1EPacketRemoveEntityEffect;
|
||||
import net.minecraft.network.play.server.S1FPacketSetExperience;
|
||||
import net.minecraft.network.play.server.S20PacketEntityProperties;
|
||||
import net.minecraft.network.play.server.S20PacketEntityProperties.Snapshot;
|
||||
import net.minecraft.network.play.server.S21PacketChunkData;
|
||||
import net.minecraft.network.play.server.S22PacketMultiBlockChange;
|
||||
import net.minecraft.network.play.server.S22PacketMultiBlockChange.BlockUpdateData;
|
||||
import net.minecraft.network.play.server.S23PacketBlockChange;
|
||||
import net.minecraft.network.play.server.S24PacketBlockAction;
|
||||
import net.minecraft.network.play.server.S25PacketBlockBreakAnim;
|
||||
|
|
@ -159,6 +162,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
|||
import net.minecraft.network.play.server.S36PacketSignEditorOpen;
|
||||
import net.minecraft.network.play.server.S37PacketStatistics;
|
||||
import net.minecraft.network.play.server.S38PacketPlayerListItem;
|
||||
import net.minecraft.network.play.server.S38PacketPlayerListItem.AddPlayerData;
|
||||
import net.minecraft.network.play.server.S39PacketPlayerAbilities;
|
||||
import net.minecraft.network.play.server.S3APacketTabComplete;
|
||||
import net.minecraft.network.play.server.S3BPacketScoreboardObjective;
|
||||
|
|
@ -664,8 +668,9 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient {
|
|||
* more blocks are changed, the server sends S21PacketChunkData
|
||||
*/
|
||||
public void handleMultiBlockChange(S22PacketMultiBlockChange packetIn) {
|
||||
for (S22PacketMultiBlockChange.BlockUpdateData s22packetmultiblockchange$blockupdatedata : packetIn
|
||||
.getChangedBlocks()) {
|
||||
BlockUpdateData[] dat = packetIn.getChangedBlocks();
|
||||
for (int i = 0; i < dat.length; ++i) {
|
||||
BlockUpdateData s22packetmultiblockchange$blockupdatedata = dat[i];
|
||||
this.clientWorldController.invalidateRegionAndSetBlock(s22packetmultiblockchange$blockupdatedata.getPos(),
|
||||
s22packetmultiblockchange$blockupdatedata.getBlockState());
|
||||
}
|
||||
|
|
@ -1361,7 +1366,9 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient {
|
|||
}
|
||||
|
||||
public void handlePlayerListItem(S38PacketPlayerListItem packetIn) {
|
||||
for (S38PacketPlayerListItem.AddPlayerData s38packetplayerlistitem$addplayerdata : packetIn.func_179767_a()) {
|
||||
List<AddPlayerData> lst = packetIn.func_179767_a();
|
||||
for (int i = 0, l = lst.size(); i < l; ++i) {
|
||||
S38PacketPlayerListItem.AddPlayerData s38packetplayerlistitem$addplayerdata = lst.get(i);
|
||||
if (packetIn.func_179768_b() == S38PacketPlayerListItem.Action.REMOVE_PLAYER) {
|
||||
EaglercraftUUID uuid = s38packetplayerlistitem$addplayerdata.getProfile().getId();
|
||||
this.playerInfoMap.remove(uuid);
|
||||
|
|
@ -1430,7 +1437,7 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient {
|
|||
public void handleResourcePack(S48PacketResourcePackSend packetIn) {
|
||||
final String s = packetIn.getURL();
|
||||
final String s1 = packetIn.getHash();
|
||||
if (s.startsWith("level://")) {
|
||||
if (!EaglerFolderResourcePack.isSupported() || s.startsWith("level://")) {
|
||||
this.netManager
|
||||
.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.DECLINED));
|
||||
return;
|
||||
|
|
@ -1716,7 +1723,9 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient {
|
|||
} else {
|
||||
BaseAttributeMap baseattributemap = ((EntityLivingBase) entity).getAttributeMap();
|
||||
|
||||
for (S20PacketEntityProperties.Snapshot s20packetentityproperties$snapshot : packetIn.func_149441_d()) {
|
||||
List<Snapshot> lst = packetIn.func_149441_d();
|
||||
for (int i = 0, l = lst.size(); i < l; ++i) {
|
||||
S20PacketEntityProperties.Snapshot s20packetentityproperties$snapshot = lst.get(i);
|
||||
IAttributeInstance iattributeinstance = baseattributemap
|
||||
.getAttributeInstanceByName(s20packetentityproperties$snapshot.func_151409_a());
|
||||
if (iattributeinstance == null) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
package net.minecraft.client.network;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile;
|
||||
import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.DefaultPlayerSkin;
|
||||
import net.minecraft.network.play.server.S38PacketPlayerListItem;
|
||||
import net.minecraft.scoreboard.ScorePlayerTeam;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
|
|
|||
|
|
@ -181,7 +181,8 @@ public class EffectRenderer {
|
|||
|
||||
ArrayList arraylist = Lists.newArrayList();
|
||||
|
||||
for (EntityParticleEmitter entityparticleemitter : this.particleEmitters) {
|
||||
for (int i = 0, l = this.particleEmitters.size(); i < l; ++i) {
|
||||
EntityParticleEmitter entityparticleemitter = this.particleEmitters.get(i);
|
||||
entityparticleemitter.onUpdate();
|
||||
if (entityparticleemitter.isDead) {
|
||||
arraylist.add(entityparticleemitter);
|
||||
|
|
|
|||
|
|
@ -2,10 +2,6 @@ package net.minecraft.client.renderer;
|
|||
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.minecraft.block.Block;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
|
|
|||
|
|
@ -74,11 +74,13 @@ public class BlockModelRenderer {
|
|||
public boolean renderModelAmbientOcclusion(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn,
|
||||
BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides) {
|
||||
boolean flag = false;
|
||||
float[] afloat = new float[EnumFacing.values().length * 2];
|
||||
float[] afloat = new float[EnumFacing._VALUES.length * 2];
|
||||
BitSet bitset = new BitSet(3);
|
||||
BlockModelRenderer.AmbientOcclusionFace blockmodelrenderer$ambientocclusionface = new BlockModelRenderer.AmbientOcclusionFace();
|
||||
|
||||
for (EnumFacing enumfacing : EnumFacing.values()) {
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int i = 0; i < facings.length; ++i) {
|
||||
EnumFacing enumfacing = facings[i];
|
||||
List list = modelIn.getFaceQuads(enumfacing);
|
||||
if (!list.isEmpty()) {
|
||||
BlockPos blockpos = blockPosIn.offset(enumfacing);
|
||||
|
|
@ -104,11 +106,13 @@ public class BlockModelRenderer {
|
|||
BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides) {
|
||||
boolean isDeferred = DeferredStateManager.isDeferredRenderer();
|
||||
boolean flag = false;
|
||||
float[] afloat = isDeferred ? new float[EnumFacing.values().length * 2] : null;
|
||||
float[] afloat = isDeferred ? new float[EnumFacing._VALUES.length * 2] : null;
|
||||
BitSet bitset = new BitSet(3);
|
||||
|
||||
BlockPos.MutableBlockPos pointer = new BlockPos.MutableBlockPos();
|
||||
for (EnumFacing enumfacing : EnumFacing.values()) {
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int m = 0; m < facings.length; ++m) {
|
||||
EnumFacing enumfacing = facings[m];
|
||||
List list = modelIn.getFaceQuads(enumfacing);
|
||||
if (!list.isEmpty()) {
|
||||
BlockPos blockpos = blockPosIn.offsetEvenFaster(enumfacing, pointer);
|
||||
|
|
@ -148,7 +152,8 @@ public class BlockModelRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
for (BakedQuad bakedquad : listQuadsIn) {
|
||||
for (int i = 0, l = listQuadsIn.size(); i < l; ++i) {
|
||||
BakedQuad bakedquad = listQuadsIn.get(i);
|
||||
int[] vertData = isDeferred ? bakedquad.getVertexDataWithNormals() : bakedquad.getVertexData();
|
||||
this.fillQuadBounds(blockIn, vertData, bakedquad.getFace(), quadBounds, boundsFlags, isDeferred ? 8 : 7);
|
||||
aoFaceIn.updateVertexBrightness(blockAccessIn, blockIn, blockPosIn, bakedquad.getFace(), quadBounds,
|
||||
|
|
@ -218,12 +223,12 @@ public class BlockModelRenderer {
|
|||
quadBounds[EnumFacing.UP.getIndex()] = f4;
|
||||
quadBounds[EnumFacing.NORTH.getIndex()] = f2;
|
||||
quadBounds[EnumFacing.SOUTH.getIndex()] = f5;
|
||||
quadBounds[EnumFacing.WEST.getIndex() + EnumFacing.values().length] = 1.0F - f;
|
||||
quadBounds[EnumFacing.EAST.getIndex() + EnumFacing.values().length] = 1.0F - f3;
|
||||
quadBounds[EnumFacing.DOWN.getIndex() + EnumFacing.values().length] = 1.0F - f1;
|
||||
quadBounds[EnumFacing.UP.getIndex() + EnumFacing.values().length] = 1.0F - f4;
|
||||
quadBounds[EnumFacing.NORTH.getIndex() + EnumFacing.values().length] = 1.0F - f2;
|
||||
quadBounds[EnumFacing.SOUTH.getIndex() + EnumFacing.values().length] = 1.0F - f5;
|
||||
quadBounds[EnumFacing.WEST.getIndex() + EnumFacing._VALUES.length] = 1.0F - f;
|
||||
quadBounds[EnumFacing.EAST.getIndex() + EnumFacing._VALUES.length] = 1.0F - f3;
|
||||
quadBounds[EnumFacing.DOWN.getIndex() + EnumFacing._VALUES.length] = 1.0F - f1;
|
||||
quadBounds[EnumFacing.UP.getIndex() + EnumFacing._VALUES.length] = 1.0F - f4;
|
||||
quadBounds[EnumFacing.NORTH.getIndex() + EnumFacing._VALUES.length] = 1.0F - f2;
|
||||
quadBounds[EnumFacing.SOUTH.getIndex() + EnumFacing._VALUES.length] = 1.0F - f5;
|
||||
}
|
||||
|
||||
float f9 = 1.0E-4F;
|
||||
|
|
@ -283,7 +288,8 @@ public class BlockModelRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
for (BakedQuad bakedquad : listQuadsIn) {
|
||||
for (int m = 0, n = listQuadsIn.size(); m < n; ++m) {
|
||||
BakedQuad bakedquad = listQuadsIn.get(m);
|
||||
EnumFacing facingIn = bakedquad.getFace();
|
||||
int[] vertData = isDeferred ? bakedquad.getVertexDataWithNormals() : bakedquad.getVertexData();
|
||||
blockPosIn.offsetEvenFaster(facingIn, blockpos0);
|
||||
|
|
@ -429,7 +435,9 @@ public class BlockModelRenderer {
|
|||
|
||||
public void renderModelBrightnessColor(IBakedModel bakedModel, float parFloat1, float parFloat2, float parFloat3,
|
||||
float parFloat4) {
|
||||
for (EnumFacing enumfacing : EnumFacing.values()) {
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int i = 0; i < facings.length; ++i) {
|
||||
EnumFacing enumfacing = facings[i];
|
||||
this.renderModelBrightnessColorQuads(parFloat1, parFloat2, parFloat3, parFloat4,
|
||||
bakedModel.getFaceQuads(enumfacing));
|
||||
}
|
||||
|
|
@ -462,7 +470,8 @@ public class BlockModelRenderer {
|
|||
Tessellator tessellator = Tessellator.getInstance();
|
||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||
|
||||
for (BakedQuad bakedquad : parList) {
|
||||
for (int i = 0, l = parList.size(); i < l; ++i) {
|
||||
BakedQuad bakedquad = parList.get(i);
|
||||
worldrenderer.begin(7, DefaultVertexFormats.ITEM);
|
||||
worldrenderer.addVertexData(bakedquad.getVertexData());
|
||||
if (bakedquad.hasTintIndex()) {
|
||||
|
|
@ -800,7 +809,7 @@ public class BlockModelRenderer {
|
|||
protected final int field_178229_m;
|
||||
|
||||
private Orientation(EnumFacing parEnumFacing, boolean parFlag) {
|
||||
this.field_178229_m = parEnumFacing.getIndex() + (parFlag ? EnumFacing.values().length : 0);
|
||||
this.field_178229_m = parEnumFacing.getIndex() + (parFlag ? EnumFacing._VALUES.length : 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1302,8 +1302,6 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
}
|
||||
|
||||
private void addRainParticles() {
|
||||
if (DeferredStateManager.isDeferredRenderer())
|
||||
return;
|
||||
float f = this.mc.theWorld.getRainStrength(1.0F);
|
||||
if (!this.mc.gameSettings.fancyGraphics) {
|
||||
f /= 2.0F;
|
||||
|
|
@ -1351,9 +1349,11 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
d2 = (double) blockpos2.getZ() + d4;
|
||||
}
|
||||
|
||||
this.mc.theWorld.spawnParticle(EnumParticleTypes.WATER_DROP, (double) blockpos2.getX() + d3,
|
||||
(double) ((float) blockpos2.getY() + 0.1F) + block.getBlockBoundsMaxY(),
|
||||
(double) blockpos2.getZ() + d4, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
if (!DeferredStateManager.isDeferredRenderer()) {
|
||||
this.mc.theWorld.spawnParticle(EnumParticleTypes.WATER_DROP, (double) blockpos2.getX() + d3,
|
||||
(double) ((float) blockpos2.getY() + 0.1F) + block.getBlockBoundsMaxY(),
|
||||
(double) blockpos2.getZ() + d4, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import net.minecraft.util.EnumWorldBlockLayer;
|
|||
*
|
||||
*/
|
||||
public class RegionRenderCacheBuilder {
|
||||
private final WorldRenderer[] worldRenderers = new WorldRenderer[EnumWorldBlockLayer.values().length];
|
||||
private final WorldRenderer[] worldRenderers = new WorldRenderer[EnumWorldBlockLayer._VALUES.length];
|
||||
|
||||
public RegionRenderCacheBuilder() {
|
||||
this.worldRenderers[EnumWorldBlockLayer.SOLID.ordinal()] = new WorldRenderer(2097152);
|
||||
|
|
|
|||
|
|
@ -524,7 +524,9 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
|||
|
||||
this.theWorld.theProfiler.endStartSection("entities");
|
||||
|
||||
label738: for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfos) {
|
||||
label738: for (int ii = 0, ll = this.renderInfos.size(); ii < ll; ++ii) {
|
||||
RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = this.renderInfos
|
||||
.get(ii);
|
||||
Chunk chunk = this.theWorld.getChunkFromBlockCoords(
|
||||
renderglobal$containerlocalrenderinformation.renderChunk.getPosition());
|
||||
ClassInheritanceMultiMap classinheritancemultimap = chunk
|
||||
|
|
@ -574,12 +576,15 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
|||
this.theWorld.theProfiler.endStartSection("blockentities");
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
|
||||
for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.renderInfos) {
|
||||
for (int ii = 0, ll = this.renderInfos.size(); ii < ll; ++ii) {
|
||||
RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 = this.renderInfos
|
||||
.get(ii);
|
||||
List list1 = renderglobal$containerlocalrenderinformation1.renderChunk.getCompiledChunk()
|
||||
.getTileEntities();
|
||||
if (!list1.isEmpty()) {
|
||||
for (TileEntity tileentity2 : (List<TileEntity>) list1) {
|
||||
TileEntityRendererDispatcher.instance.renderTileEntity(tileentity2, partialTicks, -1);
|
||||
for (int m = 0, n = list1.size(); m < n; ++m) {
|
||||
TileEntityRendererDispatcher.instance.renderTileEntity((TileEntity) list1.get(m), partialTicks,
|
||||
-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -786,7 +791,9 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
|||
int i = this.viewFrustum.renderChunks.length;
|
||||
int j = 0;
|
||||
|
||||
for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfos) {
|
||||
for (int ii = 0, ll = this.renderInfos.size(); ii < ll; ++ii) {
|
||||
RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = this.renderInfos
|
||||
.get(ii);
|
||||
CompiledChunk compiledchunk = renderglobal$containerlocalrenderinformation.renderChunk.compiledChunk;
|
||||
if (compiledchunk != CompiledChunk.DUMMY && !compiledchunk.isEmpty()) {
|
||||
++j;
|
||||
|
|
@ -912,7 +919,9 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
|||
EnumFacing enumfacing2 = renderglobal$containerlocalrenderinformation1.facing;
|
||||
BlockPos blockpos2 = renderchunk3.getPosition();
|
||||
this.renderInfos.add(renderglobal$containerlocalrenderinformation1);
|
||||
for (EnumFacing enumfacing1 : EnumFacing.values()) {
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int i = 0; i < facings.length; ++i) {
|
||||
EnumFacing enumfacing1 = facings[i];
|
||||
RenderChunk renderchunk2 = this.func_181562_a(blockpos, renderchunk3, enumfacing1);
|
||||
if ((!flag1 || !renderglobal$containerlocalrenderinformation1.setFacing // TODO:
|
||||
.contains(enumfacing1.getOpposite()))
|
||||
|
|
@ -940,7 +949,9 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
|||
Set set = this.chunksToUpdate;
|
||||
this.chunksToUpdate = Sets.newLinkedHashSet();
|
||||
|
||||
for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation2 : this.renderInfos) {
|
||||
for (int ii = 0, ll = this.renderInfos.size(); ii < ll; ++ii) {
|
||||
RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation2 = this.renderInfos
|
||||
.get(ii);
|
||||
RenderChunk renderchunk4 = renderglobal$containerlocalrenderinformation2.renderChunk;
|
||||
if (renderchunk4.isNeedsUpdate() || set.contains(renderchunk4)) {
|
||||
this.displayListEntitiesDirty = true;
|
||||
|
|
@ -1065,7 +1076,9 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
|||
this.prevRenderSortZ = entityIn.posZ;
|
||||
int k = 0;
|
||||
|
||||
for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfos) {
|
||||
for (int ii = 0, ll = this.renderInfos.size(); ii < ll; ++ii) {
|
||||
RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = this.renderInfos
|
||||
.get(ii);
|
||||
if (renderglobal$containerlocalrenderinformation.renderChunk.compiledChunk
|
||||
.isLayerStarted(blockLayerIn) && k++ < 15) {
|
||||
this.renderDispatcher
|
||||
|
|
@ -2488,7 +2501,9 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
|||
int j = 0;
|
||||
int k = 0;
|
||||
|
||||
for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfos) {
|
||||
for (int ii = 0, ll = this.renderInfos.size(); ii < ll; ++ii) {
|
||||
RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = this.renderInfos
|
||||
.get(ii);
|
||||
CompiledChunk compiledchunk = renderglobal$containerlocalrenderinformation.renderChunk.compiledChunk;
|
||||
if (compiledchunk != CompiledChunk.DUMMY && !compiledchunk.isEmpty()) {
|
||||
++j;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package net.minecraft.client.renderer;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.minecraft.client.renderer.chunk.ListedRenderChunk;
|
||||
import net.minecraft.client.renderer.chunk.RenderChunk;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
|
||||
/**+
|
||||
|
|
@ -29,10 +28,10 @@ import net.minecraft.util.EnumWorldBlockLayer;
|
|||
public class RenderList extends ChunkRenderContainer {
|
||||
public void renderChunkLayer(EnumWorldBlockLayer enumworldblocklayer) {
|
||||
if (this.initialized) {
|
||||
for (RenderChunk renderchunk : this.renderChunks) {
|
||||
ListedRenderChunk listedrenderchunk = (ListedRenderChunk) renderchunk;
|
||||
for (int i = 0, l = this.renderChunks.size(); i < l; ++i) {
|
||||
ListedRenderChunk listedrenderchunk = (ListedRenderChunk) this.renderChunks.get(i);
|
||||
GlStateManager.pushMatrix();
|
||||
this.preRenderChunk(renderchunk, enumworldblocklayer);
|
||||
this.preRenderChunk(listedrenderchunk, enumworldblocklayer);
|
||||
EaglercraftGPU.glCallList(
|
||||
listedrenderchunk.getDisplayList(enumworldblocklayer, listedrenderchunk.getCompiledChunk()));
|
||||
GlStateManager.popMatrix();
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ public class ViewFrustum {
|
|||
}
|
||||
|
||||
public void deleteGlResources() {
|
||||
for (RenderChunk renderchunk : this.renderChunks) {
|
||||
renderchunk.deleteGlResources();
|
||||
for (int i = 0; i < this.renderChunks.length; ++i) {
|
||||
renderChunks[i].deleteGlResources();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package net.minecraft.client.renderer.block.model;
|
|||
import java.util.Arrays;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
|
||||
/**+
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ public class FaceBakery {
|
|||
}
|
||||
|
||||
private float[] getPositionsDiv16(Vector3f pos1, Vector3f pos2) {
|
||||
float[] afloat = new float[EnumFacing.values().length];
|
||||
float[] afloat = new float[EnumFacing._VALUES.length];
|
||||
afloat[EnumFaceDirection.Constants.WEST_INDEX] = pos1.x / 16.0F;
|
||||
afloat[EnumFaceDirection.Constants.DOWN_INDEX] = pos1.y / 16.0F;
|
||||
afloat[EnumFaceDirection.Constants.NORTH_INDEX] = pos1.z / 16.0F;
|
||||
|
|
@ -252,7 +252,9 @@ public class FaceBakery {
|
|||
EnumFacing enumfacing = null;
|
||||
float f1 = 0.0F;
|
||||
|
||||
for (EnumFacing enumfacing1 : EnumFacing.values()) {
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int i = 0; i < facings.length; ++i) {
|
||||
EnumFacing enumfacing1 = facings[i];
|
||||
Vec3i vec3i = enumfacing1.getDirectionVec();
|
||||
Vector3f vector3f6 = new Vector3f((float) vec3i.getX(), (float) vec3i.getY(), (float) vec3i.getZ());
|
||||
float f2 = Vector3f.dot(normal, vector3f6);
|
||||
|
|
@ -280,7 +282,7 @@ public class FaceBakery {
|
|||
private void func_178408_a(int[] parArrayOfInt, EnumFacing parEnumFacing) {
|
||||
int[] aint = new int[parArrayOfInt.length];
|
||||
System.arraycopy(parArrayOfInt, 0, aint, 0, parArrayOfInt.length);
|
||||
float[] afloat = new float[EnumFacing.values().length];
|
||||
float[] afloat = new float[EnumFacing._VALUES.length];
|
||||
afloat[EnumFaceDirection.Constants.WEST_INDEX] = 999.0F;
|
||||
afloat[EnumFaceDirection.Constants.DOWN_INDEX] = 999.0F;
|
||||
afloat[EnumFaceDirection.Constants.NORTH_INDEX] = 999.0F;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,9 @@ public class ItemModelGenerator {
|
|||
float f1 = (float) parTextureAtlasSprite.getIconHeight();
|
||||
ArrayList arraylist = Lists.newArrayList();
|
||||
|
||||
for (ItemModelGenerator.Span itemmodelgenerator$span : this.func_178393_a(parTextureAtlasSprite)) {
|
||||
List<ItemModelGenerator.Span> lst = this.func_178393_a(parTextureAtlasSprite);
|
||||
for (int i = 0, l = lst.size(); i < l; ++i) {
|
||||
ItemModelGenerator.Span itemmodelgenerator$span = lst.get(i);
|
||||
float f2 = 0.0F;
|
||||
float f3 = 0.0F;
|
||||
float f4 = 0.0F;
|
||||
|
|
@ -217,7 +219,8 @@ public class ItemModelGenerator {
|
|||
int parInt1, int parInt2) {
|
||||
ItemModelGenerator.Span itemmodelgenerator$span = null;
|
||||
|
||||
for (ItemModelGenerator.Span itemmodelgenerator$span1 : parList) {
|
||||
for (int j = 0, l = parList.size(); j < l; ++j) {
|
||||
ItemModelGenerator.Span itemmodelgenerator$span1 = parList.get(j);
|
||||
if (itemmodelgenerator$span1.func_178383_a() == parSpanFacing) {
|
||||
int i = parSpanFacing.func_178369_d() ? parInt2 : parInt1;
|
||||
if (itemmodelgenerator$span1.func_178381_d() == i) {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,10 @@
|
|||
package net.minecraft.client.renderer.block.model;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.io.StringReader;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
package net.minecraft.client.renderer.block.model;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
|
@ -56,8 +53,8 @@ public class ModelBlockDefinition {
|
|||
}
|
||||
|
||||
public ModelBlockDefinition(List<ModelBlockDefinition> parList) {
|
||||
for (ModelBlockDefinition modelblockdefinition : parList) {
|
||||
this.mapVariants.putAll(modelblockdefinition.mapVariants);
|
||||
for (int i = 0, l = parList.size(); i < l; ++i) {
|
||||
this.mapVariants.putAll(parList.get(i).mapVariants);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ public class ChunkCompileTaskGenerator {
|
|||
this.finished = true;
|
||||
this.status = ChunkCompileTaskGenerator.Status.DONE;
|
||||
|
||||
for (Runnable runnable : this.listFinishRunnables) {
|
||||
runnable.run();
|
||||
for (int i = 0, l = this.listFinishRunnables.size(); i < l; ++i) {
|
||||
this.listFinishRunnables.get(i).run();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,9 @@ public class ChunkRenderWorker {
|
|||
|
||||
final CompiledChunk compiledchunk = generator.getCompiledChunk();
|
||||
if (chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.REBUILD_CHUNK) {
|
||||
for (EnumWorldBlockLayer enumworldblocklayer : EnumWorldBlockLayer.values()) {
|
||||
EnumWorldBlockLayer[] layers = EnumWorldBlockLayer._VALUES;
|
||||
for (int i = 0; i < layers.length; ++i) {
|
||||
EnumWorldBlockLayer enumworldblocklayer = layers[i];
|
||||
if (!compiledchunk.isLayerEmpty(enumworldblocklayer)) {
|
||||
this.chunkRenderDispatcher.uploadChunk(enumworldblocklayer,
|
||||
generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(enumworldblocklayer),
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ public class CompiledChunk {
|
|||
return true;
|
||||
}
|
||||
};
|
||||
private final boolean[] layersUsed = new boolean[EnumWorldBlockLayer.values().length];
|
||||
private final boolean[] layersStarted = new boolean[EnumWorldBlockLayer.values().length];
|
||||
private final boolean[] layersUsed = new boolean[EnumWorldBlockLayer._VALUES.length];
|
||||
private final boolean[] layersStarted = new boolean[EnumWorldBlockLayer._VALUES.length];
|
||||
private boolean empty = true;
|
||||
private final List<TileEntity> tileEntities = Lists.newArrayList();
|
||||
private SetVisibility setVisibility = new SetVisibility();
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class ListedRenderChunk extends RenderChunk {
|
|||
|
||||
public ListedRenderChunk(World worldIn, RenderGlobal renderGlobalIn, BlockPos pos, int indexIn) {
|
||||
super(worldIn, renderGlobalIn, pos, indexIn);
|
||||
this.baseDisplayList = new int[EnumWorldBlockLayer.values().length];
|
||||
this.baseDisplayList = new int[EnumWorldBlockLayer._VALUES.length];
|
||||
for (int i = 0; i < this.baseDisplayList.length; ++i) {
|
||||
this.baseDisplayList[i] = GLAllocation.generateDisplayLists();
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ public class ListedRenderChunk extends RenderChunk {
|
|||
|
||||
public void rebuildChunk(float x, float y, float z, ChunkCompileTaskGenerator generator) {
|
||||
super.rebuildChunk(x, y, z, generator);
|
||||
EnumWorldBlockLayer[] layers = EnumWorldBlockLayer.values();
|
||||
EnumWorldBlockLayer[] layers = EnumWorldBlockLayer._VALUES;
|
||||
for (int i = 0; i < layers.length; ++i) {
|
||||
if (generator.getCompiledChunk().isLayerEmpty(layers[i])) {
|
||||
EaglercraftGPU.flushDisplayList(this.baseDisplayList[i]);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package net.minecraft.client.renderer.chunk;
|
|||
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
|
@ -99,8 +98,9 @@ public class RenderChunk {
|
|||
this.position = pos;
|
||||
this.boundingBox = new AxisAlignedBB(pos, pos.add(16, 16, 16));
|
||||
|
||||
for (EnumFacing enumfacing : EnumFacing.values()) {
|
||||
this.field_181702_p.put(enumfacing, pos.offset(enumfacing, 16));
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int i = 0; i < facings.length; ++i) {
|
||||
this.field_181702_p.put(facings[i], pos.offset(facings[i], 16));
|
||||
}
|
||||
|
||||
this.initModelviewMatrix();
|
||||
|
|
@ -147,7 +147,7 @@ public class RenderChunk {
|
|||
HashSet hashset = Sets.newHashSet();
|
||||
if (!regionrendercache.extendedLevelsInChunkCache()) {
|
||||
++renderChunksUpdated;
|
||||
boolean[] aboolean = new boolean[EnumWorldBlockLayer.values().length];
|
||||
boolean[] aboolean = new boolean[EnumWorldBlockLayer._VALUES.length];
|
||||
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||
|
||||
for (BlockPos blockpos$mutableblockpos : BlockPos.getAllInBox(blockpos, blockpos1)) {
|
||||
|
|
@ -196,7 +196,9 @@ public class RenderChunk {
|
|||
}
|
||||
}
|
||||
|
||||
for (EnumWorldBlockLayer enumworldblocklayer : EnumWorldBlockLayer.values()) {
|
||||
EnumWorldBlockLayer[] layers = EnumWorldBlockLayer._VALUES;
|
||||
for (int i = 0; i < layers.length; ++i) {
|
||||
EnumWorldBlockLayer enumworldblocklayer = layers[i];
|
||||
if (aboolean[enumworldblocklayer.ordinal()]) {
|
||||
compiledchunk.setLayerUsed(enumworldblocklayer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import net.minecraft.util.EnumFacing;
|
|||
*
|
||||
*/
|
||||
public class SetVisibility {
|
||||
private static final int COUNT_FACES = EnumFacing.values().length;
|
||||
private static final int COUNT_FACES = EnumFacing._VALUES.length;
|
||||
private final BitSet bitSet;
|
||||
|
||||
public SetVisibility() {
|
||||
|
|
@ -34,9 +34,10 @@ public class SetVisibility {
|
|||
}
|
||||
|
||||
public void setManyVisible(Set<EnumFacing> parSet) {
|
||||
for (EnumFacing enumfacing : parSet) {
|
||||
for (EnumFacing enumfacing1 : parSet) {
|
||||
this.setVisible(enumfacing, enumfacing1, true);
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int i = 0; i < facings.length; ++i) {
|
||||
for (int j = 0; j < facings.length; ++j) {
|
||||
this.setVisible(facings[i], facings[j], true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -59,20 +60,22 @@ public class SetVisibility {
|
|||
StringBuilder stringbuilder = new StringBuilder();
|
||||
stringbuilder.append(' ');
|
||||
|
||||
for (EnumFacing enumfacing : EnumFacing.values()) {
|
||||
stringbuilder.append(' ').append(enumfacing.toString().toUpperCase().charAt(0));
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int i = 0; i < facings.length; ++i) {
|
||||
stringbuilder.append(' ').append(facings[i].toString().toUpperCase().charAt(0));
|
||||
}
|
||||
|
||||
stringbuilder.append('\n');
|
||||
|
||||
for (EnumFacing enumfacing2 : EnumFacing.values()) {
|
||||
for (int i = 0; i < facings.length; ++i) {
|
||||
EnumFacing enumfacing2 = facings[i];
|
||||
stringbuilder.append(enumfacing2.toString().toUpperCase().charAt(0));
|
||||
|
||||
for (EnumFacing enumfacing1 : EnumFacing.values()) {
|
||||
if (enumfacing2 == enumfacing1) {
|
||||
for (int j = 0; j < facings.length; ++j) {
|
||||
if (enumfacing2 == facings[j]) {
|
||||
stringbuilder.append(" ");
|
||||
} else {
|
||||
boolean flag = this.isVisible(enumfacing2, enumfacing1);
|
||||
boolean flag = this.isVisible(enumfacing2, facings[j]);
|
||||
stringbuilder.append(' ').append((char) (flag ? 'Y' : 'n'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,9 +59,9 @@ public class VisGraph {
|
|||
} else if (this.field_178611_f == 0) {
|
||||
setvisibility.setAllVisible(false);
|
||||
} else {
|
||||
for (int i : field_178613_e) {
|
||||
if (!this.field_178612_d.get(i)) {
|
||||
setvisibility.setManyVisible(this.func_178604_a(i));
|
||||
for (int i = 0; i < field_178613_e.length; ++i) {
|
||||
if (!this.field_178612_d.get(field_178613_e[i])) {
|
||||
setvisibility.setManyVisible(this.func_178604_a(field_178613_e[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -83,7 +83,9 @@ public class VisGraph {
|
|||
int i = ((Integer) linkedlist.poll()).intValue();
|
||||
this.func_178610_a(i, enumset);
|
||||
|
||||
for (EnumFacing enumfacing : EnumFacing.values()) {
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int k = 0; k < facings.length; ++k) {
|
||||
EnumFacing enumfacing = facings[k];
|
||||
int j = this.func_178603_a(i, enumfacing);
|
||||
if (j >= 0 && !this.field_178612_d.get(j)) {
|
||||
this.field_178612_d.set(j, true);
|
||||
|
|
|
|||
|
|
@ -2,11 +2,7 @@ package net.minecraft.client.renderer.culling;
|
|||
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
/**+
|
||||
|
|
|
|||
|
|
@ -2,10 +2,8 @@ package net.minecraft.client.renderer.entity;
|
|||
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DynamicLightManager;
|
||||
import net.minecraft.client.model.ModelCreeper;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerCreeperCharge;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
|||
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.EaglerDeferredPipeline;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.ShadersRenderPassFuture;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.ShadersRenderPassFuture.PassType;
|
||||
import net.lax1dude.eaglercraft.v1_8.vector.Matrix4f;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDirt;
|
||||
|
|
@ -139,7 +138,9 @@ public class RenderItem implements IResourceManagerReloadListener {
|
|||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||
worldrenderer.begin(7, DefaultVertexFormats.ITEM);
|
||||
|
||||
for (EnumFacing enumfacing : EnumFacing.values()) {
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int i = 0; i < facings.length; ++i) {
|
||||
EnumFacing enumfacing = facings[i];
|
||||
this.renderQuads(worldrenderer, model.getFaceQuads(enumfacing), color, stack);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.vector.Matrix4f;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
|
|
|
|||
|
|
@ -411,7 +411,8 @@ public abstract class RendererLivingEntity<T extends EntityLivingBase> extends R
|
|||
|
||||
protected void renderLayers(T entitylivingbaseIn, float partialTicks, float parFloat2, float parFloat3,
|
||||
float parFloat4, float parFloat5, float parFloat6, float parFloat7) {
|
||||
for (LayerRenderer layerrenderer : this.layerRenderers) {
|
||||
for (int i = 0, l = this.layerRenderers.size(); i < l; ++i) {
|
||||
LayerRenderer layerrenderer = this.layerRenderers.get(i);
|
||||
boolean flag = this.setBrightness(entitylivingbaseIn, parFloat3, layerrenderer.shouldCombineTextures());
|
||||
layerrenderer.doRenderLayer(entitylivingbaseIn, partialTicks, parFloat2, parFloat3, parFloat4, parFloat5,
|
||||
parFloat6, parFloat7);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.minecraft.client.model.ModelBox;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import net.lax1dude.eaglercraft.v1_8.vector.Matrix4f;
|
|||
import net.minecraft.client.model.ModelCreeper;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.renderer.entity.RenderCreeper;
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class LayerSheepWool implements LayerRenderer<EntitySheep> {
|
|||
if (entitysheep.hasCustomName() && "jeb_".equals(entitysheep.getCustomNameTag())) {
|
||||
boolean flag = true;
|
||||
int i = entitysheep.ticksExisted / 25 + entitysheep.getEntityId();
|
||||
int j = EnumDyeColor.values().length;
|
||||
int j = EnumDyeColor.META_LOOKUP.length;
|
||||
int k = i % j;
|
||||
int l = (i + 1) % j;
|
||||
float f7 = ((float) (entitysheep.ticksExisted % 25) + f2) / 25.0F;
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ import net.minecraft.client.model.ModelSlime;
|
|||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderSlime;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.entity.monster.EntitySlime;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
/**+
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ public class LayeredTexture extends AbstractTexture {
|
|||
ImageData bufferedimage = null;
|
||||
|
||||
try {
|
||||
for (String s : this.layeredTextureNames) {
|
||||
for (int i = 0, l = this.layeredTextureNames.size(); i < l; ++i) {
|
||||
String s = this.layeredTextureNames.get(i);
|
||||
if (s != null) {
|
||||
InputStream inputstream = parIResourceManager.getResource(new ResourceLocation(s)).getInputStream();
|
||||
ImageData bufferedimage1 = TextureUtil.readBufferedImage(inputstream);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@ public class Stitcher {
|
|||
.toArray(new Stitcher.Holder[this.setStitchHolders.size()]);
|
||||
Arrays.sort(astitcher$holder);
|
||||
|
||||
for (Stitcher.Holder stitcher$holder : astitcher$holder) {
|
||||
for (int i = 0; i < astitcher$holder.length; ++i) {
|
||||
Stitcher.Holder stitcher$holder = astitcher$holder[i];
|
||||
if (!this.allocateSlot(stitcher$holder)) {
|
||||
String s = HString.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution resourcepack?",
|
||||
new Object[] { stitcher$holder.getAtlasSprite().getIconName(),
|
||||
|
|
@ -93,15 +94,16 @@ public class Stitcher {
|
|||
}
|
||||
|
||||
public List<EaglerTextureAtlasSprite> getStichSlots() {
|
||||
ArrayList arraylist = Lists.newArrayList();
|
||||
ArrayList<Slot> arraylist = Lists.newArrayList();
|
||||
|
||||
for (Stitcher.Slot stitcher$slot : this.stitchSlots) {
|
||||
stitcher$slot.getAllStitchSlots(arraylist);
|
||||
for (int i = 0, l = this.stitchSlots.size(); i < l; ++i) {
|
||||
this.stitchSlots.get(i).getAllStitchSlots(arraylist);
|
||||
}
|
||||
|
||||
ArrayList arraylist1 = Lists.newArrayList();
|
||||
ArrayList<EaglerTextureAtlasSprite> arraylist1 = Lists.newArrayList();
|
||||
|
||||
for (Stitcher.Slot stitcher$slot1 : (List<Stitcher.Slot>) arraylist) {
|
||||
for (int i = 0, l = arraylist.size(); i < l; ++i) {
|
||||
Stitcher.Slot stitcher$slot1 = arraylist.get(i);
|
||||
Stitcher.Holder stitcher$holder = stitcher$slot1.getStitchHolder();
|
||||
EaglerTextureAtlasSprite textureatlassprite = stitcher$holder.getAtlasSprite();
|
||||
textureatlassprite.initSprite(this.currentWidth, this.currentHeight, stitcher$slot1.getOriginX(),
|
||||
|
|
@ -335,8 +337,8 @@ public class Stitcher {
|
|||
}
|
||||
}
|
||||
|
||||
for (Stitcher.Slot stitcher$slot : this.subSlots) {
|
||||
if (stitcher$slot.addSlot(holderIn)) {
|
||||
for (int m = 0, n = this.subSlots.size(); m < n; ++m) {
|
||||
if (this.subSlots.get(m).addSlot(holderIn)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -353,8 +355,8 @@ public class Stitcher {
|
|||
if (this.holder != null) {
|
||||
parList.add(this);
|
||||
} else if (this.subSlots != null) {
|
||||
for (Stitcher.Slot stitcher$slot : this.subSlots) {
|
||||
stitcher$slot.getAllStitchSlots(parList);
|
||||
for (int i = 0, l = this.subSlots.size(); i < l; ++i) {
|
||||
this.subSlots.get(i).getAllStitchSlots(parList);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -143,8 +143,8 @@ public class TextureManager implements ITickable, IResourceManagerReloadListener
|
|||
}
|
||||
|
||||
public void tick() {
|
||||
for (ITickable itickable : this.listTickables) {
|
||||
itickable.tick();
|
||||
for (int i = 0, l = this.listTickables.size(); i < l; ++i) {
|
||||
this.listTickables.get(i).tick();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -447,7 +447,8 @@ public class TextureMap extends AbstractTexture implements ITickableTextureObjec
|
|||
height = stitcher.getCurrentHeight();
|
||||
|
||||
List<EaglerTextureAtlasSprite> spriteList = stitcher.getStichSlots();
|
||||
for (EaglerTextureAtlasSprite textureatlassprite2 : spriteList) {
|
||||
for (int l = 0, m = spriteList.size(); l < m; ++l) {
|
||||
EaglerTextureAtlasSprite textureatlassprite2 = spriteList.get(l);
|
||||
String s = textureatlassprite2.getIconName();
|
||||
hashmap.remove(s);
|
||||
this.mapUploadedSprites.put(s, textureatlassprite2);
|
||||
|
|
@ -506,23 +507,24 @@ public class TextureMap extends AbstractTexture implements ITickableTextureObjec
|
|||
|
||||
public void updateAnimations() {
|
||||
if (isEaglerPBRMode) {
|
||||
for (EaglerTextureAtlasSprite textureatlassprite : this.listAnimatedSprites) {
|
||||
textureatlassprite.updateAnimationPBR(copyColorFramebuffer, copyMaterialFramebuffer, height);
|
||||
for (int i = 0, l = this.listAnimatedSprites.size(); i < l; ++i) {
|
||||
this.listAnimatedSprites.get(i).updateAnimationPBR(copyColorFramebuffer, copyMaterialFramebuffer,
|
||||
height);
|
||||
}
|
||||
_wglBindFramebuffer(_GL_FRAMEBUFFER, null);
|
||||
return;
|
||||
}
|
||||
|
||||
for (EaglerTextureAtlasSprite textureatlassprite : this.listAnimatedSprites) {
|
||||
textureatlassprite.updateAnimation(copyColorFramebuffer);
|
||||
for (int i = 0, l = this.listAnimatedSprites.size(); i < l; ++i) {
|
||||
this.listAnimatedSprites.get(i).updateAnimation(copyColorFramebuffer);
|
||||
}
|
||||
|
||||
_wglBindFramebuffer(_GL_FRAMEBUFFER, null);
|
||||
}
|
||||
|
||||
private void destroyAnimationCaches() {
|
||||
for (EaglerTextureAtlasSprite textureatlassprite : this.listAnimatedSprites) {
|
||||
textureatlassprite.clearFramesTextureData();
|
||||
for (int i = 0, l = this.listAnimatedSprites.size(); i < l; ++i) {
|
||||
this.listAnimatedSprites.get(i).clearFramesTextureData();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,9 +127,9 @@ public class TileEntityBannerRenderer extends TileEntitySpecialRenderer<TileEnti
|
|||
List list = bannerObj.getColorList();
|
||||
ArrayList arraylist = Lists.newArrayList();
|
||||
|
||||
for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : (List<TileEntityBanner.EnumBannerPattern>) list1) {
|
||||
arraylist.add(
|
||||
"textures/entity/banner/" + tileentitybanner$enumbannerpattern.getPatternName() + ".png");
|
||||
for (int i = 0, l = list1.size(); i < l; ++i) {
|
||||
arraylist.add("textures/entity/banner/"
|
||||
+ ((TileEntityBanner.EnumBannerPattern) list1.get(i)).getPatternName() + ".png");
|
||||
}
|
||||
|
||||
tileentitybannerrenderer$timedbannertexture = new TileEntityBannerRenderer.TimedBannerTexture();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.vfs.SYS;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
|
|
@ -12,6 +11,7 @@ import net.lax1dude.eaglercraft.v1_8.IOUtils;
|
|||
import net.lax1dude.eaglercraft.v1_8.HString;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ImageData;
|
||||
import net.minecraft.client.renderer.texture.TextureUtil;
|
||||
import net.minecraft.client.resources.data.IMetadataSection;
|
||||
|
|
@ -73,8 +73,8 @@ public abstract class AbstractResourcePack implements IResourcePack {
|
|||
try {
|
||||
return readMetadata(parIMetadataSerializer, this.getInputStreamByName("pack.mcmeta"), parString1);
|
||||
} catch (JSONException e) {
|
||||
if (SYS.VFS != null) {
|
||||
SYS.deleteResourcePack(this.resourcePackFile);
|
||||
if (this instanceof EaglerFolderResourcePack) {
|
||||
EaglerFolderResourcePack.deleteResourcePack((EaglerFolderResourcePack) this);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,8 @@ public class FallbackResourceManager implements IResourceManager {
|
|||
ArrayList arraylist = Lists.newArrayList();
|
||||
ResourceLocation resourcelocation = getLocationMcmeta(location);
|
||||
|
||||
for (IResourcePack iresourcepack : this.resourcePacks) {
|
||||
for (int i = 0, l = this.resourcePacks.size(); i < l; ++i) {
|
||||
IResourcePack iresourcepack = this.resourcePacks.get(i);
|
||||
if (iresourcepack.resourceExists(location)) {
|
||||
InputStream inputstream = iresourcepack.resourceExists(resourcelocation)
|
||||
? this.getInputStream(resourcelocation, iresourcepack)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,8 @@ public class LanguageManager implements IResourceManagerReloadListener {
|
|||
public void parseLanguageMetadata(List<IResourcePack> parList) {
|
||||
this.languageMap.clear();
|
||||
|
||||
for (IResourcePack iresourcepack : parList) {
|
||||
for (int i = 0, l = parList.size(); i < l; ++i) {
|
||||
IResourcePack iresourcepack = parList.get(i);
|
||||
try {
|
||||
LanguageMetadataSection languagemetadatasection = (LanguageMetadataSection) iresourcepack
|
||||
.getPackMetadata(this.theMetadataSerializer, "language");
|
||||
|
|
|
|||
|
|
@ -1,55 +0,0 @@
|
|||
package net.minecraft.client.resources;
|
||||
|
||||
/**+
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
*
|
||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
||||
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
|
||||
*
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
public class ResourceIndex {
|
||||
// private static final Logger logger = LogManager.getLogger();
|
||||
// private final Map<String, File> resourceMap = Maps.newHashMap();
|
||||
|
||||
// public ResourceIndex(File parFile, String parString1) {
|
||||
/*
|
||||
* if (parString1 != null) { File file1 = new File(parFile, "objects"); File
|
||||
* file2 = new File(parFile, "indexes/" + parString1 + ".json"); BufferedReader
|
||||
* bufferedreader = null;
|
||||
*
|
||||
* try { bufferedreader = Files.newReader(file2, Charsets.UTF_8); JsonObject
|
||||
* jsonobject = (new JsonParser()).parse(bufferedreader).getAsJsonObject();
|
||||
* JsonObject jsonobject1 = JsonUtils.getJsonObject(jsonobject, "objects",
|
||||
* (JsonObject) null); if (jsonobject1 != null) { for (Entry entry :
|
||||
* jsonobject1.entrySet()) { JsonObject jsonobject2 = (JsonObject)
|
||||
* entry.getValue(); String s = (String) entry.getKey(); String[] astring =
|
||||
* s.split("/", 2); String s1 = astring.length == 1 ? astring[0] : astring[0] +
|
||||
* ":" + astring[1]; String s2 = JsonUtils.getString(jsonobject2, "hash"); File
|
||||
* file3 = new File(file1, s2.substring(0, 2) + "/" + s2);
|
||||
* this.resourceMap.put(s1, file3); } } } catch (JsonParseException var20) {
|
||||
* logger.error("Unable to parse resource index file: " + file2); } catch
|
||||
* (FileNotFoundException var21) {
|
||||
* logger.error("Can\'t find the resource index file: " + file2); } finally {
|
||||
* IOUtils.closeQuietly(bufferedreader); }
|
||||
*
|
||||
* }
|
||||
*/
|
||||
// }
|
||||
|
||||
// public Map<String, File> getResourceMap() {
|
||||
// return this.resourceMap;
|
||||
// }
|
||||
}
|
||||
|
|
@ -3,8 +3,8 @@ package net.minecraft.client.resources;
|
|||
import java.util.List;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.Keyboard;
|
||||
import net.lax1dude.eaglercraft.v1_8.vfs.SYS;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
|
|
@ -182,7 +182,8 @@ public abstract class ResourcePackListEntry implements GuiListExtended.IGuiListE
|
|||
this.resourcePacksGUI.getListContaining(this).remove(this);
|
||||
if (deleteInstead) {
|
||||
this.mc.loadingScreen.eaglerShow(I18n.format("resourcePack.load.deleting"), this.func_148312_b());
|
||||
SYS.deleteResourcePack(this.func_148312_b());
|
||||
EaglerFolderResourcePack.deleteResourcePack(EaglerFolderResourcePack.RESOURCE_PACKS,
|
||||
this.func_148312_b());
|
||||
} else {
|
||||
this.resourcePacksGUI.getSelectedResourcePacks().add(0, this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class ResourcePackListEntryFound extends ResourcePackListEntry {
|
|||
}
|
||||
|
||||
protected String func_148312_b() {
|
||||
return this.field_148319_c.getResourcePackName();
|
||||
return this.field_148319_c.getResourcePackEaglerDisplayName();
|
||||
}
|
||||
|
||||
public ResourcePackRepository.Entry func_148318_i() {
|
||||
|
|
|
|||
|
|
@ -10,11 +10,10 @@ import com.google.common.collect.ImmutableList;
|
|||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.IOUtils;
|
||||
import net.lax1dude.eaglercraft.v1_8.vfs.FolderResourcePack;
|
||||
import net.lax1dude.eaglercraft.v1_8.vfs.SYS;
|
||||
import net.lax1dude.eaglercraft.v1_8.futures.ListenableFuture;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ImageData;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||
|
|
@ -58,13 +57,20 @@ public class ResourcePackRepository {
|
|||
GameSettings settings) {
|
||||
this.rprDefaultResourcePack = rprDefaultResourcePackIn;
|
||||
this.rprMetadataSerializer = rprMetadataSerializerIn;
|
||||
reconstruct(settings);
|
||||
}
|
||||
|
||||
public void reconstruct(GameSettings settings) {
|
||||
this.repositoryEntriesAll.clear();
|
||||
this.repositoryEntries.clear();
|
||||
this.updateRepositoryEntriesAll();
|
||||
Iterator iterator = settings.resourcePacks.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
String s = (String) iterator.next();
|
||||
|
||||
for (ResourcePackRepository.Entry resourcepackrepository$entry : this.repositoryEntriesAll) {
|
||||
for (int i = 0, l = this.repositoryEntriesAll.size(); i < l; ++i) {
|
||||
ResourcePackRepository.Entry resourcepackrepository$entry = this.repositoryEntriesAll.get(i);
|
||||
if (resourcepackrepository$entry.getResourcePackName().equals(s)) {
|
||||
if (resourcepackrepository$entry.func_183027_f() == 1
|
||||
|| settings.field_183018_l.contains(resourcepackrepository$entry.getResourcePackName())) {
|
||||
|
|
@ -82,13 +88,12 @@ public class ResourcePackRepository {
|
|||
}
|
||||
|
||||
public void updateRepositoryEntriesAll() {
|
||||
if (SYS.VFS == null)
|
||||
return;
|
||||
|
||||
List<ResourcePackRepository.Entry> list = Lists.<ResourcePackRepository.Entry>newArrayList();
|
||||
|
||||
for (String file1 : SYS.getResourcePackNames()) {
|
||||
ResourcePackRepository.Entry resourcepackrepository$entry = new ResourcePackRepository.Entry(file1);
|
||||
List<EaglerFolderResourcePack> list2 = EaglerFolderResourcePack
|
||||
.getFolderResourcePacks(EaglerFolderResourcePack.RESOURCE_PACKS);
|
||||
for (int j = 0, l = list2.size(); j < l; ++j) {
|
||||
ResourcePackRepository.Entry resourcepackrepository$entry = new ResourcePackRepository.Entry(list2.get(j));
|
||||
|
||||
if (!this.repositoryEntriesAll.contains(resourcepackrepository$entry)) {
|
||||
try {
|
||||
|
|
@ -96,7 +101,7 @@ public class ResourcePackRepository {
|
|||
list.add(resourcepackrepository$entry);
|
||||
} catch (Exception var6) {
|
||||
logger.error("Failed to call \"updateResourcePack\" for resource pack \"{}\"",
|
||||
resourcepackrepository$entry.resourcePackFile);
|
||||
resourcepackrepository$entry.reResourcePack.resourcePackFile);
|
||||
logger.error(var6);
|
||||
list.remove(resourcepackrepository$entry);
|
||||
}
|
||||
|
|
@ -111,8 +116,8 @@ public class ResourcePackRepository {
|
|||
|
||||
this.repositoryEntriesAll.removeAll(list);
|
||||
|
||||
for (ResourcePackRepository.Entry resourcepackrepository$entry1 : this.repositoryEntriesAll) {
|
||||
resourcepackrepository$entry1.closeResourcePack();
|
||||
for (int i = 0, l = this.repositoryEntriesAll.size(); i < l; ++i) {
|
||||
this.repositoryEntriesAll.get(i).closeResourcePack();
|
||||
}
|
||||
|
||||
this.repositoryEntriesAll = list;
|
||||
|
|
@ -132,9 +137,9 @@ public class ResourcePackRepository {
|
|||
}
|
||||
|
||||
public void downloadResourcePack(String s1, String s2, Consumer<Boolean> cb) {
|
||||
SYS.loadRemoteResourcePack(s1, s2, res -> {
|
||||
EaglerFolderResourcePack.loadRemoteResourcePack(s1, s2, res -> {
|
||||
if (res != null) {
|
||||
ResourcePackRepository.this.resourcePackInstance = new FolderResourcePack(res, "srp/");
|
||||
ResourcePackRepository.this.resourcePackInstance = res;
|
||||
Minecraft.getMinecraft().scheduleResourcesRefresh();
|
||||
cb.accept(true);
|
||||
return;
|
||||
|
|
@ -164,28 +169,24 @@ public class ResourcePackRepository {
|
|||
}
|
||||
|
||||
public class Entry {
|
||||
private final String resourcePackFile;
|
||||
private IResourcePack reResourcePack;
|
||||
private EaglerFolderResourcePack reResourcePack;
|
||||
private PackMetadataSection rePackMetadataSection;
|
||||
private ImageData texturePackIcon;
|
||||
private ResourceLocation locationTexturePackIcon;
|
||||
private TextureManager iconTextureManager;
|
||||
|
||||
private Entry(String resourcePackFileIn) {
|
||||
this.resourcePackFile = resourcePackFileIn;
|
||||
private Entry(EaglerFolderResourcePack resourcePackFileIn) {
|
||||
this.reResourcePack = resourcePackFileIn;
|
||||
}
|
||||
|
||||
public void updateResourcePack() throws IOException {
|
||||
if (SYS.VFS == null)
|
||||
return;
|
||||
this.reResourcePack = (IResourcePack) new FolderResourcePack(this.resourcePackFile, "resourcepacks/");
|
||||
this.rePackMetadataSection = (PackMetadataSection) this.reResourcePack
|
||||
.getPackMetadata(ResourcePackRepository.this.rprMetadataSerializer, "pack");
|
||||
|
||||
try {
|
||||
this.texturePackIcon = this.reResourcePack.getPackImage();
|
||||
} catch (IOException var2) {
|
||||
logger.error("Failed to load resource pack icon for \"{}\"!", resourcePackFile);
|
||||
logger.error("Failed to load resource pack icon for \"{}\"!", reResourcePack.resourcePackFile);
|
||||
logger.error(var2);
|
||||
}
|
||||
|
||||
|
|
@ -225,6 +226,10 @@ public class ResourcePackRepository {
|
|||
return this.reResourcePack.getPackName();
|
||||
}
|
||||
|
||||
public String getResourcePackEaglerDisplayName() {
|
||||
return this.reResourcePack.getDisplayName();
|
||||
}
|
||||
|
||||
public String getTexturePackDescription() {
|
||||
return this.rePackMetadataSection == null
|
||||
? EnumChatFormatting.RED + "Invalid pack.mcmeta (or missing \'pack\' section)"
|
||||
|
|
@ -246,7 +251,7 @@ public class ResourcePackRepository {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
return this.resourcePackFile;
|
||||
return this.reResourcePack.resourcePackFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -82,8 +82,8 @@ public class AnimationMetadataSection implements IMetadataSection {
|
|||
public Set<Integer> getFrameIndexSet() {
|
||||
HashSet hashset = Sets.newHashSet();
|
||||
|
||||
for (AnimationFrame animationframe : this.animationFrames) {
|
||||
hashset.add(Integer.valueOf(animationframe.getFrameIndex()));
|
||||
for (int i = 0, l = this.animationFrames.size(); i < l; ++i) {
|
||||
hashset.add(Integer.valueOf(this.animationFrames.get(i).getFrameIndex()));
|
||||
}
|
||||
|
||||
return hashset;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
|||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.BlockVertexIDs;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.VertexMarkerState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BlockModelShapes;
|
||||
|
|
|
|||
|
|
@ -103,8 +103,9 @@ public enum ModelRotation {
|
|||
}
|
||||
|
||||
static {
|
||||
for (ModelRotation modelrotation : values()) {
|
||||
mapRotations.put(Integer.valueOf(modelrotation.combinedXY), modelrotation);
|
||||
ModelRotation[] lst = values();
|
||||
for (int i = 0; i < lst.length; ++i) {
|
||||
mapRotations.put(Integer.valueOf(lst[i].combinedXY), lst[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,8 +94,9 @@ public class SimpleBakedModel implements IBakedModel {
|
|||
parIBakedModel.getItemCameraTransforms());
|
||||
this.builderTexture = parIBakedModel.getParticleTexture();
|
||||
|
||||
for (EnumFacing enumfacing : EnumFacing.values()) {
|
||||
this.addFaceBreakingFours(parIBakedModel, parTextureAtlasSprite, enumfacing);
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int i = 0; i < facings.length; ++i) {
|
||||
this.addFaceBreakingFours(parIBakedModel, parTextureAtlasSprite, facings[i]);
|
||||
}
|
||||
|
||||
this.addGeneralBreakingFours(parIBakedModel, parTextureAtlasSprite);
|
||||
|
|
@ -103,16 +104,18 @@ public class SimpleBakedModel implements IBakedModel {
|
|||
|
||||
private void addFaceBreakingFours(IBakedModel parIBakedModel, EaglerTextureAtlasSprite parTextureAtlasSprite,
|
||||
EnumFacing parEnumFacing) {
|
||||
for (BakedQuad bakedquad : parIBakedModel.getFaceQuads(parEnumFacing)) {
|
||||
this.addFaceQuad(parEnumFacing, new BreakingFour(bakedquad, parTextureAtlasSprite));
|
||||
List<BakedQuad> quads = parIBakedModel.getFaceQuads(parEnumFacing);
|
||||
for (int i = 0, l = quads.size(); i < l; ++i) {
|
||||
this.addFaceQuad(parEnumFacing, new BreakingFour(quads.get(i), parTextureAtlasSprite));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void addGeneralBreakingFours(IBakedModel parIBakedModel,
|
||||
EaglerTextureAtlasSprite parTextureAtlasSprite) {
|
||||
for (BakedQuad bakedquad : parIBakedModel.getGeneralQuads()) {
|
||||
this.addGeneralQuad(new BreakingFour(bakedquad, parTextureAtlasSprite));
|
||||
List<BakedQuad> quads = parIBakedModel.getGeneralQuads();
|
||||
for (int i = 0, l = quads.size(); i < l; ++i) {
|
||||
this.addGeneralQuad(new BreakingFour(quads.get(i), parTextureAtlasSprite));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -121,7 +124,7 @@ public class SimpleBakedModel implements IBakedModel {
|
|||
this.builderGeneralQuads = Lists.newArrayList();
|
||||
this.builderFaceQuads = Lists.newArrayListWithCapacity(6);
|
||||
|
||||
for (EnumFacing enumfacing : EnumFacing.values()) {
|
||||
for (int i = 0, l = EnumFacing._VALUES.length; i < l; ++i) {
|
||||
this.builderFaceQuads.add(Lists.newArrayList());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,8 +111,9 @@ public class WeightedBakedModel implements IBakedModel {
|
|||
protected int getCountQuads() {
|
||||
int i = this.model.getGeneralQuads().size();
|
||||
|
||||
for (EnumFacing enumfacing : EnumFacing.values()) {
|
||||
i += this.model.getFaceQuads(enumfacing).size();
|
||||
EnumFacing[] facings = EnumFacing._VALUES;
|
||||
for (int j = 0; j < facings.length; ++j) {
|
||||
i += this.model.getFaceQuads(facings[j]).size();
|
||||
}
|
||||
|
||||
return i;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package net.minecraft.client.settings;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
|
|
@ -10,8 +9,6 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import org.json.JSONArray;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
|
@ -22,6 +19,7 @@ import com.google.common.collect.Sets;
|
|||
import net.lax1dude.eaglercraft.v1_8.ArrayUtils;
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerZLIB;
|
||||
import net.lax1dude.eaglercraft.v1_8.HString;
|
||||
import net.lax1dude.eaglercraft.v1_8.Keyboard;
|
||||
|
|
@ -116,7 +114,7 @@ public class GameSettings {
|
|||
* Whether to pause when the game loses focus, toggled by F3+P
|
||||
*/
|
||||
public boolean pauseOnLostFocus = true;
|
||||
private final Set<EnumPlayerModelParts> setModelParts = Sets.newHashSet(EnumPlayerModelParts.values());
|
||||
private final Set<EnumPlayerModelParts> setModelParts = Sets.newHashSet(EnumPlayerModelParts._VALUES);
|
||||
public boolean touchscreen;
|
||||
public int overrideWidth;
|
||||
public int overrideHeight;
|
||||
|
|
@ -641,14 +639,21 @@ public class GameSettings {
|
|||
* has replaced the previous 'loadOptions'
|
||||
*/
|
||||
public void loadOptions() {
|
||||
try {
|
||||
byte[] options = EagRuntime.getStorage("g");
|
||||
if (options == null) {
|
||||
return;
|
||||
}
|
||||
byte[] options = EagRuntime.getStorage("g");
|
||||
if (options == null) {
|
||||
return;
|
||||
}
|
||||
loadOptions(options);
|
||||
}
|
||||
|
||||
/**+
|
||||
* Loads the options from the options file. It appears that this
|
||||
* has replaced the previous 'loadOptions'
|
||||
*/
|
||||
public void loadOptions(byte[] data) {
|
||||
try {
|
||||
BufferedReader bufferedreader = new BufferedReader(
|
||||
new InputStreamReader(EaglerZLIB.newGZIPInputStream(new EaglerInputStream(options))));
|
||||
new InputStreamReader(EaglerZLIB.newGZIPInputStream(new EaglerInputStream(data))));
|
||||
String s = "";
|
||||
this.mapSoundLevels.clear();
|
||||
|
||||
|
|
@ -929,13 +934,13 @@ public class GameSettings {
|
|||
|
||||
Keyboard.setFunctionKeyModifier(keyBindFunction.getKeyCode());
|
||||
|
||||
for (SoundCategory soundcategory : SoundCategory.values()) {
|
||||
for (SoundCategory soundcategory : SoundCategory._VALUES) {
|
||||
if (astring[0].equals("soundCategory_" + soundcategory.getCategoryName())) {
|
||||
this.mapSoundLevels.put(soundcategory, Float.valueOf(this.parseFloat(astring[1])));
|
||||
}
|
||||
}
|
||||
|
||||
for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts.values()) {
|
||||
for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts._VALUES) {
|
||||
if (astring[0].equals("modelPart_" + enumplayermodelparts.getPartName())) {
|
||||
this.setModelPartEnabled(enumplayermodelparts, astring[1].equals("true"));
|
||||
}
|
||||
|
|
@ -965,8 +970,17 @@ public class GameSettings {
|
|||
* Saves the options to the options file.
|
||||
*/
|
||||
public void saveOptions() {
|
||||
byte[] data = writeOptions();
|
||||
if (data != null) {
|
||||
EagRuntime.setStorage("g", data);
|
||||
}
|
||||
RelayManager.relayManager.save();
|
||||
this.sendSettingsToServer();
|
||||
}
|
||||
|
||||
public byte[] writeOptions() {
|
||||
try {
|
||||
ByteArrayOutputStream bao = new ByteArrayOutputStream();
|
||||
EaglerOutputStream bao = new EaglerOutputStream();
|
||||
PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(EaglerZLIB.newGZIPOutputStream(bao)));
|
||||
printwriter.println("invertYMouse:" + this.invertMouse);
|
||||
printwriter.println("mouseSensitivity:" + this.mouseSensitivity);
|
||||
|
|
@ -1044,12 +1058,12 @@ public class GameSettings {
|
|||
|
||||
Keyboard.setFunctionKeyModifier(keyBindFunction.getKeyCode());
|
||||
|
||||
for (SoundCategory soundcategory : SoundCategory.values()) {
|
||||
for (SoundCategory soundcategory : SoundCategory._VALUES) {
|
||||
printwriter.println(
|
||||
"soundCategory_" + soundcategory.getCategoryName() + ":" + this.getSoundLevel(soundcategory));
|
||||
}
|
||||
|
||||
for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts.values()) {
|
||||
for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts._VALUES) {
|
||||
printwriter.println("modelPart_" + enumplayermodelparts.getPartName() + ":"
|
||||
+ this.setModelParts.contains(enumplayermodelparts));
|
||||
}
|
||||
|
|
@ -1057,15 +1071,12 @@ public class GameSettings {
|
|||
deferredShaderConf.writeOptions(printwriter);
|
||||
|
||||
printwriter.close();
|
||||
|
||||
EagRuntime.setStorage("g", bao.toByteArray());
|
||||
|
||||
RelayManager.relayManager.save();
|
||||
return bao.toByteArray();
|
||||
} catch (Exception exception) {
|
||||
logger.error("Failed to save options", exception);
|
||||
return null;
|
||||
}
|
||||
|
||||
this.sendSettingsToServer();
|
||||
}
|
||||
|
||||
public float getSoundLevel(SoundCategory parSoundCategory) {
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ public class KeyBinding implements Comparable<KeyBinding> {
|
|||
}
|
||||
|
||||
public static void unPressAllKeys() {
|
||||
for (KeyBinding keybinding : keybindArray) {
|
||||
keybinding.unpressKey();
|
||||
for (int i = 0, l = keybindArray.size(); i < l; ++i) {
|
||||
keybindArray.get(i).unpressKey();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -70,7 +70,8 @@ public class KeyBinding implements Comparable<KeyBinding> {
|
|||
public static void resetKeyBindingArrayAndHash() {
|
||||
hash.clearMap();
|
||||
|
||||
for (KeyBinding keybinding : keybindArray) {
|
||||
for (int i = 0, l = keybindArray.size(); i < l; ++i) {
|
||||
KeyBinding keybinding = keybindArray.get(i);
|
||||
hash.addKey(keybinding.keyCode, keybinding);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue