diff --git a/CREDITS b/CREDITS index fe69c9e..f4bfcb9 100644 --- a/CREDITS +++ b/CREDITS @@ -539,6 +539,28 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Project Name: webrtc-java + Project Author: Alex Andres + Project URL: https://github.com/devopvoid/webrtc-java + + Used For: WebRTC LAN worlds in desktop runtime + + * Copyright 2019 Alex Andres + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Project Name: Netty Project Author: Netty Project Project URL: https://netty.io/ diff --git a/README.md b/README.md index 3f180bb..cc09dcc 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,7 @@ The default eaglercraftXOpts values is this: - `assetsURI:` the URL of the assets.epk file **(required)** - `localesURI:` the URL where extra .lang files can be found - `worldsDB:` the name of the IndexedDB database to store worlds in +- `resourcePacksDB:` the name of the IndexedDB database to store resource packs in - `demoMode:` whether to launch the game in java edition demo mode - `servers:` a list of default servers to display on the Multiplayer screen - `relays:` the default list of shared world relays to use for invites diff --git a/buildtools/BuildTools.jar b/buildtools/BuildTools.jar index 3661329..9221f54 100644 Binary files a/buildtools/BuildTools.jar and b/buildtools/BuildTools.jar differ diff --git a/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/gui/CompileLatestClientGUI.java b/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/gui/CompileLatestClientGUI.java index 1f51356..5ddd23b 100644 --- a/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/gui/CompileLatestClientGUI.java +++ b/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/gui/CompileLatestClientGUI.java @@ -6,7 +6,6 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStream; import java.io.PrintStream; import java.net.URL; import java.net.URLClassLoader; diff --git a/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/task/diff/JARMemoryCache.java b/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/task/diff/JARMemoryCache.java index 6f47ff1..da409a1 100644 --- a/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/task/diff/JARMemoryCache.java +++ b/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/task/diff/JARMemoryCache.java @@ -2,7 +2,6 @@ package net.lax1dude.eaglercraft.v1_8.buildtools.task.diff; import java.io.IOException; import java.io.InputStream; -import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.zip.ZipEntry; diff --git a/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/task/diff/MergePullRequest.java b/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/task/diff/MergePullRequest.java index e671651..b3790b8 100644 --- a/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/task/diff/MergePullRequest.java +++ b/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/task/diff/MergePullRequest.java @@ -14,7 +14,6 @@ import java.nio.CharBuffer; import java.nio.charset.CharsetDecoder; import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; -import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.HashSet; @@ -23,14 +22,12 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import com.github.difflib.DiffUtils; -import com.github.difflib.UnifiedDiffUtils; import com.github.difflib.patch.Patch; import net.lax1dude.eaglercraft.v1_8.buildtools.EaglerBuildToolsConfig; diff --git a/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/task/init/DecompileMinecraft.java b/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/task/init/DecompileMinecraft.java index 2be8b16..32544bb 100644 --- a/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/task/init/DecompileMinecraft.java +++ b/buildtools/src/main/java/net/lax1dude/eaglercraft/v1_8/buildtools/task/init/DecompileMinecraft.java @@ -123,10 +123,6 @@ public class DecompileMinecraft { System.out.println("This will take a while, go get a drink or something lol."); System.out.println(); - System.out.println("Staying hydrated is important when u work on a fucked up project that"); - System.out.println("will make you angry enough put your fists through your bedroom wall"); - System.out.println(); - ex = JARSubprocess.runJava(mcpDataTMP, new String[] { "-jar", "fernflower.jar", "-din=1", "-rbr=1", "-dgs=1", "-asc=1", "-rsy=1", "-iec=1", "-ren=0", "-jvn=1", "-udv=1", "-ump=1", "-log=WARN", deobfOut2.getAbsolutePath(), diff --git a/client_version b/client_version index 0ecd536..582626e 100644 --- a/client_version +++ b/client_version @@ -1 +1 @@ -u23 \ No newline at end of file +u24 \ No newline at end of file diff --git a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/auth/AuthLoadingCache.java b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/auth/AuthLoadingCache.java index 5e9dc1d..db1a352 100644 --- a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/auth/AuthLoadingCache.java +++ b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/auth/AuthLoadingCache.java @@ -2,11 +2,8 @@ package net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.auth; import java.util.HashMap; import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.function.Consumer; /** * Copyright (c) 2022-2023 lax1dude. All Rights Reserved. diff --git a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/server/HttpHandshakeHandler.java b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/server/HttpHandshakeHandler.java index 6d4dbd8..f81434c 100644 --- a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/server/HttpHandshakeHandler.java +++ b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/server/HttpHandshakeHandler.java @@ -13,7 +13,6 @@ import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.DefaultFullHttpResponse; -import io.netty.handler.codec.http.DefaultHttpResponse; import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpHeaders; import io.netty.handler.codec.http.HttpRequest; diff --git a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/server/HttpWebSocketHandler.java b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/server/HttpWebSocketHandler.java index c18551c..bcc885d 100644 --- a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/server/HttpWebSocketHandler.java +++ b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/server/HttpWebSocketHandler.java @@ -7,7 +7,6 @@ import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.nio.charset.StandardCharsets; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/server/query/MOTDQueryHandler.java b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/server/query/MOTDQueryHandler.java index aa5cee0..ca4651f 100644 --- a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/server/query/MOTDQueryHandler.java +++ b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/server/query/MOTDQueryHandler.java @@ -7,7 +7,6 @@ import java.util.List; import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.api.query.EaglerQueryHandler; import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.api.query.EaglerQuerySimpleHandler; import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.api.query.MOTDConnection; import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.config.EaglerListenerConfig; diff --git a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/skins/BinaryHttpClient.java b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/skins/BinaryHttpClient.java index 709ea88..a9e980c 100644 --- a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/skins/BinaryHttpClient.java +++ b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/skins/BinaryHttpClient.java @@ -4,7 +4,6 @@ import java.io.IOException; import java.net.InetAddress; import java.net.URI; import java.net.UnknownHostException; -import java.nio.charset.StandardCharsets; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; diff --git a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/skins/JDBCCacheProvider.java b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/skins/JDBCCacheProvider.java index 1e2a04b..f476175 100644 --- a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/skins/JDBCCacheProvider.java +++ b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/skins/JDBCCacheProvider.java @@ -12,11 +12,8 @@ import java.sql.Statement; import java.util.Properties; import java.util.UUID; import java.util.logging.Level; -import java.util.zip.DeflaterOutputStream; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; -import java.util.zip.InflaterInputStream; - import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee; import net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.sqlite.EaglerDrivers; diff --git a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/skins/SkinService.java b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/skins/SkinService.java index d23883e..94a1f60 100644 --- a/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/skins/SkinService.java +++ b/gateway/EaglercraftXBungee/src/main/java/net/lax1dude/eaglercraft/v1_8/plugin/gateway_bungeecord/skins/SkinService.java @@ -12,8 +12,6 @@ import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.function.Consumer; -import java.util.logging.Logger; - import org.apache.commons.codec.binary.Base64; import com.google.common.collect.Multimap; diff --git a/patches/minecraft/delete.txt b/patches/minecraft/delete.txt index fe8e690..aa1178f 100644 --- a/patches/minecraft/delete.txt +++ b/patches/minecraft/delete.txt @@ -1,4 +1,4 @@ -# 143 files to delete: +# 144 files to delete: net/minecraft/client/renderer/VertexBufferUploader.java net/minecraft/realms/DisconnectedRealmsScreen.java net/minecraft/client/stream/Metadata.java @@ -65,6 +65,7 @@ net/minecraft/client/shader/ShaderGroup.java net/minecraft/server/management/UserListWhitelist.java net/minecraft/client/shader/ShaderLoader.java net/minecraft/realms/RealmsEditBox.java +net/minecraft/client/resources/ResourceIndex.java net/minecraft/server/management/UserListEntry.java net/minecraft/network/NettyEncryptionTranslator.java net/minecraft/client/audio/SoundManager.java diff --git a/patches/minecraft/net/minecraft/block/BlockBed.edit.java b/patches/minecraft/net/minecraft/block/BlockBed.edit.java index 3042855..efdd843 100644 --- a/patches/minecraft/net/minecraft/block/BlockBed.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockBed.edit.java @@ -5,8 +5,10 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 2 : 4 @ 2 : 5 +> CHANGE 2 : 6 @ 2 : 5 +~ import java.util.List; +~ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; ~ @@ -96,7 +98,13 @@ + (double) blockpos.getZ() + 0.5D, 5.0F, true, true); + return true; -> CHANGE 40 : 41 @ 40 : 41 +> CHANGE 4 : 7 @ 4 : 5 + +~ List playerEntities = worldIn.playerEntities; +~ for (int i = 0, l = playerEntities.size(); i < l; ++i) { +~ EntityPlayer entityplayer = playerEntities.get(i); + +> CHANGE 35 : 36 @ 35 : 36 ~ public Item getItemDropped(IBlockState iblockstate, EaglercraftRandom var2, int var3) { diff --git a/patches/minecraft/net/minecraft/block/BlockButton.edit.java b/patches/minecraft/net/minecraft/block/BlockButton.edit.java index 2ee76c3..f3e2516 100644 --- a/patches/minecraft/net/minecraft/block/BlockButton.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockButton.edit.java @@ -9,7 +9,13 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 164 : 165 @ 164 : 165 +> CHANGE 52 : 55 @ 52 : 53 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> CHANGE 111 : 112 @ 111 : 112 ~ public void randomTick(World var1, BlockPos var2, IBlockState var3, EaglercraftRandom var4) { diff --git a/patches/minecraft/net/minecraft/block/BlockCactus.edit.java b/patches/minecraft/net/minecraft/block/BlockCactus.edit.java index b3ecd76..d4d351d 100644 --- a/patches/minecraft/net/minecraft/block/BlockCactus.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockCactus.edit.java @@ -14,4 +14,10 @@ ~ public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { +> CHANGE 56 : 59 @ 56 : 57 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockChest.edit.java b/patches/minecraft/net/minecraft/block/BlockChest.edit.java index 3abf9b7..8bc12b0 100644 --- a/patches/minecraft/net/minecraft/block/BlockChest.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockChest.edit.java @@ -5,9 +5,18 @@ # Version: 1.0 # Author: lax1dude -> DELETE 2 @ 2 : 4 +> CHANGE 2 : 4 @ 2 : 4 -> CHANGE 130 : 131 @ 130 : 133 +~ import java.util.List; +~ + +> CHANGE 68 : 71 @ 68 : 69 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facings(); +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> CHANGE 61 : 62 @ 61 : 64 ~ if (!worldIn.isRemote) { @@ -17,8 +26,36 @@ + return state; -> CHANGE 117 : 118 @ 117 : 120 +> CHANGE 5 : 8 @ 5 : 6 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing1 = facings[i]; + +> CHANGE 80 : 83 @ 80 : 81 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> CHANGE 30 : 31 @ 30 : 33 ~ { +> CHANGE 23 : 26 @ 23 : 24 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> CHANGE 61 : 62 @ 61 : 62 + +~ List entityList = worldIn.getEntitiesWithinAABB(EntityOcelot.class, + +> CHANGE 1 : 4 @ 1 : 2 + +~ (double) (pos.getX() + 1), (double) (pos.getY() + 2), (double) (pos.getZ() + 1))); +~ for (int i = 0, l = entityList.size(); i < l; ++i) { +~ Entity entity = entityList.get(i); + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockColored.edit.java b/patches/minecraft/net/minecraft/block/BlockColored.edit.java index bfbb2b5..51a5901 100644 --- a/patches/minecraft/net/minecraft/block/BlockColored.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockColored.edit.java @@ -9,4 +9,10 @@ ~ +> CHANGE 26 : 29 @ 26 : 27 + +~ EnumDyeColor[] colors = EnumDyeColor.META_LOOKUP; +~ for (int i = 0; i < colors.length; ++i) { +~ EnumDyeColor enumdyecolor = colors[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockDirt.edit.java b/patches/minecraft/net/minecraft/block/BlockDirt.edit.java index b400dda..be247c7 100644 --- a/patches/minecraft/net/minecraft/block/BlockDirt.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockDirt.edit.java @@ -20,4 +20,14 @@ + } + +> CHANGE 50 : 51 @ 50 : 51 + +~ private static final BlockDirt.DirtType[] METADATA_LOOKUP = new BlockDirt.DirtType[3]; + +> CHANGE 45 : 48 @ 45 : 47 + +~ BlockDirt.DirtType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ METADATA_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockDoublePlant.edit.java b/patches/minecraft/net/minecraft/block/BlockDoublePlant.edit.java index c91c92e..5a497fa 100644 --- a/patches/minecraft/net/minecraft/block/BlockDoublePlant.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockDoublePlant.edit.java @@ -27,7 +27,13 @@ ~ public Item getItemDropped(IBlockState iblockstate, EaglercraftRandom random, int var3) { -> CHANGE 114 : 115 @ 114 : 115 +> CHANGE 98 : 101 @ 98 : 100 + +~ BlockDoublePlant.EnumPlantType[] types = BlockDoublePlant.EnumPlantType.META_LOOKUP; +~ for (int i = 0; i < types.length; ++i) { +~ list.add(new ItemStack(item, 1, types[i].getMeta())); + +> CHANGE 14 : 15 @ 14 : 15 ~ public boolean canUseBonemeal(World var1, EaglercraftRandom var2, BlockPos var3, IBlockState var4) { @@ -35,4 +41,14 @@ ~ public void grow(World world, EaglercraftRandom var2, BlockPos blockpos, IBlockState var4) { +> CHANGE 50 : 51 @ 50 : 51 + +~ private static final BlockDoublePlant.EnumPlantType[] META_LOOKUP = new BlockDoublePlant.EnumPlantType[6]; + +> CHANGE 39 : 42 @ 39 : 41 + +~ BlockDoublePlant.EnumPlantType[] types = BlockDoublePlant.EnumPlantType.values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMeta()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockDynamicLiquid.edit.java b/patches/minecraft/net/minecraft/block/BlockDynamicLiquid.edit.java index cb14a94..53fa48e 100644 --- a/patches/minecraft/net/minecraft/block/BlockDynamicLiquid.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockDynamicLiquid.edit.java @@ -17,8 +17,26 @@ ~ public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { -> CHANGE 75 : 76 @ 75 : 76 +> CHANGE 11 : 14 @ 11 : 12 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int m = 0; m < facings.length; ++m) { +~ EnumFacing enumfacing = facings[m]; + +> CHANGE 63 : 64 @ 63 : 64 ~ Set set = this.getPossibleFlowDirections(world, blockpos); +> CHANGE 35 : 38 @ 35 : 36 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int l = 0; l < facings.length; ++l) { +~ EnumFacing enumfacing = facings[l]; + +> CHANGE 27 : 30 @ 27 : 28 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int k = 0; k < facings.length; ++k) { +~ EnumFacing enumfacing = facings[k]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockFire.edit.java b/patches/minecraft/net/minecraft/block/BlockFire.edit.java index 017d1be..631f867 100644 --- a/patches/minecraft/net/minecraft/block/BlockFire.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockFire.edit.java @@ -26,7 +26,19 @@ ~ private void catchOnFire(World worldIn, BlockPos pos, int chance, EaglercraftRandom random, int age) { -> CHANGE 77 : 78 @ 77 : 78 +> CHANGE 23 : 26 @ 23 : 24 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> CHANGE 14 : 17 @ 14 : 16 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int j = 0; j < facings.length; ++j) { +~ i = Math.max(this.getEncouragement(worldIn.getBlockState(pos.offset(facings[j])).getBlock()), i); + +> CHANGE 37 : 38 @ 37 : 38 ~ public void randomDisplayTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) { diff --git a/patches/minecraft/net/minecraft/block/BlockFlower.edit.java b/patches/minecraft/net/minecraft/block/BlockFlower.edit.java index 4bcad09..2e4ad4e 100644 --- a/patches/minecraft/net/minecraft/block/BlockFlower.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockFlower.edit.java @@ -15,4 +15,22 @@ ~ +> CHANGE 24 : 27 @ 24 : 27 + +~ BlockFlower.EnumFlowerType[] flowerTypes = BlockFlower.EnumFlowerType.getTypes(this.getBlockType()); +~ for (int i = 0; i < flowerTypes.length; ++i) { +~ list.add(new ItemStack(item, 1, flowerTypes[i].getMeta())); + +> CHANGE 56 : 59 @ 56 : 58 + +~ public static final BlockFlower.EnumFlowerType[] _VALUES = EnumFlowerType.values(); +~ +~ private static final BlockFlower.EnumFlowerType[][] TYPES_FOR_BLOCK = new BlockFlower.EnumFlowerType[_VALUES.length][]; + +> CHANGE 50 : 53 @ 50 : 51 + +~ BlockFlower.EnumFlowerColor[] colors = BlockFlower.EnumFlowerColor.values(); +~ for (int i = 0; i < colors.length; ++i) { +~ final BlockFlower.EnumFlowerColor blockflower$enumflowercolor = colors[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockHugeMushroom.edit.java b/patches/minecraft/net/minecraft/block/BlockHugeMushroom.edit.java index 351ab0b..bff23d7 100644 --- a/patches/minecraft/net/minecraft/block/BlockHugeMushroom.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockHugeMushroom.edit.java @@ -26,4 +26,10 @@ ~ public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { +> CHANGE 61 : 64 @ 61 : 63 + +~ BlockHugeMushroom.EnumType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockLadder.edit.java b/patches/minecraft/net/minecraft/block/BlockLadder.edit.java index ad2d1ab..6626424 100644 --- a/patches/minecraft/net/minecraft/block/BlockLadder.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockLadder.edit.java @@ -7,4 +7,10 @@ > DELETE 2 @ 2 : 3 +> CHANGE 75 : 78 @ 75 : 76 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing1 = facings[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockLever.edit.java b/patches/minecraft/net/minecraft/block/BlockLever.edit.java index 7d43dcf..5365ca5 100644 --- a/patches/minecraft/net/minecraft/block/BlockLever.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockLever.edit.java @@ -18,4 +18,26 @@ + } + +> CHANGE 17 : 20 @ 17 : 18 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> CHANGE 19 : 22 @ 19 : 20 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing1 = facings[i]; + +> CHANGE 145 : 146 @ 145 : 146 + +~ private static final BlockLever.EnumOrientation[] META_LOOKUP = new BlockLever.EnumOrientation[8]; + +> CHANGE 70 : 73 @ 70 : 72 + +~ BlockLever.EnumOrientation[] orientations = values(); +~ for (int i = 0; i < orientations.length; ++i) { +~ META_LOOKUP[orientations[i].getMetadata()] = orientations[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockLiquid.edit.java b/patches/minecraft/net/minecraft/block/BlockLiquid.edit.java index 0b0e488..9f5af98 100644 --- a/patches/minecraft/net/minecraft/block/BlockLiquid.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockLiquid.edit.java @@ -18,7 +18,18 @@ ~ public int quantityDropped(EaglercraftRandom var1) { -> CHANGE 61 : 65 @ 61 : 62 +> CHANGE 7 : 10 @ 7 : 8 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int m = 0; m < facings.length; ++m) { +~ EnumFacing enumfacing = facings[m]; + +> CHANGE 20 : 22 @ 20 : 21 + +~ for (int j = 0; j < facings.length; ++j) { +~ EnumFacing enumfacing1 = facings[j]; + +> CHANGE 32 : 36 @ 32 : 33 ~ return this.blockMaterial == Material.water ~ ? (DeferredStateManager.isRenderingRealisticWater() ? EnumWorldBlockLayer.REALISTIC_WATER @@ -29,4 +40,10 @@ ~ public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { +> CHANGE 69 : 72 @ 69 : 70 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int j = 0; j < facings.length; ++j) { +~ EnumFacing enumfacing = facings[j]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockPistonBase.edit.java b/patches/minecraft/net/minecraft/block/BlockPistonBase.edit.java index 6f053c0..6030254 100644 --- a/patches/minecraft/net/minecraft/block/BlockPistonBase.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockPistonBase.edit.java @@ -9,4 +9,15 @@ ~ +> CHANGE 85 : 88 @ 85 : 86 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> CHANGE 10 : 12 @ 10 : 11 + +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing1 = facings[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockPlanks.edit.java b/patches/minecraft/net/minecraft/block/BlockPlanks.edit.java index f6ee972..d88e7c2 100644 --- a/patches/minecraft/net/minecraft/block/BlockPlanks.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockPlanks.edit.java @@ -20,4 +20,20 @@ + } + +> CHANGE 5 : 8 @ 5 : 7 + +~ BlockPlanks.EnumType[] types = BlockPlanks.EnumType.META_LOOKUP; +~ for (int i = 0; i < types.length; ++i) { +~ list.add(new ItemStack(item, 1, types[i].getMetadata())); + +> CHANGE 25 : 26 @ 25 : 26 + +~ public static final BlockPlanks.EnumType[] META_LOOKUP = new BlockPlanks.EnumType[6]; + +> CHANGE 45 : 48 @ 45 : 47 + +~ BlockPlanks.EnumType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockPortal.edit.java b/patches/minecraft/net/minecraft/block/BlockPortal.edit.java index 3ebebaa..bf73c06 100644 --- a/patches/minecraft/net/minecraft/block/BlockPortal.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockPortal.edit.java @@ -27,4 +27,19 @@ ~ EaglerLoadingCache loadingcache = BlockPattern.func_181627_a(parWorld, true); +> CHANGE 8 : 10 @ 8 : 9 + +~ EnumFacing.AxisDirection[] axis = EnumFacing.AxisDirection._VALUES; +~ int[] aint = new int[axis.length]; + +> CHANGE 3 : 5 @ 3 : 4 + +~ for (int k = 0; k < axis.length; ++k) { +~ EnumFacing.AxisDirection enumfacing$axisdirection = axis[k]; + +> CHANGE 20 : 22 @ 20 : 21 + +~ for (int k = 0; k < axis.length; ++k) { +~ EnumFacing.AxisDirection enumfacing$axisdirection2 = axis[k]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockPressurePlate.edit.java b/patches/minecraft/net/minecraft/block/BlockPressurePlate.edit.java index 9bcc29c..584a786 100644 --- a/patches/minecraft/net/minecraft/block/BlockPressurePlate.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockPressurePlate.edit.java @@ -13,4 +13,9 @@ ~ List list; +> CHANGE 12 : 14 @ 12 : 13 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ Entity entity = list.get(i); + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockPrismarine.edit.java b/patches/minecraft/net/minecraft/block/BlockPrismarine.edit.java index 4b01d69..26609f7 100644 --- a/patches/minecraft/net/minecraft/block/BlockPrismarine.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockPrismarine.edit.java @@ -20,4 +20,14 @@ + } + +> CHANGE 35 : 36 @ 35 : 36 + +~ private static final BlockPrismarine.EnumType[] META_LOOKUP = new BlockPrismarine.EnumType[3]; + +> CHANGE 35 : 38 @ 35 : 37 + +~ BlockPrismarine.EnumType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockQuartz.edit.java b/patches/minecraft/net/minecraft/block/BlockQuartz.edit.java index d69bef7..3693676 100644 --- a/patches/minecraft/net/minecraft/block/BlockQuartz.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockQuartz.edit.java @@ -20,4 +20,14 @@ + } + +> CHANGE 59 : 60 @ 59 : 60 + +~ private static final BlockQuartz.EnumType[] META_LOOKUP = new BlockQuartz.EnumType[5]; + +> CHANGE 31 : 34 @ 31 : 33 + +~ BlockQuartz.EnumType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockRailBase.edit.java b/patches/minecraft/net/minecraft/block/BlockRailBase.edit.java index 75d2c92..7f1a219 100644 --- a/patches/minecraft/net/minecraft/block/BlockRailBase.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockRailBase.edit.java @@ -17,4 +17,21 @@ > DELETE 31 @ 31 : 32 +> CHANGE 42 : 43 @ 42 : 43 + +~ private static final BlockRailBase.EnumRailDirection[] META_LOOKUP = new BlockRailBase.EnumRailDirection[10]; + +> CHANGE 34 : 37 @ 34 : 36 + +~ BlockRailBase.EnumRailDirection[] directions = values(); +~ for (int i = 0; i < directions.length; ++i) { +~ META_LOOKUP[directions[i].getMetadata()] = directions[i]; + +> CHANGE 124 : 128 @ 124 : 126 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ for (int j = 0; j < facings.length; ++j) { +~ if (this.hasRailAt(this.pos.offsetEvenFaster(facings[j], tmp))) { + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockRailDetector.edit.java b/patches/minecraft/net/minecraft/block/BlockRailDetector.edit.java index ac816b9..ea7f17d 100644 --- a/patches/minecraft/net/minecraft/block/BlockRailDetector.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockRailDetector.edit.java @@ -14,9 +14,8 @@ ~ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 18 : 20 @ 18 : 27 +> CHANGE 18 : 19 @ 18 : 27 -~ ~ public static PropertyEnum SHAPE; > INSERT 9 : 21 @ 9 diff --git a/patches/minecraft/net/minecraft/block/BlockRedSandstone.edit.java b/patches/minecraft/net/minecraft/block/BlockRedSandstone.edit.java index 7699787..008af82 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedSandstone.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockRedSandstone.edit.java @@ -20,4 +20,20 @@ + } + +> CHANGE 5 : 8 @ 5 : 7 + +~ BlockRedSandstone.EnumType[] types = BlockRedSandstone.EnumType.META_LOOKUP; +~ for (int i = 0; i < types.length; ++i) { +~ list.add(new ItemStack(item, 1, types[i].getMetadata())); + +> CHANGE 20 : 21 @ 20 : 21 + +~ public static final BlockRedSandstone.EnumType[] META_LOOKUP = new BlockRedSandstone.EnumType[3]; + +> CHANGE 35 : 38 @ 35 : 37 + +~ BlockRedSandstone.EnumType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.edit.java b/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.edit.java index bba6f09..4248747 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.edit.java @@ -18,4 +18,18 @@ ~ public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { +> CHANGE 43 : 47 @ 43 : 45 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ for (int i = 0; i < facings.length; ++i) { +~ world.notifyNeighborsOfStateChange(blockpos.offsetEvenFaster(facings[i], tmp), this); + +> CHANGE 93 : 97 @ 93 : 95 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ for (int i = 0; i < facings.length; ++i) { +~ world.notifyNeighborsOfStateChange(blockpos.offsetEvenFaster(facings[i], tmp), this); + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneTorch.edit.java b/patches/minecraft/net/minecraft/block/BlockRedstoneTorch.edit.java index e395b8b..13b2d89 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneTorch.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneTorch.edit.java @@ -15,7 +15,21 @@ ~ import com.google.common.collect.Maps; ~ -> CHANGE 76 : 77 @ 76 : 77 +> CHANGE 51 : 55 @ 51 : 53 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ for (int i = 0; i < facings.length; ++i) { +~ world.notifyNeighborsOfStateChange(blockpos.offsetEvenFaster(facings[i], tmp), this); + +> CHANGE 7 : 11 @ 7 : 9 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ for (int i = 0; i < facings.length; ++i) { +~ world.notifyNeighborsOfStateChange(blockpos.offsetEvenFaster(facings[i], tmp), this); + +> CHANGE 14 : 15 @ 14 : 15 ~ public void randomTick(World var1, BlockPos var2, IBlockState var3, EaglercraftRandom var4) { diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.edit.java b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.edit.java index 8540495..33edfc7 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.edit.java @@ -39,13 +39,113 @@ + } + -> CHANGE 49 : 50 @ 49 : 50 +> CHANGE 11 : 15 @ 11 : 14 + +~ BlockPos posTmp = new BlockPos(0, 0, 0); +~ Block block = worldIn.getBlockState(blockpos).getBlock(); +~ if (!canConnectTo(worldIn.getBlockState(blockpos), direction) && (block.isBlockNormalCube() +~ || !canConnectUpwardsTo(worldIn.getBlockState(blockpos.offsetEvenFaster(EnumFacing.UP, posTmp))))) { + +> CHANGE 2 : 3 @ 2 : 3 + +~ && canConnectUpwardsTo(worldIn.getBlockState(blockpos.offsetEvenFaster(EnumFacing.UP, posTmp))) + +> CHANGE 26 : 29 @ 26 : 28 + +~ BlockPos fuckOff = blockpos.down(); +~ return World.doesBlockHaveSolidTopSurface(world, fuckOff) +~ || world.getBlockState(fuckOff).getBlock() == Blocks.glowstone; + +> CHANGE 4 : 5 @ 4 : 5 ~ ArrayList arraylist = Lists.newArrayList(this.blocksNeedingUpdate); -> DELETE 100 @ 100 : 101 +> CHANGE 2 : 4 @ 2 : 4 -> DELETE 24 @ 24 : 25 +~ for (int i = 0, l = arraylist.size(); i < l; ++i) { +~ worldIn.notifyNeighborsOfStateChange(arraylist.get(i), this); + +> CHANGE 19 : 25 @ 19 : 22 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ for (int m = 0; m < facings.length; ++m) { +~ EnumFacing enumfacing = facings[m]; +~ BlockPos blockpos = pos1.offsetEvenFaster(enumfacing, tmp); +~ boolean flag = blockpos.x != pos2.x || blockpos.z != pos2.z; + +> CHANGE 35 : 37 @ 35 : 37 + +~ for (int m = 0; m < facings.length; ++m) { +~ this.blocksNeedingUpdate.add(pos1.offset(facings[m])); + +> CHANGE 10 : 14 @ 10 : 12 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ for (int i = 0; i < facings.length; ++i) { +~ worldIn.notifyNeighborsOfStateChange(pos.offsetEvenFaster(facings[i], tmp), this); + +> CHANGE 9 : 13 @ 9 : 11 + +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ EnumFacing[] facings = EnumFacing.Plane.VERTICAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ world.notifyNeighborsOfStateChange(blockpos.offsetEvenFaster(facings[i], tmp), this); + +> CHANGE 2 : 5 @ 2 : 4 + +~ facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ this.notifyWireNeighborsOfStateChange(world, blockpos.offsetEvenFaster(facings[i], tmp)); + +> CHANGE 2 : 4 @ 2 : 4 + +~ for (int i = 0; i < facings.length; ++i) { +~ BlockPos blockpos1 = blockpos.offsetEvenFaster(facings[i], tmp); + +> CHANGE 1 : 3 @ 1 : 2 + +~ ++blockpos1.y; +~ this.notifyWireNeighborsOfStateChange(world, blockpos1); + +> CHANGE 1 : 3 @ 1 : 2 + +~ --blockpos1.y; +~ this.notifyWireNeighborsOfStateChange(world, blockpos1); + +> DELETE 2 @ 2 : 3 + +> CHANGE 6 : 10 @ 6 : 8 + +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ world.notifyNeighborsOfStateChange(blockpos.offsetEvenFaster(facings[i], tmp), this); + +> CHANGE 4 : 7 @ 4 : 6 + +~ facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ this.notifyWireNeighborsOfStateChange(world, blockpos.offsetEvenFaster(facings[i], tmp)); + +> CHANGE 2 : 5 @ 2 : 4 + +~ facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ BlockPos blockpos1 = blockpos.offsetEvenFaster(facings[i], tmp); + +> CHANGE 1 : 3 @ 1 : 2 + +~ ++blockpos1.y; +~ this.notifyWireNeighborsOfStateChange(world, blockpos1); + +> CHANGE 1 : 3 @ 1 : 2 + +~ --blockpos1.y; +~ this.notifyWireNeighborsOfStateChange(world, blockpos1); + +> DELETE 2 @ 2 : 3 > DELETE 20 @ 20 : 21 @@ -53,7 +153,13 @@ ~ public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { -> CHANGE 99 : 100 @ 99 : 100 +> CHANGE 21 : 24 @ 21 : 22 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int j = 0; j < facings.length; ++j) { +~ EnumFacing enumfacing1 = facings[j]; + +> CHANGE 77 : 78 @ 77 : 78 ~ public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { diff --git a/patches/minecraft/net/minecraft/block/BlockReed.edit.java b/patches/minecraft/net/minecraft/block/BlockReed.edit.java index 5d866f6..e52db33 100644 --- a/patches/minecraft/net/minecraft/block/BlockReed.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockReed.edit.java @@ -10,11 +10,40 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; ~ -> CHANGE 26 : 27 @ 26 : 27 +> CHANGE 26 : 29 @ 26 : 28 ~ public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ if (world.getBlockState(blockpos.offsetEvenFaster(EnumFacing.DOWN, tmp)).getBlock() == Blocks.reeds -> CHANGE 62 : 63 @ 62 : 63 +> CHANGE 1 : 2 @ 1 : 2 + +~ if (world.isAirBlock(blockpos.offsetEvenFaster(EnumFacing.UP, tmp))) { + +> CHANGE 1 : 3 @ 1 : 2 + +~ --tmp.y; +~ for (i = 1; world.getBlockState(tmp.offsetEvenFaster(EnumFacing.DOWN, tmp)).getBlock() == this; ++i) { + +> CHANGE 6 : 7 @ 6 : 7 + +~ world.setBlockState(blockpos.offsetEvenFaster(EnumFacing.UP, tmp), this.getDefaultState()); + +> CHANGE 11 : 13 @ 11 : 12 + +~ BlockPos down = blockpos.down(); +~ Block block = world.getBlockState(down).getBlock(); + +> CHANGE 5 : 11 @ 5 : 8 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; +~ down = blockpos.offsetEvenFaster(enumfacing, down); +~ --down.y; +~ if (world.getBlockState(down).getBlock().getMaterial() == Material.water) { + +> CHANGE 30 : 31 @ 30 : 31 ~ public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { diff --git a/patches/minecraft/net/minecraft/block/BlockSand.edit.java b/patches/minecraft/net/minecraft/block/BlockSand.edit.java index 1b01ee5..683c02b 100644 --- a/patches/minecraft/net/minecraft/block/BlockSand.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockSand.edit.java @@ -20,4 +20,20 @@ + } + +> CHANGE 5 : 8 @ 5 : 7 + +~ BlockSand.EnumType[] blocks = BlockSand.EnumType.META_LOOKUP; +~ for (int i = 0; i < blocks.length; ++i) { +~ list.add(new ItemStack(item, 1, blocks[i].getMetadata())); + +> CHANGE 23 : 24 @ 23 : 24 + +~ public static final BlockSand.EnumType[] META_LOOKUP = new BlockSand.EnumType[2]; + +> CHANGE 41 : 44 @ 41 : 43 + +~ BlockSand.EnumType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockSandStone.edit.java b/patches/minecraft/net/minecraft/block/BlockSandStone.edit.java index ad8bf90..125ca6d 100644 --- a/patches/minecraft/net/minecraft/block/BlockSandStone.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockSandStone.edit.java @@ -20,4 +20,20 @@ + } + +> CHANGE 5 : 8 @ 5 : 7 + +~ BlockSandStone.EnumType[] types = BlockSandStone.EnumType.META_LOOKUP; +~ for (int i = 0; i < types.length; ++i) { +~ list.add(new ItemStack(item, 1, types[i].getMetadata())); + +> CHANGE 24 : 25 @ 24 : 25 + +~ public static final BlockSandStone.EnumType[] META_LOOKUP = new BlockSandStone.EnumType[3]; + +> CHANGE 35 : 38 @ 35 : 37 + +~ BlockSandStone.EnumType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockSapling.edit.java b/patches/minecraft/net/minecraft/block/BlockSapling.edit.java index 51dbe80..552fb71 100644 --- a/patches/minecraft/net/minecraft/block/BlockSapling.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockSapling.edit.java @@ -35,7 +35,13 @@ ~ public void generateTree(World worldIn, BlockPos pos, IBlockState state, EaglercraftRandom rand) { -> CHANGE 119 : 120 @ 119 : 120 +> CHANGE 109 : 112 @ 109 : 111 + +~ BlockPlanks.EnumType[] types = BlockPlanks.EnumType.META_LOOKUP; +~ for (int i = 0; i < types.length; ++i) { +~ list.add(new ItemStack(item, 1, types[i].getMetadata())); + +> CHANGE 8 : 9 @ 8 : 9 ~ public boolean canUseBonemeal(World world, EaglercraftRandom var2, BlockPos var3, IBlockState var4) { diff --git a/patches/minecraft/net/minecraft/block/BlockSilverfish.edit.java b/patches/minecraft/net/minecraft/block/BlockSilverfish.edit.java index 2003ac9..a52925c 100644 --- a/patches/minecraft/net/minecraft/block/BlockSilverfish.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockSilverfish.edit.java @@ -22,4 +22,26 @@ ~ ~ public int quantityDropped(EaglercraftRandom var1) { +> CHANGE 43 : 46 @ 43 : 45 + +~ BlockSilverfish.EnumType[] types = BlockSilverfish.EnumType.META_LOOKUP; +~ for (int i = 0; i < types.length; ++i) { +~ list.add(new ItemStack(item, 1, types[i].getMetadata())); + +> CHANGE 52 : 53 @ 52 : 53 + +~ public static final BlockSilverfish.EnumType[] META_LOOKUP = new BlockSilverfish.EnumType[6]; + +> CHANGE 41 : 44 @ 41 : 42 + +~ BlockSilverfish.EnumType[] types = BlockSilverfish.EnumType.META_LOOKUP; +~ for (int i = 0; i < types.length; ++i) { +~ BlockSilverfish.EnumType blocksilverfish$enumtype = types[i]; + +> CHANGE 9 : 12 @ 9 : 11 + +~ BlockSilverfish.EnumType[] types = BlockSilverfish.EnumType.values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockSkull.edit.java b/patches/minecraft/net/minecraft/block/BlockSkull.edit.java index d4533c3..11c3879 100644 --- a/patches/minecraft/net/minecraft/block/BlockSkull.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockSkull.edit.java @@ -5,10 +5,12 @@ # Version: 1.0 # Author: lax1dude -> INSERT 2 : 4 @ 2 +> INSERT 2 : 6 @ 2 + import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; + ++ import java.util.List; ++ > CHANGE 1 : 2 @ 1 : 3 @@ -18,4 +20,11 @@ ~ public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { +> CHANGE 38 : 42 @ 38 : 41 + +~ List list = worldIn.getEntitiesWithinAABB(EntityPlayer.class, +~ entitywither.getEntityBoundingBox().expand(50.0D, 50.0D, 50.0D)); +~ for (int j = 0, l = list.size(); j < l; ++j) { +~ list.get(j).triggerAchievement(AchievementList.spawnWither); + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockSponge.edit.java b/patches/minecraft/net/minecraft/block/BlockSponge.edit.java index 0a824ed..fbc7476 100644 --- a/patches/minecraft/net/minecraft/block/BlockSponge.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockSponge.edit.java @@ -18,7 +18,23 @@ ~ ArrayList arraylist = Lists.newArrayList(); -> CHANGE 49 : 50 @ 49 : 50 +> INSERT 3 : 4 @ 3 + ++ BlockPos tmp = new BlockPos(0, 0, 0); + +> CHANGE 5 : 9 @ 5 : 7 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int k = 0; k < facings.length; ++k) { +~ EnumFacing enumfacing = facings[k]; +~ BlockPos blockpos1 = blockpos.offsetEvenFaster(enumfacing, tmp); + +> CHANGE 15 : 17 @ 15 : 17 + +~ for (int j = 0, l = arraylist.size(); j < l; ++j) { +~ worldIn.notifyNeighborsOfStateChange(arraylist.get(j), Blocks.air); + +> CHANGE 22 : 23 @ 22 : 23 ~ public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { diff --git a/patches/minecraft/net/minecraft/block/BlockStainedGlass.edit.java b/patches/minecraft/net/minecraft/block/BlockStainedGlass.edit.java index 0060f1b..99d9a29 100644 --- a/patches/minecraft/net/minecraft/block/BlockStainedGlass.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockStainedGlass.edit.java @@ -10,7 +10,13 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; ~ -> CHANGE 43 : 44 @ 43 : 44 +> CHANGE 29 : 32 @ 29 : 31 + +~ EnumDyeColor[] colors = EnumDyeColor.META_LOOKUP; +~ for (int i = 0; i < colors.length; ++i) { +~ list.add(new ItemStack(item, 1, colors[i].getMetadata())); + +> CHANGE 12 : 13 @ 12 : 13 ~ public int quantityDropped(EaglercraftRandom var1) { diff --git a/patches/minecraft/net/minecraft/block/BlockStainedGlassPane.edit.java b/patches/minecraft/net/minecraft/block/BlockStainedGlassPane.edit.java index 28ec20e..1560eb1 100644 --- a/patches/minecraft/net/minecraft/block/BlockStainedGlassPane.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockStainedGlassPane.edit.java @@ -9,7 +9,11 @@ ~ -> DELETE 61 @ 61 : 62 +> CHANGE 31 : 32 @ 31 : 32 + +~ for (int i = 0; i < EnumDyeColor.META_LOOKUP.length; ++i) { + +> DELETE 29 @ 29 : 30 > DELETE 6 @ 6 : 7 diff --git a/patches/minecraft/net/minecraft/block/BlockStairs.edit.java b/patches/minecraft/net/minecraft/block/BlockStairs.edit.java index 35cc091..e14a8af 100644 --- a/patches/minecraft/net/minecraft/block/BlockStairs.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockStairs.edit.java @@ -50,4 +50,14 @@ + return true; + } +> CHANGE 37 : 39 @ 37 : 39 + +~ for (int l = 0; l < aint.length; ++l) { +~ amovingobjectposition[aint[l]] = null; + +> CHANGE 5 : 7 @ 5 : 6 + +~ for (int l = 0; l < amovingobjectposition.length; ++l) { +~ MovingObjectPosition movingobjectposition = amovingobjectposition[l]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockStaticLiquid.edit.java b/patches/minecraft/net/minecraft/block/BlockStaticLiquid.edit.java index a82f69d..5cd0ea8 100644 --- a/patches/minecraft/net/minecraft/block/BlockStaticLiquid.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockStaticLiquid.edit.java @@ -14,4 +14,10 @@ ~ public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) { +> CHANGE 32 : 35 @ 32 : 33 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockStem.edit.java b/patches/minecraft/net/minecraft/block/BlockStem.edit.java index 047c10b..b8d3015 100644 --- a/patches/minecraft/net/minecraft/block/BlockStem.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockStem.edit.java @@ -14,11 +14,25 @@ ~ -> CHANGE 53 : 54 @ 53 : 54 +> CHANGE 39 : 44 @ 39 : 41 + +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; +~ if (iblockaccess.getBlockState(blockpos.offsetEvenFaster(enumfacing, tmp)).getBlock() == this.crop) { + +> CHANGE 12 : 13 @ 12 : 13 ~ public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { -> CHANGE 82 : 83 @ 82 : 83 +> CHANGE 9 : 12 @ 9 : 11 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int j = 0; j < facings.length; ++j) { +~ if (world.getBlockState(blockpos.offset(facings[j])).getBlock() == this.crop) { + +> CHANGE 71 : 72 @ 71 : 72 ~ public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { diff --git a/patches/minecraft/net/minecraft/block/BlockStone.edit.java b/patches/minecraft/net/minecraft/block/BlockStone.edit.java index 510aa15..f4a1838 100644 --- a/patches/minecraft/net/minecraft/block/BlockStone.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockStone.edit.java @@ -25,4 +25,20 @@ ~ public Item getItemDropped(IBlockState iblockstate, EaglercraftRandom var2, int var3) { +> CHANGE 9 : 12 @ 9 : 11 + +~ BlockStone.EnumType[] types = BlockStone.EnumType.META_LOOKUP; +~ for (int i = 0; i < types.length; ++i) { +~ list.add(new ItemStack(item, 1, types[i].getMetadata())); + +> CHANGE 24 : 25 @ 24 : 25 + +~ public static final BlockStone.EnumType[] META_LOOKUP = new BlockStone.EnumType[7]; + +> CHANGE 45 : 48 @ 45 : 47 + +~ BlockStone.EnumType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockStoneBrick.edit.java b/patches/minecraft/net/minecraft/block/BlockStoneBrick.edit.java index c0eaadb..84e82cd 100644 --- a/patches/minecraft/net/minecraft/block/BlockStoneBrick.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockStoneBrick.edit.java @@ -20,4 +20,20 @@ + } + +> CHANGE 5 : 8 @ 5 : 7 + +~ BlockStoneBrick.EnumType[] types = BlockStoneBrick.EnumType.META_LOOKUP; +~ for (int i = 0; i < types.length; ++i) { +~ list.add(new ItemStack(item, 1, types[i].getMetadata())); + +> CHANGE 20 : 21 @ 20 : 21 + +~ public static final BlockStoneBrick.EnumType[] META_LOOKUP = new BlockStoneBrick.EnumType[4]; + +> CHANGE 35 : 38 @ 35 : 37 + +~ BlockStoneBrick.EnumType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockStoneSlab.edit.java b/patches/minecraft/net/minecraft/block/BlockStoneSlab.edit.java index 0acdd06..41ad16e 100644 --- a/patches/minecraft/net/minecraft/block/BlockStoneSlab.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockStoneSlab.edit.java @@ -22,4 +22,20 @@ ~ ~ public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { +> CHANGE 21 : 24 @ 21 : 22 + +~ BlockStoneSlab.EnumType[] types = BlockStoneSlab.EnumType.META_LOOKUP; +~ for (int i = 0; i < types.length; ++i) { +~ BlockStoneSlab.EnumType blockstoneslab$enumtype = types[i]; + +> CHANGE 55 : 56 @ 55 : 56 + +~ public static final BlockStoneSlab.EnumType[] META_LOOKUP = new BlockStoneSlab.EnumType[8]; + +> CHANGE 45 : 48 @ 45 : 47 + +~ BlockStoneSlab.EnumType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockStoneSlabNew.edit.java b/patches/minecraft/net/minecraft/block/BlockStoneSlabNew.edit.java index b4aec4a..63bca25 100644 --- a/patches/minecraft/net/minecraft/block/BlockStoneSlabNew.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockStoneSlabNew.edit.java @@ -25,4 +25,20 @@ ~ public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { +> CHANGE 21 : 24 @ 21 : 23 + +~ BlockStoneSlabNew.EnumType[] types = BlockStoneSlabNew.EnumType.META_LOOKUP; +~ for (int i = 0; i < types.length; ++i) { +~ list.add(new ItemStack(item, 1, types[i].getMetadata())); + +> CHANGE 48 : 49 @ 48 : 49 + +~ public static final BlockStoneSlabNew.EnumType[] META_LOOKUP = new BlockStoneSlabNew.EnumType[1]; + +> CHANGE 39 : 42 @ 39 : 41 + +~ BlockStoneSlabNew.EnumType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockTallGrass.edit.java b/patches/minecraft/net/minecraft/block/BlockTallGrass.edit.java index 65458a5..efed5f4 100644 --- a/patches/minecraft/net/minecraft/block/BlockTallGrass.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockTallGrass.edit.java @@ -37,4 +37,14 @@ ~ public void grow(World world, EaglercraftRandom var2, BlockPos blockpos, IBlockState iblockstate) { +> CHANGE 30 : 31 @ 30 : 31 + +~ private static final BlockTallGrass.EnumType[] META_LOOKUP = new BlockTallGrass.EnumType[3]; + +> CHANGE 29 : 32 @ 29 : 31 + +~ BlockTallGrass.EnumType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMeta()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockTorch.edit.java b/patches/minecraft/net/minecraft/block/BlockTorch.edit.java index 7c60d2a..21042f5 100644 --- a/patches/minecraft/net/minecraft/block/BlockTorch.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockTorch.edit.java @@ -14,7 +14,13 @@ ~ -> CHANGE 149 : 150 @ 149 : 150 +> CHANGE 75 : 78 @ 75 : 76 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing1 = facings[i]; + +> CHANGE 73 : 74 @ 73 : 74 ~ public void randomDisplayTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { diff --git a/patches/minecraft/net/minecraft/block/BlockTripWire.edit.java b/patches/minecraft/net/minecraft/block/BlockTripWire.edit.java index 7942ae0..39bf79e 100644 --- a/patches/minecraft/net/minecraft/block/BlockTripWire.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockTripWire.edit.java @@ -24,8 +24,13 @@ ~ public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { -> CHANGE 16 : 17 @ 16 : 17 +> CHANGE 11 : 12 @ 11 : 12 -~ for (Entity entity : (List) list) { +~ List list = worldIn.getEntitiesWithinAABBExcludingEntity((Entity) null, + +> CHANGE 4 : 6 @ 4 : 6 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ if (!list.get(i).doesEntityNotTriggerPressurePlate()) { > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockTripWireHook.edit.java b/patches/minecraft/net/minecraft/block/BlockTripWireHook.edit.java index 211685a..db3af33 100644 --- a/patches/minecraft/net/minecraft/block/BlockTripWireHook.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockTripWireHook.edit.java @@ -14,7 +14,14 @@ ~ -> CHANGE 167 : 168 @ 167 : 168 +> CHANGE 55 : 59 @ 55 : 57 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ for (int i = 0; i < facings.length; ++i) { +~ if (world.getBlockState(blockpos.offsetEvenFaster(facings[i], tmp)).getBlock().isNormalCube()) { + +> CHANGE 110 : 111 @ 110 : 111 ~ public void randomTick(World var1, BlockPos var2, IBlockState var3, EaglercraftRandom var4) { diff --git a/patches/minecraft/net/minecraft/block/BlockVine.edit.java b/patches/minecraft/net/minecraft/block/BlockVine.edit.java index b0a375e..deaf20d 100644 --- a/patches/minecraft/net/minecraft/block/BlockVine.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockVine.edit.java @@ -10,11 +10,62 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; ~ -> CHANGE 189 : 190 @ 189 : 190 +> CHANGE 146 : 150 @ 146 : 147 + +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> CHANGE 2 : 4 @ 2 : 4 + +~ && !this.canPlaceOn(worldIn.getBlockState(pos.offsetEvenFaster(enumfacing, tmp)).getBlock())) { +~ IBlockState iblockstate1 = worldIn.getBlockState(pos.offsetEvenFaster(EnumFacing.UP, tmp)); + +> CHANGE 38 : 39 @ 38 : 39 ~ public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { -> DELETE 119 @ 119 : 120 +> INSERT 22 : 23 @ 22 + ++ BlockPos tmp = new BlockPos(0, 0, 0); + +> CHANGE 4 : 9 @ 4 : 7 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int j = 0; j < facings.length; ++j) { +~ EnumFacing enumfacing3 = facings[j]; +~ if (random.nextBoolean() || !this.canPlaceOn( +~ world.getBlockState(blockpos2.offsetEvenFaster(enumfacing3, tmp)).getBlock())) { + +> CHANGE 33 : 35 @ 33 : 35 + +~ } else if (flag1 && world.isAirBlock(blockpos5) && this.canPlaceOn( +~ world.getBlockState(blockpos.offsetEvenFaster(enumfacing2, tmp)).getBlock())) { + +> CHANGE 2 : 4 @ 2 : 4 + +~ } else if (flag2 && world.isAirBlock(blockpos1) && this.canPlaceOn( +~ world.getBlockState(blockpos.offsetEvenFaster(enumfacing4, tmp)).getBlock())) { + +> INSERT 16 : 17 @ 16 + ++ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; + +> CHANGE 3 : 4 @ 3 : 4 + +~ for (int j = 0; j < facings.length; ++j) { + +> CHANGE 1 : 2 @ 1 : 2 + +~ iblockstate2 = iblockstate2.withProperty(getPropertyFor(facings[j]), + +> CHANGE 13 : 15 @ 13 : 15 + +~ for (int j = 0; j < facings.length; ++j) { +~ PropertyBool propertybool = getPropertyFor(facings[j]); + +> DELETE 14 @ 14 : 15 > CHANGE 15 : 16 @ 15 : 16 @@ -24,4 +75,9 @@ ~ public int quantityDropped(EaglercraftRandom var1) { +> CHANGE 70 : 72 @ 70 : 72 + +~ for (int j = 0; j < ALL_FACES.length; ++j) { +~ if (((Boolean) state.getValue(ALL_FACES[j])).booleanValue()) { + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockWall.edit.java b/patches/minecraft/net/minecraft/block/BlockWall.edit.java index d995cb1..242590e 100644 --- a/patches/minecraft/net/minecraft/block/BlockWall.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockWall.edit.java @@ -20,4 +20,20 @@ + } + +> CHANGE 72 : 75 @ 72 : 74 + +~ BlockWall.EnumType[] types = BlockWall.EnumType.META_LOOKUP; +~ for (int i = 0; i < types.length; ++i) { +~ list.add(new ItemStack(item, 1, types[i].getMetadata())); + +> CHANGE 35 : 36 @ 35 : 36 + +~ public static final BlockWall.EnumType[] META_LOOKUP = new BlockWall.EnumType[2]; + +> CHANGE 35 : 38 @ 35 : 37 + +~ BlockWall.EnumType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP[types[i].getMetadata()] = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/BlockWoodSlab.edit.java b/patches/minecraft/net/minecraft/block/BlockWoodSlab.edit.java index 9779cd4..ba6306c 100644 --- a/patches/minecraft/net/minecraft/block/BlockWoodSlab.edit.java +++ b/patches/minecraft/net/minecraft/block/BlockWoodSlab.edit.java @@ -25,4 +25,10 @@ ~ public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { +> CHANGE 21 : 24 @ 21 : 23 + +~ BlockPlanks.EnumType[] types = BlockPlanks.EnumType.META_LOOKUP; +~ for (int i = 0; i < types.length; ++i) { +~ list.add(new ItemStack(item, 1, types[i].getMetadata())); + > EOF diff --git a/patches/minecraft/net/minecraft/block/properties/PropertyDirection.edit.java b/patches/minecraft/net/minecraft/block/properties/PropertyDirection.edit.java index 7328f82..5b510d6 100644 --- a/patches/minecraft/net/minecraft/block/properties/PropertyDirection.edit.java +++ b/patches/minecraft/net/minecraft/block/properties/PropertyDirection.edit.java @@ -14,4 +14,8 @@ ~ +> CHANGE 12 : 13 @ 12 : 13 + +~ return create(name, Collections2.filter(Lists.newArrayList(EnumFacing._VALUES), filter)); + > EOF diff --git a/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.edit.java b/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.edit.java index 56ec8e8..156351f 100644 --- a/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.edit.java +++ b/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.edit.java @@ -13,4 +13,10 @@ + import com.google.common.collect.Lists; + +> CHANGE 152 : 155 @ 152 : 153 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/block/state/pattern/BlockPattern.edit.java b/patches/minecraft/net/minecraft/block/state/pattern/BlockPattern.edit.java index 117dc7e..a9ac68a 100644 --- a/patches/minecraft/net/minecraft/block/state/pattern/BlockPattern.edit.java +++ b/patches/minecraft/net/minecraft/block/state/pattern/BlockPattern.edit.java @@ -23,7 +23,15 @@ ~ EaglerLoadingCache loadingcache = func_181627_a(worldIn, false); -> CHANGE 19 : 21 @ 19 : 21 +> CHANGE 3 : 8 @ 3 : 5 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int j = 0; j < facings.length; ++j) { +~ EnumFacing enumfacing = facings[j]; +~ for (int k = 0; k < facings.length; ++k) { +~ EnumFacing enumfacing1 = facings[k]; + +> CHANGE 14 : 16 @ 14 : 16 ~ public static EaglerLoadingCache func_181627_a(World parWorld, boolean parFlag) { ~ return new EaglerLoadingCache(new BlockPattern.CacheLoader(parWorld, parFlag)); diff --git a/patches/minecraft/net/minecraft/block/state/pattern/FactoryBlockPattern.edit.java b/patches/minecraft/net/minecraft/block/state/pattern/FactoryBlockPattern.edit.java index 538d9f9..cdfe605 100644 --- a/patches/minecraft/net/minecraft/block/state/pattern/FactoryBlockPattern.edit.java +++ b/patches/minecraft/net/minecraft/block/state/pattern/FactoryBlockPattern.edit.java @@ -5,28 +5,38 @@ # Version: 1.0 # Author: lax1dude -> DELETE 2 @ 2 : 7 +> INSERT 2 : 9 @ 2 -> CHANGE 5 : 6 @ 5 : 8 ++ import java.util.ArrayList; ++ import java.util.List; ++ import java.util.Map; ++ import java.util.Map.Entry; ++ ++ import org.apache.commons.lang3.StringUtils; ++ + +> CHANGE 5 : 6 @ 5 : 10 ~ -> INSERT 2 : 10 @ 2 +> DELETE 1 @ 1 : 4 -+ import com.google.common.base.Joiner; -+ import com.google.common.base.Predicate; -+ import com.google.common.base.Predicates; -+ import com.google.common.collect.Lists; -+ import com.google.common.collect.Maps; -+ -+ import net.minecraft.block.state.BlockWorldState; -+ - -> CHANGE 12 : 13 @ 12 : 13 +> CHANGE 13 : 14 @ 13 : 14 ~ if (!(aisle == null || aisle.length <= 0) && !StringUtils.isEmpty(aisle[0])) { -> CHANGE 18 : 19 @ 18 : 19 +> CHANGE 9 : 11 @ 9 : 10 + +~ for (int i = 0; i < aisle.length; ++i) { +~ String s = aisle[i]; + +> CHANGE 6 : 9 @ 6 : 7 + +~ char[] achar = s.toCharArray(); +~ for (int j = 0; j < achar.length; ++j) { +~ char c0 = achar[j]; + +> CHANGE 1 : 2 @ 1 : 2 ~ this.symbolMap.put(Character.valueOf(c0), null); diff --git a/patches/minecraft/net/minecraft/client/Minecraft.edit.java b/patches/minecraft/net/minecraft/client/Minecraft.edit.java index 3af372c..eba857f 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.edit.java +++ b/patches/minecraft/net/minecraft/client/Minecraft.edit.java @@ -20,7 +20,7 @@ > DELETE 1 @ 1 : 4 -> CHANGE 1 : 51 @ 1 : 4 +> CHANGE 1 : 52 @ 1 : 4 ~ ~ import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput; @@ -44,6 +44,7 @@ ~ 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; @@ -75,7 +76,9 @@ > DELETE 2 @ 2 : 4 -> DELETE 13 @ 13 : 15 +> DELETE 10 @ 10 : 11 + +> DELETE 2 @ 2 : 4 > DELETE 3 @ 3 : 4 @@ -229,8 +232,9 @@ > DELETE 1 @ 1 : 4 -> CHANGE 1 : 2 @ 1 : 3 +> CHANGE 1 : 3 @ 1 : 3 +~ EaglerFolderResourcePack.deleteOldResourcePacks(EaglerFolderResourcePack.SERVER_RESOURCE_PACKS, 604800000L); ~ this.mcResourcePackRepository = new ResourcePackRepository(this.mcDefaultResourcePack, this.metadataSerializer_, > DELETE 8 @ 8 : 11 @@ -373,7 +377,7 @@ ~ 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); ~ } @@ -613,7 +617,7 @@ + this.eagskullCommand.tick(); -> INSERT 43 : 88 @ 43 +> INSERT 43 : 87 @ 43 + if (this.theWorld != null) { + ++joinWorldTickCounter; @@ -654,8 +658,7 @@ + if (SingleplayerServerController.hangupEaglercraftServer()) { + this.displayGuiScreen(new GuiScreenIntegratedServerBusy(currentScreen, + "singleplayer.busy.stoppingIntegratedServer", -+ "singleplayer.failed.stoppingIntegratedServer", -+ () -> SingleplayerServerController.isReady())); ++ "singleplayer.failed.stoppingIntegratedServer", SingleplayerServerController::isReady)); + } + } + } diff --git a/patches/minecraft/net/minecraft/client/audio/SoundCategory.edit.java b/patches/minecraft/net/minecraft/client/audio/SoundCategory.edit.java index 8875bc4..93eaafe 100644 --- a/patches/minecraft/net/minecraft/client/audio/SoundCategory.edit.java +++ b/patches/minecraft/net/minecraft/client/audio/SoundCategory.edit.java @@ -16,4 +16,15 @@ ~ MOBS("hostile", 5), ANIMALS("neutral", 6), PLAYERS("player", 7), AMBIENT("ambient", 8), VOICE("voice", 9); +> INSERT 1 : 3 @ 1 + ++ public static final SoundCategory[] _VALUES = values(); ++ + +> CHANGE 23 : 26 @ 23 : 24 + +~ SoundCategory[] categories = _VALUES; +~ for (int i = 0; i < categories.length; ++i) { +~ SoundCategory soundcategory = categories[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/client/audio/SoundEventAccessorComposite.edit.java b/patches/minecraft/net/minecraft/client/audio/SoundEventAccessorComposite.edit.java index 60515be..01bc933 100644 --- a/patches/minecraft/net/minecraft/client/audio/SoundEventAccessorComposite.edit.java +++ b/patches/minecraft/net/minecraft/client/audio/SoundEventAccessorComposite.edit.java @@ -18,4 +18,14 @@ ~ private final EaglercraftRandom rnd = new EaglercraftRandom(); +> CHANGE 16 : 18 @ 16 : 18 + +~ for (int j = 0, l = this.soundPool.size(); j < l; ++j) { +~ i += this.soundPool.get(j).getWeight(); + +> CHANGE 10 : 12 @ 10 : 11 + +~ for (int k = 0, l = this.soundPool.size(); k < l; ++k) { +~ ISoundEventAccessor isoundeventaccessor = this.soundPool.get(k); + > EOF diff --git a/patches/minecraft/net/minecraft/client/audio/SoundList.edit.java b/patches/minecraft/net/minecraft/client/audio/SoundList.edit.java index b807a65..f62bf1a 100644 --- a/patches/minecraft/net/minecraft/client/audio/SoundList.edit.java +++ b/patches/minecraft/net/minecraft/client/audio/SoundList.edit.java @@ -14,4 +14,11 @@ + import com.google.common.collect.Lists; + +> CHANGE 91 : 95 @ 91 : 94 + +~ SoundList.SoundEntry.Type[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ if (types[i].field_148583_c.equals(parString1)) { +~ return types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.edit.java b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.edit.java index a22b273..f853691 100644 --- a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.edit.java +++ b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.edit.java @@ -5,11 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 2 : 6 @ 2 +> INSERT 2 : 4 @ 2 -+ 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; > DELETE 3 @ 3 : 4 diff --git a/patches/minecraft/net/minecraft/client/gui/FontRenderer.edit.java b/patches/minecraft/net/minecraft/client/gui/FontRenderer.edit.java index 758f080..512b09b 100644 --- a/patches/minecraft/net/minecraft/client/gui/FontRenderer.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/FontRenderer.edit.java @@ -159,7 +159,13 @@ + textColor |= -16777216; + } -> CHANGE 30 : 31 @ 30 : 31 +> CHANGE 6 : 9 @ 6 : 8 + +~ List 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); + +> CHANGE 22 : 23 @ 22 : 23 ~ return Arrays.asList(this.wrapFormattedStringToWidth(str, wrapWidth, 0).split("\n")); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiChat.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiChat.edit.java index a336e0d..84fa26e 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiChat.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiChat.edit.java @@ -88,7 +88,20 @@ + } + -> INSERT 85 : 86 @ 85 +> CHANGE 32 : 34 @ 32 : 33 + +~ int l = this.foundPlayerNames.size(); +~ if (l > 1) { + +> CHANGE 2 : 3 @ 2 : 3 + +~ for (int i = 0; i < l; ++i) { + +> CHANGE 4 : 5 @ 4 : 5 + +~ stringbuilder.append(this.foundPlayerNames.get(i)); + +> INSERT 44 : 45 @ 44 + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); @@ -99,4 +112,9 @@ + } + +> CHANGE 8 : 10 @ 8 : 9 + +~ for (int i = 0; i < parArrayOfString.length; ++i) { +~ String s = parArrayOfString[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/client/gui/GuiControls.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiControls.edit.java index b2ae922..6bc6168 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiControls.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiControls.edit.java @@ -15,7 +15,13 @@ ~ protected void actionPerformed(GuiButton parGuiButton) { -> CHANGE 16 : 17 @ 16 : 17 +> CHANGE 3 : 6 @ 3 : 5 + +~ KeyBinding[] arr = this.mc.gameSettings.keyBindings; +~ for (int i = 0; i < arr.length; ++i) { +~ arr[i].setKeyCode(arr[i].getKeyCodeDefault()); + +> CHANGE 11 : 12 @ 11 : 12 ~ protected void mouseClicked(int parInt1, int parInt2, int parInt3) { @@ -23,4 +29,10 @@ ~ protected void keyTyped(char parChar1, int parInt1) { +> CHANGE 24 : 27 @ 24 : 26 + +~ KeyBinding[] arr = this.options.keyBindings; +~ for (int k = 0; k < arr.length; ++k) { +~ if (arr[k].getKeyCode() != arr[k].getKeyCodeDefault()) { + > EOF diff --git a/patches/minecraft/net/minecraft/client/gui/GuiCreateFlatWorld.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiCreateFlatWorld.edit.java index e688835..4d9df20 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiCreateFlatWorld.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiCreateFlatWorld.edit.java @@ -11,7 +11,7 @@ + import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; + import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; -> DELETE 8 @ 8 : 9 +> DELETE 2 @ 2 : 9 > DELETE 2 @ 2 : 3 diff --git a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.edit.java index fdd996b..fb89341 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.edit.java @@ -5,14 +5,26 @@ # Version: 1.0 # Author: lax1dude -> INSERT 4 : 6 @ 4 +> DELETE 2 @ 2 : 3 -+ -+ import net.lax1dude.eaglercraft.v1_8.Keyboard; +> CHANGE 1 : 3 @ 1 : 6 -> DELETE 12 @ 12 : 13 +~ +~ import net.lax1dude.eaglercraft.v1_8.Keyboard; -> CHANGE 149 : 150 @ 149 : 150 +> DELETE 7 @ 7 : 8 + +> CHANGE 82 : 84 @ 82 : 84 + +~ for (int i = 0; i < ChatAllowedCharacters.allowedCharactersArray.length; ++i) { +~ this.field_146336_i = this.field_146336_i.replace(ChatAllowedCharacters.allowedCharactersArray[i], '_'); + +> CHANGE 48 : 50 @ 48 : 50 + +~ for (int i = 0; i < disallowedFilenames.length; ++i) { +~ if (parString1.equalsIgnoreCase(disallowedFilenames[i])) { + +> CHANGE 15 : 16 @ 15 : 16 ~ protected void actionPerformed(GuiButton parGuiButton) { diff --git a/patches/minecraft/net/minecraft/client/gui/GuiCustomizeSkin.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiCustomizeSkin.edit.java index 4cb8702..5697dbb 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiCustomizeSkin.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiCustomizeSkin.edit.java @@ -7,7 +7,13 @@ > DELETE 2 @ 2 : 5 -> CHANGE 30 : 31 @ 30 : 31 +> CHANGE 15 : 18 @ 15 : 16 + +~ EnumPlayerModelParts[] parts = EnumPlayerModelParts._VALUES; +~ for (int k = 0; k < parts.length; ++k) { +~ EnumPlayerModelParts enumplayermodelparts = parts[k]; + +> CHANGE 14 : 15 @ 14 : 15 ~ protected void actionPerformed(GuiButton parGuiButton) { diff --git a/patches/minecraft/net/minecraft/client/gui/GuiCustomizeWorldScreen.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiCustomizeWorldScreen.edit.java index 19a16f0..d88b2ff 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiCustomizeWorldScreen.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiCustomizeWorldScreen.edit.java @@ -5,14 +5,12 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 10 @ 6 +> CHANGE 6 : 10 @ 6 : 16 -+ -+ import net.lax1dude.eaglercraft.v1_8.HString; -+ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; -+ import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; - -> DELETE 9 @ 9 : 10 +~ +~ import net.lax1dude.eaglercraft.v1_8.HString; +~ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +~ import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; > DELETE 1 @ 1 : 2 diff --git a/patches/minecraft/net/minecraft/client/gui/GuiDisconnected.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiDisconnected.edit.java index a7d27bd..26c14cd 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiDisconnected.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiDisconnected.edit.java @@ -26,7 +26,13 @@ ~ protected void actionPerformed(GuiButton parGuiButton) { -> INSERT 20 : 32 @ 20 +> CHANGE 12 : 15 @ 12 : 14 + +~ for (int l = 0, m = this.multilineMessage.size(); l < m; ++l) { +~ this.drawCenteredString(this.fontRendererObj, this.multilineMessage.get(l), this.width / 2, k, +~ 16777215); + +> INSERT 6 : 18 @ 6 + + public void updateScreen() { diff --git a/patches/minecraft/net/minecraft/client/gui/GuiFlatPresets.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiFlatPresets.edit.java index 9c3f35a..5dc8fbd 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiFlatPresets.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiFlatPresets.edit.java @@ -12,7 +12,7 @@ + import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; + import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; -> DELETE 7 @ 7 : 8 +> DELETE 1 @ 1 : 8 > DELETE 2 @ 2 : 3 @@ -30,4 +30,9 @@ ~ protected void actionPerformed(GuiButton parGuiButton) { +> CHANGE 55 : 57 @ 55 : 57 + +~ for (int i = 0, l = parList.size(); i < l; ++i) { +~ flatgeneratorinfo.getWorldFeatures().put(parList.get(i), Maps.newHashMap()); + > EOF diff --git a/patches/minecraft/net/minecraft/client/gui/GuiGameOver.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiGameOver.edit.java index c068b2d..b489499 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiGameOver.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiGameOver.edit.java @@ -11,7 +11,12 @@ > DELETE 1 @ 1 : 2 -> CHANGE 33 : 34 @ 33 : 34 +> CHANGE 27 : 29 @ 27 : 29 + +~ for (int i = 0, l = this.buttonList.size(); i < l; ++i) { +~ this.buttonList.get(i).enabled = false; + +> CHANGE 4 : 5 @ 4 : 5 ~ protected void keyTyped(char parChar1, int parInt1) { @@ -34,4 +39,9 @@ ~ this.mc.shutdownIntegratedServer(new GuiMainMenu()); +> CHANGE 34 : 36 @ 34 : 36 + +~ for (int i = 0, l = this.buttonList.size(); i < l; ++i) { +~ this.buttonList.get(i).enabled = true; + > EOF diff --git a/patches/minecraft/net/minecraft/client/gui/GuiIngame.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiIngame.edit.java index 764a877..8d6f610 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiIngame.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiIngame.edit.java @@ -5,11 +5,10 @@ # Version: 1.0 # Author: lax1dude -> INSERT 2 : 8 @ 2 +> INSERT 2 : 7 @ 2 + 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; + @@ -77,13 +76,15 @@ > DELETE 147 @ 147 : 151 -> CHANGE 17 : 18 @ 17 : 18 +> CHANGE 17 : 19 @ 17 : 18 -~ for (Score score : (List) arraylist1) { +~ for (int m = 0, n = arraylist1.size(); m < n; ++m) { +~ Score score = (Score) arraylist1.get(m); -> CHANGE 12 : 13 @ 12 : 13 +> CHANGE 12 : 14 @ 12 : 13 -~ for (Score score1 : (List) arraylist1) { +~ for (int m = 0, n = arraylist1.size(); m < n; ++m) { +~ Score score1 = (Score) arraylist1.get(m); > CHANGE 7 : 9 @ 7 : 9 diff --git a/patches/minecraft/net/minecraft/client/gui/GuiKeyBindingList.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiKeyBindingList.edit.java index ae48a43..ba289f0 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiKeyBindingList.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiKeyBindingList.edit.java @@ -14,4 +14,15 @@ > DELETE 4 @ 4 : 5 +> CHANGE 17 : 19 @ 17 : 18 + +~ for (int l = 0; l < akeybinding.length; ++l) { +~ KeyBinding keybinding = akeybinding[l]; + +> CHANGE 86 : 89 @ 86 : 87 + +~ KeyBinding[] kb = GuiKeyBindingList.this.mc.gameSettings.keyBindings; +~ for (int m = 0; m < kb.length; ++m) { +~ KeyBinding keybindingx = kb[m]; + > EOF diff --git a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.edit.java index 0b5c78b..2b669b3 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.edit.java @@ -51,7 +51,9 @@ > DELETE 3 @ 3 : 5 -> DELETE 4 @ 4 : 11 +> DELETE 2 @ 2 : 3 + +> DELETE 1 @ 1 : 8 > DELETE 2 @ 2 : 3 @@ -247,7 +249,7 @@ ~ isaveformat.deleteWorldDirectory("Demo World"); ~ this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.deleting", -~ "singleplayer.failed.deleting", () -> SingleplayerServerController.isReady())); +~ "singleplayer.failed.deleting", SingleplayerServerController::isReady)); ~ } else { > DELETE 1 @ 1 : 14 diff --git a/patches/minecraft/net/minecraft/client/gui/GuiMultiplayer.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiMultiplayer.edit.java index c79e218..ea4be68 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiMultiplayer.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiMultiplayer.edit.java @@ -145,7 +145,14 @@ ~ this.refreshServerList(); ~ } -> DELETE 1 @ 1 : 2 +> INSERT 1 : 2 @ 1 + ++ } + +> INSERT 1 : 3 @ 1 + ++ public void cancelDirectConnect() { ++ this.directConnect = false; > CHANGE 2 : 3 @ 2 : 3 @@ -159,10 +166,13 @@ > DELETE 2 @ 2 : 11 -> INSERT 25 : 28 @ 25 +> INSERT 22 : 24 @ 22 + relaysButton.drawScreen(i, j); + drawPluginDownloadLink(i, j); + +> INSERT 3 : 4 @ 3 + + } > INSERT 1 : 17 @ 1 diff --git a/patches/minecraft/net/minecraft/client/gui/GuiNewChat.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiNewChat.edit.java index 49c3b5a..fb3bda1 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiNewChat.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiNewChat.edit.java @@ -22,6 +22,10 @@ > CHANGE 108 : 109 @ 108 : 109 -~ for (IChatComponent ichatcomponent : (List) list) { +~ for (int j = 0, l = list.size(); j < l; ++j) { + +> CHANGE 5 : 6 @ 5 : 6 + +~ this.field_146253_i.add(0, new ChatLine(parInt2, (IChatComponent) list.get(j), parInt1)); > EOF diff --git a/patches/minecraft/net/minecraft/client/gui/GuiOptions.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiOptions.edit.java index 721b849..41c88f9 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiOptions.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiOptions.edit.java @@ -5,23 +5,39 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 2 : 9 @ 2 : 24 +> CHANGE 2 : 13 @ 2 : 3 ~ 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; + +> DELETE 1 @ 1 : 21 > DELETE 2 @ 2 : 3 -> INSERT 12 : 13 @ 12 +> INSERT 2 : 4 @ 2 + ++ import net.minecraft.util.EnumChatFormatting; ++ import net.minecraft.util.ResourceLocation; + +> INSERT 10 : 11 @ 10 + private GuiButton broadcastSettings; -> CHANGE 47 : 48 @ 47 : 59 +> CHANGE 10 : 12 @ 10 : 11 + +~ for (int j = 0; j < field_146440_f.length; ++j) { +~ GameSettings.Options gamesettings$options = field_146440_f[j]; + +> CHANGE 36 : 37 @ 36 : 48 ~ I18n.format("shaders.gui.optionsButton"))); @@ -33,22 +49,17 @@ > CHANGE 8 : 10 @ 8 : 9 -~ 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, > CHANGE 1 : 5 @ 1 : 3 -~ 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; -> INSERT 2 : 4 @ 2 - -+ -+ rp.enabled = SYS.VFS != null; - -> CHANGE 22 : 23 @ 22 : 23 +> CHANGE 24 : 25 @ 24 : 25 ~ protected void actionPerformed(GuiButton parGuiButton) { @@ -79,4 +90,40 @@ + EagRuntime.showDebugConsole(); + } +> INSERT 6 : 24 @ 6 + ++ ++ 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(); ++ } ++ + +> INSERT 2 : 14 @ 2 + ++ ++ 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)); ++ } ++ } ++ } + > EOF diff --git a/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.edit.java index 12a511e..0d95cd3 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.edit.java @@ -18,7 +18,7 @@ + import java.util.Locale; -> INSERT 1 : 14 @ 1 +> INSERT 1 : 13 @ 1 + import java.util.TimeZone; + @@ -31,18 +31,14 @@ + 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; -> CHANGE 5 : 8 @ 5 : 10 +> CHANGE 5 : 6 @ 5 : 10 -~ import net.minecraft.client.renderer.RenderHelper; -~ import net.minecraft.client.renderer.entity.RenderManager; ~ import net.minecraft.client.resources.I18n; -> CHANGE 1 : 3 @ 1 : 2 +> CHANGE 1 : 2 @ 1 : 2 -~ import net.minecraft.entity.EntityLivingBase; ~ import net.minecraft.potion.PotionEffect; > CHANGE 8 : 9 @ 8 : 9 @@ -254,7 +250,7 @@ + } + -> INSERT 4 : 36 @ 4 +> INSERT 4 : 37 @ 4 + private int drawSingleplayerStats(ScaledResolution parScaledResolution) { + if (mc.isDemo()) { @@ -268,7 +264,8 @@ + List 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); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiPageButtonList.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiPageButtonList.edit.java index b09bff6..3fe499a 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiPageButtonList.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiPageButtonList.edit.java @@ -16,4 +16,34 @@ > DELETE 1 @ 1 : 9 +> CHANGE 22 : 24 @ 22 : 23 + +~ for (int n = 0; n < this.field_178078_x.length; ++n) { +~ GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry = this.field_178078_x[n]; + +> CHANGE 86 : 91 @ 86 : 90 + +~ +~ 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); + +> CHANGE 3 : 7 @ 3 : 7 + +~ 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); + +> CHANGE 33 : 35 @ 33 : 34 + +~ for (int i = 0, l = this.field_178074_u.size(); i < l; ++i) { +~ GuiPageButtonList.GuiEntry guipagebuttonlist$guientry = this.field_178074_u.get(i); + +> CHANGE 108 : 110 @ 108 : 110 + +~ for (int k = 0; k < astring.length; ++k) { +~ ((GuiTextField) this.field_178072_w.get(j)).setText(astring[k]); + > EOF diff --git a/patches/minecraft/net/minecraft/client/gui/GuiPlayerTabOverlay.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiPlayerTabOverlay.edit.java index 2534b21..6d26180 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiPlayerTabOverlay.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiPlayerTabOverlay.edit.java @@ -20,32 +20,42 @@ > DELETE 2 @ 2 : 3 -> CHANGE 46 : 47 @ 46 : 47 +> CHANGE 46 : 48 @ 46 : 47 -~ for (NetworkPlayerInfo networkplayerinfo : (List) list) { +~ for (int m = 0, n = list.size(); m < n; ++m) { +~ NetworkPlayerInfo networkplayerinfo = (NetworkPlayerInfo) list.get(m); > CHANGE 20 : 21 @ 20 : 22 ~ boolean flag = true; -> CHANGE 20 : 21 @ 20 : 21 +> CHANGE 15 : 17 @ 15 : 17 -~ for (String s : (List) list1) { +~ List list1 = null; +~ List list2 = null; -> CHANGE 7 : 8 @ 7 : 8 +> CHANGE 3 : 5 @ 3 : 5 -~ for (String s2 : (List) list2) { +~ for (int m = 0, n = list1.size(); m < n; ++m) { +~ l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(list1.get(m))); -> CHANGE 8 : 9 @ 8 : 9 +> CHANGE 6 : 8 @ 6 : 8 -~ for (String s3 : (List) list1) { +~ for (int m = 0, n = list2.size(); m < n; ++m) { +~ l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(list2.get(m))); + +> CHANGE 7 : 9 @ 7 : 8 + +~ for (int m = 0, n = list1.size(); m < n; ++m) { +~ String s3 = list1.get(m); > CHANGE 32 : 33 @ 32 : 33 ~ if (entityplayer == null || entityplayer.isWearing(EnumPlayerModelParts.HAT)) { -> CHANGE 33 : 34 @ 33 : 34 +> CHANGE 33 : 35 @ 33 : 34 -~ for (String s4 : (List) list2) { +~ for (int m = 0, n = list2.size(); m < n; ++m) { +~ String s4 = list2.get(m); > EOF diff --git a/patches/minecraft/net/minecraft/client/gui/GuiRenameWorld.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiRenameWorld.edit.java index c6cf2c6..b0c9f4f 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiRenameWorld.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiRenameWorld.edit.java @@ -5,14 +5,13 @@ # Version: 1.0 # Author: lax1dude -> INSERT 3 : 7 @ 3 +> CHANGE 2 : 5 @ 2 : 6 -+ -+ 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.lax1dude.eaglercraft.v1_8.Keyboard; +~ import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +~ import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenIntegratedServerBusy; -> DELETE 6 @ 6 : 7 +> DELETE 3 @ 3 : 4 > INSERT 5 : 6 @ 5 @@ -51,13 +50,13 @@ ~ 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)); ~ } > DELETE 1 @ 1 : 2 diff --git a/patches/minecraft/net/minecraft/client/gui/GuiScreen.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiScreen.edit.java index 81dfaf3..1ea2001 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiScreen.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiScreen.edit.java @@ -45,7 +45,15 @@ ~ private String clickedLinkURI; ~ protected long showingCloseKey = 0; -> INSERT 10 : 40 @ 10 +> CHANGE 2 : 3 @ 2 : 3 + +~ for (int k = 0, l = this.buttonList.size(); k < l; ++k) { + +> CHANGE 3 : 4 @ 3 : 4 + +~ for (int l = 0, m = this.labelList.size(); l < m; ++l) { + +> INSERT 3 : 33 @ 3 + long millis = System.currentTimeMillis(); + long closeKeyTimeout = millis - showingCloseKey; @@ -108,7 +116,16 @@ ~ EagRuntime.setClipboard(copyText); -> CHANGE 68 : 71 @ 68 : 69 +> CHANGE 6 : 7 @ 6 : 7 + +~ for (int k = 0, l = list.size(); k < l; ++k) { + +> CHANGE 22 : 24 @ 22 : 24 + +~ for (int m = 0, n = list.size(); m < n; ++m) { +~ int l = this.fontRendererObj.getStringWidth(list.get(m)); + +> CHANGE 37 : 40 @ 37 : 38 ~ if (s1.length() > 0) { ~ this.fontRendererObj.drawStringWithShadow(s1, (float) j2, (float) k2, -1); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiScreenAddServer.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiScreenAddServer.edit.java index 560ab99..2b3c03f 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiScreenAddServer.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiScreenAddServer.edit.java @@ -62,7 +62,12 @@ ~ + I18n.format(this.serverData.hideAddress ? "gui.yes" : "gui.no", new Object[0]); ~ } else if (parGuiButton.id == 2) { -> CHANGE 8 : 10 @ 8 : 10 +> CHANGE 1 : 3 @ 1 : 3 + +~ ServerData.ServerResourceMode._VALUES[(this.serverData.getResourceMode().ordinal() + 1) +~ % ServerData.ServerResourceMode._VALUES.length]); + +> CHANGE 5 : 7 @ 5 : 7 ~ this.serverData.serverName = this.serverNameField.getText().trim(); ~ this.serverData.serverIP = this.serverIPField.getText().trim(); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiScreenCustomizePresets.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiScreenCustomizePresets.edit.java index 153cbac..f65476c 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiScreenCustomizePresets.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiScreenCustomizePresets.edit.java @@ -5,14 +5,12 @@ # Version: 1.0 # Author: lax1dude -> INSERT 5 : 9 @ 5 +> CHANGE 5 : 9 @ 5 : 11 -+ -+ import net.lax1dude.eaglercraft.v1_8.Keyboard; -+ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; -+ import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; - -> DELETE 5 @ 5 : 6 +~ +~ import net.lax1dude.eaglercraft.v1_8.Keyboard; +~ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +~ import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; > DELETE 1 @ 1 : 2 diff --git a/patches/minecraft/net/minecraft/client/gui/GuiScreenOptionsSounds.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiScreenOptionsSounds.edit.java index e926526..a934d7c 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiScreenOptionsSounds.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiScreenOptionsSounds.edit.java @@ -11,7 +11,13 @@ > DELETE 4 @ 4 : 7 -> CHANGE 37 : 38 @ 37 : 38 +> CHANGE 24 : 27 @ 24 : 25 + +~ SoundCategory[] cats = SoundCategory._VALUES; +~ for (int j = 0; j < cats.length; ++j) { +~ SoundCategory soundcategory = cats[j]; + +> CHANGE 12 : 13 @ 12 : 13 ~ protected void actionPerformed(GuiButton parGuiButton) { diff --git a/patches/minecraft/net/minecraft/client/gui/GuiScreenResourcePacks.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiScreenResourcePacks.edit.java index d504fa6..37a6e9b 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiScreenResourcePacks.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiScreenResourcePacks.edit.java @@ -5,51 +5,62 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 2 : 3 @ 2 : 4 - -~ import java.io.ByteArrayInputStream; +> DELETE 2 @ 2 : 4 > DELETE 1 @ 1 : 2 -> CHANGE 3 : 11 @ 3 : 8 +> CHANGE 3 : 12 @ 3 : 8 ~ ~ 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; > DELETE 5 @ 5 : 9 -> CHANGE 15 : 17 @ 15 : 16 +> CHANGE 24 : 25 @ 24 : 25 -~ GuiButton btn; -~ this.buttonList.add(btn = new GuiOptionButton(2, this.width / 2 - 154, this.height - 48, +~ List arraylist = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll()); -> INSERT 1 : 2 @ 1 +> CHANGE 2 : 5 @ 2 : 4 -+ btn.enabled = SYS.VFS != null; +~ for (int i = 0, l = arraylist.size(); i < l; ++i) { +~ this.availableResourcePacks +~ .add(new ResourcePackListEntryFound(this, (ResourcePackRepository.Entry) arraylist.get(i))); -> CHANGE 10 : 11 @ 10 : 11 +> CHANGE 2 : 6 @ 2 : 5 -~ for (ResourcePackRepository.Entry resourcepackrepository$entry : (List) arraylist) { +~ 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))); -> CHANGE 44 : 45 @ 44 : 45 +> CHANGE 38 : 39 @ 38 : 39 ~ protected void actionPerformed(GuiButton parGuiButton) { -> CHANGE 2 : 5 @ 2 : 39 +> CHANGE 2 : 3 @ 2 : 39 -~ if (SYS.VFS == null) -~ return; ~ EagRuntime.displayFileChooser("application/zip", "zip"); -> CHANGE 15 : 16 @ 15 : 16 +> CHANGE 2 : 3 @ 2 : 3 -~ for (ResourcePackRepository.Entry resourcepackrepository$entry : (List) arraylist) { +~ ArrayList arraylist = Lists.newArrayList(); + +> CHANGE 1 : 3 @ 1 : 2 + +~ for (int i = 0, l = this.selectedResourcePacks.size(); i < l; ++i) { +~ ResourcePackListEntry resourcepacklistentry = this.selectedResourcePacks.get(i); + +> CHANGE 10 : 12 @ 10 : 11 + +~ for (int i = 0, l = arraylist.size(); i < l; ++i) { +~ ResourcePackRepository.Entry resourcepackrepository$entry = arraylist.get(i); > INSERT 6 : 8 @ 6 @@ -58,22 +69,32 @@ > DELETE 3 @ 3 : 4 -> CHANGE 6 : 46 @ 6 : 7 +> CHANGE 6 : 57 @ 6 : 7 ~ public void updateScreen() { ~ FileChooserResult packFile = null; ~ 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 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()); ~ } @@ -84,7 +105,8 @@ ~ this.mc.gameSettings.resourcePacks.clear(); ~ this.mc.gameSettings.field_183018_l.clear(); ~ -~ for (ResourcePackRepository.Entry resourcepackrepository$entry : (List) 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()); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiSelectWorld.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiSelectWorld.edit.java index 86f4f99..039a01c 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiSelectWorld.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiSelectWorld.edit.java @@ -17,11 +17,11 @@ ~ import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenLANNotSupported; ~ import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; -> INSERT 1 : 2 @ 1 +> CHANGE 1 : 2 @ 1 : 9 -+ import net.minecraft.client.audio.PositionedSoundRecord; +~ import net.minecraft.client.audio.PositionedSoundRecord; -> INSERT 10 : 11 @ 10 +> INSERT 2 : 3 @ 2 + import net.minecraft.util.ResourceLocation; @@ -63,7 +63,7 @@ + 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)); @@ -112,7 +112,7 @@ > CHANGE 1 : 5 @ 1 : 7 ~ this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.deleting", -~ "singleplayer.failed.deleting", () -> SingleplayerServerController.isReady())); +~ "singleplayer.failed.deleting", SingleplayerServerController::isReady)); ~ } else { ~ this.mc.displayGuiScreen(this); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiVideoSettings.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiVideoSettings.edit.java index c001132..28eff5b 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiVideoSettings.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiVideoSettings.edit.java @@ -17,22 +17,10 @@ ~ GameSettings.Options.HUD_PLAYER, GameSettings.Options.HUD_STATS, GameSettings.Options.HUD_WORLD, ~ GameSettings.Options.HUD_24H, GameSettings.Options.CHUNK_FIX }; -> CHANGE 11 : 13 @ 11 : 14 +> CHANGE 11 : 13 @ 11 : 31 -~ GameSettings.Options[] agamesettings$options = new GameSettings.Options[videoOptions.length]; -~ int i = 0; - -> CHANGE 1 : 4 @ 1 : 15 - -~ for (GameSettings.Options gamesettings$options : videoOptions) { -~ agamesettings$options[i] = gamesettings$options; -~ ++i; - -> INSERT 2 : 5 @ 2 - -+ this.optionsRowList = new GuiOptionsRowList(this.mc, this.width, this.height, 32, this.height - 32, 25, -+ agamesettings$options); -+ +~ this.optionsRowList = new GuiOptionsRowList(this.mc, this.width, this.height, 32, this.height - 32, 25, +~ videoOptions); > CHANGE 7 : 8 @ 7 : 8 diff --git a/patches/minecraft/net/minecraft/client/gui/GuiYesNo.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiYesNo.edit.java index 90806fc..f2978a5 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiYesNo.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiYesNo.edit.java @@ -29,7 +29,22 @@ ~ this.drawDefaultBackground(); ~ } -> INSERT 29 : 34 @ 29 +> CHANGE 3 : 5 @ 3 : 5 + +~ 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); + +> CHANGE 9 : 11 @ 9 : 11 + +~ for (int l = 0, m = this.buttonList.size(); l < m; ++l) { +~ this.buttonList.get(l).enabled = false; + +> CHANGE 7 : 9 @ 7 : 9 + +~ for (int l = 0, m = this.buttonList.size(); l < m; ++l) { +~ this.buttonList.get(l).enabled = true; + +> INSERT 4 : 9 @ 4 + + public GuiYesNo withOpaqueBackground() { diff --git a/patches/minecraft/net/minecraft/client/gui/ScreenChatOptions.edit.java b/patches/minecraft/net/minecraft/client/gui/ScreenChatOptions.edit.java index 644d6a0..7a83650 100644 --- a/patches/minecraft/net/minecraft/client/gui/ScreenChatOptions.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/ScreenChatOptions.edit.java @@ -7,7 +7,12 @@ > DELETE 2 @ 2 : 7 -> CHANGE 39 : 40 @ 39 : 40 +> CHANGE 22 : 24 @ 22 : 23 + +~ for (int j = 0; j < field_146399_a.length; ++j) { +~ GameSettings.Options gamesettings$options = field_146399_a[j]; + +> CHANGE 16 : 17 @ 16 : 17 ~ protected void actionPerformed(GuiButton parGuiButton) { diff --git a/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.edit.java b/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.edit.java index c46844c..3692a79 100644 --- a/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.edit.java @@ -26,4 +26,14 @@ ~ protected void actionPerformed(GuiButton parGuiButton) { +> CHANGE 270 : 272 @ 270 : 271 + +~ for (int m = 0, l = StatList.objectMineStats.size(); m < l; ++m) { +~ StatCrafting statcrafting = StatList.objectMineStats.get(m); + +> CHANGE 133 : 135 @ 133 : 134 + +~ for (int m = 0, l = StatList.itemStats.size(); m < l; ++m) { +~ StatCrafting statcrafting = StatList.itemStats.get(m); + > EOF diff --git a/patches/minecraft/net/minecraft/client/gui/inventory/GuiBeacon.edit.java b/patches/minecraft/net/minecraft/client/gui/inventory/GuiBeacon.edit.java index 0495c4a..4d470aa 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiBeacon.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiBeacon.edit.java @@ -22,7 +22,12 @@ ~ protected void actionPerformed(GuiButton parGuiButton) { -> INSERT 116 : 118 @ 116 +> CHANGE 37 : 39 @ 37 : 38 + +~ for (int k = 0, l = this.buttonList.size(); k < l; ++k) { +~ GuiButton guibutton = this.buttonList.get(k); + +> INSERT 78 : 80 @ 78 + if (this.enabled) + Mouse.showCursor(EnumCursorType.HAND); diff --git a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.edit.java b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.edit.java index 18ebe39..484f4f5 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.edit.java @@ -5,15 +5,16 @@ # Version: 1.0 # Author: lax1dude -> DELETE 2 @ 2 : 4 +> CHANGE 2 : 3 @ 2 : 4 -> INSERT 1 : 9 @ 1 +~ import java.util.List; + +> INSERT 1 : 8 @ 1 + + 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; @@ -36,7 +37,13 @@ ~ protected void mouseClicked(int parInt1, int parInt2, int parInt3) { -> CHANGE 235 : 239 @ 235 : 237 +> CHANGE 126 : 129 @ 126 : 127 + +~ List lst = this.inventorySlots.inventorySlots; +~ for (int n = 0, m = lst.size(); n < m; ++n) { +~ Slot slot2 = lst.get(n); + +> CHANGE 108 : 112 @ 108 : 110 ~ protected void keyTyped(char parChar1, int parInt1) { ~ if (parInt1 == this.mc.gameSettings.keyBindClose.getKeyCode() diff --git a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.edit.java b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.edit.java index 0a0ce60..e7539fc 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.edit.java @@ -39,15 +39,48 @@ + } + -> CHANGE 49 : 50 @ 49 : 50 +> CHANGE 10 : 12 @ 10 : 11 + +~ for (int i = 0; i < Enchantment.enchantmentsBookList.length; ++i) { +~ Enchantment enchantment = Enchantment.enchantmentsBookList[i]; + +> CHANGE 12 : 15 @ 12 : 14 + +~ List 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)) { + +> CHANGE 24 : 25 @ 24 : 25 ~ protected void mouseClicked(int parInt1, int parInt2, int parInt3) { -> INSERT 149 : 150 @ 149 +> CHANGE 4 : 6 @ 4 : 6 -+ Mouse.showCursor(EnumCursorType.HAND); +~ for (int k = 0; k < CreativeTabs.creativeTabArray.length; ++k) { +~ if (this.func_147049_a(CreativeTabs.creativeTabArray[k], i, j)) { -> CHANGE 173 : 174 @ 173 : 174 +> CHANGE 13 : 15 @ 13 : 14 + +~ for (int m = 0; m < CreativeTabs.creativeTabArray.length; ++m) { +~ CreativeTabs creativetabs = CreativeTabs.creativeTabArray[m]; + +> CHANGE 127 : 130 @ 127 : 129 + +~ for (int m = 0; m < CreativeTabs.creativeTabArray.length; ++m) { +~ if (this.renderCreativeInventoryHoveringText(CreativeTabs.creativeTabArray[m], i, j)) { +~ Mouse.showCursor(EnumCursorType.HAND); + +> CHANGE 24 : 26 @ 24 : 25 + +~ for (int m = 0; m < CreativeTabs.creativeTabArray.length; ++m) { +~ CreativeTabs creativetabs1 = CreativeTabs.creativeTabArray[m]; + +> CHANGE 33 : 35 @ 33 : 34 + +~ for (int m = 0; m < CreativeTabs.creativeTabArray.length; ++m) { +~ CreativeTabs creativetabs1 = CreativeTabs.creativeTabArray[m]; + +> CHANGE 114 : 115 @ 114 : 115 ~ protected void actionPerformed(GuiButton parGuiButton) { diff --git a/patches/minecraft/net/minecraft/client/gui/spectator/PlayerMenuObject.edit.java b/patches/minecraft/net/minecraft/client/gui/spectator/PlayerMenuObject.edit.java index 47e27cc..e19ff03 100644 --- a/patches/minecraft/net/minecraft/client/gui/spectator/PlayerMenuObject.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/spectator/PlayerMenuObject.edit.java @@ -10,9 +10,13 @@ ~ import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; ~ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; -> DELETE 3 @ 3 : 6 +> DELETE 1 @ 1 : 2 -> DELETE 7 @ 7 : 8 +> DELETE 1 @ 1 : 4 + +> DELETE 3 @ 3 : 4 + +> DELETE 3 @ 3 : 4 > DELETE 3 @ 3 : 5 diff --git a/patches/minecraft/net/minecraft/client/gui/spectator/categories/TeleportToPlayer.edit.java b/patches/minecraft/net/minecraft/client/gui/spectator/categories/TeleportToPlayer.edit.java index d534384..93db571 100644 --- a/patches/minecraft/net/minecraft/client/gui/spectator/categories/TeleportToPlayer.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/spectator/categories/TeleportToPlayer.edit.java @@ -15,4 +15,10 @@ + import com.google.common.collect.Ordering; + +> CHANGE 29 : 32 @ 29 : 30 + +~ List lst = field_178674_a.sortedCopy(parCollection); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ NetworkPlayerInfo networkplayerinfo = lst.get(i); + > EOF diff --git a/patches/minecraft/net/minecraft/client/gui/spectator/categories/TeleportToTeam.edit.java b/patches/minecraft/net/minecraft/client/gui/spectator/categories/TeleportToTeam.edit.java index 67d9fce..353826b 100644 --- a/patches/minecraft/net/minecraft/client/gui/spectator/categories/TeleportToTeam.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/spectator/categories/TeleportToTeam.edit.java @@ -7,19 +7,24 @@ > DELETE 2 @ 2 : 3 -> CHANGE 1 : 6 @ 1 : 2 +> CHANGE 1 : 4 @ 1 : 2 -~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -~ ~ import com.google.common.collect.Lists; ~ ~ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; -> DELETE 8 @ 8 : 9 +> DELETE 1 @ 1 : 2 + +> DELETE 6 @ 6 : 7 > DELETE 1 @ 1 : 2 -> INSERT 66 : 70 @ 66 +> CHANGE 41 : 43 @ 41 : 43 + +~ for (int i = 0, l = this.field_178672_a.size(); i < l; ++i) { +~ if (this.field_178672_a.get(i).func_178662_A_()) { + +> INSERT 23 : 27 @ 23 + this.field_178677_c = DefaultPlayerSkin.getDefaultSkinLegacy(); + diff --git a/patches/minecraft/net/minecraft/client/main/Main.edit.java b/patches/minecraft/net/minecraft/client/main/Main.edit.java index 3844b68..47659e0 100644 --- a/patches/minecraft/net/minecraft/client/main/Main.edit.java +++ b/patches/minecraft/net/minecraft/client/main/Main.edit.java @@ -11,13 +11,10 @@ > DELETE 1 @ 1 : 2 -> CHANGE 3 : 4 @ 3 : 4 +> CHANGE 3 : 5 @ 3 : 100 ~ public static void appMain(String[] astring) { - -> DELETE 1 @ 1 : 45 - -> DELETE 1 @ 1 : 51 +~ System.setProperty("java.net.preferIPv6Addresses", "true"); > CHANGE 1 : 5 @ 1 : 12 diff --git a/patches/minecraft/net/minecraft/client/model/ModelGhast.edit.java b/patches/minecraft/net/minecraft/client/model/ModelGhast.edit.java index 4705674..5588df9 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelGhast.edit.java +++ b/patches/minecraft/net/minecraft/client/model/ModelGhast.edit.java @@ -15,4 +15,9 @@ ~ EaglercraftRandom random = new EaglercraftRandom(1660L); +> CHANGE 27 : 29 @ 27 : 29 + +~ for (int i = 0; i < this.tentacles.length; ++i) { +~ this.tentacles[i].render(f5); + > EOF diff --git a/patches/minecraft/net/minecraft/client/model/ModelSquid.edit.java b/patches/minecraft/net/minecraft/client/model/ModelSquid.edit.java index 8b7360a..31ce0cb 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelSquid.edit.java +++ b/patches/minecraft/net/minecraft/client/model/ModelSquid.edit.java @@ -7,4 +7,9 @@ > DELETE 2 @ 2 : 4 +> CHANGE 28 : 30 @ 28 : 30 + +~ for (int i = 0; i < this.squidTentacles.length; ++i) { +~ this.squidTentacles[i].rotateAngleX = f; + > EOF diff --git a/patches/minecraft/net/minecraft/client/model/ModelWither.edit.java b/patches/minecraft/net/minecraft/client/model/ModelWither.edit.java index 8b7360a..9d5baca 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelWither.edit.java +++ b/patches/minecraft/net/minecraft/client/model/ModelWither.edit.java @@ -7,4 +7,14 @@ > DELETE 2 @ 2 : 4 +> CHANGE 39 : 41 @ 39 : 41 + +~ for (int i = 0; i < this.field_82904_b.length; ++i) { +~ this.field_82904_b[i].render(f5); + +> CHANGE 2 : 4 @ 2 : 4 + +~ for (int i = 0; i < this.field_82905_a.length; ++i) { +~ this.field_82905_a[i].render(f5); + > EOF diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.edit.java b/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.edit.java index f090ce9..ef37860 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.edit.java +++ b/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.edit.java @@ -17,4 +17,9 @@ > DELETE 10 @ 10 : 12 +> CHANGE 50 : 52 @ 50 : 52 + +~ for (int j = 0, k = this.chunkListing.size(); j < k; ++j) { +~ this.chunkListing.get(j).func_150804_b(System.currentTimeMillis() - i > 5L); + > EOF diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ServerData.edit.java b/patches/minecraft/net/minecraft/client/multiplayer/ServerData.edit.java index a2cf524..6eaa72f 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ServerData.edit.java +++ b/patches/minecraft/net/minecraft/client/multiplayer/ServerData.edit.java @@ -79,7 +79,12 @@ ~ this.hideAddress = serverDataIn.hideAddress; -> INSERT 16 : 82 @ 16 +> INSERT 6 : 8 @ 6 + ++ public static final ServerResourceMode[] _VALUES = values(); ++ + +> INSERT 10 : 76 @ 10 + + public void setMOTDFromQuery(QueryResponse pkt) { diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ServerList.edit.java b/patches/minecraft/net/minecraft/client/multiplayer/ServerList.edit.java index 62673a0..1d6a6fc 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ServerList.edit.java +++ b/patches/minecraft/net/minecraft/client/multiplayer/ServerList.edit.java @@ -5,10 +5,7 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 2 : 4 @ 2 : 4 - -~ import java.io.ByteArrayOutputStream; -~ import java.util.Iterator; +> DELETE 2 @ 2 : 4 > INSERT 1 : 15 @ 1 @@ -17,6 +14,7 @@ + + 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; @@ -25,7 +23,6 @@ + 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; > CHANGE 1 : 2 @ 1 : 2 @@ -56,7 +53,14 @@ + } + -> CHANGE 2 : 9 @ 2 : 6 +> INSERT 1 : 5 @ 1 + ++ loadServerList(EagRuntime.getStorage("s")); ++ } ++ ++ public void loadServerList(byte[] localStorage) { + +> CHANGE 1 : 8 @ 1 : 5 ~ freeServerIcons(); ~ @@ -66,11 +70,7 @@ ~ dat.isDefault = true; ~ this.allServers.add(dat); -> CHANGE 2 : 3 @ 2 : 3 - -~ byte[] localStorage = EagRuntime.getStorage("s"); - -> CHANGE 1 : 14 @ 1 : 3 +> CHANGE 2 : 8 @ 2 : 3 ~ if (localStorage != null) { ~ NBTTagCompound nbttagcompound = CompressedStreamTools @@ -78,7 +78,9 @@ ~ if (nbttagcompound == null) { ~ return; ~ } -~ + +> CHANGE 1 : 7 @ 1 : 3 + ~ NBTTagList nbttaglist = nbttagcompound.getTagList("servers", 10); ~ ~ for (int i = 0; i < nbttaglist.tagCount(); ++i) { @@ -95,8 +97,20 @@ + } finally { + refreshServerPing(); -> CHANGE 9 : 12 @ 9 : 10 +> INSERT 5 : 12 @ 5 ++ byte[] data = writeServerList(); ++ if (data != null) { ++ EagRuntime.setStorage("s", data); ++ } ++ } ++ ++ public byte[] writeServerList() { + +> CHANGE 3 : 8 @ 3 : 5 + +~ for (int i = 0, l = this.servers.size(); i < l; ++i) { +~ ServerData serverdata = this.servers.get(i); ~ if (!serverdata.isDefault) { ~ nbttaglist.appendTag(serverdata.getNBTCompound()); ~ } @@ -104,12 +118,16 @@ > CHANGE 4 : 9 @ 4 : 5 ~ -~ ByteArrayOutputStream bao = new ByteArrayOutputStream(); +~ EaglerOutputStream bao = new EaglerOutputStream(); ~ CompressedStreamTools.writeCompressed(nbttagcompound, bao); -~ EagRuntime.setStorage("s", bao.toByteArray()); +~ return bao.toByteArray(); ~ -> CHANGE 11 : 16 @ 11 : 12 +> INSERT 2 : 3 @ 2 + ++ return null; + +> CHANGE 9 : 14 @ 9 : 10 ~ ServerData data = this.servers.remove(parInt1); ~ if (data != null && data.iconTextureObject != null) { @@ -134,7 +152,8 @@ + 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(); @@ -148,9 +167,8 @@ + + public void updateServerPing() { + int total = 0; -+ Iterator 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)) { diff --git a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.edit.java b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.edit.java index ace3b53..ffb4316 100644 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.edit.java +++ b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.edit.java @@ -9,7 +9,7 @@ > DELETE 4 @ 4 : 6 -> INSERT 1 : 18 @ 1 +> INSERT 1 : 19 @ 1 + + import net.lax1dude.eaglercraft.v1_8.EagRuntime; @@ -27,6 +27,7 @@ + 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; > DELETE 14 @ 14 : 16 @@ -39,7 +40,19 @@ > DELETE 2 @ 2 : 3 -> DELETE 78 @ 78 : 79 +> INSERT 36 : 37 @ 36 + ++ import net.minecraft.network.play.server.S20PacketEntityProperties.Snapshot; + +> INSERT 2 : 3 @ 2 + ++ import net.minecraft.network.play.server.S22PacketMultiBlockChange.BlockUpdateData; + +> INSERT 22 : 23 @ 22 + ++ import net.minecraft.network.play.server.S38PacketPlayerListItem.AddPlayerData; + +> DELETE 18 @ 18 : 19 > DELETE 32 @ 32 : 34 @@ -106,9 +119,13 @@ > DELETE 7 @ 7 : 8 -> DELETE 47 @ 47 : 49 +> CHANGE 47 : 50 @ 47 : 51 -> DELETE 9 @ 9 : 10 +~ BlockUpdateData[] dat = packetIn.getChangedBlocks(); +~ for (int i = 0; i < dat.length; ++i) { +~ BlockUpdateData s22packetmultiblockchange$blockupdatedata = dat[i]; + +> DELETE 7 @ 7 : 8 > DELETE 22 @ 22 : 23 @@ -218,9 +235,13 @@ > DELETE 36 @ 36 : 37 -> DELETE 8 @ 8 : 10 +> CHANGE 8 : 11 @ 8 : 11 -> CHANGE 2 : 5 @ 2 : 3 +~ List lst = packetIn.func_179767_a(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ S38PacketPlayerListItem.AddPlayerData s38packetplayerlistitem$addplayerdata = lst.get(i); + +> CHANGE 1 : 4 @ 1 : 2 ~ EaglercraftUUID uuid = s38packetplayerlistitem$addplayerdata.getProfile().getId(); ~ this.playerInfoMap.remove(uuid); @@ -232,8 +253,9 @@ > DELETE 9 @ 9 : 10 -> CHANGE 8 : 30 @ 8 : 31 +> CHANGE 7 : 30 @ 7 : 31 +~ if (!EaglerFolderResourcePack.isSupported() || s.startsWith("level://")) { ~ this.netManager ~ .sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.DECLINED)); ~ return; @@ -347,7 +369,13 @@ > DELETE 35 @ 35 : 36 -> CHANGE 29 : 30 @ 29 : 30 +> CHANGE 8 : 11 @ 8 : 9 + +~ List lst = packetIn.func_149441_d(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ S20PacketEntityProperties.Snapshot s20packetentityproperties$snapshot = lst.get(i); + +> CHANGE 20 : 21 @ 20 : 21 ~ public EaglercraftNetworkManager getNetworkManager() { diff --git a/patches/minecraft/net/minecraft/client/network/NetworkPlayerInfo.edit.java b/patches/minecraft/net/minecraft/client/network/NetworkPlayerInfo.edit.java index 8f1519e..ef7c3f7 100644 --- a/patches/minecraft/net/minecraft/client/network/NetworkPlayerInfo.edit.java +++ b/patches/minecraft/net/minecraft/client/network/NetworkPlayerInfo.edit.java @@ -5,13 +5,11 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 3 : 6 @ 3 : 6 +> CHANGE 2 : 3 @ 2 : 6 -~ ~ import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; -~ import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; -> DELETE 2 @ 2 : 3 +> DELETE 1 @ 1 : 3 > DELETE 10 @ 10 : 13 diff --git a/patches/minecraft/net/minecraft/client/particle/EffectRenderer.edit.java b/patches/minecraft/net/minecraft/client/particle/EffectRenderer.edit.java index 6887620..c81df64 100644 --- a/patches/minecraft/net/minecraft/client/particle/EffectRenderer.edit.java +++ b/patches/minecraft/net/minecraft/client/particle/EffectRenderer.edit.java @@ -46,7 +46,12 @@ + public IAcceleratedParticleEngine acceleratedParticleRenderer = vanillaAcceleratedParticleRenderer; + -> CHANGE 157 : 167 @ 157 : 158 +> CHANGE 104 : 106 @ 104 : 105 + +~ for (int i = 0, l = this.particleEmitters.size(); i < l; ++i) { +~ EntityParticleEmitter entityparticleemitter = this.particleEmitters.get(i); + +> CHANGE 52 : 62 @ 52 : 53 ~ public boolean hasParticlesInAlphaLayer() { ~ for (int i = 0; i < 3; ++i) { diff --git a/patches/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.edit.java b/patches/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.edit.java index 40f7b53..2143df2 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/ActiveRenderInfo.edit.java @@ -5,12 +5,8 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 2 : 8 @ 2 : 4 +> CHANGE 2 : 4 @ 2 : 4 -~ 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; diff --git a/patches/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.edit.java b/patches/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.edit.java index 2c8686b..fa604c3 100644 --- a/patches/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/BlockFluidRenderer.edit.java @@ -15,11 +15,7 @@ > DELETE 4 @ 4 : 6 -> INSERT 1 : 2 @ 1 - -+ import net.minecraft.init.Blocks; - -> CHANGE 6 : 8 @ 6 : 8 +> CHANGE 7 : 9 @ 7 : 9 ~ private EaglerTextureAtlasSprite[] atlasSpritesLava = new EaglerTextureAtlasSprite[2]; ~ private EaglerTextureAtlasSprite[] atlasSpritesWater = new EaglerTextureAtlasSprite[2]; diff --git a/patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.edit.java b/patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.edit.java index 8027e79..c51f2e5 100644 --- a/patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/BlockModelRenderer.edit.java @@ -15,19 +15,32 @@ > DELETE 3 @ 3 : 7 -> INSERT 72 : 73 @ 72 +> CHANGE 44 : 45 @ 44 : 45 + +~ float[] afloat = new float[EnumFacing._VALUES.length * 2]; + +> CHANGE 3 : 6 @ 3 : 4 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> INSERT 23 : 24 @ 23 + boolean isDeferred = DeferredStateManager.isDeferredRenderer(); > INSERT 1 : 2 @ 1 -+ float[] afloat = isDeferred ? new float[EnumFacing.values().length * 2] : null; ++ float[] afloat = isDeferred ? new float[EnumFacing._VALUES.length * 2] : null; -> INSERT 2 : 3 @ 2 +> CHANGE 2 : 6 @ 2 : 3 -+ BlockPos.MutableBlockPos pointer = new BlockPos.MutableBlockPos(); +~ BlockPos.MutableBlockPos pointer = new BlockPos.MutableBlockPos(); +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int m = 0; m < facings.length; ++m) { +~ EnumFacing enumfacing = facings[m]; -> CHANGE 3 : 4 @ 3 : 4 +> CHANGE 2 : 3 @ 2 : 3 ~ BlockPos blockpos = blockPosIn.offsetEvenFaster(enumfacing, pointer); @@ -47,8 +60,10 @@ ~ if (!isDeferred && block$enumoffsettype == Block.EnumOffsetType.XYZ) { -> CHANGE 5 : 7 @ 5 : 6 +> CHANGE 4 : 8 @ 4 : 6 +~ 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); @@ -67,7 +82,16 @@ ~ float f7 = Float.intBitsToFloat(vertexData[j + 1]); ~ float f8 = Float.intBitsToFloat(vertexData[j + 2]); -> INSERT 53 : 60 @ 53 +> CHANGE 15 : 21 @ 15 : 21 + +~ 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; + +> INSERT 32 : 39 @ 32 + private final BlockPos blockpos0 = new BlockPos(0, 0, 0); + private final BlockPos blockpos1 = new BlockPos(0, 0, 0); @@ -86,13 +110,15 @@ ~ if (!isDeferred && block$enumoffsettype == Block.EnumOffsetType.XYZ) { -> INSERT 5 : 10 @ 5 +> CHANGE 4 : 11 @ 4 : 5 -+ EnumFacing facingIn = bakedquad.getFace(); -+ int[] vertData = isDeferred ? bakedquad.getVertexDataWithNormals() : bakedquad.getVertexData(); -+ blockPosIn.offsetEvenFaster(facingIn, blockpos0); -+ this.fillQuadBounds(blockIn, vertData, facingIn, quadBounds, boundsFlags, isDeferred ? 8 : 7); -+ boolean boundsFlags0 = boundsFlags.get(0); +~ 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); +~ this.fillQuadBounds(blockIn, vertData, facingIn, quadBounds, boundsFlags, isDeferred ? 8 : 7); +~ boolean boundsFlags0 = boundsFlags.get(0); > CHANGE 1 : 2 @ 1 : 5 @@ -217,7 +243,18 @@ + } + -> CHANGE 45 : 47 @ 45 : 46 +> CHANGE 2 : 5 @ 2 : 3 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> CHANGE 32 : 34 @ 32 : 33 + +~ for (int i = 0, l = parList.size(); i < l; ++i) { +~ BakedQuad bakedquad = parList.get(i); + +> CHANGE 9 : 11 @ 9 : 10 ~ worldrenderer.putNormal((float) vec3i.getX(), (float) vec3i.getY(), (float) vec3i.getZ(), ~ VertexMarkerState.markId); @@ -343,4 +380,8 @@ ~ + (float) (parInt3 & 255) * parFloat3 + (float) (parInt4 & 255) * parFloat4) & 255; ~ return i << 16 | j; +> CHANGE 140 : 141 @ 140 : 141 + +~ this.field_178229_m = parEnumFacing.getIndex() + (parFlag ? EnumFacing._VALUES.length : 0); + > EOF diff --git a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.edit.java b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.edit.java index 8130e6f..065a909 100644 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.edit.java @@ -333,12 +333,15 @@ ~ GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true), -> INSERT 8 : 10 @ 8 +> CHANGE 55 : 60 @ 55 : 58 -+ if (DeferredStateManager.isDeferredRenderer()) -+ return; +~ 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]); +~ } -> INSERT 70 : 71 @ 70 +> INSERT 20 : 21 @ 20 + boolean df = DeferredStateManager.isInDeferredPass(); diff --git a/patches/minecraft/net/minecraft/client/renderer/RegionRenderCacheBuilder.edit.java b/patches/minecraft/net/minecraft/client/renderer/RegionRenderCacheBuilder.edit.java index f779f89..9ce878c 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RegionRenderCacheBuilder.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/RegionRenderCacheBuilder.edit.java @@ -9,7 +9,11 @@ ~ import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; -> INSERT 10 : 12 @ 10 +> CHANGE 3 : 4 @ 3 : 4 + +~ private final WorldRenderer[] worldRenderers = new WorldRenderer[EnumWorldBlockLayer._VALUES.length]; + +> INSERT 6 : 8 @ 6 + this.worldRenderers[EnumWorldBlockLayer.REALISTIC_WATER.ordinal()] = new WorldRenderer(262145); + this.worldRenderers[EnumWorldBlockLayer.GLASS_HIGHLIGHTS.ordinal()] = new WorldRenderer(131072); diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.edit.java b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.edit.java index 519d9b7..2ed0af3 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.edit.java @@ -222,17 +222,31 @@ > DELETE 2 @ 2 : 16 -> INSERT 24 : 27 @ 24 +> CHANGE 4 : 7 @ 4 : 5 + +~ label738: for (int ii = 0, ll = this.renderInfos.size(); ii < ll; ++ii) { +~ RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = this.renderInfos +~ .get(ii); + +> INSERT 19 : 22 @ 19 + if (light) { + entity2.renderDynamicLightsEagler(partialTicks, flag2); + } -> CHANGE 31 : 32 @ 31 : 32 +> CHANGE 27 : 30 @ 27 : 28 -~ for (TileEntity tileentity2 : (List) list1) { +~ for (int ii = 0, ll = this.renderInfos.size(); ii < ll; ++ii) { +~ RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 = this.renderInfos +~ .get(ii); -> INSERT 41 : 200 @ 41 +> CHANGE 3 : 6 @ 3 : 5 + +~ for (int m = 0, n = list1.size(); m < n; ++m) { +~ TileEntityRendererDispatcher.instance.renderTileEntity((TileEntity) list1.get(m), partialTicks, +~ -1); + +> INSERT 40 : 199 @ 40 + public static interface EntityChunkCullAdapter { + boolean shouldCull(RenderChunk renderChunk); @@ -394,19 +408,35 @@ + } + -> CHANGE 11 : 12 @ 11 : 12 +> CHANGE 4 : 7 @ 4 : 5 + +~ for (int ii = 0, ll = this.renderInfos.size(); ii < ll; ++ii) { +~ RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = this.renderInfos +~ .get(ii); + +> CHANGE 6 : 7 @ 6 : 7 ~ return HString.format("C: %d/%d %sD: %d, %s", -> DELETE 115 @ 115 : 116 +> CHANGE 115 : 118 @ 115 : 117 -> CHANGE 2 : 3 @ 2 : 3 +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing1 = facings[i]; + +> CHANGE 1 : 2 @ 1 : 2 ~ if ((!flag1 || !renderglobal$containerlocalrenderinformation1.setFacing // TODO: > DELETE 22 @ 22 : 23 -> CHANGE 7 : 9 @ 7 : 8 +> CHANGE 3 : 6 @ 3 : 4 + +~ for (int ii = 0, ll = this.renderInfos.size(); ii < ll; ++ii) { +~ RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation2 = this.renderInfos +~ .get(ii); + +> CHANGE 3 : 5 @ 3 : 4 ~ if (this.mc.gameSettings.chunkFix ? this.isPositionInRenderChunkHack(blockpos1, renderchunk4) ~ : this.isPositionInRenderChunk(blockpos, renderchunk4)) { @@ -428,7 +458,13 @@ + ((ClippingHelperImpl) this.debugFixedClippingHelper).destroy(); -> INSERT 92 : 129 @ 92 +> CHANGE 58 : 61 @ 58 : 59 + +~ for (int ii = 0, ll = this.renderInfos.size(); ii < ll; ++ii) { +~ RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = this.renderInfos +~ .get(ii); + +> INSERT 33 : 70 @ 33 + public static interface ChunkCullAdapter { + boolean shouldCull(RenderChunk chunk); @@ -576,7 +612,7 @@ ~ EaglercraftRandom random = this.theWorld.rand; -> INSERT 229 : 246 @ 229 +> INSERT 229 : 248 @ 229 + + public String getDebugInfoShort() { @@ -584,7 +620,9 @@ + 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; diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderList.edit.java b/patches/minecraft/net/minecraft/client/renderer/RenderList.edit.java index 04ed5dd..d562edd 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderList.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/RenderList.edit.java @@ -10,11 +10,18 @@ ~ import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; ~ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; -> DELETE 3 @ 3 : 4 +> DELETE 1 @ 1 : 2 -> CHANGE 7 : 9 @ 7 : 9 +> DELETE 1 @ 1 : 2 -~ this.preRenderChunk(renderchunk, enumworldblocklayer); +> CHANGE 4 : 6 @ 4 : 6 + +~ for (int i = 0, l = this.renderChunks.size(); i < l; ++i) { +~ ListedRenderChunk listedrenderchunk = (ListedRenderChunk) this.renderChunks.get(i); + +> CHANGE 1 : 3 @ 1 : 3 + +~ this.preRenderChunk(listedrenderchunk, enumworldblocklayer); ~ EaglercraftGPU.glCallList( > EOF diff --git a/patches/minecraft/net/minecraft/client/renderer/ViewFrustum.edit.java b/patches/minecraft/net/minecraft/client/renderer/ViewFrustum.edit.java index ad2d1ab..4cf8796 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ViewFrustum.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/ViewFrustum.edit.java @@ -7,4 +7,9 @@ > DELETE 2 @ 2 : 3 +> CHANGE 41 : 43 @ 41 : 43 + +~ for (int i = 0; i < this.renderChunks.length; ++i) { +~ renderChunks[i].deleteGlResources(); + > EOF diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/BreakingFour.edit.java b/patches/minecraft/net/minecraft/client/renderer/block/model/BreakingFour.edit.java index 5ed9779..4e45d24 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/BreakingFour.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/BreakingFour.edit.java @@ -7,10 +7,9 @@ > DELETE 3 @ 3 : 6 -> INSERT 1 : 4 @ 1 +> INSERT 1 : 3 @ 1 + import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite; -+ import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager; + > CHANGE 1 : 2 @ 1 : 2 diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.edit.java b/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.edit.java index 496f4db..888bd90 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.edit.java @@ -61,7 +61,11 @@ ~ parFlag2, calcNormal); -> CHANGE 40 : 42 @ 40 : 42 +> CHANGE 29 : 30 @ 29 : 30 + +~ float[] afloat = new float[EnumFacing._VALUES.length]; + +> CHANGE 10 : 12 @ 10 : 12 ~ float[] sprite, EaglerTextureAtlasSprite modelRotationIn, ModelRotation partRotation, ~ BlockPartRotation uvLocked, boolean shade, boolean parFlag2, Vector3f calcNormal) { @@ -117,7 +121,13 @@ + + public static EnumFacing getFacingFromVertexData(Vector3f normal) { -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 3 : 6 @ 3 : 4 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing1 = facings[i]; + +> CHANGE 2 : 3 @ 2 : 3 ~ float f2 = Vector3f.dot(normal, vector3f6); @@ -125,7 +135,11 @@ ~ EaglerTextureAtlasSprite parTextureAtlasSprite) { -> CHANGE 18 : 19 @ 18 : 19 +> CHANGE 9 : 10 @ 9 : 10 + +~ float[] afloat = new float[EnumFacing._VALUES.length]; + +> CHANGE 8 : 9 @ 8 : 9 ~ int j = stride * i; diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemModelGenerator.edit.java b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemModelGenerator.edit.java index e1390cf..76879ce 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemModelGenerator.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemModelGenerator.edit.java @@ -33,8 +33,19 @@ ~ private List func_178397_a(EaglerTextureAtlasSprite parTextureAtlasSprite, String parString1, ~ int parInt1) { -> CHANGE 102 : 103 @ 102 : 103 +> CHANGE 4 : 7 @ 4 : 5 + +~ List lst = this.func_178393_a(parTextureAtlasSprite); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ ItemModelGenerator.Span itemmodelgenerator$span = lst.get(i); + +> CHANGE 97 : 98 @ 97 : 98 ~ private List func_178393_a(EaglerTextureAtlasSprite parTextureAtlasSprite) { +> CHANGE 35 : 37 @ 35 : 36 + +~ for (int j = 0, l = parList.size(); j < l; ++j) { +~ ItemModelGenerator.Span itemmodelgenerator$span1 = parList.get(j); + > EOF diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlock.edit.java b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlock.edit.java index fb1098e..aef6252 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlock.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlock.edit.java @@ -5,11 +5,9 @@ # Version: 1.0 # Author: lax1dude -> DELETE 2 @ 2 : 11 +> DELETE 2 @ 2 : 14 -> CHANGE 9 : 10 @ 9 : 16 - -~ +> DELETE 5 @ 5 : 13 > CHANGE 1 : 3 @ 1 : 3 diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.edit.java b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.edit.java index 91a5430..26e1d52 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.edit.java @@ -7,18 +7,19 @@ > DELETE 2 @ 2 : 11 -> INSERT 7 : 17 @ 7 +> DELETE 1 @ 1 : 2 -+ -+ import org.json.JSONArray; -+ import org.json.JSONException; -+ import org.json.JSONObject; -+ -+ import com.google.common.collect.Lists; -+ import com.google.common.collect.Maps; -+ -+ import net.lax1dude.eaglercraft.v1_8.json.JSONTypeDeserializer; -+ import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider; +> CHANGE 4 : 13 @ 4 : 5 + +~ import org.json.JSONArray; +~ import org.json.JSONException; +~ import org.json.JSONObject; +~ +~ import com.google.common.collect.Lists; +~ import com.google.common.collect.Maps; +~ +~ import net.lax1dude.eaglercraft.v1_8.json.JSONTypeDeserializer; +~ import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider; > DELETE 1 @ 1 : 2 @@ -30,7 +31,12 @@ ~ return (ModelBlockDefinition) JSONTypeProvider.deserialize(parReader, ModelBlockDefinition.class); -> CHANGE 41 : 45 @ 41 : 47 +> CHANGE 10 : 12 @ 10 : 12 + +~ for (int i = 0, l = parList.size(); i < l; ++i) { +~ this.mapVariants.putAll(parList.get(i).mapVariants); + +> CHANGE 29 : 33 @ 29 : 35 ~ public static class Deserializer implements JSONTypeDeserializer { ~ public ModelBlockDefinition deserialize(JSONObject jsonobject) throws JSONException { diff --git a/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator.edit.java b/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator.edit.java index b4ffa62..e967705 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator.edit.java @@ -43,8 +43,8 @@ > CHANGE 1 : 3 @ 1 : 9 -~ for (Runnable runnable : this.listFinishRunnables) { -~ runnable.run(); +~ for (int i = 0, l = this.listFinishRunnables.size(); i < l; ++i) { +~ this.listFinishRunnables.get(i).run(); > DELETE 1 @ 1 : 2 diff --git a/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderWorker.edit.java b/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderWorker.edit.java index 88dc090..af49778 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderWorker.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderWorker.edit.java @@ -69,8 +69,11 @@ > DELETE 1 @ 1 : 2 -> CHANGE 2 : 4 @ 2 : 4 +> CHANGE 1 : 6 @ 1 : 4 +~ EnumWorldBlockLayer[] layers = EnumWorldBlockLayer._VALUES; +~ for (int i = 0; i < layers.length; ++i) { +~ EnumWorldBlockLayer enumworldblocklayer = layers[i]; ~ if (!compiledchunk.isLayerEmpty(enumworldblocklayer)) { ~ this.chunkRenderDispatcher.uploadChunk(enumworldblocklayer, diff --git a/patches/minecraft/net/minecraft/client/renderer/chunk/CompiledChunk.edit.java b/patches/minecraft/net/minecraft/client/renderer/chunk/CompiledChunk.edit.java index f5ab865..2b8e2ee 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/CompiledChunk.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/CompiledChunk.edit.java @@ -18,7 +18,12 @@ ~ return true; -> INSERT 8 : 9 @ 8 +> CHANGE 2 : 4 @ 2 : 4 + +~ private final boolean[] layersUsed = new boolean[EnumWorldBlockLayer._VALUES.length]; +~ private final boolean[] layersStarted = new boolean[EnumWorldBlockLayer._VALUES.length]; + +> INSERT 4 : 5 @ 4 + private WorldRenderer.State stateWater; diff --git a/patches/minecraft/net/minecraft/client/renderer/chunk/ListedRenderChunk.edit.java b/patches/minecraft/net/minecraft/client/renderer/chunk/ListedRenderChunk.edit.java index 5186178..284570f 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/ListedRenderChunk.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/ListedRenderChunk.edit.java @@ -17,7 +17,7 @@ > INSERT 3 : 7 @ 3 -+ 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(); + } @@ -37,7 +37,7 @@ + + 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]); diff --git a/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.edit.java b/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.edit.java index dbc52ce..44bb643 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.edit.java @@ -5,9 +5,7 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 2 : 3 @ 2 : 5 - -~ import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer; +> DELETE 2 @ 2 : 5 > CHANGE 3 : 11 @ 3 : 4 @@ -52,7 +50,13 @@ > DELETE 11 @ 11 : 15 -> INSERT 24 : 33 @ 24 +> CHANGE 5 : 8 @ 5 : 7 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ this.field_181702_p.put(facings[i], pos.offset(facings[i], 16)); + +> INSERT 17 : 26 @ 17 + if (DeferredStateManager.isRenderingRealisticWater() && compiledchunk.getStateRealisticWater() != null + && !compiledchunk.isLayerEmpty(EnumWorldBlockLayer.REALISTIC_WATER)) { @@ -77,7 +81,11 @@ + generator.setCompiledChunk(compiledchunk); + -> CHANGE 7 : 9 @ 7 : 9 +> CHANGE 4 : 5 @ 4 : 5 + +~ boolean[] aboolean = new boolean[EnumWorldBlockLayer._VALUES.length]; + +> CHANGE 2 : 4 @ 2 : 4 ~ for (BlockPos blockpos$mutableblockpos : BlockPos.getAllInBox(blockpos, blockpos1)) { ~ IBlockState iblockstate = regionrendercache.getBlockStateFaster(blockpos$mutableblockpos); @@ -102,7 +110,13 @@ + blockpos$mutableblockpos, regionrendercache, worldrenderer); + } -> DELETE 17 @ 17 : 18 +> CHANGE 3 : 6 @ 3 : 4 + +~ EnumWorldBlockLayer[] layers = EnumWorldBlockLayer._VALUES; +~ for (int i = 0; i < layers.length; ++i) { +~ EnumWorldBlockLayer enumworldblocklayer = layers[i]; + +> DELETE 13 @ 13 : 14 > CHANGE 1 : 8 @ 1 : 12 diff --git a/patches/minecraft/net/minecraft/client/renderer/chunk/SetVisibility.edit.java b/patches/minecraft/net/minecraft/client/renderer/chunk/SetVisibility.edit.java index 1307512..278b1cb 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/SetVisibility.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/SetVisibility.edit.java @@ -9,4 +9,35 @@ + +> CHANGE 3 : 4 @ 3 : 4 + +~ private static final int COUNT_FACES = EnumFacing._VALUES.length; + +> CHANGE 7 : 11 @ 7 : 10 + +~ 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); + +> CHANGE 22 : 25 @ 22 : 24 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ stringbuilder.append(' ').append(facings[i].toString().toUpperCase().charAt(0)); + +> CHANGE 4 : 6 @ 4 : 5 + +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing2 = facings[i]; + +> CHANGE 2 : 4 @ 2 : 4 + +~ for (int j = 0; j < facings.length; ++j) { +~ if (enumfacing2 == facings[j]) { + +> CHANGE 2 : 3 @ 2 : 3 + +~ boolean flag = this.isVisible(enumfacing2, facings[j]); + > EOF diff --git a/patches/minecraft/net/minecraft/client/renderer/chunk/VisGraph.edit.java b/patches/minecraft/net/minecraft/client/renderer/chunk/VisGraph.edit.java index e9566b3..1fd523b 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/VisGraph.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/VisGraph.edit.java @@ -13,4 +13,16 @@ ~ import com.google.common.collect.Lists; ~ +> CHANGE 32 : 35 @ 32 : 35 + +~ 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])); + +> CHANGE 21 : 24 @ 21 : 22 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int k = 0; k < facings.length; ++k) { +~ EnumFacing enumfacing = facings[k]; + > EOF diff --git a/patches/minecraft/net/minecraft/client/renderer/culling/ClippingHelperImpl.edit.java b/patches/minecraft/net/minecraft/client/renderer/culling/ClippingHelperImpl.edit.java index 3edd1ee..302c7d4 100644 --- a/patches/minecraft/net/minecraft/client/renderer/culling/ClippingHelperImpl.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/culling/ClippingHelperImpl.edit.java @@ -5,15 +5,10 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 2 : 6 @ 2 : 3 +> CHANGE 2 : 3 @ 2 : 6 -~ import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer; -~ -~ import net.lax1dude.eaglercraft.v1_8.EagRuntime; ~ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; -> DELETE 1 @ 1 : 3 - > DELETE 4 @ 4 : 7 > INSERT 3 : 4 @ 3 diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderCreeper.edit.java b/patches/minecraft/net/minecraft/client/renderer/entity/RenderCreeper.edit.java index 02f1deb..a2070f3 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderCreeper.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderCreeper.edit.java @@ -5,19 +5,14 @@ # Version: 1.0 # Author: lax1dude -> INSERT 2 : 5 @ 2 +> INSERT 2 : 4 @ 2 + 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; > DELETE 1 @ 1 : 4 -> INSERT 1 : 2 @ 1 - -+ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; - -> INSERT 34 : 46 @ 34 +> INSERT 35 : 47 @ 35 + public void doRender(EntityCreeper entitycreeper, double d0, double d1, double d2, float f, float f1) { + float ff = entitycreeper.getCreeperFlashIntensity(f); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.edit.java b/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.edit.java index c9ee7e3..daffe3b 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.edit.java @@ -5,13 +5,12 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 2 : 7 @ 2 : 4 +> CHANGE 2 : 6 @ 2 : 4 ~ 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; > DELETE 1 @ 1 : 4 diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.edit.java b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.edit.java index b9e2c9b..fa0e250 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.edit.java @@ -5,7 +5,7 @@ # Version: 1.0 # Author: lax1dude -> INSERT 4 : 12 @ 4 +> INSERT 4 : 11 @ 4 + + import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; @@ -13,7 +13,6 @@ + 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; > DELETE 21 @ 21 : 22 @@ -28,7 +27,13 @@ + import net.minecraft.util.EnumWorldBlockLayer; -> INSERT 63 : 67 @ 63 +> CHANGE 55 : 58 @ 55 : 56 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> INSERT 7 : 11 @ 7 + public static float renderPosX = 0.0f; + public static float renderPosY = 0.0f; diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderLightningBolt.edit.java b/patches/minecraft/net/minecraft/client/renderer/entity/RenderLightningBolt.edit.java index 315d8a2..0476812 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderLightningBolt.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderLightningBolt.edit.java @@ -5,14 +5,13 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 2 : 9 @ 2 : 4 +> CHANGE 2 : 8 @ 2 : 4 ~ 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; > DELETE 1 @ 1 : 4 diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.edit.java b/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.edit.java index 4276a39..300aeeb 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.edit.java @@ -137,7 +137,12 @@ ~ public void renderLivingAt(T entityLivingBaseIn, double x, double y, double z) { -> INSERT 66 : 70 @ 66 +> CHANGE 35 : 37 @ 35 : 36 + +~ for (int i = 0, l = this.layerRenderers.size(); i < l; ++i) { +~ LayerRenderer layerrenderer = this.layerRenderers.get(i); + +> INSERT 30 : 34 @ 30 + if (DeferredStateManager.isInDeferredPass()) { + NameTagRenderer.renderNameTag(entitylivingbase, null, d0, d1, d2, -69); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArrow.edit.java b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArrow.edit.java index d666ee2..93f3957 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArrow.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArrow.edit.java @@ -11,9 +11,9 @@ ~ ~ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; -> DELETE 2 @ 2 : 3 +> DELETE 2 @ 2 : 4 -> DELETE 2 @ 2 : 3 +> DELETE 1 @ 1 : 2 > CHANGE 17 : 19 @ 17 : 19 diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerCreeperCharge.edit.java b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerCreeperCharge.edit.java index 11c9545..3e6bea4 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerCreeperCharge.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerCreeperCharge.edit.java @@ -16,9 +16,7 @@ ~ import net.minecraft.client.renderer.EntityRenderer; -> CHANGE 1 : 2 @ 1 : 2 - -~ import net.minecraft.client.renderer.entity.RendererLivingEntity; +> DELETE 1 @ 1 : 2 > INSERT 16 : 67 @ 16 diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerSheepWool.edit.java b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerSheepWool.edit.java index a3d2bdc..6547a5e 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerSheepWool.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerSheepWool.edit.java @@ -13,4 +13,8 @@ > DELETE 1 @ 1 : 2 +> CHANGE 20 : 21 @ 20 : 21 + +~ int j = EnumDyeColor.META_LOOKUP.length; + > EOF diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerSlimeGel.edit.java b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerSlimeGel.edit.java index 0a95cd3..2014bb5 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerSlimeGel.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerSlimeGel.edit.java @@ -17,15 +17,9 @@ ~ import net.minecraft.client.renderer.EntityRenderer; ~ import net.minecraft.client.renderer.entity.RenderManager; -> CHANGE 1 : 2 @ 1 : 2 +> DELETE 1 @ 1 : 2 -~ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; - -> INSERT 1 : 2 @ 1 - -+ import net.minecraft.util.MathHelper; - -> INSERT 11 : 44 @ 11 +> INSERT 12 : 45 @ 12 + if (DeferredStateManager.isInDeferredPass()) { + if (DeferredStateManager.forwardCallbackHandler != null) { diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/LayeredTexture.edit.java b/patches/minecraft/net/minecraft/client/renderer/texture/LayeredTexture.edit.java index 78e673c..9dd3f54 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/LayeredTexture.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/texture/LayeredTexture.edit.java @@ -22,7 +22,12 @@ ~ ImageData bufferedimage = null; -> CHANGE 5 : 6 @ 5 : 6 +> CHANGE 2 : 4 @ 2 : 3 + +~ for (int i = 0, l = this.layeredTextureNames.size(); i < l; ++i) { +~ String s = this.layeredTextureNames.get(i); + +> CHANGE 2 : 3 @ 2 : 3 ~ ImageData bufferedimage1 = TextureUtil.readBufferedImage(inputstream); diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.edit.java b/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.edit.java index ce2273e..6ccfdfe 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.edit.java @@ -23,17 +23,33 @@ ~ public void addSprite(EaglerTextureAtlasSprite parTextureAtlasSprite) { -> CHANGE 15 : 16 @ 15 : 16 +> CHANGE 13 : 15 @ 13 : 14 + +~ for (int i = 0; i < astitcher$holder.length; ++i) { +~ Stitcher.Holder stitcher$holder = astitcher$holder[i]; + +> CHANGE 1 : 2 @ 1 : 2 ~ String s = HString.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution resourcepack?", -> CHANGE 14 : 15 @ 14 : 15 +> CHANGE 14 : 16 @ 14 : 16 ~ public List getStichSlots() { +~ ArrayList arraylist = Lists.newArrayList(); -> CHANGE 8 : 9 @ 8 : 9 +> CHANGE 1 : 3 @ 1 : 3 -~ for (Stitcher.Slot stitcher$slot1 : (List) arraylist) { +~ for (int i = 0, l = this.stitchSlots.size(); i < l; ++i) { +~ this.stitchSlots.get(i).getAllStitchSlots(arraylist); + +> CHANGE 2 : 3 @ 2 : 3 + +~ ArrayList arraylist1 = Lists.newArrayList(); + +> CHANGE 1 : 3 @ 1 : 2 + +~ for (int i = 0, l = arraylist.size(); i < l; ++i) { +~ Stitcher.Slot stitcher$slot1 = arraylist.get(i); > CHANGE 1 : 2 @ 1 : 2 @@ -51,4 +67,14 @@ ~ public EaglerTextureAtlasSprite getAtlasSprite() { +> CHANGE 117 : 119 @ 117 : 119 + +~ for (int m = 0, n = this.subSlots.size(); m < n; ++m) { +~ if (this.subSlots.get(m).addSlot(holderIn)) { + +> CHANGE 16 : 18 @ 16 : 18 + +~ for (int i = 0, l = this.subSlots.size(); i < l; ++i) { +~ this.subSlots.get(i).getAllStitchSlots(parList); + > EOF diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.edit.java b/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.edit.java index ecbd47e..587ce9e 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.edit.java @@ -82,7 +82,12 @@ ~ HString.format("dynamic/%s_%d", new Object[] { name, integer })); -> CHANGE 12 : 13 @ 12 : 13 +> CHANGE 5 : 7 @ 5 : 7 + +~ for (int i = 0, l = this.listTickables.size(); i < l; ++i) { +~ this.listTickables.get(i).tick(); + +> CHANGE 5 : 6 @ 5 : 6 ~ ITextureObject itextureobject = this.mapTextureObjects.remove(textureLocation); diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.edit.java b/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.edit.java index 72669c1..a3ebc43 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.edit.java @@ -322,13 +322,14 @@ + _wglBindFramebuffer(_GL_FRAMEBUFFER, null); + -> CHANGE 2 : 7 @ 2 : 3 +> CHANGE 2 : 8 @ 2 : 3 ~ width = stitcher.getCurrentWidth(); ~ height = stitcher.getCurrentHeight(); ~ ~ List spriteList = stitcher.getStichSlots(); -~ for (EaglerTextureAtlasSprite textureatlassprite2 : spriteList) { +~ for (int l = 0, m = spriteList.size(); l < m; ++l) { +~ EaglerTextureAtlasSprite textureatlassprite2 = spriteList.get(l); > INSERT 5 : 6 @ 5 @@ -369,11 +370,12 @@ ~ textureatlassprite = isEaglerPBRMode ? missingImagePBR : missingImage; -> CHANGE 6 : 13 @ 6 : 7 +> CHANGE 6 : 14 @ 6 : 7 ~ 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; @@ -381,8 +383,8 @@ > CHANGE 1 : 3 @ 1 : 3 -~ 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); > INSERT 2 : 3 @ 2 @@ -391,8 +393,8 @@ > CHANGE 2 : 9 @ 2 : 3 ~ 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(); ~ } ~ } ~ diff --git a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityBannerRenderer.edit.java b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityBannerRenderer.edit.java index a59d919..e670e4c 100644 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityBannerRenderer.edit.java +++ b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityBannerRenderer.edit.java @@ -19,8 +19,10 @@ > DELETE 1 @ 1 : 2 -> CHANGE 95 : 96 @ 95 : 96 +> CHANGE 95 : 98 @ 95 : 98 -~ for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : (List) list1) { +~ for (int i = 0, l = list1.size(); i < l; ++i) { +~ arraylist.add("textures/entity/banner/" +~ + ((TileEntityBanner.EnumBannerPattern) list1.get(i)).getPatternName() + ".png"); > EOF diff --git a/patches/minecraft/net/minecraft/client/resources/AbstractResourcePack.edit.java b/patches/minecraft/net/minecraft/client/resources/AbstractResourcePack.edit.java index 92225a9..6eafe1d 100644 --- a/patches/minecraft/net/minecraft/client/resources/AbstractResourcePack.edit.java +++ b/patches/minecraft/net/minecraft/client/resources/AbstractResourcePack.edit.java @@ -11,7 +11,6 @@ ~ import java.nio.charset.StandardCharsets; ~ -~ import net.lax1dude.eaglercraft.v1_8.vfs.SYS; ~ import org.json.JSONException; ~ import org.json.JSONObject; ~ @@ -19,6 +18,7 @@ ~ 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; > DELETE 1 @ 1 : 2 @@ -44,8 +44,8 @@ ~ 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; ~ } diff --git a/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.edit.java b/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.edit.java index 16dce21..b2e41e7 100644 --- a/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.edit.java +++ b/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.edit.java @@ -23,6 +23,11 @@ ~ return resourcePack.getInputStream(location); -> DELETE 27 @ 27 : 58 +> CHANGE 6 : 8 @ 6 : 7 + +~ for (int i = 0, l = this.resourcePacks.size(); i < l; ++i) { +~ IResourcePack iresourcepack = this.resourcePacks.get(i); + +> DELETE 20 @ 20 : 51 > EOF diff --git a/patches/minecraft/net/minecraft/client/resources/LanguageManager.edit.java b/patches/minecraft/net/minecraft/client/resources/LanguageManager.edit.java index 89a3307..2565a58 100644 --- a/patches/minecraft/net/minecraft/client/resources/LanguageManager.edit.java +++ b/patches/minecraft/net/minecraft/client/resources/LanguageManager.edit.java @@ -19,4 +19,9 @@ > DELETE 3 @ 3 : 5 +> CHANGE 17 : 19 @ 17 : 18 + +~ for (int i = 0, l = parList.size(); i < l; ++i) { +~ IResourcePack iresourcepack = parList.get(i); + > EOF diff --git a/patches/minecraft/net/minecraft/client/resources/ResourceIndex.edit.java b/patches/minecraft/net/minecraft/client/resources/ResourceIndex.edit.java deleted file mode 100644 index 40d7ab0..0000000 --- a/patches/minecraft/net/minecraft/client/resources/ResourceIndex.edit.java +++ /dev/null @@ -1,48 +0,0 @@ - -# Eagler Context Redacted Diff -# Copyright (c) 2024 lax1dude. All rights reserved. - -# Version: 1.0 -# Author: lax1dude - -> DELETE 2 @ 2 : 18 - -> CHANGE 1 : 3 @ 1 : 3 - -~ // private static final Logger logger = LogManager.getLogger(); -~ // private final Map resourceMap = Maps.newHashMap(); - -> CHANGE 1 : 25 @ 1 : 6 - -~ // 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); } -~ * -~ * } -~ */ -~ // } - -> CHANGE 1 : 4 @ 1 : 30 - -~ // public Map getResourceMap() { -~ // return this.resourceMap; -~ // } - -> EOF diff --git a/patches/minecraft/net/minecraft/client/resources/ResourcePackListEntry.edit.java b/patches/minecraft/net/minecraft/client/resources/ResourcePackListEntry.edit.java index 79b0092..3331e88 100644 --- a/patches/minecraft/net/minecraft/client/resources/ResourcePackListEntry.edit.java +++ b/patches/minecraft/net/minecraft/client/resources/ResourcePackListEntry.edit.java @@ -9,13 +9,13 @@ + + 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; > DELETE 6 @ 6 : 8 -> INSERT 128 : 157 @ 128 +> INSERT 128 : 158 @ 128 + private void proceedWithBs(int l, boolean deleteInstead) { + if (!deleteInstead && l != 1) { @@ -39,7 +39,8 @@ + 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); + } diff --git a/patches/minecraft/net/minecraft/client/resources/ResourcePackListEntryFound.edit.java b/patches/minecraft/net/minecraft/client/resources/ResourcePackListEntryFound.edit.java index 831f1a2..2dd9380 100644 --- a/patches/minecraft/net/minecraft/client/resources/ResourcePackListEntryFound.edit.java +++ b/patches/minecraft/net/minecraft/client/resources/ResourcePackListEntryFound.edit.java @@ -7,4 +7,8 @@ > DELETE 3 @ 3 : 5 +> CHANGE 23 : 24 @ 23 : 24 + +~ return this.field_148319_c.getResourcePackEaglerDisplayName(); + > EOF diff --git a/patches/minecraft/net/minecraft/client/resources/ResourcePackRepository.edit.java b/patches/minecraft/net/minecraft/client/resources/ResourcePackRepository.edit.java index 57361a8..a544564 100644 --- a/patches/minecraft/net/minecraft/client/resources/ResourcePackRepository.edit.java +++ b/patches/minecraft/net/minecraft/client/resources/ResourcePackRepository.edit.java @@ -11,7 +11,7 @@ > DELETE 1 @ 1 : 4 -> CHANGE 2 : 14 @ 2 : 4 +> CHANGE 2 : 13 @ 2 : 4 ~ import java.util.function.Consumer; ~ @@ -19,11 +19,10 @@ ~ 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; > DELETE 1 @ 1 : 2 @@ -46,24 +45,33 @@ > DELETE 1 @ 1 : 3 -> DELETE 2 @ 2 : 3 +> CHANGE 2 : 8 @ 2 : 3 -> DELETE 23 @ 23 : 41 +~ reconstruct(settings); +~ } +~ +~ public void reconstruct(GameSettings settings) { +~ this.repositoryEntriesAll.clear(); +~ this.repositoryEntries.clear(); -> CHANGE 1 : 3 @ 1 : 2 +> CHANGE 6 : 8 @ 6 : 7 -~ if (SYS.VFS == null) -~ return; +~ for (int i = 0, l = this.repositoryEntriesAll.size(); i < l; ++i) { +~ ResourcePackRepository.Entry resourcepackrepository$entry = this.repositoryEntriesAll.get(i); -> CHANGE 1 : 4 @ 1 : 2 +> DELETE 16 @ 16 : 34 + +> CHANGE 1 : 2 @ 1 : 2 ~ List list = Lists.newArrayList(); + +> CHANGE 1 : 6 @ 1 : 3 + +~ List 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)); ~ -~ for (String file1 : SYS.getResourcePackNames()) { - -> INSERT 1 : 2 @ 1 - -+ > CHANGE 3 : 4 @ 3 : 4 @@ -72,7 +80,7 @@ > CHANGE 1 : 5 @ 1 : 2 ~ logger.error("Failed to call \"updateResourcePack\" for resource pack \"{}\"", -~ resourcepackrepository$entry.resourcePackFile); +~ resourcepackrepository$entry.reResourcePack.resourcePackFile); ~ logger.error(var6); ~ list.remove(resourcepackrepository$entry); @@ -88,16 +96,21 @@ ~ this.repositoryEntriesAll.removeAll(list); -> CHANGE 5 : 6 @ 5 : 6 +> CHANGE 1 : 3 @ 1 : 3 + +~ for (int i = 0, l = this.repositoryEntriesAll.size(); i < l; ++i) { +~ this.repositoryEntriesAll.get(i).closeResourcePack(); + +> CHANGE 2 : 3 @ 2 : 3 ~ this.repositoryEntriesAll = list; > CHANGE 15 : 22 @ 15 : 47 ~ public void downloadResourcePack(String s1, String s2, Consumer 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; @@ -122,11 +135,11 @@ > DELETE 1 @ 1 : 2 -> CHANGE 3 : 4 @ 3 : 4 +> CHANGE 3 : 4 @ 3 : 5 -~ private final String resourcePackFile; +~ private EaglerFolderResourcePack reResourcePack; -> CHANGE 2 : 3 @ 2 : 3 +> CHANGE 1 : 2 @ 1 : 2 ~ private ImageData texturePackIcon; @@ -134,19 +147,16 @@ + private TextureManager iconTextureManager; -> CHANGE 1 : 2 @ 1 : 2 +> CHANGE 1 : 3 @ 1 : 3 -~ private Entry(String resourcePackFileIn) { +~ private Entry(EaglerFolderResourcePack resourcePackFileIn) { +~ this.reResourcePack = resourcePackFileIn; -> CHANGE 4 : 7 @ 4 : 7 - -~ if (SYS.VFS == null) -~ return; -~ this.reResourcePack = (IResourcePack) new FolderResourcePack(this.resourcePackFile, "resourcepacks/"); +> DELETE 3 @ 3 : 6 > CHANGE 6 : 8 @ 6 : 7 -~ logger.error("Failed to load resource pack icon for \"{}\"!", resourcePackFile); +~ logger.error("Failed to load resource pack icon for \"{}\"!", reResourcePack.resourcePackFile); ~ logger.error(var2); > INSERT 11 : 12 @ 11 @@ -160,8 +170,15 @@ + this.locationTexturePackIcon = null; + } -> CHANGE 35 : 36 @ 35 : 39 +> INSERT 14 : 18 @ 14 -~ return this.resourcePackFile; ++ public String getResourcePackEaglerDisplayName() { ++ return this.reResourcePack.getDisplayName(); ++ } ++ + +> CHANGE 21 : 22 @ 21 : 25 + +~ return this.reResourcePack.resourcePackFile; > EOF diff --git a/patches/minecraft/net/minecraft/client/resources/data/AnimationMetadataSection.edit.java b/patches/minecraft/net/minecraft/client/resources/data/AnimationMetadataSection.edit.java index e578f4e..426d385 100644 --- a/patches/minecraft/net/minecraft/client/resources/data/AnimationMetadataSection.edit.java +++ b/patches/minecraft/net/minecraft/client/resources/data/AnimationMetadataSection.edit.java @@ -14,4 +14,9 @@ + import com.google.common.collect.Sets; + +> CHANGE 56 : 58 @ 56 : 58 + +~ for (int i = 0, l = this.animationFrames.size(); i < l; ++i) { +~ hashset.add(Integer.valueOf(this.animationFrames.get(i).getFrameIndex())); + > EOF diff --git a/patches/minecraft/net/minecraft/client/resources/model/ModelBakery.edit.java b/patches/minecraft/net/minecraft/client/resources/model/ModelBakery.edit.java index fac698f..154ff68 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/ModelBakery.edit.java +++ b/patches/minecraft/net/minecraft/client/resources/model/ModelBakery.edit.java @@ -13,7 +13,7 @@ > DELETE 7 @ 7 : 8 -> INSERT 1 : 17 @ 1 +> INSERT 1 : 16 @ 1 + import java.util.Set; + @@ -28,7 +28,6 @@ + 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; diff --git a/patches/minecraft/net/minecraft/client/resources/model/ModelRotation.edit.java b/patches/minecraft/net/minecraft/client/resources/model/ModelRotation.edit.java index c926e37..d0aab90 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/ModelRotation.edit.java +++ b/patches/minecraft/net/minecraft/client/resources/model/ModelRotation.edit.java @@ -17,4 +17,10 @@ > DELETE 2 @ 2 : 4 +> CHANGE 75 : 78 @ 75 : 77 + +~ ModelRotation[] lst = values(); +~ for (int i = 0; i < lst.length; ++i) { +~ mapRotations.put(Integer.valueOf(lst[i].combinedXY), lst[i]); + > EOF diff --git a/patches/minecraft/net/minecraft/client/resources/model/SimpleBakedModel.edit.java b/patches/minecraft/net/minecraft/client/resources/model/SimpleBakedModel.edit.java index 99974a1..758586e 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/SimpleBakedModel.edit.java +++ b/patches/minecraft/net/minecraft/client/resources/model/SimpleBakedModel.edit.java @@ -36,16 +36,35 @@ ~ public Builder(IBakedModel parIBakedModel, EaglerTextureAtlasSprite parTextureAtlasSprite) { -> CHANGE 11 : 12 @ 11 : 12 +> CHANGE 4 : 7 @ 4 : 6 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ this.addFaceBreakingFours(parIBakedModel, parTextureAtlasSprite, facings[i]); + +> CHANGE 5 : 6 @ 5 : 6 ~ private void addFaceBreakingFours(IBakedModel parIBakedModel, EaglerTextureAtlasSprite parTextureAtlasSprite, -> CHANGE 7 : 9 @ 7 : 8 +> CHANGE 1 : 4 @ 1 : 3 + +~ List quads = parIBakedModel.getFaceQuads(parEnumFacing); +~ for (int i = 0, l = quads.size(); i < l; ++i) { +~ this.addFaceQuad(parEnumFacing, new BreakingFour(quads.get(i), parTextureAtlasSprite)); + +> CHANGE 4 : 9 @ 4 : 7 ~ private void addGeneralBreakingFours(IBakedModel parIBakedModel, ~ EaglerTextureAtlasSprite parTextureAtlasSprite) { +~ List quads = parIBakedModel.getGeneralQuads(); +~ for (int i = 0, l = quads.size(); i < l; ++i) { +~ this.addGeneralQuad(new BreakingFour(quads.get(i), parTextureAtlasSprite)); -> CHANGE 29 : 30 @ 29 : 30 +> CHANGE 8 : 9 @ 8 : 9 + +~ for (int i = 0, l = EnumFacing._VALUES.length; i < l; ++i) { + +> CHANGE 18 : 19 @ 18 : 19 ~ public SimpleBakedModel.Builder setTexture(EaglerTextureAtlasSprite parTextureAtlasSprite) { diff --git a/patches/minecraft/net/minecraft/client/resources/model/WeightedBakedModel.edit.java b/patches/minecraft/net/minecraft/client/resources/model/WeightedBakedModel.edit.java index 94e4563..515dbca 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/WeightedBakedModel.edit.java +++ b/patches/minecraft/net/minecraft/client/resources/model/WeightedBakedModel.edit.java @@ -21,4 +21,10 @@ ~ public EaglerTextureAtlasSprite getParticleTexture() { +> CHANGE 47 : 50 @ 47 : 49 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int j = 0; j < facings.length; ++j) { +~ i += this.model.getFaceQuads(facings[j]).size(); + > EOF diff --git a/patches/minecraft/net/minecraft/client/settings/GameSettings.edit.java b/patches/minecraft/net/minecraft/client/settings/GameSettings.edit.java index b559f18..4e4720e 100644 --- a/patches/minecraft/net/minecraft/client/settings/GameSettings.edit.java +++ b/patches/minecraft/net/minecraft/client/settings/GameSettings.edit.java @@ -7,20 +7,17 @@ > DELETE 2 @ 2 : 7 -> CHANGE 1 : 4 @ 1 : 4 +> CHANGE 1 : 3 @ 1 : 4 -~ import java.io.ByteArrayOutputStream; ~ import java.io.InputStreamReader; ~ import java.io.OutputStreamWriter; > DELETE 1 @ 1 : 3 -> INSERT 3 : 25 @ 3 +> INSERT 3 : 24 @ 3 + + 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; @@ -31,6 +28,7 @@ + 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; @@ -59,7 +57,11 @@ > DELETE 1 @ 1 : 2 -> DELETE 17 @ 17 : 28 +> CHANGE 5 : 6 @ 5 : 6 + +~ private final Set setModelParts = Sets.newHashSet(EnumPlayerModelParts._VALUES); + +> DELETE 11 @ 11 : 22 > CHANGE 8 : 9 @ 8 : 9 @@ -267,15 +269,21 @@ + return s + I18n.format("options.off"); + } -> CHANGE 7 : 9 @ 7 : 8 +> CHANGE 6 : 12 @ 6 : 10 -~ byte[] options = EagRuntime.getStorage("g"); -~ if (options == null) { +~ byte[] options = EagRuntime.getStorage("g"); +~ if (options == null) { +~ return; +~ } +~ loadOptions(options); +~ } -> CHANGE 3 : 5 @ 3 : 4 +> CHANGE 1 : 5 @ 1 : 2 +~ public void loadOptions(byte[] data) { +~ try { ~ BufferedReader bufferedreader = new BufferedReader( -~ new InputStreamReader(EaglerZLIB.newGZIPInputStream(new EaglerInputStream(options)))); +~ new InputStreamReader(EaglerZLIB.newGZIPInputStream(new EaglerInputStream(data)))); > INSERT 58 : 70 @ 58 @@ -387,29 +395,46 @@ > DELETE 2 @ 2 : 10 -> INSERT 6 : 16 @ 6 +> CHANGE 6 : 17 @ 6 : 7 -+ if (astring[0].equals("shaders")) { -+ this.shaders = astring[1].equals("true"); -+ } -+ -+ if (astring[0].equals("enableUpdateSvc")) { -+ this.enableUpdateSvc = astring[1].equals("true"); -+ } -+ -+ Keyboard.setFunctionKeyModifier(keyBindFunction.getKeyCode()); -+ +~ if (astring[0].equals("shaders")) { +~ this.shaders = astring[1].equals("true"); +~ } +~ +~ if (astring[0].equals("enableUpdateSvc")) { +~ this.enableUpdateSvc = astring[1].equals("true"); +~ } +~ +~ Keyboard.setFunctionKeyModifier(keyBindFunction.getKeyCode()); +~ +~ for (SoundCategory soundcategory : SoundCategory._VALUES) { -> INSERT 11 : 13 @ 11 +> CHANGE 5 : 6 @ 5 : 6 + +~ for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts._VALUES) { + +> INSERT 4 : 6 @ 4 + + deferredShaderConf.readOption(astring[0], astring[1]); > DELETE 6 @ 6 : 7 -> CHANGE 12 : 14 @ 12 : 13 +> INSERT 11 : 20 @ 11 -~ ByteArrayOutputStream bao = new ByteArrayOutputStream(); ++ byte[] data = writeOptions(); ++ if (data != null) { ++ EagRuntime.setStorage("g", data); ++ } ++ RelayManager.relayManager.save(); ++ this.sendSettingsToServer(); ++ } ++ ++ public byte[] writeOptions() { + +> CHANGE 1 : 3 @ 1 : 2 + +~ EaglerOutputStream bao = new EaglerOutputStream(); ~ PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(EaglerZLIB.newGZIPOutputStream(bao))); > INSERT 13 : 16 @ 13 @@ -443,24 +468,32 @@ + printwriter.println("shaders:" + this.shaders); + printwriter.println("enableUpdateSvc:" + this.enableUpdateSvc); -> INSERT 5 : 7 @ 5 +> CHANGE 5 : 8 @ 5 : 6 -+ Keyboard.setFunctionKeyModifier(keyBindFunction.getKeyCode()); -+ +~ Keyboard.setFunctionKeyModifier(keyBindFunction.getKeyCode()); +~ +~ for (SoundCategory soundcategory : SoundCategory._VALUES) { -> INSERT 10 : 12 @ 10 +> CHANGE 4 : 5 @ 4 : 5 + +~ for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts._VALUES) { + +> INSERT 4 : 6 @ 4 + deferredShaderConf.writeOptions(printwriter); + -> INSERT 1 : 5 @ 1 +> INSERT 1 : 2 @ 1 -+ -+ EagRuntime.setStorage("g", bao.toByteArray()); -+ -+ RelayManager.relayManager.save(); ++ return bao.toByteArray(); -> CHANGE 10 : 11 @ 10 : 11 +> INSERT 2 : 3 @ 2 + ++ return null; + +> DELETE 2 @ 2 : 3 + +> CHANGE 5 : 6 @ 5 : 6 ~ : (parSoundCategory == SoundCategory.VOICE ? 0.0F : 1.0F); diff --git a/patches/minecraft/net/minecraft/client/settings/KeyBinding.edit.java b/patches/minecraft/net/minecraft/client/settings/KeyBinding.edit.java index 21b9131..5bf2077 100644 --- a/patches/minecraft/net/minecraft/client/settings/KeyBinding.edit.java +++ b/patches/minecraft/net/minecraft/client/settings/KeyBinding.edit.java @@ -14,4 +14,14 @@ + import com.google.common.collect.Sets; + +> CHANGE 35 : 37 @ 35 : 37 + +~ for (int i = 0, l = keybindArray.size(); i < l; ++i) { +~ keybindArray.get(i).unpressKey(); + +> CHANGE 7 : 9 @ 7 : 8 + +~ for (int i = 0, l = keybindArray.size(); i < l; ++i) { +~ KeyBinding keybinding = keybindArray.get(i); + > EOF diff --git a/patches/minecraft/net/minecraft/command/CommandBase.edit.java b/patches/minecraft/net/minecraft/command/CommandBase.edit.java index b78dbdb..6bce1e9 100644 --- a/patches/minecraft/net/minecraft/command/CommandBase.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandBase.edit.java @@ -13,7 +13,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; -> INSERT 19 : 20 @ 19 +> DELETE 1 @ 1 : 9 + +> INSERT 10 : 11 @ 10 + diff --git a/patches/minecraft/net/minecraft/command/CommandBlockData.edit.java b/patches/minecraft/net/minecraft/command/CommandBlockData.edit.java index 89a1d9e..4900322 100644 --- a/patches/minecraft/net/minecraft/command/CommandBlockData.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandBlockData.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 16 : 17 @ 16 +> DELETE 3 @ 3 : 8 + +> INSERT 8 : 9 @ 8 + diff --git a/patches/minecraft/net/minecraft/command/CommandClearInventory.edit.java b/patches/minecraft/net/minecraft/command/CommandClearInventory.edit.java index 50f8102..fd97d31 100644 --- a/patches/minecraft/net/minecraft/command/CommandClearInventory.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandClearInventory.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 17 : 18 @ 17 +> DELETE 3 @ 3 : 7 + +> INSERT 10 : 11 @ 10 + diff --git a/patches/minecraft/net/minecraft/command/CommandClone.edit.java b/patches/minecraft/net/minecraft/command/CommandClone.edit.java index 53f2c6c..fd286ed 100644 --- a/patches/minecraft/net/minecraft/command/CommandClone.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandClone.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 23 : 24 @ 23 +> DELETE 8 @ 8 : 13 + +> INSERT 10 : 11 @ 10 + @@ -17,24 +19,33 @@ ~ for (BlockPos blockpos7 : (LinkedList) linkedlist) { -> CHANGE 10 : 11 @ 10 : 11 +> CHANGE 10 : 13 @ 10 : 11 -~ for (CommandClone.StaticCloneData commandclone$staticclonedata : (List) list) { +~ for (int k = 0, l = list.size(); k < l; ++k) { +~ CommandClone.StaticCloneData commandclone$staticclonedata = (CommandClone.StaticCloneData) list +~ .get(k); -> CHANGE 12 : 13 @ 12 : 13 +> CHANGE 12 : 15 @ 12 : 13 -~ for (CommandClone.StaticCloneData commandclone$staticclonedata1 : (ArrayList) arraylist3) { +~ for (int k = 0, l = arraylist3.size(); k < l; ++k) { +~ CommandClone.StaticCloneData commandclone$staticclonedata1 = (CommandClone.StaticCloneData) arraylist3 +~ .get(k); -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 6 : 9 @ 6 : 7 -~ for (CommandClone.StaticCloneData commandclone$staticclonedata2 : (ArrayList) arraylist1) { +~ for (int k = 0, l = arraylist1.size(); k < l; ++k) { +~ CommandClone.StaticCloneData commandclone$staticclonedata2 = (CommandClone.StaticCloneData) arraylist1 +~ .get(k); -> CHANGE 17 : 18 @ 17 : 18 +> CHANGE 17 : 20 @ 17 : 18 -~ for (CommandClone.StaticCloneData commandclone$staticclonedata3 : (List) list) { +~ for (int k = 0, l = list.size(); k < l; ++k) { +~ CommandClone.StaticCloneData commandclone$staticclonedata3 = (CommandClone.StaticCloneData) list +~ .get(k); -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 6 : 8 @ 6 : 7 -~ for (NextTickListEntry nextticklistentry : (List) list1) { +~ for (int k = 0, l = list1.size(); k < l; ++k) { +~ NextTickListEntry nextticklistentry = (NextTickListEntry) list1.get(k); > EOF diff --git a/patches/minecraft/net/minecraft/command/CommandCompare.edit.java b/patches/minecraft/net/minecraft/command/CommandCompare.edit.java index 50f8102..c3bb426 100644 --- a/patches/minecraft/net/minecraft/command/CommandCompare.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandCompare.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 17 : 18 @ 17 +> DELETE 4 @ 4 : 9 + +> INSERT 8 : 9 @ 8 + diff --git a/patches/minecraft/net/minecraft/command/CommandDefaultGameMode.edit.java b/patches/minecraft/net/minecraft/command/CommandDefaultGameMode.edit.java index 9e4f0d7..e04e6b8 100644 --- a/patches/minecraft/net/minecraft/command/CommandDefaultGameMode.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandDefaultGameMode.edit.java @@ -5,8 +5,19 @@ # Version: 1.0 # Author: lax1dude -> INSERT 12 : 13 @ 12 +> CHANGE 2 : 4 @ 2 : 6 + +~ import java.util.List; +~ + +> INSERT 6 : 7 @ 6 + +> CHANGE 24 : 27 @ 24 : 26 + +~ List lst = MinecraftServer.getServer().getConfigurationManager().func_181057_v(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ EntityPlayerMP entityplayermp = lst.get(i); + > EOF diff --git a/patches/minecraft/net/minecraft/command/CommandDifficulty.edit.java b/patches/minecraft/net/minecraft/command/CommandDifficulty.edit.java index b5da4fe..940400a 100644 --- a/patches/minecraft/net/minecraft/command/CommandDifficulty.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandDifficulty.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 14 : 15 @ 14 +> DELETE 3 @ 3 : 8 + +> INSERT 6 : 7 @ 6 + diff --git a/patches/minecraft/net/minecraft/command/CommandEffect.edit.java b/patches/minecraft/net/minecraft/command/CommandEffect.edit.java index 89a1d9e..4900322 100644 --- a/patches/minecraft/net/minecraft/command/CommandEffect.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandEffect.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 16 : 17 @ 16 +> DELETE 3 @ 3 : 8 + +> INSERT 8 : 9 @ 8 + diff --git a/patches/minecraft/net/minecraft/command/CommandEnchant.edit.java b/patches/minecraft/net/minecraft/command/CommandEnchant.edit.java index 50f8102..317b685 100644 --- a/patches/minecraft/net/minecraft/command/CommandEnchant.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandEnchant.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 17 : 18 @ 17 +> DELETE 3 @ 3 : 9 + +> INSERT 8 : 9 @ 8 + diff --git a/patches/minecraft/net/minecraft/command/CommandEntityData.edit.java b/patches/minecraft/net/minecraft/command/CommandEntityData.edit.java index 0c12581..93eb289 100644 --- a/patches/minecraft/net/minecraft/command/CommandEntityData.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandEntityData.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 13 : 14 @ 13 +> DELETE 2 @ 2 : 6 + +> INSERT 7 : 8 @ 7 + diff --git a/patches/minecraft/net/minecraft/command/CommandExecuteAt.edit.java b/patches/minecraft/net/minecraft/command/CommandExecuteAt.edit.java index 6592a60..45ee67e 100644 --- a/patches/minecraft/net/minecraft/command/CommandExecuteAt.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandExecuteAt.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 19 : 20 @ 19 +> DELETE 5 @ 5 : 11 + +> INSERT 8 : 9 @ 8 + diff --git a/patches/minecraft/net/minecraft/command/CommandFill.edit.java b/patches/minecraft/net/minecraft/command/CommandFill.edit.java index fa309af..73b1ce5 100644 --- a/patches/minecraft/net/minecraft/command/CommandFill.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandFill.edit.java @@ -5,12 +5,15 @@ # Version: 1.0 # Author: lax1dude -> INSERT 22 : 23 @ 22 +> DELETE 7 @ 7 : 12 + +> INSERT 10 : 11 @ 10 + -> CHANGE 129 : 130 @ 129 : 130 +> CHANGE 129 : 131 @ 129 : 130 -~ for (BlockPos blockpos5 : (ArrayList) arraylist) { +~ for (int m = 0, n = arraylist.size(); m < n; ++m) { +~ BlockPos blockpos5 = (BlockPos) arraylist.get(m); > EOF diff --git a/patches/minecraft/net/minecraft/command/CommandGameMode.edit.java b/patches/minecraft/net/minecraft/command/CommandGameMode.edit.java index d2c6452..815cb1e 100644 --- a/patches/minecraft/net/minecraft/command/CommandGameMode.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandGameMode.edit.java @@ -5,8 +5,14 @@ # Version: 1.0 # Author: lax1dude -> INSERT 15 : 16 @ 15 +> DELETE 3 @ 3 : 8 + +> INSERT 7 : 8 @ 7 + +> CHANGE 53 : 54 @ 53 : 54 + +~ WorldSettings.GameType._VALUES.length + > EOF diff --git a/patches/minecraft/net/minecraft/command/CommandGameRule.edit.java b/patches/minecraft/net/minecraft/command/CommandGameRule.edit.java index d2c6452..b27cf88 100644 --- a/patches/minecraft/net/minecraft/command/CommandGameRule.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandGameRule.edit.java @@ -5,8 +5,16 @@ # Version: 1.0 # Author: lax1dude -> INSERT 15 : 16 @ 15 +> DELETE 3 @ 3 : 7 + +> INSERT 8 : 9 @ 8 + +> CHANGE 46 : 49 @ 46 : 48 + +~ List lst = MinecraftServer.getServer().getConfigurationManager().func_181057_v(); +~ for (int j = 0, l = lst.size(); j < l; ++j) { +~ EntityPlayerMP entityplayermp = lst.get(j); + > EOF diff --git a/patches/minecraft/net/minecraft/command/CommandGive.edit.java b/patches/minecraft/net/minecraft/command/CommandGive.edit.java index e8768a1..ca4e730 100644 --- a/patches/minecraft/net/minecraft/command/CommandGive.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandGive.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 18 : 19 @ 18 +> DELETE 3 @ 3 : 8 + +> INSERT 10 : 11 @ 10 + diff --git a/patches/minecraft/net/minecraft/command/CommandHandler.edit.java b/patches/minecraft/net/minecraft/command/CommandHandler.edit.java index cdd05b8..487da41 100644 --- a/patches/minecraft/net/minecraft/command/CommandHandler.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandHandler.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 22 : 24 @ 22 : 24 +> DELETE 10 @ 10 : 18 + +> CHANGE 4 : 6 @ 4 : 6 ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; @@ -14,8 +16,9 @@ + -> CHANGE 27 : 28 @ 27 : 28 +> CHANGE 27 : 29 @ 27 : 29 -~ for (Entity entity : (List) list) { +~ for (int k = 0, l = list.size(); k < l; ++k) { +~ astring[i] = ((Entity) list.get(k)).getUniqueID().toString(); > EOF diff --git a/patches/minecraft/net/minecraft/command/CommandHelp.edit.java b/patches/minecraft/net/minecraft/command/CommandHelp.edit.java index e5dd790..a6010ec 100644 --- a/patches/minecraft/net/minecraft/command/CommandHelp.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandHelp.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 23 : 24 @ 23 +> DELETE 7 @ 7 : 14 + +> INSERT 9 : 10 @ 9 + diff --git a/patches/minecraft/net/minecraft/command/CommandKill.edit.java b/patches/minecraft/net/minecraft/command/CommandKill.edit.java index 9e4f0d7..0c4dac1 100644 --- a/patches/minecraft/net/minecraft/command/CommandKill.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandKill.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 12 : 13 @ 12 +> DELETE 3 @ 3 : 6 + +> INSERT 6 : 7 @ 6 + diff --git a/patches/minecraft/net/minecraft/command/CommandNotFoundException.edit.java b/patches/minecraft/net/minecraft/command/CommandNotFoundException.edit.java index 613846d..5d95064 100644 --- a/patches/minecraft/net/minecraft/command/CommandNotFoundException.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandNotFoundException.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 5 : 6 @ 5 +> DELETE 2 @ 2 : 4 + +> INSERT 1 : 2 @ 1 + diff --git a/patches/minecraft/net/minecraft/command/CommandParticle.edit.java b/patches/minecraft/net/minecraft/command/CommandParticle.edit.java index b5da4fe..1b9af6f 100644 --- a/patches/minecraft/net/minecraft/command/CommandParticle.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandParticle.edit.java @@ -5,8 +5,16 @@ # Version: 1.0 # Author: lax1dude -> INSERT 14 : 15 @ 14 +> DELETE 3 @ 3 : 7 + +> INSERT 7 : 8 @ 7 + +> CHANGE 19 : 22 @ 19 : 20 + +~ EnumParticleTypes[] types = EnumParticleTypes._VALUES; +~ for (int i = 0; i < types.length; ++i) { +~ EnumParticleTypes enumparticletypes1 = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/command/CommandPlaySound.edit.java b/patches/minecraft/net/minecraft/command/CommandPlaySound.edit.java index b5da4fe..a47ee1d 100644 --- a/patches/minecraft/net/minecraft/command/CommandPlaySound.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandPlaySound.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 14 : 15 @ 14 +> DELETE 3 @ 3 : 7 + +> INSERT 7 : 8 @ 7 + diff --git a/patches/minecraft/net/minecraft/command/CommandReplaceItem.edit.java b/patches/minecraft/net/minecraft/command/CommandReplaceItem.edit.java index b5f0f4d..ce71b4c 100644 --- a/patches/minecraft/net/minecraft/command/CommandReplaceItem.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandReplaceItem.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 26 : 27 @ 26 +> DELETE 6 @ 6 : 12 + +> INSERT 14 : 15 @ 14 + diff --git a/patches/minecraft/net/minecraft/command/CommandResultStats.edit.java b/patches/minecraft/net/minecraft/command/CommandResultStats.edit.java index 89a1d9e..707dfb1 100644 --- a/patches/minecraft/net/minecraft/command/CommandResultStats.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandResultStats.edit.java @@ -5,8 +5,56 @@ # Version: 1.0 # Author: lax1dude -> INSERT 16 : 17 @ 16 +> DELETE 2 @ 2 : 5 +> CHANGE 11 : 13 @ 11 : 12 + +~ +~ private static final int NUM_RESULT_TYPES = CommandResultStats.Type._VALUES.length; + +> CHANGE 79 : 82 @ 79 : 80 + +~ CommandResultStats.Type[] types = CommandResultStats.Type.values(); +~ for (int i = 0; i < types.length; ++i) { +~ CommandResultStats.Type commandresultstats$type = types[i]; + +> CHANGE 15 : 18 @ 15 : 16 + +~ CommandResultStats.Type[] types = CommandResultStats.Type.values(); +~ for (int i = 0; i < types.length; ++i) { +~ CommandResultStats.Type commandresultstats$type = types[i]; + +> CHANGE 36 : 39 @ 36 : 37 + +~ CommandResultStats.Type[] types = CommandResultStats.Type.values(); +~ for (int i = 0; i < types.length; ++i) { +~ CommandResultStats.Type commandresultstats$type = types[i]; + +> CHANGE 16 : 19 @ 16 : 17 + +~ CommandResultStats.Type[] types = CommandResultStats.Type.values(); +~ for (int i = 0; i < types.length; ++i) { +~ CommandResultStats.Type commandresultstats$type = types[i]; + +> INSERT 11 : 13 @ 11 + ++ public static final Type[] _VALUES = values(); + +> CHANGE 17 : 18 @ 17 : 18 + +~ String[] astring = new String[_VALUES.length]; + +> CHANGE 2 : 5 @ 2 : 4 + +~ CommandResultStats.Type[] types = _VALUES; +~ for (int j = 0; j < types.length; ++j) { +~ astring[i++] = types[j].getTypeName(); + +> CHANGE 6 : 9 @ 6 : 7 + +~ CommandResultStats.Type[] types = _VALUES; +~ for (int i = 0; i < types.length; ++i) { +~ CommandResultStats.Type commandresultstats$type = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/command/CommandServerKick.edit.java b/patches/minecraft/net/minecraft/command/CommandServerKick.edit.java index 5253965..f1bcc50 100644 --- a/patches/minecraft/net/minecraft/command/CommandServerKick.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandServerKick.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 11 : 12 @ 11 +> DELETE 3 @ 3 : 8 + +> INSERT 3 : 4 @ 3 + import net.minecraft.util.StringUtils; diff --git a/patches/minecraft/net/minecraft/command/CommandSetPlayerTimeout.edit.java b/patches/minecraft/net/minecraft/command/CommandSetPlayerTimeout.edit.java index 80304af..a4d21d0 100644 --- a/patches/minecraft/net/minecraft/command/CommandSetPlayerTimeout.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandSetPlayerTimeout.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 9 : 10 @ 9 +> DELETE 2 @ 2 : 6 + +> INSERT 3 : 4 @ 3 + diff --git a/patches/minecraft/net/minecraft/command/CommandSetSpawnpoint.edit.java b/patches/minecraft/net/minecraft/command/CommandSetSpawnpoint.edit.java index 9e4f0d7..1d7ad25 100644 --- a/patches/minecraft/net/minecraft/command/CommandSetSpawnpoint.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandSetSpawnpoint.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 12 : 13 @ 12 +> DELETE 3 @ 3 : 7 + +> INSERT 5 : 6 @ 5 + diff --git a/patches/minecraft/net/minecraft/command/CommandShowSeed.edit.java b/patches/minecraft/net/minecraft/command/CommandShowSeed.edit.java index e395576..3259a40 100644 --- a/patches/minecraft/net/minecraft/command/CommandShowSeed.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandShowSeed.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 11 : 12 @ 11 +> DELETE 2 @ 2 : 5 + +> INSERT 6 : 7 @ 6 + diff --git a/patches/minecraft/net/minecraft/command/CommandSpreadPlayers.edit.java b/patches/minecraft/net/minecraft/command/CommandSpreadPlayers.edit.java index 4f34654..a1e68e5 100644 --- a/patches/minecraft/net/minecraft/command/CommandSpreadPlayers.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandSpreadPlayers.edit.java @@ -10,7 +10,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; ~ import net.lax1dude.eaglercraft.v1_8.HString; -> INSERT 20 : 21 @ 20 +> DELETE 1 @ 1 : 9 + +> INSERT 11 : 12 @ 11 + @@ -22,11 +24,22 @@ ~ new Object[] { HString.format("%.2f", new Object[] { Double.valueOf(d4) }), Integer.valueOf(i) })); -> CHANGE 19 : 20 @ 19 : 20 +> CHANGE 7 : 9 @ 7 : 8 + +~ for (int i = 0, l = parList.size(); i < l; ++i) { +~ Entity entity = parList.get(i); + +> CHANGE 11 : 12 @ 11 : 12 ~ EaglercraftRandom parRandom, double parDouble2, double parDouble3, double parDouble4, double parDouble5, -> CHANGE 64 : 65 @ 64 : 65 +> CHANGE 50 : 53 @ 50 : 54 + +~ for (int k = 0; k < parArrayOfPosition.length; ++k) { +~ if (!parArrayOfPosition[k].func_111098_b(parWorld)) { +~ parArrayOfPosition[k].func_111097_a(parRandom, parDouble2, parDouble3, parDouble4, parDouble5); + +> CHANGE 10 : 11 @ 10 : 11 ~ HString.format("%.2f", new Object[] { Double.valueOf(d0) }) }); diff --git a/patches/minecraft/net/minecraft/command/CommandStats.edit.java b/patches/minecraft/net/minecraft/command/CommandStats.edit.java index 0f97099..24869ce 100644 --- a/patches/minecraft/net/minecraft/command/CommandStats.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandStats.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 21 : 22 @ 21 +> DELETE 6 @ 6 : 11 + +> INSERT 10 : 11 @ 10 + diff --git a/patches/minecraft/net/minecraft/command/CommandTime.edit.java b/patches/minecraft/net/minecraft/command/CommandTime.edit.java index 0c12581..762437b 100644 --- a/patches/minecraft/net/minecraft/command/CommandTime.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandTime.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 13 : 14 @ 13 +> DELETE 3 @ 3 : 8 + +> INSERT 5 : 6 @ 5 + diff --git a/patches/minecraft/net/minecraft/command/CommandTitle.edit.java b/patches/minecraft/net/minecraft/command/CommandTitle.edit.java index d3b6972..c74e959 100644 --- a/patches/minecraft/net/minecraft/command/CommandTitle.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandTitle.edit.java @@ -7,13 +7,13 @@ > DELETE 2 @ 2 : 3 -> INSERT 1 : 4 @ 1 +> CHANGE 1 : 4 @ 1 : 6 -+ -+ import org.json.JSONException; -+ +~ +~ import org.json.JSONException; +~ -> CHANGE 11 : 14 @ 11 : 14 +> CHANGE 6 : 9 @ 6 : 9 ~ import net.lax1dude.eaglercraft.v1_8.ExceptionUtils; ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; diff --git a/patches/minecraft/net/minecraft/command/CommandToggleDownfall.edit.java b/patches/minecraft/net/minecraft/command/CommandToggleDownfall.edit.java index 80304af..6d81d15 100644 --- a/patches/minecraft/net/minecraft/command/CommandToggleDownfall.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandToggleDownfall.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 9 : 10 @ 9 +> DELETE 2 @ 2 : 5 + +> INSERT 4 : 5 @ 4 + diff --git a/patches/minecraft/net/minecraft/command/CommandTrigger.edit.java b/patches/minecraft/net/minecraft/command/CommandTrigger.edit.java index 6592a60..d9f1f3c 100644 --- a/patches/minecraft/net/minecraft/command/CommandTrigger.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandTrigger.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 19 : 20 @ 19 +> DELETE 5 @ 5 : 9 + +> INSERT 10 : 11 @ 10 + diff --git a/patches/minecraft/net/minecraft/command/CommandWeather.edit.java b/patches/minecraft/net/minecraft/command/CommandWeather.edit.java index 09ff820..f59410c 100644 --- a/patches/minecraft/net/minecraft/command/CommandWeather.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandWeather.edit.java @@ -5,11 +5,11 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 3 : 4 @ 3 : 4 +> CHANGE 3 : 4 @ 3 : 8 ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 10 : 11 @ 10 +> INSERT 6 : 7 @ 6 + diff --git a/patches/minecraft/net/minecraft/command/CommandWorldBorder.edit.java b/patches/minecraft/net/minecraft/command/CommandWorldBorder.edit.java index 6c03d8f..084a84a 100644 --- a/patches/minecraft/net/minecraft/command/CommandWorldBorder.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandWorldBorder.edit.java @@ -5,12 +5,12 @@ # Version: 1.0 # Author: lax1dude -> INSERT 3 : 5 @ 3 +> CHANGE 3 : 5 @ 3 : 8 -+ -+ import net.lax1dude.eaglercraft.v1_8.HString; +~ +~ import net.lax1dude.eaglercraft.v1_8.HString; -> INSERT 12 : 13 @ 12 +> INSERT 7 : 8 @ 7 + diff --git a/patches/minecraft/net/minecraft/command/CommandXP.edit.java b/patches/minecraft/net/minecraft/command/CommandXP.edit.java index 0c12581..762437b 100644 --- a/patches/minecraft/net/minecraft/command/CommandXP.edit.java +++ b/patches/minecraft/net/minecraft/command/CommandXP.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 13 : 14 @ 13 +> DELETE 3 @ 3 : 8 + +> INSERT 5 : 6 @ 5 + diff --git a/patches/minecraft/net/minecraft/command/IAdminCommand.edit.java b/patches/minecraft/net/minecraft/command/IAdminCommand.edit.java new file mode 100644 index 0000000..0c65978 --- /dev/null +++ b/patches/minecraft/net/minecraft/command/IAdminCommand.edit.java @@ -0,0 +1,10 @@ + +# Eagler Context Redacted Diff +# Copyright (c) 2024 lax1dude. All rights reserved. + +# Version: 1.0 +# Author: lax1dude + +> DELETE 2 @ 2 : 5 + +> EOF diff --git a/patches/minecraft/net/minecraft/command/ICommand.edit.java b/patches/minecraft/net/minecraft/command/ICommand.edit.java new file mode 100644 index 0000000..831f1a2 --- /dev/null +++ b/patches/minecraft/net/minecraft/command/ICommand.edit.java @@ -0,0 +1,10 @@ + +# Eagler Context Redacted Diff +# Copyright (c) 2024 lax1dude. All rights reserved. + +# Version: 1.0 +# Author: lax1dude + +> DELETE 3 @ 3 : 5 + +> EOF diff --git a/patches/minecraft/net/minecraft/command/ICommandManager.edit.java b/patches/minecraft/net/minecraft/command/ICommandManager.edit.java new file mode 100644 index 0000000..a7f89c1 --- /dev/null +++ b/patches/minecraft/net/minecraft/command/ICommandManager.edit.java @@ -0,0 +1,10 @@ + +# Eagler Context Redacted Diff +# Copyright (c) 2024 lax1dude. All rights reserved. + +# Version: 1.0 +# Author: lax1dude + +> DELETE 4 @ 4 : 6 + +> EOF diff --git a/patches/minecraft/net/minecraft/command/ICommandSender.edit.java b/patches/minecraft/net/minecraft/command/ICommandSender.edit.java index 7572609..ad2d1ab 100644 --- a/patches/minecraft/net/minecraft/command/ICommandSender.edit.java +++ b/patches/minecraft/net/minecraft/command/ICommandSender.edit.java @@ -5,4 +5,6 @@ # Version: 1.0 # Author: lax1dude +> DELETE 2 @ 2 : 3 + > EOF diff --git a/patches/minecraft/net/minecraft/command/NumberInvalidException.edit.java b/patches/minecraft/net/minecraft/command/NumberInvalidException.edit.java index 613846d..5d95064 100644 --- a/patches/minecraft/net/minecraft/command/NumberInvalidException.edit.java +++ b/patches/minecraft/net/minecraft/command/NumberInvalidException.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 5 : 6 @ 5 +> DELETE 2 @ 2 : 4 + +> INSERT 1 : 2 @ 1 + diff --git a/patches/minecraft/net/minecraft/command/PlayerSelector.edit.java b/patches/minecraft/net/minecraft/command/PlayerSelector.edit.java index 6b7e217..a62133a 100644 --- a/patches/minecraft/net/minecraft/command/PlayerSelector.edit.java +++ b/patches/minecraft/net/minecraft/command/PlayerSelector.edit.java @@ -5,13 +5,25 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 64 : 65 @ 64 : 65 +> DELETE 18 @ 18 : 20 -~ for (Entity entity : (ArrayList) list) { +> CHANGE 38 : 39 @ 38 : 39 -> CHANGE 20 : 21 @ 20 : 21 +~ List list = matchEntities(sender, token, Entity.class); -~ for (World world : (ArrayList) list) { +> CHANGE 5 : 7 @ 5 : 7 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ arraylist.add(list.get(i).getDisplayName()); + +> CHANGE 16 : 17 @ 16 : 17 + +~ List list = getWorlds(sender, map); + +> CHANGE 2 : 4 @ 2 : 3 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ World world = list.get(i); > CHANGE 49 : 50 @ 49 : 50 diff --git a/patches/minecraft/net/minecraft/command/ServerCommandManager.edit.java b/patches/minecraft/net/minecraft/command/ServerCommandManager.edit.java index dd1c99d..1db682e 100644 --- a/patches/minecraft/net/minecraft/command/ServerCommandManager.edit.java +++ b/patches/minecraft/net/minecraft/command/ServerCommandManager.edit.java @@ -17,12 +17,14 @@ > DELETE 3 @ 3 : 4 -> DELETE 4 @ 4 : 5 +> CHANGE 4 : 5 @ 4 : 7 -> DELETE 1 @ 1 : 2 +~ import net.minecraft.entity.player.EntityPlayerMP; -> INSERT 4 : 6 @ 4 +> INSERT 4 : 8 @ 4 ++ import java.util.List; ++ + import net.lax1dude.eaglercraft.v1_8.sp.server.ClientCommandDummy; + @@ -39,7 +41,13 @@ ~ this.registerCommand(new CommandSetPlayerTimeout()); ~ this.registerCommand(new ClientCommandDummy("eagskull", 2, "command.skull.usage")); -> CHANGE 20 : 21 @ 20 : 26 +> CHANGE 16 : 19 @ 16 : 17 + +~ List players = minecraftserver.getConfigurationManager().func_181057_v(); +~ for (int i = 0, l = players.size(); i < l; ++i) { +~ EntityPlayerMP entityplayer = players.get(i); + +> CHANGE 3 : 4 @ 3 : 9 ~ entityplayer.addChatMessage(chatcomponenttranslation); diff --git a/patches/minecraft/net/minecraft/command/SyntaxErrorException.edit.java b/patches/minecraft/net/minecraft/command/SyntaxErrorException.edit.java index 613846d..5d95064 100644 --- a/patches/minecraft/net/minecraft/command/SyntaxErrorException.edit.java +++ b/patches/minecraft/net/minecraft/command/SyntaxErrorException.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 5 : 6 @ 5 +> DELETE 2 @ 2 : 4 + +> INSERT 1 : 2 @ 1 + diff --git a/patches/minecraft/net/minecraft/command/WrongUsageException.edit.java b/patches/minecraft/net/minecraft/command/WrongUsageException.edit.java index 613846d..5d95064 100644 --- a/patches/minecraft/net/minecraft/command/WrongUsageException.edit.java +++ b/patches/minecraft/net/minecraft/command/WrongUsageException.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 5 : 6 @ 5 +> DELETE 2 @ 2 : 4 + +> INSERT 1 : 2 @ 1 + diff --git a/patches/minecraft/net/minecraft/command/server/CommandAchievement.edit.java b/patches/minecraft/net/minecraft/command/server/CommandAchievement.edit.java index beb1aeb..b0d75c7 100644 --- a/patches/minecraft/net/minecraft/command/server/CommandAchievement.edit.java +++ b/patches/minecraft/net/minecraft/command/server/CommandAchievement.edit.java @@ -9,16 +9,36 @@ + -> CHANGE 60 : 61 @ 60 : 61 +> CHANGE 29 : 31 @ 29 : 31 -~ for (Achievement achievement1 : (List) Lists.reverse(arraylist)) { +~ for (int i = 0, l = AchievementList.achievementList.size(); i < l; ++i) { +~ entityplayermp.triggerAchievement(AchievementList.achievementList.get(i)); -> CHANGE 17 : 18 @ 17 : 18 +> CHANGE 5 : 8 @ 5 : 7 -~ for (Achievement achievement2 : (ArrayList) arraylist1) { +~ List ach = Lists.reverse(AchievementList.achievementList); +~ for (int i = 0, l = ach.size(); i < l; ++i) { +~ entityplayermp.func_175145_a(ach.get(i)); -> CHANGE 16 : 17 @ 16 : 17 +> CHANGE 22 : 25 @ 22 : 24 -~ for (Achievement achievement6 : (ArrayList) arraylist2) { +~ List ach = Lists.reverse(AchievementList.achievementList); +~ for (int i = 0, l = ach.size(); i < l; ++i) { +~ entityplayermp.triggerAchievement(ach.get(i)); + +> CHANGE 16 : 18 @ 16 : 17 + +~ for (int i = 0, l = arraylist1.size(); i < l; ++i) { +~ Achievement achievement2 = (Achievement) arraylist1.get(i); + +> CHANGE 16 : 18 @ 16 : 18 + +~ for (int i = 0, l = arraylist2.size(); i < l; ++i) { +~ entityplayermp.func_175145_a((Achievement) arraylist2.get(i)); + +> CHANGE 30 : 32 @ 30 : 32 + +~ for (int i = 0, l = StatList.allStats.size(); i < l; ++i) { +~ arraylist.add(StatList.allStats.get(i).statId); > EOF diff --git a/patches/minecraft/net/minecraft/command/server/CommandBlockLogic.edit.java b/patches/minecraft/net/minecraft/command/server/CommandBlockLogic.edit.java index e8deda0..4de8714 100644 --- a/patches/minecraft/net/minecraft/command/server/CommandBlockLogic.edit.java +++ b/patches/minecraft/net/minecraft/command/server/CommandBlockLogic.edit.java @@ -5,9 +5,8 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 2 : 5 @ 2 : 3 +> CHANGE 2 : 4 @ 2 : 3 -~ import net.lax1dude.eaglercraft.v1_8.EagRuntime; ~ import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf; ~ diff --git a/patches/minecraft/net/minecraft/command/server/CommandScoreboard.edit.java b/patches/minecraft/net/minecraft/command/server/CommandScoreboard.edit.java index 8adb6ba..f72536d 100644 --- a/patches/minecraft/net/minecraft/command/server/CommandScoreboard.edit.java +++ b/patches/minecraft/net/minecraft/command/server/CommandScoreboard.edit.java @@ -9,19 +9,37 @@ + -> CHANGE 189 : 190 @ 189 : 190 +> CHANGE 189 : 191 @ 189 : 190 -~ for (String s1 : (ArrayList) arraylist1) { +~ for (int j = 0, l = arraylist1.size(); j < l; ++j) { +~ String s1 = (String) arraylist1.get(j); > CHANGE 234 : 235 @ 234 : 235 ~ for (ScorePlayerTeam scoreplayerteam1 : (Collection) collection1) { -> CHANGE 115 : 116 @ 115 : 116 +> CHANGE 25 : 28 @ 25 : 26 -~ for (String s : (ArrayList) arraylist) { +~ List lst = func_175763_c(parICommandSender, s1); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ Entity entity = lst.get(i); -> CHANGE 28 : 29 @ 28 : 29 +> CHANGE 47 : 50 @ 47 : 48 + +~ List lst = func_175763_c(parICommandSender, s); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ Entity entity = lst.get(i); + +> CHANGE 35 : 36 @ 35 : 36 + +~ ArrayList arraylist = Lists.newArrayList(scoreplayerteam.getMembershipCollection()); + +> CHANGE 5 : 7 @ 5 : 7 + +~ for (int i = 0, l = arraylist.size(); i < l; ++i) { +~ scoreboard.removePlayerFromTeam(arraylist.get(i), scoreplayerteam); + +> CHANGE 27 : 28 @ 27 : 28 ~ for (ScoreObjective scoreobjective : (Collection) collection) { diff --git a/patches/minecraft/net/minecraft/crash/CrashReport.edit.java b/patches/minecraft/net/minecraft/crash/CrashReport.edit.java index 708b9d3..56b6994 100644 --- a/patches/minecraft/net/minecraft/crash/CrashReport.edit.java +++ b/patches/minecraft/net/minecraft/crash/CrashReport.edit.java @@ -5,18 +5,15 @@ # Version: 1.0 # Author: lax1dude -> DELETE 2 @ 2 : 5 +> DELETE 2 @ 2 : 9 -> DELETE 2 @ 2 : 4 - -> CHANGE 4 : 13 @ 4 : 5 +> CHANGE 4 : 12 @ 4 : 5 ~ ~ import com.google.common.collect.Lists; ~ ~ import net.lax1dude.eaglercraft.v1_8.ArrayUtils; ~ import net.lax1dude.eaglercraft.v1_8.EagRuntime; -~ import net.lax1dude.eaglercraft.v1_8.IOUtils; ~ import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType; ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; @@ -56,11 +53,17 @@ ~ this.stacktrace = (String[]) ArrayUtils -> CHANGE 7 : 8 @ 7 : 8 +> CHANGE 7 : 9 @ 7 : 9 -~ for (String stacktraceelement : this.stacktrace) { +~ for (int i = 0; i < this.stacktrace.length; ++i) { +~ builder.append("\t").append("at ").append(this.stacktrace[i].toString()); -> CHANGE 16 : 17 @ 16 : 27 +> CHANGE 6 : 8 @ 6 : 8 + +~ for (int i = 0, l = this.crashReportSections.size(); i < l; ++i) { +~ this.crashReportSections.get(i).appendToStringBuilder(builder); + +> CHANGE 7 : 8 @ 7 : 18 ~ StringBuilder stackTrace = new StringBuilder(); diff --git a/patches/minecraft/net/minecraft/crash/CrashReportCategory.edit.java b/patches/minecraft/net/minecraft/crash/CrashReportCategory.edit.java index 975eb03..eab7d6f 100644 --- a/patches/minecraft/net/minecraft/crash/CrashReportCategory.edit.java +++ b/patches/minecraft/net/minecraft/crash/CrashReportCategory.edit.java @@ -59,13 +59,18 @@ ~ String[] astacktraceelement = new String[this.stackTrace.length - amount]; -> CHANGE 18 : 19 @ 18 : 19 +> CHANGE 8 : 10 @ 8 : 9 -~ for (String stacktraceelement : this.stackTrace) { +~ for (int i = 0, l = this.children.size(); i < l; ++i) { +~ CrashReportCategory.Entry crashreportcategory$entry = this.children.get(i); + +> CHANGE 9 : 10 @ 9 : 10 + +~ for (int i = 0; i < this.stackTrace.length; ++i) { > CHANGE 1 : 2 @ 1 : 2 -~ builder.append(stacktraceelement); +~ builder.append(this.stackTrace[i]); > CHANGE 5 : 6 @ 5 : 6 diff --git a/patches/minecraft/net/minecraft/creativetab/CreativeTabs.edit.java b/patches/minecraft/net/minecraft/creativetab/CreativeTabs.edit.java index 6d88f89..a31eab7 100644 --- a/patches/minecraft/net/minecraft/creativetab/CreativeTabs.edit.java +++ b/patches/minecraft/net/minecraft/creativetab/CreativeTabs.edit.java @@ -9,4 +9,19 @@ + +> CHANGE 166 : 168 @ 166 : 168 + +~ for (int i = 0; i < this.enchantmentTypes.length; ++i) { +~ if (this.enchantmentTypes[i] == enchantmentType) { + +> CHANGE 22 : 24 @ 22 : 23 + +~ for (int i = 0; i < Enchantment.enchantmentsBookList.length; ++i) { +~ Enchantment enchantment = Enchantment.enchantmentsBookList[i]; + +> CHANGE 3 : 5 @ 3 : 5 + +~ for (int j = 0; j < enchantmentType.length && !flag; ++j) { +~ if (enchantment.type == enchantmentType[j]) { + > EOF diff --git a/patches/minecraft/net/minecraft/enchantment/Enchantment.edit.java b/patches/minecraft/net/minecraft/enchantment/Enchantment.edit.java index ff27385..fb509b5 100644 --- a/patches/minecraft/net/minecraft/enchantment/Enchantment.edit.java +++ b/patches/minecraft/net/minecraft/enchantment/Enchantment.edit.java @@ -14,4 +14,9 @@ ~ import com.google.common.collect.Maps; ~ +> CHANGE 137 : 139 @ 137 : 138 + +~ for (int i = 0; i < enchantmentsList.length; ++i) { +~ Enchantment enchantment = enchantmentsList[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.edit.java b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.edit.java index 0a4fe29..0fa0250 100644 --- a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.edit.java +++ b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.edit.java @@ -19,26 +19,54 @@ ~ private static final EaglercraftRandom enchantmentRand = new EaglercraftRandom(); -> CHANGE 211 : 213 @ 211 : 212 +> CHANGE 76 : 78 @ 76 : 78 + +~ for (int k = 0; k < stacks.length; ++k) { +~ int j = getEnchantmentLevel(enchID, stacks[k]); + +> CHANGE 26 : 28 @ 26 : 28 + +~ for (int k = 0; k < stacks.length; ++k) { +~ applyEnchantmentModifier(modifier, stacks[k]); + +> CHANGE 96 : 99 @ 96 : 97 + +~ ItemStack[] stacks = parEntityLivingBase.getInventory(); +~ for (int k = 0; k < stacks.length; ++k) { +~ ItemStack itemstack = stacks[k]; + +> CHANGE 8 : 10 @ 8 : 9 ~ public static int calcItemStackEnchantability(EaglercraftRandom parRandom, int parInt1, int parInt2, ~ ItemStack parItemStack) { -> CHANGE 14 : 15 @ 14 : 15 +> CHANGE 14 : 16 @ 14 : 16 ~ public static ItemStack addRandomEnchantment(EaglercraftRandom parRandom, ItemStack parItemStack, int parInt1) { +~ List list = buildEnchantmentList(parRandom, parItemStack, parInt1); -> CHANGE 7 : 8 @ 7 : 8 +> CHANGE 6 : 8 @ 6 : 7 -~ for (EnchantmentData enchantmentdata : (List) list) { +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ EnchantmentData enchantmentdata = list.get(i); > CHANGE 11 : 13 @ 11 : 12 ~ public static List buildEnchantmentList(EaglercraftRandom randomIn, ItemStack itemStackIn, ~ int parInt1) { -> CHANGE 30 : 31 @ 30 : 31 +> CHANGE 14 : 15 @ 14 : 15 -~ for (EnchantmentData enchantmentdata1 : (List) arraylist) { +~ ArrayList arraylist = null; + +> CHANGE 15 : 17 @ 15 : 16 + +~ for (int m = 0, n = arraylist.size(); m < n; ++m) { +~ EnchantmentData enchantmentdata1 = arraylist.get(m); + +> CHANGE 30 : 32 @ 30 : 31 + +~ for (int j = 0; j < Enchantment.enchantmentsBookList.length; ++j) { +~ Enchantment enchantment = Enchantment.enchantmentsBookList[j]; > EOF diff --git a/patches/minecraft/net/minecraft/entity/DataWatcher.edit.java b/patches/minecraft/net/minecraft/entity/DataWatcher.edit.java index 9cc0a70..b8048a0 100644 --- a/patches/minecraft/net/minecraft/entity/DataWatcher.edit.java +++ b/patches/minecraft/net/minecraft/entity/DataWatcher.edit.java @@ -34,7 +34,12 @@ > DELETE 9 @ 9 : 11 -> DELETE 41 @ 41 : 43 +> CHANGE 30 : 32 @ 30 : 32 + +~ for (int i = 0, l = objectsList.size(); i < l; ++i) { +~ writeWatchableObjectToPacketBuffer(buffer, objectsList.get(i)); + +> DELETE 9 @ 9 : 11 > DELETE 10 @ 10 : 12 @@ -48,6 +53,11 @@ > DELETE 93 @ 93 : 94 -> DELETE 10 @ 10 : 11 +> CHANGE 1 : 3 @ 1 : 2 + +~ for (int i = 0, l = parList.size(); i < l; ++i) { +~ DataWatcher.WatchableObject datawatcher$watchableobject = parList.get(i); + +> DELETE 8 @ 8 : 9 > EOF diff --git a/patches/minecraft/net/minecraft/entity/Entity.edit.java b/patches/minecraft/net/minecraft/entity/Entity.edit.java index 9f44834..1c496f4 100644 --- a/patches/minecraft/net/minecraft/entity/Entity.edit.java +++ b/patches/minecraft/net/minecraft/entity/Entity.edit.java @@ -35,47 +35,66 @@ ~ this.rand = new EaglercraftRandom(); -> CHANGE 297 : 298 @ 297 : 298 +> CHANGE 294 : 296 @ 294 : 295 -~ for (AxisAlignedBB axisalignedbb1 : (List) list1) { +~ List list1 = this.worldObj.getCollidingBoundingBoxes(this, +~ this.getEntityBoundingBox().addCoord(x, y, z)); -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 2 : 4 @ 2 : 4 -~ for (AxisAlignedBB axisalignedbb2 : (List) list1) { +~ for (int i = 0, l = list1.size(); i < l; ++i) { +~ y = list1.get(i).calculateYOffset(this.getEntityBoundingBox(), y); -> CHANGE 5 : 6 @ 5 : 6 +> CHANGE 5 : 7 @ 5 : 7 -~ for (AxisAlignedBB axisalignedbb13 : (List) list1) { +~ for (int i = 0, l = list1.size(); i < l; ++i) { +~ x = list1.get(i).calculateXOffset(this.getEntityBoundingBox(), x); -> CHANGE 17 : 18 @ 17 : 18 +> CHANGE 4 : 6 @ 4 : 6 -~ for (AxisAlignedBB axisalignedbb6 : (List) list) { +~ for (int i = 0, l = list1.size(); i < l; ++i) { +~ z = list1.get(i).calculateZOffset(this.getEntityBoundingBox(), z); -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 10 : 11 @ 10 : 11 -~ for (AxisAlignedBB axisalignedbb7 : (List) list) { +~ List list = this.worldObj.getCollidingBoundingBoxes(this, -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 5 : 7 @ 5 : 7 -~ for (AxisAlignedBB axisalignedbb8 : (List) list) { +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ d9 = list.get(i).calculateYOffset(axisalignedbb5, d9); -> CHANGE 7 : 8 @ 7 : 8 +> CHANGE 5 : 7 @ 5 : 7 -~ for (AxisAlignedBB axisalignedbb9 : (List) list) { +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ d15 = list.get(i).calculateXOffset(axisalignedbb4, d15); -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 5 : 7 @ 5 : 7 -~ for (AxisAlignedBB axisalignedbb10 : (List) list) { +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ d16 = list.get(i).calculateZOffset(axisalignedbb4, d16); -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 6 : 8 @ 6 : 8 -~ for (AxisAlignedBB axisalignedbb11 : (List) list) { +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ d17 = list.get(i).calculateYOffset(axisalignedbb14, d17); -> CHANGE 18 : 19 @ 18 : 19 +> CHANGE 5 : 7 @ 5 : 7 -~ for (AxisAlignedBB axisalignedbb12 : (List) list) { +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ d18 = list.get(i).calculateXOffset(axisalignedbb14, d18); -> CHANGE 651 : 653 @ 651 : 652 +> CHANGE 5 : 7 @ 5 : 7 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ d19 = list.get(i).calculateZOffset(axisalignedbb14, d19); + +> CHANGE 17 : 19 @ 17 : 19 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ y = list.get(i).calculateYOffset(this.getEntityBoundingBox(), y); + +> CHANGE 650 : 652 @ 650 : 651 ~ this.entityUniqueID = new EaglercraftUUID(tagCompund.getLong("UUIDMost"), ~ tagCompund.getLong("UUIDLeast")); @@ -84,7 +103,17 @@ ~ this.entityUniqueID = EaglercraftUUID.fromString(tagCompund.getString("UUID")); -> CHANGE 226 : 227 @ 226 : 227 +> CHANGE 42 : 44 @ 42 : 44 + +~ for (int i = 0; i < numbers.length; ++i) { +~ nbttaglist.appendTag(new NBTTagDouble(numbers[i])); + +> CHANGE 8 : 10 @ 8 : 10 + +~ for (int i = 0; i < numbers.length; ++i) { +~ nbttaglist.appendTag(new NBTTagFloat(numbers[i])); + +> CHANGE 172 : 173 @ 172 : 173 ~ for (AxisAlignedBB axisalignedbb : (List) list) { diff --git a/patches/minecraft/net/minecraft/entity/EntityHanging.edit.java b/patches/minecraft/net/minecraft/entity/EntityHanging.edit.java index 630e259..69e5ee3 100644 --- a/patches/minecraft/net/minecraft/entity/EntityHanging.edit.java +++ b/patches/minecraft/net/minecraft/entity/EntityHanging.edit.java @@ -7,8 +7,16 @@ > DELETE 4 @ 4 : 5 -> INSERT 7 : 8 @ 7 +> INSERT 7 : 10 @ 7 + ++ import java.util.List; ++ + +> CHANGE 98 : 101 @ 98 : 101 + +~ List lst = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox()); +~ for (int k = 0, l = lst.size(); k < l; ++k) { +~ if (lst.get(k) instanceof EntityHanging) { > EOF diff --git a/patches/minecraft/net/minecraft/entity/EntityLeashKnot.edit.java b/patches/minecraft/net/minecraft/entity/EntityLeashKnot.edit.java index 9c2c149..02dd920 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLeashKnot.edit.java +++ b/patches/minecraft/net/minecraft/entity/EntityLeashKnot.edit.java @@ -5,6 +5,38 @@ # Version: 1.0 # Author: lax1dude -> DELETE 3 @ 3 : 6 +> INSERT 2 : 4 @ 2 + ++ import java.util.List; ++ + +> DELETE 1 @ 1 : 4 + +> CHANGE 67 : 71 @ 67 : 69 + +~ List entities = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB( +~ this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + d0, this.posZ + d0)); +~ for (int i = 0, l = entities.size(); i < l; ++i) { +~ EntityLiving entityliving = entities.get(i); + +> CHANGE 12 : 13 @ 12 : 13 + +~ List entities = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, + +> CHANGE 1 : 4 @ 1 : 2 + +~ this.posY + d1, this.posZ + d1)); +~ for (int i = 0, l = entities.size(); i < l; ++i) { +~ EntityLiving entityliving1 = entities.get(i); + +> CHANGE 26 : 27 @ 26 : 27 + +~ List entities = worldIn.getEntitiesWithinAABB(EntityLeashKnot.class, + +> CHANGE 1 : 4 @ 1 : 2 + +~ (double) j + 1.0D, (double) k + 1.0D)); +~ for (int m = 0, l = entities.size(); m < l; ++m) { +~ EntityLeashKnot entityleashknot = entities.get(m); > EOF diff --git a/patches/minecraft/net/minecraft/entity/EntityList.edit.java b/patches/minecraft/net/minecraft/entity/EntityList.edit.java index 48a9c87..bc342f9 100644 --- a/patches/minecraft/net/minecraft/entity/EntityList.edit.java +++ b/patches/minecraft/net/minecraft/entity/EntityList.edit.java @@ -125,76 +125,75 @@ ~ Set set = stringToClassMapping.keySet(); -> CHANGE 29 : 98 @ 29 : 91 +> CHANGE 29 : 97 @ 29 : 91 -~ addMapping(EntityItem.class, (w) -> new EntityItem(w), "Item", 1); -~ addMapping(EntityXPOrb.class, (w) -> new EntityXPOrb(w), "XPOrb", 2); -~ addMapping(EntityEgg.class, (w) -> new EntityEgg(w), "ThrownEgg", 7); -~ addMapping(EntityLeashKnot.class, (w) -> new EntityLeashKnot(w), "LeashKnot", 8); -~ addMapping(EntityPainting.class, (w) -> new EntityPainting(w), "Painting", 9); -~ addMapping(EntityArrow.class, (w) -> new EntityArrow(w), "Arrow", 10); -~ addMapping(EntitySnowball.class, (w) -> new EntitySnowball(w), "Snowball", 11); -~ addMapping(EntityLargeFireball.class, (w) -> new EntityLargeFireball(w), "Fireball", 12); -~ addMapping(EntitySmallFireball.class, (w) -> new EntitySmallFireball(w), "SmallFireball", 13); -~ addMapping(EntityEnderPearl.class, (w) -> new EntityEnderPearl(w), "ThrownEnderpearl", 14); -~ addMapping(EntityEnderEye.class, (w) -> new EntityEnderEye(w), "EyeOfEnderSignal", 15); -~ addMapping(EntityPotion.class, (w) -> new EntityPotion(w), "ThrownPotion", 16); -~ addMapping(EntityExpBottle.class, (w) -> new EntityExpBottle(w), "ThrownExpBottle", 17); -~ addMapping(EntityItemFrame.class, (w) -> new EntityItemFrame(w), "ItemFrame", 18); -~ addMapping(EntityWitherSkull.class, (w) -> new EntityWitherSkull(w), "WitherSkull", 19); -~ addMapping(EntityTNTPrimed.class, (w) -> new EntityTNTPrimed(w), "PrimedTnt", 20); -~ addMapping(EntityFallingBlock.class, (w) -> new EntityFallingBlock(w), "FallingSand", 21); -~ addMapping(EntityFireworkRocket.class, (w) -> new EntityFireworkRocket(w), "FireworksRocketEntity", 22); -~ addMapping(EntityArmorStand.class, (w) -> new EntityArmorStand(w), "ArmorStand", 30); -~ addMapping(EntityBoat.class, (w) -> new EntityBoat(w), "Boat", 41); -~ addMapping(EntityMinecartEmpty.class, (w) -> new EntityMinecartEmpty(w), +~ addMapping(EntityItem.class, EntityItem::new, "Item", 1); +~ addMapping(EntityXPOrb.class, EntityXPOrb::new, "XPOrb", 2); +~ addMapping(EntityEgg.class, EntityEgg::new, "ThrownEgg", 7); +~ addMapping(EntityLeashKnot.class, EntityLeashKnot::new, "LeashKnot", 8); +~ addMapping(EntityPainting.class, EntityPainting::new, "Painting", 9); +~ addMapping(EntityArrow.class, EntityArrow::new, "Arrow", 10); +~ addMapping(EntitySnowball.class, EntitySnowball::new, "Snowball", 11); +~ addMapping(EntityLargeFireball.class, EntityLargeFireball::new, "Fireball", 12); +~ addMapping(EntitySmallFireball.class, EntitySmallFireball::new, "SmallFireball", 13); +~ addMapping(EntityEnderPearl.class, EntityEnderPearl::new, "ThrownEnderpearl", 14); +~ addMapping(EntityEnderEye.class, EntityEnderEye::new, "EyeOfEnderSignal", 15); +~ addMapping(EntityPotion.class, EntityPotion::new, "ThrownPotion", 16); +~ addMapping(EntityExpBottle.class, EntityExpBottle::new, "ThrownExpBottle", 17); +~ addMapping(EntityItemFrame.class, EntityItemFrame::new, "ItemFrame", 18); +~ addMapping(EntityWitherSkull.class, EntityWitherSkull::new, "WitherSkull", 19); +~ addMapping(EntityTNTPrimed.class, EntityTNTPrimed::new, "PrimedTnt", 20); +~ addMapping(EntityFallingBlock.class, EntityFallingBlock::new, "FallingSand", 21); +~ addMapping(EntityFireworkRocket.class, EntityFireworkRocket::new, "FireworksRocketEntity", 22); +~ addMapping(EntityArmorStand.class, EntityArmorStand::new, "ArmorStand", 30); +~ addMapping(EntityBoat.class, EntityBoat::new, "Boat", 41); +~ addMapping(EntityMinecartEmpty.class, EntityMinecartEmpty::new, ~ EntityMinecart.EnumMinecartType.RIDEABLE.getName(), 42); -~ addMapping(EntityMinecartChest.class, (w) -> new EntityMinecartChest(w), -~ EntityMinecart.EnumMinecartType.CHEST.getName(), 43); -~ addMapping(EntityMinecartFurnace.class, (w) -> new EntityMinecartFurnace(w), +~ addMapping(EntityMinecartChest.class, EntityMinecartChest::new, EntityMinecart.EnumMinecartType.CHEST.getName(), +~ 43); +~ addMapping(EntityMinecartFurnace.class, EntityMinecartFurnace::new, ~ EntityMinecart.EnumMinecartType.FURNACE.getName(), 44); -~ addMapping(EntityMinecartTNT.class, (w) -> new EntityMinecartTNT(w), -~ EntityMinecart.EnumMinecartType.TNT.getName(), 45); -~ addMapping(EntityMinecartHopper.class, (w) -> new EntityMinecartHopper(w), +~ addMapping(EntityMinecartTNT.class, EntityMinecartTNT::new, EntityMinecart.EnumMinecartType.TNT.getName(), 45); +~ addMapping(EntityMinecartHopper.class, EntityMinecartHopper::new, ~ EntityMinecart.EnumMinecartType.HOPPER.getName(), 46); -~ addMapping(EntityMinecartMobSpawner.class, (w) -> new EntityMinecartMobSpawner(w), +~ addMapping(EntityMinecartMobSpawner.class, EntityMinecartMobSpawner::new, ~ EntityMinecart.EnumMinecartType.SPAWNER.getName(), 47); -~ addMapping(EntityMinecartCommandBlock.class, (w) -> new EntityMinecartCommandBlock(w), +~ addMapping(EntityMinecartCommandBlock.class, EntityMinecartCommandBlock::new, ~ EntityMinecart.EnumMinecartType.COMMAND_BLOCK.getName(), 40); ~ addMapping(EntityLiving.class, null, "Mob", 48); ~ addMapping(EntityMob.class, null, "Monster", 49); -~ addMapping(EntityCreeper.class, (w) -> new EntityCreeper(w), "Creeper", 50, 894731, 0); -~ addMapping(EntitySkeleton.class, (w) -> new EntitySkeleton(w), "Skeleton", 51, 12698049, 4802889); -~ addMapping(EntitySpider.class, (w) -> new EntitySpider(w), "Spider", 52, 3419431, 11013646); -~ addMapping(EntityGiantZombie.class, (w) -> new EntityGiantZombie(w), "Giant", 53); -~ addMapping(EntityZombie.class, (w) -> new EntityZombie(w), "Zombie", 54, '\uafaf', 7969893); -~ addMapping(EntitySlime.class, (w) -> new EntitySlime(w), "Slime", 55, 5349438, 8306542); -~ addMapping(EntityGhast.class, (w) -> new EntityGhast(w), "Ghast", 56, 16382457, 12369084); -~ addMapping(EntityPigZombie.class, (w) -> new EntityPigZombie(w), "PigZombie", 57, 15373203, 5009705); -~ addMapping(EntityEnderman.class, (w) -> new EntityEnderman(w), "Enderman", 58, 1447446, 0); -~ addMapping(EntityCaveSpider.class, (w) -> new EntityCaveSpider(w), "CaveSpider", 59, 803406, 11013646); -~ addMapping(EntitySilverfish.class, (w) -> new EntitySilverfish(w), "Silverfish", 60, 7237230, 3158064); -~ addMapping(EntityBlaze.class, (w) -> new EntityBlaze(w), "Blaze", 61, 16167425, 16775294); -~ addMapping(EntityMagmaCube.class, (w) -> new EntityMagmaCube(w), "LavaSlime", 62, 3407872, 16579584); -~ addMapping(EntityDragon.class, (w) -> new EntityDragon(w), "EnderDragon", 63); -~ addMapping(EntityWither.class, (w) -> new EntityWither(w), "WitherBoss", 64); -~ addMapping(EntityBat.class, (w) -> new EntityBat(w), "Bat", 65, 4996656, 986895); -~ addMapping(EntityWitch.class, (w) -> new EntityWitch(w), "Witch", 66, 3407872, 5349438); -~ addMapping(EntityEndermite.class, (w) -> new EntityEndermite(w), "Endermite", 67, 1447446, 7237230); -~ addMapping(EntityGuardian.class, (w) -> new EntityGuardian(w), "Guardian", 68, 5931634, 15826224); -~ addMapping(EntityPig.class, (w) -> new EntityPig(w), "Pig", 90, 15771042, 14377823); -~ addMapping(EntitySheep.class, (w) -> new EntitySheep(w), "Sheep", 91, 15198183, 16758197); -~ addMapping(EntityCow.class, (w) -> new EntityCow(w), "Cow", 92, 4470310, 10592673); -~ addMapping(EntityChicken.class, (w) -> new EntityChicken(w), "Chicken", 93, 10592673, 16711680); -~ addMapping(EntitySquid.class, (w) -> new EntitySquid(w), "Squid", 94, 2243405, 7375001); -~ addMapping(EntityWolf.class, (w) -> new EntityWolf(w), "Wolf", 95, 14144467, 13545366); -~ addMapping(EntityMooshroom.class, (w) -> new EntityMooshroom(w), "MushroomCow", 96, 10489616, 12040119); -~ addMapping(EntitySnowman.class, (w) -> new EntitySnowman(w), "SnowMan", 97); -~ addMapping(EntityOcelot.class, (w) -> new EntityOcelot(w), "Ozelot", 98, 15720061, 5653556); -~ addMapping(EntityIronGolem.class, (w) -> new EntityIronGolem(w), "VillagerGolem", 99); -~ addMapping(EntityHorse.class, (w) -> new EntityHorse(w), "EntityHorse", 100, 12623485, 15656192); -~ addMapping(EntityRabbit.class, (w) -> new EntityRabbit(w), "Rabbit", 101, 10051392, 7555121); -~ addMapping(EntityVillager.class, (w) -> new EntityVillager(w), "Villager", 120, 5651507, 12422002); -~ addMapping(EntityEnderCrystal.class, (w) -> new EntityEnderCrystal(w), "EnderCrystal", 200); +~ addMapping(EntityCreeper.class, EntityCreeper::new, "Creeper", 50, 894731, 0); +~ addMapping(EntitySkeleton.class, EntitySkeleton::new, "Skeleton", 51, 12698049, 4802889); +~ addMapping(EntitySpider.class, EntitySpider::new, "Spider", 52, 3419431, 11013646); +~ addMapping(EntityGiantZombie.class, EntityGiantZombie::new, "Giant", 53); +~ addMapping(EntityZombie.class, EntityZombie::new, "Zombie", 54, '\uafaf', 7969893); +~ addMapping(EntitySlime.class, EntitySlime::new, "Slime", 55, 5349438, 8306542); +~ addMapping(EntityGhast.class, EntityGhast::new, "Ghast", 56, 16382457, 12369084); +~ addMapping(EntityPigZombie.class, EntityPigZombie::new, "PigZombie", 57, 15373203, 5009705); +~ addMapping(EntityEnderman.class, EntityEnderman::new, "Enderman", 58, 1447446, 0); +~ addMapping(EntityCaveSpider.class, EntityCaveSpider::new, "CaveSpider", 59, 803406, 11013646); +~ addMapping(EntitySilverfish.class, EntitySilverfish::new, "Silverfish", 60, 7237230, 3158064); +~ addMapping(EntityBlaze.class, EntityBlaze::new, "Blaze", 61, 16167425, 16775294); +~ addMapping(EntityMagmaCube.class, EntityMagmaCube::new, "LavaSlime", 62, 3407872, 16579584); +~ addMapping(EntityDragon.class, EntityDragon::new, "EnderDragon", 63); +~ addMapping(EntityWither.class, EntityWither::new, "WitherBoss", 64); +~ addMapping(EntityBat.class, EntityBat::new, "Bat", 65, 4996656, 986895); +~ addMapping(EntityWitch.class, EntityWitch::new, "Witch", 66, 3407872, 5349438); +~ addMapping(EntityEndermite.class, EntityEndermite::new, "Endermite", 67, 1447446, 7237230); +~ addMapping(EntityGuardian.class, EntityGuardian::new, "Guardian", 68, 5931634, 15826224); +~ addMapping(EntityPig.class, EntityPig::new, "Pig", 90, 15771042, 14377823); +~ addMapping(EntitySheep.class, EntitySheep::new, "Sheep", 91, 15198183, 16758197); +~ addMapping(EntityCow.class, EntityCow::new, "Cow", 92, 4470310, 10592673); +~ addMapping(EntityChicken.class, EntityChicken::new, "Chicken", 93, 10592673, 16711680); +~ addMapping(EntitySquid.class, EntitySquid::new, "Squid", 94, 2243405, 7375001); +~ addMapping(EntityWolf.class, EntityWolf::new, "Wolf", 95, 14144467, 13545366); +~ addMapping(EntityMooshroom.class, EntityMooshroom::new, "MushroomCow", 96, 10489616, 12040119); +~ addMapping(EntitySnowman.class, EntitySnowman::new, "SnowMan", 97); +~ addMapping(EntityOcelot.class, EntityOcelot::new, "Ozelot", 98, 15720061, 5653556); +~ addMapping(EntityIronGolem.class, EntityIronGolem::new, "VillagerGolem", 99); +~ addMapping(EntityHorse.class, EntityHorse::new, "EntityHorse", 100, 12623485, 15656192); +~ addMapping(EntityRabbit.class, EntityRabbit::new, "Rabbit", 101, 10051392, 7555121); +~ addMapping(EntityVillager.class, EntityVillager::new, "Villager", 120, 5651507, 12422002); +~ addMapping(EntityEnderCrystal.class, EntityEnderCrystal::new, "EnderCrystal", 200); > EOF diff --git a/patches/minecraft/net/minecraft/entity/EntityLiving.edit.java b/patches/minecraft/net/minecraft/entity/EntityLiving.edit.java index 5365500..2abff34 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLiving.edit.java +++ b/patches/minecraft/net/minecraft/entity/EntityLiving.edit.java @@ -5,15 +5,31 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 2 : 3 @ 2 : 3 +> CHANGE 2 : 5 @ 2 : 3 +~ import java.util.List; +~ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; > DELETE 1 @ 1 : 8 -> CHANGE 815 : 817 @ 815 : 816 +> CHANGE 316 : 320 @ 316 : 318 + +~ List lst = this.worldObj.getEntitiesWithinAABB(EntityItem.class, +~ this.getEntityBoundingBox().expand(1.0D, 0.0D, 1.0D)); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ EntityItem entityitem = lst.get(i); + +> CHANGE 497 : 499 @ 497 : 498 ~ EaglercraftUUID uuid = new EaglercraftUUID(this.leashNBTTag.getLong("UUIDMost"), ~ this.leashNBTTag.getLong("UUIDLeast")); +> CHANGE 1 : 5 @ 1 : 3 + +~ List entities = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, +~ this.getEntityBoundingBox().expand(10.0D, 10.0D, 10.0D)); +~ for (int i = 0, l = entities.size(); i < l; ++i) { +~ EntityLivingBase entitylivingbase = entities.get(i); + > EOF diff --git a/patches/minecraft/net/minecraft/entity/EntityLivingBase.edit.java b/patches/minecraft/net/minecraft/entity/EntityLivingBase.edit.java index 1b184af..4bdf575 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLivingBase.edit.java +++ b/patches/minecraft/net/minecraft/entity/EntityLivingBase.edit.java @@ -29,7 +29,18 @@ ~ public EaglercraftRandom getRNG() { -> INSERT 1309 : 1320 @ 1309 +> CHANGE 46 : 49 @ 46 : 47 + +~ ItemStack[] inv = this.getInventory(); +~ for (int i = 0; i < inv.length; ++i) { +~ ItemStack itemstack = inv[i]; + +> CHANGE 7 : 9 @ 7 : 8 + +~ for (int i = 0; i < inv.length; ++i) { +~ ItemStack itemstack1 = inv[i]; + +> INSERT 1254 : 1265 @ 1254 + + protected void renderDynamicLightsEaglerAt(double entityX, double entityY, double entityZ, double renderX, diff --git a/patches/minecraft/net/minecraft/entity/EntityTracker.edit.java b/patches/minecraft/net/minecraft/entity/EntityTracker.edit.java index 37eea41..3269066 100644 --- a/patches/minecraft/net/minecraft/entity/EntityTracker.edit.java +++ b/patches/minecraft/net/minecraft/entity/EntityTracker.edit.java @@ -5,13 +5,11 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 42 : 44 @ 42 : 44 +> DELETE 9 @ 9 : 12 + +> CHANGE 30 : 32 @ 30 : 32 ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> INSERT 2 : 3 @ 2 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.edit.java b/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.edit.java index 0d38ae8..8c1cdad 100644 --- a/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.edit.java +++ b/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.edit.java @@ -5,16 +5,19 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 63 : 65 @ 63 : 65 +> DELETE 7 @ 7 : 12 + +> CHANGE 51 : 53 @ 51 : 53 ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> INSERT 2 : 3 @ 2 +> CHANGE 78 : 80 @ 78 : 80 -+ +~ for (int i = 0, l = parList.size(); i < l; ++i) { +~ EntityPlayerMP entityplayermp = (EntityPlayerMP) parList.get(i); -> CHANGE 405 : 407 @ 405 : 406 +> CHANGE 327 : 329 @ 327 : 328 ~ s0epacketspawnobject2 = new S0EPacketSpawnObject(this.trackedEntity, b0, ~ this.trackedEntity.getEntityId()); diff --git a/patches/minecraft/net/minecraft/entity/EnumCreatureType.edit.java b/patches/minecraft/net/minecraft/entity/EnumCreatureType.edit.java new file mode 100644 index 0000000..3e70454 --- /dev/null +++ b/patches/minecraft/net/minecraft/entity/EnumCreatureType.edit.java @@ -0,0 +1,13 @@ + +# Eagler Context Redacted Diff +# Copyright (c) 2024 lax1dude. All rights reserved. + +# Version: 1.0 +# Author: lax1dude + +> INSERT 14 : 16 @ 14 + ++ public static final EnumCreatureType[] _VALUES = values(); ++ + +> EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIArrowAttack.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIArrowAttack.edit.java index 80304af..be6673d 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIArrowAttack.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIArrowAttack.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 9 : 10 @ 9 - -+ +> DELETE 5 @ 5 : 6 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.edit.java index e395576..be6673d 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 11 : 12 @ 11 - -+ +> DELETE 5 @ 5 : 6 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIAvoidEntity.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIAvoidEntity.edit.java index 95d8743..40f3ee0 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIAvoidEntity.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIAvoidEntity.edit.java @@ -5,11 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 15 : 16 @ 15 +> DELETE 7 @ 7 : 9 -+ - -> CHANGE 42 : 43 @ 42 : 43 +> CHANGE 48 : 49 @ 48 : 49 ~ this.closestLivingEntity = (T) list.get(0); diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIBase.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIBase.edit.java index 6d88f89..7572609 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIBase.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIBase.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 3 : 4 @ 3 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIBeg.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIBeg.edit.java index 61e0fa2..ad2d1ab 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIBeg.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIBeg.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 10 : 11 @ 10 - -+ +> DELETE 2 @ 2 : 3 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.edit.java index 80304af..be6673d 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 9 : 10 @ 9 - -+ +> DELETE 5 @ 5 : 6 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIControlledByPlayer.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIControlledByPlayer.edit.java index 50f8102..d9711e3 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIControlledByPlayer.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIControlledByPlayer.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 17 : 18 @ 17 - -+ +> DELETE 8 @ 8 : 9 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAICreeperSwell.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAICreeperSwell.edit.java index 8477115..a8dd664 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAICreeperSwell.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAICreeperSwell.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIDefendVillage.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIDefendVillage.edit.java index 80304af..a8dd664 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIDefendVillage.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIDefendVillage.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 9 : 10 @ 9 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIDoorInteract.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIDoorInteract.edit.java index 0c12581..97688dc 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIDoorInteract.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIDoorInteract.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 13 : 14 @ 13 - -+ +> DELETE 6 @ 6 : 7 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.edit.java index d2c6452..a2cda1e 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 15 : 16 @ 15 - -+ +> DELETE 9 @ 9 : 10 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIFindEntityNearest.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIFindEntityNearest.edit.java index 6983727..817fbbb 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIFindEntityNearest.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIFindEntityNearest.edit.java @@ -5,13 +5,11 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 14 : 16 @ 14 : 16 +> DELETE 9 @ 9 : 12 + +> CHANGE 2 : 4 @ 2 : 4 ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> INSERT 2 : 3 @ 2 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.edit.java index a5a3f5e..aad8294 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.edit.java @@ -5,13 +5,11 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 17 : 19 @ 17 : 19 +> DELETE 10 @ 10 : 13 + +> CHANGE 4 : 6 @ 4 : 6 ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> INSERT 2 : 3 @ 2 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIFleeSun.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIFleeSun.edit.java index 3f043f8..cb64cdb 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIFleeSun.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIFleeSun.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 7 : 8 @ 7 +> DELETE 1 @ 1 : 2 -+ - -> CHANGE 44 : 45 @ 44 : 45 +> CHANGE 49 : 50 @ 49 : 50 ~ EaglercraftRandom random = this.theCreature.getRNG(); diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIFollowGolem.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIFollowGolem.edit.java index 12a0693..b13fc62 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIFollowGolem.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIFollowGolem.edit.java @@ -5,12 +5,15 @@ # Version: 1.0 # Author: lax1dude -> INSERT 8 : 9 @ 8 +> DELETE 3 @ 3 : 4 -+ +> CHANGE 20 : 21 @ 20 : 21 -> CHANGE 21 : 22 @ 21 : 22 +~ List list = this.theVillager.worldObj.getEntitiesWithinAABB(EntityIronGolem.class, -~ for (EntityIronGolem entityirongolem : (List) list) { +> CHANGE 4 : 6 @ 4 : 5 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ EntityIronGolem entityirongolem = list.get(i); > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIFollowOwner.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIFollowOwner.edit.java index 89a1d9e..be6673d 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIFollowOwner.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIFollowOwner.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 16 : 17 @ 16 - -+ +> DELETE 5 @ 5 : 6 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIFollowParent.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIFollowParent.edit.java index fc46c9d..e561514 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIFollowParent.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIFollowParent.edit.java @@ -5,12 +5,15 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 +> DELETE 3 @ 3 : 4 -+ +> CHANGE 17 : 18 @ 17 : 18 -> CHANGE 19 : 20 @ 19 : 20 +~ List list = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), -~ for (EntityAnimal entityanimal1 : (List) list) { +> CHANGE 4 : 6 @ 4 : 5 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ EntityAnimal entityanimal1 = list.get(i); > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIHarvestFarmland.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIHarvestFarmland.edit.java index d2c6452..be6673d 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIHarvestFarmland.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIHarvestFarmland.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 15 : 16 @ 15 - -+ +> DELETE 5 @ 5 : 6 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIHurtByTarget.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIHurtByTarget.edit.java index 3215e29..efe9567 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIHurtByTarget.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIHurtByTarget.edit.java @@ -5,8 +5,26 @@ # Version: 1.0 # Author: lax1dude -> INSERT 8 : 9 @ 8 +> INSERT 2 : 4 @ 2 ++ import java.util.List; + +> DELETE 2 @ 2 : 3 + +> CHANGE 25 : 26 @ 25 : 27 + +~ List lst = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), + +> CHANGE 2 : 5 @ 2 : 3 + +~ .expand(d0, 10.0D, d0)); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ EntityCreature entitycreature = lst.get(i); + +> CHANGE 4 : 6 @ 4 : 6 + +~ for (int j = 0; j < this.targetClasses.length; ++j) { +~ if (entitycreature.getClass() == this.targetClasses[j]) { + > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAILeapAtTarget.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAILeapAtTarget.edit.java index 3215e29..0d7c65a 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAILeapAtTarget.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAILeapAtTarget.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 8 : 9 @ 8 - -+ +> DELETE 4 @ 4 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAILookAtTradePlayer.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAILookAtTradePlayer.edit.java index 8477115..ad2d1ab 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAILookAtTradePlayer.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAILookAtTradePlayer.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 2 @ 2 : 3 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAILookAtVillager.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAILookAtVillager.edit.java index 8477115..ad2d1ab 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAILookAtVillager.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAILookAtVillager.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 2 @ 2 : 3 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAILookIdle.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAILookIdle.edit.java index 60f453f..a8dd664 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAILookIdle.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAILookIdle.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIMate.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIMate.edit.java index 3fed841..9abd8a1 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIMate.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIMate.edit.java @@ -9,13 +9,16 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 12 : 13 @ 12 +> DELETE 1 @ 1 : 2 -+ +> CHANGE 54 : 55 @ 54 : 55 -> CHANGE 49 : 50 @ 49 : 50 +~ List list = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), -~ for (EntityAnimal entityanimal1 : (List) list) { +> CHANGE 4 : 6 @ 4 : 5 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ EntityAnimal entityanimal1 = list.get(i); > CHANGE 32 : 33 @ 32 : 33 diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveIndoors.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveIndoors.edit.java index e395576..831f1a2 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveIndoors.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveIndoors.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 11 : 12 @ 11 - -+ +> DELETE 3 @ 3 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveThroughVillage.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveThroughVillage.edit.java index 89a1d9e..069abd3 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveThroughVillage.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveThroughVillage.edit.java @@ -5,8 +5,17 @@ # Version: 1.0 # Author: lax1dude -> INSERT 16 : 17 @ 16 +> DELETE 5 @ 5 : 7 -+ +> CHANGE 92 : 95 @ 92 : 93 + +~ List lst = villageIn.getVillageDoorInfoList(); +~ for (int k = 0, l = lst.size(); k < l; ++k) { +~ VillageDoorInfo villagedoorinfo1 = lst.get(k); + +> CHANGE 12 : 14 @ 12 : 13 + +~ for (int i = 0, l = this.doorList.size(); i < l; ++i) { +~ VillageDoorInfo villagedoorinfo = this.doorList.get(i); > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveToBlock.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveToBlock.edit.java index 3215e29..a8dd664 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveToBlock.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveToBlock.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 8 : 9 @ 8 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.edit.java index 80304af..831f1a2 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 9 : 10 @ 9 - -+ +> DELETE 3 @ 3 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.edit.java index 80304af..a7f89c1 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 9 : 10 @ 9 - -+ +> DELETE 4 @ 4 : 6 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAINearestAttackableTarget.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAINearestAttackableTarget.edit.java index d2c6452..166779e 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAINearestAttackableTarget.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAINearestAttackableTarget.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 15 : 16 @ 15 - -+ +> DELETE 10 @ 10 : 11 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIOcelotAttack.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIOcelotAttack.edit.java index 3215e29..0d7c65a 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIOcelotAttack.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIOcelotAttack.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 8 : 9 @ 8 - -+ +> DELETE 4 @ 4 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIOcelotSit.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIOcelotSit.edit.java index b5da4fe..be6673d 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIOcelotSit.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIOcelotSit.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 14 : 15 @ 14 - -+ +> DELETE 5 @ 5 : 6 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIOpenDoor.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIOpenDoor.edit.java index 60f453f..a8dd664 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIOpenDoor.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIOpenDoor.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.edit.java index 8477115..a8dd664 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.edit.java index 8477115..a8dd664 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIPanic.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIPanic.edit.java index 3215e29..831f1a2 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIPanic.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIPanic.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 8 : 9 @ 8 - -+ +> DELETE 3 @ 3 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIPlay.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIPlay.edit.java index b7ec52c..dda0fb0 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIPlay.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIPlay.edit.java @@ -5,12 +5,15 @@ # Version: 1.0 # Author: lax1dude -> INSERT 10 : 11 @ 10 - -+ +> DELETE 4 @ 4 : 6 > CHANGE 21 : 22 @ 21 : 22 -~ for (EntityVillager entityvillager : (List) list) { +~ List list = this.villagerObj.worldObj.getEntitiesWithinAABB(EntityVillager.class, + +> CHANGE 3 : 5 @ 3 : 4 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ EntityVillager entityvillager = list.get(i); > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.edit.java index 61e0fa2..a8dd664 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 10 : 11 @ 10 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIRestrictSun.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIRestrictSun.edit.java index 8477115..a8dd664 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIRestrictSun.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIRestrictSun.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.edit.java index 61e0fa2..831f1a2 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 10 : 11 @ 10 - -+ +> DELETE 3 @ 3 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAISit.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAISit.edit.java index 8477115..a8dd664 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAISit.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAISit.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAISwimming.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAISwimming.edit.java index 8477115..a8dd664 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAISwimming.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAISwimming.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAITarget.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAITarget.edit.java index 968176e..6e876c6 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAITarget.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAITarget.edit.java @@ -5,11 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 15 : 16 @ 15 +> DELETE 7 @ 7 : 8 -+ - -> INSERT 3 : 4 @ 3 +> INSERT 7 : 8 @ 7 + diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAITargetNonTamed.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAITargetNonTamed.edit.java index 3215e29..0d7c65a 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAITargetNonTamed.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAITargetNonTamed.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 8 : 9 @ 8 - -+ +> DELETE 4 @ 4 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAITasks.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAITasks.edit.java index 3627264..9396d14 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAITasks.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAITasks.edit.java @@ -5,13 +5,21 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 7 : 9 @ 7 : 9 +> DELETE 5 @ 5 : 6 + +> CHANGE 1 : 3 @ 1 : 3 ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> INSERT 2 : 3 @ 2 +> CHANGE 84 : 86 @ 84 : 86 -+ +~ for (int i = 0, l = this.executingTaskEntries.size(); i < l; ++i) { +~ this.executingTaskEntries.get(i).action.updateTask(); + +> CHANGE 11 : 13 @ 11 : 12 + +~ for (int i = 0, l = this.taskEntries.size(); i < l; ++i) { +~ EntityAITasks.EntityAITaskEntry entityaitasks$entityaitaskentry = this.taskEntries.get(i); > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAITempt.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAITempt.edit.java index 61e0fa2..a8dd664 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAITempt.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAITempt.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 10 : 11 @ 10 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAITradePlayer.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAITradePlayer.edit.java index 3215e29..ad2d1ab 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAITradePlayer.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAITradePlayer.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 8 : 9 @ 8 - -+ +> DELETE 2 @ 2 : 3 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIVillagerInteract.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIVillagerInteract.edit.java index 9e4f0d7..ad2d1ab 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIVillagerInteract.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIVillagerInteract.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 12 : 13 @ 12 - -+ +> DELETE 2 @ 2 : 3 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.edit.java index 61e0fa2..a8dd664 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIVillagerMate.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 10 : 11 @ 10 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIWander.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIWander.edit.java index 3215e29..831f1a2 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIWander.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIWander.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 8 : 9 @ 8 - -+ +> DELETE 3 @ 3 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIWatchClosest.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIWatchClosest.edit.java index 3215e29..0d7c65a 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIWatchClosest.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIWatchClosest.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 8 : 9 @ 8 - -+ +> DELETE 4 @ 4 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIWatchClosest2.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityAIWatchClosest2.edit.java index 8477115..0d7c65a 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIWatchClosest2.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIWatchClosest2.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 4 @ 4 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityJumpHelper.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityJumpHelper.edit.java index 613846d..7572609 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityJumpHelper.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityJumpHelper.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 5 : 6 @ 5 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityLookHelper.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityLookHelper.edit.java index 3215e29..7572609 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityLookHelper.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityLookHelper.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 8 : 9 @ 8 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityMoveHelper.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntityMoveHelper.edit.java index 8477115..7572609 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityMoveHelper.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntityMoveHelper.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/EntitySenses.edit.java b/patches/minecraft/net/minecraft/entity/ai/EntitySenses.edit.java index 3215e29..7572609 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntitySenses.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/EntitySenses.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 8 : 9 @ 8 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/entity/ai/RandomPositionGenerator.edit.java b/patches/minecraft/net/minecraft/entity/ai/RandomPositionGenerator.edit.java index 9d9ff6b..34c253e 100644 --- a/patches/minecraft/net/minecraft/entity/ai/RandomPositionGenerator.edit.java +++ b/patches/minecraft/net/minecraft/entity/ai/RandomPositionGenerator.edit.java @@ -9,11 +9,7 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 6 : 7 @ 6 - -+ - -> CHANGE 18 : 19 @ 18 : 19 +> CHANGE 24 : 25 @ 24 : 25 ~ EaglercraftRandom random = entitycreatureIn.getRNG(); diff --git a/patches/minecraft/net/minecraft/entity/ai/attributes/ServersideAttributeMap.edit.java b/patches/minecraft/net/minecraft/entity/ai/attributes/ServersideAttributeMap.edit.java new file mode 100644 index 0000000..8e16278 --- /dev/null +++ b/patches/minecraft/net/minecraft/entity/ai/attributes/ServersideAttributeMap.edit.java @@ -0,0 +1,10 @@ + +# Eagler Context Redacted Diff +# Copyright (c) 2024 lax1dude. All rights reserved. + +# Version: 1.0 +# Author: lax1dude + +> DELETE 7 @ 7 : 12 + +> EOF diff --git a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.edit.java b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.edit.java index fd1d62f..eb74b7a 100644 --- a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.edit.java +++ b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.edit.java @@ -5,8 +5,24 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 346 : 347 @ 346 : 347 +> DELETE 14 @ 14 : 16 -~ for (EntityEnderCrystal entityendercrystal1 : (List) list) { +> CHANGE 325 : 326 @ 325 : 326 + +~ List list = this.worldObj.getEntitiesWithinAABB(EntityEnderCrystal.class, + +> CHANGE 4 : 6 @ 4 : 5 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ EntityEnderCrystal entityendercrystal1 = list.get(i); + +> CHANGE 18 : 20 @ 18 : 19 + +~ for (int i = 0, l = parList.size(); i < l; ++i) { +~ Entity entity = parList.get(i); + +> CHANGE 11 : 12 @ 11 : 12 + +~ for (int i = 0, l = parList.size(); i < l; ++i) { > EOF diff --git a/patches/minecraft/net/minecraft/entity/boss/EntityWither.edit.java b/patches/minecraft/net/minecraft/entity/boss/EntityWither.edit.java index 7572609..4da548e 100644 --- a/patches/minecraft/net/minecraft/entity/boss/EntityWither.edit.java +++ b/patches/minecraft/net/minecraft/entity/boss/EntityWither.edit.java @@ -5,4 +5,20 @@ # Version: 1.0 # Author: lax1dude +> DELETE 20 @ 20 : 21 + +> CHANGE 53 : 57 @ 53 : 57 + +~ this.dataWatcher.addObject(17, Integer.valueOf(0)); +~ this.dataWatcher.addObject(18, Integer.valueOf(0)); +~ this.dataWatcher.addObject(19, Integer.valueOf(0)); +~ this.dataWatcher.addObject(20, Integer.valueOf(0)); + +> CHANGE 360 : 364 @ 360 : 363 + +~ List lst = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, +~ this.getEntityBoundingBox().expand(50.0D, 100.0D, 50.0D)); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ lst.get(i).triggerAchievement(AchievementList.killWither); + > EOF diff --git a/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.edit.java b/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.edit.java index 7572609..be6673d 100644 --- a/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.edit.java +++ b/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.edit.java @@ -5,4 +5,6 @@ # Version: 1.0 # Author: lax1dude +> DELETE 5 @ 5 : 6 + > EOF diff --git a/patches/minecraft/net/minecraft/entity/item/EntityBoat.edit.java b/patches/minecraft/net/minecraft/entity/item/EntityBoat.edit.java index 7572609..1ebc4b2 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityBoat.edit.java +++ b/patches/minecraft/net/minecraft/entity/item/EntityBoat.edit.java @@ -5,4 +5,10 @@ # Version: 1.0 # Author: lax1dude +> CHANGE 46 : 49 @ 46 : 49 + +~ this.dataWatcher.addObject(17, Integer.valueOf(0)); +~ this.dataWatcher.addObject(18, Integer.valueOf(1)); +~ this.dataWatcher.addObject(19, Float.valueOf(0.0F)); + > EOF diff --git a/patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.edit.java b/patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.edit.java index 475f025..6bc1f1b 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.edit.java +++ b/patches/minecraft/net/minecraft/entity/item/EntityFallingBlock.edit.java @@ -9,4 +9,9 @@ ~ ArrayList arraylist = Lists.newArrayList( +> CHANGE 4 : 6 @ 4 : 6 + +~ for (int j = 0, l = arraylist.size(); j < l; ++j) { +~ arraylist.get(j).attackEntityFrom(damagesource, (float) Math + > EOF diff --git a/patches/minecraft/net/minecraft/entity/item/EntityItem.edit.java b/patches/minecraft/net/minecraft/entity/item/EntityItem.edit.java index cfbc2cc..667ee1d 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityItem.edit.java +++ b/patches/minecraft/net/minecraft/entity/item/EntityItem.edit.java @@ -5,8 +5,10 @@ # Version: 1.0 # Author: lax1dude -> INSERT 2 : 4 @ 2 +> INSERT 2 : 6 @ 2 ++ import java.util.List; ++ + import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; + import net.lax1dude.eaglercraft.v1_8.log4j.Logger; @@ -16,7 +18,14 @@ > DELETE 13 @ 13 : 15 -> INSERT 362 : 371 @ 362 +> CHANGE 101 : 105 @ 101 : 104 + +~ List lst = this.worldObj.getEntitiesWithinAABB(EntityItem.class, +~ this.getEntityBoundingBox().expand(0.5D, 0.0D, 0.5D)); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ this.combineItems(lst.get(i)); + +> INSERT 258 : 267 @ 258 + + public boolean eaglerEmissiveFlag = false; diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.edit.java b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.edit.java index af33d1f..9953186 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.edit.java +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> DELETE 2 @ 2 : 3 +> CHANGE 2 : 3 @ 2 : 3 + +~ import java.util.List; > INSERT 1 : 4 @ 1 @@ -15,4 +17,25 @@ > DELETE 8 @ 8 : 13 +> CHANGE 68 : 73 @ 68 : 73 + +~ this.dataWatcher.addObject(17, Integer.valueOf(0)); +~ this.dataWatcher.addObject(18, Integer.valueOf(1)); +~ this.dataWatcher.addObject(19, Float.valueOf(0.0F)); +~ this.dataWatcher.addObject(20, Integer.valueOf(0)); +~ this.dataWatcher.addObject(21, Integer.valueOf(6)); + +> CHANGE 198 : 202 @ 198 : 200 + +~ List lst = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, +~ this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); +~ for (int i = 0, m = lst.size(); i < m; ++i) { +~ Entity entity = lst.get(i); + +> CHANGE 585 : 588 @ 585 : 588 + +~ EntityMinecart.EnumMinecartType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ ID_LOOKUP.put(Integer.valueOf(types[i].getNetworkID()), types[i]); + > EOF diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.edit.java b/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.edit.java index 0d7c65a..1b45b06 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.edit.java +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.edit.java @@ -7,4 +7,8 @@ > DELETE 4 @ 4 : 5 +> CHANGE 31 : 32 @ 31 : 32 + +~ this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + > EOF diff --git a/patches/minecraft/net/minecraft/entity/item/EntityPainting.edit.java b/patches/minecraft/net/minecraft/entity/item/EntityPainting.edit.java index bfb412b..b5e22f3 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityPainting.edit.java +++ b/patches/minecraft/net/minecraft/entity/item/EntityPainting.edit.java @@ -13,4 +13,31 @@ + import com.google.common.collect.Lists; + +> CHANGE 21 : 24 @ 21 : 23 + +~ EntityPainting.EnumArt[] types = EntityPainting.EnumArt._VALUES; +~ for (int i = 0; i < types.length; ++i) { +~ this.art = types[i]; + +> CHANGE 2 : 3 @ 2 : 3 + +~ arraylist.add(types[i]); + +> CHANGE 13 : 16 @ 13 : 14 + +~ EntityPainting.EnumArt[] types = EntityPainting.EnumArt._VALUES; +~ for (int i = 0; i < types.length; ++i) { +~ EntityPainting.EnumArt entitypainting$enumart = types[i]; + +> CHANGE 17 : 20 @ 17 : 18 + +~ EntityPainting.EnumArt[] types = EntityPainting.EnumArt._VALUES; +~ for (int i = 0; i < types.length; ++i) { +~ EntityPainting.EnumArt entitypainting$enumart = types[i]; + +> INSERT 56 : 58 @ 56 + ++ public static final EnumArt[] _VALUES = values(); ++ + > EOF diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityBlaze.edit.java b/patches/minecraft/net/minecraft/entity/monster/EntityBlaze.edit.java index 0a8daba..0e688dc 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityBlaze.edit.java +++ b/patches/minecraft/net/minecraft/entity/monster/EntityBlaze.edit.java @@ -11,7 +11,11 @@ > DELETE 9 @ 9 : 10 -> INSERT 222 : 229 @ 222 +> CHANGE 36 : 37 @ 36 : 37 + +~ this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + +> INSERT 185 : 192 @ 185 + + protected void renderDynamicLightsEaglerAt(double entityX, double entityY, double entityZ, double renderX, diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.edit.java b/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.edit.java index 3ba7c10..832f020 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.edit.java +++ b/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.edit.java @@ -20,7 +20,13 @@ ~ private static final EaglercraftUUID attackingSpeedBoostModifierUUID = EaglercraftUUID ~ .fromString("020E0DFB-87AE-4653-9556-831010E291A0"); -> CHANGE 280 : 281 @ 280 : 281 +> CHANGE 36 : 39 @ 36 : 39 + +~ this.dataWatcher.addObject(16, Short.valueOf((short) 0)); +~ this.dataWatcher.addObject(17, Byte.valueOf((byte) 0)); +~ this.dataWatcher.addObject(18, Byte.valueOf((byte) 0)); + +> CHANGE 241 : 242 @ 241 : 242 ~ public static void bootstrap() { diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityGuardian.edit.java b/patches/minecraft/net/minecraft/entity/monster/EntityGuardian.edit.java index ffbb9b2..061a46e 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityGuardian.edit.java +++ b/patches/minecraft/net/minecraft/entity/monster/EntityGuardian.edit.java @@ -5,6 +5,21 @@ # Version: 1.0 # Author: lax1dude -> DELETE 15 @ 15 : 16 +> INSERT 2 : 4 @ 2 + ++ import java.util.List; ++ + +> DELETE 13 @ 13 : 14 + +> CHANGE 317 : 318 @ 317 : 318 + +~ List lst = this.worldObj.getPlayers(EntityPlayerMP.class, + +> CHANGE 5 : 8 @ 5 : 6 + +~ }); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ EntityPlayerMP entityplayermp = lst.get(i); > EOF diff --git a/patches/minecraft/net/minecraft/entity/monster/EntitySkeleton.edit.java b/patches/minecraft/net/minecraft/entity/monster/EntitySkeleton.edit.java index afcfc7e..cd8062b 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntitySkeleton.edit.java +++ b/patches/minecraft/net/minecraft/entity/monster/EntitySkeleton.edit.java @@ -7,4 +7,8 @@ > DELETE 24 @ 24 : 27 +> CHANGE 47 : 48 @ 47 : 48 + +~ this.dataWatcher.addObject(13, Byte.valueOf((byte) 0)); + > EOF diff --git a/patches/minecraft/net/minecraft/entity/monster/EntitySpider.edit.java b/patches/minecraft/net/minecraft/entity/monster/EntitySpider.edit.java index 4bbf235..b491c23 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntitySpider.edit.java +++ b/patches/minecraft/net/minecraft/entity/monster/EntitySpider.edit.java @@ -11,7 +11,11 @@ > DELETE 14 @ 14 : 17 -> CHANGE 180 : 181 @ 180 : 181 +> CHANGE 38 : 39 @ 38 : 39 + +~ this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + +> CHANGE 141 : 142 @ 141 : 142 ~ public void func_111104_a(EaglercraftRandom rand) { diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityWitch.edit.java b/patches/minecraft/net/minecraft/entity/monster/EntityWitch.edit.java index ccfa58f..bfce8ee 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityWitch.edit.java +++ b/patches/minecraft/net/minecraft/entity/monster/EntityWitch.edit.java @@ -20,4 +20,9 @@ ~ List list = Items.potionitem.getEffects(itemstack); +> CHANGE 1 : 3 @ 1 : 3 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ this.addPotionEffect(new PotionEffect(list.get(i))); + > EOF diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityBat.edit.java b/patches/minecraft/net/minecraft/entity/passive/EntityBat.edit.java index 97688dc..d6538ee 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityBat.edit.java +++ b/patches/minecraft/net/minecraft/entity/passive/EntityBat.edit.java @@ -7,4 +7,8 @@ > DELETE 6 @ 6 : 7 +> CHANGE 18 : 19 @ 18 : 19 + +~ this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + > EOF diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityHorse.edit.java b/patches/minecraft/net/minecraft/entity/passive/EntityHorse.edit.java index 73edf4d..4778f2d 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityHorse.edit.java +++ b/patches/minecraft/net/minecraft/entity/passive/EntityHorse.edit.java @@ -5,7 +5,12 @@ # Version: 1.0 # Author: lax1dude -> INSERT 3 : 5 @ 3 +> INSERT 2 : 4 @ 2 + ++ import java.util.List; ++ + +> INSERT 1 : 3 @ 1 + + import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; @@ -14,7 +19,14 @@ > DELETE 12 @ 12 : 13 -> CHANGE 1015 : 1020 @ 1015 : 1016 +> CHANGE 381 : 385 @ 381 : 383 + +~ List lst = this.worldObj.getEntitiesInAABBexcluding(entityIn, +~ entityIn.getEntityBoundingBox().addCoord(distance, distance, distance), horseBreedingSelector); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ Entity entity1 = lst.get(i); + +> CHANGE 632 : 637 @ 632 : 633 ~ if (worldObj.isRemote && !SingleplayerServerController.isClientInEaglerSingleplayerOrLAN()) { ~ nbttagcompound.setString("OwnerUUID", this.getOwnerId()); diff --git a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.edit.java b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.edit.java index 888b696..33f8552 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.edit.java +++ b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.edit.java @@ -11,7 +11,11 @@ > DELETE 14 @ 14 : 15 -> CHANGE 193 : 194 @ 193 : 194 +> CHANGE 68 : 69 @ 68 : 69 + +~ this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + +> CHANGE 124 : 125 @ 124 : 125 ~ public static EnumDyeColor getRandomSheepColor(EaglercraftRandom random) { diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityVillager.edit.java b/patches/minecraft/net/minecraft/entity/passive/EntityVillager.edit.java index 38b6206..5f1f0f9 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityVillager.edit.java +++ b/patches/minecraft/net/minecraft/entity/passive/EntityVillager.edit.java @@ -5,48 +5,59 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 2 : 3 @ 2 : 3 +> CHANGE 2 : 6 @ 2 : 3 +~ import java.util.Arrays; +~ import java.util.List; +~ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; > CHANGE 77 : 78 @ 77 : 229 -~ private static EntityVillager.ITradeList[][][][] DEFAULT_TRADE_LIST_MAP = null; +~ private static List>>> DEFAULT_TRADE_LIST_MAP = null; -> INSERT 1 : 166 @ 1 +> INSERT 1 : 206 @ 1 + public static void bootstrap() { -+ DEFAULT_TRADE_LIST_MAP = new EntityVillager.ITradeList[][][][] { -+ { { { new EntityVillager.EmeraldForItems(Items.wheat, new EntityVillager.PriceInfo(18, 22)), ++ DEFAULT_TRADE_LIST_MAP = Arrays.asList( ++ Arrays.asList(Arrays.asList(Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.wheat, new EntityVillager.PriceInfo(18, 22)), + new EntityVillager.EmeraldForItems(Items.potato, new EntityVillager.PriceInfo(15, 19)), + new EntityVillager.EmeraldForItems(Items.carrot, + new EntityVillager.PriceInfo(15, 19)), -+ new EntityVillager.ListItemForEmeralds(Items.bread, new EntityVillager.PriceInfo(-4, -2)) }, -+ { new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.pumpkin), -+ new EntityVillager.PriceInfo(8, 13)), ++ new EntityVillager.ListItemForEmeralds(Items.bread, new EntityVillager.PriceInfo(-4, -2))), ++ Arrays.asList( ++ new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.pumpkin), ++ new EntityVillager.PriceInfo(8, 13)), + new EntityVillager.ListItemForEmeralds(Items.pumpkin_pie, -+ new EntityVillager.PriceInfo(-3, -2)) }, -+ { new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.melon_block), -+ new EntityVillager.PriceInfo(7, 12)), ++ new EntityVillager.PriceInfo(-3, -2))), ++ Arrays.asList( ++ new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.melon_block), ++ new EntityVillager.PriceInfo(7, 12)), + new EntityVillager.ListItemForEmeralds(Items.apple, -+ new EntityVillager.PriceInfo(-5, -7)) }, -+ { new EntityVillager.ListItemForEmeralds(Items.cookie, new EntityVillager.PriceInfo(-6, -10)), ++ new EntityVillager.PriceInfo(-5, -7))), ++ Arrays.asList( ++ new EntityVillager.ListItemForEmeralds(Items.cookie, ++ new EntityVillager.PriceInfo(-6, -10)), + new EntityVillager.ListItemForEmeralds(Items.cake, -+ new EntityVillager.PriceInfo(1, 1)) } }, -+ { { new EntityVillager.EmeraldForItems(Items.string, new EntityVillager.PriceInfo(15, 20)), ++ new EntityVillager.PriceInfo(1, 1)))), ++ Arrays.asList(Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.string, new EntityVillager.PriceInfo(15, 20)), + new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), -+ new EntityVillager.ItemAndEmeraldToItem( -+ Items.fish, new EntityVillager.PriceInfo(6, 6), Items.cooked_fish, -+ new EntityVillager.PriceInfo(6, 6)) }, -+ { new EntityVillager.ListEnchantedItemForEmeralds(Items.fishing_rod, -+ new EntityVillager.PriceInfo(7, 8)) } }, -+ { { new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.wool), -+ new EntityVillager.PriceInfo(16, 22)), -+ new EntityVillager.ListItemForEmeralds(Items.shears, -+ new EntityVillager.PriceInfo(3, 4)) }, -+ { new EntityVillager.ListItemForEmeralds( -+ new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 0), -+ new EntityVillager.PriceInfo(1, 2)), ++ new EntityVillager.ItemAndEmeraldToItem(Items.fish, new EntityVillager.PriceInfo(6, 6), ++ Items.cooked_fish, new EntityVillager.PriceInfo(6, 6))), ++ Arrays.asList(new EntityVillager.ListEnchantedItemForEmeralds(Items.fishing_rod, ++ new EntityVillager.PriceInfo(7, 8)))), ++ Arrays.asList( ++ Arrays.asList( ++ new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.wool), ++ new EntityVillager.PriceInfo(16, 22)), ++ new EntityVillager.ListItemForEmeralds(Items.shears, ++ new EntityVillager.PriceInfo(3, 4))), ++ Arrays.asList( ++ new EntityVillager.ListItemForEmeralds( ++ new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 0), ++ new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 1), + new EntityVillager.PriceInfo(1, 2)), @@ -91,97 +102,134 @@ + new EntityVillager.PriceInfo(1, 2)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 15), -+ new EntityVillager.PriceInfo(1, 2)) } }, -+ { { new EntityVillager.EmeraldForItems(Items.string, new EntityVillager.PriceInfo(15, 20)), ++ new EntityVillager.PriceInfo(1, 2)))), ++ Arrays.asList(Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.string, new EntityVillager.PriceInfo(15, 20)), + new EntityVillager.ListItemForEmeralds(Items.arrow, -+ new EntityVillager.PriceInfo(-12, -8)) }, -+ { new EntityVillager.ListItemForEmeralds(Items.bow, new EntityVillager.PriceInfo(2, 3)), ++ new EntityVillager.PriceInfo(-12, -8))), ++ Arrays.asList( ++ new EntityVillager.ListItemForEmeralds(Items.bow, ++ new EntityVillager.PriceInfo(2, 3)), + new EntityVillager.ItemAndEmeraldToItem(Item.getItemFromBlock(Blocks.gravel), + new EntityVillager.PriceInfo(10, 10), Items.flint, -+ new EntityVillager.PriceInfo(6, 10)) } } }, -+ { { { new EntityVillager.EmeraldForItems(Items.paper, new EntityVillager.PriceInfo(24, 36)), -+ new EntityVillager.ListEnchantedBookForEmeralds() }, -+ { new EntityVillager.EmeraldForItems(Items.book, new EntityVillager.PriceInfo(8, 10)), ++ new EntityVillager.PriceInfo(6, 10))))), ++ Arrays.asList(Arrays.asList( ++ Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.paper, new EntityVillager.PriceInfo(24, 36)), ++ new EntityVillager.ListEnchantedBookForEmeralds()), ++ Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.book, new EntityVillager.PriceInfo(8, 10)), + new EntityVillager.ListItemForEmeralds(Items.compass, + new EntityVillager.PriceInfo(10, 12)), + new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.bookshelf), -+ new EntityVillager.PriceInfo(3, 4)) }, -+ { new EntityVillager.EmeraldForItems(Items.written_book, new EntityVillager.PriceInfo(2, 2)), ++ new EntityVillager.PriceInfo(3, 4))), ++ Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.written_book, ++ new EntityVillager.PriceInfo(2, 2)), + new EntityVillager.ListItemForEmeralds(Items.clock, + new EntityVillager.PriceInfo(10, 12)), + new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.glass), -+ new EntityVillager.PriceInfo(-5, -3)) }, -+ { new EntityVillager.ListEnchantedBookForEmeralds() }, -+ { new EntityVillager.ListEnchantedBookForEmeralds() }, -+ { new EntityVillager.ListItemForEmeralds(Items.name_tag, -+ new EntityVillager.PriceInfo(20, 22)) } } }, -+ { { { new EntityVillager.EmeraldForItems(Items.rotten_flesh, new EntityVillager.PriceInfo(36, 40)), -+ new EntityVillager.EmeraldForItems(Items.gold_ingot, new EntityVillager.PriceInfo(8, 10)) }, -+ { new EntityVillager.ListItemForEmeralds(Items.redstone, new EntityVillager.PriceInfo(-4, -1)), ++ new EntityVillager.PriceInfo(-5, -3))), ++ Arrays.asList(new EntityVillager.ListEnchantedBookForEmeralds()), ++ Arrays.asList(new EntityVillager.ListEnchantedBookForEmeralds()), ++ Arrays.asList(new EntityVillager.ListItemForEmeralds(Items.name_tag, ++ new EntityVillager.PriceInfo(20, 22))))), ++ Arrays.asList(Arrays.asList(Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.rotten_flesh, new EntityVillager.PriceInfo(36, 40)), ++ new EntityVillager.EmeraldForItems(Items.gold_ingot, new EntityVillager.PriceInfo(8, 10))), ++ Arrays.asList( ++ new EntityVillager.ListItemForEmeralds(Items.redstone, ++ new EntityVillager.PriceInfo(-4, -1)), + new EntityVillager.ListItemForEmeralds( + new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), -+ new EntityVillager.PriceInfo(-2, -1)) }, -+ { new EntityVillager.ListItemForEmeralds(Items.ender_eye, new EntityVillager.PriceInfo(7, 11)), ++ new EntityVillager.PriceInfo(-2, -1))), ++ Arrays.asList( ++ new EntityVillager.ListItemForEmeralds(Items.ender_eye, ++ new EntityVillager.PriceInfo(7, 11)), + new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.glowstone), -+ new EntityVillager.PriceInfo(-3, -1)) }, -+ { new EntityVillager.ListItemForEmeralds(Items.experience_bottle, -+ new EntityVillager.PriceInfo(3, 11)) } } }, -+ { { { new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), -+ new EntityVillager.ListItemForEmeralds(Items.iron_helmet, new EntityVillager.PriceInfo(4, 6)) }, -+ { new EntityVillager.EmeraldForItems(Items.iron_ingot, new EntityVillager.PriceInfo(7, 9)), -+ new EntityVillager.ListItemForEmeralds(Items.iron_chestplate, -+ new EntityVillager.PriceInfo(10, 14)) }, -+ { new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), -+ new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_chestplate, -+ new EntityVillager.PriceInfo(16, 19)) }, -+ { new EntityVillager.ListItemForEmeralds(Items.chainmail_boots, -+ new EntityVillager.PriceInfo(5, 7)), -+ new EntityVillager.ListItemForEmeralds(Items.chainmail_leggings, -+ new EntityVillager.PriceInfo(9, 11)), -+ new EntityVillager.ListItemForEmeralds(Items.chainmail_helmet, -+ new EntityVillager.PriceInfo(5, 7)), -+ new EntityVillager.ListItemForEmeralds(Items.chainmail_chestplate, -+ new EntityVillager.PriceInfo(11, 15)) } }, -+ { { new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), ++ new EntityVillager.PriceInfo(-3, -1))), ++ Arrays.asList(new EntityVillager.ListItemForEmeralds(Items.experience_bottle, ++ new EntityVillager.PriceInfo(3, 11))))), ++ Arrays.asList( ++ Arrays.asList(Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), ++ new EntityVillager.ListItemForEmeralds(Items.iron_helmet, ++ new EntityVillager.PriceInfo(4, 6))), ++ Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.iron_ingot, ++ new EntityVillager.PriceInfo(7, 9)), ++ new EntityVillager.ListItemForEmeralds(Items.iron_chestplate, ++ new EntityVillager.PriceInfo(10, 14))), ++ Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.diamond, ++ new EntityVillager.PriceInfo(3, 4)), ++ new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_chestplate, ++ new EntityVillager.PriceInfo(16, 19))), ++ Arrays.asList( ++ new EntityVillager.ListItemForEmeralds(Items.chainmail_boots, ++ new EntityVillager.PriceInfo(5, 7)), ++ new EntityVillager.ListItemForEmeralds(Items.chainmail_leggings, ++ new EntityVillager.PriceInfo(9, 11)), ++ new EntityVillager.ListItemForEmeralds(Items.chainmail_helmet, ++ new EntityVillager.PriceInfo(5, 7)), ++ new EntityVillager.ListItemForEmeralds(Items.chainmail_chestplate, ++ new EntityVillager.PriceInfo(11, 15)))), ++ Arrays.asList(Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), + new EntityVillager.ListItemForEmeralds(Items.iron_axe, -+ new EntityVillager.PriceInfo(6, 8)) }, -+ { new EntityVillager.EmeraldForItems(Items.iron_ingot, -+ new EntityVillager.PriceInfo(7, 9)), ++ new EntityVillager.PriceInfo(6, 8))), ++ Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.iron_ingot, ++ new EntityVillager.PriceInfo(7, 9)), + new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_sword, -+ new EntityVillager.PriceInfo(9, 10)) }, -+ { new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), ++ new EntityVillager.PriceInfo(9, 10))), ++ Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.diamond, ++ new EntityVillager.PriceInfo(3, 4)), + new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_sword, + new EntityVillager.PriceInfo(12, 15)), + new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_axe, -+ new EntityVillager.PriceInfo(9, 12)) } }, -+ { { new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), ++ new EntityVillager.PriceInfo(9, 12)))), ++ Arrays.asList(Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), + new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_shovel, -+ new EntityVillager.PriceInfo(5, 7)) }, -+ { new EntityVillager.EmeraldForItems(Items.iron_ingot, -+ new EntityVillager.PriceInfo(7, 9)), ++ new EntityVillager.PriceInfo(5, 7))), ++ Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.iron_ingot, ++ new EntityVillager.PriceInfo(7, 9)), + new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_pickaxe, -+ new EntityVillager.PriceInfo(9, 11)) }, -+ { new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), ++ new EntityVillager.PriceInfo(9, 11))), ++ Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.diamond, ++ new EntityVillager.PriceInfo(3, 4)), + new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_pickaxe, -+ new EntityVillager.PriceInfo(12, 15)) } } }, -+ { { { new EntityVillager.EmeraldForItems(Items.porkchop, new EntityVillager.PriceInfo(14, 18)), -+ new EntityVillager.EmeraldForItems(Items.chicken, new EntityVillager.PriceInfo(14, 18)) }, -+ { new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), ++ new EntityVillager.PriceInfo(12, 15))))), ++ Arrays.asList(Arrays.asList(Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.porkchop, new EntityVillager.PriceInfo(14, 18)), ++ new EntityVillager.EmeraldForItems(Items.chicken, new EntityVillager.PriceInfo(14, 18))), ++ Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), + new EntityVillager.ListItemForEmeralds(Items.cooked_porkchop, + new EntityVillager.PriceInfo(-7, -5)), + new EntityVillager.ListItemForEmeralds(Items.cooked_chicken, -+ new EntityVillager.PriceInfo(-8, -6)) } }, -+ { { new EntityVillager.EmeraldForItems(Items.leather, new EntityVillager.PriceInfo(9, 12)), ++ new EntityVillager.PriceInfo(-8, -6)))), ++ Arrays.asList(Arrays.asList( ++ new EntityVillager.EmeraldForItems(Items.leather, new EntityVillager.PriceInfo(9, 12)), + new EntityVillager.ListItemForEmeralds(Items.leather_leggings, -+ new EntityVillager.PriceInfo(2, 4)) }, -+ { new EntityVillager.ListEnchantedItemForEmeralds(Items.leather_chestplate, -+ new EntityVillager.PriceInfo(7, 12)) }, -+ { new EntityVillager.ListItemForEmeralds(Items.saddle, -+ new EntityVillager.PriceInfo(8, 10)) } } } }; ++ new EntityVillager.PriceInfo(2, 4))), ++ Arrays.asList(new EntityVillager.ListEnchantedItemForEmeralds(Items.leather_chestplate, ++ new EntityVillager.PriceInfo(7, 12))), ++ Arrays.asList(new EntityVillager.ListItemForEmeralds(Items.saddle, ++ new EntityVillager.PriceInfo(8, 10)))))); + } + -> CHANGE 125 : 130 @ 125 : 126 +> CHANGE 75 : 77 @ 75 : 76 + +~ for (int i = 0, l = this.buyingList.size(); i < l; ++i) { +~ MerchantRecipe merchantrecipe = this.buyingList.get(i); + +> CHANGE 49 : 54 @ 49 : 50 ~ try { ~ nbttagcompound.setTag("Offers", this.buyingList.getRecipiesAsTags()); @@ -189,7 +237,27 @@ ~ this.buyingList = null; // workaround ~ } -> CHANGE 467 : 468 @ 467 : 468 +> CHANGE 211 : 213 @ 211 : 212 + +~ List>> aentityvillager$itradelist = DEFAULT_TRADE_LIST_MAP +~ .get(this.getProfession()); + +> CHANGE 3 : 4 @ 3 : 4 + +~ this.careerId = this.rand.nextInt(aentityvillager$itradelist.size()) + 1; + +> CHANGE 9 : 12 @ 9 : 12 + +~ List> aentityvillager$itradelist1 = aentityvillager$itradelist.get(i); +~ if (j >= 0 && j < aentityvillager$itradelist1.size()) { +~ List aentityvillager$itradelist2 = aentityvillager$itradelist1.get(j); + +> CHANGE 1 : 3 @ 1 : 3 + +~ for (int k = 0, l = aentityvillager$itradelist2.size(); k < l; ++k) { +~ aentityvillager$itradelist2.get(k).modifyMerchantRecipeList(this.buyingList, this.rand); + +> CHANGE 236 : 237 @ 236 : 237 ~ public void modifyMerchantRecipeList(MerchantRecipeList recipeList, EaglercraftRandom random) { diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityWolf.edit.java b/patches/minecraft/net/minecraft/entity/passive/EntityWolf.edit.java index f507e8b..83e359c 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityWolf.edit.java +++ b/patches/minecraft/net/minecraft/entity/passive/EntityWolf.edit.java @@ -7,4 +7,10 @@ > DELETE 25 @ 25 : 30 +> CHANGE 79 : 82 @ 79 : 82 + +~ this.dataWatcher.addObject(18, Float.valueOf(this.getHealth())); +~ this.dataWatcher.addObject(19, Byte.valueOf((byte) 0)); +~ this.dataWatcher.addObject(20, Byte.valueOf((byte) EnumDyeColor.RED.getMetadata())); + > EOF diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.edit.java b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.edit.java index 0b50ac5..b7ffecd 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.edit.java +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.edit.java @@ -28,7 +28,13 @@ ~ Collection collection = this.getWorldScoreboard() -> INSERT 348 : 359 @ 348 +> CHANGE 271 : 274 @ 271 : 273 + +~ ItemStack[] stack = this.inventory.armorInventory; +~ for (int j = 0; j < stack.length; ++j) { +~ if (stack[j] != null) { + +> INSERT 75 : 86 @ 75 + } else if (!this.worldObj.isRemote && MinecraftServer.getServer().worldServers[0].getWorldInfo() + .getGameRulesInstance().getBoolean("clickToRide") && itemstack == null @@ -52,4 +58,14 @@ ~ public static EaglercraftUUID getOfflineUUID(String username) { ~ return EaglercraftUUID.nameUUIDFromBytes(("OfflinePlayer:" + username).getBytes(Charsets.UTF_8)); +> CHANGE 66 : 67 @ 66 : 67 + +~ private static final EntityPlayer.EnumChatVisibility[] ID_LOOKUP = new EntityPlayer.EnumChatVisibility[3]; + +> CHANGE 21 : 24 @ 21 : 23 + +~ EntityPlayer.EnumChatVisibility[] lst = values(); +~ for (int i = 0; i < lst.length; ++i) { +~ ID_LOOKUP[lst[i].chatVisibility] = lst[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.edit.java b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.edit.java index 1d368b7..7afbaf1 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.edit.java +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.edit.java @@ -10,7 +10,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; ~ import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; -> DELETE 69 @ 69 : 70 +> DELETE 17 @ 17 : 18 + +> DELETE 51 @ 51 : 52 > CHANGE 22 : 24 @ 22 : 24 @@ -29,15 +31,17 @@ ~ if (!this.openContainer.canInteractWith(this)) { -> CHANGE 51 : 52 @ 51 : 52 +> CHANGE 51 : 53 @ 51 : 53 -~ for (TileEntity tileentity : (ArrayList) arraylist1) { +~ for (int i = 0, l = arraylist1.size(); i < l; ++i) { +~ this.sendTileEntityUpdate((TileEntity) arraylist1.get(i)); -> CHANGE 3 : 4 @ 3 : 4 +> CHANGE 2 : 4 @ 2 : 4 -~ for (Chunk chunk1 : (ArrayList) arraylist) { +~ for (int i = 0, l = arraylist.size(); i < l; ++i) { +~ this.getServerForPlayer().getEntityTracker().func_85172_a(this, (Chunk) arraylist.get(i)); -> CHANGE 582 : 583 @ 582 : 583 +> CHANGE 581 : 582 @ 581 : 582 ~ if ("seed".equals(s)) { diff --git a/patches/minecraft/net/minecraft/entity/player/EnumPlayerModelParts.edit.java b/patches/minecraft/net/minecraft/entity/player/EnumPlayerModelParts.edit.java new file mode 100644 index 0000000..da9aee3 --- /dev/null +++ b/patches/minecraft/net/minecraft/entity/player/EnumPlayerModelParts.edit.java @@ -0,0 +1,13 @@ + +# Eagler Context Redacted Diff +# Copyright (c) 2024 lax1dude. All rights reserved. + +# Version: 1.0 +# Author: lax1dude + +> INSERT 9 : 11 @ 9 + ++ public static final EnumPlayerModelParts[] _VALUES = values(); ++ + +> EOF diff --git a/patches/minecraft/net/minecraft/entity/projectile/EntityPotion.edit.java b/patches/minecraft/net/minecraft/entity/projectile/EntityPotion.edit.java index 2a9912e..de1a02d 100644 --- a/patches/minecraft/net/minecraft/entity/projectile/EntityPotion.edit.java +++ b/patches/minecraft/net/minecraft/entity/projectile/EntityPotion.edit.java @@ -7,12 +7,14 @@ > DELETE 4 @ 4 : 5 -> CHANGE 70 : 71 @ 70 : 71 +> CHANGE 70 : 72 @ 70 : 71 -~ for (EntityLivingBase entitylivingbase : (List) list1) { +~ for (int k = 0, l = list1.size(); k < l; ++k) { +~ EntityLivingBase entitylivingbase = (EntityLivingBase) list1.get(k); -> CHANGE 7 : 8 @ 7 : 8 +> CHANGE 7 : 9 @ 7 : 8 -~ for (PotionEffect potioneffect : (List) list) { +~ for (int m = 0, n = list.size(); m < n; ++m) { +~ PotionEffect potioneffect = (PotionEffect) list.get(m); > EOF diff --git a/patches/minecraft/net/minecraft/event/ClickEvent.edit.java b/patches/minecraft/net/minecraft/event/ClickEvent.edit.java index 4ccfed7..70d5174 100644 --- a/patches/minecraft/net/minecraft/event/ClickEvent.edit.java +++ b/patches/minecraft/net/minecraft/event/ClickEvent.edit.java @@ -16,4 +16,10 @@ ~ CHANGE_PAGE("change_page", true), EAGLER_PLUGIN_DOWNLOAD("eagler_plugin_download", true); +> CHANGE 23 : 26 @ 23 : 25 + +~ ClickEvent.Action[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ nameMapping.put(types[i].getCanonicalName(), types[i]); + > EOF diff --git a/patches/minecraft/net/minecraft/event/HoverEvent.edit.java b/patches/minecraft/net/minecraft/event/HoverEvent.edit.java index 2493e99..c8b1da0 100644 --- a/patches/minecraft/net/minecraft/event/HoverEvent.edit.java +++ b/patches/minecraft/net/minecraft/event/HoverEvent.edit.java @@ -13,4 +13,10 @@ + import com.google.common.collect.Maps; + +> CHANGE 78 : 81 @ 78 : 80 + +~ HoverEvent.Action[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ nameMapping.put(types[i].getCanonicalName(), types[i]); + > EOF diff --git a/patches/minecraft/net/minecraft/init/Bootstrap.edit.java b/patches/minecraft/net/minecraft/init/Bootstrap.edit.java index 05803e7..a257df0 100644 --- a/patches/minecraft/net/minecraft/init/Bootstrap.edit.java +++ b/patches/minecraft/net/minecraft/init/Bootstrap.edit.java @@ -19,7 +19,9 @@ + import net.minecraft.entity.monster.EntityEnderman; + import net.minecraft.entity.passive.EntityVillager; -> INSERT 9 : 10 @ 9 +> DELETE 5 @ 5 : 7 + +> INSERT 2 : 3 @ 2 + import net.minecraft.item.ItemAxe; diff --git a/patches/minecraft/net/minecraft/item/EnumDyeColor.edit.java b/patches/minecraft/net/minecraft/item/EnumDyeColor.edit.java new file mode 100644 index 0000000..6e75ce5 --- /dev/null +++ b/patches/minecraft/net/minecraft/item/EnumDyeColor.edit.java @@ -0,0 +1,19 @@ + +# Eagler Context Redacted Diff +# Copyright (c) 2024 lax1dude. All rights reserved. + +# Version: 1.0 +# Author: lax1dude + +> CHANGE 24 : 26 @ 24 : 26 + +~ public static final EnumDyeColor[] META_LOOKUP = new EnumDyeColor[16]; +~ public static final EnumDyeColor[] DYE_DMG_LOOKUP = new EnumDyeColor[16]; + +> CHANGE 58 : 61 @ 58 : 59 + +~ EnumDyeColor[] colors = values(); +~ for (int i = 0; i < colors.length; ++i) { +~ EnumDyeColor enumdyecolor = colors[i]; + +> EOF diff --git a/patches/minecraft/net/minecraft/item/ItemBanner.edit.java b/patches/minecraft/net/minecraft/item/ItemBanner.edit.java index 3e21c15..40a6641 100644 --- a/patches/minecraft/net/minecraft/item/ItemBanner.edit.java +++ b/patches/minecraft/net/minecraft/item/ItemBanner.edit.java @@ -7,4 +7,10 @@ > DELETE 8 @ 8 : 12 +> CHANGE 92 : 95 @ 92 : 93 + +~ EnumDyeColor[] colors = EnumDyeColor.META_LOOKUP; +~ for (int i = 0; i < colors.length; ++i) { +~ EnumDyeColor enumdyecolor = colors[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/item/ItemFireworkCharge.edit.java b/patches/minecraft/net/minecraft/item/ItemFireworkCharge.edit.java index 4f8322e..1d13cfe 100644 --- a/patches/minecraft/net/minecraft/item/ItemFireworkCharge.edit.java +++ b/patches/minecraft/net/minecraft/item/ItemFireworkCharge.edit.java @@ -11,4 +11,19 @@ > DELETE 1 @ 1 : 5 +> CHANGE 23 : 25 @ 23 : 24 + +~ for (int m = 0; m < aint.length; ++m) { +~ int i1 = aint[m]; + +> CHANGE 48 : 50 @ 48 : 49 + +~ for (int m = 0; m < aint.length; ++m) { +~ int i = aint[m]; + +> CHANGE 29 : 31 @ 29 : 30 + +~ for (int m = 0; m < aint1.length; ++m) { +~ int l = aint1[m]; + > EOF diff --git a/patches/minecraft/net/minecraft/item/ItemFishFood.edit.java b/patches/minecraft/net/minecraft/item/ItemFishFood.edit.java index 9b36091..3eb8c4b 100644 --- a/patches/minecraft/net/minecraft/item/ItemFishFood.edit.java +++ b/patches/minecraft/net/minecraft/item/ItemFishFood.edit.java @@ -15,4 +15,16 @@ > DELETE 2 @ 2 : 5 +> CHANGE 43 : 46 @ 43 : 44 + +~ ItemFishFood.FishType[] types = ItemFishFood.FishType.values(); +~ for (int i = 0; i < types.length; ++i) { +~ ItemFishFood.FishType itemfishfood$fishtype = types[i]; + +> CHANGE 86 : 89 @ 86 : 88 + +~ ItemFishFood.FishType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ META_LOOKUP.put(Integer.valueOf(types[i].getMetadata()), types[i]); + > EOF diff --git a/patches/minecraft/net/minecraft/item/ItemLead.edit.java b/patches/minecraft/net/minecraft/item/ItemLead.edit.java index b723c56..6fb0a30 100644 --- a/patches/minecraft/net/minecraft/item/ItemLead.edit.java +++ b/patches/minecraft/net/minecraft/item/ItemLead.edit.java @@ -5,6 +5,18 @@ # Version: 1.0 # Author: lax1dude -> DELETE 8 @ 8 : 10 +> INSERT 2 : 4 @ 2 + ++ import java.util.List; ++ + +> DELETE 6 @ 6 : 8 + +> CHANGE 33 : 37 @ 33 : 36 + +~ List lst = worldIn.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB((double) i - d0, +~ (double) j - d0, (double) k - d0, (double) i + d0, (double) j + d0, (double) k + d0)); +~ for (int m = 0, l = lst.size(); m < l; ++m) { +~ EntityLiving entityliving = lst.get(m); > EOF diff --git a/patches/minecraft/net/minecraft/item/ItemMonsterPlacer.edit.java b/patches/minecraft/net/minecraft/item/ItemMonsterPlacer.edit.java index 7572609..f72c226 100644 --- a/patches/minecraft/net/minecraft/item/ItemMonsterPlacer.edit.java +++ b/patches/minecraft/net/minecraft/item/ItemMonsterPlacer.edit.java @@ -5,4 +5,6 @@ # Version: 1.0 # Author: lax1dude +> DELETE 14 @ 14 : 16 + > EOF diff --git a/patches/minecraft/net/minecraft/item/ItemPotion.edit.java b/patches/minecraft/net/minecraft/item/ItemPotion.edit.java index f7ae9d5..48537b9 100644 --- a/patches/minecraft/net/minecraft/item/ItemPotion.edit.java +++ b/patches/minecraft/net/minecraft/item/ItemPotion.edit.java @@ -18,17 +18,32 @@ > DELETE 6 @ 6 : 9 -> CHANGE 64 : 65 @ 64 : 65 +> CHANGE 62 : 63 @ 62 : 63 -~ for (PotionEffect potioneffect : (List) list) { +~ List list = this.getEffects(itemstack); -> CHANGE 59 : 60 @ 59 : 60 +> CHANGE 1 : 3 @ 1 : 3 -~ for (PotionEffect potioneffect : (List) list) { +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ entityplayer.addPotionEffect(new PotionEffect(list.get(i))); -> CHANGE 37 : 38 @ 37 : 38 +> CHANGE 56 : 57 @ 56 : 57 -~ for (PotionEffect potioneffect : (List) list1) { +~ List list = this.getEffects(meta); + +> CHANGE 1 : 3 @ 1 : 3 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ if (Potion.potionTypes[list.get(i).getPotionID()].isInstant()) { + +> CHANGE 33 : 34 @ 33 : 34 + +~ List list1 = Items.potionitem.getEffects(itemstack); + +> CHANGE 2 : 4 @ 2 : 3 + +~ for (int i = 0, l = list1.size(); i < l; ++i) { +~ PotionEffect potioneffect = list1.get(i); > CHANGE 4 : 5 @ 4 : 5 diff --git a/patches/minecraft/net/minecraft/item/crafting/CraftingManager.edit.java b/patches/minecraft/net/minecraft/item/crafting/CraftingManager.edit.java index 1be5247..74ed1a3 100644 --- a/patches/minecraft/net/minecraft/item/crafting/CraftingManager.edit.java +++ b/patches/minecraft/net/minecraft/item/crafting/CraftingManager.edit.java @@ -26,4 +26,19 @@ + instance = new CraftingManager(); + } +> CHANGE 382 : 384 @ 382 : 383 + +~ for (int i = 0; i < recipeComponents.length; ++i) { +~ Object object = recipeComponents[i]; + +> CHANGE 22 : 24 @ 22 : 23 + +~ for (int i = 0, l = this.recipes.size(); i < l; ++i) { +~ IRecipe irecipe = this.recipes.get(i); + +> CHANGE 9 : 11 @ 9 : 10 + +~ for (int i = 0, l = this.recipes.size(); i < l; ++i) { +~ IRecipe irecipe = this.recipes.get(i); + > EOF diff --git a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.edit.java b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.edit.java index a13ea10..715fced 100644 --- a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.edit.java +++ b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.edit.java @@ -23,4 +23,10 @@ + smeltingBase = new FurnaceRecipes(); + } +> CHANGE 27 : 30 @ 27 : 28 + +~ ItemFishFood.FishType[] types = ItemFishFood.FishType.values(); +~ for (int i = 0; i < types.length; ++i) { +~ ItemFishFood.FishType itemfishfood$fishtype = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipesBanners.edit.java b/patches/minecraft/net/minecraft/item/crafting/RecipesBanners.edit.java index 81d6176..3ee9ac1 100644 --- a/patches/minecraft/net/minecraft/item/crafting/RecipesBanners.edit.java +++ b/patches/minecraft/net/minecraft/item/crafting/RecipesBanners.edit.java @@ -7,4 +7,16 @@ > DELETE 7 @ 7 : 9 +> CHANGE 7 : 10 @ 7 : 8 + +~ EnumDyeColor[] colors = EnumDyeColor.META_LOOKUP; +~ for (int i = 0; i < colors.length; ++i) { +~ EnumDyeColor enumdyecolor = colors[i]; + +> CHANGE 104 : 107 @ 104 : 106 + +~ TileEntityBanner.EnumBannerPattern[] patterns = TileEntityBanner.EnumBannerPattern._VALUES; +~ for (int m = 0; m < patterns.length; ++m) { +~ TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = patterns[m]; + > EOF diff --git a/patches/minecraft/net/minecraft/item/crafting/ShapelessRecipes.edit.java b/patches/minecraft/net/minecraft/item/crafting/ShapelessRecipes.edit.java index 6f064e1..a97fcc5 100644 --- a/patches/minecraft/net/minecraft/item/crafting/ShapelessRecipes.edit.java +++ b/patches/minecraft/net/minecraft/item/crafting/ShapelessRecipes.edit.java @@ -15,8 +15,13 @@ > DELETE 2 @ 2 : 3 -> CHANGE 37 : 38 @ 37 : 38 +> CHANGE 29 : 30 @ 29 : 30 -~ for (ItemStack itemstack1 : (List) arraylist) { +~ ArrayList arraylist = Lists.newArrayList(this.recipeItems); + +> CHANGE 7 : 9 @ 7 : 8 + +~ for (int m = 0, l = arraylist.size(); m < l; ++m) { +~ ItemStack itemstack1 = arraylist.get(m); > EOF diff --git a/patches/minecraft/net/minecraft/nbt/JsonToNBT.edit.java b/patches/minecraft/net/minecraft/nbt/JsonToNBT.edit.java index bd8da46..770b089 100644 --- a/patches/minecraft/net/minecraft/nbt/JsonToNBT.edit.java +++ b/patches/minecraft/net/minecraft/nbt/JsonToNBT.edit.java @@ -19,4 +19,14 @@ + import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +> CHANGE 282 : 284 @ 282 : 283 + +~ for (int i = 0, l = this.field_150491_b.size(); i < l; ++i) { +~ JsonToNBT.Any jsontonbt$any = this.field_150491_b.get(i); + +> CHANGE 17 : 19 @ 17 : 19 + +~ for (int i = 0, l = this.field_150492_b.size(); i < l; ++i) { +~ nbttaglist.appendTag(this.field_150492_b.get(i).parse()); + > EOF diff --git a/patches/minecraft/net/minecraft/nbt/NBTTagIntArray.edit.java b/patches/minecraft/net/minecraft/nbt/NBTTagIntArray.edit.java index 6422a38..491599b 100644 --- a/patches/minecraft/net/minecraft/nbt/NBTTagIntArray.edit.java +++ b/patches/minecraft/net/minecraft/nbt/NBTTagIntArray.edit.java @@ -7,4 +7,9 @@ > DELETE 6 @ 6 : 8 +> CHANGE 39 : 41 @ 39 : 41 + +~ for (int i = 0; i < this.intArray.length; ++i) { +~ s = s + this.intArray[i] + ","; + > EOF diff --git a/patches/minecraft/net/minecraft/nbt/NBTTagList.edit.java b/patches/minecraft/net/minecraft/nbt/NBTTagList.edit.java index f8751a9..af98c60 100644 --- a/patches/minecraft/net/minecraft/nbt/NBTTagList.edit.java +++ b/patches/minecraft/net/minecraft/nbt/NBTTagList.edit.java @@ -17,4 +17,9 @@ + import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + +> CHANGE 159 : 161 @ 159 : 161 + +~ for (int i = 0, l = this.tagList.size(); i < l; ++i) { +~ NBTBase nbtbase1 = this.tagList.get(i).copy(); + > EOF diff --git a/patches/minecraft/net/minecraft/network/EnumConnectionState.edit.java b/patches/minecraft/net/minecraft/network/EnumConnectionState.edit.java index 3974175..99d546a 100644 --- a/patches/minecraft/net/minecraft/network/EnumConnectionState.edit.java +++ b/patches/minecraft/net/minecraft/network/EnumConnectionState.edit.java @@ -10,7 +10,9 @@ + + import java.util.Collection; -> CHANGE 104 : 105 @ 104 : 109 +> DELETE 1 @ 1 : 3 + +> CHANGE 101 : 102 @ 101 : 106 ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; @@ -20,7 +22,13 @@ ~ this.directionMaps.put(direction, (BiMap>) object); -> CHANGE 45 : 47 @ 45 : 46 +> CHANGE 36 : 39 @ 36 : 37 + +~ EnumConnectionState[] states = values(); +~ for (int j = 0; j < states.length; ++j) { +~ EnumConnectionState enumconnectionstate = states[j]; + +> CHANGE 8 : 10 @ 8 : 9 ~ for (Class oclass : (Collection) ((BiMap) enumconnectionstate.directionMaps ~ .get(enumpacketdirection)).values()) { diff --git a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.edit.java b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.edit.java index 324cc75..b39cfe1 100644 --- a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.edit.java +++ b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.edit.java @@ -9,14 +9,16 @@ ~ import net.lax1dude.eaglercraft.v1_8.netty.Unpooled; -> INSERT 6 : 8 @ 6 +> CHANGE 3 : 4 @ 3 : 4 + +~ import java.util.List; + +> INSERT 2 : 4 @ 2 + + import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerMinecraftServer; -> DELETE 25 @ 25 : 26 - -> DELETE 2 @ 2 : 3 +> DELETE 25 @ 25 : 29 > INSERT 33 : 34 @ 33 @@ -70,7 +72,13 @@ > DELETE 64 @ 64 : 65 -> CHANGE 51 : 65 @ 51 : 63 +> CHANGE 3 : 6 @ 3 : 4 + +~ WorldServer[] srv = this.serverController.worldServers; +~ for (int i = 0; i < srv.length; ++i) { +~ WorldServer worldserver = srv[i]; + +> CHANGE 47 : 61 @ 47 : 59 ~ if (!hasDisconnected) { ~ hasDisconnected = true; @@ -133,9 +141,19 @@ > DELETE 21 @ 21 : 22 -> DELETE 5 @ 5 : 6 +> CHANGE 5 : 10 @ 5 : 11 -> DELETE 12 @ 12 : 13 +~ List lst = this.serverController.getTabCompletions(this.playerEntity, c14packettabcomplete.getMessage(), +~ c14packettabcomplete.getTargetBlock()); +~ String[] fuckOff = new String[lst.size()]; +~ for (int i = 0; i < fuckOff.length; ++i) { +~ fuckOff[i] = lst.get(i); + +> CHANGE 2 : 3 @ 2 : 4 + +~ this.playerEntity.playerNetServerHandler.sendPacket(new S3APacketTabComplete(fuckOff)); + +> DELETE 3 @ 3 : 4 > DELETE 4 @ 4 : 5 @@ -168,7 +186,7 @@ + s = net.minecraft.util.StringUtils.translateControlCodesAlternate(s); + } -> INSERT 5 : 22 @ 5 +> INSERT 5 : 24 @ 5 + } else if ("EAG|Skins-1.8".equals(c17packetcustompayload.getChannelName())) { + byte[] r = new byte[c17packetcustompayload.getBufferData().readableBytes()]; @@ -180,7 +198,9 @@ + byte[] cert = new byte[pb.readableBytes()]; + pb.readBytes(cert); + playerEntity.updateCertificate = cert; -+ for (EntityPlayerMP player : playerEntity.mcServer.getConfigurationManager().func_181057_v()) { ++ List lst = playerEntity.mcServer.getConfigurationManager().func_181057_v(); ++ for (int i = 0, l = lst.size(); i < l; ++i) { ++ EntityPlayerMP player = lst.get(i); + if (player != playerEntity) { + player.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload("EAG|UpdateCert-1.8", + new PacketBuffer(Unpooled.buffer(cert, cert.length).writerIndex(cert.length)))); diff --git a/patches/minecraft/net/minecraft/network/play/server/S08PacketPlayerPosLook.edit.java b/patches/minecraft/net/minecraft/network/play/server/S08PacketPlayerPosLook.edit.java index 613846d..7a7a763 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S08PacketPlayerPosLook.edit.java +++ b/patches/minecraft/net/minecraft/network/play/server/S08PacketPlayerPosLook.edit.java @@ -9,4 +9,10 @@ + +> CHANGE 91 : 94 @ 91 : 92 + +~ S08PacketPlayerPosLook.EnumFlags[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ S08PacketPlayerPosLook.EnumFlags s08packetplayerposlook$enumflags = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/network/play/server/S21PacketChunkData.edit.java b/patches/minecraft/net/minecraft/network/play/server/S21PacketChunkData.edit.java index 1b47a86..b6512af 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S21PacketChunkData.edit.java +++ b/patches/minecraft/net/minecraft/network/play/server/S21PacketChunkData.edit.java @@ -13,16 +13,29 @@ + import com.google.common.collect.Lists; + -> CHANGE 74 : 75 @ 74 : 75 +> CHANGE 59 : 60 @ 59 : 60 -~ for (ExtendedBlockStorage extendedblockstorage1 : (ArrayList) arraylist) { +~ ArrayList arraylist = Lists.newArrayList(); -> CHANGE 8 : 9 @ 8 : 9 +> INSERT 13 : 16 @ 13 -~ for (ExtendedBlockStorage extendedblockstorage2 : (ArrayList) arraylist) { ++ int l = arraylist.size(); ++ for (int k = 0; k < l; ++k) { ++ char[] achar = arraylist.get(k).getData(); -> CHANGE 5 : 6 @ 5 : 6 +> CHANGE 1 : 3 @ 1 : 5 -~ for (ExtendedBlockStorage extendedblockstorage3 : (ArrayList) arraylist) { +~ for (int m = 0; m < achar.length; ++m) { +~ char c0 = achar[m]; + +> CHANGE 5 : 7 @ 5 : 8 + +~ for (int k = 0; k < l; ++k) { +~ j = func_179757_a(arraylist.get(k).getBlocklightArray().getData(), s21packetchunkdata$extracted.data, j); + +> CHANGE 3 : 5 @ 3 : 6 + +~ for (int k = 0; k < l; ++k) { +~ j = func_179757_a(arraylist.get(k).getSkylightArray().getData(), s21packetchunkdata$extracted.data, j); > EOF diff --git a/patches/minecraft/net/minecraft/network/play/server/S22PacketMultiBlockChange.edit.java b/patches/minecraft/net/minecraft/network/play/server/S22PacketMultiBlockChange.edit.java index 6d88f89..78646b0 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S22PacketMultiBlockChange.edit.java +++ b/patches/minecraft/net/minecraft/network/play/server/S22PacketMultiBlockChange.edit.java @@ -9,4 +9,9 @@ + +> CHANGE 42 : 44 @ 42 : 43 + +~ for (int i = 0; i < this.changedBlocks.length; ++i) { +~ S22PacketMultiBlockChange.BlockUpdateData s22packetmultiblockchange$blockupdatedata = this.changedBlocks[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/network/play/server/S27PacketExplosion.edit.java b/patches/minecraft/net/minecraft/network/play/server/S27PacketExplosion.edit.java index 56ec8e8..15c4c3d 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S27PacketExplosion.edit.java +++ b/patches/minecraft/net/minecraft/network/play/server/S27PacketExplosion.edit.java @@ -13,4 +13,9 @@ + import com.google.common.collect.Lists; + +> CHANGE 67 : 69 @ 67 : 68 + +~ for (int m = 0, n = this.affectedBlockPositions.size(); m < n; ++m) { +~ BlockPos blockpos = this.affectedBlockPositions.get(m); + > EOF diff --git a/patches/minecraft/net/minecraft/network/play/server/S30PacketWindowItems.edit.java b/patches/minecraft/net/minecraft/network/play/server/S30PacketWindowItems.edit.java index 1307512..4ba17a6 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S30PacketWindowItems.edit.java +++ b/patches/minecraft/net/minecraft/network/play/server/S30PacketWindowItems.edit.java @@ -9,4 +9,9 @@ + +> CHANGE 38 : 40 @ 38 : 40 + +~ for (int i = 0; i < this.itemStacks.length; ++i) { +~ parPacketBuffer.writeItemStackToBuffer(this.itemStacks[i]); + > EOF diff --git a/patches/minecraft/net/minecraft/network/play/server/S34PacketMaps.edit.java b/patches/minecraft/net/minecraft/network/play/server/S34PacketMaps.edit.java index 1307512..4ee8f5c 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S34PacketMaps.edit.java +++ b/patches/minecraft/net/minecraft/network/play/server/S34PacketMaps.edit.java @@ -9,4 +9,9 @@ + +> CHANGE 64 : 66 @ 64 : 65 + +~ for (int i = 0; i < this.mapVisiblePlayersVec4b.length; ++i) { +~ Vec4b vec4b = this.mapVisiblePlayersVec4b[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/network/play/server/S38PacketPlayerListItem.edit.java b/patches/minecraft/net/minecraft/network/play/server/S38PacketPlayerListItem.edit.java index 0dd348a..d4e3644 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S38PacketPlayerListItem.edit.java +++ b/patches/minecraft/net/minecraft/network/play/server/S38PacketPlayerListItem.edit.java @@ -10,4 +10,14 @@ ~ import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; ~ import net.lax1dude.eaglercraft.v1_8.mojang.authlib.Property; +> CHANGE 19 : 21 @ 19 : 20 + +~ for (int i = 0; i < players.length; ++i) { +~ EntityPlayerMP entityplayermp = players[i]; + +> CHANGE 79 : 81 @ 79 : 80 + +~ for (int i = 0, l = this.players.size(); i < l; ++i) { +~ S38PacketPlayerListItem.AddPlayerData s38packetplayerlistitem$addplayerdata = this.players.get(i); + > EOF diff --git a/patches/minecraft/net/minecraft/network/play/server/S3APacketTabComplete.edit.java b/patches/minecraft/net/minecraft/network/play/server/S3APacketTabComplete.edit.java index 6d88f89..7ff4850 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S3APacketTabComplete.edit.java +++ b/patches/minecraft/net/minecraft/network/play/server/S3APacketTabComplete.edit.java @@ -9,4 +9,9 @@ + +> CHANGE 26 : 28 @ 26 : 28 + +~ for (int i = 0; i < this.matches.length; ++i) { +~ parPacketBuffer.writeString(this.matches[i]); + > EOF diff --git a/patches/minecraft/net/minecraft/network/play/server/S45PacketTitle.edit.java b/patches/minecraft/net/minecraft/network/play/server/S45PacketTitle.edit.java index 6d88f89..55f010c 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S45PacketTitle.edit.java +++ b/patches/minecraft/net/minecraft/network/play/server/S45PacketTitle.edit.java @@ -9,4 +9,20 @@ + +> CHANGE 88 : 91 @ 88 : 89 + +~ S45PacketTitle.Type[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ S45PacketTitle.Type s45packettitle$type = types[i]; + +> CHANGE 9 : 11 @ 9 : 11 + +~ S45PacketTitle.Type[] types = values(); +~ String[] astring = new String[types.length]; + +> CHANGE 1 : 3 @ 1 : 3 + +~ for (int i = 0; i < types.length; ++i) { +~ astring[i] = types[i].name().toLowerCase(); + > EOF diff --git a/patches/minecraft/net/minecraft/pathfinding/Path.edit.java b/patches/minecraft/net/minecraft/pathfinding/Path.edit.java index 613846d..8b7360a 100644 --- a/patches/minecraft/net/minecraft/pathfinding/Path.edit.java +++ b/patches/minecraft/net/minecraft/pathfinding/Path.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 5 : 6 @ 5 - -+ +> DELETE 2 @ 2 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/pathfinding/PathEntity.edit.java b/patches/minecraft/net/minecraft/pathfinding/PathEntity.edit.java index 8477115..a8dd664 100644 --- a/patches/minecraft/net/minecraft/pathfinding/PathEntity.edit.java +++ b/patches/minecraft/net/minecraft/pathfinding/PathEntity.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 3 @ 3 : 4 > EOF diff --git a/patches/minecraft/net/minecraft/pathfinding/PathFinder.edit.java b/patches/minecraft/net/minecraft/pathfinding/PathFinder.edit.java index e395576..9c2c149 100644 --- a/patches/minecraft/net/minecraft/pathfinding/PathFinder.edit.java +++ b/patches/minecraft/net/minecraft/pathfinding/PathFinder.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 11 : 12 @ 11 - -+ +> DELETE 3 @ 3 : 6 > EOF diff --git a/patches/minecraft/net/minecraft/pathfinding/PathNavigate.edit.java b/patches/minecraft/net/minecraft/pathfinding/PathNavigate.edit.java index 2e2d6bf..eb2d4ef 100644 --- a/patches/minecraft/net/minecraft/pathfinding/PathNavigate.edit.java +++ b/patches/minecraft/net/minecraft/pathfinding/PathNavigate.edit.java @@ -5,12 +5,15 @@ # Version: 1.0 # Author: lax1dude -> INSERT 17 : 18 @ 17 +> DELETE 7 @ 7 : 9 -+ +> CHANGE 134 : 135 @ 134 : 135 -> CHANGE 131 : 132 @ 131 : 132 +~ List list = this.worldObj.getCollidingBoundingBoxes(this.theEntity, -~ for (AxisAlignedBB axisalignedbb : (List) list) { +> CHANGE 4 : 6 @ 4 : 5 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ AxisAlignedBB axisalignedbb = list.get(i); > EOF diff --git a/patches/minecraft/net/minecraft/pathfinding/PathNavigateClimber.edit.java b/patches/minecraft/net/minecraft/pathfinding/PathNavigateClimber.edit.java index e395576..a7f89c1 100644 --- a/patches/minecraft/net/minecraft/pathfinding/PathNavigateClimber.edit.java +++ b/patches/minecraft/net/minecraft/pathfinding/PathNavigateClimber.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 11 : 12 @ 11 - -+ +> DELETE 4 @ 4 : 6 > EOF diff --git a/patches/minecraft/net/minecraft/pathfinding/PathNavigateGround.edit.java b/patches/minecraft/net/minecraft/pathfinding/PathNavigateGround.edit.java index e8768a1..3f5c9b6 100644 --- a/patches/minecraft/net/minecraft/pathfinding/PathNavigateGround.edit.java +++ b/patches/minecraft/net/minecraft/pathfinding/PathNavigateGround.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 18 : 19 @ 18 - -+ +> DELETE 8 @ 8 : 11 > EOF diff --git a/patches/minecraft/net/minecraft/pathfinding/PathNavigateSwimmer.edit.java b/patches/minecraft/net/minecraft/pathfinding/PathNavigateSwimmer.edit.java index e395576..831f1a2 100644 --- a/patches/minecraft/net/minecraft/pathfinding/PathNavigateSwimmer.edit.java +++ b/patches/minecraft/net/minecraft/pathfinding/PathNavigateSwimmer.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 11 : 12 @ 11 - -+ +> DELETE 3 @ 3 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/pathfinding/PathPoint.edit.java b/patches/minecraft/net/minecraft/pathfinding/PathPoint.edit.java index 613846d..7572609 100644 --- a/patches/minecraft/net/minecraft/pathfinding/PathPoint.edit.java +++ b/patches/minecraft/net/minecraft/pathfinding/PathPoint.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 5 : 6 @ 5 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/potion/PotionHelper.edit.java b/patches/minecraft/net/minecraft/potion/PotionHelper.edit.java index 9b70091..d21b1f6 100644 --- a/patches/minecraft/net/minecraft/potion/PotionHelper.edit.java +++ b/patches/minecraft/net/minecraft/potion/PotionHelper.edit.java @@ -14,4 +14,9 @@ ~ import com.google.common.collect.Maps; ~ +> CHANGE 270 : 272 @ 270 : 271 + +~ for (int k = 0; k < Potion.potionTypes.length; ++k) { +~ Potion potion = Potion.potionTypes[k]; + > EOF diff --git a/patches/minecraft/net/minecraft/scoreboard/IScoreObjectiveCriteria.edit.java b/patches/minecraft/net/minecraft/scoreboard/IScoreObjectiveCriteria.edit.java index a8d551c..7bf453f 100644 --- a/patches/minecraft/net/minecraft/scoreboard/IScoreObjectiveCriteria.edit.java +++ b/patches/minecraft/net/minecraft/scoreboard/IScoreObjectiveCriteria.edit.java @@ -15,4 +15,10 @@ > DELETE 1 @ 1 : 4 +> CHANGE 71 : 74 @ 71 : 74 + +~ IScoreObjectiveCriteria.EnumRenderType[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ field_178801_c.put(types[i].func_178796_a(), types[i]); + > EOF diff --git a/patches/minecraft/net/minecraft/scoreboard/ScoreHealthCriteria.edit.java b/patches/minecraft/net/minecraft/scoreboard/ScoreHealthCriteria.edit.java index 9a4a33d..8448ec4 100644 --- a/patches/minecraft/net/minecraft/scoreboard/ScoreHealthCriteria.edit.java +++ b/patches/minecraft/net/minecraft/scoreboard/ScoreHealthCriteria.edit.java @@ -11,4 +11,9 @@ > DELETE 1 @ 1 : 3 +> CHANGE 10 : 12 @ 10 : 11 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ EntityPlayer entityplayer = list.get(i); + > EOF diff --git a/patches/minecraft/net/minecraft/scoreboard/ServerScoreboard.edit.java b/patches/minecraft/net/minecraft/scoreboard/ServerScoreboard.edit.java index 7ade005..ceaacce 100644 --- a/patches/minecraft/net/minecraft/scoreboard/ServerScoreboard.edit.java +++ b/patches/minecraft/net/minecraft/scoreboard/ServerScoreboard.edit.java @@ -5,16 +5,34 @@ # Version: 1.0 # Author: lax1dude -> INSERT 22 : 23 @ 22 +> DELETE 14 @ 14 : 19 + +> INSERT 3 : 4 @ 3 + -> CHANGE 150 : 151 @ 150 : 151 +> CHANGE 147 : 148 @ 147 : 148 -~ for (Packet packet : (List) list) { +~ List list = this.func_96550_d(parScoreObjective); -> CHANGE 24 : 25 @ 24 : 25 +> CHANGE 1 : 6 @ 1 : 4 -~ for (Packet packet : (List) list) { +~ List players = this.scoreboardMCServer.getConfigurationManager().func_181057_v(); +~ for (int i = 0, l = players.size(); i < l; ++i) { +~ EntityPlayerMP entityplayermp = players.get(i); +~ for (int j = 0, m = list.size(); j < m; ++j) { +~ entityplayermp.playerNetServerHandler.sendPacket(list.get(j)); + +> CHANGE 20 : 21 @ 20 : 21 + +~ List list = this.func_96548_f(parScoreObjective); + +> CHANGE 1 : 6 @ 1 : 4 + +~ List players = this.scoreboardMCServer.getConfigurationManager().func_181057_v(); +~ for (int i = 0, l = players.size(); i < l; ++i) { +~ EntityPlayerMP entityplayermp = players.get(i); +~ for (int j = 0, m = list.size(); j < m; ++j) { +~ entityplayermp.playerNetServerHandler.sendPacket(list.get(j)); > EOF diff --git a/patches/minecraft/net/minecraft/scoreboard/Team.edit.java b/patches/minecraft/net/minecraft/scoreboard/Team.edit.java index 6a3fab8..48178f1 100644 --- a/patches/minecraft/net/minecraft/scoreboard/Team.edit.java +++ b/patches/minecraft/net/minecraft/scoreboard/Team.edit.java @@ -12,4 +12,10 @@ + import com.google.common.collect.Maps; + +> CHANGE 41 : 44 @ 41 : 43 + +~ Team.EnumVisible[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ field_178828_g.put(types[i].field_178830_e, types[i]); + > EOF diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.edit.java b/patches/minecraft/net/minecraft/server/MinecraftServer.edit.java index 284b327..fae012e 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.edit.java +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.edit.java @@ -12,11 +12,11 @@ ~ import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; ~ -> DELETE 1 @ 1 : 3 +> DELETE 1 @ 1 : 4 -> INSERT 5 : 6 @ 5 +> CHANGE 1 : 2 @ 1 : 4 -+ import java.util.LinkedList; +~ import java.util.LinkedList; > DELETE 2 @ 2 : 4 @@ -28,25 +28,28 @@ ~ import net.lax1dude.eaglercraft.v1_8.futures.FutureTask; ~ import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerIntegratedServerWorker; -> DELETE 9 @ 9 : 11 +> DELETE 8 @ 8 : 11 > DELETE 1 @ 1 : 3 > DELETE 1 @ 1 : 2 -> CHANGE 19 : 20 @ 19 : 20 +> DELETE 7 @ 7 : 8 + +> CHANGE 10 : 11 @ 10 : 12 ~ import net.minecraft.world.chunk.Chunk; -> CHANGE 5 : 7 @ 5 : 7 +> DELETE 1 @ 1 : 2 + +> CHANGE 2 : 4 @ 2 : 5 ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> CHANGE 1 : 3 @ 1 : 2 +> CHANGE 1 : 2 @ 1 : 2 ~ public abstract class MinecraftServer implements Runnable, ICommandSender, IThreadListener { -~ > DELETE 1 @ 1 : 2 @@ -158,7 +161,12 @@ ~ public void saveAllWorlds(boolean dontLog) { -> DELETE 22 @ 22 : 25 +> CHANGE 1 : 3 @ 1 : 2 + +~ for (int i = 0; i < this.worldServers.length; ++i) { +~ WorldServer worldserver = this.worldServers[i]; + +> DELETE 20 @ 20 : 23 > CHANGE 16 : 22 @ 16 : 21 @@ -213,11 +221,22 @@ ~ return "eagler"; -> CHANGE 30 : 31 @ 30 : 31 +> CHANGE 28 : 29 @ 28 : 29 -~ for (String s2 : (List) list) { +~ List list = this.commandManager.getTabCompletionOptions(sender, input, pos); -> DELETE 27 @ 27 : 31 +> CHANGE 1 : 3 @ 1 : 2 + +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ String s2 = list.get(i); + +> CHANGE 12 : 15 @ 12 : 14 + +~ String[] unames = this.serverConfigManager.getAllUsernames(); +~ for (int i = 0; i < unames.length; ++i) { +~ String s1 = unames[i]; + +> DELETE 13 @ 13 : 17 > DELETE 16 @ 16 : 20 @@ -241,11 +260,13 @@ > DELETE 20 @ 20 : 36 -> CHANGE 4 : 5 @ 4 : 5 +> CHANGE 4 : 7 @ 4 : 6 ~ public Entity getEntityFromUuid(EaglercraftUUID uuid) { +~ for (int i = 0; i < this.worldServers.length; ++i) { +~ WorldServer worldserver = this.worldServers[i]; -> CHANGE 23 : 25 @ 23 : 38 +> CHANGE 22 : 24 @ 22 : 37 ~ public boolean isCallingFromMinecraftThread() { ~ return true; diff --git a/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.edit.java b/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.edit.java index e5dd790..7572609 100644 --- a/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.edit.java +++ b/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 23 : 24 @ 23 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/server/management/PlayerManager.edit.java b/patches/minecraft/net/minecraft/server/management/PlayerManager.edit.java index be49b2b..98c95bc 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerManager.edit.java +++ b/patches/minecraft/net/minecraft/server/management/PlayerManager.edit.java @@ -10,8 +10,10 @@ ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> INSERT 2 : 3 @ 2 +> CHANGE 206 : 209 @ 206 : 207 -+ +~ List playerz = Lists.newArrayList(this.players); +~ for (int m = 0, n = playerz.size(); m < n; ++m) { +~ EntityPlayerMP entityplayermp = playerz.get(m); > EOF diff --git a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.edit.java b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.edit.java index 9fe3e0c..760bd88 100644 --- a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.edit.java +++ b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.edit.java @@ -20,9 +20,7 @@ > DELETE 6 @ 6 : 7 -> DELETE 23 @ 23 : 25 - -> DELETE 2 @ 2 : 9 +> DELETE 23 @ 23 : 34 > INSERT 3 : 4 @ 3 @@ -34,9 +32,7 @@ ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> CHANGE 2 : 3 @ 2 : 6 - -~ +> DELETE 2 @ 2 : 6 > CHANGE 4 : 6 @ 4 : 10 @@ -90,10 +86,11 @@ + playerIn.addChatMessage(shaderF4Msg); + } -> INSERT 23 : 34 @ 23 +> INSERT 23 : 35 @ 23 + if (EagRuntime.getConfiguration().allowUpdateSvc()) { -+ for (EntityPlayerMP playerItr : playerEntityList) { ++ for (int i = 0, l = playerEntityList.size(); i < l; ++i) { ++ EntityPlayerMP playerItr = playerEntityList.get(i); + if (playerItr != playerIn && playerItr.updateCertificate != null) { + nethandlerplayserver + .sendPacket(new S3FPacketCustomPayload("EAG|UpdateCert-1.8", @@ -104,7 +101,13 @@ + } + } -> CHANGE 88 : 89 @ 88 : 89 +> CHANGE 12 : 15 @ 12 : 14 + +~ List lst = scoreboardIn.func_96550_d(scoreobjective); +~ for (int j = 0, l = lst.size(); j < l; ++j) { +~ playerIn.playerNetServerHandler.sendPacket(lst.get(j)); + +> CHANGE 74 : 75 @ 74 : 75 ~ StatisticsFile statisticsfile = (StatisticsFile) this.playerStatFiles.get(entityplayermp.getName()); @@ -126,10 +129,11 @@ ~ : null); ~ } -> CHANGE 1 : 6 @ 1 : 9 +> CHANGE 1 : 7 @ 1 : 9 ~ private boolean doesPlayerAlreadyExist(GameProfile gameprofile) { -~ for (EntityPlayerMP player : this.playerEntityList) { +~ for (int i = 0, l = playerEntityList.size(); i < l; ++i) { +~ EntityPlayerMP player = playerEntityList.get(i); ~ if (player.getName().equalsIgnoreCase(gameprofile.getName()) ~ || player.getUniqueID().equals(gameprofile.getId())) { ~ return true; @@ -140,20 +144,38 @@ + return false; -> CHANGE 3 : 4 @ 3 : 4 +> CHANGE 3 : 5 @ 3 : 5 ~ EaglercraftUUID uuid = EntityPlayer.getUUID(profile); +~ ArrayList arraylist = Lists.newArrayList(); -> CHANGE 4 : 6 @ 4 : 5 +> CHANGE 1 : 2 @ 1 : 2 + +~ for (int i = 0, l = this.playerEntityList.size(); i < l; ++i) { + +> CHANGE 1 : 3 @ 1 : 2 ~ if (entityplayermp.getUniqueID().equals(uuid) ~ || entityplayermp.getName().equalsIgnoreCase(profile.getName())) { +> CHANGE 9 : 11 @ 9 : 11 + +~ for (int i = 0, l = arraylist.size(); i < l; ++i) { +~ arraylist.get(i).playerNetServerHandler.kickPlayerFromServer("You logged in from another location"); + +> CHANGE 205 : 206 @ 205 : 206 + +~ for (int i = 0, l = this.playerEntityList.size(); i < l; ++i) { + +> CHANGE 30 : 31 @ 30 : 31 + +~ for (int i = 0; i < astring.length; ++i) { + > CHANGE 9 : 10 @ 9 : 10 -~ for (EntityPlayerMP entityplayermp1 : (ArrayList) arraylist) { +~ for (int i = 0; i < agameprofile.length; ++i) { -> DELETE 254 @ 254 : 271 +> DELETE 6 @ 6 : 23 > CHANGE 1 : 2 @ 1 : 3 @@ -163,9 +185,22 @@ ~ return lanCheats -> DELETE 42 @ 42 : 69 +> CHANGE 21 : 22 @ 21 : 22 -> CHANGE 67 : 73 @ 67 : 72 +~ for (int i = 0, l = this.playerEntityList.size(); i < l; ++i) { + +> CHANGE 14 : 15 @ 14 : 15 + +~ for (int i = 0, l = this.playerEntityList.size(); i < l; ++i) { + +> DELETE 5 @ 5 : 32 + +> CHANGE 40 : 42 @ 40 : 41 + +~ for (int i = 0, l = playerEntityList.size(); i < l; ++i) { +~ EntityPlayerMP entityplayermp = playerEntityList.get(i); + +> CHANGE 26 : 32 @ 26 : 31 ~ if (parEntityPlayerMP2 == null || parEntityPlayerMP2.getName().equals(mcServer.getServerOwner())) { ~ if (parEntityPlayerMP2 != null) { @@ -181,7 +216,11 @@ ~ parEntityPlayerMP2.theItemInWorldManager.setGameType(lanGamemode); ~ } -> CHANGE 25 : 27 @ 25 : 27 +> CHANGE 7 : 8 @ 7 : 8 + +~ for (int i = 0, l = this.playerEntityList.size(); i < l; ++i) { + +> CHANGE 17 : 19 @ 17 : 19 ~ String name = playerIn.getName(); ~ StatisticsFile statisticsfile = (StatisticsFile) this.playerStatFiles.get(name); @@ -198,7 +237,13 @@ ~ this.playerStatFiles.put(name, statisticsfile); -> DELETE 13 @ 13 : 14 +> CHANGE 8 : 11 @ 8 : 9 + +~ WorldServer[] srv = this.mcServer.worldServers; +~ for (int i = 0; i < srv.length; ++i) { +~ WorldServer worldserver = srv[i]; + +> DELETE 4 @ 4 : 5 > CHANGE 7 : 8 @ 7 : 8 diff --git a/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.edit.java b/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.edit.java index 9d10035..9d6def6 100644 --- a/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.edit.java +++ b/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.edit.java @@ -32,9 +32,7 @@ ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> CHANGE 2 : 3 @ 2 : 3 - -~ +> DELETE 2 @ 2 : 3 > CHANGE 1 : 2 @ 1 : 2 diff --git a/patches/minecraft/net/minecraft/stats/StatisticsFile.edit.java b/patches/minecraft/net/minecraft/stats/StatisticsFile.edit.java index 084d8ac..34eaf55 100644 --- a/patches/minecraft/net/minecraft/stats/StatisticsFile.edit.java +++ b/patches/minecraft/net/minecraft/stats/StatisticsFile.edit.java @@ -5,9 +5,11 @@ # Version: 1.0 # Author: lax1dude -> DELETE 4 @ 4 : 9 +> DELETE 4 @ 4 : 10 -> CHANGE 19 : 21 @ 19 : 22 +> DELETE 10 @ 10 : 15 + +> CHANGE 3 : 5 @ 3 : 6 ~ import org.json.JSONException; ~ import org.json.JSONObject; @@ -19,11 +21,7 @@ + import net.lax1dude.eaglercraft.v1_8.log4j.Logger; + -> INSERT 1 : 2 @ 1 - -+ - -> CHANGE 2 : 3 @ 2 : 3 +> CHANGE 3 : 4 @ 3 : 4 ~ private final VFile2 statsFile; @@ -94,4 +92,9 @@ ~ jsonobject.put(((StatBase) entry.getKey()).statId, +> CHANGE 31 : 33 @ 31 : 32 + +~ for (int i = 0, l = AchievementList.achievementList.size(); i < l; ++i) { +~ Achievement achievement = AchievementList.achievementList.get(i); + > EOF diff --git a/patches/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.edit.java b/patches/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.edit.java index bfb412b..91b59f0 100644 --- a/patches/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.edit.java +++ b/patches/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.edit.java @@ -13,4 +13,11 @@ + import com.google.common.collect.Lists; + +> CHANGE 258 : 262 @ 258 : 261 + +~ int l = this.minecartToSpawn.size(); +~ if (l > 0) { +~ for (int i = 0; i < l; ++i) { +~ nbttaglist.appendTag(this.minecartToSpawn.get(i).toNBT()); + > EOF diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBanner.edit.java b/patches/minecraft/net/minecraft/tileentity/TileEntityBanner.edit.java index 84a5103..b3990b8 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBanner.edit.java +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBanner.edit.java @@ -28,7 +28,12 @@ ~ () -> new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.OXEYE_DAISY.getMeta())), ~ MOJANG("mojang", "moj", () -> new ItemStack(Items.golden_apple, 1, 1)); -> INSERT 4 : 5 @ 4 +> INSERT 1 : 3 @ 1 + ++ public static final EnumBannerPattern[] _VALUES = values(); ++ + +> INSERT 3 : 4 @ 3 + private Supplier patternCraftingStackSupplier; @@ -54,4 +59,10 @@ + patternCraftingStack = patternCraftingStackSupplier.get(); + } +> CHANGE 4 : 7 @ 4 : 5 + +~ TileEntityBanner.EnumBannerPattern[] arr = _VALUES; +~ for (int i = 0; i < arr.length; ++i) { +~ TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = arr[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.edit.java b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.edit.java index b1d1654..e429faa 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.edit.java +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.edit.java @@ -11,4 +11,24 @@ ~ List list = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, axisalignedbb); +> CHANGE 1 : 3 @ 1 : 3 + +~ for (int m = 0, l = list.size(); m < l; ++m) { +~ list.get(m).addPotionEffect(new PotionEffect(this.primaryEffect, 180, b0, true, true)); + +> CHANGE 3 : 5 @ 3 : 5 + +~ for (int m = 0, l = list.size(); m < l; ++m) { +~ list.get(m).addPotionEffect(new PotionEffect(this.secondaryEffect, 180, 0, true, true)); + +> CHANGE 87 : 88 @ 87 : 88 + +~ List lst = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, + +> CHANGE 1 : 4 @ 1 : 3 + +~ .expand(10.0D, 5.0D, 10.0D)); +~ for (int m = 0, n = lst.size(); m < n; ++m) { +~ lst.get(m).triggerAchievement(AchievementList.fullBeacon); + > EOF diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityChest.edit.java b/patches/minecraft/net/minecraft/tileentity/TileEntityChest.edit.java index 9aa5be3..9e9ff2e 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityChest.edit.java +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityChest.edit.java @@ -5,6 +5,21 @@ # Version: 1.0 # Author: lax1dude -> DELETE 13 @ 13 : 15 +> INSERT 2 : 4 @ 2 + ++ import java.util.List; ++ + +> DELETE 11 @ 11 : 13 + +> CHANGE 212 : 213 @ 212 : 213 + +~ List players = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, + +> CHANGE 2 : 5 @ 2 : 3 + +~ (double) ((float) (k + 1) + f))); +~ for (int m = 0, l = players.size(); m < l; ++m) { +~ EntityPlayer entityplayer = players.get(m); > EOF diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.edit.java b/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.edit.java index e75cfa5..e82004a 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.edit.java +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.edit.java @@ -7,4 +7,21 @@ > DELETE 17 @ 17 : 21 +> CHANGE 172 : 174 @ 172 : 174 + +~ for (int i = 0; i < this.inventory.length; ++i) { +~ if (this.inventory[i] != null) { + +> CHANGE 8 : 10 @ 8 : 9 + +~ for (int i = 0; i < this.inventory.length; ++i) { +~ ItemStack itemstack = this.inventory[i]; + +> CHANGE 111 : 115 @ 111 : 114 + +~ List list = func_181556_a(parIHopper.getWorld(), parIHopper.getXPos(), +~ parIHopper.getYPos() + 1.0D, parIHopper.getZPos()); +~ for (int i = 0, l = list.size(); i < l; ++i) { +~ if (putDropInInventoryAllSlots(parIHopper, list.get(i))) { + > EOF diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.edit.java b/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.edit.java index 40c2424..ff226ef 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.edit.java +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.edit.java @@ -15,4 +15,9 @@ > DELETE 5 @ 5 : 6 +> CHANGE 81 : 83 @ 81 : 82 + +~ for (int i = 0, l = this.field_174933_k.size(); i < l; ++i) { +~ Entity entity = this.field_174933_k.get(i); + > EOF diff --git a/patches/minecraft/net/minecraft/util/ChatAllowedCharacters.edit.java b/patches/minecraft/net/minecraft/util/ChatAllowedCharacters.edit.java new file mode 100644 index 0000000..84633fe --- /dev/null +++ b/patches/minecraft/net/minecraft/util/ChatAllowedCharacters.edit.java @@ -0,0 +1,14 @@ + +# Eagler Context Redacted Diff +# Copyright (c) 2024 lax1dude. All rights reserved. + +# Version: 1.0 +# Author: lax1dude + +> CHANGE 13 : 16 @ 13 : 14 + +~ char[] chars = input.toCharArray(); +~ for (int i = 0; i < chars.length; ++i) { +~ char c0 = chars[i]; + +> EOF diff --git a/patches/minecraft/net/minecraft/util/ChatComponentProcessor.edit.java b/patches/minecraft/net/minecraft/util/ChatComponentProcessor.edit.java index bc6244c..44cd8dc 100644 --- a/patches/minecraft/net/minecraft/util/ChatComponentProcessor.edit.java +++ b/patches/minecraft/net/minecraft/util/ChatComponentProcessor.edit.java @@ -11,4 +11,10 @@ > DELETE 5 @ 5 : 11 +> CHANGE 51 : 54 @ 51 : 53 + +~ List lst = component.getSiblings(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ ((IChatComponent) object).appendSibling(processComponent(commandSender, lst.get(i), entityIn)); + > EOF diff --git a/patches/minecraft/net/minecraft/util/ChatComponentScore.edit.java b/patches/minecraft/net/minecraft/util/ChatComponentScore.edit.java index b5dcabb..ef88104 100644 --- a/patches/minecraft/net/minecraft/util/ChatComponentScore.edit.java +++ b/patches/minecraft/net/minecraft/util/ChatComponentScore.edit.java @@ -7,8 +7,10 @@ > DELETE 6 @ 6 : 9 -> INSERT 1 : 3 @ 1 +> INSERT 1 : 5 @ 1 ++ import java.util.List; ++ + import net.lax1dude.eaglercraft.v1_8.HString; + @@ -20,4 +22,10 @@ ~ this.setValue(HString.format("%d", new Object[] { Integer.valueOf(score.getScorePoints()) })); +> CHANGE 13 : 16 @ 13 : 15 + +~ List lst = this.getSiblings(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ chatcomponentscore.appendSibling(lst.get(i).createCopy()); + > EOF diff --git a/patches/minecraft/net/minecraft/util/ChatComponentSelector.edit.java b/patches/minecraft/net/minecraft/util/ChatComponentSelector.edit.java index 0c65978..fba8f3c 100644 --- a/patches/minecraft/net/minecraft/util/ChatComponentSelector.edit.java +++ b/patches/minecraft/net/minecraft/util/ChatComponentSelector.edit.java @@ -5,6 +5,14 @@ # Version: 1.0 # Author: lax1dude -> DELETE 2 @ 2 : 5 +> CHANGE 2 : 3 @ 2 : 4 + +~ import java.util.List; + +> CHANGE 20 : 23 @ 20 : 22 + +~ List lst = this.getSiblings(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ chatcomponentselector.appendSibling(lst.get(i).createCopy()); > EOF diff --git a/patches/minecraft/net/minecraft/util/ChatComponentStyle.edit.java b/patches/minecraft/net/minecraft/util/ChatComponentStyle.edit.java index da79d95..9b30fde 100644 --- a/patches/minecraft/net/minecraft/util/ChatComponentStyle.edit.java +++ b/patches/minecraft/net/minecraft/util/ChatComponentStyle.edit.java @@ -13,4 +13,14 @@ > DELETE 3 @ 3 : 9 +> CHANGE 22 : 24 @ 22 : 24 + +~ for (int i = 0, l = this.siblings.size(); i < l; ++i) { +~ this.siblings.get(i).getChatStyle().setParentStyle(this.getChatStyle()); + +> CHANGE 9 : 11 @ 9 : 11 + +~ for (int i = 0, l = this.siblings.size(); i < l; ++i) { +~ this.siblings.get(i).getChatStyle().setParentStyle(this.style); + > EOF diff --git a/patches/minecraft/net/minecraft/util/ChatComponentText.edit.java b/patches/minecraft/net/minecraft/util/ChatComponentText.edit.java index 0c65978..b87b087 100644 --- a/patches/minecraft/net/minecraft/util/ChatComponentText.edit.java +++ b/patches/minecraft/net/minecraft/util/ChatComponentText.edit.java @@ -5,6 +5,14 @@ # Version: 1.0 # Author: lax1dude -> DELETE 2 @ 2 : 5 +> CHANGE 2 : 3 @ 2 : 4 + +~ import java.util.List; + +> CHANGE 20 : 23 @ 20 : 22 + +~ List lst = this.getSiblings(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ chatcomponenttext.appendSibling(lst.get(i).createCopy()); > EOF diff --git a/patches/minecraft/net/minecraft/util/ChatComponentTranslation.edit.java b/patches/minecraft/net/minecraft/util/ChatComponentTranslation.edit.java index f050bc2..b07634b 100644 --- a/patches/minecraft/net/minecraft/util/ChatComponentTranslation.edit.java +++ b/patches/minecraft/net/minecraft/util/ChatComponentTranslation.edit.java @@ -17,7 +17,12 @@ + import net.lax1dude.eaglercraft.v1_8.HString; + -> CHANGE 58 : 59 @ 58 : 59 +> CHANGE 12 : 14 @ 12 : 13 + +~ for (int i = 0; i < args.length; ++i) { +~ Object object = args[i]; + +> CHANGE 45 : 46 @ 45 : 46 ~ HString.format(format.substring(j, k), new Object[0])); @@ -25,4 +30,25 @@ ~ HString.format(format.substring(j), new Object[0])); +> CHANGE 29 : 31 @ 29 : 30 + +~ for (int i = 0; i < this.formatArgs.length; ++i) { +~ Object object = this.formatArgs[i]; + +> CHANGE 6 : 8 @ 6 : 8 + +~ for (int i = 0, l = this.children.size(); i < l; ++i) { +~ this.children.get(i).getChatStyle().setParentStyle(chatstyle); + +> CHANGE 15 : 17 @ 15 : 17 + +~ for (int i = 0, l = this.children.size(); i < l; ++i) { +~ stringbuilder.append(this.children.get(i).getUnformattedTextForChat()); + +> CHANGE 19 : 22 @ 19 : 21 + +~ List lst = this.getSiblings(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ chatcomponenttranslation.appendSibling(lst.get(i).createCopy()); + > EOF diff --git a/patches/minecraft/net/minecraft/util/ClassInheritanceMultiMap.edit.java b/patches/minecraft/net/minecraft/util/ClassInheritanceMultiMap.edit.java index 4f3c31c..84bd861 100644 --- a/patches/minecraft/net/minecraft/util/ClassInheritanceMultiMap.edit.java +++ b/patches/minecraft/net/minecraft/util/ClassInheritanceMultiMap.edit.java @@ -15,11 +15,12 @@ + import com.google.common.collect.Sets; + -> CHANGE 23 : 24 @ 23 : 24 +> CHANGE 21 : 23 @ 21 : 22 -~ this.func_181743_a((T) object, clazz); +~ for (int i = 0, l = this.field_181745_e.size(); i < l; ++i) { +~ T object = this.field_181745_e.get(i); -> CHANGE 31 : 32 @ 31 : 32 +> CHANGE 33 : 34 @ 33 : 34 ~ this.map.put(parClass1, (List) Lists.newArrayList(new Object[] { parObject })); diff --git a/patches/minecraft/net/minecraft/util/CombatTracker.edit.java b/patches/minecraft/net/minecraft/util/CombatTracker.edit.java index da236f8..5010667 100644 --- a/patches/minecraft/net/minecraft/util/CombatTracker.edit.java +++ b/patches/minecraft/net/minecraft/util/CombatTracker.edit.java @@ -15,4 +15,9 @@ > DELETE 6 @ 6 : 11 +> CHANGE 108 : 110 @ 108 : 109 + +~ for (int i = 0, l = this.combatEntries.size(); i < l; ++i) { +~ CombatEntry combatentry = this.combatEntries.get(i); + > EOF diff --git a/patches/minecraft/net/minecraft/util/EnumChatFormatting.edit.java b/patches/minecraft/net/minecraft/util/EnumChatFormatting.edit.java index e7f4a85..98eae41 100644 --- a/patches/minecraft/net/minecraft/util/EnumChatFormatting.edit.java +++ b/patches/minecraft/net/minecraft/util/EnumChatFormatting.edit.java @@ -13,4 +13,27 @@ + import com.google.common.collect.Maps; + +> INSERT 9 : 11 @ 9 + ++ public static final EnumChatFormatting[] _VALUES = values(); ++ + +> CHANGE 61 : 64 @ 61 : 62 + +~ EnumChatFormatting[] types = _VALUES; +~ for (int i = 0; i < types.length; ++i) { +~ EnumChatFormatting enumchatformatting = types[i]; + +> CHANGE 12 : 15 @ 12 : 13 + +~ EnumChatFormatting[] types = _VALUES; +~ for (int i = 0; i < types.length; ++i) { +~ EnumChatFormatting enumchatformatting = types[i]; + +> CHANGE 9 : 12 @ 9 : 11 + +~ EnumChatFormatting[] types = _VALUES; +~ for (int i = 0; i < types.length; ++i) { +~ nameMapping.put(func_175745_c(types[i].name), types[i]); + > EOF diff --git a/patches/minecraft/net/minecraft/util/EnumFacing.edit.java b/patches/minecraft/net/minecraft/util/EnumFacing.edit.java index 545b8a6..7b3e917 100644 --- a/patches/minecraft/net/minecraft/util/EnumFacing.edit.java +++ b/patches/minecraft/net/minecraft/util/EnumFacing.edit.java @@ -14,12 +14,81 @@ > DELETE 3 @ 3 : 9 -> CHANGE 171 : 172 @ 171 : 172 +> INSERT 9 : 11 @ 9 + ++ public static final EnumFacing[] _VALUES = values(); ++ + +> CHANGE 162 : 164 @ 162 : 164 ~ public static EnumFacing random(EaglercraftRandom rand) { +~ return _VALUES[rand.nextInt(_VALUES.length)]; -> CHANGE 140 : 141 @ 140 : 141 +> CHANGE 6 : 9 @ 6 : 7 + +~ EnumFacing[] facings = _VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing1 = facings[i]; + +> CHANGE 21 : 24 @ 21 : 22 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> CHANGE 13 : 17 @ 13 : 14 + +~ Plane.bootstrap(); +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> CHANGE 55 : 58 @ 55 : 57 + +~ EnumFacing.Axis[] axis = values(); +~ for (int i = 0; i < axis.length; ++i) { +~ NAME_LOOKUP.put(axis[i].getName2().toLowerCase(), axis[i]); + +> INSERT 8 : 10 @ 8 + ++ public static final AxisDirection[] _VALUES = values(); ++ + +> CHANGE 18 : 19 @ 18 : 19 + +~ HORIZONTAL(new EnumFacing[4]), VERTICAL(new EnumFacing[2]); + +> INSERT 1 : 7 @ 1 + ++ public final EnumFacing[] facingsArray; ++ ++ private Plane(EnumFacing[] facingsArray) { ++ this.facingsArray = facingsArray; ++ } ++ + +> CHANGE 1 : 2 @ 1 : 9 + +~ return facingsArray; + +> CHANGE 2 : 3 @ 2 : 3 ~ public EnumFacing random(EaglercraftRandom rand) { +> CHANGE 9 : 10 @ 9 : 10 + +~ return Iterators.forArray(facingsArray); + +> INSERT 1 : 10 @ 1 + ++ ++ private static void bootstrap() { ++ HORIZONTAL.facingsArray[0] = EnumFacing.NORTH; ++ HORIZONTAL.facingsArray[1] = EnumFacing.EAST; ++ HORIZONTAL.facingsArray[2] = EnumFacing.SOUTH; ++ HORIZONTAL.facingsArray[3] = EnumFacing.WEST; ++ VERTICAL.facingsArray[0] = EnumFacing.UP; ++ VERTICAL.facingsArray[1] = EnumFacing.DOWN; ++ } + > EOF diff --git a/patches/minecraft/net/minecraft/util/EnumParticleTypes.edit.java b/patches/minecraft/net/minecraft/util/EnumParticleTypes.edit.java index 7101694..8f8afeb 100644 --- a/patches/minecraft/net/minecraft/util/EnumParticleTypes.edit.java +++ b/patches/minecraft/net/minecraft/util/EnumParticleTypes.edit.java @@ -13,4 +13,15 @@ + import com.google.common.collect.Maps; + +> INSERT 17 : 19 @ 17 + ++ public static final EnumParticleTypes[] _VALUES = values(); ++ + +> CHANGE 49 : 52 @ 49 : 50 + +~ EnumParticleTypes[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ EnumParticleTypes enumparticletypes = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/util/EnumWorldBlockLayer.edit.java b/patches/minecraft/net/minecraft/util/EnumWorldBlockLayer.edit.java index 359fb41..2d4fc70 100644 --- a/patches/minecraft/net/minecraft/util/EnumWorldBlockLayer.edit.java +++ b/patches/minecraft/net/minecraft/util/EnumWorldBlockLayer.edit.java @@ -10,4 +10,9 @@ ~ SOLID("Solid"), CUTOUT_MIPPED("Mipped Cutout"), CUTOUT("Cutout"), TRANSLUCENT("Translucent"), ~ REALISTIC_WATER("EaglerShaderWater"), GLASS_HIGHLIGHTS("EaglerShaderGlassHighlights"); +> INSERT 1 : 3 @ 1 + ++ public static final EnumWorldBlockLayer[] _VALUES = values(); ++ + > EOF diff --git a/patches/minecraft/net/minecraft/util/IChatComponent.edit.java b/patches/minecraft/net/minecraft/util/IChatComponent.edit.java index d4e4e1c..de2713a 100644 --- a/patches/minecraft/net/minecraft/util/IChatComponent.edit.java +++ b/patches/minecraft/net/minecraft/util/IChatComponent.edit.java @@ -34,8 +34,8 @@ > CHANGE 2 : 4 @ 2 : 5 -~ for (Object jsonelement : jsonarray1) { -~ IChatComponent ichatcomponent1 = this.deserialize(jsonelement); +~ for (int i = 0, l = jsonarray1.length(); i < l; ++i) { +~ IChatComponent ichatcomponent1 = this.deserialize(jsonarray1.get(i)); > CHANGE 9 : 11 @ 9 : 11 @@ -131,9 +131,11 @@ ~ JSONArray jsonarray = new JSONArray(); -> CHANGE 2 : 3 @ 2 : 4 +> CHANGE 1 : 4 @ 1 : 4 -~ jsonarray.put(this.serialize(ichatcomponent1)); +~ List lst = ichatcomponent.getSiblings(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ jsonarray.put(this.serialize(lst.get(i))); > CHANGE 2 : 3 @ 2 : 3 @@ -151,7 +153,13 @@ ~ JSONArray jsonarray1 = new JSONArray(); -> CHANGE 3 : 4 @ 3 : 5 +> CHANGE 1 : 4 @ 1 : 2 + +~ Object[] arr = chatcomponenttranslation.getFormatArgs(); +~ for (int i = 0; i < arr.length; ++i) { +~ Object object = arr[i]; + +> CHANGE 1 : 2 @ 1 : 3 ~ jsonarray1.put(this.serialize((IChatComponent) object)); diff --git a/patches/minecraft/net/minecraft/util/MathHelper.edit.java b/patches/minecraft/net/minecraft/util/MathHelper.edit.java index 3ed02dd..f132000 100644 --- a/patches/minecraft/net/minecraft/util/MathHelper.edit.java +++ b/patches/minecraft/net/minecraft/util/MathHelper.edit.java @@ -22,7 +22,12 @@ ~ public static double getRandomDoubleInRange(EaglercraftRandom parRandom, double parDouble1, double parDouble2) { -> CHANGE 147 : 148 @ 147 : 148 +> CHANGE 6 : 8 @ 6 : 8 + +~ for (int j = 0; j < values.length; ++j) { +~ i += values[j]; + +> CHANGE 139 : 140 @ 139 : 140 ~ public static EaglercraftUUID getRandomUuid(EaglercraftRandom rand) { diff --git a/patches/minecraft/net/minecraft/util/StatCollector.edit.java b/patches/minecraft/net/minecraft/util/StatCollector.edit.java index 20d9aa5..7352171 100644 --- a/patches/minecraft/net/minecraft/util/StatCollector.edit.java +++ b/patches/minecraft/net/minecraft/util/StatCollector.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> DELETE 6 @ 6 : 7 +> DELETE 2 @ 2 : 4 + +> DELETE 2 @ 2 : 3 > CHANGE 10 : 12 @ 10 : 11 diff --git a/patches/minecraft/net/minecraft/util/StringTranslate.edit.java b/patches/minecraft/net/minecraft/util/StringTranslate.edit.java index bd922aa..7ff5bb5 100644 --- a/patches/minecraft/net/minecraft/util/StringTranslate.edit.java +++ b/patches/minecraft/net/minecraft/util/StringTranslate.edit.java @@ -38,7 +38,7 @@ ~ private StringTranslate() { ~ } -> CHANGE 1 : 24 @ 1 : 9 +> CHANGE 1 : 25 @ 1 : 9 ~ public static void initClient() { ~ try (InputStream inputstream = EagRuntime.getResourceStream("/assets/minecraft/lang/en_US.lang")) { @@ -53,7 +53,8 @@ ~ ~ public static void initServer(List strs) { ~ instance.languageList.clear(); -~ for (String s : strs) { +~ for (int i = 0, l = strs.size(); i < l; ++i) { +~ String s = strs.get(i); ~ if (!s.isEmpty() && s.charAt(0) != 35) { ~ String[] astring = (String[]) Iterables.toArray(equalSignSplitter.split(s), String.class); ~ if (astring != null && astring.length == 2) { diff --git a/patches/minecraft/net/minecraft/village/Village.edit.java b/patches/minecraft/net/minecraft/village/Village.edit.java index e6a2823..7ca92ce 100644 --- a/patches/minecraft/net/minecraft/village/Village.edit.java +++ b/patches/minecraft/net/minecraft/village/Village.edit.java @@ -5,25 +5,49 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 3 : 4 @ 3 : 4 +> DELETE 3 @ 3 : 4 -~ import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; +> DELETE 3 @ 3 : 4 -> CHANGE 3 : 4 @ 3 : 4 +> DELETE 9 @ 9 : 11 -~ import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +> DELETE 4 @ 4 : 5 -> DELETE 10 @ 10 : 11 +> CHANGE 139 : 141 @ 139 : 140 -> INSERT 8 : 9 @ 8 +~ for (int m = 0, n = this.villageDoorInfoList.size(); m < n; ++m) { +~ VillageDoorInfo villagedoorinfo1 = this.villageDoorInfoList.get(m); -+ +> CHANGE 14 : 16 @ 14 : 15 -> CHANGE 348 : 349 @ 348 : 356 +~ for (int m = 0, n = this.villageDoorInfoList.size(); m < n; ++m) { +~ VillageDoorInfo villagedoorinfo1 = this.villageDoorInfoList.get(m); + +> CHANGE 20 : 22 @ 20 : 21 + +~ for (int m = 0, n = this.villageDoorInfoList.size(); m < n; ++m) { +~ VillageDoorInfo villagedoorinfo = this.villageDoorInfoList.get(m); + +> CHANGE 23 : 25 @ 23 : 24 + +~ for (int i = 0, l = this.villageAgressors.size(); i < l; ++i) { +~ Village.VillageAggressor village$villageaggressor = this.villageAgressors.get(i); + +> CHANGE 100 : 102 @ 100 : 102 + +~ for (int m = 0, n = this.villageDoorInfoList.size(); m < n; ++m) { +~ j = Math.max(this.villageDoorInfoList.get(m).getDistanceToDoorBlockSq(this.center), j); + +> CHANGE 49 : 50 @ 49 : 57 ~ if (nbttagcompound1.hasKey("Name")) { -> CHANGE 38 : 41 @ 38 : 45 +> CHANGE 22 : 24 @ 22 : 23 + +~ for (int m = 0, n = this.villageDoorInfoList.size(); m < n; ++m) { +~ VillageDoorInfo villagedoorinfo = this.villageDoorInfoList.get(m); + +> CHANGE 15 : 18 @ 15 : 22 ~ nbttagcompound1.setString("Name", s); ~ nbttagcompound1.setInteger("S", ((Integer) this.playerReputation.get(s)).intValue()); diff --git a/patches/minecraft/net/minecraft/village/VillageCollection.edit.java b/patches/minecraft/net/minecraft/village/VillageCollection.edit.java index 6592a60..4ebbb3b 100644 --- a/patches/minecraft/net/minecraft/village/VillageCollection.edit.java +++ b/patches/minecraft/net/minecraft/village/VillageCollection.edit.java @@ -5,8 +5,44 @@ # Version: 1.0 # Author: lax1dude -> INSERT 19 : 20 @ 19 +> DELETE 12 @ 12 : 14 -+ +> CHANGE 24 : 26 @ 24 : 26 + +~ for (int i = 0, l = this.villageList.size(); i < l; ++i) { +~ this.villageList.get(i).setWorld(worldIn); + +> CHANGE 16 : 18 @ 16 : 18 + +~ for (int i = 0, l = this.villageList.size(); i < l; ++i) { +~ this.villageList.get(i).tick(this.tickCounter); + +> CHANGE 32 : 34 @ 32 : 33 + +~ for (int i = 0, l = this.villageList.size(); i < l; ++i) { +~ Village village1 = this.villageList.get(i); + +> CHANGE 59 : 61 @ 59 : 60 + +~ for (int i = 0, l = this.newDoors.size(); i < l; ++i) { +~ VillageDoorInfo villagedoorinfo = this.newDoors.get(i); + +> CHANGE 7 : 9 @ 7 : 9 + +~ for (int i = 0, l = this.villageList.size(); i < l; ++i) { +~ VillageDoorInfo villagedoorinfo1 = this.villageList.get(i).getExistedDoor(doorBlock); + +> CHANGE 35 : 37 @ 35 : 37 + +~ for (int i = 0, l = this.villagerPositionsList.size(); i < l; ++i) { +~ if (this.villagerPositionsList.get(i).equals(pos)) { + +> CHANGE 29 : 30 @ 29 : 30 + +~ for (int i = 0, l = this.villageList.size(); i < l; ++i) { + +> CHANGE 1 : 2 @ 1 : 2 + +~ this.villageList.get(i).writeVillageDataToNBT(nbttagcompound1); > EOF diff --git a/patches/minecraft/net/minecraft/village/VillageDoorInfo.edit.java b/patches/minecraft/net/minecraft/village/VillageDoorInfo.edit.java index 60f453f..7572609 100644 --- a/patches/minecraft/net/minecraft/village/VillageDoorInfo.edit.java +++ b/patches/minecraft/net/minecraft/village/VillageDoorInfo.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/village/VillageSiege.edit.java b/patches/minecraft/net/minecraft/village/VillageSiege.edit.java index d3fd3f1..b9e201a 100644 --- a/patches/minecraft/net/minecraft/village/VillageSiege.edit.java +++ b/patches/minecraft/net/minecraft/village/VillageSiege.edit.java @@ -10,11 +10,15 @@ + + import net.lax1dude.eaglercraft.v1_8.EagRuntime; -> INSERT 12 : 13 @ 12 +> DELETE 7 @ 7 : 8 -+ +> CHANGE 86 : 89 @ 86 : 87 -> CHANGE 125 : 126 @ 125 : 126 +~ List lst = this.worldObj.getVillageCollection().getVillageList(); +~ for (int j = 0, l = lst.size(); j < l; ++j) { +~ Village village = lst.get(i); + +> CHANGE 42 : 43 @ 42 : 43 ~ EagRuntime.debugPrintStackTrace(exception); diff --git a/patches/minecraft/net/minecraft/world/ChunkCache.edit.java b/patches/minecraft/net/minecraft/world/ChunkCache.edit.java index 89831be..3595759 100644 --- a/patches/minecraft/net/minecraft/world/ChunkCache.edit.java +++ b/patches/minecraft/net/minecraft/world/ChunkCache.edit.java @@ -11,4 +11,11 @@ ~ return Chunk.getNoSkyLightValue(); +> CHANGE 4 : 8 @ 4 : 6 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ for (int i = 0; i < facings.length; ++i) { +~ int k = this.getLightFor(pos, parBlockPos.offsetEvenFaster(facings[i], tmp)); + > EOF diff --git a/patches/minecraft/net/minecraft/world/EnumDifficulty.edit.java b/patches/minecraft/net/minecraft/world/EnumDifficulty.edit.java new file mode 100644 index 0000000..c83d1ce --- /dev/null +++ b/patches/minecraft/net/minecraft/world/EnumDifficulty.edit.java @@ -0,0 +1,18 @@ + +# Eagler Context Redacted Diff +# Copyright (c) 2024 lax1dude. All rights reserved. + +# Version: 1.0 +# Author: lax1dude + +> CHANGE 6 : 7 @ 6 : 7 + +~ private static final EnumDifficulty[] difficultyEnums = new EnumDifficulty[4]; + +> CHANGE 21 : 24 @ 21 : 23 + +~ EnumDifficulty[] types = values(); +~ for (int i = 0; i < types.length; ++i) { +~ difficultyEnums[types[i].difficultyId] = types[i]; + +> EOF diff --git a/patches/minecraft/net/minecraft/world/Explosion.edit.java b/patches/minecraft/net/minecraft/world/Explosion.edit.java index 06c5122..74417ec 100644 --- a/patches/minecraft/net/minecraft/world/Explosion.edit.java +++ b/patches/minecraft/net/minecraft/world/Explosion.edit.java @@ -16,7 +16,11 @@ ~ import com.google.common.collect.Sets; ~ -> DELETE 15 @ 15 : 16 +> INSERT 12 : 13 @ 12 + ++ import net.minecraft.util.EnumFacing; + +> DELETE 3 @ 3 : 4 > CHANGE 4 : 5 @ 4 : 5 @@ -26,4 +30,17 @@ ~ this.explosionRNG = new EaglercraftRandom(); +> CHANGE 112 : 114 @ 112 : 113 + +~ for (int i = 0, l = this.affectedBlockPositions.size(); i < l; ++i) { +~ BlockPos blockpos = this.affectedBlockPositions.get(i); + +> CHANGE 36 : 41 @ 36 : 39 + +~ BlockPos tmp = new BlockPos(0, 0, 0); +~ for (int i = 0, l = this.affectedBlockPositions.size(); i < l; ++i) { +~ BlockPos blockpos1 = this.affectedBlockPositions.get(i); +~ if (this.worldObj.getBlockState(blockpos1).getBlock().getMaterial() == Material.air && this.worldObj +~ .getBlockState(blockpos1.offsetEvenFaster(EnumFacing.DOWN, tmp)).getBlock().isFullBlock() + > EOF diff --git a/patches/minecraft/net/minecraft/world/SpawnerAnimals.edit.java b/patches/minecraft/net/minecraft/world/SpawnerAnimals.edit.java index e998eb2..dc96e59 100644 --- a/patches/minecraft/net/minecraft/world/SpawnerAnimals.edit.java +++ b/patches/minecraft/net/minecraft/world/SpawnerAnimals.edit.java @@ -19,17 +19,27 @@ + import net.minecraft.entity.EntityList; -> INSERT 16 : 17 @ 16 +> DELETE 9 @ 9 : 12 -+ +> CHANGE 15 : 18 @ 15 : 16 -> CHANGE 21 : 24 @ 21 : 22 +~ List lst = spawnHostileMobs.playerEntities; +~ for (int m = 0, n = lst.size(); m < n; ++m) { +~ EntityPlayer entityplayer = lst.get(m); + +> CHANGE 9 : 12 @ 9 : 10 ~ if (!this.eligibleChunksForSpawning.contains(chunkcoordintpair) ~ && spawnHostileMobs.theChunkProviderServer.chunkExists(chunkcoordintpair.chunkXPos, ~ chunkcoordintpair.chunkZPos)) { -> CHANGE 65 : 67 @ 65 : 68 +> CHANGE 13 : 16 @ 13 : 14 + +~ EnumCreatureType[] types = EnumCreatureType._VALUES; +~ for (int m = 0; m < types.length; ++m) { +~ EnumCreatureType enumcreaturetype = types[m]; + +> CHANGE 51 : 53 @ 51 : 54 ~ entityliving = (EntityLiving) EntityList.createEntityByClassUnsafe( ~ biomegenbase$spawnlistentry.entityClass, spawnHostileMobs); diff --git a/patches/minecraft/net/minecraft/world/Teleporter.edit.java b/patches/minecraft/net/minecraft/world/Teleporter.edit.java index 72a4b9e..b95a755 100644 --- a/patches/minecraft/net/minecraft/world/Teleporter.edit.java +++ b/patches/minecraft/net/minecraft/world/Teleporter.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 13 : 14 @ 13 +> DELETE 9 @ 9 : 11 -+ - -> CHANGE 1 : 2 @ 1 : 2 +> CHANGE 3 : 4 @ 3 : 4 ~ private final EaglercraftRandom random; diff --git a/patches/minecraft/net/minecraft/world/World.edit.java b/patches/minecraft/net/minecraft/world/World.edit.java index e12c6c5..d813e51 100644 --- a/patches/minecraft/net/minecraft/world/World.edit.java +++ b/patches/minecraft/net/minecraft/world/World.edit.java @@ -84,15 +84,42 @@ ~ public void forceBlockUpdateTick(Block blockType, BlockPos pos, EaglercraftRandom random) { -> CHANGE 263 : 264 @ 263 : 264 +> CHANGE 93 : 96 @ 93 : 94 +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int m = 0; m < facings.length; ++m) { +~ EnumFacing enumfacing = facings[m]; + +> CHANGE 50 : 53 @ 50 : 51 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int m = 0; m < facings.length; ++m) { +~ EnumFacing enumfacing = facings[m]; + +> CHANGE 117 : 120 @ 117 : 119 + +~ for (int i = 0, l = this.loadedEntityList.size(); i < l; ++i) { +~ Entity entity = this.loadedEntityList.get(i); ~ if (entityType.isAssignableFrom(entity.getClass()) && filter.apply((T) entity)) { -> CHANGE 11 : 12 @ 11 : 12 +> CHANGE 10 : 13 @ 10 : 12 +~ for (int i = 0, l = this.playerEntities.size(); i < l; ++i) { +~ Entity entity = this.playerEntities.get(i); ~ if (playerType.isAssignableFrom(entity.getClass()) && filter.apply((T) entity)) { -> CHANGE 232 : 233 @ 232 : 233 +> CHANGE 68 : 70 @ 68 : 69 + +~ for (int j = 0, l = this.loadedEntityList.size(); j < l; ++j) { +~ Entity entity = this.loadedEntityList.get(j); + +> CHANGE 102 : 105 @ 102 : 103 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int k = 0; k < facings.length; ++k) { +~ EnumFacing enumfacing = facings[k]; + +> CHANGE 60 : 61 @ 60 : 61 ~ public EntityPlayer getPlayerEntityByUUID(EaglercraftUUID uuid) { @@ -100,7 +127,13 @@ ~ public EaglercraftRandom setRandomSeed(int parInt1, int parInt2, int parInt3) { -> INSERT 129 : 132 @ 129 +> CHANGE 67 : 70 @ 67 : 68 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + +> INSERT 61 : 64 @ 61 + if (!MinecraftServer.getServer().worldServers[0].getWorldInfo().getGameRulesInstance() + .getBoolean("loadSpawnChunks")) diff --git a/patches/minecraft/net/minecraft/world/WorldManager.edit.java b/patches/minecraft/net/minecraft/world/WorldManager.edit.java index b5da4fe..2e74d30 100644 --- a/patches/minecraft/net/minecraft/world/WorldManager.edit.java +++ b/patches/minecraft/net/minecraft/world/WorldManager.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 14 : 15 @ 14 - -+ +> DELETE 10 @ 10 : 12 > EOF diff --git a/patches/minecraft/net/minecraft/world/WorldServer.edit.java b/patches/minecraft/net/minecraft/world/WorldServer.edit.java index f38a959..57e9e43 100644 --- a/patches/minecraft/net/minecraft/world/WorldServer.edit.java +++ b/patches/minecraft/net/minecraft/world/WorldServer.edit.java @@ -16,24 +16,40 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; ~ import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerMinecraftServer; -> CHANGE 65 : 67 @ 65 : 67 +> DELETE 42 @ 42 : 53 + +> CHANGE 12 : 14 @ 12 : 14 ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> INSERT 2 : 3 @ 2 - -+ - -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 8 : 9 @ 8 : 9 ~ private final Map entitiesByUuid = Maps.newHashMap(); -> CHANGE 176 : 177 @ 176 : 177 +> CHANGE 143 : 145 @ 143 : 144 + +~ for (int k = 0, l = this.playerEntities.size(); k < l; ++k) { +~ EntityPlayer entityplayer = this.playerEntities.get(k); + +> CHANGE 15 : 17 @ 15 : 16 + +~ for (int k = 0, l = this.playerEntities.size(); k < l; ++k) { +~ EntityPlayer entityplayer = this.playerEntities.get(k); + +> CHANGE 16 : 19 @ 16 : 18 ~ if (this.allPlayersSleeping) { +~ for (int k = 0, l = this.playerEntities.size(); k < l; ++k) { +~ EntityPlayer entityplayer = this.playerEntities.get(k); -> INSERT 105 : 106 @ 105 +> CHANGE 88 : 91 @ 88 : 89 + +~ ExtendedBlockStorage[] vigg = chunk.getBlockStorageArray(); +~ for (int m = 0; m < vigg.length; ++m) { +~ ExtendedBlockStorage extendedblockstorage = vigg[m]; + +> INSERT 15 : 16 @ 15 + ++EaglerMinecraftServer.counterTileUpdate; @@ -49,7 +65,31 @@ ~ EaglercraftRandom random = new EaglercraftRandom(this.getSeed()); -> CHANGE 268 : 269 @ 268 : 269 +> CHANGE 62 : 65 @ 62 : 63 + +~ List lst = Lists.newArrayList(this.theChunkProviderServer.func_152380_a()); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ Chunk chunk = lst.get(i); + +> CHANGE 79 : 82 @ 79 : 80 + +~ List lst = this.playerEntities; +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ EntityPlayer entityplayer = lst.get(i); + +> CHANGE 13 : 16 @ 13 : 15 + +~ ServerBlockEventList lst = this.field_147490_S[this.blockEventCacheIndex]; +~ for (int k = 0, l = lst.size(); k < l; ++k) { +~ if (lst.get(k).equals(blockeventdata)) { + +> CHANGE 12 : 15 @ 12 : 13 + +~ ServerBlockEventList lst = this.field_147490_S[i]; +~ for (int k = 0, l = lst.size(); k < l; ++k) { +~ BlockEventData blockeventdata = lst.get(k); + +> CHANGE 97 : 98 @ 97 : 98 ~ public Entity getEntityFromUuid(EaglercraftUUID uuid) { diff --git a/patches/minecraft/net/minecraft/world/WorldServerMulti.edit.java b/patches/minecraft/net/minecraft/world/WorldServerMulti.edit.java index b5da4fe..3e397c6 100644 --- a/patches/minecraft/net/minecraft/world/WorldServerMulti.edit.java +++ b/patches/minecraft/net/minecraft/world/WorldServerMulti.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 14 : 15 @ 14 - -+ +> DELETE 5 @ 5 : 8 > EOF diff --git a/patches/minecraft/net/minecraft/world/WorldSettings.edit.java b/patches/minecraft/net/minecraft/world/WorldSettings.edit.java index a8dd664..acba398 100644 --- a/patches/minecraft/net/minecraft/world/WorldSettings.edit.java +++ b/patches/minecraft/net/minecraft/world/WorldSettings.edit.java @@ -7,4 +7,21 @@ > DELETE 3 @ 3 : 4 +> INSERT 82 : 84 @ 82 + ++ public static final GameType[] _VALUES = values(); ++ + +> CHANGE 49 : 52 @ 49 : 50 + +~ WorldSettings.GameType[] types = _VALUES; +~ for (int i = 0; i < types.length; ++i) { +~ WorldSettings.GameType worldsettings$gametype = types[i]; + +> CHANGE 9 : 12 @ 9 : 10 + +~ WorldSettings.GameType[] types = _VALUES; +~ for (int i = 0; i < types.length; ++i) { +~ WorldSettings.GameType worldsettings$gametype = types[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeCache.edit.java b/patches/minecraft/net/minecraft/world/biome/BiomeCache.edit.java index 61e0fa2..6422a38 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeCache.edit.java +++ b/patches/minecraft/net/minecraft/world/biome/BiomeCache.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 10 : 11 @ 10 - -+ +> DELETE 6 @ 6 : 8 > EOF diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.edit.java b/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.edit.java index 5d4ec2e..36bdb08 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.edit.java +++ b/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.edit.java @@ -9,7 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 24 : 25 @ 24 +> DELETE 6 @ 6 : 7 + +> INSERT 17 : 18 @ 17 + diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeEndDecorator.edit.java b/patches/minecraft/net/minecraft/world/biome/BiomeEndDecorator.edit.java index 61e0fa2..7e3f464 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeEndDecorator.edit.java +++ b/patches/minecraft/net/minecraft/world/biome/BiomeEndDecorator.edit.java @@ -5,7 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 10 : 11 @ 10 +> DELETE 4 @ 4 : 6 + +> INSERT 4 : 5 @ 4 + diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.edit.java b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.edit.java index 98e9ed2..3fb538e 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.edit.java +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.edit.java @@ -172,12 +172,14 @@ ~ field_180279_ad = ocean; ~ -> INSERT 22 : 24 @ 22 +> CHANGE 22 : 26 @ 22 : 23 -+ explorationBiomesList.clear(); -+ +~ explorationBiomesList.clear(); +~ +~ for (int i = 0; i < biomeList.length; ++i) { +~ BiomeGenBase biomegenbase = biomeList[i]; -> CHANGE 19 : 21 @ 19 : 21 +> CHANGE 18 : 20 @ 18 : 20 ~ temperatureNoise = new NoiseGeneratorPerlin(new EaglercraftRandom(1234L), 1); ~ GRASS_COLOR_NOISE = new NoiseGeneratorPerlin(new EaglercraftRandom(2345L), 1); diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.edit.java b/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.edit.java index a65c812..de9160d 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.edit.java +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.edit.java @@ -19,7 +19,12 @@ ~ public BlockFlower.EnumFlowerType pickRandomFlower(EaglercraftRandom random, BlockPos blockpos) { -> CHANGE 14 : 15 @ 14 : 15 +> CHANGE 4 : 6 @ 4 : 6 + +~ BlockFlower.EnumFlowerType blockflower$enumflowertype = BlockFlower.EnumFlowerType._VALUES[(int) (d0 +~ * (double) BlockFlower.EnumFlowerType._VALUES.length)]; + +> CHANGE 8 : 9 @ 8 : 9 ~ public void decorate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenMesa.edit.java b/patches/minecraft/net/minecraft/world/biome/BiomeGenMesa.edit.java index b5934f5..32a7a08 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenMesa.edit.java +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenMesa.edit.java @@ -9,7 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 44 : 45 @ 44 : 45 +> DELETE 9 @ 9 : 10 + +> CHANGE 34 : 35 @ 34 : 35 ~ public WorldGenAbstractTree genBigTreeChance(EaglercraftRandom var1) { diff --git a/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.edit.java b/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.edit.java index c5f6221..118f33a 100644 --- a/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.edit.java +++ b/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 12 : 13 @ 12 +> DELETE 6 @ 6 : 8 -+ - -> CHANGE 163 : 164 @ 163 : 164 +> CHANGE 167 : 168 @ 167 : 168 ~ public BlockPos findBiomePosition(int x, int z, int range, List biomes, EaglercraftRandom random) { diff --git a/patches/minecraft/net/minecraft/world/biome/WorldChunkManagerHell.edit.java b/patches/minecraft/net/minecraft/world/biome/WorldChunkManagerHell.edit.java index eaecf53..ed8acce 100644 --- a/patches/minecraft/net/minecraft/world/biome/WorldChunkManagerHell.edit.java +++ b/patches/minecraft/net/minecraft/world/biome/WorldChunkManagerHell.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 5 : 6 @ 5 +> DELETE 1 @ 1 : 3 -+ - -> CHANGE 43 : 44 @ 43 : 44 +> CHANGE 45 : 46 @ 45 : 46 ~ public BlockPos findBiomePosition(int i, int j, int k, List list, EaglercraftRandom random) { diff --git a/patches/minecraft/net/minecraft/world/border/WorldBorder.edit.java b/patches/minecraft/net/minecraft/world/border/WorldBorder.edit.java index 86fbdc8..2f9f340 100644 --- a/patches/minecraft/net/minecraft/world/border/WorldBorder.edit.java +++ b/patches/minecraft/net/minecraft/world/border/WorldBorder.edit.java @@ -15,4 +15,46 @@ > DELETE 4 @ 4 : 6 +> CHANGE 105 : 108 @ 105 : 107 + +~ List lst = this.getListeners(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ lst.get(i).onCenterChanged(this, x, z); + +> CHANGE 32 : 35 @ 32 : 34 + +~ List lst = this.getListeners(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ lst.get(i).onSizeChanged(this, newSize); + +> CHANGE 10 : 13 @ 10 : 12 + +~ List lst = this.getListeners(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ lst.get(i).onTransitionStarted(this, oldSize, newSize, time); + +> CHANGE 27 : 30 @ 27 : 29 + +~ List lst = this.getListeners(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ lst.get(i).onDamageBufferChanged(this, bufferSize); + +> CHANGE 11 : 14 @ 11 : 13 + +~ List lst = this.getListeners(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ lst.get(i).onDamageAmountChanged(this, newAmount); + +> CHANGE 16 : 19 @ 16 : 18 + +~ List lst = this.getListeners(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ lst.get(i).onWarningTimeChanged(this, warningTime); + +> CHANGE 11 : 14 @ 11 : 13 + +~ List lst = this.getListeners(); +~ for (int i = 0, l = lst.size(); i < l; ++i) { +~ lst.get(i).onWarningDistanceChanged(this, warningDistance); + > EOF diff --git a/patches/minecraft/net/minecraft/world/chunk/Chunk.edit.java b/patches/minecraft/net/minecraft/world/chunk/Chunk.edit.java index 1e1e1bc..5a0f735 100644 --- a/patches/minecraft/net/minecraft/world/chunk/Chunk.edit.java +++ b/patches/minecraft/net/minecraft/world/chunk/Chunk.edit.java @@ -45,7 +45,24 @@ + ++EaglerMinecraftServer.counterLightUpdate; + } -> INSERT 146 : 149 @ 146 +> CHANGE 20 : 23 @ 20 : 21 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int m = 0; m < facings.length; ++m) { +~ EnumFacing enumfacing = facings[m]; + +> CHANGE 6 : 8 @ 6 : 7 + +~ for (int m = 0; m < facings.length; ++m) { +~ EnumFacing enumfacing1 = facings[m]; + +> CHANGE 110 : 113 @ 110 : 111 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int m = 0; m < facings.length; ++m) { +~ EnumFacing enumfacing = facings[m]; + +> INSERT 7 : 10 @ 7 + if (!this.worldObj.isRemote) { + ++EaglerMinecraftServer.counterLightUpdate; @@ -153,4 +170,19 @@ ~ if (chunkManager != null && k == 255) { +> INSERT 42 : 43 @ 42 + ++ EnumFacing[] facings = EnumFacing._VALUES; + +> CHANGE 5 : 7 @ 5 : 7 + +~ for (int m = 0; m < facings.length; ++m) { +~ BlockPos blockpos2 = blockpos1.offset(facings[m]); + +> CHANGE 29 : 32 @ 29 : 30 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.edit.java b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.edit.java index 472e046..535387b 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.edit.java +++ b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.edit.java @@ -5,30 +5,38 @@ # Version: 1.0 # Author: lax1dude -> DELETE 5 @ 5 : 6 +> DELETE 2 @ 2 : 8 -> CHANGE 23 : 25 @ 23 : 28 +> DELETE 1 @ 1 : 4 + +> DELETE 3 @ 3 : 4 + +> DELETE 5 @ 5 : 7 + +> CHANGE 4 : 6 @ 4 : 11 ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> CHANGE 1 : 2 @ 1 : 7 +> CHANGE 1 : 3 @ 1 : 7 ~ public abstract class AnvilChunkLoader implements IChunkLoader { - -> CHANGE 1 : 2 @ 1 : 4 - ~ private static final Logger logger = LogManager.getLogger("AnvilChunkLoader"); -> DELETE 1 @ 1 : 17 +> DELETE 1 @ 1 : 21 > CHANGE 24 : 25 @ 24 : 109 ~ protected void writeChunkToNBT(Chunk chunkIn, World worldIn, NBTTagCompound parNBTTagCompound) { -> CHANGE 85 : 86 @ 85 : 86 +> CHANGE 80 : 81 @ 80 : 81 -~ for (NextTickListEntry nextticklistentry : (List) list) { +~ List list = worldIn.getPendingBlockUpdates(chunkIn, false); + +> CHANGE 4 : 6 @ 4 : 5 + +~ for (int k = 0, l = list.size(); k < l; ++k) { +~ NextTickListEntry nextticklistentry = list.get(k); > CHANGE 17 : 18 @ 17 : 18 diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/ChunkLoader.edit.java b/patches/minecraft/net/minecraft/world/chunk/storage/ChunkLoader.edit.java index e395576..d9711e3 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/ChunkLoader.edit.java +++ b/patches/minecraft/net/minecraft/world/chunk/storage/ChunkLoader.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 11 : 12 @ 11 - -+ +> DELETE 8 @ 8 : 9 > EOF diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.edit.java b/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.edit.java index d32d3a5..4edc466 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.edit.java +++ b/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.edit.java @@ -7,16 +7,20 @@ > DELETE 2 @ 2 : 3 -> DELETE 5 @ 5 : 6 +> DELETE 1 @ 1 : 3 + +> DELETE 2 @ 2 : 3 > DELETE 1 @ 1 : 2 > DELETE 1 @ 1 : 5 -> INSERT 1 : 6 @ 1 +> INSERT 1 : 8 @ 1 + import com.google.common.collect.Lists; + ++ 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.sp.server.export.RandomAccessMemoryFile; + @@ -60,11 +64,11 @@ > CHANGE 10 : 12 @ 10 : 12 ~ return new DataInputStream(new BufferedInputStream( -~ EaglerZLIB.newGZIPInputStream(new ByteArrayInputStream(abyte1)))); +~ EaglerZLIB.newGZIPInputStream(new EaglerInputStream(abyte1)))); > CHANGE 4 : 5 @ 4 : 5 -~ EaglerZLIB.newInflaterInputStream(new ByteArrayInputStream(abyte)))); +~ EaglerZLIB.newInflaterInputStream(new EaglerInputStream(abyte)))); > CHANGE 12 : 13 @ 12 : 13 @@ -103,4 +107,8 @@ ~ public RandomAccessMemoryFile getFile() { ~ return dataFile; +> CHANGE 2 : 3 @ 2 : 3 + +~ class ChunkBuffer extends EaglerOutputStream { + > EOF diff --git a/patches/minecraft/net/minecraft/world/demo/DemoWorldManager.edit.java b/patches/minecraft/net/minecraft/world/demo/DemoWorldManager.edit.java index 9e4f0d7..7572609 100644 --- a/patches/minecraft/net/minecraft/world/demo/DemoWorldManager.edit.java +++ b/patches/minecraft/net/minecraft/world/demo/DemoWorldManager.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 12 : 13 @ 12 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/world/demo/DemoWorldServer.edit.java b/patches/minecraft/net/minecraft/world/demo/DemoWorldServer.edit.java index 19d48a0..cf86a38 100644 --- a/patches/minecraft/net/minecraft/world/demo/DemoWorldServer.edit.java +++ b/patches/minecraft/net/minecraft/world/demo/DemoWorldServer.edit.java @@ -10,9 +10,8 @@ + import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; + -> CHANGE 1 : 3 @ 1 : 2 +> CHANGE 1 : 2 @ 1 : 2 -~ ~ private static final long demoWorldSeed = EaglercraftVersion.demoWorldSeed; > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderDebug.edit.java b/patches/minecraft/net/minecraft/world/gen/ChunkProviderDebug.edit.java index e8768a1..7572609 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderDebug.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderDebug.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 18 : 19 @ 18 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.edit.java b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.edit.java index fe98eb0..e068c6a 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.edit.java @@ -9,9 +9,10 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 16 : 18 @ 16 : 17 +> DELETE 13 @ 13 : 14 + +> CHANGE 2 : 3 @ 2 : 3 -~ ~ private EaglercraftRandom endRNG; > CHANGE 16 : 17 @ 16 : 17 diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderFlat.edit.java b/patches/minecraft/net/minecraft/world/gen/ChunkProviderFlat.edit.java index af2c971..87c486a 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderFlat.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderFlat.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 24 : 25 @ 24 +> DELETE 11 @ 11 : 14 -+ - -> CHANGE 1 : 2 @ 1 : 2 +> CHANGE 11 : 12 @ 11 : 12 ~ private EaglercraftRandom random; @@ -21,4 +19,19 @@ ~ this.random = new EaglercraftRandom(seed); +> CHANGE 110 : 112 @ 110 : 111 + +~ for (int m = 0, n = this.structureGenerators.size(); m < n; ++m) { +~ MapGenStructure mapgenstructure = this.structureGenerators.get(m); + +> CHANGE 63 : 65 @ 63 : 64 + +~ for (int m = 0, n = this.structureGenerators.size(); m < n; ++m) { +~ MapGenStructure mapgenstructure = this.structureGenerators.get(m); + +> CHANGE 14 : 16 @ 14 : 16 + +~ for (int m = 0, n = this.structureGenerators.size(); m < n; ++m) { +~ this.structureGenerators.get(m).generate(this, this.worldObj, i, j, (ChunkPrimer) null); + > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.edit.java b/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.edit.java index 5669a87..82a06c5 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.edit.java @@ -9,9 +9,10 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 30 : 32 @ 30 : 31 +> DELETE 15 @ 15 : 21 + +> CHANGE 9 : 10 @ 9 : 10 -~ ~ private EaglercraftRandom rand; > CHANGE 32 : 33 @ 32 : 33 diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.edit.java b/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.edit.java index f616a61..f90a6ac 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 28 : 29 @ 28 +> DELETE 15 @ 15 : 19 -+ - -> CHANGE 2 : 3 @ 2 : 3 +> CHANGE 11 : 12 @ 11 : 12 ~ private final EaglercraftRandom hellRNG; diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.edit.java b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.edit.java index 0804487..865eadb 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.edit.java @@ -15,11 +15,11 @@ ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> INSERT 2 : 3 @ 2 +> CHANGE 9 : 10 @ 9 : 10 -+ +~ private List loadedChunks = Lists.newLinkedList(); -> INSERT 56 : 57 @ 56 +> INSERT 48 : 49 @ 48 + ++EaglerMinecraftServer.counterChunkGenerate; @@ -36,4 +36,8 @@ + ++EaglerMinecraftServer.counterChunkWrite; +> CHANGE 36 : 37 @ 36 : 37 + +~ for (int j = 0, l = arraylist.size(); j < l; ++j) { + > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/FlatGeneratorInfo.edit.java b/patches/minecraft/net/minecraft/world/gen/FlatGeneratorInfo.edit.java index 6faef69..2c4f328 100644 --- a/patches/minecraft/net/minecraft/world/gen/FlatGeneratorInfo.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/FlatGeneratorInfo.edit.java @@ -17,8 +17,23 @@ > DELETE 4 @ 4 : 5 -> CHANGE 62 : 63 @ 62 : 63 +> CHANGE 25 : 27 @ 25 : 26 + +~ for (int j = 0, l = this.flatLayers.size(); j < l; ++j) { +~ FlatLayerInfo flatlayerinfo = this.flatLayers.get(j); + +> CHANGE 36 : 37 @ 36 : 37 ~ for (Entry entry1 : (Set) map.entrySet()) { +> CHANGE 88 : 90 @ 88 : 90 + +~ for (int j = 0; j < astring.length; ++j) { +~ FlatLayerInfo flatlayerinfo = func_180715_a(parInt1, astring[j], i); + +> CHANGE 36 : 38 @ 36 : 38 + +~ for (int m = 0; m < astring1.length; ++m) { +~ String[] astring2 = astring1[m].split("\\(", 2); + > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenBase.edit.java b/patches/minecraft/net/minecraft/world/gen/MapGenBase.edit.java index 877b528..c73afac 100644 --- a/patches/minecraft/net/minecraft/world/gen/MapGenBase.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/MapGenBase.edit.java @@ -9,11 +9,7 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 5 : 6 @ 5 - -+ - -> CHANGE 1 : 2 @ 1 : 2 +> CHANGE 6 : 7 @ 6 : 7 ~ protected EaglercraftRandom rand = new EaglercraftRandom(); diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenCaves.edit.java b/patches/minecraft/net/minecraft/world/gen/MapGenCaves.edit.java index 7e8b1cf..51803e7 100644 --- a/patches/minecraft/net/minecraft/world/gen/MapGenCaves.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/MapGenCaves.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 11 : 12 @ 11 +> DELETE 8 @ 8 : 9 -+ - -> CHANGE 13 : 14 @ 13 : 14 +> CHANGE 15 : 16 @ 15 : 16 ~ EaglercraftRandom random = new EaglercraftRandom(parLong1); diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenCavesHell.edit.java b/patches/minecraft/net/minecraft/world/gen/MapGenCavesHell.edit.java index d623e03..7fd6bd1 100644 --- a/patches/minecraft/net/minecraft/world/gen/MapGenCavesHell.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/MapGenCavesHell.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 8 : 9 @ 8 +> DELETE 5 @ 5 : 6 -+ - -> CHANGE 13 : 14 @ 13 : 14 +> CHANGE 15 : 16 @ 15 : 16 ~ EaglercraftRandom random = new EaglercraftRandom(parLong1); diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenRavine.edit.java b/patches/minecraft/net/minecraft/world/gen/MapGenRavine.edit.java index 323f98c..d24d97d 100644 --- a/patches/minecraft/net/minecraft/world/gen/MapGenRavine.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/MapGenRavine.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 9 : 10 @ 9 +> DELETE 6 @ 6 : 7 -+ - -> CHANGE 5 : 6 @ 5 : 6 +> CHANGE 7 : 8 @ 7 : 8 ~ EaglercraftRandom random = new EaglercraftRandom(parLong1); diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.edit.java index 8a84ecb..89c0a2a 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 8 : 9 @ 8 +> DELETE 5 @ 5 : 6 -+ - -> CHANGE 11 : 12 @ 11 : 12 +> CHANGE 13 : 14 @ 13 : 14 ~ public void func_180711_a(World worldIn, EaglercraftRandom parRandom, BlockPos parBlockPos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.edit.java index 0f31d7b..e295768 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 9 : 10 @ 9 +> DELETE 6 @ 6 : 7 -+ - -> CHANGE 11 : 12 @ 11 : 12 +> CHANGE 13 : 14 @ 13 : 14 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.edit.java index a2b7625..028bd7b 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.edit.java @@ -9,9 +9,10 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 12 : 14 @ 12 : 13 +> DELETE 9 @ 9 : 10 + +> CHANGE 2 : 3 @ 2 : 3 -~ ~ private EaglercraftRandom rand; > CHANGE 37 : 39 @ 37 : 39 @@ -19,7 +20,17 @@ ~ double d0 = this.scaleWidth * (double) f * ((double) rand.nextFloat() + 0.328D); ~ double d1 = (double) (rand.nextFloat() * 2.0F) * 3.141592653589793D; -> CHANGE 171 : 172 @ 171 : 172 +> CHANGE 111 : 113 @ 111 : 113 + +~ for (int i = 0, l = this.field_175948_j.size(); i < l; ++i) { +~ this.generateLeafNode(this.field_175948_j.get(i)); + +> CHANGE 22 : 24 @ 22 : 23 + +~ for (int j = 0, l = this.field_175948_j.size(); j < l; ++j) { +~ WorldGenBigTree.FoliageCoordinates worldgenbigtree$foliagecoordinates = this.field_175948_j.get(j); + +> CHANGE 35 : 36 @ 35 : 36 ~ public boolean generate(World worldIn, EaglercraftRandom rand, BlockPos position) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBlockBlob.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBlockBlob.edit.java index bf86377..1493ab3 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBlockBlob.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBlockBlob.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 7 : 8 @ 7 +> DELETE 4 @ 4 : 5 -+ - -> CHANGE 9 : 10 @ 9 : 10 +> CHANGE 11 : 12 @ 11 : 12 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCactus.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCactus.edit.java index afe4738..6ed184f 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCactus.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCactus.edit.java @@ -9,9 +9,10 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 6 : 8 @ 6 : 7 +> DELETE 3 @ 3 : 4 + +> CHANGE 2 : 3 @ 2 : 3 -~ ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.edit.java index 30781c3..4c5dc06 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 14 : 15 @ 14 +> DELETE 11 @ 11 : 12 -+ - -> CHANGE 10 : 11 @ 10 : 11 +> CHANGE 12 : 13 @ 12 : 13 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenClay.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenClay.edit.java index 8600d62..bcf0a12 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenClay.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenClay.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 8 : 9 @ 8 +> DELETE 5 @ 5 : 6 -+ - -> CHANGE 7 : 8 @ 7 : 8 +> CHANGE 9 : 10 @ 9 : 10 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.edit.java index dd92a3e..dc816e1 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.edit.java @@ -9,9 +9,10 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 8 : 10 @ 8 : 9 +> DELETE 5 @ 5 : 6 + +> CHANGE 2 : 3 @ 2 : 3 -~ ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDesertWells.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDesertWells.edit.java index 5b0dde8..5875215 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDesertWells.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDesertWells.edit.java @@ -9,12 +9,16 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 12 : 13 @ 12 +> DELETE 9 @ 9 : 10 -+ - -> CHANGE 8 : 9 @ 8 : 9 +> CHANGE 10 : 11 @ 10 : 11 ~ public boolean generate(World world, EaglercraftRandom var2, BlockPos blockpos) { +> CHANGE 25 : 28 @ 25 : 27 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ world.setBlockState(blockpos.offset(facings[i]), this.field_175910_d, 2); + > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDoublePlant.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDoublePlant.edit.java index c13f33e..f8454de 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDoublePlant.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDoublePlant.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 7 : 8 @ 7 +> DELETE 4 @ 4 : 5 -+ - -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 8 : 9 @ 8 : 9 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.edit.java index f1c39a2..15c5240 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.edit.java @@ -9,20 +9,22 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 11 : 13 @ 11 : 13 +> CHANGE 10 : 12 @ 10 : 13 ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> INSERT 2 : 3 @ 2 - -+ - -> CHANGE 19 : 20 @ 19 : 20 +> CHANGE 21 : 22 @ 21 : 22 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { -> CHANGE 103 : 104 @ 103 : 104 +> CHANGE 66 : 69 @ 66 : 68 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int m = 0; m < facings.length; ++m) { +~ if (world.getBlockState(blockpos3.offset(facings[m])).getBlock().getMaterial().isSolid()) { + +> CHANGE 35 : 36 @ 35 : 36 ~ private String pickMobSpawner(EaglercraftRandom parRandom) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenFire.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenFire.edit.java index afe4738..6ed184f 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenFire.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenFire.edit.java @@ -9,9 +9,10 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 6 : 8 @ 6 : 7 +> DELETE 3 @ 3 : 4 + +> CHANGE 2 : 3 @ 2 : 3 -~ ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenFlowers.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenFlowers.edit.java index 2354e9d..784a811 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenFlowers.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenFlowers.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 7 : 8 @ 7 +> DELETE 4 @ 4 : 5 -+ - -> CHANGE 13 : 14 @ 13 : 14 +> CHANGE 15 : 16 @ 15 : 16 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.edit.java index 5edaf13..60a12be 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 12 : 13 @ 12 +> DELETE 9 @ 9 : 10 -+ - -> CHANGE 12 : 13 @ 12 : 13 +> CHANGE 14 : 15 @ 14 : 15 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.edit.java index dd92a3e..d66c32a 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.edit.java @@ -9,9 +9,23 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 8 : 10 @ 8 : 9 +> DELETE 5 @ 5 : 6 + +> CHANGE 2 : 4 @ 2 : 3 -~ ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { +~ BlockPos tmp; + +> CHANGE 2 : 4 @ 2 : 3 + +~ } else if (world.getBlockState(blockpos.offsetEvenFaster(EnumFacing.UP, tmp = new BlockPos(0, 0, 0))) +~ .getBlock() != Blocks.netherrack) { + +> CHANGE 10 : 14 @ 10 : 12 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int k = 0; k < facings.length; ++k) { +~ if (world.getBlockState(blockpos1.offsetEvenFaster(facings[k], tmp)) +~ .getBlock() == Blocks.glowstone) { > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.edit.java index dd92a3e..d66c32a 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone2.edit.java @@ -9,9 +9,23 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 8 : 10 @ 8 : 9 +> DELETE 5 @ 5 : 6 + +> CHANGE 2 : 4 @ 2 : 3 -~ ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { +~ BlockPos tmp; + +> CHANGE 2 : 4 @ 2 : 3 + +~ } else if (world.getBlockState(blockpos.offsetEvenFaster(EnumFacing.UP, tmp = new BlockPos(0, 0, 0))) +~ .getBlock() != Blocks.netherrack) { + +> CHANGE 10 : 14 @ 10 : 12 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int k = 0; k < facings.length; ++k) { +~ if (world.getBlockState(blockpos1.offsetEvenFaster(facings[k], tmp)) +~ .getBlock() == Blocks.glowstone) { > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.edit.java index af6c975..4783ecc 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHellLava.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 8 : 9 @ 8 +> DELETE 5 @ 5 : 6 -+ - -> CHANGE 8 : 9 @ 8 : 9 +> CHANGE 10 : 11 @ 10 : 11 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.edit.java index cdf7fd1..0fb8853 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 9 : 10 @ 9 +> DELETE 6 @ 6 : 7 -+ - -> CHANGE 14 : 15 @ 14 : 15 +> CHANGE 16 : 17 @ 16 : 17 ~ protected int func_150533_a(EaglercraftRandom parRandom) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenIcePath.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenIcePath.edit.java index 6c3f730..6c38fb5 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenIcePath.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenIcePath.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 7 : 8 @ 7 +> DELETE 4 @ 4 : 5 -+ - -> CHANGE 7 : 8 @ 7 : 8 +> CHANGE 9 : 10 @ 9 : 10 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.edit.java index 3a5e0e4..d1f9e3e 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenIceSpike.edit.java @@ -9,9 +9,10 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 9 : 11 @ 9 : 10 +> DELETE 6 @ 6 : 7 + +> CHANGE 2 : 3 @ 2 : 3 -~ ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.edit.java index 43f9838..b7cc8a1 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 10 : 11 @ 10 +> DELETE 7 @ 7 : 8 -+ - -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 8 : 9 @ 8 : 9 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.edit.java index d4da835..4727abe 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenLiquids.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 8 : 9 @ 8 +> DELETE 5 @ 5 : 6 -+ - -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 8 : 9 @ 8 : 9 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.edit.java index d6f96dd..f833b0a 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 10 : 11 @ 10 +> DELETE 7 @ 7 : 8 -+ - -> CHANGE 5 : 6 @ 5 : 6 +> CHANGE 7 : 8 @ 7 : 8 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.edit.java index ae1947d..0bc8a06 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 15 : 16 @ 15 +> DELETE 12 @ 12 : 13 -+ - -> CHANGE 14 : 15 @ 14 : 15 +> CHANGE 16 : 17 @ 16 : 17 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMelon.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMelon.edit.java index afe4738..6ed184f 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMelon.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMelon.edit.java @@ -9,9 +9,10 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 6 : 8 @ 6 : 7 +> DELETE 3 @ 3 : 4 + +> CHANGE 2 : 3 @ 2 : 3 -~ ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.edit.java index 2c42eba..666e47d 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 9 : 10 @ 9 +> DELETE 6 @ 6 : 7 -+ - -> CHANGE 14 : 15 @ 14 : 15 +> CHANGE 16 : 17 @ 16 : 17 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenPumpkin.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenPumpkin.edit.java index dd92a3e..dc816e1 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenPumpkin.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenPumpkin.edit.java @@ -9,9 +9,10 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 8 : 10 @ 8 : 9 +> DELETE 5 @ 5 : 6 + +> CHANGE 2 : 3 @ 2 : 3 -~ ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenReed.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenReed.edit.java index 51a3b42..35e9533 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenReed.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenReed.edit.java @@ -9,9 +9,10 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 7 : 9 @ 7 : 8 +> DELETE 4 @ 4 : 5 + +> CHANGE 2 : 3 @ 2 : 3 -~ ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSand.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSand.edit.java index af6c975..4783ecc 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSand.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSand.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 8 : 9 @ 8 +> DELETE 5 @ 5 : 6 -+ - -> CHANGE 8 : 9 @ 8 : 9 +> CHANGE 10 : 11 @ 10 : 11 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.edit.java index 30781c3..4c5dc06 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 14 : 15 @ 14 +> DELETE 11 @ 11 : 12 -+ - -> CHANGE 10 : 11 @ 10 : 11 +> CHANGE 12 : 13 @ 12 : 13 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.edit.java index a3e741c..7271ad3 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 9 : 10 @ 9 +> DELETE 6 @ 6 : 7 -+ - -> CHANGE 9 : 10 @ 9 : 10 +> CHANGE 11 : 12 @ 11 : 12 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSpikes.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSpikes.edit.java index d4da835..4727abe 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSpikes.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSpikes.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 8 : 9 @ 8 +> DELETE 5 @ 5 : 6 -+ - -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 8 : 9 @ 8 : 9 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.edit.java index 30781c3..4c5dc06 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 14 : 15 @ 14 +> DELETE 11 @ 11 : 12 -+ - -> CHANGE 10 : 11 @ 10 : 11 +> CHANGE 12 : 13 @ 12 : 13 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.edit.java index c699c4b..a8005cf 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 13 : 14 @ 13 +> DELETE 10 @ 10 : 11 -+ - -> CHANGE 10 : 11 @ 10 : 11 +> CHANGE 12 : 13 @ 12 : 13 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.edit.java index c699c4b..a8005cf 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 13 : 14 @ 13 +> DELETE 10 @ 10 : 11 -+ - -> CHANGE 10 : 11 @ 10 : 11 +> CHANGE 12 : 13 @ 12 : 13 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.edit.java index 43f9838..b7cc8a1 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 10 : 11 @ 10 +> DELETE 7 @ 7 : 8 -+ - -> CHANGE 6 : 7 @ 6 : 7 +> CHANGE 8 : 9 @ 8 : 9 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.edit.java index 536b65c..0a83582 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.edit.java @@ -9,12 +9,16 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 17 : 18 @ 17 +> DELETE 14 @ 14 : 15 -+ - -> CHANGE 23 : 24 @ 23 : 24 +> CHANGE 25 : 26 @ 25 : 26 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { +> CHANGE 126 : 129 @ 126 : 127 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int m = 0; m < facings.length; ++m) { +~ EnumFacing enumfacing = facings[m]; + > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenVines.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenVines.edit.java index 3a5e0e4..298f764 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenVines.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenVines.edit.java @@ -9,9 +9,16 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 9 : 11 @ 9 : 10 +> DELETE 6 @ 6 : 7 + +> CHANGE 2 : 3 @ 2 : 3 -~ ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { +> CHANGE 2 : 5 @ 2 : 3 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int i = 0; i < facings.length; ++i) { +~ EnumFacing enumfacing = facings[i]; + > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenWaterlily.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenWaterlily.edit.java index afe4738..6ed184f 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenWaterlily.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenWaterlily.edit.java @@ -9,9 +9,10 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> CHANGE 6 : 8 @ 6 : 7 +> DELETE 3 @ 3 : 4 + +> CHANGE 2 : 3 @ 2 : 3 -~ ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenerator.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenerator.edit.java index 0c69b92..2e66a5d 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenerator.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenerator.edit.java @@ -9,11 +9,7 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 5 : 6 @ 5 - -+ - -> CHANGE 10 : 11 @ 10 : 11 +> CHANGE 15 : 16 @ 15 : 16 ~ public abstract boolean generate(World var1, EaglercraftRandom var2, BlockPos var3); diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.edit.java b/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.edit.java index 321f835..fb068b3 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 11 : 12 @ 11 +> DELETE 8 @ 8 : 9 -+ - -> CHANGE 8 : 9 @ 8 : 9 +> CHANGE 10 : 11 @ 10 : 11 ~ public boolean generate(World world, EaglercraftRandom random, BlockPos blockpos) { diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.edit.java index 26984b9..4614df5 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.edit.java @@ -5,11 +5,9 @@ # Version: 1.0 # Author: lax1dude -> INSERT 30 : 31 @ 30 +> DELETE 9 @ 9 : 28 -+ - -> CHANGE 44 : 45 @ 44 : 45 +> CHANGE 46 : 47 @ 46 : 47 ~ GenLayer genlayerhills = new GenLayerHills(1000L, genlayerbiomeedge, genlayer1); diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerAddIsland.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerAddIsland.edit.java index 60f453f..0c65978 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerAddIsland.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerAddIsland.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ +> DELETE 2 @ 2 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.edit.java index 8477115..831f1a2 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 3 @ 3 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerAddSnow.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerAddSnow.edit.java index 60f453f..0c65978 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerAddSnow.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerAddSnow.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ +> DELETE 2 @ 2 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.edit.java index 80304af..41da09f 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 9 : 10 @ 9 - -+ +> DELETE 5 @ 5 : 7 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiomeEdge.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiomeEdge.edit.java index 8477115..831f1a2 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiomeEdge.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiomeEdge.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 3 @ 3 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerDeepOcean.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerDeepOcean.edit.java index 8477115..831f1a2 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerDeepOcean.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerDeepOcean.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 3 @ 3 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerEdge.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerEdge.edit.java index 60f453f..0c65978 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerEdge.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerEdge.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ +> DELETE 2 @ 2 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.edit.java index 60f453f..0c65978 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ +> DELETE 2 @ 2 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerHills.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerHills.edit.java index 91542f8..4651b11 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerHills.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerHills.edit.java @@ -5,13 +5,9 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 5 : 7 @ 5 : 7 +> CHANGE 3 : 5 @ 3 : 7 ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> INSERT 2 : 3 @ 2 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerIsland.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerIsland.edit.java index 60f453f..0c65978 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerIsland.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerIsland.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ +> DELETE 2 @ 2 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRareBiome.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRareBiome.edit.java index 8477115..831f1a2 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRareBiome.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRareBiome.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 3 @ 3 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.edit.java index 60f453f..0c65978 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ +> DELETE 2 @ 2 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRiver.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRiver.edit.java index 8477115..831f1a2 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRiver.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRiver.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 3 @ 3 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRiverInit.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRiverInit.edit.java index 60f453f..0c65978 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRiverInit.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRiverInit.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ +> DELETE 2 @ 2 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRiverMix.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRiverMix.edit.java index 8477115..831f1a2 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRiverMix.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerRiverMix.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 7 : 8 @ 7 - -+ +> DELETE 3 @ 3 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerShore.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerShore.edit.java index 80304af..41da09f 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerShore.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerShore.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 9 : 10 @ 9 - -+ +> DELETE 5 @ 5 : 7 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerSmooth.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerSmooth.edit.java index 60f453f..0c65978 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerSmooth.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerSmooth.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ +> DELETE 2 @ 2 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.edit.java index 60f453f..0c65978 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ +> DELETE 2 @ 2 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerZoom.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerZoom.edit.java index 60f453f..0c65978 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerZoom.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerZoom.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ +> DELETE 2 @ 2 : 5 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/layer/IntCache.edit.java b/patches/minecraft/net/minecraft/world/gen/layer/IntCache.edit.java index 60f453f..7572609 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/IntCache.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/layer/IntCache.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.edit.java index 005c3f1..3e90e08 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 23 : 24 @ 23 +> DELETE 18 @ 18 : 21 -+ - -> CHANGE 23 : 24 @ 23 : 24 +> CHANGE 25 : 26 @ 25 : 26 ~ public DesertPyramid(EaglercraftRandom parRandom, int parInt1, int parInt2) { @@ -22,7 +20,13 @@ ~ public boolean addComponentParts(World world, EaglercraftRandom random, ~ StructureBoundingBox structureboundingbox) { -> CHANGE 377 : 378 @ 377 : 378 +> CHANGE 352 : 355 @ 352 : 353 + +~ EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; +~ for (int m = 0; m < facings.length; ++m) { +~ EnumFacing enumfacing = facings[m]; + +> CHANGE 24 : 25 @ 24 : 25 ~ protected Feature(EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, int parInt4, int parInt5, diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenMineshaft.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/MapGenMineshaft.edit.java index 61e0fa2..3e397c6 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenMineshaft.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenMineshaft.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 10 : 11 @ 10 - -+ +> DELETE 5 @ 5 : 8 > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenNetherBridge.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/MapGenNetherBridge.edit.java index bc172cf..3d6c1e4 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenNetherBridge.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenNetherBridge.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 12 : 13 @ 12 +> DELETE 6 @ 6 : 10 -+ - -> CHANGE 34 : 35 @ 34 : 35 +> CHANGE 36 : 37 @ 36 : 37 ~ public Start(World worldIn, EaglercraftRandom parRandom, int parInt1, int parInt2) { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenScatteredFeature.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/MapGenScatteredFeature.edit.java index 5912aa4..c01d22c 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenScatteredFeature.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenScatteredFeature.edit.java @@ -9,15 +9,18 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 12 : 13 @ 12 +> DELETE 6 @ 6 : 10 -+ - -> CHANGE 43 : 44 @ 43 : 44 +> CHANGE 45 : 46 @ 45 : 46 ~ EaglercraftRandom random = this.worldObj.setRandomSeed(i1, j1, 14357617); -> CHANGE 44 : 45 @ 44 : 45 +> CHANGE 11 : 13 @ 11 : 13 + +~ for (int m = 0, n = biomelist.size(); m < n; ++m) { +~ if (biomegenbase == biomelist.get(m)) { + +> CHANGE 31 : 32 @ 31 : 32 ~ public Start(World worldIn, EaglercraftRandom parRandom, int parInt1, int parInt2) { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.edit.java index ffa6754..94c4878 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.edit.java @@ -9,15 +9,29 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 12 : 13 @ 12 +> DELETE 6 @ 6 : 10 -+ +> CHANGE 14 : 17 @ 14 : 15 -> CHANGE 44 : 45 @ 44 : 45 +~ BiomeGenBase[] biomes = BiomeGenBase.getBiomeGenArray(); +~ for (int i = 0; i < biomes.length; ++i) { +~ BiomeGenBase biomegenbase = biomes[i]; + +> CHANGE 31 : 32 @ 31 : 32 ~ EaglercraftRandom random = new EaglercraftRandom(); -> CHANGE 64 : 65 @ 64 : 65 +> CHANGE 26 : 28 @ 26 : 27 + +~ for (int l = 0; l < this.structureCoords.length; ++l) { +~ ChunkCoordIntPair chunkcoordintpair = this.structureCoords[l]; + +> CHANGE 11 : 13 @ 11 : 12 + +~ for (int l = 0; l < this.structureCoords.length; ++l) { +~ ChunkCoordIntPair chunkcoordintpair = this.structureCoords[l]; + +> CHANGE 25 : 26 @ 25 : 26 ~ public Start(World worldIn, EaglercraftRandom parRandom, int parInt1, int parInt2) { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.edit.java index 4fb4bcc..22b85de 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.edit.java @@ -15,15 +15,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.HString; ~ -> INSERT 5 : 6 @ 5 +> DELETE 11 @ 11 : 16 -+ import net.minecraft.util.AxisAlignedBB; - -> INSERT 13 : 14 @ 13 - -+ - -> CHANGE 28 : 29 @ 28 : 29 +> CHANGE 30 : 31 @ 30 : 31 ~ HString.format("%d,%d", new Object[] { Integer.valueOf(i), Integer.valueOf(j) })); @@ -31,8 +25,13 @@ ~ public boolean generateStructure(World worldIn, EaglercraftRandom randomIn, ChunkCoordIntPair chunkCoord) { -> CHANGE 90 : 91 @ 90 : 91 +> CHANGE 86 : 87 @ 86 : 87 -~ for (BlockPos blockpos3 : (List) list) { +~ List list = this.getCoordList(); + +> CHANGE 3 : 5 @ 3 : 4 + +~ for (int m = 0, n = list.size(); m < n; ++m) { +~ BlockPos blockpos3 = list.get(m); > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructureData.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructureData.edit.java index 60f453f..7572609 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructureData.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructureData.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 6 : 7 @ 6 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructureIO.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructureIO.edit.java index 40c4fbb..471b447 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructureIO.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructureIO.edit.java @@ -5,16 +5,12 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 20 : 22 @ 20 : 22 +> CHANGE 6 : 8 @ 6 : 22 ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> INSERT 2 : 3 @ 2 - -+ - -> CHANGE 34 : 35 @ 34 : 35 +> CHANGE 36 : 37 @ 36 : 37 ~ logger.warn(exception); diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenVillage.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/MapGenVillage.edit.java index bbab3a9..24eb3b5 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenVillage.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenVillage.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 11 : 12 @ 11 +> DELETE 5 @ 5 : 9 -+ - -> CHANGE 42 : 43 @ 42 : 43 +> CHANGE 44 : 45 @ 44 : 45 ~ EaglercraftRandom random = this.worldObj.setRandomSeed(i1, j1, 10387312); diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureBoundingBox.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/StructureBoundingBox.edit.java index 80304af..7572609 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureBoundingBox.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureBoundingBox.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 9 : 10 @ 9 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.edit.java index 9266008..bc80a75 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 19 : 20 @ 19 +> DELETE 15 @ 15 : 17 -+ - -> CHANGE 36 : 37 @ 36 : 37 +> CHANGE 38 : 39 @ 38 : 39 ~ public void buildComponent(StructureComponent var1, List var2, EaglercraftRandom var3) { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.edit.java index 39b4975..877b1c4 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 20 : 21 @ 20 +> DELETE 15 @ 15 : 18 -+ - -> CHANGE 22 : 24 @ 22 : 24 +> CHANGE 24 : 26 @ 24 : 26 ~ private static StructureComponent func_175892_a(List listIn, EaglercraftRandom rand, int x, ~ int y, int z, EnumFacing facing, int type) { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftStart.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftStart.edit.java index 6fb5c21..d31607e 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftStart.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftStart.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 5 : 6 @ 5 +> DELETE 1 @ 1 : 3 -+ - -> CHANGE 3 : 4 @ 3 : 4 +> CHANGE 5 : 6 @ 5 : 6 ~ public StructureMineshaftStart(World worldIn, EaglercraftRandom rand, int chunkX, int chunkZ) { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.edit.java index 4b551b6..80fd343 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 15 : 16 @ 15 +> DELETE 10 @ 10 : 13 -+ - -> CHANGE 35 : 37 @ 35 : 37 +> CHANGE 37 : 39 @ 37 : 39 ~ StructureNetherBridgePieces.PieceWeight parPieceWeight, List parList, ~ EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, int parInt4) { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureOceanMonument.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/StructureOceanMonument.edit.java index a5439c3..d4f37bc 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureOceanMonument.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureOceanMonument.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 17 : 18 @ 17 +> DELETE 11 @ 11 : 15 -+ - -> CHANGE 43 : 44 @ 43 : 44 +> CHANGE 45 : 46 @ 45 : 46 ~ EaglercraftRandom random = this.worldObj.setRandomSeed(i1, j1, 10387313); diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.edit.java index 118ef2c..7b66cb2 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.edit.java @@ -5,17 +5,17 @@ # Version: 1.0 # Author: lax1dude -> CHANGE 7 : 10 @ 7 : 8 +> DELETE 4 @ 4 : 5 + +> CHANGE 2 : 5 @ 2 : 3 ~ ~ import net.lax1dude.eaglercraft.v1_8.ArrayUtils; ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 15 : 16 @ 15 +> DELETE 10 @ 10 : 13 -+ - -> CHANGE 19 : 20 @ 19 : 20 +> CHANGE 21 : 22 @ 21 : 22 ~ EaglercraftRandom parRandom) { @@ -85,7 +85,11 @@ ~ private List func_175836_a(EaglercraftRandom parRandom) { -> CHANGE 99 : 100 @ 99 : 100 +> CHANGE 36 : 37 @ 36 : 37 + +~ for (EnumFacing enumfacing : EnumFacing._VALUES) { + +> CHANGE 62 : 63 @ 62 : 63 ~ ArrayUtils.eaglerShuffle(arraylist, parRandom); diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.edit.java index b719f97..9a58add 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 9 : 10 @ 9 +> DELETE 4 @ 4 : 7 -+ - -> CHANGE 21 : 22 @ 21 : 22 +> CHANGE 23 : 24 @ 23 : 24 ~ public void generateStructure(World world, EaglercraftRandom random, StructureBoundingBox structureboundingbox) { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.edit.java index bfdb2d8..c851211 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 18 : 19 @ 18 +> DELETE 13 @ 13 : 16 -+ - -> CHANGE 69 : 70 @ 69 : 70 +> CHANGE 71 : 72 @ 71 : 72 ~ EaglercraftRandom parRandom, int parInt1, int parInt2, int parInt3, EnumFacing parEnumFacing, int parInt4) { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.edit.java b/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.edit.java index 3a2bc8c..05a1fb0 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.edit.java +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.edit.java @@ -9,11 +9,9 @@ ~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -> INSERT 26 : 27 @ 26 +> DELETE 20 @ 20 : 24 -+ - -> CHANGE 16 : 18 @ 16 : 18 +> CHANGE 18 : 20 @ 18 : 20 ~ public static List getStructureVillageWeightedPieceList( ~ EaglercraftRandom random, int parInt1) { diff --git a/patches/minecraft/net/minecraft/world/pathfinder/NodeProcessor.edit.java b/patches/minecraft/net/minecraft/world/pathfinder/NodeProcessor.edit.java index 80304af..7572609 100644 --- a/patches/minecraft/net/minecraft/world/pathfinder/NodeProcessor.edit.java +++ b/patches/minecraft/net/minecraft/world/pathfinder/NodeProcessor.edit.java @@ -5,8 +5,4 @@ # Version: 1.0 # Author: lax1dude -> INSERT 9 : 10 @ 9 - -+ - > EOF diff --git a/patches/minecraft/net/minecraft/world/pathfinder/SwimNodeProcessor.edit.java b/patches/minecraft/net/minecraft/world/pathfinder/SwimNodeProcessor.edit.java index 0c12581..eb6185a 100644 --- a/patches/minecraft/net/minecraft/world/pathfinder/SwimNodeProcessor.edit.java +++ b/patches/minecraft/net/minecraft/world/pathfinder/SwimNodeProcessor.edit.java @@ -5,8 +5,12 @@ # Version: 1.0 # Author: lax1dude -> INSERT 13 : 14 @ 13 +> DELETE 10 @ 10 : 11 -+ +> CHANGE 25 : 28 @ 25 : 26 + +~ EnumFacing[] facings = EnumFacing._VALUES; +~ for (int j = 0; j < facings.length; ++j) { +~ EnumFacing enumfacing = facings[j]; > EOF diff --git a/patches/minecraft/net/minecraft/world/pathfinder/WalkNodeProcessor.edit.java b/patches/minecraft/net/minecraft/world/pathfinder/WalkNodeProcessor.edit.java index e8768a1..ffbb9b2 100644 --- a/patches/minecraft/net/minecraft/world/pathfinder/WalkNodeProcessor.edit.java +++ b/patches/minecraft/net/minecraft/world/pathfinder/WalkNodeProcessor.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 18 : 19 @ 18 - -+ +> DELETE 15 @ 15 : 16 > EOF diff --git a/patches/minecraft/net/minecraft/world/storage/DerivedWorldInfo.edit.java b/patches/minecraft/net/minecraft/world/storage/DerivedWorldInfo.edit.java index e395576..d9711e3 100644 --- a/patches/minecraft/net/minecraft/world/storage/DerivedWorldInfo.edit.java +++ b/patches/minecraft/net/minecraft/world/storage/DerivedWorldInfo.edit.java @@ -5,8 +5,6 @@ # Version: 1.0 # Author: lax1dude -> INSERT 11 : 12 @ 11 - -+ +> DELETE 8 @ 8 : 9 > EOF diff --git a/patches/minecraft/net/minecraft/world/storage/ISaveFormat.edit.java b/patches/minecraft/net/minecraft/world/storage/ISaveFormat.edit.java index 43d17d0..d3f078b 100644 --- a/patches/minecraft/net/minecraft/world/storage/ISaveFormat.edit.java +++ b/patches/minecraft/net/minecraft/world/storage/ISaveFormat.edit.java @@ -7,7 +7,9 @@ > DELETE 3 @ 3 : 4 -> CHANGE 10 : 11 @ 10 : 11 +> DELETE 1 @ 1 : 4 + +> CHANGE 6 : 7 @ 6 : 7 ~ List getSaveList(); diff --git a/patches/minecraft/net/minecraft/world/storage/ISaveHandler.edit.java b/patches/minecraft/net/minecraft/world/storage/ISaveHandler.edit.java index 5d24928..a592e56 100644 --- a/patches/minecraft/net/minecraft/world/storage/ISaveHandler.edit.java +++ b/patches/minecraft/net/minecraft/world/storage/ISaveHandler.edit.java @@ -11,7 +11,9 @@ + import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; -> CHANGE 21 : 22 @ 21 : 22 +> DELETE 3 @ 3 : 5 + +> CHANGE 16 : 17 @ 16 : 17 ~ VFile2 getWorldDirectory(); diff --git a/patches/minecraft/net/minecraft/world/storage/MapData.edit.java b/patches/minecraft/net/minecraft/world/storage/MapData.edit.java index 80b7eeb..7cdf874 100644 --- a/patches/minecraft/net/minecraft/world/storage/MapData.edit.java +++ b/patches/minecraft/net/minecraft/world/storage/MapData.edit.java @@ -14,4 +14,9 @@ + import com.google.common.collect.Maps; + +> CHANGE 179 : 181 @ 179 : 181 + +~ for (int i = 0, l = this.playersArrayList.size(); i < l; ++i) { +~ this.playersArrayList.get(i).update(x, y); + > EOF diff --git a/patches/minecraft/net/minecraft/world/storage/MapStorage.edit.java b/patches/minecraft/net/minecraft/world/storage/MapStorage.edit.java index 7a6b31b..9463927 100644 --- a/patches/minecraft/net/minecraft/world/storage/MapStorage.edit.java +++ b/patches/minecraft/net/minecraft/world/storage/MapStorage.edit.java @@ -31,10 +31,10 @@ + public static final Map, MapStorageProvider> storageProviders = new HashMap(); + + static { -+ storageProviders.put(MapData.class, (s) -> new MapData(s)); -+ storageProviders.put(MapGenStructureData.class, (s) -> new MapGenStructureData(s)); -+ storageProviders.put(ScoreboardSaveData.class, (s) -> new ScoreboardSaveData(s)); -+ storageProviders.put(VillageCollection.class, (s) -> new VillageCollection(s)); ++ storageProviders.put(MapData.class, MapData::new); ++ storageProviders.put(MapGenStructureData.class, MapGenStructureData::new); ++ storageProviders.put(ScoreboardSaveData.class, ScoreboardSaveData::new); ++ storageProviders.put(VillageCollection.class, VillageCollection::new); + } + diff --git a/patches/minecraft/net/minecraft/world/storage/SaveFormatOld.edit.java b/patches/minecraft/net/minecraft/world/storage/SaveFormatOld.edit.java index b225615..20217c7 100644 --- a/patches/minecraft/net/minecraft/world/storage/SaveFormatOld.edit.java +++ b/patches/minecraft/net/minecraft/world/storage/SaveFormatOld.edit.java @@ -17,17 +17,13 @@ + import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerIntegratedServerWorker; -> CHANGE 6 : 9 @ 6 : 8 +> CHANGE 1 : 4 @ 1 : 8 ~ import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> INSERT 2 : 3 @ 2 - -+ - -> CHANGE 1 : 2 @ 1 : 2 +> CHANGE 3 : 4 @ 3 : 4 ~ protected final VFile2 savesDirectory; diff --git a/patches/minecraft/net/minecraft/world/storage/SaveHandler.edit.java b/patches/minecraft/net/minecraft/world/storage/SaveHandler.edit.java index f284e62..9f2e41f 100644 --- a/patches/minecraft/net/minecraft/world/storage/SaveHandler.edit.java +++ b/patches/minecraft/net/minecraft/world/storage/SaveHandler.edit.java @@ -5,27 +5,20 @@ # Version: 1.0 # Author: lax1dude -> DELETE 4 @ 4 : 7 +> CHANGE 2 : 6 @ 2 : 8 -> INSERT 1 : 5 @ 1 +~ import java.io.InputStream; +~ import java.io.OutputStream; +~ import java.util.List; +~ -+ import java.io.InputStream; -+ import java.io.OutputStream; -+ import java.util.List; -+ +> CHANGE 7 : 10 @ 7 : 12 -> CHANGE 10 : 14 @ 10 : 12 - -~ import net.lax1dude.eaglercraft.v1_8.EagRuntime; ~ import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; ~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; ~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -> INSERT 2 : 3 @ 2 - -+ - -> CHANGE 1 : 4 @ 1 : 4 +> CHANGE 3 : 6 @ 3 : 6 ~ private final VFile2 worldDirectory; ~ private final VFile2 playersDirectory; diff --git a/patches/resources/assets/minecraft/lang/en_US.edit.lang b/patches/resources/assets/minecraft/lang/en_US.edit.lang index 1d05c16..24aa5e3 100644 --- a/patches/resources/assets/minecraft/lang/en_US.edit.lang +++ b/patches/resources/assets/minecraft/lang/en_US.edit.lang @@ -12,7 +12,7 @@ ~ eaglercraft.recording.start=Record Screen... ~ eaglercraft.soundCategory.voice=Voice -> INSERT 1 : 195 @ 1 +> INSERT 1 : 230 @ 1 + eaglercraft.resourcePack.prompt.title=What do you want to do with '%s'? + eaglercraft.resourcePack.prompt.text=Tip: Hold Shift to skip this screen when selecting a resource pack! @@ -38,6 +38,41 @@ + eaglercraft.editProfile.addSkin=Add Skin + eaglercraft.editProfile.clearSkin=Clear List + ++ eaglercraft.editProfile.importExport=Import/Export ++ ++ eaglercraft.settingsBackup.importExport.title=What do you wanna do? ++ eaglercraft.settingsBackup.importExport.import=Import Profile and Settings... ++ eaglercraft.settingsBackup.importExport.export=Export Profile and Settings... ++ ++ eaglercraft.settingsBackup.import.title=Import Profile and Settings ++ eaglercraft.settingsBackup.import.option.profile=Import Profile: ++ eaglercraft.settingsBackup.import.option.settings=Import Settings: ++ eaglercraft.settingsBackup.import.option.servers=Import Servers: ++ eaglercraft.settingsBackup.import.option.resourcePacks=Resource Packs: ++ eaglercraft.settingsBackup.import.option.import=Import ++ ++ eaglercraft.settingsBackup.export.title=Export Profile and Settings ++ eaglercraft.settingsBackup.export.option.profile=Export Profile: ++ eaglercraft.settingsBackup.export.option.settings=Export Settings: ++ eaglercraft.settingsBackup.export.option.servers=Export Servers: ++ eaglercraft.settingsBackup.export.option.resourcePacks=Resource Packs: ++ eaglercraft.settingsBackup.export.option.export=Export ++ ++ eaglercraft.settingsBackup.exporting.1=Exporting Profile... ++ eaglercraft.settingsBackup.exporting.2=Please Wait. ++ ++ eaglercraft.settingsBackup.exporting.failed.1=Export Failed! ++ eaglercraft.settingsBackup.exporting.failed.2=Could not compile EPK ++ ++ eaglercraft.settingsBackup.importing.1=Importing Profile... ++ eaglercraft.settingsBackup.importing.2=Please Wait. ++ ++ eaglercraft.settingsBackup.importing.failed.1=Import Failed! ++ eaglercraft.settingsBackup.importing.failed.2=Could not load EPK ++ ++ eaglercraft.resourcePack.importFailed.1=Import Failed! ++ eaglercraft.resourcePack.importFailed.2=Could not import ZIP file ++ + eaglercraft.singleplayer.integratedStartup=Starting integrated server + + eaglercraft.addServer.SSLWarn1=you are on an https: page! diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java index d7602a5..ceda34c 100644 --- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java +++ b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformApplication.java @@ -21,6 +21,7 @@ import javax.swing.JOptionPane; import javax.swing.filechooser.FileFilter; import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.MainMenuCreditsDialog; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; @@ -204,8 +205,15 @@ public class PlatformApplication { fileChooserResultObject = null; } + private static MainMenuCreditsDialog creditsDialog = null; + public static void openCreditsPopup(String text) { - + if(creditsDialog == null) { + creditsDialog = new MainMenuCreditsDialog(); + } + creditsDialog.setCreditsText(text); + creditsDialog.setLocationRelativeTo(null); + creditsDialog.setVisible(true); } private static final File downloadsDirectory = new File("downloads"); @@ -239,6 +247,11 @@ public class PlatformApplication { } downloadsLogger.info("Saved {} byte file to: {}", fileContents.length, f.getAbsolutePath()); + + try { + Desktop.getDesktop().open(downloadsDirectory); + }catch(Throwable t) { + } } public static void addLogMessage(String logMessage, boolean isError) { diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java index 164bc04..7c74b70 100644 --- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java +++ b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformAudio.java @@ -2,7 +2,6 @@ package net.lax1dude.eaglercraft.v1_8.internal; import java.net.URL; -import net.lax1dude.eaglercraft.v1_8.internal.PlatformAudio.IAudioCacheLoader; import net.lax1dude.eaglercraft.v1_8.internal.paulscode.lwjgl3.LibraryLWJGLOpenAL; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformFilesystem.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformFilesystem.java index 1f2a25f..02ad4e4 100644 --- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformFilesystem.java +++ b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformFilesystem.java @@ -6,12 +6,10 @@ import java.io.FileOutputStream; import java.io.IOException; import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; -import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.LWJGLEntryPoint; import net.lax1dude.eaglercraft.v1_8.internal.vfs2.EaglerFileSystemException; import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFSIterator2.BreakLoop; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.DesktopIntegratedServer; /** * Copyright (c) 2022-2024 lax1dude. All Rights Reserved. @@ -35,20 +33,12 @@ public class PlatformFilesystem { public static final File filesystemRoot = (new File("filesystem/sp")).getAbsoluteFile(); public static void initialize() { - assertThread(); if(!filesystemRoot.isDirectory() && !filesystemRoot.mkdirs()) { throw new EaglerFileSystemException("Could not create directory for virtual filesystem: " + filesystemRoot.getAbsolutePath()); } } - private static void assertThread() { - if(Thread.currentThread() != DesktopIntegratedServer.serverThread) { - throw new UnsupportedOperationException("[DEBUG CHECK] VFS2 is currently only initialized for server contexts!"); - } - } - public static boolean eaglerDelete(String pathName) { - assertThread(); File f = getJREFile(pathName); if(!f.exists()) { logger.warn("Tried to delete file that doesn't exist: \"{}\"", pathName); @@ -62,7 +52,6 @@ public class PlatformFilesystem { } public static ByteBuffer eaglerRead(String pathName) { - assertThread(); File f = getJREFile(pathName); if(f.isFile()) { long fileSize = f.length(); @@ -96,7 +85,6 @@ public class PlatformFilesystem { } public static void eaglerWrite(String pathName, ByteBuffer data) { - assertThread(); File f = getJREFile(pathName); File p = f.getParentFile(); if(!p.isDirectory()) { @@ -105,7 +93,7 @@ public class PlatformFilesystem { } } try(FileOutputStream fos = new FileOutputStream(f)) { - byte[] copyBuffer = new byte[4096]; + byte[] copyBuffer = new byte[Math.min(4096, data.remaining())]; int i; while((i = data.remaining()) > 0) { if(i > copyBuffer.length) { @@ -120,12 +108,10 @@ public class PlatformFilesystem { } public static boolean eaglerExists(String pathName) { - assertThread(); return getJREFile(pathName).isFile(); } public static boolean eaglerMove(String pathNameOld, String pathNameNew) { - assertThread(); File f1 = getJREFile(pathNameOld); File f2 = getJREFile(pathNameNew); if(f2.exists()) { @@ -142,7 +128,6 @@ public class PlatformFilesystem { } public static int eaglerCopy(String pathNameOld, String pathNameNew) { - assertThread(); File f1 = getJREFile(pathNameOld); File f2 = getJREFile(pathNameNew); if(!f1.isFile()) { @@ -174,7 +159,6 @@ public class PlatformFilesystem { } public static int eaglerSize(String pathName) { - assertThread(); File f = getJREFile(pathName); if(f.isFile()) { long fileSize = f.length(); @@ -186,7 +170,6 @@ public class PlatformFilesystem { } public static void eaglerIterate(String pathName, VFSFilenameIterator itr, boolean recursive) { - assertThread(); try { iterateFile(pathName, getJREFile(pathName), itr, recursive); }catch(BreakLoop ex) { diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java index 198ce76..788f4b5 100644 --- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java +++ b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformInput.java @@ -6,6 +6,7 @@ import java.util.LinkedList; import java.util.List; import org.lwjgl.PointerBuffer; +import org.lwjgl.glfw.GLFWVidMode; import org.lwjgl.system.MemoryStack; /** @@ -129,6 +130,9 @@ public class PlatformInput { }); glfwSetKeyCallback(glfwWindow, (window, key, scancode, action, mods) -> { + if (key == GLFW_KEY_F11 && action == GLFW_PRESS) { + toggleFullscreen(); + } if(glfwGetKey(glfwWindow, functionKeyModifier) == GLFW_PRESS) { if(key >= GLFW_KEY_1 && key <= GLFW_KEY_9) { key = key - GLFW_KEY_1 + GLFW_KEY_F1; @@ -381,12 +385,64 @@ public class PlatformInput { functionKeyModifier = KeyboardConstants.getGLFWKeyFromEagler(key); } + private static boolean fullscreen = false; + private static int[] lastPos = new int[4]; + public static void toggleFullscreen() { - // + long win = PlatformRuntime.getWindowHandle(); + long mon = getCurrentMonitor(win); + GLFWVidMode mode = glfwGetVideoMode(mon); + if (fullscreen) { + glfwSetWindowMonitor(win, 0, lastPos[0], lastPos[1], lastPos[2], lastPos[3], mode.refreshRate()); + } else { + int[] x = new int[1], y = new int[1]; + glfwGetWindowPos(win, x, y); + lastPos[0] = x[0]; + lastPos[1] = y[0]; + glfwGetWindowSize(win, x, y); + lastPos[2] = x[0]; + lastPos[3] = y[0]; + glfwSetWindowMonitor(win, mon, 0, 0, mode.width(), mode.height(), mode.refreshRate()); + } + fullscreen = !fullscreen; + } + + // https://stackoverflow.com/a/31526753 + private static long getCurrentMonitor(long window) { + int nmonitors, i; + int[] wx = new int[1], wy = new int[1], ww = new int[1], wh = new int[1]; + int[] mx = new int[1], my = new int[1], mw = new int[1], mh = new int[1]; + int overlap, bestoverlap = 0; + long bestmonitor = 0; + PointerBuffer monitors; + GLFWVidMode mode; + + glfwGetWindowPos(window, wx, wy); + glfwGetWindowSize(window, ww, wh); + monitors = glfwGetMonitors(); + nmonitors = monitors.remaining(); + + for (i = 0; i < nmonitors; ++i) { + mode = glfwGetVideoMode(monitors.get(i)); + glfwGetMonitorPos(monitors.get(i), mx, my); + mw[0] = mode.width(); + mh[0] = mode.height(); + + overlap = + Math.max(0, Math.min(wx[0] + ww[0], mx[0] + mw[0]) - Math.max(wx[0], mx[0])) * + Math.max(0, Math.min(wy[0] + wh[0], my[0] + mh[0]) - Math.max(wy[0], my[0])); + + if (bestoverlap < overlap) { + bestoverlap = overlap; + bestmonitor = monitors.get(i); + } + } + + return bestmonitor; } public static boolean isFullscreen() { - return false; + return fullscreen; } public static void showCursor(EnumCursorType cursor) { diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java index 4173776..702e60a 100644 --- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java +++ b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformRuntime.java @@ -10,6 +10,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.URL; import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; import java.util.Date; @@ -36,12 +37,14 @@ import org.lwjgl.system.MemoryUtil; import org.lwjgl.system.jemalloc.JEmalloc; import net.lax1dude.eaglercraft.v1_8.internal.buffer.EaglerLWJGLAllocator; +import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream; import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer; import net.lax1dude.eaglercraft.v1_8.internal.buffer.IntBuffer; import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.DesktopClientConfigAdapter; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack; /** * Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved. @@ -71,6 +74,8 @@ public class PlatformRuntime { public static void create() { logger.info("Starting Desktop Runtime..."); + PlatformFilesystem.initialize(); + EaglerFolderResourcePack.setSupported(true); if(requestedANGLEPlatform != EnumPlatformANGLE.DEFAULT) { logger.info("Setting ANGLE Platform: {}", requestedANGLEPlatform.name); @@ -295,7 +300,31 @@ public class PlatformRuntime { public static FloatBuffer allocateFloatBuffer(int length) { return EaglerLWJGLAllocator.allocFloatBuffer(length); } - + + public static ByteBuffer castPrimitiveByteArray(byte[] array) { + return null; + } + + public static IntBuffer castPrimitiveIntArray(int[] array) { + return null; + } + + public static FloatBuffer castPrimitiveFloatArray(float[] array) { + return null; + } + + public static byte[] castNativeByteBuffer(ByteBuffer buffer) { + return null; + } + + public static int[] castNativeIntBuffer(IntBuffer buffer) { + return null; + } + + public static float[] castNativeFloatBuffer(FloatBuffer buffer) { + return null; + } + public static void freeByteBuffer(ByteBuffer byteBuffer) { EaglerLWJGLAllocator.freeByteBuffer(byteBuffer); } @@ -429,6 +458,22 @@ public class PlatformRuntime { return new GZIPInputStream(is); } + public static void downloadRemoteURIByteArray(String assetPackageURI, final Consumer cb) { + logger.info("Downloading: {}"); + try(InputStream is = (new URL(assetPackageURI)).openStream()) { + EaglerOutputStream bao = new EaglerOutputStream(); + byte[] copyBuffer = new byte[16384]; + int i; + while((i = is.read(copyBuffer, 0, copyBuffer.length)) != -1) { + bao.write(copyBuffer, 0, i); + } + cb.accept(bao.toByteArray()); + }catch(IOException ex) { + logger.error("Failed to download file!"); + logger.error(ex); + } + } + public static boolean requireSSL() { return false; } @@ -468,4 +513,8 @@ public class PlatformRuntime { public static String currentThreadName() { return Thread.currentThread().getName(); } + + public static long getWindowHandle() { + return windowHandle; + } } diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java index 3b43ae0..9b7eef7 100644 --- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java +++ b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/PlatformWebRTC.java @@ -1,18 +1,41 @@ package net.lax1dude.eaglercraft.v1_8.internal; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - +import dev.onvoid.webrtc.*; +import dev.onvoid.webrtc.internal.NativeLoader; +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.sp.lan.LANPeerEvent; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayQuery; import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServerSocket; import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayWorldsQuery; +import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.*; +import net.lax1dude.eaglercraft.v1_8.update.UpdateService; + +import org.apache.commons.lang3.SystemUtils; +import org.java_websocket.client.WebSocketClient; +import org.java_websocket.handshake.ServerHandshake; +import org.json.JSONArray; +import org.json.JSONObject; +import org.json.JSONWriter; + +import com.google.common.collect.LinkedListMultimap; +import com.google.common.collect.ListMultimap; + +import java.io.DataInputStream; +import java.io.IOException; +import java.lang.reflect.Field; +import java.net.URI; +import java.nio.ByteBuffer; +import java.nio.file.Paths; +import java.util.*; /** - * Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. - * + * Copyright (c) 2022-2024 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. @@ -23,123 +46,1556 @@ import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayWorldsQuery; * 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 PlatformWebRTC { + private static final Logger logger = LogManager.getLogger("PlatformWebRTC"); + + private static final Object lock1 = new Object(); + private static final Object lock2 = new Object(); + private static final Object lock3 = new Object(); + private static final Object lock4 = new Object(); + + public static PeerConnectionFactory pcFactory; + + private static boolean supported = true; + public static boolean supported() { - return false; + if (supported && pcFactory == null) { + try { + System.load(Paths.get(SystemUtils.IS_OS_WINDOWS ? "webrtc-java.dll" : "libwebrtc-java.so").toAbsolutePath().toString()); + Field f = NativeLoader.class.getDeclaredField("LOADED_LIB_SET"); + f.setAccessible(true); + ((Set) f.get(null)).add("webrtc-java"); + pcFactory = new PeerConnectionFactory(); + Runtime.getRuntime().addShutdownHook(new Thread(() -> pcFactory.dispose())); + supported = true; + } catch (Exception e) { + EagRuntime.debugPrintStackTrace(e); + supported = false; + } + } + return supported; } - public static RelayServerSocket openRelayConnection(String addr, int timeout) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + private static final Map fuckTeaVM = new HashMap<>(); + + public static class LANClient { + public static final byte READYSTATE_INIT_FAILED = -2; + public static final byte READYSTATE_FAILED = -1; + public static final byte READYSTATE_DISCONNECTED = 0; + public static final byte READYSTATE_CONNECTING = 1; + public static final byte READYSTATE_CONNECTED = 2; + + public Set> iceServers = new HashSet<>(); + public RTCPeerConnection peerConnection = null; + public RTCDataChannel dataChannel = null; + + public byte readyState = READYSTATE_CONNECTING; + + private final List> iceCandidates = new ArrayList<>(); + + public void initialize() { + try { + if (dataChannel != null) { + dataChannel.close(); + dataChannel = null; + } + synchronized (lock1) { + if (peerConnection != null) { + peerConnection.close(); + peerConnection = null; + } + } + RTCConfiguration rtcConfig = new RTCConfiguration(); + for (Map server : iceServers) { + RTCIceServer iceServer = new RTCIceServer(); + iceServer.urls.add(server.get("urls")); + iceServer.username = server.getOrDefault("username", null); + iceServer.password = server.getOrDefault("credential", null); + rtcConfig.iceServers.add(iceServer); + } + synchronized (lock1) { + this.peerConnection = pcFactory.createPeerConnection(rtcConfig, new PeerConnectionObserver() { + @Override + public void onIceCandidate(RTCIceCandidate iceCandidate) { + synchronized (lock1) { + if (iceCandidate.sdp != null && !iceCandidate.sdp.isEmpty()) { + if (iceCandidates.isEmpty()) { + new Thread(() -> { + EagUtils.sleep(3000); + synchronized (lock1) { + if (peerConnection != null && peerConnection.getConnectionState() != RTCPeerConnectionState.DISCONNECTED) { + clientICECandidate = JSONWriter.valueToString(iceCandidates); + iceCandidates.clear(); + } + } + }).start(); + } + Map m = new HashMap<>(); + m.put("sdpMLineIndex", "" + iceCandidate.sdpMLineIndex); + m.put("candidate", iceCandidate.sdp); + iceCandidates.add(m); + } + } + } + + @Override + public void onConnectionChange(RTCPeerConnectionState connectionState) { + if (connectionState == RTCPeerConnectionState.DISCONNECTED) { + signalRemoteDisconnect(false); + } else if (connectionState == RTCPeerConnectionState.CONNECTED) { + readyState = READYSTATE_CONNECTED; + } else if (connectionState == RTCPeerConnectionState.FAILED) { + readyState = READYSTATE_FAILED; + signalRemoteDisconnect(false); + } + } + }); + } + this.readyState = READYSTATE_CONNECTING; + } catch (Throwable t) { + readyState = READYSTATE_INIT_FAILED; + } + } + + public void setIceServers(String[] urls) { + iceServers.clear(); + for (int i = 0; i < urls.length; ++i) { + String url = urls[i]; + String[] etr = url.split(";"); + if (etr.length == 1) { + Map m = new HashMap<>(); + m.put("urls", etr[0]); + iceServers.add(m); + } else if (etr.length == 3) { + Map m = new HashMap<>(); + m.put("urls", etr[0]); + m.put("username", etr[1]); + m.put("credential", etr[2]); + iceServers.add(m); + } + } + } + + public void sendPacketToServer(RTCDataChannelBuffer buffer) { + if (dataChannel != null && dataChannel.getState() == RTCDataChannelState.OPEN) { + try { + dataChannel.send(buffer); + } catch (Throwable e) { + signalRemoteDisconnect(false); + } + } else { + signalRemoteDisconnect(false); + } + } + + public void signalRemoteConnect() { + dataChannel = peerConnection.createDataChannel("lan", new RTCDataChannelInit()); + + dataChannel.registerObserver(new RTCDataChannelObserver() { + @Override + public void onBufferedAmountChange(long l) { + // + } + + @Override + public void onStateChange() { + if (dataChannel != null && dataChannel.getState() == RTCDataChannelState.OPEN) { + new Thread(() -> { + while (true) { + synchronized (lock1) { + if (iceCandidates.isEmpty()) { + break; + } + } + EagUtils.sleep(1); + } + synchronized (lock2) { + clientDataChannelClosed = false; + clientDataChannelOpen = true; + } + }).start(); + } + } + + @Override + public void onMessage(RTCDataChannelBuffer buffer) { + if (!buffer.binary) return; + byte[] data = new byte[buffer.data.remaining()]; + buffer.data.get(data); + synchronized (clientLANPacketBuffer) { + clientLANPacketBuffer.add(data); + } + } + }); + + peerConnection.createOffer(new RTCOfferOptions(), new CreateSessionDescriptionObserver() { + @Override + public void onSuccess(RTCSessionDescription desc) { + peerConnection.setLocalDescription(desc, new SetSessionDescriptionObserver() { + @Override + public void onSuccess() { + JSONObject descJson = new JSONObject(); + descJson.put("type", desc.sdpType.name().toLowerCase()); + descJson.put("sdp", desc.sdp); + clientDescription = descJson.toString(); + } + + @Override + public void onFailure(String s) { + logger.error("Failed to set local description! {}", s); + readyState = READYSTATE_FAILED; + signalRemoteDisconnect(false); + } + }); + } + + @Override + public void onFailure(String s) { + logger.error("Failed to set create offer! {}", s); + readyState = READYSTATE_FAILED; + signalRemoteDisconnect(false); + } + }); + } + + public void signalRemoteDescription(String json) { + try { + JSONObject jsonObject = new JSONObject(json); + peerConnection.setRemoteDescription(new RTCSessionDescription(RTCSdpType.valueOf(jsonObject.getString("type").toUpperCase()), jsonObject.getString("sdp")), new SetSessionDescriptionObserver() { + @Override + public void onSuccess() { + // + } + + @Override + public void onFailure(String s) { + logger.error(s); + readyState = READYSTATE_FAILED; + signalRemoteDisconnect(false); + } + }); + } catch (Throwable t) { + EagRuntime.debugPrintStackTrace(t); + readyState = READYSTATE_FAILED; + signalRemoteDisconnect(false); + } + } + + public void signalRemoteICECandidate(String candidates) { + try { + JSONArray jsonArray = new JSONArray(candidates); + for (int i = 0, l = jsonArray.length(); i < l; ++i) { + JSONObject candidate = jsonArray.getJSONObject(i); + peerConnection.addIceCandidate(new RTCIceCandidate(null, candidate.getInt("sdpMLineIndex"), candidate.getString("candidate"))); + } + } catch (Throwable t) { + EagRuntime.debugPrintStackTrace(t); + readyState = READYSTATE_FAILED; + signalRemoteDisconnect(false); + } + } + + public void signalRemoteDisconnect(boolean quiet) { + if (dataChannel != null) { + dataChannel.close(); + dataChannel = null; + } + synchronized (lock1) { + if (peerConnection != null) { + peerConnection.close(); + peerConnection = null; + } + } + synchronized (lock2) { + if (!quiet) clientDataChannelClosed = true; + } + readyState = READYSTATE_DISCONNECTED; + } + } + + public static final byte PEERSTATE_FAILED = 0; + public static final byte PEERSTATE_SUCCESS = 1; + public static final byte PEERSTATE_LOADING = 2; + + public static class LANPeer { + public LANServer client; + public String peerId; + public RTCPeerConnection peerConnection; + + public LANPeer(LANServer client, String peerId, RTCPeerConnection peerConnection) { + this.client = client; + this.peerId = peerId; + this.peerConnection = peerConnection; + } + + public void disconnect() { + synchronized (fuckTeaVM) { + if (fuckTeaVM.get(peerId) != null) { + fuckTeaVM.remove(peerId).close(); + } + } + peerConnection.close(); + peerConnection = null; + } + + public void setRemoteDescription(String descJSON) { + try { + JSONObject remoteDesc = new JSONObject(descJSON); + peerConnection.setRemoteDescription(new RTCSessionDescription(RTCSdpType.valueOf(remoteDesc.getString("type").toUpperCase()), remoteDesc.getString("sdp")), new SetSessionDescriptionObserver() { + @Override + public void onSuccess() { + if (remoteDesc.has("type") && "offer".equals(remoteDesc.getString("type"))) { + peerConnection.createAnswer(new RTCAnswerOptions(), new CreateSessionDescriptionObserver() { + @Override + public void onSuccess(RTCSessionDescription desc) { + peerConnection.setLocalDescription(desc, new SetSessionDescriptionObserver() { + @Override + public void onSuccess() { + JSONObject descJson = new JSONObject(); + descJson.put("type", desc.sdpType.name().toLowerCase()); + descJson.put("sdp", desc.sdp); + LANPeerEvent.LANPeerDescriptionEvent e = new LANPeerEvent.LANPeerDescriptionEvent(peerId, descJson.toString()); + synchronized (serverLANEventBuffer) { + serverLANEventBuffer.put(peerId, e); + } + if (client.peerStateDesc != PEERSTATE_SUCCESS) + client.peerStateDesc = PEERSTATE_SUCCESS; + } + + @Override + public void onFailure(String s) { + logger.error("Failed to set local description for \"{}\"! {}", peerId, s); + if (client.peerStateDesc == PEERSTATE_LOADING) + client.peerStateDesc = PEERSTATE_FAILED; + client.signalRemoteDisconnect(peerId); + } + }); + } + + @Override + public void onFailure(String s) { + logger.error("Failed to create answer for \"{}\"! {}", peerId, s); + if (client.peerStateDesc == PEERSTATE_LOADING) + client.peerStateDesc = PEERSTATE_FAILED; + client.signalRemoteDisconnect(peerId); + } + }); + } + } + + @Override + public void onFailure(String s) { + logger.error("Failed to set remote description for \"{}\"! {}", peerId, s); + if (client.peerStateDesc == PEERSTATE_LOADING) client.peerStateDesc = PEERSTATE_FAILED; + client.signalRemoteDisconnect(peerId); + } + }); + } catch (Throwable err) { + logger.error("Failed to parse remote description for \"{}\"! {}", peerId, err.getMessage()); + if (client.peerStateDesc == PEERSTATE_LOADING) client.peerStateDesc = PEERSTATE_FAILED; + client.signalRemoteDisconnect(peerId); + } + } + + public void addICECandidate(String candidates) { + try { + JSONArray jsonArray = new JSONArray(candidates); + for (int i = 0, l = jsonArray.length(); i < l; ++i) { + JSONObject candidate = jsonArray.getJSONObject(i); + peerConnection.addIceCandidate(new RTCIceCandidate(null, candidate.getInt("sdpMLineIndex"), candidate.getString("candidate"))); + } + if (client.peerStateIce != PEERSTATE_SUCCESS) client.peerStateIce = PEERSTATE_SUCCESS; + } catch (Throwable err) { + logger.error("Failed to parse ice candidate for \"{}\"! {}", peerId, err.getMessage()); + if (client.peerStateIce == PEERSTATE_LOADING) client.peerStateIce = PEERSTATE_FAILED; + client.signalRemoteDisconnect(peerId); + } + } + } + + public static class LANServer { + public Set> iceServers = new HashSet<>(); + public Map peerList = new HashMap<>(); + public byte peerState = PEERSTATE_LOADING; + public byte peerStateConnect = PEERSTATE_LOADING; + public byte peerStateInitial = PEERSTATE_LOADING; + public byte peerStateDesc = PEERSTATE_LOADING; + public byte peerStateIce = PEERSTATE_LOADING; + + public void setIceServers(String[] urls) { + iceServers.clear(); + for (int i = 0; i < urls.length; ++i) { + String[] etr = urls[i].split(";"); + if (etr.length == 1) { + Map m = new HashMap<>(); + m.put("urls", etr[0]); + iceServers.add(m); + } else if (etr.length == 3) { + Map m = new HashMap<>(); + m.put("urls", etr[0]); + m.put("username", etr[1]); + m.put("credential", etr[2]); + iceServers.add(m); + } + } + } + + public void sendPacketToRemoteClient(String peerId, RTCDataChannelBuffer buffer) { + LANPeer thePeer = this.peerList.get(peerId); + if (thePeer != null) { + boolean b = false; + synchronized (fuckTeaVM) { + if (fuckTeaVM.get(thePeer.peerId) != null && fuckTeaVM.get(thePeer.peerId).getState() == RTCDataChannelState.OPEN) { + try { + fuckTeaVM.get(thePeer.peerId).send(buffer); + } catch (Throwable e) { + b = true; + } + } else { + b = true; + } + } + if (b) { + signalRemoteDisconnect(peerId); + } + } + } + + public void resetPeerStates() { + peerState = peerStateConnect = peerStateInitial = peerStateDesc = peerStateIce = PEERSTATE_LOADING; + } + + public void signalRemoteConnect(String peerId) { + try { + List> iceCandidates = new ArrayList<>(); + RTCConfiguration rtcConfig = new RTCConfiguration(); + for (Map server : iceServers) { + RTCIceServer iceServer = new RTCIceServer(); + iceServer.urls.add(server.get("urls")); + iceServer.username = server.getOrDefault("username", null); + iceServer.password = server.getOrDefault("credential", null); + rtcConfig.iceServers.add(iceServer); + } + RTCPeerConnection[] peerConnection = new RTCPeerConnection[1]; + peerConnection[0] = pcFactory.createPeerConnection(rtcConfig, new PeerConnectionObserver() { + @Override + public void onIceCandidate(RTCIceCandidate iceCandidate) { + synchronized (lock3) { + if (iceCandidate.sdp != null && !iceCandidate.sdp.isEmpty()) { + if (iceCandidates.isEmpty()) { + new Thread(() -> { + EagUtils.sleep(3000); + synchronized (lock3) { + if (peerConnection[0] != null && peerConnection[0].getConnectionState() != RTCPeerConnectionState.DISCONNECTED) { + LANPeerEvent.LANPeerICECandidateEvent e = new LANPeerEvent.LANPeerICECandidateEvent(peerId, JSONWriter.valueToString(iceCandidates)); + synchronized (serverLANEventBuffer) { + serverLANEventBuffer.put(peerId, e); + } + iceCandidates.clear(); + } + } + }).start(); + } + Map m = new HashMap<>(); + m.put("sdpMLineIndex", "" + iceCandidate.sdpMLineIndex); + m.put("candidate", iceCandidate.sdp); + iceCandidates.add(m); + } + } + } + + @Override + public void onDataChannel(RTCDataChannel dataChannel) { + new Thread(() -> { + while (true) { + synchronized (lock3) { + if (iceCandidates.isEmpty()) { + break; + } + } + EagUtils.sleep(1); + } + if (dataChannel == null) return; + synchronized (fuckTeaVM) { + fuckTeaVM.put(peerId, dataChannel); + } + synchronized (serverLANEventBuffer) { + serverLANEventBuffer.put(peerId, new LANPeerEvent.LANPeerDataChannelEvent(peerId)); + } + dataChannel.registerObserver(new RTCDataChannelObserver() { + @Override + public void onBufferedAmountChange(long l) { + // + } + + @Override + public void onStateChange() { + // + } + + @Override + public void onMessage(RTCDataChannelBuffer buffer) { + if (!buffer.binary) return; + byte[] data = new byte[buffer.data.remaining()]; + buffer.data.get(data); + LANPeerEvent.LANPeerPacketEvent e = new LANPeerEvent.LANPeerPacketEvent(peerId, data); + synchronized (serverLANEventBuffer) { + serverLANEventBuffer.put(peerId, e); + } + } + }); + }).start(); + } + + @Override + public void onConnectionChange(RTCPeerConnectionState connectionState) { + if (connectionState == RTCPeerConnectionState.DISCONNECTED) { + LANServer.this.signalRemoteDisconnect(peerId); + } else if (connectionState == RTCPeerConnectionState.CONNECTED) { + if (LANServer.this.peerState != PEERSTATE_SUCCESS) + LANServer.this.peerState = PEERSTATE_SUCCESS; + } else if (connectionState == RTCPeerConnectionState.FAILED) { + if (LANServer.this.peerState == PEERSTATE_LOADING) + LANServer.this.peerState = PEERSTATE_FAILED; + LANServer.this.signalRemoteDisconnect(peerId); + } + } + }); + LANPeer peerInstance = new LANPeer(this, peerId, peerConnection[0]); + peerList.put(peerId, peerInstance); + if (peerStateConnect != PEERSTATE_SUCCESS) peerStateConnect = PEERSTATE_SUCCESS; + } catch (Throwable e) { + if (peerStateConnect == PEERSTATE_LOADING) peerStateConnect = PEERSTATE_FAILED; + } + } + + public void signalRemoteDescription(String peerId, String descJSON) { + LANPeer thePeer = peerList.get(peerId); + if (thePeer != null) { + thePeer.setRemoteDescription(descJSON); + } + } + + public void signalRemoteICECandidate(String peerId, String candidate) { + LANPeer thePeer = peerList.get(peerId); + if (thePeer != null) { + thePeer.addICECandidate(candidate); + } + } + + public void signalRemoteDisconnect(String peerId) { + if (peerId == null || peerId.isEmpty()) { + for (LANPeer thePeer : peerList.values()) { + if (thePeer != null) { + try { + thePeer.disconnect(); + } catch (Throwable ignored) { + } + synchronized (serverLANEventBuffer) { + serverLANEventBuffer.put(thePeer.peerId, new LANPeerEvent.LANPeerDisconnectEvent(thePeer.peerId)); + } + } + } + peerList.clear(); + synchronized (fuckTeaVM) { + fuckTeaVM.clear(); + } + return; + } + LANPeer thePeer = peerList.get(peerId); + if (thePeer != null) { + peerList.remove(peerId); + try { + thePeer.disconnect(); + } catch (Throwable ignored) { + } + synchronized (fuckTeaVM) { + fuckTeaVM.remove(peerId); + } + synchronized (serverLANEventBuffer) { + serverLANEventBuffer.put(thePeer.peerId, new LANPeerEvent.LANPeerDisconnectEvent(peerId)); + } + } + } + + public int countPeers() { + return peerList.size(); + } + } + + private static final Map relayQueryLimited = new HashMap<>(); + private static final Map relayQueryBlocked = new HashMap<>(); + + private static class RelayQueryImpl implements RelayQuery { + + private final WebSocketClient sock; + private final String uri; + + private boolean open; + private boolean failed; + + private boolean hasRecievedAnyData = false; + + private int vers = -1; + private String comment = ""; + private String brand = ""; + + private long connectionOpenedAt; + private long connectionPingStart = -1; + private long connectionPingTimer = -1; + + private RateLimit rateLimitStatus = RateLimit.NONE; + + private VersionMismatch versError = VersionMismatch.UNKNOWN; + + private RelayQueryImpl(String uri) { + this.uri = uri; + WebSocketClient s; + try { + connectionOpenedAt = System.currentTimeMillis(); + s = new WebSocketClient(new URI(uri)) { + @Override + public void onOpen(ServerHandshake serverHandshake) { + try { + connectionPingStart = System.currentTimeMillis(); + sock.send(IPacket.writePacket(new IPacket00Handshake(0x03, RelayManager.preferredRelayVersion, ""))); + } catch (IOException e) { + logger.error(e.toString()); + sock.close(); + failed = true; + } + } + + @Override + public void onMessage(String s) { + // + } + + @Override + public void onMessage(ByteBuffer bb) { + if(bb != null) { + hasRecievedAnyData = true; + byte[] arr = new byte[bb.remaining()]; + bb.get(arr); + if(arr.length == 2 && arr[0] == (byte)0xFC) { + long millis = System.currentTimeMillis(); + if(arr[1] == (byte)0x00 || arr[1] == (byte)0x01) { + rateLimitStatus = RateLimit.BLOCKED; + relayQueryLimited.put(RelayQueryImpl.this.uri, millis); + }else if(arr[1] == (byte)0x02) { + rateLimitStatus = RateLimit.NOW_LOCKED; + relayQueryLimited.put(RelayQueryImpl.this.uri, millis); + relayQueryBlocked.put(RelayQueryImpl.this.uri, millis); + }else { + rateLimitStatus = RateLimit.LOCKED; + relayQueryBlocked.put(RelayQueryImpl.this.uri, millis); + } + failed = true; + open = false; + sock.close(); + }else { + if(open) { + try { + IPacket pkt = IPacket.readPacket(new DataInputStream(new EaglerInputStream(arr))); + if(pkt instanceof IPacket69Pong) { + IPacket69Pong ipkt = (IPacket69Pong)pkt; + versError = VersionMismatch.COMPATIBLE; + if(connectionPingTimer == -1) { + connectionPingTimer = System.currentTimeMillis() - connectionPingStart; + } + vers = ipkt.protcolVersion; + comment = ipkt.comment; + brand = ipkt.brand; + open = false; + failed = false; + sock.close(); + }else if(pkt instanceof IPacket70SpecialUpdate) { + IPacket70SpecialUpdate ipkt = (IPacket70SpecialUpdate)pkt; + if(ipkt.operation == IPacket70SpecialUpdate.OPERATION_UPDATE_CERTIFICATE) { + UpdateService.addCertificateToSet(ipkt.updatePacket); + } + }else if(pkt instanceof IPacketFFErrorCode) { + IPacketFFErrorCode ipkt = (IPacketFFErrorCode)pkt; + if(ipkt.code == IPacketFFErrorCode.TYPE_PROTOCOL_VERSION) { + String s1 = ipkt.desc.toLowerCase(); + if(s1.contains("outdated client") || s1.contains("client outdated")) { + versError = VersionMismatch.CLIENT_OUTDATED; + }else if(s1.contains("outdated server") || s1.contains("server outdated") || + s1.contains("outdated relay") || s1.contains("server relay")) { + versError = VersionMismatch.RELAY_OUTDATED; + }else { + versError = VersionMismatch.UNKNOWN; + } + } + logger.error("{}\": Recieved query error code {}: {}", uri, ipkt.code, ipkt.desc); + open = false; + failed = true; + sock.close(); + }else { + throw new IOException("Unexpected packet '" + pkt.getClass().getSimpleName() + "'"); + } + } catch (IOException e) { + logger.error("Relay Query Error: {}", e.toString()); + EagRuntime.debugPrintStackTrace(e); + open = false; + failed = true; + sock.close(); + } + } + } + } + } + + @Override + public void onClose(int i, String s, boolean b) { + open = false; + if(!hasRecievedAnyData) { + failed = true; + Long l = relayQueryBlocked.get(uri); + if(l != null) { + if(System.currentTimeMillis() - l.longValue() < 400000l) { + rateLimitStatus = RateLimit.LOCKED; + return; + } + } + l = relayQueryLimited.get(uri); + if(l != null) { + if(System.currentTimeMillis() - l.longValue() < 900000l) { + rateLimitStatus = RateLimit.BLOCKED; + return; + } + } + } + } + + @Override + public void onError(Exception e) { + EagRuntime.debugPrintStackTrace(e); + } + }; + s.connect(); + open = true; + failed = false; + }catch(Throwable t) { + connectionOpenedAt = 0l; + sock = null; + open = false; + failed = true; + return; + } + sock = s; + } + + @Override + public boolean isQueryOpen() { + return open; + } + + @Override + public boolean isQueryFailed() { + return failed; + } + + @Override + public RateLimit isQueryRateLimit() { + return rateLimitStatus; + } + + @Override + public void close() { + if(sock != null && open) { + sock.close(); + } + open = false; + } + + @Override + public int getVersion() { + return vers; + } + + @Override + public String getComment() { + return comment; + } + + @Override + public String getBrand() { + return brand; + } + + @Override + public long getPing() { + return connectionPingTimer < 1 ? 1 : connectionPingTimer; + } + + @Override + public VersionMismatch getCompatible() { + return versError; + } + + } + + private static class RelayQueryRatelimitDummy implements RelayQuery { + + private final RateLimit type; + + private RelayQueryRatelimitDummy(RateLimit type) { + this.type = type; + } + + @Override + public boolean isQueryOpen() { + return false; + } + + @Override + public boolean isQueryFailed() { + return true; + } + + @Override + public RateLimit isQueryRateLimit() { + return type; + } + + @Override + public void close() { + } + + @Override + public int getVersion() { + return RelayManager.preferredRelayVersion; + } + + @Override + public String getComment() { + return "this query was rate limited"; + } + + @Override + public String getBrand() { + return "lax1dude"; + } + + @Override + public long getPing() { + return 0l; + } + + @Override + public VersionMismatch getCompatible() { + return VersionMismatch.COMPATIBLE; + } + } public static RelayQuery openRelayQuery(String addr) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + long millis = System.currentTimeMillis(); + + Long l = relayQueryBlocked.get(addr); + if(l != null && millis - l.longValue() < 60000l) { + return new RelayQueryRatelimitDummy(RelayQuery.RateLimit.LOCKED); + } + + l = relayQueryLimited.get(addr); + if(l != null && millis - l.longValue() < 10000l) { + return new RelayQueryRatelimitDummy(RelayQuery.RateLimit.BLOCKED); + } + + return new RelayQueryImpl(addr); + } + + private static class RelayWorldsQueryImpl implements RelayWorldsQuery { + + private final WebSocketClient sock; + private final String uri; + + private boolean open; + private boolean failed; + + private boolean hasRecievedAnyData = false; + private RelayQuery.RateLimit rateLimitStatus = RelayQuery.RateLimit.NONE; + + private RelayQuery.VersionMismatch versError = RelayQuery.VersionMismatch.UNKNOWN; + + private List worlds = null; + + private RelayWorldsQueryImpl(String uri) { + this.uri = uri; + WebSocketClient s; + try { + s = new WebSocketClient(new URI(uri)) { + @Override + public void onOpen(ServerHandshake serverHandshake) { + try { + sock.send(IPacket.writePacket(new IPacket00Handshake(0x04, RelayManager.preferredRelayVersion, ""))); + } catch (IOException e) { + logger.error(e.toString()); + sock.close(); + open = false; + failed = true; + } + } + + @Override + public void onMessage(String s) { + // + } + + @Override + public void onMessage(ByteBuffer bb) { + if(bb != null) { + hasRecievedAnyData = true; + byte[] arr = new byte[bb.remaining()]; + bb.get(arr); + if(arr.length == 2 && arr[0] == (byte)0xFC) { + long millis = System.currentTimeMillis(); + if(arr[1] == (byte)0x00 || arr[1] == (byte)0x01) { + rateLimitStatus = RelayQuery.RateLimit.BLOCKED; + relayQueryLimited.put(RelayWorldsQueryImpl.this.uri, millis); + }else if(arr[1] == (byte)0x02) { + rateLimitStatus = RelayQuery.RateLimit.NOW_LOCKED; + relayQueryLimited.put(RelayWorldsQueryImpl.this.uri, millis); + relayQueryBlocked.put(RelayWorldsQueryImpl.this.uri, millis); + }else { + rateLimitStatus = RelayQuery.RateLimit.LOCKED; + relayQueryBlocked.put(RelayWorldsQueryImpl.this.uri, millis); + } + open = false; + failed = true; + sock.close(); + }else { + if(open) { + try { + IPacket pkt = IPacket.readPacket(new DataInputStream(new EaglerInputStream(arr))); + if(pkt instanceof IPacket07LocalWorlds) { + worlds = ((IPacket07LocalWorlds)pkt).worldsList; + sock.close(); + open = false; + failed = false; + }else if(pkt instanceof IPacket70SpecialUpdate) { + IPacket70SpecialUpdate ipkt = (IPacket70SpecialUpdate)pkt; + if(ipkt.operation == IPacket70SpecialUpdate.OPERATION_UPDATE_CERTIFICATE) { + UpdateService.addCertificateToSet(ipkt.updatePacket); + } + }else if(pkt instanceof IPacketFFErrorCode) { + IPacketFFErrorCode ipkt = (IPacketFFErrorCode)pkt; + if(ipkt.code == IPacketFFErrorCode.TYPE_PROTOCOL_VERSION) { + String s1 = ipkt.desc.toLowerCase(); + if(s1.contains("outdated client") || s1.contains("client outdated")) { + versError = RelayQuery.VersionMismatch.CLIENT_OUTDATED; + }else if(s1.contains("outdated server") || s1.contains("server outdated") || + s1.contains("outdated relay") || s1.contains("server relay")) { + versError = RelayQuery.VersionMismatch.RELAY_OUTDATED; + }else { + versError = RelayQuery.VersionMismatch.UNKNOWN; + } + } + logger.error("{}: Recieved query error code {}: {}", uri, ipkt.code, ipkt.desc); + open = false; + failed = true; + sock.close(); + }else { + throw new IOException("Unexpected packet '" + pkt.getClass().getSimpleName() + "'"); + } + } catch (IOException e) { + logger.error("Relay World Query Error: {}", e.toString()); + EagRuntime.debugPrintStackTrace(e); + open = false; + failed = true; + sock.close(); + } + } + } + } + } + + @Override + public void onClose(int i, String s, boolean b) { + open = false; + if(!hasRecievedAnyData) { + failed = true; + Long l = relayQueryBlocked.get(uri); + if(l != null) { + if(System.currentTimeMillis() - l.longValue() < 400000l) { + rateLimitStatus = RelayQuery.RateLimit.LOCKED; + return; + } + } + l = relayQueryLimited.get(uri); + if(l != null) { + if(System.currentTimeMillis() - l.longValue() < 900000l) { + rateLimitStatus = RelayQuery.RateLimit.BLOCKED; + return; + } + } + } + } + + @Override + public void onError(Exception e) { + EagRuntime.debugPrintStackTrace(e); + } + }; + s.connect(); + open = true; + failed = false; + }catch(Throwable t) { + sock = null; + open = false; + failed = true; + return; + } + sock = s; + } + + @Override + public boolean isQueryOpen() { + return open; + } + + @Override + public boolean isQueryFailed() { + return failed; + } + + @Override + public RelayQuery.RateLimit isQueryRateLimit() { + return rateLimitStatus; + } + + @Override + public void close() { + if(open && sock != null) { + sock.close(); + } + open = false; + } + + @Override + public List getWorlds() { + return worlds; + } + + @Override + public RelayQuery.VersionMismatch getCompatible() { + return versError; + } + + } + + private static class RelayWorldsQueryRatelimitDummy implements RelayWorldsQuery { + + private final RelayQuery.RateLimit rateLimit; + + private RelayWorldsQueryRatelimitDummy(RelayQuery.RateLimit rateLimit) { + this.rateLimit = rateLimit; + } + + @Override + public boolean isQueryOpen() { + return false; + } + + @Override + public boolean isQueryFailed() { + return true; + } + + @Override + public RelayQuery.RateLimit isQueryRateLimit() { + return rateLimit; + } + + @Override + public void close() { + } + + @Override + public List getWorlds() { + return new ArrayList(0); + } + + @Override + public RelayQuery.VersionMismatch getCompatible() { + return RelayQuery.VersionMismatch.COMPATIBLE; + } } public static RelayWorldsQuery openRelayWorldsQuery(String addr) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + long millis = System.currentTimeMillis(); + + Long l = relayQueryBlocked.get(addr); + if(l != null && millis - l.longValue() < 60000l) { + return new RelayWorldsQueryRatelimitDummy(RelayQuery.RateLimit.LOCKED); + } + + l = relayQueryLimited.get(addr); + if(l != null && millis - l.longValue() < 10000l) { + return new RelayWorldsQueryRatelimitDummy(RelayQuery.RateLimit.BLOCKED); + } + + return new RelayWorldsQueryImpl(addr); } + private static class RelayServerSocketImpl implements RelayServerSocket { + + private final WebSocketClient sock; + private final String uri; + + private boolean open; + private boolean closed; + private boolean failed; + + private boolean hasRecievedAnyData; + + private final List exceptions = new LinkedList(); + private final List packets = new LinkedList(); + + private RelayServerSocketImpl(String uri, int timeout) { + this.uri = uri; + WebSocketClient s; + try { + s = new WebSocketClient(new URI(uri)) { + @Override + public void onOpen(ServerHandshake serverHandshake) { + synchronized (lock4) { + open = true; + } + } + + @Override + public void onMessage(String s) { + // + } + + @Override + public void onMessage(ByteBuffer bb) { + if(bb != null) { + hasRecievedAnyData = true; + try { + byte[] arr = new byte[bb.remaining()]; + bb.get(arr); + IPacket pkt = IPacket.readPacket(new DataInputStream(new EaglerInputStream(arr))); + if(pkt instanceof IPacket70SpecialUpdate) { + IPacket70SpecialUpdate ipkt = (IPacket70SpecialUpdate)pkt; + if(ipkt.operation == IPacket70SpecialUpdate.OPERATION_UPDATE_CERTIFICATE) { + UpdateService.addCertificateToSet(ipkt.updatePacket); + } + }else { + packets.add(pkt); + } + } catch (IOException e) { + exceptions.add(e); + logger.error("Relay Socket Error: {}", e.toString()); + EagRuntime.debugPrintStackTrace(e); + synchronized (lock4) { + open = false; + failed = true; + } + closed = true; + synchronized (lock4) { + sock.close(); + } + } + } + } + + @Override + public void onClose(int i, String s, boolean b) { + if (!hasRecievedAnyData) { + failed = true; + } + synchronized (lock4) { + open = false; + closed = true; + } + } + + @Override + public void onError(Exception e) { + EagRuntime.debugPrintStackTrace(e); + } + }; + s.connect(); + synchronized (lock4) { + open = false; + closed = false; + } + failed = false; + }catch(Throwable t) { + exceptions.add(t); + synchronized (lock4) { + sock = null; + open = false; + closed = true; + } + failed = true; + return; + } + synchronized (lock4) { + sock = s; + } + new Thread(() -> { + EagUtils.sleep(timeout); + synchronized (lock4) { + if (!open && !closed) { + closed = true; + sock.close(); + } + } + }).start(); + } + + @Override + public boolean isOpen() { + return open; + } + + @Override + public boolean isClosed() { + synchronized (lock4) { + return closed; + } + } + + @Override + public void close() { + if(open && sock != null) { + synchronized (lock4) { + sock.close(); + } + } + synchronized (lock4) { + open = false; + closed = true; + } + } + + @Override + public boolean isFailed() { + return failed; + } + + @Override + public Throwable getException() { + if(!exceptions.isEmpty()) { + return exceptions.remove(0); + }else { + return null; + } + } + + @Override + public void writePacket(IPacket pkt) { + try { + sock.send(IPacket.writePacket(pkt)); + } catch (Throwable e) { + logger.error("Relay connection error: {}", e.toString()); + EagRuntime.debugPrintStackTrace(e); + exceptions.add(e); + failed = true; + synchronized (lock4) { + open = false; + closed = true; + sock.close(); + } + } + } + + @Override + public IPacket readPacket() { + if(!packets.isEmpty()) { + return packets.remove(0); + }else { + return null; + } + } + + @Override + public IPacket nextPacket() { + if(!packets.isEmpty()) { + return packets.get(0); + }else { + return null; + } + } + + @Override + public RelayQuery.RateLimit getRatelimitHistory() { + if(relayQueryBlocked.containsKey(uri)) { + return RelayQuery.RateLimit.LOCKED; + } + if(relayQueryLimited.containsKey(uri)) { + return RelayQuery.RateLimit.BLOCKED; + } + return RelayQuery.RateLimit.NONE; + } + + @Override + public String getURI() { + return uri; + } + + } + + private static class RelayServerSocketRatelimitDummy implements RelayServerSocket { + + private final RelayQuery.RateLimit limit; + + private RelayServerSocketRatelimitDummy(RelayQuery.RateLimit limit) { + this.limit = limit; + } + + @Override + public boolean isOpen() { + return false; + } + + @Override + public boolean isClosed() { + return true; + } + + @Override + public void close() { + } + + @Override + public boolean isFailed() { + return true; + } + + @Override + public Throwable getException() { + return null; + } + + @Override + public void writePacket(IPacket pkt) { + } + + @Override + public IPacket readPacket() { + return null; + } + + @Override + public IPacket nextPacket() { + return null; + } + + @Override + public RelayQuery.RateLimit getRatelimitHistory() { + return limit; + } + + @Override + public String getURI() { + return ""; + } + + } + + public static RelayServerSocket openRelayConnection(String addr, int timeout) { + long millis = System.currentTimeMillis(); + + Long l = relayQueryBlocked.get(addr); + if(l != null && millis - l.longValue() < 60000l) { + return new RelayServerSocketRatelimitDummy(RelayQuery.RateLimit.LOCKED); + } + + l = relayQueryLimited.get(addr); + if(l != null && millis - l.longValue() < 10000l) { + return new RelayServerSocketRatelimitDummy(RelayQuery.RateLimit.BLOCKED); + } + + return new RelayServerSocketImpl(addr, timeout); + } + + private static LANClient rtcLANClient = null; + public static void startRTCLANClient() { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + if (rtcLANClient == null) { + rtcLANClient = new LANClient(); + } } + private static final List clientLANPacketBuffer = new ArrayList<>(); + + private static String clientICECandidate = null; + private static String clientDescription = null; + private static boolean clientDataChannelOpen = false; + private static boolean clientDataChannelClosed = true; + public static int clientLANReadyState() { - return 0; + return rtcLANClient.readyState; } public static void clientLANCloseConnection() { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + rtcLANClient.signalRemoteDisconnect(false); } public static void clientLANSendPacket(byte[] pkt) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + rtcLANClient.sendPacketToServer(new RTCDataChannelBuffer(ByteBuffer.wrap(pkt), true)); } public static byte[] clientLANReadPacket() { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + synchronized(clientLANPacketBuffer) { + return !clientLANPacketBuffer.isEmpty() ? clientLANPacketBuffer.remove(0) : null; + } } public static List clientLANReadAllPacket() { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + synchronized(clientLANPacketBuffer) { + if(!clientLANPacketBuffer.isEmpty()) { + List ret = new ArrayList(clientLANPacketBuffer); + clientLANPacketBuffer.clear(); + return ret; + }else { + return null; + } + } } public static void clientLANSetICEServersAndConnect(String[] servers) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + rtcLANClient.setIceServers(servers); + if(clientLANReadyState() == LANClient.READYSTATE_CONNECTED || clientLANReadyState() == LANClient.READYSTATE_CONNECTING) { + rtcLANClient.signalRemoteDisconnect(true); + } + rtcLANClient.initialize(); + rtcLANClient.signalRemoteConnect(); } public static void clearLANClientState() { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + clientICECandidate = null; + clientDescription = null; + synchronized (lock2) { + clientDataChannelOpen = false; + clientDataChannelClosed = true; + } } public static String clientLANAwaitICECandidate() { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + if(clientICECandidate != null) { + String ret = clientICECandidate; + clientICECandidate = null; + return ret; + }else { + return null; + } } public static String clientLANAwaitDescription() { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + if(clientDescription != null) { + String ret = clientDescription; + clientDescription = null; + return ret; + }else { + return null; + } } public static boolean clientLANAwaitChannel() { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + synchronized (lock2) { + if (clientDataChannelOpen) { + clientDataChannelOpen = false; + return true; + } else { + return false; + } + } } public static boolean clientLANClosed() { - return true; + synchronized (lock2) { + return clientDataChannelClosed; + } } public static void clientLANSetICECandidate(String candidate) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + rtcLANClient.signalRemoteICECandidate(candidate); } public static void clientLANSetDescription(String description) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + rtcLANClient.signalRemoteDescription(description); } + private static LANServer rtcLANServer = null; + public static void startRTCLANServer() { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + if (rtcLANServer == null) { + rtcLANServer = new LANServer(); + } } + private static final ListMultimap serverLANEventBuffer = LinkedListMultimap.create(); + public static void serverLANInitializeServer(String[] servers) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + synchronized(serverLANEventBuffer) { + serverLANEventBuffer.clear(); + } + rtcLANServer.resetPeerStates(); + rtcLANServer.setIceServers(servers); } public static void serverLANCloseServer() { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + rtcLANServer.signalRemoteDisconnect(""); } public static LANPeerEvent serverLANGetEvent(String clientId) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + synchronized(serverLANEventBuffer) { + if(!serverLANEventBuffer.isEmpty()) { + List l = serverLANEventBuffer.get(clientId); + if(!l.isEmpty()) { + return l.remove(0); + } + } + return null; + } } public static List serverLANGetAllEvent(String clientId) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + synchronized(serverLANEventBuffer) { + if(!serverLANEventBuffer.isEmpty()) { + List l = serverLANEventBuffer.removeAll(clientId); + if(l.isEmpty()) { + return null; + } + return l; + } + return null; + } } public static void serverLANWritePacket(String peer, byte[] data) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + rtcLANServer.sendPacketToRemoteClient(peer, new RTCDataChannelBuffer(ByteBuffer.wrap(data), true)); } public static void serverLANCreatePeer(String peer) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + rtcLANServer.signalRemoteConnect(peer); } public static void serverLANPeerICECandidates(String peer, String iceCandidates) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + rtcLANServer.signalRemoteICECandidate(peer, iceCandidates); } public static void serverLANPeerDescription(String peer, String description) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + rtcLANServer.signalRemoteDescription(peer, description); } public static void serverLANDisconnectPeer(String peer) { - throw new UnsupportedOperationException("LAN not supported on desktop runtime!"); + rtcLANServer.signalRemoteDisconnect(peer); } public static int countPeers() { - return 0; + if (rtcLANServer == null) { + return 0; + } + return rtcLANServer.countPeers(); } -} +} \ No newline at end of file diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/DesktopClientConfigAdapter.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/DesktopClientConfigAdapter.java index f2b5dd0..6813701 100644 --- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/DesktopClientConfigAdapter.java +++ b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/DesktopClientConfigAdapter.java @@ -5,6 +5,7 @@ import java.util.List; import org.json.JSONObject; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter; import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry; @@ -50,18 +51,31 @@ public class DesktopClientConfigAdapter implements IClientConfigAdapter { return "desktop"; } + @Override + public String getResourcePacksDB() { + return "desktop"; + } + @Override public JSONObject dumpConfig() { return new JSONObject("{\"container\":null,\"worldsDB\":\"desktop\"}"); } + private final List relays = new ArrayList<>(); + @Override public List getRelays() { - throw new UnsupportedOperationException("TODO"); + if (relays.isEmpty()) { + int relayId = (new EaglercraftRandom()).nextInt(3); + relays.add(new RelayEntry("wss://relay.deev.is/", "lax1dude relay #1", relayId == 0)); + relays.add(new RelayEntry("wss://relay.lax1dude.net/", "lax1dude relay #2", relayId == 1)); + relays.add(new RelayEntry("wss://relay.shhnowisnottheti.me/", "ayunami relay #1", relayId == 2)); + } + return relays; } @Override - public boolean checkShaderGLErrors() { + public boolean isCheckShaderGLErrors() { return true; } diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LWJGLEntryPoint.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LWJGLEntryPoint.java index 434404e..1c79202 100644 --- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LWJGLEntryPoint.java +++ b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/LWJGLEntryPoint.java @@ -8,6 +8,7 @@ import net.lax1dude.eaglercraft.v1_8.EagUtils; import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformANGLE; import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime; import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program.ShaderSource; +import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; import net.minecraft.client.main.Main; /** @@ -57,6 +58,13 @@ public class LWJGLEntryPoint { } } + RelayManager.relayManager.load(EagRuntime.getStorage("r")); + + if (RelayManager.relayManager.count() <= 0) { + RelayManager.relayManager.loadDefaults(); + RelayManager.relayManager.save(); + } + EagRuntime.create(); Main.appMain(new String[0]); diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/MainMenuCreditsDialog.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/MainMenuCreditsDialog.java new file mode 100644 index 0000000..4b8f666 --- /dev/null +++ b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/lwjgl/MainMenuCreditsDialog.java @@ -0,0 +1,76 @@ +package net.lax1dude.eaglercraft.v1_8.internal.lwjgl; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; +import java.awt.BorderLayout; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import java.awt.Font; +import java.awt.GraphicsEnvironment; +import java.awt.Toolkit; +import javax.swing.ScrollPaneConstants; + +/** + * Copyright (c) 2024 lax1dude. 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 MainMenuCreditsDialog extends JFrame { + + private static final long serialVersionUID = 696969696L; + private JPanel contentPane; + private JTextArea textArea; + + /** + * Create the frame. + */ + public MainMenuCreditsDialog() { + setIconImage(Toolkit.getDefaultToolkit().getImage("icon32.png")); + setTitle("EaglercraftX 1.8 Credits"); + setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); + setBounds(100, 100, 850, 700); + setLocationByPlatform(true); + setAlwaysOnTop(true); + contentPane = new JPanel(); + + setContentPane(contentPane); + contentPane.setLayout(new BorderLayout(0, 0)); + + JScrollPane scrollPane = new JScrollPane(); + scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + contentPane.add(scrollPane, BorderLayout.CENTER); + + textArea = new JTextArea(); + textArea.setEditable(false); + textArea.setLineWrap(true); + textArea.setWrapStyleWord(true); + String[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); + Font daFont = null; + for(int i = 0; i < fonts.length; ++i) { + if(fonts[i].equalsIgnoreCase("consolas")) { + daFont = new Font(fonts[i], Font.PLAIN, 15); + break; + } + } + if(daFont == null) { + daFont = new Font(Font.MONOSPACED, Font.PLAIN, 15); + } + textArea.setFont(daFont); + scrollPane.setViewportView(textArea); + } + + public void setCreditsText(String str) { + textArea.setText(str); + } +} diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/FolderResourcePack.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/FolderResourcePack.java deleted file mode 100644 index 1a5cec5..0000000 --- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/FolderResourcePack.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.lax1dude.eaglercraft.v1_8.internal.vfs; - -import com.google.common.collect.Sets; -import net.minecraft.client.resources.AbstractResourcePack; - -import java.io.BufferedInputStream; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.Set; - -/** - * Copyright (c) 2022-2023 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 FolderResourcePack extends AbstractResourcePack { - public FolderResourcePack(String resourcePackFileIn, String prefix) { - super(resourcePackFileIn); - } - - protected InputStream getInputStreamByName(String name) { - return new BufferedInputStream(new ByteArrayInputStream(new byte[0])); - } - - protected boolean hasResourceName(String name) { - return false; - } - - public Set getResourceDomains() { - return Sets.newHashSet(); - } -} \ No newline at end of file diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/SYS.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/SYS.java deleted file mode 100644 index 856bef1..0000000 --- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/internal/vfs/SYS.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.lax1dude.eaglercraft.v1_8.internal.vfs; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.function.Consumer; - -/** - * Copyright (c) 2022-2023 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 SYS { - - public static final Object VFS = null; - - public static final void loadRemoteResourcePack(String url, String hash, Consumer cb, Consumer ast, Runnable loading) { - return; - } - - public static final boolean loadResourcePack(String name, InputStream data, String hash) { - return false; - } - - public static final List getResourcePackNames() { - return new ArrayList<>(); - } - - public static final void deleteResourcePack(String packName) { - // - } -} diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/internal/ClientPlatformSingleplayer.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/internal/ClientPlatformSingleplayer.java index d346387..380acb5 100644 --- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/internal/ClientPlatformSingleplayer.java +++ b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/internal/ClientPlatformSingleplayer.java @@ -3,7 +3,6 @@ package net.lax1dude.eaglercraft.v1_8.sp.internal; import java.util.ArrayList; import java.util.List; -import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter; import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData; import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime; import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.CrashScreenPopup; diff --git a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/lwjgl/CrashScreenPopup.java b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/lwjgl/CrashScreenPopup.java index c385289..21c0018 100644 --- a/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/lwjgl/CrashScreenPopup.java +++ b/sources/lwjgl/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/lwjgl/CrashScreenPopup.java @@ -9,7 +9,6 @@ import javax.swing.ScrollPaneConstants; import java.awt.Font; import java.awt.Toolkit; import java.awt.Color; -import java.awt.Window.Type; /** * Copyright (c) 2022-2024 lax1dude. All Rights Reserved. diff --git a/sources/main/java/com/google/common/base/Charsets.java b/sources/main/java/com/google/common/base/Charsets.java index 2657704..1d06b8d 100644 --- a/sources/main/java/com/google/common/base/Charsets.java +++ b/sources/main/java/com/google/common/base/Charsets.java @@ -19,7 +19,6 @@ package com.google.common.base; import java.nio.charset.Charset; import com.google.common.annotations.GwtCompatible; -import com.google.common.annotations.GwtIncompatible; /** * Contains constant definitions for the six standard {@link Charset} instances, diff --git a/sources/main/java/com/google/common/base/Throwables.java b/sources/main/java/com/google/common/base/Throwables.java index cd7fb44..6cb87e6 100644 --- a/sources/main/java/com/google/common/base/Throwables.java +++ b/sources/main/java/com/google/common/base/Throwables.java @@ -18,8 +18,6 @@ package com.google.common.base; import static com.google.common.base.Preconditions.checkNotNull; -import java.io.PrintWriter; -import java.io.StringWriter; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/sources/main/java/com/google/common/collect/Lists.java b/sources/main/java/com/google/common/collect/Lists.java index fb816bf..1774b07 100644 --- a/sources/main/java/com/google/common/collect/Lists.java +++ b/sources/main/java/com/google/common/collect/Lists.java @@ -44,7 +44,6 @@ import javax.annotation.Nullable; import com.google.common.annotations.Beta; import com.google.common.annotations.GwtCompatible; -import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; import com.google.common.base.Objects; diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/ArrayUtils.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/ArrayUtils.java index 4c3d3e7..8335246 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/ArrayUtils.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/ArrayUtils.java @@ -55,6 +55,17 @@ public class ArrayUtils { } return str; } + + private static final String hex = "0123456789abcdef"; + + public static String hexString(byte[] bytesIn) { + char[] ret = new char[bytesIn.length << 1]; + for(int i = 0; i < bytesIn.length; ++i) { + ret[i << 1] = hex.charAt((bytesIn[i] >> 4) & 15); + ret[(i << 1) + 1] = hex.charAt(bytesIn[i] & 15); + } + return new String(ret); + } public static void eaglerShuffle(List list, EaglercraftRandom rnd) { T k; diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/BaseNCodec.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/BaseNCodec.java index c8790b4..3f02e47 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/BaseNCodec.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/BaseNCodec.java @@ -390,7 +390,8 @@ public abstract class BaseNCodec { if (arrayOctet == null) { return false; } - for (final byte element : arrayOctet) { + for (int i = 0; i < arrayOctet.length; ++i) { + byte element = arrayOctet[i]; if (pad == element || isInAlphabet(element)) { return true; } @@ -624,7 +625,8 @@ public abstract class BaseNCodec { * the byte array is empty; {@code false}, otherwise */ public boolean isInAlphabet(final byte[] arrayOctet, final boolean allowWSPad) { - for (final byte octet : arrayOctet) { + for (int i = 0; i < arrayOctet.length; ++i) { + byte octet = arrayOctet[i]; if (!isInAlphabet(octet) && (!allowWSPad || (octet != pad) && !isWhiteSpace(octet))) { return false; } diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/EagRuntime.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/EagRuntime.java index 7347b73..e80d6f4 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/EagRuntime.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/EagRuntime.java @@ -14,6 +14,7 @@ import java.util.Calendar; import java.util.List; import java.util.function.Consumer; +import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformANGLE; import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformAgent; import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformOS; import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType; @@ -28,7 +29,7 @@ import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; import net.lax1dude.eaglercraft.v1_8.update.UpdateService; /** - * Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved. + * Copyright (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 @@ -48,6 +49,10 @@ public class EagRuntime { private static final Logger exceptionLogger = LogManager.getLogger("Exception"); private static boolean ssl = false; private static boolean offlineDownloadURL = false; + private static EnumPlatformAgent userAgent = null; + private static String userAgentString = null; + private static EnumPlatformOS operatingSystem = null; + private static EnumPlatformANGLE angleBackend = null; public static String getVersion() { return "EagRuntimeX 1.0"; @@ -58,6 +63,10 @@ public class EagRuntime { PlatformRuntime.create(); ssl = PlatformRuntime.requireSSL(); offlineDownloadURL = PlatformRuntime.isOfflineDownloadURL(); + userAgent = PlatformRuntime.getPlatformAgent(); + userAgentString = PlatformRuntime.getUserAgentString(); + operatingSystem = PlatformRuntime.getPlatformOS(); + angleBackend = PlatformRuntime.getPlatformANGLE(); UpdateService.initialize(); EaglerXBungeeVersion.initialize(); EaglercraftGPU.warmUpCache(); @@ -72,15 +81,19 @@ public class EagRuntime { } public static EnumPlatformAgent getPlatformAgent() { - return PlatformRuntime.getPlatformAgent(); + return userAgent; } - + public static String getUserAgentString() { - return PlatformRuntime.getUserAgentString(); + return userAgentString; } public static EnumPlatformOS getPlatformOS() { - return PlatformRuntime.getPlatformOS(); + return operatingSystem; + } + + public static EnumPlatformANGLE getPlatformANGLE() { + return angleBackend; } public static ByteBuffer allocateByteBuffer(int length) { diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglerInputStream.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglerInputStream.java index 99b44ba..d35b115 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglerInputStream.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglerInputStream.java @@ -1,12 +1,13 @@ package net.lax1dude.eaglercraft.v1_8; import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; +import java.util.Arrays; /** - * Copyright (c) 2022 lax1dude. All Rights Reserved. + * Copyright (c) 2022-2024 lax1dude. 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 @@ -20,39 +21,117 @@ import java.io.InputStream; * POSSIBILITY OF SUCH DAMAGE. * */ -public class EaglerInputStream extends ByteArrayInputStream { +public class EaglerInputStream extends InputStream { + + protected byte buf[]; + protected int pos; + protected int mark = 0; + protected int count; public EaglerInputStream(byte[] buf) { - super(buf); + this.buf = buf; + this.pos = 0; + this.count = buf.length; } - public EaglerInputStream(byte[] buf, int off, int len) { - super(buf, off, len); + public EaglerInputStream(byte buf[], int offset, int length) { + this.buf = buf; + this.pos = offset; + this.count = Math.min(offset + length, buf.length); + this.mark = offset; } - + + public int read() { + return (pos < count) ? (buf[pos++] & 0xff) : -1; + } + + public int read(byte b[], int off, int len) { + if (pos >= count) { + return -1; + } + + int avail = count - pos; + if (len > avail) { + len = avail; + } + if (len <= 0) { + return 0; + } + System.arraycopy(buf, pos, b, off, len); + pos += len; + return len; + } + + public byte[] readAllBytes() { + byte[] result = Arrays.copyOfRange(buf, pos, count); + pos = count; + return result; + } + + public int readNBytes(byte[] b, int off, int len) { + int n = read(b, off, len); + return n == -1 ? 0 : n; + } + + public long transferTo(OutputStream out) throws IOException { + int len = count - pos; + out.write(buf, pos, len); + pos = count; + return len; + } + public static byte[] inputStreamToBytesQuiet(InputStream is) { - if(is == null) { + if (is == null) { return null; } try { return inputStreamToBytes(is); - }catch(IOException ex) { + } catch (IOException ex) { return null; } } - + + public long skip(long n) { + long k = count - pos; + if (n < k) { + k = n < 0 ? 0 : n; + } + + pos += k; + return k; + } + + public int available() { + return count - pos; + } + + public boolean markSupported() { + return true; + } + + public void mark(int readAheadLimit) { + mark = pos; + } + + public void reset() { + pos = mark; + } + + public void close() throws IOException { + } + public static byte[] inputStreamToBytes(InputStream is) throws IOException { - if(is instanceof EaglerInputStream) { + if (is instanceof EaglerInputStream) { return ((EaglerInputStream) is).getAsArray(); - }else if(is instanceof ByteArrayInputStream) { + } else if (is instanceof ByteArrayInputStream) { byte[] ret = new byte[is.available()]; is.read(ret); return ret; - }else { - ByteArrayOutputStream os = new ByteArrayOutputStream(1024); + } else { + EaglerOutputStream os = new EaglerOutputStream(1024); byte[] buf = new byte[1024]; int i; - while((i = is.read(buf)) != -1) { + while ((i = is.read(buf)) != -1) { os.write(buf, 0, i); } return os.toByteArray(); @@ -60,27 +139,27 @@ public class EaglerInputStream extends ByteArrayInputStream { } public byte[] getAsArray() { - if(pos == 0 && count == buf.length) { + if (pos == 0 && count == buf.length) { return buf; - }else { + } else { byte[] ret = new byte[count]; System.arraycopy(buf, pos, ret, 0, count); return ret; } } - + public boolean canUseArrayDirectly() { return pos == 0 && count == buf.length; } - + public int getPosition() { return pos; } - + public int getMark() { return mark; } - + public int getCount() { return count; } diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglerOutputStream.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglerOutputStream.java new file mode 100644 index 0000000..a39c268 --- /dev/null +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglerOutputStream.java @@ -0,0 +1,79 @@ +package net.lax1dude.eaglercraft.v1_8; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.Arrays; + +/** + * Copyright (c) 2024 lax1dude. 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 EaglerOutputStream extends OutputStream { + + protected byte buf[]; + protected int count; + + public EaglerOutputStream() { + this(32); + } + + public EaglerOutputStream(int size) { + if (size < 0) { + throw new IllegalArgumentException("Negative initial size: " + size); + } + buf = new byte[size]; + } + + private void ensureCapacity(int minCapacity) { + if (buf.length < minCapacity) { + minCapacity = Math.max(minCapacity, buf.length * 3 / 2); + buf = Arrays.copyOf(buf, minCapacity); + } + } + + public void write(int b) { + ensureCapacity(count + 1); + buf[count] = (byte) b; + count += 1; + } + + public void write(byte b[], int off, int len) { + ensureCapacity(count + len); + System.arraycopy(b, off, buf, count, len); + count += len; + } + + public void writeBytes(byte b[]) { + write(b, 0, b.length); + } + + public void writeTo(OutputStream out) throws IOException { + out.write(buf, 0, count); + } + + public void reset() { + count = 0; + } + + public byte[] toByteArray() { + return Arrays.copyOf(buf, count); + } + + public int size() { + return count; + } + + public void close() throws IOException { + } +} diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java index 4d5402e..5534ccd 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java @@ -10,7 +10,7 @@ public class EaglercraftVersion { /// Customize these to fit your fork: public static final String projectForkName = "EaglercraftX"; - public static final String projectForkVersion = "u23"; + public static final String projectForkVersion = "u24"; public static final String projectForkVendor = "lax1dude"; public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; @@ -20,7 +20,7 @@ public class EaglercraftVersion { public static final String projectOriginName = "EaglercraftX"; public static final String projectOriginAuthor = "lax1dude"; public static final String projectOriginRevision = "1.8"; - public static final String projectOriginVersion = "u23"; + public static final String projectOriginVersion = "u24"; public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; // rest in peace @@ -31,7 +31,7 @@ public class EaglercraftVersion { public static final boolean enableUpdateService = true; public static final String updateBundlePackageName = "net.lax1dude.eaglercraft.v1_8.client"; - public static final int updateBundlePackageVersionInt = 23; + public static final int updateBundlePackageVersionInt = 24; public static final String updateLatestLocalStorageKey = "latestUpdate_" + updateBundlePackageName; diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/IOUtils.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/IOUtils.java index b0294f4..e42561f 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/IOUtils.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/IOUtils.java @@ -71,4 +71,19 @@ public class IOUtils { } } + public static int readFully(InputStream is, byte[] out) throws IOException { + int i = 0, j; + while(i < out.length && (j = is.read(out, i, out.length - i)) != -1) { + i += j; + } + return i; + } + + public static long skipFully(InputStream is, long skip) throws IOException { + long i = 0, j; + while(i < skip && (j = is.skip(skip - i)) != 0) { + i += j; + } + return i; + } } diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/futures/ListenableFutureTask.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/futures/ListenableFutureTask.java index b6c3c28..bbbb57c 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/futures/ListenableFutureTask.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/futures/ListenableFutureTask.java @@ -41,7 +41,8 @@ public class ListenableFutureTask extends FutureTask implements Listenable } protected void done() { - for(Runnable r : listeners) { + for(int i = 0, l = listeners.size(); i < l; ++i) { + Runnable r = listeners.get(i); try { r.run(); }catch(Throwable t) { diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/IClientConfigAdapter.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/IClientConfigAdapter.java index 63e1249..0a91bfe 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/IClientConfigAdapter.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/IClientConfigAdapter.java @@ -42,11 +42,13 @@ public interface IClientConfigAdapter { String getWorldsDB(); + String getResourcePacksDB(); + JSONObject dumpConfig(); List getRelays(); - boolean checkShaderGLErrors(); + boolean isCheckShaderGLErrors(); boolean isDemo(); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFile2.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFile2.java index bff077e..88c0ecf 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFile2.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFile2.java @@ -188,8 +188,12 @@ public class VFile2 { return null; } ByteBuffer readBuffer = PlatformFilesystem.eaglerRead(path); + byte[] copyBuffer = PlatformRuntime.castNativeByteBuffer(readBuffer); + if(copyBuffer != null) { + return copyBuffer; + } try { - byte[] copyBuffer = new byte[readBuffer.remaining()]; + copyBuffer = new byte[readBuffer.remaining()]; readBuffer.get(copyBuffer); return copyBuffer; }finally { @@ -219,7 +223,12 @@ public class VFile2 { public void setAllBytes(byte[] bytes) { assertNotRelative(); - ByteBuffer copyBuffer = PlatformRuntime.allocateByteBuffer(bytes.length); + ByteBuffer copyBuffer = PlatformRuntime.castPrimitiveByteArray(bytes); + if(copyBuffer != null) { + PlatformFilesystem.eaglerWrite(path, copyBuffer); + return; + } + copyBuffer = PlatformRuntime.allocateByteBuffer(bytes.length); try { copyBuffer.put(bytes); copyBuffer.flip(); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileInputStream.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileInputStream.java index ede2301..ebd6dc1 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileInputStream.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileInputStream.java @@ -54,7 +54,7 @@ class VFileInputStream extends InputStream { if(len > 0) { fileBuffer.get(b, off, len); } - return len; + return len <= 0 ? -1 : len; } @Override diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileOutputStream.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileOutputStream.java index bc23910..4333bfd 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileOutputStream.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/internal/vfs2/VFileOutputStream.java @@ -1,8 +1,8 @@ package net.lax1dude.eaglercraft.v1_8.internal.vfs2; -import java.io.ByteArrayOutputStream; import java.io.IOException; +import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream; import net.lax1dude.eaglercraft.v1_8.internal.PlatformFilesystem; import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime; import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; @@ -22,7 +22,7 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; * POSSIBILITY OF SUCH DAMAGE. * */ -class VFileOutputStream extends ByteArrayOutputStream { +class VFileOutputStream extends EaglerOutputStream { private final VFile2 vfsFile; private boolean closed = false; diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/ChunkUpdateManager.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/ChunkUpdateManager.java index b80bf04..7ea085e 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/ChunkUpdateManager.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/ChunkUpdateManager.java @@ -73,7 +73,9 @@ public class ChunkUpdateManager { final CompiledChunk compiledchunk = generator.getCompiledChunk(); if (chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.REBUILD_CHUNK) { - for (EnumWorldBlockLayer enumworldblocklayer : EnumWorldBlockLayer.values()) { + EnumWorldBlockLayer[] en = EnumWorldBlockLayer._VALUES; + for (int i = 0; i < en.length; ++i) { + EnumWorldBlockLayer enumworldblocklayer = en[i]; if (!compiledchunk.isLayerEmpty(enumworldblocklayer)) { this.uploadChunk(enumworldblocklayer, generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(enumworldblocklayer), diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerFolderResourcePack.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerFolderResourcePack.java new file mode 100644 index 0000000..e45d36c --- /dev/null +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerFolderResourcePack.java @@ -0,0 +1,355 @@ +package net.lax1dude.eaglercraft.v1_8.minecraft; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.function.Consumer; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + +import net.lax1dude.eaglercraft.v1_8.ArrayUtils; +import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; +import net.lax1dude.eaglercraft.v1_8.crypto.SHA1Digest; +import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.minecraft.client.resources.AbstractResourcePack; + +/** + * Copyright (c) 2024 lax1dude. 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 EaglerFolderResourcePack extends AbstractResourcePack { + + public static final Logger logger = LogManager.getLogger("EaglerFolderResourcePack"); + + public static final String SERVER_RESOURCE_PACKS = "srp"; + public static final String RESOURCE_PACKS = "resourcepacks"; + + private final String prefix; + private final String displayName; + private final Set domains; + private final long timestamp; + + private static boolean isSupported = false; + + public static void setSupported(boolean supported) { + isSupported = supported; + } + + public static boolean isSupported() { + return isSupported; + } + + public EaglerFolderResourcePack(String resourcePackFileIn, String displayName, String prefix, Set domains, long timestamp) { + super(resourcePackFileIn); + this.displayName = displayName; + this.prefix = prefix; + this.domains = domains; + this.timestamp = timestamp; + } + + @Override + public Set getResourceDomains() { + return domains; + } + + @Override + protected InputStream getInputStreamByName(String var1) throws IOException { + return (new VFile2(prefix, this.resourcePackFile, var1)).getInputStream(); + } + + @Override + protected boolean hasResourceName(String var1) { + return (new VFile2(prefix, this.resourcePackFile, var1)).exists(); + } + + public long getTimestamp() { + return timestamp; + } + + public String getDisplayName() { + return displayName; + } + + public static List getFolderResourcePacks(String prefix) { + if(!isSupported) { + return Collections.emptyList(); + } + String str = (new VFile2(prefix, "manifest.json")).getAllChars(); + if(str == null) { + return Collections.emptyList(); + } + try { + JSONArray json = (new JSONObject(str)).getJSONArray("resourcePacks"); + List ret = new ArrayList(json.length()); + for(int i = 0, l = json.length(); i < l; ++i) { + JSONObject jp = json.getJSONObject(i); + String folderName = jp.getString("folder"); + String displayName = jp.optString("name", folderName); + long timestamp = jp.getLong("timestamp"); + Set domains = Sets.newHashSet(); + JSONArray jsonDomains = jp.getJSONArray("domains"); + for(int j = 0, k = jsonDomains.length(); j < k; ++j) { + domains.add(jsonDomains.getString(j)); + } + ret.add(new EaglerFolderResourcePack(folderName, displayName, prefix, domains, timestamp)); + } + return ret; + }catch(JSONException ex) { + logger.error("Failed to load resource pack manifest!"); + logger.error(ex); + return Collections.emptyList(); + } + } + + public static EaglerFolderResourcePack importResourcePack(String name, String prefix, byte[] file) throws IOException { + if(!isSupported) { + return null; + } + logger.info("Importing resource pack: {}", name); + int idx = name.lastIndexOf('.'); + if(idx != -1) { + name = name.substring(0, idx); + } + String folderName = name.replaceAll("[^A-Za-z0-9\\-_ \\(\\)]", "_"); + + final List existingLst = getFolderResourcePacks(RESOURCE_PACKS); + + vigg: for(;;) { + for(int i = 0, l = existingLst.size(); i < l; ++i) { + EaglerFolderResourcePack rp = existingLst.get(i); + if(rp.resourcePackFile.equalsIgnoreCase(folderName)) { + folderName = folderName + "-"; + continue vigg; + } + } + break; + } + + List fileNames = Lists.newArrayList(); + + logger.info("Counting files..."); + ZipInputStream ziss = new ZipInputStream(new EaglerInputStream(file)); + ZipEntry zipEntry; + while ((zipEntry = ziss.getNextEntry()) != null) { + if (!zipEntry.isDirectory()) { + fileNames.add(zipEntry.getName()); + } + } + + int prefixLen = Integer.MAX_VALUE; + for(int i = 0, l = fileNames.size(); i < l; ++i) { + String fn = fileNames.get(i); + if(fn.equals("pack.mcmeta") || fn.endsWith("/pack.mcmeta")) { + int currPrefixLen = fn.length() - 11; + if (prefixLen > currPrefixLen) { + prefixLen = currPrefixLen; + } + } + } + if (prefixLen == Integer.MAX_VALUE) { + prefixLen = 0; + } + + Set domainsList = Sets.newHashSet(); + String fn; + for(int i = 0, l = fileNames.size(); i < l; ++i) { + fn = fileNames.get(i); + if(fn.length() > prefixLen + 7) { + fn = fn.substring(prefixLen + 7); + int j = fn.indexOf('/'); + if(j != -1) { + domainsList.add(fn.substring(0, j)); + } + } + } + + VFile2 dstDir = new VFile2(prefix, folderName); + logger.info("Extracting to: {}", dstDir.getPath()); + + try { + int totalSize = 0; + int totalFiles = 0; + int lastProg = 0; + ziss = new ZipInputStream(new EaglerInputStream(file)); + while ((zipEntry = ziss.getNextEntry()) != null) { + if (!zipEntry.isDirectory()) { + fn = zipEntry.getName(); + if(fn.length() > prefixLen) { + byte[] buffer = new byte[(int)zipEntry.getSize()]; + int i = 0, j; + while(i < buffer.length && (j = ziss.read(buffer, i, buffer.length - i)) != -1) { + i += j; + } + (new VFile2(prefix, folderName, fn.substring(prefixLen))).setAllBytes(buffer); + totalSize += buffer.length; + ++totalFiles; + if(totalSize - lastProg > 25000) { + lastProg = totalSize; + logger.info("Extracted {} files, {} bytes from ZIP file...", totalFiles, totalSize); + } + } + } + } + }catch(IOException ex) { + logger.error("Encountered an error extracting zip file, deleting extracted files..."); + for(int i = 0, l = fileNames.size(); i < l; ++i) { + fn = fileNames.get(i); + if(fn.length() > prefixLen) { + (new VFile2(dstDir, fn.substring(prefixLen))).delete(); + } + } + throw ex; + } + + logger.info("Updating manifest..."); + + VFile2 manifestFile = new VFile2(prefix, "manifest.json"); + String str = manifestFile.getAllChars(); + JSONArray arr = null; + if(str != null) { + try { + arr = (new JSONObject(str)).getJSONArray("resourcePacks"); + }catch(JSONException ex) { + } + } + + if(arr == null) { + arr = new JSONArray(); + } + + JSONObject manifestEntry = new JSONObject(); + manifestEntry.put("folder", folderName); + manifestEntry.put("name", name); + long timestamp = System.currentTimeMillis(); + manifestEntry.put("timestamp", timestamp); + JSONArray domainsListJson = new JSONArray(); + for(String str2 : domainsList) { + domainsListJson.put(str2); + } + manifestEntry.put("domains", domainsListJson); + arr.put(manifestEntry); + + manifestFile.setAllChars((new JSONObject()).put("resourcePacks", arr).toString()); + + logger.info("Done!"); + return new EaglerFolderResourcePack(folderName, name, prefix, domainsList, timestamp); + } + + public static void loadRemoteResourcePack(String url, String hash, Consumer cb, Consumer ast, Runnable loading) { + if (!isSupported || !hash.matches("^[a-f0-9]{40}$")) { + cb.accept(null); + return; + } + final List lst = getFolderResourcePacks(SERVER_RESOURCE_PACKS); + for(int i = 0, l = lst.size(); i < l; ++i) { + EaglerFolderResourcePack rp = lst.get(i); + if(rp.resourcePackFile.equals(hash)) { + cb.accept(rp); + return; + } + } + PlatformRuntime.downloadRemoteURIByteArray(url, arr -> { + ast.accept(() -> { + if (arr == null) { + cb.accept(null); + return; + } + SHA1Digest digest = new SHA1Digest(); + digest.update(arr, 0, arr.length); + byte[] hashOut = new byte[20]; + digest.doFinal(hashOut, 0); + if(!hash.equals(ArrayUtils.hexString(hashOut))) { + logger.error("Downloaded resource pack hash does not equal expected resource pack hash!"); + cb.accept(null); + return; + } + if(lst.size() >= 5) { + lst.sort(Comparator.comparingLong(pack -> pack.timestamp)); + for(int i = 0; i < lst.size() - 5; i++) { + deleteResourcePack(SERVER_RESOURCE_PACKS, lst.get(i).resourcePackFile); + } + } + loading.run(); + try { + cb.accept(importResourcePack(hash, SERVER_RESOURCE_PACKS, arr)); + }catch(IOException ex) { + logger.error("Failed to load resource pack downloaded from server!"); + logger.error(ex); + cb.accept(null); + } + }); + }); + } + + public static void deleteResourcePack(EaglerFolderResourcePack pack) { + deleteResourcePack(pack.prefix, pack.resourcePackFile); + } + + public static void deleteResourcePack(String prefix, String name) { + if (!isSupported) { + return; + } + logger.info("Deleting resource pack: {}/{}", prefix, name); + (new VFile2(prefix, name)).listFiles(true).forEach(VFile2::delete); + VFile2 manifestFile = new VFile2(prefix, "manifest.json"); + String str = manifestFile.getAllChars(); + if(str != null) { + try { + JSONArray json = (new JSONObject(str)).getJSONArray("resourcePacks"); + boolean changed = false; + for(int i = 0, l = json.length(); i < l; ++i) { + if(json.getJSONObject(i).getString("folder").equals(name)) { + json.remove(i); + changed = true; + break; + } + } + if(changed) { + manifestFile.setAllChars((new JSONObject()).put("resourcePacks", json).toString()); + }else { + logger.warn("Failed to remove pack \"{}\" from manifest, it wasn't found in the list for some reason", name); + } + }catch(JSONException ex) { + } + } + } + + public static void deleteOldResourcePacks(String prefix, long maxAge) { + if (!isSupported) { + return; + } + long millis = System.currentTimeMillis(); + List lst = getFolderResourcePacks(prefix); + for(int i = 0, l = lst.size(); i < l; ++i) { + EaglerFolderResourcePack rp = lst.get(i); + if(millis - rp.timestamp > maxAge) { + deleteResourcePack(rp); + } + } + } +} diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerTextureAtlasSprite.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerTextureAtlasSprite.java index a929b0c..ef9f92a 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerTextureAtlasSprite.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/EaglerTextureAtlasSprite.java @@ -273,7 +273,8 @@ public class EaglerTextureAtlasSprite { public String call() throws Exception { StringBuilder stringbuilder = new StringBuilder(); - for (int[] aint1 : aint) { + for (int j = 0; j < aint.length; ++j) { + int[] aint1 = aint[j]; if (stringbuilder.length() > 0) { stringbuilder.append(", "); } diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/GuiScreenGenericErrorMessage.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/GuiScreenGenericErrorMessage.java new file mode 100644 index 0000000..f6fb104 --- /dev/null +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/minecraft/GuiScreenGenericErrorMessage.java @@ -0,0 +1,52 @@ +package net.lax1dude.eaglercraft.v1_8.minecraft; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +/** + * Copyright (c) 2024 lax1dude. 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 GuiScreenGenericErrorMessage extends GuiScreen { + + private String str1; + private String str2; + private GuiScreen cont; + + public GuiScreenGenericErrorMessage(String str1, String str2, GuiScreen cont) { + this.str1 = I18n.format(str1); + this.str2 = I18n.format(str2); + this.cont = cont; + } + + public void initGui() { + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 6 + 96, I18n.format("gui.done"))); + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(fontRendererObj, str1, this.width / 2, 70, 11184810); + this.drawCenteredString(fontRendererObj, str2, this.width / 2, 90, 16777215); + super.drawScreen(par1, par2, par3); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + this.mc.displayGuiScreen(cont); + } + } + +} diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/netty/ObjectUtil.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/netty/ObjectUtil.java index 6919c31..3c2c2e6 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/netty/ObjectUtil.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/netty/ObjectUtil.java @@ -53,8 +53,8 @@ public final class ObjectUtil { throw new NullPointerException(text); } - for (T element : varargs) { - if (element == null) { + for (int i = 0; i < varargs.length; ++i) { + if (varargs[i] == null) { throw new NullPointerException(text); } } diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/FixedFunctionPipeline.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/FixedFunctionPipeline.java index 41edaec..605bccf 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/FixedFunctionPipeline.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/FixedFunctionPipeline.java @@ -11,7 +11,6 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer; import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.internal.IBufferArrayGL; -import net.lax1dude.eaglercraft.v1_8.internal.IBufferGL; import net.lax1dude.eaglercraft.v1_8.internal.IProgramGL; import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedFontRenderer.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedFontRenderer.java index 07ffff3..eff5bd1 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedFontRenderer.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedFontRenderer.java @@ -202,7 +202,7 @@ public class InstancedFontRenderer { _wglVertexAttribDivisor(0, 0); EaglercraftGPU.bindGLArrayBuffer(instancesBuffer); - _wglBufferData(GL_ARRAY_BUFFER, fontDataBuffer.remaining(), GL_STATIC_DRAW); + _wglBufferData(GL_ARRAY_BUFFER, fontDataBuffer.remaining(), GL_STREAM_DRAW); _wglEnableVertexAttribArray(1); _wglVertexAttribPointer(1, 2, GL_SHORT, false, 10, 0); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedParticleRenderer.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedParticleRenderer.java index e4890d3..4307e41 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedParticleRenderer.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/InstancedParticleRenderer.java @@ -184,7 +184,7 @@ public class InstancedParticleRenderer { _wglVertexAttribDivisor(0, 0); EaglercraftGPU.bindGLArrayBuffer(instancesBuffer); - _wglBufferData(GL_ARRAY_BUFFER, particleBuffer.remaining(), GL_STATIC_DRAW); + _wglBufferData(GL_ARRAY_BUFFER, particleBuffer.remaining(), GL_STREAM_DRAW); _wglEnableVertexAttribArray(1); _wglVertexAttribPointer(1, 3, GL_FLOAT, false, 24, 0); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/SpriteLevelMixer.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/SpriteLevelMixer.java index 26c79cc..439b314 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/SpriteLevelMixer.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/SpriteLevelMixer.java @@ -4,8 +4,6 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; import net.lax1dude.eaglercraft.v1_8.EagRuntime; -import net.lax1dude.eaglercraft.v1_8.internal.IBufferArrayGL; -import net.lax1dude.eaglercraft.v1_8.internal.IBufferGL; import net.lax1dude.eaglercraft.v1_8.internal.IProgramGL; import net.lax1dude.eaglercraft.v1_8.internal.IShaderGL; import net.lax1dude.eaglercraft.v1_8.internal.IUniformGL; diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/EaglerDeferredPipeline.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/EaglerDeferredPipeline.java index c41ec7a..a1c2254 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/EaglerDeferredPipeline.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/EaglerDeferredPipeline.java @@ -380,7 +380,7 @@ public class EaglerDeferredPipeline { public void rebuild(EaglerDeferredConfig config) { destroy(); - DeferredStateManager.doCheckErrors = EagRuntime.getConfiguration().checkShaderGLErrors(); + DeferredStateManager.doCheckErrors = EagRuntime.getConfiguration().isCheckShaderGLErrors(); DeferredStateManager.checkGLError("Pre: rebuild pipeline"); this.config = config; this.currentWidth = -1; @@ -3302,7 +3302,7 @@ public class EaglerDeferredPipeline { GlStateManager.bindTexture(bloomVBlurTexture); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GL_CONSTANT_ALPHA, GL_ONE, GL_ZERO, GL_ONE); - GlStateManager.setBlendConstants(0.0f, 0.0f, 0.0f, 0.25f); + GlStateManager.setBlendConstants(0.0f, 0.0f, 0.0f, 0.15f); TextureCopyUtil.blitTexture(); GlStateManager.disableBlend(); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ForwardAcceleratedEffectRenderer.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ForwardAcceleratedEffectRenderer.java index da1deb0..b272b48 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ForwardAcceleratedEffectRenderer.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/ForwardAcceleratedEffectRenderer.java @@ -12,7 +12,6 @@ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program.PipelineShaderAccelParticleForward; -import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program.PipelineShaderAccelParticleGBuffer; import net.lax1dude.eaglercraft.v1_8.vector.Matrix4f; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; @@ -92,7 +91,7 @@ public class ForwardAcceleratedEffectRenderer extends AbstractAcceleratedEffectR _wglVertexAttribDivisor(0, 0); EaglercraftGPU.bindGLArrayBuffer(instancesBuffer); - _wglBufferData(GL_ARRAY_BUFFER, particleBuffer.remaining(), GL_STATIC_DRAW); + _wglBufferData(GL_ARRAY_BUFFER, particleBuffer.remaining(), GL_STREAM_DRAW); _wglEnableVertexAttribArray(1); _wglVertexAttribPointer(1, 3, GL_FLOAT, false, 24, 0); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferAcceleratedEffectRenderer.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferAcceleratedEffectRenderer.java index 77ebb69..691080f 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferAcceleratedEffectRenderer.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/GBufferAcceleratedEffectRenderer.java @@ -91,7 +91,7 @@ public class GBufferAcceleratedEffectRenderer extends AbstractAcceleratedEffectR _wglVertexAttribDivisor(0, 0); EaglercraftGPU.bindGLArrayBuffer(instancesBuffer); - _wglBufferData(GL_ARRAY_BUFFER, particleBuffer.remaining(), GL_STATIC_DRAW); + _wglBufferData(GL_ARRAY_BUFFER, particleBuffer.remaining(), GL_STREAM_DRAW); _wglEnableVertexAttribArray(1); _wglVertexAttribPointer(1, 3, GL_FLOAT, false, 24, 0); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/LensFlareMeshRenderer.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/LensFlareMeshRenderer.java index 8a44278..d258636 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/LensFlareMeshRenderer.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/LensFlareMeshRenderer.java @@ -4,12 +4,11 @@ import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import static net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.ExtGLEnums.*; -import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import net.lax1dude.eaglercraft.v1_8.EagRuntime; -import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; import net.lax1dude.eaglercraft.v1_8.internal.IBufferArrayGL; import net.lax1dude.eaglercraft.v1_8.internal.IBufferGL; import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer; @@ -162,7 +161,7 @@ public class LensFlareMeshRenderer { if(flareTex == null) { throw new RuntimeException("Could not locate: " + streaksTextureLocation); } - try(DataInputStream dis = new DataInputStream(new ByteArrayInputStream(flareTex))) { + try(DataInputStream dis = new DataInputStream(new EaglerInputStream(flareTex))) { loadFlareTexture(copyBuffer, dis); }catch(IOException ex) { EagRuntime.freeByteBuffer(copyBuffer); @@ -175,7 +174,7 @@ public class LensFlareMeshRenderer { if(flareTex == null) { throw new RuntimeException("Could not locate: " + ghostsTextureLocation); } - try(DataInputStream dis = new DataInputStream(new ByteArrayInputStream(flareTex))) { + try(DataInputStream dis = new DataInputStream(new EaglerInputStream(flareTex))) { loadFlareTexture(copyBuffer, dis); }catch(IOException ex) { EagRuntime.freeByteBuffer(copyBuffer); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EaglerTextureAtlasSpritePBR.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EaglerTextureAtlasSpritePBR.java index 399682a..b095929 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EaglerTextureAtlasSpritePBR.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/EaglerTextureAtlasSpritePBR.java @@ -14,7 +14,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.minecraft.TextureAnimationCache; -import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.ImageData; import net.minecraft.client.renderer.texture.TextureUtil; import net.minecraft.client.resources.data.AnimationFrame; @@ -187,11 +186,12 @@ public class EaglerTextureAtlasSpritePBR extends EaglerTextureAtlasSprite { public String call() throws Exception { StringBuilder stringbuilder = new StringBuilder(); - for (int[] aint1 : aint) { + for (int k = 0; k < aint.length; ++k) { if (stringbuilder.length() > 0) { stringbuilder.append(", "); } + int[] aint1 = aint[k]; stringbuilder.append(aint1 == null ? "null" : Integer.valueOf(aint1.length)); } diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/PBRTextureMapUtils.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/PBRTextureMapUtils.java index 8e12b0b..2e4b77d 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/PBRTextureMapUtils.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/PBRTextureMapUtils.java @@ -46,7 +46,8 @@ public class PBRTextureMapUtils { } try { List ress = resMgr.getAllResources(new ResourceLocation(domain, fname)); - for(IResource res : ress) { + for(int k = 0, l = ress.size(); k < l; ++k) { + IResource res = ress.get(k); if(res.getResourcePackName().equals(resourcePack)) { ImageData toRet = TextureUtil.readBufferedImage(res.getInputStream()); if(ext.equals("_s")) { diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureClockPBRImpl.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureClockPBRImpl.java index b421a24..620ad6d 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureClockPBRImpl.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureClockPBRImpl.java @@ -1,7 +1,6 @@ package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.texture; import net.lax1dude.eaglercraft.v1_8.internal.IFramebufferGL; -import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.minecraft.client.Minecraft; import net.minecraft.util.MathHelper; diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureCompassPBRImpl.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureCompassPBRImpl.java index 1329348..b4ac23a 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureCompassPBRImpl.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/opengl/ext/deferred/texture/TextureCompassPBRImpl.java @@ -1,7 +1,6 @@ package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.texture; import net.lax1dude.eaglercraft.v1_8.internal.IFramebufferGL; -import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.minecraft.client.Minecraft; import net.minecraft.util.BlockPos; import net.minecraft.util.MathHelper; diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/EaglerProfile.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/EaglerProfile.java index 8169db4..2a6e212 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/EaglerProfile.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/EaglerProfile.java @@ -1,17 +1,16 @@ package net.lax1dude.eaglercraft.v1_8.profile; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; 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.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.minecraft.client.Minecraft; import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.ResourceLocation; @@ -148,8 +147,10 @@ public class EaglerProfile { } public static void read() { - byte[] profileStorage = EagRuntime.getStorage("p"); + read(EagRuntime.getStorage("p")); + } + public static void read(byte[] profileStorage) { if (profileStorage == null) { return; } @@ -207,7 +208,7 @@ public class EaglerProfile { } - public static void write() { + public static byte[] write() { NBTTagCompound profile = new NBTTagCompound(); profile.setInteger("presetSkin", presetSkinId); profile.setInteger("customSkin", customSkinId); @@ -222,13 +223,20 @@ public class EaglerProfile { skinsList.appendTag(skin); } profile.setTag("skins", skinsList); - ByteArrayOutputStream bao = new ByteArrayOutputStream(); + EaglerOutputStream bao = new EaglerOutputStream(); try { CompressedStreamTools.writeCompressed(profile, bao); } catch (IOException e) { - return; + return null; + } + return bao.toByteArray(); + } + + public static void save() { + byte[] b = write(); + if(b != null) { + EagRuntime.setStorage("p", b); } - EagRuntime.setStorage("p", bao.toByteArray()); } static { diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenEditProfile.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenEditProfile.java index fe27b62..ac9f393 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenEditProfile.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenEditProfile.java @@ -3,13 +3,16 @@ package net.lax1dude.eaglercraft.v1_8.profile; import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.Keyboard; import net.lax1dude.eaglercraft.v1_8.Mouse; +import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType; import net.lax1dude.eaglercraft.v1_8.internal.FileChooserResult; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.ImageData; +import net.minecraft.client.audio.PositionedSoundRecord; 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.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; @@ -162,6 +165,23 @@ public class GuiScreenEditProfile extends GuiScreen { drawRect(skinX + skinWidth - 4, skinY + scrollerPos + 1, skinX + skinWidth - 1, skinY + scrollerPos + scrollerSize, 0xff888888); } + if(!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 = mx > 1 && my > 1 && mx < (w * 3 / 4) + 7 && my < 12; + if(hover) { + Mouse.showCursor(EnumCursorType.HAND); + } + + drawString(mc.fontRendererObj, EnumChatFormatting.UNDERLINE + text, 5, 5, hover ? 0xFFEEEE22 : 0xFFCCCCCC); + + GlStateManager.popMatrix(); + } + int xx = width / 2 - 80; int yy = height / 6 + 130; int numberOfCustomSkins = EaglerProfile.customSkins.size(); @@ -370,6 +390,15 @@ public class GuiScreenEditProfile extends GuiScreen { super.mouseClicked(mx, my, button); usernameField.mouseClicked(mx, my, button); if (button == 0) { + if(!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)); + return; + } + } + if(newSkinWaitSteveOrAlex) { int skinX = width / 2 - 90; int skinY = height / 4; @@ -459,7 +488,7 @@ public class GuiScreenEditProfile extends GuiScreen { name = name.substring(0, 16); } EaglerProfile.setName(name); - EaglerProfile.write(); + EaglerProfile.save(); } } diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenExportProfile.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenExportProfile.java new file mode 100644 index 0000000..e2fd9d0 --- /dev/null +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenExportProfile.java @@ -0,0 +1,90 @@ +package net.lax1dude.eaglercraft.v1_8.profile; + +import java.io.IOException; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack; +import net.lax1dude.eaglercraft.v1_8.minecraft.GuiScreenGenericErrorMessage; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +/** + * Copyright (c) 2024 lax1dude. 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 GuiScreenExportProfile extends GuiScreen { + + private GuiScreen back; + + private GuiButton exportProfile; + private boolean doExportProfile = true; + private GuiButton exportSettings; + private boolean doExportSettings = true; + private GuiButton exportServers; + private boolean doExportServers = true; + private GuiButton exportResourcePacks; + private boolean doExportResourcePacks = false; + + public GuiScreenExportProfile(GuiScreen back) { + this.back = back; + } + + public void initGui() { + this.buttonList.add(exportProfile = new GuiButton(2, this.width / 2 - 100, this.height / 4, I18n.format("settingsBackup.export.option.profile") + " " + I18n.format(doExportProfile ? "gui.yes" : "gui.no"))); + this.buttonList.add(exportSettings = new GuiButton(3, this.width / 2 - 100, this.height / 4 + 25, I18n.format("settingsBackup.export.option.settings") + " " + I18n.format(doExportSettings ? "gui.yes" : "gui.no"))); + this.buttonList.add(exportServers = new GuiButton(4, this.width / 2 - 100, this.height / 4 + 50, I18n.format("settingsBackup.export.option.servers") + " " + I18n.format(doExportServers ? "gui.yes" : "gui.no"))); + this.buttonList.add(exportResourcePacks = new GuiButton(5, this.width / 2 - 100, this.height / 4 + 75, I18n.format("settingsBackup.export.option.resourcePacks") + " " + I18n.format(doExportResourcePacks ? "gui.yes" : "gui.no"))); + exportResourcePacks.enabled = EaglerFolderResourcePack.isSupported(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 115, I18n.format("settingsBackup.export.option.export"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 140, I18n.format("gui.cancel"))); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + if(!doExportProfile && !doExportSettings && !doExportServers && !doExportResourcePacks) { + mc.displayGuiScreen(back); + }else { + mc.loadingScreen.eaglerShow(I18n.format("settingsBackup.exporting.1"), I18n.format("settingsBackup.exporting.2")); + try { + ProfileExporter.exportProfileAndSettings(doExportProfile, doExportSettings, doExportServers, doExportResourcePacks); + mc.displayGuiScreen(back); + } catch (IOException e) { + EagRuntime.debugPrintStackTrace(e); + mc.displayGuiScreen(new GuiScreenGenericErrorMessage("settingsBackup.exporting.failed.1", "settingsBackup.exporting.failed.2", back)); + } + } + }else if(par1GuiButton.id == 1) { + mc.displayGuiScreen(back); + }else if(par1GuiButton.id == 2) { + doExportProfile = !doExportProfile; + exportProfile.displayString = I18n.format("settingsBackup.export.option.profile") + " " + I18n.format(doExportProfile ? "gui.yes" : "gui.no"); + }else if(par1GuiButton.id == 3) { + doExportSettings = !doExportSettings; + exportSettings.displayString = I18n.format("settingsBackup.export.option.settings") + " " + I18n.format(doExportSettings ? "gui.yes" : "gui.no"); + }else if(par1GuiButton.id == 4) { + doExportServers = !doExportServers; + exportServers.displayString = I18n.format("settingsBackup.export.option.servers") + " " + I18n.format(doExportServers ? "gui.yes" : "gui.no"); + }else if(par1GuiButton.id == 5) { + doExportResourcePacks = !doExportResourcePacks; + exportResourcePacks.displayString = I18n.format("settingsBackup.export.option.resourcePacks") + " " + I18n.format(doExportResourcePacks ? "gui.yes" : "gui.no"); + } + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("settingsBackup.export.title"), this.width / 2, this.height / 4 - 25, 16777215); + super.drawScreen(par1, par2, par3); + } +} diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenImportExportProfile.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenImportExportProfile.java new file mode 100644 index 0000000..e709d2d --- /dev/null +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenImportExportProfile.java @@ -0,0 +1,78 @@ +package net.lax1dude.eaglercraft.v1_8.profile; + +import java.io.IOException; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.FileChooserResult; +import net.lax1dude.eaglercraft.v1_8.minecraft.GuiScreenGenericErrorMessage; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +/** + * Copyright (c) 2024 lax1dude. 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 GuiScreenImportExportProfile extends GuiScreen { + + private GuiScreen back; + private boolean waitingForFile = false; + + public GuiScreenImportExportProfile(GuiScreen back) { + this.back = back; + } + + public void initGui() { + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 40, I18n.format("settingsBackup.importExport.import"))); + this.buttonList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 65, I18n.format("settingsBackup.importExport.export"))); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 130, I18n.format("gui.cancel"))); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + mc.displayGuiScreen(back); + }else if(par1GuiButton.id == 1) { + waitingForFile = true; + EagRuntime.displayFileChooser(null, "epk"); + }else if(par1GuiButton.id == 2) { + mc.displayGuiScreen(new GuiScreenExportProfile(back)); + } + } + + public void updateScreen() { + if(waitingForFile && EagRuntime.fileChooserHasResult()) { + waitingForFile = false; + FileChooserResult result = EagRuntime.getFileChooserResult(); + if(result != null) { + mc.loadingScreen.eaglerShow(I18n.format("settingsBackup.importing.1"), "settingsBackup.importing.2"); + try { + ProfileImporter importer = new ProfileImporter(result.fileData); + importer.readHeader(); + mc.displayGuiScreen(new GuiScreenImportProfile(importer, back)); + }catch(IOException ex) { + EagRuntime.debugPrintStackTrace(ex); + mc.displayGuiScreen(new GuiScreenGenericErrorMessage("settingsBackup.importing.failed.1", "settingsBackup.importing.failed.2", back)); + } + } + } + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + + this.drawCenteredString(this.fontRendererObj, I18n.format("settingsBackup.importExport.title"), this.width / 2, this.height / 4, 16777215); + + super.drawScreen(par1, par2, par3); + } +} diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenImportProfile.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenImportProfile.java new file mode 100644 index 0000000..2c21f7c --- /dev/null +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/GuiScreenImportProfile.java @@ -0,0 +1,111 @@ +package net.lax1dude.eaglercraft.v1_8.profile; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack; +import net.lax1dude.eaglercraft.v1_8.minecraft.GuiScreenGenericErrorMessage; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.ResourcePackRepository; + +/** + * Copyright (c) 2024 lax1dude. 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 GuiScreenImportProfile extends GuiScreen { + + private GuiScreen back; + private ProfileImporter importer; + + private GuiButton importProfile; + private boolean doImportProfile; + private GuiButton importSettings; + private boolean doImportSettings; + private GuiButton importServers; + private boolean doImportServers; + private GuiButton importResourcePacks; + private boolean doImportResourcePacks; + + public GuiScreenImportProfile(ProfileImporter importer, GuiScreen back) { + this.back = back; + this.importer = importer; + this.doImportProfile = importer.hasProfile(); + this.doImportSettings = importer.hasSettings(); + this.doImportServers = importer.hasSettings(); + this.doImportResourcePacks = importer.hasResourcePacks(); + } + + public void initGui() { + this.buttonList.add(importProfile = new GuiButton(2, this.width / 2 - 100, this.height / 4, I18n.format("settingsBackup.import.option.profile") + " " + I18n.format(doImportProfile ? "gui.yes" : "gui.no"))); + importProfile.enabled = importer.hasProfile(); + this.buttonList.add(importSettings = new GuiButton(3, this.width / 2 - 100, this.height / 4 + 25, I18n.format("settingsBackup.import.option.settings") + " " + I18n.format(doImportSettings ? "gui.yes" : "gui.no"))); + importSettings.enabled = importer.hasProfile(); + this.buttonList.add(importServers = new GuiButton(4, this.width / 2 - 100, this.height / 4 + 50, I18n.format("settingsBackup.import.option.servers") + " " + I18n.format(doImportServers ? "gui.yes" : "gui.no"))); + importServers.enabled = importer.hasServers(); + this.buttonList.add(importResourcePacks = new GuiButton(5, this.width / 2 - 100, this.height / 4 + 75, I18n.format("settingsBackup.import.option.resourcePacks") + " " + I18n.format(doImportResourcePacks ? "gui.yes" : "gui.no"))); + importResourcePacks.enabled = importer.hasResourcePacks() && EaglerFolderResourcePack.isSupported(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 115, I18n.format("settingsBackup.import.option.import"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 140, I18n.format("gui.cancel"))); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 0) { + if(!doImportProfile && !doImportSettings && !doImportServers && !doImportResourcePacks) { + mc.displayGuiScreen(back); + }else { + mc.loadingScreen.eaglerShow(I18n.format("settingsBackup.importing.1"), I18n.format("settingsBackup.importing.2")); + try { + List list1 = new ArrayList(mc.gameSettings.resourcePacks); + List list2 = new ArrayList(mc.gameSettings.field_183018_l); + importer.importProfileAndSettings(doImportProfile, doImportSettings, doImportServers, doImportResourcePacks); + boolean resourcePacksChanged = !mc.gameSettings.resourcePacks.equals(list1) || !mc.gameSettings.field_183018_l.equals(list2); + if(resourcePacksChanged || (doImportResourcePacks && (list1.size() > 0 || list2.size() > 0))) { + mc.loadingScreen.eaglerShow(I18n.format("resourcePack.load.refreshing"), + I18n.format("resourcePack.load.pleaseWait")); + mc.getResourcePackRepository().reconstruct(mc.gameSettings); + mc.refreshResources(); + } + mc.displayGuiScreen(back); + } catch (IOException e) { + EagRuntime.debugPrintStackTrace(e); + mc.displayGuiScreen(new GuiScreenGenericErrorMessage("settingsBackup.importing.failed.1", "settingsBackup.importing.failed.2", back)); + } + } + }else if(par1GuiButton.id == 1) { + mc.displayGuiScreen(back); + }else if(par1GuiButton.id == 2) { + doImportProfile = !doImportProfile; + importProfile.displayString = I18n.format("settingsBackup.import.option.profile") + " " + I18n.format(doImportProfile ? "gui.yes" : "gui.no"); + }else if(par1GuiButton.id == 3) { + doImportSettings = !doImportSettings; + importSettings.displayString = I18n.format("settingsBackup.import.option.settings") + " " + I18n.format(doImportSettings ? "gui.yes" : "gui.no"); + }else if(par1GuiButton.id == 4) { + doImportServers = !doImportServers; + importServers.displayString = I18n.format("settingsBackup.import.option.servers") + " " + I18n.format(doImportServers ? "gui.yes" : "gui.no"); + }else if(par1GuiButton.id == 5) { + doImportResourcePacks = !doImportResourcePacks; + importResourcePacks.displayString = I18n.format("settingsBackup.import.option.resourcePacks") + " " + I18n.format(doImportResourcePacks ? "gui.yes" : "gui.no"); + } + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("settingsBackup.import.title"), this.width / 2, this.height / 4 - 25, 16777215); + super.drawScreen(par1, par2, par3); + } +} diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/ProfileExporter.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/ProfileExporter.java new file mode 100644 index 0000000..c309239 --- /dev/null +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/ProfileExporter.java @@ -0,0 +1,195 @@ +package net.lax1dude.eaglercraft.v1_8.profile; + +import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.zip.CRC32; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream; +import net.lax1dude.eaglercraft.v1_8.EaglerZLIB; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +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.sp.relay.RelayManager; +import net.lax1dude.eaglercraft.v1_8.update.UpdateCertificate; +import net.lax1dude.eaglercraft.v1_8.update.UpdateService; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerList; + +import static net.lax1dude.eaglercraft.v1_8.sp.server.export.EPKCompiler.*; + +/** + * Copyright (c) 2024 lax1dude. 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 ProfileExporter { + + private static final Logger logger = LogManager.getLogger("ProfileExporter"); + + public static void exportProfileAndSettings(boolean doExportProfile, boolean doExportSettings, + boolean doExportServers, boolean doExportResourcePacks) throws IOException { + doExportResourcePacks &= EaglerFolderResourcePack.isSupported(); + EaglerOutputStream osb = new EaglerOutputStream(); + osb.write(new byte[]{(byte)69,(byte)65,(byte)71,(byte)80,(byte)75,(byte)71,(byte)36,(byte)36}); // EAGPKG$$ + osb.write(new byte[]{(byte)6,(byte)118,(byte)101,(byte)114,(byte)50,(byte)46,(byte)48}); // 6 + ver2.0 + Date d = new Date(); + + byte[] filename = "profile.epk".getBytes(StandardCharsets.UTF_8); + osb.write(filename.length); + osb.write(filename); + + byte[] comment = ("\n\n # Eaglercraft profile backup - \"" + EaglerProfile.getName() + "\"" + + "\n # Contains: " + (doExportProfile ? "profile " : "") + (doExportSettings ? "settings " : "") + + (doExportServers ? "servers " : "") + (doExportResourcePacks ? "resourcePacks" : "") + "\n\n") + .getBytes(StandardCharsets.UTF_8); + + osb.write((comment.length >> 8) & 255); + osb.write(comment.length & 255); + osb.write(comment); + + writeLong(d.getTime(), osb); + + int lengthIntegerOffset = osb.size(); + osb.write(new byte[]{(byte)255,(byte)255,(byte)255,(byte)255}); // this will be replaced with the file count + + osb.write('G'); + OutputStream os = EaglerZLIB.newGZIPOutputStream(osb); + + os.write(new byte[]{(byte)72,(byte)69,(byte)65,(byte)68}); // HEAD + os.write(new byte[]{(byte)9,(byte)102,(byte)105,(byte)108,(byte)101,(byte)45,(byte)116,(byte)121, + (byte)112,(byte)101}); // 9 + file-type + os.write(new byte[]{(byte)0,(byte)0,(byte)0,(byte)14,(byte)101,(byte)112,(byte)107,(byte)47,(byte)112,(byte)114,(byte)111, + (byte)102,(byte)105,(byte)108,(byte)101,(byte)49,(byte)56,(byte)56}); // 14 + epk/profile188 + os.write('>'); + + os.write(new byte[]{(byte)72,(byte)69,(byte)65,(byte)68}); // HEAD + os.write(new byte[]{(byte)12,(byte)102,(byte)105,(byte)108,(byte)101,(byte)45,(byte)101,(byte)120, + (byte)112,(byte)111,(byte)114,(byte)116,(byte)115,(byte)0,(byte)0,(byte)0,(byte)1}); // 12 + file-exports + 1 + os.write((doExportProfile ? 1 : 0) | (doExportSettings ? 2 : 0) | (doExportServers ? 4 : 0) | (doExportResourcePacks ? 8 : 0)); + os.write('>'); + + int fileCount = 2; + + if(doExportProfile) { + byte[] profileData = EaglerProfile.write(); + if(profileData == null) { + throw new IOException("Could not write profile data!"); + } + exportFileToEPK("_eaglercraftX.p", profileData, os); + ++fileCount; + } + + if(doExportSettings) { + logger.info("Exporting game settings..."); + byte[] gameSettings = Minecraft.getMinecraft().gameSettings.writeOptions(); + if(gameSettings == null) { + throw new IOException("Could not write game settings!"); + } + exportFileToEPK("_eaglercraftX.g", gameSettings, os); + ++fileCount; + logger.info("Exporting relay settings..."); + byte[] relays = RelayManager.relayManager.write(); + if(relays == null) { + throw new IOException("Could not write relay settings!"); + } + exportFileToEPK("_eaglercraftX.r", relays, os); + ++fileCount; + } + + if(doExportServers) { + logger.info("Exporting server list..."); + byte[] servers = ServerList.getServerList().writeServerList(); + if(servers == null) { + throw new IOException("Could not write server list!"); + } + exportFileToEPK("_eaglercraftX.s", servers, os); + ++fileCount; + } + + logger.info("Exporting certificates..."); + UpdateCertificate cert = UpdateService.getClientCertificate(); + if(cert != null) { + exportFileToEPK("certs/main.cert", cert.rawCertData, os); + ++fileCount; + } + Collection updatesExport = UpdateService.getAvailableUpdates(); + int cc = 0; + for(UpdateCertificate cert2 : updatesExport) { + exportFileToEPK("certs/c" + (cc++) + ".cert", cert2.rawCertData, os); + ++fileCount; + } + + if(doExportResourcePacks) { + logger.info("Exporting resource packs..."); + byte[] packManifest = (new VFile2(EaglerFolderResourcePack.RESOURCE_PACKS + "/manifest.json")).getAllBytes(); + if(packManifest != null) { + exportFileToEPK(EaglerFolderResourcePack.RESOURCE_PACKS + "/manifest.json", packManifest, os); + ++fileCount; + VFile2 baseDir = new VFile2(EaglerFolderResourcePack.RESOURCE_PACKS); + List files = baseDir.listFiles(true); + logger.info("({} files to export)", files.size()); + for(int i = 0, l = files.size(); i < l; ++i) { + VFile2 f = files.get(i); + if(f.getPath().equals(EaglerFolderResourcePack.RESOURCE_PACKS + "/manifest.json")) { + continue; + } + exportFileToEPK(f.getPath(), f.getAllBytes(), os); + ++fileCount; + if(i > 0 && i % 100 == 0) { + logger.info("Exported {} files", i); + } + } + } + } + + os.write(new byte[]{(byte)69,(byte)78,(byte)68,(byte)36}); // END$ + os.close(); + + osb.write(new byte[]{(byte)58,(byte)58,(byte)58,(byte)89,(byte)69,(byte)69,(byte)58,(byte)62}); // :::YEE:> + + byte[] ret = osb.toByteArray(); + + ret[lengthIntegerOffset] = (byte)((fileCount >> 24) & 0xFF); + ret[lengthIntegerOffset + 1] = (byte)((fileCount >> 16) & 0xFF); + ret[lengthIntegerOffset + 2] = (byte)((fileCount >> 8) & 0xFF); + ret[lengthIntegerOffset + 3] = (byte)(fileCount & 0xFF); + + logger.info("Export complete!"); + + EagRuntime.downloadFileWithName(EaglerProfile.getName() + "-backup.epk", ret); + } + + private static void exportFileToEPK(String name, byte[] contents, OutputStream os) throws IOException { + CRC32 checkSum = new CRC32(); + checkSum.update(contents); + long sum = checkSum.getValue(); + + os.write(new byte[]{(byte)70,(byte)73,(byte)76,(byte)69}); // FILE + + byte[] nameBytes = name.getBytes(StandardCharsets.UTF_8); + os.write(nameBytes.length); + os.write(nameBytes); + writeInt(contents.length + 5, os); + writeInt((int)sum, os); + + os.write(contents); + os.write(':'); + os.write('>'); + } +} diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/ProfileImporter.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/ProfileImporter.java new file mode 100644 index 0000000..e626b69 --- /dev/null +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/profile/ProfileImporter.java @@ -0,0 +1,151 @@ +package net.lax1dude.eaglercraft.v1_8.profile; + +import java.io.IOException; + +import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; +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.sp.relay.RelayManager; +import net.lax1dude.eaglercraft.v1_8.sp.server.export.EPKDecompiler; +import net.lax1dude.eaglercraft.v1_8.sp.server.export.EPKDecompiler.FileEntry; +import net.lax1dude.eaglercraft.v1_8.update.UpdateService; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerList; + +/** + * Copyright (c) 2024 lax1dude. 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 ProfileImporter { + + private static final Logger logger = LogManager.getLogger("ProfileImporter"); + + private byte[] data; + private EPKDecompiler epkDecompiler; + private boolean headerHasProfile; + private boolean headerHasSettings; + private boolean headerHasServers; + private boolean headerHasResourcePacks; + + public ProfileImporter(byte[] data) { + this.data = data; + } + + public void readHeader() throws IOException { + logger.info("Reading EPK file header..."); + epkDecompiler = new EPKDecompiler(data); + + FileEntry etr = epkDecompiler.readFile(); + if (etr == null || !etr.type.equals("HEAD") || !etr.name.equals("file-type") + || !EPKDecompiler.readASCII(etr.data).equals("epk/profile188")) { + throw new IOException("EPK file is not a profile backup!"); + } + + etr = epkDecompiler.readFile(); + if (etr == null || !etr.type.equals("HEAD") || !etr.name.equals("file-exports") || etr.data.length != 1) { + throw new IOException("EPK file is not a profile backup!"); + } + + headerHasProfile = (etr.data[0] & 1) != 0; + headerHasSettings = (etr.data[0] & 2) != 0; + headerHasServers = (etr.data[0] & 4) != 0; + headerHasResourcePacks = (etr.data[0] & 8) != 0; + } + + public boolean hasProfile() { + return headerHasProfile; + } + + public boolean hasSettings() { + return headerHasSettings; + } + + public boolean hasServers() { + return headerHasServers; + } + + public boolean hasResourcePacks() { + return headerHasResourcePacks; + } + + /** + * Note: this function is sensitive to the order file appear in the EPK + */ + public void importProfileAndSettings(boolean doImportProfile, boolean doImportSettings, + boolean doImportServers, boolean doImportResourcePacks) throws IOException { + doImportProfile &= headerHasProfile; + doImportSettings &= headerHasSettings; + doImportServers &= headerHasServers; + doImportResourcePacks &= headerHasResourcePacks && EaglerFolderResourcePack.isSupported(); + FileEntry etr; + vigg: while((etr = epkDecompiler.readFile()) != null) { + if(etr.type.equals("FILE")) { + switch(etr.name) { + case "_eaglercraftX.p": + if(doImportProfile) { + logger.info("Importing profile..."); + EaglerProfile.read(etr.data); + EagRuntime.setStorage("p", etr.data); + } + break; + case "_eaglercraftX.g": + if(doImportSettings) { + logger.info("Importing settings..."); + Minecraft.getMinecraft().gameSettings.loadOptions(etr.data); + EagRuntime.setStorage("g", etr.data); + } + break; + case "_eaglercraftX.r": + if(doImportSettings) { + logger.info("Importing relays..."); + RelayManager.relayManager.load(etr.data); + EagRuntime.setStorage("r", etr.data); + } + break; + case "_eaglercraftX.s": + if(doImportServers) { + logger.info("Importing servers..."); + ServerList.getServerList().loadServerList(etr.data); + EagRuntime.setStorage("s", etr.data); + } + break; + default: + if(etr.name.startsWith("certs/")) { + UpdateService.addCertificateToSet(etr.data); + }else if(etr.name.startsWith(EaglerFolderResourcePack.RESOURCE_PACKS + "/")) { + if(doImportResourcePacks) { + logger.info("Deleting old resource packs..."); + (new VFile2(EaglerFolderResourcePack.RESOURCE_PACKS)).listFiles(true).forEach(VFile2::delete); + logger.info("Importing resource packs..."); + int counter = 0; + do { + if(etr.name.startsWith(EaglerFolderResourcePack.RESOURCE_PACKS + "/")) { + (new VFile2(etr.name)).setAllBytes(etr.data); + if(++counter % 100 == 0) { + logger.info("Imported {} files", counter); + } + } + }while((etr = epkDecompiler.readFile()) != null); + } + break vigg; + } + break; + } + } + } + logger.info("Import complete!"); + } +} diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/socket/ConnectionHandshake.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/socket/ConnectionHandshake.java index 69f681d..b51965b 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/socket/ConnectionHandshake.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/socket/ConnectionHandshake.java @@ -1,6 +1,5 @@ package net.lax1dude.eaglercraft.v1_8.socket; -import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; @@ -8,6 +7,7 @@ import java.nio.charset.StandardCharsets; import net.lax1dude.eaglercraft.v1_8.ArrayUtils; import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; +import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; import net.lax1dude.eaglercraft.v1_8.crypto.SHA256Digest; @@ -56,7 +56,7 @@ public class ConnectionHandshake { try { pluginVersion = null; pluginBrand = null; - ByteArrayOutputStream bao = new ByteArrayOutputStream(); + EaglerOutputStream bao = new EaglerOutputStream(); DataOutputStream d = new DataOutputStream(bao); d.writeByte(HandshakePacketTypes.PROTOCOL_CLIENT_VERSION); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/socket/EaglercraftNetworkManager.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/socket/EaglercraftNetworkManager.java index 53ff513..1fe7e64 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/socket/EaglercraftNetworkManager.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/socket/EaglercraftNetworkManager.java @@ -91,7 +91,8 @@ public class EaglercraftNetworkManager { return; } - for(byte[] next : pkts) { + for(int i = 0, l = pkts.size(); i < l; ++i) { + byte[] next = pkts.get(i); ++debugPacketCounter; try { ByteBuf nettyBuffer = Unpooled.buffer(next, next.length); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/SingleplayerServerController.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/SingleplayerServerController.java index 2ac1082..9d02b25 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/SingleplayerServerController.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/SingleplayerServerController.java @@ -12,17 +12,14 @@ import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC; import org.apache.commons.lang3.StringUtils; import net.lax1dude.eaglercraft.v1_8.EagRuntime; -import net.lax1dude.eaglercraft.v1_8.EaglercraftSoundManager; import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState; import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData; import net.lax1dude.eaglercraft.v1_8.internal.PlatformApplication; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.profile.EaglerProfile; -import net.lax1dude.eaglercraft.v1_8.socket.EaglercraftNetworkManager; import net.lax1dude.eaglercraft.v1_8.sp.internal.ClientPlatformSingleplayer; import net.lax1dude.eaglercraft.v1_8.sp.ipc.*; -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; @@ -475,7 +472,8 @@ public class SingleplayerServerController implements ISaveFormat { private static void loadSaveComparators() { saveListMap.clear(); saveListCache.clear(); - for(NBTTagCompound nbt : saveListNBT) { + for(int j = 0, l = saveListNBT.size(); j < l; ++j) { + NBTTagCompound nbt = saveListNBT.get(j); String folderName = nbt.getString("folderNameEagler"); if(!StringUtils.isEmpty(folderName)) { WorldInfo worldinfo = new WorldInfo(nbt.getCompoundTag("Data")); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenBackupWorldSelection.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenBackupWorldSelection.java index 11ed8cc..80051fc 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenBackupWorldSelection.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenBackupWorldSelection.java @@ -118,7 +118,7 @@ public class GuiScreenBackupWorldSelection extends GuiScreen { public void confirmClicked(boolean par1, int par2) { if(par1) { SingleplayerServerController.clearPlayerData(worldName); - this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.clearplayers", "singleplayer.failed.clearplayers", () -> SingleplayerServerController.isReady())); + this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.clearplayers", "singleplayer.failed.clearplayers", SingleplayerServerController::isReady)); }else { mc.displayGuiScreen(this); } diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenConnectOption.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenConnectOption.java index 83d5329..aee6c5e 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenConnectOption.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenConnectOption.java @@ -46,11 +46,13 @@ public class GuiScreenConnectOption extends GuiScreen { protected void actionPerformed(GuiButton par1GuiButton) { if(par1GuiButton.id == 0) { + guiScreen.cancelDirectConnect(); mc.displayGuiScreen(guiScreen); }else if(par1GuiButton.id == 1) { mc.displayGuiScreen(new GuiScreenServerList(guiScreen, guiScreen.getSelectedServer())); }else if(par1GuiButton.id == 2) { if(LANServerController.supported()) { + guiScreen.cancelDirectConnect(); mc.displayGuiScreen(GuiScreenLANInfo.showLANInfoScreen(new GuiScreenLANConnect(guiScreen))); }else { mc.displayGuiScreen(new GuiScreenLANNotSupported(this)); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenDemoPlayWorldSelection.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenDemoPlayWorldSelection.java index 5cf47ee..042e8e2 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenDemoPlayWorldSelection.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenDemoPlayWorldSelection.java @@ -2,7 +2,6 @@ package net.lax1dude.eaglercraft.v1_8.sp.gui; import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiCreateWorld; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.I18n; import net.minecraft.world.demo.DemoWorldServer; diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenNameWorldImport.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenNameWorldImport.java index 264238c..eded766 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenNameWorldImport.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiScreenNameWorldImport.java @@ -1,7 +1,5 @@ package net.lax1dude.eaglercraft.v1_8.sp.gui; -import org.apache.commons.lang3.StringUtils; - import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.Keyboard; import net.lax1dude.eaglercraft.v1_8.internal.FileChooserResult; @@ -61,7 +59,7 @@ public class GuiScreenNameWorldImport extends GuiScreen { if(definetlyTimeToImport && !isImporting) { isImporting = true; SingleplayerServerController.importWorld(GuiCreateWorld.func_146317_a(mc.getSaveLoader(), this.theGuiTextField.getText().trim()), world.fileData, importFormat, (byte) ((loadSpawnChunks ? 2 : 0) | (enhancedGameRules ? 1 : 0))); - mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(parentGuiScreen, "singleplayer.busy.importing." + (importFormat + 1), "singleplayer.failed.importing." + (importFormat + 1), () -> SingleplayerServerController.isReady())); + mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(parentGuiScreen, "singleplayer.busy.importing." + (importFormat + 1), "singleplayer.failed.importing." + (importFormat + 1), SingleplayerServerController::isReady)); } } diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiShareToLan.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiShareToLan.java index d7bd7b3..7ab3dc3 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiShareToLan.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/gui/GuiShareToLan.java @@ -150,7 +150,7 @@ public class GuiShareToLan extends GuiScreen { } this.mc.displayGuiScreen(null); LoadingScreenRenderer ls = mc.loadingScreen; - String code = LANServerController.shareToLAN((str) -> ls.resetProgressAndMessage(str), worldName, hiddenToggle); + String code = LANServerController.shareToLAN(ls::resetProgressAndMessage, worldName, hiddenToggle); if (code != null) { SingleplayerServerController.configureLAN(WorldSettings.GameType.getByName(this.gameMode), this.allowCommands); this.mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(I18n.format("lanServer.opened") diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket14StringList.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket14StringList.java index b8b7da3..62c5644 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket14StringList.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket14StringList.java @@ -39,8 +39,8 @@ public class IPCPacket14StringList implements IPCPacketBase { public IPCPacket14StringList(int opcode, String[] list) { stringList = new ArrayList(); - for(String s : list) { - s = s.trim(); + for(int i = 0; i < list.length; ++i) { + String s = list[i].trim(); if(s.length() > 0) { stringList.add(s); } @@ -50,8 +50,8 @@ public class IPCPacket14StringList implements IPCPacketBase { public IPCPacket14StringList(int opcode, List list) { stringList = new ArrayList(); - for(String s : list) { - s = s.trim(); + for(int i = 0, l = list.size(); i < l; ++i) { + String s = list.get(i).trim(); if(s.length() > 0) { stringList.add(s); } @@ -72,9 +72,10 @@ public class IPCPacket14StringList implements IPCPacketBase { @Override public void serialize(DataOutput bin) throws IOException { bin.writeByte(opCode); - bin.writeInt(stringList.size()); - for(String str : stringList) { - bin.writeUTF(str); + int l = stringList.size(); + bin.writeInt(l); + for(int i = 0; i < l; ++i) { + bin.writeUTF(stringList.get(i)); } } @@ -86,8 +87,8 @@ public class IPCPacket14StringList implements IPCPacketBase { @Override public int size() { int len = 5; - for(String str : stringList) { - len += IPCPacketBase.strLen(str); + for(int i = 0, l = stringList.size(); i < l; ++i) { + len += IPCPacketBase.strLen(stringList.get(i)); } return len; } diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket15Crashed.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket15Crashed.java index 3912964..0833455 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket15Crashed.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket15Crashed.java @@ -3,9 +3,6 @@ package net.lax1dude.eaglercraft.v1_8.sp.ipc; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; /** * Copyright (c) 2023-2024 lax1dude. All Rights Reserved. diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket16NBTList.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket16NBTList.java index e388b63..bb9d464 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket16NBTList.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacket16NBTList.java @@ -1,7 +1,5 @@ package net.lax1dude.eaglercraft.v1_8.sp.ipc; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.DataInput; import java.io.DataInputStream; import java.io.DataOutput; @@ -11,6 +9,8 @@ import java.util.Arrays; import java.util.LinkedList; import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; +import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; @@ -54,7 +54,7 @@ public class IPCPacket16NBTList implements IPCPacketBase { for(int i = 0, size = list.size(); i < size; ++i) { NBTTagCompound tag = list.get(i); try { - ByteArrayOutputStream bao = new ByteArrayOutputStream(); + EaglerOutputStream bao = new EaglerOutputStream(); CompressedStreamTools.write(tag, new DataOutputStream(bao)); tagList.add(bao.toByteArray()); }catch(IOException e) { @@ -75,7 +75,7 @@ public class IPCPacket16NBTList implements IPCPacketBase { bin.readFully(toRead); tagList.add(toRead); try { - nbtTagList.add(CompressedStreamTools.read(new DataInputStream(new ByteArrayInputStream(toRead)))); + nbtTagList.add(CompressedStreamTools.read(new DataInputStream(new EaglerInputStream(toRead)))); }catch(IOException e) { System.err.println("Failed to read tag #" + i + " in IPCPacket16NBTList"); } @@ -85,8 +85,10 @@ public class IPCPacket16NBTList implements IPCPacketBase { @Override public void serialize(DataOutput bin) throws IOException { bin.writeInt(opCode); - bin.writeInt(tagList.size()); - for(byte[] str : tagList) { + int l = tagList.size(); + bin.writeInt(l); + for(int i = 0; i < l; ++i) { + byte[] str = tagList.get(i); bin.writeInt(str.length); bin.write(str); } @@ -100,9 +102,9 @@ public class IPCPacket16NBTList implements IPCPacketBase { @Override public int size() { int len = 8; - for(byte[] str : tagList) { + for(int i = 0, l = tagList.size(); i < l; ++i) { len += 4; - len += str.length; + len += tagList.get(i).length; } return len; } diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacketManager.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacketManager.java index 7f382c1..f85176d 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacketManager.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/ipc/IPCPacketManager.java @@ -32,32 +32,32 @@ public class IPCPacketManager { public static final DataOutputStream IPC_DATA_OUTPUT_STREAM = new DataOutputStream(IPC_OUTPUT_STREAM); static { - mappings.put(IPCPacket00StartServer.ID, () -> new IPCPacket00StartServer()); - mappings.put(IPCPacket01StopServer.ID, () -> new IPCPacket01StopServer()); - mappings.put(IPCPacket02InitWorld.ID, () -> new IPCPacket02InitWorld()); - mappings.put(IPCPacket03DeleteWorld.ID, () -> new IPCPacket03DeleteWorld()); - mappings.put(IPCPacket05RequestData.ID, () -> new IPCPacket05RequestData()); - mappings.put(IPCPacket06RenameWorldNBT.ID, () -> new IPCPacket06RenameWorldNBT()); - mappings.put(IPCPacket07ImportWorld.ID, () -> new IPCPacket07ImportWorld()); - mappings.put(IPCPacket09RequestResponse.ID, () -> new IPCPacket09RequestResponse()); - mappings.put(IPCPacket0ASetWorldDifficulty.ID, () -> new IPCPacket0ASetWorldDifficulty()); - mappings.put(IPCPacket0BPause.ID, () -> new IPCPacket0BPause()); - mappings.put(IPCPacket0CPlayerChannel.ID, () -> new IPCPacket0CPlayerChannel()); - mappings.put(IPCPacket0DProgressUpdate.ID, () -> new IPCPacket0DProgressUpdate()); - mappings.put(IPCPacket0EListWorlds.ID, () -> new IPCPacket0EListWorlds()); - mappings.put(IPCPacket0FListFiles.ID, () -> new IPCPacket0FListFiles()); - mappings.put(IPCPacket10FileRead.ID, () -> new IPCPacket10FileRead()); - mappings.put(IPCPacket12FileWrite.ID, () -> new IPCPacket12FileWrite()); - mappings.put(IPCPacket13FileCopyMove.ID, () -> new IPCPacket13FileCopyMove()); - mappings.put(IPCPacket14StringList.ID, () -> new IPCPacket14StringList()); - mappings.put(IPCPacket15Crashed.ID, () -> new IPCPacket15Crashed()); - mappings.put(IPCPacket16NBTList.ID, () -> new IPCPacket16NBTList()); - mappings.put(IPCPacket17ConfigureLAN.ID, () -> new IPCPacket17ConfigureLAN()); - mappings.put(IPCPacket18ClearPlayers.ID, () -> new IPCPacket18ClearPlayers()); - mappings.put(IPCPacket19Autosave.ID, () -> new IPCPacket19Autosave()); - mappings.put(IPCPacket20LoggerMessage.ID, () -> new IPCPacket20LoggerMessage()); - mappings.put(IPCPacket21EnableLogging.ID, () -> new IPCPacket21EnableLogging()); - mappings.put(IPCPacketFFProcessKeepAlive.ID, () -> new IPCPacketFFProcessKeepAlive()); + mappings.put(IPCPacket00StartServer.ID, IPCPacket00StartServer::new); + mappings.put(IPCPacket01StopServer.ID, IPCPacket01StopServer::new); + mappings.put(IPCPacket02InitWorld.ID, IPCPacket02InitWorld::new); + mappings.put(IPCPacket03DeleteWorld.ID, IPCPacket03DeleteWorld::new); + mappings.put(IPCPacket05RequestData.ID, IPCPacket05RequestData::new); + mappings.put(IPCPacket06RenameWorldNBT.ID, IPCPacket06RenameWorldNBT::new); + mappings.put(IPCPacket07ImportWorld.ID, IPCPacket07ImportWorld::new); + mappings.put(IPCPacket09RequestResponse.ID, IPCPacket09RequestResponse::new); + mappings.put(IPCPacket0ASetWorldDifficulty.ID, IPCPacket0ASetWorldDifficulty::new); + mappings.put(IPCPacket0BPause.ID, IPCPacket0BPause::new); + mappings.put(IPCPacket0CPlayerChannel.ID, IPCPacket0CPlayerChannel::new); + mappings.put(IPCPacket0DProgressUpdate.ID, IPCPacket0DProgressUpdate::new); + mappings.put(IPCPacket0EListWorlds.ID, IPCPacket0EListWorlds::new); + mappings.put(IPCPacket0FListFiles.ID, IPCPacket0FListFiles::new); + mappings.put(IPCPacket10FileRead.ID, IPCPacket10FileRead::new); + mappings.put(IPCPacket12FileWrite.ID, IPCPacket12FileWrite::new); + mappings.put(IPCPacket13FileCopyMove.ID, IPCPacket13FileCopyMove::new); + mappings.put(IPCPacket14StringList.ID, IPCPacket14StringList::new); + mappings.put(IPCPacket15Crashed.ID, IPCPacket15Crashed::new); + mappings.put(IPCPacket16NBTList.ID, IPCPacket16NBTList::new); + mappings.put(IPCPacket17ConfigureLAN.ID, IPCPacket17ConfigureLAN::new); + mappings.put(IPCPacket18ClearPlayers.ID, IPCPacket18ClearPlayers::new); + mappings.put(IPCPacket19Autosave.ID, IPCPacket19Autosave::new); + mappings.put(IPCPacket20LoggerMessage.ID, IPCPacket20LoggerMessage::new); + mappings.put(IPCPacket21EnableLogging.ID, IPCPacket21EnableLogging::new); + mappings.put(IPCPacketFFProcessKeepAlive.ID, IPCPacketFFProcessKeepAlive::new); } public static byte[] IPCSerialize(IPCPacketBase pkt) throws IOException { diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientNetworkManager.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientNetworkManager.java index 57a738a..418d182 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientNetworkManager.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/lan/LANClientNetworkManager.java @@ -1,7 +1,9 @@ package net.lax1dude.eaglercraft.v1_8.sp.lan; import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; import net.lax1dude.eaglercraft.v1_8.EaglerZLIB; +import net.lax1dude.eaglercraft.v1_8.IOUtils; import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState; import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; @@ -17,7 +19,6 @@ import net.minecraft.network.PacketBuffer; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.IChatComponent; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -299,7 +300,8 @@ public class LANClientNetworkManager extends EaglercraftNetworkManager { if(packets == null) { return; } - for(byte[] data : packets) { + for(int k = 0, l = packets.size(); k < l; ++k) { + byte[] data = packets.get(k); byte[] fullData; boolean compressed = false; @@ -336,11 +338,14 @@ public class LANClientNetworkManager extends EaglercraftNetworkManager { if(fullData.length < 4) { throw new IOException("Recieved invalid " + fullData.length + " byte compressed packet"); } - ByteArrayInputStream bi = new ByteArrayInputStream(fullData); + EaglerInputStream bi = new EaglerInputStream(fullData); int i = (bi.read() << 24) | (bi.read() << 16) | (bi.read() << 8) | bi.read(); InputStream inflaterInputStream = EaglerZLIB.newInflaterInputStream(bi); fullData = new byte[i]; - inflaterInputStream.read(fullData); + int r = IOUtils.readFully(inflaterInputStream, fullData); + if (i != r) { + logger.warn("Decompressed packet expected size {} differs from actual size {}!", i, r); + } } if(firstPacket) { diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayManager.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayManager.java index d431bdb..6c9f3a8 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayManager.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/RelayManager.java @@ -1,6 +1,6 @@ package net.lax1dude.eaglercraft.v1_8.sp.relay; -import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; @@ -9,6 +9,9 @@ import java.util.function.Consumer; import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EagUtils; +import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; +import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream; +import net.lax1dude.eaglercraft.v1_8.ThreadLocalRandom; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.IPacket; @@ -42,8 +45,46 @@ public class RelayManager { private final List relays = new ArrayList(); private long lastPingThrough = 0l; - - public void load(NBTTagList relayConfig) { + + public void load(byte[] relayConfig) { + NBTTagCompound relays = null; + if(relayConfig != null) { + try { + relays = CompressedStreamTools.readCompressed(new EaglerInputStream(relayConfig)); + } catch (IOException ex) { + } + } + if(relays != null && relays.hasKey("relays", 9)) { + load(relays.getTagList("relays", 10)); + if(!relays.getBoolean("f")) { + fixBullshit(); + } + }else { + sort(); // loads defaults + save(); + } + } + + // versions pre-u24 always have "relay.deev.is" as primary due to a glitch + // this function is intended to randomize the list if that is detected + private void fixBullshit() { + if(!relays.isEmpty()) { + for(int i = 0, l = relays.size(); i < l; ++i) { + RelayServer rs = relays.get(i); + if(rs.address.equalsIgnoreCase("wss://relay.deev.is/") && !rs.isPrimary()) { + return; + } + } + for(int i = 0, l = relays.size(); i < l; ++i) { + relays.get(i).setPrimary(false); + } + relays.get(ThreadLocalRandom.current().nextInt(relays.size())).setPrimary(true); + sort(); + save(); + } + } + + private void load(NBTTagList relayConfig) { relays.clear(); if(relayConfig != null && relayConfig.tagCount() > 0) { boolean gotAPrimary = false; @@ -64,6 +105,16 @@ public class RelayManager { } public void save() { + if(relays.isEmpty()) { + return; + } + byte[] data = write(); + if(data != null) { + EagRuntime.setStorage("r", data); + } + } + + public byte[] write() { try { NBTTagList lst = new NBTTagList(); for(int i = 0, l = relays.size(); i < l; ++i) { @@ -77,17 +128,25 @@ public class RelayManager { NBTTagCompound nbttagcompound = new NBTTagCompound(); nbttagcompound.setTag("relays", lst); + nbttagcompound.setBoolean("f", true); - ByteArrayOutputStream bao = new ByteArrayOutputStream(); + EaglerOutputStream bao = new EaglerOutputStream(); CompressedStreamTools.writeCompressed(nbttagcompound, bao); - EagRuntime.setStorage("r", bao.toByteArray()); + return bao.toByteArray(); } catch (Exception exception) { logger.error("Couldn\'t save relay list!"); logger.error(exception); + return null; } } private void sort() { + if(relays.isEmpty()) { + List defaultRelays = EagRuntime.getConfiguration().getRelays(); + for(int i = 0, l = defaultRelays.size(); i < l; ++i) { + relays.add(new RelayServer(defaultRelays.get(i))); + } + } if(relays.isEmpty()) { return; } @@ -315,16 +374,17 @@ public class RelayManager { } public void loadDefaults() { - int setPrimary = relays.size(); - eee: for(RelayEntry etr : EagRuntime.getConfiguration().getRelays()) { - for(RelayServer exEtr : relays) { - if(exEtr.address.equalsIgnoreCase(etr.address)) { + List defaultRelays = EagRuntime.getConfiguration().getRelays(); + eee: for(int i = 0, l = defaultRelays.size(); i < l; ++i) { + RelayEntry etr = defaultRelays.get(i); + for(int j = 0, l2 = relays.size(); j < l2; ++j) { + if(relays.get(j).address.equalsIgnoreCase(etr.address)) { continue eee; } } relays.add(new RelayServer(etr)); } - setPrimary(setPrimary); + sort(); } public String makeNewRelayName() { diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket.java index e88f0ef..9f79a77 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/relay/pkt/IPacket.java @@ -1,6 +1,5 @@ package net.lax1dude.eaglercraft.v1_8.sp.relay.pkt; -import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; @@ -9,6 +8,7 @@ import java.io.OutputStream; import java.util.HashMap; import java.util.Map; +import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; @@ -73,8 +73,8 @@ public class IPacket { Integer i = definedPacketIds.get(packet.getClass()); if(i != null) { int len = packet.packetLength(); - ByteArrayOutputStream bao = len == -1 ? new ByteArrayOutputStream() : - new ByteArrayOutputStream(len + 1); + EaglerOutputStream bao = len == -1 ? new EaglerOutputStream() : + new EaglerOutputStream(len + 1); bao.write(i); packet.write(new DataOutputStream(bao)); byte[] ret = bao.toByteArray(); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerIntegratedServerWorker.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerIntegratedServerWorker.java index 8ebdd99..b19c20c 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerIntegratedServerWorker.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerIntegratedServerWorker.java @@ -88,8 +88,8 @@ public class EaglerIntegratedServerWorker { public static void tick() { List ocs = new ArrayList<>(openChannels.values()); - for(IntegratedServerPlayerNetworkManager i : ocs) { - i.tick(); + for(int i = 0, l = ocs.size(); i < l; ++i) { + ocs.get(i).tick(); } } @@ -147,8 +147,8 @@ public class EaglerIntegratedServerWorker { EaglerSaveFormat.worldsList.setAllChars(pkt.worldName); }else { boolean found = false; - for(String s : worlds) { - if(s.equals(pkt.worldName)) { + for(int i = 0; i < worlds.length; ++i) { + if(worlds[i].equals(pkt.worldName)) { found = true; break; } @@ -196,7 +196,8 @@ public class EaglerIntegratedServerWorker { String[] worldsTxt = EaglerSaveFormat.worldsList.getAllLines(); if(worldsTxt != null) { List newWorlds = new ArrayList(); - for(String str : worldsTxt) { + for(int i = 0; i < worldsTxt.length; ++i) { + String str = worldsTxt[i]; if(!str.equalsIgnoreCase(pkt.worldName)) { newWorlds.add(str); } diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerSaveFormat.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerSaveFormat.java index ce52dbc..0f2d4b2 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerSaveFormat.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/EaglerSaveFormat.java @@ -90,7 +90,9 @@ public class EaglerSaveFormat extends SaveFormatOld { int totalSize = 0; int lastUpdate = 0; final VFile2 finalNewFolder = newFolder; - for(VFile2 vf : oldFolder.listFiles(true)) { + List vfl = oldFolder.listFiles(true); + for(int i = 0, l = vfl.size(); i < l; ++i) { + VFile2 vf = vfl.get(i); String fileNameRelative = vf.getPath().substring(oldPath.length() + 1); totalSize += VFile2.copyFile(vf, new VFile2(finalNewFolder, fileNameRelative)); if (totalSize - lastUpdate > 10000) { diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKCompiler.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKCompiler.java index 2671279..27989d1 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKCompiler.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKCompiler.java @@ -1,6 +1,5 @@ package net.lax1dude.eaglercraft.v1_8.sp.server.export; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; import java.nio.charset.StandardCharsets; @@ -9,6 +8,7 @@ import java.util.Date; import java.util.zip.CRC32; import net.lax1dude.eaglercraft.v1_8.EagRuntime; +import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream; /** * Copyright (c) 2022-2024 lax1dude. All Rights Reserved. @@ -27,13 +27,13 @@ import net.lax1dude.eaglercraft.v1_8.EagRuntime; */ public class EPKCompiler { - private final ByteArrayOutputStream os; + private final EaglerOutputStream os; private final CRC32 checkSum = new CRC32(); private int lengthIntegerOffset = 0; private int totalFileCount = 0; public EPKCompiler(String name, String owner, String type) { - os = new ByteArrayOutputStream(0x200000); + os = new EaglerOutputStream(0x200000); try { os.write(new byte[]{(byte)69,(byte)65,(byte)71,(byte)80,(byte)75,(byte)71,(byte)36,(byte)36}); // EAGPKG$$ diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKDecompiler.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKDecompiler.java index 4453f3d..10f536e 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKDecompiler.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/EPKDecompiler.java @@ -7,6 +7,7 @@ import java.util.Arrays; import java.util.zip.CRC32; import net.lax1dude.eaglercraft.v1_8.EaglerZLIB; +import net.lax1dude.eaglercraft.v1_8.IOUtils; /** * Copyright (c) 2022-2024 lax1dude. All Rights Reserved. @@ -46,7 +47,7 @@ public class EPKDecompiler { in2 = new ByteArrayInputStream(data); byte[] header = new byte[8]; - in2.read(header); + IOUtils.readFully(in2, header); if(Arrays.equals(header, new byte[]{(byte)69,(byte)65,(byte)71,(byte)80,(byte)75,(byte)71,(byte)36,(byte)36})) { byte[] endCode = new byte[] { (byte)':', (byte)':', (byte)':', (byte)'Y', @@ -63,10 +64,10 @@ public class EPKDecompiler { if(!vers.startsWith("ver2.")) { throw new IOException("Unknown or invalid EPK version: " + vers); } - - is.skip(is.read()); // skip filename - is.skip(loadShort(is)); // skip comment - is.skip(8); // skip millis date + + IOUtils.skipFully(is, is.read()); // skip filename + IOUtils.skipFully(is, loadShort(is)); // skip comment + IOUtils.skipFully(is, 8); // skip millis date numFiles = loadInt(is); @@ -101,7 +102,7 @@ public class EPKDecompiler { } byte[] typeBytes = new byte[4]; - zis.read(typeBytes); + IOUtils.readFully(zis, typeBytes); String type = readASCII(typeBytes); if(numFiles == 0) { @@ -126,7 +127,7 @@ public class EPKDecompiler { int loadedCrc = loadInt(zis); data = new byte[len - 5]; - zis.read(data); + IOUtils.readFully(zis, data); crc32.reset(); crc32.update(data, 0, data.length); @@ -139,7 +140,7 @@ public class EPKDecompiler { } }else { data = new byte[len]; - zis.read(data); + IOUtils.readFully(zis, data); } if(zis.read() != '>') { @@ -152,11 +153,11 @@ public class EPKDecompiler { } } - private static final int loadShort(InputStream is) throws IOException { + public static final int loadShort(InputStream is) throws IOException { return (is.read() << 8) | is.read(); } - private static final int loadInt(InputStream is) throws IOException { + public static final int loadInt(InputStream is) throws IOException { return (is.read() << 24) | (is.read() << 16) | (is.read() << 8) | is.read(); } @@ -168,7 +169,7 @@ public class EPKDecompiler { return new String(charIn); } - private static final String readASCII(InputStream bytesIn) throws IOException { + public static final String readASCII(InputStream bytesIn) throws IOException { int len = bytesIn.read(); char[] charIn = new char[len]; for(int i = 0; i < len; ++i) { diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterEPK.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterEPK.java index 727ca99..5818c77 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterEPK.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterEPK.java @@ -1,9 +1,10 @@ package net.lax1dude.eaglercraft.v1_8.sp.server.export; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; +import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream; import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; @@ -62,10 +63,10 @@ public class WorldConverterEPK { } if(f.type.equals("FILE")) { if(f.name.equals("level.dat") || f.name.equals("level.dat_old")) { - NBTTagCompound worldDatNBT = CompressedStreamTools.readCompressed(new ByteArrayInputStream(b)); + NBTTagCompound worldDatNBT = CompressedStreamTools.readCompressed(new EaglerInputStream(b)); worldDatNBT.getCompoundTag("Data").setString("LevelName", newName); worldDatNBT.getCompoundTag("Data").setLong("LastPlayed", System.currentTimeMillis()); - ByteArrayOutputStream tmp = new ByteArrayOutputStream(); + EaglerOutputStream tmp = new EaglerOutputStream(); CompressedStreamTools.writeCompressed(worldDatNBT, tmp); b = tmp.toByteArray(); } @@ -109,7 +110,9 @@ public class WorldConverterEPK { final int[] lastUpdate = new int[1]; EPKCompiler c = new EPKCompiler(realWorldName, worldOwner, "epk/world188"); String pfx = worldDir.getPath(); - for(VFile2 vf : worldDir.listFiles(true)) { + List filesList = worldDir.listFiles(true); + for(int i = 0, l = filesList.size(); i < l; ++i) { + VFile2 vf = filesList.get(i); ++filesWritten[0]; byte[] b = vf.getAllBytes(); c.append(vf.getPath().substring(pfx.length() + 1), b); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterMCA.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterMCA.java index ee01d68..e027530 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterMCA.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterMCA.java @@ -1,7 +1,5 @@ package net.lax1dude.eaglercraft.v1_8.sp.server.export; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import java.util.ArrayList; @@ -13,6 +11,8 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; +import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; +import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream; import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; @@ -50,7 +50,7 @@ public class WorldConverterMCA { folderName += "_"; worldDir = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory(); } - ZipInputStream zis = new ZipInputStream(new ByteArrayInputStream(archiveContents)); + ZipInputStream zis = new ZipInputStream(new EaglerInputStream(archiveContents)); ZipEntry folderNameFile = null; List fileNames = new ArrayList<>(); while((folderNameFile = zis.getNextEntry()) != null) { @@ -63,7 +63,7 @@ public class WorldConverterMCA { final int[] i = new int[] { 0 }; while(fileNames.get(0).length > i[0] && fileNames.stream().allMatch(w -> w[i[0]] == fileNames.get(0)[i[0]])) i[0]++; int folderPrefixOffset = i[0]; - zis = new ZipInputStream(new ByteArrayInputStream(archiveContents)); + zis = new ZipInputStream(new EaglerInputStream(archiveContents)); ZipEntry f = null; int lastProgUpdate = 0; int prog = 0; @@ -73,7 +73,7 @@ public class WorldConverterMCA { if (f.isDirectory()) continue; String lowerName = f.getName().toLowerCase(); if (!(lowerName.endsWith(".dat") || lowerName.endsWith(".dat_old") || lowerName.endsWith(".mca") || lowerName.endsWith(".mcr") || lowerName.endsWith(".bmp"))) continue; - ByteArrayOutputStream baos = new ByteArrayOutputStream(); + EaglerOutputStream baos = new EaglerOutputStream(); int len; while ((len = zis.read(bb)) != -1) { baos.write(bb, 0, len); @@ -82,7 +82,7 @@ public class WorldConverterMCA { byte[] b = baos.toByteArray(); String fileName = f.getName().substring(folderPrefixOffset); if (fileName.equals("level.dat") || fileName.equals("level.dat_old")) { - NBTTagCompound worldDatNBT = CompressedStreamTools.readCompressed(new ByteArrayInputStream(b)); + NBTTagCompound worldDatNBT = CompressedStreamTools.readCompressed(new EaglerInputStream(b)); NBTTagCompound gameRulesNBT = worldDatNBT.getCompoundTag("Data").getCompoundTag("GameRules"); gameRulesNBT.setString("loadSpawnChunks", (gameRules & 2) != 0 ? "true" : "false"); @@ -96,7 +96,7 @@ public class WorldConverterMCA { worldDatNBT.getCompoundTag("Data").setString("LevelName", newName); worldDatNBT.getCompoundTag("Data").setLong("LastPlayed", System.currentTimeMillis()); - ByteArrayOutputStream bo = new ByteArrayOutputStream(); + EaglerOutputStream bo = new EaglerOutputStream(); CompressedStreamTools.writeCompressed(worldDatNBT, bo); b = bo.toByteArray(); VFile2 ff = new VFile2(worldDir, fileName); @@ -129,7 +129,7 @@ public class WorldConverterMCA { logger.error("{}: Chunk already exists: {}", fileName, chunkOut.getPath()); continue; } - ByteArrayOutputStream bao = new ByteArrayOutputStream(); + EaglerOutputStream bao = new EaglerOutputStream(); CompressedStreamTools.writeCompressed(chunkNBT, bao); b = bao.toByteArray(); chunkOut.setAllBytes(b); @@ -171,7 +171,7 @@ public class WorldConverterMCA { } public static byte[] exportWorld(String folderName) throws IOException { - ByteArrayOutputStream bao = new ByteArrayOutputStream(); + EaglerOutputStream bao = new EaglerOutputStream(); ZipOutputStream zos = new ZipOutputStream(bao); zos.setComment("contains backup of world '" + folderName + "'"); VFile2 worldFolder = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory(); @@ -209,12 +209,13 @@ public class WorldConverterMCA { String regionFolder = folderName + dstFolderNames[i]; logger.info("Converting chunks in \"{}\" as MCA to \"{}\"...", vf.getPath(), regionFolder); Map regionFiles = new HashMap(); - for(VFile2 chunkFile : fileList) { + for(int k = 0, l = fileList.size(); k < l; ++k) { + VFile2 chunkFile = fileList.get(k); NBTTagCompound chunkNBT; NBTTagCompound chunkLevel; try { b = chunkFile.getAllBytes(); - chunkNBT = CompressedStreamTools.readCompressed(new ByteArrayInputStream(b)); + chunkNBT = CompressedStreamTools.readCompressed(new EaglerInputStream(b)); if(!chunkNBT.hasKey("Level", 10)) { throw new IOException("Chunk is missing level data!"); } @@ -258,7 +259,8 @@ public class WorldConverterMCA { } logger.info("Copying extra world data..."); fileList = (new VFile2(worldFolder, "data")).listFiles(false); - for(VFile2 dataFile : fileList) { + for(int k = 0, l = fileList.size(); k < l; ++k) { + VFile2 dataFile = fileList.get(k); zos.putNextEntry(new ZipEntry(folderName + "/data/" + dataFile.getName())); b = dataFile.getAllBytes(); zos.write(b); @@ -269,7 +271,8 @@ public class WorldConverterMCA { } } fileList = (new VFile2(worldFolder, "players")).listFiles(false); - for(VFile2 dataFile : fileList) { + for(int k = 0, l = fileList.size(); k < l; ++k) { + VFile2 dataFile = fileList.get(k); zos.putNextEntry(new ZipEntry(folderName + "/players/" + dataFile.getName())); b = dataFile.getAllBytes(); zos.write(b); @@ -280,7 +283,8 @@ public class WorldConverterMCA { } } fileList = (new VFile2(worldFolder, "eagler/skulls")).listFiles(false); - for(VFile2 dataFile : fileList) { + for(int k = 0, l = fileList.size(); k < l; ++k) { + VFile2 dataFile = fileList.get(k); zos.putNextEntry(new ZipEntry(folderName + "/eagler/skulls/" + dataFile.getName())); b = dataFile.getAllBytes(); zos.write(b); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/socket/IntegratedServerPlayerNetworkManager.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/socket/IntegratedServerPlayerNetworkManager.java index e6915ca..3041090 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/socket/IntegratedServerPlayerNetworkManager.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/socket/IntegratedServerPlayerNetworkManager.java @@ -1,12 +1,12 @@ package net.lax1dude.eaglercraft.v1_8.sp.server.socket; -import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream; import net.lax1dude.eaglercraft.v1_8.EaglerZLIB; import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState; import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData; @@ -48,7 +48,7 @@ public class IntegratedServerPlayerNetworkManager { public final String playerChannel; private EnumConnectionState packetState = EnumConnectionState.HANDSHAKING; private static PacketBuffer temporaryBuffer; - private static ByteArrayOutputStream temporaryOutputStream; + private static EaglerOutputStream temporaryOutputStream; private int debugPacketCounter = 0; private byte[][] recievedPacketBuffer = new byte[16384][]; private int recievedPacketBufferCounter = 0; @@ -71,7 +71,7 @@ public class IntegratedServerPlayerNetworkManager { this.enableSendCompression = !SingleplayerServerController.PLAYER_CHANNEL.equals(playerChannel); if(this.enableSendCompression) { if(temporaryOutputStream == null) { - temporaryOutputStream = new ByteArrayOutputStream(16386); + temporaryOutputStream = new EaglerOutputStream(16386); } } } @@ -115,7 +115,7 @@ public class IntegratedServerPlayerNetworkManager { if(enableSendCompression) { if(firstPacket) { if(data.length > 2 && data[0] == (byte)0x02 && data[1] == (byte)0x3D) { - ByteArrayOutputStream kickPacketBAO = new ByteArrayOutputStream(); + EaglerOutputStream kickPacketBAO = new EaglerOutputStream(); try { DataOutputStream kickDAO = new DataOutputStream(kickPacketBAO); kickDAO.write(0); diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/socket/ClientIntegratedServerNetworkManager.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/socket/ClientIntegratedServerNetworkManager.java index 3039a42..f6ac239 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/socket/ClientIntegratedServerNetworkManager.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/sp/socket/ClientIntegratedServerNetworkManager.java @@ -10,7 +10,6 @@ import net.lax1dude.eaglercraft.v1_8.socket.EaglercraftNetworkManager; import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; import net.lax1dude.eaglercraft.v1_8.sp.internal.ClientPlatformSingleplayer; import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; -import net.minecraft.network.EnumConnectionState; import net.minecraft.network.EnumPacketDirection; import net.minecraft.network.Packet; import net.minecraft.network.PacketBuffer; diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateCheckerOverlay.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateCheckerOverlay.java index 6828bfa..0e1cc0c 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateCheckerOverlay.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateCheckerOverlay.java @@ -1,6 +1,5 @@ package net.lax1dude.eaglercraft.v1_8.update; -import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController; diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateVersionList.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateVersionList.java index e19b29e..905fc16 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateVersionList.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateVersionList.java @@ -1,8 +1,6 @@ package net.lax1dude.eaglercraft.v1_8.update; import java.io.IOException; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/RelayUpdateChecker.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/RelayUpdateChecker.java index 736d0ea..be5cd15 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/RelayUpdateChecker.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/RelayUpdateChecker.java @@ -1,7 +1,5 @@ package net.lax1dude.eaglercraft.v1_8.update; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; @@ -9,6 +7,8 @@ import java.util.ArrayList; import java.util.List; 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.PlatformApplication; import net.lax1dude.eaglercraft.v1_8.internal.PlatformWebRTC; import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager; @@ -67,7 +67,7 @@ public class RelayUpdateChecker { byte[] b = PlatformApplication.getLocalStorage("lastRelayUpdate"); if(b != null) { try { - lastUpdateCheck = (new DataInputStream(new ByteArrayInputStream(b))).readLong(); + lastUpdateCheck = (new DataInputStream(new EaglerInputStream(b))).readLong(); } catch (IOException e) { } } @@ -77,7 +77,7 @@ public class RelayUpdateChecker { if((mc.theWorld == null || mc.isSingleplayer()) && millis - lastUpdateCheck > updateCheckRate) { lastUpdateCheck = millis; try { - ByteArrayOutputStream bao = new ByteArrayOutputStream(8); + EaglerOutputStream bao = new EaglerOutputStream(8); (new DataOutputStream(bao)).writeLong(lastUpdateCheck); PlatformApplication.setLocalStorage("lastRelayUpdate", bao.toByteArray()); } catch (IOException e) { diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/UpdateCertificate.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/UpdateCertificate.java index 71fc213..2bfdc43 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/UpdateCertificate.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/update/UpdateCertificate.java @@ -1,6 +1,5 @@ package net.lax1dude.eaglercraft.v1_8.update; -import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import java.io.InputStream; @@ -11,8 +10,10 @@ import java.util.Objects; import com.google.common.collect.ListMultimap; import com.google.common.collect.MultimapBuilder.ListMultimapBuilder; +import net.lax1dude.eaglercraft.v1_8.EaglerInputStream; import net.lax1dude.eaglercraft.v1_8.EaglerZLIB; import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; +import net.lax1dude.eaglercraft.v1_8.IOUtils; import net.lax1dude.eaglercraft.v1_8.crypto.SHA256Digest; /** @@ -78,7 +79,7 @@ public class UpdateCertificate { public final DLSource[] bundleDataSources; public static UpdateCertificate parseAndVerifyCertificate(byte[] certData) throws IOException, CertificateInvalidException { - InputStream is = new ByteArrayInputStream(certData); + InputStream is = new EaglerInputStream(certData); if(is.read() != 'E' || is.read() != 'A' || is.read() != 'G' || is.read() != 'S' || is.read() != 'I' || is.read() != 'G') { throw new IOException("Data is not a certificate!"); } @@ -90,7 +91,7 @@ public class UpdateCertificate { } byte[] rsa2048sum = new byte[256]; - is.read(rsa2048sum); + IOUtils.readFully(is, rsa2048sum); byte[] rsa2048sumDec = (new BigInteger(rsa2048sum)).modPow(new BigInteger("65537"), EaglercraftVersion.updateSignatureModulus).toByteArray(); @@ -108,7 +109,7 @@ public class UpdateCertificate { payloadLen |= is.read(); byte[] signaturePayload = new byte[payloadLen]; - is.read(signaturePayload); + IOUtils.readFully(is, signaturePayload); SHA256Digest sha256 = new SHA256Digest(); sha256.update(new byte[] { (byte) 170, (byte) 191, (byte) 203, (byte) 188, (byte) 47, (byte) 37, (byte) 17, @@ -147,7 +148,7 @@ public class UpdateCertificate { throw new CertificateInvalidException("SHA256 checksum of signature payload is invalid!"); } - return new UpdateCertificate(certData, EaglerZLIB.newGZIPInputStream(new ByteArrayInputStream(signaturePayload)), vers); + return new UpdateCertificate(certData, EaglerZLIB.newGZIPInputStream(new EaglerInputStream(signaturePayload)), vers); } private UpdateCertificate(byte[] certData, InputStream is, int sigVers) throws IOException { @@ -157,18 +158,18 @@ public class UpdateCertificate { this.sigTimestamp = dis.readLong(); this.bundleDataLength = dis.readInt(); this.bundleDataHash = new byte[32]; - dis.read(bundleDataHash); + IOUtils.readFully(dis, bundleDataHash); this.bundlePackageName = dis.readUTF(); this.bundleDisplayName = dis.readUTF(); this.bundleAuthorName = dis.readUTF(); this.bundleVersionInteger = dis.readInt(); this.bundleDisplayVersion = dis.readUTF(); this.bundleVersionComment = dis.readUTF(); - dis.skip(dis.read()); + IOUtils.skipFully(dis, dis.read()); int sourceCount = dis.readInt(); this.bundleDataSources = new DLSource[sourceCount]; for(int i = 0; i < sourceCount; ++i) { - dis.skip(4); + IOUtils.skipFully(dis, 4); bundleDataSources[i] = new DLSource(dis.readUTF(), dis.readUTF()); } } diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/vfs/FolderResourcePack.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/vfs/FolderResourcePack.java deleted file mode 100644 index f478d07..0000000 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/vfs/FolderResourcePack.java +++ /dev/null @@ -1,22 +0,0 @@ -package net.lax1dude.eaglercraft.v1_8.vfs; - -/** - * Copyright (c) 2022-2023 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 FolderResourcePack extends net.lax1dude.eaglercraft.v1_8.internal.vfs.FolderResourcePack { - public FolderResourcePack(String resourcePackFileIn, String prefix) { - super(resourcePackFileIn, prefix); - } -} diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/vfs/SYS.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/vfs/SYS.java deleted file mode 100644 index a4a64d4..0000000 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/vfs/SYS.java +++ /dev/null @@ -1,19 +0,0 @@ -package net.lax1dude.eaglercraft.v1_8.vfs; - -/** - * Copyright (c) 2022-2023 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 SYS extends net.lax1dude.eaglercraft.v1_8.internal.vfs.SYS { -} diff --git a/sources/main/java/org/apache/commons/lang3/Validate.java b/sources/main/java/org/apache/commons/lang3/Validate.java index 8d9b749..136f9d6 100644 --- a/sources/main/java/org/apache/commons/lang3/Validate.java +++ b/sources/main/java/org/apache/commons/lang3/Validate.java @@ -19,7 +19,6 @@ package org.apache.commons.lang3; import java.util.Collection; import java.util.Iterator; import java.util.Map; -import java.util.Objects; import java.util.regex.Pattern; import net.lax1dude.eaglercraft.v1_8.HString; diff --git a/sources/resources/SignedClientTemplate.txt b/sources/resources/SignedClientTemplate.txt index a987626..72ff330 100644 --- a/sources/resources/SignedClientTemplate.txt +++ b/sources/resources/SignedClientTemplate.txt @@ -8,8 +8,8 @@ EaglercraftX 1.8 - - + + + + + +