diff --git a/ISSUE_TEMPLATE b/ISSUE_TEMPLATE index 5c5f344112..1a4ef181f2 100644 --- a/ISSUE_TEMPLATE +++ b/ISSUE_TEMPLATE @@ -1,10 +1,13 @@ -REVIEW THE GUIDELINES (LINK AT TOP OF THIS PAGE) +REVIEW THE GUIDELINES - see [Contributing](https://github.com/micdoodle8/Galacticraft/blob/master/CONTRIBUTING.md) link on right side. Minecraft version: Galacticraft version: Single player (SSP), Multiplayer (SMP), or SSP opened to LAN (LAN)? +- If SMP server, please mention if it has **Sponge**, AtomMC, BukkitForge, BungeeCord etc. -Galacticraft add-ons and other mods installed? +Any Galacticraft add-ons installed? please list all -Please provide screenshots / crash report / log as needed. +Please provide screenshots / crash report / log / full modlist as needed + +If the game is not starting at all, please confirm that you downloaded from the official Galacticraft download site (https://micdoodle8.com/mods/galacticraft) diff --git a/build.gradle b/build.gradle index a683bfe0d6..e3d55f1de6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ -def mcVersion = "1.10.2" +def mcVersion = "1.12.2" def versionMajor = 4 def versionMinor = 0 -def versionRev = 1 +def versionRev = 2 // For those who want the bleeding edge buildscript { @@ -9,11 +9,11 @@ buildscript { jcenter() maven { name = "forge" - url = "http://files.minecraftforge.net/maven" + url = "https://files.minecraftforge.net/maven" } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle.forge' @@ -39,7 +39,7 @@ sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 minecraft { - version = "1.10.2-12.18.3.2239" + version = "1.12.2-14.23.5.2768" runDir = "run" // the mappings can be changed at any time, and must be in the following format. @@ -47,23 +47,32 @@ minecraft { // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not allways work. // simply re-run your setup task after changing the mappings to update your workspace. - mappings = "snapshot_20161111" + mappings = "snapshot_20171003" makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. } -// Keep a list of dependencies files/directories for easy jar packing -ext.dependencies = ['codechicken/**', - '**/nei_at.cfg', - 'api/**', - 'appeng/**', - 'biomesoplenty/**', - 'buildcraft/**', - 'cofh/**', - 'de/**', - 'ic2/**', - 'mekanism/**', - 'mezz/**', - 'powercrystals/**'] +repositories { + maven { + name = 'curseforge' + url = 'https://minecraft.curseforge.com/api/maven/' + } + maven { + url = "https://mod-buildcraft.com/maven/" + } +} + +dependencies { + compile "jei:jei_1.12.2:4.15.0.268" + compile "mekanism:Mekanism-1.12.2:9.4.13.349:api" + compile "applied-energistics-2:appliedenergistics2-rv6:stable:6" + compile "com.github.glitchfiend.biomesoplenty:BiomesOPlenty:1.12.2-7.0.1.2399:universal" + compile "com.mod-buildcraft:buildcraft-api:7.99.21" + compile "redstone-flux:RedstoneFlux-1.12:2.1.0.6:universal" + compile "actually-additions:ActuallyAdditions:1.12.2:r144" + compile "industrial-craft:industrialcraft-2-2.8.109:ex112:api" + compile "player-api:PlayerAPI:1.12.1:1.0" + +} // Keep a list of core files/directories for easy jar packing ext.apiFiles = ['micdoodle8/mods/galacticraft/api/**'] @@ -94,7 +103,6 @@ jar includes.addAll('mcmod.info') includes.addAll('LICENSE.txt') includes.addAll('api/player/**') - includes.addAll(project.ext.dependencies) includes.addAll(project.ext.planetsFiles) includes.addAll(project.ext.micdoodleCoreFiles) } @@ -132,7 +140,6 @@ task packCoreJar(type: Jar, dependsOn: "rePackAllJarCore") { includes.addAll('mcmod.info') includes.addAll('LICENSE.txt') excludes.addAll(project.ext.planetsFiles) - excludes.addAll(project.ext.dependencies) excludes.addAll(project.ext.micdoodleCoreFiles) } } @@ -150,7 +157,6 @@ task packPlanetsJar(type: Jar, dependsOn: "rePackAllJarPlanets") { includes.addAll('LICENSE.txt') excludes.addAll(project.ext.coreFiles) excludes.addAll(project.ext.apiFiles) - excludes.addAll(project.ext.dependencies) excludes.addAll(project.ext.micdoodleCoreFiles) } } @@ -168,7 +174,6 @@ task packMicCoreJar(type: Jar, dependsOn: "reobfJar") { include('micdoodle8/mods/galacticraft/api/entity/IEntityBreathable.class') excludes.addAll(project.ext.coreFiles) excludes.addAll(project.ext.planetsFiles) - excludes.addAll(project.ext.dependencies) } // Configure manifest attributes @@ -187,7 +192,6 @@ task packCoreJarDev(type: Jar, dependsOn: "classes") { includes.addAll('mcmod.info') includes.addAll('LICENSE.txt') excludes.addAll(project.ext.planetsFiles) - excludes.addAll(project.ext.dependencies) excludes.addAll(project.ext.micdoodleCoreFiles) } @@ -197,7 +201,6 @@ task packCoreJarDev(type: Jar, dependsOn: "classes") { includes.addAll('mcmod.info') includes.addAll('LICENSE.txt') excludes.addAll(project.ext.planetsFiles) - excludes.addAll(project.ext.dependencies) excludes.addAll(project.ext.micdoodleCoreFiles) excludes.addAll('assets') into 'src' @@ -222,7 +225,6 @@ task packPlanetsJarDev(type: Jar, dependsOn: "classes") { includes.addAll('LICENSE.txt') excludes.addAll(project.ext.coreFiles) excludes.addAll(project.ext.apiFiles) - excludes.addAll(project.ext.dependencies) excludes.addAll(project.ext.micdoodleCoreFiles) } @@ -233,7 +235,6 @@ task packPlanetsJarDev(type: Jar, dependsOn: "classes") { includes.addAll('LICENSE.txt') excludes.addAll(project.ext.coreFiles) excludes.addAll(project.ext.apiFiles) - excludes.addAll(project.ext.dependencies) excludes.addAll(project.ext.micdoodleCoreFiles) excludes.addAll('assets') into 'src' @@ -253,7 +254,6 @@ task packMicCoreJarDev(type: Jar, dependsOn: "classes") { excludes.addAll(project.ext.planetsFiles) excludes.addAll(project.ext.coreFiles) excludes.addAll(project.ext.apiFiles) - excludes.addAll(project.ext.dependencies) excludes.addAll('**/*.info') } @@ -264,7 +264,6 @@ task packMicCoreJarDev(type: Jar, dependsOn: "classes") { excludes.addAll(project.ext.planetsFiles) excludes.addAll(project.ext.coreFiles) excludes.addAll(project.ext.apiFiles) - excludes.addAll(project.ext.dependencies) excludes.addAll('**/*.info') excludes.addAll('assets') into 'src' @@ -285,13 +284,21 @@ task packApi(type: Jar, dependsOn: "classes") { // Set the jar's base name baseName = "Galacticraft-API" + from (sourceSets.main.output) { + includes.addAll(project.ext.apiFiles) + includes.addAll('LICENSE.txt') + excludes.addAll(project.ext.micdoodleCoreFiles) + excludes.addAll(project.ext.planetsFiles) + excludes.addAll('**/*.info') + excludes.addAll('assets') + } + from (sourceSets.main.allSource) { // Add necessary files, remove unnecessary ones. includes.addAll(project.ext.apiFiles) includes.addAll('LICENSE.txt') excludes.addAll(project.ext.micdoodleCoreFiles) excludes.addAll(project.ext.planetsFiles) - excludes.addAll(project.ext.dependencies) excludes.addAll('**/*.info') excludes.addAll('assets') } diff --git a/capes-uuid.txt b/capes-uuid.txt new file mode 100644 index 0000000000..80af656705 --- /dev/null +++ b/capes-uuid.txt @@ -0,0 +1,97 @@ +4e0dd4b7c04f4b728bbcd8f1510d9cc7:capeOrange micdoodle8 +bba235f5785848a198bc7ccba53a309e:capeLightGray radfast +35282c16cf0a4d8eb5d6e2c2b2af8d25:capeLime JTE +f782663c84ee476188b528c672400477:capeLime Mitchski +1a32606e2e554a68b1bcdef5527a06c9:capeLime TheGookuPJ +a7108076b5e446689e8f38ce170b7c3d:capeLime bob10234 +7b87531ac6834a71a531d4216b999077:capeLime Flies_On_Eyes +6b2697befb724476b1366560dad61de5:capeLime CrimsonKMR +7ba60d3f8d3f435a92c59867614ce97f:capeLime _lime +09912f8b02dc43728d0d60ae66d85d7a:capeLime Hachipatas +15a5921d36cf4c139bcee254e2ff2885:capeLime Happypancakes56 +0dd8daa9bec74255ba4834911fe70526:capeLime Slke +532a13ec3126453f87a0df16f0eccbad:capeLime Tyroul +3d7c4b45715d4623a9104193996e1900:capeLime kungfu_dragon +9da24e27976441d8accca25da2f1457f:capeLime Lewis_McReu +bc14cd20a79b42fcb6f6eab39ed59036:capeLightGray TheDaveStream +322a906773a343f892998ff9d9ceb336:capeLime RampantDolphin +2228ec9a323a40ddb0e998e65d05608a:capeLime PureTryOut +401af2b734d14a5ea78a9ae81757b9ee:capeLime ramenators +751f7a3bf3ab43e4b5d2352c7a0d7d9a:capeLime randhope21 +c3ea848638e146c18f42b2479ac16ea8:capeLime Night_Fury_CZ +c18b17fcae494d93a1db83121dc01bff:capeLime SoaringChris137 +58cdd8b69e004a339914666457cf6421:capeLime TerraGenome +2eaac1b2af094a72bf833c462a8f97a4:capeLime Yangjo +80228a058c1345daa5d0ea0fdcb4eb12:capeLime Made_This_Name +7776112e3ade489a9ac183ff5e1cae7a:capeLime spamenigma +a865907c6b8347b2a08835688169dc6a:capeBlue EzerArch +e1d0ee1c42024b8985d9540bac457463:capeOrange GiantWaffle +e7c3e2a33e1a477f9feda46fe674bea8:capeLightBlue Lastnecron +592e9044ec26496e90296a6dcc43d407:capeBlue SpoonTrauma +b31a143466cf4b1eb27640252e0ca974:capeOrange Devsio +a163bd86b3b847788045f11cc1b171bf:capeOrange Tyrantelf +f3a1ea327dd04d0b9759203a4adff99c:capeBlue Cellenseres +47257425c09d44d9846edb042571dbec:capeOrange SgtAce +743392cc83bc49f2bd3eac04ccf69aa9:capeRainbow Roosterteeth546 +db9eea4b99e0413297aa5be75010b0ad:capeOrange SundayxFunday +42232dec4ffd458dbee45791c822bd83:capeLime THEproWINN +766cebb7c5684099870976aa5f069538:capeLime Puggy04 +cdec6b441de145f8a7d450ff27b48a62:capeRainbow scriptoffate14 +cd6eb3ef44c14030812fab39ce53febe:capeRainbow Ohrm +ade5c7958eea4880b5c305eb898dcc99:capeRainbow SirFuzzhead +291f9006916948588960f5f6d06b6e47:capeRed alexljn5 +e7a8ff43db5a48f190c2bdd039bea7ef:capeRainbow Tatertot2222 +5725dfbd769d4df8981633346b788f36:capeRainbow atomicpichu +c9ba14cd7a8f41cf9e6b13cca78563b7:capeMagenta chattanooga +aca4ca40b5e74d998d24385acaee46f8:capeOrange so2ro +2054059c45d34375b51e60d59303d6e1:capeBlue Sir_Killz +60fbe691d5fd4007b0e85bfe54fbac7b:capeRainbow ForbiddeFan12 +d5d826c123904ceb8b55a160345b91e3:capeRainbow takos +c02818a726634132a0eeabc88616d415:capeLime GradeAWizard +8f1c823c9a3b401da0a2f77829cdba33:capeBlue kelvinxj +82419cb6c25b403f8b1fc503340fff15:capeCyan BCQX +055d629e96104dddbad01944ab5f7d29:capeRainbow Shamrocker101 +08ca7900afa8474db3bc1147ed61942e:capeLightGray Truman04 +ea62f0017661447399c6c5224b5180c9:capeRainbow Krystal_Disc +4f6de754f9ef4462bc756b55094b4f6e:capeLime eggsandbaon +2f6980ebfac448c79021e452fda174f6:capeRainbow Germaniac +bdfd2c1c28964bf4b22e684ac1ed9118:capeCyan ALterRy +ff42d35e94b44933bcb2d482d277f83f:capeCyan nanatorium +cccbf098d8204d119fa9c85a0f92fee0:capeOrange Phlonk +c7b62bb08a7a41f8a9d9812c89ee9c99:capeRainbow AquaBarnes +459f310e70224bffba46cfb8f28c9b01:capeLime CmdrPineapple +9a4668a923d34fa28054820c305bd308:capeDarkGray lancewalker +8ef62b5cd49a4dd3a59a1bfbb3d3d380:capeYellow 1_c +3101ea80b1904de4b556e4b46dde541c:capeDarkGray MoonRaven +21f531d2d0dd4359a0b4ba5d036a0ce7:capeLime Survarium +ba7e73d2cbf54d63858f2d60ae9eaa6b:capeRainbow Daeon +0e585f22f60647e2a2b56ca7196cfa74:capeLightGray dragonguide +9ca6ab76cdf34b13a3f92d36d337567a:capeRainbow MrRobin1512 +a0c708a9b5fb4b8299036fc4437c34b9:capeOrange IndianGooN +6bcc4b6a354344cebe6e4de701ba45d1:capeLightBlue Mysticslay +f5f0b2ce0c094ced9c147156a6a205b5:capeYellow BeeCannon +fc9b324e8d0d4c5d8fd6d11d5d042e61:capeRainbow KrazyMonkey +76ae9784cec6448cb3521eed1abf16f9:capeLightBlue Knightblock +1630c57a471e43a6805240d4a3cbbb55:capeRainbow Shadow_Beats +98313813c3f4494fbb4d68f342633a83:capeYellow Strachey +57d64951c09c4f498875d404841efac9:capeLime JacobiCarter +c0e6fa8862d24556902ef49823b96dfe:capeBrown afoolishmoon +ed4bf20f800b4f32b79718ddb1b24d7b:capeRainbow LokeYourLord +c4c022edb98a4337832a5ea8417aea4e:capeRainbow GetVape +fe481dee2e6d4c289fb742fd3db796e2:capeLime ma10as234 +0a429b969fb04d9fb34d032ebeb07c9c:capeRainbow ARedHel66 +c53ed454efba4dcfa307ba9eb26c58d3:capeLightBlue PrezGman +0de2e5f8917049b6999c5f1fca7d0ad4:capePurple creeperchick15 +e4be20006bfb4003b4e5f6dc4f153471:capeBlue sonic5223 +34314a92dc5c43a7afa848f101699203:capeRainbow Master_Apple +6a419733b55046d3a21c46656b801849:capePurple urix123 +f71b1f8b46574347a74b0d1b0b25659f:capeLime monkeypants_271 +c178592112bb4a71b082b422153f267b:capeLightGray Nomad043 +1dafe96cb8a34cf6be51367468409943:capePurple Malstrim +504e79e97f4640688611f18075df5c4e:capeCyan WhiskeyOutlaw +09d4c32761504341b145e3048fb13d04:capeRainbow Akahito666 +d41727d58ec947f7a8deeabcb2577f9f:capeOrange Timsuper2 +6f71c0114d914942904dc9b63326df4c:capeLightGray Sonic_Blender +fab0af0f6890484594745b0c0205d1a6:capeRainbow xX_CreeperMr_Xx +7430428645f54fe8b5aca82bff3f1400:capePurple Santiv +36ab85cc86da42a99172956dfc80edec:capeRainbow SebaSphere diff --git a/capes.txt b/capes.txt index bc9ec14a06..d501a38369 100644 --- a/capes.txt +++ b/capes.txt @@ -103,3 +103,4 @@ Timsuper2:capeOrange Sonic_Blender:capeLightGray xX_CreeperMr_Xx:capeRainbow Santiv:capePurple +SebaSphere:capeRainbow diff --git a/dependencies/main/java/api/player/client/ClientPlayerAPI.java b/dependencies/main/java/api/player/client/ClientPlayerAPI.java deleted file mode 100644 index e47d28f1cb..0000000000 --- a/dependencies/main/java/api/player/client/ClientPlayerAPI.java +++ /dev/null @@ -1,6702 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.client; - -import java.io.*; -import java.text.*; -import java.util.*; -import java.util.logging.*; -import java.lang.reflect.*; - -public final class ClientPlayerAPI -{ - private final static Class[] Class = new Class[] { ClientPlayerAPI.class }; - private final static Class[] Classes = new Class[] { ClientPlayerAPI.class, String.class }; - - private static boolean isCreated; - private static final Logger logger = Logger.getLogger("ClientPlayerAPI"); - - private static void log(String text) - { - System.out.println(text); - logger.fine(text); - } - - public static void register(String id, Class baseClass) - { - register(id, baseClass, null); - } - - public static void register(String id, Class baseClass, ClientPlayerBaseSorting baseSorting) - { - try - { - register(baseClass, id, baseSorting); - } - catch(RuntimeException exception) - { - if(id != null) - log("Client Player: failed to register id '" + id + "'"); - else - log("Client Player: failed to register ClientPlayerBase"); - - throw exception; - } - } - - private static void register(Class baseClass, String id, ClientPlayerBaseSorting baseSorting) - { - if(!isCreated) - { - try - { - Method mandatory = net.minecraft.client.entity.EntityPlayerSP.class.getMethod("getClientPlayerBase", String.class); - if (mandatory.getReturnType() != ClientPlayerBase.class) - throw new NoSuchMethodException(ClientPlayerBase.class.getName() + " " + net.minecraft.client.entity.EntityPlayerSP.class.getName() + ".getClientPlayerBase(" + String.class.getName() + ")"); - } - catch(NoSuchMethodException exception) - { - String[] errorMessageParts = new String[] - { - "========================================", - "The API \"Client Player\" version " + api.player.forge.PlayerAPIPlugin.Version + " of the mod \"Player API Core " + api.player.forge.PlayerAPIPlugin.Version + "\" can not be created!", - "----------------------------------------", - "Mandatory member method \"{0} getClientPlayerBase({3})\" not found in class \"{1}\".", - "There are three scenarios this can happen:", - "* Minecraft Forge is missing a Player API Core which Minecraft version matches its own.", - " Download and install the latest Player API Core for the Minecraft version you were trying to run.", - "* The code of the class \"{2}\" of Player API Core has been modified beyond recognition by another Minecraft Forge coremod.", - " Try temporary deinstallation of other core mods to find the culprit and deinstall it permanently to fix this specific problem.", - "* Player API Core has not been installed correctly.", - " Deinstall Player API Core and install it again following the installation instructions in the readme file.", - "========================================" - }; - - String baseEntityPlayerSPClassName = ClientPlayerBase.class.getName(); - String targetClassName = net.minecraft.client.entity.EntityPlayerSP.class.getName(); - String targetClassFileName = targetClassName.replace(".", File.separator); - String stringClassName = String.class.getName(); - - for(int i=0; i allreadyRegistered = allBaseConstructors.get(id); - if(allreadyRegistered != null) - throw new IllegalArgumentException("The class '" + baseClass.getName() + "' can not be registered with the id '" + id + "' because the class '" + allreadyRegistered.getDeclaringClass().getName() + "' has allready been registered with the same id"); - - Constructor baseConstructor; - try - { - baseConstructor = baseClass.getDeclaredConstructor(Classes); - } - catch (Throwable t) - { - try - { - baseConstructor = baseClass.getDeclaredConstructor(Class); - } - catch(Throwable s) - { - throw new IllegalArgumentException("Can not find necessary constructor with one argument of type '" + ClientPlayerAPI.class.getName() + "' and eventually a second argument of type 'String' in the class '" + baseClass.getName() + "'", t); - } - } - - allBaseConstructors.put(id, baseConstructor); - - if(baseSorting != null) - { - addSorting(id, allBaseBeforeLocalConstructingSuperiors, baseSorting.getBeforeLocalConstructingSuperiors()); - addSorting(id, allBaseBeforeLocalConstructingInferiors, baseSorting.getBeforeLocalConstructingInferiors()); - addSorting(id, allBaseAfterLocalConstructingSuperiors, baseSorting.getAfterLocalConstructingSuperiors()); - addSorting(id, allBaseAfterLocalConstructingInferiors, baseSorting.getAfterLocalConstructingInferiors()); - - addDynamicSorting(id, allBaseBeforeDynamicSuperiors, baseSorting.getDynamicBeforeSuperiors()); - addDynamicSorting(id, allBaseBeforeDynamicInferiors, baseSorting.getDynamicBeforeInferiors()); - addDynamicSorting(id, allBaseOverrideDynamicSuperiors, baseSorting.getDynamicOverrideSuperiors()); - addDynamicSorting(id, allBaseOverrideDynamicInferiors, baseSorting.getDynamicOverrideInferiors()); - addDynamicSorting(id, allBaseAfterDynamicSuperiors, baseSorting.getDynamicAfterSuperiors()); - addDynamicSorting(id, allBaseAfterDynamicInferiors, baseSorting.getDynamicAfterInferiors()); - - addSorting(id, allBaseBeforeAddExhaustionSuperiors, baseSorting.getBeforeAddExhaustionSuperiors()); - addSorting(id, allBaseBeforeAddExhaustionInferiors, baseSorting.getBeforeAddExhaustionInferiors()); - addSorting(id, allBaseOverrideAddExhaustionSuperiors, baseSorting.getOverrideAddExhaustionSuperiors()); - addSorting(id, allBaseOverrideAddExhaustionInferiors, baseSorting.getOverrideAddExhaustionInferiors()); - addSorting(id, allBaseAfterAddExhaustionSuperiors, baseSorting.getAfterAddExhaustionSuperiors()); - addSorting(id, allBaseAfterAddExhaustionInferiors, baseSorting.getAfterAddExhaustionInferiors()); - - addSorting(id, allBaseBeforeAddMovementStatSuperiors, baseSorting.getBeforeAddMovementStatSuperiors()); - addSorting(id, allBaseBeforeAddMovementStatInferiors, baseSorting.getBeforeAddMovementStatInferiors()); - addSorting(id, allBaseOverrideAddMovementStatSuperiors, baseSorting.getOverrideAddMovementStatSuperiors()); - addSorting(id, allBaseOverrideAddMovementStatInferiors, baseSorting.getOverrideAddMovementStatInferiors()); - addSorting(id, allBaseAfterAddMovementStatSuperiors, baseSorting.getAfterAddMovementStatSuperiors()); - addSorting(id, allBaseAfterAddMovementStatInferiors, baseSorting.getAfterAddMovementStatInferiors()); - - addSorting(id, allBaseBeforeAddStatSuperiors, baseSorting.getBeforeAddStatSuperiors()); - addSorting(id, allBaseBeforeAddStatInferiors, baseSorting.getBeforeAddStatInferiors()); - addSorting(id, allBaseOverrideAddStatSuperiors, baseSorting.getOverrideAddStatSuperiors()); - addSorting(id, allBaseOverrideAddStatInferiors, baseSorting.getOverrideAddStatInferiors()); - addSorting(id, allBaseAfterAddStatSuperiors, baseSorting.getAfterAddStatSuperiors()); - addSorting(id, allBaseAfterAddStatInferiors, baseSorting.getAfterAddStatInferiors()); - - addSorting(id, allBaseBeforeAttackEntityFromSuperiors, baseSorting.getBeforeAttackEntityFromSuperiors()); - addSorting(id, allBaseBeforeAttackEntityFromInferiors, baseSorting.getBeforeAttackEntityFromInferiors()); - addSorting(id, allBaseOverrideAttackEntityFromSuperiors, baseSorting.getOverrideAttackEntityFromSuperiors()); - addSorting(id, allBaseOverrideAttackEntityFromInferiors, baseSorting.getOverrideAttackEntityFromInferiors()); - addSorting(id, allBaseAfterAttackEntityFromSuperiors, baseSorting.getAfterAttackEntityFromSuperiors()); - addSorting(id, allBaseAfterAttackEntityFromInferiors, baseSorting.getAfterAttackEntityFromInferiors()); - - addSorting(id, allBaseBeforeAttackTargetEntityWithCurrentItemSuperiors, baseSorting.getBeforeAttackTargetEntityWithCurrentItemSuperiors()); - addSorting(id, allBaseBeforeAttackTargetEntityWithCurrentItemInferiors, baseSorting.getBeforeAttackTargetEntityWithCurrentItemInferiors()); - addSorting(id, allBaseOverrideAttackTargetEntityWithCurrentItemSuperiors, baseSorting.getOverrideAttackTargetEntityWithCurrentItemSuperiors()); - addSorting(id, allBaseOverrideAttackTargetEntityWithCurrentItemInferiors, baseSorting.getOverrideAttackTargetEntityWithCurrentItemInferiors()); - addSorting(id, allBaseAfterAttackTargetEntityWithCurrentItemSuperiors, baseSorting.getAfterAttackTargetEntityWithCurrentItemSuperiors()); - addSorting(id, allBaseAfterAttackTargetEntityWithCurrentItemInferiors, baseSorting.getAfterAttackTargetEntityWithCurrentItemInferiors()); - - addSorting(id, allBaseBeforeCanBreatheUnderwaterSuperiors, baseSorting.getBeforeCanBreatheUnderwaterSuperiors()); - addSorting(id, allBaseBeforeCanBreatheUnderwaterInferiors, baseSorting.getBeforeCanBreatheUnderwaterInferiors()); - addSorting(id, allBaseOverrideCanBreatheUnderwaterSuperiors, baseSorting.getOverrideCanBreatheUnderwaterSuperiors()); - addSorting(id, allBaseOverrideCanBreatheUnderwaterInferiors, baseSorting.getOverrideCanBreatheUnderwaterInferiors()); - addSorting(id, allBaseAfterCanBreatheUnderwaterSuperiors, baseSorting.getAfterCanBreatheUnderwaterSuperiors()); - addSorting(id, allBaseAfterCanBreatheUnderwaterInferiors, baseSorting.getAfterCanBreatheUnderwaterInferiors()); - - addSorting(id, allBaseBeforeCanHarvestBlockSuperiors, baseSorting.getBeforeCanHarvestBlockSuperiors()); - addSorting(id, allBaseBeforeCanHarvestBlockInferiors, baseSorting.getBeforeCanHarvestBlockInferiors()); - addSorting(id, allBaseOverrideCanHarvestBlockSuperiors, baseSorting.getOverrideCanHarvestBlockSuperiors()); - addSorting(id, allBaseOverrideCanHarvestBlockInferiors, baseSorting.getOverrideCanHarvestBlockInferiors()); - addSorting(id, allBaseAfterCanHarvestBlockSuperiors, baseSorting.getAfterCanHarvestBlockSuperiors()); - addSorting(id, allBaseAfterCanHarvestBlockInferiors, baseSorting.getAfterCanHarvestBlockInferiors()); - - addSorting(id, allBaseBeforeCanPlayerEditSuperiors, baseSorting.getBeforeCanPlayerEditSuperiors()); - addSorting(id, allBaseBeforeCanPlayerEditInferiors, baseSorting.getBeforeCanPlayerEditInferiors()); - addSorting(id, allBaseOverrideCanPlayerEditSuperiors, baseSorting.getOverrideCanPlayerEditSuperiors()); - addSorting(id, allBaseOverrideCanPlayerEditInferiors, baseSorting.getOverrideCanPlayerEditInferiors()); - addSorting(id, allBaseAfterCanPlayerEditSuperiors, baseSorting.getAfterCanPlayerEditSuperiors()); - addSorting(id, allBaseAfterCanPlayerEditInferiors, baseSorting.getAfterCanPlayerEditInferiors()); - - addSorting(id, allBaseBeforeCanTriggerWalkingSuperiors, baseSorting.getBeforeCanTriggerWalkingSuperiors()); - addSorting(id, allBaseBeforeCanTriggerWalkingInferiors, baseSorting.getBeforeCanTriggerWalkingInferiors()); - addSorting(id, allBaseOverrideCanTriggerWalkingSuperiors, baseSorting.getOverrideCanTriggerWalkingSuperiors()); - addSorting(id, allBaseOverrideCanTriggerWalkingInferiors, baseSorting.getOverrideCanTriggerWalkingInferiors()); - addSorting(id, allBaseAfterCanTriggerWalkingSuperiors, baseSorting.getAfterCanTriggerWalkingSuperiors()); - addSorting(id, allBaseAfterCanTriggerWalkingInferiors, baseSorting.getAfterCanTriggerWalkingInferiors()); - - addSorting(id, allBaseBeforeCloseScreenSuperiors, baseSorting.getBeforeCloseScreenSuperiors()); - addSorting(id, allBaseBeforeCloseScreenInferiors, baseSorting.getBeforeCloseScreenInferiors()); - addSorting(id, allBaseOverrideCloseScreenSuperiors, baseSorting.getOverrideCloseScreenSuperiors()); - addSorting(id, allBaseOverrideCloseScreenInferiors, baseSorting.getOverrideCloseScreenInferiors()); - addSorting(id, allBaseAfterCloseScreenSuperiors, baseSorting.getAfterCloseScreenSuperiors()); - addSorting(id, allBaseAfterCloseScreenInferiors, baseSorting.getAfterCloseScreenInferiors()); - - addSorting(id, allBaseBeforeDamageEntitySuperiors, baseSorting.getBeforeDamageEntitySuperiors()); - addSorting(id, allBaseBeforeDamageEntityInferiors, baseSorting.getBeforeDamageEntityInferiors()); - addSorting(id, allBaseOverrideDamageEntitySuperiors, baseSorting.getOverrideDamageEntitySuperiors()); - addSorting(id, allBaseOverrideDamageEntityInferiors, baseSorting.getOverrideDamageEntityInferiors()); - addSorting(id, allBaseAfterDamageEntitySuperiors, baseSorting.getAfterDamageEntitySuperiors()); - addSorting(id, allBaseAfterDamageEntityInferiors, baseSorting.getAfterDamageEntityInferiors()); - - addSorting(id, allBaseBeforeDisplayGuiSuperiors, baseSorting.getBeforeDisplayGuiSuperiors()); - addSorting(id, allBaseBeforeDisplayGuiInferiors, baseSorting.getBeforeDisplayGuiInferiors()); - addSorting(id, allBaseOverrideDisplayGuiSuperiors, baseSorting.getOverrideDisplayGuiSuperiors()); - addSorting(id, allBaseOverrideDisplayGuiInferiors, baseSorting.getOverrideDisplayGuiInferiors()); - addSorting(id, allBaseAfterDisplayGuiSuperiors, baseSorting.getAfterDisplayGuiSuperiors()); - addSorting(id, allBaseAfterDisplayGuiInferiors, baseSorting.getAfterDisplayGuiInferiors()); - - addSorting(id, allBaseBeforeDisplayGUIChestSuperiors, baseSorting.getBeforeDisplayGUIChestSuperiors()); - addSorting(id, allBaseBeforeDisplayGUIChestInferiors, baseSorting.getBeforeDisplayGUIChestInferiors()); - addSorting(id, allBaseOverrideDisplayGUIChestSuperiors, baseSorting.getOverrideDisplayGUIChestSuperiors()); - addSorting(id, allBaseOverrideDisplayGUIChestInferiors, baseSorting.getOverrideDisplayGUIChestInferiors()); - addSorting(id, allBaseAfterDisplayGUIChestSuperiors, baseSorting.getAfterDisplayGUIChestSuperiors()); - addSorting(id, allBaseAfterDisplayGUIChestInferiors, baseSorting.getAfterDisplayGUIChestInferiors()); - - addSorting(id, allBaseBeforeDropItemSuperiors, baseSorting.getBeforeDropItemSuperiors()); - addSorting(id, allBaseBeforeDropItemInferiors, baseSorting.getBeforeDropItemInferiors()); - addSorting(id, allBaseOverrideDropItemSuperiors, baseSorting.getOverrideDropItemSuperiors()); - addSorting(id, allBaseOverrideDropItemInferiors, baseSorting.getOverrideDropItemInferiors()); - addSorting(id, allBaseAfterDropItemSuperiors, baseSorting.getAfterDropItemSuperiors()); - addSorting(id, allBaseAfterDropItemInferiors, baseSorting.getAfterDropItemInferiors()); - - addSorting(id, allBaseBeforeDropOneItemSuperiors, baseSorting.getBeforeDropOneItemSuperiors()); - addSorting(id, allBaseBeforeDropOneItemInferiors, baseSorting.getBeforeDropOneItemInferiors()); - addSorting(id, allBaseOverrideDropOneItemSuperiors, baseSorting.getOverrideDropOneItemSuperiors()); - addSorting(id, allBaseOverrideDropOneItemInferiors, baseSorting.getOverrideDropOneItemInferiors()); - addSorting(id, allBaseAfterDropOneItemSuperiors, baseSorting.getAfterDropOneItemSuperiors()); - addSorting(id, allBaseAfterDropOneItemInferiors, baseSorting.getAfterDropOneItemInferiors()); - - addSorting(id, allBaseBeforeDropPlayerItemWithRandomChoiceSuperiors, baseSorting.getBeforeDropPlayerItemWithRandomChoiceSuperiors()); - addSorting(id, allBaseBeforeDropPlayerItemWithRandomChoiceInferiors, baseSorting.getBeforeDropPlayerItemWithRandomChoiceInferiors()); - addSorting(id, allBaseOverrideDropPlayerItemWithRandomChoiceSuperiors, baseSorting.getOverrideDropPlayerItemWithRandomChoiceSuperiors()); - addSorting(id, allBaseOverrideDropPlayerItemWithRandomChoiceInferiors, baseSorting.getOverrideDropPlayerItemWithRandomChoiceInferiors()); - addSorting(id, allBaseAfterDropPlayerItemWithRandomChoiceSuperiors, baseSorting.getAfterDropPlayerItemWithRandomChoiceSuperiors()); - addSorting(id, allBaseAfterDropPlayerItemWithRandomChoiceInferiors, baseSorting.getAfterDropPlayerItemWithRandomChoiceInferiors()); - - addSorting(id, allBaseBeforeFallSuperiors, baseSorting.getBeforeFallSuperiors()); - addSorting(id, allBaseBeforeFallInferiors, baseSorting.getBeforeFallInferiors()); - addSorting(id, allBaseOverrideFallSuperiors, baseSorting.getOverrideFallSuperiors()); - addSorting(id, allBaseOverrideFallInferiors, baseSorting.getOverrideFallInferiors()); - addSorting(id, allBaseAfterFallSuperiors, baseSorting.getAfterFallSuperiors()); - addSorting(id, allBaseAfterFallInferiors, baseSorting.getAfterFallInferiors()); - - addSorting(id, allBaseBeforeGetAIMoveSpeedSuperiors, baseSorting.getBeforeGetAIMoveSpeedSuperiors()); - addSorting(id, allBaseBeforeGetAIMoveSpeedInferiors, baseSorting.getBeforeGetAIMoveSpeedInferiors()); - addSorting(id, allBaseOverrideGetAIMoveSpeedSuperiors, baseSorting.getOverrideGetAIMoveSpeedSuperiors()); - addSorting(id, allBaseOverrideGetAIMoveSpeedInferiors, baseSorting.getOverrideGetAIMoveSpeedInferiors()); - addSorting(id, allBaseAfterGetAIMoveSpeedSuperiors, baseSorting.getAfterGetAIMoveSpeedSuperiors()); - addSorting(id, allBaseAfterGetAIMoveSpeedInferiors, baseSorting.getAfterGetAIMoveSpeedInferiors()); - - addSorting(id, allBaseBeforeGetBedOrientationInDegreesSuperiors, baseSorting.getBeforeGetBedOrientationInDegreesSuperiors()); - addSorting(id, allBaseBeforeGetBedOrientationInDegreesInferiors, baseSorting.getBeforeGetBedOrientationInDegreesInferiors()); - addSorting(id, allBaseOverrideGetBedOrientationInDegreesSuperiors, baseSorting.getOverrideGetBedOrientationInDegreesSuperiors()); - addSorting(id, allBaseOverrideGetBedOrientationInDegreesInferiors, baseSorting.getOverrideGetBedOrientationInDegreesInferiors()); - addSorting(id, allBaseAfterGetBedOrientationInDegreesSuperiors, baseSorting.getAfterGetBedOrientationInDegreesSuperiors()); - addSorting(id, allBaseAfterGetBedOrientationInDegreesInferiors, baseSorting.getAfterGetBedOrientationInDegreesInferiors()); - - addSorting(id, allBaseBeforeGetBrightnessSuperiors, baseSorting.getBeforeGetBrightnessSuperiors()); - addSorting(id, allBaseBeforeGetBrightnessInferiors, baseSorting.getBeforeGetBrightnessInferiors()); - addSorting(id, allBaseOverrideGetBrightnessSuperiors, baseSorting.getOverrideGetBrightnessSuperiors()); - addSorting(id, allBaseOverrideGetBrightnessInferiors, baseSorting.getOverrideGetBrightnessInferiors()); - addSorting(id, allBaseAfterGetBrightnessSuperiors, baseSorting.getAfterGetBrightnessSuperiors()); - addSorting(id, allBaseAfterGetBrightnessInferiors, baseSorting.getAfterGetBrightnessInferiors()); - - addSorting(id, allBaseBeforeGetBrightnessForRenderSuperiors, baseSorting.getBeforeGetBrightnessForRenderSuperiors()); - addSorting(id, allBaseBeforeGetBrightnessForRenderInferiors, baseSorting.getBeforeGetBrightnessForRenderInferiors()); - addSorting(id, allBaseOverrideGetBrightnessForRenderSuperiors, baseSorting.getOverrideGetBrightnessForRenderSuperiors()); - addSorting(id, allBaseOverrideGetBrightnessForRenderInferiors, baseSorting.getOverrideGetBrightnessForRenderInferiors()); - addSorting(id, allBaseAfterGetBrightnessForRenderSuperiors, baseSorting.getAfterGetBrightnessForRenderSuperiors()); - addSorting(id, allBaseAfterGetBrightnessForRenderInferiors, baseSorting.getAfterGetBrightnessForRenderInferiors()); - - addSorting(id, allBaseBeforeGetBreakSpeedSuperiors, baseSorting.getBeforeGetBreakSpeedSuperiors()); - addSorting(id, allBaseBeforeGetBreakSpeedInferiors, baseSorting.getBeforeGetBreakSpeedInferiors()); - addSorting(id, allBaseOverrideGetBreakSpeedSuperiors, baseSorting.getOverrideGetBreakSpeedSuperiors()); - addSorting(id, allBaseOverrideGetBreakSpeedInferiors, baseSorting.getOverrideGetBreakSpeedInferiors()); - addSorting(id, allBaseAfterGetBreakSpeedSuperiors, baseSorting.getAfterGetBreakSpeedSuperiors()); - addSorting(id, allBaseAfterGetBreakSpeedInferiors, baseSorting.getAfterGetBreakSpeedInferiors()); - - addSorting(id, allBaseBeforeGetDistanceSqSuperiors, baseSorting.getBeforeGetDistanceSqSuperiors()); - addSorting(id, allBaseBeforeGetDistanceSqInferiors, baseSorting.getBeforeGetDistanceSqInferiors()); - addSorting(id, allBaseOverrideGetDistanceSqSuperiors, baseSorting.getOverrideGetDistanceSqSuperiors()); - addSorting(id, allBaseOverrideGetDistanceSqInferiors, baseSorting.getOverrideGetDistanceSqInferiors()); - addSorting(id, allBaseAfterGetDistanceSqSuperiors, baseSorting.getAfterGetDistanceSqSuperiors()); - addSorting(id, allBaseAfterGetDistanceSqInferiors, baseSorting.getAfterGetDistanceSqInferiors()); - - addSorting(id, allBaseBeforeGetDistanceSqToEntitySuperiors, baseSorting.getBeforeGetDistanceSqToEntitySuperiors()); - addSorting(id, allBaseBeforeGetDistanceSqToEntityInferiors, baseSorting.getBeforeGetDistanceSqToEntityInferiors()); - addSorting(id, allBaseOverrideGetDistanceSqToEntitySuperiors, baseSorting.getOverrideGetDistanceSqToEntitySuperiors()); - addSorting(id, allBaseOverrideGetDistanceSqToEntityInferiors, baseSorting.getOverrideGetDistanceSqToEntityInferiors()); - addSorting(id, allBaseAfterGetDistanceSqToEntitySuperiors, baseSorting.getAfterGetDistanceSqToEntitySuperiors()); - addSorting(id, allBaseAfterGetDistanceSqToEntityInferiors, baseSorting.getAfterGetDistanceSqToEntityInferiors()); - - addSorting(id, allBaseBeforeGetFovModifierSuperiors, baseSorting.getBeforeGetFovModifierSuperiors()); - addSorting(id, allBaseBeforeGetFovModifierInferiors, baseSorting.getBeforeGetFovModifierInferiors()); - addSorting(id, allBaseOverrideGetFovModifierSuperiors, baseSorting.getOverrideGetFovModifierSuperiors()); - addSorting(id, allBaseOverrideGetFovModifierInferiors, baseSorting.getOverrideGetFovModifierInferiors()); - addSorting(id, allBaseAfterGetFovModifierSuperiors, baseSorting.getAfterGetFovModifierSuperiors()); - addSorting(id, allBaseAfterGetFovModifierInferiors, baseSorting.getAfterGetFovModifierInferiors()); - - addSorting(id, allBaseBeforeGetHurtSoundSuperiors, baseSorting.getBeforeGetHurtSoundSuperiors()); - addSorting(id, allBaseBeforeGetHurtSoundInferiors, baseSorting.getBeforeGetHurtSoundInferiors()); - addSorting(id, allBaseOverrideGetHurtSoundSuperiors, baseSorting.getOverrideGetHurtSoundSuperiors()); - addSorting(id, allBaseOverrideGetHurtSoundInferiors, baseSorting.getOverrideGetHurtSoundInferiors()); - addSorting(id, allBaseAfterGetHurtSoundSuperiors, baseSorting.getAfterGetHurtSoundSuperiors()); - addSorting(id, allBaseAfterGetHurtSoundInferiors, baseSorting.getAfterGetHurtSoundInferiors()); - - addSorting(id, allBaseBeforeGetNameSuperiors, baseSorting.getBeforeGetNameSuperiors()); - addSorting(id, allBaseBeforeGetNameInferiors, baseSorting.getBeforeGetNameInferiors()); - addSorting(id, allBaseOverrideGetNameSuperiors, baseSorting.getOverrideGetNameSuperiors()); - addSorting(id, allBaseOverrideGetNameInferiors, baseSorting.getOverrideGetNameInferiors()); - addSorting(id, allBaseAfterGetNameSuperiors, baseSorting.getAfterGetNameSuperiors()); - addSorting(id, allBaseAfterGetNameInferiors, baseSorting.getAfterGetNameInferiors()); - - addSorting(id, allBaseBeforeGetSleepTimerSuperiors, baseSorting.getBeforeGetSleepTimerSuperiors()); - addSorting(id, allBaseBeforeGetSleepTimerInferiors, baseSorting.getBeforeGetSleepTimerInferiors()); - addSorting(id, allBaseOverrideGetSleepTimerSuperiors, baseSorting.getOverrideGetSleepTimerSuperiors()); - addSorting(id, allBaseOverrideGetSleepTimerInferiors, baseSorting.getOverrideGetSleepTimerInferiors()); - addSorting(id, allBaseAfterGetSleepTimerSuperiors, baseSorting.getAfterGetSleepTimerSuperiors()); - addSorting(id, allBaseAfterGetSleepTimerInferiors, baseSorting.getAfterGetSleepTimerInferiors()); - - addSorting(id, allBaseBeforeHandleWaterMovementSuperiors, baseSorting.getBeforeHandleWaterMovementSuperiors()); - addSorting(id, allBaseBeforeHandleWaterMovementInferiors, baseSorting.getBeforeHandleWaterMovementInferiors()); - addSorting(id, allBaseOverrideHandleWaterMovementSuperiors, baseSorting.getOverrideHandleWaterMovementSuperiors()); - addSorting(id, allBaseOverrideHandleWaterMovementInferiors, baseSorting.getOverrideHandleWaterMovementInferiors()); - addSorting(id, allBaseAfterHandleWaterMovementSuperiors, baseSorting.getAfterHandleWaterMovementSuperiors()); - addSorting(id, allBaseAfterHandleWaterMovementInferiors, baseSorting.getAfterHandleWaterMovementInferiors()); - - addSorting(id, allBaseBeforeHealSuperiors, baseSorting.getBeforeHealSuperiors()); - addSorting(id, allBaseBeforeHealInferiors, baseSorting.getBeforeHealInferiors()); - addSorting(id, allBaseOverrideHealSuperiors, baseSorting.getOverrideHealSuperiors()); - addSorting(id, allBaseOverrideHealInferiors, baseSorting.getOverrideHealInferiors()); - addSorting(id, allBaseAfterHealSuperiors, baseSorting.getAfterHealSuperiors()); - addSorting(id, allBaseAfterHealInferiors, baseSorting.getAfterHealInferiors()); - - addSorting(id, allBaseBeforeIsEntityInsideOpaqueBlockSuperiors, baseSorting.getBeforeIsEntityInsideOpaqueBlockSuperiors()); - addSorting(id, allBaseBeforeIsEntityInsideOpaqueBlockInferiors, baseSorting.getBeforeIsEntityInsideOpaqueBlockInferiors()); - addSorting(id, allBaseOverrideIsEntityInsideOpaqueBlockSuperiors, baseSorting.getOverrideIsEntityInsideOpaqueBlockSuperiors()); - addSorting(id, allBaseOverrideIsEntityInsideOpaqueBlockInferiors, baseSorting.getOverrideIsEntityInsideOpaqueBlockInferiors()); - addSorting(id, allBaseAfterIsEntityInsideOpaqueBlockSuperiors, baseSorting.getAfterIsEntityInsideOpaqueBlockSuperiors()); - addSorting(id, allBaseAfterIsEntityInsideOpaqueBlockInferiors, baseSorting.getAfterIsEntityInsideOpaqueBlockInferiors()); - - addSorting(id, allBaseBeforeIsInWaterSuperiors, baseSorting.getBeforeIsInWaterSuperiors()); - addSorting(id, allBaseBeforeIsInWaterInferiors, baseSorting.getBeforeIsInWaterInferiors()); - addSorting(id, allBaseOverrideIsInWaterSuperiors, baseSorting.getOverrideIsInWaterSuperiors()); - addSorting(id, allBaseOverrideIsInWaterInferiors, baseSorting.getOverrideIsInWaterInferiors()); - addSorting(id, allBaseAfterIsInWaterSuperiors, baseSorting.getAfterIsInWaterSuperiors()); - addSorting(id, allBaseAfterIsInWaterInferiors, baseSorting.getAfterIsInWaterInferiors()); - - addSorting(id, allBaseBeforeIsInsideOfMaterialSuperiors, baseSorting.getBeforeIsInsideOfMaterialSuperiors()); - addSorting(id, allBaseBeforeIsInsideOfMaterialInferiors, baseSorting.getBeforeIsInsideOfMaterialInferiors()); - addSorting(id, allBaseOverrideIsInsideOfMaterialSuperiors, baseSorting.getOverrideIsInsideOfMaterialSuperiors()); - addSorting(id, allBaseOverrideIsInsideOfMaterialInferiors, baseSorting.getOverrideIsInsideOfMaterialInferiors()); - addSorting(id, allBaseAfterIsInsideOfMaterialSuperiors, baseSorting.getAfterIsInsideOfMaterialSuperiors()); - addSorting(id, allBaseAfterIsInsideOfMaterialInferiors, baseSorting.getAfterIsInsideOfMaterialInferiors()); - - addSorting(id, allBaseBeforeIsOnLadderSuperiors, baseSorting.getBeforeIsOnLadderSuperiors()); - addSorting(id, allBaseBeforeIsOnLadderInferiors, baseSorting.getBeforeIsOnLadderInferiors()); - addSorting(id, allBaseOverrideIsOnLadderSuperiors, baseSorting.getOverrideIsOnLadderSuperiors()); - addSorting(id, allBaseOverrideIsOnLadderInferiors, baseSorting.getOverrideIsOnLadderInferiors()); - addSorting(id, allBaseAfterIsOnLadderSuperiors, baseSorting.getAfterIsOnLadderSuperiors()); - addSorting(id, allBaseAfterIsOnLadderInferiors, baseSorting.getAfterIsOnLadderInferiors()); - - addSorting(id, allBaseBeforeIsPlayerSleepingSuperiors, baseSorting.getBeforeIsPlayerSleepingSuperiors()); - addSorting(id, allBaseBeforeIsPlayerSleepingInferiors, baseSorting.getBeforeIsPlayerSleepingInferiors()); - addSorting(id, allBaseOverrideIsPlayerSleepingSuperiors, baseSorting.getOverrideIsPlayerSleepingSuperiors()); - addSorting(id, allBaseOverrideIsPlayerSleepingInferiors, baseSorting.getOverrideIsPlayerSleepingInferiors()); - addSorting(id, allBaseAfterIsPlayerSleepingSuperiors, baseSorting.getAfterIsPlayerSleepingSuperiors()); - addSorting(id, allBaseAfterIsPlayerSleepingInferiors, baseSorting.getAfterIsPlayerSleepingInferiors()); - - addSorting(id, allBaseBeforeIsSneakingSuperiors, baseSorting.getBeforeIsSneakingSuperiors()); - addSorting(id, allBaseBeforeIsSneakingInferiors, baseSorting.getBeforeIsSneakingInferiors()); - addSorting(id, allBaseOverrideIsSneakingSuperiors, baseSorting.getOverrideIsSneakingSuperiors()); - addSorting(id, allBaseOverrideIsSneakingInferiors, baseSorting.getOverrideIsSneakingInferiors()); - addSorting(id, allBaseAfterIsSneakingSuperiors, baseSorting.getAfterIsSneakingSuperiors()); - addSorting(id, allBaseAfterIsSneakingInferiors, baseSorting.getAfterIsSneakingInferiors()); - - addSorting(id, allBaseBeforeIsSprintingSuperiors, baseSorting.getBeforeIsSprintingSuperiors()); - addSorting(id, allBaseBeforeIsSprintingInferiors, baseSorting.getBeforeIsSprintingInferiors()); - addSorting(id, allBaseOverrideIsSprintingSuperiors, baseSorting.getOverrideIsSprintingSuperiors()); - addSorting(id, allBaseOverrideIsSprintingInferiors, baseSorting.getOverrideIsSprintingInferiors()); - addSorting(id, allBaseAfterIsSprintingSuperiors, baseSorting.getAfterIsSprintingSuperiors()); - addSorting(id, allBaseAfterIsSprintingInferiors, baseSorting.getAfterIsSprintingInferiors()); - - addSorting(id, allBaseBeforeJumpSuperiors, baseSorting.getBeforeJumpSuperiors()); - addSorting(id, allBaseBeforeJumpInferiors, baseSorting.getBeforeJumpInferiors()); - addSorting(id, allBaseOverrideJumpSuperiors, baseSorting.getOverrideJumpSuperiors()); - addSorting(id, allBaseOverrideJumpInferiors, baseSorting.getOverrideJumpInferiors()); - addSorting(id, allBaseAfterJumpSuperiors, baseSorting.getAfterJumpSuperiors()); - addSorting(id, allBaseAfterJumpInferiors, baseSorting.getAfterJumpInferiors()); - - addSorting(id, allBaseBeforeKnockBackSuperiors, baseSorting.getBeforeKnockBackSuperiors()); - addSorting(id, allBaseBeforeKnockBackInferiors, baseSorting.getBeforeKnockBackInferiors()); - addSorting(id, allBaseOverrideKnockBackSuperiors, baseSorting.getOverrideKnockBackSuperiors()); - addSorting(id, allBaseOverrideKnockBackInferiors, baseSorting.getOverrideKnockBackInferiors()); - addSorting(id, allBaseAfterKnockBackSuperiors, baseSorting.getAfterKnockBackSuperiors()); - addSorting(id, allBaseAfterKnockBackInferiors, baseSorting.getAfterKnockBackInferiors()); - - addSorting(id, allBaseBeforeMoveEntitySuperiors, baseSorting.getBeforeMoveEntitySuperiors()); - addSorting(id, allBaseBeforeMoveEntityInferiors, baseSorting.getBeforeMoveEntityInferiors()); - addSorting(id, allBaseOverrideMoveEntitySuperiors, baseSorting.getOverrideMoveEntitySuperiors()); - addSorting(id, allBaseOverrideMoveEntityInferiors, baseSorting.getOverrideMoveEntityInferiors()); - addSorting(id, allBaseAfterMoveEntitySuperiors, baseSorting.getAfterMoveEntitySuperiors()); - addSorting(id, allBaseAfterMoveEntityInferiors, baseSorting.getAfterMoveEntityInferiors()); - - addSorting(id, allBaseBeforeMoveEntityWithHeadingSuperiors, baseSorting.getBeforeMoveEntityWithHeadingSuperiors()); - addSorting(id, allBaseBeforeMoveEntityWithHeadingInferiors, baseSorting.getBeforeMoveEntityWithHeadingInferiors()); - addSorting(id, allBaseOverrideMoveEntityWithHeadingSuperiors, baseSorting.getOverrideMoveEntityWithHeadingSuperiors()); - addSorting(id, allBaseOverrideMoveEntityWithHeadingInferiors, baseSorting.getOverrideMoveEntityWithHeadingInferiors()); - addSorting(id, allBaseAfterMoveEntityWithHeadingSuperiors, baseSorting.getAfterMoveEntityWithHeadingSuperiors()); - addSorting(id, allBaseAfterMoveEntityWithHeadingInferiors, baseSorting.getAfterMoveEntityWithHeadingInferiors()); - - addSorting(id, allBaseBeforeMoveFlyingSuperiors, baseSorting.getBeforeMoveFlyingSuperiors()); - addSorting(id, allBaseBeforeMoveFlyingInferiors, baseSorting.getBeforeMoveFlyingInferiors()); - addSorting(id, allBaseOverrideMoveFlyingSuperiors, baseSorting.getOverrideMoveFlyingSuperiors()); - addSorting(id, allBaseOverrideMoveFlyingInferiors, baseSorting.getOverrideMoveFlyingInferiors()); - addSorting(id, allBaseAfterMoveFlyingSuperiors, baseSorting.getAfterMoveFlyingSuperiors()); - addSorting(id, allBaseAfterMoveFlyingInferiors, baseSorting.getAfterMoveFlyingInferiors()); - - addSorting(id, allBaseBeforeOnDeathSuperiors, baseSorting.getBeforeOnDeathSuperiors()); - addSorting(id, allBaseBeforeOnDeathInferiors, baseSorting.getBeforeOnDeathInferiors()); - addSorting(id, allBaseOverrideOnDeathSuperiors, baseSorting.getOverrideOnDeathSuperiors()); - addSorting(id, allBaseOverrideOnDeathInferiors, baseSorting.getOverrideOnDeathInferiors()); - addSorting(id, allBaseAfterOnDeathSuperiors, baseSorting.getAfterOnDeathSuperiors()); - addSorting(id, allBaseAfterOnDeathInferiors, baseSorting.getAfterOnDeathInferiors()); - - addSorting(id, allBaseBeforeOnLivingUpdateSuperiors, baseSorting.getBeforeOnLivingUpdateSuperiors()); - addSorting(id, allBaseBeforeOnLivingUpdateInferiors, baseSorting.getBeforeOnLivingUpdateInferiors()); - addSorting(id, allBaseOverrideOnLivingUpdateSuperiors, baseSorting.getOverrideOnLivingUpdateSuperiors()); - addSorting(id, allBaseOverrideOnLivingUpdateInferiors, baseSorting.getOverrideOnLivingUpdateInferiors()); - addSorting(id, allBaseAfterOnLivingUpdateSuperiors, baseSorting.getAfterOnLivingUpdateSuperiors()); - addSorting(id, allBaseAfterOnLivingUpdateInferiors, baseSorting.getAfterOnLivingUpdateInferiors()); - - addSorting(id, allBaseBeforeOnKillEntitySuperiors, baseSorting.getBeforeOnKillEntitySuperiors()); - addSorting(id, allBaseBeforeOnKillEntityInferiors, baseSorting.getBeforeOnKillEntityInferiors()); - addSorting(id, allBaseOverrideOnKillEntitySuperiors, baseSorting.getOverrideOnKillEntitySuperiors()); - addSorting(id, allBaseOverrideOnKillEntityInferiors, baseSorting.getOverrideOnKillEntityInferiors()); - addSorting(id, allBaseAfterOnKillEntitySuperiors, baseSorting.getAfterOnKillEntitySuperiors()); - addSorting(id, allBaseAfterOnKillEntityInferiors, baseSorting.getAfterOnKillEntityInferiors()); - - addSorting(id, allBaseBeforeOnStruckByLightningSuperiors, baseSorting.getBeforeOnStruckByLightningSuperiors()); - addSorting(id, allBaseBeforeOnStruckByLightningInferiors, baseSorting.getBeforeOnStruckByLightningInferiors()); - addSorting(id, allBaseOverrideOnStruckByLightningSuperiors, baseSorting.getOverrideOnStruckByLightningSuperiors()); - addSorting(id, allBaseOverrideOnStruckByLightningInferiors, baseSorting.getOverrideOnStruckByLightningInferiors()); - addSorting(id, allBaseAfterOnStruckByLightningSuperiors, baseSorting.getAfterOnStruckByLightningSuperiors()); - addSorting(id, allBaseAfterOnStruckByLightningInferiors, baseSorting.getAfterOnStruckByLightningInferiors()); - - addSorting(id, allBaseBeforeOnUpdateSuperiors, baseSorting.getBeforeOnUpdateSuperiors()); - addSorting(id, allBaseBeforeOnUpdateInferiors, baseSorting.getBeforeOnUpdateInferiors()); - addSorting(id, allBaseOverrideOnUpdateSuperiors, baseSorting.getOverrideOnUpdateSuperiors()); - addSorting(id, allBaseOverrideOnUpdateInferiors, baseSorting.getOverrideOnUpdateInferiors()); - addSorting(id, allBaseAfterOnUpdateSuperiors, baseSorting.getAfterOnUpdateSuperiors()); - addSorting(id, allBaseAfterOnUpdateInferiors, baseSorting.getAfterOnUpdateInferiors()); - - addSorting(id, allBaseBeforePlayStepSoundSuperiors, baseSorting.getBeforePlayStepSoundSuperiors()); - addSorting(id, allBaseBeforePlayStepSoundInferiors, baseSorting.getBeforePlayStepSoundInferiors()); - addSorting(id, allBaseOverridePlayStepSoundSuperiors, baseSorting.getOverridePlayStepSoundSuperiors()); - addSorting(id, allBaseOverridePlayStepSoundInferiors, baseSorting.getOverridePlayStepSoundInferiors()); - addSorting(id, allBaseAfterPlayStepSoundSuperiors, baseSorting.getAfterPlayStepSoundSuperiors()); - addSorting(id, allBaseAfterPlayStepSoundInferiors, baseSorting.getAfterPlayStepSoundInferiors()); - - addSorting(id, allBaseBeforePushOutOfBlocksSuperiors, baseSorting.getBeforePushOutOfBlocksSuperiors()); - addSorting(id, allBaseBeforePushOutOfBlocksInferiors, baseSorting.getBeforePushOutOfBlocksInferiors()); - addSorting(id, allBaseOverridePushOutOfBlocksSuperiors, baseSorting.getOverridePushOutOfBlocksSuperiors()); - addSorting(id, allBaseOverridePushOutOfBlocksInferiors, baseSorting.getOverridePushOutOfBlocksInferiors()); - addSorting(id, allBaseAfterPushOutOfBlocksSuperiors, baseSorting.getAfterPushOutOfBlocksSuperiors()); - addSorting(id, allBaseAfterPushOutOfBlocksInferiors, baseSorting.getAfterPushOutOfBlocksInferiors()); - - addSorting(id, allBaseBeforeRayTraceSuperiors, baseSorting.getBeforeRayTraceSuperiors()); - addSorting(id, allBaseBeforeRayTraceInferiors, baseSorting.getBeforeRayTraceInferiors()); - addSorting(id, allBaseOverrideRayTraceSuperiors, baseSorting.getOverrideRayTraceSuperiors()); - addSorting(id, allBaseOverrideRayTraceInferiors, baseSorting.getOverrideRayTraceInferiors()); - addSorting(id, allBaseAfterRayTraceSuperiors, baseSorting.getAfterRayTraceSuperiors()); - addSorting(id, allBaseAfterRayTraceInferiors, baseSorting.getAfterRayTraceInferiors()); - - addSorting(id, allBaseBeforeReadEntityFromNBTSuperiors, baseSorting.getBeforeReadEntityFromNBTSuperiors()); - addSorting(id, allBaseBeforeReadEntityFromNBTInferiors, baseSorting.getBeforeReadEntityFromNBTInferiors()); - addSorting(id, allBaseOverrideReadEntityFromNBTSuperiors, baseSorting.getOverrideReadEntityFromNBTSuperiors()); - addSorting(id, allBaseOverrideReadEntityFromNBTInferiors, baseSorting.getOverrideReadEntityFromNBTInferiors()); - addSorting(id, allBaseAfterReadEntityFromNBTSuperiors, baseSorting.getAfterReadEntityFromNBTSuperiors()); - addSorting(id, allBaseAfterReadEntityFromNBTInferiors, baseSorting.getAfterReadEntityFromNBTInferiors()); - - addSorting(id, allBaseBeforeRespawnPlayerSuperiors, baseSorting.getBeforeRespawnPlayerSuperiors()); - addSorting(id, allBaseBeforeRespawnPlayerInferiors, baseSorting.getBeforeRespawnPlayerInferiors()); - addSorting(id, allBaseOverrideRespawnPlayerSuperiors, baseSorting.getOverrideRespawnPlayerSuperiors()); - addSorting(id, allBaseOverrideRespawnPlayerInferiors, baseSorting.getOverrideRespawnPlayerInferiors()); - addSorting(id, allBaseAfterRespawnPlayerSuperiors, baseSorting.getAfterRespawnPlayerSuperiors()); - addSorting(id, allBaseAfterRespawnPlayerInferiors, baseSorting.getAfterRespawnPlayerInferiors()); - - addSorting(id, allBaseBeforeSetDeadSuperiors, baseSorting.getBeforeSetDeadSuperiors()); - addSorting(id, allBaseBeforeSetDeadInferiors, baseSorting.getBeforeSetDeadInferiors()); - addSorting(id, allBaseOverrideSetDeadSuperiors, baseSorting.getOverrideSetDeadSuperiors()); - addSorting(id, allBaseOverrideSetDeadInferiors, baseSorting.getOverrideSetDeadInferiors()); - addSorting(id, allBaseAfterSetDeadSuperiors, baseSorting.getAfterSetDeadSuperiors()); - addSorting(id, allBaseAfterSetDeadInferiors, baseSorting.getAfterSetDeadInferiors()); - - addSorting(id, allBaseBeforeSetPlayerSPHealthSuperiors, baseSorting.getBeforeSetPlayerSPHealthSuperiors()); - addSorting(id, allBaseBeforeSetPlayerSPHealthInferiors, baseSorting.getBeforeSetPlayerSPHealthInferiors()); - addSorting(id, allBaseOverrideSetPlayerSPHealthSuperiors, baseSorting.getOverrideSetPlayerSPHealthSuperiors()); - addSorting(id, allBaseOverrideSetPlayerSPHealthInferiors, baseSorting.getOverrideSetPlayerSPHealthInferiors()); - addSorting(id, allBaseAfterSetPlayerSPHealthSuperiors, baseSorting.getAfterSetPlayerSPHealthSuperiors()); - addSorting(id, allBaseAfterSetPlayerSPHealthInferiors, baseSorting.getAfterSetPlayerSPHealthInferiors()); - - addSorting(id, allBaseBeforeSetPositionAndRotationSuperiors, baseSorting.getBeforeSetPositionAndRotationSuperiors()); - addSorting(id, allBaseBeforeSetPositionAndRotationInferiors, baseSorting.getBeforeSetPositionAndRotationInferiors()); - addSorting(id, allBaseOverrideSetPositionAndRotationSuperiors, baseSorting.getOverrideSetPositionAndRotationSuperiors()); - addSorting(id, allBaseOverrideSetPositionAndRotationInferiors, baseSorting.getOverrideSetPositionAndRotationInferiors()); - addSorting(id, allBaseAfterSetPositionAndRotationSuperiors, baseSorting.getAfterSetPositionAndRotationSuperiors()); - addSorting(id, allBaseAfterSetPositionAndRotationInferiors, baseSorting.getAfterSetPositionAndRotationInferiors()); - - addSorting(id, allBaseBeforeSetSneakingSuperiors, baseSorting.getBeforeSetSneakingSuperiors()); - addSorting(id, allBaseBeforeSetSneakingInferiors, baseSorting.getBeforeSetSneakingInferiors()); - addSorting(id, allBaseOverrideSetSneakingSuperiors, baseSorting.getOverrideSetSneakingSuperiors()); - addSorting(id, allBaseOverrideSetSneakingInferiors, baseSorting.getOverrideSetSneakingInferiors()); - addSorting(id, allBaseAfterSetSneakingSuperiors, baseSorting.getAfterSetSneakingSuperiors()); - addSorting(id, allBaseAfterSetSneakingInferiors, baseSorting.getAfterSetSneakingInferiors()); - - addSorting(id, allBaseBeforeSetSprintingSuperiors, baseSorting.getBeforeSetSprintingSuperiors()); - addSorting(id, allBaseBeforeSetSprintingInferiors, baseSorting.getBeforeSetSprintingInferiors()); - addSorting(id, allBaseOverrideSetSprintingSuperiors, baseSorting.getOverrideSetSprintingSuperiors()); - addSorting(id, allBaseOverrideSetSprintingInferiors, baseSorting.getOverrideSetSprintingInferiors()); - addSorting(id, allBaseAfterSetSprintingSuperiors, baseSorting.getAfterSetSprintingSuperiors()); - addSorting(id, allBaseAfterSetSprintingInferiors, baseSorting.getAfterSetSprintingInferiors()); - - addSorting(id, allBaseBeforeTrySleepSuperiors, baseSorting.getBeforeTrySleepSuperiors()); - addSorting(id, allBaseBeforeTrySleepInferiors, baseSorting.getBeforeTrySleepInferiors()); - addSorting(id, allBaseOverrideTrySleepSuperiors, baseSorting.getOverrideTrySleepSuperiors()); - addSorting(id, allBaseOverrideTrySleepInferiors, baseSorting.getOverrideTrySleepInferiors()); - addSorting(id, allBaseAfterTrySleepSuperiors, baseSorting.getAfterTrySleepSuperiors()); - addSorting(id, allBaseAfterTrySleepInferiors, baseSorting.getAfterTrySleepInferiors()); - - addSorting(id, allBaseBeforeSwingItemSuperiors, baseSorting.getBeforeSwingItemSuperiors()); - addSorting(id, allBaseBeforeSwingItemInferiors, baseSorting.getBeforeSwingItemInferiors()); - addSorting(id, allBaseOverrideSwingItemSuperiors, baseSorting.getOverrideSwingItemSuperiors()); - addSorting(id, allBaseOverrideSwingItemInferiors, baseSorting.getOverrideSwingItemInferiors()); - addSorting(id, allBaseAfterSwingItemSuperiors, baseSorting.getAfterSwingItemSuperiors()); - addSorting(id, allBaseAfterSwingItemInferiors, baseSorting.getAfterSwingItemInferiors()); - - addSorting(id, allBaseBeforeUpdateEntityActionStateSuperiors, baseSorting.getBeforeUpdateEntityActionStateSuperiors()); - addSorting(id, allBaseBeforeUpdateEntityActionStateInferiors, baseSorting.getBeforeUpdateEntityActionStateInferiors()); - addSorting(id, allBaseOverrideUpdateEntityActionStateSuperiors, baseSorting.getOverrideUpdateEntityActionStateSuperiors()); - addSorting(id, allBaseOverrideUpdateEntityActionStateInferiors, baseSorting.getOverrideUpdateEntityActionStateInferiors()); - addSorting(id, allBaseAfterUpdateEntityActionStateSuperiors, baseSorting.getAfterUpdateEntityActionStateSuperiors()); - addSorting(id, allBaseAfterUpdateEntityActionStateInferiors, baseSorting.getAfterUpdateEntityActionStateInferiors()); - - addSorting(id, allBaseBeforeUpdateRiddenSuperiors, baseSorting.getBeforeUpdateRiddenSuperiors()); - addSorting(id, allBaseBeforeUpdateRiddenInferiors, baseSorting.getBeforeUpdateRiddenInferiors()); - addSorting(id, allBaseOverrideUpdateRiddenSuperiors, baseSorting.getOverrideUpdateRiddenSuperiors()); - addSorting(id, allBaseOverrideUpdateRiddenInferiors, baseSorting.getOverrideUpdateRiddenInferiors()); - addSorting(id, allBaseAfterUpdateRiddenSuperiors, baseSorting.getAfterUpdateRiddenSuperiors()); - addSorting(id, allBaseAfterUpdateRiddenInferiors, baseSorting.getAfterUpdateRiddenInferiors()); - - addSorting(id, allBaseBeforeWakeUpPlayerSuperiors, baseSorting.getBeforeWakeUpPlayerSuperiors()); - addSorting(id, allBaseBeforeWakeUpPlayerInferiors, baseSorting.getBeforeWakeUpPlayerInferiors()); - addSorting(id, allBaseOverrideWakeUpPlayerSuperiors, baseSorting.getOverrideWakeUpPlayerSuperiors()); - addSorting(id, allBaseOverrideWakeUpPlayerInferiors, baseSorting.getOverrideWakeUpPlayerInferiors()); - addSorting(id, allBaseAfterWakeUpPlayerSuperiors, baseSorting.getAfterWakeUpPlayerSuperiors()); - addSorting(id, allBaseAfterWakeUpPlayerInferiors, baseSorting.getAfterWakeUpPlayerInferiors()); - - addSorting(id, allBaseBeforeWriteEntityToNBTSuperiors, baseSorting.getBeforeWriteEntityToNBTSuperiors()); - addSorting(id, allBaseBeforeWriteEntityToNBTInferiors, baseSorting.getBeforeWriteEntityToNBTInferiors()); - addSorting(id, allBaseOverrideWriteEntityToNBTSuperiors, baseSorting.getOverrideWriteEntityToNBTSuperiors()); - addSorting(id, allBaseOverrideWriteEntityToNBTInferiors, baseSorting.getOverrideWriteEntityToNBTInferiors()); - addSorting(id, allBaseAfterWriteEntityToNBTSuperiors, baseSorting.getAfterWriteEntityToNBTSuperiors()); - addSorting(id, allBaseAfterWriteEntityToNBTInferiors, baseSorting.getAfterWriteEntityToNBTInferiors()); - - } - - addMethod(id, baseClass, beforeLocalConstructingHookTypes, "beforeLocalConstructing", net.minecraft.client.Minecraft.class, net.minecraft.world.World.class, net.minecraft.client.network.NetHandlerPlayClient.class, net.minecraft.stats.StatisticsManager.class); - addMethod(id, baseClass, afterLocalConstructingHookTypes, "afterLocalConstructing", net.minecraft.client.Minecraft.class, net.minecraft.world.World.class, net.minecraft.client.network.NetHandlerPlayClient.class, net.minecraft.stats.StatisticsManager.class); - - - addMethod(id, baseClass, beforeAddExhaustionHookTypes, "beforeAddExhaustion", float.class); - addMethod(id, baseClass, overrideAddExhaustionHookTypes, "addExhaustion", float.class); - addMethod(id, baseClass, afterAddExhaustionHookTypes, "afterAddExhaustion", float.class); - - addMethod(id, baseClass, beforeAddMovementStatHookTypes, "beforeAddMovementStat", double.class, double.class, double.class); - addMethod(id, baseClass, overrideAddMovementStatHookTypes, "addMovementStat", double.class, double.class, double.class); - addMethod(id, baseClass, afterAddMovementStatHookTypes, "afterAddMovementStat", double.class, double.class, double.class); - - addMethod(id, baseClass, beforeAddStatHookTypes, "beforeAddStat", net.minecraft.stats.StatBase.class, int.class); - addMethod(id, baseClass, overrideAddStatHookTypes, "addStat", net.minecraft.stats.StatBase.class, int.class); - addMethod(id, baseClass, afterAddStatHookTypes, "afterAddStat", net.minecraft.stats.StatBase.class, int.class); - - addMethod(id, baseClass, beforeAttackEntityFromHookTypes, "beforeAttackEntityFrom", net.minecraft.util.DamageSource.class, float.class); - addMethod(id, baseClass, overrideAttackEntityFromHookTypes, "attackEntityFrom", net.minecraft.util.DamageSource.class, float.class); - addMethod(id, baseClass, afterAttackEntityFromHookTypes, "afterAttackEntityFrom", net.minecraft.util.DamageSource.class, float.class); - - addMethod(id, baseClass, beforeAttackTargetEntityWithCurrentItemHookTypes, "beforeAttackTargetEntityWithCurrentItem", net.minecraft.entity.Entity.class); - addMethod(id, baseClass, overrideAttackTargetEntityWithCurrentItemHookTypes, "attackTargetEntityWithCurrentItem", net.minecraft.entity.Entity.class); - addMethod(id, baseClass, afterAttackTargetEntityWithCurrentItemHookTypes, "afterAttackTargetEntityWithCurrentItem", net.minecraft.entity.Entity.class); - - addMethod(id, baseClass, beforeCanBreatheUnderwaterHookTypes, "beforeCanBreatheUnderwater"); - addMethod(id, baseClass, overrideCanBreatheUnderwaterHookTypes, "canBreatheUnderwater"); - addMethod(id, baseClass, afterCanBreatheUnderwaterHookTypes, "afterCanBreatheUnderwater"); - - addMethod(id, baseClass, beforeCanHarvestBlockHookTypes, "beforeCanHarvestBlock", net.minecraft.block.state.IBlockState.class); - addMethod(id, baseClass, overrideCanHarvestBlockHookTypes, "canHarvestBlock", net.minecraft.block.state.IBlockState.class); - addMethod(id, baseClass, afterCanHarvestBlockHookTypes, "afterCanHarvestBlock", net.minecraft.block.state.IBlockState.class); - - addMethod(id, baseClass, beforeCanPlayerEditHookTypes, "beforeCanPlayerEdit", net.minecraft.util.math.BlockPos.class, net.minecraft.util.EnumFacing.class, net.minecraft.item.ItemStack.class); - addMethod(id, baseClass, overrideCanPlayerEditHookTypes, "canPlayerEdit", net.minecraft.util.math.BlockPos.class, net.minecraft.util.EnumFacing.class, net.minecraft.item.ItemStack.class); - addMethod(id, baseClass, afterCanPlayerEditHookTypes, "afterCanPlayerEdit", net.minecraft.util.math.BlockPos.class, net.minecraft.util.EnumFacing.class, net.minecraft.item.ItemStack.class); - - addMethod(id, baseClass, beforeCanTriggerWalkingHookTypes, "beforeCanTriggerWalking"); - addMethod(id, baseClass, overrideCanTriggerWalkingHookTypes, "canTriggerWalking"); - addMethod(id, baseClass, afterCanTriggerWalkingHookTypes, "afterCanTriggerWalking"); - - addMethod(id, baseClass, beforeCloseScreenHookTypes, "beforeCloseScreen"); - addMethod(id, baseClass, overrideCloseScreenHookTypes, "closeScreen"); - addMethod(id, baseClass, afterCloseScreenHookTypes, "afterCloseScreen"); - - addMethod(id, baseClass, beforeDamageEntityHookTypes, "beforeDamageEntity", net.minecraft.util.DamageSource.class, float.class); - addMethod(id, baseClass, overrideDamageEntityHookTypes, "damageEntity", net.minecraft.util.DamageSource.class, float.class); - addMethod(id, baseClass, afterDamageEntityHookTypes, "afterDamageEntity", net.minecraft.util.DamageSource.class, float.class); - - addMethod(id, baseClass, beforeDisplayGuiHookTypes, "beforeDisplayGui", net.minecraft.world.IInteractionObject.class); - addMethod(id, baseClass, overrideDisplayGuiHookTypes, "displayGui", net.minecraft.world.IInteractionObject.class); - addMethod(id, baseClass, afterDisplayGuiHookTypes, "afterDisplayGui", net.minecraft.world.IInteractionObject.class); - - addMethod(id, baseClass, beforeDisplayGUIChestHookTypes, "beforeDisplayGUIChest", net.minecraft.inventory.IInventory.class); - addMethod(id, baseClass, overrideDisplayGUIChestHookTypes, "displayGUIChest", net.minecraft.inventory.IInventory.class); - addMethod(id, baseClass, afterDisplayGUIChestHookTypes, "afterDisplayGUIChest", net.minecraft.inventory.IInventory.class); - - addMethod(id, baseClass, beforeDropItemHookTypes, "beforeDropItem", net.minecraft.item.ItemStack.class, boolean.class, boolean.class); - addMethod(id, baseClass, overrideDropItemHookTypes, "dropItem", net.minecraft.item.ItemStack.class, boolean.class, boolean.class); - addMethod(id, baseClass, afterDropItemHookTypes, "afterDropItem", net.minecraft.item.ItemStack.class, boolean.class, boolean.class); - - addMethod(id, baseClass, beforeDropOneItemHookTypes, "beforeDropOneItem", boolean.class); - addMethod(id, baseClass, overrideDropOneItemHookTypes, "dropOneItem", boolean.class); - addMethod(id, baseClass, afterDropOneItemHookTypes, "afterDropOneItem", boolean.class); - - addMethod(id, baseClass, beforeDropPlayerItemWithRandomChoiceHookTypes, "beforeDropPlayerItemWithRandomChoice", net.minecraft.item.ItemStack.class, boolean.class); - addMethod(id, baseClass, overrideDropPlayerItemWithRandomChoiceHookTypes, "dropPlayerItemWithRandomChoice", net.minecraft.item.ItemStack.class, boolean.class); - addMethod(id, baseClass, afterDropPlayerItemWithRandomChoiceHookTypes, "afterDropPlayerItemWithRandomChoice", net.minecraft.item.ItemStack.class, boolean.class); - - addMethod(id, baseClass, beforeFallHookTypes, "beforeFall", float.class, float.class); - addMethod(id, baseClass, overrideFallHookTypes, "fall", float.class, float.class); - addMethod(id, baseClass, afterFallHookTypes, "afterFall", float.class, float.class); - - addMethod(id, baseClass, beforeGetAIMoveSpeedHookTypes, "beforeGetAIMoveSpeed"); - addMethod(id, baseClass, overrideGetAIMoveSpeedHookTypes, "getAIMoveSpeed"); - addMethod(id, baseClass, afterGetAIMoveSpeedHookTypes, "afterGetAIMoveSpeed"); - - addMethod(id, baseClass, beforeGetBedOrientationInDegreesHookTypes, "beforeGetBedOrientationInDegrees"); - addMethod(id, baseClass, overrideGetBedOrientationInDegreesHookTypes, "getBedOrientationInDegrees"); - addMethod(id, baseClass, afterGetBedOrientationInDegreesHookTypes, "afterGetBedOrientationInDegrees"); - - addMethod(id, baseClass, beforeGetBrightnessHookTypes, "beforeGetBrightness", float.class); - addMethod(id, baseClass, overrideGetBrightnessHookTypes, "getBrightness", float.class); - addMethod(id, baseClass, afterGetBrightnessHookTypes, "afterGetBrightness", float.class); - - addMethod(id, baseClass, beforeGetBrightnessForRenderHookTypes, "beforeGetBrightnessForRender", float.class); - addMethod(id, baseClass, overrideGetBrightnessForRenderHookTypes, "getBrightnessForRender", float.class); - addMethod(id, baseClass, afterGetBrightnessForRenderHookTypes, "afterGetBrightnessForRender", float.class); - - addMethod(id, baseClass, beforeGetBreakSpeedHookTypes, "beforeGetBreakSpeed", net.minecraft.block.state.IBlockState.class, net.minecraft.util.math.BlockPos.class); - addMethod(id, baseClass, overrideGetBreakSpeedHookTypes, "getBreakSpeed", net.minecraft.block.state.IBlockState.class, net.minecraft.util.math.BlockPos.class); - addMethod(id, baseClass, afterGetBreakSpeedHookTypes, "afterGetBreakSpeed", net.minecraft.block.state.IBlockState.class, net.minecraft.util.math.BlockPos.class); - - addMethod(id, baseClass, beforeGetDistanceSqHookTypes, "beforeGetDistanceSq", double.class, double.class, double.class); - addMethod(id, baseClass, overrideGetDistanceSqHookTypes, "getDistanceSq", double.class, double.class, double.class); - addMethod(id, baseClass, afterGetDistanceSqHookTypes, "afterGetDistanceSq", double.class, double.class, double.class); - - addMethod(id, baseClass, beforeGetDistanceSqToEntityHookTypes, "beforeGetDistanceSqToEntity", net.minecraft.entity.Entity.class); - addMethod(id, baseClass, overrideGetDistanceSqToEntityHookTypes, "getDistanceSqToEntity", net.minecraft.entity.Entity.class); - addMethod(id, baseClass, afterGetDistanceSqToEntityHookTypes, "afterGetDistanceSqToEntity", net.minecraft.entity.Entity.class); - - addMethod(id, baseClass, beforeGetFovModifierHookTypes, "beforeGetFovModifier"); - addMethod(id, baseClass, overrideGetFovModifierHookTypes, "getFovModifier"); - addMethod(id, baseClass, afterGetFovModifierHookTypes, "afterGetFovModifier"); - - addMethod(id, baseClass, beforeGetHurtSoundHookTypes, "beforeGetHurtSound"); - addMethod(id, baseClass, overrideGetHurtSoundHookTypes, "getHurtSound"); - addMethod(id, baseClass, afterGetHurtSoundHookTypes, "afterGetHurtSound"); - - addMethod(id, baseClass, beforeGetNameHookTypes, "beforeGetName"); - addMethod(id, baseClass, overrideGetNameHookTypes, "getName"); - addMethod(id, baseClass, afterGetNameHookTypes, "afterGetName"); - - addMethod(id, baseClass, beforeGetSleepTimerHookTypes, "beforeGetSleepTimer"); - addMethod(id, baseClass, overrideGetSleepTimerHookTypes, "getSleepTimer"); - addMethod(id, baseClass, afterGetSleepTimerHookTypes, "afterGetSleepTimer"); - - addMethod(id, baseClass, beforeHandleWaterMovementHookTypes, "beforeHandleWaterMovement"); - addMethod(id, baseClass, overrideHandleWaterMovementHookTypes, "handleWaterMovement"); - addMethod(id, baseClass, afterHandleWaterMovementHookTypes, "afterHandleWaterMovement"); - - addMethod(id, baseClass, beforeHealHookTypes, "beforeHeal", float.class); - addMethod(id, baseClass, overrideHealHookTypes, "heal", float.class); - addMethod(id, baseClass, afterHealHookTypes, "afterHeal", float.class); - - addMethod(id, baseClass, beforeIsEntityInsideOpaqueBlockHookTypes, "beforeIsEntityInsideOpaqueBlock"); - addMethod(id, baseClass, overrideIsEntityInsideOpaqueBlockHookTypes, "isEntityInsideOpaqueBlock"); - addMethod(id, baseClass, afterIsEntityInsideOpaqueBlockHookTypes, "afterIsEntityInsideOpaqueBlock"); - - addMethod(id, baseClass, beforeIsInWaterHookTypes, "beforeIsInWater"); - addMethod(id, baseClass, overrideIsInWaterHookTypes, "isInWater"); - addMethod(id, baseClass, afterIsInWaterHookTypes, "afterIsInWater"); - - addMethod(id, baseClass, beforeIsInsideOfMaterialHookTypes, "beforeIsInsideOfMaterial", net.minecraft.block.material.Material.class); - addMethod(id, baseClass, overrideIsInsideOfMaterialHookTypes, "isInsideOfMaterial", net.minecraft.block.material.Material.class); - addMethod(id, baseClass, afterIsInsideOfMaterialHookTypes, "afterIsInsideOfMaterial", net.minecraft.block.material.Material.class); - - addMethod(id, baseClass, beforeIsOnLadderHookTypes, "beforeIsOnLadder"); - addMethod(id, baseClass, overrideIsOnLadderHookTypes, "isOnLadder"); - addMethod(id, baseClass, afterIsOnLadderHookTypes, "afterIsOnLadder"); - - addMethod(id, baseClass, beforeIsPlayerSleepingHookTypes, "beforeIsPlayerSleeping"); - addMethod(id, baseClass, overrideIsPlayerSleepingHookTypes, "isPlayerSleeping"); - addMethod(id, baseClass, afterIsPlayerSleepingHookTypes, "afterIsPlayerSleeping"); - - addMethod(id, baseClass, beforeIsSneakingHookTypes, "beforeIsSneaking"); - addMethod(id, baseClass, overrideIsSneakingHookTypes, "isSneaking"); - addMethod(id, baseClass, afterIsSneakingHookTypes, "afterIsSneaking"); - - addMethod(id, baseClass, beforeIsSprintingHookTypes, "beforeIsSprinting"); - addMethod(id, baseClass, overrideIsSprintingHookTypes, "isSprinting"); - addMethod(id, baseClass, afterIsSprintingHookTypes, "afterIsSprinting"); - - addMethod(id, baseClass, beforeJumpHookTypes, "beforeJump"); - addMethod(id, baseClass, overrideJumpHookTypes, "jump"); - addMethod(id, baseClass, afterJumpHookTypes, "afterJump"); - - addMethod(id, baseClass, beforeKnockBackHookTypes, "beforeKnockBack", net.minecraft.entity.Entity.class, float.class, double.class, double.class); - addMethod(id, baseClass, overrideKnockBackHookTypes, "knockBack", net.minecraft.entity.Entity.class, float.class, double.class, double.class); - addMethod(id, baseClass, afterKnockBackHookTypes, "afterKnockBack", net.minecraft.entity.Entity.class, float.class, double.class, double.class); - - addMethod(id, baseClass, beforeMoveEntityHookTypes, "beforeMoveEntity", double.class, double.class, double.class); - addMethod(id, baseClass, overrideMoveEntityHookTypes, "moveEntity", double.class, double.class, double.class); - addMethod(id, baseClass, afterMoveEntityHookTypes, "afterMoveEntity", double.class, double.class, double.class); - - addMethod(id, baseClass, beforeMoveEntityWithHeadingHookTypes, "beforeMoveEntityWithHeading", float.class, float.class); - addMethod(id, baseClass, overrideMoveEntityWithHeadingHookTypes, "moveEntityWithHeading", float.class, float.class); - addMethod(id, baseClass, afterMoveEntityWithHeadingHookTypes, "afterMoveEntityWithHeading", float.class, float.class); - - addMethod(id, baseClass, beforeMoveFlyingHookTypes, "beforeMoveFlying", float.class, float.class, float.class); - addMethod(id, baseClass, overrideMoveFlyingHookTypes, "moveFlying", float.class, float.class, float.class); - addMethod(id, baseClass, afterMoveFlyingHookTypes, "afterMoveFlying", float.class, float.class, float.class); - - addMethod(id, baseClass, beforeOnDeathHookTypes, "beforeOnDeath", net.minecraft.util.DamageSource.class); - addMethod(id, baseClass, overrideOnDeathHookTypes, "onDeath", net.minecraft.util.DamageSource.class); - addMethod(id, baseClass, afterOnDeathHookTypes, "afterOnDeath", net.minecraft.util.DamageSource.class); - - addMethod(id, baseClass, beforeOnLivingUpdateHookTypes, "beforeOnLivingUpdate"); - addMethod(id, baseClass, overrideOnLivingUpdateHookTypes, "onLivingUpdate"); - addMethod(id, baseClass, afterOnLivingUpdateHookTypes, "afterOnLivingUpdate"); - - addMethod(id, baseClass, beforeOnKillEntityHookTypes, "beforeOnKillEntity", net.minecraft.entity.EntityLivingBase.class); - addMethod(id, baseClass, overrideOnKillEntityHookTypes, "onKillEntity", net.minecraft.entity.EntityLivingBase.class); - addMethod(id, baseClass, afterOnKillEntityHookTypes, "afterOnKillEntity", net.minecraft.entity.EntityLivingBase.class); - - addMethod(id, baseClass, beforeOnStruckByLightningHookTypes, "beforeOnStruckByLightning", net.minecraft.entity.effect.EntityLightningBolt.class); - addMethod(id, baseClass, overrideOnStruckByLightningHookTypes, "onStruckByLightning", net.minecraft.entity.effect.EntityLightningBolt.class); - addMethod(id, baseClass, afterOnStruckByLightningHookTypes, "afterOnStruckByLightning", net.minecraft.entity.effect.EntityLightningBolt.class); - - addMethod(id, baseClass, beforeOnUpdateHookTypes, "beforeOnUpdate"); - addMethod(id, baseClass, overrideOnUpdateHookTypes, "onUpdate"); - addMethod(id, baseClass, afterOnUpdateHookTypes, "afterOnUpdate"); - - addMethod(id, baseClass, beforePlayStepSoundHookTypes, "beforePlayStepSound", net.minecraft.util.math.BlockPos.class, net.minecraft.block.Block.class); - addMethod(id, baseClass, overridePlayStepSoundHookTypes, "playStepSound", net.minecraft.util.math.BlockPos.class, net.minecraft.block.Block.class); - addMethod(id, baseClass, afterPlayStepSoundHookTypes, "afterPlayStepSound", net.minecraft.util.math.BlockPos.class, net.minecraft.block.Block.class); - - addMethod(id, baseClass, beforePushOutOfBlocksHookTypes, "beforePushOutOfBlocks", double.class, double.class, double.class); - addMethod(id, baseClass, overridePushOutOfBlocksHookTypes, "pushOutOfBlocks", double.class, double.class, double.class); - addMethod(id, baseClass, afterPushOutOfBlocksHookTypes, "afterPushOutOfBlocks", double.class, double.class, double.class); - - addMethod(id, baseClass, beforeRayTraceHookTypes, "beforeRayTrace", double.class, float.class); - addMethod(id, baseClass, overrideRayTraceHookTypes, "rayTrace", double.class, float.class); - addMethod(id, baseClass, afterRayTraceHookTypes, "afterRayTrace", double.class, float.class); - - addMethod(id, baseClass, beforeReadEntityFromNBTHookTypes, "beforeReadEntityFromNBT", net.minecraft.nbt.NBTTagCompound.class); - addMethod(id, baseClass, overrideReadEntityFromNBTHookTypes, "readEntityFromNBT", net.minecraft.nbt.NBTTagCompound.class); - addMethod(id, baseClass, afterReadEntityFromNBTHookTypes, "afterReadEntityFromNBT", net.minecraft.nbt.NBTTagCompound.class); - - addMethod(id, baseClass, beforeRespawnPlayerHookTypes, "beforeRespawnPlayer"); - addMethod(id, baseClass, overrideRespawnPlayerHookTypes, "respawnPlayer"); - addMethod(id, baseClass, afterRespawnPlayerHookTypes, "afterRespawnPlayer"); - - addMethod(id, baseClass, beforeSetDeadHookTypes, "beforeSetDead"); - addMethod(id, baseClass, overrideSetDeadHookTypes, "setDead"); - addMethod(id, baseClass, afterSetDeadHookTypes, "afterSetDead"); - - addMethod(id, baseClass, beforeSetPlayerSPHealthHookTypes, "beforeSetPlayerSPHealth", float.class); - addMethod(id, baseClass, overrideSetPlayerSPHealthHookTypes, "setPlayerSPHealth", float.class); - addMethod(id, baseClass, afterSetPlayerSPHealthHookTypes, "afterSetPlayerSPHealth", float.class); - - addMethod(id, baseClass, beforeSetPositionAndRotationHookTypes, "beforeSetPositionAndRotation", double.class, double.class, double.class, float.class, float.class); - addMethod(id, baseClass, overrideSetPositionAndRotationHookTypes, "setPositionAndRotation", double.class, double.class, double.class, float.class, float.class); - addMethod(id, baseClass, afterSetPositionAndRotationHookTypes, "afterSetPositionAndRotation", double.class, double.class, double.class, float.class, float.class); - - addMethod(id, baseClass, beforeSetSneakingHookTypes, "beforeSetSneaking", boolean.class); - addMethod(id, baseClass, overrideSetSneakingHookTypes, "setSneaking", boolean.class); - addMethod(id, baseClass, afterSetSneakingHookTypes, "afterSetSneaking", boolean.class); - - addMethod(id, baseClass, beforeSetSprintingHookTypes, "beforeSetSprinting", boolean.class); - addMethod(id, baseClass, overrideSetSprintingHookTypes, "setSprinting", boolean.class); - addMethod(id, baseClass, afterSetSprintingHookTypes, "afterSetSprinting", boolean.class); - - addMethod(id, baseClass, beforeTrySleepHookTypes, "beforeTrySleep", net.minecraft.util.math.BlockPos.class); - addMethod(id, baseClass, overrideTrySleepHookTypes, "trySleep", net.minecraft.util.math.BlockPos.class); - addMethod(id, baseClass, afterTrySleepHookTypes, "afterTrySleep", net.minecraft.util.math.BlockPos.class); - - addMethod(id, baseClass, beforeSwingItemHookTypes, "beforeSwingItem", net.minecraft.util.EnumHand.class); - addMethod(id, baseClass, overrideSwingItemHookTypes, "swingItem", net.minecraft.util.EnumHand.class); - addMethod(id, baseClass, afterSwingItemHookTypes, "afterSwingItem", net.minecraft.util.EnumHand.class); - - addMethod(id, baseClass, beforeUpdateEntityActionStateHookTypes, "beforeUpdateEntityActionState"); - addMethod(id, baseClass, overrideUpdateEntityActionStateHookTypes, "updateEntityActionState"); - addMethod(id, baseClass, afterUpdateEntityActionStateHookTypes, "afterUpdateEntityActionState"); - - addMethod(id, baseClass, beforeUpdateRiddenHookTypes, "beforeUpdateRidden"); - addMethod(id, baseClass, overrideUpdateRiddenHookTypes, "updateRidden"); - addMethod(id, baseClass, afterUpdateRiddenHookTypes, "afterUpdateRidden"); - - addMethod(id, baseClass, beforeWakeUpPlayerHookTypes, "beforeWakeUpPlayer", boolean.class, boolean.class, boolean.class); - addMethod(id, baseClass, overrideWakeUpPlayerHookTypes, "wakeUpPlayer", boolean.class, boolean.class, boolean.class); - addMethod(id, baseClass, afterWakeUpPlayerHookTypes, "afterWakeUpPlayer", boolean.class, boolean.class, boolean.class); - - addMethod(id, baseClass, beforeWriteEntityToNBTHookTypes, "beforeWriteEntityToNBT", net.minecraft.nbt.NBTTagCompound.class); - addMethod(id, baseClass, overrideWriteEntityToNBTHookTypes, "writeEntityToNBT", net.minecraft.nbt.NBTTagCompound.class); - addMethod(id, baseClass, afterWriteEntityToNBTHookTypes, "afterWriteEntityToNBT", net.minecraft.nbt.NBTTagCompound.class); - - - addDynamicMethods(id, baseClass); - - addDynamicKeys(id, baseClass, beforeDynamicHookMethods, beforeDynamicHookTypes); - addDynamicKeys(id, baseClass, overrideDynamicHookMethods, overrideDynamicHookTypes); - addDynamicKeys(id, baseClass, afterDynamicHookMethods, afterDynamicHookTypes); - - initialize(); - - for(IClientPlayerAPI instance : getAllInstancesList()) - instance.getClientPlayerAPI().attachClientPlayerBase(id); - - System.out.println("Client Player: registered " + id); - logger.fine("Client Player: registered class '" + baseClass.getName() + "' with id '" + id + "'"); - - initialized = false; - } - - public static boolean unregister(String id) - { - if(id == null) - return false; - - Constructor constructor = allBaseConstructors.remove(id); - if(constructor == null) - return false; - - for(IClientPlayerAPI instance : getAllInstancesList()) - instance.getClientPlayerAPI().detachClientPlayerBase(id); - - beforeLocalConstructingHookTypes.remove(id); - afterLocalConstructingHookTypes.remove(id); - - allBaseBeforeAddExhaustionSuperiors.remove(id); - allBaseBeforeAddExhaustionInferiors.remove(id); - allBaseOverrideAddExhaustionSuperiors.remove(id); - allBaseOverrideAddExhaustionInferiors.remove(id); - allBaseAfterAddExhaustionSuperiors.remove(id); - allBaseAfterAddExhaustionInferiors.remove(id); - - beforeAddExhaustionHookTypes.remove(id); - overrideAddExhaustionHookTypes.remove(id); - afterAddExhaustionHookTypes.remove(id); - - allBaseBeforeAddMovementStatSuperiors.remove(id); - allBaseBeforeAddMovementStatInferiors.remove(id); - allBaseOverrideAddMovementStatSuperiors.remove(id); - allBaseOverrideAddMovementStatInferiors.remove(id); - allBaseAfterAddMovementStatSuperiors.remove(id); - allBaseAfterAddMovementStatInferiors.remove(id); - - beforeAddMovementStatHookTypes.remove(id); - overrideAddMovementStatHookTypes.remove(id); - afterAddMovementStatHookTypes.remove(id); - - allBaseBeforeAddStatSuperiors.remove(id); - allBaseBeforeAddStatInferiors.remove(id); - allBaseOverrideAddStatSuperiors.remove(id); - allBaseOverrideAddStatInferiors.remove(id); - allBaseAfterAddStatSuperiors.remove(id); - allBaseAfterAddStatInferiors.remove(id); - - beforeAddStatHookTypes.remove(id); - overrideAddStatHookTypes.remove(id); - afterAddStatHookTypes.remove(id); - - allBaseBeforeAttackEntityFromSuperiors.remove(id); - allBaseBeforeAttackEntityFromInferiors.remove(id); - allBaseOverrideAttackEntityFromSuperiors.remove(id); - allBaseOverrideAttackEntityFromInferiors.remove(id); - allBaseAfterAttackEntityFromSuperiors.remove(id); - allBaseAfterAttackEntityFromInferiors.remove(id); - - beforeAttackEntityFromHookTypes.remove(id); - overrideAttackEntityFromHookTypes.remove(id); - afterAttackEntityFromHookTypes.remove(id); - - allBaseBeforeAttackTargetEntityWithCurrentItemSuperiors.remove(id); - allBaseBeforeAttackTargetEntityWithCurrentItemInferiors.remove(id); - allBaseOverrideAttackTargetEntityWithCurrentItemSuperiors.remove(id); - allBaseOverrideAttackTargetEntityWithCurrentItemInferiors.remove(id); - allBaseAfterAttackTargetEntityWithCurrentItemSuperiors.remove(id); - allBaseAfterAttackTargetEntityWithCurrentItemInferiors.remove(id); - - beforeAttackTargetEntityWithCurrentItemHookTypes.remove(id); - overrideAttackTargetEntityWithCurrentItemHookTypes.remove(id); - afterAttackTargetEntityWithCurrentItemHookTypes.remove(id); - - allBaseBeforeCanBreatheUnderwaterSuperiors.remove(id); - allBaseBeforeCanBreatheUnderwaterInferiors.remove(id); - allBaseOverrideCanBreatheUnderwaterSuperiors.remove(id); - allBaseOverrideCanBreatheUnderwaterInferiors.remove(id); - allBaseAfterCanBreatheUnderwaterSuperiors.remove(id); - allBaseAfterCanBreatheUnderwaterInferiors.remove(id); - - beforeCanBreatheUnderwaterHookTypes.remove(id); - overrideCanBreatheUnderwaterHookTypes.remove(id); - afterCanBreatheUnderwaterHookTypes.remove(id); - - allBaseBeforeCanHarvestBlockSuperiors.remove(id); - allBaseBeforeCanHarvestBlockInferiors.remove(id); - allBaseOverrideCanHarvestBlockSuperiors.remove(id); - allBaseOverrideCanHarvestBlockInferiors.remove(id); - allBaseAfterCanHarvestBlockSuperiors.remove(id); - allBaseAfterCanHarvestBlockInferiors.remove(id); - - beforeCanHarvestBlockHookTypes.remove(id); - overrideCanHarvestBlockHookTypes.remove(id); - afterCanHarvestBlockHookTypes.remove(id); - - allBaseBeforeCanPlayerEditSuperiors.remove(id); - allBaseBeforeCanPlayerEditInferiors.remove(id); - allBaseOverrideCanPlayerEditSuperiors.remove(id); - allBaseOverrideCanPlayerEditInferiors.remove(id); - allBaseAfterCanPlayerEditSuperiors.remove(id); - allBaseAfterCanPlayerEditInferiors.remove(id); - - beforeCanPlayerEditHookTypes.remove(id); - overrideCanPlayerEditHookTypes.remove(id); - afterCanPlayerEditHookTypes.remove(id); - - allBaseBeforeCanTriggerWalkingSuperiors.remove(id); - allBaseBeforeCanTriggerWalkingInferiors.remove(id); - allBaseOverrideCanTriggerWalkingSuperiors.remove(id); - allBaseOverrideCanTriggerWalkingInferiors.remove(id); - allBaseAfterCanTriggerWalkingSuperiors.remove(id); - allBaseAfterCanTriggerWalkingInferiors.remove(id); - - beforeCanTriggerWalkingHookTypes.remove(id); - overrideCanTriggerWalkingHookTypes.remove(id); - afterCanTriggerWalkingHookTypes.remove(id); - - allBaseBeforeCloseScreenSuperiors.remove(id); - allBaseBeforeCloseScreenInferiors.remove(id); - allBaseOverrideCloseScreenSuperiors.remove(id); - allBaseOverrideCloseScreenInferiors.remove(id); - allBaseAfterCloseScreenSuperiors.remove(id); - allBaseAfterCloseScreenInferiors.remove(id); - - beforeCloseScreenHookTypes.remove(id); - overrideCloseScreenHookTypes.remove(id); - afterCloseScreenHookTypes.remove(id); - - allBaseBeforeDamageEntitySuperiors.remove(id); - allBaseBeforeDamageEntityInferiors.remove(id); - allBaseOverrideDamageEntitySuperiors.remove(id); - allBaseOverrideDamageEntityInferiors.remove(id); - allBaseAfterDamageEntitySuperiors.remove(id); - allBaseAfterDamageEntityInferiors.remove(id); - - beforeDamageEntityHookTypes.remove(id); - overrideDamageEntityHookTypes.remove(id); - afterDamageEntityHookTypes.remove(id); - - allBaseBeforeDisplayGuiSuperiors.remove(id); - allBaseBeforeDisplayGuiInferiors.remove(id); - allBaseOverrideDisplayGuiSuperiors.remove(id); - allBaseOverrideDisplayGuiInferiors.remove(id); - allBaseAfterDisplayGuiSuperiors.remove(id); - allBaseAfterDisplayGuiInferiors.remove(id); - - beforeDisplayGuiHookTypes.remove(id); - overrideDisplayGuiHookTypes.remove(id); - afterDisplayGuiHookTypes.remove(id); - - allBaseBeforeDisplayGUIChestSuperiors.remove(id); - allBaseBeforeDisplayGUIChestInferiors.remove(id); - allBaseOverrideDisplayGUIChestSuperiors.remove(id); - allBaseOverrideDisplayGUIChestInferiors.remove(id); - allBaseAfterDisplayGUIChestSuperiors.remove(id); - allBaseAfterDisplayGUIChestInferiors.remove(id); - - beforeDisplayGUIChestHookTypes.remove(id); - overrideDisplayGUIChestHookTypes.remove(id); - afterDisplayGUIChestHookTypes.remove(id); - - allBaseBeforeDropItemSuperiors.remove(id); - allBaseBeforeDropItemInferiors.remove(id); - allBaseOverrideDropItemSuperiors.remove(id); - allBaseOverrideDropItemInferiors.remove(id); - allBaseAfterDropItemSuperiors.remove(id); - allBaseAfterDropItemInferiors.remove(id); - - beforeDropItemHookTypes.remove(id); - overrideDropItemHookTypes.remove(id); - afterDropItemHookTypes.remove(id); - - allBaseBeforeDropOneItemSuperiors.remove(id); - allBaseBeforeDropOneItemInferiors.remove(id); - allBaseOverrideDropOneItemSuperiors.remove(id); - allBaseOverrideDropOneItemInferiors.remove(id); - allBaseAfterDropOneItemSuperiors.remove(id); - allBaseAfterDropOneItemInferiors.remove(id); - - beforeDropOneItemHookTypes.remove(id); - overrideDropOneItemHookTypes.remove(id); - afterDropOneItemHookTypes.remove(id); - - allBaseBeforeDropPlayerItemWithRandomChoiceSuperiors.remove(id); - allBaseBeforeDropPlayerItemWithRandomChoiceInferiors.remove(id); - allBaseOverrideDropPlayerItemWithRandomChoiceSuperiors.remove(id); - allBaseOverrideDropPlayerItemWithRandomChoiceInferiors.remove(id); - allBaseAfterDropPlayerItemWithRandomChoiceSuperiors.remove(id); - allBaseAfterDropPlayerItemWithRandomChoiceInferiors.remove(id); - - beforeDropPlayerItemWithRandomChoiceHookTypes.remove(id); - overrideDropPlayerItemWithRandomChoiceHookTypes.remove(id); - afterDropPlayerItemWithRandomChoiceHookTypes.remove(id); - - allBaseBeforeFallSuperiors.remove(id); - allBaseBeforeFallInferiors.remove(id); - allBaseOverrideFallSuperiors.remove(id); - allBaseOverrideFallInferiors.remove(id); - allBaseAfterFallSuperiors.remove(id); - allBaseAfterFallInferiors.remove(id); - - beforeFallHookTypes.remove(id); - overrideFallHookTypes.remove(id); - afterFallHookTypes.remove(id); - - allBaseBeforeGetAIMoveSpeedSuperiors.remove(id); - allBaseBeforeGetAIMoveSpeedInferiors.remove(id); - allBaseOverrideGetAIMoveSpeedSuperiors.remove(id); - allBaseOverrideGetAIMoveSpeedInferiors.remove(id); - allBaseAfterGetAIMoveSpeedSuperiors.remove(id); - allBaseAfterGetAIMoveSpeedInferiors.remove(id); - - beforeGetAIMoveSpeedHookTypes.remove(id); - overrideGetAIMoveSpeedHookTypes.remove(id); - afterGetAIMoveSpeedHookTypes.remove(id); - - allBaseBeforeGetBedOrientationInDegreesSuperiors.remove(id); - allBaseBeforeGetBedOrientationInDegreesInferiors.remove(id); - allBaseOverrideGetBedOrientationInDegreesSuperiors.remove(id); - allBaseOverrideGetBedOrientationInDegreesInferiors.remove(id); - allBaseAfterGetBedOrientationInDegreesSuperiors.remove(id); - allBaseAfterGetBedOrientationInDegreesInferiors.remove(id); - - beforeGetBedOrientationInDegreesHookTypes.remove(id); - overrideGetBedOrientationInDegreesHookTypes.remove(id); - afterGetBedOrientationInDegreesHookTypes.remove(id); - - allBaseBeforeGetBrightnessSuperiors.remove(id); - allBaseBeforeGetBrightnessInferiors.remove(id); - allBaseOverrideGetBrightnessSuperiors.remove(id); - allBaseOverrideGetBrightnessInferiors.remove(id); - allBaseAfterGetBrightnessSuperiors.remove(id); - allBaseAfterGetBrightnessInferiors.remove(id); - - beforeGetBrightnessHookTypes.remove(id); - overrideGetBrightnessHookTypes.remove(id); - afterGetBrightnessHookTypes.remove(id); - - allBaseBeforeGetBrightnessForRenderSuperiors.remove(id); - allBaseBeforeGetBrightnessForRenderInferiors.remove(id); - allBaseOverrideGetBrightnessForRenderSuperiors.remove(id); - allBaseOverrideGetBrightnessForRenderInferiors.remove(id); - allBaseAfterGetBrightnessForRenderSuperiors.remove(id); - allBaseAfterGetBrightnessForRenderInferiors.remove(id); - - beforeGetBrightnessForRenderHookTypes.remove(id); - overrideGetBrightnessForRenderHookTypes.remove(id); - afterGetBrightnessForRenderHookTypes.remove(id); - - allBaseBeforeGetBreakSpeedSuperiors.remove(id); - allBaseBeforeGetBreakSpeedInferiors.remove(id); - allBaseOverrideGetBreakSpeedSuperiors.remove(id); - allBaseOverrideGetBreakSpeedInferiors.remove(id); - allBaseAfterGetBreakSpeedSuperiors.remove(id); - allBaseAfterGetBreakSpeedInferiors.remove(id); - - beforeGetBreakSpeedHookTypes.remove(id); - overrideGetBreakSpeedHookTypes.remove(id); - afterGetBreakSpeedHookTypes.remove(id); - - allBaseBeforeGetDistanceSqSuperiors.remove(id); - allBaseBeforeGetDistanceSqInferiors.remove(id); - allBaseOverrideGetDistanceSqSuperiors.remove(id); - allBaseOverrideGetDistanceSqInferiors.remove(id); - allBaseAfterGetDistanceSqSuperiors.remove(id); - allBaseAfterGetDistanceSqInferiors.remove(id); - - beforeGetDistanceSqHookTypes.remove(id); - overrideGetDistanceSqHookTypes.remove(id); - afterGetDistanceSqHookTypes.remove(id); - - allBaseBeforeGetDistanceSqToEntitySuperiors.remove(id); - allBaseBeforeGetDistanceSqToEntityInferiors.remove(id); - allBaseOverrideGetDistanceSqToEntitySuperiors.remove(id); - allBaseOverrideGetDistanceSqToEntityInferiors.remove(id); - allBaseAfterGetDistanceSqToEntitySuperiors.remove(id); - allBaseAfterGetDistanceSqToEntityInferiors.remove(id); - - beforeGetDistanceSqToEntityHookTypes.remove(id); - overrideGetDistanceSqToEntityHookTypes.remove(id); - afterGetDistanceSqToEntityHookTypes.remove(id); - - allBaseBeforeGetFovModifierSuperiors.remove(id); - allBaseBeforeGetFovModifierInferiors.remove(id); - allBaseOverrideGetFovModifierSuperiors.remove(id); - allBaseOverrideGetFovModifierInferiors.remove(id); - allBaseAfterGetFovModifierSuperiors.remove(id); - allBaseAfterGetFovModifierInferiors.remove(id); - - beforeGetFovModifierHookTypes.remove(id); - overrideGetFovModifierHookTypes.remove(id); - afterGetFovModifierHookTypes.remove(id); - - allBaseBeforeGetHurtSoundSuperiors.remove(id); - allBaseBeforeGetHurtSoundInferiors.remove(id); - allBaseOverrideGetHurtSoundSuperiors.remove(id); - allBaseOverrideGetHurtSoundInferiors.remove(id); - allBaseAfterGetHurtSoundSuperiors.remove(id); - allBaseAfterGetHurtSoundInferiors.remove(id); - - beforeGetHurtSoundHookTypes.remove(id); - overrideGetHurtSoundHookTypes.remove(id); - afterGetHurtSoundHookTypes.remove(id); - - allBaseBeforeGetNameSuperiors.remove(id); - allBaseBeforeGetNameInferiors.remove(id); - allBaseOverrideGetNameSuperiors.remove(id); - allBaseOverrideGetNameInferiors.remove(id); - allBaseAfterGetNameSuperiors.remove(id); - allBaseAfterGetNameInferiors.remove(id); - - beforeGetNameHookTypes.remove(id); - overrideGetNameHookTypes.remove(id); - afterGetNameHookTypes.remove(id); - - allBaseBeforeGetSleepTimerSuperiors.remove(id); - allBaseBeforeGetSleepTimerInferiors.remove(id); - allBaseOverrideGetSleepTimerSuperiors.remove(id); - allBaseOverrideGetSleepTimerInferiors.remove(id); - allBaseAfterGetSleepTimerSuperiors.remove(id); - allBaseAfterGetSleepTimerInferiors.remove(id); - - beforeGetSleepTimerHookTypes.remove(id); - overrideGetSleepTimerHookTypes.remove(id); - afterGetSleepTimerHookTypes.remove(id); - - allBaseBeforeHandleWaterMovementSuperiors.remove(id); - allBaseBeforeHandleWaterMovementInferiors.remove(id); - allBaseOverrideHandleWaterMovementSuperiors.remove(id); - allBaseOverrideHandleWaterMovementInferiors.remove(id); - allBaseAfterHandleWaterMovementSuperiors.remove(id); - allBaseAfterHandleWaterMovementInferiors.remove(id); - - beforeHandleWaterMovementHookTypes.remove(id); - overrideHandleWaterMovementHookTypes.remove(id); - afterHandleWaterMovementHookTypes.remove(id); - - allBaseBeforeHealSuperiors.remove(id); - allBaseBeforeHealInferiors.remove(id); - allBaseOverrideHealSuperiors.remove(id); - allBaseOverrideHealInferiors.remove(id); - allBaseAfterHealSuperiors.remove(id); - allBaseAfterHealInferiors.remove(id); - - beforeHealHookTypes.remove(id); - overrideHealHookTypes.remove(id); - afterHealHookTypes.remove(id); - - allBaseBeforeIsEntityInsideOpaqueBlockSuperiors.remove(id); - allBaseBeforeIsEntityInsideOpaqueBlockInferiors.remove(id); - allBaseOverrideIsEntityInsideOpaqueBlockSuperiors.remove(id); - allBaseOverrideIsEntityInsideOpaqueBlockInferiors.remove(id); - allBaseAfterIsEntityInsideOpaqueBlockSuperiors.remove(id); - allBaseAfterIsEntityInsideOpaqueBlockInferiors.remove(id); - - beforeIsEntityInsideOpaqueBlockHookTypes.remove(id); - overrideIsEntityInsideOpaqueBlockHookTypes.remove(id); - afterIsEntityInsideOpaqueBlockHookTypes.remove(id); - - allBaseBeforeIsInWaterSuperiors.remove(id); - allBaseBeforeIsInWaterInferiors.remove(id); - allBaseOverrideIsInWaterSuperiors.remove(id); - allBaseOverrideIsInWaterInferiors.remove(id); - allBaseAfterIsInWaterSuperiors.remove(id); - allBaseAfterIsInWaterInferiors.remove(id); - - beforeIsInWaterHookTypes.remove(id); - overrideIsInWaterHookTypes.remove(id); - afterIsInWaterHookTypes.remove(id); - - allBaseBeforeIsInsideOfMaterialSuperiors.remove(id); - allBaseBeforeIsInsideOfMaterialInferiors.remove(id); - allBaseOverrideIsInsideOfMaterialSuperiors.remove(id); - allBaseOverrideIsInsideOfMaterialInferiors.remove(id); - allBaseAfterIsInsideOfMaterialSuperiors.remove(id); - allBaseAfterIsInsideOfMaterialInferiors.remove(id); - - beforeIsInsideOfMaterialHookTypes.remove(id); - overrideIsInsideOfMaterialHookTypes.remove(id); - afterIsInsideOfMaterialHookTypes.remove(id); - - allBaseBeforeIsOnLadderSuperiors.remove(id); - allBaseBeforeIsOnLadderInferiors.remove(id); - allBaseOverrideIsOnLadderSuperiors.remove(id); - allBaseOverrideIsOnLadderInferiors.remove(id); - allBaseAfterIsOnLadderSuperiors.remove(id); - allBaseAfterIsOnLadderInferiors.remove(id); - - beforeIsOnLadderHookTypes.remove(id); - overrideIsOnLadderHookTypes.remove(id); - afterIsOnLadderHookTypes.remove(id); - - allBaseBeforeIsPlayerSleepingSuperiors.remove(id); - allBaseBeforeIsPlayerSleepingInferiors.remove(id); - allBaseOverrideIsPlayerSleepingSuperiors.remove(id); - allBaseOverrideIsPlayerSleepingInferiors.remove(id); - allBaseAfterIsPlayerSleepingSuperiors.remove(id); - allBaseAfterIsPlayerSleepingInferiors.remove(id); - - beforeIsPlayerSleepingHookTypes.remove(id); - overrideIsPlayerSleepingHookTypes.remove(id); - afterIsPlayerSleepingHookTypes.remove(id); - - allBaseBeforeIsSneakingSuperiors.remove(id); - allBaseBeforeIsSneakingInferiors.remove(id); - allBaseOverrideIsSneakingSuperiors.remove(id); - allBaseOverrideIsSneakingInferiors.remove(id); - allBaseAfterIsSneakingSuperiors.remove(id); - allBaseAfterIsSneakingInferiors.remove(id); - - beforeIsSneakingHookTypes.remove(id); - overrideIsSneakingHookTypes.remove(id); - afterIsSneakingHookTypes.remove(id); - - allBaseBeforeIsSprintingSuperiors.remove(id); - allBaseBeforeIsSprintingInferiors.remove(id); - allBaseOverrideIsSprintingSuperiors.remove(id); - allBaseOverrideIsSprintingInferiors.remove(id); - allBaseAfterIsSprintingSuperiors.remove(id); - allBaseAfterIsSprintingInferiors.remove(id); - - beforeIsSprintingHookTypes.remove(id); - overrideIsSprintingHookTypes.remove(id); - afterIsSprintingHookTypes.remove(id); - - allBaseBeforeJumpSuperiors.remove(id); - allBaseBeforeJumpInferiors.remove(id); - allBaseOverrideJumpSuperiors.remove(id); - allBaseOverrideJumpInferiors.remove(id); - allBaseAfterJumpSuperiors.remove(id); - allBaseAfterJumpInferiors.remove(id); - - beforeJumpHookTypes.remove(id); - overrideJumpHookTypes.remove(id); - afterJumpHookTypes.remove(id); - - allBaseBeforeKnockBackSuperiors.remove(id); - allBaseBeforeKnockBackInferiors.remove(id); - allBaseOverrideKnockBackSuperiors.remove(id); - allBaseOverrideKnockBackInferiors.remove(id); - allBaseAfterKnockBackSuperiors.remove(id); - allBaseAfterKnockBackInferiors.remove(id); - - beforeKnockBackHookTypes.remove(id); - overrideKnockBackHookTypes.remove(id); - afterKnockBackHookTypes.remove(id); - - allBaseBeforeMoveEntitySuperiors.remove(id); - allBaseBeforeMoveEntityInferiors.remove(id); - allBaseOverrideMoveEntitySuperiors.remove(id); - allBaseOverrideMoveEntityInferiors.remove(id); - allBaseAfterMoveEntitySuperiors.remove(id); - allBaseAfterMoveEntityInferiors.remove(id); - - beforeMoveEntityHookTypes.remove(id); - overrideMoveEntityHookTypes.remove(id); - afterMoveEntityHookTypes.remove(id); - - allBaseBeforeMoveEntityWithHeadingSuperiors.remove(id); - allBaseBeforeMoveEntityWithHeadingInferiors.remove(id); - allBaseOverrideMoveEntityWithHeadingSuperiors.remove(id); - allBaseOverrideMoveEntityWithHeadingInferiors.remove(id); - allBaseAfterMoveEntityWithHeadingSuperiors.remove(id); - allBaseAfterMoveEntityWithHeadingInferiors.remove(id); - - beforeMoveEntityWithHeadingHookTypes.remove(id); - overrideMoveEntityWithHeadingHookTypes.remove(id); - afterMoveEntityWithHeadingHookTypes.remove(id); - - allBaseBeforeMoveFlyingSuperiors.remove(id); - allBaseBeforeMoveFlyingInferiors.remove(id); - allBaseOverrideMoveFlyingSuperiors.remove(id); - allBaseOverrideMoveFlyingInferiors.remove(id); - allBaseAfterMoveFlyingSuperiors.remove(id); - allBaseAfterMoveFlyingInferiors.remove(id); - - beforeMoveFlyingHookTypes.remove(id); - overrideMoveFlyingHookTypes.remove(id); - afterMoveFlyingHookTypes.remove(id); - - allBaseBeforeOnDeathSuperiors.remove(id); - allBaseBeforeOnDeathInferiors.remove(id); - allBaseOverrideOnDeathSuperiors.remove(id); - allBaseOverrideOnDeathInferiors.remove(id); - allBaseAfterOnDeathSuperiors.remove(id); - allBaseAfterOnDeathInferiors.remove(id); - - beforeOnDeathHookTypes.remove(id); - overrideOnDeathHookTypes.remove(id); - afterOnDeathHookTypes.remove(id); - - allBaseBeforeOnLivingUpdateSuperiors.remove(id); - allBaseBeforeOnLivingUpdateInferiors.remove(id); - allBaseOverrideOnLivingUpdateSuperiors.remove(id); - allBaseOverrideOnLivingUpdateInferiors.remove(id); - allBaseAfterOnLivingUpdateSuperiors.remove(id); - allBaseAfterOnLivingUpdateInferiors.remove(id); - - beforeOnLivingUpdateHookTypes.remove(id); - overrideOnLivingUpdateHookTypes.remove(id); - afterOnLivingUpdateHookTypes.remove(id); - - allBaseBeforeOnKillEntitySuperiors.remove(id); - allBaseBeforeOnKillEntityInferiors.remove(id); - allBaseOverrideOnKillEntitySuperiors.remove(id); - allBaseOverrideOnKillEntityInferiors.remove(id); - allBaseAfterOnKillEntitySuperiors.remove(id); - allBaseAfterOnKillEntityInferiors.remove(id); - - beforeOnKillEntityHookTypes.remove(id); - overrideOnKillEntityHookTypes.remove(id); - afterOnKillEntityHookTypes.remove(id); - - allBaseBeforeOnStruckByLightningSuperiors.remove(id); - allBaseBeforeOnStruckByLightningInferiors.remove(id); - allBaseOverrideOnStruckByLightningSuperiors.remove(id); - allBaseOverrideOnStruckByLightningInferiors.remove(id); - allBaseAfterOnStruckByLightningSuperiors.remove(id); - allBaseAfterOnStruckByLightningInferiors.remove(id); - - beforeOnStruckByLightningHookTypes.remove(id); - overrideOnStruckByLightningHookTypes.remove(id); - afterOnStruckByLightningHookTypes.remove(id); - - allBaseBeforeOnUpdateSuperiors.remove(id); - allBaseBeforeOnUpdateInferiors.remove(id); - allBaseOverrideOnUpdateSuperiors.remove(id); - allBaseOverrideOnUpdateInferiors.remove(id); - allBaseAfterOnUpdateSuperiors.remove(id); - allBaseAfterOnUpdateInferiors.remove(id); - - beforeOnUpdateHookTypes.remove(id); - overrideOnUpdateHookTypes.remove(id); - afterOnUpdateHookTypes.remove(id); - - allBaseBeforePlayStepSoundSuperiors.remove(id); - allBaseBeforePlayStepSoundInferiors.remove(id); - allBaseOverridePlayStepSoundSuperiors.remove(id); - allBaseOverridePlayStepSoundInferiors.remove(id); - allBaseAfterPlayStepSoundSuperiors.remove(id); - allBaseAfterPlayStepSoundInferiors.remove(id); - - beforePlayStepSoundHookTypes.remove(id); - overridePlayStepSoundHookTypes.remove(id); - afterPlayStepSoundHookTypes.remove(id); - - allBaseBeforePushOutOfBlocksSuperiors.remove(id); - allBaseBeforePushOutOfBlocksInferiors.remove(id); - allBaseOverridePushOutOfBlocksSuperiors.remove(id); - allBaseOverridePushOutOfBlocksInferiors.remove(id); - allBaseAfterPushOutOfBlocksSuperiors.remove(id); - allBaseAfterPushOutOfBlocksInferiors.remove(id); - - beforePushOutOfBlocksHookTypes.remove(id); - overridePushOutOfBlocksHookTypes.remove(id); - afterPushOutOfBlocksHookTypes.remove(id); - - allBaseBeforeRayTraceSuperiors.remove(id); - allBaseBeforeRayTraceInferiors.remove(id); - allBaseOverrideRayTraceSuperiors.remove(id); - allBaseOverrideRayTraceInferiors.remove(id); - allBaseAfterRayTraceSuperiors.remove(id); - allBaseAfterRayTraceInferiors.remove(id); - - beforeRayTraceHookTypes.remove(id); - overrideRayTraceHookTypes.remove(id); - afterRayTraceHookTypes.remove(id); - - allBaseBeforeReadEntityFromNBTSuperiors.remove(id); - allBaseBeforeReadEntityFromNBTInferiors.remove(id); - allBaseOverrideReadEntityFromNBTSuperiors.remove(id); - allBaseOverrideReadEntityFromNBTInferiors.remove(id); - allBaseAfterReadEntityFromNBTSuperiors.remove(id); - allBaseAfterReadEntityFromNBTInferiors.remove(id); - - beforeReadEntityFromNBTHookTypes.remove(id); - overrideReadEntityFromNBTHookTypes.remove(id); - afterReadEntityFromNBTHookTypes.remove(id); - - allBaseBeforeRespawnPlayerSuperiors.remove(id); - allBaseBeforeRespawnPlayerInferiors.remove(id); - allBaseOverrideRespawnPlayerSuperiors.remove(id); - allBaseOverrideRespawnPlayerInferiors.remove(id); - allBaseAfterRespawnPlayerSuperiors.remove(id); - allBaseAfterRespawnPlayerInferiors.remove(id); - - beforeRespawnPlayerHookTypes.remove(id); - overrideRespawnPlayerHookTypes.remove(id); - afterRespawnPlayerHookTypes.remove(id); - - allBaseBeforeSetDeadSuperiors.remove(id); - allBaseBeforeSetDeadInferiors.remove(id); - allBaseOverrideSetDeadSuperiors.remove(id); - allBaseOverrideSetDeadInferiors.remove(id); - allBaseAfterSetDeadSuperiors.remove(id); - allBaseAfterSetDeadInferiors.remove(id); - - beforeSetDeadHookTypes.remove(id); - overrideSetDeadHookTypes.remove(id); - afterSetDeadHookTypes.remove(id); - - allBaseBeforeSetPlayerSPHealthSuperiors.remove(id); - allBaseBeforeSetPlayerSPHealthInferiors.remove(id); - allBaseOverrideSetPlayerSPHealthSuperiors.remove(id); - allBaseOverrideSetPlayerSPHealthInferiors.remove(id); - allBaseAfterSetPlayerSPHealthSuperiors.remove(id); - allBaseAfterSetPlayerSPHealthInferiors.remove(id); - - beforeSetPlayerSPHealthHookTypes.remove(id); - overrideSetPlayerSPHealthHookTypes.remove(id); - afterSetPlayerSPHealthHookTypes.remove(id); - - allBaseBeforeSetPositionAndRotationSuperiors.remove(id); - allBaseBeforeSetPositionAndRotationInferiors.remove(id); - allBaseOverrideSetPositionAndRotationSuperiors.remove(id); - allBaseOverrideSetPositionAndRotationInferiors.remove(id); - allBaseAfterSetPositionAndRotationSuperiors.remove(id); - allBaseAfterSetPositionAndRotationInferiors.remove(id); - - beforeSetPositionAndRotationHookTypes.remove(id); - overrideSetPositionAndRotationHookTypes.remove(id); - afterSetPositionAndRotationHookTypes.remove(id); - - allBaseBeforeSetSneakingSuperiors.remove(id); - allBaseBeforeSetSneakingInferiors.remove(id); - allBaseOverrideSetSneakingSuperiors.remove(id); - allBaseOverrideSetSneakingInferiors.remove(id); - allBaseAfterSetSneakingSuperiors.remove(id); - allBaseAfterSetSneakingInferiors.remove(id); - - beforeSetSneakingHookTypes.remove(id); - overrideSetSneakingHookTypes.remove(id); - afterSetSneakingHookTypes.remove(id); - - allBaseBeforeSetSprintingSuperiors.remove(id); - allBaseBeforeSetSprintingInferiors.remove(id); - allBaseOverrideSetSprintingSuperiors.remove(id); - allBaseOverrideSetSprintingInferiors.remove(id); - allBaseAfterSetSprintingSuperiors.remove(id); - allBaseAfterSetSprintingInferiors.remove(id); - - beforeSetSprintingHookTypes.remove(id); - overrideSetSprintingHookTypes.remove(id); - afterSetSprintingHookTypes.remove(id); - - allBaseBeforeTrySleepSuperiors.remove(id); - allBaseBeforeTrySleepInferiors.remove(id); - allBaseOverrideTrySleepSuperiors.remove(id); - allBaseOverrideTrySleepInferiors.remove(id); - allBaseAfterTrySleepSuperiors.remove(id); - allBaseAfterTrySleepInferiors.remove(id); - - beforeTrySleepHookTypes.remove(id); - overrideTrySleepHookTypes.remove(id); - afterTrySleepHookTypes.remove(id); - - allBaseBeforeSwingItemSuperiors.remove(id); - allBaseBeforeSwingItemInferiors.remove(id); - allBaseOverrideSwingItemSuperiors.remove(id); - allBaseOverrideSwingItemInferiors.remove(id); - allBaseAfterSwingItemSuperiors.remove(id); - allBaseAfterSwingItemInferiors.remove(id); - - beforeSwingItemHookTypes.remove(id); - overrideSwingItemHookTypes.remove(id); - afterSwingItemHookTypes.remove(id); - - allBaseBeforeUpdateEntityActionStateSuperiors.remove(id); - allBaseBeforeUpdateEntityActionStateInferiors.remove(id); - allBaseOverrideUpdateEntityActionStateSuperiors.remove(id); - allBaseOverrideUpdateEntityActionStateInferiors.remove(id); - allBaseAfterUpdateEntityActionStateSuperiors.remove(id); - allBaseAfterUpdateEntityActionStateInferiors.remove(id); - - beforeUpdateEntityActionStateHookTypes.remove(id); - overrideUpdateEntityActionStateHookTypes.remove(id); - afterUpdateEntityActionStateHookTypes.remove(id); - - allBaseBeforeUpdateRiddenSuperiors.remove(id); - allBaseBeforeUpdateRiddenInferiors.remove(id); - allBaseOverrideUpdateRiddenSuperiors.remove(id); - allBaseOverrideUpdateRiddenInferiors.remove(id); - allBaseAfterUpdateRiddenSuperiors.remove(id); - allBaseAfterUpdateRiddenInferiors.remove(id); - - beforeUpdateRiddenHookTypes.remove(id); - overrideUpdateRiddenHookTypes.remove(id); - afterUpdateRiddenHookTypes.remove(id); - - allBaseBeforeWakeUpPlayerSuperiors.remove(id); - allBaseBeforeWakeUpPlayerInferiors.remove(id); - allBaseOverrideWakeUpPlayerSuperiors.remove(id); - allBaseOverrideWakeUpPlayerInferiors.remove(id); - allBaseAfterWakeUpPlayerSuperiors.remove(id); - allBaseAfterWakeUpPlayerInferiors.remove(id); - - beforeWakeUpPlayerHookTypes.remove(id); - overrideWakeUpPlayerHookTypes.remove(id); - afterWakeUpPlayerHookTypes.remove(id); - - allBaseBeforeWriteEntityToNBTSuperiors.remove(id); - allBaseBeforeWriteEntityToNBTInferiors.remove(id); - allBaseOverrideWriteEntityToNBTSuperiors.remove(id); - allBaseOverrideWriteEntityToNBTInferiors.remove(id); - allBaseAfterWriteEntityToNBTSuperiors.remove(id); - allBaseAfterWriteEntityToNBTInferiors.remove(id); - - beforeWriteEntityToNBTHookTypes.remove(id); - overrideWriteEntityToNBTHookTypes.remove(id); - afterWriteEntityToNBTHookTypes.remove(id); - - for(IClientPlayerAPI instance : getAllInstancesList()) - instance.getClientPlayerAPI().updateClientPlayerBases(); - - Iterator iterator = keysToVirtualIds.keySet().iterator(); - while(iterator.hasNext()) - { - String key = iterator.next(); - if(keysToVirtualIds.get(key).equals(id)) - keysToVirtualIds.remove(key); - } - - boolean otherFound = false; - Class type = constructor.getDeclaringClass(); - - iterator = allBaseConstructors.keySet().iterator(); - while(iterator.hasNext()) - { - String otherId = iterator.next(); - Class otherType = allBaseConstructors.get(otherId).getDeclaringClass(); - if(!otherId.equals(id) && otherType.equals(type)) - { - otherFound = true; - break; - } - } - - if(!otherFound) - { - dynamicTypes.remove(type); - - virtualDynamicHookMethods.remove(type); - - beforeDynamicHookMethods.remove(type); - overrideDynamicHookMethods.remove(type); - afterDynamicHookMethods.remove(type); - } - - removeDynamicHookTypes(id, beforeDynamicHookTypes); - removeDynamicHookTypes(id, overrideDynamicHookTypes); - removeDynamicHookTypes(id, afterDynamicHookTypes); - - allBaseBeforeDynamicSuperiors.remove(id); - allBaseBeforeDynamicInferiors.remove(id); - allBaseOverrideDynamicSuperiors.remove(id); - allBaseOverrideDynamicInferiors.remove(id); - allBaseAfterDynamicSuperiors.remove(id); - allBaseAfterDynamicInferiors.remove(id); - - log("ClientPlayerAPI: unregistered id '" + id + "'"); - - return true; - } - - public static void removeDynamicHookTypes(String id, Map> map) - { - Iterator keys = map.keySet().iterator(); - while(keys.hasNext()) - map.get(keys.next()).remove(id); - } - - public static Set getRegisteredIds() - { - return unmodifiableAllIds; - } - - private static void addSorting(String id, Map map, String[] values) - { - if(values != null && values.length > 0) - map.put(id, values); - } - - private static void addDynamicSorting(String id, Map> map, Map values) - { - if(values != null && values.size() > 0) - map.put(id, values); - } - - private static boolean addMethod(String id, Class baseClass, List list, String methodName, Class... _parameterTypes) - { - try - { - Method method = baseClass.getMethod(methodName, _parameterTypes); - boolean isOverridden = method.getDeclaringClass() != ClientPlayerBase.class; - if(isOverridden) - list.add(id); - return isOverridden; - } - catch(Exception e) - { - throw new RuntimeException("Can not reflect method '" + methodName + "' of class '" + baseClass.getName() + "'", e); - } - } - - private static void addDynamicMethods(String id, Class baseClass) - { - if(!dynamicTypes.add(baseClass)) - return; - - Map virtuals = null; - Map befores = null; - Map overrides = null; - Map afters = null; - - Method[] methods = baseClass.getDeclaredMethods(); - for(int i=0; i= 8 && name.substring(0, 8).equalsIgnoreCase("override")) - { - name = name.substring(8); - override = true; - } - else if(name.length() >= 6 && name.substring(0, 6).equalsIgnoreCase("before")) - { - before = true; - name = name.substring(6); - } - else if(name.length() >= 5 && name.substring(0, 5).equalsIgnoreCase("after")) - { - after = true; - name = name.substring(5); - } - } - - if(name.length() >= 1 && (before || virtual || override || after)) - name = name.substring(0,1).toLowerCase() + name.substring(1); - - while(name.charAt(0) == '_') - name = name.substring(1); - - if(name.length() == 0) - throw new RuntimeException("Can not process dynamic hook method with no key"); - - keys.add(name); - - if(virtual) - { - if(keysToVirtualIds.containsKey(name)) - throw new RuntimeException("Can not process more than one dynamic virtual method"); - - keysToVirtualIds.put(name, id); - virtuals = addDynamicMethod(name, method, virtuals); - } - else if(before) - befores = addDynamicMethod(name, method, befores); - else if(after) - afters = addDynamicMethod(name, method, afters); - else - overrides = addDynamicMethod(name, method, overrides); - } - - if(virtuals != null) - virtualDynamicHookMethods.put(baseClass, virtuals); - if(befores != null) - beforeDynamicHookMethods.put(baseClass, befores); - if(overrides != null) - overrideDynamicHookMethods.put(baseClass, overrides); - if(afters != null) - afterDynamicHookMethods.put(baseClass, afters); - } - - private static void addDynamicKeys(String id, Class baseClass, Map, Map> dynamicHookMethods, Map> dynamicHookTypes) - { - Map methods = dynamicHookMethods.get(baseClass); - if(methods == null || methods.size() == 0) - return; - - Iterator keys = methods.keySet().iterator(); - while(keys.hasNext()) - { - String key = keys.next(); - if(!dynamicHookTypes.containsKey(key)) - dynamicHookTypes.put(key, new ArrayList(1)); - dynamicHookTypes.get(key).add(id); - } - } - - private static Map addDynamicMethod(String key, Method method, Map methods) - { - if(methods == null) - methods = new HashMap(); - if(methods.containsKey(key)) - throw new RuntimeException("method with key '" + key + "' allready exists"); - methods.put(key, method); - return methods; - } - - public static ClientPlayerAPI create(IClientPlayerAPI clientPlayer) - { - if(allBaseConstructors.size() > 0 && !initialized) - initialize(); - return new ClientPlayerAPI(clientPlayer); - } - - private static void initialize() - { - sortBases(beforeLocalConstructingHookTypes, allBaseBeforeLocalConstructingSuperiors, allBaseBeforeLocalConstructingInferiors, "beforeLocalConstructing"); - sortBases(afterLocalConstructingHookTypes, allBaseAfterLocalConstructingSuperiors, allBaseAfterLocalConstructingInferiors, "afterLocalConstructing"); - - Iterator keyIterator = keys.iterator(); - while(keyIterator.hasNext()) - { - String key = keyIterator.next(); - sortDynamicBases(beforeDynamicHookTypes, allBaseBeforeDynamicSuperiors, allBaseBeforeDynamicInferiors, key); - sortDynamicBases(overrideDynamicHookTypes, allBaseOverrideDynamicSuperiors, allBaseOverrideDynamicInferiors, key); - sortDynamicBases(afterDynamicHookTypes, allBaseAfterDynamicSuperiors, allBaseAfterDynamicInferiors, key); - } - - sortBases(beforeAddExhaustionHookTypes, allBaseBeforeAddExhaustionSuperiors, allBaseBeforeAddExhaustionInferiors, "beforeAddExhaustion"); - sortBases(overrideAddExhaustionHookTypes, allBaseOverrideAddExhaustionSuperiors, allBaseOverrideAddExhaustionInferiors, "overrideAddExhaustion"); - sortBases(afterAddExhaustionHookTypes, allBaseAfterAddExhaustionSuperiors, allBaseAfterAddExhaustionInferiors, "afterAddExhaustion"); - - sortBases(beforeAddMovementStatHookTypes, allBaseBeforeAddMovementStatSuperiors, allBaseBeforeAddMovementStatInferiors, "beforeAddMovementStat"); - sortBases(overrideAddMovementStatHookTypes, allBaseOverrideAddMovementStatSuperiors, allBaseOverrideAddMovementStatInferiors, "overrideAddMovementStat"); - sortBases(afterAddMovementStatHookTypes, allBaseAfterAddMovementStatSuperiors, allBaseAfterAddMovementStatInferiors, "afterAddMovementStat"); - - sortBases(beforeAddStatHookTypes, allBaseBeforeAddStatSuperiors, allBaseBeforeAddStatInferiors, "beforeAddStat"); - sortBases(overrideAddStatHookTypes, allBaseOverrideAddStatSuperiors, allBaseOverrideAddStatInferiors, "overrideAddStat"); - sortBases(afterAddStatHookTypes, allBaseAfterAddStatSuperiors, allBaseAfterAddStatInferiors, "afterAddStat"); - - sortBases(beforeAttackEntityFromHookTypes, allBaseBeforeAttackEntityFromSuperiors, allBaseBeforeAttackEntityFromInferiors, "beforeAttackEntityFrom"); - sortBases(overrideAttackEntityFromHookTypes, allBaseOverrideAttackEntityFromSuperiors, allBaseOverrideAttackEntityFromInferiors, "overrideAttackEntityFrom"); - sortBases(afterAttackEntityFromHookTypes, allBaseAfterAttackEntityFromSuperiors, allBaseAfterAttackEntityFromInferiors, "afterAttackEntityFrom"); - - sortBases(beforeAttackTargetEntityWithCurrentItemHookTypes, allBaseBeforeAttackTargetEntityWithCurrentItemSuperiors, allBaseBeforeAttackTargetEntityWithCurrentItemInferiors, "beforeAttackTargetEntityWithCurrentItem"); - sortBases(overrideAttackTargetEntityWithCurrentItemHookTypes, allBaseOverrideAttackTargetEntityWithCurrentItemSuperiors, allBaseOverrideAttackTargetEntityWithCurrentItemInferiors, "overrideAttackTargetEntityWithCurrentItem"); - sortBases(afterAttackTargetEntityWithCurrentItemHookTypes, allBaseAfterAttackTargetEntityWithCurrentItemSuperiors, allBaseAfterAttackTargetEntityWithCurrentItemInferiors, "afterAttackTargetEntityWithCurrentItem"); - - sortBases(beforeCanBreatheUnderwaterHookTypes, allBaseBeforeCanBreatheUnderwaterSuperiors, allBaseBeforeCanBreatheUnderwaterInferiors, "beforeCanBreatheUnderwater"); - sortBases(overrideCanBreatheUnderwaterHookTypes, allBaseOverrideCanBreatheUnderwaterSuperiors, allBaseOverrideCanBreatheUnderwaterInferiors, "overrideCanBreatheUnderwater"); - sortBases(afterCanBreatheUnderwaterHookTypes, allBaseAfterCanBreatheUnderwaterSuperiors, allBaseAfterCanBreatheUnderwaterInferiors, "afterCanBreatheUnderwater"); - - sortBases(beforeCanHarvestBlockHookTypes, allBaseBeforeCanHarvestBlockSuperiors, allBaseBeforeCanHarvestBlockInferiors, "beforeCanHarvestBlock"); - sortBases(overrideCanHarvestBlockHookTypes, allBaseOverrideCanHarvestBlockSuperiors, allBaseOverrideCanHarvestBlockInferiors, "overrideCanHarvestBlock"); - sortBases(afterCanHarvestBlockHookTypes, allBaseAfterCanHarvestBlockSuperiors, allBaseAfterCanHarvestBlockInferiors, "afterCanHarvestBlock"); - - sortBases(beforeCanPlayerEditHookTypes, allBaseBeforeCanPlayerEditSuperiors, allBaseBeforeCanPlayerEditInferiors, "beforeCanPlayerEdit"); - sortBases(overrideCanPlayerEditHookTypes, allBaseOverrideCanPlayerEditSuperiors, allBaseOverrideCanPlayerEditInferiors, "overrideCanPlayerEdit"); - sortBases(afterCanPlayerEditHookTypes, allBaseAfterCanPlayerEditSuperiors, allBaseAfterCanPlayerEditInferiors, "afterCanPlayerEdit"); - - sortBases(beforeCanTriggerWalkingHookTypes, allBaseBeforeCanTriggerWalkingSuperiors, allBaseBeforeCanTriggerWalkingInferiors, "beforeCanTriggerWalking"); - sortBases(overrideCanTriggerWalkingHookTypes, allBaseOverrideCanTriggerWalkingSuperiors, allBaseOverrideCanTriggerWalkingInferiors, "overrideCanTriggerWalking"); - sortBases(afterCanTriggerWalkingHookTypes, allBaseAfterCanTriggerWalkingSuperiors, allBaseAfterCanTriggerWalkingInferiors, "afterCanTriggerWalking"); - - sortBases(beforeCloseScreenHookTypes, allBaseBeforeCloseScreenSuperiors, allBaseBeforeCloseScreenInferiors, "beforeCloseScreen"); - sortBases(overrideCloseScreenHookTypes, allBaseOverrideCloseScreenSuperiors, allBaseOverrideCloseScreenInferiors, "overrideCloseScreen"); - sortBases(afterCloseScreenHookTypes, allBaseAfterCloseScreenSuperiors, allBaseAfterCloseScreenInferiors, "afterCloseScreen"); - - sortBases(beforeDamageEntityHookTypes, allBaseBeforeDamageEntitySuperiors, allBaseBeforeDamageEntityInferiors, "beforeDamageEntity"); - sortBases(overrideDamageEntityHookTypes, allBaseOverrideDamageEntitySuperiors, allBaseOverrideDamageEntityInferiors, "overrideDamageEntity"); - sortBases(afterDamageEntityHookTypes, allBaseAfterDamageEntitySuperiors, allBaseAfterDamageEntityInferiors, "afterDamageEntity"); - - sortBases(beforeDisplayGuiHookTypes, allBaseBeforeDisplayGuiSuperiors, allBaseBeforeDisplayGuiInferiors, "beforeDisplayGui"); - sortBases(overrideDisplayGuiHookTypes, allBaseOverrideDisplayGuiSuperiors, allBaseOverrideDisplayGuiInferiors, "overrideDisplayGui"); - sortBases(afterDisplayGuiHookTypes, allBaseAfterDisplayGuiSuperiors, allBaseAfterDisplayGuiInferiors, "afterDisplayGui"); - - sortBases(beforeDisplayGUIChestHookTypes, allBaseBeforeDisplayGUIChestSuperiors, allBaseBeforeDisplayGUIChestInferiors, "beforeDisplayGUIChest"); - sortBases(overrideDisplayGUIChestHookTypes, allBaseOverrideDisplayGUIChestSuperiors, allBaseOverrideDisplayGUIChestInferiors, "overrideDisplayGUIChest"); - sortBases(afterDisplayGUIChestHookTypes, allBaseAfterDisplayGUIChestSuperiors, allBaseAfterDisplayGUIChestInferiors, "afterDisplayGUIChest"); - - sortBases(beforeDropItemHookTypes, allBaseBeforeDropItemSuperiors, allBaseBeforeDropItemInferiors, "beforeDropItem"); - sortBases(overrideDropItemHookTypes, allBaseOverrideDropItemSuperiors, allBaseOverrideDropItemInferiors, "overrideDropItem"); - sortBases(afterDropItemHookTypes, allBaseAfterDropItemSuperiors, allBaseAfterDropItemInferiors, "afterDropItem"); - - sortBases(beforeDropOneItemHookTypes, allBaseBeforeDropOneItemSuperiors, allBaseBeforeDropOneItemInferiors, "beforeDropOneItem"); - sortBases(overrideDropOneItemHookTypes, allBaseOverrideDropOneItemSuperiors, allBaseOverrideDropOneItemInferiors, "overrideDropOneItem"); - sortBases(afterDropOneItemHookTypes, allBaseAfterDropOneItemSuperiors, allBaseAfterDropOneItemInferiors, "afterDropOneItem"); - - sortBases(beforeDropPlayerItemWithRandomChoiceHookTypes, allBaseBeforeDropPlayerItemWithRandomChoiceSuperiors, allBaseBeforeDropPlayerItemWithRandomChoiceInferiors, "beforeDropPlayerItemWithRandomChoice"); - sortBases(overrideDropPlayerItemWithRandomChoiceHookTypes, allBaseOverrideDropPlayerItemWithRandomChoiceSuperiors, allBaseOverrideDropPlayerItemWithRandomChoiceInferiors, "overrideDropPlayerItemWithRandomChoice"); - sortBases(afterDropPlayerItemWithRandomChoiceHookTypes, allBaseAfterDropPlayerItemWithRandomChoiceSuperiors, allBaseAfterDropPlayerItemWithRandomChoiceInferiors, "afterDropPlayerItemWithRandomChoice"); - - sortBases(beforeFallHookTypes, allBaseBeforeFallSuperiors, allBaseBeforeFallInferiors, "beforeFall"); - sortBases(overrideFallHookTypes, allBaseOverrideFallSuperiors, allBaseOverrideFallInferiors, "overrideFall"); - sortBases(afterFallHookTypes, allBaseAfterFallSuperiors, allBaseAfterFallInferiors, "afterFall"); - - sortBases(beforeGetAIMoveSpeedHookTypes, allBaseBeforeGetAIMoveSpeedSuperiors, allBaseBeforeGetAIMoveSpeedInferiors, "beforeGetAIMoveSpeed"); - sortBases(overrideGetAIMoveSpeedHookTypes, allBaseOverrideGetAIMoveSpeedSuperiors, allBaseOverrideGetAIMoveSpeedInferiors, "overrideGetAIMoveSpeed"); - sortBases(afterGetAIMoveSpeedHookTypes, allBaseAfterGetAIMoveSpeedSuperiors, allBaseAfterGetAIMoveSpeedInferiors, "afterGetAIMoveSpeed"); - - sortBases(beforeGetBedOrientationInDegreesHookTypes, allBaseBeforeGetBedOrientationInDegreesSuperiors, allBaseBeforeGetBedOrientationInDegreesInferiors, "beforeGetBedOrientationInDegrees"); - sortBases(overrideGetBedOrientationInDegreesHookTypes, allBaseOverrideGetBedOrientationInDegreesSuperiors, allBaseOverrideGetBedOrientationInDegreesInferiors, "overrideGetBedOrientationInDegrees"); - sortBases(afterGetBedOrientationInDegreesHookTypes, allBaseAfterGetBedOrientationInDegreesSuperiors, allBaseAfterGetBedOrientationInDegreesInferiors, "afterGetBedOrientationInDegrees"); - - sortBases(beforeGetBrightnessHookTypes, allBaseBeforeGetBrightnessSuperiors, allBaseBeforeGetBrightnessInferiors, "beforeGetBrightness"); - sortBases(overrideGetBrightnessHookTypes, allBaseOverrideGetBrightnessSuperiors, allBaseOverrideGetBrightnessInferiors, "overrideGetBrightness"); - sortBases(afterGetBrightnessHookTypes, allBaseAfterGetBrightnessSuperiors, allBaseAfterGetBrightnessInferiors, "afterGetBrightness"); - - sortBases(beforeGetBrightnessForRenderHookTypes, allBaseBeforeGetBrightnessForRenderSuperiors, allBaseBeforeGetBrightnessForRenderInferiors, "beforeGetBrightnessForRender"); - sortBases(overrideGetBrightnessForRenderHookTypes, allBaseOverrideGetBrightnessForRenderSuperiors, allBaseOverrideGetBrightnessForRenderInferiors, "overrideGetBrightnessForRender"); - sortBases(afterGetBrightnessForRenderHookTypes, allBaseAfterGetBrightnessForRenderSuperiors, allBaseAfterGetBrightnessForRenderInferiors, "afterGetBrightnessForRender"); - - sortBases(beforeGetBreakSpeedHookTypes, allBaseBeforeGetBreakSpeedSuperiors, allBaseBeforeGetBreakSpeedInferiors, "beforeGetBreakSpeed"); - sortBases(overrideGetBreakSpeedHookTypes, allBaseOverrideGetBreakSpeedSuperiors, allBaseOverrideGetBreakSpeedInferiors, "overrideGetBreakSpeed"); - sortBases(afterGetBreakSpeedHookTypes, allBaseAfterGetBreakSpeedSuperiors, allBaseAfterGetBreakSpeedInferiors, "afterGetBreakSpeed"); - - sortBases(beforeGetDistanceSqHookTypes, allBaseBeforeGetDistanceSqSuperiors, allBaseBeforeGetDistanceSqInferiors, "beforeGetDistanceSq"); - sortBases(overrideGetDistanceSqHookTypes, allBaseOverrideGetDistanceSqSuperiors, allBaseOverrideGetDistanceSqInferiors, "overrideGetDistanceSq"); - sortBases(afterGetDistanceSqHookTypes, allBaseAfterGetDistanceSqSuperiors, allBaseAfterGetDistanceSqInferiors, "afterGetDistanceSq"); - - sortBases(beforeGetDistanceSqToEntityHookTypes, allBaseBeforeGetDistanceSqToEntitySuperiors, allBaseBeforeGetDistanceSqToEntityInferiors, "beforeGetDistanceSqToEntity"); - sortBases(overrideGetDistanceSqToEntityHookTypes, allBaseOverrideGetDistanceSqToEntitySuperiors, allBaseOverrideGetDistanceSqToEntityInferiors, "overrideGetDistanceSqToEntity"); - sortBases(afterGetDistanceSqToEntityHookTypes, allBaseAfterGetDistanceSqToEntitySuperiors, allBaseAfterGetDistanceSqToEntityInferiors, "afterGetDistanceSqToEntity"); - - sortBases(beforeGetFovModifierHookTypes, allBaseBeforeGetFovModifierSuperiors, allBaseBeforeGetFovModifierInferiors, "beforeGetFovModifier"); - sortBases(overrideGetFovModifierHookTypes, allBaseOverrideGetFovModifierSuperiors, allBaseOverrideGetFovModifierInferiors, "overrideGetFovModifier"); - sortBases(afterGetFovModifierHookTypes, allBaseAfterGetFovModifierSuperiors, allBaseAfterGetFovModifierInferiors, "afterGetFovModifier"); - - sortBases(beforeGetHurtSoundHookTypes, allBaseBeforeGetHurtSoundSuperiors, allBaseBeforeGetHurtSoundInferiors, "beforeGetHurtSound"); - sortBases(overrideGetHurtSoundHookTypes, allBaseOverrideGetHurtSoundSuperiors, allBaseOverrideGetHurtSoundInferiors, "overrideGetHurtSound"); - sortBases(afterGetHurtSoundHookTypes, allBaseAfterGetHurtSoundSuperiors, allBaseAfterGetHurtSoundInferiors, "afterGetHurtSound"); - - sortBases(beforeGetNameHookTypes, allBaseBeforeGetNameSuperiors, allBaseBeforeGetNameInferiors, "beforeGetName"); - sortBases(overrideGetNameHookTypes, allBaseOverrideGetNameSuperiors, allBaseOverrideGetNameInferiors, "overrideGetName"); - sortBases(afterGetNameHookTypes, allBaseAfterGetNameSuperiors, allBaseAfterGetNameInferiors, "afterGetName"); - - sortBases(beforeGetSleepTimerHookTypes, allBaseBeforeGetSleepTimerSuperiors, allBaseBeforeGetSleepTimerInferiors, "beforeGetSleepTimer"); - sortBases(overrideGetSleepTimerHookTypes, allBaseOverrideGetSleepTimerSuperiors, allBaseOverrideGetSleepTimerInferiors, "overrideGetSleepTimer"); - sortBases(afterGetSleepTimerHookTypes, allBaseAfterGetSleepTimerSuperiors, allBaseAfterGetSleepTimerInferiors, "afterGetSleepTimer"); - - sortBases(beforeHandleWaterMovementHookTypes, allBaseBeforeHandleWaterMovementSuperiors, allBaseBeforeHandleWaterMovementInferiors, "beforeHandleWaterMovement"); - sortBases(overrideHandleWaterMovementHookTypes, allBaseOverrideHandleWaterMovementSuperiors, allBaseOverrideHandleWaterMovementInferiors, "overrideHandleWaterMovement"); - sortBases(afterHandleWaterMovementHookTypes, allBaseAfterHandleWaterMovementSuperiors, allBaseAfterHandleWaterMovementInferiors, "afterHandleWaterMovement"); - - sortBases(beforeHealHookTypes, allBaseBeforeHealSuperiors, allBaseBeforeHealInferiors, "beforeHeal"); - sortBases(overrideHealHookTypes, allBaseOverrideHealSuperiors, allBaseOverrideHealInferiors, "overrideHeal"); - sortBases(afterHealHookTypes, allBaseAfterHealSuperiors, allBaseAfterHealInferiors, "afterHeal"); - - sortBases(beforeIsEntityInsideOpaqueBlockHookTypes, allBaseBeforeIsEntityInsideOpaqueBlockSuperiors, allBaseBeforeIsEntityInsideOpaqueBlockInferiors, "beforeIsEntityInsideOpaqueBlock"); - sortBases(overrideIsEntityInsideOpaqueBlockHookTypes, allBaseOverrideIsEntityInsideOpaqueBlockSuperiors, allBaseOverrideIsEntityInsideOpaqueBlockInferiors, "overrideIsEntityInsideOpaqueBlock"); - sortBases(afterIsEntityInsideOpaqueBlockHookTypes, allBaseAfterIsEntityInsideOpaqueBlockSuperiors, allBaseAfterIsEntityInsideOpaqueBlockInferiors, "afterIsEntityInsideOpaqueBlock"); - - sortBases(beforeIsInWaterHookTypes, allBaseBeforeIsInWaterSuperiors, allBaseBeforeIsInWaterInferiors, "beforeIsInWater"); - sortBases(overrideIsInWaterHookTypes, allBaseOverrideIsInWaterSuperiors, allBaseOverrideIsInWaterInferiors, "overrideIsInWater"); - sortBases(afterIsInWaterHookTypes, allBaseAfterIsInWaterSuperiors, allBaseAfterIsInWaterInferiors, "afterIsInWater"); - - sortBases(beforeIsInsideOfMaterialHookTypes, allBaseBeforeIsInsideOfMaterialSuperiors, allBaseBeforeIsInsideOfMaterialInferiors, "beforeIsInsideOfMaterial"); - sortBases(overrideIsInsideOfMaterialHookTypes, allBaseOverrideIsInsideOfMaterialSuperiors, allBaseOverrideIsInsideOfMaterialInferiors, "overrideIsInsideOfMaterial"); - sortBases(afterIsInsideOfMaterialHookTypes, allBaseAfterIsInsideOfMaterialSuperiors, allBaseAfterIsInsideOfMaterialInferiors, "afterIsInsideOfMaterial"); - - sortBases(beforeIsOnLadderHookTypes, allBaseBeforeIsOnLadderSuperiors, allBaseBeforeIsOnLadderInferiors, "beforeIsOnLadder"); - sortBases(overrideIsOnLadderHookTypes, allBaseOverrideIsOnLadderSuperiors, allBaseOverrideIsOnLadderInferiors, "overrideIsOnLadder"); - sortBases(afterIsOnLadderHookTypes, allBaseAfterIsOnLadderSuperiors, allBaseAfterIsOnLadderInferiors, "afterIsOnLadder"); - - sortBases(beforeIsPlayerSleepingHookTypes, allBaseBeforeIsPlayerSleepingSuperiors, allBaseBeforeIsPlayerSleepingInferiors, "beforeIsPlayerSleeping"); - sortBases(overrideIsPlayerSleepingHookTypes, allBaseOverrideIsPlayerSleepingSuperiors, allBaseOverrideIsPlayerSleepingInferiors, "overrideIsPlayerSleeping"); - sortBases(afterIsPlayerSleepingHookTypes, allBaseAfterIsPlayerSleepingSuperiors, allBaseAfterIsPlayerSleepingInferiors, "afterIsPlayerSleeping"); - - sortBases(beforeIsSneakingHookTypes, allBaseBeforeIsSneakingSuperiors, allBaseBeforeIsSneakingInferiors, "beforeIsSneaking"); - sortBases(overrideIsSneakingHookTypes, allBaseOverrideIsSneakingSuperiors, allBaseOverrideIsSneakingInferiors, "overrideIsSneaking"); - sortBases(afterIsSneakingHookTypes, allBaseAfterIsSneakingSuperiors, allBaseAfterIsSneakingInferiors, "afterIsSneaking"); - - sortBases(beforeIsSprintingHookTypes, allBaseBeforeIsSprintingSuperiors, allBaseBeforeIsSprintingInferiors, "beforeIsSprinting"); - sortBases(overrideIsSprintingHookTypes, allBaseOverrideIsSprintingSuperiors, allBaseOverrideIsSprintingInferiors, "overrideIsSprinting"); - sortBases(afterIsSprintingHookTypes, allBaseAfterIsSprintingSuperiors, allBaseAfterIsSprintingInferiors, "afterIsSprinting"); - - sortBases(beforeJumpHookTypes, allBaseBeforeJumpSuperiors, allBaseBeforeJumpInferiors, "beforeJump"); - sortBases(overrideJumpHookTypes, allBaseOverrideJumpSuperiors, allBaseOverrideJumpInferiors, "overrideJump"); - sortBases(afterJumpHookTypes, allBaseAfterJumpSuperiors, allBaseAfterJumpInferiors, "afterJump"); - - sortBases(beforeKnockBackHookTypes, allBaseBeforeKnockBackSuperiors, allBaseBeforeKnockBackInferiors, "beforeKnockBack"); - sortBases(overrideKnockBackHookTypes, allBaseOverrideKnockBackSuperiors, allBaseOverrideKnockBackInferiors, "overrideKnockBack"); - sortBases(afterKnockBackHookTypes, allBaseAfterKnockBackSuperiors, allBaseAfterKnockBackInferiors, "afterKnockBack"); - - sortBases(beforeMoveEntityHookTypes, allBaseBeforeMoveEntitySuperiors, allBaseBeforeMoveEntityInferiors, "beforeMoveEntity"); - sortBases(overrideMoveEntityHookTypes, allBaseOverrideMoveEntitySuperiors, allBaseOverrideMoveEntityInferiors, "overrideMoveEntity"); - sortBases(afterMoveEntityHookTypes, allBaseAfterMoveEntitySuperiors, allBaseAfterMoveEntityInferiors, "afterMoveEntity"); - - sortBases(beforeMoveEntityWithHeadingHookTypes, allBaseBeforeMoveEntityWithHeadingSuperiors, allBaseBeforeMoveEntityWithHeadingInferiors, "beforeMoveEntityWithHeading"); - sortBases(overrideMoveEntityWithHeadingHookTypes, allBaseOverrideMoveEntityWithHeadingSuperiors, allBaseOverrideMoveEntityWithHeadingInferiors, "overrideMoveEntityWithHeading"); - sortBases(afterMoveEntityWithHeadingHookTypes, allBaseAfterMoveEntityWithHeadingSuperiors, allBaseAfterMoveEntityWithHeadingInferiors, "afterMoveEntityWithHeading"); - - sortBases(beforeMoveFlyingHookTypes, allBaseBeforeMoveFlyingSuperiors, allBaseBeforeMoveFlyingInferiors, "beforeMoveFlying"); - sortBases(overrideMoveFlyingHookTypes, allBaseOverrideMoveFlyingSuperiors, allBaseOverrideMoveFlyingInferiors, "overrideMoveFlying"); - sortBases(afterMoveFlyingHookTypes, allBaseAfterMoveFlyingSuperiors, allBaseAfterMoveFlyingInferiors, "afterMoveFlying"); - - sortBases(beforeOnDeathHookTypes, allBaseBeforeOnDeathSuperiors, allBaseBeforeOnDeathInferiors, "beforeOnDeath"); - sortBases(overrideOnDeathHookTypes, allBaseOverrideOnDeathSuperiors, allBaseOverrideOnDeathInferiors, "overrideOnDeath"); - sortBases(afterOnDeathHookTypes, allBaseAfterOnDeathSuperiors, allBaseAfterOnDeathInferiors, "afterOnDeath"); - - sortBases(beforeOnLivingUpdateHookTypes, allBaseBeforeOnLivingUpdateSuperiors, allBaseBeforeOnLivingUpdateInferiors, "beforeOnLivingUpdate"); - sortBases(overrideOnLivingUpdateHookTypes, allBaseOverrideOnLivingUpdateSuperiors, allBaseOverrideOnLivingUpdateInferiors, "overrideOnLivingUpdate"); - sortBases(afterOnLivingUpdateHookTypes, allBaseAfterOnLivingUpdateSuperiors, allBaseAfterOnLivingUpdateInferiors, "afterOnLivingUpdate"); - - sortBases(beforeOnKillEntityHookTypes, allBaseBeforeOnKillEntitySuperiors, allBaseBeforeOnKillEntityInferiors, "beforeOnKillEntity"); - sortBases(overrideOnKillEntityHookTypes, allBaseOverrideOnKillEntitySuperiors, allBaseOverrideOnKillEntityInferiors, "overrideOnKillEntity"); - sortBases(afterOnKillEntityHookTypes, allBaseAfterOnKillEntitySuperiors, allBaseAfterOnKillEntityInferiors, "afterOnKillEntity"); - - sortBases(beforeOnStruckByLightningHookTypes, allBaseBeforeOnStruckByLightningSuperiors, allBaseBeforeOnStruckByLightningInferiors, "beforeOnStruckByLightning"); - sortBases(overrideOnStruckByLightningHookTypes, allBaseOverrideOnStruckByLightningSuperiors, allBaseOverrideOnStruckByLightningInferiors, "overrideOnStruckByLightning"); - sortBases(afterOnStruckByLightningHookTypes, allBaseAfterOnStruckByLightningSuperiors, allBaseAfterOnStruckByLightningInferiors, "afterOnStruckByLightning"); - - sortBases(beforeOnUpdateHookTypes, allBaseBeforeOnUpdateSuperiors, allBaseBeforeOnUpdateInferiors, "beforeOnUpdate"); - sortBases(overrideOnUpdateHookTypes, allBaseOverrideOnUpdateSuperiors, allBaseOverrideOnUpdateInferiors, "overrideOnUpdate"); - sortBases(afterOnUpdateHookTypes, allBaseAfterOnUpdateSuperiors, allBaseAfterOnUpdateInferiors, "afterOnUpdate"); - - sortBases(beforePlayStepSoundHookTypes, allBaseBeforePlayStepSoundSuperiors, allBaseBeforePlayStepSoundInferiors, "beforePlayStepSound"); - sortBases(overridePlayStepSoundHookTypes, allBaseOverridePlayStepSoundSuperiors, allBaseOverridePlayStepSoundInferiors, "overridePlayStepSound"); - sortBases(afterPlayStepSoundHookTypes, allBaseAfterPlayStepSoundSuperiors, allBaseAfterPlayStepSoundInferiors, "afterPlayStepSound"); - - sortBases(beforePushOutOfBlocksHookTypes, allBaseBeforePushOutOfBlocksSuperiors, allBaseBeforePushOutOfBlocksInferiors, "beforePushOutOfBlocks"); - sortBases(overridePushOutOfBlocksHookTypes, allBaseOverridePushOutOfBlocksSuperiors, allBaseOverridePushOutOfBlocksInferiors, "overridePushOutOfBlocks"); - sortBases(afterPushOutOfBlocksHookTypes, allBaseAfterPushOutOfBlocksSuperiors, allBaseAfterPushOutOfBlocksInferiors, "afterPushOutOfBlocks"); - - sortBases(beforeRayTraceHookTypes, allBaseBeforeRayTraceSuperiors, allBaseBeforeRayTraceInferiors, "beforeRayTrace"); - sortBases(overrideRayTraceHookTypes, allBaseOverrideRayTraceSuperiors, allBaseOverrideRayTraceInferiors, "overrideRayTrace"); - sortBases(afterRayTraceHookTypes, allBaseAfterRayTraceSuperiors, allBaseAfterRayTraceInferiors, "afterRayTrace"); - - sortBases(beforeReadEntityFromNBTHookTypes, allBaseBeforeReadEntityFromNBTSuperiors, allBaseBeforeReadEntityFromNBTInferiors, "beforeReadEntityFromNBT"); - sortBases(overrideReadEntityFromNBTHookTypes, allBaseOverrideReadEntityFromNBTSuperiors, allBaseOverrideReadEntityFromNBTInferiors, "overrideReadEntityFromNBT"); - sortBases(afterReadEntityFromNBTHookTypes, allBaseAfterReadEntityFromNBTSuperiors, allBaseAfterReadEntityFromNBTInferiors, "afterReadEntityFromNBT"); - - sortBases(beforeRespawnPlayerHookTypes, allBaseBeforeRespawnPlayerSuperiors, allBaseBeforeRespawnPlayerInferiors, "beforeRespawnPlayer"); - sortBases(overrideRespawnPlayerHookTypes, allBaseOverrideRespawnPlayerSuperiors, allBaseOverrideRespawnPlayerInferiors, "overrideRespawnPlayer"); - sortBases(afterRespawnPlayerHookTypes, allBaseAfterRespawnPlayerSuperiors, allBaseAfterRespawnPlayerInferiors, "afterRespawnPlayer"); - - sortBases(beforeSetDeadHookTypes, allBaseBeforeSetDeadSuperiors, allBaseBeforeSetDeadInferiors, "beforeSetDead"); - sortBases(overrideSetDeadHookTypes, allBaseOverrideSetDeadSuperiors, allBaseOverrideSetDeadInferiors, "overrideSetDead"); - sortBases(afterSetDeadHookTypes, allBaseAfterSetDeadSuperiors, allBaseAfterSetDeadInferiors, "afterSetDead"); - - sortBases(beforeSetPlayerSPHealthHookTypes, allBaseBeforeSetPlayerSPHealthSuperiors, allBaseBeforeSetPlayerSPHealthInferiors, "beforeSetPlayerSPHealth"); - sortBases(overrideSetPlayerSPHealthHookTypes, allBaseOverrideSetPlayerSPHealthSuperiors, allBaseOverrideSetPlayerSPHealthInferiors, "overrideSetPlayerSPHealth"); - sortBases(afterSetPlayerSPHealthHookTypes, allBaseAfterSetPlayerSPHealthSuperiors, allBaseAfterSetPlayerSPHealthInferiors, "afterSetPlayerSPHealth"); - - sortBases(beforeSetPositionAndRotationHookTypes, allBaseBeforeSetPositionAndRotationSuperiors, allBaseBeforeSetPositionAndRotationInferiors, "beforeSetPositionAndRotation"); - sortBases(overrideSetPositionAndRotationHookTypes, allBaseOverrideSetPositionAndRotationSuperiors, allBaseOverrideSetPositionAndRotationInferiors, "overrideSetPositionAndRotation"); - sortBases(afterSetPositionAndRotationHookTypes, allBaseAfterSetPositionAndRotationSuperiors, allBaseAfterSetPositionAndRotationInferiors, "afterSetPositionAndRotation"); - - sortBases(beforeSetSneakingHookTypes, allBaseBeforeSetSneakingSuperiors, allBaseBeforeSetSneakingInferiors, "beforeSetSneaking"); - sortBases(overrideSetSneakingHookTypes, allBaseOverrideSetSneakingSuperiors, allBaseOverrideSetSneakingInferiors, "overrideSetSneaking"); - sortBases(afterSetSneakingHookTypes, allBaseAfterSetSneakingSuperiors, allBaseAfterSetSneakingInferiors, "afterSetSneaking"); - - sortBases(beforeSetSprintingHookTypes, allBaseBeforeSetSprintingSuperiors, allBaseBeforeSetSprintingInferiors, "beforeSetSprinting"); - sortBases(overrideSetSprintingHookTypes, allBaseOverrideSetSprintingSuperiors, allBaseOverrideSetSprintingInferiors, "overrideSetSprinting"); - sortBases(afterSetSprintingHookTypes, allBaseAfterSetSprintingSuperiors, allBaseAfterSetSprintingInferiors, "afterSetSprinting"); - - sortBases(beforeTrySleepHookTypes, allBaseBeforeTrySleepSuperiors, allBaseBeforeTrySleepInferiors, "beforeTrySleep"); - sortBases(overrideTrySleepHookTypes, allBaseOverrideTrySleepSuperiors, allBaseOverrideTrySleepInferiors, "overrideTrySleep"); - sortBases(afterTrySleepHookTypes, allBaseAfterTrySleepSuperiors, allBaseAfterTrySleepInferiors, "afterTrySleep"); - - sortBases(beforeSwingItemHookTypes, allBaseBeforeSwingItemSuperiors, allBaseBeforeSwingItemInferiors, "beforeSwingItem"); - sortBases(overrideSwingItemHookTypes, allBaseOverrideSwingItemSuperiors, allBaseOverrideSwingItemInferiors, "overrideSwingItem"); - sortBases(afterSwingItemHookTypes, allBaseAfterSwingItemSuperiors, allBaseAfterSwingItemInferiors, "afterSwingItem"); - - sortBases(beforeUpdateEntityActionStateHookTypes, allBaseBeforeUpdateEntityActionStateSuperiors, allBaseBeforeUpdateEntityActionStateInferiors, "beforeUpdateEntityActionState"); - sortBases(overrideUpdateEntityActionStateHookTypes, allBaseOverrideUpdateEntityActionStateSuperiors, allBaseOverrideUpdateEntityActionStateInferiors, "overrideUpdateEntityActionState"); - sortBases(afterUpdateEntityActionStateHookTypes, allBaseAfterUpdateEntityActionStateSuperiors, allBaseAfterUpdateEntityActionStateInferiors, "afterUpdateEntityActionState"); - - sortBases(beforeUpdateRiddenHookTypes, allBaseBeforeUpdateRiddenSuperiors, allBaseBeforeUpdateRiddenInferiors, "beforeUpdateRidden"); - sortBases(overrideUpdateRiddenHookTypes, allBaseOverrideUpdateRiddenSuperiors, allBaseOverrideUpdateRiddenInferiors, "overrideUpdateRidden"); - sortBases(afterUpdateRiddenHookTypes, allBaseAfterUpdateRiddenSuperiors, allBaseAfterUpdateRiddenInferiors, "afterUpdateRidden"); - - sortBases(beforeWakeUpPlayerHookTypes, allBaseBeforeWakeUpPlayerSuperiors, allBaseBeforeWakeUpPlayerInferiors, "beforeWakeUpPlayer"); - sortBases(overrideWakeUpPlayerHookTypes, allBaseOverrideWakeUpPlayerSuperiors, allBaseOverrideWakeUpPlayerInferiors, "overrideWakeUpPlayer"); - sortBases(afterWakeUpPlayerHookTypes, allBaseAfterWakeUpPlayerSuperiors, allBaseAfterWakeUpPlayerInferiors, "afterWakeUpPlayer"); - - sortBases(beforeWriteEntityToNBTHookTypes, allBaseBeforeWriteEntityToNBTSuperiors, allBaseBeforeWriteEntityToNBTInferiors, "beforeWriteEntityToNBT"); - sortBases(overrideWriteEntityToNBTHookTypes, allBaseOverrideWriteEntityToNBTSuperiors, allBaseOverrideWriteEntityToNBTInferiors, "overrideWriteEntityToNBT"); - sortBases(afterWriteEntityToNBTHookTypes, allBaseAfterWriteEntityToNBTSuperiors, allBaseAfterWriteEntityToNBTInferiors, "afterWriteEntityToNBT"); - - initialized = true; - } - - private static List getAllInstancesList() - { - List result = new ArrayList(); - Object player; - try - { - Object minecraft = net.minecraft.client.Minecraft.class.getMethod("func_71410_x").invoke(null); - player = minecraft != null ? net.minecraft.client.Minecraft.class.getField("field_71439_g").get(minecraft) : null; - } - catch(Exception obfuscatedException) - { - try - { - Object minecraft = net.minecraft.client.Minecraft.class.getMethod("getMinecraft").invoke(null); - player = minecraft != null ? net.minecraft.client.Minecraft.class.getField("thePlayer").get(minecraft) : null; - } - catch(Exception deobfuscatedException) - { - throw new RuntimeException("Unable to aquire list of current server players.", obfuscatedException); - } - } - if(player != null) - result.add((IClientPlayerAPI)player); - return result; - } - - public static net.minecraft.client.entity.EntityPlayerSP[] getAllInstances() - { - List allInstances = getAllInstancesList(); - return allInstances.toArray(new net.minecraft.client.entity.EntityPlayerSP[allInstances.size()]); - } - - public static void beforeLocalConstructing(IClientPlayerAPI clientPlayer, net.minecraft.client.Minecraft paramMinecraft, net.minecraft.world.World paramWorld, net.minecraft.client.network.NetHandlerPlayClient paramNetHandlerPlayClient, net.minecraft.stats.StatisticsManager paramStatisticsManager) - { - ClientPlayerAPI clientPlayerAPI = clientPlayer.getClientPlayerAPI(); - if(clientPlayerAPI != null) - clientPlayerAPI.load(); - - if(clientPlayerAPI != null) - clientPlayerAPI.beforeLocalConstructing(paramMinecraft, paramWorld, paramNetHandlerPlayClient, paramStatisticsManager); - } - - public static void afterLocalConstructing(IClientPlayerAPI clientPlayer, net.minecraft.client.Minecraft paramMinecraft, net.minecraft.world.World paramWorld, net.minecraft.client.network.NetHandlerPlayClient paramNetHandlerPlayClient, net.minecraft.stats.StatisticsManager paramStatisticsManager) - { - ClientPlayerAPI clientPlayerAPI = clientPlayer.getClientPlayerAPI(); - if(clientPlayerAPI != null) - clientPlayerAPI.afterLocalConstructing(paramMinecraft, paramWorld, paramNetHandlerPlayClient, paramStatisticsManager); - } - - public static ClientPlayerBase getClientPlayerBase(IClientPlayerAPI clientPlayer, String baseId) - { - ClientPlayerAPI clientPlayerAPI = clientPlayer.getClientPlayerAPI(); - if(clientPlayerAPI != null) - return clientPlayerAPI.getClientPlayerBase(baseId); - return null; - } - - public static Set getClientPlayerBaseIds(IClientPlayerAPI clientPlayer) - { - ClientPlayerAPI clientPlayerAPI = clientPlayer.getClientPlayerAPI(); - Set result = null; - if(clientPlayerAPI != null) - result = clientPlayerAPI.getClientPlayerBaseIds(); - else - result = Collections.emptySet(); - return result; - } - - public static Object dynamic(IClientPlayerAPI clientPlayer, String key, Object[] parameters) - { - ClientPlayerAPI clientPlayerAPI = clientPlayer.getClientPlayerAPI(); - if(clientPlayerAPI != null) - return clientPlayerAPI.dynamic(key, parameters); - return null; - } - - private static void sortBases(List list, Map allBaseSuperiors, Map allBaseInferiors, String methodName) - { - new ClientPlayerBaseSorter(list, allBaseSuperiors, allBaseInferiors, methodName).Sort(); - } - - private final static Map EmptySortMap = Collections.unmodifiableMap(new HashMap()); - - private static void sortDynamicBases(Map> lists, Map> allBaseSuperiors, Map> allBaseInferiors, String key) - { - List types = lists.get(key); - if(types != null && types.size() > 1) - sortBases(types, getDynamicSorters(key, types, allBaseSuperiors), getDynamicSorters(key, types, allBaseInferiors), key); - } - - private static Map getDynamicSorters(String key, List toSort, Map> allBaseValues) - { - Map superiors = null; - - Iterator ids = toSort.iterator(); - while(ids.hasNext()) - { - String id = ids.next(); - Map idSuperiors = allBaseValues.get(id); - if(idSuperiors == null) - continue; - - String[] keySuperiorIds = idSuperiors.get(key); - if(keySuperiorIds != null && keySuperiorIds.length > 0) - { - if(superiors == null) - superiors = new HashMap(1); - superiors.put(id, keySuperiorIds); - } - } - - return superiors != null ? superiors : EmptySortMap; - } - - private ClientPlayerAPI(IClientPlayerAPI player) - { - this.player = player; - } - - private void load() - { - Iterator iterator = allBaseConstructors.keySet().iterator(); - while(iterator.hasNext()) - { - String id = iterator.next(); - ClientPlayerBase toAttach = createClientPlayerBase(id); - toAttach.beforeBaseAttach(false); - allBaseObjects.put(id, toAttach); - baseObjectsToId.put(toAttach, id); - } - - beforeLocalConstructingHooks = create(beforeLocalConstructingHookTypes); - afterLocalConstructingHooks = create(afterLocalConstructingHookTypes); - - updateClientPlayerBases(); - - iterator = allBaseObjects.keySet().iterator(); - while(iterator.hasNext()) - allBaseObjects.get(iterator.next()).afterBaseAttach(false); - } - - private ClientPlayerBase createClientPlayerBase(String id) - { - Constructor contructor = allBaseConstructors.get(id); - - ClientPlayerBase base; - try - { - if(contructor.getParameterTypes().length == 1) - base = (ClientPlayerBase)contructor.newInstance(this); - else - base = (ClientPlayerBase)contructor.newInstance(this, id); - } - catch (Exception e) - { - throw new RuntimeException("Exception while creating a ClientPlayerBase of type '" + contructor.getDeclaringClass() + "'", e); - } - return base; - } - - private void updateClientPlayerBases() - { - beforeAddExhaustionHooks = create(beforeAddExhaustionHookTypes); - overrideAddExhaustionHooks = create(overrideAddExhaustionHookTypes); - afterAddExhaustionHooks = create(afterAddExhaustionHookTypes); - isAddExhaustionModded = - beforeAddExhaustionHooks != null || - overrideAddExhaustionHooks != null || - afterAddExhaustionHooks != null; - - beforeAddMovementStatHooks = create(beforeAddMovementStatHookTypes); - overrideAddMovementStatHooks = create(overrideAddMovementStatHookTypes); - afterAddMovementStatHooks = create(afterAddMovementStatHookTypes); - isAddMovementStatModded = - beforeAddMovementStatHooks != null || - overrideAddMovementStatHooks != null || - afterAddMovementStatHooks != null; - - beforeAddStatHooks = create(beforeAddStatHookTypes); - overrideAddStatHooks = create(overrideAddStatHookTypes); - afterAddStatHooks = create(afterAddStatHookTypes); - isAddStatModded = - beforeAddStatHooks != null || - overrideAddStatHooks != null || - afterAddStatHooks != null; - - beforeAttackEntityFromHooks = create(beforeAttackEntityFromHookTypes); - overrideAttackEntityFromHooks = create(overrideAttackEntityFromHookTypes); - afterAttackEntityFromHooks = create(afterAttackEntityFromHookTypes); - isAttackEntityFromModded = - beforeAttackEntityFromHooks != null || - overrideAttackEntityFromHooks != null || - afterAttackEntityFromHooks != null; - - beforeAttackTargetEntityWithCurrentItemHooks = create(beforeAttackTargetEntityWithCurrentItemHookTypes); - overrideAttackTargetEntityWithCurrentItemHooks = create(overrideAttackTargetEntityWithCurrentItemHookTypes); - afterAttackTargetEntityWithCurrentItemHooks = create(afterAttackTargetEntityWithCurrentItemHookTypes); - isAttackTargetEntityWithCurrentItemModded = - beforeAttackTargetEntityWithCurrentItemHooks != null || - overrideAttackTargetEntityWithCurrentItemHooks != null || - afterAttackTargetEntityWithCurrentItemHooks != null; - - beforeCanBreatheUnderwaterHooks = create(beforeCanBreatheUnderwaterHookTypes); - overrideCanBreatheUnderwaterHooks = create(overrideCanBreatheUnderwaterHookTypes); - afterCanBreatheUnderwaterHooks = create(afterCanBreatheUnderwaterHookTypes); - isCanBreatheUnderwaterModded = - beforeCanBreatheUnderwaterHooks != null || - overrideCanBreatheUnderwaterHooks != null || - afterCanBreatheUnderwaterHooks != null; - - beforeCanHarvestBlockHooks = create(beforeCanHarvestBlockHookTypes); - overrideCanHarvestBlockHooks = create(overrideCanHarvestBlockHookTypes); - afterCanHarvestBlockHooks = create(afterCanHarvestBlockHookTypes); - isCanHarvestBlockModded = - beforeCanHarvestBlockHooks != null || - overrideCanHarvestBlockHooks != null || - afterCanHarvestBlockHooks != null; - - beforeCanPlayerEditHooks = create(beforeCanPlayerEditHookTypes); - overrideCanPlayerEditHooks = create(overrideCanPlayerEditHookTypes); - afterCanPlayerEditHooks = create(afterCanPlayerEditHookTypes); - isCanPlayerEditModded = - beforeCanPlayerEditHooks != null || - overrideCanPlayerEditHooks != null || - afterCanPlayerEditHooks != null; - - beforeCanTriggerWalkingHooks = create(beforeCanTriggerWalkingHookTypes); - overrideCanTriggerWalkingHooks = create(overrideCanTriggerWalkingHookTypes); - afterCanTriggerWalkingHooks = create(afterCanTriggerWalkingHookTypes); - isCanTriggerWalkingModded = - beforeCanTriggerWalkingHooks != null || - overrideCanTriggerWalkingHooks != null || - afterCanTriggerWalkingHooks != null; - - beforeCloseScreenHooks = create(beforeCloseScreenHookTypes); - overrideCloseScreenHooks = create(overrideCloseScreenHookTypes); - afterCloseScreenHooks = create(afterCloseScreenHookTypes); - isCloseScreenModded = - beforeCloseScreenHooks != null || - overrideCloseScreenHooks != null || - afterCloseScreenHooks != null; - - beforeDamageEntityHooks = create(beforeDamageEntityHookTypes); - overrideDamageEntityHooks = create(overrideDamageEntityHookTypes); - afterDamageEntityHooks = create(afterDamageEntityHookTypes); - isDamageEntityModded = - beforeDamageEntityHooks != null || - overrideDamageEntityHooks != null || - afterDamageEntityHooks != null; - - beforeDisplayGuiHooks = create(beforeDisplayGuiHookTypes); - overrideDisplayGuiHooks = create(overrideDisplayGuiHookTypes); - afterDisplayGuiHooks = create(afterDisplayGuiHookTypes); - isDisplayGuiModded = - beforeDisplayGuiHooks != null || - overrideDisplayGuiHooks != null || - afterDisplayGuiHooks != null; - - beforeDisplayGUIChestHooks = create(beforeDisplayGUIChestHookTypes); - overrideDisplayGUIChestHooks = create(overrideDisplayGUIChestHookTypes); - afterDisplayGUIChestHooks = create(afterDisplayGUIChestHookTypes); - isDisplayGUIChestModded = - beforeDisplayGUIChestHooks != null || - overrideDisplayGUIChestHooks != null || - afterDisplayGUIChestHooks != null; - - beforeDropItemHooks = create(beforeDropItemHookTypes); - overrideDropItemHooks = create(overrideDropItemHookTypes); - afterDropItemHooks = create(afterDropItemHookTypes); - isDropItemModded = - beforeDropItemHooks != null || - overrideDropItemHooks != null || - afterDropItemHooks != null; - - beforeDropOneItemHooks = create(beforeDropOneItemHookTypes); - overrideDropOneItemHooks = create(overrideDropOneItemHookTypes); - afterDropOneItemHooks = create(afterDropOneItemHookTypes); - isDropOneItemModded = - beforeDropOneItemHooks != null || - overrideDropOneItemHooks != null || - afterDropOneItemHooks != null; - - beforeDropPlayerItemWithRandomChoiceHooks = create(beforeDropPlayerItemWithRandomChoiceHookTypes); - overrideDropPlayerItemWithRandomChoiceHooks = create(overrideDropPlayerItemWithRandomChoiceHookTypes); - afterDropPlayerItemWithRandomChoiceHooks = create(afterDropPlayerItemWithRandomChoiceHookTypes); - isDropPlayerItemWithRandomChoiceModded = - beforeDropPlayerItemWithRandomChoiceHooks != null || - overrideDropPlayerItemWithRandomChoiceHooks != null || - afterDropPlayerItemWithRandomChoiceHooks != null; - - beforeFallHooks = create(beforeFallHookTypes); - overrideFallHooks = create(overrideFallHookTypes); - afterFallHooks = create(afterFallHookTypes); - isFallModded = - beforeFallHooks != null || - overrideFallHooks != null || - afterFallHooks != null; - - beforeGetAIMoveSpeedHooks = create(beforeGetAIMoveSpeedHookTypes); - overrideGetAIMoveSpeedHooks = create(overrideGetAIMoveSpeedHookTypes); - afterGetAIMoveSpeedHooks = create(afterGetAIMoveSpeedHookTypes); - isGetAIMoveSpeedModded = - beforeGetAIMoveSpeedHooks != null || - overrideGetAIMoveSpeedHooks != null || - afterGetAIMoveSpeedHooks != null; - - beforeGetBedOrientationInDegreesHooks = create(beforeGetBedOrientationInDegreesHookTypes); - overrideGetBedOrientationInDegreesHooks = create(overrideGetBedOrientationInDegreesHookTypes); - afterGetBedOrientationInDegreesHooks = create(afterGetBedOrientationInDegreesHookTypes); - isGetBedOrientationInDegreesModded = - beforeGetBedOrientationInDegreesHooks != null || - overrideGetBedOrientationInDegreesHooks != null || - afterGetBedOrientationInDegreesHooks != null; - - beforeGetBrightnessHooks = create(beforeGetBrightnessHookTypes); - overrideGetBrightnessHooks = create(overrideGetBrightnessHookTypes); - afterGetBrightnessHooks = create(afterGetBrightnessHookTypes); - isGetBrightnessModded = - beforeGetBrightnessHooks != null || - overrideGetBrightnessHooks != null || - afterGetBrightnessHooks != null; - - beforeGetBrightnessForRenderHooks = create(beforeGetBrightnessForRenderHookTypes); - overrideGetBrightnessForRenderHooks = create(overrideGetBrightnessForRenderHookTypes); - afterGetBrightnessForRenderHooks = create(afterGetBrightnessForRenderHookTypes); - isGetBrightnessForRenderModded = - beforeGetBrightnessForRenderHooks != null || - overrideGetBrightnessForRenderHooks != null || - afterGetBrightnessForRenderHooks != null; - - beforeGetBreakSpeedHooks = create(beforeGetBreakSpeedHookTypes); - overrideGetBreakSpeedHooks = create(overrideGetBreakSpeedHookTypes); - afterGetBreakSpeedHooks = create(afterGetBreakSpeedHookTypes); - isGetBreakSpeedModded = - beforeGetBreakSpeedHooks != null || - overrideGetBreakSpeedHooks != null || - afterGetBreakSpeedHooks != null; - - beforeGetDistanceSqHooks = create(beforeGetDistanceSqHookTypes); - overrideGetDistanceSqHooks = create(overrideGetDistanceSqHookTypes); - afterGetDistanceSqHooks = create(afterGetDistanceSqHookTypes); - isGetDistanceSqModded = - beforeGetDistanceSqHooks != null || - overrideGetDistanceSqHooks != null || - afterGetDistanceSqHooks != null; - - beforeGetDistanceSqToEntityHooks = create(beforeGetDistanceSqToEntityHookTypes); - overrideGetDistanceSqToEntityHooks = create(overrideGetDistanceSqToEntityHookTypes); - afterGetDistanceSqToEntityHooks = create(afterGetDistanceSqToEntityHookTypes); - isGetDistanceSqToEntityModded = - beforeGetDistanceSqToEntityHooks != null || - overrideGetDistanceSqToEntityHooks != null || - afterGetDistanceSqToEntityHooks != null; - - beforeGetFovModifierHooks = create(beforeGetFovModifierHookTypes); - overrideGetFovModifierHooks = create(overrideGetFovModifierHookTypes); - afterGetFovModifierHooks = create(afterGetFovModifierHookTypes); - isGetFovModifierModded = - beforeGetFovModifierHooks != null || - overrideGetFovModifierHooks != null || - afterGetFovModifierHooks != null; - - beforeGetHurtSoundHooks = create(beforeGetHurtSoundHookTypes); - overrideGetHurtSoundHooks = create(overrideGetHurtSoundHookTypes); - afterGetHurtSoundHooks = create(afterGetHurtSoundHookTypes); - isGetHurtSoundModded = - beforeGetHurtSoundHooks != null || - overrideGetHurtSoundHooks != null || - afterGetHurtSoundHooks != null; - - beforeGetNameHooks = create(beforeGetNameHookTypes); - overrideGetNameHooks = create(overrideGetNameHookTypes); - afterGetNameHooks = create(afterGetNameHookTypes); - isGetNameModded = - beforeGetNameHooks != null || - overrideGetNameHooks != null || - afterGetNameHooks != null; - - beforeGetSleepTimerHooks = create(beforeGetSleepTimerHookTypes); - overrideGetSleepTimerHooks = create(overrideGetSleepTimerHookTypes); - afterGetSleepTimerHooks = create(afterGetSleepTimerHookTypes); - isGetSleepTimerModded = - beforeGetSleepTimerHooks != null || - overrideGetSleepTimerHooks != null || - afterGetSleepTimerHooks != null; - - beforeHandleWaterMovementHooks = create(beforeHandleWaterMovementHookTypes); - overrideHandleWaterMovementHooks = create(overrideHandleWaterMovementHookTypes); - afterHandleWaterMovementHooks = create(afterHandleWaterMovementHookTypes); - isHandleWaterMovementModded = - beforeHandleWaterMovementHooks != null || - overrideHandleWaterMovementHooks != null || - afterHandleWaterMovementHooks != null; - - beforeHealHooks = create(beforeHealHookTypes); - overrideHealHooks = create(overrideHealHookTypes); - afterHealHooks = create(afterHealHookTypes); - isHealModded = - beforeHealHooks != null || - overrideHealHooks != null || - afterHealHooks != null; - - beforeIsEntityInsideOpaqueBlockHooks = create(beforeIsEntityInsideOpaqueBlockHookTypes); - overrideIsEntityInsideOpaqueBlockHooks = create(overrideIsEntityInsideOpaqueBlockHookTypes); - afterIsEntityInsideOpaqueBlockHooks = create(afterIsEntityInsideOpaqueBlockHookTypes); - isIsEntityInsideOpaqueBlockModded = - beforeIsEntityInsideOpaqueBlockHooks != null || - overrideIsEntityInsideOpaqueBlockHooks != null || - afterIsEntityInsideOpaqueBlockHooks != null; - - beforeIsInWaterHooks = create(beforeIsInWaterHookTypes); - overrideIsInWaterHooks = create(overrideIsInWaterHookTypes); - afterIsInWaterHooks = create(afterIsInWaterHookTypes); - isIsInWaterModded = - beforeIsInWaterHooks != null || - overrideIsInWaterHooks != null || - afterIsInWaterHooks != null; - - beforeIsInsideOfMaterialHooks = create(beforeIsInsideOfMaterialHookTypes); - overrideIsInsideOfMaterialHooks = create(overrideIsInsideOfMaterialHookTypes); - afterIsInsideOfMaterialHooks = create(afterIsInsideOfMaterialHookTypes); - isIsInsideOfMaterialModded = - beforeIsInsideOfMaterialHooks != null || - overrideIsInsideOfMaterialHooks != null || - afterIsInsideOfMaterialHooks != null; - - beforeIsOnLadderHooks = create(beforeIsOnLadderHookTypes); - overrideIsOnLadderHooks = create(overrideIsOnLadderHookTypes); - afterIsOnLadderHooks = create(afterIsOnLadderHookTypes); - isIsOnLadderModded = - beforeIsOnLadderHooks != null || - overrideIsOnLadderHooks != null || - afterIsOnLadderHooks != null; - - beforeIsPlayerSleepingHooks = create(beforeIsPlayerSleepingHookTypes); - overrideIsPlayerSleepingHooks = create(overrideIsPlayerSleepingHookTypes); - afterIsPlayerSleepingHooks = create(afterIsPlayerSleepingHookTypes); - isIsPlayerSleepingModded = - beforeIsPlayerSleepingHooks != null || - overrideIsPlayerSleepingHooks != null || - afterIsPlayerSleepingHooks != null; - - beforeIsSneakingHooks = create(beforeIsSneakingHookTypes); - overrideIsSneakingHooks = create(overrideIsSneakingHookTypes); - afterIsSneakingHooks = create(afterIsSneakingHookTypes); - isIsSneakingModded = - beforeIsSneakingHooks != null || - overrideIsSneakingHooks != null || - afterIsSneakingHooks != null; - - beforeIsSprintingHooks = create(beforeIsSprintingHookTypes); - overrideIsSprintingHooks = create(overrideIsSprintingHookTypes); - afterIsSprintingHooks = create(afterIsSprintingHookTypes); - isIsSprintingModded = - beforeIsSprintingHooks != null || - overrideIsSprintingHooks != null || - afterIsSprintingHooks != null; - - beforeJumpHooks = create(beforeJumpHookTypes); - overrideJumpHooks = create(overrideJumpHookTypes); - afterJumpHooks = create(afterJumpHookTypes); - isJumpModded = - beforeJumpHooks != null || - overrideJumpHooks != null || - afterJumpHooks != null; - - beforeKnockBackHooks = create(beforeKnockBackHookTypes); - overrideKnockBackHooks = create(overrideKnockBackHookTypes); - afterKnockBackHooks = create(afterKnockBackHookTypes); - isKnockBackModded = - beforeKnockBackHooks != null || - overrideKnockBackHooks != null || - afterKnockBackHooks != null; - - beforeMoveEntityHooks = create(beforeMoveEntityHookTypes); - overrideMoveEntityHooks = create(overrideMoveEntityHookTypes); - afterMoveEntityHooks = create(afterMoveEntityHookTypes); - isMoveEntityModded = - beforeMoveEntityHooks != null || - overrideMoveEntityHooks != null || - afterMoveEntityHooks != null; - - beforeMoveEntityWithHeadingHooks = create(beforeMoveEntityWithHeadingHookTypes); - overrideMoveEntityWithHeadingHooks = create(overrideMoveEntityWithHeadingHookTypes); - afterMoveEntityWithHeadingHooks = create(afterMoveEntityWithHeadingHookTypes); - isMoveEntityWithHeadingModded = - beforeMoveEntityWithHeadingHooks != null || - overrideMoveEntityWithHeadingHooks != null || - afterMoveEntityWithHeadingHooks != null; - - beforeMoveFlyingHooks = create(beforeMoveFlyingHookTypes); - overrideMoveFlyingHooks = create(overrideMoveFlyingHookTypes); - afterMoveFlyingHooks = create(afterMoveFlyingHookTypes); - isMoveFlyingModded = - beforeMoveFlyingHooks != null || - overrideMoveFlyingHooks != null || - afterMoveFlyingHooks != null; - - beforeOnDeathHooks = create(beforeOnDeathHookTypes); - overrideOnDeathHooks = create(overrideOnDeathHookTypes); - afterOnDeathHooks = create(afterOnDeathHookTypes); - isOnDeathModded = - beforeOnDeathHooks != null || - overrideOnDeathHooks != null || - afterOnDeathHooks != null; - - beforeOnLivingUpdateHooks = create(beforeOnLivingUpdateHookTypes); - overrideOnLivingUpdateHooks = create(overrideOnLivingUpdateHookTypes); - afterOnLivingUpdateHooks = create(afterOnLivingUpdateHookTypes); - isOnLivingUpdateModded = - beforeOnLivingUpdateHooks != null || - overrideOnLivingUpdateHooks != null || - afterOnLivingUpdateHooks != null; - - beforeOnKillEntityHooks = create(beforeOnKillEntityHookTypes); - overrideOnKillEntityHooks = create(overrideOnKillEntityHookTypes); - afterOnKillEntityHooks = create(afterOnKillEntityHookTypes); - isOnKillEntityModded = - beforeOnKillEntityHooks != null || - overrideOnKillEntityHooks != null || - afterOnKillEntityHooks != null; - - beforeOnStruckByLightningHooks = create(beforeOnStruckByLightningHookTypes); - overrideOnStruckByLightningHooks = create(overrideOnStruckByLightningHookTypes); - afterOnStruckByLightningHooks = create(afterOnStruckByLightningHookTypes); - isOnStruckByLightningModded = - beforeOnStruckByLightningHooks != null || - overrideOnStruckByLightningHooks != null || - afterOnStruckByLightningHooks != null; - - beforeOnUpdateHooks = create(beforeOnUpdateHookTypes); - overrideOnUpdateHooks = create(overrideOnUpdateHookTypes); - afterOnUpdateHooks = create(afterOnUpdateHookTypes); - isOnUpdateModded = - beforeOnUpdateHooks != null || - overrideOnUpdateHooks != null || - afterOnUpdateHooks != null; - - beforePlayStepSoundHooks = create(beforePlayStepSoundHookTypes); - overridePlayStepSoundHooks = create(overridePlayStepSoundHookTypes); - afterPlayStepSoundHooks = create(afterPlayStepSoundHookTypes); - isPlayStepSoundModded = - beforePlayStepSoundHooks != null || - overridePlayStepSoundHooks != null || - afterPlayStepSoundHooks != null; - - beforePushOutOfBlocksHooks = create(beforePushOutOfBlocksHookTypes); - overridePushOutOfBlocksHooks = create(overridePushOutOfBlocksHookTypes); - afterPushOutOfBlocksHooks = create(afterPushOutOfBlocksHookTypes); - isPushOutOfBlocksModded = - beforePushOutOfBlocksHooks != null || - overridePushOutOfBlocksHooks != null || - afterPushOutOfBlocksHooks != null; - - beforeRayTraceHooks = create(beforeRayTraceHookTypes); - overrideRayTraceHooks = create(overrideRayTraceHookTypes); - afterRayTraceHooks = create(afterRayTraceHookTypes); - isRayTraceModded = - beforeRayTraceHooks != null || - overrideRayTraceHooks != null || - afterRayTraceHooks != null; - - beforeReadEntityFromNBTHooks = create(beforeReadEntityFromNBTHookTypes); - overrideReadEntityFromNBTHooks = create(overrideReadEntityFromNBTHookTypes); - afterReadEntityFromNBTHooks = create(afterReadEntityFromNBTHookTypes); - isReadEntityFromNBTModded = - beforeReadEntityFromNBTHooks != null || - overrideReadEntityFromNBTHooks != null || - afterReadEntityFromNBTHooks != null; - - beforeRespawnPlayerHooks = create(beforeRespawnPlayerHookTypes); - overrideRespawnPlayerHooks = create(overrideRespawnPlayerHookTypes); - afterRespawnPlayerHooks = create(afterRespawnPlayerHookTypes); - isRespawnPlayerModded = - beforeRespawnPlayerHooks != null || - overrideRespawnPlayerHooks != null || - afterRespawnPlayerHooks != null; - - beforeSetDeadHooks = create(beforeSetDeadHookTypes); - overrideSetDeadHooks = create(overrideSetDeadHookTypes); - afterSetDeadHooks = create(afterSetDeadHookTypes); - isSetDeadModded = - beforeSetDeadHooks != null || - overrideSetDeadHooks != null || - afterSetDeadHooks != null; - - beforeSetPlayerSPHealthHooks = create(beforeSetPlayerSPHealthHookTypes); - overrideSetPlayerSPHealthHooks = create(overrideSetPlayerSPHealthHookTypes); - afterSetPlayerSPHealthHooks = create(afterSetPlayerSPHealthHookTypes); - isSetPlayerSPHealthModded = - beforeSetPlayerSPHealthHooks != null || - overrideSetPlayerSPHealthHooks != null || - afterSetPlayerSPHealthHooks != null; - - beforeSetPositionAndRotationHooks = create(beforeSetPositionAndRotationHookTypes); - overrideSetPositionAndRotationHooks = create(overrideSetPositionAndRotationHookTypes); - afterSetPositionAndRotationHooks = create(afterSetPositionAndRotationHookTypes); - isSetPositionAndRotationModded = - beforeSetPositionAndRotationHooks != null || - overrideSetPositionAndRotationHooks != null || - afterSetPositionAndRotationHooks != null; - - beforeSetSneakingHooks = create(beforeSetSneakingHookTypes); - overrideSetSneakingHooks = create(overrideSetSneakingHookTypes); - afterSetSneakingHooks = create(afterSetSneakingHookTypes); - isSetSneakingModded = - beforeSetSneakingHooks != null || - overrideSetSneakingHooks != null || - afterSetSneakingHooks != null; - - beforeSetSprintingHooks = create(beforeSetSprintingHookTypes); - overrideSetSprintingHooks = create(overrideSetSprintingHookTypes); - afterSetSprintingHooks = create(afterSetSprintingHookTypes); - isSetSprintingModded = - beforeSetSprintingHooks != null || - overrideSetSprintingHooks != null || - afterSetSprintingHooks != null; - - beforeTrySleepHooks = create(beforeTrySleepHookTypes); - overrideTrySleepHooks = create(overrideTrySleepHookTypes); - afterTrySleepHooks = create(afterTrySleepHookTypes); - isTrySleepModded = - beforeTrySleepHooks != null || - overrideTrySleepHooks != null || - afterTrySleepHooks != null; - - beforeSwingItemHooks = create(beforeSwingItemHookTypes); - overrideSwingItemHooks = create(overrideSwingItemHookTypes); - afterSwingItemHooks = create(afterSwingItemHookTypes); - isSwingItemModded = - beforeSwingItemHooks != null || - overrideSwingItemHooks != null || - afterSwingItemHooks != null; - - beforeUpdateEntityActionStateHooks = create(beforeUpdateEntityActionStateHookTypes); - overrideUpdateEntityActionStateHooks = create(overrideUpdateEntityActionStateHookTypes); - afterUpdateEntityActionStateHooks = create(afterUpdateEntityActionStateHookTypes); - isUpdateEntityActionStateModded = - beforeUpdateEntityActionStateHooks != null || - overrideUpdateEntityActionStateHooks != null || - afterUpdateEntityActionStateHooks != null; - - beforeUpdateRiddenHooks = create(beforeUpdateRiddenHookTypes); - overrideUpdateRiddenHooks = create(overrideUpdateRiddenHookTypes); - afterUpdateRiddenHooks = create(afterUpdateRiddenHookTypes); - isUpdateRiddenModded = - beforeUpdateRiddenHooks != null || - overrideUpdateRiddenHooks != null || - afterUpdateRiddenHooks != null; - - beforeWakeUpPlayerHooks = create(beforeWakeUpPlayerHookTypes); - overrideWakeUpPlayerHooks = create(overrideWakeUpPlayerHookTypes); - afterWakeUpPlayerHooks = create(afterWakeUpPlayerHookTypes); - isWakeUpPlayerModded = - beforeWakeUpPlayerHooks != null || - overrideWakeUpPlayerHooks != null || - afterWakeUpPlayerHooks != null; - - beforeWriteEntityToNBTHooks = create(beforeWriteEntityToNBTHookTypes); - overrideWriteEntityToNBTHooks = create(overrideWriteEntityToNBTHookTypes); - afterWriteEntityToNBTHooks = create(afterWriteEntityToNBTHookTypes); - isWriteEntityToNBTModded = - beforeWriteEntityToNBTHooks != null || - overrideWriteEntityToNBTHooks != null || - afterWriteEntityToNBTHooks != null; - - } - - private void attachClientPlayerBase(String id) - { - ClientPlayerBase toAttach = createClientPlayerBase(id); - toAttach.beforeBaseAttach(true); - allBaseObjects.put(id, toAttach); - updateClientPlayerBases(); - toAttach.afterBaseAttach(true); - } - - private void detachClientPlayerBase(String id) - { - ClientPlayerBase toDetach = allBaseObjects.get(id); - toDetach.beforeBaseDetach(true); - allBaseObjects.remove(id); - toDetach.afterBaseDetach(true); - } - - private ClientPlayerBase[] create(List types) - { - if(types.isEmpty()) - return null; - - ClientPlayerBase[] result = new ClientPlayerBase[types.size()]; - for(int i = 0; i < result.length; i++) - result[i] = getClientPlayerBase(types.get(i)); - return result; - } - - private void beforeLocalConstructing(net.minecraft.client.Minecraft paramMinecraft, net.minecraft.world.World paramWorld, net.minecraft.client.network.NetHandlerPlayClient paramNetHandlerPlayClient, net.minecraft.stats.StatisticsManager paramStatisticsManager) - { - if(beforeLocalConstructingHooks != null) - for(int i = beforeLocalConstructingHooks.length - 1; i >= 0 ; i--) - beforeLocalConstructingHooks[i].beforeLocalConstructing(paramMinecraft, paramWorld, paramNetHandlerPlayClient, paramStatisticsManager); - beforeLocalConstructingHooks = null; - } - - private void afterLocalConstructing(net.minecraft.client.Minecraft paramMinecraft, net.minecraft.world.World paramWorld, net.minecraft.client.network.NetHandlerPlayClient paramNetHandlerPlayClient, net.minecraft.stats.StatisticsManager paramStatisticsManager) - { - if(afterLocalConstructingHooks != null) - for(int i = 0; i < afterLocalConstructingHooks.length; i++) - afterLocalConstructingHooks[i].afterLocalConstructing(paramMinecraft, paramWorld, paramNetHandlerPlayClient, paramStatisticsManager); - afterLocalConstructingHooks = null; - } - - public ClientPlayerBase getClientPlayerBase(String id) - { - return allBaseObjects.get(id); - } - - public Set getClientPlayerBaseIds() - { - return unmodifiableAllBaseIds; - } - - public Object dynamic(String key, Object[] parameters) - { - key = key.replace('.', '_').replace(' ', '_'); - executeAll(key, parameters, beforeDynamicHookTypes, beforeDynamicHookMethods, true); - Object result = dynamicOverwritten(key, parameters, null); - executeAll(key, parameters, afterDynamicHookTypes, afterDynamicHookMethods, false); - return result; - } - - public Object dynamicOverwritten(String key, Object[] parameters, ClientPlayerBase overwriter) - { - List overrideIds = overrideDynamicHookTypes.get(key); - - String id = null; - if(overrideIds != null) - if(overwriter != null) - { - id = baseObjectsToId.get(overwriter); - int index = overrideIds.indexOf(id); - if(index > 0) - id = overrideIds.get(index - 1); - else - id = null; - } - else if(overrideIds.size() > 0) - id = overrideIds.get(overrideIds.size() - 1); - - Map, Map> methodMap; - - if(id == null) - { - id = keysToVirtualIds.get(key); - if(id == null) - return null; - methodMap = virtualDynamicHookMethods; - } - else - methodMap = overrideDynamicHookMethods; - - Map methods = methodMap.get(allBaseConstructors.get(id).getDeclaringClass()); - if(methods == null) - return null; - - Method method = methods.get(key); - if(method == null) - return null; - - return execute(getClientPlayerBase(id), method, parameters); - } - - private void executeAll(String key, Object[] parameters, Map> dynamicHookTypes, Map, Map> dynamicHookMethods, boolean reverse) - { - List beforeIds = dynamicHookTypes.get(key); - if(beforeIds == null) - return; - - for(int i= reverse ? beforeIds.size() - 1 : 0; reverse ? i >= 0 : i < beforeIds.size(); i = i + (reverse ? -1 : 1)) - { - String id = beforeIds.get(i); - ClientPlayerBase base = getClientPlayerBase(id); - Class type = base.getClass(); - - Map methods = dynamicHookMethods.get(type); - if(methods == null) - continue; - - Method method = methods.get(key); - if(method == null) - continue; - - execute(base, method, parameters); - } - } - - private Object execute(ClientPlayerBase base, Method method, Object[] parameters) - { - try - { - return method.invoke(base, parameters); - } - catch(Exception e) - { - throw new RuntimeException("Exception while invoking dynamic method", e); - } - } - - public static void addExhaustion(IClientPlayerAPI target, float paramFloat) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isAddExhaustionModded) - clientPlayerAPI.addExhaustion(paramFloat); - else - target.localAddExhaustion(paramFloat); - } - - private void addExhaustion(float paramFloat) - { - if(beforeAddExhaustionHooks != null) - for(int i = beforeAddExhaustionHooks.length - 1; i >= 0 ; i--) - beforeAddExhaustionHooks[i].beforeAddExhaustion(paramFloat); - - if(overrideAddExhaustionHooks != null) - overrideAddExhaustionHooks[overrideAddExhaustionHooks.length - 1].addExhaustion(paramFloat); - else - player.localAddExhaustion(paramFloat); - - if(afterAddExhaustionHooks != null) - for(int i = 0; i < afterAddExhaustionHooks.length; i++) - afterAddExhaustionHooks[i].afterAddExhaustion(paramFloat); - - } - - protected ClientPlayerBase GetOverwrittenAddExhaustion(ClientPlayerBase overWriter) - { - if (overrideAddExhaustionHooks == null) - return overWriter; - - for(int i = 0; i < overrideAddExhaustionHooks.length; i++) - if(overrideAddExhaustionHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideAddExhaustionHooks[i - 1]; - - return overWriter; - } - - private final static List beforeAddExhaustionHookTypes = new LinkedList(); - private final static List overrideAddExhaustionHookTypes = new LinkedList(); - private final static List afterAddExhaustionHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeAddExhaustionHooks; - private ClientPlayerBase[] overrideAddExhaustionHooks; - private ClientPlayerBase[] afterAddExhaustionHooks; - - public boolean isAddExhaustionModded; - - private static final Map allBaseBeforeAddExhaustionSuperiors = new Hashtable(0); - private static final Map allBaseBeforeAddExhaustionInferiors = new Hashtable(0); - private static final Map allBaseOverrideAddExhaustionSuperiors = new Hashtable(0); - private static final Map allBaseOverrideAddExhaustionInferiors = new Hashtable(0); - private static final Map allBaseAfterAddExhaustionSuperiors = new Hashtable(0); - private static final Map allBaseAfterAddExhaustionInferiors = new Hashtable(0); - - public static void addMovementStat(IClientPlayerAPI target, double paramDouble1, double paramDouble2, double paramDouble3) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isAddMovementStatModded) - clientPlayerAPI.addMovementStat(paramDouble1, paramDouble2, paramDouble3); - else - target.localAddMovementStat(paramDouble1, paramDouble2, paramDouble3); - } - - private void addMovementStat(double paramDouble1, double paramDouble2, double paramDouble3) - { - if(beforeAddMovementStatHooks != null) - for(int i = beforeAddMovementStatHooks.length - 1; i >= 0 ; i--) - beforeAddMovementStatHooks[i].beforeAddMovementStat(paramDouble1, paramDouble2, paramDouble3); - - if(overrideAddMovementStatHooks != null) - overrideAddMovementStatHooks[overrideAddMovementStatHooks.length - 1].addMovementStat(paramDouble1, paramDouble2, paramDouble3); - else - player.localAddMovementStat(paramDouble1, paramDouble2, paramDouble3); - - if(afterAddMovementStatHooks != null) - for(int i = 0; i < afterAddMovementStatHooks.length; i++) - afterAddMovementStatHooks[i].afterAddMovementStat(paramDouble1, paramDouble2, paramDouble3); - - } - - protected ClientPlayerBase GetOverwrittenAddMovementStat(ClientPlayerBase overWriter) - { - if (overrideAddMovementStatHooks == null) - return overWriter; - - for(int i = 0; i < overrideAddMovementStatHooks.length; i++) - if(overrideAddMovementStatHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideAddMovementStatHooks[i - 1]; - - return overWriter; - } - - private final static List beforeAddMovementStatHookTypes = new LinkedList(); - private final static List overrideAddMovementStatHookTypes = new LinkedList(); - private final static List afterAddMovementStatHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeAddMovementStatHooks; - private ClientPlayerBase[] overrideAddMovementStatHooks; - private ClientPlayerBase[] afterAddMovementStatHooks; - - public boolean isAddMovementStatModded; - - private static final Map allBaseBeforeAddMovementStatSuperiors = new Hashtable(0); - private static final Map allBaseBeforeAddMovementStatInferiors = new Hashtable(0); - private static final Map allBaseOverrideAddMovementStatSuperiors = new Hashtable(0); - private static final Map allBaseOverrideAddMovementStatInferiors = new Hashtable(0); - private static final Map allBaseAfterAddMovementStatSuperiors = new Hashtable(0); - private static final Map allBaseAfterAddMovementStatInferiors = new Hashtable(0); - - public static void addStat(IClientPlayerAPI target, net.minecraft.stats.StatBase paramStatBase, int paramInt) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isAddStatModded) - clientPlayerAPI.addStat(paramStatBase, paramInt); - else - target.localAddStat(paramStatBase, paramInt); - } - - private void addStat(net.minecraft.stats.StatBase paramStatBase, int paramInt) - { - if(beforeAddStatHooks != null) - for(int i = beforeAddStatHooks.length - 1; i >= 0 ; i--) - beforeAddStatHooks[i].beforeAddStat(paramStatBase, paramInt); - - if(overrideAddStatHooks != null) - overrideAddStatHooks[overrideAddStatHooks.length - 1].addStat(paramStatBase, paramInt); - else - player.localAddStat(paramStatBase, paramInt); - - if(afterAddStatHooks != null) - for(int i = 0; i < afterAddStatHooks.length; i++) - afterAddStatHooks[i].afterAddStat(paramStatBase, paramInt); - - } - - protected ClientPlayerBase GetOverwrittenAddStat(ClientPlayerBase overWriter) - { - if (overrideAddStatHooks == null) - return overWriter; - - for(int i = 0; i < overrideAddStatHooks.length; i++) - if(overrideAddStatHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideAddStatHooks[i - 1]; - - return overWriter; - } - - private final static List beforeAddStatHookTypes = new LinkedList(); - private final static List overrideAddStatHookTypes = new LinkedList(); - private final static List afterAddStatHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeAddStatHooks; - private ClientPlayerBase[] overrideAddStatHooks; - private ClientPlayerBase[] afterAddStatHooks; - - public boolean isAddStatModded; - - private static final Map allBaseBeforeAddStatSuperiors = new Hashtable(0); - private static final Map allBaseBeforeAddStatInferiors = new Hashtable(0); - private static final Map allBaseOverrideAddStatSuperiors = new Hashtable(0); - private static final Map allBaseOverrideAddStatInferiors = new Hashtable(0); - private static final Map allBaseAfterAddStatSuperiors = new Hashtable(0); - private static final Map allBaseAfterAddStatInferiors = new Hashtable(0); - - public static boolean attackEntityFrom(IClientPlayerAPI target, net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isAttackEntityFromModded) - _result = clientPlayerAPI.attackEntityFrom(paramDamageSource, paramFloat); - else - _result = target.localAttackEntityFrom(paramDamageSource, paramFloat); - return _result; - } - - private boolean attackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - if(beforeAttackEntityFromHooks != null) - for(int i = beforeAttackEntityFromHooks.length - 1; i >= 0 ; i--) - beforeAttackEntityFromHooks[i].beforeAttackEntityFrom(paramDamageSource, paramFloat); - - boolean _result; - if(overrideAttackEntityFromHooks != null) - _result = overrideAttackEntityFromHooks[overrideAttackEntityFromHooks.length - 1].attackEntityFrom(paramDamageSource, paramFloat); - else - _result = player.localAttackEntityFrom(paramDamageSource, paramFloat); - - if(afterAttackEntityFromHooks != null) - for(int i = 0; i < afterAttackEntityFromHooks.length; i++) - afterAttackEntityFromHooks[i].afterAttackEntityFrom(paramDamageSource, paramFloat); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenAttackEntityFrom(ClientPlayerBase overWriter) - { - if (overrideAttackEntityFromHooks == null) - return overWriter; - - for(int i = 0; i < overrideAttackEntityFromHooks.length; i++) - if(overrideAttackEntityFromHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideAttackEntityFromHooks[i - 1]; - - return overWriter; - } - - private final static List beforeAttackEntityFromHookTypes = new LinkedList(); - private final static List overrideAttackEntityFromHookTypes = new LinkedList(); - private final static List afterAttackEntityFromHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeAttackEntityFromHooks; - private ClientPlayerBase[] overrideAttackEntityFromHooks; - private ClientPlayerBase[] afterAttackEntityFromHooks; - - public boolean isAttackEntityFromModded; - - private static final Map allBaseBeforeAttackEntityFromSuperiors = new Hashtable(0); - private static final Map allBaseBeforeAttackEntityFromInferiors = new Hashtable(0); - private static final Map allBaseOverrideAttackEntityFromSuperiors = new Hashtable(0); - private static final Map allBaseOverrideAttackEntityFromInferiors = new Hashtable(0); - private static final Map allBaseAfterAttackEntityFromSuperiors = new Hashtable(0); - private static final Map allBaseAfterAttackEntityFromInferiors = new Hashtable(0); - - public static void attackTargetEntityWithCurrentItem(IClientPlayerAPI target, net.minecraft.entity.Entity paramEntity) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isAttackTargetEntityWithCurrentItemModded) - clientPlayerAPI.attackTargetEntityWithCurrentItem(paramEntity); - else - target.localAttackTargetEntityWithCurrentItem(paramEntity); - } - - private void attackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity) - { - if(beforeAttackTargetEntityWithCurrentItemHooks != null) - for(int i = beforeAttackTargetEntityWithCurrentItemHooks.length - 1; i >= 0 ; i--) - beforeAttackTargetEntityWithCurrentItemHooks[i].beforeAttackTargetEntityWithCurrentItem(paramEntity); - - if(overrideAttackTargetEntityWithCurrentItemHooks != null) - overrideAttackTargetEntityWithCurrentItemHooks[overrideAttackTargetEntityWithCurrentItemHooks.length - 1].attackTargetEntityWithCurrentItem(paramEntity); - else - player.localAttackTargetEntityWithCurrentItem(paramEntity); - - if(afterAttackTargetEntityWithCurrentItemHooks != null) - for(int i = 0; i < afterAttackTargetEntityWithCurrentItemHooks.length; i++) - afterAttackTargetEntityWithCurrentItemHooks[i].afterAttackTargetEntityWithCurrentItem(paramEntity); - - } - - protected ClientPlayerBase GetOverwrittenAttackTargetEntityWithCurrentItem(ClientPlayerBase overWriter) - { - if (overrideAttackTargetEntityWithCurrentItemHooks == null) - return overWriter; - - for(int i = 0; i < overrideAttackTargetEntityWithCurrentItemHooks.length; i++) - if(overrideAttackTargetEntityWithCurrentItemHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideAttackTargetEntityWithCurrentItemHooks[i - 1]; - - return overWriter; - } - - private final static List beforeAttackTargetEntityWithCurrentItemHookTypes = new LinkedList(); - private final static List overrideAttackTargetEntityWithCurrentItemHookTypes = new LinkedList(); - private final static List afterAttackTargetEntityWithCurrentItemHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeAttackTargetEntityWithCurrentItemHooks; - private ClientPlayerBase[] overrideAttackTargetEntityWithCurrentItemHooks; - private ClientPlayerBase[] afterAttackTargetEntityWithCurrentItemHooks; - - public boolean isAttackTargetEntityWithCurrentItemModded; - - private static final Map allBaseBeforeAttackTargetEntityWithCurrentItemSuperiors = new Hashtable(0); - private static final Map allBaseBeforeAttackTargetEntityWithCurrentItemInferiors = new Hashtable(0); - private static final Map allBaseOverrideAttackTargetEntityWithCurrentItemSuperiors = new Hashtable(0); - private static final Map allBaseOverrideAttackTargetEntityWithCurrentItemInferiors = new Hashtable(0); - private static final Map allBaseAfterAttackTargetEntityWithCurrentItemSuperiors = new Hashtable(0); - private static final Map allBaseAfterAttackTargetEntityWithCurrentItemInferiors = new Hashtable(0); - - public static boolean canBreatheUnderwater(IClientPlayerAPI target) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isCanBreatheUnderwaterModded) - _result = clientPlayerAPI.canBreatheUnderwater(); - else - _result = target.localCanBreatheUnderwater(); - return _result; - } - - private boolean canBreatheUnderwater() - { - if(beforeCanBreatheUnderwaterHooks != null) - for(int i = beforeCanBreatheUnderwaterHooks.length - 1; i >= 0 ; i--) - beforeCanBreatheUnderwaterHooks[i].beforeCanBreatheUnderwater(); - - boolean _result; - if(overrideCanBreatheUnderwaterHooks != null) - _result = overrideCanBreatheUnderwaterHooks[overrideCanBreatheUnderwaterHooks.length - 1].canBreatheUnderwater(); - else - _result = player.localCanBreatheUnderwater(); - - if(afterCanBreatheUnderwaterHooks != null) - for(int i = 0; i < afterCanBreatheUnderwaterHooks.length; i++) - afterCanBreatheUnderwaterHooks[i].afterCanBreatheUnderwater(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenCanBreatheUnderwater(ClientPlayerBase overWriter) - { - if (overrideCanBreatheUnderwaterHooks == null) - return overWriter; - - for(int i = 0; i < overrideCanBreatheUnderwaterHooks.length; i++) - if(overrideCanBreatheUnderwaterHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideCanBreatheUnderwaterHooks[i - 1]; - - return overWriter; - } - - private final static List beforeCanBreatheUnderwaterHookTypes = new LinkedList(); - private final static List overrideCanBreatheUnderwaterHookTypes = new LinkedList(); - private final static List afterCanBreatheUnderwaterHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeCanBreatheUnderwaterHooks; - private ClientPlayerBase[] overrideCanBreatheUnderwaterHooks; - private ClientPlayerBase[] afterCanBreatheUnderwaterHooks; - - public boolean isCanBreatheUnderwaterModded; - - private static final Map allBaseBeforeCanBreatheUnderwaterSuperiors = new Hashtable(0); - private static final Map allBaseBeforeCanBreatheUnderwaterInferiors = new Hashtable(0); - private static final Map allBaseOverrideCanBreatheUnderwaterSuperiors = new Hashtable(0); - private static final Map allBaseOverrideCanBreatheUnderwaterInferiors = new Hashtable(0); - private static final Map allBaseAfterCanBreatheUnderwaterSuperiors = new Hashtable(0); - private static final Map allBaseAfterCanBreatheUnderwaterInferiors = new Hashtable(0); - - public static boolean canHarvestBlock(IClientPlayerAPI target, net.minecraft.block.state.IBlockState paramIBlockState) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isCanHarvestBlockModded) - _result = clientPlayerAPI.canHarvestBlock(paramIBlockState); - else - _result = target.localCanHarvestBlock(paramIBlockState); - return _result; - } - - private boolean canHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState) - { - if(beforeCanHarvestBlockHooks != null) - for(int i = beforeCanHarvestBlockHooks.length - 1; i >= 0 ; i--) - beforeCanHarvestBlockHooks[i].beforeCanHarvestBlock(paramIBlockState); - - boolean _result; - if(overrideCanHarvestBlockHooks != null) - _result = overrideCanHarvestBlockHooks[overrideCanHarvestBlockHooks.length - 1].canHarvestBlock(paramIBlockState); - else - _result = player.localCanHarvestBlock(paramIBlockState); - - if(afterCanHarvestBlockHooks != null) - for(int i = 0; i < afterCanHarvestBlockHooks.length; i++) - afterCanHarvestBlockHooks[i].afterCanHarvestBlock(paramIBlockState); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenCanHarvestBlock(ClientPlayerBase overWriter) - { - if (overrideCanHarvestBlockHooks == null) - return overWriter; - - for(int i = 0; i < overrideCanHarvestBlockHooks.length; i++) - if(overrideCanHarvestBlockHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideCanHarvestBlockHooks[i - 1]; - - return overWriter; - } - - private final static List beforeCanHarvestBlockHookTypes = new LinkedList(); - private final static List overrideCanHarvestBlockHookTypes = new LinkedList(); - private final static List afterCanHarvestBlockHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeCanHarvestBlockHooks; - private ClientPlayerBase[] overrideCanHarvestBlockHooks; - private ClientPlayerBase[] afterCanHarvestBlockHooks; - - public boolean isCanHarvestBlockModded; - - private static final Map allBaseBeforeCanHarvestBlockSuperiors = new Hashtable(0); - private static final Map allBaseBeforeCanHarvestBlockInferiors = new Hashtable(0); - private static final Map allBaseOverrideCanHarvestBlockSuperiors = new Hashtable(0); - private static final Map allBaseOverrideCanHarvestBlockInferiors = new Hashtable(0); - private static final Map allBaseAfterCanHarvestBlockSuperiors = new Hashtable(0); - private static final Map allBaseAfterCanHarvestBlockInferiors = new Hashtable(0); - - public static boolean canPlayerEdit(IClientPlayerAPI target, net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isCanPlayerEditModded) - _result = clientPlayerAPI.canPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - else - _result = target.localCanPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - return _result; - } - - private boolean canPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack) - { - if(beforeCanPlayerEditHooks != null) - for(int i = beforeCanPlayerEditHooks.length - 1; i >= 0 ; i--) - beforeCanPlayerEditHooks[i].beforeCanPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - - boolean _result; - if(overrideCanPlayerEditHooks != null) - _result = overrideCanPlayerEditHooks[overrideCanPlayerEditHooks.length - 1].canPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - else - _result = player.localCanPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - - if(afterCanPlayerEditHooks != null) - for(int i = 0; i < afterCanPlayerEditHooks.length; i++) - afterCanPlayerEditHooks[i].afterCanPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenCanPlayerEdit(ClientPlayerBase overWriter) - { - if (overrideCanPlayerEditHooks == null) - return overWriter; - - for(int i = 0; i < overrideCanPlayerEditHooks.length; i++) - if(overrideCanPlayerEditHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideCanPlayerEditHooks[i - 1]; - - return overWriter; - } - - private final static List beforeCanPlayerEditHookTypes = new LinkedList(); - private final static List overrideCanPlayerEditHookTypes = new LinkedList(); - private final static List afterCanPlayerEditHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeCanPlayerEditHooks; - private ClientPlayerBase[] overrideCanPlayerEditHooks; - private ClientPlayerBase[] afterCanPlayerEditHooks; - - public boolean isCanPlayerEditModded; - - private static final Map allBaseBeforeCanPlayerEditSuperiors = new Hashtable(0); - private static final Map allBaseBeforeCanPlayerEditInferiors = new Hashtable(0); - private static final Map allBaseOverrideCanPlayerEditSuperiors = new Hashtable(0); - private static final Map allBaseOverrideCanPlayerEditInferiors = new Hashtable(0); - private static final Map allBaseAfterCanPlayerEditSuperiors = new Hashtable(0); - private static final Map allBaseAfterCanPlayerEditInferiors = new Hashtable(0); - - public static boolean canTriggerWalking(IClientPlayerAPI target) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isCanTriggerWalkingModded) - _result = clientPlayerAPI.canTriggerWalking(); - else - _result = target.localCanTriggerWalking(); - return _result; - } - - private boolean canTriggerWalking() - { - if(beforeCanTriggerWalkingHooks != null) - for(int i = beforeCanTriggerWalkingHooks.length - 1; i >= 0 ; i--) - beforeCanTriggerWalkingHooks[i].beforeCanTriggerWalking(); - - boolean _result; - if(overrideCanTriggerWalkingHooks != null) - _result = overrideCanTriggerWalkingHooks[overrideCanTriggerWalkingHooks.length - 1].canTriggerWalking(); - else - _result = player.localCanTriggerWalking(); - - if(afterCanTriggerWalkingHooks != null) - for(int i = 0; i < afterCanTriggerWalkingHooks.length; i++) - afterCanTriggerWalkingHooks[i].afterCanTriggerWalking(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenCanTriggerWalking(ClientPlayerBase overWriter) - { - if (overrideCanTriggerWalkingHooks == null) - return overWriter; - - for(int i = 0; i < overrideCanTriggerWalkingHooks.length; i++) - if(overrideCanTriggerWalkingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideCanTriggerWalkingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeCanTriggerWalkingHookTypes = new LinkedList(); - private final static List overrideCanTriggerWalkingHookTypes = new LinkedList(); - private final static List afterCanTriggerWalkingHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeCanTriggerWalkingHooks; - private ClientPlayerBase[] overrideCanTriggerWalkingHooks; - private ClientPlayerBase[] afterCanTriggerWalkingHooks; - - public boolean isCanTriggerWalkingModded; - - private static final Map allBaseBeforeCanTriggerWalkingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeCanTriggerWalkingInferiors = new Hashtable(0); - private static final Map allBaseOverrideCanTriggerWalkingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideCanTriggerWalkingInferiors = new Hashtable(0); - private static final Map allBaseAfterCanTriggerWalkingSuperiors = new Hashtable(0); - private static final Map allBaseAfterCanTriggerWalkingInferiors = new Hashtable(0); - - public static void closeScreen(IClientPlayerAPI target) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isCloseScreenModded) - clientPlayerAPI.closeScreen(); - else - target.localCloseScreen(); - } - - private void closeScreen() - { - if(beforeCloseScreenHooks != null) - for(int i = beforeCloseScreenHooks.length - 1; i >= 0 ; i--) - beforeCloseScreenHooks[i].beforeCloseScreen(); - - if(overrideCloseScreenHooks != null) - overrideCloseScreenHooks[overrideCloseScreenHooks.length - 1].closeScreen(); - else - player.localCloseScreen(); - - if(afterCloseScreenHooks != null) - for(int i = 0; i < afterCloseScreenHooks.length; i++) - afterCloseScreenHooks[i].afterCloseScreen(); - - } - - protected ClientPlayerBase GetOverwrittenCloseScreen(ClientPlayerBase overWriter) - { - if (overrideCloseScreenHooks == null) - return overWriter; - - for(int i = 0; i < overrideCloseScreenHooks.length; i++) - if(overrideCloseScreenHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideCloseScreenHooks[i - 1]; - - return overWriter; - } - - private final static List beforeCloseScreenHookTypes = new LinkedList(); - private final static List overrideCloseScreenHookTypes = new LinkedList(); - private final static List afterCloseScreenHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeCloseScreenHooks; - private ClientPlayerBase[] overrideCloseScreenHooks; - private ClientPlayerBase[] afterCloseScreenHooks; - - public boolean isCloseScreenModded; - - private static final Map allBaseBeforeCloseScreenSuperiors = new Hashtable(0); - private static final Map allBaseBeforeCloseScreenInferiors = new Hashtable(0); - private static final Map allBaseOverrideCloseScreenSuperiors = new Hashtable(0); - private static final Map allBaseOverrideCloseScreenInferiors = new Hashtable(0); - private static final Map allBaseAfterCloseScreenSuperiors = new Hashtable(0); - private static final Map allBaseAfterCloseScreenInferiors = new Hashtable(0); - - public static void damageEntity(IClientPlayerAPI target, net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isDamageEntityModded) - clientPlayerAPI.damageEntity(paramDamageSource, paramFloat); - else - target.localDamageEntity(paramDamageSource, paramFloat); - } - - private void damageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - if(beforeDamageEntityHooks != null) - for(int i = beforeDamageEntityHooks.length - 1; i >= 0 ; i--) - beforeDamageEntityHooks[i].beforeDamageEntity(paramDamageSource, paramFloat); - - if(overrideDamageEntityHooks != null) - overrideDamageEntityHooks[overrideDamageEntityHooks.length - 1].damageEntity(paramDamageSource, paramFloat); - else - player.localDamageEntity(paramDamageSource, paramFloat); - - if(afterDamageEntityHooks != null) - for(int i = 0; i < afterDamageEntityHooks.length; i++) - afterDamageEntityHooks[i].afterDamageEntity(paramDamageSource, paramFloat); - - } - - protected ClientPlayerBase GetOverwrittenDamageEntity(ClientPlayerBase overWriter) - { - if (overrideDamageEntityHooks == null) - return overWriter; - - for(int i = 0; i < overrideDamageEntityHooks.length; i++) - if(overrideDamageEntityHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideDamageEntityHooks[i - 1]; - - return overWriter; - } - - private final static List beforeDamageEntityHookTypes = new LinkedList(); - private final static List overrideDamageEntityHookTypes = new LinkedList(); - private final static List afterDamageEntityHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeDamageEntityHooks; - private ClientPlayerBase[] overrideDamageEntityHooks; - private ClientPlayerBase[] afterDamageEntityHooks; - - public boolean isDamageEntityModded; - - private static final Map allBaseBeforeDamageEntitySuperiors = new Hashtable(0); - private static final Map allBaseBeforeDamageEntityInferiors = new Hashtable(0); - private static final Map allBaseOverrideDamageEntitySuperiors = new Hashtable(0); - private static final Map allBaseOverrideDamageEntityInferiors = new Hashtable(0); - private static final Map allBaseAfterDamageEntitySuperiors = new Hashtable(0); - private static final Map allBaseAfterDamageEntityInferiors = new Hashtable(0); - - public static void displayGui(IClientPlayerAPI target, net.minecraft.world.IInteractionObject paramIInteractionObject) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isDisplayGuiModded) - clientPlayerAPI.displayGui(paramIInteractionObject); - else - target.localDisplayGui(paramIInteractionObject); - } - - private void displayGui(net.minecraft.world.IInteractionObject paramIInteractionObject) - { - if(beforeDisplayGuiHooks != null) - for(int i = beforeDisplayGuiHooks.length - 1; i >= 0 ; i--) - beforeDisplayGuiHooks[i].beforeDisplayGui(paramIInteractionObject); - - if(overrideDisplayGuiHooks != null) - overrideDisplayGuiHooks[overrideDisplayGuiHooks.length - 1].displayGui(paramIInteractionObject); - else - player.localDisplayGui(paramIInteractionObject); - - if(afterDisplayGuiHooks != null) - for(int i = 0; i < afterDisplayGuiHooks.length; i++) - afterDisplayGuiHooks[i].afterDisplayGui(paramIInteractionObject); - - } - - protected ClientPlayerBase GetOverwrittenDisplayGui(ClientPlayerBase overWriter) - { - if (overrideDisplayGuiHooks == null) - return overWriter; - - for(int i = 0; i < overrideDisplayGuiHooks.length; i++) - if(overrideDisplayGuiHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideDisplayGuiHooks[i - 1]; - - return overWriter; - } - - private final static List beforeDisplayGuiHookTypes = new LinkedList(); - private final static List overrideDisplayGuiHookTypes = new LinkedList(); - private final static List afterDisplayGuiHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeDisplayGuiHooks; - private ClientPlayerBase[] overrideDisplayGuiHooks; - private ClientPlayerBase[] afterDisplayGuiHooks; - - public boolean isDisplayGuiModded; - - private static final Map allBaseBeforeDisplayGuiSuperiors = new Hashtable(0); - private static final Map allBaseBeforeDisplayGuiInferiors = new Hashtable(0); - private static final Map allBaseOverrideDisplayGuiSuperiors = new Hashtable(0); - private static final Map allBaseOverrideDisplayGuiInferiors = new Hashtable(0); - private static final Map allBaseAfterDisplayGuiSuperiors = new Hashtable(0); - private static final Map allBaseAfterDisplayGuiInferiors = new Hashtable(0); - - public static void displayGUIChest(IClientPlayerAPI target, net.minecraft.inventory.IInventory paramIInventory) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isDisplayGUIChestModded) - clientPlayerAPI.displayGUIChest(paramIInventory); - else - target.localDisplayGUIChest(paramIInventory); - } - - private void displayGUIChest(net.minecraft.inventory.IInventory paramIInventory) - { - if(beforeDisplayGUIChestHooks != null) - for(int i = beforeDisplayGUIChestHooks.length - 1; i >= 0 ; i--) - beforeDisplayGUIChestHooks[i].beforeDisplayGUIChest(paramIInventory); - - if(overrideDisplayGUIChestHooks != null) - overrideDisplayGUIChestHooks[overrideDisplayGUIChestHooks.length - 1].displayGUIChest(paramIInventory); - else - player.localDisplayGUIChest(paramIInventory); - - if(afterDisplayGUIChestHooks != null) - for(int i = 0; i < afterDisplayGUIChestHooks.length; i++) - afterDisplayGUIChestHooks[i].afterDisplayGUIChest(paramIInventory); - - } - - protected ClientPlayerBase GetOverwrittenDisplayGUIChest(ClientPlayerBase overWriter) - { - if (overrideDisplayGUIChestHooks == null) - return overWriter; - - for(int i = 0; i < overrideDisplayGUIChestHooks.length; i++) - if(overrideDisplayGUIChestHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideDisplayGUIChestHooks[i - 1]; - - return overWriter; - } - - private final static List beforeDisplayGUIChestHookTypes = new LinkedList(); - private final static List overrideDisplayGUIChestHookTypes = new LinkedList(); - private final static List afterDisplayGUIChestHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeDisplayGUIChestHooks; - private ClientPlayerBase[] overrideDisplayGUIChestHooks; - private ClientPlayerBase[] afterDisplayGUIChestHooks; - - public boolean isDisplayGUIChestModded; - - private static final Map allBaseBeforeDisplayGUIChestSuperiors = new Hashtable(0); - private static final Map allBaseBeforeDisplayGUIChestInferiors = new Hashtable(0); - private static final Map allBaseOverrideDisplayGUIChestSuperiors = new Hashtable(0); - private static final Map allBaseOverrideDisplayGUIChestInferiors = new Hashtable(0); - private static final Map allBaseAfterDisplayGUIChestSuperiors = new Hashtable(0); - private static final Map allBaseAfterDisplayGUIChestInferiors = new Hashtable(0); - - public static net.minecraft.entity.item.EntityItem dropItem(IClientPlayerAPI target, net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean1, boolean paramBoolean2) - { - net.minecraft.entity.item.EntityItem _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isDropItemModded) - _result = clientPlayerAPI.dropItem(paramItemStack, paramBoolean1, paramBoolean2); - else - _result = target.localDropItem(paramItemStack, paramBoolean1, paramBoolean2); - return _result; - } - - private net.minecraft.entity.item.EntityItem dropItem(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean1, boolean paramBoolean2) - { - if(beforeDropItemHooks != null) - for(int i = beforeDropItemHooks.length - 1; i >= 0 ; i--) - beforeDropItemHooks[i].beforeDropItem(paramItemStack, paramBoolean1, paramBoolean2); - - net.minecraft.entity.item.EntityItem _result; - if(overrideDropItemHooks != null) - _result = overrideDropItemHooks[overrideDropItemHooks.length - 1].dropItem(paramItemStack, paramBoolean1, paramBoolean2); - else - _result = player.localDropItem(paramItemStack, paramBoolean1, paramBoolean2); - - if(afterDropItemHooks != null) - for(int i = 0; i < afterDropItemHooks.length; i++) - afterDropItemHooks[i].afterDropItem(paramItemStack, paramBoolean1, paramBoolean2); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenDropItem(ClientPlayerBase overWriter) - { - if (overrideDropItemHooks == null) - return overWriter; - - for(int i = 0; i < overrideDropItemHooks.length; i++) - if(overrideDropItemHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideDropItemHooks[i - 1]; - - return overWriter; - } - - private final static List beforeDropItemHookTypes = new LinkedList(); - private final static List overrideDropItemHookTypes = new LinkedList(); - private final static List afterDropItemHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeDropItemHooks; - private ClientPlayerBase[] overrideDropItemHooks; - private ClientPlayerBase[] afterDropItemHooks; - - public boolean isDropItemModded; - - private static final Map allBaseBeforeDropItemSuperiors = new Hashtable(0); - private static final Map allBaseBeforeDropItemInferiors = new Hashtable(0); - private static final Map allBaseOverrideDropItemSuperiors = new Hashtable(0); - private static final Map allBaseOverrideDropItemInferiors = new Hashtable(0); - private static final Map allBaseAfterDropItemSuperiors = new Hashtable(0); - private static final Map allBaseAfterDropItemInferiors = new Hashtable(0); - - public static net.minecraft.entity.item.EntityItem dropOneItem(IClientPlayerAPI target, boolean paramBoolean) - { - net.minecraft.entity.item.EntityItem _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isDropOneItemModded) - _result = clientPlayerAPI.dropOneItem(paramBoolean); - else - _result = target.localDropOneItem(paramBoolean); - return _result; - } - - private net.minecraft.entity.item.EntityItem dropOneItem(boolean paramBoolean) - { - if(beforeDropOneItemHooks != null) - for(int i = beforeDropOneItemHooks.length - 1; i >= 0 ; i--) - beforeDropOneItemHooks[i].beforeDropOneItem(paramBoolean); - - net.minecraft.entity.item.EntityItem _result; - if(overrideDropOneItemHooks != null) - _result = overrideDropOneItemHooks[overrideDropOneItemHooks.length - 1].dropOneItem(paramBoolean); - else - _result = player.localDropOneItem(paramBoolean); - - if(afterDropOneItemHooks != null) - for(int i = 0; i < afterDropOneItemHooks.length; i++) - afterDropOneItemHooks[i].afterDropOneItem(paramBoolean); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenDropOneItem(ClientPlayerBase overWriter) - { - if (overrideDropOneItemHooks == null) - return overWriter; - - for(int i = 0; i < overrideDropOneItemHooks.length; i++) - if(overrideDropOneItemHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideDropOneItemHooks[i - 1]; - - return overWriter; - } - - private final static List beforeDropOneItemHookTypes = new LinkedList(); - private final static List overrideDropOneItemHookTypes = new LinkedList(); - private final static List afterDropOneItemHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeDropOneItemHooks; - private ClientPlayerBase[] overrideDropOneItemHooks; - private ClientPlayerBase[] afterDropOneItemHooks; - - public boolean isDropOneItemModded; - - private static final Map allBaseBeforeDropOneItemSuperiors = new Hashtable(0); - private static final Map allBaseBeforeDropOneItemInferiors = new Hashtable(0); - private static final Map allBaseOverrideDropOneItemSuperiors = new Hashtable(0); - private static final Map allBaseOverrideDropOneItemInferiors = new Hashtable(0); - private static final Map allBaseAfterDropOneItemSuperiors = new Hashtable(0); - private static final Map allBaseAfterDropOneItemInferiors = new Hashtable(0); - - public static net.minecraft.entity.item.EntityItem dropPlayerItemWithRandomChoice(IClientPlayerAPI target, net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean) - { - net.minecraft.entity.item.EntityItem _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isDropPlayerItemWithRandomChoiceModded) - _result = clientPlayerAPI.dropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - else - _result = target.localDropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - return _result; - } - - private net.minecraft.entity.item.EntityItem dropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean) - { - if(beforeDropPlayerItemWithRandomChoiceHooks != null) - for(int i = beforeDropPlayerItemWithRandomChoiceHooks.length - 1; i >= 0 ; i--) - beforeDropPlayerItemWithRandomChoiceHooks[i].beforeDropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - - net.minecraft.entity.item.EntityItem _result; - if(overrideDropPlayerItemWithRandomChoiceHooks != null) - _result = overrideDropPlayerItemWithRandomChoiceHooks[overrideDropPlayerItemWithRandomChoiceHooks.length - 1].dropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - else - _result = player.localDropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - - if(afterDropPlayerItemWithRandomChoiceHooks != null) - for(int i = 0; i < afterDropPlayerItemWithRandomChoiceHooks.length; i++) - afterDropPlayerItemWithRandomChoiceHooks[i].afterDropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenDropPlayerItemWithRandomChoice(ClientPlayerBase overWriter) - { - if (overrideDropPlayerItemWithRandomChoiceHooks == null) - return overWriter; - - for(int i = 0; i < overrideDropPlayerItemWithRandomChoiceHooks.length; i++) - if(overrideDropPlayerItemWithRandomChoiceHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideDropPlayerItemWithRandomChoiceHooks[i - 1]; - - return overWriter; - } - - private final static List beforeDropPlayerItemWithRandomChoiceHookTypes = new LinkedList(); - private final static List overrideDropPlayerItemWithRandomChoiceHookTypes = new LinkedList(); - private final static List afterDropPlayerItemWithRandomChoiceHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeDropPlayerItemWithRandomChoiceHooks; - private ClientPlayerBase[] overrideDropPlayerItemWithRandomChoiceHooks; - private ClientPlayerBase[] afterDropPlayerItemWithRandomChoiceHooks; - - public boolean isDropPlayerItemWithRandomChoiceModded; - - private static final Map allBaseBeforeDropPlayerItemWithRandomChoiceSuperiors = new Hashtable(0); - private static final Map allBaseBeforeDropPlayerItemWithRandomChoiceInferiors = new Hashtable(0); - private static final Map allBaseOverrideDropPlayerItemWithRandomChoiceSuperiors = new Hashtable(0); - private static final Map allBaseOverrideDropPlayerItemWithRandomChoiceInferiors = new Hashtable(0); - private static final Map allBaseAfterDropPlayerItemWithRandomChoiceSuperiors = new Hashtable(0); - private static final Map allBaseAfterDropPlayerItemWithRandomChoiceInferiors = new Hashtable(0); - - public static void fall(IClientPlayerAPI target, float paramFloat1, float paramFloat2) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isFallModded) - clientPlayerAPI.fall(paramFloat1, paramFloat2); - else - target.localFall(paramFloat1, paramFloat2); - } - - private void fall(float paramFloat1, float paramFloat2) - { - if(beforeFallHooks != null) - for(int i = beforeFallHooks.length - 1; i >= 0 ; i--) - beforeFallHooks[i].beforeFall(paramFloat1, paramFloat2); - - if(overrideFallHooks != null) - overrideFallHooks[overrideFallHooks.length - 1].fall(paramFloat1, paramFloat2); - else - player.localFall(paramFloat1, paramFloat2); - - if(afterFallHooks != null) - for(int i = 0; i < afterFallHooks.length; i++) - afterFallHooks[i].afterFall(paramFloat1, paramFloat2); - - } - - protected ClientPlayerBase GetOverwrittenFall(ClientPlayerBase overWriter) - { - if (overrideFallHooks == null) - return overWriter; - - for(int i = 0; i < overrideFallHooks.length; i++) - if(overrideFallHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideFallHooks[i - 1]; - - return overWriter; - } - - private final static List beforeFallHookTypes = new LinkedList(); - private final static List overrideFallHookTypes = new LinkedList(); - private final static List afterFallHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeFallHooks; - private ClientPlayerBase[] overrideFallHooks; - private ClientPlayerBase[] afterFallHooks; - - public boolean isFallModded; - - private static final Map allBaseBeforeFallSuperiors = new Hashtable(0); - private static final Map allBaseBeforeFallInferiors = new Hashtable(0); - private static final Map allBaseOverrideFallSuperiors = new Hashtable(0); - private static final Map allBaseOverrideFallInferiors = new Hashtable(0); - private static final Map allBaseAfterFallSuperiors = new Hashtable(0); - private static final Map allBaseAfterFallInferiors = new Hashtable(0); - - public static float getAIMoveSpeed(IClientPlayerAPI target) - { - float _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isGetAIMoveSpeedModded) - _result = clientPlayerAPI.getAIMoveSpeed(); - else - _result = target.localGetAIMoveSpeed(); - return _result; - } - - private float getAIMoveSpeed() - { - if(beforeGetAIMoveSpeedHooks != null) - for(int i = beforeGetAIMoveSpeedHooks.length - 1; i >= 0 ; i--) - beforeGetAIMoveSpeedHooks[i].beforeGetAIMoveSpeed(); - - float _result; - if(overrideGetAIMoveSpeedHooks != null) - _result = overrideGetAIMoveSpeedHooks[overrideGetAIMoveSpeedHooks.length - 1].getAIMoveSpeed(); - else - _result = player.localGetAIMoveSpeed(); - - if(afterGetAIMoveSpeedHooks != null) - for(int i = 0; i < afterGetAIMoveSpeedHooks.length; i++) - afterGetAIMoveSpeedHooks[i].afterGetAIMoveSpeed(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenGetAIMoveSpeed(ClientPlayerBase overWriter) - { - if (overrideGetAIMoveSpeedHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetAIMoveSpeedHooks.length; i++) - if(overrideGetAIMoveSpeedHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetAIMoveSpeedHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetAIMoveSpeedHookTypes = new LinkedList(); - private final static List overrideGetAIMoveSpeedHookTypes = new LinkedList(); - private final static List afterGetAIMoveSpeedHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeGetAIMoveSpeedHooks; - private ClientPlayerBase[] overrideGetAIMoveSpeedHooks; - private ClientPlayerBase[] afterGetAIMoveSpeedHooks; - - public boolean isGetAIMoveSpeedModded; - - private static final Map allBaseBeforeGetAIMoveSpeedSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetAIMoveSpeedInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetAIMoveSpeedSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetAIMoveSpeedInferiors = new Hashtable(0); - private static final Map allBaseAfterGetAIMoveSpeedSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetAIMoveSpeedInferiors = new Hashtable(0); - - public static float getBedOrientationInDegrees(IClientPlayerAPI target) - { - float _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isGetBedOrientationInDegreesModded) - _result = clientPlayerAPI.getBedOrientationInDegrees(); - else - _result = target.localGetBedOrientationInDegrees(); - return _result; - } - - private float getBedOrientationInDegrees() - { - if(beforeGetBedOrientationInDegreesHooks != null) - for(int i = beforeGetBedOrientationInDegreesHooks.length - 1; i >= 0 ; i--) - beforeGetBedOrientationInDegreesHooks[i].beforeGetBedOrientationInDegrees(); - - float _result; - if(overrideGetBedOrientationInDegreesHooks != null) - _result = overrideGetBedOrientationInDegreesHooks[overrideGetBedOrientationInDegreesHooks.length - 1].getBedOrientationInDegrees(); - else - _result = player.localGetBedOrientationInDegrees(); - - if(afterGetBedOrientationInDegreesHooks != null) - for(int i = 0; i < afterGetBedOrientationInDegreesHooks.length; i++) - afterGetBedOrientationInDegreesHooks[i].afterGetBedOrientationInDegrees(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenGetBedOrientationInDegrees(ClientPlayerBase overWriter) - { - if (overrideGetBedOrientationInDegreesHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetBedOrientationInDegreesHooks.length; i++) - if(overrideGetBedOrientationInDegreesHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetBedOrientationInDegreesHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetBedOrientationInDegreesHookTypes = new LinkedList(); - private final static List overrideGetBedOrientationInDegreesHookTypes = new LinkedList(); - private final static List afterGetBedOrientationInDegreesHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeGetBedOrientationInDegreesHooks; - private ClientPlayerBase[] overrideGetBedOrientationInDegreesHooks; - private ClientPlayerBase[] afterGetBedOrientationInDegreesHooks; - - public boolean isGetBedOrientationInDegreesModded; - - private static final Map allBaseBeforeGetBedOrientationInDegreesSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetBedOrientationInDegreesInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetBedOrientationInDegreesSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetBedOrientationInDegreesInferiors = new Hashtable(0); - private static final Map allBaseAfterGetBedOrientationInDegreesSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetBedOrientationInDegreesInferiors = new Hashtable(0); - - public static float getBrightness(IClientPlayerAPI target, float paramFloat) - { - float _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isGetBrightnessModded) - _result = clientPlayerAPI.getBrightness(paramFloat); - else - _result = target.localGetBrightness(paramFloat); - return _result; - } - - private float getBrightness(float paramFloat) - { - if(beforeGetBrightnessHooks != null) - for(int i = beforeGetBrightnessHooks.length - 1; i >= 0 ; i--) - beforeGetBrightnessHooks[i].beforeGetBrightness(paramFloat); - - float _result; - if(overrideGetBrightnessHooks != null) - _result = overrideGetBrightnessHooks[overrideGetBrightnessHooks.length - 1].getBrightness(paramFloat); - else - _result = player.localGetBrightness(paramFloat); - - if(afterGetBrightnessHooks != null) - for(int i = 0; i < afterGetBrightnessHooks.length; i++) - afterGetBrightnessHooks[i].afterGetBrightness(paramFloat); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenGetBrightness(ClientPlayerBase overWriter) - { - if (overrideGetBrightnessHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetBrightnessHooks.length; i++) - if(overrideGetBrightnessHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetBrightnessHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetBrightnessHookTypes = new LinkedList(); - private final static List overrideGetBrightnessHookTypes = new LinkedList(); - private final static List afterGetBrightnessHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeGetBrightnessHooks; - private ClientPlayerBase[] overrideGetBrightnessHooks; - private ClientPlayerBase[] afterGetBrightnessHooks; - - public boolean isGetBrightnessModded; - - private static final Map allBaseBeforeGetBrightnessSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetBrightnessInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetBrightnessSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetBrightnessInferiors = new Hashtable(0); - private static final Map allBaseAfterGetBrightnessSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetBrightnessInferiors = new Hashtable(0); - - public static int getBrightnessForRender(IClientPlayerAPI target, float paramFloat) - { - int _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isGetBrightnessForRenderModded) - _result = clientPlayerAPI.getBrightnessForRender(paramFloat); - else - _result = target.localGetBrightnessForRender(paramFloat); - return _result; - } - - private int getBrightnessForRender(float paramFloat) - { - if(beforeGetBrightnessForRenderHooks != null) - for(int i = beforeGetBrightnessForRenderHooks.length - 1; i >= 0 ; i--) - beforeGetBrightnessForRenderHooks[i].beforeGetBrightnessForRender(paramFloat); - - int _result; - if(overrideGetBrightnessForRenderHooks != null) - _result = overrideGetBrightnessForRenderHooks[overrideGetBrightnessForRenderHooks.length - 1].getBrightnessForRender(paramFloat); - else - _result = player.localGetBrightnessForRender(paramFloat); - - if(afterGetBrightnessForRenderHooks != null) - for(int i = 0; i < afterGetBrightnessForRenderHooks.length; i++) - afterGetBrightnessForRenderHooks[i].afterGetBrightnessForRender(paramFloat); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenGetBrightnessForRender(ClientPlayerBase overWriter) - { - if (overrideGetBrightnessForRenderHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetBrightnessForRenderHooks.length; i++) - if(overrideGetBrightnessForRenderHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetBrightnessForRenderHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetBrightnessForRenderHookTypes = new LinkedList(); - private final static List overrideGetBrightnessForRenderHookTypes = new LinkedList(); - private final static List afterGetBrightnessForRenderHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeGetBrightnessForRenderHooks; - private ClientPlayerBase[] overrideGetBrightnessForRenderHooks; - private ClientPlayerBase[] afterGetBrightnessForRenderHooks; - - public boolean isGetBrightnessForRenderModded; - - private static final Map allBaseBeforeGetBrightnessForRenderSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetBrightnessForRenderInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetBrightnessForRenderSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetBrightnessForRenderInferiors = new Hashtable(0); - private static final Map allBaseAfterGetBrightnessForRenderSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetBrightnessForRenderInferiors = new Hashtable(0); - - public static float getBreakSpeed(IClientPlayerAPI target, net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos) - { - float _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isGetBreakSpeedModded) - _result = clientPlayerAPI.getBreakSpeed(paramIBlockState, paramBlockPos); - else - _result = target.localGetBreakSpeed(paramIBlockState, paramBlockPos); - return _result; - } - - private float getBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos) - { - if(beforeGetBreakSpeedHooks != null) - for(int i = beforeGetBreakSpeedHooks.length - 1; i >= 0 ; i--) - beforeGetBreakSpeedHooks[i].beforeGetBreakSpeed(paramIBlockState, paramBlockPos); - - float _result; - if(overrideGetBreakSpeedHooks != null) - _result = overrideGetBreakSpeedHooks[overrideGetBreakSpeedHooks.length - 1].getBreakSpeed(paramIBlockState, paramBlockPos); - else - _result = player.localGetBreakSpeed(paramIBlockState, paramBlockPos); - - if(afterGetBreakSpeedHooks != null) - for(int i = 0; i < afterGetBreakSpeedHooks.length; i++) - afterGetBreakSpeedHooks[i].afterGetBreakSpeed(paramIBlockState, paramBlockPos); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenGetBreakSpeed(ClientPlayerBase overWriter) - { - if (overrideGetBreakSpeedHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetBreakSpeedHooks.length; i++) - if(overrideGetBreakSpeedHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetBreakSpeedHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetBreakSpeedHookTypes = new LinkedList(); - private final static List overrideGetBreakSpeedHookTypes = new LinkedList(); - private final static List afterGetBreakSpeedHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeGetBreakSpeedHooks; - private ClientPlayerBase[] overrideGetBreakSpeedHooks; - private ClientPlayerBase[] afterGetBreakSpeedHooks; - - public boolean isGetBreakSpeedModded; - - private static final Map allBaseBeforeGetBreakSpeedSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetBreakSpeedInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetBreakSpeedSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetBreakSpeedInferiors = new Hashtable(0); - private static final Map allBaseAfterGetBreakSpeedSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetBreakSpeedInferiors = new Hashtable(0); - - public static double getDistanceSq(IClientPlayerAPI target, double paramDouble1, double paramDouble2, double paramDouble3) - { - double _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isGetDistanceSqModded) - _result = clientPlayerAPI.getDistanceSq(paramDouble1, paramDouble2, paramDouble3); - else - _result = target.localGetDistanceSq(paramDouble1, paramDouble2, paramDouble3); - return _result; - } - - private double getDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3) - { - if(beforeGetDistanceSqHooks != null) - for(int i = beforeGetDistanceSqHooks.length - 1; i >= 0 ; i--) - beforeGetDistanceSqHooks[i].beforeGetDistanceSq(paramDouble1, paramDouble2, paramDouble3); - - double _result; - if(overrideGetDistanceSqHooks != null) - _result = overrideGetDistanceSqHooks[overrideGetDistanceSqHooks.length - 1].getDistanceSq(paramDouble1, paramDouble2, paramDouble3); - else - _result = player.localGetDistanceSq(paramDouble1, paramDouble2, paramDouble3); - - if(afterGetDistanceSqHooks != null) - for(int i = 0; i < afterGetDistanceSqHooks.length; i++) - afterGetDistanceSqHooks[i].afterGetDistanceSq(paramDouble1, paramDouble2, paramDouble3); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenGetDistanceSq(ClientPlayerBase overWriter) - { - if (overrideGetDistanceSqHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetDistanceSqHooks.length; i++) - if(overrideGetDistanceSqHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetDistanceSqHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetDistanceSqHookTypes = new LinkedList(); - private final static List overrideGetDistanceSqHookTypes = new LinkedList(); - private final static List afterGetDistanceSqHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeGetDistanceSqHooks; - private ClientPlayerBase[] overrideGetDistanceSqHooks; - private ClientPlayerBase[] afterGetDistanceSqHooks; - - public boolean isGetDistanceSqModded; - - private static final Map allBaseBeforeGetDistanceSqSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetDistanceSqInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetDistanceSqSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetDistanceSqInferiors = new Hashtable(0); - private static final Map allBaseAfterGetDistanceSqSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetDistanceSqInferiors = new Hashtable(0); - - public static double getDistanceSqToEntity(IClientPlayerAPI target, net.minecraft.entity.Entity paramEntity) - { - double _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isGetDistanceSqToEntityModded) - _result = clientPlayerAPI.getDistanceSqToEntity(paramEntity); - else - _result = target.localGetDistanceSqToEntity(paramEntity); - return _result; - } - - private double getDistanceSqToEntity(net.minecraft.entity.Entity paramEntity) - { - if(beforeGetDistanceSqToEntityHooks != null) - for(int i = beforeGetDistanceSqToEntityHooks.length - 1; i >= 0 ; i--) - beforeGetDistanceSqToEntityHooks[i].beforeGetDistanceSqToEntity(paramEntity); - - double _result; - if(overrideGetDistanceSqToEntityHooks != null) - _result = overrideGetDistanceSqToEntityHooks[overrideGetDistanceSqToEntityHooks.length - 1].getDistanceSqToEntity(paramEntity); - else - _result = player.localGetDistanceSqToEntity(paramEntity); - - if(afterGetDistanceSqToEntityHooks != null) - for(int i = 0; i < afterGetDistanceSqToEntityHooks.length; i++) - afterGetDistanceSqToEntityHooks[i].afterGetDistanceSqToEntity(paramEntity); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenGetDistanceSqToEntity(ClientPlayerBase overWriter) - { - if (overrideGetDistanceSqToEntityHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetDistanceSqToEntityHooks.length; i++) - if(overrideGetDistanceSqToEntityHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetDistanceSqToEntityHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetDistanceSqToEntityHookTypes = new LinkedList(); - private final static List overrideGetDistanceSqToEntityHookTypes = new LinkedList(); - private final static List afterGetDistanceSqToEntityHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeGetDistanceSqToEntityHooks; - private ClientPlayerBase[] overrideGetDistanceSqToEntityHooks; - private ClientPlayerBase[] afterGetDistanceSqToEntityHooks; - - public boolean isGetDistanceSqToEntityModded; - - private static final Map allBaseBeforeGetDistanceSqToEntitySuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetDistanceSqToEntityInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetDistanceSqToEntitySuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetDistanceSqToEntityInferiors = new Hashtable(0); - private static final Map allBaseAfterGetDistanceSqToEntitySuperiors = new Hashtable(0); - private static final Map allBaseAfterGetDistanceSqToEntityInferiors = new Hashtable(0); - - public static float getFovModifier(IClientPlayerAPI target) - { - float _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isGetFovModifierModded) - _result = clientPlayerAPI.getFovModifier(); - else - _result = target.localGetFovModifier(); - return _result; - } - - private float getFovModifier() - { - if(beforeGetFovModifierHooks != null) - for(int i = beforeGetFovModifierHooks.length - 1; i >= 0 ; i--) - beforeGetFovModifierHooks[i].beforeGetFovModifier(); - - float _result; - if(overrideGetFovModifierHooks != null) - _result = overrideGetFovModifierHooks[overrideGetFovModifierHooks.length - 1].getFovModifier(); - else - _result = player.localGetFovModifier(); - - if(afterGetFovModifierHooks != null) - for(int i = 0; i < afterGetFovModifierHooks.length; i++) - afterGetFovModifierHooks[i].afterGetFovModifier(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenGetFovModifier(ClientPlayerBase overWriter) - { - if (overrideGetFovModifierHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetFovModifierHooks.length; i++) - if(overrideGetFovModifierHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetFovModifierHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetFovModifierHookTypes = new LinkedList(); - private final static List overrideGetFovModifierHookTypes = new LinkedList(); - private final static List afterGetFovModifierHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeGetFovModifierHooks; - private ClientPlayerBase[] overrideGetFovModifierHooks; - private ClientPlayerBase[] afterGetFovModifierHooks; - - public boolean isGetFovModifierModded; - - private static final Map allBaseBeforeGetFovModifierSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetFovModifierInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetFovModifierSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetFovModifierInferiors = new Hashtable(0); - private static final Map allBaseAfterGetFovModifierSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetFovModifierInferiors = new Hashtable(0); - - public static net.minecraft.util.SoundEvent getHurtSound(IClientPlayerAPI target) - { - net.minecraft.util.SoundEvent _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isGetHurtSoundModded) - _result = clientPlayerAPI.getHurtSound(); - else - _result = target.localGetHurtSound(); - return _result; - } - - private net.minecraft.util.SoundEvent getHurtSound() - { - if(beforeGetHurtSoundHooks != null) - for(int i = beforeGetHurtSoundHooks.length - 1; i >= 0 ; i--) - beforeGetHurtSoundHooks[i].beforeGetHurtSound(); - - net.minecraft.util.SoundEvent _result; - if(overrideGetHurtSoundHooks != null) - _result = overrideGetHurtSoundHooks[overrideGetHurtSoundHooks.length - 1].getHurtSound(); - else - _result = player.localGetHurtSound(); - - if(afterGetHurtSoundHooks != null) - for(int i = 0; i < afterGetHurtSoundHooks.length; i++) - afterGetHurtSoundHooks[i].afterGetHurtSound(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenGetHurtSound(ClientPlayerBase overWriter) - { - if (overrideGetHurtSoundHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetHurtSoundHooks.length; i++) - if(overrideGetHurtSoundHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetHurtSoundHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetHurtSoundHookTypes = new LinkedList(); - private final static List overrideGetHurtSoundHookTypes = new LinkedList(); - private final static List afterGetHurtSoundHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeGetHurtSoundHooks; - private ClientPlayerBase[] overrideGetHurtSoundHooks; - private ClientPlayerBase[] afterGetHurtSoundHooks; - - public boolean isGetHurtSoundModded; - - private static final Map allBaseBeforeGetHurtSoundSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetHurtSoundInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetHurtSoundSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetHurtSoundInferiors = new Hashtable(0); - private static final Map allBaseAfterGetHurtSoundSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetHurtSoundInferiors = new Hashtable(0); - - public static java.lang.String getName(IClientPlayerAPI target) - { - java.lang.String _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isGetNameModded) - _result = clientPlayerAPI.getName(); - else - _result = target.localGetName(); - return _result; - } - - private java.lang.String getName() - { - if(beforeGetNameHooks != null) - for(int i = beforeGetNameHooks.length - 1; i >= 0 ; i--) - beforeGetNameHooks[i].beforeGetName(); - - java.lang.String _result; - if(overrideGetNameHooks != null) - _result = overrideGetNameHooks[overrideGetNameHooks.length - 1].getName(); - else - _result = player.localGetName(); - - if(afterGetNameHooks != null) - for(int i = 0; i < afterGetNameHooks.length; i++) - afterGetNameHooks[i].afterGetName(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenGetName(ClientPlayerBase overWriter) - { - if (overrideGetNameHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetNameHooks.length; i++) - if(overrideGetNameHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetNameHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetNameHookTypes = new LinkedList(); - private final static List overrideGetNameHookTypes = new LinkedList(); - private final static List afterGetNameHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeGetNameHooks; - private ClientPlayerBase[] overrideGetNameHooks; - private ClientPlayerBase[] afterGetNameHooks; - - public boolean isGetNameModded; - - private static final Map allBaseBeforeGetNameSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetNameInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetNameSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetNameInferiors = new Hashtable(0); - private static final Map allBaseAfterGetNameSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetNameInferiors = new Hashtable(0); - - public static int getSleepTimer(IClientPlayerAPI target) - { - int _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isGetSleepTimerModded) - _result = clientPlayerAPI.getSleepTimer(); - else - _result = target.localGetSleepTimer(); - return _result; - } - - private int getSleepTimer() - { - if(beforeGetSleepTimerHooks != null) - for(int i = beforeGetSleepTimerHooks.length - 1; i >= 0 ; i--) - beforeGetSleepTimerHooks[i].beforeGetSleepTimer(); - - int _result; - if(overrideGetSleepTimerHooks != null) - _result = overrideGetSleepTimerHooks[overrideGetSleepTimerHooks.length - 1].getSleepTimer(); - else - _result = player.localGetSleepTimer(); - - if(afterGetSleepTimerHooks != null) - for(int i = 0; i < afterGetSleepTimerHooks.length; i++) - afterGetSleepTimerHooks[i].afterGetSleepTimer(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenGetSleepTimer(ClientPlayerBase overWriter) - { - if (overrideGetSleepTimerHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetSleepTimerHooks.length; i++) - if(overrideGetSleepTimerHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetSleepTimerHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetSleepTimerHookTypes = new LinkedList(); - private final static List overrideGetSleepTimerHookTypes = new LinkedList(); - private final static List afterGetSleepTimerHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeGetSleepTimerHooks; - private ClientPlayerBase[] overrideGetSleepTimerHooks; - private ClientPlayerBase[] afterGetSleepTimerHooks; - - public boolean isGetSleepTimerModded; - - private static final Map allBaseBeforeGetSleepTimerSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetSleepTimerInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetSleepTimerSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetSleepTimerInferiors = new Hashtable(0); - private static final Map allBaseAfterGetSleepTimerSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetSleepTimerInferiors = new Hashtable(0); - - public static boolean handleWaterMovement(IClientPlayerAPI target) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isHandleWaterMovementModded) - _result = clientPlayerAPI.handleWaterMovement(); - else - _result = target.localHandleWaterMovement(); - return _result; - } - - private boolean handleWaterMovement() - { - if(beforeHandleWaterMovementHooks != null) - for(int i = beforeHandleWaterMovementHooks.length - 1; i >= 0 ; i--) - beforeHandleWaterMovementHooks[i].beforeHandleWaterMovement(); - - boolean _result; - if(overrideHandleWaterMovementHooks != null) - _result = overrideHandleWaterMovementHooks[overrideHandleWaterMovementHooks.length - 1].handleWaterMovement(); - else - _result = player.localHandleWaterMovement(); - - if(afterHandleWaterMovementHooks != null) - for(int i = 0; i < afterHandleWaterMovementHooks.length; i++) - afterHandleWaterMovementHooks[i].afterHandleWaterMovement(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenHandleWaterMovement(ClientPlayerBase overWriter) - { - if (overrideHandleWaterMovementHooks == null) - return overWriter; - - for(int i = 0; i < overrideHandleWaterMovementHooks.length; i++) - if(overrideHandleWaterMovementHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideHandleWaterMovementHooks[i - 1]; - - return overWriter; - } - - private final static List beforeHandleWaterMovementHookTypes = new LinkedList(); - private final static List overrideHandleWaterMovementHookTypes = new LinkedList(); - private final static List afterHandleWaterMovementHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeHandleWaterMovementHooks; - private ClientPlayerBase[] overrideHandleWaterMovementHooks; - private ClientPlayerBase[] afterHandleWaterMovementHooks; - - public boolean isHandleWaterMovementModded; - - private static final Map allBaseBeforeHandleWaterMovementSuperiors = new Hashtable(0); - private static final Map allBaseBeforeHandleWaterMovementInferiors = new Hashtable(0); - private static final Map allBaseOverrideHandleWaterMovementSuperiors = new Hashtable(0); - private static final Map allBaseOverrideHandleWaterMovementInferiors = new Hashtable(0); - private static final Map allBaseAfterHandleWaterMovementSuperiors = new Hashtable(0); - private static final Map allBaseAfterHandleWaterMovementInferiors = new Hashtable(0); - - public static void heal(IClientPlayerAPI target, float paramFloat) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isHealModded) - clientPlayerAPI.heal(paramFloat); - else - target.localHeal(paramFloat); - } - - private void heal(float paramFloat) - { - if(beforeHealHooks != null) - for(int i = beforeHealHooks.length - 1; i >= 0 ; i--) - beforeHealHooks[i].beforeHeal(paramFloat); - - if(overrideHealHooks != null) - overrideHealHooks[overrideHealHooks.length - 1].heal(paramFloat); - else - player.localHeal(paramFloat); - - if(afterHealHooks != null) - for(int i = 0; i < afterHealHooks.length; i++) - afterHealHooks[i].afterHeal(paramFloat); - - } - - protected ClientPlayerBase GetOverwrittenHeal(ClientPlayerBase overWriter) - { - if (overrideHealHooks == null) - return overWriter; - - for(int i = 0; i < overrideHealHooks.length; i++) - if(overrideHealHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideHealHooks[i - 1]; - - return overWriter; - } - - private final static List beforeHealHookTypes = new LinkedList(); - private final static List overrideHealHookTypes = new LinkedList(); - private final static List afterHealHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeHealHooks; - private ClientPlayerBase[] overrideHealHooks; - private ClientPlayerBase[] afterHealHooks; - - public boolean isHealModded; - - private static final Map allBaseBeforeHealSuperiors = new Hashtable(0); - private static final Map allBaseBeforeHealInferiors = new Hashtable(0); - private static final Map allBaseOverrideHealSuperiors = new Hashtable(0); - private static final Map allBaseOverrideHealInferiors = new Hashtable(0); - private static final Map allBaseAfterHealSuperiors = new Hashtable(0); - private static final Map allBaseAfterHealInferiors = new Hashtable(0); - - public static boolean isEntityInsideOpaqueBlock(IClientPlayerAPI target) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isIsEntityInsideOpaqueBlockModded) - _result = clientPlayerAPI.isEntityInsideOpaqueBlock(); - else - _result = target.localIsEntityInsideOpaqueBlock(); - return _result; - } - - private boolean isEntityInsideOpaqueBlock() - { - if(beforeIsEntityInsideOpaqueBlockHooks != null) - for(int i = beforeIsEntityInsideOpaqueBlockHooks.length - 1; i >= 0 ; i--) - beforeIsEntityInsideOpaqueBlockHooks[i].beforeIsEntityInsideOpaqueBlock(); - - boolean _result; - if(overrideIsEntityInsideOpaqueBlockHooks != null) - _result = overrideIsEntityInsideOpaqueBlockHooks[overrideIsEntityInsideOpaqueBlockHooks.length - 1].isEntityInsideOpaqueBlock(); - else - _result = player.localIsEntityInsideOpaqueBlock(); - - if(afterIsEntityInsideOpaqueBlockHooks != null) - for(int i = 0; i < afterIsEntityInsideOpaqueBlockHooks.length; i++) - afterIsEntityInsideOpaqueBlockHooks[i].afterIsEntityInsideOpaqueBlock(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenIsEntityInsideOpaqueBlock(ClientPlayerBase overWriter) - { - if (overrideIsEntityInsideOpaqueBlockHooks == null) - return overWriter; - - for(int i = 0; i < overrideIsEntityInsideOpaqueBlockHooks.length; i++) - if(overrideIsEntityInsideOpaqueBlockHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideIsEntityInsideOpaqueBlockHooks[i - 1]; - - return overWriter; - } - - private final static List beforeIsEntityInsideOpaqueBlockHookTypes = new LinkedList(); - private final static List overrideIsEntityInsideOpaqueBlockHookTypes = new LinkedList(); - private final static List afterIsEntityInsideOpaqueBlockHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeIsEntityInsideOpaqueBlockHooks; - private ClientPlayerBase[] overrideIsEntityInsideOpaqueBlockHooks; - private ClientPlayerBase[] afterIsEntityInsideOpaqueBlockHooks; - - public boolean isIsEntityInsideOpaqueBlockModded; - - private static final Map allBaseBeforeIsEntityInsideOpaqueBlockSuperiors = new Hashtable(0); - private static final Map allBaseBeforeIsEntityInsideOpaqueBlockInferiors = new Hashtable(0); - private static final Map allBaseOverrideIsEntityInsideOpaqueBlockSuperiors = new Hashtable(0); - private static final Map allBaseOverrideIsEntityInsideOpaqueBlockInferiors = new Hashtable(0); - private static final Map allBaseAfterIsEntityInsideOpaqueBlockSuperiors = new Hashtable(0); - private static final Map allBaseAfterIsEntityInsideOpaqueBlockInferiors = new Hashtable(0); - - public static boolean isInWater(IClientPlayerAPI target) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isIsInWaterModded) - _result = clientPlayerAPI.isInWater(); - else - _result = target.localIsInWater(); - return _result; - } - - private boolean isInWater() - { - if(beforeIsInWaterHooks != null) - for(int i = beforeIsInWaterHooks.length - 1; i >= 0 ; i--) - beforeIsInWaterHooks[i].beforeIsInWater(); - - boolean _result; - if(overrideIsInWaterHooks != null) - _result = overrideIsInWaterHooks[overrideIsInWaterHooks.length - 1].isInWater(); - else - _result = player.localIsInWater(); - - if(afterIsInWaterHooks != null) - for(int i = 0; i < afterIsInWaterHooks.length; i++) - afterIsInWaterHooks[i].afterIsInWater(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenIsInWater(ClientPlayerBase overWriter) - { - if (overrideIsInWaterHooks == null) - return overWriter; - - for(int i = 0; i < overrideIsInWaterHooks.length; i++) - if(overrideIsInWaterHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideIsInWaterHooks[i - 1]; - - return overWriter; - } - - private final static List beforeIsInWaterHookTypes = new LinkedList(); - private final static List overrideIsInWaterHookTypes = new LinkedList(); - private final static List afterIsInWaterHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeIsInWaterHooks; - private ClientPlayerBase[] overrideIsInWaterHooks; - private ClientPlayerBase[] afterIsInWaterHooks; - - public boolean isIsInWaterModded; - - private static final Map allBaseBeforeIsInWaterSuperiors = new Hashtable(0); - private static final Map allBaseBeforeIsInWaterInferiors = new Hashtable(0); - private static final Map allBaseOverrideIsInWaterSuperiors = new Hashtable(0); - private static final Map allBaseOverrideIsInWaterInferiors = new Hashtable(0); - private static final Map allBaseAfterIsInWaterSuperiors = new Hashtable(0); - private static final Map allBaseAfterIsInWaterInferiors = new Hashtable(0); - - public static boolean isInsideOfMaterial(IClientPlayerAPI target, net.minecraft.block.material.Material paramMaterial) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isIsInsideOfMaterialModded) - _result = clientPlayerAPI.isInsideOfMaterial(paramMaterial); - else - _result = target.localIsInsideOfMaterial(paramMaterial); - return _result; - } - - private boolean isInsideOfMaterial(net.minecraft.block.material.Material paramMaterial) - { - if(beforeIsInsideOfMaterialHooks != null) - for(int i = beforeIsInsideOfMaterialHooks.length - 1; i >= 0 ; i--) - beforeIsInsideOfMaterialHooks[i].beforeIsInsideOfMaterial(paramMaterial); - - boolean _result; - if(overrideIsInsideOfMaterialHooks != null) - _result = overrideIsInsideOfMaterialHooks[overrideIsInsideOfMaterialHooks.length - 1].isInsideOfMaterial(paramMaterial); - else - _result = player.localIsInsideOfMaterial(paramMaterial); - - if(afterIsInsideOfMaterialHooks != null) - for(int i = 0; i < afterIsInsideOfMaterialHooks.length; i++) - afterIsInsideOfMaterialHooks[i].afterIsInsideOfMaterial(paramMaterial); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenIsInsideOfMaterial(ClientPlayerBase overWriter) - { - if (overrideIsInsideOfMaterialHooks == null) - return overWriter; - - for(int i = 0; i < overrideIsInsideOfMaterialHooks.length; i++) - if(overrideIsInsideOfMaterialHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideIsInsideOfMaterialHooks[i - 1]; - - return overWriter; - } - - private final static List beforeIsInsideOfMaterialHookTypes = new LinkedList(); - private final static List overrideIsInsideOfMaterialHookTypes = new LinkedList(); - private final static List afterIsInsideOfMaterialHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeIsInsideOfMaterialHooks; - private ClientPlayerBase[] overrideIsInsideOfMaterialHooks; - private ClientPlayerBase[] afterIsInsideOfMaterialHooks; - - public boolean isIsInsideOfMaterialModded; - - private static final Map allBaseBeforeIsInsideOfMaterialSuperiors = new Hashtable(0); - private static final Map allBaseBeforeIsInsideOfMaterialInferiors = new Hashtable(0); - private static final Map allBaseOverrideIsInsideOfMaterialSuperiors = new Hashtable(0); - private static final Map allBaseOverrideIsInsideOfMaterialInferiors = new Hashtable(0); - private static final Map allBaseAfterIsInsideOfMaterialSuperiors = new Hashtable(0); - private static final Map allBaseAfterIsInsideOfMaterialInferiors = new Hashtable(0); - - public static boolean isOnLadder(IClientPlayerAPI target) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isIsOnLadderModded) - _result = clientPlayerAPI.isOnLadder(); - else - _result = target.localIsOnLadder(); - return _result; - } - - private boolean isOnLadder() - { - if(beforeIsOnLadderHooks != null) - for(int i = beforeIsOnLadderHooks.length - 1; i >= 0 ; i--) - beforeIsOnLadderHooks[i].beforeIsOnLadder(); - - boolean _result; - if(overrideIsOnLadderHooks != null) - _result = overrideIsOnLadderHooks[overrideIsOnLadderHooks.length - 1].isOnLadder(); - else - _result = player.localIsOnLadder(); - - if(afterIsOnLadderHooks != null) - for(int i = 0; i < afterIsOnLadderHooks.length; i++) - afterIsOnLadderHooks[i].afterIsOnLadder(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenIsOnLadder(ClientPlayerBase overWriter) - { - if (overrideIsOnLadderHooks == null) - return overWriter; - - for(int i = 0; i < overrideIsOnLadderHooks.length; i++) - if(overrideIsOnLadderHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideIsOnLadderHooks[i - 1]; - - return overWriter; - } - - private final static List beforeIsOnLadderHookTypes = new LinkedList(); - private final static List overrideIsOnLadderHookTypes = new LinkedList(); - private final static List afterIsOnLadderHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeIsOnLadderHooks; - private ClientPlayerBase[] overrideIsOnLadderHooks; - private ClientPlayerBase[] afterIsOnLadderHooks; - - public boolean isIsOnLadderModded; - - private static final Map allBaseBeforeIsOnLadderSuperiors = new Hashtable(0); - private static final Map allBaseBeforeIsOnLadderInferiors = new Hashtable(0); - private static final Map allBaseOverrideIsOnLadderSuperiors = new Hashtable(0); - private static final Map allBaseOverrideIsOnLadderInferiors = new Hashtable(0); - private static final Map allBaseAfterIsOnLadderSuperiors = new Hashtable(0); - private static final Map allBaseAfterIsOnLadderInferiors = new Hashtable(0); - - public static boolean isPlayerSleeping(IClientPlayerAPI target) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isIsPlayerSleepingModded) - _result = clientPlayerAPI.isPlayerSleeping(); - else - _result = target.localIsPlayerSleeping(); - return _result; - } - - private boolean isPlayerSleeping() - { - if(beforeIsPlayerSleepingHooks != null) - for(int i = beforeIsPlayerSleepingHooks.length - 1; i >= 0 ; i--) - beforeIsPlayerSleepingHooks[i].beforeIsPlayerSleeping(); - - boolean _result; - if(overrideIsPlayerSleepingHooks != null) - _result = overrideIsPlayerSleepingHooks[overrideIsPlayerSleepingHooks.length - 1].isPlayerSleeping(); - else - _result = player.localIsPlayerSleeping(); - - if(afterIsPlayerSleepingHooks != null) - for(int i = 0; i < afterIsPlayerSleepingHooks.length; i++) - afterIsPlayerSleepingHooks[i].afterIsPlayerSleeping(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenIsPlayerSleeping(ClientPlayerBase overWriter) - { - if (overrideIsPlayerSleepingHooks == null) - return overWriter; - - for(int i = 0; i < overrideIsPlayerSleepingHooks.length; i++) - if(overrideIsPlayerSleepingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideIsPlayerSleepingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeIsPlayerSleepingHookTypes = new LinkedList(); - private final static List overrideIsPlayerSleepingHookTypes = new LinkedList(); - private final static List afterIsPlayerSleepingHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeIsPlayerSleepingHooks; - private ClientPlayerBase[] overrideIsPlayerSleepingHooks; - private ClientPlayerBase[] afterIsPlayerSleepingHooks; - - public boolean isIsPlayerSleepingModded; - - private static final Map allBaseBeforeIsPlayerSleepingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeIsPlayerSleepingInferiors = new Hashtable(0); - private static final Map allBaseOverrideIsPlayerSleepingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideIsPlayerSleepingInferiors = new Hashtable(0); - private static final Map allBaseAfterIsPlayerSleepingSuperiors = new Hashtable(0); - private static final Map allBaseAfterIsPlayerSleepingInferiors = new Hashtable(0); - - public static boolean isSneaking(IClientPlayerAPI target) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isIsSneakingModded) - _result = clientPlayerAPI.isSneaking(); - else - _result = target.localIsSneaking(); - return _result; - } - - private boolean isSneaking() - { - if(beforeIsSneakingHooks != null) - for(int i = beforeIsSneakingHooks.length - 1; i >= 0 ; i--) - beforeIsSneakingHooks[i].beforeIsSneaking(); - - boolean _result; - if(overrideIsSneakingHooks != null) - _result = overrideIsSneakingHooks[overrideIsSneakingHooks.length - 1].isSneaking(); - else - _result = player.localIsSneaking(); - - if(afterIsSneakingHooks != null) - for(int i = 0; i < afterIsSneakingHooks.length; i++) - afterIsSneakingHooks[i].afterIsSneaking(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenIsSneaking(ClientPlayerBase overWriter) - { - if (overrideIsSneakingHooks == null) - return overWriter; - - for(int i = 0; i < overrideIsSneakingHooks.length; i++) - if(overrideIsSneakingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideIsSneakingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeIsSneakingHookTypes = new LinkedList(); - private final static List overrideIsSneakingHookTypes = new LinkedList(); - private final static List afterIsSneakingHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeIsSneakingHooks; - private ClientPlayerBase[] overrideIsSneakingHooks; - private ClientPlayerBase[] afterIsSneakingHooks; - - public boolean isIsSneakingModded; - - private static final Map allBaseBeforeIsSneakingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeIsSneakingInferiors = new Hashtable(0); - private static final Map allBaseOverrideIsSneakingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideIsSneakingInferiors = new Hashtable(0); - private static final Map allBaseAfterIsSneakingSuperiors = new Hashtable(0); - private static final Map allBaseAfterIsSneakingInferiors = new Hashtable(0); - - public static boolean isSprinting(IClientPlayerAPI target) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isIsSprintingModded) - _result = clientPlayerAPI.isSprinting(); - else - _result = target.localIsSprinting(); - return _result; - } - - private boolean isSprinting() - { - if(beforeIsSprintingHooks != null) - for(int i = beforeIsSprintingHooks.length - 1; i >= 0 ; i--) - beforeIsSprintingHooks[i].beforeIsSprinting(); - - boolean _result; - if(overrideIsSprintingHooks != null) - _result = overrideIsSprintingHooks[overrideIsSprintingHooks.length - 1].isSprinting(); - else - _result = player.localIsSprinting(); - - if(afterIsSprintingHooks != null) - for(int i = 0; i < afterIsSprintingHooks.length; i++) - afterIsSprintingHooks[i].afterIsSprinting(); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenIsSprinting(ClientPlayerBase overWriter) - { - if (overrideIsSprintingHooks == null) - return overWriter; - - for(int i = 0; i < overrideIsSprintingHooks.length; i++) - if(overrideIsSprintingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideIsSprintingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeIsSprintingHookTypes = new LinkedList(); - private final static List overrideIsSprintingHookTypes = new LinkedList(); - private final static List afterIsSprintingHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeIsSprintingHooks; - private ClientPlayerBase[] overrideIsSprintingHooks; - private ClientPlayerBase[] afterIsSprintingHooks; - - public boolean isIsSprintingModded; - - private static final Map allBaseBeforeIsSprintingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeIsSprintingInferiors = new Hashtable(0); - private static final Map allBaseOverrideIsSprintingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideIsSprintingInferiors = new Hashtable(0); - private static final Map allBaseAfterIsSprintingSuperiors = new Hashtable(0); - private static final Map allBaseAfterIsSprintingInferiors = new Hashtable(0); - - public static void jump(IClientPlayerAPI target) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isJumpModded) - clientPlayerAPI.jump(); - else - target.localJump(); - } - - private void jump() - { - if(beforeJumpHooks != null) - for(int i = beforeJumpHooks.length - 1; i >= 0 ; i--) - beforeJumpHooks[i].beforeJump(); - - if(overrideJumpHooks != null) - overrideJumpHooks[overrideJumpHooks.length - 1].jump(); - else - player.localJump(); - - if(afterJumpHooks != null) - for(int i = 0; i < afterJumpHooks.length; i++) - afterJumpHooks[i].afterJump(); - - } - - protected ClientPlayerBase GetOverwrittenJump(ClientPlayerBase overWriter) - { - if (overrideJumpHooks == null) - return overWriter; - - for(int i = 0; i < overrideJumpHooks.length; i++) - if(overrideJumpHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideJumpHooks[i - 1]; - - return overWriter; - } - - private final static List beforeJumpHookTypes = new LinkedList(); - private final static List overrideJumpHookTypes = new LinkedList(); - private final static List afterJumpHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeJumpHooks; - private ClientPlayerBase[] overrideJumpHooks; - private ClientPlayerBase[] afterJumpHooks; - - public boolean isJumpModded; - - private static final Map allBaseBeforeJumpSuperiors = new Hashtable(0); - private static final Map allBaseBeforeJumpInferiors = new Hashtable(0); - private static final Map allBaseOverrideJumpSuperiors = new Hashtable(0); - private static final Map allBaseOverrideJumpInferiors = new Hashtable(0); - private static final Map allBaseAfterJumpSuperiors = new Hashtable(0); - private static final Map allBaseAfterJumpInferiors = new Hashtable(0); - - public static void knockBack(IClientPlayerAPI target, net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isKnockBackModded) - clientPlayerAPI.knockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - else - target.localKnockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - } - - private void knockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2) - { - if(beforeKnockBackHooks != null) - for(int i = beforeKnockBackHooks.length - 1; i >= 0 ; i--) - beforeKnockBackHooks[i].beforeKnockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - - if(overrideKnockBackHooks != null) - overrideKnockBackHooks[overrideKnockBackHooks.length - 1].knockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - else - player.localKnockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - - if(afterKnockBackHooks != null) - for(int i = 0; i < afterKnockBackHooks.length; i++) - afterKnockBackHooks[i].afterKnockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - - } - - protected ClientPlayerBase GetOverwrittenKnockBack(ClientPlayerBase overWriter) - { - if (overrideKnockBackHooks == null) - return overWriter; - - for(int i = 0; i < overrideKnockBackHooks.length; i++) - if(overrideKnockBackHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideKnockBackHooks[i - 1]; - - return overWriter; - } - - private final static List beforeKnockBackHookTypes = new LinkedList(); - private final static List overrideKnockBackHookTypes = new LinkedList(); - private final static List afterKnockBackHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeKnockBackHooks; - private ClientPlayerBase[] overrideKnockBackHooks; - private ClientPlayerBase[] afterKnockBackHooks; - - public boolean isKnockBackModded; - - private static final Map allBaseBeforeKnockBackSuperiors = new Hashtable(0); - private static final Map allBaseBeforeKnockBackInferiors = new Hashtable(0); - private static final Map allBaseOverrideKnockBackSuperiors = new Hashtable(0); - private static final Map allBaseOverrideKnockBackInferiors = new Hashtable(0); - private static final Map allBaseAfterKnockBackSuperiors = new Hashtable(0); - private static final Map allBaseAfterKnockBackInferiors = new Hashtable(0); - - public static void moveEntity(IClientPlayerAPI target, double paramDouble1, double paramDouble2, double paramDouble3) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isMoveEntityModded) - clientPlayerAPI.moveEntity(paramDouble1, paramDouble2, paramDouble3); - else - target.localMoveEntity(paramDouble1, paramDouble2, paramDouble3); - } - - private void moveEntity(double paramDouble1, double paramDouble2, double paramDouble3) - { - if(beforeMoveEntityHooks != null) - for(int i = beforeMoveEntityHooks.length - 1; i >= 0 ; i--) - beforeMoveEntityHooks[i].beforeMoveEntity(paramDouble1, paramDouble2, paramDouble3); - - if(overrideMoveEntityHooks != null) - overrideMoveEntityHooks[overrideMoveEntityHooks.length - 1].moveEntity(paramDouble1, paramDouble2, paramDouble3); - else - player.localMoveEntity(paramDouble1, paramDouble2, paramDouble3); - - if(afterMoveEntityHooks != null) - for(int i = 0; i < afterMoveEntityHooks.length; i++) - afterMoveEntityHooks[i].afterMoveEntity(paramDouble1, paramDouble2, paramDouble3); - - } - - protected ClientPlayerBase GetOverwrittenMoveEntity(ClientPlayerBase overWriter) - { - if (overrideMoveEntityHooks == null) - return overWriter; - - for(int i = 0; i < overrideMoveEntityHooks.length; i++) - if(overrideMoveEntityHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideMoveEntityHooks[i - 1]; - - return overWriter; - } - - private final static List beforeMoveEntityHookTypes = new LinkedList(); - private final static List overrideMoveEntityHookTypes = new LinkedList(); - private final static List afterMoveEntityHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeMoveEntityHooks; - private ClientPlayerBase[] overrideMoveEntityHooks; - private ClientPlayerBase[] afterMoveEntityHooks; - - public boolean isMoveEntityModded; - - private static final Map allBaseBeforeMoveEntitySuperiors = new Hashtable(0); - private static final Map allBaseBeforeMoveEntityInferiors = new Hashtable(0); - private static final Map allBaseOverrideMoveEntitySuperiors = new Hashtable(0); - private static final Map allBaseOverrideMoveEntityInferiors = new Hashtable(0); - private static final Map allBaseAfterMoveEntitySuperiors = new Hashtable(0); - private static final Map allBaseAfterMoveEntityInferiors = new Hashtable(0); - - public static void moveEntityWithHeading(IClientPlayerAPI target, float paramFloat1, float paramFloat2) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isMoveEntityWithHeadingModded) - clientPlayerAPI.moveEntityWithHeading(paramFloat1, paramFloat2); - else - target.localMoveEntityWithHeading(paramFloat1, paramFloat2); - } - - private void moveEntityWithHeading(float paramFloat1, float paramFloat2) - { - if(beforeMoveEntityWithHeadingHooks != null) - for(int i = beforeMoveEntityWithHeadingHooks.length - 1; i >= 0 ; i--) - beforeMoveEntityWithHeadingHooks[i].beforeMoveEntityWithHeading(paramFloat1, paramFloat2); - - if(overrideMoveEntityWithHeadingHooks != null) - overrideMoveEntityWithHeadingHooks[overrideMoveEntityWithHeadingHooks.length - 1].moveEntityWithHeading(paramFloat1, paramFloat2); - else - player.localMoveEntityWithHeading(paramFloat1, paramFloat2); - - if(afterMoveEntityWithHeadingHooks != null) - for(int i = 0; i < afterMoveEntityWithHeadingHooks.length; i++) - afterMoveEntityWithHeadingHooks[i].afterMoveEntityWithHeading(paramFloat1, paramFloat2); - - } - - protected ClientPlayerBase GetOverwrittenMoveEntityWithHeading(ClientPlayerBase overWriter) - { - if (overrideMoveEntityWithHeadingHooks == null) - return overWriter; - - for(int i = 0; i < overrideMoveEntityWithHeadingHooks.length; i++) - if(overrideMoveEntityWithHeadingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideMoveEntityWithHeadingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeMoveEntityWithHeadingHookTypes = new LinkedList(); - private final static List overrideMoveEntityWithHeadingHookTypes = new LinkedList(); - private final static List afterMoveEntityWithHeadingHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeMoveEntityWithHeadingHooks; - private ClientPlayerBase[] overrideMoveEntityWithHeadingHooks; - private ClientPlayerBase[] afterMoveEntityWithHeadingHooks; - - public boolean isMoveEntityWithHeadingModded; - - private static final Map allBaseBeforeMoveEntityWithHeadingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeMoveEntityWithHeadingInferiors = new Hashtable(0); - private static final Map allBaseOverrideMoveEntityWithHeadingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideMoveEntityWithHeadingInferiors = new Hashtable(0); - private static final Map allBaseAfterMoveEntityWithHeadingSuperiors = new Hashtable(0); - private static final Map allBaseAfterMoveEntityWithHeadingInferiors = new Hashtable(0); - - public static void moveFlying(IClientPlayerAPI target, float paramFloat1, float paramFloat2, float paramFloat3) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isMoveFlyingModded) - clientPlayerAPI.moveFlying(paramFloat1, paramFloat2, paramFloat3); - else - target.localMoveFlying(paramFloat1, paramFloat2, paramFloat3); - } - - private void moveFlying(float paramFloat1, float paramFloat2, float paramFloat3) - { - if(beforeMoveFlyingHooks != null) - for(int i = beforeMoveFlyingHooks.length - 1; i >= 0 ; i--) - beforeMoveFlyingHooks[i].beforeMoveFlying(paramFloat1, paramFloat2, paramFloat3); - - if(overrideMoveFlyingHooks != null) - overrideMoveFlyingHooks[overrideMoveFlyingHooks.length - 1].moveFlying(paramFloat1, paramFloat2, paramFloat3); - else - player.localMoveFlying(paramFloat1, paramFloat2, paramFloat3); - - if(afterMoveFlyingHooks != null) - for(int i = 0; i < afterMoveFlyingHooks.length; i++) - afterMoveFlyingHooks[i].afterMoveFlying(paramFloat1, paramFloat2, paramFloat3); - - } - - protected ClientPlayerBase GetOverwrittenMoveFlying(ClientPlayerBase overWriter) - { - if (overrideMoveFlyingHooks == null) - return overWriter; - - for(int i = 0; i < overrideMoveFlyingHooks.length; i++) - if(overrideMoveFlyingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideMoveFlyingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeMoveFlyingHookTypes = new LinkedList(); - private final static List overrideMoveFlyingHookTypes = new LinkedList(); - private final static List afterMoveFlyingHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeMoveFlyingHooks; - private ClientPlayerBase[] overrideMoveFlyingHooks; - private ClientPlayerBase[] afterMoveFlyingHooks; - - public boolean isMoveFlyingModded; - - private static final Map allBaseBeforeMoveFlyingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeMoveFlyingInferiors = new Hashtable(0); - private static final Map allBaseOverrideMoveFlyingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideMoveFlyingInferiors = new Hashtable(0); - private static final Map allBaseAfterMoveFlyingSuperiors = new Hashtable(0); - private static final Map allBaseAfterMoveFlyingInferiors = new Hashtable(0); - - public static void onDeath(IClientPlayerAPI target, net.minecraft.util.DamageSource paramDamageSource) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isOnDeathModded) - clientPlayerAPI.onDeath(paramDamageSource); - else - target.localOnDeath(paramDamageSource); - } - - private void onDeath(net.minecraft.util.DamageSource paramDamageSource) - { - if(beforeOnDeathHooks != null) - for(int i = beforeOnDeathHooks.length - 1; i >= 0 ; i--) - beforeOnDeathHooks[i].beforeOnDeath(paramDamageSource); - - if(overrideOnDeathHooks != null) - overrideOnDeathHooks[overrideOnDeathHooks.length - 1].onDeath(paramDamageSource); - else - player.localOnDeath(paramDamageSource); - - if(afterOnDeathHooks != null) - for(int i = 0; i < afterOnDeathHooks.length; i++) - afterOnDeathHooks[i].afterOnDeath(paramDamageSource); - - } - - protected ClientPlayerBase GetOverwrittenOnDeath(ClientPlayerBase overWriter) - { - if (overrideOnDeathHooks == null) - return overWriter; - - for(int i = 0; i < overrideOnDeathHooks.length; i++) - if(overrideOnDeathHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideOnDeathHooks[i - 1]; - - return overWriter; - } - - private final static List beforeOnDeathHookTypes = new LinkedList(); - private final static List overrideOnDeathHookTypes = new LinkedList(); - private final static List afterOnDeathHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeOnDeathHooks; - private ClientPlayerBase[] overrideOnDeathHooks; - private ClientPlayerBase[] afterOnDeathHooks; - - public boolean isOnDeathModded; - - private static final Map allBaseBeforeOnDeathSuperiors = new Hashtable(0); - private static final Map allBaseBeforeOnDeathInferiors = new Hashtable(0); - private static final Map allBaseOverrideOnDeathSuperiors = new Hashtable(0); - private static final Map allBaseOverrideOnDeathInferiors = new Hashtable(0); - private static final Map allBaseAfterOnDeathSuperiors = new Hashtable(0); - private static final Map allBaseAfterOnDeathInferiors = new Hashtable(0); - - public static void onLivingUpdate(IClientPlayerAPI target) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isOnLivingUpdateModded) - clientPlayerAPI.onLivingUpdate(); - else - target.localOnLivingUpdate(); - } - - private void onLivingUpdate() - { - if(beforeOnLivingUpdateHooks != null) - for(int i = beforeOnLivingUpdateHooks.length - 1; i >= 0 ; i--) - beforeOnLivingUpdateHooks[i].beforeOnLivingUpdate(); - - if(overrideOnLivingUpdateHooks != null) - overrideOnLivingUpdateHooks[overrideOnLivingUpdateHooks.length - 1].onLivingUpdate(); - else - player.localOnLivingUpdate(); - - if(afterOnLivingUpdateHooks != null) - for(int i = 0; i < afterOnLivingUpdateHooks.length; i++) - afterOnLivingUpdateHooks[i].afterOnLivingUpdate(); - - } - - protected ClientPlayerBase GetOverwrittenOnLivingUpdate(ClientPlayerBase overWriter) - { - if (overrideOnLivingUpdateHooks == null) - return overWriter; - - for(int i = 0; i < overrideOnLivingUpdateHooks.length; i++) - if(overrideOnLivingUpdateHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideOnLivingUpdateHooks[i - 1]; - - return overWriter; - } - - private final static List beforeOnLivingUpdateHookTypes = new LinkedList(); - private final static List overrideOnLivingUpdateHookTypes = new LinkedList(); - private final static List afterOnLivingUpdateHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeOnLivingUpdateHooks; - private ClientPlayerBase[] overrideOnLivingUpdateHooks; - private ClientPlayerBase[] afterOnLivingUpdateHooks; - - public boolean isOnLivingUpdateModded; - - private static final Map allBaseBeforeOnLivingUpdateSuperiors = new Hashtable(0); - private static final Map allBaseBeforeOnLivingUpdateInferiors = new Hashtable(0); - private static final Map allBaseOverrideOnLivingUpdateSuperiors = new Hashtable(0); - private static final Map allBaseOverrideOnLivingUpdateInferiors = new Hashtable(0); - private static final Map allBaseAfterOnLivingUpdateSuperiors = new Hashtable(0); - private static final Map allBaseAfterOnLivingUpdateInferiors = new Hashtable(0); - - public static void onKillEntity(IClientPlayerAPI target, net.minecraft.entity.EntityLivingBase paramEntityLivingBase) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isOnKillEntityModded) - clientPlayerAPI.onKillEntity(paramEntityLivingBase); - else - target.localOnKillEntity(paramEntityLivingBase); - } - - private void onKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase) - { - if(beforeOnKillEntityHooks != null) - for(int i = beforeOnKillEntityHooks.length - 1; i >= 0 ; i--) - beforeOnKillEntityHooks[i].beforeOnKillEntity(paramEntityLivingBase); - - if(overrideOnKillEntityHooks != null) - overrideOnKillEntityHooks[overrideOnKillEntityHooks.length - 1].onKillEntity(paramEntityLivingBase); - else - player.localOnKillEntity(paramEntityLivingBase); - - if(afterOnKillEntityHooks != null) - for(int i = 0; i < afterOnKillEntityHooks.length; i++) - afterOnKillEntityHooks[i].afterOnKillEntity(paramEntityLivingBase); - - } - - protected ClientPlayerBase GetOverwrittenOnKillEntity(ClientPlayerBase overWriter) - { - if (overrideOnKillEntityHooks == null) - return overWriter; - - for(int i = 0; i < overrideOnKillEntityHooks.length; i++) - if(overrideOnKillEntityHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideOnKillEntityHooks[i - 1]; - - return overWriter; - } - - private final static List beforeOnKillEntityHookTypes = new LinkedList(); - private final static List overrideOnKillEntityHookTypes = new LinkedList(); - private final static List afterOnKillEntityHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeOnKillEntityHooks; - private ClientPlayerBase[] overrideOnKillEntityHooks; - private ClientPlayerBase[] afterOnKillEntityHooks; - - public boolean isOnKillEntityModded; - - private static final Map allBaseBeforeOnKillEntitySuperiors = new Hashtable(0); - private static final Map allBaseBeforeOnKillEntityInferiors = new Hashtable(0); - private static final Map allBaseOverrideOnKillEntitySuperiors = new Hashtable(0); - private static final Map allBaseOverrideOnKillEntityInferiors = new Hashtable(0); - private static final Map allBaseAfterOnKillEntitySuperiors = new Hashtable(0); - private static final Map allBaseAfterOnKillEntityInferiors = new Hashtable(0); - - public static void onStruckByLightning(IClientPlayerAPI target, net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isOnStruckByLightningModded) - clientPlayerAPI.onStruckByLightning(paramEntityLightningBolt); - else - target.localOnStruckByLightning(paramEntityLightningBolt); - } - - private void onStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt) - { - if(beforeOnStruckByLightningHooks != null) - for(int i = beforeOnStruckByLightningHooks.length - 1; i >= 0 ; i--) - beforeOnStruckByLightningHooks[i].beforeOnStruckByLightning(paramEntityLightningBolt); - - if(overrideOnStruckByLightningHooks != null) - overrideOnStruckByLightningHooks[overrideOnStruckByLightningHooks.length - 1].onStruckByLightning(paramEntityLightningBolt); - else - player.localOnStruckByLightning(paramEntityLightningBolt); - - if(afterOnStruckByLightningHooks != null) - for(int i = 0; i < afterOnStruckByLightningHooks.length; i++) - afterOnStruckByLightningHooks[i].afterOnStruckByLightning(paramEntityLightningBolt); - - } - - protected ClientPlayerBase GetOverwrittenOnStruckByLightning(ClientPlayerBase overWriter) - { - if (overrideOnStruckByLightningHooks == null) - return overWriter; - - for(int i = 0; i < overrideOnStruckByLightningHooks.length; i++) - if(overrideOnStruckByLightningHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideOnStruckByLightningHooks[i - 1]; - - return overWriter; - } - - private final static List beforeOnStruckByLightningHookTypes = new LinkedList(); - private final static List overrideOnStruckByLightningHookTypes = new LinkedList(); - private final static List afterOnStruckByLightningHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeOnStruckByLightningHooks; - private ClientPlayerBase[] overrideOnStruckByLightningHooks; - private ClientPlayerBase[] afterOnStruckByLightningHooks; - - public boolean isOnStruckByLightningModded; - - private static final Map allBaseBeforeOnStruckByLightningSuperiors = new Hashtable(0); - private static final Map allBaseBeforeOnStruckByLightningInferiors = new Hashtable(0); - private static final Map allBaseOverrideOnStruckByLightningSuperiors = new Hashtable(0); - private static final Map allBaseOverrideOnStruckByLightningInferiors = new Hashtable(0); - private static final Map allBaseAfterOnStruckByLightningSuperiors = new Hashtable(0); - private static final Map allBaseAfterOnStruckByLightningInferiors = new Hashtable(0); - - public static void onUpdate(IClientPlayerAPI target) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isOnUpdateModded) - clientPlayerAPI.onUpdate(); - else - target.localOnUpdate(); - } - - private void onUpdate() - { - if(beforeOnUpdateHooks != null) - for(int i = beforeOnUpdateHooks.length - 1; i >= 0 ; i--) - beforeOnUpdateHooks[i].beforeOnUpdate(); - - if(overrideOnUpdateHooks != null) - overrideOnUpdateHooks[overrideOnUpdateHooks.length - 1].onUpdate(); - else - player.localOnUpdate(); - - if(afterOnUpdateHooks != null) - for(int i = 0; i < afterOnUpdateHooks.length; i++) - afterOnUpdateHooks[i].afterOnUpdate(); - - } - - protected ClientPlayerBase GetOverwrittenOnUpdate(ClientPlayerBase overWriter) - { - if (overrideOnUpdateHooks == null) - return overWriter; - - for(int i = 0; i < overrideOnUpdateHooks.length; i++) - if(overrideOnUpdateHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideOnUpdateHooks[i - 1]; - - return overWriter; - } - - private final static List beforeOnUpdateHookTypes = new LinkedList(); - private final static List overrideOnUpdateHookTypes = new LinkedList(); - private final static List afterOnUpdateHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeOnUpdateHooks; - private ClientPlayerBase[] overrideOnUpdateHooks; - private ClientPlayerBase[] afterOnUpdateHooks; - - public boolean isOnUpdateModded; - - private static final Map allBaseBeforeOnUpdateSuperiors = new Hashtable(0); - private static final Map allBaseBeforeOnUpdateInferiors = new Hashtable(0); - private static final Map allBaseOverrideOnUpdateSuperiors = new Hashtable(0); - private static final Map allBaseOverrideOnUpdateInferiors = new Hashtable(0); - private static final Map allBaseAfterOnUpdateSuperiors = new Hashtable(0); - private static final Map allBaseAfterOnUpdateInferiors = new Hashtable(0); - - public static void playStepSound(IClientPlayerAPI target, net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.block.Block paramBlock) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isPlayStepSoundModded) - clientPlayerAPI.playStepSound(paramBlockPos, paramBlock); - else - target.localPlayStepSound(paramBlockPos, paramBlock); - } - - private void playStepSound(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.block.Block paramBlock) - { - if(beforePlayStepSoundHooks != null) - for(int i = beforePlayStepSoundHooks.length - 1; i >= 0 ; i--) - beforePlayStepSoundHooks[i].beforePlayStepSound(paramBlockPos, paramBlock); - - if(overridePlayStepSoundHooks != null) - overridePlayStepSoundHooks[overridePlayStepSoundHooks.length - 1].playStepSound(paramBlockPos, paramBlock); - else - player.localPlayStepSound(paramBlockPos, paramBlock); - - if(afterPlayStepSoundHooks != null) - for(int i = 0; i < afterPlayStepSoundHooks.length; i++) - afterPlayStepSoundHooks[i].afterPlayStepSound(paramBlockPos, paramBlock); - - } - - protected ClientPlayerBase GetOverwrittenPlayStepSound(ClientPlayerBase overWriter) - { - if (overridePlayStepSoundHooks == null) - return overWriter; - - for(int i = 0; i < overridePlayStepSoundHooks.length; i++) - if(overridePlayStepSoundHooks[i] == overWriter) - if(i == 0) - return null; - else - return overridePlayStepSoundHooks[i - 1]; - - return overWriter; - } - - private final static List beforePlayStepSoundHookTypes = new LinkedList(); - private final static List overridePlayStepSoundHookTypes = new LinkedList(); - private final static List afterPlayStepSoundHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforePlayStepSoundHooks; - private ClientPlayerBase[] overridePlayStepSoundHooks; - private ClientPlayerBase[] afterPlayStepSoundHooks; - - public boolean isPlayStepSoundModded; - - private static final Map allBaseBeforePlayStepSoundSuperiors = new Hashtable(0); - private static final Map allBaseBeforePlayStepSoundInferiors = new Hashtable(0); - private static final Map allBaseOverridePlayStepSoundSuperiors = new Hashtable(0); - private static final Map allBaseOverridePlayStepSoundInferiors = new Hashtable(0); - private static final Map allBaseAfterPlayStepSoundSuperiors = new Hashtable(0); - private static final Map allBaseAfterPlayStepSoundInferiors = new Hashtable(0); - - public static boolean pushOutOfBlocks(IClientPlayerAPI target, double paramDouble1, double paramDouble2, double paramDouble3) - { - boolean _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isPushOutOfBlocksModded) - _result = clientPlayerAPI.pushOutOfBlocks(paramDouble1, paramDouble2, paramDouble3); - else - _result = target.localPushOutOfBlocks(paramDouble1, paramDouble2, paramDouble3); - return _result; - } - - private boolean pushOutOfBlocks(double paramDouble1, double paramDouble2, double paramDouble3) - { - if(beforePushOutOfBlocksHooks != null) - for(int i = beforePushOutOfBlocksHooks.length - 1; i >= 0 ; i--) - beforePushOutOfBlocksHooks[i].beforePushOutOfBlocks(paramDouble1, paramDouble2, paramDouble3); - - boolean _result; - if(overridePushOutOfBlocksHooks != null) - _result = overridePushOutOfBlocksHooks[overridePushOutOfBlocksHooks.length - 1].pushOutOfBlocks(paramDouble1, paramDouble2, paramDouble3); - else - _result = player.localPushOutOfBlocks(paramDouble1, paramDouble2, paramDouble3); - - if(afterPushOutOfBlocksHooks != null) - for(int i = 0; i < afterPushOutOfBlocksHooks.length; i++) - afterPushOutOfBlocksHooks[i].afterPushOutOfBlocks(paramDouble1, paramDouble2, paramDouble3); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenPushOutOfBlocks(ClientPlayerBase overWriter) - { - if (overridePushOutOfBlocksHooks == null) - return overWriter; - - for(int i = 0; i < overridePushOutOfBlocksHooks.length; i++) - if(overridePushOutOfBlocksHooks[i] == overWriter) - if(i == 0) - return null; - else - return overridePushOutOfBlocksHooks[i - 1]; - - return overWriter; - } - - private final static List beforePushOutOfBlocksHookTypes = new LinkedList(); - private final static List overridePushOutOfBlocksHookTypes = new LinkedList(); - private final static List afterPushOutOfBlocksHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforePushOutOfBlocksHooks; - private ClientPlayerBase[] overridePushOutOfBlocksHooks; - private ClientPlayerBase[] afterPushOutOfBlocksHooks; - - public boolean isPushOutOfBlocksModded; - - private static final Map allBaseBeforePushOutOfBlocksSuperiors = new Hashtable(0); - private static final Map allBaseBeforePushOutOfBlocksInferiors = new Hashtable(0); - private static final Map allBaseOverridePushOutOfBlocksSuperiors = new Hashtable(0); - private static final Map allBaseOverridePushOutOfBlocksInferiors = new Hashtable(0); - private static final Map allBaseAfterPushOutOfBlocksSuperiors = new Hashtable(0); - private static final Map allBaseAfterPushOutOfBlocksInferiors = new Hashtable(0); - - public static net.minecraft.util.math.RayTraceResult rayTrace(IClientPlayerAPI target, double paramDouble, float paramFloat) - { - net.minecraft.util.math.RayTraceResult _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isRayTraceModded) - _result = clientPlayerAPI.rayTrace(paramDouble, paramFloat); - else - _result = target.localRayTrace(paramDouble, paramFloat); - return _result; - } - - private net.minecraft.util.math.RayTraceResult rayTrace(double paramDouble, float paramFloat) - { - if(beforeRayTraceHooks != null) - for(int i = beforeRayTraceHooks.length - 1; i >= 0 ; i--) - beforeRayTraceHooks[i].beforeRayTrace(paramDouble, paramFloat); - - net.minecraft.util.math.RayTraceResult _result; - if(overrideRayTraceHooks != null) - _result = overrideRayTraceHooks[overrideRayTraceHooks.length - 1].rayTrace(paramDouble, paramFloat); - else - _result = player.localRayTrace(paramDouble, paramFloat); - - if(afterRayTraceHooks != null) - for(int i = 0; i < afterRayTraceHooks.length; i++) - afterRayTraceHooks[i].afterRayTrace(paramDouble, paramFloat); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenRayTrace(ClientPlayerBase overWriter) - { - if (overrideRayTraceHooks == null) - return overWriter; - - for(int i = 0; i < overrideRayTraceHooks.length; i++) - if(overrideRayTraceHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideRayTraceHooks[i - 1]; - - return overWriter; - } - - private final static List beforeRayTraceHookTypes = new LinkedList(); - private final static List overrideRayTraceHookTypes = new LinkedList(); - private final static List afterRayTraceHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeRayTraceHooks; - private ClientPlayerBase[] overrideRayTraceHooks; - private ClientPlayerBase[] afterRayTraceHooks; - - public boolean isRayTraceModded; - - private static final Map allBaseBeforeRayTraceSuperiors = new Hashtable(0); - private static final Map allBaseBeforeRayTraceInferiors = new Hashtable(0); - private static final Map allBaseOverrideRayTraceSuperiors = new Hashtable(0); - private static final Map allBaseOverrideRayTraceInferiors = new Hashtable(0); - private static final Map allBaseAfterRayTraceSuperiors = new Hashtable(0); - private static final Map allBaseAfterRayTraceInferiors = new Hashtable(0); - - public static void readEntityFromNBT(IClientPlayerAPI target, net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isReadEntityFromNBTModded) - clientPlayerAPI.readEntityFromNBT(paramNBTTagCompound); - else - target.localReadEntityFromNBT(paramNBTTagCompound); - } - - private void readEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - if(beforeReadEntityFromNBTHooks != null) - for(int i = beforeReadEntityFromNBTHooks.length - 1; i >= 0 ; i--) - beforeReadEntityFromNBTHooks[i].beforeReadEntityFromNBT(paramNBTTagCompound); - - if(overrideReadEntityFromNBTHooks != null) - overrideReadEntityFromNBTHooks[overrideReadEntityFromNBTHooks.length - 1].readEntityFromNBT(paramNBTTagCompound); - else - player.localReadEntityFromNBT(paramNBTTagCompound); - - if(afterReadEntityFromNBTHooks != null) - for(int i = 0; i < afterReadEntityFromNBTHooks.length; i++) - afterReadEntityFromNBTHooks[i].afterReadEntityFromNBT(paramNBTTagCompound); - - } - - protected ClientPlayerBase GetOverwrittenReadEntityFromNBT(ClientPlayerBase overWriter) - { - if (overrideReadEntityFromNBTHooks == null) - return overWriter; - - for(int i = 0; i < overrideReadEntityFromNBTHooks.length; i++) - if(overrideReadEntityFromNBTHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideReadEntityFromNBTHooks[i - 1]; - - return overWriter; - } - - private final static List beforeReadEntityFromNBTHookTypes = new LinkedList(); - private final static List overrideReadEntityFromNBTHookTypes = new LinkedList(); - private final static List afterReadEntityFromNBTHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeReadEntityFromNBTHooks; - private ClientPlayerBase[] overrideReadEntityFromNBTHooks; - private ClientPlayerBase[] afterReadEntityFromNBTHooks; - - public boolean isReadEntityFromNBTModded; - - private static final Map allBaseBeforeReadEntityFromNBTSuperiors = new Hashtable(0); - private static final Map allBaseBeforeReadEntityFromNBTInferiors = new Hashtable(0); - private static final Map allBaseOverrideReadEntityFromNBTSuperiors = new Hashtable(0); - private static final Map allBaseOverrideReadEntityFromNBTInferiors = new Hashtable(0); - private static final Map allBaseAfterReadEntityFromNBTSuperiors = new Hashtable(0); - private static final Map allBaseAfterReadEntityFromNBTInferiors = new Hashtable(0); - - public static void respawnPlayer(IClientPlayerAPI target) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isRespawnPlayerModded) - clientPlayerAPI.respawnPlayer(); - else - target.localRespawnPlayer(); - } - - private void respawnPlayer() - { - if(beforeRespawnPlayerHooks != null) - for(int i = beforeRespawnPlayerHooks.length - 1; i >= 0 ; i--) - beforeRespawnPlayerHooks[i].beforeRespawnPlayer(); - - if(overrideRespawnPlayerHooks != null) - overrideRespawnPlayerHooks[overrideRespawnPlayerHooks.length - 1].respawnPlayer(); - else - player.localRespawnPlayer(); - - if(afterRespawnPlayerHooks != null) - for(int i = 0; i < afterRespawnPlayerHooks.length; i++) - afterRespawnPlayerHooks[i].afterRespawnPlayer(); - - } - - protected ClientPlayerBase GetOverwrittenRespawnPlayer(ClientPlayerBase overWriter) - { - if (overrideRespawnPlayerHooks == null) - return overWriter; - - for(int i = 0; i < overrideRespawnPlayerHooks.length; i++) - if(overrideRespawnPlayerHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideRespawnPlayerHooks[i - 1]; - - return overWriter; - } - - private final static List beforeRespawnPlayerHookTypes = new LinkedList(); - private final static List overrideRespawnPlayerHookTypes = new LinkedList(); - private final static List afterRespawnPlayerHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeRespawnPlayerHooks; - private ClientPlayerBase[] overrideRespawnPlayerHooks; - private ClientPlayerBase[] afterRespawnPlayerHooks; - - public boolean isRespawnPlayerModded; - - private static final Map allBaseBeforeRespawnPlayerSuperiors = new Hashtable(0); - private static final Map allBaseBeforeRespawnPlayerInferiors = new Hashtable(0); - private static final Map allBaseOverrideRespawnPlayerSuperiors = new Hashtable(0); - private static final Map allBaseOverrideRespawnPlayerInferiors = new Hashtable(0); - private static final Map allBaseAfterRespawnPlayerSuperiors = new Hashtable(0); - private static final Map allBaseAfterRespawnPlayerInferiors = new Hashtable(0); - - public static void setDead(IClientPlayerAPI target) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isSetDeadModded) - clientPlayerAPI.setDead(); - else - target.localSetDead(); - } - - private void setDead() - { - if(beforeSetDeadHooks != null) - for(int i = beforeSetDeadHooks.length - 1; i >= 0 ; i--) - beforeSetDeadHooks[i].beforeSetDead(); - - if(overrideSetDeadHooks != null) - overrideSetDeadHooks[overrideSetDeadHooks.length - 1].setDead(); - else - player.localSetDead(); - - if(afterSetDeadHooks != null) - for(int i = 0; i < afterSetDeadHooks.length; i++) - afterSetDeadHooks[i].afterSetDead(); - - } - - protected ClientPlayerBase GetOverwrittenSetDead(ClientPlayerBase overWriter) - { - if (overrideSetDeadHooks == null) - return overWriter; - - for(int i = 0; i < overrideSetDeadHooks.length; i++) - if(overrideSetDeadHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideSetDeadHooks[i - 1]; - - return overWriter; - } - - private final static List beforeSetDeadHookTypes = new LinkedList(); - private final static List overrideSetDeadHookTypes = new LinkedList(); - private final static List afterSetDeadHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeSetDeadHooks; - private ClientPlayerBase[] overrideSetDeadHooks; - private ClientPlayerBase[] afterSetDeadHooks; - - public boolean isSetDeadModded; - - private static final Map allBaseBeforeSetDeadSuperiors = new Hashtable(0); - private static final Map allBaseBeforeSetDeadInferiors = new Hashtable(0); - private static final Map allBaseOverrideSetDeadSuperiors = new Hashtable(0); - private static final Map allBaseOverrideSetDeadInferiors = new Hashtable(0); - private static final Map allBaseAfterSetDeadSuperiors = new Hashtable(0); - private static final Map allBaseAfterSetDeadInferiors = new Hashtable(0); - - public static void setPlayerSPHealth(IClientPlayerAPI target, float paramFloat) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isSetPlayerSPHealthModded) - clientPlayerAPI.setPlayerSPHealth(paramFloat); - else - target.localSetPlayerSPHealth(paramFloat); - } - - private void setPlayerSPHealth(float paramFloat) - { - if(beforeSetPlayerSPHealthHooks != null) - for(int i = beforeSetPlayerSPHealthHooks.length - 1; i >= 0 ; i--) - beforeSetPlayerSPHealthHooks[i].beforeSetPlayerSPHealth(paramFloat); - - if(overrideSetPlayerSPHealthHooks != null) - overrideSetPlayerSPHealthHooks[overrideSetPlayerSPHealthHooks.length - 1].setPlayerSPHealth(paramFloat); - else - player.localSetPlayerSPHealth(paramFloat); - - if(afterSetPlayerSPHealthHooks != null) - for(int i = 0; i < afterSetPlayerSPHealthHooks.length; i++) - afterSetPlayerSPHealthHooks[i].afterSetPlayerSPHealth(paramFloat); - - } - - protected ClientPlayerBase GetOverwrittenSetPlayerSPHealth(ClientPlayerBase overWriter) - { - if (overrideSetPlayerSPHealthHooks == null) - return overWriter; - - for(int i = 0; i < overrideSetPlayerSPHealthHooks.length; i++) - if(overrideSetPlayerSPHealthHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideSetPlayerSPHealthHooks[i - 1]; - - return overWriter; - } - - private final static List beforeSetPlayerSPHealthHookTypes = new LinkedList(); - private final static List overrideSetPlayerSPHealthHookTypes = new LinkedList(); - private final static List afterSetPlayerSPHealthHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeSetPlayerSPHealthHooks; - private ClientPlayerBase[] overrideSetPlayerSPHealthHooks; - private ClientPlayerBase[] afterSetPlayerSPHealthHooks; - - public boolean isSetPlayerSPHealthModded; - - private static final Map allBaseBeforeSetPlayerSPHealthSuperiors = new Hashtable(0); - private static final Map allBaseBeforeSetPlayerSPHealthInferiors = new Hashtable(0); - private static final Map allBaseOverrideSetPlayerSPHealthSuperiors = new Hashtable(0); - private static final Map allBaseOverrideSetPlayerSPHealthInferiors = new Hashtable(0); - private static final Map allBaseAfterSetPlayerSPHealthSuperiors = new Hashtable(0); - private static final Map allBaseAfterSetPlayerSPHealthInferiors = new Hashtable(0); - - public static void setPositionAndRotation(IClientPlayerAPI target, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isSetPositionAndRotationModded) - clientPlayerAPI.setPositionAndRotation(paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2); - else - target.localSetPositionAndRotation(paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2); - } - - private void setPositionAndRotation(double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2) - { - if(beforeSetPositionAndRotationHooks != null) - for(int i = beforeSetPositionAndRotationHooks.length - 1; i >= 0 ; i--) - beforeSetPositionAndRotationHooks[i].beforeSetPositionAndRotation(paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2); - - if(overrideSetPositionAndRotationHooks != null) - overrideSetPositionAndRotationHooks[overrideSetPositionAndRotationHooks.length - 1].setPositionAndRotation(paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2); - else - player.localSetPositionAndRotation(paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2); - - if(afterSetPositionAndRotationHooks != null) - for(int i = 0; i < afterSetPositionAndRotationHooks.length; i++) - afterSetPositionAndRotationHooks[i].afterSetPositionAndRotation(paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2); - - } - - protected ClientPlayerBase GetOverwrittenSetPositionAndRotation(ClientPlayerBase overWriter) - { - if (overrideSetPositionAndRotationHooks == null) - return overWriter; - - for(int i = 0; i < overrideSetPositionAndRotationHooks.length; i++) - if(overrideSetPositionAndRotationHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideSetPositionAndRotationHooks[i - 1]; - - return overWriter; - } - - private final static List beforeSetPositionAndRotationHookTypes = new LinkedList(); - private final static List overrideSetPositionAndRotationHookTypes = new LinkedList(); - private final static List afterSetPositionAndRotationHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeSetPositionAndRotationHooks; - private ClientPlayerBase[] overrideSetPositionAndRotationHooks; - private ClientPlayerBase[] afterSetPositionAndRotationHooks; - - public boolean isSetPositionAndRotationModded; - - private static final Map allBaseBeforeSetPositionAndRotationSuperiors = new Hashtable(0); - private static final Map allBaseBeforeSetPositionAndRotationInferiors = new Hashtable(0); - private static final Map allBaseOverrideSetPositionAndRotationSuperiors = new Hashtable(0); - private static final Map allBaseOverrideSetPositionAndRotationInferiors = new Hashtable(0); - private static final Map allBaseAfterSetPositionAndRotationSuperiors = new Hashtable(0); - private static final Map allBaseAfterSetPositionAndRotationInferiors = new Hashtable(0); - - public static void setSneaking(IClientPlayerAPI target, boolean paramBoolean) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isSetSneakingModded) - clientPlayerAPI.setSneaking(paramBoolean); - else - target.localSetSneaking(paramBoolean); - } - - private void setSneaking(boolean paramBoolean) - { - if(beforeSetSneakingHooks != null) - for(int i = beforeSetSneakingHooks.length - 1; i >= 0 ; i--) - beforeSetSneakingHooks[i].beforeSetSneaking(paramBoolean); - - if(overrideSetSneakingHooks != null) - overrideSetSneakingHooks[overrideSetSneakingHooks.length - 1].setSneaking(paramBoolean); - else - player.localSetSneaking(paramBoolean); - - if(afterSetSneakingHooks != null) - for(int i = 0; i < afterSetSneakingHooks.length; i++) - afterSetSneakingHooks[i].afterSetSneaking(paramBoolean); - - } - - protected ClientPlayerBase GetOverwrittenSetSneaking(ClientPlayerBase overWriter) - { - if (overrideSetSneakingHooks == null) - return overWriter; - - for(int i = 0; i < overrideSetSneakingHooks.length; i++) - if(overrideSetSneakingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideSetSneakingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeSetSneakingHookTypes = new LinkedList(); - private final static List overrideSetSneakingHookTypes = new LinkedList(); - private final static List afterSetSneakingHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeSetSneakingHooks; - private ClientPlayerBase[] overrideSetSneakingHooks; - private ClientPlayerBase[] afterSetSneakingHooks; - - public boolean isSetSneakingModded; - - private static final Map allBaseBeforeSetSneakingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeSetSneakingInferiors = new Hashtable(0); - private static final Map allBaseOverrideSetSneakingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideSetSneakingInferiors = new Hashtable(0); - private static final Map allBaseAfterSetSneakingSuperiors = new Hashtable(0); - private static final Map allBaseAfterSetSneakingInferiors = new Hashtable(0); - - public static void setSprinting(IClientPlayerAPI target, boolean paramBoolean) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isSetSprintingModded) - clientPlayerAPI.setSprinting(paramBoolean); - else - target.localSetSprinting(paramBoolean); - } - - private void setSprinting(boolean paramBoolean) - { - if(beforeSetSprintingHooks != null) - for(int i = beforeSetSprintingHooks.length - 1; i >= 0 ; i--) - beforeSetSprintingHooks[i].beforeSetSprinting(paramBoolean); - - if(overrideSetSprintingHooks != null) - overrideSetSprintingHooks[overrideSetSprintingHooks.length - 1].setSprinting(paramBoolean); - else - player.localSetSprinting(paramBoolean); - - if(afterSetSprintingHooks != null) - for(int i = 0; i < afterSetSprintingHooks.length; i++) - afterSetSprintingHooks[i].afterSetSprinting(paramBoolean); - - } - - protected ClientPlayerBase GetOverwrittenSetSprinting(ClientPlayerBase overWriter) - { - if (overrideSetSprintingHooks == null) - return overWriter; - - for(int i = 0; i < overrideSetSprintingHooks.length; i++) - if(overrideSetSprintingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideSetSprintingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeSetSprintingHookTypes = new LinkedList(); - private final static List overrideSetSprintingHookTypes = new LinkedList(); - private final static List afterSetSprintingHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeSetSprintingHooks; - private ClientPlayerBase[] overrideSetSprintingHooks; - private ClientPlayerBase[] afterSetSprintingHooks; - - public boolean isSetSprintingModded; - - private static final Map allBaseBeforeSetSprintingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeSetSprintingInferiors = new Hashtable(0); - private static final Map allBaseOverrideSetSprintingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideSetSprintingInferiors = new Hashtable(0); - private static final Map allBaseAfterSetSprintingSuperiors = new Hashtable(0); - private static final Map allBaseAfterSetSprintingInferiors = new Hashtable(0); - - public static net.minecraft.entity.player.EntityPlayer.SleepResult trySleep(IClientPlayerAPI target, net.minecraft.util.math.BlockPos paramBlockPos) - { - net.minecraft.entity.player.EntityPlayer.SleepResult _result; - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isTrySleepModded) - _result = clientPlayerAPI.trySleep(paramBlockPos); - else - _result = target.localTrySleep(paramBlockPos); - return _result; - } - - private net.minecraft.entity.player.EntityPlayer.SleepResult trySleep(net.minecraft.util.math.BlockPos paramBlockPos) - { - if(beforeTrySleepHooks != null) - for(int i = beforeTrySleepHooks.length - 1; i >= 0 ; i--) - beforeTrySleepHooks[i].beforeTrySleep(paramBlockPos); - - net.minecraft.entity.player.EntityPlayer.SleepResult _result; - if(overrideTrySleepHooks != null) - _result = overrideTrySleepHooks[overrideTrySleepHooks.length - 1].trySleep(paramBlockPos); - else - _result = player.localTrySleep(paramBlockPos); - - if(afterTrySleepHooks != null) - for(int i = 0; i < afterTrySleepHooks.length; i++) - afterTrySleepHooks[i].afterTrySleep(paramBlockPos); - - return _result; - } - - protected ClientPlayerBase GetOverwrittenTrySleep(ClientPlayerBase overWriter) - { - if (overrideTrySleepHooks == null) - return overWriter; - - for(int i = 0; i < overrideTrySleepHooks.length; i++) - if(overrideTrySleepHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideTrySleepHooks[i - 1]; - - return overWriter; - } - - private final static List beforeTrySleepHookTypes = new LinkedList(); - private final static List overrideTrySleepHookTypes = new LinkedList(); - private final static List afterTrySleepHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeTrySleepHooks; - private ClientPlayerBase[] overrideTrySleepHooks; - private ClientPlayerBase[] afterTrySleepHooks; - - public boolean isTrySleepModded; - - private static final Map allBaseBeforeTrySleepSuperiors = new Hashtable(0); - private static final Map allBaseBeforeTrySleepInferiors = new Hashtable(0); - private static final Map allBaseOverrideTrySleepSuperiors = new Hashtable(0); - private static final Map allBaseOverrideTrySleepInferiors = new Hashtable(0); - private static final Map allBaseAfterTrySleepSuperiors = new Hashtable(0); - private static final Map allBaseAfterTrySleepInferiors = new Hashtable(0); - - public static void swingItem(IClientPlayerAPI target, net.minecraft.util.EnumHand paramEnumHand) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isSwingItemModded) - clientPlayerAPI.swingItem(paramEnumHand); - else - target.localSwingItem(paramEnumHand); - } - - private void swingItem(net.minecraft.util.EnumHand paramEnumHand) - { - if(beforeSwingItemHooks != null) - for(int i = beforeSwingItemHooks.length - 1; i >= 0 ; i--) - beforeSwingItemHooks[i].beforeSwingItem(paramEnumHand); - - if(overrideSwingItemHooks != null) - overrideSwingItemHooks[overrideSwingItemHooks.length - 1].swingItem(paramEnumHand); - else - player.localSwingItem(paramEnumHand); - - if(afterSwingItemHooks != null) - for(int i = 0; i < afterSwingItemHooks.length; i++) - afterSwingItemHooks[i].afterSwingItem(paramEnumHand); - - } - - protected ClientPlayerBase GetOverwrittenSwingItem(ClientPlayerBase overWriter) - { - if (overrideSwingItemHooks == null) - return overWriter; - - for(int i = 0; i < overrideSwingItemHooks.length; i++) - if(overrideSwingItemHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideSwingItemHooks[i - 1]; - - return overWriter; - } - - private final static List beforeSwingItemHookTypes = new LinkedList(); - private final static List overrideSwingItemHookTypes = new LinkedList(); - private final static List afterSwingItemHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeSwingItemHooks; - private ClientPlayerBase[] overrideSwingItemHooks; - private ClientPlayerBase[] afterSwingItemHooks; - - public boolean isSwingItemModded; - - private static final Map allBaseBeforeSwingItemSuperiors = new Hashtable(0); - private static final Map allBaseBeforeSwingItemInferiors = new Hashtable(0); - private static final Map allBaseOverrideSwingItemSuperiors = new Hashtable(0); - private static final Map allBaseOverrideSwingItemInferiors = new Hashtable(0); - private static final Map allBaseAfterSwingItemSuperiors = new Hashtable(0); - private static final Map allBaseAfterSwingItemInferiors = new Hashtable(0); - - public static void updateEntityActionState(IClientPlayerAPI target) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isUpdateEntityActionStateModded) - clientPlayerAPI.updateEntityActionState(); - else - target.localUpdateEntityActionState(); - } - - private void updateEntityActionState() - { - if(beforeUpdateEntityActionStateHooks != null) - for(int i = beforeUpdateEntityActionStateHooks.length - 1; i >= 0 ; i--) - beforeUpdateEntityActionStateHooks[i].beforeUpdateEntityActionState(); - - if(overrideUpdateEntityActionStateHooks != null) - overrideUpdateEntityActionStateHooks[overrideUpdateEntityActionStateHooks.length - 1].updateEntityActionState(); - else - player.localUpdateEntityActionState(); - - if(afterUpdateEntityActionStateHooks != null) - for(int i = 0; i < afterUpdateEntityActionStateHooks.length; i++) - afterUpdateEntityActionStateHooks[i].afterUpdateEntityActionState(); - - } - - protected ClientPlayerBase GetOverwrittenUpdateEntityActionState(ClientPlayerBase overWriter) - { - if (overrideUpdateEntityActionStateHooks == null) - return overWriter; - - for(int i = 0; i < overrideUpdateEntityActionStateHooks.length; i++) - if(overrideUpdateEntityActionStateHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideUpdateEntityActionStateHooks[i - 1]; - - return overWriter; - } - - private final static List beforeUpdateEntityActionStateHookTypes = new LinkedList(); - private final static List overrideUpdateEntityActionStateHookTypes = new LinkedList(); - private final static List afterUpdateEntityActionStateHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeUpdateEntityActionStateHooks; - private ClientPlayerBase[] overrideUpdateEntityActionStateHooks; - private ClientPlayerBase[] afterUpdateEntityActionStateHooks; - - public boolean isUpdateEntityActionStateModded; - - private static final Map allBaseBeforeUpdateEntityActionStateSuperiors = new Hashtable(0); - private static final Map allBaseBeforeUpdateEntityActionStateInferiors = new Hashtable(0); - private static final Map allBaseOverrideUpdateEntityActionStateSuperiors = new Hashtable(0); - private static final Map allBaseOverrideUpdateEntityActionStateInferiors = new Hashtable(0); - private static final Map allBaseAfterUpdateEntityActionStateSuperiors = new Hashtable(0); - private static final Map allBaseAfterUpdateEntityActionStateInferiors = new Hashtable(0); - - public static void updateRidden(IClientPlayerAPI target) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isUpdateRiddenModded) - clientPlayerAPI.updateRidden(); - else - target.localUpdateRidden(); - } - - private void updateRidden() - { - if(beforeUpdateRiddenHooks != null) - for(int i = beforeUpdateRiddenHooks.length - 1; i >= 0 ; i--) - beforeUpdateRiddenHooks[i].beforeUpdateRidden(); - - if(overrideUpdateRiddenHooks != null) - overrideUpdateRiddenHooks[overrideUpdateRiddenHooks.length - 1].updateRidden(); - else - player.localUpdateRidden(); - - if(afterUpdateRiddenHooks != null) - for(int i = 0; i < afterUpdateRiddenHooks.length; i++) - afterUpdateRiddenHooks[i].afterUpdateRidden(); - - } - - protected ClientPlayerBase GetOverwrittenUpdateRidden(ClientPlayerBase overWriter) - { - if (overrideUpdateRiddenHooks == null) - return overWriter; - - for(int i = 0; i < overrideUpdateRiddenHooks.length; i++) - if(overrideUpdateRiddenHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideUpdateRiddenHooks[i - 1]; - - return overWriter; - } - - private final static List beforeUpdateRiddenHookTypes = new LinkedList(); - private final static List overrideUpdateRiddenHookTypes = new LinkedList(); - private final static List afterUpdateRiddenHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeUpdateRiddenHooks; - private ClientPlayerBase[] overrideUpdateRiddenHooks; - private ClientPlayerBase[] afterUpdateRiddenHooks; - - public boolean isUpdateRiddenModded; - - private static final Map allBaseBeforeUpdateRiddenSuperiors = new Hashtable(0); - private static final Map allBaseBeforeUpdateRiddenInferiors = new Hashtable(0); - private static final Map allBaseOverrideUpdateRiddenSuperiors = new Hashtable(0); - private static final Map allBaseOverrideUpdateRiddenInferiors = new Hashtable(0); - private static final Map allBaseAfterUpdateRiddenSuperiors = new Hashtable(0); - private static final Map allBaseAfterUpdateRiddenInferiors = new Hashtable(0); - - public static void wakeUpPlayer(IClientPlayerAPI target, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isWakeUpPlayerModded) - clientPlayerAPI.wakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - else - target.localWakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - } - - private void wakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) - { - if(beforeWakeUpPlayerHooks != null) - for(int i = beforeWakeUpPlayerHooks.length - 1; i >= 0 ; i--) - beforeWakeUpPlayerHooks[i].beforeWakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - - if(overrideWakeUpPlayerHooks != null) - overrideWakeUpPlayerHooks[overrideWakeUpPlayerHooks.length - 1].wakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - else - player.localWakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - - if(afterWakeUpPlayerHooks != null) - for(int i = 0; i < afterWakeUpPlayerHooks.length; i++) - afterWakeUpPlayerHooks[i].afterWakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - - } - - protected ClientPlayerBase GetOverwrittenWakeUpPlayer(ClientPlayerBase overWriter) - { - if (overrideWakeUpPlayerHooks == null) - return overWriter; - - for(int i = 0; i < overrideWakeUpPlayerHooks.length; i++) - if(overrideWakeUpPlayerHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideWakeUpPlayerHooks[i - 1]; - - return overWriter; - } - - private final static List beforeWakeUpPlayerHookTypes = new LinkedList(); - private final static List overrideWakeUpPlayerHookTypes = new LinkedList(); - private final static List afterWakeUpPlayerHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeWakeUpPlayerHooks; - private ClientPlayerBase[] overrideWakeUpPlayerHooks; - private ClientPlayerBase[] afterWakeUpPlayerHooks; - - public boolean isWakeUpPlayerModded; - - private static final Map allBaseBeforeWakeUpPlayerSuperiors = new Hashtable(0); - private static final Map allBaseBeforeWakeUpPlayerInferiors = new Hashtable(0); - private static final Map allBaseOverrideWakeUpPlayerSuperiors = new Hashtable(0); - private static final Map allBaseOverrideWakeUpPlayerInferiors = new Hashtable(0); - private static final Map allBaseAfterWakeUpPlayerSuperiors = new Hashtable(0); - private static final Map allBaseAfterWakeUpPlayerInferiors = new Hashtable(0); - - public static void writeEntityToNBT(IClientPlayerAPI target, net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - ClientPlayerAPI clientPlayerAPI = target.getClientPlayerAPI(); - if(clientPlayerAPI != null && clientPlayerAPI.isWriteEntityToNBTModded) - clientPlayerAPI.writeEntityToNBT(paramNBTTagCompound); - else - target.localWriteEntityToNBT(paramNBTTagCompound); - } - - private void writeEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - if(beforeWriteEntityToNBTHooks != null) - for(int i = beforeWriteEntityToNBTHooks.length - 1; i >= 0 ; i--) - beforeWriteEntityToNBTHooks[i].beforeWriteEntityToNBT(paramNBTTagCompound); - - if(overrideWriteEntityToNBTHooks != null) - overrideWriteEntityToNBTHooks[overrideWriteEntityToNBTHooks.length - 1].writeEntityToNBT(paramNBTTagCompound); - else - player.localWriteEntityToNBT(paramNBTTagCompound); - - if(afterWriteEntityToNBTHooks != null) - for(int i = 0; i < afterWriteEntityToNBTHooks.length; i++) - afterWriteEntityToNBTHooks[i].afterWriteEntityToNBT(paramNBTTagCompound); - - } - - protected ClientPlayerBase GetOverwrittenWriteEntityToNBT(ClientPlayerBase overWriter) - { - if (overrideWriteEntityToNBTHooks == null) - return overWriter; - - for(int i = 0; i < overrideWriteEntityToNBTHooks.length; i++) - if(overrideWriteEntityToNBTHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideWriteEntityToNBTHooks[i - 1]; - - return overWriter; - } - - private final static List beforeWriteEntityToNBTHookTypes = new LinkedList(); - private final static List overrideWriteEntityToNBTHookTypes = new LinkedList(); - private final static List afterWriteEntityToNBTHookTypes = new LinkedList(); - - private ClientPlayerBase[] beforeWriteEntityToNBTHooks; - private ClientPlayerBase[] overrideWriteEntityToNBTHooks; - private ClientPlayerBase[] afterWriteEntityToNBTHooks; - - public boolean isWriteEntityToNBTModded; - - private static final Map allBaseBeforeWriteEntityToNBTSuperiors = new Hashtable(0); - private static final Map allBaseBeforeWriteEntityToNBTInferiors = new Hashtable(0); - private static final Map allBaseOverrideWriteEntityToNBTSuperiors = new Hashtable(0); - private static final Map allBaseOverrideWriteEntityToNBTInferiors = new Hashtable(0); - private static final Map allBaseAfterWriteEntityToNBTSuperiors = new Hashtable(0); - private static final Map allBaseAfterWriteEntityToNBTInferiors = new Hashtable(0); - - - protected final IClientPlayerAPI player; - - private final static Set keys = new HashSet(); - private final static Map keysToVirtualIds = new HashMap(); - private final static Set> dynamicTypes = new HashSet>(); - - private final static Map, Map> virtualDynamicHookMethods = new HashMap, Map>(); - - private final static Map, Map> beforeDynamicHookMethods = new HashMap, Map>(); - private final static Map, Map> overrideDynamicHookMethods = new HashMap, Map>(); - private final static Map, Map> afterDynamicHookMethods = new HashMap, Map>(); - - private final static List beforeLocalConstructingHookTypes = new LinkedList(); - private final static List afterLocalConstructingHookTypes = new LinkedList(); - - private static final Map> beforeDynamicHookTypes = new Hashtable>(0); - private static final Map> overrideDynamicHookTypes = new Hashtable>(0); - private static final Map> afterDynamicHookTypes = new Hashtable>(0); - - private ClientPlayerBase[] beforeLocalConstructingHooks; - private ClientPlayerBase[] afterLocalConstructingHooks; - - private final Map baseObjectsToId = new Hashtable(); - private final Map allBaseObjects = new Hashtable(); - private final Set unmodifiableAllBaseIds = Collections.unmodifiableSet(allBaseObjects.keySet()); - - private static final Map> allBaseConstructors = new Hashtable>(); - private static final Set unmodifiableAllIds = Collections.unmodifiableSet(allBaseConstructors.keySet()); - - private static final Map allBaseBeforeLocalConstructingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeLocalConstructingInferiors = new Hashtable(0); - private static final Map allBaseAfterLocalConstructingSuperiors = new Hashtable(0); - private static final Map allBaseAfterLocalConstructingInferiors = new Hashtable(0); - - private static final Map> allBaseBeforeDynamicSuperiors = new Hashtable>(0); - private static final Map> allBaseBeforeDynamicInferiors = new Hashtable>(0); - private static final Map> allBaseOverrideDynamicSuperiors = new Hashtable>(0); - private static final Map> allBaseOverrideDynamicInferiors = new Hashtable>(0); - private static final Map> allBaseAfterDynamicSuperiors = new Hashtable>(0); - private static final Map> allBaseAfterDynamicInferiors = new Hashtable>(0); - - private static boolean initialized = false; -} diff --git a/dependencies/main/java/api/player/client/ClientPlayerBase.java b/dependencies/main/java/api/player/client/ClientPlayerBase.java deleted file mode 100644 index fd224702ab..0000000000 --- a/dependencies/main/java/api/player/client/ClientPlayerBase.java +++ /dev/null @@ -1,1384 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.client; - -public abstract class ClientPlayerBase -{ - public ClientPlayerBase(ClientPlayerAPI playerAPI) - { - this.internalClientPlayerAPI = playerAPI; - this.playerAPI = playerAPI.player; - this.player = playerAPI.player.getEntityPlayerSP(); - } - - public void beforeBaseAttach(boolean onTheFly) - { - } - - public void afterBaseAttach(boolean onTheFly) - { - } - - public void beforeLocalConstructing(net.minecraft.client.Minecraft paramMinecraft, net.minecraft.world.World paramWorld, net.minecraft.client.network.NetHandlerPlayClient paramNetHandlerPlayClient, net.minecraft.stats.StatisticsManager paramStatisticsManager) - { - } - - public void afterLocalConstructing(net.minecraft.client.Minecraft paramMinecraft, net.minecraft.world.World paramWorld, net.minecraft.client.network.NetHandlerPlayClient paramNetHandlerPlayClient, net.minecraft.stats.StatisticsManager paramStatisticsManager) - { - } - - public void beforeBaseDetach(boolean onTheFly) - { - } - - public void afterBaseDetach(boolean onTheFly) - { - } - - public Object dynamic(String key, Object[] parameters) - { - return internalClientPlayerAPI.dynamicOverwritten(key, parameters, this); - } - - public final int hashCode() - { - return super.hashCode(); - } - - public void beforeAddExhaustion(float paramFloat) - { - } - - public void addExhaustion(float paramFloat) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenAddExhaustion(this); - - if(overwritten == null) - playerAPI.localAddExhaustion(paramFloat); - else if(overwritten != this) - overwritten.addExhaustion(paramFloat); - - } - - public void afterAddExhaustion(float paramFloat) - { - } - - public void beforeAddMovementStat(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public void addMovementStat(double paramDouble1, double paramDouble2, double paramDouble3) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenAddMovementStat(this); - - if(overwritten == null) - playerAPI.localAddMovementStat(paramDouble1, paramDouble2, paramDouble3); - else if(overwritten != this) - overwritten.addMovementStat(paramDouble1, paramDouble2, paramDouble3); - - } - - public void afterAddMovementStat(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public void beforeAddStat(net.minecraft.stats.StatBase paramStatBase, int paramInt) - { - } - - public void addStat(net.minecraft.stats.StatBase paramStatBase, int paramInt) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenAddStat(this); - - if(overwritten == null) - playerAPI.localAddStat(paramStatBase, paramInt); - else if(overwritten != this) - overwritten.addStat(paramStatBase, paramInt); - - } - - public void afterAddStat(net.minecraft.stats.StatBase paramStatBase, int paramInt) - { - } - - public void beforeAttackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - } - - public boolean attackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenAttackEntityFrom(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localAttackEntityFrom(paramDamageSource, paramFloat); - else if(overwritten != this) - _result = overwritten.attackEntityFrom(paramDamageSource, paramFloat); - else - _result = false; - - return _result; - } - - public void afterAttackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - } - - public void beforeAttackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity) - { - } - - public void attackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenAttackTargetEntityWithCurrentItem(this); - - if(overwritten == null) - playerAPI.localAttackTargetEntityWithCurrentItem(paramEntity); - else if(overwritten != this) - overwritten.attackTargetEntityWithCurrentItem(paramEntity); - - } - - public void afterAttackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity) - { - } - - public void beforeCanBreatheUnderwater() - { - } - - public boolean canBreatheUnderwater() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenCanBreatheUnderwater(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localCanBreatheUnderwater(); - else if(overwritten != this) - _result = overwritten.canBreatheUnderwater(); - else - _result = false; - - return _result; - } - - public void afterCanBreatheUnderwater() - { - } - - public void beforeCanHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState) - { - } - - public boolean canHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenCanHarvestBlock(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localCanHarvestBlock(paramIBlockState); - else if(overwritten != this) - _result = overwritten.canHarvestBlock(paramIBlockState); - else - _result = false; - - return _result; - } - - public void afterCanHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState) - { - } - - public void beforeCanPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack) - { - } - - public boolean canPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenCanPlayerEdit(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localCanPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - else if(overwritten != this) - _result = overwritten.canPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - else - _result = false; - - return _result; - } - - public void afterCanPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack) - { - } - - public void beforeCanTriggerWalking() - { - } - - public boolean canTriggerWalking() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenCanTriggerWalking(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localCanTriggerWalking(); - else if(overwritten != this) - _result = overwritten.canTriggerWalking(); - else - _result = false; - - return _result; - } - - public void afterCanTriggerWalking() - { - } - - public void beforeCloseScreen() - { - } - - public void closeScreen() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenCloseScreen(this); - - if(overwritten == null) - playerAPI.localCloseScreen(); - else if(overwritten != this) - overwritten.closeScreen(); - - } - - public void afterCloseScreen() - { - } - - public void beforeDamageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - } - - public void damageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenDamageEntity(this); - - if(overwritten == null) - playerAPI.localDamageEntity(paramDamageSource, paramFloat); - else if(overwritten != this) - overwritten.damageEntity(paramDamageSource, paramFloat); - - } - - public void afterDamageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - } - - public void beforeDisplayGui(net.minecraft.world.IInteractionObject paramIInteractionObject) - { - } - - public void displayGui(net.minecraft.world.IInteractionObject paramIInteractionObject) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenDisplayGui(this); - - if(overwritten == null) - playerAPI.localDisplayGui(paramIInteractionObject); - else if(overwritten != this) - overwritten.displayGui(paramIInteractionObject); - - } - - public void afterDisplayGui(net.minecraft.world.IInteractionObject paramIInteractionObject) - { - } - - public void beforeDisplayGUIChest(net.minecraft.inventory.IInventory paramIInventory) - { - } - - public void displayGUIChest(net.minecraft.inventory.IInventory paramIInventory) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenDisplayGUIChest(this); - - if(overwritten == null) - playerAPI.localDisplayGUIChest(paramIInventory); - else if(overwritten != this) - overwritten.displayGUIChest(paramIInventory); - - } - - public void afterDisplayGUIChest(net.minecraft.inventory.IInventory paramIInventory) - { - } - - public void beforeDropItem(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean1, boolean paramBoolean2) - { - } - - public net.minecraft.entity.item.EntityItem dropItem(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean1, boolean paramBoolean2) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenDropItem(this); - - net.minecraft.entity.item.EntityItem _result; - if(overwritten == null) - _result = playerAPI.localDropItem(paramItemStack, paramBoolean1, paramBoolean2); - else if(overwritten != this) - _result = overwritten.dropItem(paramItemStack, paramBoolean1, paramBoolean2); - else - _result = null; - - return _result; - } - - public void afterDropItem(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean1, boolean paramBoolean2) - { - } - - public void beforeDropOneItem(boolean paramBoolean) - { - } - - public net.minecraft.entity.item.EntityItem dropOneItem(boolean paramBoolean) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenDropOneItem(this); - - net.minecraft.entity.item.EntityItem _result; - if(overwritten == null) - _result = playerAPI.localDropOneItem(paramBoolean); - else if(overwritten != this) - _result = overwritten.dropOneItem(paramBoolean); - else - _result = null; - - return _result; - } - - public void afterDropOneItem(boolean paramBoolean) - { - } - - public void beforeDropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean) - { - } - - public net.minecraft.entity.item.EntityItem dropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenDropPlayerItemWithRandomChoice(this); - - net.minecraft.entity.item.EntityItem _result; - if(overwritten == null) - _result = playerAPI.localDropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - else if(overwritten != this) - _result = overwritten.dropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - else - _result = null; - - return _result; - } - - public void afterDropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean) - { - } - - public void beforeFall(float paramFloat1, float paramFloat2) - { - } - - public void fall(float paramFloat1, float paramFloat2) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenFall(this); - - if(overwritten == null) - playerAPI.localFall(paramFloat1, paramFloat2); - else if(overwritten != this) - overwritten.fall(paramFloat1, paramFloat2); - - } - - public void afterFall(float paramFloat1, float paramFloat2) - { - } - - public void beforeGetAIMoveSpeed() - { - } - - public float getAIMoveSpeed() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenGetAIMoveSpeed(this); - - float _result; - if(overwritten == null) - _result = playerAPI.localGetAIMoveSpeed(); - else if(overwritten != this) - _result = overwritten.getAIMoveSpeed(); - else - _result = 0; - - return _result; - } - - public void afterGetAIMoveSpeed() - { - } - - public void beforeGetBedOrientationInDegrees() - { - } - - public float getBedOrientationInDegrees() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenGetBedOrientationInDegrees(this); - - float _result; - if(overwritten == null) - _result = playerAPI.localGetBedOrientationInDegrees(); - else if(overwritten != this) - _result = overwritten.getBedOrientationInDegrees(); - else - _result = 0; - - return _result; - } - - public void afterGetBedOrientationInDegrees() - { - } - - public void beforeGetBrightness(float paramFloat) - { - } - - public float getBrightness(float paramFloat) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenGetBrightness(this); - - float _result; - if(overwritten == null) - _result = playerAPI.localGetBrightness(paramFloat); - else if(overwritten != this) - _result = overwritten.getBrightness(paramFloat); - else - _result = 0; - - return _result; - } - - public void afterGetBrightness(float paramFloat) - { - } - - public void beforeGetBrightnessForRender(float paramFloat) - { - } - - public int getBrightnessForRender(float paramFloat) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenGetBrightnessForRender(this); - - int _result; - if(overwritten == null) - _result = playerAPI.localGetBrightnessForRender(paramFloat); - else if(overwritten != this) - _result = overwritten.getBrightnessForRender(paramFloat); - else - _result = 0; - - return _result; - } - - public void afterGetBrightnessForRender(float paramFloat) - { - } - - public void beforeGetBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos) - { - } - - public float getBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenGetBreakSpeed(this); - - float _result; - if(overwritten == null) - _result = playerAPI.localGetBreakSpeed(paramIBlockState, paramBlockPos); - else if(overwritten != this) - _result = overwritten.getBreakSpeed(paramIBlockState, paramBlockPos); - else - _result = 0; - - return _result; - } - - public void afterGetBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos) - { - } - - public void beforeGetDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public double getDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenGetDistanceSq(this); - - double _result; - if(overwritten == null) - _result = playerAPI.localGetDistanceSq(paramDouble1, paramDouble2, paramDouble3); - else if(overwritten != this) - _result = overwritten.getDistanceSq(paramDouble1, paramDouble2, paramDouble3); - else - _result = 0; - - return _result; - } - - public void afterGetDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public void beforeGetDistanceSqToEntity(net.minecraft.entity.Entity paramEntity) - { - } - - public double getDistanceSqToEntity(net.minecraft.entity.Entity paramEntity) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenGetDistanceSqToEntity(this); - - double _result; - if(overwritten == null) - _result = playerAPI.localGetDistanceSqToEntity(paramEntity); - else if(overwritten != this) - _result = overwritten.getDistanceSqToEntity(paramEntity); - else - _result = 0; - - return _result; - } - - public void afterGetDistanceSqToEntity(net.minecraft.entity.Entity paramEntity) - { - } - - public void beforeGetFovModifier() - { - } - - public float getFovModifier() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenGetFovModifier(this); - - float _result; - if(overwritten == null) - _result = playerAPI.localGetFovModifier(); - else if(overwritten != this) - _result = overwritten.getFovModifier(); - else - _result = 0; - - return _result; - } - - public void afterGetFovModifier() - { - } - - public void beforeGetHurtSound() - { - } - - public net.minecraft.util.SoundEvent getHurtSound() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenGetHurtSound(this); - - net.minecraft.util.SoundEvent _result; - if(overwritten == null) - _result = playerAPI.localGetHurtSound(); - else if(overwritten != this) - _result = overwritten.getHurtSound(); - else - _result = null; - - return _result; - } - - public void afterGetHurtSound() - { - } - - public void beforeGetName() - { - } - - public java.lang.String getName() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenGetName(this); - - java.lang.String _result; - if(overwritten == null) - _result = playerAPI.localGetName(); - else if(overwritten != this) - _result = overwritten.getName(); - else - _result = null; - - return _result; - } - - public void afterGetName() - { - } - - public void beforeGetSleepTimer() - { - } - - public int getSleepTimer() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenGetSleepTimer(this); - - int _result; - if(overwritten == null) - _result = playerAPI.localGetSleepTimer(); - else if(overwritten != this) - _result = overwritten.getSleepTimer(); - else - _result = 0; - - return _result; - } - - public void afterGetSleepTimer() - { - } - - public void beforeHandleWaterMovement() - { - } - - public boolean handleWaterMovement() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenHandleWaterMovement(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localHandleWaterMovement(); - else if(overwritten != this) - _result = overwritten.handleWaterMovement(); - else - _result = false; - - return _result; - } - - public void afterHandleWaterMovement() - { - } - - public void beforeHeal(float paramFloat) - { - } - - public void heal(float paramFloat) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenHeal(this); - - if(overwritten == null) - playerAPI.localHeal(paramFloat); - else if(overwritten != this) - overwritten.heal(paramFloat); - - } - - public void afterHeal(float paramFloat) - { - } - - public void beforeIsEntityInsideOpaqueBlock() - { - } - - public boolean isEntityInsideOpaqueBlock() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenIsEntityInsideOpaqueBlock(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localIsEntityInsideOpaqueBlock(); - else if(overwritten != this) - _result = overwritten.isEntityInsideOpaqueBlock(); - else - _result = false; - - return _result; - } - - public void afterIsEntityInsideOpaqueBlock() - { - } - - public void beforeIsInWater() - { - } - - public boolean isInWater() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenIsInWater(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localIsInWater(); - else if(overwritten != this) - _result = overwritten.isInWater(); - else - _result = false; - - return _result; - } - - public void afterIsInWater() - { - } - - public void beforeIsInsideOfMaterial(net.minecraft.block.material.Material paramMaterial) - { - } - - public boolean isInsideOfMaterial(net.minecraft.block.material.Material paramMaterial) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenIsInsideOfMaterial(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localIsInsideOfMaterial(paramMaterial); - else if(overwritten != this) - _result = overwritten.isInsideOfMaterial(paramMaterial); - else - _result = false; - - return _result; - } - - public void afterIsInsideOfMaterial(net.minecraft.block.material.Material paramMaterial) - { - } - - public void beforeIsOnLadder() - { - } - - public boolean isOnLadder() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenIsOnLadder(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localIsOnLadder(); - else if(overwritten != this) - _result = overwritten.isOnLadder(); - else - _result = false; - - return _result; - } - - public void afterIsOnLadder() - { - } - - public void beforeIsPlayerSleeping() - { - } - - public boolean isPlayerSleeping() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenIsPlayerSleeping(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localIsPlayerSleeping(); - else if(overwritten != this) - _result = overwritten.isPlayerSleeping(); - else - _result = false; - - return _result; - } - - public void afterIsPlayerSleeping() - { - } - - public void beforeIsSneaking() - { - } - - public boolean isSneaking() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenIsSneaking(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localIsSneaking(); - else if(overwritten != this) - _result = overwritten.isSneaking(); - else - _result = false; - - return _result; - } - - public void afterIsSneaking() - { - } - - public void beforeIsSprinting() - { - } - - public boolean isSprinting() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenIsSprinting(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localIsSprinting(); - else if(overwritten != this) - _result = overwritten.isSprinting(); - else - _result = false; - - return _result; - } - - public void afterIsSprinting() - { - } - - public void beforeJump() - { - } - - public void jump() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenJump(this); - - if(overwritten == null) - playerAPI.localJump(); - else if(overwritten != this) - overwritten.jump(); - - } - - public void afterJump() - { - } - - public void beforeKnockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2) - { - } - - public void knockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenKnockBack(this); - - if(overwritten == null) - playerAPI.localKnockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - else if(overwritten != this) - overwritten.knockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - - } - - public void afterKnockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2) - { - } - - public void beforeMoveEntity(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public void moveEntity(double paramDouble1, double paramDouble2, double paramDouble3) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenMoveEntity(this); - - if(overwritten == null) - playerAPI.localMoveEntity(paramDouble1, paramDouble2, paramDouble3); - else if(overwritten != this) - overwritten.moveEntity(paramDouble1, paramDouble2, paramDouble3); - - } - - public void afterMoveEntity(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public void beforeMoveEntityWithHeading(float paramFloat1, float paramFloat2) - { - } - - public void moveEntityWithHeading(float paramFloat1, float paramFloat2) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenMoveEntityWithHeading(this); - - if(overwritten == null) - playerAPI.localMoveEntityWithHeading(paramFloat1, paramFloat2); - else if(overwritten != this) - overwritten.moveEntityWithHeading(paramFloat1, paramFloat2); - - } - - public void afterMoveEntityWithHeading(float paramFloat1, float paramFloat2) - { - } - - public void beforeMoveFlying(float paramFloat1, float paramFloat2, float paramFloat3) - { - } - - public void moveFlying(float paramFloat1, float paramFloat2, float paramFloat3) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenMoveFlying(this); - - if(overwritten == null) - playerAPI.localMoveFlying(paramFloat1, paramFloat2, paramFloat3); - else if(overwritten != this) - overwritten.moveFlying(paramFloat1, paramFloat2, paramFloat3); - - } - - public void afterMoveFlying(float paramFloat1, float paramFloat2, float paramFloat3) - { - } - - public void beforeOnDeath(net.minecraft.util.DamageSource paramDamageSource) - { - } - - public void onDeath(net.minecraft.util.DamageSource paramDamageSource) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenOnDeath(this); - - if(overwritten == null) - playerAPI.localOnDeath(paramDamageSource); - else if(overwritten != this) - overwritten.onDeath(paramDamageSource); - - } - - public void afterOnDeath(net.minecraft.util.DamageSource paramDamageSource) - { - } - - public void beforeOnLivingUpdate() - { - } - - public void onLivingUpdate() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenOnLivingUpdate(this); - - if(overwritten == null) - playerAPI.localOnLivingUpdate(); - else if(overwritten != this) - overwritten.onLivingUpdate(); - - } - - public void afterOnLivingUpdate() - { - } - - public void beforeOnKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase) - { - } - - public void onKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenOnKillEntity(this); - - if(overwritten == null) - playerAPI.localOnKillEntity(paramEntityLivingBase); - else if(overwritten != this) - overwritten.onKillEntity(paramEntityLivingBase); - - } - - public void afterOnKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase) - { - } - - public void beforeOnStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt) - { - } - - public void onStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenOnStruckByLightning(this); - - if(overwritten == null) - playerAPI.localOnStruckByLightning(paramEntityLightningBolt); - else if(overwritten != this) - overwritten.onStruckByLightning(paramEntityLightningBolt); - - } - - public void afterOnStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt) - { - } - - public void beforeOnUpdate() - { - } - - public void onUpdate() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenOnUpdate(this); - - if(overwritten == null) - playerAPI.localOnUpdate(); - else if(overwritten != this) - overwritten.onUpdate(); - - } - - public void afterOnUpdate() - { - } - - public void beforePlayStepSound(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.block.Block paramBlock) - { - } - - public void playStepSound(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.block.Block paramBlock) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenPlayStepSound(this); - - if(overwritten == null) - playerAPI.localPlayStepSound(paramBlockPos, paramBlock); - else if(overwritten != this) - overwritten.playStepSound(paramBlockPos, paramBlock); - - } - - public void afterPlayStepSound(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.block.Block paramBlock) - { - } - - public void beforePushOutOfBlocks(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public boolean pushOutOfBlocks(double paramDouble1, double paramDouble2, double paramDouble3) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenPushOutOfBlocks(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localPushOutOfBlocks(paramDouble1, paramDouble2, paramDouble3); - else if(overwritten != this) - _result = overwritten.pushOutOfBlocks(paramDouble1, paramDouble2, paramDouble3); - else - _result = false; - - return _result; - } - - public void afterPushOutOfBlocks(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public void beforeRayTrace(double paramDouble, float paramFloat) - { - } - - public net.minecraft.util.math.RayTraceResult rayTrace(double paramDouble, float paramFloat) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenRayTrace(this); - - net.minecraft.util.math.RayTraceResult _result; - if(overwritten == null) - _result = playerAPI.localRayTrace(paramDouble, paramFloat); - else if(overwritten != this) - _result = overwritten.rayTrace(paramDouble, paramFloat); - else - _result = null; - - return _result; - } - - public void afterRayTrace(double paramDouble, float paramFloat) - { - } - - public void beforeReadEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - } - - public void readEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenReadEntityFromNBT(this); - - if(overwritten == null) - playerAPI.localReadEntityFromNBT(paramNBTTagCompound); - else if(overwritten != this) - overwritten.readEntityFromNBT(paramNBTTagCompound); - - } - - public void afterReadEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - } - - public void beforeRespawnPlayer() - { - } - - public void respawnPlayer() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenRespawnPlayer(this); - - if(overwritten == null) - playerAPI.localRespawnPlayer(); - else if(overwritten != this) - overwritten.respawnPlayer(); - - } - - public void afterRespawnPlayer() - { - } - - public void beforeSetDead() - { - } - - public void setDead() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenSetDead(this); - - if(overwritten == null) - playerAPI.localSetDead(); - else if(overwritten != this) - overwritten.setDead(); - - } - - public void afterSetDead() - { - } - - public void beforeSetPlayerSPHealth(float paramFloat) - { - } - - public void setPlayerSPHealth(float paramFloat) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenSetPlayerSPHealth(this); - - if(overwritten == null) - playerAPI.localSetPlayerSPHealth(paramFloat); - else if(overwritten != this) - overwritten.setPlayerSPHealth(paramFloat); - - } - - public void afterSetPlayerSPHealth(float paramFloat) - { - } - - public void beforeSetPositionAndRotation(double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2) - { - } - - public void setPositionAndRotation(double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenSetPositionAndRotation(this); - - if(overwritten == null) - playerAPI.localSetPositionAndRotation(paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2); - else if(overwritten != this) - overwritten.setPositionAndRotation(paramDouble1, paramDouble2, paramDouble3, paramFloat1, paramFloat2); - - } - - public void afterSetPositionAndRotation(double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2) - { - } - - public void beforeSetSneaking(boolean paramBoolean) - { - } - - public void setSneaking(boolean paramBoolean) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenSetSneaking(this); - - if(overwritten == null) - playerAPI.localSetSneaking(paramBoolean); - else if(overwritten != this) - overwritten.setSneaking(paramBoolean); - - } - - public void afterSetSneaking(boolean paramBoolean) - { - } - - public void beforeSetSprinting(boolean paramBoolean) - { - } - - public void setSprinting(boolean paramBoolean) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenSetSprinting(this); - - if(overwritten == null) - playerAPI.localSetSprinting(paramBoolean); - else if(overwritten != this) - overwritten.setSprinting(paramBoolean); - - } - - public void afterSetSprinting(boolean paramBoolean) - { - } - - public void beforeTrySleep(net.minecraft.util.math.BlockPos paramBlockPos) - { - } - - public net.minecraft.entity.player.EntityPlayer.SleepResult trySleep(net.minecraft.util.math.BlockPos paramBlockPos) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenTrySleep(this); - - net.minecraft.entity.player.EntityPlayer.SleepResult _result; - if(overwritten == null) - _result = playerAPI.localTrySleep(paramBlockPos); - else if(overwritten != this) - _result = overwritten.trySleep(paramBlockPos); - else - _result = null; - - return _result; - } - - public void afterTrySleep(net.minecraft.util.math.BlockPos paramBlockPos) - { - } - - public void beforeSwingItem(net.minecraft.util.EnumHand paramEnumHand) - { - } - - public void swingItem(net.minecraft.util.EnumHand paramEnumHand) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenSwingItem(this); - - if(overwritten == null) - playerAPI.localSwingItem(paramEnumHand); - else if(overwritten != this) - overwritten.swingItem(paramEnumHand); - - } - - public void afterSwingItem(net.minecraft.util.EnumHand paramEnumHand) - { - } - - public void beforeUpdateEntityActionState() - { - } - - public void updateEntityActionState() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenUpdateEntityActionState(this); - - if(overwritten == null) - playerAPI.localUpdateEntityActionState(); - else if(overwritten != this) - overwritten.updateEntityActionState(); - - } - - public void afterUpdateEntityActionState() - { - } - - public void beforeUpdateRidden() - { - } - - public void updateRidden() - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenUpdateRidden(this); - - if(overwritten == null) - playerAPI.localUpdateRidden(); - else if(overwritten != this) - overwritten.updateRidden(); - - } - - public void afterUpdateRidden() - { - } - - public void beforeWakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) - { - } - - public void wakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenWakeUpPlayer(this); - - if(overwritten == null) - playerAPI.localWakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - else if(overwritten != this) - overwritten.wakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - - } - - public void afterWakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) - { - } - - public void beforeWriteEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - } - - public void writeEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - ClientPlayerBase overwritten = internalClientPlayerAPI.GetOverwrittenWriteEntityToNBT(this); - - if(overwritten == null) - playerAPI.localWriteEntityToNBT(paramNBTTagCompound); - else if(overwritten != this) - overwritten.writeEntityToNBT(paramNBTTagCompound); - - } - - public void afterWriteEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - } - - protected final net.minecraft.client.entity.EntityPlayerSP player; - protected final IClientPlayer playerAPI; - private final ClientPlayerAPI internalClientPlayerAPI; -} diff --git a/dependencies/main/java/api/player/client/ClientPlayerBaseSorter.java b/dependencies/main/java/api/player/client/ClientPlayerBaseSorter.java deleted file mode 100644 index 68bc9ada07..0000000000 --- a/dependencies/main/java/api/player/client/ClientPlayerBaseSorter.java +++ /dev/null @@ -1,259 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.client; - -import java.util.*; - -public final class ClientPlayerBaseSorter -{ - public ClientPlayerBaseSorter(List list, Map allBaseSuperiors, Map allBaseInferiors, String methodName) - { - this.list = list; - this.allBaseSuperiors = allBaseSuperiors; - this.allBaseInferiors = allBaseInferiors; - this.methodName = methodName; - } - - public void Sort() - { - if(list.size() <= 1) - return; - - if(explicitInferiors != null) - explicitInferiors.clear(); - - if(explicitSuperiors != null) - explicitSuperiors.clear(); - - if(directInferiorsMap != null) - directInferiorsMap.clear(); - - if(allInferiors != null) - allInferiors.clear(); - - for(int i = 0; i < list.size(); i++) - { - String baseId = list.get(i); - - String[] inferiorNames = allBaseInferiors.get(baseId); - boolean hasInferiors = inferiorNames != null && inferiorNames.length > 0; - - String[] superiorNames = allBaseSuperiors.get(baseId); - boolean hasSuperiors = superiorNames != null && superiorNames.length > 0; - - if((hasInferiors || hasSuperiors) && directInferiorsMap == null) - directInferiorsMap = new Hashtable>(); - - if(hasInferiors) - explicitInferiors = build(baseId, explicitInferiors, directInferiorsMap, null, inferiorNames); - - if(hasSuperiors) - explicitSuperiors = build(baseId, explicitSuperiors, null, directInferiorsMap, superiorNames); - } - if(directInferiorsMap != null) - { - for(int i = 0; i < list.size() - 1; i++) - for(int n = i + 1; n < list.size(); n++) - { - String left = list.get(i); - String right = list.get(n); - - Set leftInferiors = null, rightInferiors = null; - if(explicitInferiors != null) - { - leftInferiors = explicitInferiors.get(left); - rightInferiors = explicitInferiors.get(right); - } - - Set leftSuperiors = null, rightSuperiors = null; - if(explicitSuperiors != null) - { - leftSuperiors = explicitSuperiors.get(left); - rightSuperiors = explicitSuperiors.get(right); - } - - boolean leftWantsToBeInferiorToRight = leftSuperiors != null && leftSuperiors.contains(right); - boolean leftWantsToBeSuperiorToRight = leftInferiors != null && leftInferiors.contains(right); - - boolean rightWantsToBeInferiorToLeft = rightSuperiors != null && rightSuperiors.contains(left); - boolean rightWantsToBeSuperiorToLeft = rightInferiors != null && rightInferiors.contains(left); - - if(leftWantsToBeInferiorToRight && rightWantsToBeInferiorToLeft) - throw new UnsupportedOperationException("Can not sort ClientPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be inferior to '" + right + "' and '" + right + "' wants to be inferior to '" + left + "'"); - if(leftWantsToBeSuperiorToRight && rightWantsToBeSuperiorToLeft) - throw new UnsupportedOperationException("Can not sort ClientPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be superior to '" + right + "' and '" + right + "' wants to be superior to '" + left + "'"); - - if(leftWantsToBeInferiorToRight && leftWantsToBeSuperiorToRight) - throw new UnsupportedOperationException("Can not sort ClientPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be superior and inferior to '" + right + "'"); - if(rightWantsToBeInferiorToLeft && rightWantsToBeSuperiorToLeft) - throw new UnsupportedOperationException("Can not sort ClientPlayerBase classes for method '" + methodName + "'. '" + right + "' wants to be superior and inferior to '" + left + "'"); - } - - if(allInferiors == null) - allInferiors = new Hashtable>(); - - for(int i = 0; i < list.size(); i++) - build(list.get(i), null); - } - - if (withoutSuperiors == null) - withoutSuperiors = new LinkedList(); - - int offset = 0; - int size = list.size(); - - while(size > 1) - { - withoutSuperiors.clear(); - for(int i = offset; i < offset + size; i++) - withoutSuperiors.add(list.get(i)); - - if(allInferiors != null) - for(int i = offset; i < offset + size; i++) - { - Set inferiors = allInferiors.get(list.get(i)); - if (inferiors != null) - withoutSuperiors.removeAll(inferiors); - } - - boolean initial = true; - for(int i = offset; i < offset + size; i++) - { - String key = list.get(i); - if(withoutSuperiors.contains(key)) - { - if(initial) - { - Set inferiors = null; - if(allInferiors != null) - inferiors = allInferiors.get(key); - if(inferiors == null || inferiors.isEmpty()) - { - withoutSuperiors.remove(key); - size--; - offset++; - continue; - } - } - list.remove(i--); - size--; - } - initial = false; - } - list.addAll(offset + size, withoutSuperiors); - } - } - - private Set build(String type, String startType) - { - Set inferiors = allInferiors.get(type); - if(inferiors == null) - { - inferiors = build(type, null, startType != null ? startType : type); - if(inferiors == null) - inferiors = Empty; - allInferiors.put(type, inferiors); - } - return inferiors; - } - - private Set build(String type, Set inferiors, String startType) - { - Set directInferiors = directInferiorsMap.get(type); - if(directInferiors == null) - return inferiors; - - if(inferiors == null) - inferiors = new HashSet(); - - Iterator iter = directInferiors.iterator(); - while(iter.hasNext()) - { - String inferiorType = iter.next(); - if(inferiorType == startType) - throw new UnsupportedOperationException("Can not sort ClientPlayerBase classes for method '" + methodName + "'. Circular superiosity found including '" + startType + "'"); - if(list.contains(inferiorType)) - inferiors.add(inferiorType); - - Set inferiorSet; - try - { - inferiorSet = build(inferiorType, startType); - } - catch(UnsupportedOperationException uoe) - { - throw new UnsupportedOperationException("Can not sort ClientPlayerBase classes for method '" + methodName + "'. Circular superiosity found including '" + inferiorType + "'", uoe); - } - - if(inferiorSet != Empty) - inferiors.addAll(inferiorSet); - } - return inferiors; - } - - private static Map> build(String baseId, Map> map, Map> directMap, Map> otherDirectMap, String[] names) - { - if(map == null) - map = new Hashtable>(); - - Set types = new HashSet(); - for(int n = 0; n < names.length; n++) - { - if(names[n] != null) - types.add(names[n]); - } - - if(directMap != null) - getOrCreateSet(directMap, baseId).addAll(types); - - if(otherDirectMap != null) - { - Iterator iter = types.iterator(); - while(iter.hasNext()) - getOrCreateSet(otherDirectMap, iter.next()).add(baseId); - } - - map.put(baseId, types); - return map; - } - - private static Set getOrCreateSet(Map> map, String key) - { - Set value = map.get(key); - if(value != null) - return value; - - value = new HashSet(); - map.put(key, value); - return value; - } - - private Map> explicitInferiors; - private Map> explicitSuperiors; - private Map> directInferiorsMap; - private Map> allInferiors; - private List withoutSuperiors; - - private final List list; - private final Map allBaseSuperiors; - private final Map allBaseInferiors; - private final String methodName; - - private static final Set Empty = new HashSet(); -} diff --git a/dependencies/main/java/api/player/client/ClientPlayerBaseSorting.java b/dependencies/main/java/api/player/client/ClientPlayerBaseSorting.java deleted file mode 100644 index 49ffcbbced..0000000000 --- a/dependencies/main/java/api/player/client/ClientPlayerBaseSorting.java +++ /dev/null @@ -1,4378 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.client; - -import java.util.*; - -public final class ClientPlayerBaseSorting -{ - private String[] beforeLocalConstructingSuperiors = null; - private String[] beforeLocalConstructingInferiors = null; - private String[] afterLocalConstructingSuperiors = null; - private String[] afterLocalConstructingInferiors = null; - - private Map dynamicBeforeSuperiors = null; - private Map dynamicBeforeInferiors = null; - private Map dynamicOverrideSuperiors = null; - private Map dynamicOverrideInferiors = null; - private Map dynamicAfterSuperiors = null; - private Map dynamicAfterInferiors = null; - - private String[] beforeAddExhaustionSuperiors = null; - private String[] beforeAddExhaustionInferiors = null; - private String[] overrideAddExhaustionSuperiors = null; - private String[] overrideAddExhaustionInferiors = null; - private String[] afterAddExhaustionSuperiors = null; - private String[] afterAddExhaustionInferiors = null; - - private String[] beforeAddMovementStatSuperiors = null; - private String[] beforeAddMovementStatInferiors = null; - private String[] overrideAddMovementStatSuperiors = null; - private String[] overrideAddMovementStatInferiors = null; - private String[] afterAddMovementStatSuperiors = null; - private String[] afterAddMovementStatInferiors = null; - - private String[] beforeAddStatSuperiors = null; - private String[] beforeAddStatInferiors = null; - private String[] overrideAddStatSuperiors = null; - private String[] overrideAddStatInferiors = null; - private String[] afterAddStatSuperiors = null; - private String[] afterAddStatInferiors = null; - - private String[] beforeAttackEntityFromSuperiors = null; - private String[] beforeAttackEntityFromInferiors = null; - private String[] overrideAttackEntityFromSuperiors = null; - private String[] overrideAttackEntityFromInferiors = null; - private String[] afterAttackEntityFromSuperiors = null; - private String[] afterAttackEntityFromInferiors = null; - - private String[] beforeAttackTargetEntityWithCurrentItemSuperiors = null; - private String[] beforeAttackTargetEntityWithCurrentItemInferiors = null; - private String[] overrideAttackTargetEntityWithCurrentItemSuperiors = null; - private String[] overrideAttackTargetEntityWithCurrentItemInferiors = null; - private String[] afterAttackTargetEntityWithCurrentItemSuperiors = null; - private String[] afterAttackTargetEntityWithCurrentItemInferiors = null; - - private String[] beforeCanBreatheUnderwaterSuperiors = null; - private String[] beforeCanBreatheUnderwaterInferiors = null; - private String[] overrideCanBreatheUnderwaterSuperiors = null; - private String[] overrideCanBreatheUnderwaterInferiors = null; - private String[] afterCanBreatheUnderwaterSuperiors = null; - private String[] afterCanBreatheUnderwaterInferiors = null; - - private String[] beforeCanHarvestBlockSuperiors = null; - private String[] beforeCanHarvestBlockInferiors = null; - private String[] overrideCanHarvestBlockSuperiors = null; - private String[] overrideCanHarvestBlockInferiors = null; - private String[] afterCanHarvestBlockSuperiors = null; - private String[] afterCanHarvestBlockInferiors = null; - - private String[] beforeCanPlayerEditSuperiors = null; - private String[] beforeCanPlayerEditInferiors = null; - private String[] overrideCanPlayerEditSuperiors = null; - private String[] overrideCanPlayerEditInferiors = null; - private String[] afterCanPlayerEditSuperiors = null; - private String[] afterCanPlayerEditInferiors = null; - - private String[] beforeCanTriggerWalkingSuperiors = null; - private String[] beforeCanTriggerWalkingInferiors = null; - private String[] overrideCanTriggerWalkingSuperiors = null; - private String[] overrideCanTriggerWalkingInferiors = null; - private String[] afterCanTriggerWalkingSuperiors = null; - private String[] afterCanTriggerWalkingInferiors = null; - - private String[] beforeCloseScreenSuperiors = null; - private String[] beforeCloseScreenInferiors = null; - private String[] overrideCloseScreenSuperiors = null; - private String[] overrideCloseScreenInferiors = null; - private String[] afterCloseScreenSuperiors = null; - private String[] afterCloseScreenInferiors = null; - - private String[] beforeDamageEntitySuperiors = null; - private String[] beforeDamageEntityInferiors = null; - private String[] overrideDamageEntitySuperiors = null; - private String[] overrideDamageEntityInferiors = null; - private String[] afterDamageEntitySuperiors = null; - private String[] afterDamageEntityInferiors = null; - - private String[] beforeDisplayGuiSuperiors = null; - private String[] beforeDisplayGuiInferiors = null; - private String[] overrideDisplayGuiSuperiors = null; - private String[] overrideDisplayGuiInferiors = null; - private String[] afterDisplayGuiSuperiors = null; - private String[] afterDisplayGuiInferiors = null; - - private String[] beforeDisplayGUIChestSuperiors = null; - private String[] beforeDisplayGUIChestInferiors = null; - private String[] overrideDisplayGUIChestSuperiors = null; - private String[] overrideDisplayGUIChestInferiors = null; - private String[] afterDisplayGUIChestSuperiors = null; - private String[] afterDisplayGUIChestInferiors = null; - - private String[] beforeDropItemSuperiors = null; - private String[] beforeDropItemInferiors = null; - private String[] overrideDropItemSuperiors = null; - private String[] overrideDropItemInferiors = null; - private String[] afterDropItemSuperiors = null; - private String[] afterDropItemInferiors = null; - - private String[] beforeDropOneItemSuperiors = null; - private String[] beforeDropOneItemInferiors = null; - private String[] overrideDropOneItemSuperiors = null; - private String[] overrideDropOneItemInferiors = null; - private String[] afterDropOneItemSuperiors = null; - private String[] afterDropOneItemInferiors = null; - - private String[] beforeDropPlayerItemWithRandomChoiceSuperiors = null; - private String[] beforeDropPlayerItemWithRandomChoiceInferiors = null; - private String[] overrideDropPlayerItemWithRandomChoiceSuperiors = null; - private String[] overrideDropPlayerItemWithRandomChoiceInferiors = null; - private String[] afterDropPlayerItemWithRandomChoiceSuperiors = null; - private String[] afterDropPlayerItemWithRandomChoiceInferiors = null; - - private String[] beforeFallSuperiors = null; - private String[] beforeFallInferiors = null; - private String[] overrideFallSuperiors = null; - private String[] overrideFallInferiors = null; - private String[] afterFallSuperiors = null; - private String[] afterFallInferiors = null; - - private String[] beforeGetAIMoveSpeedSuperiors = null; - private String[] beforeGetAIMoveSpeedInferiors = null; - private String[] overrideGetAIMoveSpeedSuperiors = null; - private String[] overrideGetAIMoveSpeedInferiors = null; - private String[] afterGetAIMoveSpeedSuperiors = null; - private String[] afterGetAIMoveSpeedInferiors = null; - - private String[] beforeGetBedOrientationInDegreesSuperiors = null; - private String[] beforeGetBedOrientationInDegreesInferiors = null; - private String[] overrideGetBedOrientationInDegreesSuperiors = null; - private String[] overrideGetBedOrientationInDegreesInferiors = null; - private String[] afterGetBedOrientationInDegreesSuperiors = null; - private String[] afterGetBedOrientationInDegreesInferiors = null; - - private String[] beforeGetBrightnessSuperiors = null; - private String[] beforeGetBrightnessInferiors = null; - private String[] overrideGetBrightnessSuperiors = null; - private String[] overrideGetBrightnessInferiors = null; - private String[] afterGetBrightnessSuperiors = null; - private String[] afterGetBrightnessInferiors = null; - - private String[] beforeGetBrightnessForRenderSuperiors = null; - private String[] beforeGetBrightnessForRenderInferiors = null; - private String[] overrideGetBrightnessForRenderSuperiors = null; - private String[] overrideGetBrightnessForRenderInferiors = null; - private String[] afterGetBrightnessForRenderSuperiors = null; - private String[] afterGetBrightnessForRenderInferiors = null; - - private String[] beforeGetBreakSpeedSuperiors = null; - private String[] beforeGetBreakSpeedInferiors = null; - private String[] overrideGetBreakSpeedSuperiors = null; - private String[] overrideGetBreakSpeedInferiors = null; - private String[] afterGetBreakSpeedSuperiors = null; - private String[] afterGetBreakSpeedInferiors = null; - - private String[] beforeGetDistanceSqSuperiors = null; - private String[] beforeGetDistanceSqInferiors = null; - private String[] overrideGetDistanceSqSuperiors = null; - private String[] overrideGetDistanceSqInferiors = null; - private String[] afterGetDistanceSqSuperiors = null; - private String[] afterGetDistanceSqInferiors = null; - - private String[] beforeGetDistanceSqToEntitySuperiors = null; - private String[] beforeGetDistanceSqToEntityInferiors = null; - private String[] overrideGetDistanceSqToEntitySuperiors = null; - private String[] overrideGetDistanceSqToEntityInferiors = null; - private String[] afterGetDistanceSqToEntitySuperiors = null; - private String[] afterGetDistanceSqToEntityInferiors = null; - - private String[] beforeGetFovModifierSuperiors = null; - private String[] beforeGetFovModifierInferiors = null; - private String[] overrideGetFovModifierSuperiors = null; - private String[] overrideGetFovModifierInferiors = null; - private String[] afterGetFovModifierSuperiors = null; - private String[] afterGetFovModifierInferiors = null; - - private String[] beforeGetHurtSoundSuperiors = null; - private String[] beforeGetHurtSoundInferiors = null; - private String[] overrideGetHurtSoundSuperiors = null; - private String[] overrideGetHurtSoundInferiors = null; - private String[] afterGetHurtSoundSuperiors = null; - private String[] afterGetHurtSoundInferiors = null; - - private String[] beforeGetNameSuperiors = null; - private String[] beforeGetNameInferiors = null; - private String[] overrideGetNameSuperiors = null; - private String[] overrideGetNameInferiors = null; - private String[] afterGetNameSuperiors = null; - private String[] afterGetNameInferiors = null; - - private String[] beforeGetSleepTimerSuperiors = null; - private String[] beforeGetSleepTimerInferiors = null; - private String[] overrideGetSleepTimerSuperiors = null; - private String[] overrideGetSleepTimerInferiors = null; - private String[] afterGetSleepTimerSuperiors = null; - private String[] afterGetSleepTimerInferiors = null; - - private String[] beforeHandleWaterMovementSuperiors = null; - private String[] beforeHandleWaterMovementInferiors = null; - private String[] overrideHandleWaterMovementSuperiors = null; - private String[] overrideHandleWaterMovementInferiors = null; - private String[] afterHandleWaterMovementSuperiors = null; - private String[] afterHandleWaterMovementInferiors = null; - - private String[] beforeHealSuperiors = null; - private String[] beforeHealInferiors = null; - private String[] overrideHealSuperiors = null; - private String[] overrideHealInferiors = null; - private String[] afterHealSuperiors = null; - private String[] afterHealInferiors = null; - - private String[] beforeIsEntityInsideOpaqueBlockSuperiors = null; - private String[] beforeIsEntityInsideOpaqueBlockInferiors = null; - private String[] overrideIsEntityInsideOpaqueBlockSuperiors = null; - private String[] overrideIsEntityInsideOpaqueBlockInferiors = null; - private String[] afterIsEntityInsideOpaqueBlockSuperiors = null; - private String[] afterIsEntityInsideOpaqueBlockInferiors = null; - - private String[] beforeIsInWaterSuperiors = null; - private String[] beforeIsInWaterInferiors = null; - private String[] overrideIsInWaterSuperiors = null; - private String[] overrideIsInWaterInferiors = null; - private String[] afterIsInWaterSuperiors = null; - private String[] afterIsInWaterInferiors = null; - - private String[] beforeIsInsideOfMaterialSuperiors = null; - private String[] beforeIsInsideOfMaterialInferiors = null; - private String[] overrideIsInsideOfMaterialSuperiors = null; - private String[] overrideIsInsideOfMaterialInferiors = null; - private String[] afterIsInsideOfMaterialSuperiors = null; - private String[] afterIsInsideOfMaterialInferiors = null; - - private String[] beforeIsOnLadderSuperiors = null; - private String[] beforeIsOnLadderInferiors = null; - private String[] overrideIsOnLadderSuperiors = null; - private String[] overrideIsOnLadderInferiors = null; - private String[] afterIsOnLadderSuperiors = null; - private String[] afterIsOnLadderInferiors = null; - - private String[] beforeIsPlayerSleepingSuperiors = null; - private String[] beforeIsPlayerSleepingInferiors = null; - private String[] overrideIsPlayerSleepingSuperiors = null; - private String[] overrideIsPlayerSleepingInferiors = null; - private String[] afterIsPlayerSleepingSuperiors = null; - private String[] afterIsPlayerSleepingInferiors = null; - - private String[] beforeIsSneakingSuperiors = null; - private String[] beforeIsSneakingInferiors = null; - private String[] overrideIsSneakingSuperiors = null; - private String[] overrideIsSneakingInferiors = null; - private String[] afterIsSneakingSuperiors = null; - private String[] afterIsSneakingInferiors = null; - - private String[] beforeIsSprintingSuperiors = null; - private String[] beforeIsSprintingInferiors = null; - private String[] overrideIsSprintingSuperiors = null; - private String[] overrideIsSprintingInferiors = null; - private String[] afterIsSprintingSuperiors = null; - private String[] afterIsSprintingInferiors = null; - - private String[] beforeJumpSuperiors = null; - private String[] beforeJumpInferiors = null; - private String[] overrideJumpSuperiors = null; - private String[] overrideJumpInferiors = null; - private String[] afterJumpSuperiors = null; - private String[] afterJumpInferiors = null; - - private String[] beforeKnockBackSuperiors = null; - private String[] beforeKnockBackInferiors = null; - private String[] overrideKnockBackSuperiors = null; - private String[] overrideKnockBackInferiors = null; - private String[] afterKnockBackSuperiors = null; - private String[] afterKnockBackInferiors = null; - - private String[] beforeMoveEntitySuperiors = null; - private String[] beforeMoveEntityInferiors = null; - private String[] overrideMoveEntitySuperiors = null; - private String[] overrideMoveEntityInferiors = null; - private String[] afterMoveEntitySuperiors = null; - private String[] afterMoveEntityInferiors = null; - - private String[] beforeMoveEntityWithHeadingSuperiors = null; - private String[] beforeMoveEntityWithHeadingInferiors = null; - private String[] overrideMoveEntityWithHeadingSuperiors = null; - private String[] overrideMoveEntityWithHeadingInferiors = null; - private String[] afterMoveEntityWithHeadingSuperiors = null; - private String[] afterMoveEntityWithHeadingInferiors = null; - - private String[] beforeMoveFlyingSuperiors = null; - private String[] beforeMoveFlyingInferiors = null; - private String[] overrideMoveFlyingSuperiors = null; - private String[] overrideMoveFlyingInferiors = null; - private String[] afterMoveFlyingSuperiors = null; - private String[] afterMoveFlyingInferiors = null; - - private String[] beforeOnDeathSuperiors = null; - private String[] beforeOnDeathInferiors = null; - private String[] overrideOnDeathSuperiors = null; - private String[] overrideOnDeathInferiors = null; - private String[] afterOnDeathSuperiors = null; - private String[] afterOnDeathInferiors = null; - - private String[] beforeOnLivingUpdateSuperiors = null; - private String[] beforeOnLivingUpdateInferiors = null; - private String[] overrideOnLivingUpdateSuperiors = null; - private String[] overrideOnLivingUpdateInferiors = null; - private String[] afterOnLivingUpdateSuperiors = null; - private String[] afterOnLivingUpdateInferiors = null; - - private String[] beforeOnKillEntitySuperiors = null; - private String[] beforeOnKillEntityInferiors = null; - private String[] overrideOnKillEntitySuperiors = null; - private String[] overrideOnKillEntityInferiors = null; - private String[] afterOnKillEntitySuperiors = null; - private String[] afterOnKillEntityInferiors = null; - - private String[] beforeOnStruckByLightningSuperiors = null; - private String[] beforeOnStruckByLightningInferiors = null; - private String[] overrideOnStruckByLightningSuperiors = null; - private String[] overrideOnStruckByLightningInferiors = null; - private String[] afterOnStruckByLightningSuperiors = null; - private String[] afterOnStruckByLightningInferiors = null; - - private String[] beforeOnUpdateSuperiors = null; - private String[] beforeOnUpdateInferiors = null; - private String[] overrideOnUpdateSuperiors = null; - private String[] overrideOnUpdateInferiors = null; - private String[] afterOnUpdateSuperiors = null; - private String[] afterOnUpdateInferiors = null; - - private String[] beforePlayStepSoundSuperiors = null; - private String[] beforePlayStepSoundInferiors = null; - private String[] overridePlayStepSoundSuperiors = null; - private String[] overridePlayStepSoundInferiors = null; - private String[] afterPlayStepSoundSuperiors = null; - private String[] afterPlayStepSoundInferiors = null; - - private String[] beforePushOutOfBlocksSuperiors = null; - private String[] beforePushOutOfBlocksInferiors = null; - private String[] overridePushOutOfBlocksSuperiors = null; - private String[] overridePushOutOfBlocksInferiors = null; - private String[] afterPushOutOfBlocksSuperiors = null; - private String[] afterPushOutOfBlocksInferiors = null; - - private String[] beforeRayTraceSuperiors = null; - private String[] beforeRayTraceInferiors = null; - private String[] overrideRayTraceSuperiors = null; - private String[] overrideRayTraceInferiors = null; - private String[] afterRayTraceSuperiors = null; - private String[] afterRayTraceInferiors = null; - - private String[] beforeReadEntityFromNBTSuperiors = null; - private String[] beforeReadEntityFromNBTInferiors = null; - private String[] overrideReadEntityFromNBTSuperiors = null; - private String[] overrideReadEntityFromNBTInferiors = null; - private String[] afterReadEntityFromNBTSuperiors = null; - private String[] afterReadEntityFromNBTInferiors = null; - - private String[] beforeRespawnPlayerSuperiors = null; - private String[] beforeRespawnPlayerInferiors = null; - private String[] overrideRespawnPlayerSuperiors = null; - private String[] overrideRespawnPlayerInferiors = null; - private String[] afterRespawnPlayerSuperiors = null; - private String[] afterRespawnPlayerInferiors = null; - - private String[] beforeSetDeadSuperiors = null; - private String[] beforeSetDeadInferiors = null; - private String[] overrideSetDeadSuperiors = null; - private String[] overrideSetDeadInferiors = null; - private String[] afterSetDeadSuperiors = null; - private String[] afterSetDeadInferiors = null; - - private String[] beforeSetPlayerSPHealthSuperiors = null; - private String[] beforeSetPlayerSPHealthInferiors = null; - private String[] overrideSetPlayerSPHealthSuperiors = null; - private String[] overrideSetPlayerSPHealthInferiors = null; - private String[] afterSetPlayerSPHealthSuperiors = null; - private String[] afterSetPlayerSPHealthInferiors = null; - - private String[] beforeSetPositionAndRotationSuperiors = null; - private String[] beforeSetPositionAndRotationInferiors = null; - private String[] overrideSetPositionAndRotationSuperiors = null; - private String[] overrideSetPositionAndRotationInferiors = null; - private String[] afterSetPositionAndRotationSuperiors = null; - private String[] afterSetPositionAndRotationInferiors = null; - - private String[] beforeSetSneakingSuperiors = null; - private String[] beforeSetSneakingInferiors = null; - private String[] overrideSetSneakingSuperiors = null; - private String[] overrideSetSneakingInferiors = null; - private String[] afterSetSneakingSuperiors = null; - private String[] afterSetSneakingInferiors = null; - - private String[] beforeSetSprintingSuperiors = null; - private String[] beforeSetSprintingInferiors = null; - private String[] overrideSetSprintingSuperiors = null; - private String[] overrideSetSprintingInferiors = null; - private String[] afterSetSprintingSuperiors = null; - private String[] afterSetSprintingInferiors = null; - - private String[] beforeTrySleepSuperiors = null; - private String[] beforeTrySleepInferiors = null; - private String[] overrideTrySleepSuperiors = null; - private String[] overrideTrySleepInferiors = null; - private String[] afterTrySleepSuperiors = null; - private String[] afterTrySleepInferiors = null; - - private String[] beforeSwingItemSuperiors = null; - private String[] beforeSwingItemInferiors = null; - private String[] overrideSwingItemSuperiors = null; - private String[] overrideSwingItemInferiors = null; - private String[] afterSwingItemSuperiors = null; - private String[] afterSwingItemInferiors = null; - - private String[] beforeUpdateEntityActionStateSuperiors = null; - private String[] beforeUpdateEntityActionStateInferiors = null; - private String[] overrideUpdateEntityActionStateSuperiors = null; - private String[] overrideUpdateEntityActionStateInferiors = null; - private String[] afterUpdateEntityActionStateSuperiors = null; - private String[] afterUpdateEntityActionStateInferiors = null; - - private String[] beforeUpdateRiddenSuperiors = null; - private String[] beforeUpdateRiddenInferiors = null; - private String[] overrideUpdateRiddenSuperiors = null; - private String[] overrideUpdateRiddenInferiors = null; - private String[] afterUpdateRiddenSuperiors = null; - private String[] afterUpdateRiddenInferiors = null; - - private String[] beforeWakeUpPlayerSuperiors = null; - private String[] beforeWakeUpPlayerInferiors = null; - private String[] overrideWakeUpPlayerSuperiors = null; - private String[] overrideWakeUpPlayerInferiors = null; - private String[] afterWakeUpPlayerSuperiors = null; - private String[] afterWakeUpPlayerInferiors = null; - - private String[] beforeWriteEntityToNBTSuperiors = null; - private String[] beforeWriteEntityToNBTInferiors = null; - private String[] overrideWriteEntityToNBTSuperiors = null; - private String[] overrideWriteEntityToNBTInferiors = null; - private String[] afterWriteEntityToNBTSuperiors = null; - private String[] afterWriteEntityToNBTInferiors = null; - - - public String[] getBeforeLocalConstructingSuperiors() - { - return beforeLocalConstructingSuperiors; - } - - public String[] getBeforeLocalConstructingInferiors() - { - return beforeLocalConstructingInferiors; - } - - public String[] getAfterLocalConstructingSuperiors() - { - return afterLocalConstructingSuperiors; - } - - public String[] getAfterLocalConstructingInferiors() - { - return afterLocalConstructingInferiors; - } - - public void setBeforeLocalConstructingSuperiors(String[] value) - { - beforeLocalConstructingSuperiors = value; - } - - public void setBeforeLocalConstructingInferiors(String[] value) - { - beforeLocalConstructingInferiors = value; - } - - public void setAfterLocalConstructingSuperiors(String[] value) - { - afterLocalConstructingSuperiors = value; - } - - public void setAfterLocalConstructingInferiors(String[] value) - { - afterLocalConstructingInferiors = value; - } - - public Map getDynamicBeforeSuperiors() - { - return dynamicBeforeSuperiors; - } - - public Map getDynamicBeforeInferiors() - { - return dynamicBeforeInferiors; - } - - public Map getDynamicOverrideSuperiors() - { - return dynamicOverrideSuperiors; - } - - public Map getDynamicOverrideInferiors() - { - return dynamicOverrideInferiors; - } - - public Map getDynamicAfterSuperiors() - { - return dynamicAfterSuperiors; - } - - public Map getDynamicAfterInferiors() - { - return dynamicAfterInferiors; - } - - public void setDynamicBeforeSuperiors(String name, String[] superiors) - { - dynamicBeforeSuperiors = setDynamic(name, superiors, dynamicBeforeSuperiors); - } - - public void setDynamicBeforeInferiors(String name, String[] inferiors) - { - dynamicBeforeInferiors = setDynamic(name, inferiors, dynamicBeforeInferiors); - } - - public void setDynamicOverrideSuperiors(String name, String[] superiors) - { - dynamicOverrideSuperiors = setDynamic(name, superiors, dynamicOverrideSuperiors); - } - - public void setDynamicOverrideInferiors(String name, String[] inferiors) - { - dynamicOverrideInferiors = setDynamic(name, inferiors, dynamicOverrideInferiors); - } - - public void setDynamicAfterSuperiors(String name, String[] superiors) - { - dynamicAfterSuperiors = setDynamic(name, superiors, dynamicAfterSuperiors); - } - - public void setDynamicAfterInferiors(String name, String[] inferiors) - { - dynamicAfterInferiors = setDynamic(name, inferiors, dynamicAfterInferiors); - } - - private Map setDynamic(String name, String[] names, Map map) - { - if(name == null) - throw new IllegalArgumentException("Parameter 'name' may not be null"); - - if(names == null) - { - if(map != null) - map.remove(name); - return map; - } - - if(map == null) - map = new HashMap(); - map.put(name, names); - - return map; - } - - public String[] getBeforeAddExhaustionSuperiors() - { - return beforeAddExhaustionSuperiors; - } - - public String[] getBeforeAddExhaustionInferiors() - { - return beforeAddExhaustionInferiors; - } - - public String[] getOverrideAddExhaustionSuperiors() - { - return overrideAddExhaustionSuperiors; - } - - public String[] getOverrideAddExhaustionInferiors() - { - return overrideAddExhaustionInferiors; - } - - public String[] getAfterAddExhaustionSuperiors() - { - return afterAddExhaustionSuperiors; - } - - public String[] getAfterAddExhaustionInferiors() - { - return afterAddExhaustionInferiors; - } - - public void setBeforeAddExhaustionSuperiors(String[] value) - { - beforeAddExhaustionSuperiors = value; - } - - public void setBeforeAddExhaustionInferiors(String[] value) - { - beforeAddExhaustionInferiors = value; - } - - public void setOverrideAddExhaustionSuperiors(String[] value) - { - overrideAddExhaustionSuperiors = value; - } - - public void setOverrideAddExhaustionInferiors(String[] value) - { - overrideAddExhaustionInferiors = value; - } - - public void setAfterAddExhaustionSuperiors(String[] value) - { - afterAddExhaustionSuperiors = value; - } - - public void setAfterAddExhaustionInferiors(String[] value) - { - afterAddExhaustionInferiors = value; - } - - public String[] getBeforeAddMovementStatSuperiors() - { - return beforeAddMovementStatSuperiors; - } - - public String[] getBeforeAddMovementStatInferiors() - { - return beforeAddMovementStatInferiors; - } - - public String[] getOverrideAddMovementStatSuperiors() - { - return overrideAddMovementStatSuperiors; - } - - public String[] getOverrideAddMovementStatInferiors() - { - return overrideAddMovementStatInferiors; - } - - public String[] getAfterAddMovementStatSuperiors() - { - return afterAddMovementStatSuperiors; - } - - public String[] getAfterAddMovementStatInferiors() - { - return afterAddMovementStatInferiors; - } - - public void setBeforeAddMovementStatSuperiors(String[] value) - { - beforeAddMovementStatSuperiors = value; - } - - public void setBeforeAddMovementStatInferiors(String[] value) - { - beforeAddMovementStatInferiors = value; - } - - public void setOverrideAddMovementStatSuperiors(String[] value) - { - overrideAddMovementStatSuperiors = value; - } - - public void setOverrideAddMovementStatInferiors(String[] value) - { - overrideAddMovementStatInferiors = value; - } - - public void setAfterAddMovementStatSuperiors(String[] value) - { - afterAddMovementStatSuperiors = value; - } - - public void setAfterAddMovementStatInferiors(String[] value) - { - afterAddMovementStatInferiors = value; - } - - public String[] getBeforeAddStatSuperiors() - { - return beforeAddStatSuperiors; - } - - public String[] getBeforeAddStatInferiors() - { - return beforeAddStatInferiors; - } - - public String[] getOverrideAddStatSuperiors() - { - return overrideAddStatSuperiors; - } - - public String[] getOverrideAddStatInferiors() - { - return overrideAddStatInferiors; - } - - public String[] getAfterAddStatSuperiors() - { - return afterAddStatSuperiors; - } - - public String[] getAfterAddStatInferiors() - { - return afterAddStatInferiors; - } - - public void setBeforeAddStatSuperiors(String[] value) - { - beforeAddStatSuperiors = value; - } - - public void setBeforeAddStatInferiors(String[] value) - { - beforeAddStatInferiors = value; - } - - public void setOverrideAddStatSuperiors(String[] value) - { - overrideAddStatSuperiors = value; - } - - public void setOverrideAddStatInferiors(String[] value) - { - overrideAddStatInferiors = value; - } - - public void setAfterAddStatSuperiors(String[] value) - { - afterAddStatSuperiors = value; - } - - public void setAfterAddStatInferiors(String[] value) - { - afterAddStatInferiors = value; - } - - public String[] getBeforeAttackEntityFromSuperiors() - { - return beforeAttackEntityFromSuperiors; - } - - public String[] getBeforeAttackEntityFromInferiors() - { - return beforeAttackEntityFromInferiors; - } - - public String[] getOverrideAttackEntityFromSuperiors() - { - return overrideAttackEntityFromSuperiors; - } - - public String[] getOverrideAttackEntityFromInferiors() - { - return overrideAttackEntityFromInferiors; - } - - public String[] getAfterAttackEntityFromSuperiors() - { - return afterAttackEntityFromSuperiors; - } - - public String[] getAfterAttackEntityFromInferiors() - { - return afterAttackEntityFromInferiors; - } - - public void setBeforeAttackEntityFromSuperiors(String[] value) - { - beforeAttackEntityFromSuperiors = value; - } - - public void setBeforeAttackEntityFromInferiors(String[] value) - { - beforeAttackEntityFromInferiors = value; - } - - public void setOverrideAttackEntityFromSuperiors(String[] value) - { - overrideAttackEntityFromSuperiors = value; - } - - public void setOverrideAttackEntityFromInferiors(String[] value) - { - overrideAttackEntityFromInferiors = value; - } - - public void setAfterAttackEntityFromSuperiors(String[] value) - { - afterAttackEntityFromSuperiors = value; - } - - public void setAfterAttackEntityFromInferiors(String[] value) - { - afterAttackEntityFromInferiors = value; - } - - public String[] getBeforeAttackTargetEntityWithCurrentItemSuperiors() - { - return beforeAttackTargetEntityWithCurrentItemSuperiors; - } - - public String[] getBeforeAttackTargetEntityWithCurrentItemInferiors() - { - return beforeAttackTargetEntityWithCurrentItemInferiors; - } - - public String[] getOverrideAttackTargetEntityWithCurrentItemSuperiors() - { - return overrideAttackTargetEntityWithCurrentItemSuperiors; - } - - public String[] getOverrideAttackTargetEntityWithCurrentItemInferiors() - { - return overrideAttackTargetEntityWithCurrentItemInferiors; - } - - public String[] getAfterAttackTargetEntityWithCurrentItemSuperiors() - { - return afterAttackTargetEntityWithCurrentItemSuperiors; - } - - public String[] getAfterAttackTargetEntityWithCurrentItemInferiors() - { - return afterAttackTargetEntityWithCurrentItemInferiors; - } - - public void setBeforeAttackTargetEntityWithCurrentItemSuperiors(String[] value) - { - beforeAttackTargetEntityWithCurrentItemSuperiors = value; - } - - public void setBeforeAttackTargetEntityWithCurrentItemInferiors(String[] value) - { - beforeAttackTargetEntityWithCurrentItemInferiors = value; - } - - public void setOverrideAttackTargetEntityWithCurrentItemSuperiors(String[] value) - { - overrideAttackTargetEntityWithCurrentItemSuperiors = value; - } - - public void setOverrideAttackTargetEntityWithCurrentItemInferiors(String[] value) - { - overrideAttackTargetEntityWithCurrentItemInferiors = value; - } - - public void setAfterAttackTargetEntityWithCurrentItemSuperiors(String[] value) - { - afterAttackTargetEntityWithCurrentItemSuperiors = value; - } - - public void setAfterAttackTargetEntityWithCurrentItemInferiors(String[] value) - { - afterAttackTargetEntityWithCurrentItemInferiors = value; - } - - public String[] getBeforeCanBreatheUnderwaterSuperiors() - { - return beforeCanBreatheUnderwaterSuperiors; - } - - public String[] getBeforeCanBreatheUnderwaterInferiors() - { - return beforeCanBreatheUnderwaterInferiors; - } - - public String[] getOverrideCanBreatheUnderwaterSuperiors() - { - return overrideCanBreatheUnderwaterSuperiors; - } - - public String[] getOverrideCanBreatheUnderwaterInferiors() - { - return overrideCanBreatheUnderwaterInferiors; - } - - public String[] getAfterCanBreatheUnderwaterSuperiors() - { - return afterCanBreatheUnderwaterSuperiors; - } - - public String[] getAfterCanBreatheUnderwaterInferiors() - { - return afterCanBreatheUnderwaterInferiors; - } - - public void setBeforeCanBreatheUnderwaterSuperiors(String[] value) - { - beforeCanBreatheUnderwaterSuperiors = value; - } - - public void setBeforeCanBreatheUnderwaterInferiors(String[] value) - { - beforeCanBreatheUnderwaterInferiors = value; - } - - public void setOverrideCanBreatheUnderwaterSuperiors(String[] value) - { - overrideCanBreatheUnderwaterSuperiors = value; - } - - public void setOverrideCanBreatheUnderwaterInferiors(String[] value) - { - overrideCanBreatheUnderwaterInferiors = value; - } - - public void setAfterCanBreatheUnderwaterSuperiors(String[] value) - { - afterCanBreatheUnderwaterSuperiors = value; - } - - public void setAfterCanBreatheUnderwaterInferiors(String[] value) - { - afterCanBreatheUnderwaterInferiors = value; - } - - public String[] getBeforeCanHarvestBlockSuperiors() - { - return beforeCanHarvestBlockSuperiors; - } - - public String[] getBeforeCanHarvestBlockInferiors() - { - return beforeCanHarvestBlockInferiors; - } - - public String[] getOverrideCanHarvestBlockSuperiors() - { - return overrideCanHarvestBlockSuperiors; - } - - public String[] getOverrideCanHarvestBlockInferiors() - { - return overrideCanHarvestBlockInferiors; - } - - public String[] getAfterCanHarvestBlockSuperiors() - { - return afterCanHarvestBlockSuperiors; - } - - public String[] getAfterCanHarvestBlockInferiors() - { - return afterCanHarvestBlockInferiors; - } - - public void setBeforeCanHarvestBlockSuperiors(String[] value) - { - beforeCanHarvestBlockSuperiors = value; - } - - public void setBeforeCanHarvestBlockInferiors(String[] value) - { - beforeCanHarvestBlockInferiors = value; - } - - public void setOverrideCanHarvestBlockSuperiors(String[] value) - { - overrideCanHarvestBlockSuperiors = value; - } - - public void setOverrideCanHarvestBlockInferiors(String[] value) - { - overrideCanHarvestBlockInferiors = value; - } - - public void setAfterCanHarvestBlockSuperiors(String[] value) - { - afterCanHarvestBlockSuperiors = value; - } - - public void setAfterCanHarvestBlockInferiors(String[] value) - { - afterCanHarvestBlockInferiors = value; - } - - public String[] getBeforeCanPlayerEditSuperiors() - { - return beforeCanPlayerEditSuperiors; - } - - public String[] getBeforeCanPlayerEditInferiors() - { - return beforeCanPlayerEditInferiors; - } - - public String[] getOverrideCanPlayerEditSuperiors() - { - return overrideCanPlayerEditSuperiors; - } - - public String[] getOverrideCanPlayerEditInferiors() - { - return overrideCanPlayerEditInferiors; - } - - public String[] getAfterCanPlayerEditSuperiors() - { - return afterCanPlayerEditSuperiors; - } - - public String[] getAfterCanPlayerEditInferiors() - { - return afterCanPlayerEditInferiors; - } - - public void setBeforeCanPlayerEditSuperiors(String[] value) - { - beforeCanPlayerEditSuperiors = value; - } - - public void setBeforeCanPlayerEditInferiors(String[] value) - { - beforeCanPlayerEditInferiors = value; - } - - public void setOverrideCanPlayerEditSuperiors(String[] value) - { - overrideCanPlayerEditSuperiors = value; - } - - public void setOverrideCanPlayerEditInferiors(String[] value) - { - overrideCanPlayerEditInferiors = value; - } - - public void setAfterCanPlayerEditSuperiors(String[] value) - { - afterCanPlayerEditSuperiors = value; - } - - public void setAfterCanPlayerEditInferiors(String[] value) - { - afterCanPlayerEditInferiors = value; - } - - public String[] getBeforeCanTriggerWalkingSuperiors() - { - return beforeCanTriggerWalkingSuperiors; - } - - public String[] getBeforeCanTriggerWalkingInferiors() - { - return beforeCanTriggerWalkingInferiors; - } - - public String[] getOverrideCanTriggerWalkingSuperiors() - { - return overrideCanTriggerWalkingSuperiors; - } - - public String[] getOverrideCanTriggerWalkingInferiors() - { - return overrideCanTriggerWalkingInferiors; - } - - public String[] getAfterCanTriggerWalkingSuperiors() - { - return afterCanTriggerWalkingSuperiors; - } - - public String[] getAfterCanTriggerWalkingInferiors() - { - return afterCanTriggerWalkingInferiors; - } - - public void setBeforeCanTriggerWalkingSuperiors(String[] value) - { - beforeCanTriggerWalkingSuperiors = value; - } - - public void setBeforeCanTriggerWalkingInferiors(String[] value) - { - beforeCanTriggerWalkingInferiors = value; - } - - public void setOverrideCanTriggerWalkingSuperiors(String[] value) - { - overrideCanTriggerWalkingSuperiors = value; - } - - public void setOverrideCanTriggerWalkingInferiors(String[] value) - { - overrideCanTriggerWalkingInferiors = value; - } - - public void setAfterCanTriggerWalkingSuperiors(String[] value) - { - afterCanTriggerWalkingSuperiors = value; - } - - public void setAfterCanTriggerWalkingInferiors(String[] value) - { - afterCanTriggerWalkingInferiors = value; - } - - public String[] getBeforeCloseScreenSuperiors() - { - return beforeCloseScreenSuperiors; - } - - public String[] getBeforeCloseScreenInferiors() - { - return beforeCloseScreenInferiors; - } - - public String[] getOverrideCloseScreenSuperiors() - { - return overrideCloseScreenSuperiors; - } - - public String[] getOverrideCloseScreenInferiors() - { - return overrideCloseScreenInferiors; - } - - public String[] getAfterCloseScreenSuperiors() - { - return afterCloseScreenSuperiors; - } - - public String[] getAfterCloseScreenInferiors() - { - return afterCloseScreenInferiors; - } - - public void setBeforeCloseScreenSuperiors(String[] value) - { - beforeCloseScreenSuperiors = value; - } - - public void setBeforeCloseScreenInferiors(String[] value) - { - beforeCloseScreenInferiors = value; - } - - public void setOverrideCloseScreenSuperiors(String[] value) - { - overrideCloseScreenSuperiors = value; - } - - public void setOverrideCloseScreenInferiors(String[] value) - { - overrideCloseScreenInferiors = value; - } - - public void setAfterCloseScreenSuperiors(String[] value) - { - afterCloseScreenSuperiors = value; - } - - public void setAfterCloseScreenInferiors(String[] value) - { - afterCloseScreenInferiors = value; - } - - public String[] getBeforeDamageEntitySuperiors() - { - return beforeDamageEntitySuperiors; - } - - public String[] getBeforeDamageEntityInferiors() - { - return beforeDamageEntityInferiors; - } - - public String[] getOverrideDamageEntitySuperiors() - { - return overrideDamageEntitySuperiors; - } - - public String[] getOverrideDamageEntityInferiors() - { - return overrideDamageEntityInferiors; - } - - public String[] getAfterDamageEntitySuperiors() - { - return afterDamageEntitySuperiors; - } - - public String[] getAfterDamageEntityInferiors() - { - return afterDamageEntityInferiors; - } - - public void setBeforeDamageEntitySuperiors(String[] value) - { - beforeDamageEntitySuperiors = value; - } - - public void setBeforeDamageEntityInferiors(String[] value) - { - beforeDamageEntityInferiors = value; - } - - public void setOverrideDamageEntitySuperiors(String[] value) - { - overrideDamageEntitySuperiors = value; - } - - public void setOverrideDamageEntityInferiors(String[] value) - { - overrideDamageEntityInferiors = value; - } - - public void setAfterDamageEntitySuperiors(String[] value) - { - afterDamageEntitySuperiors = value; - } - - public void setAfterDamageEntityInferiors(String[] value) - { - afterDamageEntityInferiors = value; - } - - public String[] getBeforeDisplayGuiSuperiors() - { - return beforeDisplayGuiSuperiors; - } - - public String[] getBeforeDisplayGuiInferiors() - { - return beforeDisplayGuiInferiors; - } - - public String[] getOverrideDisplayGuiSuperiors() - { - return overrideDisplayGuiSuperiors; - } - - public String[] getOverrideDisplayGuiInferiors() - { - return overrideDisplayGuiInferiors; - } - - public String[] getAfterDisplayGuiSuperiors() - { - return afterDisplayGuiSuperiors; - } - - public String[] getAfterDisplayGuiInferiors() - { - return afterDisplayGuiInferiors; - } - - public void setBeforeDisplayGuiSuperiors(String[] value) - { - beforeDisplayGuiSuperiors = value; - } - - public void setBeforeDisplayGuiInferiors(String[] value) - { - beforeDisplayGuiInferiors = value; - } - - public void setOverrideDisplayGuiSuperiors(String[] value) - { - overrideDisplayGuiSuperiors = value; - } - - public void setOverrideDisplayGuiInferiors(String[] value) - { - overrideDisplayGuiInferiors = value; - } - - public void setAfterDisplayGuiSuperiors(String[] value) - { - afterDisplayGuiSuperiors = value; - } - - public void setAfterDisplayGuiInferiors(String[] value) - { - afterDisplayGuiInferiors = value; - } - - public String[] getBeforeDisplayGUIChestSuperiors() - { - return beforeDisplayGUIChestSuperiors; - } - - public String[] getBeforeDisplayGUIChestInferiors() - { - return beforeDisplayGUIChestInferiors; - } - - public String[] getOverrideDisplayGUIChestSuperiors() - { - return overrideDisplayGUIChestSuperiors; - } - - public String[] getOverrideDisplayGUIChestInferiors() - { - return overrideDisplayGUIChestInferiors; - } - - public String[] getAfterDisplayGUIChestSuperiors() - { - return afterDisplayGUIChestSuperiors; - } - - public String[] getAfterDisplayGUIChestInferiors() - { - return afterDisplayGUIChestInferiors; - } - - public void setBeforeDisplayGUIChestSuperiors(String[] value) - { - beforeDisplayGUIChestSuperiors = value; - } - - public void setBeforeDisplayGUIChestInferiors(String[] value) - { - beforeDisplayGUIChestInferiors = value; - } - - public void setOverrideDisplayGUIChestSuperiors(String[] value) - { - overrideDisplayGUIChestSuperiors = value; - } - - public void setOverrideDisplayGUIChestInferiors(String[] value) - { - overrideDisplayGUIChestInferiors = value; - } - - public void setAfterDisplayGUIChestSuperiors(String[] value) - { - afterDisplayGUIChestSuperiors = value; - } - - public void setAfterDisplayGUIChestInferiors(String[] value) - { - afterDisplayGUIChestInferiors = value; - } - - public String[] getBeforeDropItemSuperiors() - { - return beforeDropItemSuperiors; - } - - public String[] getBeforeDropItemInferiors() - { - return beforeDropItemInferiors; - } - - public String[] getOverrideDropItemSuperiors() - { - return overrideDropItemSuperiors; - } - - public String[] getOverrideDropItemInferiors() - { - return overrideDropItemInferiors; - } - - public String[] getAfterDropItemSuperiors() - { - return afterDropItemSuperiors; - } - - public String[] getAfterDropItemInferiors() - { - return afterDropItemInferiors; - } - - public void setBeforeDropItemSuperiors(String[] value) - { - beforeDropItemSuperiors = value; - } - - public void setBeforeDropItemInferiors(String[] value) - { - beforeDropItemInferiors = value; - } - - public void setOverrideDropItemSuperiors(String[] value) - { - overrideDropItemSuperiors = value; - } - - public void setOverrideDropItemInferiors(String[] value) - { - overrideDropItemInferiors = value; - } - - public void setAfterDropItemSuperiors(String[] value) - { - afterDropItemSuperiors = value; - } - - public void setAfterDropItemInferiors(String[] value) - { - afterDropItemInferiors = value; - } - - public String[] getBeforeDropOneItemSuperiors() - { - return beforeDropOneItemSuperiors; - } - - public String[] getBeforeDropOneItemInferiors() - { - return beforeDropOneItemInferiors; - } - - public String[] getOverrideDropOneItemSuperiors() - { - return overrideDropOneItemSuperiors; - } - - public String[] getOverrideDropOneItemInferiors() - { - return overrideDropOneItemInferiors; - } - - public String[] getAfterDropOneItemSuperiors() - { - return afterDropOneItemSuperiors; - } - - public String[] getAfterDropOneItemInferiors() - { - return afterDropOneItemInferiors; - } - - public void setBeforeDropOneItemSuperiors(String[] value) - { - beforeDropOneItemSuperiors = value; - } - - public void setBeforeDropOneItemInferiors(String[] value) - { - beforeDropOneItemInferiors = value; - } - - public void setOverrideDropOneItemSuperiors(String[] value) - { - overrideDropOneItemSuperiors = value; - } - - public void setOverrideDropOneItemInferiors(String[] value) - { - overrideDropOneItemInferiors = value; - } - - public void setAfterDropOneItemSuperiors(String[] value) - { - afterDropOneItemSuperiors = value; - } - - public void setAfterDropOneItemInferiors(String[] value) - { - afterDropOneItemInferiors = value; - } - - public String[] getBeforeDropPlayerItemWithRandomChoiceSuperiors() - { - return beforeDropPlayerItemWithRandomChoiceSuperiors; - } - - public String[] getBeforeDropPlayerItemWithRandomChoiceInferiors() - { - return beforeDropPlayerItemWithRandomChoiceInferiors; - } - - public String[] getOverrideDropPlayerItemWithRandomChoiceSuperiors() - { - return overrideDropPlayerItemWithRandomChoiceSuperiors; - } - - public String[] getOverrideDropPlayerItemWithRandomChoiceInferiors() - { - return overrideDropPlayerItemWithRandomChoiceInferiors; - } - - public String[] getAfterDropPlayerItemWithRandomChoiceSuperiors() - { - return afterDropPlayerItemWithRandomChoiceSuperiors; - } - - public String[] getAfterDropPlayerItemWithRandomChoiceInferiors() - { - return afterDropPlayerItemWithRandomChoiceInferiors; - } - - public void setBeforeDropPlayerItemWithRandomChoiceSuperiors(String[] value) - { - beforeDropPlayerItemWithRandomChoiceSuperiors = value; - } - - public void setBeforeDropPlayerItemWithRandomChoiceInferiors(String[] value) - { - beforeDropPlayerItemWithRandomChoiceInferiors = value; - } - - public void setOverrideDropPlayerItemWithRandomChoiceSuperiors(String[] value) - { - overrideDropPlayerItemWithRandomChoiceSuperiors = value; - } - - public void setOverrideDropPlayerItemWithRandomChoiceInferiors(String[] value) - { - overrideDropPlayerItemWithRandomChoiceInferiors = value; - } - - public void setAfterDropPlayerItemWithRandomChoiceSuperiors(String[] value) - { - afterDropPlayerItemWithRandomChoiceSuperiors = value; - } - - public void setAfterDropPlayerItemWithRandomChoiceInferiors(String[] value) - { - afterDropPlayerItemWithRandomChoiceInferiors = value; - } - - public String[] getBeforeFallSuperiors() - { - return beforeFallSuperiors; - } - - public String[] getBeforeFallInferiors() - { - return beforeFallInferiors; - } - - public String[] getOverrideFallSuperiors() - { - return overrideFallSuperiors; - } - - public String[] getOverrideFallInferiors() - { - return overrideFallInferiors; - } - - public String[] getAfterFallSuperiors() - { - return afterFallSuperiors; - } - - public String[] getAfterFallInferiors() - { - return afterFallInferiors; - } - - public void setBeforeFallSuperiors(String[] value) - { - beforeFallSuperiors = value; - } - - public void setBeforeFallInferiors(String[] value) - { - beforeFallInferiors = value; - } - - public void setOverrideFallSuperiors(String[] value) - { - overrideFallSuperiors = value; - } - - public void setOverrideFallInferiors(String[] value) - { - overrideFallInferiors = value; - } - - public void setAfterFallSuperiors(String[] value) - { - afterFallSuperiors = value; - } - - public void setAfterFallInferiors(String[] value) - { - afterFallInferiors = value; - } - - public String[] getBeforeGetAIMoveSpeedSuperiors() - { - return beforeGetAIMoveSpeedSuperiors; - } - - public String[] getBeforeGetAIMoveSpeedInferiors() - { - return beforeGetAIMoveSpeedInferiors; - } - - public String[] getOverrideGetAIMoveSpeedSuperiors() - { - return overrideGetAIMoveSpeedSuperiors; - } - - public String[] getOverrideGetAIMoveSpeedInferiors() - { - return overrideGetAIMoveSpeedInferiors; - } - - public String[] getAfterGetAIMoveSpeedSuperiors() - { - return afterGetAIMoveSpeedSuperiors; - } - - public String[] getAfterGetAIMoveSpeedInferiors() - { - return afterGetAIMoveSpeedInferiors; - } - - public void setBeforeGetAIMoveSpeedSuperiors(String[] value) - { - beforeGetAIMoveSpeedSuperiors = value; - } - - public void setBeforeGetAIMoveSpeedInferiors(String[] value) - { - beforeGetAIMoveSpeedInferiors = value; - } - - public void setOverrideGetAIMoveSpeedSuperiors(String[] value) - { - overrideGetAIMoveSpeedSuperiors = value; - } - - public void setOverrideGetAIMoveSpeedInferiors(String[] value) - { - overrideGetAIMoveSpeedInferiors = value; - } - - public void setAfterGetAIMoveSpeedSuperiors(String[] value) - { - afterGetAIMoveSpeedSuperiors = value; - } - - public void setAfterGetAIMoveSpeedInferiors(String[] value) - { - afterGetAIMoveSpeedInferiors = value; - } - - public String[] getBeforeGetBedOrientationInDegreesSuperiors() - { - return beforeGetBedOrientationInDegreesSuperiors; - } - - public String[] getBeforeGetBedOrientationInDegreesInferiors() - { - return beforeGetBedOrientationInDegreesInferiors; - } - - public String[] getOverrideGetBedOrientationInDegreesSuperiors() - { - return overrideGetBedOrientationInDegreesSuperiors; - } - - public String[] getOverrideGetBedOrientationInDegreesInferiors() - { - return overrideGetBedOrientationInDegreesInferiors; - } - - public String[] getAfterGetBedOrientationInDegreesSuperiors() - { - return afterGetBedOrientationInDegreesSuperiors; - } - - public String[] getAfterGetBedOrientationInDegreesInferiors() - { - return afterGetBedOrientationInDegreesInferiors; - } - - public void setBeforeGetBedOrientationInDegreesSuperiors(String[] value) - { - beforeGetBedOrientationInDegreesSuperiors = value; - } - - public void setBeforeGetBedOrientationInDegreesInferiors(String[] value) - { - beforeGetBedOrientationInDegreesInferiors = value; - } - - public void setOverrideGetBedOrientationInDegreesSuperiors(String[] value) - { - overrideGetBedOrientationInDegreesSuperiors = value; - } - - public void setOverrideGetBedOrientationInDegreesInferiors(String[] value) - { - overrideGetBedOrientationInDegreesInferiors = value; - } - - public void setAfterGetBedOrientationInDegreesSuperiors(String[] value) - { - afterGetBedOrientationInDegreesSuperiors = value; - } - - public void setAfterGetBedOrientationInDegreesInferiors(String[] value) - { - afterGetBedOrientationInDegreesInferiors = value; - } - - public String[] getBeforeGetBrightnessSuperiors() - { - return beforeGetBrightnessSuperiors; - } - - public String[] getBeforeGetBrightnessInferiors() - { - return beforeGetBrightnessInferiors; - } - - public String[] getOverrideGetBrightnessSuperiors() - { - return overrideGetBrightnessSuperiors; - } - - public String[] getOverrideGetBrightnessInferiors() - { - return overrideGetBrightnessInferiors; - } - - public String[] getAfterGetBrightnessSuperiors() - { - return afterGetBrightnessSuperiors; - } - - public String[] getAfterGetBrightnessInferiors() - { - return afterGetBrightnessInferiors; - } - - public void setBeforeGetBrightnessSuperiors(String[] value) - { - beforeGetBrightnessSuperiors = value; - } - - public void setBeforeGetBrightnessInferiors(String[] value) - { - beforeGetBrightnessInferiors = value; - } - - public void setOverrideGetBrightnessSuperiors(String[] value) - { - overrideGetBrightnessSuperiors = value; - } - - public void setOverrideGetBrightnessInferiors(String[] value) - { - overrideGetBrightnessInferiors = value; - } - - public void setAfterGetBrightnessSuperiors(String[] value) - { - afterGetBrightnessSuperiors = value; - } - - public void setAfterGetBrightnessInferiors(String[] value) - { - afterGetBrightnessInferiors = value; - } - - public String[] getBeforeGetBrightnessForRenderSuperiors() - { - return beforeGetBrightnessForRenderSuperiors; - } - - public String[] getBeforeGetBrightnessForRenderInferiors() - { - return beforeGetBrightnessForRenderInferiors; - } - - public String[] getOverrideGetBrightnessForRenderSuperiors() - { - return overrideGetBrightnessForRenderSuperiors; - } - - public String[] getOverrideGetBrightnessForRenderInferiors() - { - return overrideGetBrightnessForRenderInferiors; - } - - public String[] getAfterGetBrightnessForRenderSuperiors() - { - return afterGetBrightnessForRenderSuperiors; - } - - public String[] getAfterGetBrightnessForRenderInferiors() - { - return afterGetBrightnessForRenderInferiors; - } - - public void setBeforeGetBrightnessForRenderSuperiors(String[] value) - { - beforeGetBrightnessForRenderSuperiors = value; - } - - public void setBeforeGetBrightnessForRenderInferiors(String[] value) - { - beforeGetBrightnessForRenderInferiors = value; - } - - public void setOverrideGetBrightnessForRenderSuperiors(String[] value) - { - overrideGetBrightnessForRenderSuperiors = value; - } - - public void setOverrideGetBrightnessForRenderInferiors(String[] value) - { - overrideGetBrightnessForRenderInferiors = value; - } - - public void setAfterGetBrightnessForRenderSuperiors(String[] value) - { - afterGetBrightnessForRenderSuperiors = value; - } - - public void setAfterGetBrightnessForRenderInferiors(String[] value) - { - afterGetBrightnessForRenderInferiors = value; - } - - public String[] getBeforeGetBreakSpeedSuperiors() - { - return beforeGetBreakSpeedSuperiors; - } - - public String[] getBeforeGetBreakSpeedInferiors() - { - return beforeGetBreakSpeedInferiors; - } - - public String[] getOverrideGetBreakSpeedSuperiors() - { - return overrideGetBreakSpeedSuperiors; - } - - public String[] getOverrideGetBreakSpeedInferiors() - { - return overrideGetBreakSpeedInferiors; - } - - public String[] getAfterGetBreakSpeedSuperiors() - { - return afterGetBreakSpeedSuperiors; - } - - public String[] getAfterGetBreakSpeedInferiors() - { - return afterGetBreakSpeedInferiors; - } - - public void setBeforeGetBreakSpeedSuperiors(String[] value) - { - beforeGetBreakSpeedSuperiors = value; - } - - public void setBeforeGetBreakSpeedInferiors(String[] value) - { - beforeGetBreakSpeedInferiors = value; - } - - public void setOverrideGetBreakSpeedSuperiors(String[] value) - { - overrideGetBreakSpeedSuperiors = value; - } - - public void setOverrideGetBreakSpeedInferiors(String[] value) - { - overrideGetBreakSpeedInferiors = value; - } - - public void setAfterGetBreakSpeedSuperiors(String[] value) - { - afterGetBreakSpeedSuperiors = value; - } - - public void setAfterGetBreakSpeedInferiors(String[] value) - { - afterGetBreakSpeedInferiors = value; - } - - public String[] getBeforeGetDistanceSqSuperiors() - { - return beforeGetDistanceSqSuperiors; - } - - public String[] getBeforeGetDistanceSqInferiors() - { - return beforeGetDistanceSqInferiors; - } - - public String[] getOverrideGetDistanceSqSuperiors() - { - return overrideGetDistanceSqSuperiors; - } - - public String[] getOverrideGetDistanceSqInferiors() - { - return overrideGetDistanceSqInferiors; - } - - public String[] getAfterGetDistanceSqSuperiors() - { - return afterGetDistanceSqSuperiors; - } - - public String[] getAfterGetDistanceSqInferiors() - { - return afterGetDistanceSqInferiors; - } - - public void setBeforeGetDistanceSqSuperiors(String[] value) - { - beforeGetDistanceSqSuperiors = value; - } - - public void setBeforeGetDistanceSqInferiors(String[] value) - { - beforeGetDistanceSqInferiors = value; - } - - public void setOverrideGetDistanceSqSuperiors(String[] value) - { - overrideGetDistanceSqSuperiors = value; - } - - public void setOverrideGetDistanceSqInferiors(String[] value) - { - overrideGetDistanceSqInferiors = value; - } - - public void setAfterGetDistanceSqSuperiors(String[] value) - { - afterGetDistanceSqSuperiors = value; - } - - public void setAfterGetDistanceSqInferiors(String[] value) - { - afterGetDistanceSqInferiors = value; - } - - public String[] getBeforeGetDistanceSqToEntitySuperiors() - { - return beforeGetDistanceSqToEntitySuperiors; - } - - public String[] getBeforeGetDistanceSqToEntityInferiors() - { - return beforeGetDistanceSqToEntityInferiors; - } - - public String[] getOverrideGetDistanceSqToEntitySuperiors() - { - return overrideGetDistanceSqToEntitySuperiors; - } - - public String[] getOverrideGetDistanceSqToEntityInferiors() - { - return overrideGetDistanceSqToEntityInferiors; - } - - public String[] getAfterGetDistanceSqToEntitySuperiors() - { - return afterGetDistanceSqToEntitySuperiors; - } - - public String[] getAfterGetDistanceSqToEntityInferiors() - { - return afterGetDistanceSqToEntityInferiors; - } - - public void setBeforeGetDistanceSqToEntitySuperiors(String[] value) - { - beforeGetDistanceSqToEntitySuperiors = value; - } - - public void setBeforeGetDistanceSqToEntityInferiors(String[] value) - { - beforeGetDistanceSqToEntityInferiors = value; - } - - public void setOverrideGetDistanceSqToEntitySuperiors(String[] value) - { - overrideGetDistanceSqToEntitySuperiors = value; - } - - public void setOverrideGetDistanceSqToEntityInferiors(String[] value) - { - overrideGetDistanceSqToEntityInferiors = value; - } - - public void setAfterGetDistanceSqToEntitySuperiors(String[] value) - { - afterGetDistanceSqToEntitySuperiors = value; - } - - public void setAfterGetDistanceSqToEntityInferiors(String[] value) - { - afterGetDistanceSqToEntityInferiors = value; - } - - public String[] getBeforeGetFovModifierSuperiors() - { - return beforeGetFovModifierSuperiors; - } - - public String[] getBeforeGetFovModifierInferiors() - { - return beforeGetFovModifierInferiors; - } - - public String[] getOverrideGetFovModifierSuperiors() - { - return overrideGetFovModifierSuperiors; - } - - public String[] getOverrideGetFovModifierInferiors() - { - return overrideGetFovModifierInferiors; - } - - public String[] getAfterGetFovModifierSuperiors() - { - return afterGetFovModifierSuperiors; - } - - public String[] getAfterGetFovModifierInferiors() - { - return afterGetFovModifierInferiors; - } - - public void setBeforeGetFovModifierSuperiors(String[] value) - { - beforeGetFovModifierSuperiors = value; - } - - public void setBeforeGetFovModifierInferiors(String[] value) - { - beforeGetFovModifierInferiors = value; - } - - public void setOverrideGetFovModifierSuperiors(String[] value) - { - overrideGetFovModifierSuperiors = value; - } - - public void setOverrideGetFovModifierInferiors(String[] value) - { - overrideGetFovModifierInferiors = value; - } - - public void setAfterGetFovModifierSuperiors(String[] value) - { - afterGetFovModifierSuperiors = value; - } - - public void setAfterGetFovModifierInferiors(String[] value) - { - afterGetFovModifierInferiors = value; - } - - public String[] getBeforeGetHurtSoundSuperiors() - { - return beforeGetHurtSoundSuperiors; - } - - public String[] getBeforeGetHurtSoundInferiors() - { - return beforeGetHurtSoundInferiors; - } - - public String[] getOverrideGetHurtSoundSuperiors() - { - return overrideGetHurtSoundSuperiors; - } - - public String[] getOverrideGetHurtSoundInferiors() - { - return overrideGetHurtSoundInferiors; - } - - public String[] getAfterGetHurtSoundSuperiors() - { - return afterGetHurtSoundSuperiors; - } - - public String[] getAfterGetHurtSoundInferiors() - { - return afterGetHurtSoundInferiors; - } - - public void setBeforeGetHurtSoundSuperiors(String[] value) - { - beforeGetHurtSoundSuperiors = value; - } - - public void setBeforeGetHurtSoundInferiors(String[] value) - { - beforeGetHurtSoundInferiors = value; - } - - public void setOverrideGetHurtSoundSuperiors(String[] value) - { - overrideGetHurtSoundSuperiors = value; - } - - public void setOverrideGetHurtSoundInferiors(String[] value) - { - overrideGetHurtSoundInferiors = value; - } - - public void setAfterGetHurtSoundSuperiors(String[] value) - { - afterGetHurtSoundSuperiors = value; - } - - public void setAfterGetHurtSoundInferiors(String[] value) - { - afterGetHurtSoundInferiors = value; - } - - public String[] getBeforeGetNameSuperiors() - { - return beforeGetNameSuperiors; - } - - public String[] getBeforeGetNameInferiors() - { - return beforeGetNameInferiors; - } - - public String[] getOverrideGetNameSuperiors() - { - return overrideGetNameSuperiors; - } - - public String[] getOverrideGetNameInferiors() - { - return overrideGetNameInferiors; - } - - public String[] getAfterGetNameSuperiors() - { - return afterGetNameSuperiors; - } - - public String[] getAfterGetNameInferiors() - { - return afterGetNameInferiors; - } - - public void setBeforeGetNameSuperiors(String[] value) - { - beforeGetNameSuperiors = value; - } - - public void setBeforeGetNameInferiors(String[] value) - { - beforeGetNameInferiors = value; - } - - public void setOverrideGetNameSuperiors(String[] value) - { - overrideGetNameSuperiors = value; - } - - public void setOverrideGetNameInferiors(String[] value) - { - overrideGetNameInferiors = value; - } - - public void setAfterGetNameSuperiors(String[] value) - { - afterGetNameSuperiors = value; - } - - public void setAfterGetNameInferiors(String[] value) - { - afterGetNameInferiors = value; - } - - public String[] getBeforeGetSleepTimerSuperiors() - { - return beforeGetSleepTimerSuperiors; - } - - public String[] getBeforeGetSleepTimerInferiors() - { - return beforeGetSleepTimerInferiors; - } - - public String[] getOverrideGetSleepTimerSuperiors() - { - return overrideGetSleepTimerSuperiors; - } - - public String[] getOverrideGetSleepTimerInferiors() - { - return overrideGetSleepTimerInferiors; - } - - public String[] getAfterGetSleepTimerSuperiors() - { - return afterGetSleepTimerSuperiors; - } - - public String[] getAfterGetSleepTimerInferiors() - { - return afterGetSleepTimerInferiors; - } - - public void setBeforeGetSleepTimerSuperiors(String[] value) - { - beforeGetSleepTimerSuperiors = value; - } - - public void setBeforeGetSleepTimerInferiors(String[] value) - { - beforeGetSleepTimerInferiors = value; - } - - public void setOverrideGetSleepTimerSuperiors(String[] value) - { - overrideGetSleepTimerSuperiors = value; - } - - public void setOverrideGetSleepTimerInferiors(String[] value) - { - overrideGetSleepTimerInferiors = value; - } - - public void setAfterGetSleepTimerSuperiors(String[] value) - { - afterGetSleepTimerSuperiors = value; - } - - public void setAfterGetSleepTimerInferiors(String[] value) - { - afterGetSleepTimerInferiors = value; - } - - public String[] getBeforeHandleWaterMovementSuperiors() - { - return beforeHandleWaterMovementSuperiors; - } - - public String[] getBeforeHandleWaterMovementInferiors() - { - return beforeHandleWaterMovementInferiors; - } - - public String[] getOverrideHandleWaterMovementSuperiors() - { - return overrideHandleWaterMovementSuperiors; - } - - public String[] getOverrideHandleWaterMovementInferiors() - { - return overrideHandleWaterMovementInferiors; - } - - public String[] getAfterHandleWaterMovementSuperiors() - { - return afterHandleWaterMovementSuperiors; - } - - public String[] getAfterHandleWaterMovementInferiors() - { - return afterHandleWaterMovementInferiors; - } - - public void setBeforeHandleWaterMovementSuperiors(String[] value) - { - beforeHandleWaterMovementSuperiors = value; - } - - public void setBeforeHandleWaterMovementInferiors(String[] value) - { - beforeHandleWaterMovementInferiors = value; - } - - public void setOverrideHandleWaterMovementSuperiors(String[] value) - { - overrideHandleWaterMovementSuperiors = value; - } - - public void setOverrideHandleWaterMovementInferiors(String[] value) - { - overrideHandleWaterMovementInferiors = value; - } - - public void setAfterHandleWaterMovementSuperiors(String[] value) - { - afterHandleWaterMovementSuperiors = value; - } - - public void setAfterHandleWaterMovementInferiors(String[] value) - { - afterHandleWaterMovementInferiors = value; - } - - public String[] getBeforeHealSuperiors() - { - return beforeHealSuperiors; - } - - public String[] getBeforeHealInferiors() - { - return beforeHealInferiors; - } - - public String[] getOverrideHealSuperiors() - { - return overrideHealSuperiors; - } - - public String[] getOverrideHealInferiors() - { - return overrideHealInferiors; - } - - public String[] getAfterHealSuperiors() - { - return afterHealSuperiors; - } - - public String[] getAfterHealInferiors() - { - return afterHealInferiors; - } - - public void setBeforeHealSuperiors(String[] value) - { - beforeHealSuperiors = value; - } - - public void setBeforeHealInferiors(String[] value) - { - beforeHealInferiors = value; - } - - public void setOverrideHealSuperiors(String[] value) - { - overrideHealSuperiors = value; - } - - public void setOverrideHealInferiors(String[] value) - { - overrideHealInferiors = value; - } - - public void setAfterHealSuperiors(String[] value) - { - afterHealSuperiors = value; - } - - public void setAfterHealInferiors(String[] value) - { - afterHealInferiors = value; - } - - public String[] getBeforeIsEntityInsideOpaqueBlockSuperiors() - { - return beforeIsEntityInsideOpaqueBlockSuperiors; - } - - public String[] getBeforeIsEntityInsideOpaqueBlockInferiors() - { - return beforeIsEntityInsideOpaqueBlockInferiors; - } - - public String[] getOverrideIsEntityInsideOpaqueBlockSuperiors() - { - return overrideIsEntityInsideOpaqueBlockSuperiors; - } - - public String[] getOverrideIsEntityInsideOpaqueBlockInferiors() - { - return overrideIsEntityInsideOpaqueBlockInferiors; - } - - public String[] getAfterIsEntityInsideOpaqueBlockSuperiors() - { - return afterIsEntityInsideOpaqueBlockSuperiors; - } - - public String[] getAfterIsEntityInsideOpaqueBlockInferiors() - { - return afterIsEntityInsideOpaqueBlockInferiors; - } - - public void setBeforeIsEntityInsideOpaqueBlockSuperiors(String[] value) - { - beforeIsEntityInsideOpaqueBlockSuperiors = value; - } - - public void setBeforeIsEntityInsideOpaqueBlockInferiors(String[] value) - { - beforeIsEntityInsideOpaqueBlockInferiors = value; - } - - public void setOverrideIsEntityInsideOpaqueBlockSuperiors(String[] value) - { - overrideIsEntityInsideOpaqueBlockSuperiors = value; - } - - public void setOverrideIsEntityInsideOpaqueBlockInferiors(String[] value) - { - overrideIsEntityInsideOpaqueBlockInferiors = value; - } - - public void setAfterIsEntityInsideOpaqueBlockSuperiors(String[] value) - { - afterIsEntityInsideOpaqueBlockSuperiors = value; - } - - public void setAfterIsEntityInsideOpaqueBlockInferiors(String[] value) - { - afterIsEntityInsideOpaqueBlockInferiors = value; - } - - public String[] getBeforeIsInWaterSuperiors() - { - return beforeIsInWaterSuperiors; - } - - public String[] getBeforeIsInWaterInferiors() - { - return beforeIsInWaterInferiors; - } - - public String[] getOverrideIsInWaterSuperiors() - { - return overrideIsInWaterSuperiors; - } - - public String[] getOverrideIsInWaterInferiors() - { - return overrideIsInWaterInferiors; - } - - public String[] getAfterIsInWaterSuperiors() - { - return afterIsInWaterSuperiors; - } - - public String[] getAfterIsInWaterInferiors() - { - return afterIsInWaterInferiors; - } - - public void setBeforeIsInWaterSuperiors(String[] value) - { - beforeIsInWaterSuperiors = value; - } - - public void setBeforeIsInWaterInferiors(String[] value) - { - beforeIsInWaterInferiors = value; - } - - public void setOverrideIsInWaterSuperiors(String[] value) - { - overrideIsInWaterSuperiors = value; - } - - public void setOverrideIsInWaterInferiors(String[] value) - { - overrideIsInWaterInferiors = value; - } - - public void setAfterIsInWaterSuperiors(String[] value) - { - afterIsInWaterSuperiors = value; - } - - public void setAfterIsInWaterInferiors(String[] value) - { - afterIsInWaterInferiors = value; - } - - public String[] getBeforeIsInsideOfMaterialSuperiors() - { - return beforeIsInsideOfMaterialSuperiors; - } - - public String[] getBeforeIsInsideOfMaterialInferiors() - { - return beforeIsInsideOfMaterialInferiors; - } - - public String[] getOverrideIsInsideOfMaterialSuperiors() - { - return overrideIsInsideOfMaterialSuperiors; - } - - public String[] getOverrideIsInsideOfMaterialInferiors() - { - return overrideIsInsideOfMaterialInferiors; - } - - public String[] getAfterIsInsideOfMaterialSuperiors() - { - return afterIsInsideOfMaterialSuperiors; - } - - public String[] getAfterIsInsideOfMaterialInferiors() - { - return afterIsInsideOfMaterialInferiors; - } - - public void setBeforeIsInsideOfMaterialSuperiors(String[] value) - { - beforeIsInsideOfMaterialSuperiors = value; - } - - public void setBeforeIsInsideOfMaterialInferiors(String[] value) - { - beforeIsInsideOfMaterialInferiors = value; - } - - public void setOverrideIsInsideOfMaterialSuperiors(String[] value) - { - overrideIsInsideOfMaterialSuperiors = value; - } - - public void setOverrideIsInsideOfMaterialInferiors(String[] value) - { - overrideIsInsideOfMaterialInferiors = value; - } - - public void setAfterIsInsideOfMaterialSuperiors(String[] value) - { - afterIsInsideOfMaterialSuperiors = value; - } - - public void setAfterIsInsideOfMaterialInferiors(String[] value) - { - afterIsInsideOfMaterialInferiors = value; - } - - public String[] getBeforeIsOnLadderSuperiors() - { - return beforeIsOnLadderSuperiors; - } - - public String[] getBeforeIsOnLadderInferiors() - { - return beforeIsOnLadderInferiors; - } - - public String[] getOverrideIsOnLadderSuperiors() - { - return overrideIsOnLadderSuperiors; - } - - public String[] getOverrideIsOnLadderInferiors() - { - return overrideIsOnLadderInferiors; - } - - public String[] getAfterIsOnLadderSuperiors() - { - return afterIsOnLadderSuperiors; - } - - public String[] getAfterIsOnLadderInferiors() - { - return afterIsOnLadderInferiors; - } - - public void setBeforeIsOnLadderSuperiors(String[] value) - { - beforeIsOnLadderSuperiors = value; - } - - public void setBeforeIsOnLadderInferiors(String[] value) - { - beforeIsOnLadderInferiors = value; - } - - public void setOverrideIsOnLadderSuperiors(String[] value) - { - overrideIsOnLadderSuperiors = value; - } - - public void setOverrideIsOnLadderInferiors(String[] value) - { - overrideIsOnLadderInferiors = value; - } - - public void setAfterIsOnLadderSuperiors(String[] value) - { - afterIsOnLadderSuperiors = value; - } - - public void setAfterIsOnLadderInferiors(String[] value) - { - afterIsOnLadderInferiors = value; - } - - public String[] getBeforeIsPlayerSleepingSuperiors() - { - return beforeIsPlayerSleepingSuperiors; - } - - public String[] getBeforeIsPlayerSleepingInferiors() - { - return beforeIsPlayerSleepingInferiors; - } - - public String[] getOverrideIsPlayerSleepingSuperiors() - { - return overrideIsPlayerSleepingSuperiors; - } - - public String[] getOverrideIsPlayerSleepingInferiors() - { - return overrideIsPlayerSleepingInferiors; - } - - public String[] getAfterIsPlayerSleepingSuperiors() - { - return afterIsPlayerSleepingSuperiors; - } - - public String[] getAfterIsPlayerSleepingInferiors() - { - return afterIsPlayerSleepingInferiors; - } - - public void setBeforeIsPlayerSleepingSuperiors(String[] value) - { - beforeIsPlayerSleepingSuperiors = value; - } - - public void setBeforeIsPlayerSleepingInferiors(String[] value) - { - beforeIsPlayerSleepingInferiors = value; - } - - public void setOverrideIsPlayerSleepingSuperiors(String[] value) - { - overrideIsPlayerSleepingSuperiors = value; - } - - public void setOverrideIsPlayerSleepingInferiors(String[] value) - { - overrideIsPlayerSleepingInferiors = value; - } - - public void setAfterIsPlayerSleepingSuperiors(String[] value) - { - afterIsPlayerSleepingSuperiors = value; - } - - public void setAfterIsPlayerSleepingInferiors(String[] value) - { - afterIsPlayerSleepingInferiors = value; - } - - public String[] getBeforeIsSneakingSuperiors() - { - return beforeIsSneakingSuperiors; - } - - public String[] getBeforeIsSneakingInferiors() - { - return beforeIsSneakingInferiors; - } - - public String[] getOverrideIsSneakingSuperiors() - { - return overrideIsSneakingSuperiors; - } - - public String[] getOverrideIsSneakingInferiors() - { - return overrideIsSneakingInferiors; - } - - public String[] getAfterIsSneakingSuperiors() - { - return afterIsSneakingSuperiors; - } - - public String[] getAfterIsSneakingInferiors() - { - return afterIsSneakingInferiors; - } - - public void setBeforeIsSneakingSuperiors(String[] value) - { - beforeIsSneakingSuperiors = value; - } - - public void setBeforeIsSneakingInferiors(String[] value) - { - beforeIsSneakingInferiors = value; - } - - public void setOverrideIsSneakingSuperiors(String[] value) - { - overrideIsSneakingSuperiors = value; - } - - public void setOverrideIsSneakingInferiors(String[] value) - { - overrideIsSneakingInferiors = value; - } - - public void setAfterIsSneakingSuperiors(String[] value) - { - afterIsSneakingSuperiors = value; - } - - public void setAfterIsSneakingInferiors(String[] value) - { - afterIsSneakingInferiors = value; - } - - public String[] getBeforeIsSprintingSuperiors() - { - return beforeIsSprintingSuperiors; - } - - public String[] getBeforeIsSprintingInferiors() - { - return beforeIsSprintingInferiors; - } - - public String[] getOverrideIsSprintingSuperiors() - { - return overrideIsSprintingSuperiors; - } - - public String[] getOverrideIsSprintingInferiors() - { - return overrideIsSprintingInferiors; - } - - public String[] getAfterIsSprintingSuperiors() - { - return afterIsSprintingSuperiors; - } - - public String[] getAfterIsSprintingInferiors() - { - return afterIsSprintingInferiors; - } - - public void setBeforeIsSprintingSuperiors(String[] value) - { - beforeIsSprintingSuperiors = value; - } - - public void setBeforeIsSprintingInferiors(String[] value) - { - beforeIsSprintingInferiors = value; - } - - public void setOverrideIsSprintingSuperiors(String[] value) - { - overrideIsSprintingSuperiors = value; - } - - public void setOverrideIsSprintingInferiors(String[] value) - { - overrideIsSprintingInferiors = value; - } - - public void setAfterIsSprintingSuperiors(String[] value) - { - afterIsSprintingSuperiors = value; - } - - public void setAfterIsSprintingInferiors(String[] value) - { - afterIsSprintingInferiors = value; - } - - public String[] getBeforeJumpSuperiors() - { - return beforeJumpSuperiors; - } - - public String[] getBeforeJumpInferiors() - { - return beforeJumpInferiors; - } - - public String[] getOverrideJumpSuperiors() - { - return overrideJumpSuperiors; - } - - public String[] getOverrideJumpInferiors() - { - return overrideJumpInferiors; - } - - public String[] getAfterJumpSuperiors() - { - return afterJumpSuperiors; - } - - public String[] getAfterJumpInferiors() - { - return afterJumpInferiors; - } - - public void setBeforeJumpSuperiors(String[] value) - { - beforeJumpSuperiors = value; - } - - public void setBeforeJumpInferiors(String[] value) - { - beforeJumpInferiors = value; - } - - public void setOverrideJumpSuperiors(String[] value) - { - overrideJumpSuperiors = value; - } - - public void setOverrideJumpInferiors(String[] value) - { - overrideJumpInferiors = value; - } - - public void setAfterJumpSuperiors(String[] value) - { - afterJumpSuperiors = value; - } - - public void setAfterJumpInferiors(String[] value) - { - afterJumpInferiors = value; - } - - public String[] getBeforeKnockBackSuperiors() - { - return beforeKnockBackSuperiors; - } - - public String[] getBeforeKnockBackInferiors() - { - return beforeKnockBackInferiors; - } - - public String[] getOverrideKnockBackSuperiors() - { - return overrideKnockBackSuperiors; - } - - public String[] getOverrideKnockBackInferiors() - { - return overrideKnockBackInferiors; - } - - public String[] getAfterKnockBackSuperiors() - { - return afterKnockBackSuperiors; - } - - public String[] getAfterKnockBackInferiors() - { - return afterKnockBackInferiors; - } - - public void setBeforeKnockBackSuperiors(String[] value) - { - beforeKnockBackSuperiors = value; - } - - public void setBeforeKnockBackInferiors(String[] value) - { - beforeKnockBackInferiors = value; - } - - public void setOverrideKnockBackSuperiors(String[] value) - { - overrideKnockBackSuperiors = value; - } - - public void setOverrideKnockBackInferiors(String[] value) - { - overrideKnockBackInferiors = value; - } - - public void setAfterKnockBackSuperiors(String[] value) - { - afterKnockBackSuperiors = value; - } - - public void setAfterKnockBackInferiors(String[] value) - { - afterKnockBackInferiors = value; - } - - public String[] getBeforeMoveEntitySuperiors() - { - return beforeMoveEntitySuperiors; - } - - public String[] getBeforeMoveEntityInferiors() - { - return beforeMoveEntityInferiors; - } - - public String[] getOverrideMoveEntitySuperiors() - { - return overrideMoveEntitySuperiors; - } - - public String[] getOverrideMoveEntityInferiors() - { - return overrideMoveEntityInferiors; - } - - public String[] getAfterMoveEntitySuperiors() - { - return afterMoveEntitySuperiors; - } - - public String[] getAfterMoveEntityInferiors() - { - return afterMoveEntityInferiors; - } - - public void setBeforeMoveEntitySuperiors(String[] value) - { - beforeMoveEntitySuperiors = value; - } - - public void setBeforeMoveEntityInferiors(String[] value) - { - beforeMoveEntityInferiors = value; - } - - public void setOverrideMoveEntitySuperiors(String[] value) - { - overrideMoveEntitySuperiors = value; - } - - public void setOverrideMoveEntityInferiors(String[] value) - { - overrideMoveEntityInferiors = value; - } - - public void setAfterMoveEntitySuperiors(String[] value) - { - afterMoveEntitySuperiors = value; - } - - public void setAfterMoveEntityInferiors(String[] value) - { - afterMoveEntityInferiors = value; - } - - public String[] getBeforeMoveEntityWithHeadingSuperiors() - { - return beforeMoveEntityWithHeadingSuperiors; - } - - public String[] getBeforeMoveEntityWithHeadingInferiors() - { - return beforeMoveEntityWithHeadingInferiors; - } - - public String[] getOverrideMoveEntityWithHeadingSuperiors() - { - return overrideMoveEntityWithHeadingSuperiors; - } - - public String[] getOverrideMoveEntityWithHeadingInferiors() - { - return overrideMoveEntityWithHeadingInferiors; - } - - public String[] getAfterMoveEntityWithHeadingSuperiors() - { - return afterMoveEntityWithHeadingSuperiors; - } - - public String[] getAfterMoveEntityWithHeadingInferiors() - { - return afterMoveEntityWithHeadingInferiors; - } - - public void setBeforeMoveEntityWithHeadingSuperiors(String[] value) - { - beforeMoveEntityWithHeadingSuperiors = value; - } - - public void setBeforeMoveEntityWithHeadingInferiors(String[] value) - { - beforeMoveEntityWithHeadingInferiors = value; - } - - public void setOverrideMoveEntityWithHeadingSuperiors(String[] value) - { - overrideMoveEntityWithHeadingSuperiors = value; - } - - public void setOverrideMoveEntityWithHeadingInferiors(String[] value) - { - overrideMoveEntityWithHeadingInferiors = value; - } - - public void setAfterMoveEntityWithHeadingSuperiors(String[] value) - { - afterMoveEntityWithHeadingSuperiors = value; - } - - public void setAfterMoveEntityWithHeadingInferiors(String[] value) - { - afterMoveEntityWithHeadingInferiors = value; - } - - public String[] getBeforeMoveFlyingSuperiors() - { - return beforeMoveFlyingSuperiors; - } - - public String[] getBeforeMoveFlyingInferiors() - { - return beforeMoveFlyingInferiors; - } - - public String[] getOverrideMoveFlyingSuperiors() - { - return overrideMoveFlyingSuperiors; - } - - public String[] getOverrideMoveFlyingInferiors() - { - return overrideMoveFlyingInferiors; - } - - public String[] getAfterMoveFlyingSuperiors() - { - return afterMoveFlyingSuperiors; - } - - public String[] getAfterMoveFlyingInferiors() - { - return afterMoveFlyingInferiors; - } - - public void setBeforeMoveFlyingSuperiors(String[] value) - { - beforeMoveFlyingSuperiors = value; - } - - public void setBeforeMoveFlyingInferiors(String[] value) - { - beforeMoveFlyingInferiors = value; - } - - public void setOverrideMoveFlyingSuperiors(String[] value) - { - overrideMoveFlyingSuperiors = value; - } - - public void setOverrideMoveFlyingInferiors(String[] value) - { - overrideMoveFlyingInferiors = value; - } - - public void setAfterMoveFlyingSuperiors(String[] value) - { - afterMoveFlyingSuperiors = value; - } - - public void setAfterMoveFlyingInferiors(String[] value) - { - afterMoveFlyingInferiors = value; - } - - public String[] getBeforeOnDeathSuperiors() - { - return beforeOnDeathSuperiors; - } - - public String[] getBeforeOnDeathInferiors() - { - return beforeOnDeathInferiors; - } - - public String[] getOverrideOnDeathSuperiors() - { - return overrideOnDeathSuperiors; - } - - public String[] getOverrideOnDeathInferiors() - { - return overrideOnDeathInferiors; - } - - public String[] getAfterOnDeathSuperiors() - { - return afterOnDeathSuperiors; - } - - public String[] getAfterOnDeathInferiors() - { - return afterOnDeathInferiors; - } - - public void setBeforeOnDeathSuperiors(String[] value) - { - beforeOnDeathSuperiors = value; - } - - public void setBeforeOnDeathInferiors(String[] value) - { - beforeOnDeathInferiors = value; - } - - public void setOverrideOnDeathSuperiors(String[] value) - { - overrideOnDeathSuperiors = value; - } - - public void setOverrideOnDeathInferiors(String[] value) - { - overrideOnDeathInferiors = value; - } - - public void setAfterOnDeathSuperiors(String[] value) - { - afterOnDeathSuperiors = value; - } - - public void setAfterOnDeathInferiors(String[] value) - { - afterOnDeathInferiors = value; - } - - public String[] getBeforeOnLivingUpdateSuperiors() - { - return beforeOnLivingUpdateSuperiors; - } - - public String[] getBeforeOnLivingUpdateInferiors() - { - return beforeOnLivingUpdateInferiors; - } - - public String[] getOverrideOnLivingUpdateSuperiors() - { - return overrideOnLivingUpdateSuperiors; - } - - public String[] getOverrideOnLivingUpdateInferiors() - { - return overrideOnLivingUpdateInferiors; - } - - public String[] getAfterOnLivingUpdateSuperiors() - { - return afterOnLivingUpdateSuperiors; - } - - public String[] getAfterOnLivingUpdateInferiors() - { - return afterOnLivingUpdateInferiors; - } - - public void setBeforeOnLivingUpdateSuperiors(String[] value) - { - beforeOnLivingUpdateSuperiors = value; - } - - public void setBeforeOnLivingUpdateInferiors(String[] value) - { - beforeOnLivingUpdateInferiors = value; - } - - public void setOverrideOnLivingUpdateSuperiors(String[] value) - { - overrideOnLivingUpdateSuperiors = value; - } - - public void setOverrideOnLivingUpdateInferiors(String[] value) - { - overrideOnLivingUpdateInferiors = value; - } - - public void setAfterOnLivingUpdateSuperiors(String[] value) - { - afterOnLivingUpdateSuperiors = value; - } - - public void setAfterOnLivingUpdateInferiors(String[] value) - { - afterOnLivingUpdateInferiors = value; - } - - public String[] getBeforeOnKillEntitySuperiors() - { - return beforeOnKillEntitySuperiors; - } - - public String[] getBeforeOnKillEntityInferiors() - { - return beforeOnKillEntityInferiors; - } - - public String[] getOverrideOnKillEntitySuperiors() - { - return overrideOnKillEntitySuperiors; - } - - public String[] getOverrideOnKillEntityInferiors() - { - return overrideOnKillEntityInferiors; - } - - public String[] getAfterOnKillEntitySuperiors() - { - return afterOnKillEntitySuperiors; - } - - public String[] getAfterOnKillEntityInferiors() - { - return afterOnKillEntityInferiors; - } - - public void setBeforeOnKillEntitySuperiors(String[] value) - { - beforeOnKillEntitySuperiors = value; - } - - public void setBeforeOnKillEntityInferiors(String[] value) - { - beforeOnKillEntityInferiors = value; - } - - public void setOverrideOnKillEntitySuperiors(String[] value) - { - overrideOnKillEntitySuperiors = value; - } - - public void setOverrideOnKillEntityInferiors(String[] value) - { - overrideOnKillEntityInferiors = value; - } - - public void setAfterOnKillEntitySuperiors(String[] value) - { - afterOnKillEntitySuperiors = value; - } - - public void setAfterOnKillEntityInferiors(String[] value) - { - afterOnKillEntityInferiors = value; - } - - public String[] getBeforeOnStruckByLightningSuperiors() - { - return beforeOnStruckByLightningSuperiors; - } - - public String[] getBeforeOnStruckByLightningInferiors() - { - return beforeOnStruckByLightningInferiors; - } - - public String[] getOverrideOnStruckByLightningSuperiors() - { - return overrideOnStruckByLightningSuperiors; - } - - public String[] getOverrideOnStruckByLightningInferiors() - { - return overrideOnStruckByLightningInferiors; - } - - public String[] getAfterOnStruckByLightningSuperiors() - { - return afterOnStruckByLightningSuperiors; - } - - public String[] getAfterOnStruckByLightningInferiors() - { - return afterOnStruckByLightningInferiors; - } - - public void setBeforeOnStruckByLightningSuperiors(String[] value) - { - beforeOnStruckByLightningSuperiors = value; - } - - public void setBeforeOnStruckByLightningInferiors(String[] value) - { - beforeOnStruckByLightningInferiors = value; - } - - public void setOverrideOnStruckByLightningSuperiors(String[] value) - { - overrideOnStruckByLightningSuperiors = value; - } - - public void setOverrideOnStruckByLightningInferiors(String[] value) - { - overrideOnStruckByLightningInferiors = value; - } - - public void setAfterOnStruckByLightningSuperiors(String[] value) - { - afterOnStruckByLightningSuperiors = value; - } - - public void setAfterOnStruckByLightningInferiors(String[] value) - { - afterOnStruckByLightningInferiors = value; - } - - public String[] getBeforeOnUpdateSuperiors() - { - return beforeOnUpdateSuperiors; - } - - public String[] getBeforeOnUpdateInferiors() - { - return beforeOnUpdateInferiors; - } - - public String[] getOverrideOnUpdateSuperiors() - { - return overrideOnUpdateSuperiors; - } - - public String[] getOverrideOnUpdateInferiors() - { - return overrideOnUpdateInferiors; - } - - public String[] getAfterOnUpdateSuperiors() - { - return afterOnUpdateSuperiors; - } - - public String[] getAfterOnUpdateInferiors() - { - return afterOnUpdateInferiors; - } - - public void setBeforeOnUpdateSuperiors(String[] value) - { - beforeOnUpdateSuperiors = value; - } - - public void setBeforeOnUpdateInferiors(String[] value) - { - beforeOnUpdateInferiors = value; - } - - public void setOverrideOnUpdateSuperiors(String[] value) - { - overrideOnUpdateSuperiors = value; - } - - public void setOverrideOnUpdateInferiors(String[] value) - { - overrideOnUpdateInferiors = value; - } - - public void setAfterOnUpdateSuperiors(String[] value) - { - afterOnUpdateSuperiors = value; - } - - public void setAfterOnUpdateInferiors(String[] value) - { - afterOnUpdateInferiors = value; - } - - public String[] getBeforePlayStepSoundSuperiors() - { - return beforePlayStepSoundSuperiors; - } - - public String[] getBeforePlayStepSoundInferiors() - { - return beforePlayStepSoundInferiors; - } - - public String[] getOverridePlayStepSoundSuperiors() - { - return overridePlayStepSoundSuperiors; - } - - public String[] getOverridePlayStepSoundInferiors() - { - return overridePlayStepSoundInferiors; - } - - public String[] getAfterPlayStepSoundSuperiors() - { - return afterPlayStepSoundSuperiors; - } - - public String[] getAfterPlayStepSoundInferiors() - { - return afterPlayStepSoundInferiors; - } - - public void setBeforePlayStepSoundSuperiors(String[] value) - { - beforePlayStepSoundSuperiors = value; - } - - public void setBeforePlayStepSoundInferiors(String[] value) - { - beforePlayStepSoundInferiors = value; - } - - public void setOverridePlayStepSoundSuperiors(String[] value) - { - overridePlayStepSoundSuperiors = value; - } - - public void setOverridePlayStepSoundInferiors(String[] value) - { - overridePlayStepSoundInferiors = value; - } - - public void setAfterPlayStepSoundSuperiors(String[] value) - { - afterPlayStepSoundSuperiors = value; - } - - public void setAfterPlayStepSoundInferiors(String[] value) - { - afterPlayStepSoundInferiors = value; - } - - public String[] getBeforePushOutOfBlocksSuperiors() - { - return beforePushOutOfBlocksSuperiors; - } - - public String[] getBeforePushOutOfBlocksInferiors() - { - return beforePushOutOfBlocksInferiors; - } - - public String[] getOverridePushOutOfBlocksSuperiors() - { - return overridePushOutOfBlocksSuperiors; - } - - public String[] getOverridePushOutOfBlocksInferiors() - { - return overridePushOutOfBlocksInferiors; - } - - public String[] getAfterPushOutOfBlocksSuperiors() - { - return afterPushOutOfBlocksSuperiors; - } - - public String[] getAfterPushOutOfBlocksInferiors() - { - return afterPushOutOfBlocksInferiors; - } - - public void setBeforePushOutOfBlocksSuperiors(String[] value) - { - beforePushOutOfBlocksSuperiors = value; - } - - public void setBeforePushOutOfBlocksInferiors(String[] value) - { - beforePushOutOfBlocksInferiors = value; - } - - public void setOverridePushOutOfBlocksSuperiors(String[] value) - { - overridePushOutOfBlocksSuperiors = value; - } - - public void setOverridePushOutOfBlocksInferiors(String[] value) - { - overridePushOutOfBlocksInferiors = value; - } - - public void setAfterPushOutOfBlocksSuperiors(String[] value) - { - afterPushOutOfBlocksSuperiors = value; - } - - public void setAfterPushOutOfBlocksInferiors(String[] value) - { - afterPushOutOfBlocksInferiors = value; - } - - public String[] getBeforeRayTraceSuperiors() - { - return beforeRayTraceSuperiors; - } - - public String[] getBeforeRayTraceInferiors() - { - return beforeRayTraceInferiors; - } - - public String[] getOverrideRayTraceSuperiors() - { - return overrideRayTraceSuperiors; - } - - public String[] getOverrideRayTraceInferiors() - { - return overrideRayTraceInferiors; - } - - public String[] getAfterRayTraceSuperiors() - { - return afterRayTraceSuperiors; - } - - public String[] getAfterRayTraceInferiors() - { - return afterRayTraceInferiors; - } - - public void setBeforeRayTraceSuperiors(String[] value) - { - beforeRayTraceSuperiors = value; - } - - public void setBeforeRayTraceInferiors(String[] value) - { - beforeRayTraceInferiors = value; - } - - public void setOverrideRayTraceSuperiors(String[] value) - { - overrideRayTraceSuperiors = value; - } - - public void setOverrideRayTraceInferiors(String[] value) - { - overrideRayTraceInferiors = value; - } - - public void setAfterRayTraceSuperiors(String[] value) - { - afterRayTraceSuperiors = value; - } - - public void setAfterRayTraceInferiors(String[] value) - { - afterRayTraceInferiors = value; - } - - public String[] getBeforeReadEntityFromNBTSuperiors() - { - return beforeReadEntityFromNBTSuperiors; - } - - public String[] getBeforeReadEntityFromNBTInferiors() - { - return beforeReadEntityFromNBTInferiors; - } - - public String[] getOverrideReadEntityFromNBTSuperiors() - { - return overrideReadEntityFromNBTSuperiors; - } - - public String[] getOverrideReadEntityFromNBTInferiors() - { - return overrideReadEntityFromNBTInferiors; - } - - public String[] getAfterReadEntityFromNBTSuperiors() - { - return afterReadEntityFromNBTSuperiors; - } - - public String[] getAfterReadEntityFromNBTInferiors() - { - return afterReadEntityFromNBTInferiors; - } - - public void setBeforeReadEntityFromNBTSuperiors(String[] value) - { - beforeReadEntityFromNBTSuperiors = value; - } - - public void setBeforeReadEntityFromNBTInferiors(String[] value) - { - beforeReadEntityFromNBTInferiors = value; - } - - public void setOverrideReadEntityFromNBTSuperiors(String[] value) - { - overrideReadEntityFromNBTSuperiors = value; - } - - public void setOverrideReadEntityFromNBTInferiors(String[] value) - { - overrideReadEntityFromNBTInferiors = value; - } - - public void setAfterReadEntityFromNBTSuperiors(String[] value) - { - afterReadEntityFromNBTSuperiors = value; - } - - public void setAfterReadEntityFromNBTInferiors(String[] value) - { - afterReadEntityFromNBTInferiors = value; - } - - public String[] getBeforeRespawnPlayerSuperiors() - { - return beforeRespawnPlayerSuperiors; - } - - public String[] getBeforeRespawnPlayerInferiors() - { - return beforeRespawnPlayerInferiors; - } - - public String[] getOverrideRespawnPlayerSuperiors() - { - return overrideRespawnPlayerSuperiors; - } - - public String[] getOverrideRespawnPlayerInferiors() - { - return overrideRespawnPlayerInferiors; - } - - public String[] getAfterRespawnPlayerSuperiors() - { - return afterRespawnPlayerSuperiors; - } - - public String[] getAfterRespawnPlayerInferiors() - { - return afterRespawnPlayerInferiors; - } - - public void setBeforeRespawnPlayerSuperiors(String[] value) - { - beforeRespawnPlayerSuperiors = value; - } - - public void setBeforeRespawnPlayerInferiors(String[] value) - { - beforeRespawnPlayerInferiors = value; - } - - public void setOverrideRespawnPlayerSuperiors(String[] value) - { - overrideRespawnPlayerSuperiors = value; - } - - public void setOverrideRespawnPlayerInferiors(String[] value) - { - overrideRespawnPlayerInferiors = value; - } - - public void setAfterRespawnPlayerSuperiors(String[] value) - { - afterRespawnPlayerSuperiors = value; - } - - public void setAfterRespawnPlayerInferiors(String[] value) - { - afterRespawnPlayerInferiors = value; - } - - public String[] getBeforeSetDeadSuperiors() - { - return beforeSetDeadSuperiors; - } - - public String[] getBeforeSetDeadInferiors() - { - return beforeSetDeadInferiors; - } - - public String[] getOverrideSetDeadSuperiors() - { - return overrideSetDeadSuperiors; - } - - public String[] getOverrideSetDeadInferiors() - { - return overrideSetDeadInferiors; - } - - public String[] getAfterSetDeadSuperiors() - { - return afterSetDeadSuperiors; - } - - public String[] getAfterSetDeadInferiors() - { - return afterSetDeadInferiors; - } - - public void setBeforeSetDeadSuperiors(String[] value) - { - beforeSetDeadSuperiors = value; - } - - public void setBeforeSetDeadInferiors(String[] value) - { - beforeSetDeadInferiors = value; - } - - public void setOverrideSetDeadSuperiors(String[] value) - { - overrideSetDeadSuperiors = value; - } - - public void setOverrideSetDeadInferiors(String[] value) - { - overrideSetDeadInferiors = value; - } - - public void setAfterSetDeadSuperiors(String[] value) - { - afterSetDeadSuperiors = value; - } - - public void setAfterSetDeadInferiors(String[] value) - { - afterSetDeadInferiors = value; - } - - public String[] getBeforeSetPlayerSPHealthSuperiors() - { - return beforeSetPlayerSPHealthSuperiors; - } - - public String[] getBeforeSetPlayerSPHealthInferiors() - { - return beforeSetPlayerSPHealthInferiors; - } - - public String[] getOverrideSetPlayerSPHealthSuperiors() - { - return overrideSetPlayerSPHealthSuperiors; - } - - public String[] getOverrideSetPlayerSPHealthInferiors() - { - return overrideSetPlayerSPHealthInferiors; - } - - public String[] getAfterSetPlayerSPHealthSuperiors() - { - return afterSetPlayerSPHealthSuperiors; - } - - public String[] getAfterSetPlayerSPHealthInferiors() - { - return afterSetPlayerSPHealthInferiors; - } - - public void setBeforeSetPlayerSPHealthSuperiors(String[] value) - { - beforeSetPlayerSPHealthSuperiors = value; - } - - public void setBeforeSetPlayerSPHealthInferiors(String[] value) - { - beforeSetPlayerSPHealthInferiors = value; - } - - public void setOverrideSetPlayerSPHealthSuperiors(String[] value) - { - overrideSetPlayerSPHealthSuperiors = value; - } - - public void setOverrideSetPlayerSPHealthInferiors(String[] value) - { - overrideSetPlayerSPHealthInferiors = value; - } - - public void setAfterSetPlayerSPHealthSuperiors(String[] value) - { - afterSetPlayerSPHealthSuperiors = value; - } - - public void setAfterSetPlayerSPHealthInferiors(String[] value) - { - afterSetPlayerSPHealthInferiors = value; - } - - public String[] getBeforeSetPositionAndRotationSuperiors() - { - return beforeSetPositionAndRotationSuperiors; - } - - public String[] getBeforeSetPositionAndRotationInferiors() - { - return beforeSetPositionAndRotationInferiors; - } - - public String[] getOverrideSetPositionAndRotationSuperiors() - { - return overrideSetPositionAndRotationSuperiors; - } - - public String[] getOverrideSetPositionAndRotationInferiors() - { - return overrideSetPositionAndRotationInferiors; - } - - public String[] getAfterSetPositionAndRotationSuperiors() - { - return afterSetPositionAndRotationSuperiors; - } - - public String[] getAfterSetPositionAndRotationInferiors() - { - return afterSetPositionAndRotationInferiors; - } - - public void setBeforeSetPositionAndRotationSuperiors(String[] value) - { - beforeSetPositionAndRotationSuperiors = value; - } - - public void setBeforeSetPositionAndRotationInferiors(String[] value) - { - beforeSetPositionAndRotationInferiors = value; - } - - public void setOverrideSetPositionAndRotationSuperiors(String[] value) - { - overrideSetPositionAndRotationSuperiors = value; - } - - public void setOverrideSetPositionAndRotationInferiors(String[] value) - { - overrideSetPositionAndRotationInferiors = value; - } - - public void setAfterSetPositionAndRotationSuperiors(String[] value) - { - afterSetPositionAndRotationSuperiors = value; - } - - public void setAfterSetPositionAndRotationInferiors(String[] value) - { - afterSetPositionAndRotationInferiors = value; - } - - public String[] getBeforeSetSneakingSuperiors() - { - return beforeSetSneakingSuperiors; - } - - public String[] getBeforeSetSneakingInferiors() - { - return beforeSetSneakingInferiors; - } - - public String[] getOverrideSetSneakingSuperiors() - { - return overrideSetSneakingSuperiors; - } - - public String[] getOverrideSetSneakingInferiors() - { - return overrideSetSneakingInferiors; - } - - public String[] getAfterSetSneakingSuperiors() - { - return afterSetSneakingSuperiors; - } - - public String[] getAfterSetSneakingInferiors() - { - return afterSetSneakingInferiors; - } - - public void setBeforeSetSneakingSuperiors(String[] value) - { - beforeSetSneakingSuperiors = value; - } - - public void setBeforeSetSneakingInferiors(String[] value) - { - beforeSetSneakingInferiors = value; - } - - public void setOverrideSetSneakingSuperiors(String[] value) - { - overrideSetSneakingSuperiors = value; - } - - public void setOverrideSetSneakingInferiors(String[] value) - { - overrideSetSneakingInferiors = value; - } - - public void setAfterSetSneakingSuperiors(String[] value) - { - afterSetSneakingSuperiors = value; - } - - public void setAfterSetSneakingInferiors(String[] value) - { - afterSetSneakingInferiors = value; - } - - public String[] getBeforeSetSprintingSuperiors() - { - return beforeSetSprintingSuperiors; - } - - public String[] getBeforeSetSprintingInferiors() - { - return beforeSetSprintingInferiors; - } - - public String[] getOverrideSetSprintingSuperiors() - { - return overrideSetSprintingSuperiors; - } - - public String[] getOverrideSetSprintingInferiors() - { - return overrideSetSprintingInferiors; - } - - public String[] getAfterSetSprintingSuperiors() - { - return afterSetSprintingSuperiors; - } - - public String[] getAfterSetSprintingInferiors() - { - return afterSetSprintingInferiors; - } - - public void setBeforeSetSprintingSuperiors(String[] value) - { - beforeSetSprintingSuperiors = value; - } - - public void setBeforeSetSprintingInferiors(String[] value) - { - beforeSetSprintingInferiors = value; - } - - public void setOverrideSetSprintingSuperiors(String[] value) - { - overrideSetSprintingSuperiors = value; - } - - public void setOverrideSetSprintingInferiors(String[] value) - { - overrideSetSprintingInferiors = value; - } - - public void setAfterSetSprintingSuperiors(String[] value) - { - afterSetSprintingSuperiors = value; - } - - public void setAfterSetSprintingInferiors(String[] value) - { - afterSetSprintingInferiors = value; - } - - public String[] getBeforeTrySleepSuperiors() - { - return beforeTrySleepSuperiors; - } - - public String[] getBeforeTrySleepInferiors() - { - return beforeTrySleepInferiors; - } - - public String[] getOverrideTrySleepSuperiors() - { - return overrideTrySleepSuperiors; - } - - public String[] getOverrideTrySleepInferiors() - { - return overrideTrySleepInferiors; - } - - public String[] getAfterTrySleepSuperiors() - { - return afterTrySleepSuperiors; - } - - public String[] getAfterTrySleepInferiors() - { - return afterTrySleepInferiors; - } - - public void setBeforeTrySleepSuperiors(String[] value) - { - beforeTrySleepSuperiors = value; - } - - public void setBeforeTrySleepInferiors(String[] value) - { - beforeTrySleepInferiors = value; - } - - public void setOverrideTrySleepSuperiors(String[] value) - { - overrideTrySleepSuperiors = value; - } - - public void setOverrideTrySleepInferiors(String[] value) - { - overrideTrySleepInferiors = value; - } - - public void setAfterTrySleepSuperiors(String[] value) - { - afterTrySleepSuperiors = value; - } - - public void setAfterTrySleepInferiors(String[] value) - { - afterTrySleepInferiors = value; - } - - public String[] getBeforeSwingItemSuperiors() - { - return beforeSwingItemSuperiors; - } - - public String[] getBeforeSwingItemInferiors() - { - return beforeSwingItemInferiors; - } - - public String[] getOverrideSwingItemSuperiors() - { - return overrideSwingItemSuperiors; - } - - public String[] getOverrideSwingItemInferiors() - { - return overrideSwingItemInferiors; - } - - public String[] getAfterSwingItemSuperiors() - { - return afterSwingItemSuperiors; - } - - public String[] getAfterSwingItemInferiors() - { - return afterSwingItemInferiors; - } - - public void setBeforeSwingItemSuperiors(String[] value) - { - beforeSwingItemSuperiors = value; - } - - public void setBeforeSwingItemInferiors(String[] value) - { - beforeSwingItemInferiors = value; - } - - public void setOverrideSwingItemSuperiors(String[] value) - { - overrideSwingItemSuperiors = value; - } - - public void setOverrideSwingItemInferiors(String[] value) - { - overrideSwingItemInferiors = value; - } - - public void setAfterSwingItemSuperiors(String[] value) - { - afterSwingItemSuperiors = value; - } - - public void setAfterSwingItemInferiors(String[] value) - { - afterSwingItemInferiors = value; - } - - public String[] getBeforeUpdateEntityActionStateSuperiors() - { - return beforeUpdateEntityActionStateSuperiors; - } - - public String[] getBeforeUpdateEntityActionStateInferiors() - { - return beforeUpdateEntityActionStateInferiors; - } - - public String[] getOverrideUpdateEntityActionStateSuperiors() - { - return overrideUpdateEntityActionStateSuperiors; - } - - public String[] getOverrideUpdateEntityActionStateInferiors() - { - return overrideUpdateEntityActionStateInferiors; - } - - public String[] getAfterUpdateEntityActionStateSuperiors() - { - return afterUpdateEntityActionStateSuperiors; - } - - public String[] getAfterUpdateEntityActionStateInferiors() - { - return afterUpdateEntityActionStateInferiors; - } - - public void setBeforeUpdateEntityActionStateSuperiors(String[] value) - { - beforeUpdateEntityActionStateSuperiors = value; - } - - public void setBeforeUpdateEntityActionStateInferiors(String[] value) - { - beforeUpdateEntityActionStateInferiors = value; - } - - public void setOverrideUpdateEntityActionStateSuperiors(String[] value) - { - overrideUpdateEntityActionStateSuperiors = value; - } - - public void setOverrideUpdateEntityActionStateInferiors(String[] value) - { - overrideUpdateEntityActionStateInferiors = value; - } - - public void setAfterUpdateEntityActionStateSuperiors(String[] value) - { - afterUpdateEntityActionStateSuperiors = value; - } - - public void setAfterUpdateEntityActionStateInferiors(String[] value) - { - afterUpdateEntityActionStateInferiors = value; - } - - public String[] getBeforeUpdateRiddenSuperiors() - { - return beforeUpdateRiddenSuperiors; - } - - public String[] getBeforeUpdateRiddenInferiors() - { - return beforeUpdateRiddenInferiors; - } - - public String[] getOverrideUpdateRiddenSuperiors() - { - return overrideUpdateRiddenSuperiors; - } - - public String[] getOverrideUpdateRiddenInferiors() - { - return overrideUpdateRiddenInferiors; - } - - public String[] getAfterUpdateRiddenSuperiors() - { - return afterUpdateRiddenSuperiors; - } - - public String[] getAfterUpdateRiddenInferiors() - { - return afterUpdateRiddenInferiors; - } - - public void setBeforeUpdateRiddenSuperiors(String[] value) - { - beforeUpdateRiddenSuperiors = value; - } - - public void setBeforeUpdateRiddenInferiors(String[] value) - { - beforeUpdateRiddenInferiors = value; - } - - public void setOverrideUpdateRiddenSuperiors(String[] value) - { - overrideUpdateRiddenSuperiors = value; - } - - public void setOverrideUpdateRiddenInferiors(String[] value) - { - overrideUpdateRiddenInferiors = value; - } - - public void setAfterUpdateRiddenSuperiors(String[] value) - { - afterUpdateRiddenSuperiors = value; - } - - public void setAfterUpdateRiddenInferiors(String[] value) - { - afterUpdateRiddenInferiors = value; - } - - public String[] getBeforeWakeUpPlayerSuperiors() - { - return beforeWakeUpPlayerSuperiors; - } - - public String[] getBeforeWakeUpPlayerInferiors() - { - return beforeWakeUpPlayerInferiors; - } - - public String[] getOverrideWakeUpPlayerSuperiors() - { - return overrideWakeUpPlayerSuperiors; - } - - public String[] getOverrideWakeUpPlayerInferiors() - { - return overrideWakeUpPlayerInferiors; - } - - public String[] getAfterWakeUpPlayerSuperiors() - { - return afterWakeUpPlayerSuperiors; - } - - public String[] getAfterWakeUpPlayerInferiors() - { - return afterWakeUpPlayerInferiors; - } - - public void setBeforeWakeUpPlayerSuperiors(String[] value) - { - beforeWakeUpPlayerSuperiors = value; - } - - public void setBeforeWakeUpPlayerInferiors(String[] value) - { - beforeWakeUpPlayerInferiors = value; - } - - public void setOverrideWakeUpPlayerSuperiors(String[] value) - { - overrideWakeUpPlayerSuperiors = value; - } - - public void setOverrideWakeUpPlayerInferiors(String[] value) - { - overrideWakeUpPlayerInferiors = value; - } - - public void setAfterWakeUpPlayerSuperiors(String[] value) - { - afterWakeUpPlayerSuperiors = value; - } - - public void setAfterWakeUpPlayerInferiors(String[] value) - { - afterWakeUpPlayerInferiors = value; - } - - public String[] getBeforeWriteEntityToNBTSuperiors() - { - return beforeWriteEntityToNBTSuperiors; - } - - public String[] getBeforeWriteEntityToNBTInferiors() - { - return beforeWriteEntityToNBTInferiors; - } - - public String[] getOverrideWriteEntityToNBTSuperiors() - { - return overrideWriteEntityToNBTSuperiors; - } - - public String[] getOverrideWriteEntityToNBTInferiors() - { - return overrideWriteEntityToNBTInferiors; - } - - public String[] getAfterWriteEntityToNBTSuperiors() - { - return afterWriteEntityToNBTSuperiors; - } - - public String[] getAfterWriteEntityToNBTInferiors() - { - return afterWriteEntityToNBTInferiors; - } - - public void setBeforeWriteEntityToNBTSuperiors(String[] value) - { - beforeWriteEntityToNBTSuperiors = value; - } - - public void setBeforeWriteEntityToNBTInferiors(String[] value) - { - beforeWriteEntityToNBTInferiors = value; - } - - public void setOverrideWriteEntityToNBTSuperiors(String[] value) - { - overrideWriteEntityToNBTSuperiors = value; - } - - public void setOverrideWriteEntityToNBTInferiors(String[] value) - { - overrideWriteEntityToNBTInferiors = value; - } - - public void setAfterWriteEntityToNBTSuperiors(String[] value) - { - afterWriteEntityToNBTSuperiors = value; - } - - public void setAfterWriteEntityToNBTInferiors(String[] value) - { - afterWriteEntityToNBTInferiors = value; - } - -} diff --git a/dependencies/main/java/api/player/client/ClientPlayerClassVisitor.java b/dependencies/main/java/api/player/client/ClientPlayerClassVisitor.java deleted file mode 100644 index 329a3a19bc..0000000000 --- a/dependencies/main/java/api/player/client/ClientPlayerClassVisitor.java +++ /dev/null @@ -1,5351 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.client; - -import java.io.*; - -import org.objectweb.asm.*; - -public final class ClientPlayerClassVisitor extends ClassVisitor -{ - public static final String targetClassName = "net.minecraft.client.entity.EntityPlayerSP"; - - private boolean hadLocalAddExhaustion; - private boolean hadLocalAddMovementStat; - private boolean hadLocalAddStat; - private boolean hadLocalAttackEntityFrom; - private boolean hadLocalAttackTargetEntityWithCurrentItem; - private boolean hadLocalCanBreatheUnderwater; - private boolean hadLocalCanHarvestBlock; - private boolean hadLocalCanPlayerEdit; - private boolean hadLocalCanTriggerWalking; - private boolean hadLocalCloseScreen; - private boolean hadLocalDamageEntity; - private boolean hadLocalDisplayGui; - private boolean hadLocalDisplayGUIChest; - private boolean hadLocalDropItem; - private boolean hadLocalDropOneItem; - private boolean hadLocalDropPlayerItemWithRandomChoice; - private boolean hadLocalFall; - private boolean hadLocalGetAIMoveSpeed; - private boolean hadLocalGetBedOrientationInDegrees; - private boolean hadLocalGetBrightness; - private boolean hadLocalGetBrightnessForRender; - private boolean hadLocalGetBreakSpeed; - private boolean hadLocalGetDistanceSq; - private boolean hadLocalGetDistanceSqToEntity; - private boolean hadLocalGetFovModifier; - private boolean hadLocalGetHurtSound; - private boolean hadLocalGetName; - private boolean hadLocalGetSleepTimer; - private boolean hadLocalHandleWaterMovement; - private boolean hadLocalHeal; - private boolean hadLocalIsEntityInsideOpaqueBlock; - private boolean hadLocalIsInWater; - private boolean hadLocalIsInsideOfMaterial; - private boolean hadLocalIsOnLadder; - private boolean hadLocalIsPlayerSleeping; - private boolean hadLocalIsSneaking; - private boolean hadLocalIsSprinting; - private boolean hadLocalJump; - private boolean hadLocalKnockBack; - private boolean hadLocalMoveEntity; - private boolean hadLocalMoveEntityWithHeading; - private boolean hadLocalMoveFlying; - private boolean hadLocalOnDeath; - private boolean hadLocalOnLivingUpdate; - private boolean hadLocalOnKillEntity; - private boolean hadLocalOnStruckByLightning; - private boolean hadLocalOnUpdate; - private boolean hadLocalPlayStepSound; - private boolean hadLocalPushOutOfBlocks; - private boolean hadLocalRayTrace; - private boolean hadLocalReadEntityFromNBT; - private boolean hadLocalRespawnPlayer; - private boolean hadLocalSetDead; - private boolean hadLocalSetPlayerSPHealth; - private boolean hadLocalSetPositionAndRotation; - private boolean hadLocalSetSneaking; - private boolean hadLocalSetSprinting; - private boolean hadLocalTrySleep; - private boolean hadLocalSwingItem; - private boolean hadLocalUpdateEntityActionState; - private boolean hadLocalUpdateRidden; - private boolean hadLocalWakeUpPlayer; - private boolean hadLocalWriteEntityToNBT; - - public static byte[] transform(byte[] bytes, boolean isObfuscated) - { - try - { - ByteArrayInputStream in = new ByteArrayInputStream(bytes); - ClassReader cr = new ClassReader(in); - ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); - ClientPlayerClassVisitor p = new ClientPlayerClassVisitor(cw, isObfuscated); - - cr.accept(p, 0); - - byte[] result = cw.toByteArray(); - in.close(); - return result; - } - catch(IOException ioe) - { - throw new RuntimeException(ioe); - } - } - - private final boolean isObfuscated; - - public ClientPlayerClassVisitor(ClassVisitor classVisitor, boolean isObfuscated) - { - super(262144, classVisitor); - this.isObfuscated = isObfuscated; - } - - @Override - public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) - { - String[] newInterfaces = new String[interfaces.length + 1]; - for(int i=0; i")) - return new ClientPlayerConstructorVisitor(super.visitMethod(access, name, desc, signature, exceptions), isObfuscated); - - if(name.equals(isObfuscated ? "a" : "addExhaustion") && desc.equals("(F)V")) - { - hadLocalAddExhaustion = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddExhaustion", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "l" : "addMovementStat") && desc.equals("(DDD)V")) - { - hadLocalAddMovementStat = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddMovementStat", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "addStat") && desc.equals(isObfuscated ? "(Lns;I)V" : "(Lnet/minecraft/stats/StatBase;I)V")) - { - hadLocalAddStat = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddStat", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "attackEntityFrom") && desc.equals(isObfuscated ? "(Lrh;F)Z" : "(Lnet/minecraft/util/DamageSource;F)Z")) - { - hadLocalAttackEntityFrom = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAttackEntityFrom", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "f" : "attackEntityPlayerSPEntityWithCurrentItem") && desc.equals(isObfuscated ? "(Lrw;)V" : "(Lnet/minecraft/entity/Entity;)V")) - { - hadLocalAttackTargetEntityWithCurrentItem = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAttackTargetEntityWithCurrentItem", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "bE" : "canBreatheUnderwater") && desc.equals("()Z")) - { - hadLocalCanBreatheUnderwater = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanBreatheUnderwater", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "b" : "canHarvestBlock") && desc.equals(isObfuscated ? "(Lars;)Z" : "(Lnet/minecraft/block/state/IBlockState;)Z")) - { - hadLocalCanHarvestBlock = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanHarvestBlock", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "canPlayerEdit") && desc.equals(isObfuscated ? "(Lcm;Lct;Ladz;)Z" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z")) - { - hadLocalCanPlayerEdit = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanPlayerEdit", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "af" : "canTriggerWalking") && desc.equals("()Z")) - { - hadLocalCanTriggerWalking = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanTriggerWalking", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "q" : "closeScreen") && desc.equals("()V")) - { - hadLocalCloseScreen = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCloseScreen", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "d" : "damageEntity") && desc.equals(isObfuscated ? "(Lrh;F)V" : "(Lnet/minecraft/util/DamageSource;F)V")) - { - hadLocalDamageEntity = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDamageEntity", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "displayGui") && desc.equals(isObfuscated ? "(Lqs;)V" : "(Lnet/minecraft/world/IInteractionObject;)V")) - { - hadLocalDisplayGui = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDisplayGui", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "displayGUIChest") && desc.equals(isObfuscated ? "(Lql;)V" : "(Lnet/minecraft/inventory/IInventory;)V")) - { - hadLocalDisplayGUIChest = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDisplayGUIChest", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "dropItem") && desc.equals(isObfuscated ? "(Ladz;ZZ)Lyk;" : "(Lnet/minecraft/item/ItemStack;ZZ)Lnet/minecraft/entity/item/EntityItem;")) - { - hadLocalDropItem = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDropItem", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "dropItem") && desc.equals(isObfuscated ? "(Z)Lyk;" : "(Z)Lnet/minecraft/entity/item/EntityItem;")) - { - hadLocalDropOneItem = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDropOneItem", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "dropItem") && desc.equals(isObfuscated ? "(Ladz;Z)Lyk;" : "(Lnet/minecraft/item/ItemStack;Z)Lnet/minecraft/entity/item/EntityItem;")) - { - hadLocalDropPlayerItemWithRandomChoice = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDropPlayerItemWithRandomChoice", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "e" : "fall") && desc.equals("(FF)V")) - { - hadLocalFall = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localFall", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "cp" : "getAIMoveSpeed") && desc.equals("()F")) - { - hadLocalGetAIMoveSpeed = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetAIMoveSpeed", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "cQ" : "getBedOrientationInDegrees") && desc.equals("()F")) - { - hadLocalGetBedOrientationInDegrees = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetBedOrientationInDegrees", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "e" : "getBrightness") && desc.equals("(F)F")) - { - hadLocalGetBrightness = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetBrightness", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "d" : "getBrightnessForRender") && desc.equals("(F)I")) - { - hadLocalGetBrightnessForRender = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetBrightnessForRender", desc, signature, exceptions); - } - - if(name.equals("getDigSpeed") && desc.equals(isObfuscated ? "(Lars;Lcm;)F" : "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F")) - { - hadLocalGetBreakSpeed = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetBreakSpeed", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "e" : "getDistanceSq") && desc.equals("(DDD)D")) - { - hadLocalGetDistanceSq = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetDistanceSq", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "h" : "getDistanceSqToEntity") && desc.equals(isObfuscated ? "(Lrw;)D" : "(Lnet/minecraft/entity/Entity;)D")) - { - hadLocalGetDistanceSqToEntity = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetDistanceSqToEntity", desc, signature, exceptions); - } - - if(name.equals("getFovModifier") && desc.equals("()F")) - { - hadLocalGetFovModifier = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetFovModifier", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "bV" : "getHurtSound") && desc.equals(isObfuscated ? "()Lni;" : "()Lnet/minecraft/util/SoundEvent;")) - { - hadLocalGetHurtSound = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetHurtSound", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "h_" : "getName") && desc.equals("()Ljava/lang/String;")) - { - hadLocalGetName = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetName", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "cS" : "getSleepTimer") && desc.equals("()I")) - { - hadLocalGetSleepTimer = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetSleepTimer", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "ak" : "handleWaterMovement") && desc.equals("()Z")) - { - hadLocalHandleWaterMovement = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localHandleWaterMovement", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "b" : "heal") && desc.equals("(F)V")) - { - hadLocalHeal = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localHeal", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "av" : "isEntityInsideOpaqueBlock") && desc.equals("()Z")) - { - hadLocalIsEntityInsideOpaqueBlock = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsEntityInsideOpaqueBlock", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "aj" : "isInWater") && desc.equals("()Z")) - { - hadLocalIsInWater = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsInWater", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "isInsideOfMaterial") && desc.equals(isObfuscated ? "(Laxx;)Z" : "(Lnet/minecraft/block/material/Material;)Z")) - { - hadLocalIsInsideOfMaterial = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsInsideOfMaterial", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "m_" : "isOnLadder") && desc.equals("()Z")) - { - hadLocalIsOnLadder = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsOnLadder", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "cq" : "isPlayerSleeping") && desc.equals("()Z")) - { - hadLocalIsPlayerSleeping = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsPlayerSleeping", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "aM" : "isSneaking") && desc.equals("()Z")) - { - hadLocalIsSneaking = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsSneaking", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "aN" : "isSprinting") && desc.equals("()Z")) - { - hadLocalIsSprinting = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsSprinting", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "cl" : "jump") && desc.equals("()V")) - { - hadLocalJump = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localJump", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "knockBack") && desc.equals(isObfuscated ? "(Lrw;FDD)V" : "(Lnet/minecraft/entity/Entity;FDD)V")) - { - hadLocalKnockBack = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localKnockBack", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "d" : "moveEntity") && desc.equals("(DDD)V")) - { - hadLocalMoveEntity = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMoveEntity", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "g" : "moveEntityWithHeading") && desc.equals("(FF)V")) - { - hadLocalMoveEntityWithHeading = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMoveEntityWithHeading", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "moveRelative") && desc.equals("(FFF)V")) - { - hadLocalMoveFlying = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMoveFlying", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "onDeath") && desc.equals(isObfuscated ? "(Lrh;)V" : "(Lnet/minecraft/util/DamageSource;)V")) - { - hadLocalOnDeath = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnDeath", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "n" : "onLivingUpdate") && desc.equals("()V")) - { - hadLocalOnLivingUpdate = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnLivingUpdate", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "b" : "onKillEntity") && desc.equals(isObfuscated ? "(Lsf;)V" : "(Lnet/minecraft/entity/EntityLivingBase;)V")) - { - hadLocalOnKillEntity = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnKillEntity", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "onStruckByLightning") && desc.equals(isObfuscated ? "(Lyh;)V" : "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V")) - { - hadLocalOnStruckByLightning = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnStruckByLightning", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "m" : "onUpdate") && desc.equals("()V")) - { - hadLocalOnUpdate = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnUpdate", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "playStepSound") && desc.equals(isObfuscated ? "(Lcm;Lakf;)V" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V")) - { - hadLocalPlayStepSound = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localPlayStepSound", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "j" : "pushOutOfBlocks") && desc.equals("(DDD)Z")) - { - hadLocalPushOutOfBlocks = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localPushOutOfBlocks", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "rayTrace") && desc.equals(isObfuscated ? "(DF)Lbbz;" : "(DF)Lnet/minecraft/util/math/RayTraceResult;")) - { - hadLocalRayTrace = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localRayTrace", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "readEntityFromNBT") && desc.equals(isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V")) - { - hadLocalReadEntityFromNBT = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localReadEntityFromNBT", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "cN" : "respawnPlayer") && desc.equals("()V")) - { - hadLocalRespawnPlayer = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localRespawnPlayer", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "T" : "setDead") && desc.equals("()V")) - { - hadLocalSetDead = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetDead", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "p" : "setPlayerSPHealth") && desc.equals("(F)V")) - { - hadLocalSetPlayerSPHealth = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetPlayerSPHealth", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "setPositionAndRotation") && desc.equals("(DDDFF)V")) - { - hadLocalSetPositionAndRotation = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetPositionAndRotation", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "e" : "setSneaking") && desc.equals("(Z)V")) - { - hadLocalSetSneaking = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetSneaking", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "f" : "setSprinting") && desc.equals("(Z)V")) - { - hadLocalSetSprinting = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetSprinting", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "trySleep") && desc.equals(isObfuscated ? "(Lcm;)Lzs$a;" : "(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/entity/player/EntityPlayer$SleepResult;")) - { - hadLocalTrySleep = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localTrySleep", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "swingArm") && desc.equals(isObfuscated ? "(Lqr;)V" : "(Lnet/minecraft/util/EnumHand;)V")) - { - hadLocalSwingItem = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSwingItem", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "cr" : "updateEntityActionState") && desc.equals("()V")) - { - hadLocalUpdateEntityActionState = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localUpdateEntityActionState", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "aw" : "updateRidden") && desc.equals("()V")) - { - hadLocalUpdateRidden = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localUpdateRidden", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "wakeUpPlayer") && desc.equals("(ZZZ)V")) - { - hadLocalWakeUpPlayer = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localWakeUpPlayer", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "b" : "writeEntityToNBT") && desc.equals(isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V")) - { - hadLocalWriteEntityToNBT = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localWriteEntityToNBT", desc, signature, exceptions); - } - - return super.visitMethod(access, name, desc, signature, exceptions); - } - - @Override - public void visitEnd() - { - MethodVisitor mv; - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "addExhaustion", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "addExhaustion", "(Lapi/player/client/IClientPlayerAPI;F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realAddExhaustion", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "addExhaustion", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superAddExhaustion", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "addExhaustion", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalAddExhaustion) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddExhaustion", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "addExhaustion", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "l" : "addMovementStat", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "addMovementStat", "(Lapi/player/client/IClientPlayerAPI;DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realAddMovementStat", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "l" : "addMovementStat", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superAddMovementStat", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "l" : "addMovementStat", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalAddMovementStat) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddMovementStat", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "l" : "addMovementStat", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "addStat", "" + (isObfuscated ? "(Lns;I)V" : "(Lnet/minecraft/stats/StatBase;I)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "addStat", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/stats/StatBase;I)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realAddStat", "(Lnet/minecraft/stats/StatBase;I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "addStat", "" + (isObfuscated ? "(Lns;I)V" : "(Lnet/minecraft/stats/StatBase;I)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superAddStat", "(Lnet/minecraft/stats/StatBase;I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "addStat", "" + (isObfuscated ? "(Lns;I)V" : "(Lnet/minecraft/stats/StatBase;I)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalAddStat) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddStat", "(Lnet/minecraft/stats/StatBase;I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "addStat", "" + (isObfuscated ? "(Lns;I)V" : "(Lnet/minecraft/stats/StatBase;I)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "attackEntityFrom", "" + (isObfuscated ? "(Lrh;F)Z" : "(Lnet/minecraft/util/DamageSource;F)Z") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "attackEntityFrom", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/util/DamageSource;F)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realAttackEntityFrom", "(Lnet/minecraft/util/DamageSource;F)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "attackEntityFrom", "" + (isObfuscated ? "(Lrh;F)Z" : "(Lnet/minecraft/util/DamageSource;F)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superAttackEntityFrom", "(Lnet/minecraft/util/DamageSource;F)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "attackEntityFrom", "" + (isObfuscated ? "(Lrh;F)Z" : "(Lnet/minecraft/util/DamageSource;F)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalAttackEntityFrom) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAttackEntityFrom", "(Lnet/minecraft/util/DamageSource;F)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "attackEntityFrom", "" + (isObfuscated ? "(Lrh;F)Z" : "(Lnet/minecraft/util/DamageSource;F)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "f" : "attackEntityPlayerSPEntityWithCurrentItem", "" + (isObfuscated ? "(Lrw;)V" : "(Lnet/minecraft/entity/Entity;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "attackTargetEntityWithCurrentItem", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/entity/Entity;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realAttackTargetEntityWithCurrentItem", "(Lnet/minecraft/entity/Entity;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "f" : "attackEntityPlayerSPEntityWithCurrentItem", "" + (isObfuscated ? "(Lrw;)V" : "(Lnet/minecraft/entity/Entity;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superAttackTargetEntityWithCurrentItem", "(Lnet/minecraft/entity/Entity;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "f" : "attackEntityPlayerSPEntityWithCurrentItem", "" + (isObfuscated ? "(Lrw;)V" : "(Lnet/minecraft/entity/Entity;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalAttackTargetEntityWithCurrentItem) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAttackTargetEntityWithCurrentItem", "(Lnet/minecraft/entity/Entity;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "f" : "attackEntityPlayerSPEntityWithCurrentItem", "" + (isObfuscated ? "(Lrw;)V" : "(Lnet/minecraft/entity/Entity;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "bE" : "canBreatheUnderwater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "canBreatheUnderwater", "(Lapi/player/client/IClientPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realCanBreatheUnderwater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bE" : "canBreatheUnderwater", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superCanBreatheUnderwater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "bE" : "canBreatheUnderwater", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalCanBreatheUnderwater) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanBreatheUnderwater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "bE" : "canBreatheUnderwater", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "b" : "canHarvestBlock", "" + (isObfuscated ? "(Lars;)Z" : "(Lnet/minecraft/block/state/IBlockState;)Z") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "canHarvestBlock", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/block/state/IBlockState;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realCanHarvestBlock", "(Lnet/minecraft/block/state/IBlockState;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "b" : "canHarvestBlock", "" + (isObfuscated ? "(Lars;)Z" : "(Lnet/minecraft/block/state/IBlockState;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superCanHarvestBlock", "(Lnet/minecraft/block/state/IBlockState;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "b" : "canHarvestBlock", "" + (isObfuscated ? "(Lars;)Z" : "(Lnet/minecraft/block/state/IBlockState;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalCanHarvestBlock) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanHarvestBlock", "(Lnet/minecraft/block/state/IBlockState;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "b" : "canHarvestBlock", "" + (isObfuscated ? "(Lars;)Z" : "(Lnet/minecraft/block/state/IBlockState;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "canPlayerEdit", "" + (isObfuscated ? "(Lcm;Lct;Ladz;)Z" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitVarInsn(Opcodes.ALOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "canPlayerEdit", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realCanPlayerEdit", "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitVarInsn(Opcodes.ALOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "canPlayerEdit", "" + (isObfuscated ? "(Lcm;Lct;Ladz;)Z" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superCanPlayerEdit", "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitVarInsn(Opcodes.ALOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "canPlayerEdit", "" + (isObfuscated ? "(Lcm;Lct;Ladz;)Z" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalCanPlayerEdit) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanPlayerEdit", "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitVarInsn(Opcodes.ALOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "canPlayerEdit", "" + (isObfuscated ? "(Lcm;Lct;Ladz;)Z" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "af" : "canTriggerWalking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "canTriggerWalking", "(Lapi/player/client/IClientPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realCanTriggerWalking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "af" : "canTriggerWalking", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superCanTriggerWalking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "af" : "canTriggerWalking", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalCanTriggerWalking) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanTriggerWalking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "af" : "canTriggerWalking", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "q" : "closeScreen", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "closeScreen", "(Lapi/player/client/IClientPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realCloseScreen", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "q" : "closeScreen", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superCloseScreen", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "q" : "closeScreen", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalCloseScreen) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCloseScreen", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "q" : "closeScreen", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "d" : "damageEntity", "" + (isObfuscated ? "(Lrh;F)V" : "(Lnet/minecraft/util/DamageSource;F)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "damageEntity", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/util/DamageSource;F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realDamageEntity", "(Lnet/minecraft/util/DamageSource;F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "d" : "damageEntity", "" + (isObfuscated ? "(Lrh;F)V" : "(Lnet/minecraft/util/DamageSource;F)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superDamageEntity", "(Lnet/minecraft/util/DamageSource;F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "d" : "damageEntity", "" + (isObfuscated ? "(Lrh;F)V" : "(Lnet/minecraft/util/DamageSource;F)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalDamageEntity) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDamageEntity", "(Lnet/minecraft/util/DamageSource;F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "d" : "damageEntity", "" + (isObfuscated ? "(Lrh;F)V" : "(Lnet/minecraft/util/DamageSource;F)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "displayGui", "" + (isObfuscated ? "(Lqs;)V" : "(Lnet/minecraft/world/IInteractionObject;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "displayGui", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/world/IInteractionObject;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realDisplayGui", "(Lnet/minecraft/world/IInteractionObject;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "displayGui", "" + (isObfuscated ? "(Lqs;)V" : "(Lnet/minecraft/world/IInteractionObject;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superDisplayGui", "(Lnet/minecraft/world/IInteractionObject;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "displayGui", "" + (isObfuscated ? "(Lqs;)V" : "(Lnet/minecraft/world/IInteractionObject;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalDisplayGui) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDisplayGui", "(Lnet/minecraft/world/IInteractionObject;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "displayGui", "" + (isObfuscated ? "(Lqs;)V" : "(Lnet/minecraft/world/IInteractionObject;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "displayGUIChest", "" + (isObfuscated ? "(Lql;)V" : "(Lnet/minecraft/inventory/IInventory;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "displayGUIChest", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/inventory/IInventory;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realDisplayGUIChest", "(Lnet/minecraft/inventory/IInventory;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "displayGUIChest", "" + (isObfuscated ? "(Lql;)V" : "(Lnet/minecraft/inventory/IInventory;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superDisplayGUIChest", "(Lnet/minecraft/inventory/IInventory;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "displayGUIChest", "" + (isObfuscated ? "(Lql;)V" : "(Lnet/minecraft/inventory/IInventory;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalDisplayGUIChest) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDisplayGUIChest", "(Lnet/minecraft/inventory/IInventory;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "displayGUIChest", "" + (isObfuscated ? "(Lql;)V" : "(Lnet/minecraft/inventory/IInventory;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Ladz;ZZ)Lyk;" : "(Lnet/minecraft/item/ItemStack;ZZ)Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "dropItem", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/item/ItemStack;ZZ)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realDropItem", "(Lnet/minecraft/item/ItemStack;ZZ)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Ladz;ZZ)Lyk;" : "(Lnet/minecraft/item/ItemStack;ZZ)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superDropItem", "(Lnet/minecraft/item/ItemStack;ZZ)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Ladz;ZZ)Lyk;" : "(Lnet/minecraft/item/ItemStack;ZZ)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalDropItem) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDropItem", "(Lnet/minecraft/item/ItemStack;ZZ)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Ladz;ZZ)Lyk;" : "(Lnet/minecraft/item/ItemStack;ZZ)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Z)Lyk;" : "(Z)Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "dropOneItem", "(Lapi/player/client/IClientPlayerAPI;Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realDropOneItem", "(Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Z)Lyk;" : "(Z)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superDropOneItem", "(Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Z)Lyk;" : "(Z)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalDropOneItem) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDropOneItem", "(Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Z)Lyk;" : "(Z)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Ladz;Z)Lyk;" : "(Lnet/minecraft/item/ItemStack;Z)Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "dropPlayerItemWithRandomChoice", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/item/ItemStack;Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realDropPlayerItemWithRandomChoice", "(Lnet/minecraft/item/ItemStack;Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Ladz;Z)Lyk;" : "(Lnet/minecraft/item/ItemStack;Z)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superDropPlayerItemWithRandomChoice", "(Lnet/minecraft/item/ItemStack;Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Ladz;Z)Lyk;" : "(Lnet/minecraft/item/ItemStack;Z)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalDropPlayerItemWithRandomChoice) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDropPlayerItemWithRandomChoice", "(Lnet/minecraft/item/ItemStack;Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Ladz;Z)Lyk;" : "(Lnet/minecraft/item/ItemStack;Z)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "e" : "fall", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "fall", "(Lapi/player/client/IClientPlayerAPI;FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realFall", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "e" : "fall", "(FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superFall", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "e" : "fall", "(FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalFall) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localFall", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "e" : "fall", "(FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "cp" : "getAIMoveSpeed", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "getAIMoveSpeed", "(Lapi/player/client/IClientPlayerAPI;)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetAIMoveSpeed", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cp" : "getAIMoveSpeed", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetAIMoveSpeed", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cp" : "getAIMoveSpeed", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetAIMoveSpeed) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetAIMoveSpeed", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cp" : "getAIMoveSpeed", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "cQ" : "getBedOrientationInDegrees", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "getBedOrientationInDegrees", "(Lapi/player/client/IClientPlayerAPI;)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetBedOrientationInDegrees", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cQ" : "getBedOrientationInDegrees", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetBedOrientationInDegrees", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cQ" : "getBedOrientationInDegrees", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetBedOrientationInDegrees) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetBedOrientationInDegrees", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cQ" : "getBedOrientationInDegrees", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "e" : "getBrightness", "(F)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "getBrightness", "(Lapi/player/client/IClientPlayerAPI;F)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetBrightness", "(F)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "e" : "getBrightness", "(F)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetBrightness", "(F)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "e" : "getBrightness", "(F)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetBrightness) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetBrightness", "(F)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "e" : "getBrightness", "(F)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "d" : "getBrightnessForRender", "(F)I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "getBrightnessForRender", "(Lapi/player/client/IClientPlayerAPI;F)I", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetBrightnessForRender", "(F)I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "d" : "getBrightnessForRender", "(F)I", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetBrightnessForRender", "(F)I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "d" : "getBrightnessForRender", "(F)I", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetBrightnessForRender) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetBrightnessForRender", "(F)I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "d" : "getBrightnessForRender", "(F)I", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "getDigSpeed", "" + (isObfuscated ? "(Lars;Lcm;)F" : "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "getBreakSpeed", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetBreakSpeed", "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", "getDigSpeed", "" + (isObfuscated ? "(Lars;Lcm;)F" : "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F") + "", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetBreakSpeed", "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", "getDigSpeed", "" + (isObfuscated ? "(Lars;Lcm;)F" : "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F") + "", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetBreakSpeed) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetBreakSpeed", "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", "getDigSpeed", "" + (isObfuscated ? "(Lars;Lcm;)F" : "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F") + "", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "e" : "getDistanceSq", "(DDD)D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "getDistanceSq", "(Lapi/player/client/IClientPlayerAPI;DDD)D", false); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetDistanceSq", "(DDD)D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "e" : "getDistanceSq", "(DDD)D", false); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetDistanceSq", "(DDD)D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "e" : "getDistanceSq", "(DDD)D", false); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetDistanceSq) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetDistanceSq", "(DDD)D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "e" : "getDistanceSq", "(DDD)D", false); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "h" : "getDistanceSqToEntity", "" + (isObfuscated ? "(Lrw;)D" : "(Lnet/minecraft/entity/Entity;)D") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "getDistanceSqToEntity", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/entity/Entity;)D", false); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetDistanceSqToEntity", "(Lnet/minecraft/entity/Entity;)D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "h" : "getDistanceSqToEntity", "" + (isObfuscated ? "(Lrw;)D" : "(Lnet/minecraft/entity/Entity;)D") + "", false); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetDistanceSqToEntity", "(Lnet/minecraft/entity/Entity;)D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "h" : "getDistanceSqToEntity", "" + (isObfuscated ? "(Lrw;)D" : "(Lnet/minecraft/entity/Entity;)D") + "", false); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetDistanceSqToEntity) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetDistanceSqToEntity", "(Lnet/minecraft/entity/Entity;)D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "h" : "getDistanceSqToEntity", "" + (isObfuscated ? "(Lrw;)D" : "(Lnet/minecraft/entity/Entity;)D") + "", false); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "getFovModifier", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "getFovModifier", "(Lapi/player/client/IClientPlayerAPI;)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetFovModifier", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", "getFovModifier", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetFovModifier", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", "getFovModifier", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetFovModifier) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetFovModifier", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", "getFovModifier", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "bV" : "getHurtSound", "" + (isObfuscated ? "()Lni;" : "()Lnet/minecraft/util/SoundEvent;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "getHurtSound", "(Lapi/player/client/IClientPlayerAPI;)" + (isObfuscated ? "Lni;" : "Lnet/minecraft/util/SoundEvent;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetHurtSound", "()" + (isObfuscated ? "Lni;" : "Lnet/minecraft/util/SoundEvent;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bV" : "getHurtSound", "" + (isObfuscated ? "()Lni;" : "()Lnet/minecraft/util/SoundEvent;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetHurtSound", "()" + (isObfuscated ? "Lni;" : "Lnet/minecraft/util/SoundEvent;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "bV" : "getHurtSound", "" + (isObfuscated ? "()Lni;" : "()Lnet/minecraft/util/SoundEvent;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetHurtSound) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetHurtSound", "()" + (isObfuscated ? "Lni;" : "Lnet/minecraft/util/SoundEvent;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "bV" : "getHurtSound", "" + (isObfuscated ? "()Lni;" : "()Lnet/minecraft/util/SoundEvent;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "h_" : "getName", "()Ljava/lang/String;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "getName", "(Lapi/player/client/IClientPlayerAPI;)Ljava/lang/String;", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetName", "()Ljava/lang/String;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "h_" : "getName", "()Ljava/lang/String;", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetName", "()Ljava/lang/String;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "h_" : "getName", "()Ljava/lang/String;", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetName) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetName", "()Ljava/lang/String;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "h_" : "getName", "()Ljava/lang/String;", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "cS" : "getSleepTimer", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "getSleepTimer", "(Lapi/player/client/IClientPlayerAPI;)I", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetSleepTimer", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cS" : "getSleepTimer", "()I", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetSleepTimer", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cS" : "getSleepTimer", "()I", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetSleepTimer) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetSleepTimer", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cS" : "getSleepTimer", "()I", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "ak" : "handleWaterMovement", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "handleWaterMovement", "(Lapi/player/client/IClientPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realHandleWaterMovement", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ak" : "handleWaterMovement", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superHandleWaterMovement", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "ak" : "handleWaterMovement", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalHandleWaterMovement) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localHandleWaterMovement", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "ak" : "handleWaterMovement", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "b" : "heal", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "heal", "(Lapi/player/client/IClientPlayerAPI;F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realHeal", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "b" : "heal", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superHeal", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "b" : "heal", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalHeal) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localHeal", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "b" : "heal", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "av" : "isEntityInsideOpaqueBlock", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "isEntityInsideOpaqueBlock", "(Lapi/player/client/IClientPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realIsEntityInsideOpaqueBlock", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "av" : "isEntityInsideOpaqueBlock", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superIsEntityInsideOpaqueBlock", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "av" : "isEntityInsideOpaqueBlock", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalIsEntityInsideOpaqueBlock) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsEntityInsideOpaqueBlock", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "av" : "isEntityInsideOpaqueBlock", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "aj" : "isInWater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "isInWater", "(Lapi/player/client/IClientPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realIsInWater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aj" : "isInWater", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superIsInWater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "aj" : "isInWater", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalIsInWater) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsInWater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "aj" : "isInWater", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "isInsideOfMaterial", "" + (isObfuscated ? "(Laxx;)Z" : "(Lnet/minecraft/block/material/Material;)Z") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "isInsideOfMaterial", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/block/material/Material;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realIsInsideOfMaterial", "(Lnet/minecraft/block/material/Material;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "isInsideOfMaterial", "" + (isObfuscated ? "(Laxx;)Z" : "(Lnet/minecraft/block/material/Material;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superIsInsideOfMaterial", "(Lnet/minecraft/block/material/Material;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "isInsideOfMaterial", "" + (isObfuscated ? "(Laxx;)Z" : "(Lnet/minecraft/block/material/Material;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalIsInsideOfMaterial) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsInsideOfMaterial", "(Lnet/minecraft/block/material/Material;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "isInsideOfMaterial", "" + (isObfuscated ? "(Laxx;)Z" : "(Lnet/minecraft/block/material/Material;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "m_" : "isOnLadder", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "isOnLadder", "(Lapi/player/client/IClientPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realIsOnLadder", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "m_" : "isOnLadder", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superIsOnLadder", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "m_" : "isOnLadder", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalIsOnLadder) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsOnLadder", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "m_" : "isOnLadder", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "cq" : "isPlayerSleeping", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "isPlayerSleeping", "(Lapi/player/client/IClientPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realIsPlayerSleeping", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cq" : "isPlayerSleeping", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superIsPlayerSleeping", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cq" : "isPlayerSleeping", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalIsPlayerSleeping) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsPlayerSleeping", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cq" : "isPlayerSleeping", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "aM" : "isSneaking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "isSneaking", "(Lapi/player/client/IClientPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realIsSneaking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aM" : "isSneaking", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superIsSneaking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "aM" : "isSneaking", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalIsSneaking) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsSneaking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "aM" : "isSneaking", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "aN" : "isSprinting", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "isSprinting", "(Lapi/player/client/IClientPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realIsSprinting", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aN" : "isSprinting", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superIsSprinting", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "aN" : "isSprinting", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalIsSprinting) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsSprinting", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "aN" : "isSprinting", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "cl" : "jump", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "jump", "(Lapi/player/client/IClientPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realJump", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cl" : "jump", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superJump", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cl" : "jump", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalJump) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localJump", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cl" : "jump", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "knockBack", "" + (isObfuscated ? "(Lrw;FDD)V" : "(Lnet/minecraft/entity/Entity;FDD)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "knockBack", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/entity/Entity;FDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realKnockBack", "(Lnet/minecraft/entity/Entity;FDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "knockBack", "" + (isObfuscated ? "(Lrw;FDD)V" : "(Lnet/minecraft/entity/Entity;FDD)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superKnockBack", "(Lnet/minecraft/entity/Entity;FDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "knockBack", "" + (isObfuscated ? "(Lrw;FDD)V" : "(Lnet/minecraft/entity/Entity;FDD)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalKnockBack) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localKnockBack", "(Lnet/minecraft/entity/Entity;FDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "knockBack", "" + (isObfuscated ? "(Lrw;FDD)V" : "(Lnet/minecraft/entity/Entity;FDD)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "d" : "moveEntity", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "moveEntity", "(Lapi/player/client/IClientPlayerAPI;DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realMoveEntity", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "d" : "moveEntity", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superMoveEntity", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "d" : "moveEntity", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalMoveEntity) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMoveEntity", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "d" : "moveEntity", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "g" : "moveEntityWithHeading", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "moveEntityWithHeading", "(Lapi/player/client/IClientPlayerAPI;FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realMoveEntityWithHeading", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "g" : "moveEntityWithHeading", "(FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superMoveEntityWithHeading", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "g" : "moveEntityWithHeading", "(FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalMoveEntityWithHeading) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMoveEntityWithHeading", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "g" : "moveEntityWithHeading", "(FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "moveRelative", "(FFF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.FLOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "moveFlying", "(Lapi/player/client/IClientPlayerAPI;FFF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realMoveFlying", "(FFF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.FLOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "moveRelative", "(FFF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superMoveFlying", "(FFF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.FLOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "moveRelative", "(FFF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalMoveFlying) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMoveFlying", "(FFF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.FLOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "moveRelative", "(FFF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "onDeath", "" + (isObfuscated ? "(Lrh;)V" : "(Lnet/minecraft/util/DamageSource;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "onDeath", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/util/DamageSource;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realOnDeath", "(Lnet/minecraft/util/DamageSource;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "onDeath", "" + (isObfuscated ? "(Lrh;)V" : "(Lnet/minecraft/util/DamageSource;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superOnDeath", "(Lnet/minecraft/util/DamageSource;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "onDeath", "" + (isObfuscated ? "(Lrh;)V" : "(Lnet/minecraft/util/DamageSource;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalOnDeath) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnDeath", "(Lnet/minecraft/util/DamageSource;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "onDeath", "" + (isObfuscated ? "(Lrh;)V" : "(Lnet/minecraft/util/DamageSource;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "n" : "onLivingUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "onLivingUpdate", "(Lapi/player/client/IClientPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realOnLivingUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "n" : "onLivingUpdate", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superOnLivingUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "n" : "onLivingUpdate", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalOnLivingUpdate) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnLivingUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "n" : "onLivingUpdate", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "b" : "onKillEntity", "" + (isObfuscated ? "(Lsf;)V" : "(Lnet/minecraft/entity/EntityLivingBase;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "onKillEntity", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/entity/EntityLivingBase;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realOnKillEntity", "(Lnet/minecraft/entity/EntityLivingBase;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "b" : "onKillEntity", "" + (isObfuscated ? "(Lsf;)V" : "(Lnet/minecraft/entity/EntityLivingBase;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superOnKillEntity", "(Lnet/minecraft/entity/EntityLivingBase;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "b" : "onKillEntity", "" + (isObfuscated ? "(Lsf;)V" : "(Lnet/minecraft/entity/EntityLivingBase;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalOnKillEntity) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnKillEntity", "(Lnet/minecraft/entity/EntityLivingBase;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "b" : "onKillEntity", "" + (isObfuscated ? "(Lsf;)V" : "(Lnet/minecraft/entity/EntityLivingBase;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "onStruckByLightning", "" + (isObfuscated ? "(Lyh;)V" : "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "onStruckByLightning", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/entity/effect/EntityLightningBolt;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realOnStruckByLightning", "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "onStruckByLightning", "" + (isObfuscated ? "(Lyh;)V" : "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superOnStruckByLightning", "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "onStruckByLightning", "" + (isObfuscated ? "(Lyh;)V" : "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalOnStruckByLightning) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnStruckByLightning", "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "onStruckByLightning", "" + (isObfuscated ? "(Lyh;)V" : "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "m" : "onUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "onUpdate", "(Lapi/player/client/IClientPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realOnUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "m" : "onUpdate", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superOnUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "m" : "onUpdate", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalOnUpdate) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "m" : "onUpdate", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "playStepSound", "" + (isObfuscated ? "(Lcm;Lakf;)V" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "playStepSound", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realPlayStepSound", "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "playStepSound", "" + (isObfuscated ? "(Lcm;Lakf;)V" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superPlayStepSound", "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "playStepSound", "" + (isObfuscated ? "(Lcm;Lakf;)V" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalPlayStepSound) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localPlayStepSound", "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "playStepSound", "" + (isObfuscated ? "(Lcm;Lakf;)V" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "j" : "pushOutOfBlocks", "(DDD)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "pushOutOfBlocks", "(Lapi/player/client/IClientPlayerAPI;DDD)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realPushOutOfBlocks", "(DDD)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "j" : "pushOutOfBlocks", "(DDD)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superPushOutOfBlocks", "(DDD)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "j" : "pushOutOfBlocks", "(DDD)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalPushOutOfBlocks) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localPushOutOfBlocks", "(DDD)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "j" : "pushOutOfBlocks", "(DDD)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "rayTrace", "" + (isObfuscated ? "(DF)Lbbz;" : "(DF)Lnet/minecraft/util/math/RayTraceResult;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "rayTrace", "(Lapi/player/client/IClientPlayerAPI;DF)" + (isObfuscated ? "Lbbz;" : "Lnet/minecraft/util/math/RayTraceResult;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realRayTrace", "(DF)" + (isObfuscated ? "Lbbz;" : "Lnet/minecraft/util/math/RayTraceResult;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "rayTrace", "" + (isObfuscated ? "(DF)Lbbz;" : "(DF)Lnet/minecraft/util/math/RayTraceResult;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superRayTrace", "(DF)" + (isObfuscated ? "Lbbz;" : "Lnet/minecraft/util/math/RayTraceResult;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "rayTrace", "" + (isObfuscated ? "(DF)Lbbz;" : "(DF)Lnet/minecraft/util/math/RayTraceResult;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalRayTrace) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localRayTrace", "(DF)" + (isObfuscated ? "Lbbz;" : "Lnet/minecraft/util/math/RayTraceResult;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "rayTrace", "" + (isObfuscated ? "(DF)Lbbz;" : "(DF)Lnet/minecraft/util/math/RayTraceResult;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "readEntityFromNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "readEntityFromNBT", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/nbt/NBTTagCompound;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realReadEntityFromNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "readEntityFromNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superReadEntityFromNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "readEntityFromNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalReadEntityFromNBT) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localReadEntityFromNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "readEntityFromNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "cN" : "respawnPlayer", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "respawnPlayer", "(Lapi/player/client/IClientPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realRespawnPlayer", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cN" : "respawnPlayer", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superRespawnPlayer", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cN" : "respawnPlayer", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalRespawnPlayer) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localRespawnPlayer", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cN" : "respawnPlayer", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "T" : "setDead", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "setDead", "(Lapi/player/client/IClientPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSetDead", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "T" : "setDead", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSetDead", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "T" : "setDead", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalSetDead) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetDead", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "T" : "setDead", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "p" : "setPlayerSPHealth", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "setPlayerSPHealth", "(Lapi/player/client/IClientPlayerAPI;F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSetPlayerSPHealth", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "p" : "setPlayerSPHealth", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSetPlayerSPHealth", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "p" : "setPlayerSPHealth", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalSetPlayerSPHealth) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetPlayerSPHealth", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "p" : "setPlayerSPHealth", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "setPositionAndRotation", "(DDDFF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitVarInsn(Opcodes.FLOAD, 7); - mv.visitVarInsn(Opcodes.FLOAD, 8); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "setPositionAndRotation", "(Lapi/player/client/IClientPlayerAPI;DDDFF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSetPositionAndRotation", "(DDDFF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitVarInsn(Opcodes.FLOAD, 7); - mv.visitVarInsn(Opcodes.FLOAD, 8); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "setPositionAndRotation", "(DDDFF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSetPositionAndRotation", "(DDDFF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitVarInsn(Opcodes.FLOAD, 7); - mv.visitVarInsn(Opcodes.FLOAD, 8); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "setPositionAndRotation", "(DDDFF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalSetPositionAndRotation) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetPositionAndRotation", "(DDDFF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitVarInsn(Opcodes.FLOAD, 7); - mv.visitVarInsn(Opcodes.FLOAD, 8); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "setPositionAndRotation", "(DDDFF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "e" : "setSneaking", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "setSneaking", "(Lapi/player/client/IClientPlayerAPI;Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSetSneaking", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "e" : "setSneaking", "(Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSetSneaking", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "e" : "setSneaking", "(Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalSetSneaking) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetSneaking", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "e" : "setSneaking", "(Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "f" : "setSprinting", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "setSprinting", "(Lapi/player/client/IClientPlayerAPI;Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSetSprinting", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "f" : "setSprinting", "(Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSetSprinting", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "f" : "setSprinting", "(Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalSetSprinting) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetSprinting", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "f" : "setSprinting", "(Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "trySleep", "" + (isObfuscated ? "(Lcm;)Lzs$a;" : "(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/entity/player/EntityPlayer$SleepResult;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "trySleep", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/util/math/BlockPos;)" + (isObfuscated ? "Lzs$a;" : "Lnet/minecraft/entity/player/EntityPlayer$SleepResult;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realTrySleep", "(Lnet/minecraft/util/math/BlockPos;)" + (isObfuscated ? "Lzs$a;" : "Lnet/minecraft/entity/player/EntityPlayer$SleepResult;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "trySleep", "" + (isObfuscated ? "(Lcm;)Lzs$a;" : "(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/entity/player/EntityPlayer$SleepResult;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superTrySleep", "(Lnet/minecraft/util/math/BlockPos;)" + (isObfuscated ? "Lzs$a;" : "Lnet/minecraft/entity/player/EntityPlayer$SleepResult;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "trySleep", "" + (isObfuscated ? "(Lcm;)Lzs$a;" : "(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/entity/player/EntityPlayer$SleepResult;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalTrySleep) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localTrySleep", "(Lnet/minecraft/util/math/BlockPos;)" + (isObfuscated ? "Lzs$a;" : "Lnet/minecraft/entity/player/EntityPlayer$SleepResult;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "trySleep", "" + (isObfuscated ? "(Lcm;)Lzs$a;" : "(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/entity/player/EntityPlayer$SleepResult;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "swingArm", "" + (isObfuscated ? "(Lqr;)V" : "(Lnet/minecraft/util/EnumHand;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "swingItem", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/util/EnumHand;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSwingItem", "(Lnet/minecraft/util/EnumHand;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "swingArm", "" + (isObfuscated ? "(Lqr;)V" : "(Lnet/minecraft/util/EnumHand;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSwingItem", "(Lnet/minecraft/util/EnumHand;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "swingArm", "" + (isObfuscated ? "(Lqr;)V" : "(Lnet/minecraft/util/EnumHand;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalSwingItem) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSwingItem", "(Lnet/minecraft/util/EnumHand;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "swingArm", "" + (isObfuscated ? "(Lqr;)V" : "(Lnet/minecraft/util/EnumHand;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "cr" : "updateEntityActionState", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "updateEntityActionState", "(Lapi/player/client/IClientPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realUpdateEntityActionState", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cr" : "updateEntityActionState", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superUpdateEntityActionState", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cr" : "updateEntityActionState", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalUpdateEntityActionState) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localUpdateEntityActionState", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "cr" : "updateEntityActionState", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "aw" : "updateRidden", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "updateRidden", "(Lapi/player/client/IClientPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realUpdateRidden", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aw" : "updateRidden", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superUpdateRidden", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "aw" : "updateRidden", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalUpdateRidden) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localUpdateRidden", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "aw" : "updateRidden", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "wakeUpPlayer", "(ZZZ)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "wakeUpPlayer", "(Lapi/player/client/IClientPlayerAPI;ZZZ)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realWakeUpPlayer", "(ZZZ)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "a" : "wakeUpPlayer", "(ZZZ)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superWakeUpPlayer", "(ZZZ)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "wakeUpPlayer", "(ZZZ)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalWakeUpPlayer) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localWakeUpPlayer", "(ZZZ)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "a" : "wakeUpPlayer", "(ZZZ)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "b" : "writeEntityToNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "writeEntityToNBT", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/nbt/NBTTagCompound;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realWriteEntityToNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "b" : "writeEntityToNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superWriteEntityToNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "b" : "writeEntityToNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalWriteEntityToNBT) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localWriteEntityToNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer", isObfuscated ? "b" : "writeEntityToNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getActiveHandField", isObfuscated ? "()Lqr;" : "()Lnet/minecraft/util/EnumHand;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cp" : "activeHand", isObfuscated ? "Lqr;" : "Lnet/minecraft/util/EnumHand;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setActiveHandField", isObfuscated ? "(Lqr;)V" : "(Lnet/minecraft/util/EnumHand;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cp" : "activeHand", isObfuscated ? "Lqr;" : "Lnet/minecraft/util/EnumHand;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getActiveItemStackField", isObfuscated ? "()Ladz;" : "()Lnet/minecraft/item/ItemStack;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bo" : "activeItemStack", isObfuscated ? "Ladz;" : "Lnet/minecraft/item/ItemStack;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setActiveItemStackField", isObfuscated ? "(Ladz;)V" : "(Lnet/minecraft/item/ItemStack;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bo" : "activeItemStack", isObfuscated ? "Ladz;" : "Lnet/minecraft/item/ItemStack;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getActiveItemStackUseCountField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bp" : "activeItemStackUseCount", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setActiveItemStackUseCountField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bp" : "activeItemStackUseCount", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getAddedToChunkField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ab" : "addedToChunk", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setAddedToChunkField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ab" : "addedToChunk", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getArrowHitTimerField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ay" : "arrowHitTimer", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setArrowHitTimerField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ay" : "arrowHitTimer", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getAttackedAtYawField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aB" : "attackedAtYaw", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setAttackedAtYawField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aB" : "attackedAtYaw", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getAttackingPlayerField", isObfuscated ? "()Lzs;" : "()Lnet/minecraft/entity/player/EntityPlayer;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aT" : "attackingPlayer", isObfuscated ? "Lzs;" : "Lnet/minecraft/entity/player/EntityPlayer;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setAttackingPlayerField", isObfuscated ? "(Lzs;)V" : "(Lnet/minecraft/entity/player/EntityPlayer;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aT" : "attackingPlayer", isObfuscated ? "Lzs;" : "Lnet/minecraft/entity/player/EntityPlayer;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getAutoJumpEnabledField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cr" : "autoJumpEnabled", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setAutoJumpEnabledField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cr" : "autoJumpEnabled", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getAutoJumpRequiredField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cs" : "autoJumpTime", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setAutoJumpRequiredField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cs" : "autoJumpTime", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getCachedUniqueIdStringField", "()Ljava/lang/String;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "as" : "cachedUniqueIdString", "Ljava/lang/String;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setCachedUniqueIdStringField", "(Ljava/lang/String;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "as" : "cachedUniqueIdString", "Ljava/lang/String;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getCameraPitchField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aL" : "cameraPitch", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setCameraPitchField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aL" : "cameraPitch", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getCameraYawField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bz" : "cameraYaw", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setCameraYawField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bz" : "cameraYaw", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getCapabilitiesField", isObfuscated ? "()Lzq;" : "()Lnet/minecraft/entity/player/PlayerCapabilities;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bL" : "capabilities", isObfuscated ? "Lzq;" : "Lnet/minecraft/entity/player/PlayerCapabilities;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setCapabilitiesField", isObfuscated ? "(Lzq;)V" : "(Lnet/minecraft/entity/player/PlayerCapabilities;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bL" : "capabilities", isObfuscated ? "Lzq;" : "Lnet/minecraft/entity/player/PlayerCapabilities;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChasingPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bE" : "chasingPosX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChasingPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bE" : "chasingPosX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChasingPosYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bF" : "chasingPosY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChasingPosYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bF" : "chasingPosY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChasingPosZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bG" : "chasingPosZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChasingPosZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bG" : "chasingPosZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChunkCoordXField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ac" : "chunkCoordX", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChunkCoordXField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ac" : "chunkCoordX", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChunkCoordYField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ad" : "chunkCoordY", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChunkCoordYField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ad" : "chunkCoordY", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChunkCoordZField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ae" : "chunkCoordZ", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChunkCoordZField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ae" : "chunkCoordZ", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getDataWatcherField", isObfuscated ? "()Lkk;" : "()Lnet/minecraft/network/datasync/EntityDataManager;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "Z" : "dataManager", isObfuscated ? "Lkk;" : "Lnet/minecraft/network/datasync/EntityDataManager;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setDataWatcherField", isObfuscated ? "(Lkk;)V" : "(Lnet/minecraft/network/datasync/EntityDataManager;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "Z" : "dataManager", isObfuscated ? "Lkk;" : "Lnet/minecraft/network/datasync/EntityDataManager;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getDeadField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aV" : "dead", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setDeadField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aV" : "dead", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getDeathTimeField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aC" : "deathTime", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setDeathTimeField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aC" : "deathTime", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getDimensionField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "an" : "dimension", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setDimensionField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "an" : "dimension", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getDistanceWalkedModifiedField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "J" : "distanceWalkedModified", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setDistanceWalkedModifiedField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "J" : "distanceWalkedModified", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getDistanceWalkedOnStepModifiedField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "K" : "distanceWalkedOnStepModified", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setDistanceWalkedOnStepModifiedField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "K" : "distanceWalkedOnStepModified", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getEntityAgeField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aW" : "entityAge", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setEntityAgeField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aW" : "entityAge", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getEntityCollisionReductionField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "R" : "entityCollisionReduction", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setEntityCollisionReductionField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "R" : "entityCollisionReduction", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getEntityUniqueIDField", "()Ljava/util/UUID;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ar" : "entityUniqueID", "Ljava/util/UUID;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setEntityUniqueIDField", "(Ljava/util/UUID;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ar" : "entityUniqueID", "Ljava/util/UUID;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getExperienceField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bO" : "experience", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setExperienceField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bO" : "experience", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getExperienceLevelField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bM" : "experienceLevel", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setExperienceLevelField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bM" : "experienceLevel", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getExperienceTotalField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bN" : "experienceTotal", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setExperienceTotalField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bN" : "experienceTotal", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFallDistanceField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "L" : "fallDistance", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setFallDistanceField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "L" : "fallDistance", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFireResistanceField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "U" : "fireResistance", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setFireResistanceField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "U" : "fireResistance", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFirstUpdateField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "X" : "firstUpdate", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setFirstUpdateField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "X" : "firstUpdate", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFishEntityField", isObfuscated ? "()Lyd;" : "()Lnet/minecraft/entity/projectile/EntityFishHook;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bR" : "fishEntity", isObfuscated ? "Lyd;" : "Lnet/minecraft/entity/projectile/EntityFishHook;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setFishEntityField", isObfuscated ? "(Lyd;)V" : "(Lnet/minecraft/entity/projectile/EntityFishHook;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bR" : "fishEntity", isObfuscated ? "Lyd;" : "Lnet/minecraft/entity/projectile/EntityFishHook;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFlagsField", isObfuscated ? "()Lkh;" : "()Lnet/minecraft/network/datasync/DataParameter;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aa" : "FLAGS", isObfuscated ? "Lkh;" : "Lnet/minecraft/network/datasync/DataParameter;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFlyToggleTimerField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bx" : "flyToggleTimer", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setFlyToggleTimerField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bx" : "flyToggleTimer", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFoodStatsField", isObfuscated ? "()Labb;" : "()Lnet/minecraft/util/FoodStats;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bw" : "foodStats", isObfuscated ? "Labb;" : "Lnet/minecraft/util/FoodStats;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setFoodStatsField", isObfuscated ? "(Labb;)V" : "(Lnet/minecraft/util/FoodStats;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bw" : "foodStats", isObfuscated ? "Labb;" : "Lnet/minecraft/util/FoodStats;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getForceSpawnField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "k" : "forceSpawn", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setForceSpawnField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "k" : "forceSpawn", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getGlowingField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "at" : "glowing", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setGlowingField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "at" : "glowing", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHandActiveField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "co" : "handActive", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHandActiveField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "co" : "handActive", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHandStatesField", isObfuscated ? "()Lkh;" : "()Lnet/minecraft/network/datasync/DataParameter;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "au" : "HAND_STATES", isObfuscated ? "Lkh;" : "Lnet/minecraft/network/datasync/DataParameter;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHasValidHealthField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cj" : "hasValidHealth", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHasValidHealthField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cj" : "hasValidHealth", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHeightField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "H" : "height", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHeightField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "H" : "height", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHorseJumpPowerField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cm" : "horseJumpPower", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHorseJumpPowerField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cm" : "horseJumpPower", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHorseJumpPowerCounterField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cl" : "horseJumpPowerCounter", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHorseJumpPowerCounterField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cl" : "horseJumpPowerCounter", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHundredEightyField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bb" : "unused180", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHundredEightyField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bb" : "unused180", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHurtResistantTimeField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "W" : "hurtResistantTime", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHurtResistantTimeField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "W" : "hurtResistantTime", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHurtTimeField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "az" : "hurtTime", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHurtTimeField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "az" : "hurtTime", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIgnoreFrustumCheckField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ai" : "ignoreFrustumCheck", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIgnoreFrustumCheckField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ai" : "ignoreFrustumCheck", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInPortalField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "al" : "inPortal", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInPortalField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "al" : "inPortal", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInWaterField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "V" : "inWater", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInWaterField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "V" : "inWater", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInterpTargetXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bj" : "interpEntityPlayerSPX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInterpTargetXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bj" : "interpEntityPlayerSPX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInterpTargetYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bk" : "interpEntityPlayerSPY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInterpTargetYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bk" : "interpEntityPlayerSPY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInterpTargetYawField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bm" : "interpEntityPlayerSPYaw", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInterpTargetYawField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bm" : "interpEntityPlayerSPYaw", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInterpTargetZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bl" : "interpEntityPlayerSPZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInterpTargetZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bl" : "interpEntityPlayerSPZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInventoryField", isObfuscated ? "()Lzr;" : "()Lnet/minecraft/entity/player/InventoryPlayer;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bt" : "inventory", isObfuscated ? "Lzr;" : "Lnet/minecraft/entity/player/InventoryPlayer;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInventoryField", isObfuscated ? "(Lzr;)V" : "(Lnet/minecraft/entity/player/InventoryPlayer;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bt" : "inventory", isObfuscated ? "Lzr;" : "Lnet/minecraft/entity/player/InventoryPlayer;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInventoryContainerField", isObfuscated ? "()Labd;" : "()Lnet/minecraft/inventory/Container;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bu" : "inventoryContainer", isObfuscated ? "Labd;" : "Lnet/minecraft/inventory/Container;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInventoryContainerField", isObfuscated ? "(Labd;)V" : "(Lnet/minecraft/inventory/Container;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bu" : "inventoryContainer", isObfuscated ? "Labd;" : "Lnet/minecraft/inventory/Container;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsAirBorneField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aj" : "isAirBorne", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsAirBorneField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aj" : "isAirBorne", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsCollidedField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "C" : "isCollided", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsCollidedField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "C" : "isCollided", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsCollidedHorizontallyField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "A" : "isCollidedHorizontally", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsCollidedHorizontallyField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "A" : "isCollidedHorizontally", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsCollidedVerticallyField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "B" : "isCollidedVertically", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsCollidedVerticallyField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "B" : "isCollidedVertically", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsDeadField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "F" : "isDead", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsDeadField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "F" : "isDead", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsElytraFlyingField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ct" : "wasFallFlying", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsElytraFlyingField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ct" : "wasFallFlying", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsImmuneToFireField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "Y" : "isImmuneToFire", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsImmuneToFireField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "Y" : "isImmuneToFire", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsInWebField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "E" : "isInWeb", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsInWebField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "E" : "isInWeb", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsJumpingField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "be" : "isJumping", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsJumpingField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "be" : "isJumping", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsSwingInProgressField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "av" : "isSwingInProgress", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsSwingInProgressField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "av" : "isSwingInProgress", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getJumpMovementFactorField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aS" : "jumpMovementFactor", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setJumpMovementFactorField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aS" : "jumpMovementFactor", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastDamageField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bd" : "lastDamage", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastDamageField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bd" : "lastDamage", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastPortalPosField", isObfuscated ? "()Lcm;" : "()Lnet/minecraft/util/math/BlockPos;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ao" : "lastPortalPos", isObfuscated ? "Lcm;" : "Lnet/minecraft/util/math/BlockPos;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastPortalPosField", isObfuscated ? "(Lcm;)V" : "(Lnet/minecraft/util/math/BlockPos;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ao" : "lastPortalPos", isObfuscated ? "Lcm;" : "Lnet/minecraft/util/math/BlockPos;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastPortalVecField", isObfuscated ? "()Lbcb;" : "()Lnet/minecraft/util/math/Vec3d;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ap" : "lastPortalVec", isObfuscated ? "Lbcb;" : "Lnet/minecraft/util/math/Vec3d;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastPortalVecField", isObfuscated ? "(Lbcb;)V" : "(Lnet/minecraft/util/math/Vec3d;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ap" : "lastPortalVec", isObfuscated ? "Lbcb;" : "Lnet/minecraft/util/math/Vec3d;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastReportedPitchField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ce" : "lastReportedPitch", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastReportedPitchField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ce" : "lastReportedPitch", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastReportedPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ca" : "lastReportedPosX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastReportedPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ca" : "lastReportedPosX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastReportedPosYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cb" : "lastReportedPosY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastReportedPosYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cb" : "lastReportedPosY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastReportedPosZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cc" : "lastReportedPosZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastReportedPosZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cc" : "lastReportedPosZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastReportedYawField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cd" : "lastReportedYaw", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastReportedYawField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cd" : "lastReportedYaw", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastTickPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "M" : "lastTickPosX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastTickPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "M" : "lastTickPosX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastTickPosYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "N" : "lastTickPosY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastTickPosYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "N" : "lastTickPosY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastTickPosZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "O" : "lastTickPosZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastTickPosZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "O" : "lastTickPosZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLimbSwingField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aI" : "limbSwing", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLimbSwingField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aI" : "limbSwing", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLimbSwingAmountField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aH" : "limbSwingAmount", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLimbSwingAmountField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aH" : "limbSwingAmount", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMainHandField", isObfuscated ? "()Lkh;" : "()Lnet/minecraft/network/datasync/DataParameter;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bs" : "MAIN_HAND", isObfuscated ? "Lkh;" : "Lnet/minecraft/network/datasync/DataParameter;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMaxHurtResistantTimeField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aJ" : "maxHurtResistantTime", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMaxHurtResistantTimeField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aJ" : "maxHurtResistantTime", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMaxHurtTimeField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aA" : "maxHurtTime", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMaxHurtTimeField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aA" : "maxHurtTime", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMcField", isObfuscated ? "()Lbcx;" : "()Lnet/minecraft/client/Minecraft;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "f" : "mc", isObfuscated ? "Lbcx;" : "Lnet/minecraft/client/Minecraft;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMcField", isObfuscated ? "(Lbcx;)V" : "(Lnet/minecraft/client/Minecraft;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "f" : "mc", isObfuscated ? "Lbcx;" : "Lnet/minecraft/client/Minecraft;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMotionXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "s" : "motionX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMotionXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "s" : "motionX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMotionYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "t" : "motionY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMotionYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "t" : "motionY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMotionZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "u" : "motionZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMotionZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "u" : "motionZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMoveForwardField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bg" : "moveForward", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMoveForwardField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bg" : "moveForward", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMoveStrafingField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bf" : "moveStrafing", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMoveStrafingField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bf" : "moveStrafing", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMovedDistanceField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aZ" : "movedDistance", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMovedDistanceField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aZ" : "movedDistance", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMovementInputField", isObfuscated ? "()Lbnl;" : "()Lnet/minecraft/util/MovementInput;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "e" : "movementInput", isObfuscated ? "Lbnl;" : "Lnet/minecraft/util/MovementInput;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMovementInputField", isObfuscated ? "(Lbnl;)V" : "(Lnet/minecraft/util/MovementInput;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "e" : "movementInput", isObfuscated ? "Lbnl;" : "Lnet/minecraft/util/MovementInput;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getNewPosRotationIncrementsField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bi" : "newPosRotationIncrements", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setNewPosRotationIncrementsField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bi" : "newPosRotationIncrements", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getNewPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bn" : "interpEntityPlayerSPPitch", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setNewPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bn" : "interpEntityPlayerSPPitch", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getNoClipField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "Q" : "noClip", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setNoClipField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "Q" : "noClip", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getOnGroundField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "z" : "onGround", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setOnGroundField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "z" : "onGround", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getOnGroundSpeedFactorField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aY" : "onGroundSpeedFactor", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setOnGroundSpeedFactorField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aY" : "onGroundSpeedFactor", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getOpenContainerField", isObfuscated ? "()Labd;" : "()Lnet/minecraft/inventory/Container;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bv" : "openContainer", isObfuscated ? "Labd;" : "Lnet/minecraft/inventory/Container;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setOpenContainerField", isObfuscated ? "(Labd;)V" : "(Lnet/minecraft/inventory/Container;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bv" : "openContainer", isObfuscated ? "Labd;" : "Lnet/minecraft/inventory/Container;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPermissionLevelField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bZ" : "permissionLevel", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPermissionLevelField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bZ" : "permissionLevel", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPlayerLocationField", isObfuscated ? "()Lcm;" : "()Lnet/minecraft/util/math/BlockPos;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bI" : "bedLocation", isObfuscated ? "Lcm;" : "Lnet/minecraft/util/math/BlockPos;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPlayerLocationField", isObfuscated ? "(Lcm;)V" : "(Lnet/minecraft/util/math/BlockPos;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bI" : "bedLocation", isObfuscated ? "Lcm;" : "Lnet/minecraft/util/math/BlockPos;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPlayerModelFlagField", isObfuscated ? "()Lkh;" : "()Lnet/minecraft/network/datasync/DataParameter;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "br" : "PLAYER_MODEL_FLAG", isObfuscated ? "Lkh;" : "Lnet/minecraft/network/datasync/DataParameter;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPortalCounterField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "am" : "portalCounter", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPortalCounterField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "am" : "portalCounter", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "p" : "posX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "p" : "posX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPosYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "q" : "posY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPosYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "q" : "posY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPosZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "r" : "posZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPosZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "r" : "posZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPositionUpdateTicksField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ci" : "positionUpdateTicks", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPositionUpdateTicksField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ci" : "positionUpdateTicks", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevCameraPitchField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aK" : "prevCameraPitch", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevCameraPitchField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aK" : "prevCameraPitch", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevCameraYawField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "by" : "prevCameraYaw", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevCameraYawField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "by" : "prevCameraYaw", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevChasingPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bB" : "prevChasingPosX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevChasingPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bB" : "prevChasingPosX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevChasingPosYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bC" : "prevChasingPosY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevChasingPosYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bC" : "prevChasingPosY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevChasingPosZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bD" : "prevChasingPosZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevChasingPosZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bD" : "prevChasingPosZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevDistanceWalkedModifiedField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "I" : "prevDistanceWalkedModified", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevDistanceWalkedModifiedField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "I" : "prevDistanceWalkedModified", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevLimbSwingAmountField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aG" : "prevLimbSwingAmount", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevLimbSwingAmountField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aG" : "prevLimbSwingAmount", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevMovedDistanceField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ba" : "prevMovedDistance", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevMovedDistanceField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ba" : "prevMovedDistance", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevOnGroundField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cf" : "prevOnGround", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevOnGroundField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cf" : "prevOnGround", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevOnGroundSpeedFactorField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aX" : "prevOnGroundSpeedFactor", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevOnGroundSpeedFactorField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aX" : "prevOnGroundSpeedFactor", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "m" : "prevPosX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "m" : "prevPosX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevPosYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "n" : "prevPosY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevPosYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "n" : "prevPosY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevPosZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "o" : "prevPosZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevPosZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "o" : "prevPosZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevRenderArmPitchField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bV" : "prevRenderArmPitch", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevRenderArmPitchField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bV" : "prevRenderArmPitch", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevRenderArmYawField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bU" : "prevRenderArmYaw", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevRenderArmYawField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bU" : "prevRenderArmYaw", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevRenderYawOffsetField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aP" : "prevRenderYawOffset", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevRenderYawOffsetField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aP" : "prevRenderYawOffset", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevRotationPitchField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "y" : "prevRotationPitch", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevRotationPitchField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "y" : "prevRotationPitch", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevRotationYawField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "x" : "prevRotationYaw", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevRotationYawField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "x" : "prevRotationYaw", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevRotationYawHeadField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aR" : "prevRotationYawHead", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevRotationYawHeadField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aR" : "prevRotationYawHead", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevSwingProgressField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aD" : "prevSwingProgress", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevSwingProgressField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aD" : "prevSwingProgress", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevTimeInPortalField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bX" : "prevTimeInPortal", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevTimeInPortalField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bX" : "prevTimeInPortal", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPreventEntitySpawningField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "i" : "preventEntitySpawning", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPreventEntitySpawningField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "i" : "preventEntitySpawning", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRandField", "()Ljava/util/Random;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "S" : "rand", "Ljava/util/Random;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRandField", "(Ljava/util/Random;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "S" : "rand", "Ljava/util/Random;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRandomNumberBetweenOneHundredthAndTwoHundredthField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aN" : "randomUnused1", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRandomNumberBetweenOneHundredthAndTwoHundredthField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aN" : "randomUnused1", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRandomNumberBetweenZeroAndTwelveThousandThreeHundredNinetyEightField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aM" : "randomUnused2", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRandomNumberBetweenZeroAndTwelveThousandThreeHundredNinetyEightField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aM" : "randomUnused2", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRandomYawVelocityField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bh" : "randomYawVelocity", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRandomYawVelocityField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bh" : "randomYawVelocity", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRecentlyHitField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aU" : "recentlyHit", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRecentlyHitField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aU" : "recentlyHit", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRenderArmPitchField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bT" : "renderArmPitch", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRenderArmPitchField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bT" : "renderArmPitch", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRenderArmYawField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bS" : "renderArmYaw", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRenderArmYawField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bS" : "renderArmYaw", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRenderOffsetXField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bJ" : "renderOffsetX", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRenderOffsetXField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bJ" : "renderOffsetX", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRenderOffsetYField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cn" : "renderOffsetY", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRenderOffsetYField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cn" : "renderOffsetY", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRenderOffsetZField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bK" : "renderOffsetZ", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRenderOffsetZField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bK" : "renderOffsetZ", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRenderYawOffsetField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aO" : "renderYawOffset", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRenderYawOffsetField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aO" : "renderYawOffset", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRideCooldownField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "j" : "rideCooldown", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRideCooldownField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "j" : "rideCooldown", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRotationPitchField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "w" : "rotationPitch", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRotationPitchField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "w" : "rotationPitch", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRotationYawField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "v" : "rotationYaw", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRotationYawField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "v" : "rotationYaw", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRotationYawHeadField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aQ" : "rotationYawHead", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRotationYawHeadField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aQ" : "rotationYawHead", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRowingBoatField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cq" : "rowingBoat", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRowingBoatField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cq" : "rowingBoat", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getScoreValueField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bc" : "scoreValue", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setScoreValueField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bc" : "scoreValue", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSendQueueField", isObfuscated ? "()Lbll;" : "()Lnet/minecraft/client/network/NetHandlerPlayClient;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "d" : "connection", isObfuscated ? "Lbll;" : "Lnet/minecraft/client/network/NetHandlerPlayClient;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getServerBrandField", "()Ljava/lang/String;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ck" : "serverBrand", "Ljava/lang/String;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setServerBrandField", "(Ljava/lang/String;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ck" : "serverBrand", "Ljava/lang/String;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getServerPosXField", "()J", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "af" : "serverPosX", "J"); - mv.visitInsn(Opcodes.LRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setServerPosXField", "(J)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.LLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "af" : "serverPosX", "J"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getServerPosYField", "()J", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ag" : "serverPosY", "J"); - mv.visitInsn(Opcodes.LRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setServerPosYField", "(J)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.LLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ag" : "serverPosY", "J"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getServerPosZField", "()J", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ah" : "serverPosZ", "J"); - mv.visitInsn(Opcodes.LRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setServerPosZField", "(J)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.LLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ah" : "serverPosZ", "J"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getServerSneakStateField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cg" : "serverSneakState", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setServerSneakStateField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "cg" : "serverSneakState", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getServerSprintStateField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ch" : "serverSprintState", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setServerSprintStateField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ch" : "serverSprintState", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSleepingField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bH" : "sleeping", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSleepingField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bH" : "sleeping", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSpeedInAirField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bQ" : "speedInAir", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSpeedInAirField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bQ" : "speedInAir", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSpeedOnGroundField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bP" : "speedOnGround", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSpeedOnGroundField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bP" : "speedOnGround", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSprintToggleTimerField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "g" : "sprintToggleTimer", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSprintToggleTimerField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "g" : "sprintToggleTimer", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSprintingTicksLeftField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "h" : "sprintingTicksLeft", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSprintingTicksLeftField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "h" : "sprintingTicksLeft", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getStatWriterField", isObfuscated ? "()Lnx;" : "()Lnet/minecraft/stats/StatisticsManager;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bY" : "statWriter", isObfuscated ? "Lnx;" : "Lnet/minecraft/stats/StatisticsManager;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getStepHeightField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "P" : "stepHeight", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setStepHeightField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "P" : "stepHeight", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSwingProgressField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aE" : "swingProgress", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSwingProgressField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aE" : "swingProgress", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSwingProgressIntField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ax" : "swingProgressInt", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSwingProgressIntField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ax" : "swingProgressInt", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSwingingHandField", isObfuscated ? "()Lqr;" : "()Lnet/minecraft/util/EnumHand;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aw" : "swingingHand", isObfuscated ? "Lqr;" : "Lnet/minecraft/util/EnumHand;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSwingingHandField", isObfuscated ? "(Lqr;)V" : "(Lnet/minecraft/util/EnumHand;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aw" : "swingingHand", isObfuscated ? "Lqr;" : "Lnet/minecraft/util/EnumHand;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTeleportDirectionField", isObfuscated ? "()Lct;" : "()Lnet/minecraft/util/EnumFacing;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aq" : "teleportDirection", isObfuscated ? "Lct;" : "Lnet/minecraft/util/EnumFacing;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTeleportDirectionField", isObfuscated ? "(Lct;)V" : "(Lnet/minecraft/util/EnumFacing;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aq" : "teleportDirection", isObfuscated ? "Lct;" : "Lnet/minecraft/util/EnumFacing;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTicksElytraFlyingField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bq" : "ticksElytraFlying", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTicksElytraFlyingField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bq" : "ticksElytraFlying", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTicksExistedField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "T" : "ticksExisted", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTicksExistedField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "T" : "ticksExisted", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTicksSinceLastSwingField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aF" : "ticksSinceLastSwing", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTicksSinceLastSwingField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "aF" : "ticksSinceLastSwing", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTimeInPortalField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bW" : "timeInPortal", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTimeInPortalField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bW" : "timeInPortal", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTimeUntilPortalField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ak" : "timeUntilPortal", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTimeUntilPortalField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "ak" : "timeUntilPortal", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getVelocityChangedField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "D" : "velocityChanged", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setVelocityChangedField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "D" : "velocityChanged", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getWidthField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "G" : "width", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setWidthField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "G" : "width", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getWorldObjField", isObfuscated ? "()Laid;" : "()Lnet/minecraft/world/World;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "l" : "worldObj", isObfuscated ? "Laid;" : "Lnet/minecraft/world/World;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setWorldObjField", isObfuscated ? "(Laid;)V" : "(Lnet/minecraft/world/World;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "l" : "worldObj", isObfuscated ? "Laid;" : "Lnet/minecraft/world/World;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getXpCooldownField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bA" : "xpCooldown", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setXpCooldownField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", isObfuscated ? "bA" : "xpCooldown", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getClientPlayerBase", "(Ljava/lang/String;)Lapi/player/client/ClientPlayerBase;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "getClientPlayerBase", "(Lapi/player/client/IClientPlayerAPI;Ljava/lang/String;)Lapi/player/client/ClientPlayerBase;", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getClientPlayerBaseIds", "()Ljava/util/Set;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "getClientPlayerBaseIds", "(Lapi/player/client/IClientPlayerAPI;)Ljava/util/Set;", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "dynamic", "(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "dynamic", "(Lapi/player/client/IClientPlayerAPI;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getClientPlayerAPI", "()Lapi/player/client/ClientPlayerAPI;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", "clientPlayerAPI", "Lapi/player/client/ClientPlayerAPI;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getEntityPlayerSP", isObfuscated ? "()Lbnn;" : "()Lnet/minecraft/client/entity/EntityPlayerSP;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - cv.visitField(Opcodes.ACC_PRIVATE | Opcodes.ACC_FINAL, "clientPlayerAPI", "Lapi/player/client/ClientPlayerAPI;", null, null); - } -} diff --git a/dependencies/main/java/api/player/client/ClientPlayerConstructorVisitor.java b/dependencies/main/java/api/player/client/ClientPlayerConstructorVisitor.java deleted file mode 100644 index 83ee6faff7..0000000000 --- a/dependencies/main/java/api/player/client/ClientPlayerConstructorVisitor.java +++ /dev/null @@ -1,66 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.client; - -import org.objectweb.asm.*; - -public final class ClientPlayerConstructorVisitor extends MethodVisitor -{ - private final boolean isObfuscated; - - public ClientPlayerConstructorVisitor(MethodVisitor paramMethodVisitor, boolean isObfuscated) - { - super(262144, paramMethodVisitor); - this.isObfuscated = isObfuscated; - } - - @Override - public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) - { - super.visitMethodInsn(opcode, owner, name, desc, itf); - if(name.equals("") && owner.equals(isObfuscated ? "bnk" : "net/minecraft/client/entity/AbstractClientPlayer")) - { - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "create", "(Lapi/player/client/IClientPlayerAPI;)Lapi/player/client/ClientPlayerAPI;", false); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "bnn" : "net/minecraft/client/entity/EntityPlayerSP", "clientPlayerAPI", "Lapi/player/client/ClientPlayerAPI;"); - - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitVarInsn(Opcodes.ALOAD, 3); - mv.visitVarInsn(Opcodes.ALOAD, 4); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "beforeLocalConstructing", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/client/Minecraft;Lnet/minecraft/world/World;Lnet/minecraft/client/network/NetHandlerPlayClient;Lnet/minecraft/stats/StatisticsManager;)V", false); - } - } - - public void visitInsn(int opcode) - { - if(opcode == Opcodes.RETURN) - { - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitVarInsn(Opcodes.ALOAD, 3); - mv.visitVarInsn(Opcodes.ALOAD, 4); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/client/ClientPlayerAPI", "afterLocalConstructing", "(Lapi/player/client/IClientPlayerAPI;Lnet/minecraft/client/Minecraft;Lnet/minecraft/world/World;Lnet/minecraft/client/network/NetHandlerPlayClient;Lnet/minecraft/stats/StatisticsManager;)V", false); - } - super.visitInsn(opcode); - } -} diff --git a/dependencies/main/java/api/player/client/IClientPlayer.java b/dependencies/main/java/api/player/client/IClientPlayer.java deleted file mode 100644 index a98962e9bc..0000000000 --- a/dependencies/main/java/api/player/client/IClientPlayer.java +++ /dev/null @@ -1,1085 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.client; - -public interface IClientPlayer -{ - ClientPlayerBase getClientPlayerBase(String baseId); - - java.util.Set getClientPlayerBaseIds(); - - Object dynamic(String key, Object[] parameters); - - void realAddExhaustion(float paramFloat); - - void superAddExhaustion(float paramFloat); - - void localAddExhaustion(float paramFloat); - - void realAddMovementStat(double paramDouble1, double paramDouble2, double paramDouble3); - - void superAddMovementStat(double paramDouble1, double paramDouble2, double paramDouble3); - - void localAddMovementStat(double paramDouble1, double paramDouble2, double paramDouble3); - - void realAddStat(net.minecraft.stats.StatBase paramStatBase, int paramInt); - - void superAddStat(net.minecraft.stats.StatBase paramStatBase, int paramInt); - - void localAddStat(net.minecraft.stats.StatBase paramStatBase, int paramInt); - - boolean realAttackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat); - - boolean superAttackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat); - - boolean localAttackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat); - - void realAttackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity); - - void superAttackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity); - - void localAttackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity); - - boolean realCanBreatheUnderwater(); - - boolean superCanBreatheUnderwater(); - - boolean localCanBreatheUnderwater(); - - boolean realCanHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState); - - boolean superCanHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState); - - boolean localCanHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState); - - boolean realCanPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack); - - boolean superCanPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack); - - boolean localCanPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack); - - boolean realCanTriggerWalking(); - - boolean superCanTriggerWalking(); - - boolean localCanTriggerWalking(); - - void realCloseScreen(); - - void superCloseScreen(); - - void localCloseScreen(); - - void realDamageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat); - - void superDamageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat); - - void localDamageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat); - - void realDisplayGui(net.minecraft.world.IInteractionObject paramIInteractionObject); - - void superDisplayGui(net.minecraft.world.IInteractionObject paramIInteractionObject); - - void localDisplayGui(net.minecraft.world.IInteractionObject paramIInteractionObject); - - void realDisplayGUIChest(net.minecraft.inventory.IInventory paramIInventory); - - void superDisplayGUIChest(net.minecraft.inventory.IInventory paramIInventory); - - void localDisplayGUIChest(net.minecraft.inventory.IInventory paramIInventory); - - net.minecraft.entity.item.EntityItem realDropItem(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean1, boolean paramBoolean2); - - net.minecraft.entity.item.EntityItem superDropItem(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean1, boolean paramBoolean2); - - net.minecraft.entity.item.EntityItem localDropItem(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean1, boolean paramBoolean2); - - net.minecraft.entity.item.EntityItem realDropOneItem(boolean paramBoolean); - - net.minecraft.entity.item.EntityItem superDropOneItem(boolean paramBoolean); - - net.minecraft.entity.item.EntityItem localDropOneItem(boolean paramBoolean); - - net.minecraft.entity.item.EntityItem realDropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean); - - net.minecraft.entity.item.EntityItem superDropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean); - - net.minecraft.entity.item.EntityItem localDropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean); - - void realFall(float paramFloat1, float paramFloat2); - - void superFall(float paramFloat1, float paramFloat2); - - void localFall(float paramFloat1, float paramFloat2); - - float realGetAIMoveSpeed(); - - float superGetAIMoveSpeed(); - - float localGetAIMoveSpeed(); - - float realGetBedOrientationInDegrees(); - - float superGetBedOrientationInDegrees(); - - float localGetBedOrientationInDegrees(); - - float realGetBrightness(float paramFloat); - - float superGetBrightness(float paramFloat); - - float localGetBrightness(float paramFloat); - - int realGetBrightnessForRender(float paramFloat); - - int superGetBrightnessForRender(float paramFloat); - - int localGetBrightnessForRender(float paramFloat); - - float realGetBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos); - - float superGetBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos); - - float localGetBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos); - - double realGetDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3); - - double superGetDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3); - - double localGetDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3); - - double realGetDistanceSqToEntity(net.minecraft.entity.Entity paramEntity); - - double superGetDistanceSqToEntity(net.minecraft.entity.Entity paramEntity); - - double localGetDistanceSqToEntity(net.minecraft.entity.Entity paramEntity); - - float realGetFovModifier(); - - float superGetFovModifier(); - - float localGetFovModifier(); - - net.minecraft.util.SoundEvent realGetHurtSound(); - - net.minecraft.util.SoundEvent superGetHurtSound(); - - net.minecraft.util.SoundEvent localGetHurtSound(); - - java.lang.String realGetName(); - - java.lang.String superGetName(); - - java.lang.String localGetName(); - - int realGetSleepTimer(); - - int superGetSleepTimer(); - - int localGetSleepTimer(); - - boolean realHandleWaterMovement(); - - boolean superHandleWaterMovement(); - - boolean localHandleWaterMovement(); - - void realHeal(float paramFloat); - - void superHeal(float paramFloat); - - void localHeal(float paramFloat); - - boolean realIsEntityInsideOpaqueBlock(); - - boolean superIsEntityInsideOpaqueBlock(); - - boolean localIsEntityInsideOpaqueBlock(); - - boolean realIsInWater(); - - boolean superIsInWater(); - - boolean localIsInWater(); - - boolean realIsInsideOfMaterial(net.minecraft.block.material.Material paramMaterial); - - boolean superIsInsideOfMaterial(net.minecraft.block.material.Material paramMaterial); - - boolean localIsInsideOfMaterial(net.minecraft.block.material.Material paramMaterial); - - boolean realIsOnLadder(); - - boolean superIsOnLadder(); - - boolean localIsOnLadder(); - - boolean realIsPlayerSleeping(); - - boolean superIsPlayerSleeping(); - - boolean localIsPlayerSleeping(); - - boolean realIsSneaking(); - - boolean superIsSneaking(); - - boolean localIsSneaking(); - - boolean realIsSprinting(); - - boolean superIsSprinting(); - - boolean localIsSprinting(); - - void realJump(); - - void superJump(); - - void localJump(); - - void realKnockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2); - - void superKnockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2); - - void localKnockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2); - - void realMoveEntity(double paramDouble1, double paramDouble2, double paramDouble3); - - void superMoveEntity(double paramDouble1, double paramDouble2, double paramDouble3); - - void localMoveEntity(double paramDouble1, double paramDouble2, double paramDouble3); - - void realMoveEntityWithHeading(float paramFloat1, float paramFloat2); - - void superMoveEntityWithHeading(float paramFloat1, float paramFloat2); - - void localMoveEntityWithHeading(float paramFloat1, float paramFloat2); - - void realMoveFlying(float paramFloat1, float paramFloat2, float paramFloat3); - - void superMoveFlying(float paramFloat1, float paramFloat2, float paramFloat3); - - void localMoveFlying(float paramFloat1, float paramFloat2, float paramFloat3); - - void realOnDeath(net.minecraft.util.DamageSource paramDamageSource); - - void superOnDeath(net.minecraft.util.DamageSource paramDamageSource); - - void localOnDeath(net.minecraft.util.DamageSource paramDamageSource); - - void realOnLivingUpdate(); - - void superOnLivingUpdate(); - - void localOnLivingUpdate(); - - void realOnKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase); - - void superOnKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase); - - void localOnKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase); - - void realOnStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt); - - void superOnStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt); - - void localOnStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt); - - void realOnUpdate(); - - void superOnUpdate(); - - void localOnUpdate(); - - void realPlayStepSound(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.block.Block paramBlock); - - void superPlayStepSound(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.block.Block paramBlock); - - void localPlayStepSound(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.block.Block paramBlock); - - boolean realPushOutOfBlocks(double paramDouble1, double paramDouble2, double paramDouble3); - - boolean superPushOutOfBlocks(double paramDouble1, double paramDouble2, double paramDouble3); - - boolean localPushOutOfBlocks(double paramDouble1, double paramDouble2, double paramDouble3); - - net.minecraft.util.math.RayTraceResult realRayTrace(double paramDouble, float paramFloat); - - net.minecraft.util.math.RayTraceResult superRayTrace(double paramDouble, float paramFloat); - - net.minecraft.util.math.RayTraceResult localRayTrace(double paramDouble, float paramFloat); - - void realReadEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound); - - void superReadEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound); - - void localReadEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound); - - void realRespawnPlayer(); - - void superRespawnPlayer(); - - void localRespawnPlayer(); - - void realSetDead(); - - void superSetDead(); - - void localSetDead(); - - void realSetPlayerSPHealth(float paramFloat); - - void localSetPlayerSPHealth(float paramFloat); - - void realSetPositionAndRotation(double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2); - - void superSetPositionAndRotation(double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2); - - void localSetPositionAndRotation(double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2); - - void realSetSneaking(boolean paramBoolean); - - void superSetSneaking(boolean paramBoolean); - - void localSetSneaking(boolean paramBoolean); - - void realSetSprinting(boolean paramBoolean); - - void superSetSprinting(boolean paramBoolean); - - void localSetSprinting(boolean paramBoolean); - - net.minecraft.entity.player.EntityPlayer.SleepResult realTrySleep(net.minecraft.util.math.BlockPos paramBlockPos); - - net.minecraft.entity.player.EntityPlayer.SleepResult superTrySleep(net.minecraft.util.math.BlockPos paramBlockPos); - - net.minecraft.entity.player.EntityPlayer.SleepResult localTrySleep(net.minecraft.util.math.BlockPos paramBlockPos); - - void realSwingItem(net.minecraft.util.EnumHand paramEnumHand); - - void superSwingItem(net.minecraft.util.EnumHand paramEnumHand); - - void localSwingItem(net.minecraft.util.EnumHand paramEnumHand); - - void realUpdateEntityActionState(); - - void superUpdateEntityActionState(); - - void localUpdateEntityActionState(); - - void realUpdateRidden(); - - void superUpdateRidden(); - - void localUpdateRidden(); - - void realWakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3); - - void superWakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3); - - void localWakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3); - - void realWriteEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound); - - void superWriteEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound); - - void localWriteEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound); - - net.minecraft.util.EnumHand getActiveHandField(); - - void setActiveHandField(net.minecraft.util.EnumHand activeHand); - - net.minecraft.item.ItemStack getActiveItemStackField(); - - void setActiveItemStackField(net.minecraft.item.ItemStack activeItemStack); - - int getActiveItemStackUseCountField(); - - void setActiveItemStackUseCountField(int activeItemStackUseCount); - - boolean getAddedToChunkField(); - - void setAddedToChunkField(boolean addedToChunk); - - int getArrowHitTimerField(); - - void setArrowHitTimerField(int arrowHitTimer); - - float getAttackedAtYawField(); - - void setAttackedAtYawField(float attackedAtYaw); - - net.minecraft.entity.player.EntityPlayer getAttackingPlayerField(); - - void setAttackingPlayerField(net.minecraft.entity.player.EntityPlayer attackingPlayer); - - boolean getAutoJumpEnabledField(); - - void setAutoJumpEnabledField(boolean autoJumpEnabled); - - int getAutoJumpRequiredField(); - - void setAutoJumpRequiredField(int autoJumpRequired); - - java.lang.String getCachedUniqueIdStringField(); - - void setCachedUniqueIdStringField(java.lang.String cachedUniqueIdString); - - float getCameraPitchField(); - - void setCameraPitchField(float cameraPitch); - - float getCameraYawField(); - - void setCameraYawField(float cameraYaw); - - net.minecraft.entity.player.PlayerCapabilities getCapabilitiesField(); - - void setCapabilitiesField(net.minecraft.entity.player.PlayerCapabilities capabilities); - - double getChasingPosXField(); - - void setChasingPosXField(double chasingPosX); - - double getChasingPosYField(); - - void setChasingPosYField(double chasingPosY); - - double getChasingPosZField(); - - void setChasingPosZField(double chasingPosZ); - - int getChunkCoordXField(); - - void setChunkCoordXField(int chunkCoordX); - - int getChunkCoordYField(); - - void setChunkCoordYField(int chunkCoordY); - - int getChunkCoordZField(); - - void setChunkCoordZField(int chunkCoordZ); - - net.minecraft.network.datasync.EntityDataManager getDataWatcherField(); - - void setDataWatcherField(net.minecraft.network.datasync.EntityDataManager dataWatcher); - - boolean getDeadField(); - - void setDeadField(boolean dead); - - int getDeathTimeField(); - - void setDeathTimeField(int deathTime); - - int getDimensionField(); - - void setDimensionField(int dimension); - - float getDistanceWalkedModifiedField(); - - void setDistanceWalkedModifiedField(float distanceWalkedModified); - - float getDistanceWalkedOnStepModifiedField(); - - void setDistanceWalkedOnStepModifiedField(float distanceWalkedOnStepModified); - - int getEntityAgeField(); - - void setEntityAgeField(int entityAge); - - float getEntityCollisionReductionField(); - - void setEntityCollisionReductionField(float entityCollisionReduction); - - java.util.UUID getEntityUniqueIDField(); - - void setEntityUniqueIDField(java.util.UUID entityUniqueID); - - float getExperienceField(); - - void setExperienceField(float experience); - - int getExperienceLevelField(); - - void setExperienceLevelField(int experienceLevel); - - int getExperienceTotalField(); - - void setExperienceTotalField(int experienceTotal); - - float getFallDistanceField(); - - void setFallDistanceField(float fallDistance); - - int getFireResistanceField(); - - void setFireResistanceField(int fireResistance); - - boolean getFirstUpdateField(); - - void setFirstUpdateField(boolean firstUpdate); - - net.minecraft.entity.projectile.EntityFishHook getFishEntityField(); - - void setFishEntityField(net.minecraft.entity.projectile.EntityFishHook fishEntity); - - net.minecraft.network.datasync.DataParameter getFlagsField(); - - int getFlyToggleTimerField(); - - void setFlyToggleTimerField(int flyToggleTimer); - - net.minecraft.util.FoodStats getFoodStatsField(); - - void setFoodStatsField(net.minecraft.util.FoodStats foodStats); - - boolean getForceSpawnField(); - - void setForceSpawnField(boolean forceSpawn); - - boolean getGlowingField(); - - void setGlowingField(boolean glowing); - - boolean getHandActiveField(); - - void setHandActiveField(boolean handActive); - - net.minecraft.network.datasync.DataParameter getHandStatesField(); - - boolean getHasValidHealthField(); - - void setHasValidHealthField(boolean hasValidHealth); - - float getHeightField(); - - void setHeightField(float height); - - float getHorseJumpPowerField(); - - void setHorseJumpPowerField(float horseJumpPower); - - int getHorseJumpPowerCounterField(); - - void setHorseJumpPowerCounterField(int horseJumpPowerCounter); - - float getHundredEightyField(); - - void setHundredEightyField(float hundredEighty); - - int getHurtResistantTimeField(); - - void setHurtResistantTimeField(int hurtResistantTime); - - int getHurtTimeField(); - - void setHurtTimeField(int hurtTime); - - boolean getIgnoreFrustumCheckField(); - - void setIgnoreFrustumCheckField(boolean ignoreFrustumCheck); - - boolean getInPortalField(); - - void setInPortalField(boolean inPortal); - - boolean getInWaterField(); - - void setInWaterField(boolean inWater); - - double getInterpTargetXField(); - - void setInterpTargetXField(double interpTargetX); - - double getInterpTargetYField(); - - void setInterpTargetYField(double interpTargetY); - - double getInterpTargetYawField(); - - void setInterpTargetYawField(double interpTargetYaw); - - double getInterpTargetZField(); - - void setInterpTargetZField(double interpTargetZ); - - net.minecraft.entity.player.InventoryPlayer getInventoryField(); - - void setInventoryField(net.minecraft.entity.player.InventoryPlayer inventory); - - net.minecraft.inventory.Container getInventoryContainerField(); - - void setInventoryContainerField(net.minecraft.inventory.Container inventoryContainer); - - boolean getIsAirBorneField(); - - void setIsAirBorneField(boolean isAirBorne); - - boolean getIsCollidedField(); - - void setIsCollidedField(boolean isCollided); - - boolean getIsCollidedHorizontallyField(); - - void setIsCollidedHorizontallyField(boolean isCollidedHorizontally); - - boolean getIsCollidedVerticallyField(); - - void setIsCollidedVerticallyField(boolean isCollidedVertically); - - boolean getIsDeadField(); - - void setIsDeadField(boolean isDead); - - boolean getIsElytraFlyingField(); - - void setIsElytraFlyingField(boolean isElytraFlying); - - boolean getIsImmuneToFireField(); - - void setIsImmuneToFireField(boolean isImmuneToFire); - - boolean getIsInWebField(); - - void setIsInWebField(boolean isInWeb); - - boolean getIsJumpingField(); - - void setIsJumpingField(boolean isJumping); - - boolean getIsSwingInProgressField(); - - void setIsSwingInProgressField(boolean isSwingInProgress); - - float getJumpMovementFactorField(); - - void setJumpMovementFactorField(float jumpMovementFactor); - - float getLastDamageField(); - - void setLastDamageField(float lastDamage); - - net.minecraft.util.math.BlockPos getLastPortalPosField(); - - void setLastPortalPosField(net.minecraft.util.math.BlockPos lastPortalPos); - - net.minecraft.util.math.Vec3d getLastPortalVecField(); - - void setLastPortalVecField(net.minecraft.util.math.Vec3d lastPortalVec); - - float getLastReportedPitchField(); - - void setLastReportedPitchField(float lastReportedPitch); - - double getLastReportedPosXField(); - - void setLastReportedPosXField(double lastReportedPosX); - - double getLastReportedPosYField(); - - void setLastReportedPosYField(double lastReportedPosY); - - double getLastReportedPosZField(); - - void setLastReportedPosZField(double lastReportedPosZ); - - float getLastReportedYawField(); - - void setLastReportedYawField(float lastReportedYaw); - - double getLastTickPosXField(); - - void setLastTickPosXField(double lastTickPosX); - - double getLastTickPosYField(); - - void setLastTickPosYField(double lastTickPosY); - - double getLastTickPosZField(); - - void setLastTickPosZField(double lastTickPosZ); - - float getLimbSwingField(); - - void setLimbSwingField(float limbSwing); - - float getLimbSwingAmountField(); - - void setLimbSwingAmountField(float limbSwingAmount); - - net.minecraft.network.datasync.DataParameter getMainHandField(); - - int getMaxHurtResistantTimeField(); - - void setMaxHurtResistantTimeField(int maxHurtResistantTime); - - int getMaxHurtTimeField(); - - void setMaxHurtTimeField(int maxHurtTime); - - net.minecraft.client.Minecraft getMcField(); - - void setMcField(net.minecraft.client.Minecraft mc); - - double getMotionXField(); - - void setMotionXField(double motionX); - - double getMotionYField(); - - void setMotionYField(double motionY); - - double getMotionZField(); - - void setMotionZField(double motionZ); - - float getMoveForwardField(); - - void setMoveForwardField(float moveForward); - - float getMoveStrafingField(); - - void setMoveStrafingField(float moveStrafing); - - float getMovedDistanceField(); - - void setMovedDistanceField(float movedDistance); - - net.minecraft.util.MovementInput getMovementInputField(); - - void setMovementInputField(net.minecraft.util.MovementInput movementInput); - - int getNewPosRotationIncrementsField(); - - void setNewPosRotationIncrementsField(int newPosRotationIncrements); - - double getNewPosXField(); - - void setNewPosXField(double newPosX); - - boolean getNoClipField(); - - void setNoClipField(boolean noClip); - - boolean getOnGroundField(); - - void setOnGroundField(boolean onGround); - - float getOnGroundSpeedFactorField(); - - void setOnGroundSpeedFactorField(float onGroundSpeedFactor); - - net.minecraft.inventory.Container getOpenContainerField(); - - void setOpenContainerField(net.minecraft.inventory.Container openContainer); - - int getPermissionLevelField(); - - void setPermissionLevelField(int permissionLevel); - - net.minecraft.util.math.BlockPos getPlayerLocationField(); - - void setPlayerLocationField(net.minecraft.util.math.BlockPos playerLocation); - - net.minecraft.network.datasync.DataParameter getPlayerModelFlagField(); - - int getPortalCounterField(); - - void setPortalCounterField(int portalCounter); - - double getPosXField(); - - void setPosXField(double posX); - - double getPosYField(); - - void setPosYField(double posY); - - double getPosZField(); - - void setPosZField(double posZ); - - int getPositionUpdateTicksField(); - - void setPositionUpdateTicksField(int positionUpdateTicks); - - float getPrevCameraPitchField(); - - void setPrevCameraPitchField(float prevCameraPitch); - - float getPrevCameraYawField(); - - void setPrevCameraYawField(float prevCameraYaw); - - double getPrevChasingPosXField(); - - void setPrevChasingPosXField(double prevChasingPosX); - - double getPrevChasingPosYField(); - - void setPrevChasingPosYField(double prevChasingPosY); - - double getPrevChasingPosZField(); - - void setPrevChasingPosZField(double prevChasingPosZ); - - float getPrevDistanceWalkedModifiedField(); - - void setPrevDistanceWalkedModifiedField(float prevDistanceWalkedModified); - - float getPrevLimbSwingAmountField(); - - void setPrevLimbSwingAmountField(float prevLimbSwingAmount); - - float getPrevMovedDistanceField(); - - void setPrevMovedDistanceField(float prevMovedDistance); - - boolean getPrevOnGroundField(); - - void setPrevOnGroundField(boolean prevOnGround); - - float getPrevOnGroundSpeedFactorField(); - - void setPrevOnGroundSpeedFactorField(float prevOnGroundSpeedFactor); - - double getPrevPosXField(); - - void setPrevPosXField(double prevPosX); - - double getPrevPosYField(); - - void setPrevPosYField(double prevPosY); - - double getPrevPosZField(); - - void setPrevPosZField(double prevPosZ); - - float getPrevRenderArmPitchField(); - - void setPrevRenderArmPitchField(float prevRenderArmPitch); - - float getPrevRenderArmYawField(); - - void setPrevRenderArmYawField(float prevRenderArmYaw); - - float getPrevRenderYawOffsetField(); - - void setPrevRenderYawOffsetField(float prevRenderYawOffset); - - float getPrevRotationPitchField(); - - void setPrevRotationPitchField(float prevRotationPitch); - - float getPrevRotationYawField(); - - void setPrevRotationYawField(float prevRotationYaw); - - float getPrevRotationYawHeadField(); - - void setPrevRotationYawHeadField(float prevRotationYawHead); - - float getPrevSwingProgressField(); - - void setPrevSwingProgressField(float prevSwingProgress); - - float getPrevTimeInPortalField(); - - void setPrevTimeInPortalField(float prevTimeInPortal); - - boolean getPreventEntitySpawningField(); - - void setPreventEntitySpawningField(boolean preventEntitySpawning); - - java.util.Random getRandField(); - - void setRandField(java.util.Random rand); - - float getRandomNumberBetweenOneHundredthAndTwoHundredthField(); - - void setRandomNumberBetweenOneHundredthAndTwoHundredthField(float randomNumberBetweenOneHundredthAndTwoHundredth); - - float getRandomNumberBetweenZeroAndTwelveThousandThreeHundredNinetyEightField(); - - void setRandomNumberBetweenZeroAndTwelveThousandThreeHundredNinetyEightField(float randomNumberBetweenZeroAndTwelveThousandThreeHundredNinetyEight); - - float getRandomYawVelocityField(); - - void setRandomYawVelocityField(float randomYawVelocity); - - int getRecentlyHitField(); - - void setRecentlyHitField(int recentlyHit); - - float getRenderArmPitchField(); - - void setRenderArmPitchField(float renderArmPitch); - - float getRenderArmYawField(); - - void setRenderArmYawField(float renderArmYaw); - - float getRenderOffsetXField(); - - void setRenderOffsetXField(float renderOffsetX); - - float getRenderOffsetYField(); - - void setRenderOffsetYField(float renderOffsetY); - - float getRenderOffsetZField(); - - void setRenderOffsetZField(float renderOffsetZ); - - float getRenderYawOffsetField(); - - void setRenderYawOffsetField(float renderYawOffset); - - int getRideCooldownField(); - - void setRideCooldownField(int rideCooldown); - - float getRotationPitchField(); - - void setRotationPitchField(float rotationPitch); - - float getRotationYawField(); - - void setRotationYawField(float rotationYaw); - - float getRotationYawHeadField(); - - void setRotationYawHeadField(float rotationYawHead); - - boolean getRowingBoatField(); - - void setRowingBoatField(boolean rowingBoat); - - int getScoreValueField(); - - void setScoreValueField(int scoreValue); - - net.minecraft.client.network.NetHandlerPlayClient getSendQueueField(); - - java.lang.String getServerBrandField(); - - void setServerBrandField(java.lang.String serverBrand); - - long getServerPosXField(); - - void setServerPosXField(long serverPosX); - - long getServerPosYField(); - - void setServerPosYField(long serverPosY); - - long getServerPosZField(); - - void setServerPosZField(long serverPosZ); - - boolean getServerSneakStateField(); - - void setServerSneakStateField(boolean serverSneakState); - - boolean getServerSprintStateField(); - - void setServerSprintStateField(boolean serverSprintState); - - boolean getSleepingField(); - - void setSleepingField(boolean sleeping); - - float getSpeedInAirField(); - - void setSpeedInAirField(float speedInAir); - - float getSpeedOnGroundField(); - - void setSpeedOnGroundField(float speedOnGround); - - int getSprintToggleTimerField(); - - void setSprintToggleTimerField(int sprintToggleTimer); - - int getSprintingTicksLeftField(); - - void setSprintingTicksLeftField(int sprintingTicksLeft); - - net.minecraft.stats.StatisticsManager getStatWriterField(); - - float getStepHeightField(); - - void setStepHeightField(float stepHeight); - - float getSwingProgressField(); - - void setSwingProgressField(float swingProgress); - - int getSwingProgressIntField(); - - void setSwingProgressIntField(int swingProgressInt); - - net.minecraft.util.EnumHand getSwingingHandField(); - - void setSwingingHandField(net.minecraft.util.EnumHand swingingHand); - - net.minecraft.util.EnumFacing getTeleportDirectionField(); - - void setTeleportDirectionField(net.minecraft.util.EnumFacing teleportDirection); - - int getTicksElytraFlyingField(); - - void setTicksElytraFlyingField(int ticksElytraFlying); - - int getTicksExistedField(); - - void setTicksExistedField(int ticksExisted); - - int getTicksSinceLastSwingField(); - - void setTicksSinceLastSwingField(int ticksSinceLastSwing); - - float getTimeInPortalField(); - - void setTimeInPortalField(float timeInPortal); - - int getTimeUntilPortalField(); - - void setTimeUntilPortalField(int timeUntilPortal); - - boolean getVelocityChangedField(); - - void setVelocityChangedField(boolean velocityChanged); - - float getWidthField(); - - void setWidthField(float width); - - net.minecraft.world.World getWorldObjField(); - - void setWorldObjField(net.minecraft.world.World worldObj); - - int getXpCooldownField(); - - void setXpCooldownField(int xpCooldown); - -} diff --git a/dependencies/main/java/api/player/client/IClientPlayerAPI.java b/dependencies/main/java/api/player/client/IClientPlayerAPI.java deleted file mode 100644 index 5c2235ae6e..0000000000 --- a/dependencies/main/java/api/player/client/IClientPlayerAPI.java +++ /dev/null @@ -1,26 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.client; - -public interface IClientPlayerAPI extends IClientPlayer -{ - ClientPlayerAPI getClientPlayerAPI(); - - net.minecraft.client.entity.EntityPlayerSP getEntityPlayerSP(); -} diff --git a/dependencies/main/java/api/player/forge/PlayerAPIContainer.java b/dependencies/main/java/api/player/forge/PlayerAPIContainer.java deleted file mode 100644 index 884a223405..0000000000 --- a/dependencies/main/java/api/player/forge/PlayerAPIContainer.java +++ /dev/null @@ -1,51 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.forge; - -import java.util.*; - -import com.google.common.eventbus.*; -import net.minecraftforge.fml.common.*; - -public class PlayerAPIContainer extends DummyModContainer -{ - public PlayerAPIContainer() - { - super(createMetadata()); - } - - public boolean registerBus(EventBus bus, LoadController controller) - { - return true; - } - - private static ModMetadata createMetadata() - { - ModMetadata meta = new ModMetadata(); - - meta.modId = "PlayerAPI"; - meta.name = "Player API"; - meta.version = PlayerAPIPlugin.Version; - meta.description = "Player API for Minecraft Forge"; - meta.url = "http://www.minecraftforum.net/topic/738498-"; - meta.authorList = Arrays.asList(new String[] { "Divisor" }); - - return meta; - } -} diff --git a/dependencies/main/java/api/player/forge/PlayerAPIPlugin.java b/dependencies/main/java/api/player/forge/PlayerAPIPlugin.java deleted file mode 100644 index a5cf87b501..0000000000 --- a/dependencies/main/java/api/player/forge/PlayerAPIPlugin.java +++ /dev/null @@ -1,57 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.forge; - -import java.util.*; - -import net.minecraftforge.fml.relauncher.*; - -@IFMLLoadingPlugin.MCVersion("1.10.2") -@IFMLLoadingPlugin.TransformerExclusions("api.player.forge") -public class PlayerAPIPlugin implements IFMLLoadingPlugin -{ - public static String Version = "1.1"; - - public static boolean isObfuscated; - - public String[] getASMTransformerClass() - { - return new String[] { "api.player.forge.PlayerAPITransformer" }; - } - - public String getModContainerClass() - { - return "api.player.forge.PlayerAPIContainer"; - } - - public String getSetupClass() - { - return null; - } - - public void injectData(Map data) - { - isObfuscated = (Boolean)data.get("runtimeDeobfuscationEnabled"); - } - - public String getAccessTransformerClass() - { - return null; - } -} diff --git a/dependencies/main/java/api/player/forge/PlayerAPITransformer.java b/dependencies/main/java/api/player/forge/PlayerAPITransformer.java deleted file mode 100644 index 31bd9f48f1..0000000000 --- a/dependencies/main/java/api/player/forge/PlayerAPITransformer.java +++ /dev/null @@ -1,37 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.forge; - -import net.minecraft.launchwrapper.*; - -import api.player.client.*; -import api.player.server.*; - -public class PlayerAPITransformer implements IClassTransformer -{ - public byte[] transform(String name, String transformedName, byte[] bytes) - { - if(transformedName.equals(ClientPlayerClassVisitor.targetClassName)) - return ClientPlayerClassVisitor.transform(bytes, PlayerAPIPlugin.isObfuscated); - else if(transformedName.equals(ServerPlayerClassVisitor.targetClassName)) - return ServerPlayerClassVisitor.transform(bytes, PlayerAPIPlugin.isObfuscated); - else - return bytes; - } -} \ No newline at end of file diff --git a/dependencies/main/java/api/player/server/IServerPlayer.java b/dependencies/main/java/api/player/server/IServerPlayer.java deleted file mode 100644 index bafc46116a..0000000000 --- a/dependencies/main/java/api/player/server/IServerPlayer.java +++ /dev/null @@ -1,1005 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.server; - -public interface IServerPlayer -{ - ServerPlayerBase getServerPlayerBase(String baseId); - - java.util.Set getServerPlayerBaseIds(); - - Object dynamic(String key, Object[] parameters); - - void realAddExhaustion(float paramFloat); - - void superAddExhaustion(float paramFloat); - - void localAddExhaustion(float paramFloat); - - void realAddExperience(int paramInt); - - void superAddExperience(int paramInt); - - void localAddExperience(int paramInt); - - void realAddExperienceLevel(int paramInt); - - void superAddExperienceLevel(int paramInt); - - void localAddExperienceLevel(int paramInt); - - void realAddMovementStat(double paramDouble1, double paramDouble2, double paramDouble3); - - void superAddMovementStat(double paramDouble1, double paramDouble2, double paramDouble3); - - void localAddMovementStat(double paramDouble1, double paramDouble2, double paramDouble3); - - boolean realAttackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat); - - boolean superAttackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat); - - boolean localAttackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat); - - void realAttackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity); - - void superAttackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity); - - void localAttackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity); - - boolean realCanBreatheUnderwater(); - - boolean superCanBreatheUnderwater(); - - boolean localCanBreatheUnderwater(); - - boolean realCanHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState); - - boolean superCanHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState); - - boolean localCanHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState); - - boolean realCanPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack); - - boolean superCanPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack); - - boolean localCanPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack); - - boolean realCanTriggerWalking(); - - boolean superCanTriggerWalking(); - - boolean localCanTriggerWalking(); - - void realClonePlayer(net.minecraft.entity.player.EntityPlayer paramEntityPlayer, boolean paramBoolean); - - void superClonePlayer(net.minecraft.entity.player.EntityPlayer paramEntityPlayer, boolean paramBoolean); - - void localClonePlayer(net.minecraft.entity.player.EntityPlayer paramEntityPlayer, boolean paramBoolean); - - void realDamageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat); - - void superDamageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat); - - void localDamageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat); - - void realDisplayGui(net.minecraft.world.IInteractionObject paramIInteractionObject); - - void superDisplayGui(net.minecraft.world.IInteractionObject paramIInteractionObject); - - void localDisplayGui(net.minecraft.world.IInteractionObject paramIInteractionObject); - - void realDisplayGUIChest(net.minecraft.inventory.IInventory paramIInventory); - - void superDisplayGUIChest(net.minecraft.inventory.IInventory paramIInventory); - - void localDisplayGUIChest(net.minecraft.inventory.IInventory paramIInventory); - - net.minecraft.entity.item.EntityItem realDropOneItem(boolean paramBoolean); - - net.minecraft.entity.item.EntityItem superDropOneItem(boolean paramBoolean); - - net.minecraft.entity.item.EntityItem localDropOneItem(boolean paramBoolean); - - net.minecraft.entity.item.EntityItem realDropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean); - - net.minecraft.entity.item.EntityItem superDropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean); - - net.minecraft.entity.item.EntityItem localDropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean); - - void realFall(float paramFloat1, float paramFloat2); - - void superFall(float paramFloat1, float paramFloat2); - - void localFall(float paramFloat1, float paramFloat2); - - float realGetAIMoveSpeed(); - - float superGetAIMoveSpeed(); - - float localGetAIMoveSpeed(); - - float realGetBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos); - - float superGetBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos); - - float localGetBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos); - - double realGetDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3); - - double superGetDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3); - - double localGetDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3); - - float realGetBrightness(float paramFloat); - - float superGetBrightness(float paramFloat); - - float localGetBrightness(float paramFloat); - - float realGetEyeHeight(); - - float superGetEyeHeight(); - - float localGetEyeHeight(); - - void realHeal(float paramFloat); - - void superHeal(float paramFloat); - - void localHeal(float paramFloat); - - boolean realIsEntityInsideOpaqueBlock(); - - boolean superIsEntityInsideOpaqueBlock(); - - boolean localIsEntityInsideOpaqueBlock(); - - boolean realIsInWater(); - - boolean superIsInWater(); - - boolean localIsInWater(); - - boolean realIsInsideOfMaterial(net.minecraft.block.material.Material paramMaterial); - - boolean superIsInsideOfMaterial(net.minecraft.block.material.Material paramMaterial); - - boolean localIsInsideOfMaterial(net.minecraft.block.material.Material paramMaterial); - - boolean realIsOnLadder(); - - boolean superIsOnLadder(); - - boolean localIsOnLadder(); - - boolean realIsPlayerSleeping(); - - boolean superIsPlayerSleeping(); - - boolean localIsPlayerSleeping(); - - boolean realIsSneaking(); - - boolean superIsSneaking(); - - boolean localIsSneaking(); - - void realJump(); - - void superJump(); - - void localJump(); - - void realKnockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2); - - void superKnockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2); - - void localKnockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2); - - boolean realMountEntity(net.minecraft.entity.Entity paramEntity, boolean paramBoolean); - - boolean superMountEntity(net.minecraft.entity.Entity paramEntity, boolean paramBoolean); - - boolean localMountEntity(net.minecraft.entity.Entity paramEntity, boolean paramBoolean); - - void realMoveEntity(double paramDouble1, double paramDouble2, double paramDouble3); - - void superMoveEntity(double paramDouble1, double paramDouble2, double paramDouble3); - - void localMoveEntity(double paramDouble1, double paramDouble2, double paramDouble3); - - void realMoveEntityWithHeading(float paramFloat1, float paramFloat2); - - void superMoveEntityWithHeading(float paramFloat1, float paramFloat2); - - void localMoveEntityWithHeading(float paramFloat1, float paramFloat2); - - void realMoveFlying(float paramFloat1, float paramFloat2, float paramFloat3); - - void superMoveFlying(float paramFloat1, float paramFloat2, float paramFloat3); - - void localMoveFlying(float paramFloat1, float paramFloat2, float paramFloat3); - - void realOnDeath(net.minecraft.util.DamageSource paramDamageSource); - - void superOnDeath(net.minecraft.util.DamageSource paramDamageSource); - - void localOnDeath(net.minecraft.util.DamageSource paramDamageSource); - - void realOnLivingUpdate(); - - void superOnLivingUpdate(); - - void localOnLivingUpdate(); - - void realOnKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase); - - void superOnKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase); - - void localOnKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase); - - void realOnStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt); - - void superOnStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt); - - void localOnStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt); - - void realOnUpdate(); - - void superOnUpdate(); - - void localOnUpdate(); - - void realOnUpdateEntity(); - - void localOnUpdateEntity(); - - void realReadEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound); - - void superReadEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound); - - void localReadEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound); - - void realSetDead(); - - void superSetDead(); - - void localSetDead(); - - void realSetEntityActionState(float paramFloat1, float paramFloat2, boolean paramBoolean1, boolean paramBoolean2); - - void localSetEntityActionState(float paramFloat1, float paramFloat2, boolean paramBoolean1, boolean paramBoolean2); - - void realSetPosition(double paramDouble1, double paramDouble2, double paramDouble3); - - void superSetPosition(double paramDouble1, double paramDouble2, double paramDouble3); - - void localSetPosition(double paramDouble1, double paramDouble2, double paramDouble3); - - void realSetSneaking(boolean paramBoolean); - - void superSetSneaking(boolean paramBoolean); - - void localSetSneaking(boolean paramBoolean); - - void realSetSprinting(boolean paramBoolean); - - void superSetSprinting(boolean paramBoolean); - - void localSetSprinting(boolean paramBoolean); - - void realSwingItem(net.minecraft.util.EnumHand paramEnumHand); - - void superSwingItem(net.minecraft.util.EnumHand paramEnumHand); - - void localSwingItem(net.minecraft.util.EnumHand paramEnumHand); - - void realUpdateEntityActionState(); - - void superUpdateEntityActionState(); - - void localUpdateEntityActionState(); - - void realUpdatePotionEffects(); - - void superUpdatePotionEffects(); - - void localUpdatePotionEffects(); - - void realUpdateRidden(); - - void superUpdateRidden(); - - void localUpdateRidden(); - - void realWakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3); - - void superWakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3); - - void localWakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3); - - void realWriteEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound); - - void superWriteEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound); - - void localWriteEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound); - - net.minecraft.item.ItemStack getActiveItemStackField(); - - void setActiveItemStackField(net.minecraft.item.ItemStack activeItemStack); - - int getActiveItemStackUseCountField(); - - void setActiveItemStackUseCountField(int activeItemStackUseCount); - - boolean getAddedToChunkField(); - - void setAddedToChunkField(boolean addedToChunk); - - int getArrowHitTimerField(); - - void setArrowHitTimerField(int arrowHitTimer); - - float getAttackedAtYawField(); - - void setAttackedAtYawField(float attackedAtYaw); - - net.minecraft.entity.player.EntityPlayer getAttackingPlayerField(); - - void setAttackingPlayerField(net.minecraft.entity.player.EntityPlayer attackingPlayer); - - java.lang.String getCachedUniqueIdStringField(); - - void setCachedUniqueIdStringField(java.lang.String cachedUniqueIdString); - - float getCameraPitchField(); - - void setCameraPitchField(float cameraPitch); - - float getCameraYawField(); - - void setCameraYawField(float cameraYaw); - - net.minecraft.entity.player.PlayerCapabilities getCapabilitiesField(); - - void setCapabilitiesField(net.minecraft.entity.player.PlayerCapabilities capabilities); - - double getChasingPosXField(); - - void setChasingPosXField(double chasingPosX); - - double getChasingPosYField(); - - void setChasingPosYField(double chasingPosY); - - double getChasingPosZField(); - - void setChasingPosZField(double chasingPosZ); - - boolean getChatColoursField(); - - void setChatColoursField(boolean chatColours); - - net.minecraft.entity.player.EntityPlayer.EnumChatVisibility getChatVisibilityField(); - - void setChatVisibilityField(net.minecraft.entity.player.EntityPlayer.EnumChatVisibility chatVisibility); - - int getChunkCoordXField(); - - void setChunkCoordXField(int chunkCoordX); - - int getChunkCoordYField(); - - void setChunkCoordYField(int chunkCoordY); - - int getChunkCoordZField(); - - void setChunkCoordZField(int chunkCoordZ); - - float getCombinedHealthField(); - - void setCombinedHealthField(float combinedHealth); - - int getCurrentWindowIdField(); - - void setCurrentWindowIdField(int currentWindowId); - - net.minecraft.network.datasync.EntityDataManager getDataWatcherField(); - - void setDataWatcherField(net.minecraft.network.datasync.EntityDataManager dataWatcher); - - boolean getDeadField(); - - void setDeadField(boolean dead); - - int getDeathTimeField(); - - void setDeathTimeField(int deathTime); - - java.util.List getDestroyedItemsNetCacheField(); - - int getDimensionField(); - - void setDimensionField(int dimension); - - float getDistanceWalkedModifiedField(); - - void setDistanceWalkedModifiedField(float distanceWalkedModified); - - float getDistanceWalkedOnStepModifiedField(); - - void setDistanceWalkedOnStepModifiedField(float distanceWalkedOnStepModified); - - int getEntityAgeField(); - - void setEntityAgeField(int entityAge); - - float getEntityCollisionReductionField(); - - void setEntityCollisionReductionField(float entityCollisionReduction); - - java.util.UUID getEntityUniqueIDField(); - - void setEntityUniqueIDField(java.util.UUID entityUniqueID); - - float getExperienceField(); - - void setExperienceField(float experience); - - int getExperienceLevelField(); - - void setExperienceLevelField(int experienceLevel); - - int getExperienceTotalField(); - - void setExperienceTotalField(int experienceTotal); - - float getFallDistanceField(); - - void setFallDistanceField(float fallDistance); - - int getFireResistanceField(); - - void setFireResistanceField(int fireResistance); - - boolean getFirstUpdateField(); - - void setFirstUpdateField(boolean firstUpdate); - - net.minecraft.entity.projectile.EntityFishHook getFishEntityField(); - - void setFishEntityField(net.minecraft.entity.projectile.EntityFishHook fishEntity); - - net.minecraft.network.datasync.DataParameter getFlagsField(); - - int getFlyToggleTimerField(); - - void setFlyToggleTimerField(int flyToggleTimer); - - net.minecraft.util.FoodStats getFoodStatsField(); - - void setFoodStatsField(net.minecraft.util.FoodStats foodStats); - - boolean getForceSpawnField(); - - void setForceSpawnField(boolean forceSpawn); - - boolean getGlowingField(); - - void setGlowingField(boolean glowing); - - net.minecraft.network.datasync.DataParameter getHandStatesField(); - - float getHeightField(); - - void setHeightField(float height); - - float getHundredEightyField(); - - void setHundredEightyField(float hundredEighty); - - int getHurtResistantTimeField(); - - void setHurtResistantTimeField(int hurtResistantTime); - - int getHurtTimeField(); - - void setHurtTimeField(int hurtTime); - - boolean getIgnoreFrustumCheckField(); - - void setIgnoreFrustumCheckField(boolean ignoreFrustumCheck); - - boolean getInPortalField(); - - void setInPortalField(boolean inPortal); - - boolean getInWaterField(); - - void setInWaterField(boolean inWater); - - net.minecraft.server.management.PlayerInteractionManager getInteractionManagerField(); - - double getInterpTargetXField(); - - void setInterpTargetXField(double interpTargetX); - - double getInterpTargetYField(); - - void setInterpTargetYField(double interpTargetY); - - double getInterpTargetYawField(); - - void setInterpTargetYawField(double interpTargetYaw); - - double getInterpTargetZField(); - - void setInterpTargetZField(double interpTargetZ); - - net.minecraft.entity.player.InventoryPlayer getInventoryField(); - - void setInventoryField(net.minecraft.entity.player.InventoryPlayer inventory); - - net.minecraft.inventory.Container getInventoryContainerField(); - - void setInventoryContainerField(net.minecraft.inventory.Container inventoryContainer); - - boolean getInvulnerableDimensionChangeField(); - - void setInvulnerableDimensionChangeField(boolean invulnerableDimensionChange); - - boolean getIsAirBorneField(); - - void setIsAirBorneField(boolean isAirBorne); - - boolean getIsChangingQuantityOnlyField(); - - void setIsChangingQuantityOnlyField(boolean isChangingQuantityOnly); - - boolean getIsCollidedField(); - - void setIsCollidedField(boolean isCollided); - - boolean getIsCollidedHorizontallyField(); - - void setIsCollidedHorizontallyField(boolean isCollidedHorizontally); - - boolean getIsCollidedVerticallyField(); - - void setIsCollidedVerticallyField(boolean isCollidedVertically); - - boolean getIsDeadField(); - - void setIsDeadField(boolean isDead); - - boolean getIsImmuneToFireField(); - - void setIsImmuneToFireField(boolean isImmuneToFire); - - boolean getIsInWebField(); - - void setIsInWebField(boolean isInWeb); - - boolean getIsJumpingField(); - - void setIsJumpingField(boolean isJumping); - - boolean getIsSwingInProgressField(); - - void setIsSwingInProgressField(boolean isSwingInProgress); - - float getJumpMovementFactorField(); - - void setJumpMovementFactorField(float jumpMovementFactor); - - int getLastAirScoreField(); - - void setLastAirScoreField(int lastAirScore); - - int getLastArmorScoreField(); - - void setLastArmorScoreField(int lastArmorScore); - - float getLastDamageField(); - - void setLastDamageField(float lastDamage); - - int getLastExperienceField(); - - void setLastExperienceField(int lastExperience); - - int getLastExperienceScoreField(); - - void setLastExperienceScoreField(int lastExperienceScore); - - int getLastFoodLevelField(); - - void setLastFoodLevelField(int lastFoodLevel); - - int getLastFoodScoreField(); - - void setLastFoodScoreField(int lastFoodScore); - - float getLastHealthField(); - - void setLastHealthField(float lastHealth); - - int getLastLevelScoreField(); - - void setLastLevelScoreField(int lastLevelScore); - - net.minecraft.util.math.BlockPos getLastPortalPosField(); - - void setLastPortalPosField(net.minecraft.util.math.BlockPos lastPortalPos); - - net.minecraft.util.math.Vec3d getLastPortalVecField(); - - void setLastPortalVecField(net.minecraft.util.math.Vec3d lastPortalVec); - - double getLastTickPosXField(); - - void setLastTickPosXField(double lastTickPosX); - - double getLastTickPosYField(); - - void setLastTickPosYField(double lastTickPosY); - - double getLastTickPosZField(); - - void setLastTickPosZField(double lastTickPosZ); - - float getLimbSwingField(); - - void setLimbSwingField(float limbSwing); - - float getLimbSwingAmountField(); - - void setLimbSwingAmountField(float limbSwingAmount); - - org.apache.logging.log4j.Logger getLoggerField(); - - net.minecraft.network.datasync.DataParameter getMainHandField(); - - double getManagedPosXField(); - - void setManagedPosXField(double managedPosX); - - double getManagedPosZField(); - - void setManagedPosZField(double managedPosZ); - - int getMaxHurtResistantTimeField(); - - void setMaxHurtResistantTimeField(int maxHurtResistantTime); - - int getMaxHurtTimeField(); - - void setMaxHurtTimeField(int maxHurtTime); - - net.minecraft.server.MinecraftServer getMcServerField(); - - double getMotionXField(); - - void setMotionXField(double motionX); - - double getMotionYField(); - - void setMotionYField(double motionY); - - double getMotionZField(); - - void setMotionZField(double motionZ); - - float getMoveForwardField(); - - void setMoveForwardField(float moveForward); - - float getMoveStrafingField(); - - void setMoveStrafingField(float moveStrafing); - - float getMovedDistanceField(); - - void setMovedDistanceField(float movedDistance); - - int getNewPosRotationIncrementsField(); - - void setNewPosRotationIncrementsField(int newPosRotationIncrements); - - double getNewPosXField(); - - void setNewPosXField(double newPosX); - - boolean getNoClipField(); - - void setNoClipField(boolean noClip); - - boolean getOnGroundField(); - - void setOnGroundField(boolean onGround); - - float getOnGroundSpeedFactorField(); - - void setOnGroundSpeedFactorField(float onGroundSpeedFactor); - - net.minecraft.inventory.Container getOpenContainerField(); - - void setOpenContainerField(net.minecraft.inventory.Container openContainer); - - int getPingField(); - - void setPingField(int ping); - - boolean getPlayerConqueredTheEndField(); - - void setPlayerConqueredTheEndField(boolean playerConqueredTheEnd); - - long getPlayerLastActiveTimeField(); - - void setPlayerLastActiveTimeField(long playerLastActiveTime); - - net.minecraft.util.math.BlockPos getPlayerLocationField(); - - void setPlayerLocationField(net.minecraft.util.math.BlockPos playerLocation); - - net.minecraft.network.datasync.DataParameter getPlayerModelFlagField(); - - net.minecraft.network.NetHandlerPlayServer getPlayerNetServerHandlerField(); - - void setPlayerNetServerHandlerField(net.minecraft.network.NetHandlerPlayServer playerNetServerHandler); - - int getPortalCounterField(); - - void setPortalCounterField(int portalCounter); - - double getPosXField(); - - void setPosXField(double posX); - - double getPosYField(); - - void setPosYField(double posY); - - double getPosZField(); - - void setPosZField(double posZ); - - float getPrevCameraPitchField(); - - void setPrevCameraPitchField(float prevCameraPitch); - - float getPrevCameraYawField(); - - void setPrevCameraYawField(float prevCameraYaw); - - double getPrevChasingPosXField(); - - void setPrevChasingPosXField(double prevChasingPosX); - - double getPrevChasingPosYField(); - - void setPrevChasingPosYField(double prevChasingPosY); - - double getPrevChasingPosZField(); - - void setPrevChasingPosZField(double prevChasingPosZ); - - float getPrevDistanceWalkedModifiedField(); - - void setPrevDistanceWalkedModifiedField(float prevDistanceWalkedModified); - - float getPrevLimbSwingAmountField(); - - void setPrevLimbSwingAmountField(float prevLimbSwingAmount); - - float getPrevMovedDistanceField(); - - void setPrevMovedDistanceField(float prevMovedDistance); - - float getPrevOnGroundSpeedFactorField(); - - void setPrevOnGroundSpeedFactorField(float prevOnGroundSpeedFactor); - - double getPrevPosXField(); - - void setPrevPosXField(double prevPosX); - - double getPrevPosYField(); - - void setPrevPosYField(double prevPosY); - - double getPrevPosZField(); - - void setPrevPosZField(double prevPosZ); - - float getPrevRenderYawOffsetField(); - - void setPrevRenderYawOffsetField(float prevRenderYawOffset); - - float getPrevRotationPitchField(); - - void setPrevRotationPitchField(float prevRotationPitch); - - float getPrevRotationYawField(); - - void setPrevRotationYawField(float prevRotationYaw); - - float getPrevRotationYawHeadField(); - - void setPrevRotationYawHeadField(float prevRotationYawHead); - - float getPrevSwingProgressField(); - - void setPrevSwingProgressField(float prevSwingProgress); - - boolean getPreventEntitySpawningField(); - - void setPreventEntitySpawningField(boolean preventEntitySpawning); - - java.util.Random getRandField(); - - void setRandField(java.util.Random rand); - - float getRandomNumberBetweenOneHundredthAndTwoHundredthField(); - - void setRandomNumberBetweenOneHundredthAndTwoHundredthField(float randomNumberBetweenOneHundredthAndTwoHundredth); - - float getRandomNumberBetweenZeroAndTwelveThousandThreeHundredNinetyEightField(); - - void setRandomNumberBetweenZeroAndTwelveThousandThreeHundredNinetyEightField(float randomNumberBetweenZeroAndTwelveThousandThreeHundredNinetyEight); - - float getRandomYawVelocityField(); - - void setRandomYawVelocityField(float randomYawVelocity); - - int getRecentlyHitField(); - - void setRecentlyHitField(int recentlyHit); - - float getRenderOffsetXField(); - - void setRenderOffsetXField(float renderOffsetX); - - float getRenderOffsetYField(); - - void setRenderOffsetYField(float renderOffsetY); - - float getRenderOffsetZField(); - - void setRenderOffsetZField(float renderOffsetZ); - - float getRenderYawOffsetField(); - - void setRenderYawOffsetField(float renderYawOffset); - - int getRespawnInvulnerabilityTicksField(); - - void setRespawnInvulnerabilityTicksField(int respawnInvulnerabilityTicks); - - int getRideCooldownField(); - - void setRideCooldownField(int rideCooldown); - - float getRotationPitchField(); - - void setRotationPitchField(float rotationPitch); - - float getRotationYawField(); - - void setRotationYawField(float rotationYaw); - - float getRotationYawHeadField(); - - void setRotationYawHeadField(float rotationYawHead); - - int getScoreValueField(); - - void setScoreValueField(int scoreValue); - - long getServerPosXField(); - - void setServerPosXField(long serverPosX); - - long getServerPosYField(); - - void setServerPosYField(long serverPosY); - - long getServerPosZField(); - - void setServerPosZField(long serverPosZ); - - boolean getSleepingField(); - - void setSleepingField(boolean sleeping); - - net.minecraft.entity.Entity getSpectatingEntityField(); - - void setSpectatingEntityField(net.minecraft.entity.Entity spectatingEntity); - - float getSpeedInAirField(); - - void setSpeedInAirField(float speedInAir); - - float getSpeedOnGroundField(); - - void setSpeedOnGroundField(float speedOnGround); - - net.minecraft.stats.StatisticsManagerServer getStatsFileField(); - - float getStepHeightField(); - - void setStepHeightField(float stepHeight); - - float getSwingProgressField(); - - void setSwingProgressField(float swingProgress); - - int getSwingProgressIntField(); - - void setSwingProgressIntField(int swingProgressInt); - - net.minecraft.util.EnumHand getSwingingHandField(); - - void setSwingingHandField(net.minecraft.util.EnumHand swingingHand); - - net.minecraft.util.EnumFacing getTeleportDirectionField(); - - void setTeleportDirectionField(net.minecraft.util.EnumFacing teleportDirection); - - int getTicksElytraFlyingField(); - - void setTicksElytraFlyingField(int ticksElytraFlying); - - int getTicksExistedField(); - - void setTicksExistedField(int ticksExisted); - - int getTicksSinceLastSwingField(); - - void setTicksSinceLastSwingField(int ticksSinceLastSwing); - - int getTimeUntilPortalField(); - - void setTimeUntilPortalField(int timeUntilPortal); - - java.lang.String getTranslatorField(); - - void setTranslatorField(java.lang.String translator); - - boolean getVelocityChangedField(); - - void setVelocityChangedField(boolean velocityChanged); - - boolean getWasHungryField(); - - void setWasHungryField(boolean wasHungry); - - float getWidthField(); - - void setWidthField(float width); - - net.minecraft.world.World getWorldObjField(); - - void setWorldObjField(net.minecraft.world.World worldObj); - - int getXpCooldownField(); - - void setXpCooldownField(int xpCooldown); - -} diff --git a/dependencies/main/java/api/player/server/IServerPlayerAPI.java b/dependencies/main/java/api/player/server/IServerPlayerAPI.java deleted file mode 100644 index 29a4cf6a49..0000000000 --- a/dependencies/main/java/api/player/server/IServerPlayerAPI.java +++ /dev/null @@ -1,26 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.server; - -public interface IServerPlayerAPI extends IServerPlayer -{ - ServerPlayerAPI getServerPlayerAPI(); - - net.minecraft.entity.player.EntityPlayerMP getEntityPlayerMP(); -} diff --git a/dependencies/main/java/api/player/server/ServerPlayerAPI.java b/dependencies/main/java/api/player/server/ServerPlayerAPI.java deleted file mode 100644 index 61751080ac..0000000000 --- a/dependencies/main/java/api/player/server/ServerPlayerAPI.java +++ /dev/null @@ -1,5739 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.server; - -import java.io.*; -import java.text.*; -import java.util.*; -import java.util.logging.*; -import java.lang.reflect.*; - -public final class ServerPlayerAPI -{ - private final static Class[] Class = new Class[] { ServerPlayerAPI.class }; - private final static Class[] Classes = new Class[] { ServerPlayerAPI.class, String.class }; - - private static boolean isCreated; - private static final Logger logger = Logger.getLogger("ServerPlayerAPI"); - - private static void log(String text) - { - System.out.println(text); - logger.fine(text); - } - - public static void register(String id, Class baseClass) - { - register(id, baseClass, null); - } - - public static void register(String id, Class baseClass, ServerPlayerBaseSorting baseSorting) - { - try - { - register(baseClass, id, baseSorting); - } - catch(RuntimeException exception) - { - if(id != null) - log("Server Player: failed to register id '" + id + "'"); - else - log("Server Player: failed to register ServerPlayerBase"); - - throw exception; - } - } - - private static void register(Class baseClass, String id, ServerPlayerBaseSorting baseSorting) - { - if(!isCreated) - { - try - { - Method mandatory = net.minecraft.entity.player.EntityPlayerMP.class.getMethod("getServerPlayerBase", String.class); - if (mandatory.getReturnType() != ServerPlayerBase.class) - throw new NoSuchMethodException(ServerPlayerBase.class.getName() + " " + net.minecraft.entity.player.EntityPlayerMP.class.getName() + ".getServerPlayerBase(" + String.class.getName() + ")"); - } - catch(NoSuchMethodException exception) - { - String[] errorMessageParts = new String[] - { - "========================================", - "The API \"Server Player\" version " + api.player.forge.PlayerAPIPlugin.Version + " of the mod \"Player API Core " + api.player.forge.PlayerAPIPlugin.Version + "\" can not be created!", - "----------------------------------------", - "Mandatory member method \"{0} getServerPlayerBase({3})\" not found in class \"{1}\".", - "There are three scenarios this can happen:", - "* Minecraft Forge is missing a Player API Core which Minecraft version matches its own.", - " Download and install the latest Player API Core for the Minecraft version you were trying to run.", - "* The code of the class \"{2}\" of Player API Core has been modified beyond recognition by another Minecraft Forge coremod.", - " Try temporary deinstallation of other core mods to find the culprit and deinstall it permanently to fix this specific problem.", - "* Player API Core has not been installed correctly.", - " Deinstall Player API Core and install it again following the installation instructions in the readme file.", - "========================================" - }; - - String baseEntityPlayerMPClassName = ServerPlayerBase.class.getName(); - String targetClassName = net.minecraft.entity.player.EntityPlayerMP.class.getName(); - String targetClassFileName = targetClassName.replace(".", File.separator); - String stringClassName = String.class.getName(); - - for(int i=0; i allreadyRegistered = allBaseConstructors.get(id); - if(allreadyRegistered != null) - throw new IllegalArgumentException("The class '" + baseClass.getName() + "' can not be registered with the id '" + id + "' because the class '" + allreadyRegistered.getDeclaringClass().getName() + "' has allready been registered with the same id"); - - Constructor baseConstructor; - try - { - baseConstructor = baseClass.getDeclaredConstructor(Classes); - } - catch (Throwable t) - { - try - { - baseConstructor = baseClass.getDeclaredConstructor(Class); - } - catch(Throwable s) - { - throw new IllegalArgumentException("Can not find necessary constructor with one argument of type '" + ServerPlayerAPI.class.getName() + "' and eventually a second argument of type 'String' in the class '" + baseClass.getName() + "'", t); - } - } - - allBaseConstructors.put(id, baseConstructor); - - if(baseSorting != null) - { - addSorting(id, allBaseBeforeLocalConstructingSuperiors, baseSorting.getBeforeLocalConstructingSuperiors()); - addSorting(id, allBaseBeforeLocalConstructingInferiors, baseSorting.getBeforeLocalConstructingInferiors()); - addSorting(id, allBaseAfterLocalConstructingSuperiors, baseSorting.getAfterLocalConstructingSuperiors()); - addSorting(id, allBaseAfterLocalConstructingInferiors, baseSorting.getAfterLocalConstructingInferiors()); - - addDynamicSorting(id, allBaseBeforeDynamicSuperiors, baseSorting.getDynamicBeforeSuperiors()); - addDynamicSorting(id, allBaseBeforeDynamicInferiors, baseSorting.getDynamicBeforeInferiors()); - addDynamicSorting(id, allBaseOverrideDynamicSuperiors, baseSorting.getDynamicOverrideSuperiors()); - addDynamicSorting(id, allBaseOverrideDynamicInferiors, baseSorting.getDynamicOverrideInferiors()); - addDynamicSorting(id, allBaseAfterDynamicSuperiors, baseSorting.getDynamicAfterSuperiors()); - addDynamicSorting(id, allBaseAfterDynamicInferiors, baseSorting.getDynamicAfterInferiors()); - - addSorting(id, allBaseBeforeAddExhaustionSuperiors, baseSorting.getBeforeAddExhaustionSuperiors()); - addSorting(id, allBaseBeforeAddExhaustionInferiors, baseSorting.getBeforeAddExhaustionInferiors()); - addSorting(id, allBaseOverrideAddExhaustionSuperiors, baseSorting.getOverrideAddExhaustionSuperiors()); - addSorting(id, allBaseOverrideAddExhaustionInferiors, baseSorting.getOverrideAddExhaustionInferiors()); - addSorting(id, allBaseAfterAddExhaustionSuperiors, baseSorting.getAfterAddExhaustionSuperiors()); - addSorting(id, allBaseAfterAddExhaustionInferiors, baseSorting.getAfterAddExhaustionInferiors()); - - addSorting(id, allBaseBeforeAddExperienceSuperiors, baseSorting.getBeforeAddExperienceSuperiors()); - addSorting(id, allBaseBeforeAddExperienceInferiors, baseSorting.getBeforeAddExperienceInferiors()); - addSorting(id, allBaseOverrideAddExperienceSuperiors, baseSorting.getOverrideAddExperienceSuperiors()); - addSorting(id, allBaseOverrideAddExperienceInferiors, baseSorting.getOverrideAddExperienceInferiors()); - addSorting(id, allBaseAfterAddExperienceSuperiors, baseSorting.getAfterAddExperienceSuperiors()); - addSorting(id, allBaseAfterAddExperienceInferiors, baseSorting.getAfterAddExperienceInferiors()); - - addSorting(id, allBaseBeforeAddExperienceLevelSuperiors, baseSorting.getBeforeAddExperienceLevelSuperiors()); - addSorting(id, allBaseBeforeAddExperienceLevelInferiors, baseSorting.getBeforeAddExperienceLevelInferiors()); - addSorting(id, allBaseOverrideAddExperienceLevelSuperiors, baseSorting.getOverrideAddExperienceLevelSuperiors()); - addSorting(id, allBaseOverrideAddExperienceLevelInferiors, baseSorting.getOverrideAddExperienceLevelInferiors()); - addSorting(id, allBaseAfterAddExperienceLevelSuperiors, baseSorting.getAfterAddExperienceLevelSuperiors()); - addSorting(id, allBaseAfterAddExperienceLevelInferiors, baseSorting.getAfterAddExperienceLevelInferiors()); - - addSorting(id, allBaseBeforeAddMovementStatSuperiors, baseSorting.getBeforeAddMovementStatSuperiors()); - addSorting(id, allBaseBeforeAddMovementStatInferiors, baseSorting.getBeforeAddMovementStatInferiors()); - addSorting(id, allBaseOverrideAddMovementStatSuperiors, baseSorting.getOverrideAddMovementStatSuperiors()); - addSorting(id, allBaseOverrideAddMovementStatInferiors, baseSorting.getOverrideAddMovementStatInferiors()); - addSorting(id, allBaseAfterAddMovementStatSuperiors, baseSorting.getAfterAddMovementStatSuperiors()); - addSorting(id, allBaseAfterAddMovementStatInferiors, baseSorting.getAfterAddMovementStatInferiors()); - - addSorting(id, allBaseBeforeAttackEntityFromSuperiors, baseSorting.getBeforeAttackEntityFromSuperiors()); - addSorting(id, allBaseBeforeAttackEntityFromInferiors, baseSorting.getBeforeAttackEntityFromInferiors()); - addSorting(id, allBaseOverrideAttackEntityFromSuperiors, baseSorting.getOverrideAttackEntityFromSuperiors()); - addSorting(id, allBaseOverrideAttackEntityFromInferiors, baseSorting.getOverrideAttackEntityFromInferiors()); - addSorting(id, allBaseAfterAttackEntityFromSuperiors, baseSorting.getAfterAttackEntityFromSuperiors()); - addSorting(id, allBaseAfterAttackEntityFromInferiors, baseSorting.getAfterAttackEntityFromInferiors()); - - addSorting(id, allBaseBeforeAttackTargetEntityWithCurrentItemSuperiors, baseSorting.getBeforeAttackTargetEntityWithCurrentItemSuperiors()); - addSorting(id, allBaseBeforeAttackTargetEntityWithCurrentItemInferiors, baseSorting.getBeforeAttackTargetEntityWithCurrentItemInferiors()); - addSorting(id, allBaseOverrideAttackTargetEntityWithCurrentItemSuperiors, baseSorting.getOverrideAttackTargetEntityWithCurrentItemSuperiors()); - addSorting(id, allBaseOverrideAttackTargetEntityWithCurrentItemInferiors, baseSorting.getOverrideAttackTargetEntityWithCurrentItemInferiors()); - addSorting(id, allBaseAfterAttackTargetEntityWithCurrentItemSuperiors, baseSorting.getAfterAttackTargetEntityWithCurrentItemSuperiors()); - addSorting(id, allBaseAfterAttackTargetEntityWithCurrentItemInferiors, baseSorting.getAfterAttackTargetEntityWithCurrentItemInferiors()); - - addSorting(id, allBaseBeforeCanBreatheUnderwaterSuperiors, baseSorting.getBeforeCanBreatheUnderwaterSuperiors()); - addSorting(id, allBaseBeforeCanBreatheUnderwaterInferiors, baseSorting.getBeforeCanBreatheUnderwaterInferiors()); - addSorting(id, allBaseOverrideCanBreatheUnderwaterSuperiors, baseSorting.getOverrideCanBreatheUnderwaterSuperiors()); - addSorting(id, allBaseOverrideCanBreatheUnderwaterInferiors, baseSorting.getOverrideCanBreatheUnderwaterInferiors()); - addSorting(id, allBaseAfterCanBreatheUnderwaterSuperiors, baseSorting.getAfterCanBreatheUnderwaterSuperiors()); - addSorting(id, allBaseAfterCanBreatheUnderwaterInferiors, baseSorting.getAfterCanBreatheUnderwaterInferiors()); - - addSorting(id, allBaseBeforeCanHarvestBlockSuperiors, baseSorting.getBeforeCanHarvestBlockSuperiors()); - addSorting(id, allBaseBeforeCanHarvestBlockInferiors, baseSorting.getBeforeCanHarvestBlockInferiors()); - addSorting(id, allBaseOverrideCanHarvestBlockSuperiors, baseSorting.getOverrideCanHarvestBlockSuperiors()); - addSorting(id, allBaseOverrideCanHarvestBlockInferiors, baseSorting.getOverrideCanHarvestBlockInferiors()); - addSorting(id, allBaseAfterCanHarvestBlockSuperiors, baseSorting.getAfterCanHarvestBlockSuperiors()); - addSorting(id, allBaseAfterCanHarvestBlockInferiors, baseSorting.getAfterCanHarvestBlockInferiors()); - - addSorting(id, allBaseBeforeCanPlayerEditSuperiors, baseSorting.getBeforeCanPlayerEditSuperiors()); - addSorting(id, allBaseBeforeCanPlayerEditInferiors, baseSorting.getBeforeCanPlayerEditInferiors()); - addSorting(id, allBaseOverrideCanPlayerEditSuperiors, baseSorting.getOverrideCanPlayerEditSuperiors()); - addSorting(id, allBaseOverrideCanPlayerEditInferiors, baseSorting.getOverrideCanPlayerEditInferiors()); - addSorting(id, allBaseAfterCanPlayerEditSuperiors, baseSorting.getAfterCanPlayerEditSuperiors()); - addSorting(id, allBaseAfterCanPlayerEditInferiors, baseSorting.getAfterCanPlayerEditInferiors()); - - addSorting(id, allBaseBeforeCanTriggerWalkingSuperiors, baseSorting.getBeforeCanTriggerWalkingSuperiors()); - addSorting(id, allBaseBeforeCanTriggerWalkingInferiors, baseSorting.getBeforeCanTriggerWalkingInferiors()); - addSorting(id, allBaseOverrideCanTriggerWalkingSuperiors, baseSorting.getOverrideCanTriggerWalkingSuperiors()); - addSorting(id, allBaseOverrideCanTriggerWalkingInferiors, baseSorting.getOverrideCanTriggerWalkingInferiors()); - addSorting(id, allBaseAfterCanTriggerWalkingSuperiors, baseSorting.getAfterCanTriggerWalkingSuperiors()); - addSorting(id, allBaseAfterCanTriggerWalkingInferiors, baseSorting.getAfterCanTriggerWalkingInferiors()); - - addSorting(id, allBaseBeforeClonePlayerSuperiors, baseSorting.getBeforeClonePlayerSuperiors()); - addSorting(id, allBaseBeforeClonePlayerInferiors, baseSorting.getBeforeClonePlayerInferiors()); - addSorting(id, allBaseOverrideClonePlayerSuperiors, baseSorting.getOverrideClonePlayerSuperiors()); - addSorting(id, allBaseOverrideClonePlayerInferiors, baseSorting.getOverrideClonePlayerInferiors()); - addSorting(id, allBaseAfterClonePlayerSuperiors, baseSorting.getAfterClonePlayerSuperiors()); - addSorting(id, allBaseAfterClonePlayerInferiors, baseSorting.getAfterClonePlayerInferiors()); - - addSorting(id, allBaseBeforeDamageEntitySuperiors, baseSorting.getBeforeDamageEntitySuperiors()); - addSorting(id, allBaseBeforeDamageEntityInferiors, baseSorting.getBeforeDamageEntityInferiors()); - addSorting(id, allBaseOverrideDamageEntitySuperiors, baseSorting.getOverrideDamageEntitySuperiors()); - addSorting(id, allBaseOverrideDamageEntityInferiors, baseSorting.getOverrideDamageEntityInferiors()); - addSorting(id, allBaseAfterDamageEntitySuperiors, baseSorting.getAfterDamageEntitySuperiors()); - addSorting(id, allBaseAfterDamageEntityInferiors, baseSorting.getAfterDamageEntityInferiors()); - - addSorting(id, allBaseBeforeDisplayGuiSuperiors, baseSorting.getBeforeDisplayGuiSuperiors()); - addSorting(id, allBaseBeforeDisplayGuiInferiors, baseSorting.getBeforeDisplayGuiInferiors()); - addSorting(id, allBaseOverrideDisplayGuiSuperiors, baseSorting.getOverrideDisplayGuiSuperiors()); - addSorting(id, allBaseOverrideDisplayGuiInferiors, baseSorting.getOverrideDisplayGuiInferiors()); - addSorting(id, allBaseAfterDisplayGuiSuperiors, baseSorting.getAfterDisplayGuiSuperiors()); - addSorting(id, allBaseAfterDisplayGuiInferiors, baseSorting.getAfterDisplayGuiInferiors()); - - addSorting(id, allBaseBeforeDisplayGUIChestSuperiors, baseSorting.getBeforeDisplayGUIChestSuperiors()); - addSorting(id, allBaseBeforeDisplayGUIChestInferiors, baseSorting.getBeforeDisplayGUIChestInferiors()); - addSorting(id, allBaseOverrideDisplayGUIChestSuperiors, baseSorting.getOverrideDisplayGUIChestSuperiors()); - addSorting(id, allBaseOverrideDisplayGUIChestInferiors, baseSorting.getOverrideDisplayGUIChestInferiors()); - addSorting(id, allBaseAfterDisplayGUIChestSuperiors, baseSorting.getAfterDisplayGUIChestSuperiors()); - addSorting(id, allBaseAfterDisplayGUIChestInferiors, baseSorting.getAfterDisplayGUIChestInferiors()); - - addSorting(id, allBaseBeforeDropOneItemSuperiors, baseSorting.getBeforeDropOneItemSuperiors()); - addSorting(id, allBaseBeforeDropOneItemInferiors, baseSorting.getBeforeDropOneItemInferiors()); - addSorting(id, allBaseOverrideDropOneItemSuperiors, baseSorting.getOverrideDropOneItemSuperiors()); - addSorting(id, allBaseOverrideDropOneItemInferiors, baseSorting.getOverrideDropOneItemInferiors()); - addSorting(id, allBaseAfterDropOneItemSuperiors, baseSorting.getAfterDropOneItemSuperiors()); - addSorting(id, allBaseAfterDropOneItemInferiors, baseSorting.getAfterDropOneItemInferiors()); - - addSorting(id, allBaseBeforeDropPlayerItemWithRandomChoiceSuperiors, baseSorting.getBeforeDropPlayerItemWithRandomChoiceSuperiors()); - addSorting(id, allBaseBeforeDropPlayerItemWithRandomChoiceInferiors, baseSorting.getBeforeDropPlayerItemWithRandomChoiceInferiors()); - addSorting(id, allBaseOverrideDropPlayerItemWithRandomChoiceSuperiors, baseSorting.getOverrideDropPlayerItemWithRandomChoiceSuperiors()); - addSorting(id, allBaseOverrideDropPlayerItemWithRandomChoiceInferiors, baseSorting.getOverrideDropPlayerItemWithRandomChoiceInferiors()); - addSorting(id, allBaseAfterDropPlayerItemWithRandomChoiceSuperiors, baseSorting.getAfterDropPlayerItemWithRandomChoiceSuperiors()); - addSorting(id, allBaseAfterDropPlayerItemWithRandomChoiceInferiors, baseSorting.getAfterDropPlayerItemWithRandomChoiceInferiors()); - - addSorting(id, allBaseBeforeFallSuperiors, baseSorting.getBeforeFallSuperiors()); - addSorting(id, allBaseBeforeFallInferiors, baseSorting.getBeforeFallInferiors()); - addSorting(id, allBaseOverrideFallSuperiors, baseSorting.getOverrideFallSuperiors()); - addSorting(id, allBaseOverrideFallInferiors, baseSorting.getOverrideFallInferiors()); - addSorting(id, allBaseAfterFallSuperiors, baseSorting.getAfterFallSuperiors()); - addSorting(id, allBaseAfterFallInferiors, baseSorting.getAfterFallInferiors()); - - addSorting(id, allBaseBeforeGetAIMoveSpeedSuperiors, baseSorting.getBeforeGetAIMoveSpeedSuperiors()); - addSorting(id, allBaseBeforeGetAIMoveSpeedInferiors, baseSorting.getBeforeGetAIMoveSpeedInferiors()); - addSorting(id, allBaseOverrideGetAIMoveSpeedSuperiors, baseSorting.getOverrideGetAIMoveSpeedSuperiors()); - addSorting(id, allBaseOverrideGetAIMoveSpeedInferiors, baseSorting.getOverrideGetAIMoveSpeedInferiors()); - addSorting(id, allBaseAfterGetAIMoveSpeedSuperiors, baseSorting.getAfterGetAIMoveSpeedSuperiors()); - addSorting(id, allBaseAfterGetAIMoveSpeedInferiors, baseSorting.getAfterGetAIMoveSpeedInferiors()); - - addSorting(id, allBaseBeforeGetBreakSpeedSuperiors, baseSorting.getBeforeGetBreakSpeedSuperiors()); - addSorting(id, allBaseBeforeGetBreakSpeedInferiors, baseSorting.getBeforeGetBreakSpeedInferiors()); - addSorting(id, allBaseOverrideGetBreakSpeedSuperiors, baseSorting.getOverrideGetBreakSpeedSuperiors()); - addSorting(id, allBaseOverrideGetBreakSpeedInferiors, baseSorting.getOverrideGetBreakSpeedInferiors()); - addSorting(id, allBaseAfterGetBreakSpeedSuperiors, baseSorting.getAfterGetBreakSpeedSuperiors()); - addSorting(id, allBaseAfterGetBreakSpeedInferiors, baseSorting.getAfterGetBreakSpeedInferiors()); - - addSorting(id, allBaseBeforeGetDistanceSqSuperiors, baseSorting.getBeforeGetDistanceSqSuperiors()); - addSorting(id, allBaseBeforeGetDistanceSqInferiors, baseSorting.getBeforeGetDistanceSqInferiors()); - addSorting(id, allBaseOverrideGetDistanceSqSuperiors, baseSorting.getOverrideGetDistanceSqSuperiors()); - addSorting(id, allBaseOverrideGetDistanceSqInferiors, baseSorting.getOverrideGetDistanceSqInferiors()); - addSorting(id, allBaseAfterGetDistanceSqSuperiors, baseSorting.getAfterGetDistanceSqSuperiors()); - addSorting(id, allBaseAfterGetDistanceSqInferiors, baseSorting.getAfterGetDistanceSqInferiors()); - - addSorting(id, allBaseBeforeGetBrightnessSuperiors, baseSorting.getBeforeGetBrightnessSuperiors()); - addSorting(id, allBaseBeforeGetBrightnessInferiors, baseSorting.getBeforeGetBrightnessInferiors()); - addSorting(id, allBaseOverrideGetBrightnessSuperiors, baseSorting.getOverrideGetBrightnessSuperiors()); - addSorting(id, allBaseOverrideGetBrightnessInferiors, baseSorting.getOverrideGetBrightnessInferiors()); - addSorting(id, allBaseAfterGetBrightnessSuperiors, baseSorting.getAfterGetBrightnessSuperiors()); - addSorting(id, allBaseAfterGetBrightnessInferiors, baseSorting.getAfterGetBrightnessInferiors()); - - addSorting(id, allBaseBeforeGetEyeHeightSuperiors, baseSorting.getBeforeGetEyeHeightSuperiors()); - addSorting(id, allBaseBeforeGetEyeHeightInferiors, baseSorting.getBeforeGetEyeHeightInferiors()); - addSorting(id, allBaseOverrideGetEyeHeightSuperiors, baseSorting.getOverrideGetEyeHeightSuperiors()); - addSorting(id, allBaseOverrideGetEyeHeightInferiors, baseSorting.getOverrideGetEyeHeightInferiors()); - addSorting(id, allBaseAfterGetEyeHeightSuperiors, baseSorting.getAfterGetEyeHeightSuperiors()); - addSorting(id, allBaseAfterGetEyeHeightInferiors, baseSorting.getAfterGetEyeHeightInferiors()); - - addSorting(id, allBaseBeforeHealSuperiors, baseSorting.getBeforeHealSuperiors()); - addSorting(id, allBaseBeforeHealInferiors, baseSorting.getBeforeHealInferiors()); - addSorting(id, allBaseOverrideHealSuperiors, baseSorting.getOverrideHealSuperiors()); - addSorting(id, allBaseOverrideHealInferiors, baseSorting.getOverrideHealInferiors()); - addSorting(id, allBaseAfterHealSuperiors, baseSorting.getAfterHealSuperiors()); - addSorting(id, allBaseAfterHealInferiors, baseSorting.getAfterHealInferiors()); - - addSorting(id, allBaseBeforeIsEntityInsideOpaqueBlockSuperiors, baseSorting.getBeforeIsEntityInsideOpaqueBlockSuperiors()); - addSorting(id, allBaseBeforeIsEntityInsideOpaqueBlockInferiors, baseSorting.getBeforeIsEntityInsideOpaqueBlockInferiors()); - addSorting(id, allBaseOverrideIsEntityInsideOpaqueBlockSuperiors, baseSorting.getOverrideIsEntityInsideOpaqueBlockSuperiors()); - addSorting(id, allBaseOverrideIsEntityInsideOpaqueBlockInferiors, baseSorting.getOverrideIsEntityInsideOpaqueBlockInferiors()); - addSorting(id, allBaseAfterIsEntityInsideOpaqueBlockSuperiors, baseSorting.getAfterIsEntityInsideOpaqueBlockSuperiors()); - addSorting(id, allBaseAfterIsEntityInsideOpaqueBlockInferiors, baseSorting.getAfterIsEntityInsideOpaqueBlockInferiors()); - - addSorting(id, allBaseBeforeIsInWaterSuperiors, baseSorting.getBeforeIsInWaterSuperiors()); - addSorting(id, allBaseBeforeIsInWaterInferiors, baseSorting.getBeforeIsInWaterInferiors()); - addSorting(id, allBaseOverrideIsInWaterSuperiors, baseSorting.getOverrideIsInWaterSuperiors()); - addSorting(id, allBaseOverrideIsInWaterInferiors, baseSorting.getOverrideIsInWaterInferiors()); - addSorting(id, allBaseAfterIsInWaterSuperiors, baseSorting.getAfterIsInWaterSuperiors()); - addSorting(id, allBaseAfterIsInWaterInferiors, baseSorting.getAfterIsInWaterInferiors()); - - addSorting(id, allBaseBeforeIsInsideOfMaterialSuperiors, baseSorting.getBeforeIsInsideOfMaterialSuperiors()); - addSorting(id, allBaseBeforeIsInsideOfMaterialInferiors, baseSorting.getBeforeIsInsideOfMaterialInferiors()); - addSorting(id, allBaseOverrideIsInsideOfMaterialSuperiors, baseSorting.getOverrideIsInsideOfMaterialSuperiors()); - addSorting(id, allBaseOverrideIsInsideOfMaterialInferiors, baseSorting.getOverrideIsInsideOfMaterialInferiors()); - addSorting(id, allBaseAfterIsInsideOfMaterialSuperiors, baseSorting.getAfterIsInsideOfMaterialSuperiors()); - addSorting(id, allBaseAfterIsInsideOfMaterialInferiors, baseSorting.getAfterIsInsideOfMaterialInferiors()); - - addSorting(id, allBaseBeforeIsOnLadderSuperiors, baseSorting.getBeforeIsOnLadderSuperiors()); - addSorting(id, allBaseBeforeIsOnLadderInferiors, baseSorting.getBeforeIsOnLadderInferiors()); - addSorting(id, allBaseOverrideIsOnLadderSuperiors, baseSorting.getOverrideIsOnLadderSuperiors()); - addSorting(id, allBaseOverrideIsOnLadderInferiors, baseSorting.getOverrideIsOnLadderInferiors()); - addSorting(id, allBaseAfterIsOnLadderSuperiors, baseSorting.getAfterIsOnLadderSuperiors()); - addSorting(id, allBaseAfterIsOnLadderInferiors, baseSorting.getAfterIsOnLadderInferiors()); - - addSorting(id, allBaseBeforeIsPlayerSleepingSuperiors, baseSorting.getBeforeIsPlayerSleepingSuperiors()); - addSorting(id, allBaseBeforeIsPlayerSleepingInferiors, baseSorting.getBeforeIsPlayerSleepingInferiors()); - addSorting(id, allBaseOverrideIsPlayerSleepingSuperiors, baseSorting.getOverrideIsPlayerSleepingSuperiors()); - addSorting(id, allBaseOverrideIsPlayerSleepingInferiors, baseSorting.getOverrideIsPlayerSleepingInferiors()); - addSorting(id, allBaseAfterIsPlayerSleepingSuperiors, baseSorting.getAfterIsPlayerSleepingSuperiors()); - addSorting(id, allBaseAfterIsPlayerSleepingInferiors, baseSorting.getAfterIsPlayerSleepingInferiors()); - - addSorting(id, allBaseBeforeIsSneakingSuperiors, baseSorting.getBeforeIsSneakingSuperiors()); - addSorting(id, allBaseBeforeIsSneakingInferiors, baseSorting.getBeforeIsSneakingInferiors()); - addSorting(id, allBaseOverrideIsSneakingSuperiors, baseSorting.getOverrideIsSneakingSuperiors()); - addSorting(id, allBaseOverrideIsSneakingInferiors, baseSorting.getOverrideIsSneakingInferiors()); - addSorting(id, allBaseAfterIsSneakingSuperiors, baseSorting.getAfterIsSneakingSuperiors()); - addSorting(id, allBaseAfterIsSneakingInferiors, baseSorting.getAfterIsSneakingInferiors()); - - addSorting(id, allBaseBeforeJumpSuperiors, baseSorting.getBeforeJumpSuperiors()); - addSorting(id, allBaseBeforeJumpInferiors, baseSorting.getBeforeJumpInferiors()); - addSorting(id, allBaseOverrideJumpSuperiors, baseSorting.getOverrideJumpSuperiors()); - addSorting(id, allBaseOverrideJumpInferiors, baseSorting.getOverrideJumpInferiors()); - addSorting(id, allBaseAfterJumpSuperiors, baseSorting.getAfterJumpSuperiors()); - addSorting(id, allBaseAfterJumpInferiors, baseSorting.getAfterJumpInferiors()); - - addSorting(id, allBaseBeforeKnockBackSuperiors, baseSorting.getBeforeKnockBackSuperiors()); - addSorting(id, allBaseBeforeKnockBackInferiors, baseSorting.getBeforeKnockBackInferiors()); - addSorting(id, allBaseOverrideKnockBackSuperiors, baseSorting.getOverrideKnockBackSuperiors()); - addSorting(id, allBaseOverrideKnockBackInferiors, baseSorting.getOverrideKnockBackInferiors()); - addSorting(id, allBaseAfterKnockBackSuperiors, baseSorting.getAfterKnockBackSuperiors()); - addSorting(id, allBaseAfterKnockBackInferiors, baseSorting.getAfterKnockBackInferiors()); - - addSorting(id, allBaseBeforeMountEntitySuperiors, baseSorting.getBeforeMountEntitySuperiors()); - addSorting(id, allBaseBeforeMountEntityInferiors, baseSorting.getBeforeMountEntityInferiors()); - addSorting(id, allBaseOverrideMountEntitySuperiors, baseSorting.getOverrideMountEntitySuperiors()); - addSorting(id, allBaseOverrideMountEntityInferiors, baseSorting.getOverrideMountEntityInferiors()); - addSorting(id, allBaseAfterMountEntitySuperiors, baseSorting.getAfterMountEntitySuperiors()); - addSorting(id, allBaseAfterMountEntityInferiors, baseSorting.getAfterMountEntityInferiors()); - - addSorting(id, allBaseBeforeMoveEntitySuperiors, baseSorting.getBeforeMoveEntitySuperiors()); - addSorting(id, allBaseBeforeMoveEntityInferiors, baseSorting.getBeforeMoveEntityInferiors()); - addSorting(id, allBaseOverrideMoveEntitySuperiors, baseSorting.getOverrideMoveEntitySuperiors()); - addSorting(id, allBaseOverrideMoveEntityInferiors, baseSorting.getOverrideMoveEntityInferiors()); - addSorting(id, allBaseAfterMoveEntitySuperiors, baseSorting.getAfterMoveEntitySuperiors()); - addSorting(id, allBaseAfterMoveEntityInferiors, baseSorting.getAfterMoveEntityInferiors()); - - addSorting(id, allBaseBeforeMoveEntityWithHeadingSuperiors, baseSorting.getBeforeMoveEntityWithHeadingSuperiors()); - addSorting(id, allBaseBeforeMoveEntityWithHeadingInferiors, baseSorting.getBeforeMoveEntityWithHeadingInferiors()); - addSorting(id, allBaseOverrideMoveEntityWithHeadingSuperiors, baseSorting.getOverrideMoveEntityWithHeadingSuperiors()); - addSorting(id, allBaseOverrideMoveEntityWithHeadingInferiors, baseSorting.getOverrideMoveEntityWithHeadingInferiors()); - addSorting(id, allBaseAfterMoveEntityWithHeadingSuperiors, baseSorting.getAfterMoveEntityWithHeadingSuperiors()); - addSorting(id, allBaseAfterMoveEntityWithHeadingInferiors, baseSorting.getAfterMoveEntityWithHeadingInferiors()); - - addSorting(id, allBaseBeforeMoveFlyingSuperiors, baseSorting.getBeforeMoveFlyingSuperiors()); - addSorting(id, allBaseBeforeMoveFlyingInferiors, baseSorting.getBeforeMoveFlyingInferiors()); - addSorting(id, allBaseOverrideMoveFlyingSuperiors, baseSorting.getOverrideMoveFlyingSuperiors()); - addSorting(id, allBaseOverrideMoveFlyingInferiors, baseSorting.getOverrideMoveFlyingInferiors()); - addSorting(id, allBaseAfterMoveFlyingSuperiors, baseSorting.getAfterMoveFlyingSuperiors()); - addSorting(id, allBaseAfterMoveFlyingInferiors, baseSorting.getAfterMoveFlyingInferiors()); - - addSorting(id, allBaseBeforeOnDeathSuperiors, baseSorting.getBeforeOnDeathSuperiors()); - addSorting(id, allBaseBeforeOnDeathInferiors, baseSorting.getBeforeOnDeathInferiors()); - addSorting(id, allBaseOverrideOnDeathSuperiors, baseSorting.getOverrideOnDeathSuperiors()); - addSorting(id, allBaseOverrideOnDeathInferiors, baseSorting.getOverrideOnDeathInferiors()); - addSorting(id, allBaseAfterOnDeathSuperiors, baseSorting.getAfterOnDeathSuperiors()); - addSorting(id, allBaseAfterOnDeathInferiors, baseSorting.getAfterOnDeathInferiors()); - - addSorting(id, allBaseBeforeOnLivingUpdateSuperiors, baseSorting.getBeforeOnLivingUpdateSuperiors()); - addSorting(id, allBaseBeforeOnLivingUpdateInferiors, baseSorting.getBeforeOnLivingUpdateInferiors()); - addSorting(id, allBaseOverrideOnLivingUpdateSuperiors, baseSorting.getOverrideOnLivingUpdateSuperiors()); - addSorting(id, allBaseOverrideOnLivingUpdateInferiors, baseSorting.getOverrideOnLivingUpdateInferiors()); - addSorting(id, allBaseAfterOnLivingUpdateSuperiors, baseSorting.getAfterOnLivingUpdateSuperiors()); - addSorting(id, allBaseAfterOnLivingUpdateInferiors, baseSorting.getAfterOnLivingUpdateInferiors()); - - addSorting(id, allBaseBeforeOnKillEntitySuperiors, baseSorting.getBeforeOnKillEntitySuperiors()); - addSorting(id, allBaseBeforeOnKillEntityInferiors, baseSorting.getBeforeOnKillEntityInferiors()); - addSorting(id, allBaseOverrideOnKillEntitySuperiors, baseSorting.getOverrideOnKillEntitySuperiors()); - addSorting(id, allBaseOverrideOnKillEntityInferiors, baseSorting.getOverrideOnKillEntityInferiors()); - addSorting(id, allBaseAfterOnKillEntitySuperiors, baseSorting.getAfterOnKillEntitySuperiors()); - addSorting(id, allBaseAfterOnKillEntityInferiors, baseSorting.getAfterOnKillEntityInferiors()); - - addSorting(id, allBaseBeforeOnStruckByLightningSuperiors, baseSorting.getBeforeOnStruckByLightningSuperiors()); - addSorting(id, allBaseBeforeOnStruckByLightningInferiors, baseSorting.getBeforeOnStruckByLightningInferiors()); - addSorting(id, allBaseOverrideOnStruckByLightningSuperiors, baseSorting.getOverrideOnStruckByLightningSuperiors()); - addSorting(id, allBaseOverrideOnStruckByLightningInferiors, baseSorting.getOverrideOnStruckByLightningInferiors()); - addSorting(id, allBaseAfterOnStruckByLightningSuperiors, baseSorting.getAfterOnStruckByLightningSuperiors()); - addSorting(id, allBaseAfterOnStruckByLightningInferiors, baseSorting.getAfterOnStruckByLightningInferiors()); - - addSorting(id, allBaseBeforeOnUpdateSuperiors, baseSorting.getBeforeOnUpdateSuperiors()); - addSorting(id, allBaseBeforeOnUpdateInferiors, baseSorting.getBeforeOnUpdateInferiors()); - addSorting(id, allBaseOverrideOnUpdateSuperiors, baseSorting.getOverrideOnUpdateSuperiors()); - addSorting(id, allBaseOverrideOnUpdateInferiors, baseSorting.getOverrideOnUpdateInferiors()); - addSorting(id, allBaseAfterOnUpdateSuperiors, baseSorting.getAfterOnUpdateSuperiors()); - addSorting(id, allBaseAfterOnUpdateInferiors, baseSorting.getAfterOnUpdateInferiors()); - - addSorting(id, allBaseBeforeOnUpdateEntitySuperiors, baseSorting.getBeforeOnUpdateEntitySuperiors()); - addSorting(id, allBaseBeforeOnUpdateEntityInferiors, baseSorting.getBeforeOnUpdateEntityInferiors()); - addSorting(id, allBaseOverrideOnUpdateEntitySuperiors, baseSorting.getOverrideOnUpdateEntitySuperiors()); - addSorting(id, allBaseOverrideOnUpdateEntityInferiors, baseSorting.getOverrideOnUpdateEntityInferiors()); - addSorting(id, allBaseAfterOnUpdateEntitySuperiors, baseSorting.getAfterOnUpdateEntitySuperiors()); - addSorting(id, allBaseAfterOnUpdateEntityInferiors, baseSorting.getAfterOnUpdateEntityInferiors()); - - addSorting(id, allBaseBeforeReadEntityFromNBTSuperiors, baseSorting.getBeforeReadEntityFromNBTSuperiors()); - addSorting(id, allBaseBeforeReadEntityFromNBTInferiors, baseSorting.getBeforeReadEntityFromNBTInferiors()); - addSorting(id, allBaseOverrideReadEntityFromNBTSuperiors, baseSorting.getOverrideReadEntityFromNBTSuperiors()); - addSorting(id, allBaseOverrideReadEntityFromNBTInferiors, baseSorting.getOverrideReadEntityFromNBTInferiors()); - addSorting(id, allBaseAfterReadEntityFromNBTSuperiors, baseSorting.getAfterReadEntityFromNBTSuperiors()); - addSorting(id, allBaseAfterReadEntityFromNBTInferiors, baseSorting.getAfterReadEntityFromNBTInferiors()); - - addSorting(id, allBaseBeforeSetDeadSuperiors, baseSorting.getBeforeSetDeadSuperiors()); - addSorting(id, allBaseBeforeSetDeadInferiors, baseSorting.getBeforeSetDeadInferiors()); - addSorting(id, allBaseOverrideSetDeadSuperiors, baseSorting.getOverrideSetDeadSuperiors()); - addSorting(id, allBaseOverrideSetDeadInferiors, baseSorting.getOverrideSetDeadInferiors()); - addSorting(id, allBaseAfterSetDeadSuperiors, baseSorting.getAfterSetDeadSuperiors()); - addSorting(id, allBaseAfterSetDeadInferiors, baseSorting.getAfterSetDeadInferiors()); - - addSorting(id, allBaseBeforeSetEntityActionStateSuperiors, baseSorting.getBeforeSetEntityActionStateSuperiors()); - addSorting(id, allBaseBeforeSetEntityActionStateInferiors, baseSorting.getBeforeSetEntityActionStateInferiors()); - addSorting(id, allBaseOverrideSetEntityActionStateSuperiors, baseSorting.getOverrideSetEntityActionStateSuperiors()); - addSorting(id, allBaseOverrideSetEntityActionStateInferiors, baseSorting.getOverrideSetEntityActionStateInferiors()); - addSorting(id, allBaseAfterSetEntityActionStateSuperiors, baseSorting.getAfterSetEntityActionStateSuperiors()); - addSorting(id, allBaseAfterSetEntityActionStateInferiors, baseSorting.getAfterSetEntityActionStateInferiors()); - - addSorting(id, allBaseBeforeSetPositionSuperiors, baseSorting.getBeforeSetPositionSuperiors()); - addSorting(id, allBaseBeforeSetPositionInferiors, baseSorting.getBeforeSetPositionInferiors()); - addSorting(id, allBaseOverrideSetPositionSuperiors, baseSorting.getOverrideSetPositionSuperiors()); - addSorting(id, allBaseOverrideSetPositionInferiors, baseSorting.getOverrideSetPositionInferiors()); - addSorting(id, allBaseAfterSetPositionSuperiors, baseSorting.getAfterSetPositionSuperiors()); - addSorting(id, allBaseAfterSetPositionInferiors, baseSorting.getAfterSetPositionInferiors()); - - addSorting(id, allBaseBeforeSetSneakingSuperiors, baseSorting.getBeforeSetSneakingSuperiors()); - addSorting(id, allBaseBeforeSetSneakingInferiors, baseSorting.getBeforeSetSneakingInferiors()); - addSorting(id, allBaseOverrideSetSneakingSuperiors, baseSorting.getOverrideSetSneakingSuperiors()); - addSorting(id, allBaseOverrideSetSneakingInferiors, baseSorting.getOverrideSetSneakingInferiors()); - addSorting(id, allBaseAfterSetSneakingSuperiors, baseSorting.getAfterSetSneakingSuperiors()); - addSorting(id, allBaseAfterSetSneakingInferiors, baseSorting.getAfterSetSneakingInferiors()); - - addSorting(id, allBaseBeforeSetSprintingSuperiors, baseSorting.getBeforeSetSprintingSuperiors()); - addSorting(id, allBaseBeforeSetSprintingInferiors, baseSorting.getBeforeSetSprintingInferiors()); - addSorting(id, allBaseOverrideSetSprintingSuperiors, baseSorting.getOverrideSetSprintingSuperiors()); - addSorting(id, allBaseOverrideSetSprintingInferiors, baseSorting.getOverrideSetSprintingInferiors()); - addSorting(id, allBaseAfterSetSprintingSuperiors, baseSorting.getAfterSetSprintingSuperiors()); - addSorting(id, allBaseAfterSetSprintingInferiors, baseSorting.getAfterSetSprintingInferiors()); - - addSorting(id, allBaseBeforeSwingItemSuperiors, baseSorting.getBeforeSwingItemSuperiors()); - addSorting(id, allBaseBeforeSwingItemInferiors, baseSorting.getBeforeSwingItemInferiors()); - addSorting(id, allBaseOverrideSwingItemSuperiors, baseSorting.getOverrideSwingItemSuperiors()); - addSorting(id, allBaseOverrideSwingItemInferiors, baseSorting.getOverrideSwingItemInferiors()); - addSorting(id, allBaseAfterSwingItemSuperiors, baseSorting.getAfterSwingItemSuperiors()); - addSorting(id, allBaseAfterSwingItemInferiors, baseSorting.getAfterSwingItemInferiors()); - - addSorting(id, allBaseBeforeUpdateEntityActionStateSuperiors, baseSorting.getBeforeUpdateEntityActionStateSuperiors()); - addSorting(id, allBaseBeforeUpdateEntityActionStateInferiors, baseSorting.getBeforeUpdateEntityActionStateInferiors()); - addSorting(id, allBaseOverrideUpdateEntityActionStateSuperiors, baseSorting.getOverrideUpdateEntityActionStateSuperiors()); - addSorting(id, allBaseOverrideUpdateEntityActionStateInferiors, baseSorting.getOverrideUpdateEntityActionStateInferiors()); - addSorting(id, allBaseAfterUpdateEntityActionStateSuperiors, baseSorting.getAfterUpdateEntityActionStateSuperiors()); - addSorting(id, allBaseAfterUpdateEntityActionStateInferiors, baseSorting.getAfterUpdateEntityActionStateInferiors()); - - addSorting(id, allBaseBeforeUpdatePotionEffectsSuperiors, baseSorting.getBeforeUpdatePotionEffectsSuperiors()); - addSorting(id, allBaseBeforeUpdatePotionEffectsInferiors, baseSorting.getBeforeUpdatePotionEffectsInferiors()); - addSorting(id, allBaseOverrideUpdatePotionEffectsSuperiors, baseSorting.getOverrideUpdatePotionEffectsSuperiors()); - addSorting(id, allBaseOverrideUpdatePotionEffectsInferiors, baseSorting.getOverrideUpdatePotionEffectsInferiors()); - addSorting(id, allBaseAfterUpdatePotionEffectsSuperiors, baseSorting.getAfterUpdatePotionEffectsSuperiors()); - addSorting(id, allBaseAfterUpdatePotionEffectsInferiors, baseSorting.getAfterUpdatePotionEffectsInferiors()); - - addSorting(id, allBaseBeforeUpdateRiddenSuperiors, baseSorting.getBeforeUpdateRiddenSuperiors()); - addSorting(id, allBaseBeforeUpdateRiddenInferiors, baseSorting.getBeforeUpdateRiddenInferiors()); - addSorting(id, allBaseOverrideUpdateRiddenSuperiors, baseSorting.getOverrideUpdateRiddenSuperiors()); - addSorting(id, allBaseOverrideUpdateRiddenInferiors, baseSorting.getOverrideUpdateRiddenInferiors()); - addSorting(id, allBaseAfterUpdateRiddenSuperiors, baseSorting.getAfterUpdateRiddenSuperiors()); - addSorting(id, allBaseAfterUpdateRiddenInferiors, baseSorting.getAfterUpdateRiddenInferiors()); - - addSorting(id, allBaseBeforeWakeUpPlayerSuperiors, baseSorting.getBeforeWakeUpPlayerSuperiors()); - addSorting(id, allBaseBeforeWakeUpPlayerInferiors, baseSorting.getBeforeWakeUpPlayerInferiors()); - addSorting(id, allBaseOverrideWakeUpPlayerSuperiors, baseSorting.getOverrideWakeUpPlayerSuperiors()); - addSorting(id, allBaseOverrideWakeUpPlayerInferiors, baseSorting.getOverrideWakeUpPlayerInferiors()); - addSorting(id, allBaseAfterWakeUpPlayerSuperiors, baseSorting.getAfterWakeUpPlayerSuperiors()); - addSorting(id, allBaseAfterWakeUpPlayerInferiors, baseSorting.getAfterWakeUpPlayerInferiors()); - - addSorting(id, allBaseBeforeWriteEntityToNBTSuperiors, baseSorting.getBeforeWriteEntityToNBTSuperiors()); - addSorting(id, allBaseBeforeWriteEntityToNBTInferiors, baseSorting.getBeforeWriteEntityToNBTInferiors()); - addSorting(id, allBaseOverrideWriteEntityToNBTSuperiors, baseSorting.getOverrideWriteEntityToNBTSuperiors()); - addSorting(id, allBaseOverrideWriteEntityToNBTInferiors, baseSorting.getOverrideWriteEntityToNBTInferiors()); - addSorting(id, allBaseAfterWriteEntityToNBTSuperiors, baseSorting.getAfterWriteEntityToNBTSuperiors()); - addSorting(id, allBaseAfterWriteEntityToNBTInferiors, baseSorting.getAfterWriteEntityToNBTInferiors()); - - } - - addMethod(id, baseClass, beforeLocalConstructingHookTypes, "beforeLocalConstructing", net.minecraft.server.MinecraftServer.class, net.minecraft.world.WorldServer.class, com.mojang.authlib.GameProfile.class, net.minecraft.server.management.PlayerInteractionManager.class); - addMethod(id, baseClass, afterLocalConstructingHookTypes, "afterLocalConstructing", net.minecraft.server.MinecraftServer.class, net.minecraft.world.WorldServer.class, com.mojang.authlib.GameProfile.class, net.minecraft.server.management.PlayerInteractionManager.class); - - - addMethod(id, baseClass, beforeAddExhaustionHookTypes, "beforeAddExhaustion", float.class); - addMethod(id, baseClass, overrideAddExhaustionHookTypes, "addExhaustion", float.class); - addMethod(id, baseClass, afterAddExhaustionHookTypes, "afterAddExhaustion", float.class); - - addMethod(id, baseClass, beforeAddExperienceHookTypes, "beforeAddExperience", int.class); - addMethod(id, baseClass, overrideAddExperienceHookTypes, "addExperience", int.class); - addMethod(id, baseClass, afterAddExperienceHookTypes, "afterAddExperience", int.class); - - addMethod(id, baseClass, beforeAddExperienceLevelHookTypes, "beforeAddExperienceLevel", int.class); - addMethod(id, baseClass, overrideAddExperienceLevelHookTypes, "addExperienceLevel", int.class); - addMethod(id, baseClass, afterAddExperienceLevelHookTypes, "afterAddExperienceLevel", int.class); - - addMethod(id, baseClass, beforeAddMovementStatHookTypes, "beforeAddMovementStat", double.class, double.class, double.class); - addMethod(id, baseClass, overrideAddMovementStatHookTypes, "addMovementStat", double.class, double.class, double.class); - addMethod(id, baseClass, afterAddMovementStatHookTypes, "afterAddMovementStat", double.class, double.class, double.class); - - addMethod(id, baseClass, beforeAttackEntityFromHookTypes, "beforeAttackEntityFrom", net.minecraft.util.DamageSource.class, float.class); - addMethod(id, baseClass, overrideAttackEntityFromHookTypes, "attackEntityFrom", net.minecraft.util.DamageSource.class, float.class); - addMethod(id, baseClass, afterAttackEntityFromHookTypes, "afterAttackEntityFrom", net.minecraft.util.DamageSource.class, float.class); - - addMethod(id, baseClass, beforeAttackTargetEntityWithCurrentItemHookTypes, "beforeAttackTargetEntityWithCurrentItem", net.minecraft.entity.Entity.class); - addMethod(id, baseClass, overrideAttackTargetEntityWithCurrentItemHookTypes, "attackTargetEntityWithCurrentItem", net.minecraft.entity.Entity.class); - addMethod(id, baseClass, afterAttackTargetEntityWithCurrentItemHookTypes, "afterAttackTargetEntityWithCurrentItem", net.minecraft.entity.Entity.class); - - addMethod(id, baseClass, beforeCanBreatheUnderwaterHookTypes, "beforeCanBreatheUnderwater"); - addMethod(id, baseClass, overrideCanBreatheUnderwaterHookTypes, "canBreatheUnderwater"); - addMethod(id, baseClass, afterCanBreatheUnderwaterHookTypes, "afterCanBreatheUnderwater"); - - addMethod(id, baseClass, beforeCanHarvestBlockHookTypes, "beforeCanHarvestBlock", net.minecraft.block.state.IBlockState.class); - addMethod(id, baseClass, overrideCanHarvestBlockHookTypes, "canHarvestBlock", net.minecraft.block.state.IBlockState.class); - addMethod(id, baseClass, afterCanHarvestBlockHookTypes, "afterCanHarvestBlock", net.minecraft.block.state.IBlockState.class); - - addMethod(id, baseClass, beforeCanPlayerEditHookTypes, "beforeCanPlayerEdit", net.minecraft.util.math.BlockPos.class, net.minecraft.util.EnumFacing.class, net.minecraft.item.ItemStack.class); - addMethod(id, baseClass, overrideCanPlayerEditHookTypes, "canPlayerEdit", net.minecraft.util.math.BlockPos.class, net.minecraft.util.EnumFacing.class, net.minecraft.item.ItemStack.class); - addMethod(id, baseClass, afterCanPlayerEditHookTypes, "afterCanPlayerEdit", net.minecraft.util.math.BlockPos.class, net.minecraft.util.EnumFacing.class, net.minecraft.item.ItemStack.class); - - addMethod(id, baseClass, beforeCanTriggerWalkingHookTypes, "beforeCanTriggerWalking"); - addMethod(id, baseClass, overrideCanTriggerWalkingHookTypes, "canTriggerWalking"); - addMethod(id, baseClass, afterCanTriggerWalkingHookTypes, "afterCanTriggerWalking"); - - addMethod(id, baseClass, beforeClonePlayerHookTypes, "beforeClonePlayer", net.minecraft.entity.player.EntityPlayer.class, boolean.class); - addMethod(id, baseClass, overrideClonePlayerHookTypes, "clonePlayer", net.minecraft.entity.player.EntityPlayer.class, boolean.class); - addMethod(id, baseClass, afterClonePlayerHookTypes, "afterClonePlayer", net.minecraft.entity.player.EntityPlayer.class, boolean.class); - - addMethod(id, baseClass, beforeDamageEntityHookTypes, "beforeDamageEntity", net.minecraft.util.DamageSource.class, float.class); - addMethod(id, baseClass, overrideDamageEntityHookTypes, "damageEntity", net.minecraft.util.DamageSource.class, float.class); - addMethod(id, baseClass, afterDamageEntityHookTypes, "afterDamageEntity", net.minecraft.util.DamageSource.class, float.class); - - addMethod(id, baseClass, beforeDisplayGuiHookTypes, "beforeDisplayGui", net.minecraft.world.IInteractionObject.class); - addMethod(id, baseClass, overrideDisplayGuiHookTypes, "displayGui", net.minecraft.world.IInteractionObject.class); - addMethod(id, baseClass, afterDisplayGuiHookTypes, "afterDisplayGui", net.minecraft.world.IInteractionObject.class); - - addMethod(id, baseClass, beforeDisplayGUIChestHookTypes, "beforeDisplayGUIChest", net.minecraft.inventory.IInventory.class); - addMethod(id, baseClass, overrideDisplayGUIChestHookTypes, "displayGUIChest", net.minecraft.inventory.IInventory.class); - addMethod(id, baseClass, afterDisplayGUIChestHookTypes, "afterDisplayGUIChest", net.minecraft.inventory.IInventory.class); - - addMethod(id, baseClass, beforeDropOneItemHookTypes, "beforeDropOneItem", boolean.class); - addMethod(id, baseClass, overrideDropOneItemHookTypes, "dropOneItem", boolean.class); - addMethod(id, baseClass, afterDropOneItemHookTypes, "afterDropOneItem", boolean.class); - - addMethod(id, baseClass, beforeDropPlayerItemWithRandomChoiceHookTypes, "beforeDropPlayerItemWithRandomChoice", net.minecraft.item.ItemStack.class, boolean.class); - addMethod(id, baseClass, overrideDropPlayerItemWithRandomChoiceHookTypes, "dropPlayerItemWithRandomChoice", net.minecraft.item.ItemStack.class, boolean.class); - addMethod(id, baseClass, afterDropPlayerItemWithRandomChoiceHookTypes, "afterDropPlayerItemWithRandomChoice", net.minecraft.item.ItemStack.class, boolean.class); - - addMethod(id, baseClass, beforeFallHookTypes, "beforeFall", float.class, float.class); - addMethod(id, baseClass, overrideFallHookTypes, "fall", float.class, float.class); - addMethod(id, baseClass, afterFallHookTypes, "afterFall", float.class, float.class); - - addMethod(id, baseClass, beforeGetAIMoveSpeedHookTypes, "beforeGetAIMoveSpeed"); - addMethod(id, baseClass, overrideGetAIMoveSpeedHookTypes, "getAIMoveSpeed"); - addMethod(id, baseClass, afterGetAIMoveSpeedHookTypes, "afterGetAIMoveSpeed"); - - addMethod(id, baseClass, beforeGetBreakSpeedHookTypes, "beforeGetBreakSpeed", net.minecraft.block.state.IBlockState.class, net.minecraft.util.math.BlockPos.class); - addMethod(id, baseClass, overrideGetBreakSpeedHookTypes, "getBreakSpeed", net.minecraft.block.state.IBlockState.class, net.minecraft.util.math.BlockPos.class); - addMethod(id, baseClass, afterGetBreakSpeedHookTypes, "afterGetBreakSpeed", net.minecraft.block.state.IBlockState.class, net.minecraft.util.math.BlockPos.class); - - addMethod(id, baseClass, beforeGetDistanceSqHookTypes, "beforeGetDistanceSq", double.class, double.class, double.class); - addMethod(id, baseClass, overrideGetDistanceSqHookTypes, "getDistanceSq", double.class, double.class, double.class); - addMethod(id, baseClass, afterGetDistanceSqHookTypes, "afterGetDistanceSq", double.class, double.class, double.class); - - addMethod(id, baseClass, beforeGetBrightnessHookTypes, "beforeGetBrightness", float.class); - addMethod(id, baseClass, overrideGetBrightnessHookTypes, "getBrightness", float.class); - addMethod(id, baseClass, afterGetBrightnessHookTypes, "afterGetBrightness", float.class); - - addMethod(id, baseClass, beforeGetEyeHeightHookTypes, "beforeGetEyeHeight"); - addMethod(id, baseClass, overrideGetEyeHeightHookTypes, "getEyeHeight"); - addMethod(id, baseClass, afterGetEyeHeightHookTypes, "afterGetEyeHeight"); - - addMethod(id, baseClass, beforeHealHookTypes, "beforeHeal", float.class); - addMethod(id, baseClass, overrideHealHookTypes, "heal", float.class); - addMethod(id, baseClass, afterHealHookTypes, "afterHeal", float.class); - - addMethod(id, baseClass, beforeIsEntityInsideOpaqueBlockHookTypes, "beforeIsEntityInsideOpaqueBlock"); - addMethod(id, baseClass, overrideIsEntityInsideOpaqueBlockHookTypes, "isEntityInsideOpaqueBlock"); - addMethod(id, baseClass, afterIsEntityInsideOpaqueBlockHookTypes, "afterIsEntityInsideOpaqueBlock"); - - addMethod(id, baseClass, beforeIsInWaterHookTypes, "beforeIsInWater"); - addMethod(id, baseClass, overrideIsInWaterHookTypes, "isInWater"); - addMethod(id, baseClass, afterIsInWaterHookTypes, "afterIsInWater"); - - addMethod(id, baseClass, beforeIsInsideOfMaterialHookTypes, "beforeIsInsideOfMaterial", net.minecraft.block.material.Material.class); - addMethod(id, baseClass, overrideIsInsideOfMaterialHookTypes, "isInsideOfMaterial", net.minecraft.block.material.Material.class); - addMethod(id, baseClass, afterIsInsideOfMaterialHookTypes, "afterIsInsideOfMaterial", net.minecraft.block.material.Material.class); - - addMethod(id, baseClass, beforeIsOnLadderHookTypes, "beforeIsOnLadder"); - addMethod(id, baseClass, overrideIsOnLadderHookTypes, "isOnLadder"); - addMethod(id, baseClass, afterIsOnLadderHookTypes, "afterIsOnLadder"); - - addMethod(id, baseClass, beforeIsPlayerSleepingHookTypes, "beforeIsPlayerSleeping"); - addMethod(id, baseClass, overrideIsPlayerSleepingHookTypes, "isPlayerSleeping"); - addMethod(id, baseClass, afterIsPlayerSleepingHookTypes, "afterIsPlayerSleeping"); - - addMethod(id, baseClass, beforeIsSneakingHookTypes, "beforeIsSneaking"); - addMethod(id, baseClass, overrideIsSneakingHookTypes, "isSneaking"); - addMethod(id, baseClass, afterIsSneakingHookTypes, "afterIsSneaking"); - - addMethod(id, baseClass, beforeJumpHookTypes, "beforeJump"); - addMethod(id, baseClass, overrideJumpHookTypes, "jump"); - addMethod(id, baseClass, afterJumpHookTypes, "afterJump"); - - addMethod(id, baseClass, beforeKnockBackHookTypes, "beforeKnockBack", net.minecraft.entity.Entity.class, float.class, double.class, double.class); - addMethod(id, baseClass, overrideKnockBackHookTypes, "knockBack", net.minecraft.entity.Entity.class, float.class, double.class, double.class); - addMethod(id, baseClass, afterKnockBackHookTypes, "afterKnockBack", net.minecraft.entity.Entity.class, float.class, double.class, double.class); - - addMethod(id, baseClass, beforeMountEntityHookTypes, "beforeMountEntity", net.minecraft.entity.Entity.class, boolean.class); - addMethod(id, baseClass, overrideMountEntityHookTypes, "mountEntity", net.minecraft.entity.Entity.class, boolean.class); - addMethod(id, baseClass, afterMountEntityHookTypes, "afterMountEntity", net.minecraft.entity.Entity.class, boolean.class); - - addMethod(id, baseClass, beforeMoveEntityHookTypes, "beforeMoveEntity", double.class, double.class, double.class); - addMethod(id, baseClass, overrideMoveEntityHookTypes, "moveEntity", double.class, double.class, double.class); - addMethod(id, baseClass, afterMoveEntityHookTypes, "afterMoveEntity", double.class, double.class, double.class); - - addMethod(id, baseClass, beforeMoveEntityWithHeadingHookTypes, "beforeMoveEntityWithHeading", float.class, float.class); - addMethod(id, baseClass, overrideMoveEntityWithHeadingHookTypes, "moveEntityWithHeading", float.class, float.class); - addMethod(id, baseClass, afterMoveEntityWithHeadingHookTypes, "afterMoveEntityWithHeading", float.class, float.class); - - addMethod(id, baseClass, beforeMoveFlyingHookTypes, "beforeMoveFlying", float.class, float.class, float.class); - addMethod(id, baseClass, overrideMoveFlyingHookTypes, "moveFlying", float.class, float.class, float.class); - addMethod(id, baseClass, afterMoveFlyingHookTypes, "afterMoveFlying", float.class, float.class, float.class); - - addMethod(id, baseClass, beforeOnDeathHookTypes, "beforeOnDeath", net.minecraft.util.DamageSource.class); - addMethod(id, baseClass, overrideOnDeathHookTypes, "onDeath", net.minecraft.util.DamageSource.class); - addMethod(id, baseClass, afterOnDeathHookTypes, "afterOnDeath", net.minecraft.util.DamageSource.class); - - addMethod(id, baseClass, beforeOnLivingUpdateHookTypes, "beforeOnLivingUpdate"); - addMethod(id, baseClass, overrideOnLivingUpdateHookTypes, "onLivingUpdate"); - addMethod(id, baseClass, afterOnLivingUpdateHookTypes, "afterOnLivingUpdate"); - - addMethod(id, baseClass, beforeOnKillEntityHookTypes, "beforeOnKillEntity", net.minecraft.entity.EntityLivingBase.class); - addMethod(id, baseClass, overrideOnKillEntityHookTypes, "onKillEntity", net.minecraft.entity.EntityLivingBase.class); - addMethod(id, baseClass, afterOnKillEntityHookTypes, "afterOnKillEntity", net.minecraft.entity.EntityLivingBase.class); - - addMethod(id, baseClass, beforeOnStruckByLightningHookTypes, "beforeOnStruckByLightning", net.minecraft.entity.effect.EntityLightningBolt.class); - addMethod(id, baseClass, overrideOnStruckByLightningHookTypes, "onStruckByLightning", net.minecraft.entity.effect.EntityLightningBolt.class); - addMethod(id, baseClass, afterOnStruckByLightningHookTypes, "afterOnStruckByLightning", net.minecraft.entity.effect.EntityLightningBolt.class); - - addMethod(id, baseClass, beforeOnUpdateHookTypes, "beforeOnUpdate"); - addMethod(id, baseClass, overrideOnUpdateHookTypes, "onUpdate"); - addMethod(id, baseClass, afterOnUpdateHookTypes, "afterOnUpdate"); - - addMethod(id, baseClass, beforeOnUpdateEntityHookTypes, "beforeOnUpdateEntity"); - addMethod(id, baseClass, overrideOnUpdateEntityHookTypes, "onUpdateEntity"); - addMethod(id, baseClass, afterOnUpdateEntityHookTypes, "afterOnUpdateEntity"); - - addMethod(id, baseClass, beforeReadEntityFromNBTHookTypes, "beforeReadEntityFromNBT", net.minecraft.nbt.NBTTagCompound.class); - addMethod(id, baseClass, overrideReadEntityFromNBTHookTypes, "readEntityFromNBT", net.minecraft.nbt.NBTTagCompound.class); - addMethod(id, baseClass, afterReadEntityFromNBTHookTypes, "afterReadEntityFromNBT", net.minecraft.nbt.NBTTagCompound.class); - - addMethod(id, baseClass, beforeSetDeadHookTypes, "beforeSetDead"); - addMethod(id, baseClass, overrideSetDeadHookTypes, "setDead"); - addMethod(id, baseClass, afterSetDeadHookTypes, "afterSetDead"); - - addMethod(id, baseClass, beforeSetEntityActionStateHookTypes, "beforeSetEntityActionState", float.class, float.class, boolean.class, boolean.class); - addMethod(id, baseClass, overrideSetEntityActionStateHookTypes, "setEntityActionState", float.class, float.class, boolean.class, boolean.class); - addMethod(id, baseClass, afterSetEntityActionStateHookTypes, "afterSetEntityActionState", float.class, float.class, boolean.class, boolean.class); - - addMethod(id, baseClass, beforeSetPositionHookTypes, "beforeSetPosition", double.class, double.class, double.class); - addMethod(id, baseClass, overrideSetPositionHookTypes, "setPosition", double.class, double.class, double.class); - addMethod(id, baseClass, afterSetPositionHookTypes, "afterSetPosition", double.class, double.class, double.class); - - addMethod(id, baseClass, beforeSetSneakingHookTypes, "beforeSetSneaking", boolean.class); - addMethod(id, baseClass, overrideSetSneakingHookTypes, "setSneaking", boolean.class); - addMethod(id, baseClass, afterSetSneakingHookTypes, "afterSetSneaking", boolean.class); - - addMethod(id, baseClass, beforeSetSprintingHookTypes, "beforeSetSprinting", boolean.class); - addMethod(id, baseClass, overrideSetSprintingHookTypes, "setSprinting", boolean.class); - addMethod(id, baseClass, afterSetSprintingHookTypes, "afterSetSprinting", boolean.class); - - addMethod(id, baseClass, beforeSwingItemHookTypes, "beforeSwingItem", net.minecraft.util.EnumHand.class); - addMethod(id, baseClass, overrideSwingItemHookTypes, "swingItem", net.minecraft.util.EnumHand.class); - addMethod(id, baseClass, afterSwingItemHookTypes, "afterSwingItem", net.minecraft.util.EnumHand.class); - - addMethod(id, baseClass, beforeUpdateEntityActionStateHookTypes, "beforeUpdateEntityActionState"); - addMethod(id, baseClass, overrideUpdateEntityActionStateHookTypes, "updateEntityActionState"); - addMethod(id, baseClass, afterUpdateEntityActionStateHookTypes, "afterUpdateEntityActionState"); - - addMethod(id, baseClass, beforeUpdatePotionEffectsHookTypes, "beforeUpdatePotionEffects"); - addMethod(id, baseClass, overrideUpdatePotionEffectsHookTypes, "updatePotionEffects"); - addMethod(id, baseClass, afterUpdatePotionEffectsHookTypes, "afterUpdatePotionEffects"); - - addMethod(id, baseClass, beforeUpdateRiddenHookTypes, "beforeUpdateRidden"); - addMethod(id, baseClass, overrideUpdateRiddenHookTypes, "updateRidden"); - addMethod(id, baseClass, afterUpdateRiddenHookTypes, "afterUpdateRidden"); - - addMethod(id, baseClass, beforeWakeUpPlayerHookTypes, "beforeWakeUpPlayer", boolean.class, boolean.class, boolean.class); - addMethod(id, baseClass, overrideWakeUpPlayerHookTypes, "wakeUpPlayer", boolean.class, boolean.class, boolean.class); - addMethod(id, baseClass, afterWakeUpPlayerHookTypes, "afterWakeUpPlayer", boolean.class, boolean.class, boolean.class); - - addMethod(id, baseClass, beforeWriteEntityToNBTHookTypes, "beforeWriteEntityToNBT", net.minecraft.nbt.NBTTagCompound.class); - addMethod(id, baseClass, overrideWriteEntityToNBTHookTypes, "writeEntityToNBT", net.minecraft.nbt.NBTTagCompound.class); - addMethod(id, baseClass, afterWriteEntityToNBTHookTypes, "afterWriteEntityToNBT", net.minecraft.nbt.NBTTagCompound.class); - - - addDynamicMethods(id, baseClass); - - addDynamicKeys(id, baseClass, beforeDynamicHookMethods, beforeDynamicHookTypes); - addDynamicKeys(id, baseClass, overrideDynamicHookMethods, overrideDynamicHookTypes); - addDynamicKeys(id, baseClass, afterDynamicHookMethods, afterDynamicHookTypes); - - initialize(); - - for(IServerPlayerAPI instance : getAllInstancesList()) - instance.getServerPlayerAPI().attachServerPlayerBase(id); - - System.out.println("Server Player: registered " + id); - logger.fine("Server Player: registered class '" + baseClass.getName() + "' with id '" + id + "'"); - - initialized = false; - } - - public static boolean unregister(String id) - { - if(id == null) - return false; - - Constructor constructor = allBaseConstructors.remove(id); - if(constructor == null) - return false; - - for(IServerPlayerAPI instance : getAllInstancesList()) - instance.getServerPlayerAPI().detachServerPlayerBase(id); - - beforeLocalConstructingHookTypes.remove(id); - afterLocalConstructingHookTypes.remove(id); - - allBaseBeforeAddExhaustionSuperiors.remove(id); - allBaseBeforeAddExhaustionInferiors.remove(id); - allBaseOverrideAddExhaustionSuperiors.remove(id); - allBaseOverrideAddExhaustionInferiors.remove(id); - allBaseAfterAddExhaustionSuperiors.remove(id); - allBaseAfterAddExhaustionInferiors.remove(id); - - beforeAddExhaustionHookTypes.remove(id); - overrideAddExhaustionHookTypes.remove(id); - afterAddExhaustionHookTypes.remove(id); - - allBaseBeforeAddExperienceSuperiors.remove(id); - allBaseBeforeAddExperienceInferiors.remove(id); - allBaseOverrideAddExperienceSuperiors.remove(id); - allBaseOverrideAddExperienceInferiors.remove(id); - allBaseAfterAddExperienceSuperiors.remove(id); - allBaseAfterAddExperienceInferiors.remove(id); - - beforeAddExperienceHookTypes.remove(id); - overrideAddExperienceHookTypes.remove(id); - afterAddExperienceHookTypes.remove(id); - - allBaseBeforeAddExperienceLevelSuperiors.remove(id); - allBaseBeforeAddExperienceLevelInferiors.remove(id); - allBaseOverrideAddExperienceLevelSuperiors.remove(id); - allBaseOverrideAddExperienceLevelInferiors.remove(id); - allBaseAfterAddExperienceLevelSuperiors.remove(id); - allBaseAfterAddExperienceLevelInferiors.remove(id); - - beforeAddExperienceLevelHookTypes.remove(id); - overrideAddExperienceLevelHookTypes.remove(id); - afterAddExperienceLevelHookTypes.remove(id); - - allBaseBeforeAddMovementStatSuperiors.remove(id); - allBaseBeforeAddMovementStatInferiors.remove(id); - allBaseOverrideAddMovementStatSuperiors.remove(id); - allBaseOverrideAddMovementStatInferiors.remove(id); - allBaseAfterAddMovementStatSuperiors.remove(id); - allBaseAfterAddMovementStatInferiors.remove(id); - - beforeAddMovementStatHookTypes.remove(id); - overrideAddMovementStatHookTypes.remove(id); - afterAddMovementStatHookTypes.remove(id); - - allBaseBeforeAttackEntityFromSuperiors.remove(id); - allBaseBeforeAttackEntityFromInferiors.remove(id); - allBaseOverrideAttackEntityFromSuperiors.remove(id); - allBaseOverrideAttackEntityFromInferiors.remove(id); - allBaseAfterAttackEntityFromSuperiors.remove(id); - allBaseAfterAttackEntityFromInferiors.remove(id); - - beforeAttackEntityFromHookTypes.remove(id); - overrideAttackEntityFromHookTypes.remove(id); - afterAttackEntityFromHookTypes.remove(id); - - allBaseBeforeAttackTargetEntityWithCurrentItemSuperiors.remove(id); - allBaseBeforeAttackTargetEntityWithCurrentItemInferiors.remove(id); - allBaseOverrideAttackTargetEntityWithCurrentItemSuperiors.remove(id); - allBaseOverrideAttackTargetEntityWithCurrentItemInferiors.remove(id); - allBaseAfterAttackTargetEntityWithCurrentItemSuperiors.remove(id); - allBaseAfterAttackTargetEntityWithCurrentItemInferiors.remove(id); - - beforeAttackTargetEntityWithCurrentItemHookTypes.remove(id); - overrideAttackTargetEntityWithCurrentItemHookTypes.remove(id); - afterAttackTargetEntityWithCurrentItemHookTypes.remove(id); - - allBaseBeforeCanBreatheUnderwaterSuperiors.remove(id); - allBaseBeforeCanBreatheUnderwaterInferiors.remove(id); - allBaseOverrideCanBreatheUnderwaterSuperiors.remove(id); - allBaseOverrideCanBreatheUnderwaterInferiors.remove(id); - allBaseAfterCanBreatheUnderwaterSuperiors.remove(id); - allBaseAfterCanBreatheUnderwaterInferiors.remove(id); - - beforeCanBreatheUnderwaterHookTypes.remove(id); - overrideCanBreatheUnderwaterHookTypes.remove(id); - afterCanBreatheUnderwaterHookTypes.remove(id); - - allBaseBeforeCanHarvestBlockSuperiors.remove(id); - allBaseBeforeCanHarvestBlockInferiors.remove(id); - allBaseOverrideCanHarvestBlockSuperiors.remove(id); - allBaseOverrideCanHarvestBlockInferiors.remove(id); - allBaseAfterCanHarvestBlockSuperiors.remove(id); - allBaseAfterCanHarvestBlockInferiors.remove(id); - - beforeCanHarvestBlockHookTypes.remove(id); - overrideCanHarvestBlockHookTypes.remove(id); - afterCanHarvestBlockHookTypes.remove(id); - - allBaseBeforeCanPlayerEditSuperiors.remove(id); - allBaseBeforeCanPlayerEditInferiors.remove(id); - allBaseOverrideCanPlayerEditSuperiors.remove(id); - allBaseOverrideCanPlayerEditInferiors.remove(id); - allBaseAfterCanPlayerEditSuperiors.remove(id); - allBaseAfterCanPlayerEditInferiors.remove(id); - - beforeCanPlayerEditHookTypes.remove(id); - overrideCanPlayerEditHookTypes.remove(id); - afterCanPlayerEditHookTypes.remove(id); - - allBaseBeforeCanTriggerWalkingSuperiors.remove(id); - allBaseBeforeCanTriggerWalkingInferiors.remove(id); - allBaseOverrideCanTriggerWalkingSuperiors.remove(id); - allBaseOverrideCanTriggerWalkingInferiors.remove(id); - allBaseAfterCanTriggerWalkingSuperiors.remove(id); - allBaseAfterCanTriggerWalkingInferiors.remove(id); - - beforeCanTriggerWalkingHookTypes.remove(id); - overrideCanTriggerWalkingHookTypes.remove(id); - afterCanTriggerWalkingHookTypes.remove(id); - - allBaseBeforeClonePlayerSuperiors.remove(id); - allBaseBeforeClonePlayerInferiors.remove(id); - allBaseOverrideClonePlayerSuperiors.remove(id); - allBaseOverrideClonePlayerInferiors.remove(id); - allBaseAfterClonePlayerSuperiors.remove(id); - allBaseAfterClonePlayerInferiors.remove(id); - - beforeClonePlayerHookTypes.remove(id); - overrideClonePlayerHookTypes.remove(id); - afterClonePlayerHookTypes.remove(id); - - allBaseBeforeDamageEntitySuperiors.remove(id); - allBaseBeforeDamageEntityInferiors.remove(id); - allBaseOverrideDamageEntitySuperiors.remove(id); - allBaseOverrideDamageEntityInferiors.remove(id); - allBaseAfterDamageEntitySuperiors.remove(id); - allBaseAfterDamageEntityInferiors.remove(id); - - beforeDamageEntityHookTypes.remove(id); - overrideDamageEntityHookTypes.remove(id); - afterDamageEntityHookTypes.remove(id); - - allBaseBeforeDisplayGuiSuperiors.remove(id); - allBaseBeforeDisplayGuiInferiors.remove(id); - allBaseOverrideDisplayGuiSuperiors.remove(id); - allBaseOverrideDisplayGuiInferiors.remove(id); - allBaseAfterDisplayGuiSuperiors.remove(id); - allBaseAfterDisplayGuiInferiors.remove(id); - - beforeDisplayGuiHookTypes.remove(id); - overrideDisplayGuiHookTypes.remove(id); - afterDisplayGuiHookTypes.remove(id); - - allBaseBeforeDisplayGUIChestSuperiors.remove(id); - allBaseBeforeDisplayGUIChestInferiors.remove(id); - allBaseOverrideDisplayGUIChestSuperiors.remove(id); - allBaseOverrideDisplayGUIChestInferiors.remove(id); - allBaseAfterDisplayGUIChestSuperiors.remove(id); - allBaseAfterDisplayGUIChestInferiors.remove(id); - - beforeDisplayGUIChestHookTypes.remove(id); - overrideDisplayGUIChestHookTypes.remove(id); - afterDisplayGUIChestHookTypes.remove(id); - - allBaseBeforeDropOneItemSuperiors.remove(id); - allBaseBeforeDropOneItemInferiors.remove(id); - allBaseOverrideDropOneItemSuperiors.remove(id); - allBaseOverrideDropOneItemInferiors.remove(id); - allBaseAfterDropOneItemSuperiors.remove(id); - allBaseAfterDropOneItemInferiors.remove(id); - - beforeDropOneItemHookTypes.remove(id); - overrideDropOneItemHookTypes.remove(id); - afterDropOneItemHookTypes.remove(id); - - allBaseBeforeDropPlayerItemWithRandomChoiceSuperiors.remove(id); - allBaseBeforeDropPlayerItemWithRandomChoiceInferiors.remove(id); - allBaseOverrideDropPlayerItemWithRandomChoiceSuperiors.remove(id); - allBaseOverrideDropPlayerItemWithRandomChoiceInferiors.remove(id); - allBaseAfterDropPlayerItemWithRandomChoiceSuperiors.remove(id); - allBaseAfterDropPlayerItemWithRandomChoiceInferiors.remove(id); - - beforeDropPlayerItemWithRandomChoiceHookTypes.remove(id); - overrideDropPlayerItemWithRandomChoiceHookTypes.remove(id); - afterDropPlayerItemWithRandomChoiceHookTypes.remove(id); - - allBaseBeforeFallSuperiors.remove(id); - allBaseBeforeFallInferiors.remove(id); - allBaseOverrideFallSuperiors.remove(id); - allBaseOverrideFallInferiors.remove(id); - allBaseAfterFallSuperiors.remove(id); - allBaseAfterFallInferiors.remove(id); - - beforeFallHookTypes.remove(id); - overrideFallHookTypes.remove(id); - afterFallHookTypes.remove(id); - - allBaseBeforeGetAIMoveSpeedSuperiors.remove(id); - allBaseBeforeGetAIMoveSpeedInferiors.remove(id); - allBaseOverrideGetAIMoveSpeedSuperiors.remove(id); - allBaseOverrideGetAIMoveSpeedInferiors.remove(id); - allBaseAfterGetAIMoveSpeedSuperiors.remove(id); - allBaseAfterGetAIMoveSpeedInferiors.remove(id); - - beforeGetAIMoveSpeedHookTypes.remove(id); - overrideGetAIMoveSpeedHookTypes.remove(id); - afterGetAIMoveSpeedHookTypes.remove(id); - - allBaseBeforeGetBreakSpeedSuperiors.remove(id); - allBaseBeforeGetBreakSpeedInferiors.remove(id); - allBaseOverrideGetBreakSpeedSuperiors.remove(id); - allBaseOverrideGetBreakSpeedInferiors.remove(id); - allBaseAfterGetBreakSpeedSuperiors.remove(id); - allBaseAfterGetBreakSpeedInferiors.remove(id); - - beforeGetBreakSpeedHookTypes.remove(id); - overrideGetBreakSpeedHookTypes.remove(id); - afterGetBreakSpeedHookTypes.remove(id); - - allBaseBeforeGetDistanceSqSuperiors.remove(id); - allBaseBeforeGetDistanceSqInferiors.remove(id); - allBaseOverrideGetDistanceSqSuperiors.remove(id); - allBaseOverrideGetDistanceSqInferiors.remove(id); - allBaseAfterGetDistanceSqSuperiors.remove(id); - allBaseAfterGetDistanceSqInferiors.remove(id); - - beforeGetDistanceSqHookTypes.remove(id); - overrideGetDistanceSqHookTypes.remove(id); - afterGetDistanceSqHookTypes.remove(id); - - allBaseBeforeGetBrightnessSuperiors.remove(id); - allBaseBeforeGetBrightnessInferiors.remove(id); - allBaseOverrideGetBrightnessSuperiors.remove(id); - allBaseOverrideGetBrightnessInferiors.remove(id); - allBaseAfterGetBrightnessSuperiors.remove(id); - allBaseAfterGetBrightnessInferiors.remove(id); - - beforeGetBrightnessHookTypes.remove(id); - overrideGetBrightnessHookTypes.remove(id); - afterGetBrightnessHookTypes.remove(id); - - allBaseBeforeGetEyeHeightSuperiors.remove(id); - allBaseBeforeGetEyeHeightInferiors.remove(id); - allBaseOverrideGetEyeHeightSuperiors.remove(id); - allBaseOverrideGetEyeHeightInferiors.remove(id); - allBaseAfterGetEyeHeightSuperiors.remove(id); - allBaseAfterGetEyeHeightInferiors.remove(id); - - beforeGetEyeHeightHookTypes.remove(id); - overrideGetEyeHeightHookTypes.remove(id); - afterGetEyeHeightHookTypes.remove(id); - - allBaseBeforeHealSuperiors.remove(id); - allBaseBeforeHealInferiors.remove(id); - allBaseOverrideHealSuperiors.remove(id); - allBaseOverrideHealInferiors.remove(id); - allBaseAfterHealSuperiors.remove(id); - allBaseAfterHealInferiors.remove(id); - - beforeHealHookTypes.remove(id); - overrideHealHookTypes.remove(id); - afterHealHookTypes.remove(id); - - allBaseBeforeIsEntityInsideOpaqueBlockSuperiors.remove(id); - allBaseBeforeIsEntityInsideOpaqueBlockInferiors.remove(id); - allBaseOverrideIsEntityInsideOpaqueBlockSuperiors.remove(id); - allBaseOverrideIsEntityInsideOpaqueBlockInferiors.remove(id); - allBaseAfterIsEntityInsideOpaqueBlockSuperiors.remove(id); - allBaseAfterIsEntityInsideOpaqueBlockInferiors.remove(id); - - beforeIsEntityInsideOpaqueBlockHookTypes.remove(id); - overrideIsEntityInsideOpaqueBlockHookTypes.remove(id); - afterIsEntityInsideOpaqueBlockHookTypes.remove(id); - - allBaseBeforeIsInWaterSuperiors.remove(id); - allBaseBeforeIsInWaterInferiors.remove(id); - allBaseOverrideIsInWaterSuperiors.remove(id); - allBaseOverrideIsInWaterInferiors.remove(id); - allBaseAfterIsInWaterSuperiors.remove(id); - allBaseAfterIsInWaterInferiors.remove(id); - - beforeIsInWaterHookTypes.remove(id); - overrideIsInWaterHookTypes.remove(id); - afterIsInWaterHookTypes.remove(id); - - allBaseBeforeIsInsideOfMaterialSuperiors.remove(id); - allBaseBeforeIsInsideOfMaterialInferiors.remove(id); - allBaseOverrideIsInsideOfMaterialSuperiors.remove(id); - allBaseOverrideIsInsideOfMaterialInferiors.remove(id); - allBaseAfterIsInsideOfMaterialSuperiors.remove(id); - allBaseAfterIsInsideOfMaterialInferiors.remove(id); - - beforeIsInsideOfMaterialHookTypes.remove(id); - overrideIsInsideOfMaterialHookTypes.remove(id); - afterIsInsideOfMaterialHookTypes.remove(id); - - allBaseBeforeIsOnLadderSuperiors.remove(id); - allBaseBeforeIsOnLadderInferiors.remove(id); - allBaseOverrideIsOnLadderSuperiors.remove(id); - allBaseOverrideIsOnLadderInferiors.remove(id); - allBaseAfterIsOnLadderSuperiors.remove(id); - allBaseAfterIsOnLadderInferiors.remove(id); - - beforeIsOnLadderHookTypes.remove(id); - overrideIsOnLadderHookTypes.remove(id); - afterIsOnLadderHookTypes.remove(id); - - allBaseBeforeIsPlayerSleepingSuperiors.remove(id); - allBaseBeforeIsPlayerSleepingInferiors.remove(id); - allBaseOverrideIsPlayerSleepingSuperiors.remove(id); - allBaseOverrideIsPlayerSleepingInferiors.remove(id); - allBaseAfterIsPlayerSleepingSuperiors.remove(id); - allBaseAfterIsPlayerSleepingInferiors.remove(id); - - beforeIsPlayerSleepingHookTypes.remove(id); - overrideIsPlayerSleepingHookTypes.remove(id); - afterIsPlayerSleepingHookTypes.remove(id); - - allBaseBeforeIsSneakingSuperiors.remove(id); - allBaseBeforeIsSneakingInferiors.remove(id); - allBaseOverrideIsSneakingSuperiors.remove(id); - allBaseOverrideIsSneakingInferiors.remove(id); - allBaseAfterIsSneakingSuperiors.remove(id); - allBaseAfterIsSneakingInferiors.remove(id); - - beforeIsSneakingHookTypes.remove(id); - overrideIsSneakingHookTypes.remove(id); - afterIsSneakingHookTypes.remove(id); - - allBaseBeforeJumpSuperiors.remove(id); - allBaseBeforeJumpInferiors.remove(id); - allBaseOverrideJumpSuperiors.remove(id); - allBaseOverrideJumpInferiors.remove(id); - allBaseAfterJumpSuperiors.remove(id); - allBaseAfterJumpInferiors.remove(id); - - beforeJumpHookTypes.remove(id); - overrideJumpHookTypes.remove(id); - afterJumpHookTypes.remove(id); - - allBaseBeforeKnockBackSuperiors.remove(id); - allBaseBeforeKnockBackInferiors.remove(id); - allBaseOverrideKnockBackSuperiors.remove(id); - allBaseOverrideKnockBackInferiors.remove(id); - allBaseAfterKnockBackSuperiors.remove(id); - allBaseAfterKnockBackInferiors.remove(id); - - beforeKnockBackHookTypes.remove(id); - overrideKnockBackHookTypes.remove(id); - afterKnockBackHookTypes.remove(id); - - allBaseBeforeMountEntitySuperiors.remove(id); - allBaseBeforeMountEntityInferiors.remove(id); - allBaseOverrideMountEntitySuperiors.remove(id); - allBaseOverrideMountEntityInferiors.remove(id); - allBaseAfterMountEntitySuperiors.remove(id); - allBaseAfterMountEntityInferiors.remove(id); - - beforeMountEntityHookTypes.remove(id); - overrideMountEntityHookTypes.remove(id); - afterMountEntityHookTypes.remove(id); - - allBaseBeforeMoveEntitySuperiors.remove(id); - allBaseBeforeMoveEntityInferiors.remove(id); - allBaseOverrideMoveEntitySuperiors.remove(id); - allBaseOverrideMoveEntityInferiors.remove(id); - allBaseAfterMoveEntitySuperiors.remove(id); - allBaseAfterMoveEntityInferiors.remove(id); - - beforeMoveEntityHookTypes.remove(id); - overrideMoveEntityHookTypes.remove(id); - afterMoveEntityHookTypes.remove(id); - - allBaseBeforeMoveEntityWithHeadingSuperiors.remove(id); - allBaseBeforeMoveEntityWithHeadingInferiors.remove(id); - allBaseOverrideMoveEntityWithHeadingSuperiors.remove(id); - allBaseOverrideMoveEntityWithHeadingInferiors.remove(id); - allBaseAfterMoveEntityWithHeadingSuperiors.remove(id); - allBaseAfterMoveEntityWithHeadingInferiors.remove(id); - - beforeMoveEntityWithHeadingHookTypes.remove(id); - overrideMoveEntityWithHeadingHookTypes.remove(id); - afterMoveEntityWithHeadingHookTypes.remove(id); - - allBaseBeforeMoveFlyingSuperiors.remove(id); - allBaseBeforeMoveFlyingInferiors.remove(id); - allBaseOverrideMoveFlyingSuperiors.remove(id); - allBaseOverrideMoveFlyingInferiors.remove(id); - allBaseAfterMoveFlyingSuperiors.remove(id); - allBaseAfterMoveFlyingInferiors.remove(id); - - beforeMoveFlyingHookTypes.remove(id); - overrideMoveFlyingHookTypes.remove(id); - afterMoveFlyingHookTypes.remove(id); - - allBaseBeforeOnDeathSuperiors.remove(id); - allBaseBeforeOnDeathInferiors.remove(id); - allBaseOverrideOnDeathSuperiors.remove(id); - allBaseOverrideOnDeathInferiors.remove(id); - allBaseAfterOnDeathSuperiors.remove(id); - allBaseAfterOnDeathInferiors.remove(id); - - beforeOnDeathHookTypes.remove(id); - overrideOnDeathHookTypes.remove(id); - afterOnDeathHookTypes.remove(id); - - allBaseBeforeOnLivingUpdateSuperiors.remove(id); - allBaseBeforeOnLivingUpdateInferiors.remove(id); - allBaseOverrideOnLivingUpdateSuperiors.remove(id); - allBaseOverrideOnLivingUpdateInferiors.remove(id); - allBaseAfterOnLivingUpdateSuperiors.remove(id); - allBaseAfterOnLivingUpdateInferiors.remove(id); - - beforeOnLivingUpdateHookTypes.remove(id); - overrideOnLivingUpdateHookTypes.remove(id); - afterOnLivingUpdateHookTypes.remove(id); - - allBaseBeforeOnKillEntitySuperiors.remove(id); - allBaseBeforeOnKillEntityInferiors.remove(id); - allBaseOverrideOnKillEntitySuperiors.remove(id); - allBaseOverrideOnKillEntityInferiors.remove(id); - allBaseAfterOnKillEntitySuperiors.remove(id); - allBaseAfterOnKillEntityInferiors.remove(id); - - beforeOnKillEntityHookTypes.remove(id); - overrideOnKillEntityHookTypes.remove(id); - afterOnKillEntityHookTypes.remove(id); - - allBaseBeforeOnStruckByLightningSuperiors.remove(id); - allBaseBeforeOnStruckByLightningInferiors.remove(id); - allBaseOverrideOnStruckByLightningSuperiors.remove(id); - allBaseOverrideOnStruckByLightningInferiors.remove(id); - allBaseAfterOnStruckByLightningSuperiors.remove(id); - allBaseAfterOnStruckByLightningInferiors.remove(id); - - beforeOnStruckByLightningHookTypes.remove(id); - overrideOnStruckByLightningHookTypes.remove(id); - afterOnStruckByLightningHookTypes.remove(id); - - allBaseBeforeOnUpdateSuperiors.remove(id); - allBaseBeforeOnUpdateInferiors.remove(id); - allBaseOverrideOnUpdateSuperiors.remove(id); - allBaseOverrideOnUpdateInferiors.remove(id); - allBaseAfterOnUpdateSuperiors.remove(id); - allBaseAfterOnUpdateInferiors.remove(id); - - beforeOnUpdateHookTypes.remove(id); - overrideOnUpdateHookTypes.remove(id); - afterOnUpdateHookTypes.remove(id); - - allBaseBeforeOnUpdateEntitySuperiors.remove(id); - allBaseBeforeOnUpdateEntityInferiors.remove(id); - allBaseOverrideOnUpdateEntitySuperiors.remove(id); - allBaseOverrideOnUpdateEntityInferiors.remove(id); - allBaseAfterOnUpdateEntitySuperiors.remove(id); - allBaseAfterOnUpdateEntityInferiors.remove(id); - - beforeOnUpdateEntityHookTypes.remove(id); - overrideOnUpdateEntityHookTypes.remove(id); - afterOnUpdateEntityHookTypes.remove(id); - - allBaseBeforeReadEntityFromNBTSuperiors.remove(id); - allBaseBeforeReadEntityFromNBTInferiors.remove(id); - allBaseOverrideReadEntityFromNBTSuperiors.remove(id); - allBaseOverrideReadEntityFromNBTInferiors.remove(id); - allBaseAfterReadEntityFromNBTSuperiors.remove(id); - allBaseAfterReadEntityFromNBTInferiors.remove(id); - - beforeReadEntityFromNBTHookTypes.remove(id); - overrideReadEntityFromNBTHookTypes.remove(id); - afterReadEntityFromNBTHookTypes.remove(id); - - allBaseBeforeSetDeadSuperiors.remove(id); - allBaseBeforeSetDeadInferiors.remove(id); - allBaseOverrideSetDeadSuperiors.remove(id); - allBaseOverrideSetDeadInferiors.remove(id); - allBaseAfterSetDeadSuperiors.remove(id); - allBaseAfterSetDeadInferiors.remove(id); - - beforeSetDeadHookTypes.remove(id); - overrideSetDeadHookTypes.remove(id); - afterSetDeadHookTypes.remove(id); - - allBaseBeforeSetEntityActionStateSuperiors.remove(id); - allBaseBeforeSetEntityActionStateInferiors.remove(id); - allBaseOverrideSetEntityActionStateSuperiors.remove(id); - allBaseOverrideSetEntityActionStateInferiors.remove(id); - allBaseAfterSetEntityActionStateSuperiors.remove(id); - allBaseAfterSetEntityActionStateInferiors.remove(id); - - beforeSetEntityActionStateHookTypes.remove(id); - overrideSetEntityActionStateHookTypes.remove(id); - afterSetEntityActionStateHookTypes.remove(id); - - allBaseBeforeSetPositionSuperiors.remove(id); - allBaseBeforeSetPositionInferiors.remove(id); - allBaseOverrideSetPositionSuperiors.remove(id); - allBaseOverrideSetPositionInferiors.remove(id); - allBaseAfterSetPositionSuperiors.remove(id); - allBaseAfterSetPositionInferiors.remove(id); - - beforeSetPositionHookTypes.remove(id); - overrideSetPositionHookTypes.remove(id); - afterSetPositionHookTypes.remove(id); - - allBaseBeforeSetSneakingSuperiors.remove(id); - allBaseBeforeSetSneakingInferiors.remove(id); - allBaseOverrideSetSneakingSuperiors.remove(id); - allBaseOverrideSetSneakingInferiors.remove(id); - allBaseAfterSetSneakingSuperiors.remove(id); - allBaseAfterSetSneakingInferiors.remove(id); - - beforeSetSneakingHookTypes.remove(id); - overrideSetSneakingHookTypes.remove(id); - afterSetSneakingHookTypes.remove(id); - - allBaseBeforeSetSprintingSuperiors.remove(id); - allBaseBeforeSetSprintingInferiors.remove(id); - allBaseOverrideSetSprintingSuperiors.remove(id); - allBaseOverrideSetSprintingInferiors.remove(id); - allBaseAfterSetSprintingSuperiors.remove(id); - allBaseAfterSetSprintingInferiors.remove(id); - - beforeSetSprintingHookTypes.remove(id); - overrideSetSprintingHookTypes.remove(id); - afterSetSprintingHookTypes.remove(id); - - allBaseBeforeSwingItemSuperiors.remove(id); - allBaseBeforeSwingItemInferiors.remove(id); - allBaseOverrideSwingItemSuperiors.remove(id); - allBaseOverrideSwingItemInferiors.remove(id); - allBaseAfterSwingItemSuperiors.remove(id); - allBaseAfterSwingItemInferiors.remove(id); - - beforeSwingItemHookTypes.remove(id); - overrideSwingItemHookTypes.remove(id); - afterSwingItemHookTypes.remove(id); - - allBaseBeforeUpdateEntityActionStateSuperiors.remove(id); - allBaseBeforeUpdateEntityActionStateInferiors.remove(id); - allBaseOverrideUpdateEntityActionStateSuperiors.remove(id); - allBaseOverrideUpdateEntityActionStateInferiors.remove(id); - allBaseAfterUpdateEntityActionStateSuperiors.remove(id); - allBaseAfterUpdateEntityActionStateInferiors.remove(id); - - beforeUpdateEntityActionStateHookTypes.remove(id); - overrideUpdateEntityActionStateHookTypes.remove(id); - afterUpdateEntityActionStateHookTypes.remove(id); - - allBaseBeforeUpdatePotionEffectsSuperiors.remove(id); - allBaseBeforeUpdatePotionEffectsInferiors.remove(id); - allBaseOverrideUpdatePotionEffectsSuperiors.remove(id); - allBaseOverrideUpdatePotionEffectsInferiors.remove(id); - allBaseAfterUpdatePotionEffectsSuperiors.remove(id); - allBaseAfterUpdatePotionEffectsInferiors.remove(id); - - beforeUpdatePotionEffectsHookTypes.remove(id); - overrideUpdatePotionEffectsHookTypes.remove(id); - afterUpdatePotionEffectsHookTypes.remove(id); - - allBaseBeforeUpdateRiddenSuperiors.remove(id); - allBaseBeforeUpdateRiddenInferiors.remove(id); - allBaseOverrideUpdateRiddenSuperiors.remove(id); - allBaseOverrideUpdateRiddenInferiors.remove(id); - allBaseAfterUpdateRiddenSuperiors.remove(id); - allBaseAfterUpdateRiddenInferiors.remove(id); - - beforeUpdateRiddenHookTypes.remove(id); - overrideUpdateRiddenHookTypes.remove(id); - afterUpdateRiddenHookTypes.remove(id); - - allBaseBeforeWakeUpPlayerSuperiors.remove(id); - allBaseBeforeWakeUpPlayerInferiors.remove(id); - allBaseOverrideWakeUpPlayerSuperiors.remove(id); - allBaseOverrideWakeUpPlayerInferiors.remove(id); - allBaseAfterWakeUpPlayerSuperiors.remove(id); - allBaseAfterWakeUpPlayerInferiors.remove(id); - - beforeWakeUpPlayerHookTypes.remove(id); - overrideWakeUpPlayerHookTypes.remove(id); - afterWakeUpPlayerHookTypes.remove(id); - - allBaseBeforeWriteEntityToNBTSuperiors.remove(id); - allBaseBeforeWriteEntityToNBTInferiors.remove(id); - allBaseOverrideWriteEntityToNBTSuperiors.remove(id); - allBaseOverrideWriteEntityToNBTInferiors.remove(id); - allBaseAfterWriteEntityToNBTSuperiors.remove(id); - allBaseAfterWriteEntityToNBTInferiors.remove(id); - - beforeWriteEntityToNBTHookTypes.remove(id); - overrideWriteEntityToNBTHookTypes.remove(id); - afterWriteEntityToNBTHookTypes.remove(id); - - for(IServerPlayerAPI instance : getAllInstancesList()) - instance.getServerPlayerAPI().updateServerPlayerBases(); - - Iterator iterator = keysToVirtualIds.keySet().iterator(); - while(iterator.hasNext()) - { - String key = iterator.next(); - if(keysToVirtualIds.get(key).equals(id)) - keysToVirtualIds.remove(key); - } - - boolean otherFound = false; - Class type = constructor.getDeclaringClass(); - - iterator = allBaseConstructors.keySet().iterator(); - while(iterator.hasNext()) - { - String otherId = iterator.next(); - Class otherType = allBaseConstructors.get(otherId).getDeclaringClass(); - if(!otherId.equals(id) && otherType.equals(type)) - { - otherFound = true; - break; - } - } - - if(!otherFound) - { - dynamicTypes.remove(type); - - virtualDynamicHookMethods.remove(type); - - beforeDynamicHookMethods.remove(type); - overrideDynamicHookMethods.remove(type); - afterDynamicHookMethods.remove(type); - } - - removeDynamicHookTypes(id, beforeDynamicHookTypes); - removeDynamicHookTypes(id, overrideDynamicHookTypes); - removeDynamicHookTypes(id, afterDynamicHookTypes); - - allBaseBeforeDynamicSuperiors.remove(id); - allBaseBeforeDynamicInferiors.remove(id); - allBaseOverrideDynamicSuperiors.remove(id); - allBaseOverrideDynamicInferiors.remove(id); - allBaseAfterDynamicSuperiors.remove(id); - allBaseAfterDynamicInferiors.remove(id); - - log("ServerPlayerAPI: unregistered id '" + id + "'"); - - return true; - } - - public static void removeDynamicHookTypes(String id, Map> map) - { - Iterator keys = map.keySet().iterator(); - while(keys.hasNext()) - map.get(keys.next()).remove(id); - } - - public static Set getRegisteredIds() - { - return unmodifiableAllIds; - } - - private static void addSorting(String id, Map map, String[] values) - { - if(values != null && values.length > 0) - map.put(id, values); - } - - private static void addDynamicSorting(String id, Map> map, Map values) - { - if(values != null && values.size() > 0) - map.put(id, values); - } - - private static boolean addMethod(String id, Class baseClass, List list, String methodName, Class... _parameterTypes) - { - try - { - Method method = baseClass.getMethod(methodName, _parameterTypes); - boolean isOverridden = method.getDeclaringClass() != ServerPlayerBase.class; - if(isOverridden) - list.add(id); - return isOverridden; - } - catch(Exception e) - { - throw new RuntimeException("Can not reflect method '" + methodName + "' of class '" + baseClass.getName() + "'", e); - } - } - - private static void addDynamicMethods(String id, Class baseClass) - { - if(!dynamicTypes.add(baseClass)) - return; - - Map virtuals = null; - Map befores = null; - Map overrides = null; - Map afters = null; - - Method[] methods = baseClass.getDeclaredMethods(); - for(int i=0; i= 8 && name.substring(0, 8).equalsIgnoreCase("override")) - { - name = name.substring(8); - override = true; - } - else if(name.length() >= 6 && name.substring(0, 6).equalsIgnoreCase("before")) - { - before = true; - name = name.substring(6); - } - else if(name.length() >= 5 && name.substring(0, 5).equalsIgnoreCase("after")) - { - after = true; - name = name.substring(5); - } - } - - if(name.length() >= 1 && (before || virtual || override || after)) - name = name.substring(0,1).toLowerCase() + name.substring(1); - - while(name.charAt(0) == '_') - name = name.substring(1); - - if(name.length() == 0) - throw new RuntimeException("Can not process dynamic hook method with no key"); - - keys.add(name); - - if(virtual) - { - if(keysToVirtualIds.containsKey(name)) - throw new RuntimeException("Can not process more than one dynamic virtual method"); - - keysToVirtualIds.put(name, id); - virtuals = addDynamicMethod(name, method, virtuals); - } - else if(before) - befores = addDynamicMethod(name, method, befores); - else if(after) - afters = addDynamicMethod(name, method, afters); - else - overrides = addDynamicMethod(name, method, overrides); - } - - if(virtuals != null) - virtualDynamicHookMethods.put(baseClass, virtuals); - if(befores != null) - beforeDynamicHookMethods.put(baseClass, befores); - if(overrides != null) - overrideDynamicHookMethods.put(baseClass, overrides); - if(afters != null) - afterDynamicHookMethods.put(baseClass, afters); - } - - private static void addDynamicKeys(String id, Class baseClass, Map, Map> dynamicHookMethods, Map> dynamicHookTypes) - { - Map methods = dynamicHookMethods.get(baseClass); - if(methods == null || methods.size() == 0) - return; - - Iterator keys = methods.keySet().iterator(); - while(keys.hasNext()) - { - String key = keys.next(); - if(!dynamicHookTypes.containsKey(key)) - dynamicHookTypes.put(key, new ArrayList(1)); - dynamicHookTypes.get(key).add(id); - } - } - - private static Map addDynamicMethod(String key, Method method, Map methods) - { - if(methods == null) - methods = new HashMap(); - if(methods.containsKey(key)) - throw new RuntimeException("method with key '" + key + "' allready exists"); - methods.put(key, method); - return methods; - } - - public static ServerPlayerAPI create(IServerPlayerAPI serverPlayer) - { - if(allBaseConstructors.size() > 0 && !initialized) - initialize(); - return new ServerPlayerAPI(serverPlayer); - } - - private static void initialize() - { - sortBases(beforeLocalConstructingHookTypes, allBaseBeforeLocalConstructingSuperiors, allBaseBeforeLocalConstructingInferiors, "beforeLocalConstructing"); - sortBases(afterLocalConstructingHookTypes, allBaseAfterLocalConstructingSuperiors, allBaseAfterLocalConstructingInferiors, "afterLocalConstructing"); - - Iterator keyIterator = keys.iterator(); - while(keyIterator.hasNext()) - { - String key = keyIterator.next(); - sortDynamicBases(beforeDynamicHookTypes, allBaseBeforeDynamicSuperiors, allBaseBeforeDynamicInferiors, key); - sortDynamicBases(overrideDynamicHookTypes, allBaseOverrideDynamicSuperiors, allBaseOverrideDynamicInferiors, key); - sortDynamicBases(afterDynamicHookTypes, allBaseAfterDynamicSuperiors, allBaseAfterDynamicInferiors, key); - } - - sortBases(beforeAddExhaustionHookTypes, allBaseBeforeAddExhaustionSuperiors, allBaseBeforeAddExhaustionInferiors, "beforeAddExhaustion"); - sortBases(overrideAddExhaustionHookTypes, allBaseOverrideAddExhaustionSuperiors, allBaseOverrideAddExhaustionInferiors, "overrideAddExhaustion"); - sortBases(afterAddExhaustionHookTypes, allBaseAfterAddExhaustionSuperiors, allBaseAfterAddExhaustionInferiors, "afterAddExhaustion"); - - sortBases(beforeAddExperienceHookTypes, allBaseBeforeAddExperienceSuperiors, allBaseBeforeAddExperienceInferiors, "beforeAddExperience"); - sortBases(overrideAddExperienceHookTypes, allBaseOverrideAddExperienceSuperiors, allBaseOverrideAddExperienceInferiors, "overrideAddExperience"); - sortBases(afterAddExperienceHookTypes, allBaseAfterAddExperienceSuperiors, allBaseAfterAddExperienceInferiors, "afterAddExperience"); - - sortBases(beforeAddExperienceLevelHookTypes, allBaseBeforeAddExperienceLevelSuperiors, allBaseBeforeAddExperienceLevelInferiors, "beforeAddExperienceLevel"); - sortBases(overrideAddExperienceLevelHookTypes, allBaseOverrideAddExperienceLevelSuperiors, allBaseOverrideAddExperienceLevelInferiors, "overrideAddExperienceLevel"); - sortBases(afterAddExperienceLevelHookTypes, allBaseAfterAddExperienceLevelSuperiors, allBaseAfterAddExperienceLevelInferiors, "afterAddExperienceLevel"); - - sortBases(beforeAddMovementStatHookTypes, allBaseBeforeAddMovementStatSuperiors, allBaseBeforeAddMovementStatInferiors, "beforeAddMovementStat"); - sortBases(overrideAddMovementStatHookTypes, allBaseOverrideAddMovementStatSuperiors, allBaseOverrideAddMovementStatInferiors, "overrideAddMovementStat"); - sortBases(afterAddMovementStatHookTypes, allBaseAfterAddMovementStatSuperiors, allBaseAfterAddMovementStatInferiors, "afterAddMovementStat"); - - sortBases(beforeAttackEntityFromHookTypes, allBaseBeforeAttackEntityFromSuperiors, allBaseBeforeAttackEntityFromInferiors, "beforeAttackEntityFrom"); - sortBases(overrideAttackEntityFromHookTypes, allBaseOverrideAttackEntityFromSuperiors, allBaseOverrideAttackEntityFromInferiors, "overrideAttackEntityFrom"); - sortBases(afterAttackEntityFromHookTypes, allBaseAfterAttackEntityFromSuperiors, allBaseAfterAttackEntityFromInferiors, "afterAttackEntityFrom"); - - sortBases(beforeAttackTargetEntityWithCurrentItemHookTypes, allBaseBeforeAttackTargetEntityWithCurrentItemSuperiors, allBaseBeforeAttackTargetEntityWithCurrentItemInferiors, "beforeAttackTargetEntityWithCurrentItem"); - sortBases(overrideAttackTargetEntityWithCurrentItemHookTypes, allBaseOverrideAttackTargetEntityWithCurrentItemSuperiors, allBaseOverrideAttackTargetEntityWithCurrentItemInferiors, "overrideAttackTargetEntityWithCurrentItem"); - sortBases(afterAttackTargetEntityWithCurrentItemHookTypes, allBaseAfterAttackTargetEntityWithCurrentItemSuperiors, allBaseAfterAttackTargetEntityWithCurrentItemInferiors, "afterAttackTargetEntityWithCurrentItem"); - - sortBases(beforeCanBreatheUnderwaterHookTypes, allBaseBeforeCanBreatheUnderwaterSuperiors, allBaseBeforeCanBreatheUnderwaterInferiors, "beforeCanBreatheUnderwater"); - sortBases(overrideCanBreatheUnderwaterHookTypes, allBaseOverrideCanBreatheUnderwaterSuperiors, allBaseOverrideCanBreatheUnderwaterInferiors, "overrideCanBreatheUnderwater"); - sortBases(afterCanBreatheUnderwaterHookTypes, allBaseAfterCanBreatheUnderwaterSuperiors, allBaseAfterCanBreatheUnderwaterInferiors, "afterCanBreatheUnderwater"); - - sortBases(beforeCanHarvestBlockHookTypes, allBaseBeforeCanHarvestBlockSuperiors, allBaseBeforeCanHarvestBlockInferiors, "beforeCanHarvestBlock"); - sortBases(overrideCanHarvestBlockHookTypes, allBaseOverrideCanHarvestBlockSuperiors, allBaseOverrideCanHarvestBlockInferiors, "overrideCanHarvestBlock"); - sortBases(afterCanHarvestBlockHookTypes, allBaseAfterCanHarvestBlockSuperiors, allBaseAfterCanHarvestBlockInferiors, "afterCanHarvestBlock"); - - sortBases(beforeCanPlayerEditHookTypes, allBaseBeforeCanPlayerEditSuperiors, allBaseBeforeCanPlayerEditInferiors, "beforeCanPlayerEdit"); - sortBases(overrideCanPlayerEditHookTypes, allBaseOverrideCanPlayerEditSuperiors, allBaseOverrideCanPlayerEditInferiors, "overrideCanPlayerEdit"); - sortBases(afterCanPlayerEditHookTypes, allBaseAfterCanPlayerEditSuperiors, allBaseAfterCanPlayerEditInferiors, "afterCanPlayerEdit"); - - sortBases(beforeCanTriggerWalkingHookTypes, allBaseBeforeCanTriggerWalkingSuperiors, allBaseBeforeCanTriggerWalkingInferiors, "beforeCanTriggerWalking"); - sortBases(overrideCanTriggerWalkingHookTypes, allBaseOverrideCanTriggerWalkingSuperiors, allBaseOverrideCanTriggerWalkingInferiors, "overrideCanTriggerWalking"); - sortBases(afterCanTriggerWalkingHookTypes, allBaseAfterCanTriggerWalkingSuperiors, allBaseAfterCanTriggerWalkingInferiors, "afterCanTriggerWalking"); - - sortBases(beforeClonePlayerHookTypes, allBaseBeforeClonePlayerSuperiors, allBaseBeforeClonePlayerInferiors, "beforeClonePlayer"); - sortBases(overrideClonePlayerHookTypes, allBaseOverrideClonePlayerSuperiors, allBaseOverrideClonePlayerInferiors, "overrideClonePlayer"); - sortBases(afterClonePlayerHookTypes, allBaseAfterClonePlayerSuperiors, allBaseAfterClonePlayerInferiors, "afterClonePlayer"); - - sortBases(beforeDamageEntityHookTypes, allBaseBeforeDamageEntitySuperiors, allBaseBeforeDamageEntityInferiors, "beforeDamageEntity"); - sortBases(overrideDamageEntityHookTypes, allBaseOverrideDamageEntitySuperiors, allBaseOverrideDamageEntityInferiors, "overrideDamageEntity"); - sortBases(afterDamageEntityHookTypes, allBaseAfterDamageEntitySuperiors, allBaseAfterDamageEntityInferiors, "afterDamageEntity"); - - sortBases(beforeDisplayGuiHookTypes, allBaseBeforeDisplayGuiSuperiors, allBaseBeforeDisplayGuiInferiors, "beforeDisplayGui"); - sortBases(overrideDisplayGuiHookTypes, allBaseOverrideDisplayGuiSuperiors, allBaseOverrideDisplayGuiInferiors, "overrideDisplayGui"); - sortBases(afterDisplayGuiHookTypes, allBaseAfterDisplayGuiSuperiors, allBaseAfterDisplayGuiInferiors, "afterDisplayGui"); - - sortBases(beforeDisplayGUIChestHookTypes, allBaseBeforeDisplayGUIChestSuperiors, allBaseBeforeDisplayGUIChestInferiors, "beforeDisplayGUIChest"); - sortBases(overrideDisplayGUIChestHookTypes, allBaseOverrideDisplayGUIChestSuperiors, allBaseOverrideDisplayGUIChestInferiors, "overrideDisplayGUIChest"); - sortBases(afterDisplayGUIChestHookTypes, allBaseAfterDisplayGUIChestSuperiors, allBaseAfterDisplayGUIChestInferiors, "afterDisplayGUIChest"); - - sortBases(beforeDropOneItemHookTypes, allBaseBeforeDropOneItemSuperiors, allBaseBeforeDropOneItemInferiors, "beforeDropOneItem"); - sortBases(overrideDropOneItemHookTypes, allBaseOverrideDropOneItemSuperiors, allBaseOverrideDropOneItemInferiors, "overrideDropOneItem"); - sortBases(afterDropOneItemHookTypes, allBaseAfterDropOneItemSuperiors, allBaseAfterDropOneItemInferiors, "afterDropOneItem"); - - sortBases(beforeDropPlayerItemWithRandomChoiceHookTypes, allBaseBeforeDropPlayerItemWithRandomChoiceSuperiors, allBaseBeforeDropPlayerItemWithRandomChoiceInferiors, "beforeDropPlayerItemWithRandomChoice"); - sortBases(overrideDropPlayerItemWithRandomChoiceHookTypes, allBaseOverrideDropPlayerItemWithRandomChoiceSuperiors, allBaseOverrideDropPlayerItemWithRandomChoiceInferiors, "overrideDropPlayerItemWithRandomChoice"); - sortBases(afterDropPlayerItemWithRandomChoiceHookTypes, allBaseAfterDropPlayerItemWithRandomChoiceSuperiors, allBaseAfterDropPlayerItemWithRandomChoiceInferiors, "afterDropPlayerItemWithRandomChoice"); - - sortBases(beforeFallHookTypes, allBaseBeforeFallSuperiors, allBaseBeforeFallInferiors, "beforeFall"); - sortBases(overrideFallHookTypes, allBaseOverrideFallSuperiors, allBaseOverrideFallInferiors, "overrideFall"); - sortBases(afterFallHookTypes, allBaseAfterFallSuperiors, allBaseAfterFallInferiors, "afterFall"); - - sortBases(beforeGetAIMoveSpeedHookTypes, allBaseBeforeGetAIMoveSpeedSuperiors, allBaseBeforeGetAIMoveSpeedInferiors, "beforeGetAIMoveSpeed"); - sortBases(overrideGetAIMoveSpeedHookTypes, allBaseOverrideGetAIMoveSpeedSuperiors, allBaseOverrideGetAIMoveSpeedInferiors, "overrideGetAIMoveSpeed"); - sortBases(afterGetAIMoveSpeedHookTypes, allBaseAfterGetAIMoveSpeedSuperiors, allBaseAfterGetAIMoveSpeedInferiors, "afterGetAIMoveSpeed"); - - sortBases(beforeGetBreakSpeedHookTypes, allBaseBeforeGetBreakSpeedSuperiors, allBaseBeforeGetBreakSpeedInferiors, "beforeGetBreakSpeed"); - sortBases(overrideGetBreakSpeedHookTypes, allBaseOverrideGetBreakSpeedSuperiors, allBaseOverrideGetBreakSpeedInferiors, "overrideGetBreakSpeed"); - sortBases(afterGetBreakSpeedHookTypes, allBaseAfterGetBreakSpeedSuperiors, allBaseAfterGetBreakSpeedInferiors, "afterGetBreakSpeed"); - - sortBases(beforeGetDistanceSqHookTypes, allBaseBeforeGetDistanceSqSuperiors, allBaseBeforeGetDistanceSqInferiors, "beforeGetDistanceSq"); - sortBases(overrideGetDistanceSqHookTypes, allBaseOverrideGetDistanceSqSuperiors, allBaseOverrideGetDistanceSqInferiors, "overrideGetDistanceSq"); - sortBases(afterGetDistanceSqHookTypes, allBaseAfterGetDistanceSqSuperiors, allBaseAfterGetDistanceSqInferiors, "afterGetDistanceSq"); - - sortBases(beforeGetBrightnessHookTypes, allBaseBeforeGetBrightnessSuperiors, allBaseBeforeGetBrightnessInferiors, "beforeGetBrightness"); - sortBases(overrideGetBrightnessHookTypes, allBaseOverrideGetBrightnessSuperiors, allBaseOverrideGetBrightnessInferiors, "overrideGetBrightness"); - sortBases(afterGetBrightnessHookTypes, allBaseAfterGetBrightnessSuperiors, allBaseAfterGetBrightnessInferiors, "afterGetBrightness"); - - sortBases(beforeGetEyeHeightHookTypes, allBaseBeforeGetEyeHeightSuperiors, allBaseBeforeGetEyeHeightInferiors, "beforeGetEyeHeight"); - sortBases(overrideGetEyeHeightHookTypes, allBaseOverrideGetEyeHeightSuperiors, allBaseOverrideGetEyeHeightInferiors, "overrideGetEyeHeight"); - sortBases(afterGetEyeHeightHookTypes, allBaseAfterGetEyeHeightSuperiors, allBaseAfterGetEyeHeightInferiors, "afterGetEyeHeight"); - - sortBases(beforeHealHookTypes, allBaseBeforeHealSuperiors, allBaseBeforeHealInferiors, "beforeHeal"); - sortBases(overrideHealHookTypes, allBaseOverrideHealSuperiors, allBaseOverrideHealInferiors, "overrideHeal"); - sortBases(afterHealHookTypes, allBaseAfterHealSuperiors, allBaseAfterHealInferiors, "afterHeal"); - - sortBases(beforeIsEntityInsideOpaqueBlockHookTypes, allBaseBeforeIsEntityInsideOpaqueBlockSuperiors, allBaseBeforeIsEntityInsideOpaqueBlockInferiors, "beforeIsEntityInsideOpaqueBlock"); - sortBases(overrideIsEntityInsideOpaqueBlockHookTypes, allBaseOverrideIsEntityInsideOpaqueBlockSuperiors, allBaseOverrideIsEntityInsideOpaqueBlockInferiors, "overrideIsEntityInsideOpaqueBlock"); - sortBases(afterIsEntityInsideOpaqueBlockHookTypes, allBaseAfterIsEntityInsideOpaqueBlockSuperiors, allBaseAfterIsEntityInsideOpaqueBlockInferiors, "afterIsEntityInsideOpaqueBlock"); - - sortBases(beforeIsInWaterHookTypes, allBaseBeforeIsInWaterSuperiors, allBaseBeforeIsInWaterInferiors, "beforeIsInWater"); - sortBases(overrideIsInWaterHookTypes, allBaseOverrideIsInWaterSuperiors, allBaseOverrideIsInWaterInferiors, "overrideIsInWater"); - sortBases(afterIsInWaterHookTypes, allBaseAfterIsInWaterSuperiors, allBaseAfterIsInWaterInferiors, "afterIsInWater"); - - sortBases(beforeIsInsideOfMaterialHookTypes, allBaseBeforeIsInsideOfMaterialSuperiors, allBaseBeforeIsInsideOfMaterialInferiors, "beforeIsInsideOfMaterial"); - sortBases(overrideIsInsideOfMaterialHookTypes, allBaseOverrideIsInsideOfMaterialSuperiors, allBaseOverrideIsInsideOfMaterialInferiors, "overrideIsInsideOfMaterial"); - sortBases(afterIsInsideOfMaterialHookTypes, allBaseAfterIsInsideOfMaterialSuperiors, allBaseAfterIsInsideOfMaterialInferiors, "afterIsInsideOfMaterial"); - - sortBases(beforeIsOnLadderHookTypes, allBaseBeforeIsOnLadderSuperiors, allBaseBeforeIsOnLadderInferiors, "beforeIsOnLadder"); - sortBases(overrideIsOnLadderHookTypes, allBaseOverrideIsOnLadderSuperiors, allBaseOverrideIsOnLadderInferiors, "overrideIsOnLadder"); - sortBases(afterIsOnLadderHookTypes, allBaseAfterIsOnLadderSuperiors, allBaseAfterIsOnLadderInferiors, "afterIsOnLadder"); - - sortBases(beforeIsPlayerSleepingHookTypes, allBaseBeforeIsPlayerSleepingSuperiors, allBaseBeforeIsPlayerSleepingInferiors, "beforeIsPlayerSleeping"); - sortBases(overrideIsPlayerSleepingHookTypes, allBaseOverrideIsPlayerSleepingSuperiors, allBaseOverrideIsPlayerSleepingInferiors, "overrideIsPlayerSleeping"); - sortBases(afterIsPlayerSleepingHookTypes, allBaseAfterIsPlayerSleepingSuperiors, allBaseAfterIsPlayerSleepingInferiors, "afterIsPlayerSleeping"); - - sortBases(beforeIsSneakingHookTypes, allBaseBeforeIsSneakingSuperiors, allBaseBeforeIsSneakingInferiors, "beforeIsSneaking"); - sortBases(overrideIsSneakingHookTypes, allBaseOverrideIsSneakingSuperiors, allBaseOverrideIsSneakingInferiors, "overrideIsSneaking"); - sortBases(afterIsSneakingHookTypes, allBaseAfterIsSneakingSuperiors, allBaseAfterIsSneakingInferiors, "afterIsSneaking"); - - sortBases(beforeJumpHookTypes, allBaseBeforeJumpSuperiors, allBaseBeforeJumpInferiors, "beforeJump"); - sortBases(overrideJumpHookTypes, allBaseOverrideJumpSuperiors, allBaseOverrideJumpInferiors, "overrideJump"); - sortBases(afterJumpHookTypes, allBaseAfterJumpSuperiors, allBaseAfterJumpInferiors, "afterJump"); - - sortBases(beforeKnockBackHookTypes, allBaseBeforeKnockBackSuperiors, allBaseBeforeKnockBackInferiors, "beforeKnockBack"); - sortBases(overrideKnockBackHookTypes, allBaseOverrideKnockBackSuperiors, allBaseOverrideKnockBackInferiors, "overrideKnockBack"); - sortBases(afterKnockBackHookTypes, allBaseAfterKnockBackSuperiors, allBaseAfterKnockBackInferiors, "afterKnockBack"); - - sortBases(beforeMountEntityHookTypes, allBaseBeforeMountEntitySuperiors, allBaseBeforeMountEntityInferiors, "beforeMountEntity"); - sortBases(overrideMountEntityHookTypes, allBaseOverrideMountEntitySuperiors, allBaseOverrideMountEntityInferiors, "overrideMountEntity"); - sortBases(afterMountEntityHookTypes, allBaseAfterMountEntitySuperiors, allBaseAfterMountEntityInferiors, "afterMountEntity"); - - sortBases(beforeMoveEntityHookTypes, allBaseBeforeMoveEntitySuperiors, allBaseBeforeMoveEntityInferiors, "beforeMoveEntity"); - sortBases(overrideMoveEntityHookTypes, allBaseOverrideMoveEntitySuperiors, allBaseOverrideMoveEntityInferiors, "overrideMoveEntity"); - sortBases(afterMoveEntityHookTypes, allBaseAfterMoveEntitySuperiors, allBaseAfterMoveEntityInferiors, "afterMoveEntity"); - - sortBases(beforeMoveEntityWithHeadingHookTypes, allBaseBeforeMoveEntityWithHeadingSuperiors, allBaseBeforeMoveEntityWithHeadingInferiors, "beforeMoveEntityWithHeading"); - sortBases(overrideMoveEntityWithHeadingHookTypes, allBaseOverrideMoveEntityWithHeadingSuperiors, allBaseOverrideMoveEntityWithHeadingInferiors, "overrideMoveEntityWithHeading"); - sortBases(afterMoveEntityWithHeadingHookTypes, allBaseAfterMoveEntityWithHeadingSuperiors, allBaseAfterMoveEntityWithHeadingInferiors, "afterMoveEntityWithHeading"); - - sortBases(beforeMoveFlyingHookTypes, allBaseBeforeMoveFlyingSuperiors, allBaseBeforeMoveFlyingInferiors, "beforeMoveFlying"); - sortBases(overrideMoveFlyingHookTypes, allBaseOverrideMoveFlyingSuperiors, allBaseOverrideMoveFlyingInferiors, "overrideMoveFlying"); - sortBases(afterMoveFlyingHookTypes, allBaseAfterMoveFlyingSuperiors, allBaseAfterMoveFlyingInferiors, "afterMoveFlying"); - - sortBases(beforeOnDeathHookTypes, allBaseBeforeOnDeathSuperiors, allBaseBeforeOnDeathInferiors, "beforeOnDeath"); - sortBases(overrideOnDeathHookTypes, allBaseOverrideOnDeathSuperiors, allBaseOverrideOnDeathInferiors, "overrideOnDeath"); - sortBases(afterOnDeathHookTypes, allBaseAfterOnDeathSuperiors, allBaseAfterOnDeathInferiors, "afterOnDeath"); - - sortBases(beforeOnLivingUpdateHookTypes, allBaseBeforeOnLivingUpdateSuperiors, allBaseBeforeOnLivingUpdateInferiors, "beforeOnLivingUpdate"); - sortBases(overrideOnLivingUpdateHookTypes, allBaseOverrideOnLivingUpdateSuperiors, allBaseOverrideOnLivingUpdateInferiors, "overrideOnLivingUpdate"); - sortBases(afterOnLivingUpdateHookTypes, allBaseAfterOnLivingUpdateSuperiors, allBaseAfterOnLivingUpdateInferiors, "afterOnLivingUpdate"); - - sortBases(beforeOnKillEntityHookTypes, allBaseBeforeOnKillEntitySuperiors, allBaseBeforeOnKillEntityInferiors, "beforeOnKillEntity"); - sortBases(overrideOnKillEntityHookTypes, allBaseOverrideOnKillEntitySuperiors, allBaseOverrideOnKillEntityInferiors, "overrideOnKillEntity"); - sortBases(afterOnKillEntityHookTypes, allBaseAfterOnKillEntitySuperiors, allBaseAfterOnKillEntityInferiors, "afterOnKillEntity"); - - sortBases(beforeOnStruckByLightningHookTypes, allBaseBeforeOnStruckByLightningSuperiors, allBaseBeforeOnStruckByLightningInferiors, "beforeOnStruckByLightning"); - sortBases(overrideOnStruckByLightningHookTypes, allBaseOverrideOnStruckByLightningSuperiors, allBaseOverrideOnStruckByLightningInferiors, "overrideOnStruckByLightning"); - sortBases(afterOnStruckByLightningHookTypes, allBaseAfterOnStruckByLightningSuperiors, allBaseAfterOnStruckByLightningInferiors, "afterOnStruckByLightning"); - - sortBases(beforeOnUpdateHookTypes, allBaseBeforeOnUpdateSuperiors, allBaseBeforeOnUpdateInferiors, "beforeOnUpdate"); - sortBases(overrideOnUpdateHookTypes, allBaseOverrideOnUpdateSuperiors, allBaseOverrideOnUpdateInferiors, "overrideOnUpdate"); - sortBases(afterOnUpdateHookTypes, allBaseAfterOnUpdateSuperiors, allBaseAfterOnUpdateInferiors, "afterOnUpdate"); - - sortBases(beforeOnUpdateEntityHookTypes, allBaseBeforeOnUpdateEntitySuperiors, allBaseBeforeOnUpdateEntityInferiors, "beforeOnUpdateEntity"); - sortBases(overrideOnUpdateEntityHookTypes, allBaseOverrideOnUpdateEntitySuperiors, allBaseOverrideOnUpdateEntityInferiors, "overrideOnUpdateEntity"); - sortBases(afterOnUpdateEntityHookTypes, allBaseAfterOnUpdateEntitySuperiors, allBaseAfterOnUpdateEntityInferiors, "afterOnUpdateEntity"); - - sortBases(beforeReadEntityFromNBTHookTypes, allBaseBeforeReadEntityFromNBTSuperiors, allBaseBeforeReadEntityFromNBTInferiors, "beforeReadEntityFromNBT"); - sortBases(overrideReadEntityFromNBTHookTypes, allBaseOverrideReadEntityFromNBTSuperiors, allBaseOverrideReadEntityFromNBTInferiors, "overrideReadEntityFromNBT"); - sortBases(afterReadEntityFromNBTHookTypes, allBaseAfterReadEntityFromNBTSuperiors, allBaseAfterReadEntityFromNBTInferiors, "afterReadEntityFromNBT"); - - sortBases(beforeSetDeadHookTypes, allBaseBeforeSetDeadSuperiors, allBaseBeforeSetDeadInferiors, "beforeSetDead"); - sortBases(overrideSetDeadHookTypes, allBaseOverrideSetDeadSuperiors, allBaseOverrideSetDeadInferiors, "overrideSetDead"); - sortBases(afterSetDeadHookTypes, allBaseAfterSetDeadSuperiors, allBaseAfterSetDeadInferiors, "afterSetDead"); - - sortBases(beforeSetEntityActionStateHookTypes, allBaseBeforeSetEntityActionStateSuperiors, allBaseBeforeSetEntityActionStateInferiors, "beforeSetEntityActionState"); - sortBases(overrideSetEntityActionStateHookTypes, allBaseOverrideSetEntityActionStateSuperiors, allBaseOverrideSetEntityActionStateInferiors, "overrideSetEntityActionState"); - sortBases(afterSetEntityActionStateHookTypes, allBaseAfterSetEntityActionStateSuperiors, allBaseAfterSetEntityActionStateInferiors, "afterSetEntityActionState"); - - sortBases(beforeSetPositionHookTypes, allBaseBeforeSetPositionSuperiors, allBaseBeforeSetPositionInferiors, "beforeSetPosition"); - sortBases(overrideSetPositionHookTypes, allBaseOverrideSetPositionSuperiors, allBaseOverrideSetPositionInferiors, "overrideSetPosition"); - sortBases(afterSetPositionHookTypes, allBaseAfterSetPositionSuperiors, allBaseAfterSetPositionInferiors, "afterSetPosition"); - - sortBases(beforeSetSneakingHookTypes, allBaseBeforeSetSneakingSuperiors, allBaseBeforeSetSneakingInferiors, "beforeSetSneaking"); - sortBases(overrideSetSneakingHookTypes, allBaseOverrideSetSneakingSuperiors, allBaseOverrideSetSneakingInferiors, "overrideSetSneaking"); - sortBases(afterSetSneakingHookTypes, allBaseAfterSetSneakingSuperiors, allBaseAfterSetSneakingInferiors, "afterSetSneaking"); - - sortBases(beforeSetSprintingHookTypes, allBaseBeforeSetSprintingSuperiors, allBaseBeforeSetSprintingInferiors, "beforeSetSprinting"); - sortBases(overrideSetSprintingHookTypes, allBaseOverrideSetSprintingSuperiors, allBaseOverrideSetSprintingInferiors, "overrideSetSprinting"); - sortBases(afterSetSprintingHookTypes, allBaseAfterSetSprintingSuperiors, allBaseAfterSetSprintingInferiors, "afterSetSprinting"); - - sortBases(beforeSwingItemHookTypes, allBaseBeforeSwingItemSuperiors, allBaseBeforeSwingItemInferiors, "beforeSwingItem"); - sortBases(overrideSwingItemHookTypes, allBaseOverrideSwingItemSuperiors, allBaseOverrideSwingItemInferiors, "overrideSwingItem"); - sortBases(afterSwingItemHookTypes, allBaseAfterSwingItemSuperiors, allBaseAfterSwingItemInferiors, "afterSwingItem"); - - sortBases(beforeUpdateEntityActionStateHookTypes, allBaseBeforeUpdateEntityActionStateSuperiors, allBaseBeforeUpdateEntityActionStateInferiors, "beforeUpdateEntityActionState"); - sortBases(overrideUpdateEntityActionStateHookTypes, allBaseOverrideUpdateEntityActionStateSuperiors, allBaseOverrideUpdateEntityActionStateInferiors, "overrideUpdateEntityActionState"); - sortBases(afterUpdateEntityActionStateHookTypes, allBaseAfterUpdateEntityActionStateSuperiors, allBaseAfterUpdateEntityActionStateInferiors, "afterUpdateEntityActionState"); - - sortBases(beforeUpdatePotionEffectsHookTypes, allBaseBeforeUpdatePotionEffectsSuperiors, allBaseBeforeUpdatePotionEffectsInferiors, "beforeUpdatePotionEffects"); - sortBases(overrideUpdatePotionEffectsHookTypes, allBaseOverrideUpdatePotionEffectsSuperiors, allBaseOverrideUpdatePotionEffectsInferiors, "overrideUpdatePotionEffects"); - sortBases(afterUpdatePotionEffectsHookTypes, allBaseAfterUpdatePotionEffectsSuperiors, allBaseAfterUpdatePotionEffectsInferiors, "afterUpdatePotionEffects"); - - sortBases(beforeUpdateRiddenHookTypes, allBaseBeforeUpdateRiddenSuperiors, allBaseBeforeUpdateRiddenInferiors, "beforeUpdateRidden"); - sortBases(overrideUpdateRiddenHookTypes, allBaseOverrideUpdateRiddenSuperiors, allBaseOverrideUpdateRiddenInferiors, "overrideUpdateRidden"); - sortBases(afterUpdateRiddenHookTypes, allBaseAfterUpdateRiddenSuperiors, allBaseAfterUpdateRiddenInferiors, "afterUpdateRidden"); - - sortBases(beforeWakeUpPlayerHookTypes, allBaseBeforeWakeUpPlayerSuperiors, allBaseBeforeWakeUpPlayerInferiors, "beforeWakeUpPlayer"); - sortBases(overrideWakeUpPlayerHookTypes, allBaseOverrideWakeUpPlayerSuperiors, allBaseOverrideWakeUpPlayerInferiors, "overrideWakeUpPlayer"); - sortBases(afterWakeUpPlayerHookTypes, allBaseAfterWakeUpPlayerSuperiors, allBaseAfterWakeUpPlayerInferiors, "afterWakeUpPlayer"); - - sortBases(beforeWriteEntityToNBTHookTypes, allBaseBeforeWriteEntityToNBTSuperiors, allBaseBeforeWriteEntityToNBTInferiors, "beforeWriteEntityToNBT"); - sortBases(overrideWriteEntityToNBTHookTypes, allBaseOverrideWriteEntityToNBTSuperiors, allBaseOverrideWriteEntityToNBTInferiors, "overrideWriteEntityToNBT"); - sortBases(afterWriteEntityToNBTHookTypes, allBaseAfterWriteEntityToNBTSuperiors, allBaseAfterWriteEntityToNBTInferiors, "afterWriteEntityToNBT"); - - initialized = true; - } - - private static List getAllInstancesList() - { - List result = new ArrayList(); - Object entityPlayerList; - try - { - Object minecraftServer = net.minecraftforge.fml.common.FMLCommonHandler.instance().getMinecraftServerInstance(); - entityPlayerList = minecraftServer != null ? net.minecraft.server.MinecraftServer.class.getMethod("func_184103_al").invoke(minecraftServer) : null; - } - catch(Exception obfuscatedException) - { - try - { - Object minecraftServer = net.minecraftforge.fml.common.FMLCommonHandler.instance().getMinecraftServerInstance(); - entityPlayerList = minecraftServer != null ? net.minecraft.server.MinecraftServer.class.getMethod("getPlayerList").invoke(minecraftServer) : null; - } - catch(Exception deobfuscatedException) - { - throw new RuntimeException("Unable to aquire list of current server players.", obfuscatedException); - } - } - if(entityPlayerList != null) - for(Object entityPlayer : (List)entityPlayerList) - result.add((IServerPlayerAPI)entityPlayer); - return result; - } - - public static net.minecraft.entity.player.EntityPlayerMP[] getAllInstances() - { - List allInstances = getAllInstancesList(); - return allInstances.toArray(new net.minecraft.entity.player.EntityPlayerMP[allInstances.size()]); - } - - public static void beforeLocalConstructing(IServerPlayerAPI serverPlayer, net.minecraft.server.MinecraftServer paramMinecraftServer, net.minecraft.world.WorldServer paramWorldServer, com.mojang.authlib.GameProfile paramGameProfile, net.minecraft.server.management.PlayerInteractionManager paramPlayerInteractionManager) - { - ServerPlayerAPI serverPlayerAPI = serverPlayer.getServerPlayerAPI(); - if(serverPlayerAPI != null) - serverPlayerAPI.load(); - - if(serverPlayerAPI != null) - serverPlayerAPI.beforeLocalConstructing(paramMinecraftServer, paramWorldServer, paramGameProfile, paramPlayerInteractionManager); - } - - public static void afterLocalConstructing(IServerPlayerAPI serverPlayer, net.minecraft.server.MinecraftServer paramMinecraftServer, net.minecraft.world.WorldServer paramWorldServer, com.mojang.authlib.GameProfile paramGameProfile, net.minecraft.server.management.PlayerInteractionManager paramPlayerInteractionManager) - { - ServerPlayerAPI serverPlayerAPI = serverPlayer.getServerPlayerAPI(); - if(serverPlayerAPI != null) - serverPlayerAPI.afterLocalConstructing(paramMinecraftServer, paramWorldServer, paramGameProfile, paramPlayerInteractionManager); - } - - public static ServerPlayerBase getServerPlayerBase(IServerPlayerAPI serverPlayer, String baseId) - { - ServerPlayerAPI serverPlayerAPI = serverPlayer.getServerPlayerAPI(); - if(serverPlayerAPI != null) - return serverPlayerAPI.getServerPlayerBase(baseId); - return null; - } - - public static Set getServerPlayerBaseIds(IServerPlayerAPI serverPlayer) - { - ServerPlayerAPI serverPlayerAPI = serverPlayer.getServerPlayerAPI(); - Set result = null; - if(serverPlayerAPI != null) - result = serverPlayerAPI.getServerPlayerBaseIds(); - else - result = Collections.emptySet(); - return result; - } - - public static Object dynamic(IServerPlayerAPI serverPlayer, String key, Object[] parameters) - { - ServerPlayerAPI serverPlayerAPI = serverPlayer.getServerPlayerAPI(); - if(serverPlayerAPI != null) - return serverPlayerAPI.dynamic(key, parameters); - return null; - } - - private static void sortBases(List list, Map allBaseSuperiors, Map allBaseInferiors, String methodName) - { - new ServerPlayerBaseSorter(list, allBaseSuperiors, allBaseInferiors, methodName).Sort(); - } - - private final static Map EmptySortMap = Collections.unmodifiableMap(new HashMap()); - - private static void sortDynamicBases(Map> lists, Map> allBaseSuperiors, Map> allBaseInferiors, String key) - { - List types = lists.get(key); - if(types != null && types.size() > 1) - sortBases(types, getDynamicSorters(key, types, allBaseSuperiors), getDynamicSorters(key, types, allBaseInferiors), key); - } - - private static Map getDynamicSorters(String key, List toSort, Map> allBaseValues) - { - Map superiors = null; - - Iterator ids = toSort.iterator(); - while(ids.hasNext()) - { - String id = ids.next(); - Map idSuperiors = allBaseValues.get(id); - if(idSuperiors == null) - continue; - - String[] keySuperiorIds = idSuperiors.get(key); - if(keySuperiorIds != null && keySuperiorIds.length > 0) - { - if(superiors == null) - superiors = new HashMap(1); - superiors.put(id, keySuperiorIds); - } - } - - return superiors != null ? superiors : EmptySortMap; - } - - private ServerPlayerAPI(IServerPlayerAPI player) - { - this.player = player; - } - - private void load() - { - Iterator iterator = allBaseConstructors.keySet().iterator(); - while(iterator.hasNext()) - { - String id = iterator.next(); - ServerPlayerBase toAttach = createServerPlayerBase(id); - toAttach.beforeBaseAttach(false); - allBaseObjects.put(id, toAttach); - baseObjectsToId.put(toAttach, id); - } - - beforeLocalConstructingHooks = create(beforeLocalConstructingHookTypes); - afterLocalConstructingHooks = create(afterLocalConstructingHookTypes); - - updateServerPlayerBases(); - - iterator = allBaseObjects.keySet().iterator(); - while(iterator.hasNext()) - allBaseObjects.get(iterator.next()).afterBaseAttach(false); - } - - private ServerPlayerBase createServerPlayerBase(String id) - { - Constructor contructor = allBaseConstructors.get(id); - - ServerPlayerBase base; - try - { - if(contructor.getParameterTypes().length == 1) - base = (ServerPlayerBase)contructor.newInstance(this); - else - base = (ServerPlayerBase)contructor.newInstance(this, id); - } - catch (Exception e) - { - throw new RuntimeException("Exception while creating a ServerPlayerBase of type '" + contructor.getDeclaringClass() + "'", e); - } - return base; - } - - private void updateServerPlayerBases() - { - beforeAddExhaustionHooks = create(beforeAddExhaustionHookTypes); - overrideAddExhaustionHooks = create(overrideAddExhaustionHookTypes); - afterAddExhaustionHooks = create(afterAddExhaustionHookTypes); - isAddExhaustionModded = - beforeAddExhaustionHooks != null || - overrideAddExhaustionHooks != null || - afterAddExhaustionHooks != null; - - beforeAddExperienceHooks = create(beforeAddExperienceHookTypes); - overrideAddExperienceHooks = create(overrideAddExperienceHookTypes); - afterAddExperienceHooks = create(afterAddExperienceHookTypes); - isAddExperienceModded = - beforeAddExperienceHooks != null || - overrideAddExperienceHooks != null || - afterAddExperienceHooks != null; - - beforeAddExperienceLevelHooks = create(beforeAddExperienceLevelHookTypes); - overrideAddExperienceLevelHooks = create(overrideAddExperienceLevelHookTypes); - afterAddExperienceLevelHooks = create(afterAddExperienceLevelHookTypes); - isAddExperienceLevelModded = - beforeAddExperienceLevelHooks != null || - overrideAddExperienceLevelHooks != null || - afterAddExperienceLevelHooks != null; - - beforeAddMovementStatHooks = create(beforeAddMovementStatHookTypes); - overrideAddMovementStatHooks = create(overrideAddMovementStatHookTypes); - afterAddMovementStatHooks = create(afterAddMovementStatHookTypes); - isAddMovementStatModded = - beforeAddMovementStatHooks != null || - overrideAddMovementStatHooks != null || - afterAddMovementStatHooks != null; - - beforeAttackEntityFromHooks = create(beforeAttackEntityFromHookTypes); - overrideAttackEntityFromHooks = create(overrideAttackEntityFromHookTypes); - afterAttackEntityFromHooks = create(afterAttackEntityFromHookTypes); - isAttackEntityFromModded = - beforeAttackEntityFromHooks != null || - overrideAttackEntityFromHooks != null || - afterAttackEntityFromHooks != null; - - beforeAttackTargetEntityWithCurrentItemHooks = create(beforeAttackTargetEntityWithCurrentItemHookTypes); - overrideAttackTargetEntityWithCurrentItemHooks = create(overrideAttackTargetEntityWithCurrentItemHookTypes); - afterAttackTargetEntityWithCurrentItemHooks = create(afterAttackTargetEntityWithCurrentItemHookTypes); - isAttackTargetEntityWithCurrentItemModded = - beforeAttackTargetEntityWithCurrentItemHooks != null || - overrideAttackTargetEntityWithCurrentItemHooks != null || - afterAttackTargetEntityWithCurrentItemHooks != null; - - beforeCanBreatheUnderwaterHooks = create(beforeCanBreatheUnderwaterHookTypes); - overrideCanBreatheUnderwaterHooks = create(overrideCanBreatheUnderwaterHookTypes); - afterCanBreatheUnderwaterHooks = create(afterCanBreatheUnderwaterHookTypes); - isCanBreatheUnderwaterModded = - beforeCanBreatheUnderwaterHooks != null || - overrideCanBreatheUnderwaterHooks != null || - afterCanBreatheUnderwaterHooks != null; - - beforeCanHarvestBlockHooks = create(beforeCanHarvestBlockHookTypes); - overrideCanHarvestBlockHooks = create(overrideCanHarvestBlockHookTypes); - afterCanHarvestBlockHooks = create(afterCanHarvestBlockHookTypes); - isCanHarvestBlockModded = - beforeCanHarvestBlockHooks != null || - overrideCanHarvestBlockHooks != null || - afterCanHarvestBlockHooks != null; - - beforeCanPlayerEditHooks = create(beforeCanPlayerEditHookTypes); - overrideCanPlayerEditHooks = create(overrideCanPlayerEditHookTypes); - afterCanPlayerEditHooks = create(afterCanPlayerEditHookTypes); - isCanPlayerEditModded = - beforeCanPlayerEditHooks != null || - overrideCanPlayerEditHooks != null || - afterCanPlayerEditHooks != null; - - beforeCanTriggerWalkingHooks = create(beforeCanTriggerWalkingHookTypes); - overrideCanTriggerWalkingHooks = create(overrideCanTriggerWalkingHookTypes); - afterCanTriggerWalkingHooks = create(afterCanTriggerWalkingHookTypes); - isCanTriggerWalkingModded = - beforeCanTriggerWalkingHooks != null || - overrideCanTriggerWalkingHooks != null || - afterCanTriggerWalkingHooks != null; - - beforeClonePlayerHooks = create(beforeClonePlayerHookTypes); - overrideClonePlayerHooks = create(overrideClonePlayerHookTypes); - afterClonePlayerHooks = create(afterClonePlayerHookTypes); - isClonePlayerModded = - beforeClonePlayerHooks != null || - overrideClonePlayerHooks != null || - afterClonePlayerHooks != null; - - beforeDamageEntityHooks = create(beforeDamageEntityHookTypes); - overrideDamageEntityHooks = create(overrideDamageEntityHookTypes); - afterDamageEntityHooks = create(afterDamageEntityHookTypes); - isDamageEntityModded = - beforeDamageEntityHooks != null || - overrideDamageEntityHooks != null || - afterDamageEntityHooks != null; - - beforeDisplayGuiHooks = create(beforeDisplayGuiHookTypes); - overrideDisplayGuiHooks = create(overrideDisplayGuiHookTypes); - afterDisplayGuiHooks = create(afterDisplayGuiHookTypes); - isDisplayGuiModded = - beforeDisplayGuiHooks != null || - overrideDisplayGuiHooks != null || - afterDisplayGuiHooks != null; - - beforeDisplayGUIChestHooks = create(beforeDisplayGUIChestHookTypes); - overrideDisplayGUIChestHooks = create(overrideDisplayGUIChestHookTypes); - afterDisplayGUIChestHooks = create(afterDisplayGUIChestHookTypes); - isDisplayGUIChestModded = - beforeDisplayGUIChestHooks != null || - overrideDisplayGUIChestHooks != null || - afterDisplayGUIChestHooks != null; - - beforeDropOneItemHooks = create(beforeDropOneItemHookTypes); - overrideDropOneItemHooks = create(overrideDropOneItemHookTypes); - afterDropOneItemHooks = create(afterDropOneItemHookTypes); - isDropOneItemModded = - beforeDropOneItemHooks != null || - overrideDropOneItemHooks != null || - afterDropOneItemHooks != null; - - beforeDropPlayerItemWithRandomChoiceHooks = create(beforeDropPlayerItemWithRandomChoiceHookTypes); - overrideDropPlayerItemWithRandomChoiceHooks = create(overrideDropPlayerItemWithRandomChoiceHookTypes); - afterDropPlayerItemWithRandomChoiceHooks = create(afterDropPlayerItemWithRandomChoiceHookTypes); - isDropPlayerItemWithRandomChoiceModded = - beforeDropPlayerItemWithRandomChoiceHooks != null || - overrideDropPlayerItemWithRandomChoiceHooks != null || - afterDropPlayerItemWithRandomChoiceHooks != null; - - beforeFallHooks = create(beforeFallHookTypes); - overrideFallHooks = create(overrideFallHookTypes); - afterFallHooks = create(afterFallHookTypes); - isFallModded = - beforeFallHooks != null || - overrideFallHooks != null || - afterFallHooks != null; - - beforeGetAIMoveSpeedHooks = create(beforeGetAIMoveSpeedHookTypes); - overrideGetAIMoveSpeedHooks = create(overrideGetAIMoveSpeedHookTypes); - afterGetAIMoveSpeedHooks = create(afterGetAIMoveSpeedHookTypes); - isGetAIMoveSpeedModded = - beforeGetAIMoveSpeedHooks != null || - overrideGetAIMoveSpeedHooks != null || - afterGetAIMoveSpeedHooks != null; - - beforeGetBreakSpeedHooks = create(beforeGetBreakSpeedHookTypes); - overrideGetBreakSpeedHooks = create(overrideGetBreakSpeedHookTypes); - afterGetBreakSpeedHooks = create(afterGetBreakSpeedHookTypes); - isGetBreakSpeedModded = - beforeGetBreakSpeedHooks != null || - overrideGetBreakSpeedHooks != null || - afterGetBreakSpeedHooks != null; - - beforeGetDistanceSqHooks = create(beforeGetDistanceSqHookTypes); - overrideGetDistanceSqHooks = create(overrideGetDistanceSqHookTypes); - afterGetDistanceSqHooks = create(afterGetDistanceSqHookTypes); - isGetDistanceSqModded = - beforeGetDistanceSqHooks != null || - overrideGetDistanceSqHooks != null || - afterGetDistanceSqHooks != null; - - beforeGetBrightnessHooks = create(beforeGetBrightnessHookTypes); - overrideGetBrightnessHooks = create(overrideGetBrightnessHookTypes); - afterGetBrightnessHooks = create(afterGetBrightnessHookTypes); - isGetBrightnessModded = - beforeGetBrightnessHooks != null || - overrideGetBrightnessHooks != null || - afterGetBrightnessHooks != null; - - beforeGetEyeHeightHooks = create(beforeGetEyeHeightHookTypes); - overrideGetEyeHeightHooks = create(overrideGetEyeHeightHookTypes); - afterGetEyeHeightHooks = create(afterGetEyeHeightHookTypes); - isGetEyeHeightModded = - beforeGetEyeHeightHooks != null || - overrideGetEyeHeightHooks != null || - afterGetEyeHeightHooks != null; - - beforeHealHooks = create(beforeHealHookTypes); - overrideHealHooks = create(overrideHealHookTypes); - afterHealHooks = create(afterHealHookTypes); - isHealModded = - beforeHealHooks != null || - overrideHealHooks != null || - afterHealHooks != null; - - beforeIsEntityInsideOpaqueBlockHooks = create(beforeIsEntityInsideOpaqueBlockHookTypes); - overrideIsEntityInsideOpaqueBlockHooks = create(overrideIsEntityInsideOpaqueBlockHookTypes); - afterIsEntityInsideOpaqueBlockHooks = create(afterIsEntityInsideOpaqueBlockHookTypes); - isIsEntityInsideOpaqueBlockModded = - beforeIsEntityInsideOpaqueBlockHooks != null || - overrideIsEntityInsideOpaqueBlockHooks != null || - afterIsEntityInsideOpaqueBlockHooks != null; - - beforeIsInWaterHooks = create(beforeIsInWaterHookTypes); - overrideIsInWaterHooks = create(overrideIsInWaterHookTypes); - afterIsInWaterHooks = create(afterIsInWaterHookTypes); - isIsInWaterModded = - beforeIsInWaterHooks != null || - overrideIsInWaterHooks != null || - afterIsInWaterHooks != null; - - beforeIsInsideOfMaterialHooks = create(beforeIsInsideOfMaterialHookTypes); - overrideIsInsideOfMaterialHooks = create(overrideIsInsideOfMaterialHookTypes); - afterIsInsideOfMaterialHooks = create(afterIsInsideOfMaterialHookTypes); - isIsInsideOfMaterialModded = - beforeIsInsideOfMaterialHooks != null || - overrideIsInsideOfMaterialHooks != null || - afterIsInsideOfMaterialHooks != null; - - beforeIsOnLadderHooks = create(beforeIsOnLadderHookTypes); - overrideIsOnLadderHooks = create(overrideIsOnLadderHookTypes); - afterIsOnLadderHooks = create(afterIsOnLadderHookTypes); - isIsOnLadderModded = - beforeIsOnLadderHooks != null || - overrideIsOnLadderHooks != null || - afterIsOnLadderHooks != null; - - beforeIsPlayerSleepingHooks = create(beforeIsPlayerSleepingHookTypes); - overrideIsPlayerSleepingHooks = create(overrideIsPlayerSleepingHookTypes); - afterIsPlayerSleepingHooks = create(afterIsPlayerSleepingHookTypes); - isIsPlayerSleepingModded = - beforeIsPlayerSleepingHooks != null || - overrideIsPlayerSleepingHooks != null || - afterIsPlayerSleepingHooks != null; - - beforeIsSneakingHooks = create(beforeIsSneakingHookTypes); - overrideIsSneakingHooks = create(overrideIsSneakingHookTypes); - afterIsSneakingHooks = create(afterIsSneakingHookTypes); - isIsSneakingModded = - beforeIsSneakingHooks != null || - overrideIsSneakingHooks != null || - afterIsSneakingHooks != null; - - beforeJumpHooks = create(beforeJumpHookTypes); - overrideJumpHooks = create(overrideJumpHookTypes); - afterJumpHooks = create(afterJumpHookTypes); - isJumpModded = - beforeJumpHooks != null || - overrideJumpHooks != null || - afterJumpHooks != null; - - beforeKnockBackHooks = create(beforeKnockBackHookTypes); - overrideKnockBackHooks = create(overrideKnockBackHookTypes); - afterKnockBackHooks = create(afterKnockBackHookTypes); - isKnockBackModded = - beforeKnockBackHooks != null || - overrideKnockBackHooks != null || - afterKnockBackHooks != null; - - beforeMountEntityHooks = create(beforeMountEntityHookTypes); - overrideMountEntityHooks = create(overrideMountEntityHookTypes); - afterMountEntityHooks = create(afterMountEntityHookTypes); - isMountEntityModded = - beforeMountEntityHooks != null || - overrideMountEntityHooks != null || - afterMountEntityHooks != null; - - beforeMoveEntityHooks = create(beforeMoveEntityHookTypes); - overrideMoveEntityHooks = create(overrideMoveEntityHookTypes); - afterMoveEntityHooks = create(afterMoveEntityHookTypes); - isMoveEntityModded = - beforeMoveEntityHooks != null || - overrideMoveEntityHooks != null || - afterMoveEntityHooks != null; - - beforeMoveEntityWithHeadingHooks = create(beforeMoveEntityWithHeadingHookTypes); - overrideMoveEntityWithHeadingHooks = create(overrideMoveEntityWithHeadingHookTypes); - afterMoveEntityWithHeadingHooks = create(afterMoveEntityWithHeadingHookTypes); - isMoveEntityWithHeadingModded = - beforeMoveEntityWithHeadingHooks != null || - overrideMoveEntityWithHeadingHooks != null || - afterMoveEntityWithHeadingHooks != null; - - beforeMoveFlyingHooks = create(beforeMoveFlyingHookTypes); - overrideMoveFlyingHooks = create(overrideMoveFlyingHookTypes); - afterMoveFlyingHooks = create(afterMoveFlyingHookTypes); - isMoveFlyingModded = - beforeMoveFlyingHooks != null || - overrideMoveFlyingHooks != null || - afterMoveFlyingHooks != null; - - beforeOnDeathHooks = create(beforeOnDeathHookTypes); - overrideOnDeathHooks = create(overrideOnDeathHookTypes); - afterOnDeathHooks = create(afterOnDeathHookTypes); - isOnDeathModded = - beforeOnDeathHooks != null || - overrideOnDeathHooks != null || - afterOnDeathHooks != null; - - beforeOnLivingUpdateHooks = create(beforeOnLivingUpdateHookTypes); - overrideOnLivingUpdateHooks = create(overrideOnLivingUpdateHookTypes); - afterOnLivingUpdateHooks = create(afterOnLivingUpdateHookTypes); - isOnLivingUpdateModded = - beforeOnLivingUpdateHooks != null || - overrideOnLivingUpdateHooks != null || - afterOnLivingUpdateHooks != null; - - beforeOnKillEntityHooks = create(beforeOnKillEntityHookTypes); - overrideOnKillEntityHooks = create(overrideOnKillEntityHookTypes); - afterOnKillEntityHooks = create(afterOnKillEntityHookTypes); - isOnKillEntityModded = - beforeOnKillEntityHooks != null || - overrideOnKillEntityHooks != null || - afterOnKillEntityHooks != null; - - beforeOnStruckByLightningHooks = create(beforeOnStruckByLightningHookTypes); - overrideOnStruckByLightningHooks = create(overrideOnStruckByLightningHookTypes); - afterOnStruckByLightningHooks = create(afterOnStruckByLightningHookTypes); - isOnStruckByLightningModded = - beforeOnStruckByLightningHooks != null || - overrideOnStruckByLightningHooks != null || - afterOnStruckByLightningHooks != null; - - beforeOnUpdateHooks = create(beforeOnUpdateHookTypes); - overrideOnUpdateHooks = create(overrideOnUpdateHookTypes); - afterOnUpdateHooks = create(afterOnUpdateHookTypes); - isOnUpdateModded = - beforeOnUpdateHooks != null || - overrideOnUpdateHooks != null || - afterOnUpdateHooks != null; - - beforeOnUpdateEntityHooks = create(beforeOnUpdateEntityHookTypes); - overrideOnUpdateEntityHooks = create(overrideOnUpdateEntityHookTypes); - afterOnUpdateEntityHooks = create(afterOnUpdateEntityHookTypes); - isOnUpdateEntityModded = - beforeOnUpdateEntityHooks != null || - overrideOnUpdateEntityHooks != null || - afterOnUpdateEntityHooks != null; - - beforeReadEntityFromNBTHooks = create(beforeReadEntityFromNBTHookTypes); - overrideReadEntityFromNBTHooks = create(overrideReadEntityFromNBTHookTypes); - afterReadEntityFromNBTHooks = create(afterReadEntityFromNBTHookTypes); - isReadEntityFromNBTModded = - beforeReadEntityFromNBTHooks != null || - overrideReadEntityFromNBTHooks != null || - afterReadEntityFromNBTHooks != null; - - beforeSetDeadHooks = create(beforeSetDeadHookTypes); - overrideSetDeadHooks = create(overrideSetDeadHookTypes); - afterSetDeadHooks = create(afterSetDeadHookTypes); - isSetDeadModded = - beforeSetDeadHooks != null || - overrideSetDeadHooks != null || - afterSetDeadHooks != null; - - beforeSetEntityActionStateHooks = create(beforeSetEntityActionStateHookTypes); - overrideSetEntityActionStateHooks = create(overrideSetEntityActionStateHookTypes); - afterSetEntityActionStateHooks = create(afterSetEntityActionStateHookTypes); - isSetEntityActionStateModded = - beforeSetEntityActionStateHooks != null || - overrideSetEntityActionStateHooks != null || - afterSetEntityActionStateHooks != null; - - beforeSetPositionHooks = create(beforeSetPositionHookTypes); - overrideSetPositionHooks = create(overrideSetPositionHookTypes); - afterSetPositionHooks = create(afterSetPositionHookTypes); - isSetPositionModded = - beforeSetPositionHooks != null || - overrideSetPositionHooks != null || - afterSetPositionHooks != null; - - beforeSetSneakingHooks = create(beforeSetSneakingHookTypes); - overrideSetSneakingHooks = create(overrideSetSneakingHookTypes); - afterSetSneakingHooks = create(afterSetSneakingHookTypes); - isSetSneakingModded = - beforeSetSneakingHooks != null || - overrideSetSneakingHooks != null || - afterSetSneakingHooks != null; - - beforeSetSprintingHooks = create(beforeSetSprintingHookTypes); - overrideSetSprintingHooks = create(overrideSetSprintingHookTypes); - afterSetSprintingHooks = create(afterSetSprintingHookTypes); - isSetSprintingModded = - beforeSetSprintingHooks != null || - overrideSetSprintingHooks != null || - afterSetSprintingHooks != null; - - beforeSwingItemHooks = create(beforeSwingItemHookTypes); - overrideSwingItemHooks = create(overrideSwingItemHookTypes); - afterSwingItemHooks = create(afterSwingItemHookTypes); - isSwingItemModded = - beforeSwingItemHooks != null || - overrideSwingItemHooks != null || - afterSwingItemHooks != null; - - beforeUpdateEntityActionStateHooks = create(beforeUpdateEntityActionStateHookTypes); - overrideUpdateEntityActionStateHooks = create(overrideUpdateEntityActionStateHookTypes); - afterUpdateEntityActionStateHooks = create(afterUpdateEntityActionStateHookTypes); - isUpdateEntityActionStateModded = - beforeUpdateEntityActionStateHooks != null || - overrideUpdateEntityActionStateHooks != null || - afterUpdateEntityActionStateHooks != null; - - beforeUpdatePotionEffectsHooks = create(beforeUpdatePotionEffectsHookTypes); - overrideUpdatePotionEffectsHooks = create(overrideUpdatePotionEffectsHookTypes); - afterUpdatePotionEffectsHooks = create(afterUpdatePotionEffectsHookTypes); - isUpdatePotionEffectsModded = - beforeUpdatePotionEffectsHooks != null || - overrideUpdatePotionEffectsHooks != null || - afterUpdatePotionEffectsHooks != null; - - beforeUpdateRiddenHooks = create(beforeUpdateRiddenHookTypes); - overrideUpdateRiddenHooks = create(overrideUpdateRiddenHookTypes); - afterUpdateRiddenHooks = create(afterUpdateRiddenHookTypes); - isUpdateRiddenModded = - beforeUpdateRiddenHooks != null || - overrideUpdateRiddenHooks != null || - afterUpdateRiddenHooks != null; - - beforeWakeUpPlayerHooks = create(beforeWakeUpPlayerHookTypes); - overrideWakeUpPlayerHooks = create(overrideWakeUpPlayerHookTypes); - afterWakeUpPlayerHooks = create(afterWakeUpPlayerHookTypes); - isWakeUpPlayerModded = - beforeWakeUpPlayerHooks != null || - overrideWakeUpPlayerHooks != null || - afterWakeUpPlayerHooks != null; - - beforeWriteEntityToNBTHooks = create(beforeWriteEntityToNBTHookTypes); - overrideWriteEntityToNBTHooks = create(overrideWriteEntityToNBTHookTypes); - afterWriteEntityToNBTHooks = create(afterWriteEntityToNBTHookTypes); - isWriteEntityToNBTModded = - beforeWriteEntityToNBTHooks != null || - overrideWriteEntityToNBTHooks != null || - afterWriteEntityToNBTHooks != null; - - } - - private void attachServerPlayerBase(String id) - { - ServerPlayerBase toAttach = createServerPlayerBase(id); - toAttach.beforeBaseAttach(true); - allBaseObjects.put(id, toAttach); - updateServerPlayerBases(); - toAttach.afterBaseAttach(true); - } - - private void detachServerPlayerBase(String id) - { - ServerPlayerBase toDetach = allBaseObjects.get(id); - toDetach.beforeBaseDetach(true); - allBaseObjects.remove(id); - toDetach.afterBaseDetach(true); - } - - private ServerPlayerBase[] create(List types) - { - if(types.isEmpty()) - return null; - - ServerPlayerBase[] result = new ServerPlayerBase[types.size()]; - for(int i = 0; i < result.length; i++) - result[i] = getServerPlayerBase(types.get(i)); - return result; - } - - private void beforeLocalConstructing(net.minecraft.server.MinecraftServer paramMinecraftServer, net.minecraft.world.WorldServer paramWorldServer, com.mojang.authlib.GameProfile paramGameProfile, net.minecraft.server.management.PlayerInteractionManager paramPlayerInteractionManager) - { - if(beforeLocalConstructingHooks != null) - for(int i = beforeLocalConstructingHooks.length - 1; i >= 0 ; i--) - beforeLocalConstructingHooks[i].beforeLocalConstructing(paramMinecraftServer, paramWorldServer, paramGameProfile, paramPlayerInteractionManager); - beforeLocalConstructingHooks = null; - } - - private void afterLocalConstructing(net.minecraft.server.MinecraftServer paramMinecraftServer, net.minecraft.world.WorldServer paramWorldServer, com.mojang.authlib.GameProfile paramGameProfile, net.minecraft.server.management.PlayerInteractionManager paramPlayerInteractionManager) - { - if(afterLocalConstructingHooks != null) - for(int i = 0; i < afterLocalConstructingHooks.length; i++) - afterLocalConstructingHooks[i].afterLocalConstructing(paramMinecraftServer, paramWorldServer, paramGameProfile, paramPlayerInteractionManager); - afterLocalConstructingHooks = null; - } - - public ServerPlayerBase getServerPlayerBase(String id) - { - return allBaseObjects.get(id); - } - - public Set getServerPlayerBaseIds() - { - return unmodifiableAllBaseIds; - } - - public Object dynamic(String key, Object[] parameters) - { - key = key.replace('.', '_').replace(' ', '_'); - executeAll(key, parameters, beforeDynamicHookTypes, beforeDynamicHookMethods, true); - Object result = dynamicOverwritten(key, parameters, null); - executeAll(key, parameters, afterDynamicHookTypes, afterDynamicHookMethods, false); - return result; - } - - public Object dynamicOverwritten(String key, Object[] parameters, ServerPlayerBase overwriter) - { - List overrideIds = overrideDynamicHookTypes.get(key); - - String id = null; - if(overrideIds != null) - if(overwriter != null) - { - id = baseObjectsToId.get(overwriter); - int index = overrideIds.indexOf(id); - if(index > 0) - id = overrideIds.get(index - 1); - else - id = null; - } - else if(overrideIds.size() > 0) - id = overrideIds.get(overrideIds.size() - 1); - - Map, Map> methodMap; - - if(id == null) - { - id = keysToVirtualIds.get(key); - if(id == null) - return null; - methodMap = virtualDynamicHookMethods; - } - else - methodMap = overrideDynamicHookMethods; - - Map methods = methodMap.get(allBaseConstructors.get(id).getDeclaringClass()); - if(methods == null) - return null; - - Method method = methods.get(key); - if(method == null) - return null; - - return execute(getServerPlayerBase(id), method, parameters); - } - - private void executeAll(String key, Object[] parameters, Map> dynamicHookTypes, Map, Map> dynamicHookMethods, boolean reverse) - { - List beforeIds = dynamicHookTypes.get(key); - if(beforeIds == null) - return; - - for(int i= reverse ? beforeIds.size() - 1 : 0; reverse ? i >= 0 : i < beforeIds.size(); i = i + (reverse ? -1 : 1)) - { - String id = beforeIds.get(i); - ServerPlayerBase base = getServerPlayerBase(id); - Class type = base.getClass(); - - Map methods = dynamicHookMethods.get(type); - if(methods == null) - continue; - - Method method = methods.get(key); - if(method == null) - continue; - - execute(base, method, parameters); - } - } - - private Object execute(ServerPlayerBase base, Method method, Object[] parameters) - { - try - { - return method.invoke(base, parameters); - } - catch(Exception e) - { - throw new RuntimeException("Exception while invoking dynamic method", e); - } - } - - public static void addExhaustion(IServerPlayerAPI target, float paramFloat) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isAddExhaustionModded) - serverPlayerAPI.addExhaustion(paramFloat); - else - target.localAddExhaustion(paramFloat); - } - - private void addExhaustion(float paramFloat) - { - if(beforeAddExhaustionHooks != null) - for(int i = beforeAddExhaustionHooks.length - 1; i >= 0 ; i--) - beforeAddExhaustionHooks[i].beforeAddExhaustion(paramFloat); - - if(overrideAddExhaustionHooks != null) - overrideAddExhaustionHooks[overrideAddExhaustionHooks.length - 1].addExhaustion(paramFloat); - else - player.localAddExhaustion(paramFloat); - - if(afterAddExhaustionHooks != null) - for(int i = 0; i < afterAddExhaustionHooks.length; i++) - afterAddExhaustionHooks[i].afterAddExhaustion(paramFloat); - - } - - protected ServerPlayerBase GetOverwrittenAddExhaustion(ServerPlayerBase overWriter) - { - if (overrideAddExhaustionHooks == null) - return overWriter; - - for(int i = 0; i < overrideAddExhaustionHooks.length; i++) - if(overrideAddExhaustionHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideAddExhaustionHooks[i - 1]; - - return overWriter; - } - - private final static List beforeAddExhaustionHookTypes = new LinkedList(); - private final static List overrideAddExhaustionHookTypes = new LinkedList(); - private final static List afterAddExhaustionHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeAddExhaustionHooks; - private ServerPlayerBase[] overrideAddExhaustionHooks; - private ServerPlayerBase[] afterAddExhaustionHooks; - - public boolean isAddExhaustionModded; - - private static final Map allBaseBeforeAddExhaustionSuperiors = new Hashtable(0); - private static final Map allBaseBeforeAddExhaustionInferiors = new Hashtable(0); - private static final Map allBaseOverrideAddExhaustionSuperiors = new Hashtable(0); - private static final Map allBaseOverrideAddExhaustionInferiors = new Hashtable(0); - private static final Map allBaseAfterAddExhaustionSuperiors = new Hashtable(0); - private static final Map allBaseAfterAddExhaustionInferiors = new Hashtable(0); - - public static void addExperience(IServerPlayerAPI target, int paramInt) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isAddExperienceModded) - serverPlayerAPI.addExperience(paramInt); - else - target.localAddExperience(paramInt); - } - - private void addExperience(int paramInt) - { - if(beforeAddExperienceHooks != null) - for(int i = beforeAddExperienceHooks.length - 1; i >= 0 ; i--) - beforeAddExperienceHooks[i].beforeAddExperience(paramInt); - - if(overrideAddExperienceHooks != null) - overrideAddExperienceHooks[overrideAddExperienceHooks.length - 1].addExperience(paramInt); - else - player.localAddExperience(paramInt); - - if(afterAddExperienceHooks != null) - for(int i = 0; i < afterAddExperienceHooks.length; i++) - afterAddExperienceHooks[i].afterAddExperience(paramInt); - - } - - protected ServerPlayerBase GetOverwrittenAddExperience(ServerPlayerBase overWriter) - { - if (overrideAddExperienceHooks == null) - return overWriter; - - for(int i = 0; i < overrideAddExperienceHooks.length; i++) - if(overrideAddExperienceHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideAddExperienceHooks[i - 1]; - - return overWriter; - } - - private final static List beforeAddExperienceHookTypes = new LinkedList(); - private final static List overrideAddExperienceHookTypes = new LinkedList(); - private final static List afterAddExperienceHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeAddExperienceHooks; - private ServerPlayerBase[] overrideAddExperienceHooks; - private ServerPlayerBase[] afterAddExperienceHooks; - - public boolean isAddExperienceModded; - - private static final Map allBaseBeforeAddExperienceSuperiors = new Hashtable(0); - private static final Map allBaseBeforeAddExperienceInferiors = new Hashtable(0); - private static final Map allBaseOverrideAddExperienceSuperiors = new Hashtable(0); - private static final Map allBaseOverrideAddExperienceInferiors = new Hashtable(0); - private static final Map allBaseAfterAddExperienceSuperiors = new Hashtable(0); - private static final Map allBaseAfterAddExperienceInferiors = new Hashtable(0); - - public static void addExperienceLevel(IServerPlayerAPI target, int paramInt) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isAddExperienceLevelModded) - serverPlayerAPI.addExperienceLevel(paramInt); - else - target.localAddExperienceLevel(paramInt); - } - - private void addExperienceLevel(int paramInt) - { - if(beforeAddExperienceLevelHooks != null) - for(int i = beforeAddExperienceLevelHooks.length - 1; i >= 0 ; i--) - beforeAddExperienceLevelHooks[i].beforeAddExperienceLevel(paramInt); - - if(overrideAddExperienceLevelHooks != null) - overrideAddExperienceLevelHooks[overrideAddExperienceLevelHooks.length - 1].addExperienceLevel(paramInt); - else - player.localAddExperienceLevel(paramInt); - - if(afterAddExperienceLevelHooks != null) - for(int i = 0; i < afterAddExperienceLevelHooks.length; i++) - afterAddExperienceLevelHooks[i].afterAddExperienceLevel(paramInt); - - } - - protected ServerPlayerBase GetOverwrittenAddExperienceLevel(ServerPlayerBase overWriter) - { - if (overrideAddExperienceLevelHooks == null) - return overWriter; - - for(int i = 0; i < overrideAddExperienceLevelHooks.length; i++) - if(overrideAddExperienceLevelHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideAddExperienceLevelHooks[i - 1]; - - return overWriter; - } - - private final static List beforeAddExperienceLevelHookTypes = new LinkedList(); - private final static List overrideAddExperienceLevelHookTypes = new LinkedList(); - private final static List afterAddExperienceLevelHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeAddExperienceLevelHooks; - private ServerPlayerBase[] overrideAddExperienceLevelHooks; - private ServerPlayerBase[] afterAddExperienceLevelHooks; - - public boolean isAddExperienceLevelModded; - - private static final Map allBaseBeforeAddExperienceLevelSuperiors = new Hashtable(0); - private static final Map allBaseBeforeAddExperienceLevelInferiors = new Hashtable(0); - private static final Map allBaseOverrideAddExperienceLevelSuperiors = new Hashtable(0); - private static final Map allBaseOverrideAddExperienceLevelInferiors = new Hashtable(0); - private static final Map allBaseAfterAddExperienceLevelSuperiors = new Hashtable(0); - private static final Map allBaseAfterAddExperienceLevelInferiors = new Hashtable(0); - - public static void addMovementStat(IServerPlayerAPI target, double paramDouble1, double paramDouble2, double paramDouble3) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isAddMovementStatModded) - serverPlayerAPI.addMovementStat(paramDouble1, paramDouble2, paramDouble3); - else - target.localAddMovementStat(paramDouble1, paramDouble2, paramDouble3); - } - - private void addMovementStat(double paramDouble1, double paramDouble2, double paramDouble3) - { - if(beforeAddMovementStatHooks != null) - for(int i = beforeAddMovementStatHooks.length - 1; i >= 0 ; i--) - beforeAddMovementStatHooks[i].beforeAddMovementStat(paramDouble1, paramDouble2, paramDouble3); - - if(overrideAddMovementStatHooks != null) - overrideAddMovementStatHooks[overrideAddMovementStatHooks.length - 1].addMovementStat(paramDouble1, paramDouble2, paramDouble3); - else - player.localAddMovementStat(paramDouble1, paramDouble2, paramDouble3); - - if(afterAddMovementStatHooks != null) - for(int i = 0; i < afterAddMovementStatHooks.length; i++) - afterAddMovementStatHooks[i].afterAddMovementStat(paramDouble1, paramDouble2, paramDouble3); - - } - - protected ServerPlayerBase GetOverwrittenAddMovementStat(ServerPlayerBase overWriter) - { - if (overrideAddMovementStatHooks == null) - return overWriter; - - for(int i = 0; i < overrideAddMovementStatHooks.length; i++) - if(overrideAddMovementStatHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideAddMovementStatHooks[i - 1]; - - return overWriter; - } - - private final static List beforeAddMovementStatHookTypes = new LinkedList(); - private final static List overrideAddMovementStatHookTypes = new LinkedList(); - private final static List afterAddMovementStatHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeAddMovementStatHooks; - private ServerPlayerBase[] overrideAddMovementStatHooks; - private ServerPlayerBase[] afterAddMovementStatHooks; - - public boolean isAddMovementStatModded; - - private static final Map allBaseBeforeAddMovementStatSuperiors = new Hashtable(0); - private static final Map allBaseBeforeAddMovementStatInferiors = new Hashtable(0); - private static final Map allBaseOverrideAddMovementStatSuperiors = new Hashtable(0); - private static final Map allBaseOverrideAddMovementStatInferiors = new Hashtable(0); - private static final Map allBaseAfterAddMovementStatSuperiors = new Hashtable(0); - private static final Map allBaseAfterAddMovementStatInferiors = new Hashtable(0); - - public static boolean attackEntityFrom(IServerPlayerAPI target, net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - boolean _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isAttackEntityFromModded) - _result = serverPlayerAPI.attackEntityFrom(paramDamageSource, paramFloat); - else - _result = target.localAttackEntityFrom(paramDamageSource, paramFloat); - return _result; - } - - private boolean attackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - if(beforeAttackEntityFromHooks != null) - for(int i = beforeAttackEntityFromHooks.length - 1; i >= 0 ; i--) - beforeAttackEntityFromHooks[i].beforeAttackEntityFrom(paramDamageSource, paramFloat); - - boolean _result; - if(overrideAttackEntityFromHooks != null) - _result = overrideAttackEntityFromHooks[overrideAttackEntityFromHooks.length - 1].attackEntityFrom(paramDamageSource, paramFloat); - else - _result = player.localAttackEntityFrom(paramDamageSource, paramFloat); - - if(afterAttackEntityFromHooks != null) - for(int i = 0; i < afterAttackEntityFromHooks.length; i++) - afterAttackEntityFromHooks[i].afterAttackEntityFrom(paramDamageSource, paramFloat); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenAttackEntityFrom(ServerPlayerBase overWriter) - { - if (overrideAttackEntityFromHooks == null) - return overWriter; - - for(int i = 0; i < overrideAttackEntityFromHooks.length; i++) - if(overrideAttackEntityFromHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideAttackEntityFromHooks[i - 1]; - - return overWriter; - } - - private final static List beforeAttackEntityFromHookTypes = new LinkedList(); - private final static List overrideAttackEntityFromHookTypes = new LinkedList(); - private final static List afterAttackEntityFromHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeAttackEntityFromHooks; - private ServerPlayerBase[] overrideAttackEntityFromHooks; - private ServerPlayerBase[] afterAttackEntityFromHooks; - - public boolean isAttackEntityFromModded; - - private static final Map allBaseBeforeAttackEntityFromSuperiors = new Hashtable(0); - private static final Map allBaseBeforeAttackEntityFromInferiors = new Hashtable(0); - private static final Map allBaseOverrideAttackEntityFromSuperiors = new Hashtable(0); - private static final Map allBaseOverrideAttackEntityFromInferiors = new Hashtable(0); - private static final Map allBaseAfterAttackEntityFromSuperiors = new Hashtable(0); - private static final Map allBaseAfterAttackEntityFromInferiors = new Hashtable(0); - - public static void attackTargetEntityWithCurrentItem(IServerPlayerAPI target, net.minecraft.entity.Entity paramEntity) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isAttackTargetEntityWithCurrentItemModded) - serverPlayerAPI.attackTargetEntityWithCurrentItem(paramEntity); - else - target.localAttackTargetEntityWithCurrentItem(paramEntity); - } - - private void attackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity) - { - if(beforeAttackTargetEntityWithCurrentItemHooks != null) - for(int i = beforeAttackTargetEntityWithCurrentItemHooks.length - 1; i >= 0 ; i--) - beforeAttackTargetEntityWithCurrentItemHooks[i].beforeAttackTargetEntityWithCurrentItem(paramEntity); - - if(overrideAttackTargetEntityWithCurrentItemHooks != null) - overrideAttackTargetEntityWithCurrentItemHooks[overrideAttackTargetEntityWithCurrentItemHooks.length - 1].attackTargetEntityWithCurrentItem(paramEntity); - else - player.localAttackTargetEntityWithCurrentItem(paramEntity); - - if(afterAttackTargetEntityWithCurrentItemHooks != null) - for(int i = 0; i < afterAttackTargetEntityWithCurrentItemHooks.length; i++) - afterAttackTargetEntityWithCurrentItemHooks[i].afterAttackTargetEntityWithCurrentItem(paramEntity); - - } - - protected ServerPlayerBase GetOverwrittenAttackTargetEntityWithCurrentItem(ServerPlayerBase overWriter) - { - if (overrideAttackTargetEntityWithCurrentItemHooks == null) - return overWriter; - - for(int i = 0; i < overrideAttackTargetEntityWithCurrentItemHooks.length; i++) - if(overrideAttackTargetEntityWithCurrentItemHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideAttackTargetEntityWithCurrentItemHooks[i - 1]; - - return overWriter; - } - - private final static List beforeAttackTargetEntityWithCurrentItemHookTypes = new LinkedList(); - private final static List overrideAttackTargetEntityWithCurrentItemHookTypes = new LinkedList(); - private final static List afterAttackTargetEntityWithCurrentItemHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeAttackTargetEntityWithCurrentItemHooks; - private ServerPlayerBase[] overrideAttackTargetEntityWithCurrentItemHooks; - private ServerPlayerBase[] afterAttackTargetEntityWithCurrentItemHooks; - - public boolean isAttackTargetEntityWithCurrentItemModded; - - private static final Map allBaseBeforeAttackTargetEntityWithCurrentItemSuperiors = new Hashtable(0); - private static final Map allBaseBeforeAttackTargetEntityWithCurrentItemInferiors = new Hashtable(0); - private static final Map allBaseOverrideAttackTargetEntityWithCurrentItemSuperiors = new Hashtable(0); - private static final Map allBaseOverrideAttackTargetEntityWithCurrentItemInferiors = new Hashtable(0); - private static final Map allBaseAfterAttackTargetEntityWithCurrentItemSuperiors = new Hashtable(0); - private static final Map allBaseAfterAttackTargetEntityWithCurrentItemInferiors = new Hashtable(0); - - public static boolean canBreatheUnderwater(IServerPlayerAPI target) - { - boolean _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isCanBreatheUnderwaterModded) - _result = serverPlayerAPI.canBreatheUnderwater(); - else - _result = target.localCanBreatheUnderwater(); - return _result; - } - - private boolean canBreatheUnderwater() - { - if(beforeCanBreatheUnderwaterHooks != null) - for(int i = beforeCanBreatheUnderwaterHooks.length - 1; i >= 0 ; i--) - beforeCanBreatheUnderwaterHooks[i].beforeCanBreatheUnderwater(); - - boolean _result; - if(overrideCanBreatheUnderwaterHooks != null) - _result = overrideCanBreatheUnderwaterHooks[overrideCanBreatheUnderwaterHooks.length - 1].canBreatheUnderwater(); - else - _result = player.localCanBreatheUnderwater(); - - if(afterCanBreatheUnderwaterHooks != null) - for(int i = 0; i < afterCanBreatheUnderwaterHooks.length; i++) - afterCanBreatheUnderwaterHooks[i].afterCanBreatheUnderwater(); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenCanBreatheUnderwater(ServerPlayerBase overWriter) - { - if (overrideCanBreatheUnderwaterHooks == null) - return overWriter; - - for(int i = 0; i < overrideCanBreatheUnderwaterHooks.length; i++) - if(overrideCanBreatheUnderwaterHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideCanBreatheUnderwaterHooks[i - 1]; - - return overWriter; - } - - private final static List beforeCanBreatheUnderwaterHookTypes = new LinkedList(); - private final static List overrideCanBreatheUnderwaterHookTypes = new LinkedList(); - private final static List afterCanBreatheUnderwaterHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeCanBreatheUnderwaterHooks; - private ServerPlayerBase[] overrideCanBreatheUnderwaterHooks; - private ServerPlayerBase[] afterCanBreatheUnderwaterHooks; - - public boolean isCanBreatheUnderwaterModded; - - private static final Map allBaseBeforeCanBreatheUnderwaterSuperiors = new Hashtable(0); - private static final Map allBaseBeforeCanBreatheUnderwaterInferiors = new Hashtable(0); - private static final Map allBaseOverrideCanBreatheUnderwaterSuperiors = new Hashtable(0); - private static final Map allBaseOverrideCanBreatheUnderwaterInferiors = new Hashtable(0); - private static final Map allBaseAfterCanBreatheUnderwaterSuperiors = new Hashtable(0); - private static final Map allBaseAfterCanBreatheUnderwaterInferiors = new Hashtable(0); - - public static boolean canHarvestBlock(IServerPlayerAPI target, net.minecraft.block.state.IBlockState paramIBlockState) - { - boolean _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isCanHarvestBlockModded) - _result = serverPlayerAPI.canHarvestBlock(paramIBlockState); - else - _result = target.localCanHarvestBlock(paramIBlockState); - return _result; - } - - private boolean canHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState) - { - if(beforeCanHarvestBlockHooks != null) - for(int i = beforeCanHarvestBlockHooks.length - 1; i >= 0 ; i--) - beforeCanHarvestBlockHooks[i].beforeCanHarvestBlock(paramIBlockState); - - boolean _result; - if(overrideCanHarvestBlockHooks != null) - _result = overrideCanHarvestBlockHooks[overrideCanHarvestBlockHooks.length - 1].canHarvestBlock(paramIBlockState); - else - _result = player.localCanHarvestBlock(paramIBlockState); - - if(afterCanHarvestBlockHooks != null) - for(int i = 0; i < afterCanHarvestBlockHooks.length; i++) - afterCanHarvestBlockHooks[i].afterCanHarvestBlock(paramIBlockState); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenCanHarvestBlock(ServerPlayerBase overWriter) - { - if (overrideCanHarvestBlockHooks == null) - return overWriter; - - for(int i = 0; i < overrideCanHarvestBlockHooks.length; i++) - if(overrideCanHarvestBlockHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideCanHarvestBlockHooks[i - 1]; - - return overWriter; - } - - private final static List beforeCanHarvestBlockHookTypes = new LinkedList(); - private final static List overrideCanHarvestBlockHookTypes = new LinkedList(); - private final static List afterCanHarvestBlockHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeCanHarvestBlockHooks; - private ServerPlayerBase[] overrideCanHarvestBlockHooks; - private ServerPlayerBase[] afterCanHarvestBlockHooks; - - public boolean isCanHarvestBlockModded; - - private static final Map allBaseBeforeCanHarvestBlockSuperiors = new Hashtable(0); - private static final Map allBaseBeforeCanHarvestBlockInferiors = new Hashtable(0); - private static final Map allBaseOverrideCanHarvestBlockSuperiors = new Hashtable(0); - private static final Map allBaseOverrideCanHarvestBlockInferiors = new Hashtable(0); - private static final Map allBaseAfterCanHarvestBlockSuperiors = new Hashtable(0); - private static final Map allBaseAfterCanHarvestBlockInferiors = new Hashtable(0); - - public static boolean canPlayerEdit(IServerPlayerAPI target, net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack) - { - boolean _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isCanPlayerEditModded) - _result = serverPlayerAPI.canPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - else - _result = target.localCanPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - return _result; - } - - private boolean canPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack) - { - if(beforeCanPlayerEditHooks != null) - for(int i = beforeCanPlayerEditHooks.length - 1; i >= 0 ; i--) - beforeCanPlayerEditHooks[i].beforeCanPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - - boolean _result; - if(overrideCanPlayerEditHooks != null) - _result = overrideCanPlayerEditHooks[overrideCanPlayerEditHooks.length - 1].canPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - else - _result = player.localCanPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - - if(afterCanPlayerEditHooks != null) - for(int i = 0; i < afterCanPlayerEditHooks.length; i++) - afterCanPlayerEditHooks[i].afterCanPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenCanPlayerEdit(ServerPlayerBase overWriter) - { - if (overrideCanPlayerEditHooks == null) - return overWriter; - - for(int i = 0; i < overrideCanPlayerEditHooks.length; i++) - if(overrideCanPlayerEditHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideCanPlayerEditHooks[i - 1]; - - return overWriter; - } - - private final static List beforeCanPlayerEditHookTypes = new LinkedList(); - private final static List overrideCanPlayerEditHookTypes = new LinkedList(); - private final static List afterCanPlayerEditHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeCanPlayerEditHooks; - private ServerPlayerBase[] overrideCanPlayerEditHooks; - private ServerPlayerBase[] afterCanPlayerEditHooks; - - public boolean isCanPlayerEditModded; - - private static final Map allBaseBeforeCanPlayerEditSuperiors = new Hashtable(0); - private static final Map allBaseBeforeCanPlayerEditInferiors = new Hashtable(0); - private static final Map allBaseOverrideCanPlayerEditSuperiors = new Hashtable(0); - private static final Map allBaseOverrideCanPlayerEditInferiors = new Hashtable(0); - private static final Map allBaseAfterCanPlayerEditSuperiors = new Hashtable(0); - private static final Map allBaseAfterCanPlayerEditInferiors = new Hashtable(0); - - public static boolean canTriggerWalking(IServerPlayerAPI target) - { - boolean _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isCanTriggerWalkingModded) - _result = serverPlayerAPI.canTriggerWalking(); - else - _result = target.localCanTriggerWalking(); - return _result; - } - - private boolean canTriggerWalking() - { - if(beforeCanTriggerWalkingHooks != null) - for(int i = beforeCanTriggerWalkingHooks.length - 1; i >= 0 ; i--) - beforeCanTriggerWalkingHooks[i].beforeCanTriggerWalking(); - - boolean _result; - if(overrideCanTriggerWalkingHooks != null) - _result = overrideCanTriggerWalkingHooks[overrideCanTriggerWalkingHooks.length - 1].canTriggerWalking(); - else - _result = player.localCanTriggerWalking(); - - if(afterCanTriggerWalkingHooks != null) - for(int i = 0; i < afterCanTriggerWalkingHooks.length; i++) - afterCanTriggerWalkingHooks[i].afterCanTriggerWalking(); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenCanTriggerWalking(ServerPlayerBase overWriter) - { - if (overrideCanTriggerWalkingHooks == null) - return overWriter; - - for(int i = 0; i < overrideCanTriggerWalkingHooks.length; i++) - if(overrideCanTriggerWalkingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideCanTriggerWalkingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeCanTriggerWalkingHookTypes = new LinkedList(); - private final static List overrideCanTriggerWalkingHookTypes = new LinkedList(); - private final static List afterCanTriggerWalkingHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeCanTriggerWalkingHooks; - private ServerPlayerBase[] overrideCanTriggerWalkingHooks; - private ServerPlayerBase[] afterCanTriggerWalkingHooks; - - public boolean isCanTriggerWalkingModded; - - private static final Map allBaseBeforeCanTriggerWalkingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeCanTriggerWalkingInferiors = new Hashtable(0); - private static final Map allBaseOverrideCanTriggerWalkingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideCanTriggerWalkingInferiors = new Hashtable(0); - private static final Map allBaseAfterCanTriggerWalkingSuperiors = new Hashtable(0); - private static final Map allBaseAfterCanTriggerWalkingInferiors = new Hashtable(0); - - public static void clonePlayer(IServerPlayerAPI target, net.minecraft.entity.player.EntityPlayer paramEntityPlayer, boolean paramBoolean) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isClonePlayerModded) - serverPlayerAPI.clonePlayer(paramEntityPlayer, paramBoolean); - else - target.localClonePlayer(paramEntityPlayer, paramBoolean); - } - - private void clonePlayer(net.minecraft.entity.player.EntityPlayer paramEntityPlayer, boolean paramBoolean) - { - if(beforeClonePlayerHooks != null) - for(int i = beforeClonePlayerHooks.length - 1; i >= 0 ; i--) - beforeClonePlayerHooks[i].beforeClonePlayer(paramEntityPlayer, paramBoolean); - - if(overrideClonePlayerHooks != null) - overrideClonePlayerHooks[overrideClonePlayerHooks.length - 1].clonePlayer(paramEntityPlayer, paramBoolean); - else - player.localClonePlayer(paramEntityPlayer, paramBoolean); - - if(afterClonePlayerHooks != null) - for(int i = 0; i < afterClonePlayerHooks.length; i++) - afterClonePlayerHooks[i].afterClonePlayer(paramEntityPlayer, paramBoolean); - - } - - protected ServerPlayerBase GetOverwrittenClonePlayer(ServerPlayerBase overWriter) - { - if (overrideClonePlayerHooks == null) - return overWriter; - - for(int i = 0; i < overrideClonePlayerHooks.length; i++) - if(overrideClonePlayerHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideClonePlayerHooks[i - 1]; - - return overWriter; - } - - private final static List beforeClonePlayerHookTypes = new LinkedList(); - private final static List overrideClonePlayerHookTypes = new LinkedList(); - private final static List afterClonePlayerHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeClonePlayerHooks; - private ServerPlayerBase[] overrideClonePlayerHooks; - private ServerPlayerBase[] afterClonePlayerHooks; - - public boolean isClonePlayerModded; - - private static final Map allBaseBeforeClonePlayerSuperiors = new Hashtable(0); - private static final Map allBaseBeforeClonePlayerInferiors = new Hashtable(0); - private static final Map allBaseOverrideClonePlayerSuperiors = new Hashtable(0); - private static final Map allBaseOverrideClonePlayerInferiors = new Hashtable(0); - private static final Map allBaseAfterClonePlayerSuperiors = new Hashtable(0); - private static final Map allBaseAfterClonePlayerInferiors = new Hashtable(0); - - public static void damageEntity(IServerPlayerAPI target, net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isDamageEntityModded) - serverPlayerAPI.damageEntity(paramDamageSource, paramFloat); - else - target.localDamageEntity(paramDamageSource, paramFloat); - } - - private void damageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - if(beforeDamageEntityHooks != null) - for(int i = beforeDamageEntityHooks.length - 1; i >= 0 ; i--) - beforeDamageEntityHooks[i].beforeDamageEntity(paramDamageSource, paramFloat); - - if(overrideDamageEntityHooks != null) - overrideDamageEntityHooks[overrideDamageEntityHooks.length - 1].damageEntity(paramDamageSource, paramFloat); - else - player.localDamageEntity(paramDamageSource, paramFloat); - - if(afterDamageEntityHooks != null) - for(int i = 0; i < afterDamageEntityHooks.length; i++) - afterDamageEntityHooks[i].afterDamageEntity(paramDamageSource, paramFloat); - - } - - protected ServerPlayerBase GetOverwrittenDamageEntity(ServerPlayerBase overWriter) - { - if (overrideDamageEntityHooks == null) - return overWriter; - - for(int i = 0; i < overrideDamageEntityHooks.length; i++) - if(overrideDamageEntityHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideDamageEntityHooks[i - 1]; - - return overWriter; - } - - private final static List beforeDamageEntityHookTypes = new LinkedList(); - private final static List overrideDamageEntityHookTypes = new LinkedList(); - private final static List afterDamageEntityHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeDamageEntityHooks; - private ServerPlayerBase[] overrideDamageEntityHooks; - private ServerPlayerBase[] afterDamageEntityHooks; - - public boolean isDamageEntityModded; - - private static final Map allBaseBeforeDamageEntitySuperiors = new Hashtable(0); - private static final Map allBaseBeforeDamageEntityInferiors = new Hashtable(0); - private static final Map allBaseOverrideDamageEntitySuperiors = new Hashtable(0); - private static final Map allBaseOverrideDamageEntityInferiors = new Hashtable(0); - private static final Map allBaseAfterDamageEntitySuperiors = new Hashtable(0); - private static final Map allBaseAfterDamageEntityInferiors = new Hashtable(0); - - public static void displayGui(IServerPlayerAPI target, net.minecraft.world.IInteractionObject paramIInteractionObject) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isDisplayGuiModded) - serverPlayerAPI.displayGui(paramIInteractionObject); - else - target.localDisplayGui(paramIInteractionObject); - } - - private void displayGui(net.minecraft.world.IInteractionObject paramIInteractionObject) - { - if(beforeDisplayGuiHooks != null) - for(int i = beforeDisplayGuiHooks.length - 1; i >= 0 ; i--) - beforeDisplayGuiHooks[i].beforeDisplayGui(paramIInteractionObject); - - if(overrideDisplayGuiHooks != null) - overrideDisplayGuiHooks[overrideDisplayGuiHooks.length - 1].displayGui(paramIInteractionObject); - else - player.localDisplayGui(paramIInteractionObject); - - if(afterDisplayGuiHooks != null) - for(int i = 0; i < afterDisplayGuiHooks.length; i++) - afterDisplayGuiHooks[i].afterDisplayGui(paramIInteractionObject); - - } - - protected ServerPlayerBase GetOverwrittenDisplayGui(ServerPlayerBase overWriter) - { - if (overrideDisplayGuiHooks == null) - return overWriter; - - for(int i = 0; i < overrideDisplayGuiHooks.length; i++) - if(overrideDisplayGuiHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideDisplayGuiHooks[i - 1]; - - return overWriter; - } - - private final static List beforeDisplayGuiHookTypes = new LinkedList(); - private final static List overrideDisplayGuiHookTypes = new LinkedList(); - private final static List afterDisplayGuiHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeDisplayGuiHooks; - private ServerPlayerBase[] overrideDisplayGuiHooks; - private ServerPlayerBase[] afterDisplayGuiHooks; - - public boolean isDisplayGuiModded; - - private static final Map allBaseBeforeDisplayGuiSuperiors = new Hashtable(0); - private static final Map allBaseBeforeDisplayGuiInferiors = new Hashtable(0); - private static final Map allBaseOverrideDisplayGuiSuperiors = new Hashtable(0); - private static final Map allBaseOverrideDisplayGuiInferiors = new Hashtable(0); - private static final Map allBaseAfterDisplayGuiSuperiors = new Hashtable(0); - private static final Map allBaseAfterDisplayGuiInferiors = new Hashtable(0); - - public static void displayGUIChest(IServerPlayerAPI target, net.minecraft.inventory.IInventory paramIInventory) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isDisplayGUIChestModded) - serverPlayerAPI.displayGUIChest(paramIInventory); - else - target.localDisplayGUIChest(paramIInventory); - } - - private void displayGUIChest(net.minecraft.inventory.IInventory paramIInventory) - { - if(beforeDisplayGUIChestHooks != null) - for(int i = beforeDisplayGUIChestHooks.length - 1; i >= 0 ; i--) - beforeDisplayGUIChestHooks[i].beforeDisplayGUIChest(paramIInventory); - - if(overrideDisplayGUIChestHooks != null) - overrideDisplayGUIChestHooks[overrideDisplayGUIChestHooks.length - 1].displayGUIChest(paramIInventory); - else - player.localDisplayGUIChest(paramIInventory); - - if(afterDisplayGUIChestHooks != null) - for(int i = 0; i < afterDisplayGUIChestHooks.length; i++) - afterDisplayGUIChestHooks[i].afterDisplayGUIChest(paramIInventory); - - } - - protected ServerPlayerBase GetOverwrittenDisplayGUIChest(ServerPlayerBase overWriter) - { - if (overrideDisplayGUIChestHooks == null) - return overWriter; - - for(int i = 0; i < overrideDisplayGUIChestHooks.length; i++) - if(overrideDisplayGUIChestHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideDisplayGUIChestHooks[i - 1]; - - return overWriter; - } - - private final static List beforeDisplayGUIChestHookTypes = new LinkedList(); - private final static List overrideDisplayGUIChestHookTypes = new LinkedList(); - private final static List afterDisplayGUIChestHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeDisplayGUIChestHooks; - private ServerPlayerBase[] overrideDisplayGUIChestHooks; - private ServerPlayerBase[] afterDisplayGUIChestHooks; - - public boolean isDisplayGUIChestModded; - - private static final Map allBaseBeforeDisplayGUIChestSuperiors = new Hashtable(0); - private static final Map allBaseBeforeDisplayGUIChestInferiors = new Hashtable(0); - private static final Map allBaseOverrideDisplayGUIChestSuperiors = new Hashtable(0); - private static final Map allBaseOverrideDisplayGUIChestInferiors = new Hashtable(0); - private static final Map allBaseAfterDisplayGUIChestSuperiors = new Hashtable(0); - private static final Map allBaseAfterDisplayGUIChestInferiors = new Hashtable(0); - - public static net.minecraft.entity.item.EntityItem dropOneItem(IServerPlayerAPI target, boolean paramBoolean) - { - net.minecraft.entity.item.EntityItem _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isDropOneItemModded) - _result = serverPlayerAPI.dropOneItem(paramBoolean); - else - _result = target.localDropOneItem(paramBoolean); - return _result; - } - - private net.minecraft.entity.item.EntityItem dropOneItem(boolean paramBoolean) - { - if(beforeDropOneItemHooks != null) - for(int i = beforeDropOneItemHooks.length - 1; i >= 0 ; i--) - beforeDropOneItemHooks[i].beforeDropOneItem(paramBoolean); - - net.minecraft.entity.item.EntityItem _result; - if(overrideDropOneItemHooks != null) - _result = overrideDropOneItemHooks[overrideDropOneItemHooks.length - 1].dropOneItem(paramBoolean); - else - _result = player.localDropOneItem(paramBoolean); - - if(afterDropOneItemHooks != null) - for(int i = 0; i < afterDropOneItemHooks.length; i++) - afterDropOneItemHooks[i].afterDropOneItem(paramBoolean); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenDropOneItem(ServerPlayerBase overWriter) - { - if (overrideDropOneItemHooks == null) - return overWriter; - - for(int i = 0; i < overrideDropOneItemHooks.length; i++) - if(overrideDropOneItemHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideDropOneItemHooks[i - 1]; - - return overWriter; - } - - private final static List beforeDropOneItemHookTypes = new LinkedList(); - private final static List overrideDropOneItemHookTypes = new LinkedList(); - private final static List afterDropOneItemHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeDropOneItemHooks; - private ServerPlayerBase[] overrideDropOneItemHooks; - private ServerPlayerBase[] afterDropOneItemHooks; - - public boolean isDropOneItemModded; - - private static final Map allBaseBeforeDropOneItemSuperiors = new Hashtable(0); - private static final Map allBaseBeforeDropOneItemInferiors = new Hashtable(0); - private static final Map allBaseOverrideDropOneItemSuperiors = new Hashtable(0); - private static final Map allBaseOverrideDropOneItemInferiors = new Hashtable(0); - private static final Map allBaseAfterDropOneItemSuperiors = new Hashtable(0); - private static final Map allBaseAfterDropOneItemInferiors = new Hashtable(0); - - public static net.minecraft.entity.item.EntityItem dropPlayerItemWithRandomChoice(IServerPlayerAPI target, net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean) - { - net.minecraft.entity.item.EntityItem _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isDropPlayerItemWithRandomChoiceModded) - _result = serverPlayerAPI.dropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - else - _result = target.localDropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - return _result; - } - - private net.minecraft.entity.item.EntityItem dropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean) - { - if(beforeDropPlayerItemWithRandomChoiceHooks != null) - for(int i = beforeDropPlayerItemWithRandomChoiceHooks.length - 1; i >= 0 ; i--) - beforeDropPlayerItemWithRandomChoiceHooks[i].beforeDropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - - net.minecraft.entity.item.EntityItem _result; - if(overrideDropPlayerItemWithRandomChoiceHooks != null) - _result = overrideDropPlayerItemWithRandomChoiceHooks[overrideDropPlayerItemWithRandomChoiceHooks.length - 1].dropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - else - _result = player.localDropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - - if(afterDropPlayerItemWithRandomChoiceHooks != null) - for(int i = 0; i < afterDropPlayerItemWithRandomChoiceHooks.length; i++) - afterDropPlayerItemWithRandomChoiceHooks[i].afterDropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenDropPlayerItemWithRandomChoice(ServerPlayerBase overWriter) - { - if (overrideDropPlayerItemWithRandomChoiceHooks == null) - return overWriter; - - for(int i = 0; i < overrideDropPlayerItemWithRandomChoiceHooks.length; i++) - if(overrideDropPlayerItemWithRandomChoiceHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideDropPlayerItemWithRandomChoiceHooks[i - 1]; - - return overWriter; - } - - private final static List beforeDropPlayerItemWithRandomChoiceHookTypes = new LinkedList(); - private final static List overrideDropPlayerItemWithRandomChoiceHookTypes = new LinkedList(); - private final static List afterDropPlayerItemWithRandomChoiceHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeDropPlayerItemWithRandomChoiceHooks; - private ServerPlayerBase[] overrideDropPlayerItemWithRandomChoiceHooks; - private ServerPlayerBase[] afterDropPlayerItemWithRandomChoiceHooks; - - public boolean isDropPlayerItemWithRandomChoiceModded; - - private static final Map allBaseBeforeDropPlayerItemWithRandomChoiceSuperiors = new Hashtable(0); - private static final Map allBaseBeforeDropPlayerItemWithRandomChoiceInferiors = new Hashtable(0); - private static final Map allBaseOverrideDropPlayerItemWithRandomChoiceSuperiors = new Hashtable(0); - private static final Map allBaseOverrideDropPlayerItemWithRandomChoiceInferiors = new Hashtable(0); - private static final Map allBaseAfterDropPlayerItemWithRandomChoiceSuperiors = new Hashtable(0); - private static final Map allBaseAfterDropPlayerItemWithRandomChoiceInferiors = new Hashtable(0); - - public static void fall(IServerPlayerAPI target, float paramFloat1, float paramFloat2) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isFallModded) - serverPlayerAPI.fall(paramFloat1, paramFloat2); - else - target.localFall(paramFloat1, paramFloat2); - } - - private void fall(float paramFloat1, float paramFloat2) - { - if(beforeFallHooks != null) - for(int i = beforeFallHooks.length - 1; i >= 0 ; i--) - beforeFallHooks[i].beforeFall(paramFloat1, paramFloat2); - - if(overrideFallHooks != null) - overrideFallHooks[overrideFallHooks.length - 1].fall(paramFloat1, paramFloat2); - else - player.localFall(paramFloat1, paramFloat2); - - if(afterFallHooks != null) - for(int i = 0; i < afterFallHooks.length; i++) - afterFallHooks[i].afterFall(paramFloat1, paramFloat2); - - } - - protected ServerPlayerBase GetOverwrittenFall(ServerPlayerBase overWriter) - { - if (overrideFallHooks == null) - return overWriter; - - for(int i = 0; i < overrideFallHooks.length; i++) - if(overrideFallHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideFallHooks[i - 1]; - - return overWriter; - } - - private final static List beforeFallHookTypes = new LinkedList(); - private final static List overrideFallHookTypes = new LinkedList(); - private final static List afterFallHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeFallHooks; - private ServerPlayerBase[] overrideFallHooks; - private ServerPlayerBase[] afterFallHooks; - - public boolean isFallModded; - - private static final Map allBaseBeforeFallSuperiors = new Hashtable(0); - private static final Map allBaseBeforeFallInferiors = new Hashtable(0); - private static final Map allBaseOverrideFallSuperiors = new Hashtable(0); - private static final Map allBaseOverrideFallInferiors = new Hashtable(0); - private static final Map allBaseAfterFallSuperiors = new Hashtable(0); - private static final Map allBaseAfterFallInferiors = new Hashtable(0); - - public static float getAIMoveSpeed(IServerPlayerAPI target) - { - float _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isGetAIMoveSpeedModded) - _result = serverPlayerAPI.getAIMoveSpeed(); - else - _result = target.localGetAIMoveSpeed(); - return _result; - } - - private float getAIMoveSpeed() - { - if(beforeGetAIMoveSpeedHooks != null) - for(int i = beforeGetAIMoveSpeedHooks.length - 1; i >= 0 ; i--) - beforeGetAIMoveSpeedHooks[i].beforeGetAIMoveSpeed(); - - float _result; - if(overrideGetAIMoveSpeedHooks != null) - _result = overrideGetAIMoveSpeedHooks[overrideGetAIMoveSpeedHooks.length - 1].getAIMoveSpeed(); - else - _result = player.localGetAIMoveSpeed(); - - if(afterGetAIMoveSpeedHooks != null) - for(int i = 0; i < afterGetAIMoveSpeedHooks.length; i++) - afterGetAIMoveSpeedHooks[i].afterGetAIMoveSpeed(); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenGetAIMoveSpeed(ServerPlayerBase overWriter) - { - if (overrideGetAIMoveSpeedHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetAIMoveSpeedHooks.length; i++) - if(overrideGetAIMoveSpeedHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetAIMoveSpeedHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetAIMoveSpeedHookTypes = new LinkedList(); - private final static List overrideGetAIMoveSpeedHookTypes = new LinkedList(); - private final static List afterGetAIMoveSpeedHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeGetAIMoveSpeedHooks; - private ServerPlayerBase[] overrideGetAIMoveSpeedHooks; - private ServerPlayerBase[] afterGetAIMoveSpeedHooks; - - public boolean isGetAIMoveSpeedModded; - - private static final Map allBaseBeforeGetAIMoveSpeedSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetAIMoveSpeedInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetAIMoveSpeedSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetAIMoveSpeedInferiors = new Hashtable(0); - private static final Map allBaseAfterGetAIMoveSpeedSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetAIMoveSpeedInferiors = new Hashtable(0); - - public static float getBreakSpeed(IServerPlayerAPI target, net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos) - { - float _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isGetBreakSpeedModded) - _result = serverPlayerAPI.getBreakSpeed(paramIBlockState, paramBlockPos); - else - _result = target.localGetBreakSpeed(paramIBlockState, paramBlockPos); - return _result; - } - - private float getBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos) - { - if(beforeGetBreakSpeedHooks != null) - for(int i = beforeGetBreakSpeedHooks.length - 1; i >= 0 ; i--) - beforeGetBreakSpeedHooks[i].beforeGetBreakSpeed(paramIBlockState, paramBlockPos); - - float _result; - if(overrideGetBreakSpeedHooks != null) - _result = overrideGetBreakSpeedHooks[overrideGetBreakSpeedHooks.length - 1].getBreakSpeed(paramIBlockState, paramBlockPos); - else - _result = player.localGetBreakSpeed(paramIBlockState, paramBlockPos); - - if(afterGetBreakSpeedHooks != null) - for(int i = 0; i < afterGetBreakSpeedHooks.length; i++) - afterGetBreakSpeedHooks[i].afterGetBreakSpeed(paramIBlockState, paramBlockPos); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenGetBreakSpeed(ServerPlayerBase overWriter) - { - if (overrideGetBreakSpeedHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetBreakSpeedHooks.length; i++) - if(overrideGetBreakSpeedHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetBreakSpeedHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetBreakSpeedHookTypes = new LinkedList(); - private final static List overrideGetBreakSpeedHookTypes = new LinkedList(); - private final static List afterGetBreakSpeedHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeGetBreakSpeedHooks; - private ServerPlayerBase[] overrideGetBreakSpeedHooks; - private ServerPlayerBase[] afterGetBreakSpeedHooks; - - public boolean isGetBreakSpeedModded; - - private static final Map allBaseBeforeGetBreakSpeedSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetBreakSpeedInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetBreakSpeedSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetBreakSpeedInferiors = new Hashtable(0); - private static final Map allBaseAfterGetBreakSpeedSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetBreakSpeedInferiors = new Hashtable(0); - - public static double getDistanceSq(IServerPlayerAPI target, double paramDouble1, double paramDouble2, double paramDouble3) - { - double _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isGetDistanceSqModded) - _result = serverPlayerAPI.getDistanceSq(paramDouble1, paramDouble2, paramDouble3); - else - _result = target.localGetDistanceSq(paramDouble1, paramDouble2, paramDouble3); - return _result; - } - - private double getDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3) - { - if(beforeGetDistanceSqHooks != null) - for(int i = beforeGetDistanceSqHooks.length - 1; i >= 0 ; i--) - beforeGetDistanceSqHooks[i].beforeGetDistanceSq(paramDouble1, paramDouble2, paramDouble3); - - double _result; - if(overrideGetDistanceSqHooks != null) - _result = overrideGetDistanceSqHooks[overrideGetDistanceSqHooks.length - 1].getDistanceSq(paramDouble1, paramDouble2, paramDouble3); - else - _result = player.localGetDistanceSq(paramDouble1, paramDouble2, paramDouble3); - - if(afterGetDistanceSqHooks != null) - for(int i = 0; i < afterGetDistanceSqHooks.length; i++) - afterGetDistanceSqHooks[i].afterGetDistanceSq(paramDouble1, paramDouble2, paramDouble3); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenGetDistanceSq(ServerPlayerBase overWriter) - { - if (overrideGetDistanceSqHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetDistanceSqHooks.length; i++) - if(overrideGetDistanceSqHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetDistanceSqHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetDistanceSqHookTypes = new LinkedList(); - private final static List overrideGetDistanceSqHookTypes = new LinkedList(); - private final static List afterGetDistanceSqHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeGetDistanceSqHooks; - private ServerPlayerBase[] overrideGetDistanceSqHooks; - private ServerPlayerBase[] afterGetDistanceSqHooks; - - public boolean isGetDistanceSqModded; - - private static final Map allBaseBeforeGetDistanceSqSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetDistanceSqInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetDistanceSqSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetDistanceSqInferiors = new Hashtable(0); - private static final Map allBaseAfterGetDistanceSqSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetDistanceSqInferiors = new Hashtable(0); - - public static float getBrightness(IServerPlayerAPI target, float paramFloat) - { - float _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isGetBrightnessModded) - _result = serverPlayerAPI.getBrightness(paramFloat); - else - _result = target.localGetBrightness(paramFloat); - return _result; - } - - private float getBrightness(float paramFloat) - { - if(beforeGetBrightnessHooks != null) - for(int i = beforeGetBrightnessHooks.length - 1; i >= 0 ; i--) - beforeGetBrightnessHooks[i].beforeGetBrightness(paramFloat); - - float _result; - if(overrideGetBrightnessHooks != null) - _result = overrideGetBrightnessHooks[overrideGetBrightnessHooks.length - 1].getBrightness(paramFloat); - else - _result = player.localGetBrightness(paramFloat); - - if(afterGetBrightnessHooks != null) - for(int i = 0; i < afterGetBrightnessHooks.length; i++) - afterGetBrightnessHooks[i].afterGetBrightness(paramFloat); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenGetBrightness(ServerPlayerBase overWriter) - { - if (overrideGetBrightnessHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetBrightnessHooks.length; i++) - if(overrideGetBrightnessHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetBrightnessHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetBrightnessHookTypes = new LinkedList(); - private final static List overrideGetBrightnessHookTypes = new LinkedList(); - private final static List afterGetBrightnessHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeGetBrightnessHooks; - private ServerPlayerBase[] overrideGetBrightnessHooks; - private ServerPlayerBase[] afterGetBrightnessHooks; - - public boolean isGetBrightnessModded; - - private static final Map allBaseBeforeGetBrightnessSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetBrightnessInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetBrightnessSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetBrightnessInferiors = new Hashtable(0); - private static final Map allBaseAfterGetBrightnessSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetBrightnessInferiors = new Hashtable(0); - - public static float getEyeHeight(IServerPlayerAPI target) - { - float _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isGetEyeHeightModded) - _result = serverPlayerAPI.getEyeHeight(); - else - _result = target.localGetEyeHeight(); - return _result; - } - - private float getEyeHeight() - { - if(beforeGetEyeHeightHooks != null) - for(int i = beforeGetEyeHeightHooks.length - 1; i >= 0 ; i--) - beforeGetEyeHeightHooks[i].beforeGetEyeHeight(); - - float _result; - if(overrideGetEyeHeightHooks != null) - _result = overrideGetEyeHeightHooks[overrideGetEyeHeightHooks.length - 1].getEyeHeight(); - else - _result = player.localGetEyeHeight(); - - if(afterGetEyeHeightHooks != null) - for(int i = 0; i < afterGetEyeHeightHooks.length; i++) - afterGetEyeHeightHooks[i].afterGetEyeHeight(); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenGetEyeHeight(ServerPlayerBase overWriter) - { - if (overrideGetEyeHeightHooks == null) - return overWriter; - - for(int i = 0; i < overrideGetEyeHeightHooks.length; i++) - if(overrideGetEyeHeightHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideGetEyeHeightHooks[i - 1]; - - return overWriter; - } - - private final static List beforeGetEyeHeightHookTypes = new LinkedList(); - private final static List overrideGetEyeHeightHookTypes = new LinkedList(); - private final static List afterGetEyeHeightHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeGetEyeHeightHooks; - private ServerPlayerBase[] overrideGetEyeHeightHooks; - private ServerPlayerBase[] afterGetEyeHeightHooks; - - public boolean isGetEyeHeightModded; - - private static final Map allBaseBeforeGetEyeHeightSuperiors = new Hashtable(0); - private static final Map allBaseBeforeGetEyeHeightInferiors = new Hashtable(0); - private static final Map allBaseOverrideGetEyeHeightSuperiors = new Hashtable(0); - private static final Map allBaseOverrideGetEyeHeightInferiors = new Hashtable(0); - private static final Map allBaseAfterGetEyeHeightSuperiors = new Hashtable(0); - private static final Map allBaseAfterGetEyeHeightInferiors = new Hashtable(0); - - public static void heal(IServerPlayerAPI target, float paramFloat) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isHealModded) - serverPlayerAPI.heal(paramFloat); - else - target.localHeal(paramFloat); - } - - private void heal(float paramFloat) - { - if(beforeHealHooks != null) - for(int i = beforeHealHooks.length - 1; i >= 0 ; i--) - beforeHealHooks[i].beforeHeal(paramFloat); - - if(overrideHealHooks != null) - overrideHealHooks[overrideHealHooks.length - 1].heal(paramFloat); - else - player.localHeal(paramFloat); - - if(afterHealHooks != null) - for(int i = 0; i < afterHealHooks.length; i++) - afterHealHooks[i].afterHeal(paramFloat); - - } - - protected ServerPlayerBase GetOverwrittenHeal(ServerPlayerBase overWriter) - { - if (overrideHealHooks == null) - return overWriter; - - for(int i = 0; i < overrideHealHooks.length; i++) - if(overrideHealHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideHealHooks[i - 1]; - - return overWriter; - } - - private final static List beforeHealHookTypes = new LinkedList(); - private final static List overrideHealHookTypes = new LinkedList(); - private final static List afterHealHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeHealHooks; - private ServerPlayerBase[] overrideHealHooks; - private ServerPlayerBase[] afterHealHooks; - - public boolean isHealModded; - - private static final Map allBaseBeforeHealSuperiors = new Hashtable(0); - private static final Map allBaseBeforeHealInferiors = new Hashtable(0); - private static final Map allBaseOverrideHealSuperiors = new Hashtable(0); - private static final Map allBaseOverrideHealInferiors = new Hashtable(0); - private static final Map allBaseAfterHealSuperiors = new Hashtable(0); - private static final Map allBaseAfterHealInferiors = new Hashtable(0); - - public static boolean isEntityInsideOpaqueBlock(IServerPlayerAPI target) - { - boolean _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isIsEntityInsideOpaqueBlockModded) - _result = serverPlayerAPI.isEntityInsideOpaqueBlock(); - else - _result = target.localIsEntityInsideOpaqueBlock(); - return _result; - } - - private boolean isEntityInsideOpaqueBlock() - { - if(beforeIsEntityInsideOpaqueBlockHooks != null) - for(int i = beforeIsEntityInsideOpaqueBlockHooks.length - 1; i >= 0 ; i--) - beforeIsEntityInsideOpaqueBlockHooks[i].beforeIsEntityInsideOpaqueBlock(); - - boolean _result; - if(overrideIsEntityInsideOpaqueBlockHooks != null) - _result = overrideIsEntityInsideOpaqueBlockHooks[overrideIsEntityInsideOpaqueBlockHooks.length - 1].isEntityInsideOpaqueBlock(); - else - _result = player.localIsEntityInsideOpaqueBlock(); - - if(afterIsEntityInsideOpaqueBlockHooks != null) - for(int i = 0; i < afterIsEntityInsideOpaqueBlockHooks.length; i++) - afterIsEntityInsideOpaqueBlockHooks[i].afterIsEntityInsideOpaqueBlock(); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenIsEntityInsideOpaqueBlock(ServerPlayerBase overWriter) - { - if (overrideIsEntityInsideOpaqueBlockHooks == null) - return overWriter; - - for(int i = 0; i < overrideIsEntityInsideOpaqueBlockHooks.length; i++) - if(overrideIsEntityInsideOpaqueBlockHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideIsEntityInsideOpaqueBlockHooks[i - 1]; - - return overWriter; - } - - private final static List beforeIsEntityInsideOpaqueBlockHookTypes = new LinkedList(); - private final static List overrideIsEntityInsideOpaqueBlockHookTypes = new LinkedList(); - private final static List afterIsEntityInsideOpaqueBlockHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeIsEntityInsideOpaqueBlockHooks; - private ServerPlayerBase[] overrideIsEntityInsideOpaqueBlockHooks; - private ServerPlayerBase[] afterIsEntityInsideOpaqueBlockHooks; - - public boolean isIsEntityInsideOpaqueBlockModded; - - private static final Map allBaseBeforeIsEntityInsideOpaqueBlockSuperiors = new Hashtable(0); - private static final Map allBaseBeforeIsEntityInsideOpaqueBlockInferiors = new Hashtable(0); - private static final Map allBaseOverrideIsEntityInsideOpaqueBlockSuperiors = new Hashtable(0); - private static final Map allBaseOverrideIsEntityInsideOpaqueBlockInferiors = new Hashtable(0); - private static final Map allBaseAfterIsEntityInsideOpaqueBlockSuperiors = new Hashtable(0); - private static final Map allBaseAfterIsEntityInsideOpaqueBlockInferiors = new Hashtable(0); - - public static boolean isInWater(IServerPlayerAPI target) - { - boolean _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isIsInWaterModded) - _result = serverPlayerAPI.isInWater(); - else - _result = target.localIsInWater(); - return _result; - } - - private boolean isInWater() - { - if(beforeIsInWaterHooks != null) - for(int i = beforeIsInWaterHooks.length - 1; i >= 0 ; i--) - beforeIsInWaterHooks[i].beforeIsInWater(); - - boolean _result; - if(overrideIsInWaterHooks != null) - _result = overrideIsInWaterHooks[overrideIsInWaterHooks.length - 1].isInWater(); - else - _result = player.localIsInWater(); - - if(afterIsInWaterHooks != null) - for(int i = 0; i < afterIsInWaterHooks.length; i++) - afterIsInWaterHooks[i].afterIsInWater(); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenIsInWater(ServerPlayerBase overWriter) - { - if (overrideIsInWaterHooks == null) - return overWriter; - - for(int i = 0; i < overrideIsInWaterHooks.length; i++) - if(overrideIsInWaterHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideIsInWaterHooks[i - 1]; - - return overWriter; - } - - private final static List beforeIsInWaterHookTypes = new LinkedList(); - private final static List overrideIsInWaterHookTypes = new LinkedList(); - private final static List afterIsInWaterHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeIsInWaterHooks; - private ServerPlayerBase[] overrideIsInWaterHooks; - private ServerPlayerBase[] afterIsInWaterHooks; - - public boolean isIsInWaterModded; - - private static final Map allBaseBeforeIsInWaterSuperiors = new Hashtable(0); - private static final Map allBaseBeforeIsInWaterInferiors = new Hashtable(0); - private static final Map allBaseOverrideIsInWaterSuperiors = new Hashtable(0); - private static final Map allBaseOverrideIsInWaterInferiors = new Hashtable(0); - private static final Map allBaseAfterIsInWaterSuperiors = new Hashtable(0); - private static final Map allBaseAfterIsInWaterInferiors = new Hashtable(0); - - public static boolean isInsideOfMaterial(IServerPlayerAPI target, net.minecraft.block.material.Material paramMaterial) - { - boolean _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isIsInsideOfMaterialModded) - _result = serverPlayerAPI.isInsideOfMaterial(paramMaterial); - else - _result = target.localIsInsideOfMaterial(paramMaterial); - return _result; - } - - private boolean isInsideOfMaterial(net.minecraft.block.material.Material paramMaterial) - { - if(beforeIsInsideOfMaterialHooks != null) - for(int i = beforeIsInsideOfMaterialHooks.length - 1; i >= 0 ; i--) - beforeIsInsideOfMaterialHooks[i].beforeIsInsideOfMaterial(paramMaterial); - - boolean _result; - if(overrideIsInsideOfMaterialHooks != null) - _result = overrideIsInsideOfMaterialHooks[overrideIsInsideOfMaterialHooks.length - 1].isInsideOfMaterial(paramMaterial); - else - _result = player.localIsInsideOfMaterial(paramMaterial); - - if(afterIsInsideOfMaterialHooks != null) - for(int i = 0; i < afterIsInsideOfMaterialHooks.length; i++) - afterIsInsideOfMaterialHooks[i].afterIsInsideOfMaterial(paramMaterial); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenIsInsideOfMaterial(ServerPlayerBase overWriter) - { - if (overrideIsInsideOfMaterialHooks == null) - return overWriter; - - for(int i = 0; i < overrideIsInsideOfMaterialHooks.length; i++) - if(overrideIsInsideOfMaterialHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideIsInsideOfMaterialHooks[i - 1]; - - return overWriter; - } - - private final static List beforeIsInsideOfMaterialHookTypes = new LinkedList(); - private final static List overrideIsInsideOfMaterialHookTypes = new LinkedList(); - private final static List afterIsInsideOfMaterialHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeIsInsideOfMaterialHooks; - private ServerPlayerBase[] overrideIsInsideOfMaterialHooks; - private ServerPlayerBase[] afterIsInsideOfMaterialHooks; - - public boolean isIsInsideOfMaterialModded; - - private static final Map allBaseBeforeIsInsideOfMaterialSuperiors = new Hashtable(0); - private static final Map allBaseBeforeIsInsideOfMaterialInferiors = new Hashtable(0); - private static final Map allBaseOverrideIsInsideOfMaterialSuperiors = new Hashtable(0); - private static final Map allBaseOverrideIsInsideOfMaterialInferiors = new Hashtable(0); - private static final Map allBaseAfterIsInsideOfMaterialSuperiors = new Hashtable(0); - private static final Map allBaseAfterIsInsideOfMaterialInferiors = new Hashtable(0); - - public static boolean isOnLadder(IServerPlayerAPI target) - { - boolean _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isIsOnLadderModded) - _result = serverPlayerAPI.isOnLadder(); - else - _result = target.localIsOnLadder(); - return _result; - } - - private boolean isOnLadder() - { - if(beforeIsOnLadderHooks != null) - for(int i = beforeIsOnLadderHooks.length - 1; i >= 0 ; i--) - beforeIsOnLadderHooks[i].beforeIsOnLadder(); - - boolean _result; - if(overrideIsOnLadderHooks != null) - _result = overrideIsOnLadderHooks[overrideIsOnLadderHooks.length - 1].isOnLadder(); - else - _result = player.localIsOnLadder(); - - if(afterIsOnLadderHooks != null) - for(int i = 0; i < afterIsOnLadderHooks.length; i++) - afterIsOnLadderHooks[i].afterIsOnLadder(); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenIsOnLadder(ServerPlayerBase overWriter) - { - if (overrideIsOnLadderHooks == null) - return overWriter; - - for(int i = 0; i < overrideIsOnLadderHooks.length; i++) - if(overrideIsOnLadderHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideIsOnLadderHooks[i - 1]; - - return overWriter; - } - - private final static List beforeIsOnLadderHookTypes = new LinkedList(); - private final static List overrideIsOnLadderHookTypes = new LinkedList(); - private final static List afterIsOnLadderHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeIsOnLadderHooks; - private ServerPlayerBase[] overrideIsOnLadderHooks; - private ServerPlayerBase[] afterIsOnLadderHooks; - - public boolean isIsOnLadderModded; - - private static final Map allBaseBeforeIsOnLadderSuperiors = new Hashtable(0); - private static final Map allBaseBeforeIsOnLadderInferiors = new Hashtable(0); - private static final Map allBaseOverrideIsOnLadderSuperiors = new Hashtable(0); - private static final Map allBaseOverrideIsOnLadderInferiors = new Hashtable(0); - private static final Map allBaseAfterIsOnLadderSuperiors = new Hashtable(0); - private static final Map allBaseAfterIsOnLadderInferiors = new Hashtable(0); - - public static boolean isPlayerSleeping(IServerPlayerAPI target) - { - boolean _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isIsPlayerSleepingModded) - _result = serverPlayerAPI.isPlayerSleeping(); - else - _result = target.localIsPlayerSleeping(); - return _result; - } - - private boolean isPlayerSleeping() - { - if(beforeIsPlayerSleepingHooks != null) - for(int i = beforeIsPlayerSleepingHooks.length - 1; i >= 0 ; i--) - beforeIsPlayerSleepingHooks[i].beforeIsPlayerSleeping(); - - boolean _result; - if(overrideIsPlayerSleepingHooks != null) - _result = overrideIsPlayerSleepingHooks[overrideIsPlayerSleepingHooks.length - 1].isPlayerSleeping(); - else - _result = player.localIsPlayerSleeping(); - - if(afterIsPlayerSleepingHooks != null) - for(int i = 0; i < afterIsPlayerSleepingHooks.length; i++) - afterIsPlayerSleepingHooks[i].afterIsPlayerSleeping(); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenIsPlayerSleeping(ServerPlayerBase overWriter) - { - if (overrideIsPlayerSleepingHooks == null) - return overWriter; - - for(int i = 0; i < overrideIsPlayerSleepingHooks.length; i++) - if(overrideIsPlayerSleepingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideIsPlayerSleepingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeIsPlayerSleepingHookTypes = new LinkedList(); - private final static List overrideIsPlayerSleepingHookTypes = new LinkedList(); - private final static List afterIsPlayerSleepingHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeIsPlayerSleepingHooks; - private ServerPlayerBase[] overrideIsPlayerSleepingHooks; - private ServerPlayerBase[] afterIsPlayerSleepingHooks; - - public boolean isIsPlayerSleepingModded; - - private static final Map allBaseBeforeIsPlayerSleepingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeIsPlayerSleepingInferiors = new Hashtable(0); - private static final Map allBaseOverrideIsPlayerSleepingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideIsPlayerSleepingInferiors = new Hashtable(0); - private static final Map allBaseAfterIsPlayerSleepingSuperiors = new Hashtable(0); - private static final Map allBaseAfterIsPlayerSleepingInferiors = new Hashtable(0); - - public static boolean isSneaking(IServerPlayerAPI target) - { - boolean _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isIsSneakingModded) - _result = serverPlayerAPI.isSneaking(); - else - _result = target.localIsSneaking(); - return _result; - } - - private boolean isSneaking() - { - if(beforeIsSneakingHooks != null) - for(int i = beforeIsSneakingHooks.length - 1; i >= 0 ; i--) - beforeIsSneakingHooks[i].beforeIsSneaking(); - - boolean _result; - if(overrideIsSneakingHooks != null) - _result = overrideIsSneakingHooks[overrideIsSneakingHooks.length - 1].isSneaking(); - else - _result = player.localIsSneaking(); - - if(afterIsSneakingHooks != null) - for(int i = 0; i < afterIsSneakingHooks.length; i++) - afterIsSneakingHooks[i].afterIsSneaking(); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenIsSneaking(ServerPlayerBase overWriter) - { - if (overrideIsSneakingHooks == null) - return overWriter; - - for(int i = 0; i < overrideIsSneakingHooks.length; i++) - if(overrideIsSneakingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideIsSneakingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeIsSneakingHookTypes = new LinkedList(); - private final static List overrideIsSneakingHookTypes = new LinkedList(); - private final static List afterIsSneakingHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeIsSneakingHooks; - private ServerPlayerBase[] overrideIsSneakingHooks; - private ServerPlayerBase[] afterIsSneakingHooks; - - public boolean isIsSneakingModded; - - private static final Map allBaseBeforeIsSneakingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeIsSneakingInferiors = new Hashtable(0); - private static final Map allBaseOverrideIsSneakingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideIsSneakingInferiors = new Hashtable(0); - private static final Map allBaseAfterIsSneakingSuperiors = new Hashtable(0); - private static final Map allBaseAfterIsSneakingInferiors = new Hashtable(0); - - public static void jump(IServerPlayerAPI target) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isJumpModded) - serverPlayerAPI.jump(); - else - target.localJump(); - } - - private void jump() - { - if(beforeJumpHooks != null) - for(int i = beforeJumpHooks.length - 1; i >= 0 ; i--) - beforeJumpHooks[i].beforeJump(); - - if(overrideJumpHooks != null) - overrideJumpHooks[overrideJumpHooks.length - 1].jump(); - else - player.localJump(); - - if(afterJumpHooks != null) - for(int i = 0; i < afterJumpHooks.length; i++) - afterJumpHooks[i].afterJump(); - - } - - protected ServerPlayerBase GetOverwrittenJump(ServerPlayerBase overWriter) - { - if (overrideJumpHooks == null) - return overWriter; - - for(int i = 0; i < overrideJumpHooks.length; i++) - if(overrideJumpHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideJumpHooks[i - 1]; - - return overWriter; - } - - private final static List beforeJumpHookTypes = new LinkedList(); - private final static List overrideJumpHookTypes = new LinkedList(); - private final static List afterJumpHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeJumpHooks; - private ServerPlayerBase[] overrideJumpHooks; - private ServerPlayerBase[] afterJumpHooks; - - public boolean isJumpModded; - - private static final Map allBaseBeforeJumpSuperiors = new Hashtable(0); - private static final Map allBaseBeforeJumpInferiors = new Hashtable(0); - private static final Map allBaseOverrideJumpSuperiors = new Hashtable(0); - private static final Map allBaseOverrideJumpInferiors = new Hashtable(0); - private static final Map allBaseAfterJumpSuperiors = new Hashtable(0); - private static final Map allBaseAfterJumpInferiors = new Hashtable(0); - - public static void knockBack(IServerPlayerAPI target, net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isKnockBackModded) - serverPlayerAPI.knockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - else - target.localKnockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - } - - private void knockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2) - { - if(beforeKnockBackHooks != null) - for(int i = beforeKnockBackHooks.length - 1; i >= 0 ; i--) - beforeKnockBackHooks[i].beforeKnockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - - if(overrideKnockBackHooks != null) - overrideKnockBackHooks[overrideKnockBackHooks.length - 1].knockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - else - player.localKnockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - - if(afterKnockBackHooks != null) - for(int i = 0; i < afterKnockBackHooks.length; i++) - afterKnockBackHooks[i].afterKnockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - - } - - protected ServerPlayerBase GetOverwrittenKnockBack(ServerPlayerBase overWriter) - { - if (overrideKnockBackHooks == null) - return overWriter; - - for(int i = 0; i < overrideKnockBackHooks.length; i++) - if(overrideKnockBackHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideKnockBackHooks[i - 1]; - - return overWriter; - } - - private final static List beforeKnockBackHookTypes = new LinkedList(); - private final static List overrideKnockBackHookTypes = new LinkedList(); - private final static List afterKnockBackHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeKnockBackHooks; - private ServerPlayerBase[] overrideKnockBackHooks; - private ServerPlayerBase[] afterKnockBackHooks; - - public boolean isKnockBackModded; - - private static final Map allBaseBeforeKnockBackSuperiors = new Hashtable(0); - private static final Map allBaseBeforeKnockBackInferiors = new Hashtable(0); - private static final Map allBaseOverrideKnockBackSuperiors = new Hashtable(0); - private static final Map allBaseOverrideKnockBackInferiors = new Hashtable(0); - private static final Map allBaseAfterKnockBackSuperiors = new Hashtable(0); - private static final Map allBaseAfterKnockBackInferiors = new Hashtable(0); - - public static boolean mountEntity(IServerPlayerAPI target, net.minecraft.entity.Entity paramEntity, boolean paramBoolean) - { - boolean _result; - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isMountEntityModded) - _result = serverPlayerAPI.mountEntity(paramEntity, paramBoolean); - else - _result = target.localMountEntity(paramEntity, paramBoolean); - return _result; - } - - private boolean mountEntity(net.minecraft.entity.Entity paramEntity, boolean paramBoolean) - { - if(beforeMountEntityHooks != null) - for(int i = beforeMountEntityHooks.length - 1; i >= 0 ; i--) - beforeMountEntityHooks[i].beforeMountEntity(paramEntity, paramBoolean); - - boolean _result; - if(overrideMountEntityHooks != null) - _result = overrideMountEntityHooks[overrideMountEntityHooks.length - 1].mountEntity(paramEntity, paramBoolean); - else - _result = player.localMountEntity(paramEntity, paramBoolean); - - if(afterMountEntityHooks != null) - for(int i = 0; i < afterMountEntityHooks.length; i++) - afterMountEntityHooks[i].afterMountEntity(paramEntity, paramBoolean); - - return _result; - } - - protected ServerPlayerBase GetOverwrittenMountEntity(ServerPlayerBase overWriter) - { - if (overrideMountEntityHooks == null) - return overWriter; - - for(int i = 0; i < overrideMountEntityHooks.length; i++) - if(overrideMountEntityHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideMountEntityHooks[i - 1]; - - return overWriter; - } - - private final static List beforeMountEntityHookTypes = new LinkedList(); - private final static List overrideMountEntityHookTypes = new LinkedList(); - private final static List afterMountEntityHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeMountEntityHooks; - private ServerPlayerBase[] overrideMountEntityHooks; - private ServerPlayerBase[] afterMountEntityHooks; - - public boolean isMountEntityModded; - - private static final Map allBaseBeforeMountEntitySuperiors = new Hashtable(0); - private static final Map allBaseBeforeMountEntityInferiors = new Hashtable(0); - private static final Map allBaseOverrideMountEntitySuperiors = new Hashtable(0); - private static final Map allBaseOverrideMountEntityInferiors = new Hashtable(0); - private static final Map allBaseAfterMountEntitySuperiors = new Hashtable(0); - private static final Map allBaseAfterMountEntityInferiors = new Hashtable(0); - - public static void moveEntity(IServerPlayerAPI target, double paramDouble1, double paramDouble2, double paramDouble3) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isMoveEntityModded) - serverPlayerAPI.moveEntity(paramDouble1, paramDouble2, paramDouble3); - else - target.localMoveEntity(paramDouble1, paramDouble2, paramDouble3); - } - - private void moveEntity(double paramDouble1, double paramDouble2, double paramDouble3) - { - if(beforeMoveEntityHooks != null) - for(int i = beforeMoveEntityHooks.length - 1; i >= 0 ; i--) - beforeMoveEntityHooks[i].beforeMoveEntity(paramDouble1, paramDouble2, paramDouble3); - - if(overrideMoveEntityHooks != null) - overrideMoveEntityHooks[overrideMoveEntityHooks.length - 1].moveEntity(paramDouble1, paramDouble2, paramDouble3); - else - player.localMoveEntity(paramDouble1, paramDouble2, paramDouble3); - - if(afterMoveEntityHooks != null) - for(int i = 0; i < afterMoveEntityHooks.length; i++) - afterMoveEntityHooks[i].afterMoveEntity(paramDouble1, paramDouble2, paramDouble3); - - } - - protected ServerPlayerBase GetOverwrittenMoveEntity(ServerPlayerBase overWriter) - { - if (overrideMoveEntityHooks == null) - return overWriter; - - for(int i = 0; i < overrideMoveEntityHooks.length; i++) - if(overrideMoveEntityHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideMoveEntityHooks[i - 1]; - - return overWriter; - } - - private final static List beforeMoveEntityHookTypes = new LinkedList(); - private final static List overrideMoveEntityHookTypes = new LinkedList(); - private final static List afterMoveEntityHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeMoveEntityHooks; - private ServerPlayerBase[] overrideMoveEntityHooks; - private ServerPlayerBase[] afterMoveEntityHooks; - - public boolean isMoveEntityModded; - - private static final Map allBaseBeforeMoveEntitySuperiors = new Hashtable(0); - private static final Map allBaseBeforeMoveEntityInferiors = new Hashtable(0); - private static final Map allBaseOverrideMoveEntitySuperiors = new Hashtable(0); - private static final Map allBaseOverrideMoveEntityInferiors = new Hashtable(0); - private static final Map allBaseAfterMoveEntitySuperiors = new Hashtable(0); - private static final Map allBaseAfterMoveEntityInferiors = new Hashtable(0); - - public static void moveEntityWithHeading(IServerPlayerAPI target, float paramFloat1, float paramFloat2) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isMoveEntityWithHeadingModded) - serverPlayerAPI.moveEntityWithHeading(paramFloat1, paramFloat2); - else - target.localMoveEntityWithHeading(paramFloat1, paramFloat2); - } - - private void moveEntityWithHeading(float paramFloat1, float paramFloat2) - { - if(beforeMoveEntityWithHeadingHooks != null) - for(int i = beforeMoveEntityWithHeadingHooks.length - 1; i >= 0 ; i--) - beforeMoveEntityWithHeadingHooks[i].beforeMoveEntityWithHeading(paramFloat1, paramFloat2); - - if(overrideMoveEntityWithHeadingHooks != null) - overrideMoveEntityWithHeadingHooks[overrideMoveEntityWithHeadingHooks.length - 1].moveEntityWithHeading(paramFloat1, paramFloat2); - else - player.localMoveEntityWithHeading(paramFloat1, paramFloat2); - - if(afterMoveEntityWithHeadingHooks != null) - for(int i = 0; i < afterMoveEntityWithHeadingHooks.length; i++) - afterMoveEntityWithHeadingHooks[i].afterMoveEntityWithHeading(paramFloat1, paramFloat2); - - } - - protected ServerPlayerBase GetOverwrittenMoveEntityWithHeading(ServerPlayerBase overWriter) - { - if (overrideMoveEntityWithHeadingHooks == null) - return overWriter; - - for(int i = 0; i < overrideMoveEntityWithHeadingHooks.length; i++) - if(overrideMoveEntityWithHeadingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideMoveEntityWithHeadingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeMoveEntityWithHeadingHookTypes = new LinkedList(); - private final static List overrideMoveEntityWithHeadingHookTypes = new LinkedList(); - private final static List afterMoveEntityWithHeadingHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeMoveEntityWithHeadingHooks; - private ServerPlayerBase[] overrideMoveEntityWithHeadingHooks; - private ServerPlayerBase[] afterMoveEntityWithHeadingHooks; - - public boolean isMoveEntityWithHeadingModded; - - private static final Map allBaseBeforeMoveEntityWithHeadingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeMoveEntityWithHeadingInferiors = new Hashtable(0); - private static final Map allBaseOverrideMoveEntityWithHeadingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideMoveEntityWithHeadingInferiors = new Hashtable(0); - private static final Map allBaseAfterMoveEntityWithHeadingSuperiors = new Hashtable(0); - private static final Map allBaseAfterMoveEntityWithHeadingInferiors = new Hashtable(0); - - public static void moveFlying(IServerPlayerAPI target, float paramFloat1, float paramFloat2, float paramFloat3) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isMoveFlyingModded) - serverPlayerAPI.moveFlying(paramFloat1, paramFloat2, paramFloat3); - else - target.localMoveFlying(paramFloat1, paramFloat2, paramFloat3); - } - - private void moveFlying(float paramFloat1, float paramFloat2, float paramFloat3) - { - if(beforeMoveFlyingHooks != null) - for(int i = beforeMoveFlyingHooks.length - 1; i >= 0 ; i--) - beforeMoveFlyingHooks[i].beforeMoveFlying(paramFloat1, paramFloat2, paramFloat3); - - if(overrideMoveFlyingHooks != null) - overrideMoveFlyingHooks[overrideMoveFlyingHooks.length - 1].moveFlying(paramFloat1, paramFloat2, paramFloat3); - else - player.localMoveFlying(paramFloat1, paramFloat2, paramFloat3); - - if(afterMoveFlyingHooks != null) - for(int i = 0; i < afterMoveFlyingHooks.length; i++) - afterMoveFlyingHooks[i].afterMoveFlying(paramFloat1, paramFloat2, paramFloat3); - - } - - protected ServerPlayerBase GetOverwrittenMoveFlying(ServerPlayerBase overWriter) - { - if (overrideMoveFlyingHooks == null) - return overWriter; - - for(int i = 0; i < overrideMoveFlyingHooks.length; i++) - if(overrideMoveFlyingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideMoveFlyingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeMoveFlyingHookTypes = new LinkedList(); - private final static List overrideMoveFlyingHookTypes = new LinkedList(); - private final static List afterMoveFlyingHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeMoveFlyingHooks; - private ServerPlayerBase[] overrideMoveFlyingHooks; - private ServerPlayerBase[] afterMoveFlyingHooks; - - public boolean isMoveFlyingModded; - - private static final Map allBaseBeforeMoveFlyingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeMoveFlyingInferiors = new Hashtable(0); - private static final Map allBaseOverrideMoveFlyingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideMoveFlyingInferiors = new Hashtable(0); - private static final Map allBaseAfterMoveFlyingSuperiors = new Hashtable(0); - private static final Map allBaseAfterMoveFlyingInferiors = new Hashtable(0); - - public static void onDeath(IServerPlayerAPI target, net.minecraft.util.DamageSource paramDamageSource) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isOnDeathModded) - serverPlayerAPI.onDeath(paramDamageSource); - else - target.localOnDeath(paramDamageSource); - } - - private void onDeath(net.minecraft.util.DamageSource paramDamageSource) - { - if(beforeOnDeathHooks != null) - for(int i = beforeOnDeathHooks.length - 1; i >= 0 ; i--) - beforeOnDeathHooks[i].beforeOnDeath(paramDamageSource); - - if(overrideOnDeathHooks != null) - overrideOnDeathHooks[overrideOnDeathHooks.length - 1].onDeath(paramDamageSource); - else - player.localOnDeath(paramDamageSource); - - if(afterOnDeathHooks != null) - for(int i = 0; i < afterOnDeathHooks.length; i++) - afterOnDeathHooks[i].afterOnDeath(paramDamageSource); - - } - - protected ServerPlayerBase GetOverwrittenOnDeath(ServerPlayerBase overWriter) - { - if (overrideOnDeathHooks == null) - return overWriter; - - for(int i = 0; i < overrideOnDeathHooks.length; i++) - if(overrideOnDeathHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideOnDeathHooks[i - 1]; - - return overWriter; - } - - private final static List beforeOnDeathHookTypes = new LinkedList(); - private final static List overrideOnDeathHookTypes = new LinkedList(); - private final static List afterOnDeathHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeOnDeathHooks; - private ServerPlayerBase[] overrideOnDeathHooks; - private ServerPlayerBase[] afterOnDeathHooks; - - public boolean isOnDeathModded; - - private static final Map allBaseBeforeOnDeathSuperiors = new Hashtable(0); - private static final Map allBaseBeforeOnDeathInferiors = new Hashtable(0); - private static final Map allBaseOverrideOnDeathSuperiors = new Hashtable(0); - private static final Map allBaseOverrideOnDeathInferiors = new Hashtable(0); - private static final Map allBaseAfterOnDeathSuperiors = new Hashtable(0); - private static final Map allBaseAfterOnDeathInferiors = new Hashtable(0); - - public static void onLivingUpdate(IServerPlayerAPI target) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isOnLivingUpdateModded) - serverPlayerAPI.onLivingUpdate(); - else - target.localOnLivingUpdate(); - } - - private void onLivingUpdate() - { - if(beforeOnLivingUpdateHooks != null) - for(int i = beforeOnLivingUpdateHooks.length - 1; i >= 0 ; i--) - beforeOnLivingUpdateHooks[i].beforeOnLivingUpdate(); - - if(overrideOnLivingUpdateHooks != null) - overrideOnLivingUpdateHooks[overrideOnLivingUpdateHooks.length - 1].onLivingUpdate(); - else - player.localOnLivingUpdate(); - - if(afterOnLivingUpdateHooks != null) - for(int i = 0; i < afterOnLivingUpdateHooks.length; i++) - afterOnLivingUpdateHooks[i].afterOnLivingUpdate(); - - } - - protected ServerPlayerBase GetOverwrittenOnLivingUpdate(ServerPlayerBase overWriter) - { - if (overrideOnLivingUpdateHooks == null) - return overWriter; - - for(int i = 0; i < overrideOnLivingUpdateHooks.length; i++) - if(overrideOnLivingUpdateHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideOnLivingUpdateHooks[i - 1]; - - return overWriter; - } - - private final static List beforeOnLivingUpdateHookTypes = new LinkedList(); - private final static List overrideOnLivingUpdateHookTypes = new LinkedList(); - private final static List afterOnLivingUpdateHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeOnLivingUpdateHooks; - private ServerPlayerBase[] overrideOnLivingUpdateHooks; - private ServerPlayerBase[] afterOnLivingUpdateHooks; - - public boolean isOnLivingUpdateModded; - - private static final Map allBaseBeforeOnLivingUpdateSuperiors = new Hashtable(0); - private static final Map allBaseBeforeOnLivingUpdateInferiors = new Hashtable(0); - private static final Map allBaseOverrideOnLivingUpdateSuperiors = new Hashtable(0); - private static final Map allBaseOverrideOnLivingUpdateInferiors = new Hashtable(0); - private static final Map allBaseAfterOnLivingUpdateSuperiors = new Hashtable(0); - private static final Map allBaseAfterOnLivingUpdateInferiors = new Hashtable(0); - - public static void onKillEntity(IServerPlayerAPI target, net.minecraft.entity.EntityLivingBase paramEntityLivingBase) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isOnKillEntityModded) - serverPlayerAPI.onKillEntity(paramEntityLivingBase); - else - target.localOnKillEntity(paramEntityLivingBase); - } - - private void onKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase) - { - if(beforeOnKillEntityHooks != null) - for(int i = beforeOnKillEntityHooks.length - 1; i >= 0 ; i--) - beforeOnKillEntityHooks[i].beforeOnKillEntity(paramEntityLivingBase); - - if(overrideOnKillEntityHooks != null) - overrideOnKillEntityHooks[overrideOnKillEntityHooks.length - 1].onKillEntity(paramEntityLivingBase); - else - player.localOnKillEntity(paramEntityLivingBase); - - if(afterOnKillEntityHooks != null) - for(int i = 0; i < afterOnKillEntityHooks.length; i++) - afterOnKillEntityHooks[i].afterOnKillEntity(paramEntityLivingBase); - - } - - protected ServerPlayerBase GetOverwrittenOnKillEntity(ServerPlayerBase overWriter) - { - if (overrideOnKillEntityHooks == null) - return overWriter; - - for(int i = 0; i < overrideOnKillEntityHooks.length; i++) - if(overrideOnKillEntityHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideOnKillEntityHooks[i - 1]; - - return overWriter; - } - - private final static List beforeOnKillEntityHookTypes = new LinkedList(); - private final static List overrideOnKillEntityHookTypes = new LinkedList(); - private final static List afterOnKillEntityHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeOnKillEntityHooks; - private ServerPlayerBase[] overrideOnKillEntityHooks; - private ServerPlayerBase[] afterOnKillEntityHooks; - - public boolean isOnKillEntityModded; - - private static final Map allBaseBeforeOnKillEntitySuperiors = new Hashtable(0); - private static final Map allBaseBeforeOnKillEntityInferiors = new Hashtable(0); - private static final Map allBaseOverrideOnKillEntitySuperiors = new Hashtable(0); - private static final Map allBaseOverrideOnKillEntityInferiors = new Hashtable(0); - private static final Map allBaseAfterOnKillEntitySuperiors = new Hashtable(0); - private static final Map allBaseAfterOnKillEntityInferiors = new Hashtable(0); - - public static void onStruckByLightning(IServerPlayerAPI target, net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isOnStruckByLightningModded) - serverPlayerAPI.onStruckByLightning(paramEntityLightningBolt); - else - target.localOnStruckByLightning(paramEntityLightningBolt); - } - - private void onStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt) - { - if(beforeOnStruckByLightningHooks != null) - for(int i = beforeOnStruckByLightningHooks.length - 1; i >= 0 ; i--) - beforeOnStruckByLightningHooks[i].beforeOnStruckByLightning(paramEntityLightningBolt); - - if(overrideOnStruckByLightningHooks != null) - overrideOnStruckByLightningHooks[overrideOnStruckByLightningHooks.length - 1].onStruckByLightning(paramEntityLightningBolt); - else - player.localOnStruckByLightning(paramEntityLightningBolt); - - if(afterOnStruckByLightningHooks != null) - for(int i = 0; i < afterOnStruckByLightningHooks.length; i++) - afterOnStruckByLightningHooks[i].afterOnStruckByLightning(paramEntityLightningBolt); - - } - - protected ServerPlayerBase GetOverwrittenOnStruckByLightning(ServerPlayerBase overWriter) - { - if (overrideOnStruckByLightningHooks == null) - return overWriter; - - for(int i = 0; i < overrideOnStruckByLightningHooks.length; i++) - if(overrideOnStruckByLightningHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideOnStruckByLightningHooks[i - 1]; - - return overWriter; - } - - private final static List beforeOnStruckByLightningHookTypes = new LinkedList(); - private final static List overrideOnStruckByLightningHookTypes = new LinkedList(); - private final static List afterOnStruckByLightningHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeOnStruckByLightningHooks; - private ServerPlayerBase[] overrideOnStruckByLightningHooks; - private ServerPlayerBase[] afterOnStruckByLightningHooks; - - public boolean isOnStruckByLightningModded; - - private static final Map allBaseBeforeOnStruckByLightningSuperiors = new Hashtable(0); - private static final Map allBaseBeforeOnStruckByLightningInferiors = new Hashtable(0); - private static final Map allBaseOverrideOnStruckByLightningSuperiors = new Hashtable(0); - private static final Map allBaseOverrideOnStruckByLightningInferiors = new Hashtable(0); - private static final Map allBaseAfterOnStruckByLightningSuperiors = new Hashtable(0); - private static final Map allBaseAfterOnStruckByLightningInferiors = new Hashtable(0); - - public static void onUpdate(IServerPlayerAPI target) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isOnUpdateModded) - serverPlayerAPI.onUpdate(); - else - target.localOnUpdate(); - } - - private void onUpdate() - { - if(beforeOnUpdateHooks != null) - for(int i = beforeOnUpdateHooks.length - 1; i >= 0 ; i--) - beforeOnUpdateHooks[i].beforeOnUpdate(); - - if(overrideOnUpdateHooks != null) - overrideOnUpdateHooks[overrideOnUpdateHooks.length - 1].onUpdate(); - else - player.localOnUpdate(); - - if(afterOnUpdateHooks != null) - for(int i = 0; i < afterOnUpdateHooks.length; i++) - afterOnUpdateHooks[i].afterOnUpdate(); - - } - - protected ServerPlayerBase GetOverwrittenOnUpdate(ServerPlayerBase overWriter) - { - if (overrideOnUpdateHooks == null) - return overWriter; - - for(int i = 0; i < overrideOnUpdateHooks.length; i++) - if(overrideOnUpdateHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideOnUpdateHooks[i - 1]; - - return overWriter; - } - - private final static List beforeOnUpdateHookTypes = new LinkedList(); - private final static List overrideOnUpdateHookTypes = new LinkedList(); - private final static List afterOnUpdateHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeOnUpdateHooks; - private ServerPlayerBase[] overrideOnUpdateHooks; - private ServerPlayerBase[] afterOnUpdateHooks; - - public boolean isOnUpdateModded; - - private static final Map allBaseBeforeOnUpdateSuperiors = new Hashtable(0); - private static final Map allBaseBeforeOnUpdateInferiors = new Hashtable(0); - private static final Map allBaseOverrideOnUpdateSuperiors = new Hashtable(0); - private static final Map allBaseOverrideOnUpdateInferiors = new Hashtable(0); - private static final Map allBaseAfterOnUpdateSuperiors = new Hashtable(0); - private static final Map allBaseAfterOnUpdateInferiors = new Hashtable(0); - - public static void onUpdateEntity(IServerPlayerAPI target) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isOnUpdateEntityModded) - serverPlayerAPI.onUpdateEntity(); - else - target.localOnUpdateEntity(); - } - - private void onUpdateEntity() - { - if(beforeOnUpdateEntityHooks != null) - for(int i = beforeOnUpdateEntityHooks.length - 1; i >= 0 ; i--) - beforeOnUpdateEntityHooks[i].beforeOnUpdateEntity(); - - if(overrideOnUpdateEntityHooks != null) - overrideOnUpdateEntityHooks[overrideOnUpdateEntityHooks.length - 1].onUpdateEntity(); - else - player.localOnUpdateEntity(); - - if(afterOnUpdateEntityHooks != null) - for(int i = 0; i < afterOnUpdateEntityHooks.length; i++) - afterOnUpdateEntityHooks[i].afterOnUpdateEntity(); - - } - - protected ServerPlayerBase GetOverwrittenOnUpdateEntity(ServerPlayerBase overWriter) - { - if (overrideOnUpdateEntityHooks == null) - return overWriter; - - for(int i = 0; i < overrideOnUpdateEntityHooks.length; i++) - if(overrideOnUpdateEntityHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideOnUpdateEntityHooks[i - 1]; - - return overWriter; - } - - private final static List beforeOnUpdateEntityHookTypes = new LinkedList(); - private final static List overrideOnUpdateEntityHookTypes = new LinkedList(); - private final static List afterOnUpdateEntityHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeOnUpdateEntityHooks; - private ServerPlayerBase[] overrideOnUpdateEntityHooks; - private ServerPlayerBase[] afterOnUpdateEntityHooks; - - public boolean isOnUpdateEntityModded; - - private static final Map allBaseBeforeOnUpdateEntitySuperiors = new Hashtable(0); - private static final Map allBaseBeforeOnUpdateEntityInferiors = new Hashtable(0); - private static final Map allBaseOverrideOnUpdateEntitySuperiors = new Hashtable(0); - private static final Map allBaseOverrideOnUpdateEntityInferiors = new Hashtable(0); - private static final Map allBaseAfterOnUpdateEntitySuperiors = new Hashtable(0); - private static final Map allBaseAfterOnUpdateEntityInferiors = new Hashtable(0); - - public static void readEntityFromNBT(IServerPlayerAPI target, net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isReadEntityFromNBTModded) - serverPlayerAPI.readEntityFromNBT(paramNBTTagCompound); - else - target.localReadEntityFromNBT(paramNBTTagCompound); - } - - private void readEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - if(beforeReadEntityFromNBTHooks != null) - for(int i = beforeReadEntityFromNBTHooks.length - 1; i >= 0 ; i--) - beforeReadEntityFromNBTHooks[i].beforeReadEntityFromNBT(paramNBTTagCompound); - - if(overrideReadEntityFromNBTHooks != null) - overrideReadEntityFromNBTHooks[overrideReadEntityFromNBTHooks.length - 1].readEntityFromNBT(paramNBTTagCompound); - else - player.localReadEntityFromNBT(paramNBTTagCompound); - - if(afterReadEntityFromNBTHooks != null) - for(int i = 0; i < afterReadEntityFromNBTHooks.length; i++) - afterReadEntityFromNBTHooks[i].afterReadEntityFromNBT(paramNBTTagCompound); - - } - - protected ServerPlayerBase GetOverwrittenReadEntityFromNBT(ServerPlayerBase overWriter) - { - if (overrideReadEntityFromNBTHooks == null) - return overWriter; - - for(int i = 0; i < overrideReadEntityFromNBTHooks.length; i++) - if(overrideReadEntityFromNBTHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideReadEntityFromNBTHooks[i - 1]; - - return overWriter; - } - - private final static List beforeReadEntityFromNBTHookTypes = new LinkedList(); - private final static List overrideReadEntityFromNBTHookTypes = new LinkedList(); - private final static List afterReadEntityFromNBTHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeReadEntityFromNBTHooks; - private ServerPlayerBase[] overrideReadEntityFromNBTHooks; - private ServerPlayerBase[] afterReadEntityFromNBTHooks; - - public boolean isReadEntityFromNBTModded; - - private static final Map allBaseBeforeReadEntityFromNBTSuperiors = new Hashtable(0); - private static final Map allBaseBeforeReadEntityFromNBTInferiors = new Hashtable(0); - private static final Map allBaseOverrideReadEntityFromNBTSuperiors = new Hashtable(0); - private static final Map allBaseOverrideReadEntityFromNBTInferiors = new Hashtable(0); - private static final Map allBaseAfterReadEntityFromNBTSuperiors = new Hashtable(0); - private static final Map allBaseAfterReadEntityFromNBTInferiors = new Hashtable(0); - - public static void setDead(IServerPlayerAPI target) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isSetDeadModded) - serverPlayerAPI.setDead(); - else - target.localSetDead(); - } - - private void setDead() - { - if(beforeSetDeadHooks != null) - for(int i = beforeSetDeadHooks.length - 1; i >= 0 ; i--) - beforeSetDeadHooks[i].beforeSetDead(); - - if(overrideSetDeadHooks != null) - overrideSetDeadHooks[overrideSetDeadHooks.length - 1].setDead(); - else - player.localSetDead(); - - if(afterSetDeadHooks != null) - for(int i = 0; i < afterSetDeadHooks.length; i++) - afterSetDeadHooks[i].afterSetDead(); - - } - - protected ServerPlayerBase GetOverwrittenSetDead(ServerPlayerBase overWriter) - { - if (overrideSetDeadHooks == null) - return overWriter; - - for(int i = 0; i < overrideSetDeadHooks.length; i++) - if(overrideSetDeadHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideSetDeadHooks[i - 1]; - - return overWriter; - } - - private final static List beforeSetDeadHookTypes = new LinkedList(); - private final static List overrideSetDeadHookTypes = new LinkedList(); - private final static List afterSetDeadHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeSetDeadHooks; - private ServerPlayerBase[] overrideSetDeadHooks; - private ServerPlayerBase[] afterSetDeadHooks; - - public boolean isSetDeadModded; - - private static final Map allBaseBeforeSetDeadSuperiors = new Hashtable(0); - private static final Map allBaseBeforeSetDeadInferiors = new Hashtable(0); - private static final Map allBaseOverrideSetDeadSuperiors = new Hashtable(0); - private static final Map allBaseOverrideSetDeadInferiors = new Hashtable(0); - private static final Map allBaseAfterSetDeadSuperiors = new Hashtable(0); - private static final Map allBaseAfterSetDeadInferiors = new Hashtable(0); - - public static void setEntityActionState(IServerPlayerAPI target, float paramFloat1, float paramFloat2, boolean paramBoolean1, boolean paramBoolean2) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isSetEntityActionStateModded) - serverPlayerAPI.setEntityActionState(paramFloat1, paramFloat2, paramBoolean1, paramBoolean2); - else - target.localSetEntityActionState(paramFloat1, paramFloat2, paramBoolean1, paramBoolean2); - } - - private void setEntityActionState(float paramFloat1, float paramFloat2, boolean paramBoolean1, boolean paramBoolean2) - { - if(beforeSetEntityActionStateHooks != null) - for(int i = beforeSetEntityActionStateHooks.length - 1; i >= 0 ; i--) - beforeSetEntityActionStateHooks[i].beforeSetEntityActionState(paramFloat1, paramFloat2, paramBoolean1, paramBoolean2); - - if(overrideSetEntityActionStateHooks != null) - overrideSetEntityActionStateHooks[overrideSetEntityActionStateHooks.length - 1].setEntityActionState(paramFloat1, paramFloat2, paramBoolean1, paramBoolean2); - else - player.localSetEntityActionState(paramFloat1, paramFloat2, paramBoolean1, paramBoolean2); - - if(afterSetEntityActionStateHooks != null) - for(int i = 0; i < afterSetEntityActionStateHooks.length; i++) - afterSetEntityActionStateHooks[i].afterSetEntityActionState(paramFloat1, paramFloat2, paramBoolean1, paramBoolean2); - - } - - protected ServerPlayerBase GetOverwrittenSetEntityActionState(ServerPlayerBase overWriter) - { - if (overrideSetEntityActionStateHooks == null) - return overWriter; - - for(int i = 0; i < overrideSetEntityActionStateHooks.length; i++) - if(overrideSetEntityActionStateHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideSetEntityActionStateHooks[i - 1]; - - return overWriter; - } - - private final static List beforeSetEntityActionStateHookTypes = new LinkedList(); - private final static List overrideSetEntityActionStateHookTypes = new LinkedList(); - private final static List afterSetEntityActionStateHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeSetEntityActionStateHooks; - private ServerPlayerBase[] overrideSetEntityActionStateHooks; - private ServerPlayerBase[] afterSetEntityActionStateHooks; - - public boolean isSetEntityActionStateModded; - - private static final Map allBaseBeforeSetEntityActionStateSuperiors = new Hashtable(0); - private static final Map allBaseBeforeSetEntityActionStateInferiors = new Hashtable(0); - private static final Map allBaseOverrideSetEntityActionStateSuperiors = new Hashtable(0); - private static final Map allBaseOverrideSetEntityActionStateInferiors = new Hashtable(0); - private static final Map allBaseAfterSetEntityActionStateSuperiors = new Hashtable(0); - private static final Map allBaseAfterSetEntityActionStateInferiors = new Hashtable(0); - - public static void setPosition(IServerPlayerAPI target, double paramDouble1, double paramDouble2, double paramDouble3) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isSetPositionModded) - serverPlayerAPI.setPosition(paramDouble1, paramDouble2, paramDouble3); - else - target.localSetPosition(paramDouble1, paramDouble2, paramDouble3); - } - - private void setPosition(double paramDouble1, double paramDouble2, double paramDouble3) - { - if(beforeSetPositionHooks != null) - for(int i = beforeSetPositionHooks.length - 1; i >= 0 ; i--) - beforeSetPositionHooks[i].beforeSetPosition(paramDouble1, paramDouble2, paramDouble3); - - if(overrideSetPositionHooks != null) - overrideSetPositionHooks[overrideSetPositionHooks.length - 1].setPosition(paramDouble1, paramDouble2, paramDouble3); - else - player.localSetPosition(paramDouble1, paramDouble2, paramDouble3); - - if(afterSetPositionHooks != null) - for(int i = 0; i < afterSetPositionHooks.length; i++) - afterSetPositionHooks[i].afterSetPosition(paramDouble1, paramDouble2, paramDouble3); - - } - - protected ServerPlayerBase GetOverwrittenSetPosition(ServerPlayerBase overWriter) - { - if (overrideSetPositionHooks == null) - return overWriter; - - for(int i = 0; i < overrideSetPositionHooks.length; i++) - if(overrideSetPositionHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideSetPositionHooks[i - 1]; - - return overWriter; - } - - private final static List beforeSetPositionHookTypes = new LinkedList(); - private final static List overrideSetPositionHookTypes = new LinkedList(); - private final static List afterSetPositionHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeSetPositionHooks; - private ServerPlayerBase[] overrideSetPositionHooks; - private ServerPlayerBase[] afterSetPositionHooks; - - public boolean isSetPositionModded; - - private static final Map allBaseBeforeSetPositionSuperiors = new Hashtable(0); - private static final Map allBaseBeforeSetPositionInferiors = new Hashtable(0); - private static final Map allBaseOverrideSetPositionSuperiors = new Hashtable(0); - private static final Map allBaseOverrideSetPositionInferiors = new Hashtable(0); - private static final Map allBaseAfterSetPositionSuperiors = new Hashtable(0); - private static final Map allBaseAfterSetPositionInferiors = new Hashtable(0); - - public static void setSneaking(IServerPlayerAPI target, boolean paramBoolean) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isSetSneakingModded) - serverPlayerAPI.setSneaking(paramBoolean); - else - target.localSetSneaking(paramBoolean); - } - - private void setSneaking(boolean paramBoolean) - { - if(beforeSetSneakingHooks != null) - for(int i = beforeSetSneakingHooks.length - 1; i >= 0 ; i--) - beforeSetSneakingHooks[i].beforeSetSneaking(paramBoolean); - - if(overrideSetSneakingHooks != null) - overrideSetSneakingHooks[overrideSetSneakingHooks.length - 1].setSneaking(paramBoolean); - else - player.localSetSneaking(paramBoolean); - - if(afterSetSneakingHooks != null) - for(int i = 0; i < afterSetSneakingHooks.length; i++) - afterSetSneakingHooks[i].afterSetSneaking(paramBoolean); - - } - - protected ServerPlayerBase GetOverwrittenSetSneaking(ServerPlayerBase overWriter) - { - if (overrideSetSneakingHooks == null) - return overWriter; - - for(int i = 0; i < overrideSetSneakingHooks.length; i++) - if(overrideSetSneakingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideSetSneakingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeSetSneakingHookTypes = new LinkedList(); - private final static List overrideSetSneakingHookTypes = new LinkedList(); - private final static List afterSetSneakingHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeSetSneakingHooks; - private ServerPlayerBase[] overrideSetSneakingHooks; - private ServerPlayerBase[] afterSetSneakingHooks; - - public boolean isSetSneakingModded; - - private static final Map allBaseBeforeSetSneakingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeSetSneakingInferiors = new Hashtable(0); - private static final Map allBaseOverrideSetSneakingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideSetSneakingInferiors = new Hashtable(0); - private static final Map allBaseAfterSetSneakingSuperiors = new Hashtable(0); - private static final Map allBaseAfterSetSneakingInferiors = new Hashtable(0); - - public static void setSprinting(IServerPlayerAPI target, boolean paramBoolean) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isSetSprintingModded) - serverPlayerAPI.setSprinting(paramBoolean); - else - target.localSetSprinting(paramBoolean); - } - - private void setSprinting(boolean paramBoolean) - { - if(beforeSetSprintingHooks != null) - for(int i = beforeSetSprintingHooks.length - 1; i >= 0 ; i--) - beforeSetSprintingHooks[i].beforeSetSprinting(paramBoolean); - - if(overrideSetSprintingHooks != null) - overrideSetSprintingHooks[overrideSetSprintingHooks.length - 1].setSprinting(paramBoolean); - else - player.localSetSprinting(paramBoolean); - - if(afterSetSprintingHooks != null) - for(int i = 0; i < afterSetSprintingHooks.length; i++) - afterSetSprintingHooks[i].afterSetSprinting(paramBoolean); - - } - - protected ServerPlayerBase GetOverwrittenSetSprinting(ServerPlayerBase overWriter) - { - if (overrideSetSprintingHooks == null) - return overWriter; - - for(int i = 0; i < overrideSetSprintingHooks.length; i++) - if(overrideSetSprintingHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideSetSprintingHooks[i - 1]; - - return overWriter; - } - - private final static List beforeSetSprintingHookTypes = new LinkedList(); - private final static List overrideSetSprintingHookTypes = new LinkedList(); - private final static List afterSetSprintingHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeSetSprintingHooks; - private ServerPlayerBase[] overrideSetSprintingHooks; - private ServerPlayerBase[] afterSetSprintingHooks; - - public boolean isSetSprintingModded; - - private static final Map allBaseBeforeSetSprintingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeSetSprintingInferiors = new Hashtable(0); - private static final Map allBaseOverrideSetSprintingSuperiors = new Hashtable(0); - private static final Map allBaseOverrideSetSprintingInferiors = new Hashtable(0); - private static final Map allBaseAfterSetSprintingSuperiors = new Hashtable(0); - private static final Map allBaseAfterSetSprintingInferiors = new Hashtable(0); - - public static void swingItem(IServerPlayerAPI target, net.minecraft.util.EnumHand paramEnumHand) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isSwingItemModded) - serverPlayerAPI.swingItem(paramEnumHand); - else - target.localSwingItem(paramEnumHand); - } - - private void swingItem(net.minecraft.util.EnumHand paramEnumHand) - { - if(beforeSwingItemHooks != null) - for(int i = beforeSwingItemHooks.length - 1; i >= 0 ; i--) - beforeSwingItemHooks[i].beforeSwingItem(paramEnumHand); - - if(overrideSwingItemHooks != null) - overrideSwingItemHooks[overrideSwingItemHooks.length - 1].swingItem(paramEnumHand); - else - player.localSwingItem(paramEnumHand); - - if(afterSwingItemHooks != null) - for(int i = 0; i < afterSwingItemHooks.length; i++) - afterSwingItemHooks[i].afterSwingItem(paramEnumHand); - - } - - protected ServerPlayerBase GetOverwrittenSwingItem(ServerPlayerBase overWriter) - { - if (overrideSwingItemHooks == null) - return overWriter; - - for(int i = 0; i < overrideSwingItemHooks.length; i++) - if(overrideSwingItemHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideSwingItemHooks[i - 1]; - - return overWriter; - } - - private final static List beforeSwingItemHookTypes = new LinkedList(); - private final static List overrideSwingItemHookTypes = new LinkedList(); - private final static List afterSwingItemHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeSwingItemHooks; - private ServerPlayerBase[] overrideSwingItemHooks; - private ServerPlayerBase[] afterSwingItemHooks; - - public boolean isSwingItemModded; - - private static final Map allBaseBeforeSwingItemSuperiors = new Hashtable(0); - private static final Map allBaseBeforeSwingItemInferiors = new Hashtable(0); - private static final Map allBaseOverrideSwingItemSuperiors = new Hashtable(0); - private static final Map allBaseOverrideSwingItemInferiors = new Hashtable(0); - private static final Map allBaseAfterSwingItemSuperiors = new Hashtable(0); - private static final Map allBaseAfterSwingItemInferiors = new Hashtable(0); - - public static void updateEntityActionState(IServerPlayerAPI target) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isUpdateEntityActionStateModded) - serverPlayerAPI.updateEntityActionState(); - else - target.localUpdateEntityActionState(); - } - - private void updateEntityActionState() - { - if(beforeUpdateEntityActionStateHooks != null) - for(int i = beforeUpdateEntityActionStateHooks.length - 1; i >= 0 ; i--) - beforeUpdateEntityActionStateHooks[i].beforeUpdateEntityActionState(); - - if(overrideUpdateEntityActionStateHooks != null) - overrideUpdateEntityActionStateHooks[overrideUpdateEntityActionStateHooks.length - 1].updateEntityActionState(); - else - player.localUpdateEntityActionState(); - - if(afterUpdateEntityActionStateHooks != null) - for(int i = 0; i < afterUpdateEntityActionStateHooks.length; i++) - afterUpdateEntityActionStateHooks[i].afterUpdateEntityActionState(); - - } - - protected ServerPlayerBase GetOverwrittenUpdateEntityActionState(ServerPlayerBase overWriter) - { - if (overrideUpdateEntityActionStateHooks == null) - return overWriter; - - for(int i = 0; i < overrideUpdateEntityActionStateHooks.length; i++) - if(overrideUpdateEntityActionStateHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideUpdateEntityActionStateHooks[i - 1]; - - return overWriter; - } - - private final static List beforeUpdateEntityActionStateHookTypes = new LinkedList(); - private final static List overrideUpdateEntityActionStateHookTypes = new LinkedList(); - private final static List afterUpdateEntityActionStateHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeUpdateEntityActionStateHooks; - private ServerPlayerBase[] overrideUpdateEntityActionStateHooks; - private ServerPlayerBase[] afterUpdateEntityActionStateHooks; - - public boolean isUpdateEntityActionStateModded; - - private static final Map allBaseBeforeUpdateEntityActionStateSuperiors = new Hashtable(0); - private static final Map allBaseBeforeUpdateEntityActionStateInferiors = new Hashtable(0); - private static final Map allBaseOverrideUpdateEntityActionStateSuperiors = new Hashtable(0); - private static final Map allBaseOverrideUpdateEntityActionStateInferiors = new Hashtable(0); - private static final Map allBaseAfterUpdateEntityActionStateSuperiors = new Hashtable(0); - private static final Map allBaseAfterUpdateEntityActionStateInferiors = new Hashtable(0); - - public static void updatePotionEffects(IServerPlayerAPI target) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isUpdatePotionEffectsModded) - serverPlayerAPI.updatePotionEffects(); - else - target.localUpdatePotionEffects(); - } - - private void updatePotionEffects() - { - if(beforeUpdatePotionEffectsHooks != null) - for(int i = beforeUpdatePotionEffectsHooks.length - 1; i >= 0 ; i--) - beforeUpdatePotionEffectsHooks[i].beforeUpdatePotionEffects(); - - if(overrideUpdatePotionEffectsHooks != null) - overrideUpdatePotionEffectsHooks[overrideUpdatePotionEffectsHooks.length - 1].updatePotionEffects(); - else - player.localUpdatePotionEffects(); - - if(afterUpdatePotionEffectsHooks != null) - for(int i = 0; i < afterUpdatePotionEffectsHooks.length; i++) - afterUpdatePotionEffectsHooks[i].afterUpdatePotionEffects(); - - } - - protected ServerPlayerBase GetOverwrittenUpdatePotionEffects(ServerPlayerBase overWriter) - { - if (overrideUpdatePotionEffectsHooks == null) - return overWriter; - - for(int i = 0; i < overrideUpdatePotionEffectsHooks.length; i++) - if(overrideUpdatePotionEffectsHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideUpdatePotionEffectsHooks[i - 1]; - - return overWriter; - } - - private final static List beforeUpdatePotionEffectsHookTypes = new LinkedList(); - private final static List overrideUpdatePotionEffectsHookTypes = new LinkedList(); - private final static List afterUpdatePotionEffectsHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeUpdatePotionEffectsHooks; - private ServerPlayerBase[] overrideUpdatePotionEffectsHooks; - private ServerPlayerBase[] afterUpdatePotionEffectsHooks; - - public boolean isUpdatePotionEffectsModded; - - private static final Map allBaseBeforeUpdatePotionEffectsSuperiors = new Hashtable(0); - private static final Map allBaseBeforeUpdatePotionEffectsInferiors = new Hashtable(0); - private static final Map allBaseOverrideUpdatePotionEffectsSuperiors = new Hashtable(0); - private static final Map allBaseOverrideUpdatePotionEffectsInferiors = new Hashtable(0); - private static final Map allBaseAfterUpdatePotionEffectsSuperiors = new Hashtable(0); - private static final Map allBaseAfterUpdatePotionEffectsInferiors = new Hashtable(0); - - public static void updateRidden(IServerPlayerAPI target) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isUpdateRiddenModded) - serverPlayerAPI.updateRidden(); - else - target.localUpdateRidden(); - } - - private void updateRidden() - { - if(beforeUpdateRiddenHooks != null) - for(int i = beforeUpdateRiddenHooks.length - 1; i >= 0 ; i--) - beforeUpdateRiddenHooks[i].beforeUpdateRidden(); - - if(overrideUpdateRiddenHooks != null) - overrideUpdateRiddenHooks[overrideUpdateRiddenHooks.length - 1].updateRidden(); - else - player.localUpdateRidden(); - - if(afterUpdateRiddenHooks != null) - for(int i = 0; i < afterUpdateRiddenHooks.length; i++) - afterUpdateRiddenHooks[i].afterUpdateRidden(); - - } - - protected ServerPlayerBase GetOverwrittenUpdateRidden(ServerPlayerBase overWriter) - { - if (overrideUpdateRiddenHooks == null) - return overWriter; - - for(int i = 0; i < overrideUpdateRiddenHooks.length; i++) - if(overrideUpdateRiddenHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideUpdateRiddenHooks[i - 1]; - - return overWriter; - } - - private final static List beforeUpdateRiddenHookTypes = new LinkedList(); - private final static List overrideUpdateRiddenHookTypes = new LinkedList(); - private final static List afterUpdateRiddenHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeUpdateRiddenHooks; - private ServerPlayerBase[] overrideUpdateRiddenHooks; - private ServerPlayerBase[] afterUpdateRiddenHooks; - - public boolean isUpdateRiddenModded; - - private static final Map allBaseBeforeUpdateRiddenSuperiors = new Hashtable(0); - private static final Map allBaseBeforeUpdateRiddenInferiors = new Hashtable(0); - private static final Map allBaseOverrideUpdateRiddenSuperiors = new Hashtable(0); - private static final Map allBaseOverrideUpdateRiddenInferiors = new Hashtable(0); - private static final Map allBaseAfterUpdateRiddenSuperiors = new Hashtable(0); - private static final Map allBaseAfterUpdateRiddenInferiors = new Hashtable(0); - - public static void wakeUpPlayer(IServerPlayerAPI target, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isWakeUpPlayerModded) - serverPlayerAPI.wakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - else - target.localWakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - } - - private void wakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) - { - if(beforeWakeUpPlayerHooks != null) - for(int i = beforeWakeUpPlayerHooks.length - 1; i >= 0 ; i--) - beforeWakeUpPlayerHooks[i].beforeWakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - - if(overrideWakeUpPlayerHooks != null) - overrideWakeUpPlayerHooks[overrideWakeUpPlayerHooks.length - 1].wakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - else - player.localWakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - - if(afterWakeUpPlayerHooks != null) - for(int i = 0; i < afterWakeUpPlayerHooks.length; i++) - afterWakeUpPlayerHooks[i].afterWakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - - } - - protected ServerPlayerBase GetOverwrittenWakeUpPlayer(ServerPlayerBase overWriter) - { - if (overrideWakeUpPlayerHooks == null) - return overWriter; - - for(int i = 0; i < overrideWakeUpPlayerHooks.length; i++) - if(overrideWakeUpPlayerHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideWakeUpPlayerHooks[i - 1]; - - return overWriter; - } - - private final static List beforeWakeUpPlayerHookTypes = new LinkedList(); - private final static List overrideWakeUpPlayerHookTypes = new LinkedList(); - private final static List afterWakeUpPlayerHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeWakeUpPlayerHooks; - private ServerPlayerBase[] overrideWakeUpPlayerHooks; - private ServerPlayerBase[] afterWakeUpPlayerHooks; - - public boolean isWakeUpPlayerModded; - - private static final Map allBaseBeforeWakeUpPlayerSuperiors = new Hashtable(0); - private static final Map allBaseBeforeWakeUpPlayerInferiors = new Hashtable(0); - private static final Map allBaseOverrideWakeUpPlayerSuperiors = new Hashtable(0); - private static final Map allBaseOverrideWakeUpPlayerInferiors = new Hashtable(0); - private static final Map allBaseAfterWakeUpPlayerSuperiors = new Hashtable(0); - private static final Map allBaseAfterWakeUpPlayerInferiors = new Hashtable(0); - - public static void writeEntityToNBT(IServerPlayerAPI target, net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - ServerPlayerAPI serverPlayerAPI = target.getServerPlayerAPI(); - if(serverPlayerAPI != null && serverPlayerAPI.isWriteEntityToNBTModded) - serverPlayerAPI.writeEntityToNBT(paramNBTTagCompound); - else - target.localWriteEntityToNBT(paramNBTTagCompound); - } - - private void writeEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - if(beforeWriteEntityToNBTHooks != null) - for(int i = beforeWriteEntityToNBTHooks.length - 1; i >= 0 ; i--) - beforeWriteEntityToNBTHooks[i].beforeWriteEntityToNBT(paramNBTTagCompound); - - if(overrideWriteEntityToNBTHooks != null) - overrideWriteEntityToNBTHooks[overrideWriteEntityToNBTHooks.length - 1].writeEntityToNBT(paramNBTTagCompound); - else - player.localWriteEntityToNBT(paramNBTTagCompound); - - if(afterWriteEntityToNBTHooks != null) - for(int i = 0; i < afterWriteEntityToNBTHooks.length; i++) - afterWriteEntityToNBTHooks[i].afterWriteEntityToNBT(paramNBTTagCompound); - - } - - protected ServerPlayerBase GetOverwrittenWriteEntityToNBT(ServerPlayerBase overWriter) - { - if (overrideWriteEntityToNBTHooks == null) - return overWriter; - - for(int i = 0; i < overrideWriteEntityToNBTHooks.length; i++) - if(overrideWriteEntityToNBTHooks[i] == overWriter) - if(i == 0) - return null; - else - return overrideWriteEntityToNBTHooks[i - 1]; - - return overWriter; - } - - private final static List beforeWriteEntityToNBTHookTypes = new LinkedList(); - private final static List overrideWriteEntityToNBTHookTypes = new LinkedList(); - private final static List afterWriteEntityToNBTHookTypes = new LinkedList(); - - private ServerPlayerBase[] beforeWriteEntityToNBTHooks; - private ServerPlayerBase[] overrideWriteEntityToNBTHooks; - private ServerPlayerBase[] afterWriteEntityToNBTHooks; - - public boolean isWriteEntityToNBTModded; - - private static final Map allBaseBeforeWriteEntityToNBTSuperiors = new Hashtable(0); - private static final Map allBaseBeforeWriteEntityToNBTInferiors = new Hashtable(0); - private static final Map allBaseOverrideWriteEntityToNBTSuperiors = new Hashtable(0); - private static final Map allBaseOverrideWriteEntityToNBTInferiors = new Hashtable(0); - private static final Map allBaseAfterWriteEntityToNBTSuperiors = new Hashtable(0); - private static final Map allBaseAfterWriteEntityToNBTInferiors = new Hashtable(0); - - - protected final IServerPlayerAPI player; - - private final static Set keys = new HashSet(); - private final static Map keysToVirtualIds = new HashMap(); - private final static Set> dynamicTypes = new HashSet>(); - - private final static Map, Map> virtualDynamicHookMethods = new HashMap, Map>(); - - private final static Map, Map> beforeDynamicHookMethods = new HashMap, Map>(); - private final static Map, Map> overrideDynamicHookMethods = new HashMap, Map>(); - private final static Map, Map> afterDynamicHookMethods = new HashMap, Map>(); - - private final static List beforeLocalConstructingHookTypes = new LinkedList(); - private final static List afterLocalConstructingHookTypes = new LinkedList(); - - private static final Map> beforeDynamicHookTypes = new Hashtable>(0); - private static final Map> overrideDynamicHookTypes = new Hashtable>(0); - private static final Map> afterDynamicHookTypes = new Hashtable>(0); - - private ServerPlayerBase[] beforeLocalConstructingHooks; - private ServerPlayerBase[] afterLocalConstructingHooks; - - private final Map baseObjectsToId = new Hashtable(); - private final Map allBaseObjects = new Hashtable(); - private final Set unmodifiableAllBaseIds = Collections.unmodifiableSet(allBaseObjects.keySet()); - - private static final Map> allBaseConstructors = new Hashtable>(); - private static final Set unmodifiableAllIds = Collections.unmodifiableSet(allBaseConstructors.keySet()); - - private static final Map allBaseBeforeLocalConstructingSuperiors = new Hashtable(0); - private static final Map allBaseBeforeLocalConstructingInferiors = new Hashtable(0); - private static final Map allBaseAfterLocalConstructingSuperiors = new Hashtable(0); - private static final Map allBaseAfterLocalConstructingInferiors = new Hashtable(0); - - private static final Map> allBaseBeforeDynamicSuperiors = new Hashtable>(0); - private static final Map> allBaseBeforeDynamicInferiors = new Hashtable>(0); - private static final Map> allBaseOverrideDynamicSuperiors = new Hashtable>(0); - private static final Map> allBaseOverrideDynamicInferiors = new Hashtable>(0); - private static final Map> allBaseAfterDynamicSuperiors = new Hashtable>(0); - private static final Map> allBaseAfterDynamicInferiors = new Hashtable>(0); - - private static boolean initialized = false; -} diff --git a/dependencies/main/java/api/player/server/ServerPlayerBase.java b/dependencies/main/java/api/player/server/ServerPlayerBase.java deleted file mode 100644 index dec8699542..0000000000 --- a/dependencies/main/java/api/player/server/ServerPlayerBase.java +++ /dev/null @@ -1,1150 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.server; - -public abstract class ServerPlayerBase -{ - public ServerPlayerBase(ServerPlayerAPI playerAPI) - { - this.internalServerPlayerAPI = playerAPI; - this.playerAPI = playerAPI.player; - this.player = playerAPI.player.getEntityPlayerMP(); - } - - public void beforeBaseAttach(boolean onTheFly) - { - } - - public void afterBaseAttach(boolean onTheFly) - { - } - - public void beforeLocalConstructing(net.minecraft.server.MinecraftServer paramMinecraftServer, net.minecraft.world.WorldServer paramWorldServer, com.mojang.authlib.GameProfile paramGameProfile, net.minecraft.server.management.PlayerInteractionManager paramPlayerInteractionManager) - { - } - - public void afterLocalConstructing(net.minecraft.server.MinecraftServer paramMinecraftServer, net.minecraft.world.WorldServer paramWorldServer, com.mojang.authlib.GameProfile paramGameProfile, net.minecraft.server.management.PlayerInteractionManager paramPlayerInteractionManager) - { - } - - public void beforeBaseDetach(boolean onTheFly) - { - } - - public void afterBaseDetach(boolean onTheFly) - { - } - - public Object dynamic(String key, Object[] parameters) - { - return internalServerPlayerAPI.dynamicOverwritten(key, parameters, this); - } - - public final int hashCode() - { - return super.hashCode(); - } - - public void beforeAddExhaustion(float paramFloat) - { - } - - public void addExhaustion(float paramFloat) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenAddExhaustion(this); - - if(overwritten == null) - playerAPI.localAddExhaustion(paramFloat); - else if(overwritten != this) - overwritten.addExhaustion(paramFloat); - - } - - public void afterAddExhaustion(float paramFloat) - { - } - - public void beforeAddExperience(int paramInt) - { - } - - public void addExperience(int paramInt) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenAddExperience(this); - - if(overwritten == null) - playerAPI.localAddExperience(paramInt); - else if(overwritten != this) - overwritten.addExperience(paramInt); - - } - - public void afterAddExperience(int paramInt) - { - } - - public void beforeAddExperienceLevel(int paramInt) - { - } - - public void addExperienceLevel(int paramInt) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenAddExperienceLevel(this); - - if(overwritten == null) - playerAPI.localAddExperienceLevel(paramInt); - else if(overwritten != this) - overwritten.addExperienceLevel(paramInt); - - } - - public void afterAddExperienceLevel(int paramInt) - { - } - - public void beforeAddMovementStat(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public void addMovementStat(double paramDouble1, double paramDouble2, double paramDouble3) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenAddMovementStat(this); - - if(overwritten == null) - playerAPI.localAddMovementStat(paramDouble1, paramDouble2, paramDouble3); - else if(overwritten != this) - overwritten.addMovementStat(paramDouble1, paramDouble2, paramDouble3); - - } - - public void afterAddMovementStat(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public void beforeAttackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - } - - public boolean attackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenAttackEntityFrom(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localAttackEntityFrom(paramDamageSource, paramFloat); - else if(overwritten != this) - _result = overwritten.attackEntityFrom(paramDamageSource, paramFloat); - else - _result = false; - - return _result; - } - - public void afterAttackEntityFrom(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - } - - public void beforeAttackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity) - { - } - - public void attackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenAttackTargetEntityWithCurrentItem(this); - - if(overwritten == null) - playerAPI.localAttackTargetEntityWithCurrentItem(paramEntity); - else if(overwritten != this) - overwritten.attackTargetEntityWithCurrentItem(paramEntity); - - } - - public void afterAttackTargetEntityWithCurrentItem(net.minecraft.entity.Entity paramEntity) - { - } - - public void beforeCanBreatheUnderwater() - { - } - - public boolean canBreatheUnderwater() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenCanBreatheUnderwater(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localCanBreatheUnderwater(); - else if(overwritten != this) - _result = overwritten.canBreatheUnderwater(); - else - _result = false; - - return _result; - } - - public void afterCanBreatheUnderwater() - { - } - - public void beforeCanHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState) - { - } - - public boolean canHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenCanHarvestBlock(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localCanHarvestBlock(paramIBlockState); - else if(overwritten != this) - _result = overwritten.canHarvestBlock(paramIBlockState); - else - _result = false; - - return _result; - } - - public void afterCanHarvestBlock(net.minecraft.block.state.IBlockState paramIBlockState) - { - } - - public void beforeCanPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack) - { - } - - public boolean canPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenCanPlayerEdit(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localCanPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - else if(overwritten != this) - _result = overwritten.canPlayerEdit(paramBlockPos, paramEnumFacing, paramItemStack); - else - _result = false; - - return _result; - } - - public void afterCanPlayerEdit(net.minecraft.util.math.BlockPos paramBlockPos, net.minecraft.util.EnumFacing paramEnumFacing, net.minecraft.item.ItemStack paramItemStack) - { - } - - public void beforeCanTriggerWalking() - { - } - - public boolean canTriggerWalking() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenCanTriggerWalking(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localCanTriggerWalking(); - else if(overwritten != this) - _result = overwritten.canTriggerWalking(); - else - _result = false; - - return _result; - } - - public void afterCanTriggerWalking() - { - } - - public void beforeClonePlayer(net.minecraft.entity.player.EntityPlayer paramEntityPlayer, boolean paramBoolean) - { - } - - public void clonePlayer(net.minecraft.entity.player.EntityPlayer paramEntityPlayer, boolean paramBoolean) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenClonePlayer(this); - - if(overwritten == null) - playerAPI.localClonePlayer(paramEntityPlayer, paramBoolean); - else if(overwritten != this) - overwritten.clonePlayer(paramEntityPlayer, paramBoolean); - - } - - public void afterClonePlayer(net.minecraft.entity.player.EntityPlayer paramEntityPlayer, boolean paramBoolean) - { - } - - public void beforeDamageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - } - - public void damageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenDamageEntity(this); - - if(overwritten == null) - playerAPI.localDamageEntity(paramDamageSource, paramFloat); - else if(overwritten != this) - overwritten.damageEntity(paramDamageSource, paramFloat); - - } - - public void afterDamageEntity(net.minecraft.util.DamageSource paramDamageSource, float paramFloat) - { - } - - public void beforeDisplayGui(net.minecraft.world.IInteractionObject paramIInteractionObject) - { - } - - public void displayGui(net.minecraft.world.IInteractionObject paramIInteractionObject) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenDisplayGui(this); - - if(overwritten == null) - playerAPI.localDisplayGui(paramIInteractionObject); - else if(overwritten != this) - overwritten.displayGui(paramIInteractionObject); - - } - - public void afterDisplayGui(net.minecraft.world.IInteractionObject paramIInteractionObject) - { - } - - public void beforeDisplayGUIChest(net.minecraft.inventory.IInventory paramIInventory) - { - } - - public void displayGUIChest(net.minecraft.inventory.IInventory paramIInventory) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenDisplayGUIChest(this); - - if(overwritten == null) - playerAPI.localDisplayGUIChest(paramIInventory); - else if(overwritten != this) - overwritten.displayGUIChest(paramIInventory); - - } - - public void afterDisplayGUIChest(net.minecraft.inventory.IInventory paramIInventory) - { - } - - public void beforeDropOneItem(boolean paramBoolean) - { - } - - public net.minecraft.entity.item.EntityItem dropOneItem(boolean paramBoolean) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenDropOneItem(this); - - net.minecraft.entity.item.EntityItem _result; - if(overwritten == null) - _result = playerAPI.localDropOneItem(paramBoolean); - else if(overwritten != this) - _result = overwritten.dropOneItem(paramBoolean); - else - _result = null; - - return _result; - } - - public void afterDropOneItem(boolean paramBoolean) - { - } - - public void beforeDropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean) - { - } - - public net.minecraft.entity.item.EntityItem dropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenDropPlayerItemWithRandomChoice(this); - - net.minecraft.entity.item.EntityItem _result; - if(overwritten == null) - _result = playerAPI.localDropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - else if(overwritten != this) - _result = overwritten.dropPlayerItemWithRandomChoice(paramItemStack, paramBoolean); - else - _result = null; - - return _result; - } - - public void afterDropPlayerItemWithRandomChoice(net.minecraft.item.ItemStack paramItemStack, boolean paramBoolean) - { - } - - public void beforeFall(float paramFloat1, float paramFloat2) - { - } - - public void fall(float paramFloat1, float paramFloat2) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenFall(this); - - if(overwritten == null) - playerAPI.localFall(paramFloat1, paramFloat2); - else if(overwritten != this) - overwritten.fall(paramFloat1, paramFloat2); - - } - - public void afterFall(float paramFloat1, float paramFloat2) - { - } - - public void beforeGetAIMoveSpeed() - { - } - - public float getAIMoveSpeed() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenGetAIMoveSpeed(this); - - float _result; - if(overwritten == null) - _result = playerAPI.localGetAIMoveSpeed(); - else if(overwritten != this) - _result = overwritten.getAIMoveSpeed(); - else - _result = 0; - - return _result; - } - - public void afterGetAIMoveSpeed() - { - } - - public void beforeGetBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos) - { - } - - public float getBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenGetBreakSpeed(this); - - float _result; - if(overwritten == null) - _result = playerAPI.localGetBreakSpeed(paramIBlockState, paramBlockPos); - else if(overwritten != this) - _result = overwritten.getBreakSpeed(paramIBlockState, paramBlockPos); - else - _result = 0; - - return _result; - } - - public void afterGetBreakSpeed(net.minecraft.block.state.IBlockState paramIBlockState, net.minecraft.util.math.BlockPos paramBlockPos) - { - } - - public void beforeGetDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public double getDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenGetDistanceSq(this); - - double _result; - if(overwritten == null) - _result = playerAPI.localGetDistanceSq(paramDouble1, paramDouble2, paramDouble3); - else if(overwritten != this) - _result = overwritten.getDistanceSq(paramDouble1, paramDouble2, paramDouble3); - else - _result = 0; - - return _result; - } - - public void afterGetDistanceSq(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public void beforeGetBrightness(float paramFloat) - { - } - - public float getBrightness(float paramFloat) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenGetBrightness(this); - - float _result; - if(overwritten == null) - _result = playerAPI.localGetBrightness(paramFloat); - else if(overwritten != this) - _result = overwritten.getBrightness(paramFloat); - else - _result = 0; - - return _result; - } - - public void afterGetBrightness(float paramFloat) - { - } - - public void beforeGetEyeHeight() - { - } - - public float getEyeHeight() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenGetEyeHeight(this); - - float _result; - if(overwritten == null) - _result = playerAPI.localGetEyeHeight(); - else if(overwritten != this) - _result = overwritten.getEyeHeight(); - else - _result = 0; - - return _result; - } - - public void afterGetEyeHeight() - { - } - - public void beforeHeal(float paramFloat) - { - } - - public void heal(float paramFloat) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenHeal(this); - - if(overwritten == null) - playerAPI.localHeal(paramFloat); - else if(overwritten != this) - overwritten.heal(paramFloat); - - } - - public void afterHeal(float paramFloat) - { - } - - public void beforeIsEntityInsideOpaqueBlock() - { - } - - public boolean isEntityInsideOpaqueBlock() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenIsEntityInsideOpaqueBlock(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localIsEntityInsideOpaqueBlock(); - else if(overwritten != this) - _result = overwritten.isEntityInsideOpaqueBlock(); - else - _result = false; - - return _result; - } - - public void afterIsEntityInsideOpaqueBlock() - { - } - - public void beforeIsInWater() - { - } - - public boolean isInWater() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenIsInWater(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localIsInWater(); - else if(overwritten != this) - _result = overwritten.isInWater(); - else - _result = false; - - return _result; - } - - public void afterIsInWater() - { - } - - public void beforeIsInsideOfMaterial(net.minecraft.block.material.Material paramMaterial) - { - } - - public boolean isInsideOfMaterial(net.minecraft.block.material.Material paramMaterial) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenIsInsideOfMaterial(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localIsInsideOfMaterial(paramMaterial); - else if(overwritten != this) - _result = overwritten.isInsideOfMaterial(paramMaterial); - else - _result = false; - - return _result; - } - - public void afterIsInsideOfMaterial(net.minecraft.block.material.Material paramMaterial) - { - } - - public void beforeIsOnLadder() - { - } - - public boolean isOnLadder() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenIsOnLadder(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localIsOnLadder(); - else if(overwritten != this) - _result = overwritten.isOnLadder(); - else - _result = false; - - return _result; - } - - public void afterIsOnLadder() - { - } - - public void beforeIsPlayerSleeping() - { - } - - public boolean isPlayerSleeping() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenIsPlayerSleeping(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localIsPlayerSleeping(); - else if(overwritten != this) - _result = overwritten.isPlayerSleeping(); - else - _result = false; - - return _result; - } - - public void afterIsPlayerSleeping() - { - } - - public void beforeIsSneaking() - { - } - - public boolean isSneaking() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenIsSneaking(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localIsSneaking(); - else if(overwritten != this) - _result = overwritten.isSneaking(); - else - _result = false; - - return _result; - } - - public void afterIsSneaking() - { - } - - public void beforeJump() - { - } - - public void jump() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenJump(this); - - if(overwritten == null) - playerAPI.localJump(); - else if(overwritten != this) - overwritten.jump(); - - } - - public void afterJump() - { - } - - public void beforeKnockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2) - { - } - - public void knockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenKnockBack(this); - - if(overwritten == null) - playerAPI.localKnockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - else if(overwritten != this) - overwritten.knockBack(paramEntity, paramFloat, paramDouble1, paramDouble2); - - } - - public void afterKnockBack(net.minecraft.entity.Entity paramEntity, float paramFloat, double paramDouble1, double paramDouble2) - { - } - - public void beforeMountEntity(net.minecraft.entity.Entity paramEntity, boolean paramBoolean) - { - } - - public boolean mountEntity(net.minecraft.entity.Entity paramEntity, boolean paramBoolean) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenMountEntity(this); - - boolean _result; - if(overwritten == null) - _result = playerAPI.localMountEntity(paramEntity, paramBoolean); - else if(overwritten != this) - _result = overwritten.mountEntity(paramEntity, paramBoolean); - else - _result = false; - - return _result; - } - - public void afterMountEntity(net.minecraft.entity.Entity paramEntity, boolean paramBoolean) - { - } - - public void beforeMoveEntity(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public void moveEntity(double paramDouble1, double paramDouble2, double paramDouble3) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenMoveEntity(this); - - if(overwritten == null) - playerAPI.localMoveEntity(paramDouble1, paramDouble2, paramDouble3); - else if(overwritten != this) - overwritten.moveEntity(paramDouble1, paramDouble2, paramDouble3); - - } - - public void afterMoveEntity(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public void beforeMoveEntityWithHeading(float paramFloat1, float paramFloat2) - { - } - - public void moveEntityWithHeading(float paramFloat1, float paramFloat2) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenMoveEntityWithHeading(this); - - if(overwritten == null) - playerAPI.localMoveEntityWithHeading(paramFloat1, paramFloat2); - else if(overwritten != this) - overwritten.moveEntityWithHeading(paramFloat1, paramFloat2); - - } - - public void afterMoveEntityWithHeading(float paramFloat1, float paramFloat2) - { - } - - public void beforeMoveFlying(float paramFloat1, float paramFloat2, float paramFloat3) - { - } - - public void moveFlying(float paramFloat1, float paramFloat2, float paramFloat3) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenMoveFlying(this); - - if(overwritten == null) - playerAPI.localMoveFlying(paramFloat1, paramFloat2, paramFloat3); - else if(overwritten != this) - overwritten.moveFlying(paramFloat1, paramFloat2, paramFloat3); - - } - - public void afterMoveFlying(float paramFloat1, float paramFloat2, float paramFloat3) - { - } - - public void beforeOnDeath(net.minecraft.util.DamageSource paramDamageSource) - { - } - - public void onDeath(net.minecraft.util.DamageSource paramDamageSource) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenOnDeath(this); - - if(overwritten == null) - playerAPI.localOnDeath(paramDamageSource); - else if(overwritten != this) - overwritten.onDeath(paramDamageSource); - - } - - public void afterOnDeath(net.minecraft.util.DamageSource paramDamageSource) - { - } - - public void beforeOnLivingUpdate() - { - } - - public void onLivingUpdate() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenOnLivingUpdate(this); - - if(overwritten == null) - playerAPI.localOnLivingUpdate(); - else if(overwritten != this) - overwritten.onLivingUpdate(); - - } - - public void afterOnLivingUpdate() - { - } - - public void beforeOnKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase) - { - } - - public void onKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenOnKillEntity(this); - - if(overwritten == null) - playerAPI.localOnKillEntity(paramEntityLivingBase); - else if(overwritten != this) - overwritten.onKillEntity(paramEntityLivingBase); - - } - - public void afterOnKillEntity(net.minecraft.entity.EntityLivingBase paramEntityLivingBase) - { - } - - public void beforeOnStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt) - { - } - - public void onStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenOnStruckByLightning(this); - - if(overwritten == null) - playerAPI.localOnStruckByLightning(paramEntityLightningBolt); - else if(overwritten != this) - overwritten.onStruckByLightning(paramEntityLightningBolt); - - } - - public void afterOnStruckByLightning(net.minecraft.entity.effect.EntityLightningBolt paramEntityLightningBolt) - { - } - - public void beforeOnUpdate() - { - } - - public void onUpdate() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenOnUpdate(this); - - if(overwritten == null) - playerAPI.localOnUpdate(); - else if(overwritten != this) - overwritten.onUpdate(); - - } - - public void afterOnUpdate() - { - } - - public void beforeOnUpdateEntity() - { - } - - public void onUpdateEntity() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenOnUpdateEntity(this); - - if(overwritten == null) - playerAPI.localOnUpdateEntity(); - else if(overwritten != this) - overwritten.onUpdateEntity(); - - } - - public void afterOnUpdateEntity() - { - } - - public void beforeReadEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - } - - public void readEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenReadEntityFromNBT(this); - - if(overwritten == null) - playerAPI.localReadEntityFromNBT(paramNBTTagCompound); - else if(overwritten != this) - overwritten.readEntityFromNBT(paramNBTTagCompound); - - } - - public void afterReadEntityFromNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - } - - public void beforeSetDead() - { - } - - public void setDead() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenSetDead(this); - - if(overwritten == null) - playerAPI.localSetDead(); - else if(overwritten != this) - overwritten.setDead(); - - } - - public void afterSetDead() - { - } - - public void beforeSetEntityActionState(float paramFloat1, float paramFloat2, boolean paramBoolean1, boolean paramBoolean2) - { - } - - public void setEntityActionState(float paramFloat1, float paramFloat2, boolean paramBoolean1, boolean paramBoolean2) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenSetEntityActionState(this); - - if(overwritten == null) - playerAPI.localSetEntityActionState(paramFloat1, paramFloat2, paramBoolean1, paramBoolean2); - else if(overwritten != this) - overwritten.setEntityActionState(paramFloat1, paramFloat2, paramBoolean1, paramBoolean2); - - } - - public void afterSetEntityActionState(float paramFloat1, float paramFloat2, boolean paramBoolean1, boolean paramBoolean2) - { - } - - public void beforeSetPosition(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public void setPosition(double paramDouble1, double paramDouble2, double paramDouble3) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenSetPosition(this); - - if(overwritten == null) - playerAPI.localSetPosition(paramDouble1, paramDouble2, paramDouble3); - else if(overwritten != this) - overwritten.setPosition(paramDouble1, paramDouble2, paramDouble3); - - } - - public void afterSetPosition(double paramDouble1, double paramDouble2, double paramDouble3) - { - } - - public void beforeSetSneaking(boolean paramBoolean) - { - } - - public void setSneaking(boolean paramBoolean) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenSetSneaking(this); - - if(overwritten == null) - playerAPI.localSetSneaking(paramBoolean); - else if(overwritten != this) - overwritten.setSneaking(paramBoolean); - - } - - public void afterSetSneaking(boolean paramBoolean) - { - } - - public void beforeSetSprinting(boolean paramBoolean) - { - } - - public void setSprinting(boolean paramBoolean) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenSetSprinting(this); - - if(overwritten == null) - playerAPI.localSetSprinting(paramBoolean); - else if(overwritten != this) - overwritten.setSprinting(paramBoolean); - - } - - public void afterSetSprinting(boolean paramBoolean) - { - } - - public void beforeSwingItem(net.minecraft.util.EnumHand paramEnumHand) - { - } - - public void swingItem(net.minecraft.util.EnumHand paramEnumHand) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenSwingItem(this); - - if(overwritten == null) - playerAPI.localSwingItem(paramEnumHand); - else if(overwritten != this) - overwritten.swingItem(paramEnumHand); - - } - - public void afterSwingItem(net.minecraft.util.EnumHand paramEnumHand) - { - } - - public void beforeUpdateEntityActionState() - { - } - - public void updateEntityActionState() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenUpdateEntityActionState(this); - - if(overwritten == null) - playerAPI.localUpdateEntityActionState(); - else if(overwritten != this) - overwritten.updateEntityActionState(); - - } - - public void afterUpdateEntityActionState() - { - } - - public void beforeUpdatePotionEffects() - { - } - - public void updatePotionEffects() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenUpdatePotionEffects(this); - - if(overwritten == null) - playerAPI.localUpdatePotionEffects(); - else if(overwritten != this) - overwritten.updatePotionEffects(); - - } - - public void afterUpdatePotionEffects() - { - } - - public void beforeUpdateRidden() - { - } - - public void updateRidden() - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenUpdateRidden(this); - - if(overwritten == null) - playerAPI.localUpdateRidden(); - else if(overwritten != this) - overwritten.updateRidden(); - - } - - public void afterUpdateRidden() - { - } - - public void beforeWakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) - { - } - - public void wakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenWakeUpPlayer(this); - - if(overwritten == null) - playerAPI.localWakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - else if(overwritten != this) - overwritten.wakeUpPlayer(paramBoolean1, paramBoolean2, paramBoolean3); - - } - - public void afterWakeUpPlayer(boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) - { - } - - public void beforeWriteEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - } - - public void writeEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - ServerPlayerBase overwritten = internalServerPlayerAPI.GetOverwrittenWriteEntityToNBT(this); - - if(overwritten == null) - playerAPI.localWriteEntityToNBT(paramNBTTagCompound); - else if(overwritten != this) - overwritten.writeEntityToNBT(paramNBTTagCompound); - - } - - public void afterWriteEntityToNBT(net.minecraft.nbt.NBTTagCompound paramNBTTagCompound) - { - } - - protected final net.minecraft.entity.player.EntityPlayerMP player; - protected final IServerPlayer playerAPI; - private final ServerPlayerAPI internalServerPlayerAPI; -} diff --git a/dependencies/main/java/api/player/server/ServerPlayerBaseSorter.java b/dependencies/main/java/api/player/server/ServerPlayerBaseSorter.java deleted file mode 100644 index 551d760564..0000000000 --- a/dependencies/main/java/api/player/server/ServerPlayerBaseSorter.java +++ /dev/null @@ -1,259 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.server; - -import java.util.*; - -public final class ServerPlayerBaseSorter -{ - public ServerPlayerBaseSorter(List list, Map allBaseSuperiors, Map allBaseInferiors, String methodName) - { - this.list = list; - this.allBaseSuperiors = allBaseSuperiors; - this.allBaseInferiors = allBaseInferiors; - this.methodName = methodName; - } - - public void Sort() - { - if(list.size() <= 1) - return; - - if(explicitInferiors != null) - explicitInferiors.clear(); - - if(explicitSuperiors != null) - explicitSuperiors.clear(); - - if(directInferiorsMap != null) - directInferiorsMap.clear(); - - if(allInferiors != null) - allInferiors.clear(); - - for(int i = 0; i < list.size(); i++) - { - String baseId = list.get(i); - - String[] inferiorNames = allBaseInferiors.get(baseId); - boolean hasInferiors = inferiorNames != null && inferiorNames.length > 0; - - String[] superiorNames = allBaseSuperiors.get(baseId); - boolean hasSuperiors = superiorNames != null && superiorNames.length > 0; - - if((hasInferiors || hasSuperiors) && directInferiorsMap == null) - directInferiorsMap = new Hashtable>(); - - if(hasInferiors) - explicitInferiors = build(baseId, explicitInferiors, directInferiorsMap, null, inferiorNames); - - if(hasSuperiors) - explicitSuperiors = build(baseId, explicitSuperiors, null, directInferiorsMap, superiorNames); - } - if(directInferiorsMap != null) - { - for(int i = 0; i < list.size() - 1; i++) - for(int n = i + 1; n < list.size(); n++) - { - String left = list.get(i); - String right = list.get(n); - - Set leftInferiors = null, rightInferiors = null; - if(explicitInferiors != null) - { - leftInferiors = explicitInferiors.get(left); - rightInferiors = explicitInferiors.get(right); - } - - Set leftSuperiors = null, rightSuperiors = null; - if(explicitSuperiors != null) - { - leftSuperiors = explicitSuperiors.get(left); - rightSuperiors = explicitSuperiors.get(right); - } - - boolean leftWantsToBeInferiorToRight = leftSuperiors != null && leftSuperiors.contains(right); - boolean leftWantsToBeSuperiorToRight = leftInferiors != null && leftInferiors.contains(right); - - boolean rightWantsToBeInferiorToLeft = rightSuperiors != null && rightSuperiors.contains(left); - boolean rightWantsToBeSuperiorToLeft = rightInferiors != null && rightInferiors.contains(left); - - if(leftWantsToBeInferiorToRight && rightWantsToBeInferiorToLeft) - throw new UnsupportedOperationException("Can not sort ServerPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be inferior to '" + right + "' and '" + right + "' wants to be inferior to '" + left + "'"); - if(leftWantsToBeSuperiorToRight && rightWantsToBeSuperiorToLeft) - throw new UnsupportedOperationException("Can not sort ServerPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be superior to '" + right + "' and '" + right + "' wants to be superior to '" + left + "'"); - - if(leftWantsToBeInferiorToRight && leftWantsToBeSuperiorToRight) - throw new UnsupportedOperationException("Can not sort ServerPlayerBase classes for method '" + methodName + "'. '" + left + "' wants to be superior and inferior to '" + right + "'"); - if(rightWantsToBeInferiorToLeft && rightWantsToBeSuperiorToLeft) - throw new UnsupportedOperationException("Can not sort ServerPlayerBase classes for method '" + methodName + "'. '" + right + "' wants to be superior and inferior to '" + left + "'"); - } - - if(allInferiors == null) - allInferiors = new Hashtable>(); - - for(int i = 0; i < list.size(); i++) - build(list.get(i), null); - } - - if (withoutSuperiors == null) - withoutSuperiors = new LinkedList(); - - int offset = 0; - int size = list.size(); - - while(size > 1) - { - withoutSuperiors.clear(); - for(int i = offset; i < offset + size; i++) - withoutSuperiors.add(list.get(i)); - - if(allInferiors != null) - for(int i = offset; i < offset + size; i++) - { - Set inferiors = allInferiors.get(list.get(i)); - if (inferiors != null) - withoutSuperiors.removeAll(inferiors); - } - - boolean initial = true; - for(int i = offset; i < offset + size; i++) - { - String key = list.get(i); - if(withoutSuperiors.contains(key)) - { - if(initial) - { - Set inferiors = null; - if(allInferiors != null) - inferiors = allInferiors.get(key); - if(inferiors == null || inferiors.isEmpty()) - { - withoutSuperiors.remove(key); - size--; - offset++; - continue; - } - } - list.remove(i--); - size--; - } - initial = false; - } - list.addAll(offset + size, withoutSuperiors); - } - } - - private Set build(String type, String startType) - { - Set inferiors = allInferiors.get(type); - if(inferiors == null) - { - inferiors = build(type, null, startType != null ? startType : type); - if(inferiors == null) - inferiors = Empty; - allInferiors.put(type, inferiors); - } - return inferiors; - } - - private Set build(String type, Set inferiors, String startType) - { - Set directInferiors = directInferiorsMap.get(type); - if(directInferiors == null) - return inferiors; - - if(inferiors == null) - inferiors = new HashSet(); - - Iterator iter = directInferiors.iterator(); - while(iter.hasNext()) - { - String inferiorType = iter.next(); - if(inferiorType == startType) - throw new UnsupportedOperationException("Can not sort ServerPlayerBase classes for method '" + methodName + "'. Circular superiosity found including '" + startType + "'"); - if(list.contains(inferiorType)) - inferiors.add(inferiorType); - - Set inferiorSet; - try - { - inferiorSet = build(inferiorType, startType); - } - catch(UnsupportedOperationException uoe) - { - throw new UnsupportedOperationException("Can not sort ServerPlayerBase classes for method '" + methodName + "'. Circular superiosity found including '" + inferiorType + "'", uoe); - } - - if(inferiorSet != Empty) - inferiors.addAll(inferiorSet); - } - return inferiors; - } - - private static Map> build(String baseId, Map> map, Map> directMap, Map> otherDirectMap, String[] names) - { - if(map == null) - map = new Hashtable>(); - - Set types = new HashSet(); - for(int n = 0; n < names.length; n++) - { - if(names[n] != null) - types.add(names[n]); - } - - if(directMap != null) - getOrCreateSet(directMap, baseId).addAll(types); - - if(otherDirectMap != null) - { - Iterator iter = types.iterator(); - while(iter.hasNext()) - getOrCreateSet(otherDirectMap, iter.next()).add(baseId); - } - - map.put(baseId, types); - return map; - } - - private static Set getOrCreateSet(Map> map, String key) - { - Set value = map.get(key); - if(value != null) - return value; - - value = new HashSet(); - map.put(key, value); - return value; - } - - private Map> explicitInferiors; - private Map> explicitSuperiors; - private Map> directInferiorsMap; - private Map> allInferiors; - private List withoutSuperiors; - - private final List list; - private final Map allBaseSuperiors; - private final Map allBaseInferiors; - private final String methodName; - - private static final Set Empty = new HashSet(); -} diff --git a/dependencies/main/java/api/player/server/ServerPlayerBaseSorting.java b/dependencies/main/java/api/player/server/ServerPlayerBaseSorting.java deleted file mode 100644 index 6e5d9f8f31..0000000000 --- a/dependencies/main/java/api/player/server/ServerPlayerBaseSorting.java +++ /dev/null @@ -1,3708 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.server; - -import java.util.*; - -public final class ServerPlayerBaseSorting -{ - private String[] beforeLocalConstructingSuperiors = null; - private String[] beforeLocalConstructingInferiors = null; - private String[] afterLocalConstructingSuperiors = null; - private String[] afterLocalConstructingInferiors = null; - - private Map dynamicBeforeSuperiors = null; - private Map dynamicBeforeInferiors = null; - private Map dynamicOverrideSuperiors = null; - private Map dynamicOverrideInferiors = null; - private Map dynamicAfterSuperiors = null; - private Map dynamicAfterInferiors = null; - - private String[] beforeAddExhaustionSuperiors = null; - private String[] beforeAddExhaustionInferiors = null; - private String[] overrideAddExhaustionSuperiors = null; - private String[] overrideAddExhaustionInferiors = null; - private String[] afterAddExhaustionSuperiors = null; - private String[] afterAddExhaustionInferiors = null; - - private String[] beforeAddExperienceSuperiors = null; - private String[] beforeAddExperienceInferiors = null; - private String[] overrideAddExperienceSuperiors = null; - private String[] overrideAddExperienceInferiors = null; - private String[] afterAddExperienceSuperiors = null; - private String[] afterAddExperienceInferiors = null; - - private String[] beforeAddExperienceLevelSuperiors = null; - private String[] beforeAddExperienceLevelInferiors = null; - private String[] overrideAddExperienceLevelSuperiors = null; - private String[] overrideAddExperienceLevelInferiors = null; - private String[] afterAddExperienceLevelSuperiors = null; - private String[] afterAddExperienceLevelInferiors = null; - - private String[] beforeAddMovementStatSuperiors = null; - private String[] beforeAddMovementStatInferiors = null; - private String[] overrideAddMovementStatSuperiors = null; - private String[] overrideAddMovementStatInferiors = null; - private String[] afterAddMovementStatSuperiors = null; - private String[] afterAddMovementStatInferiors = null; - - private String[] beforeAttackEntityFromSuperiors = null; - private String[] beforeAttackEntityFromInferiors = null; - private String[] overrideAttackEntityFromSuperiors = null; - private String[] overrideAttackEntityFromInferiors = null; - private String[] afterAttackEntityFromSuperiors = null; - private String[] afterAttackEntityFromInferiors = null; - - private String[] beforeAttackTargetEntityWithCurrentItemSuperiors = null; - private String[] beforeAttackTargetEntityWithCurrentItemInferiors = null; - private String[] overrideAttackTargetEntityWithCurrentItemSuperiors = null; - private String[] overrideAttackTargetEntityWithCurrentItemInferiors = null; - private String[] afterAttackTargetEntityWithCurrentItemSuperiors = null; - private String[] afterAttackTargetEntityWithCurrentItemInferiors = null; - - private String[] beforeCanBreatheUnderwaterSuperiors = null; - private String[] beforeCanBreatheUnderwaterInferiors = null; - private String[] overrideCanBreatheUnderwaterSuperiors = null; - private String[] overrideCanBreatheUnderwaterInferiors = null; - private String[] afterCanBreatheUnderwaterSuperiors = null; - private String[] afterCanBreatheUnderwaterInferiors = null; - - private String[] beforeCanHarvestBlockSuperiors = null; - private String[] beforeCanHarvestBlockInferiors = null; - private String[] overrideCanHarvestBlockSuperiors = null; - private String[] overrideCanHarvestBlockInferiors = null; - private String[] afterCanHarvestBlockSuperiors = null; - private String[] afterCanHarvestBlockInferiors = null; - - private String[] beforeCanPlayerEditSuperiors = null; - private String[] beforeCanPlayerEditInferiors = null; - private String[] overrideCanPlayerEditSuperiors = null; - private String[] overrideCanPlayerEditInferiors = null; - private String[] afterCanPlayerEditSuperiors = null; - private String[] afterCanPlayerEditInferiors = null; - - private String[] beforeCanTriggerWalkingSuperiors = null; - private String[] beforeCanTriggerWalkingInferiors = null; - private String[] overrideCanTriggerWalkingSuperiors = null; - private String[] overrideCanTriggerWalkingInferiors = null; - private String[] afterCanTriggerWalkingSuperiors = null; - private String[] afterCanTriggerWalkingInferiors = null; - - private String[] beforeClonePlayerSuperiors = null; - private String[] beforeClonePlayerInferiors = null; - private String[] overrideClonePlayerSuperiors = null; - private String[] overrideClonePlayerInferiors = null; - private String[] afterClonePlayerSuperiors = null; - private String[] afterClonePlayerInferiors = null; - - private String[] beforeDamageEntitySuperiors = null; - private String[] beforeDamageEntityInferiors = null; - private String[] overrideDamageEntitySuperiors = null; - private String[] overrideDamageEntityInferiors = null; - private String[] afterDamageEntitySuperiors = null; - private String[] afterDamageEntityInferiors = null; - - private String[] beforeDisplayGuiSuperiors = null; - private String[] beforeDisplayGuiInferiors = null; - private String[] overrideDisplayGuiSuperiors = null; - private String[] overrideDisplayGuiInferiors = null; - private String[] afterDisplayGuiSuperiors = null; - private String[] afterDisplayGuiInferiors = null; - - private String[] beforeDisplayGUIChestSuperiors = null; - private String[] beforeDisplayGUIChestInferiors = null; - private String[] overrideDisplayGUIChestSuperiors = null; - private String[] overrideDisplayGUIChestInferiors = null; - private String[] afterDisplayGUIChestSuperiors = null; - private String[] afterDisplayGUIChestInferiors = null; - - private String[] beforeDropOneItemSuperiors = null; - private String[] beforeDropOneItemInferiors = null; - private String[] overrideDropOneItemSuperiors = null; - private String[] overrideDropOneItemInferiors = null; - private String[] afterDropOneItemSuperiors = null; - private String[] afterDropOneItemInferiors = null; - - private String[] beforeDropPlayerItemWithRandomChoiceSuperiors = null; - private String[] beforeDropPlayerItemWithRandomChoiceInferiors = null; - private String[] overrideDropPlayerItemWithRandomChoiceSuperiors = null; - private String[] overrideDropPlayerItemWithRandomChoiceInferiors = null; - private String[] afterDropPlayerItemWithRandomChoiceSuperiors = null; - private String[] afterDropPlayerItemWithRandomChoiceInferiors = null; - - private String[] beforeFallSuperiors = null; - private String[] beforeFallInferiors = null; - private String[] overrideFallSuperiors = null; - private String[] overrideFallInferiors = null; - private String[] afterFallSuperiors = null; - private String[] afterFallInferiors = null; - - private String[] beforeGetAIMoveSpeedSuperiors = null; - private String[] beforeGetAIMoveSpeedInferiors = null; - private String[] overrideGetAIMoveSpeedSuperiors = null; - private String[] overrideGetAIMoveSpeedInferiors = null; - private String[] afterGetAIMoveSpeedSuperiors = null; - private String[] afterGetAIMoveSpeedInferiors = null; - - private String[] beforeGetBreakSpeedSuperiors = null; - private String[] beforeGetBreakSpeedInferiors = null; - private String[] overrideGetBreakSpeedSuperiors = null; - private String[] overrideGetBreakSpeedInferiors = null; - private String[] afterGetBreakSpeedSuperiors = null; - private String[] afterGetBreakSpeedInferiors = null; - - private String[] beforeGetDistanceSqSuperiors = null; - private String[] beforeGetDistanceSqInferiors = null; - private String[] overrideGetDistanceSqSuperiors = null; - private String[] overrideGetDistanceSqInferiors = null; - private String[] afterGetDistanceSqSuperiors = null; - private String[] afterGetDistanceSqInferiors = null; - - private String[] beforeGetBrightnessSuperiors = null; - private String[] beforeGetBrightnessInferiors = null; - private String[] overrideGetBrightnessSuperiors = null; - private String[] overrideGetBrightnessInferiors = null; - private String[] afterGetBrightnessSuperiors = null; - private String[] afterGetBrightnessInferiors = null; - - private String[] beforeGetEyeHeightSuperiors = null; - private String[] beforeGetEyeHeightInferiors = null; - private String[] overrideGetEyeHeightSuperiors = null; - private String[] overrideGetEyeHeightInferiors = null; - private String[] afterGetEyeHeightSuperiors = null; - private String[] afterGetEyeHeightInferiors = null; - - private String[] beforeHealSuperiors = null; - private String[] beforeHealInferiors = null; - private String[] overrideHealSuperiors = null; - private String[] overrideHealInferiors = null; - private String[] afterHealSuperiors = null; - private String[] afterHealInferiors = null; - - private String[] beforeIsEntityInsideOpaqueBlockSuperiors = null; - private String[] beforeIsEntityInsideOpaqueBlockInferiors = null; - private String[] overrideIsEntityInsideOpaqueBlockSuperiors = null; - private String[] overrideIsEntityInsideOpaqueBlockInferiors = null; - private String[] afterIsEntityInsideOpaqueBlockSuperiors = null; - private String[] afterIsEntityInsideOpaqueBlockInferiors = null; - - private String[] beforeIsInWaterSuperiors = null; - private String[] beforeIsInWaterInferiors = null; - private String[] overrideIsInWaterSuperiors = null; - private String[] overrideIsInWaterInferiors = null; - private String[] afterIsInWaterSuperiors = null; - private String[] afterIsInWaterInferiors = null; - - private String[] beforeIsInsideOfMaterialSuperiors = null; - private String[] beforeIsInsideOfMaterialInferiors = null; - private String[] overrideIsInsideOfMaterialSuperiors = null; - private String[] overrideIsInsideOfMaterialInferiors = null; - private String[] afterIsInsideOfMaterialSuperiors = null; - private String[] afterIsInsideOfMaterialInferiors = null; - - private String[] beforeIsOnLadderSuperiors = null; - private String[] beforeIsOnLadderInferiors = null; - private String[] overrideIsOnLadderSuperiors = null; - private String[] overrideIsOnLadderInferiors = null; - private String[] afterIsOnLadderSuperiors = null; - private String[] afterIsOnLadderInferiors = null; - - private String[] beforeIsPlayerSleepingSuperiors = null; - private String[] beforeIsPlayerSleepingInferiors = null; - private String[] overrideIsPlayerSleepingSuperiors = null; - private String[] overrideIsPlayerSleepingInferiors = null; - private String[] afterIsPlayerSleepingSuperiors = null; - private String[] afterIsPlayerSleepingInferiors = null; - - private String[] beforeIsSneakingSuperiors = null; - private String[] beforeIsSneakingInferiors = null; - private String[] overrideIsSneakingSuperiors = null; - private String[] overrideIsSneakingInferiors = null; - private String[] afterIsSneakingSuperiors = null; - private String[] afterIsSneakingInferiors = null; - - private String[] beforeJumpSuperiors = null; - private String[] beforeJumpInferiors = null; - private String[] overrideJumpSuperiors = null; - private String[] overrideJumpInferiors = null; - private String[] afterJumpSuperiors = null; - private String[] afterJumpInferiors = null; - - private String[] beforeKnockBackSuperiors = null; - private String[] beforeKnockBackInferiors = null; - private String[] overrideKnockBackSuperiors = null; - private String[] overrideKnockBackInferiors = null; - private String[] afterKnockBackSuperiors = null; - private String[] afterKnockBackInferiors = null; - - private String[] beforeMountEntitySuperiors = null; - private String[] beforeMountEntityInferiors = null; - private String[] overrideMountEntitySuperiors = null; - private String[] overrideMountEntityInferiors = null; - private String[] afterMountEntitySuperiors = null; - private String[] afterMountEntityInferiors = null; - - private String[] beforeMoveEntitySuperiors = null; - private String[] beforeMoveEntityInferiors = null; - private String[] overrideMoveEntitySuperiors = null; - private String[] overrideMoveEntityInferiors = null; - private String[] afterMoveEntitySuperiors = null; - private String[] afterMoveEntityInferiors = null; - - private String[] beforeMoveEntityWithHeadingSuperiors = null; - private String[] beforeMoveEntityWithHeadingInferiors = null; - private String[] overrideMoveEntityWithHeadingSuperiors = null; - private String[] overrideMoveEntityWithHeadingInferiors = null; - private String[] afterMoveEntityWithHeadingSuperiors = null; - private String[] afterMoveEntityWithHeadingInferiors = null; - - private String[] beforeMoveFlyingSuperiors = null; - private String[] beforeMoveFlyingInferiors = null; - private String[] overrideMoveFlyingSuperiors = null; - private String[] overrideMoveFlyingInferiors = null; - private String[] afterMoveFlyingSuperiors = null; - private String[] afterMoveFlyingInferiors = null; - - private String[] beforeOnDeathSuperiors = null; - private String[] beforeOnDeathInferiors = null; - private String[] overrideOnDeathSuperiors = null; - private String[] overrideOnDeathInferiors = null; - private String[] afterOnDeathSuperiors = null; - private String[] afterOnDeathInferiors = null; - - private String[] beforeOnLivingUpdateSuperiors = null; - private String[] beforeOnLivingUpdateInferiors = null; - private String[] overrideOnLivingUpdateSuperiors = null; - private String[] overrideOnLivingUpdateInferiors = null; - private String[] afterOnLivingUpdateSuperiors = null; - private String[] afterOnLivingUpdateInferiors = null; - - private String[] beforeOnKillEntitySuperiors = null; - private String[] beforeOnKillEntityInferiors = null; - private String[] overrideOnKillEntitySuperiors = null; - private String[] overrideOnKillEntityInferiors = null; - private String[] afterOnKillEntitySuperiors = null; - private String[] afterOnKillEntityInferiors = null; - - private String[] beforeOnStruckByLightningSuperiors = null; - private String[] beforeOnStruckByLightningInferiors = null; - private String[] overrideOnStruckByLightningSuperiors = null; - private String[] overrideOnStruckByLightningInferiors = null; - private String[] afterOnStruckByLightningSuperiors = null; - private String[] afterOnStruckByLightningInferiors = null; - - private String[] beforeOnUpdateSuperiors = null; - private String[] beforeOnUpdateInferiors = null; - private String[] overrideOnUpdateSuperiors = null; - private String[] overrideOnUpdateInferiors = null; - private String[] afterOnUpdateSuperiors = null; - private String[] afterOnUpdateInferiors = null; - - private String[] beforeOnUpdateEntitySuperiors = null; - private String[] beforeOnUpdateEntityInferiors = null; - private String[] overrideOnUpdateEntitySuperiors = null; - private String[] overrideOnUpdateEntityInferiors = null; - private String[] afterOnUpdateEntitySuperiors = null; - private String[] afterOnUpdateEntityInferiors = null; - - private String[] beforeReadEntityFromNBTSuperiors = null; - private String[] beforeReadEntityFromNBTInferiors = null; - private String[] overrideReadEntityFromNBTSuperiors = null; - private String[] overrideReadEntityFromNBTInferiors = null; - private String[] afterReadEntityFromNBTSuperiors = null; - private String[] afterReadEntityFromNBTInferiors = null; - - private String[] beforeSetDeadSuperiors = null; - private String[] beforeSetDeadInferiors = null; - private String[] overrideSetDeadSuperiors = null; - private String[] overrideSetDeadInferiors = null; - private String[] afterSetDeadSuperiors = null; - private String[] afterSetDeadInferiors = null; - - private String[] beforeSetEntityActionStateSuperiors = null; - private String[] beforeSetEntityActionStateInferiors = null; - private String[] overrideSetEntityActionStateSuperiors = null; - private String[] overrideSetEntityActionStateInferiors = null; - private String[] afterSetEntityActionStateSuperiors = null; - private String[] afterSetEntityActionStateInferiors = null; - - private String[] beforeSetPositionSuperiors = null; - private String[] beforeSetPositionInferiors = null; - private String[] overrideSetPositionSuperiors = null; - private String[] overrideSetPositionInferiors = null; - private String[] afterSetPositionSuperiors = null; - private String[] afterSetPositionInferiors = null; - - private String[] beforeSetSneakingSuperiors = null; - private String[] beforeSetSneakingInferiors = null; - private String[] overrideSetSneakingSuperiors = null; - private String[] overrideSetSneakingInferiors = null; - private String[] afterSetSneakingSuperiors = null; - private String[] afterSetSneakingInferiors = null; - - private String[] beforeSetSprintingSuperiors = null; - private String[] beforeSetSprintingInferiors = null; - private String[] overrideSetSprintingSuperiors = null; - private String[] overrideSetSprintingInferiors = null; - private String[] afterSetSprintingSuperiors = null; - private String[] afterSetSprintingInferiors = null; - - private String[] beforeSwingItemSuperiors = null; - private String[] beforeSwingItemInferiors = null; - private String[] overrideSwingItemSuperiors = null; - private String[] overrideSwingItemInferiors = null; - private String[] afterSwingItemSuperiors = null; - private String[] afterSwingItemInferiors = null; - - private String[] beforeUpdateEntityActionStateSuperiors = null; - private String[] beforeUpdateEntityActionStateInferiors = null; - private String[] overrideUpdateEntityActionStateSuperiors = null; - private String[] overrideUpdateEntityActionStateInferiors = null; - private String[] afterUpdateEntityActionStateSuperiors = null; - private String[] afterUpdateEntityActionStateInferiors = null; - - private String[] beforeUpdatePotionEffectsSuperiors = null; - private String[] beforeUpdatePotionEffectsInferiors = null; - private String[] overrideUpdatePotionEffectsSuperiors = null; - private String[] overrideUpdatePotionEffectsInferiors = null; - private String[] afterUpdatePotionEffectsSuperiors = null; - private String[] afterUpdatePotionEffectsInferiors = null; - - private String[] beforeUpdateRiddenSuperiors = null; - private String[] beforeUpdateRiddenInferiors = null; - private String[] overrideUpdateRiddenSuperiors = null; - private String[] overrideUpdateRiddenInferiors = null; - private String[] afterUpdateRiddenSuperiors = null; - private String[] afterUpdateRiddenInferiors = null; - - private String[] beforeWakeUpPlayerSuperiors = null; - private String[] beforeWakeUpPlayerInferiors = null; - private String[] overrideWakeUpPlayerSuperiors = null; - private String[] overrideWakeUpPlayerInferiors = null; - private String[] afterWakeUpPlayerSuperiors = null; - private String[] afterWakeUpPlayerInferiors = null; - - private String[] beforeWriteEntityToNBTSuperiors = null; - private String[] beforeWriteEntityToNBTInferiors = null; - private String[] overrideWriteEntityToNBTSuperiors = null; - private String[] overrideWriteEntityToNBTInferiors = null; - private String[] afterWriteEntityToNBTSuperiors = null; - private String[] afterWriteEntityToNBTInferiors = null; - - - public String[] getBeforeLocalConstructingSuperiors() - { - return beforeLocalConstructingSuperiors; - } - - public String[] getBeforeLocalConstructingInferiors() - { - return beforeLocalConstructingInferiors; - } - - public String[] getAfterLocalConstructingSuperiors() - { - return afterLocalConstructingSuperiors; - } - - public String[] getAfterLocalConstructingInferiors() - { - return afterLocalConstructingInferiors; - } - - public void setBeforeLocalConstructingSuperiors(String[] value) - { - beforeLocalConstructingSuperiors = value; - } - - public void setBeforeLocalConstructingInferiors(String[] value) - { - beforeLocalConstructingInferiors = value; - } - - public void setAfterLocalConstructingSuperiors(String[] value) - { - afterLocalConstructingSuperiors = value; - } - - public void setAfterLocalConstructingInferiors(String[] value) - { - afterLocalConstructingInferiors = value; - } - - public Map getDynamicBeforeSuperiors() - { - return dynamicBeforeSuperiors; - } - - public Map getDynamicBeforeInferiors() - { - return dynamicBeforeInferiors; - } - - public Map getDynamicOverrideSuperiors() - { - return dynamicOverrideSuperiors; - } - - public Map getDynamicOverrideInferiors() - { - return dynamicOverrideInferiors; - } - - public Map getDynamicAfterSuperiors() - { - return dynamicAfterSuperiors; - } - - public Map getDynamicAfterInferiors() - { - return dynamicAfterInferiors; - } - - public void setDynamicBeforeSuperiors(String name, String[] superiors) - { - dynamicBeforeSuperiors = setDynamic(name, superiors, dynamicBeforeSuperiors); - } - - public void setDynamicBeforeInferiors(String name, String[] inferiors) - { - dynamicBeforeInferiors = setDynamic(name, inferiors, dynamicBeforeInferiors); - } - - public void setDynamicOverrideSuperiors(String name, String[] superiors) - { - dynamicOverrideSuperiors = setDynamic(name, superiors, dynamicOverrideSuperiors); - } - - public void setDynamicOverrideInferiors(String name, String[] inferiors) - { - dynamicOverrideInferiors = setDynamic(name, inferiors, dynamicOverrideInferiors); - } - - public void setDynamicAfterSuperiors(String name, String[] superiors) - { - dynamicAfterSuperiors = setDynamic(name, superiors, dynamicAfterSuperiors); - } - - public void setDynamicAfterInferiors(String name, String[] inferiors) - { - dynamicAfterInferiors = setDynamic(name, inferiors, dynamicAfterInferiors); - } - - private Map setDynamic(String name, String[] names, Map map) - { - if(name == null) - throw new IllegalArgumentException("Parameter 'name' may not be null"); - - if(names == null) - { - if(map != null) - map.remove(name); - return map; - } - - if(map == null) - map = new HashMap(); - map.put(name, names); - - return map; - } - - public String[] getBeforeAddExhaustionSuperiors() - { - return beforeAddExhaustionSuperiors; - } - - public String[] getBeforeAddExhaustionInferiors() - { - return beforeAddExhaustionInferiors; - } - - public String[] getOverrideAddExhaustionSuperiors() - { - return overrideAddExhaustionSuperiors; - } - - public String[] getOverrideAddExhaustionInferiors() - { - return overrideAddExhaustionInferiors; - } - - public String[] getAfterAddExhaustionSuperiors() - { - return afterAddExhaustionSuperiors; - } - - public String[] getAfterAddExhaustionInferiors() - { - return afterAddExhaustionInferiors; - } - - public void setBeforeAddExhaustionSuperiors(String[] value) - { - beforeAddExhaustionSuperiors = value; - } - - public void setBeforeAddExhaustionInferiors(String[] value) - { - beforeAddExhaustionInferiors = value; - } - - public void setOverrideAddExhaustionSuperiors(String[] value) - { - overrideAddExhaustionSuperiors = value; - } - - public void setOverrideAddExhaustionInferiors(String[] value) - { - overrideAddExhaustionInferiors = value; - } - - public void setAfterAddExhaustionSuperiors(String[] value) - { - afterAddExhaustionSuperiors = value; - } - - public void setAfterAddExhaustionInferiors(String[] value) - { - afterAddExhaustionInferiors = value; - } - - public String[] getBeforeAddExperienceSuperiors() - { - return beforeAddExperienceSuperiors; - } - - public String[] getBeforeAddExperienceInferiors() - { - return beforeAddExperienceInferiors; - } - - public String[] getOverrideAddExperienceSuperiors() - { - return overrideAddExperienceSuperiors; - } - - public String[] getOverrideAddExperienceInferiors() - { - return overrideAddExperienceInferiors; - } - - public String[] getAfterAddExperienceSuperiors() - { - return afterAddExperienceSuperiors; - } - - public String[] getAfterAddExperienceInferiors() - { - return afterAddExperienceInferiors; - } - - public void setBeforeAddExperienceSuperiors(String[] value) - { - beforeAddExperienceSuperiors = value; - } - - public void setBeforeAddExperienceInferiors(String[] value) - { - beforeAddExperienceInferiors = value; - } - - public void setOverrideAddExperienceSuperiors(String[] value) - { - overrideAddExperienceSuperiors = value; - } - - public void setOverrideAddExperienceInferiors(String[] value) - { - overrideAddExperienceInferiors = value; - } - - public void setAfterAddExperienceSuperiors(String[] value) - { - afterAddExperienceSuperiors = value; - } - - public void setAfterAddExperienceInferiors(String[] value) - { - afterAddExperienceInferiors = value; - } - - public String[] getBeforeAddExperienceLevelSuperiors() - { - return beforeAddExperienceLevelSuperiors; - } - - public String[] getBeforeAddExperienceLevelInferiors() - { - return beforeAddExperienceLevelInferiors; - } - - public String[] getOverrideAddExperienceLevelSuperiors() - { - return overrideAddExperienceLevelSuperiors; - } - - public String[] getOverrideAddExperienceLevelInferiors() - { - return overrideAddExperienceLevelInferiors; - } - - public String[] getAfterAddExperienceLevelSuperiors() - { - return afterAddExperienceLevelSuperiors; - } - - public String[] getAfterAddExperienceLevelInferiors() - { - return afterAddExperienceLevelInferiors; - } - - public void setBeforeAddExperienceLevelSuperiors(String[] value) - { - beforeAddExperienceLevelSuperiors = value; - } - - public void setBeforeAddExperienceLevelInferiors(String[] value) - { - beforeAddExperienceLevelInferiors = value; - } - - public void setOverrideAddExperienceLevelSuperiors(String[] value) - { - overrideAddExperienceLevelSuperiors = value; - } - - public void setOverrideAddExperienceLevelInferiors(String[] value) - { - overrideAddExperienceLevelInferiors = value; - } - - public void setAfterAddExperienceLevelSuperiors(String[] value) - { - afterAddExperienceLevelSuperiors = value; - } - - public void setAfterAddExperienceLevelInferiors(String[] value) - { - afterAddExperienceLevelInferiors = value; - } - - public String[] getBeforeAddMovementStatSuperiors() - { - return beforeAddMovementStatSuperiors; - } - - public String[] getBeforeAddMovementStatInferiors() - { - return beforeAddMovementStatInferiors; - } - - public String[] getOverrideAddMovementStatSuperiors() - { - return overrideAddMovementStatSuperiors; - } - - public String[] getOverrideAddMovementStatInferiors() - { - return overrideAddMovementStatInferiors; - } - - public String[] getAfterAddMovementStatSuperiors() - { - return afterAddMovementStatSuperiors; - } - - public String[] getAfterAddMovementStatInferiors() - { - return afterAddMovementStatInferiors; - } - - public void setBeforeAddMovementStatSuperiors(String[] value) - { - beforeAddMovementStatSuperiors = value; - } - - public void setBeforeAddMovementStatInferiors(String[] value) - { - beforeAddMovementStatInferiors = value; - } - - public void setOverrideAddMovementStatSuperiors(String[] value) - { - overrideAddMovementStatSuperiors = value; - } - - public void setOverrideAddMovementStatInferiors(String[] value) - { - overrideAddMovementStatInferiors = value; - } - - public void setAfterAddMovementStatSuperiors(String[] value) - { - afterAddMovementStatSuperiors = value; - } - - public void setAfterAddMovementStatInferiors(String[] value) - { - afterAddMovementStatInferiors = value; - } - - public String[] getBeforeAttackEntityFromSuperiors() - { - return beforeAttackEntityFromSuperiors; - } - - public String[] getBeforeAttackEntityFromInferiors() - { - return beforeAttackEntityFromInferiors; - } - - public String[] getOverrideAttackEntityFromSuperiors() - { - return overrideAttackEntityFromSuperiors; - } - - public String[] getOverrideAttackEntityFromInferiors() - { - return overrideAttackEntityFromInferiors; - } - - public String[] getAfterAttackEntityFromSuperiors() - { - return afterAttackEntityFromSuperiors; - } - - public String[] getAfterAttackEntityFromInferiors() - { - return afterAttackEntityFromInferiors; - } - - public void setBeforeAttackEntityFromSuperiors(String[] value) - { - beforeAttackEntityFromSuperiors = value; - } - - public void setBeforeAttackEntityFromInferiors(String[] value) - { - beforeAttackEntityFromInferiors = value; - } - - public void setOverrideAttackEntityFromSuperiors(String[] value) - { - overrideAttackEntityFromSuperiors = value; - } - - public void setOverrideAttackEntityFromInferiors(String[] value) - { - overrideAttackEntityFromInferiors = value; - } - - public void setAfterAttackEntityFromSuperiors(String[] value) - { - afterAttackEntityFromSuperiors = value; - } - - public void setAfterAttackEntityFromInferiors(String[] value) - { - afterAttackEntityFromInferiors = value; - } - - public String[] getBeforeAttackTargetEntityWithCurrentItemSuperiors() - { - return beforeAttackTargetEntityWithCurrentItemSuperiors; - } - - public String[] getBeforeAttackTargetEntityWithCurrentItemInferiors() - { - return beforeAttackTargetEntityWithCurrentItemInferiors; - } - - public String[] getOverrideAttackTargetEntityWithCurrentItemSuperiors() - { - return overrideAttackTargetEntityWithCurrentItemSuperiors; - } - - public String[] getOverrideAttackTargetEntityWithCurrentItemInferiors() - { - return overrideAttackTargetEntityWithCurrentItemInferiors; - } - - public String[] getAfterAttackTargetEntityWithCurrentItemSuperiors() - { - return afterAttackTargetEntityWithCurrentItemSuperiors; - } - - public String[] getAfterAttackTargetEntityWithCurrentItemInferiors() - { - return afterAttackTargetEntityWithCurrentItemInferiors; - } - - public void setBeforeAttackTargetEntityWithCurrentItemSuperiors(String[] value) - { - beforeAttackTargetEntityWithCurrentItemSuperiors = value; - } - - public void setBeforeAttackTargetEntityWithCurrentItemInferiors(String[] value) - { - beforeAttackTargetEntityWithCurrentItemInferiors = value; - } - - public void setOverrideAttackTargetEntityWithCurrentItemSuperiors(String[] value) - { - overrideAttackTargetEntityWithCurrentItemSuperiors = value; - } - - public void setOverrideAttackTargetEntityWithCurrentItemInferiors(String[] value) - { - overrideAttackTargetEntityWithCurrentItemInferiors = value; - } - - public void setAfterAttackTargetEntityWithCurrentItemSuperiors(String[] value) - { - afterAttackTargetEntityWithCurrentItemSuperiors = value; - } - - public void setAfterAttackTargetEntityWithCurrentItemInferiors(String[] value) - { - afterAttackTargetEntityWithCurrentItemInferiors = value; - } - - public String[] getBeforeCanBreatheUnderwaterSuperiors() - { - return beforeCanBreatheUnderwaterSuperiors; - } - - public String[] getBeforeCanBreatheUnderwaterInferiors() - { - return beforeCanBreatheUnderwaterInferiors; - } - - public String[] getOverrideCanBreatheUnderwaterSuperiors() - { - return overrideCanBreatheUnderwaterSuperiors; - } - - public String[] getOverrideCanBreatheUnderwaterInferiors() - { - return overrideCanBreatheUnderwaterInferiors; - } - - public String[] getAfterCanBreatheUnderwaterSuperiors() - { - return afterCanBreatheUnderwaterSuperiors; - } - - public String[] getAfterCanBreatheUnderwaterInferiors() - { - return afterCanBreatheUnderwaterInferiors; - } - - public void setBeforeCanBreatheUnderwaterSuperiors(String[] value) - { - beforeCanBreatheUnderwaterSuperiors = value; - } - - public void setBeforeCanBreatheUnderwaterInferiors(String[] value) - { - beforeCanBreatheUnderwaterInferiors = value; - } - - public void setOverrideCanBreatheUnderwaterSuperiors(String[] value) - { - overrideCanBreatheUnderwaterSuperiors = value; - } - - public void setOverrideCanBreatheUnderwaterInferiors(String[] value) - { - overrideCanBreatheUnderwaterInferiors = value; - } - - public void setAfterCanBreatheUnderwaterSuperiors(String[] value) - { - afterCanBreatheUnderwaterSuperiors = value; - } - - public void setAfterCanBreatheUnderwaterInferiors(String[] value) - { - afterCanBreatheUnderwaterInferiors = value; - } - - public String[] getBeforeCanHarvestBlockSuperiors() - { - return beforeCanHarvestBlockSuperiors; - } - - public String[] getBeforeCanHarvestBlockInferiors() - { - return beforeCanHarvestBlockInferiors; - } - - public String[] getOverrideCanHarvestBlockSuperiors() - { - return overrideCanHarvestBlockSuperiors; - } - - public String[] getOverrideCanHarvestBlockInferiors() - { - return overrideCanHarvestBlockInferiors; - } - - public String[] getAfterCanHarvestBlockSuperiors() - { - return afterCanHarvestBlockSuperiors; - } - - public String[] getAfterCanHarvestBlockInferiors() - { - return afterCanHarvestBlockInferiors; - } - - public void setBeforeCanHarvestBlockSuperiors(String[] value) - { - beforeCanHarvestBlockSuperiors = value; - } - - public void setBeforeCanHarvestBlockInferiors(String[] value) - { - beforeCanHarvestBlockInferiors = value; - } - - public void setOverrideCanHarvestBlockSuperiors(String[] value) - { - overrideCanHarvestBlockSuperiors = value; - } - - public void setOverrideCanHarvestBlockInferiors(String[] value) - { - overrideCanHarvestBlockInferiors = value; - } - - public void setAfterCanHarvestBlockSuperiors(String[] value) - { - afterCanHarvestBlockSuperiors = value; - } - - public void setAfterCanHarvestBlockInferiors(String[] value) - { - afterCanHarvestBlockInferiors = value; - } - - public String[] getBeforeCanPlayerEditSuperiors() - { - return beforeCanPlayerEditSuperiors; - } - - public String[] getBeforeCanPlayerEditInferiors() - { - return beforeCanPlayerEditInferiors; - } - - public String[] getOverrideCanPlayerEditSuperiors() - { - return overrideCanPlayerEditSuperiors; - } - - public String[] getOverrideCanPlayerEditInferiors() - { - return overrideCanPlayerEditInferiors; - } - - public String[] getAfterCanPlayerEditSuperiors() - { - return afterCanPlayerEditSuperiors; - } - - public String[] getAfterCanPlayerEditInferiors() - { - return afterCanPlayerEditInferiors; - } - - public void setBeforeCanPlayerEditSuperiors(String[] value) - { - beforeCanPlayerEditSuperiors = value; - } - - public void setBeforeCanPlayerEditInferiors(String[] value) - { - beforeCanPlayerEditInferiors = value; - } - - public void setOverrideCanPlayerEditSuperiors(String[] value) - { - overrideCanPlayerEditSuperiors = value; - } - - public void setOverrideCanPlayerEditInferiors(String[] value) - { - overrideCanPlayerEditInferiors = value; - } - - public void setAfterCanPlayerEditSuperiors(String[] value) - { - afterCanPlayerEditSuperiors = value; - } - - public void setAfterCanPlayerEditInferiors(String[] value) - { - afterCanPlayerEditInferiors = value; - } - - public String[] getBeforeCanTriggerWalkingSuperiors() - { - return beforeCanTriggerWalkingSuperiors; - } - - public String[] getBeforeCanTriggerWalkingInferiors() - { - return beforeCanTriggerWalkingInferiors; - } - - public String[] getOverrideCanTriggerWalkingSuperiors() - { - return overrideCanTriggerWalkingSuperiors; - } - - public String[] getOverrideCanTriggerWalkingInferiors() - { - return overrideCanTriggerWalkingInferiors; - } - - public String[] getAfterCanTriggerWalkingSuperiors() - { - return afterCanTriggerWalkingSuperiors; - } - - public String[] getAfterCanTriggerWalkingInferiors() - { - return afterCanTriggerWalkingInferiors; - } - - public void setBeforeCanTriggerWalkingSuperiors(String[] value) - { - beforeCanTriggerWalkingSuperiors = value; - } - - public void setBeforeCanTriggerWalkingInferiors(String[] value) - { - beforeCanTriggerWalkingInferiors = value; - } - - public void setOverrideCanTriggerWalkingSuperiors(String[] value) - { - overrideCanTriggerWalkingSuperiors = value; - } - - public void setOverrideCanTriggerWalkingInferiors(String[] value) - { - overrideCanTriggerWalkingInferiors = value; - } - - public void setAfterCanTriggerWalkingSuperiors(String[] value) - { - afterCanTriggerWalkingSuperiors = value; - } - - public void setAfterCanTriggerWalkingInferiors(String[] value) - { - afterCanTriggerWalkingInferiors = value; - } - - public String[] getBeforeClonePlayerSuperiors() - { - return beforeClonePlayerSuperiors; - } - - public String[] getBeforeClonePlayerInferiors() - { - return beforeClonePlayerInferiors; - } - - public String[] getOverrideClonePlayerSuperiors() - { - return overrideClonePlayerSuperiors; - } - - public String[] getOverrideClonePlayerInferiors() - { - return overrideClonePlayerInferiors; - } - - public String[] getAfterClonePlayerSuperiors() - { - return afterClonePlayerSuperiors; - } - - public String[] getAfterClonePlayerInferiors() - { - return afterClonePlayerInferiors; - } - - public void setBeforeClonePlayerSuperiors(String[] value) - { - beforeClonePlayerSuperiors = value; - } - - public void setBeforeClonePlayerInferiors(String[] value) - { - beforeClonePlayerInferiors = value; - } - - public void setOverrideClonePlayerSuperiors(String[] value) - { - overrideClonePlayerSuperiors = value; - } - - public void setOverrideClonePlayerInferiors(String[] value) - { - overrideClonePlayerInferiors = value; - } - - public void setAfterClonePlayerSuperiors(String[] value) - { - afterClonePlayerSuperiors = value; - } - - public void setAfterClonePlayerInferiors(String[] value) - { - afterClonePlayerInferiors = value; - } - - public String[] getBeforeDamageEntitySuperiors() - { - return beforeDamageEntitySuperiors; - } - - public String[] getBeforeDamageEntityInferiors() - { - return beforeDamageEntityInferiors; - } - - public String[] getOverrideDamageEntitySuperiors() - { - return overrideDamageEntitySuperiors; - } - - public String[] getOverrideDamageEntityInferiors() - { - return overrideDamageEntityInferiors; - } - - public String[] getAfterDamageEntitySuperiors() - { - return afterDamageEntitySuperiors; - } - - public String[] getAfterDamageEntityInferiors() - { - return afterDamageEntityInferiors; - } - - public void setBeforeDamageEntitySuperiors(String[] value) - { - beforeDamageEntitySuperiors = value; - } - - public void setBeforeDamageEntityInferiors(String[] value) - { - beforeDamageEntityInferiors = value; - } - - public void setOverrideDamageEntitySuperiors(String[] value) - { - overrideDamageEntitySuperiors = value; - } - - public void setOverrideDamageEntityInferiors(String[] value) - { - overrideDamageEntityInferiors = value; - } - - public void setAfterDamageEntitySuperiors(String[] value) - { - afterDamageEntitySuperiors = value; - } - - public void setAfterDamageEntityInferiors(String[] value) - { - afterDamageEntityInferiors = value; - } - - public String[] getBeforeDisplayGuiSuperiors() - { - return beforeDisplayGuiSuperiors; - } - - public String[] getBeforeDisplayGuiInferiors() - { - return beforeDisplayGuiInferiors; - } - - public String[] getOverrideDisplayGuiSuperiors() - { - return overrideDisplayGuiSuperiors; - } - - public String[] getOverrideDisplayGuiInferiors() - { - return overrideDisplayGuiInferiors; - } - - public String[] getAfterDisplayGuiSuperiors() - { - return afterDisplayGuiSuperiors; - } - - public String[] getAfterDisplayGuiInferiors() - { - return afterDisplayGuiInferiors; - } - - public void setBeforeDisplayGuiSuperiors(String[] value) - { - beforeDisplayGuiSuperiors = value; - } - - public void setBeforeDisplayGuiInferiors(String[] value) - { - beforeDisplayGuiInferiors = value; - } - - public void setOverrideDisplayGuiSuperiors(String[] value) - { - overrideDisplayGuiSuperiors = value; - } - - public void setOverrideDisplayGuiInferiors(String[] value) - { - overrideDisplayGuiInferiors = value; - } - - public void setAfterDisplayGuiSuperiors(String[] value) - { - afterDisplayGuiSuperiors = value; - } - - public void setAfterDisplayGuiInferiors(String[] value) - { - afterDisplayGuiInferiors = value; - } - - public String[] getBeforeDisplayGUIChestSuperiors() - { - return beforeDisplayGUIChestSuperiors; - } - - public String[] getBeforeDisplayGUIChestInferiors() - { - return beforeDisplayGUIChestInferiors; - } - - public String[] getOverrideDisplayGUIChestSuperiors() - { - return overrideDisplayGUIChestSuperiors; - } - - public String[] getOverrideDisplayGUIChestInferiors() - { - return overrideDisplayGUIChestInferiors; - } - - public String[] getAfterDisplayGUIChestSuperiors() - { - return afterDisplayGUIChestSuperiors; - } - - public String[] getAfterDisplayGUIChestInferiors() - { - return afterDisplayGUIChestInferiors; - } - - public void setBeforeDisplayGUIChestSuperiors(String[] value) - { - beforeDisplayGUIChestSuperiors = value; - } - - public void setBeforeDisplayGUIChestInferiors(String[] value) - { - beforeDisplayGUIChestInferiors = value; - } - - public void setOverrideDisplayGUIChestSuperiors(String[] value) - { - overrideDisplayGUIChestSuperiors = value; - } - - public void setOverrideDisplayGUIChestInferiors(String[] value) - { - overrideDisplayGUIChestInferiors = value; - } - - public void setAfterDisplayGUIChestSuperiors(String[] value) - { - afterDisplayGUIChestSuperiors = value; - } - - public void setAfterDisplayGUIChestInferiors(String[] value) - { - afterDisplayGUIChestInferiors = value; - } - - public String[] getBeforeDropOneItemSuperiors() - { - return beforeDropOneItemSuperiors; - } - - public String[] getBeforeDropOneItemInferiors() - { - return beforeDropOneItemInferiors; - } - - public String[] getOverrideDropOneItemSuperiors() - { - return overrideDropOneItemSuperiors; - } - - public String[] getOverrideDropOneItemInferiors() - { - return overrideDropOneItemInferiors; - } - - public String[] getAfterDropOneItemSuperiors() - { - return afterDropOneItemSuperiors; - } - - public String[] getAfterDropOneItemInferiors() - { - return afterDropOneItemInferiors; - } - - public void setBeforeDropOneItemSuperiors(String[] value) - { - beforeDropOneItemSuperiors = value; - } - - public void setBeforeDropOneItemInferiors(String[] value) - { - beforeDropOneItemInferiors = value; - } - - public void setOverrideDropOneItemSuperiors(String[] value) - { - overrideDropOneItemSuperiors = value; - } - - public void setOverrideDropOneItemInferiors(String[] value) - { - overrideDropOneItemInferiors = value; - } - - public void setAfterDropOneItemSuperiors(String[] value) - { - afterDropOneItemSuperiors = value; - } - - public void setAfterDropOneItemInferiors(String[] value) - { - afterDropOneItemInferiors = value; - } - - public String[] getBeforeDropPlayerItemWithRandomChoiceSuperiors() - { - return beforeDropPlayerItemWithRandomChoiceSuperiors; - } - - public String[] getBeforeDropPlayerItemWithRandomChoiceInferiors() - { - return beforeDropPlayerItemWithRandomChoiceInferiors; - } - - public String[] getOverrideDropPlayerItemWithRandomChoiceSuperiors() - { - return overrideDropPlayerItemWithRandomChoiceSuperiors; - } - - public String[] getOverrideDropPlayerItemWithRandomChoiceInferiors() - { - return overrideDropPlayerItemWithRandomChoiceInferiors; - } - - public String[] getAfterDropPlayerItemWithRandomChoiceSuperiors() - { - return afterDropPlayerItemWithRandomChoiceSuperiors; - } - - public String[] getAfterDropPlayerItemWithRandomChoiceInferiors() - { - return afterDropPlayerItemWithRandomChoiceInferiors; - } - - public void setBeforeDropPlayerItemWithRandomChoiceSuperiors(String[] value) - { - beforeDropPlayerItemWithRandomChoiceSuperiors = value; - } - - public void setBeforeDropPlayerItemWithRandomChoiceInferiors(String[] value) - { - beforeDropPlayerItemWithRandomChoiceInferiors = value; - } - - public void setOverrideDropPlayerItemWithRandomChoiceSuperiors(String[] value) - { - overrideDropPlayerItemWithRandomChoiceSuperiors = value; - } - - public void setOverrideDropPlayerItemWithRandomChoiceInferiors(String[] value) - { - overrideDropPlayerItemWithRandomChoiceInferiors = value; - } - - public void setAfterDropPlayerItemWithRandomChoiceSuperiors(String[] value) - { - afterDropPlayerItemWithRandomChoiceSuperiors = value; - } - - public void setAfterDropPlayerItemWithRandomChoiceInferiors(String[] value) - { - afterDropPlayerItemWithRandomChoiceInferiors = value; - } - - public String[] getBeforeFallSuperiors() - { - return beforeFallSuperiors; - } - - public String[] getBeforeFallInferiors() - { - return beforeFallInferiors; - } - - public String[] getOverrideFallSuperiors() - { - return overrideFallSuperiors; - } - - public String[] getOverrideFallInferiors() - { - return overrideFallInferiors; - } - - public String[] getAfterFallSuperiors() - { - return afterFallSuperiors; - } - - public String[] getAfterFallInferiors() - { - return afterFallInferiors; - } - - public void setBeforeFallSuperiors(String[] value) - { - beforeFallSuperiors = value; - } - - public void setBeforeFallInferiors(String[] value) - { - beforeFallInferiors = value; - } - - public void setOverrideFallSuperiors(String[] value) - { - overrideFallSuperiors = value; - } - - public void setOverrideFallInferiors(String[] value) - { - overrideFallInferiors = value; - } - - public void setAfterFallSuperiors(String[] value) - { - afterFallSuperiors = value; - } - - public void setAfterFallInferiors(String[] value) - { - afterFallInferiors = value; - } - - public String[] getBeforeGetAIMoveSpeedSuperiors() - { - return beforeGetAIMoveSpeedSuperiors; - } - - public String[] getBeforeGetAIMoveSpeedInferiors() - { - return beforeGetAIMoveSpeedInferiors; - } - - public String[] getOverrideGetAIMoveSpeedSuperiors() - { - return overrideGetAIMoveSpeedSuperiors; - } - - public String[] getOverrideGetAIMoveSpeedInferiors() - { - return overrideGetAIMoveSpeedInferiors; - } - - public String[] getAfterGetAIMoveSpeedSuperiors() - { - return afterGetAIMoveSpeedSuperiors; - } - - public String[] getAfterGetAIMoveSpeedInferiors() - { - return afterGetAIMoveSpeedInferiors; - } - - public void setBeforeGetAIMoveSpeedSuperiors(String[] value) - { - beforeGetAIMoveSpeedSuperiors = value; - } - - public void setBeforeGetAIMoveSpeedInferiors(String[] value) - { - beforeGetAIMoveSpeedInferiors = value; - } - - public void setOverrideGetAIMoveSpeedSuperiors(String[] value) - { - overrideGetAIMoveSpeedSuperiors = value; - } - - public void setOverrideGetAIMoveSpeedInferiors(String[] value) - { - overrideGetAIMoveSpeedInferiors = value; - } - - public void setAfterGetAIMoveSpeedSuperiors(String[] value) - { - afterGetAIMoveSpeedSuperiors = value; - } - - public void setAfterGetAIMoveSpeedInferiors(String[] value) - { - afterGetAIMoveSpeedInferiors = value; - } - - public String[] getBeforeGetBreakSpeedSuperiors() - { - return beforeGetBreakSpeedSuperiors; - } - - public String[] getBeforeGetBreakSpeedInferiors() - { - return beforeGetBreakSpeedInferiors; - } - - public String[] getOverrideGetBreakSpeedSuperiors() - { - return overrideGetBreakSpeedSuperiors; - } - - public String[] getOverrideGetBreakSpeedInferiors() - { - return overrideGetBreakSpeedInferiors; - } - - public String[] getAfterGetBreakSpeedSuperiors() - { - return afterGetBreakSpeedSuperiors; - } - - public String[] getAfterGetBreakSpeedInferiors() - { - return afterGetBreakSpeedInferiors; - } - - public void setBeforeGetBreakSpeedSuperiors(String[] value) - { - beforeGetBreakSpeedSuperiors = value; - } - - public void setBeforeGetBreakSpeedInferiors(String[] value) - { - beforeGetBreakSpeedInferiors = value; - } - - public void setOverrideGetBreakSpeedSuperiors(String[] value) - { - overrideGetBreakSpeedSuperiors = value; - } - - public void setOverrideGetBreakSpeedInferiors(String[] value) - { - overrideGetBreakSpeedInferiors = value; - } - - public void setAfterGetBreakSpeedSuperiors(String[] value) - { - afterGetBreakSpeedSuperiors = value; - } - - public void setAfterGetBreakSpeedInferiors(String[] value) - { - afterGetBreakSpeedInferiors = value; - } - - public String[] getBeforeGetDistanceSqSuperiors() - { - return beforeGetDistanceSqSuperiors; - } - - public String[] getBeforeGetDistanceSqInferiors() - { - return beforeGetDistanceSqInferiors; - } - - public String[] getOverrideGetDistanceSqSuperiors() - { - return overrideGetDistanceSqSuperiors; - } - - public String[] getOverrideGetDistanceSqInferiors() - { - return overrideGetDistanceSqInferiors; - } - - public String[] getAfterGetDistanceSqSuperiors() - { - return afterGetDistanceSqSuperiors; - } - - public String[] getAfterGetDistanceSqInferiors() - { - return afterGetDistanceSqInferiors; - } - - public void setBeforeGetDistanceSqSuperiors(String[] value) - { - beforeGetDistanceSqSuperiors = value; - } - - public void setBeforeGetDistanceSqInferiors(String[] value) - { - beforeGetDistanceSqInferiors = value; - } - - public void setOverrideGetDistanceSqSuperiors(String[] value) - { - overrideGetDistanceSqSuperiors = value; - } - - public void setOverrideGetDistanceSqInferiors(String[] value) - { - overrideGetDistanceSqInferiors = value; - } - - public void setAfterGetDistanceSqSuperiors(String[] value) - { - afterGetDistanceSqSuperiors = value; - } - - public void setAfterGetDistanceSqInferiors(String[] value) - { - afterGetDistanceSqInferiors = value; - } - - public String[] getBeforeGetBrightnessSuperiors() - { - return beforeGetBrightnessSuperiors; - } - - public String[] getBeforeGetBrightnessInferiors() - { - return beforeGetBrightnessInferiors; - } - - public String[] getOverrideGetBrightnessSuperiors() - { - return overrideGetBrightnessSuperiors; - } - - public String[] getOverrideGetBrightnessInferiors() - { - return overrideGetBrightnessInferiors; - } - - public String[] getAfterGetBrightnessSuperiors() - { - return afterGetBrightnessSuperiors; - } - - public String[] getAfterGetBrightnessInferiors() - { - return afterGetBrightnessInferiors; - } - - public void setBeforeGetBrightnessSuperiors(String[] value) - { - beforeGetBrightnessSuperiors = value; - } - - public void setBeforeGetBrightnessInferiors(String[] value) - { - beforeGetBrightnessInferiors = value; - } - - public void setOverrideGetBrightnessSuperiors(String[] value) - { - overrideGetBrightnessSuperiors = value; - } - - public void setOverrideGetBrightnessInferiors(String[] value) - { - overrideGetBrightnessInferiors = value; - } - - public void setAfterGetBrightnessSuperiors(String[] value) - { - afterGetBrightnessSuperiors = value; - } - - public void setAfterGetBrightnessInferiors(String[] value) - { - afterGetBrightnessInferiors = value; - } - - public String[] getBeforeGetEyeHeightSuperiors() - { - return beforeGetEyeHeightSuperiors; - } - - public String[] getBeforeGetEyeHeightInferiors() - { - return beforeGetEyeHeightInferiors; - } - - public String[] getOverrideGetEyeHeightSuperiors() - { - return overrideGetEyeHeightSuperiors; - } - - public String[] getOverrideGetEyeHeightInferiors() - { - return overrideGetEyeHeightInferiors; - } - - public String[] getAfterGetEyeHeightSuperiors() - { - return afterGetEyeHeightSuperiors; - } - - public String[] getAfterGetEyeHeightInferiors() - { - return afterGetEyeHeightInferiors; - } - - public void setBeforeGetEyeHeightSuperiors(String[] value) - { - beforeGetEyeHeightSuperiors = value; - } - - public void setBeforeGetEyeHeightInferiors(String[] value) - { - beforeGetEyeHeightInferiors = value; - } - - public void setOverrideGetEyeHeightSuperiors(String[] value) - { - overrideGetEyeHeightSuperiors = value; - } - - public void setOverrideGetEyeHeightInferiors(String[] value) - { - overrideGetEyeHeightInferiors = value; - } - - public void setAfterGetEyeHeightSuperiors(String[] value) - { - afterGetEyeHeightSuperiors = value; - } - - public void setAfterGetEyeHeightInferiors(String[] value) - { - afterGetEyeHeightInferiors = value; - } - - public String[] getBeforeHealSuperiors() - { - return beforeHealSuperiors; - } - - public String[] getBeforeHealInferiors() - { - return beforeHealInferiors; - } - - public String[] getOverrideHealSuperiors() - { - return overrideHealSuperiors; - } - - public String[] getOverrideHealInferiors() - { - return overrideHealInferiors; - } - - public String[] getAfterHealSuperiors() - { - return afterHealSuperiors; - } - - public String[] getAfterHealInferiors() - { - return afterHealInferiors; - } - - public void setBeforeHealSuperiors(String[] value) - { - beforeHealSuperiors = value; - } - - public void setBeforeHealInferiors(String[] value) - { - beforeHealInferiors = value; - } - - public void setOverrideHealSuperiors(String[] value) - { - overrideHealSuperiors = value; - } - - public void setOverrideHealInferiors(String[] value) - { - overrideHealInferiors = value; - } - - public void setAfterHealSuperiors(String[] value) - { - afterHealSuperiors = value; - } - - public void setAfterHealInferiors(String[] value) - { - afterHealInferiors = value; - } - - public String[] getBeforeIsEntityInsideOpaqueBlockSuperiors() - { - return beforeIsEntityInsideOpaqueBlockSuperiors; - } - - public String[] getBeforeIsEntityInsideOpaqueBlockInferiors() - { - return beforeIsEntityInsideOpaqueBlockInferiors; - } - - public String[] getOverrideIsEntityInsideOpaqueBlockSuperiors() - { - return overrideIsEntityInsideOpaqueBlockSuperiors; - } - - public String[] getOverrideIsEntityInsideOpaqueBlockInferiors() - { - return overrideIsEntityInsideOpaqueBlockInferiors; - } - - public String[] getAfterIsEntityInsideOpaqueBlockSuperiors() - { - return afterIsEntityInsideOpaqueBlockSuperiors; - } - - public String[] getAfterIsEntityInsideOpaqueBlockInferiors() - { - return afterIsEntityInsideOpaqueBlockInferiors; - } - - public void setBeforeIsEntityInsideOpaqueBlockSuperiors(String[] value) - { - beforeIsEntityInsideOpaqueBlockSuperiors = value; - } - - public void setBeforeIsEntityInsideOpaqueBlockInferiors(String[] value) - { - beforeIsEntityInsideOpaqueBlockInferiors = value; - } - - public void setOverrideIsEntityInsideOpaqueBlockSuperiors(String[] value) - { - overrideIsEntityInsideOpaqueBlockSuperiors = value; - } - - public void setOverrideIsEntityInsideOpaqueBlockInferiors(String[] value) - { - overrideIsEntityInsideOpaqueBlockInferiors = value; - } - - public void setAfterIsEntityInsideOpaqueBlockSuperiors(String[] value) - { - afterIsEntityInsideOpaqueBlockSuperiors = value; - } - - public void setAfterIsEntityInsideOpaqueBlockInferiors(String[] value) - { - afterIsEntityInsideOpaqueBlockInferiors = value; - } - - public String[] getBeforeIsInWaterSuperiors() - { - return beforeIsInWaterSuperiors; - } - - public String[] getBeforeIsInWaterInferiors() - { - return beforeIsInWaterInferiors; - } - - public String[] getOverrideIsInWaterSuperiors() - { - return overrideIsInWaterSuperiors; - } - - public String[] getOverrideIsInWaterInferiors() - { - return overrideIsInWaterInferiors; - } - - public String[] getAfterIsInWaterSuperiors() - { - return afterIsInWaterSuperiors; - } - - public String[] getAfterIsInWaterInferiors() - { - return afterIsInWaterInferiors; - } - - public void setBeforeIsInWaterSuperiors(String[] value) - { - beforeIsInWaterSuperiors = value; - } - - public void setBeforeIsInWaterInferiors(String[] value) - { - beforeIsInWaterInferiors = value; - } - - public void setOverrideIsInWaterSuperiors(String[] value) - { - overrideIsInWaterSuperiors = value; - } - - public void setOverrideIsInWaterInferiors(String[] value) - { - overrideIsInWaterInferiors = value; - } - - public void setAfterIsInWaterSuperiors(String[] value) - { - afterIsInWaterSuperiors = value; - } - - public void setAfterIsInWaterInferiors(String[] value) - { - afterIsInWaterInferiors = value; - } - - public String[] getBeforeIsInsideOfMaterialSuperiors() - { - return beforeIsInsideOfMaterialSuperiors; - } - - public String[] getBeforeIsInsideOfMaterialInferiors() - { - return beforeIsInsideOfMaterialInferiors; - } - - public String[] getOverrideIsInsideOfMaterialSuperiors() - { - return overrideIsInsideOfMaterialSuperiors; - } - - public String[] getOverrideIsInsideOfMaterialInferiors() - { - return overrideIsInsideOfMaterialInferiors; - } - - public String[] getAfterIsInsideOfMaterialSuperiors() - { - return afterIsInsideOfMaterialSuperiors; - } - - public String[] getAfterIsInsideOfMaterialInferiors() - { - return afterIsInsideOfMaterialInferiors; - } - - public void setBeforeIsInsideOfMaterialSuperiors(String[] value) - { - beforeIsInsideOfMaterialSuperiors = value; - } - - public void setBeforeIsInsideOfMaterialInferiors(String[] value) - { - beforeIsInsideOfMaterialInferiors = value; - } - - public void setOverrideIsInsideOfMaterialSuperiors(String[] value) - { - overrideIsInsideOfMaterialSuperiors = value; - } - - public void setOverrideIsInsideOfMaterialInferiors(String[] value) - { - overrideIsInsideOfMaterialInferiors = value; - } - - public void setAfterIsInsideOfMaterialSuperiors(String[] value) - { - afterIsInsideOfMaterialSuperiors = value; - } - - public void setAfterIsInsideOfMaterialInferiors(String[] value) - { - afterIsInsideOfMaterialInferiors = value; - } - - public String[] getBeforeIsOnLadderSuperiors() - { - return beforeIsOnLadderSuperiors; - } - - public String[] getBeforeIsOnLadderInferiors() - { - return beforeIsOnLadderInferiors; - } - - public String[] getOverrideIsOnLadderSuperiors() - { - return overrideIsOnLadderSuperiors; - } - - public String[] getOverrideIsOnLadderInferiors() - { - return overrideIsOnLadderInferiors; - } - - public String[] getAfterIsOnLadderSuperiors() - { - return afterIsOnLadderSuperiors; - } - - public String[] getAfterIsOnLadderInferiors() - { - return afterIsOnLadderInferiors; - } - - public void setBeforeIsOnLadderSuperiors(String[] value) - { - beforeIsOnLadderSuperiors = value; - } - - public void setBeforeIsOnLadderInferiors(String[] value) - { - beforeIsOnLadderInferiors = value; - } - - public void setOverrideIsOnLadderSuperiors(String[] value) - { - overrideIsOnLadderSuperiors = value; - } - - public void setOverrideIsOnLadderInferiors(String[] value) - { - overrideIsOnLadderInferiors = value; - } - - public void setAfterIsOnLadderSuperiors(String[] value) - { - afterIsOnLadderSuperiors = value; - } - - public void setAfterIsOnLadderInferiors(String[] value) - { - afterIsOnLadderInferiors = value; - } - - public String[] getBeforeIsPlayerSleepingSuperiors() - { - return beforeIsPlayerSleepingSuperiors; - } - - public String[] getBeforeIsPlayerSleepingInferiors() - { - return beforeIsPlayerSleepingInferiors; - } - - public String[] getOverrideIsPlayerSleepingSuperiors() - { - return overrideIsPlayerSleepingSuperiors; - } - - public String[] getOverrideIsPlayerSleepingInferiors() - { - return overrideIsPlayerSleepingInferiors; - } - - public String[] getAfterIsPlayerSleepingSuperiors() - { - return afterIsPlayerSleepingSuperiors; - } - - public String[] getAfterIsPlayerSleepingInferiors() - { - return afterIsPlayerSleepingInferiors; - } - - public void setBeforeIsPlayerSleepingSuperiors(String[] value) - { - beforeIsPlayerSleepingSuperiors = value; - } - - public void setBeforeIsPlayerSleepingInferiors(String[] value) - { - beforeIsPlayerSleepingInferiors = value; - } - - public void setOverrideIsPlayerSleepingSuperiors(String[] value) - { - overrideIsPlayerSleepingSuperiors = value; - } - - public void setOverrideIsPlayerSleepingInferiors(String[] value) - { - overrideIsPlayerSleepingInferiors = value; - } - - public void setAfterIsPlayerSleepingSuperiors(String[] value) - { - afterIsPlayerSleepingSuperiors = value; - } - - public void setAfterIsPlayerSleepingInferiors(String[] value) - { - afterIsPlayerSleepingInferiors = value; - } - - public String[] getBeforeIsSneakingSuperiors() - { - return beforeIsSneakingSuperiors; - } - - public String[] getBeforeIsSneakingInferiors() - { - return beforeIsSneakingInferiors; - } - - public String[] getOverrideIsSneakingSuperiors() - { - return overrideIsSneakingSuperiors; - } - - public String[] getOverrideIsSneakingInferiors() - { - return overrideIsSneakingInferiors; - } - - public String[] getAfterIsSneakingSuperiors() - { - return afterIsSneakingSuperiors; - } - - public String[] getAfterIsSneakingInferiors() - { - return afterIsSneakingInferiors; - } - - public void setBeforeIsSneakingSuperiors(String[] value) - { - beforeIsSneakingSuperiors = value; - } - - public void setBeforeIsSneakingInferiors(String[] value) - { - beforeIsSneakingInferiors = value; - } - - public void setOverrideIsSneakingSuperiors(String[] value) - { - overrideIsSneakingSuperiors = value; - } - - public void setOverrideIsSneakingInferiors(String[] value) - { - overrideIsSneakingInferiors = value; - } - - public void setAfterIsSneakingSuperiors(String[] value) - { - afterIsSneakingSuperiors = value; - } - - public void setAfterIsSneakingInferiors(String[] value) - { - afterIsSneakingInferiors = value; - } - - public String[] getBeforeJumpSuperiors() - { - return beforeJumpSuperiors; - } - - public String[] getBeforeJumpInferiors() - { - return beforeJumpInferiors; - } - - public String[] getOverrideJumpSuperiors() - { - return overrideJumpSuperiors; - } - - public String[] getOverrideJumpInferiors() - { - return overrideJumpInferiors; - } - - public String[] getAfterJumpSuperiors() - { - return afterJumpSuperiors; - } - - public String[] getAfterJumpInferiors() - { - return afterJumpInferiors; - } - - public void setBeforeJumpSuperiors(String[] value) - { - beforeJumpSuperiors = value; - } - - public void setBeforeJumpInferiors(String[] value) - { - beforeJumpInferiors = value; - } - - public void setOverrideJumpSuperiors(String[] value) - { - overrideJumpSuperiors = value; - } - - public void setOverrideJumpInferiors(String[] value) - { - overrideJumpInferiors = value; - } - - public void setAfterJumpSuperiors(String[] value) - { - afterJumpSuperiors = value; - } - - public void setAfterJumpInferiors(String[] value) - { - afterJumpInferiors = value; - } - - public String[] getBeforeKnockBackSuperiors() - { - return beforeKnockBackSuperiors; - } - - public String[] getBeforeKnockBackInferiors() - { - return beforeKnockBackInferiors; - } - - public String[] getOverrideKnockBackSuperiors() - { - return overrideKnockBackSuperiors; - } - - public String[] getOverrideKnockBackInferiors() - { - return overrideKnockBackInferiors; - } - - public String[] getAfterKnockBackSuperiors() - { - return afterKnockBackSuperiors; - } - - public String[] getAfterKnockBackInferiors() - { - return afterKnockBackInferiors; - } - - public void setBeforeKnockBackSuperiors(String[] value) - { - beforeKnockBackSuperiors = value; - } - - public void setBeforeKnockBackInferiors(String[] value) - { - beforeKnockBackInferiors = value; - } - - public void setOverrideKnockBackSuperiors(String[] value) - { - overrideKnockBackSuperiors = value; - } - - public void setOverrideKnockBackInferiors(String[] value) - { - overrideKnockBackInferiors = value; - } - - public void setAfterKnockBackSuperiors(String[] value) - { - afterKnockBackSuperiors = value; - } - - public void setAfterKnockBackInferiors(String[] value) - { - afterKnockBackInferiors = value; - } - - public String[] getBeforeMountEntitySuperiors() - { - return beforeMountEntitySuperiors; - } - - public String[] getBeforeMountEntityInferiors() - { - return beforeMountEntityInferiors; - } - - public String[] getOverrideMountEntitySuperiors() - { - return overrideMountEntitySuperiors; - } - - public String[] getOverrideMountEntityInferiors() - { - return overrideMountEntityInferiors; - } - - public String[] getAfterMountEntitySuperiors() - { - return afterMountEntitySuperiors; - } - - public String[] getAfterMountEntityInferiors() - { - return afterMountEntityInferiors; - } - - public void setBeforeMountEntitySuperiors(String[] value) - { - beforeMountEntitySuperiors = value; - } - - public void setBeforeMountEntityInferiors(String[] value) - { - beforeMountEntityInferiors = value; - } - - public void setOverrideMountEntitySuperiors(String[] value) - { - overrideMountEntitySuperiors = value; - } - - public void setOverrideMountEntityInferiors(String[] value) - { - overrideMountEntityInferiors = value; - } - - public void setAfterMountEntitySuperiors(String[] value) - { - afterMountEntitySuperiors = value; - } - - public void setAfterMountEntityInferiors(String[] value) - { - afterMountEntityInferiors = value; - } - - public String[] getBeforeMoveEntitySuperiors() - { - return beforeMoveEntitySuperiors; - } - - public String[] getBeforeMoveEntityInferiors() - { - return beforeMoveEntityInferiors; - } - - public String[] getOverrideMoveEntitySuperiors() - { - return overrideMoveEntitySuperiors; - } - - public String[] getOverrideMoveEntityInferiors() - { - return overrideMoveEntityInferiors; - } - - public String[] getAfterMoveEntitySuperiors() - { - return afterMoveEntitySuperiors; - } - - public String[] getAfterMoveEntityInferiors() - { - return afterMoveEntityInferiors; - } - - public void setBeforeMoveEntitySuperiors(String[] value) - { - beforeMoveEntitySuperiors = value; - } - - public void setBeforeMoveEntityInferiors(String[] value) - { - beforeMoveEntityInferiors = value; - } - - public void setOverrideMoveEntitySuperiors(String[] value) - { - overrideMoveEntitySuperiors = value; - } - - public void setOverrideMoveEntityInferiors(String[] value) - { - overrideMoveEntityInferiors = value; - } - - public void setAfterMoveEntitySuperiors(String[] value) - { - afterMoveEntitySuperiors = value; - } - - public void setAfterMoveEntityInferiors(String[] value) - { - afterMoveEntityInferiors = value; - } - - public String[] getBeforeMoveEntityWithHeadingSuperiors() - { - return beforeMoveEntityWithHeadingSuperiors; - } - - public String[] getBeforeMoveEntityWithHeadingInferiors() - { - return beforeMoveEntityWithHeadingInferiors; - } - - public String[] getOverrideMoveEntityWithHeadingSuperiors() - { - return overrideMoveEntityWithHeadingSuperiors; - } - - public String[] getOverrideMoveEntityWithHeadingInferiors() - { - return overrideMoveEntityWithHeadingInferiors; - } - - public String[] getAfterMoveEntityWithHeadingSuperiors() - { - return afterMoveEntityWithHeadingSuperiors; - } - - public String[] getAfterMoveEntityWithHeadingInferiors() - { - return afterMoveEntityWithHeadingInferiors; - } - - public void setBeforeMoveEntityWithHeadingSuperiors(String[] value) - { - beforeMoveEntityWithHeadingSuperiors = value; - } - - public void setBeforeMoveEntityWithHeadingInferiors(String[] value) - { - beforeMoveEntityWithHeadingInferiors = value; - } - - public void setOverrideMoveEntityWithHeadingSuperiors(String[] value) - { - overrideMoveEntityWithHeadingSuperiors = value; - } - - public void setOverrideMoveEntityWithHeadingInferiors(String[] value) - { - overrideMoveEntityWithHeadingInferiors = value; - } - - public void setAfterMoveEntityWithHeadingSuperiors(String[] value) - { - afterMoveEntityWithHeadingSuperiors = value; - } - - public void setAfterMoveEntityWithHeadingInferiors(String[] value) - { - afterMoveEntityWithHeadingInferiors = value; - } - - public String[] getBeforeMoveFlyingSuperiors() - { - return beforeMoveFlyingSuperiors; - } - - public String[] getBeforeMoveFlyingInferiors() - { - return beforeMoveFlyingInferiors; - } - - public String[] getOverrideMoveFlyingSuperiors() - { - return overrideMoveFlyingSuperiors; - } - - public String[] getOverrideMoveFlyingInferiors() - { - return overrideMoveFlyingInferiors; - } - - public String[] getAfterMoveFlyingSuperiors() - { - return afterMoveFlyingSuperiors; - } - - public String[] getAfterMoveFlyingInferiors() - { - return afterMoveFlyingInferiors; - } - - public void setBeforeMoveFlyingSuperiors(String[] value) - { - beforeMoveFlyingSuperiors = value; - } - - public void setBeforeMoveFlyingInferiors(String[] value) - { - beforeMoveFlyingInferiors = value; - } - - public void setOverrideMoveFlyingSuperiors(String[] value) - { - overrideMoveFlyingSuperiors = value; - } - - public void setOverrideMoveFlyingInferiors(String[] value) - { - overrideMoveFlyingInferiors = value; - } - - public void setAfterMoveFlyingSuperiors(String[] value) - { - afterMoveFlyingSuperiors = value; - } - - public void setAfterMoveFlyingInferiors(String[] value) - { - afterMoveFlyingInferiors = value; - } - - public String[] getBeforeOnDeathSuperiors() - { - return beforeOnDeathSuperiors; - } - - public String[] getBeforeOnDeathInferiors() - { - return beforeOnDeathInferiors; - } - - public String[] getOverrideOnDeathSuperiors() - { - return overrideOnDeathSuperiors; - } - - public String[] getOverrideOnDeathInferiors() - { - return overrideOnDeathInferiors; - } - - public String[] getAfterOnDeathSuperiors() - { - return afterOnDeathSuperiors; - } - - public String[] getAfterOnDeathInferiors() - { - return afterOnDeathInferiors; - } - - public void setBeforeOnDeathSuperiors(String[] value) - { - beforeOnDeathSuperiors = value; - } - - public void setBeforeOnDeathInferiors(String[] value) - { - beforeOnDeathInferiors = value; - } - - public void setOverrideOnDeathSuperiors(String[] value) - { - overrideOnDeathSuperiors = value; - } - - public void setOverrideOnDeathInferiors(String[] value) - { - overrideOnDeathInferiors = value; - } - - public void setAfterOnDeathSuperiors(String[] value) - { - afterOnDeathSuperiors = value; - } - - public void setAfterOnDeathInferiors(String[] value) - { - afterOnDeathInferiors = value; - } - - public String[] getBeforeOnLivingUpdateSuperiors() - { - return beforeOnLivingUpdateSuperiors; - } - - public String[] getBeforeOnLivingUpdateInferiors() - { - return beforeOnLivingUpdateInferiors; - } - - public String[] getOverrideOnLivingUpdateSuperiors() - { - return overrideOnLivingUpdateSuperiors; - } - - public String[] getOverrideOnLivingUpdateInferiors() - { - return overrideOnLivingUpdateInferiors; - } - - public String[] getAfterOnLivingUpdateSuperiors() - { - return afterOnLivingUpdateSuperiors; - } - - public String[] getAfterOnLivingUpdateInferiors() - { - return afterOnLivingUpdateInferiors; - } - - public void setBeforeOnLivingUpdateSuperiors(String[] value) - { - beforeOnLivingUpdateSuperiors = value; - } - - public void setBeforeOnLivingUpdateInferiors(String[] value) - { - beforeOnLivingUpdateInferiors = value; - } - - public void setOverrideOnLivingUpdateSuperiors(String[] value) - { - overrideOnLivingUpdateSuperiors = value; - } - - public void setOverrideOnLivingUpdateInferiors(String[] value) - { - overrideOnLivingUpdateInferiors = value; - } - - public void setAfterOnLivingUpdateSuperiors(String[] value) - { - afterOnLivingUpdateSuperiors = value; - } - - public void setAfterOnLivingUpdateInferiors(String[] value) - { - afterOnLivingUpdateInferiors = value; - } - - public String[] getBeforeOnKillEntitySuperiors() - { - return beforeOnKillEntitySuperiors; - } - - public String[] getBeforeOnKillEntityInferiors() - { - return beforeOnKillEntityInferiors; - } - - public String[] getOverrideOnKillEntitySuperiors() - { - return overrideOnKillEntitySuperiors; - } - - public String[] getOverrideOnKillEntityInferiors() - { - return overrideOnKillEntityInferiors; - } - - public String[] getAfterOnKillEntitySuperiors() - { - return afterOnKillEntitySuperiors; - } - - public String[] getAfterOnKillEntityInferiors() - { - return afterOnKillEntityInferiors; - } - - public void setBeforeOnKillEntitySuperiors(String[] value) - { - beforeOnKillEntitySuperiors = value; - } - - public void setBeforeOnKillEntityInferiors(String[] value) - { - beforeOnKillEntityInferiors = value; - } - - public void setOverrideOnKillEntitySuperiors(String[] value) - { - overrideOnKillEntitySuperiors = value; - } - - public void setOverrideOnKillEntityInferiors(String[] value) - { - overrideOnKillEntityInferiors = value; - } - - public void setAfterOnKillEntitySuperiors(String[] value) - { - afterOnKillEntitySuperiors = value; - } - - public void setAfterOnKillEntityInferiors(String[] value) - { - afterOnKillEntityInferiors = value; - } - - public String[] getBeforeOnStruckByLightningSuperiors() - { - return beforeOnStruckByLightningSuperiors; - } - - public String[] getBeforeOnStruckByLightningInferiors() - { - return beforeOnStruckByLightningInferiors; - } - - public String[] getOverrideOnStruckByLightningSuperiors() - { - return overrideOnStruckByLightningSuperiors; - } - - public String[] getOverrideOnStruckByLightningInferiors() - { - return overrideOnStruckByLightningInferiors; - } - - public String[] getAfterOnStruckByLightningSuperiors() - { - return afterOnStruckByLightningSuperiors; - } - - public String[] getAfterOnStruckByLightningInferiors() - { - return afterOnStruckByLightningInferiors; - } - - public void setBeforeOnStruckByLightningSuperiors(String[] value) - { - beforeOnStruckByLightningSuperiors = value; - } - - public void setBeforeOnStruckByLightningInferiors(String[] value) - { - beforeOnStruckByLightningInferiors = value; - } - - public void setOverrideOnStruckByLightningSuperiors(String[] value) - { - overrideOnStruckByLightningSuperiors = value; - } - - public void setOverrideOnStruckByLightningInferiors(String[] value) - { - overrideOnStruckByLightningInferiors = value; - } - - public void setAfterOnStruckByLightningSuperiors(String[] value) - { - afterOnStruckByLightningSuperiors = value; - } - - public void setAfterOnStruckByLightningInferiors(String[] value) - { - afterOnStruckByLightningInferiors = value; - } - - public String[] getBeforeOnUpdateSuperiors() - { - return beforeOnUpdateSuperiors; - } - - public String[] getBeforeOnUpdateInferiors() - { - return beforeOnUpdateInferiors; - } - - public String[] getOverrideOnUpdateSuperiors() - { - return overrideOnUpdateSuperiors; - } - - public String[] getOverrideOnUpdateInferiors() - { - return overrideOnUpdateInferiors; - } - - public String[] getAfterOnUpdateSuperiors() - { - return afterOnUpdateSuperiors; - } - - public String[] getAfterOnUpdateInferiors() - { - return afterOnUpdateInferiors; - } - - public void setBeforeOnUpdateSuperiors(String[] value) - { - beforeOnUpdateSuperiors = value; - } - - public void setBeforeOnUpdateInferiors(String[] value) - { - beforeOnUpdateInferiors = value; - } - - public void setOverrideOnUpdateSuperiors(String[] value) - { - overrideOnUpdateSuperiors = value; - } - - public void setOverrideOnUpdateInferiors(String[] value) - { - overrideOnUpdateInferiors = value; - } - - public void setAfterOnUpdateSuperiors(String[] value) - { - afterOnUpdateSuperiors = value; - } - - public void setAfterOnUpdateInferiors(String[] value) - { - afterOnUpdateInferiors = value; - } - - public String[] getBeforeOnUpdateEntitySuperiors() - { - return beforeOnUpdateEntitySuperiors; - } - - public String[] getBeforeOnUpdateEntityInferiors() - { - return beforeOnUpdateEntityInferiors; - } - - public String[] getOverrideOnUpdateEntitySuperiors() - { - return overrideOnUpdateEntitySuperiors; - } - - public String[] getOverrideOnUpdateEntityInferiors() - { - return overrideOnUpdateEntityInferiors; - } - - public String[] getAfterOnUpdateEntitySuperiors() - { - return afterOnUpdateEntitySuperiors; - } - - public String[] getAfterOnUpdateEntityInferiors() - { - return afterOnUpdateEntityInferiors; - } - - public void setBeforeOnUpdateEntitySuperiors(String[] value) - { - beforeOnUpdateEntitySuperiors = value; - } - - public void setBeforeOnUpdateEntityInferiors(String[] value) - { - beforeOnUpdateEntityInferiors = value; - } - - public void setOverrideOnUpdateEntitySuperiors(String[] value) - { - overrideOnUpdateEntitySuperiors = value; - } - - public void setOverrideOnUpdateEntityInferiors(String[] value) - { - overrideOnUpdateEntityInferiors = value; - } - - public void setAfterOnUpdateEntitySuperiors(String[] value) - { - afterOnUpdateEntitySuperiors = value; - } - - public void setAfterOnUpdateEntityInferiors(String[] value) - { - afterOnUpdateEntityInferiors = value; - } - - public String[] getBeforeReadEntityFromNBTSuperiors() - { - return beforeReadEntityFromNBTSuperiors; - } - - public String[] getBeforeReadEntityFromNBTInferiors() - { - return beforeReadEntityFromNBTInferiors; - } - - public String[] getOverrideReadEntityFromNBTSuperiors() - { - return overrideReadEntityFromNBTSuperiors; - } - - public String[] getOverrideReadEntityFromNBTInferiors() - { - return overrideReadEntityFromNBTInferiors; - } - - public String[] getAfterReadEntityFromNBTSuperiors() - { - return afterReadEntityFromNBTSuperiors; - } - - public String[] getAfterReadEntityFromNBTInferiors() - { - return afterReadEntityFromNBTInferiors; - } - - public void setBeforeReadEntityFromNBTSuperiors(String[] value) - { - beforeReadEntityFromNBTSuperiors = value; - } - - public void setBeforeReadEntityFromNBTInferiors(String[] value) - { - beforeReadEntityFromNBTInferiors = value; - } - - public void setOverrideReadEntityFromNBTSuperiors(String[] value) - { - overrideReadEntityFromNBTSuperiors = value; - } - - public void setOverrideReadEntityFromNBTInferiors(String[] value) - { - overrideReadEntityFromNBTInferiors = value; - } - - public void setAfterReadEntityFromNBTSuperiors(String[] value) - { - afterReadEntityFromNBTSuperiors = value; - } - - public void setAfterReadEntityFromNBTInferiors(String[] value) - { - afterReadEntityFromNBTInferiors = value; - } - - public String[] getBeforeSetDeadSuperiors() - { - return beforeSetDeadSuperiors; - } - - public String[] getBeforeSetDeadInferiors() - { - return beforeSetDeadInferiors; - } - - public String[] getOverrideSetDeadSuperiors() - { - return overrideSetDeadSuperiors; - } - - public String[] getOverrideSetDeadInferiors() - { - return overrideSetDeadInferiors; - } - - public String[] getAfterSetDeadSuperiors() - { - return afterSetDeadSuperiors; - } - - public String[] getAfterSetDeadInferiors() - { - return afterSetDeadInferiors; - } - - public void setBeforeSetDeadSuperiors(String[] value) - { - beforeSetDeadSuperiors = value; - } - - public void setBeforeSetDeadInferiors(String[] value) - { - beforeSetDeadInferiors = value; - } - - public void setOverrideSetDeadSuperiors(String[] value) - { - overrideSetDeadSuperiors = value; - } - - public void setOverrideSetDeadInferiors(String[] value) - { - overrideSetDeadInferiors = value; - } - - public void setAfterSetDeadSuperiors(String[] value) - { - afterSetDeadSuperiors = value; - } - - public void setAfterSetDeadInferiors(String[] value) - { - afterSetDeadInferiors = value; - } - - public String[] getBeforeSetEntityActionStateSuperiors() - { - return beforeSetEntityActionStateSuperiors; - } - - public String[] getBeforeSetEntityActionStateInferiors() - { - return beforeSetEntityActionStateInferiors; - } - - public String[] getOverrideSetEntityActionStateSuperiors() - { - return overrideSetEntityActionStateSuperiors; - } - - public String[] getOverrideSetEntityActionStateInferiors() - { - return overrideSetEntityActionStateInferiors; - } - - public String[] getAfterSetEntityActionStateSuperiors() - { - return afterSetEntityActionStateSuperiors; - } - - public String[] getAfterSetEntityActionStateInferiors() - { - return afterSetEntityActionStateInferiors; - } - - public void setBeforeSetEntityActionStateSuperiors(String[] value) - { - beforeSetEntityActionStateSuperiors = value; - } - - public void setBeforeSetEntityActionStateInferiors(String[] value) - { - beforeSetEntityActionStateInferiors = value; - } - - public void setOverrideSetEntityActionStateSuperiors(String[] value) - { - overrideSetEntityActionStateSuperiors = value; - } - - public void setOverrideSetEntityActionStateInferiors(String[] value) - { - overrideSetEntityActionStateInferiors = value; - } - - public void setAfterSetEntityActionStateSuperiors(String[] value) - { - afterSetEntityActionStateSuperiors = value; - } - - public void setAfterSetEntityActionStateInferiors(String[] value) - { - afterSetEntityActionStateInferiors = value; - } - - public String[] getBeforeSetPositionSuperiors() - { - return beforeSetPositionSuperiors; - } - - public String[] getBeforeSetPositionInferiors() - { - return beforeSetPositionInferiors; - } - - public String[] getOverrideSetPositionSuperiors() - { - return overrideSetPositionSuperiors; - } - - public String[] getOverrideSetPositionInferiors() - { - return overrideSetPositionInferiors; - } - - public String[] getAfterSetPositionSuperiors() - { - return afterSetPositionSuperiors; - } - - public String[] getAfterSetPositionInferiors() - { - return afterSetPositionInferiors; - } - - public void setBeforeSetPositionSuperiors(String[] value) - { - beforeSetPositionSuperiors = value; - } - - public void setBeforeSetPositionInferiors(String[] value) - { - beforeSetPositionInferiors = value; - } - - public void setOverrideSetPositionSuperiors(String[] value) - { - overrideSetPositionSuperiors = value; - } - - public void setOverrideSetPositionInferiors(String[] value) - { - overrideSetPositionInferiors = value; - } - - public void setAfterSetPositionSuperiors(String[] value) - { - afterSetPositionSuperiors = value; - } - - public void setAfterSetPositionInferiors(String[] value) - { - afterSetPositionInferiors = value; - } - - public String[] getBeforeSetSneakingSuperiors() - { - return beforeSetSneakingSuperiors; - } - - public String[] getBeforeSetSneakingInferiors() - { - return beforeSetSneakingInferiors; - } - - public String[] getOverrideSetSneakingSuperiors() - { - return overrideSetSneakingSuperiors; - } - - public String[] getOverrideSetSneakingInferiors() - { - return overrideSetSneakingInferiors; - } - - public String[] getAfterSetSneakingSuperiors() - { - return afterSetSneakingSuperiors; - } - - public String[] getAfterSetSneakingInferiors() - { - return afterSetSneakingInferiors; - } - - public void setBeforeSetSneakingSuperiors(String[] value) - { - beforeSetSneakingSuperiors = value; - } - - public void setBeforeSetSneakingInferiors(String[] value) - { - beforeSetSneakingInferiors = value; - } - - public void setOverrideSetSneakingSuperiors(String[] value) - { - overrideSetSneakingSuperiors = value; - } - - public void setOverrideSetSneakingInferiors(String[] value) - { - overrideSetSneakingInferiors = value; - } - - public void setAfterSetSneakingSuperiors(String[] value) - { - afterSetSneakingSuperiors = value; - } - - public void setAfterSetSneakingInferiors(String[] value) - { - afterSetSneakingInferiors = value; - } - - public String[] getBeforeSetSprintingSuperiors() - { - return beforeSetSprintingSuperiors; - } - - public String[] getBeforeSetSprintingInferiors() - { - return beforeSetSprintingInferiors; - } - - public String[] getOverrideSetSprintingSuperiors() - { - return overrideSetSprintingSuperiors; - } - - public String[] getOverrideSetSprintingInferiors() - { - return overrideSetSprintingInferiors; - } - - public String[] getAfterSetSprintingSuperiors() - { - return afterSetSprintingSuperiors; - } - - public String[] getAfterSetSprintingInferiors() - { - return afterSetSprintingInferiors; - } - - public void setBeforeSetSprintingSuperiors(String[] value) - { - beforeSetSprintingSuperiors = value; - } - - public void setBeforeSetSprintingInferiors(String[] value) - { - beforeSetSprintingInferiors = value; - } - - public void setOverrideSetSprintingSuperiors(String[] value) - { - overrideSetSprintingSuperiors = value; - } - - public void setOverrideSetSprintingInferiors(String[] value) - { - overrideSetSprintingInferiors = value; - } - - public void setAfterSetSprintingSuperiors(String[] value) - { - afterSetSprintingSuperiors = value; - } - - public void setAfterSetSprintingInferiors(String[] value) - { - afterSetSprintingInferiors = value; - } - - public String[] getBeforeSwingItemSuperiors() - { - return beforeSwingItemSuperiors; - } - - public String[] getBeforeSwingItemInferiors() - { - return beforeSwingItemInferiors; - } - - public String[] getOverrideSwingItemSuperiors() - { - return overrideSwingItemSuperiors; - } - - public String[] getOverrideSwingItemInferiors() - { - return overrideSwingItemInferiors; - } - - public String[] getAfterSwingItemSuperiors() - { - return afterSwingItemSuperiors; - } - - public String[] getAfterSwingItemInferiors() - { - return afterSwingItemInferiors; - } - - public void setBeforeSwingItemSuperiors(String[] value) - { - beforeSwingItemSuperiors = value; - } - - public void setBeforeSwingItemInferiors(String[] value) - { - beforeSwingItemInferiors = value; - } - - public void setOverrideSwingItemSuperiors(String[] value) - { - overrideSwingItemSuperiors = value; - } - - public void setOverrideSwingItemInferiors(String[] value) - { - overrideSwingItemInferiors = value; - } - - public void setAfterSwingItemSuperiors(String[] value) - { - afterSwingItemSuperiors = value; - } - - public void setAfterSwingItemInferiors(String[] value) - { - afterSwingItemInferiors = value; - } - - public String[] getBeforeUpdateEntityActionStateSuperiors() - { - return beforeUpdateEntityActionStateSuperiors; - } - - public String[] getBeforeUpdateEntityActionStateInferiors() - { - return beforeUpdateEntityActionStateInferiors; - } - - public String[] getOverrideUpdateEntityActionStateSuperiors() - { - return overrideUpdateEntityActionStateSuperiors; - } - - public String[] getOverrideUpdateEntityActionStateInferiors() - { - return overrideUpdateEntityActionStateInferiors; - } - - public String[] getAfterUpdateEntityActionStateSuperiors() - { - return afterUpdateEntityActionStateSuperiors; - } - - public String[] getAfterUpdateEntityActionStateInferiors() - { - return afterUpdateEntityActionStateInferiors; - } - - public void setBeforeUpdateEntityActionStateSuperiors(String[] value) - { - beforeUpdateEntityActionStateSuperiors = value; - } - - public void setBeforeUpdateEntityActionStateInferiors(String[] value) - { - beforeUpdateEntityActionStateInferiors = value; - } - - public void setOverrideUpdateEntityActionStateSuperiors(String[] value) - { - overrideUpdateEntityActionStateSuperiors = value; - } - - public void setOverrideUpdateEntityActionStateInferiors(String[] value) - { - overrideUpdateEntityActionStateInferiors = value; - } - - public void setAfterUpdateEntityActionStateSuperiors(String[] value) - { - afterUpdateEntityActionStateSuperiors = value; - } - - public void setAfterUpdateEntityActionStateInferiors(String[] value) - { - afterUpdateEntityActionStateInferiors = value; - } - - public String[] getBeforeUpdatePotionEffectsSuperiors() - { - return beforeUpdatePotionEffectsSuperiors; - } - - public String[] getBeforeUpdatePotionEffectsInferiors() - { - return beforeUpdatePotionEffectsInferiors; - } - - public String[] getOverrideUpdatePotionEffectsSuperiors() - { - return overrideUpdatePotionEffectsSuperiors; - } - - public String[] getOverrideUpdatePotionEffectsInferiors() - { - return overrideUpdatePotionEffectsInferiors; - } - - public String[] getAfterUpdatePotionEffectsSuperiors() - { - return afterUpdatePotionEffectsSuperiors; - } - - public String[] getAfterUpdatePotionEffectsInferiors() - { - return afterUpdatePotionEffectsInferiors; - } - - public void setBeforeUpdatePotionEffectsSuperiors(String[] value) - { - beforeUpdatePotionEffectsSuperiors = value; - } - - public void setBeforeUpdatePotionEffectsInferiors(String[] value) - { - beforeUpdatePotionEffectsInferiors = value; - } - - public void setOverrideUpdatePotionEffectsSuperiors(String[] value) - { - overrideUpdatePotionEffectsSuperiors = value; - } - - public void setOverrideUpdatePotionEffectsInferiors(String[] value) - { - overrideUpdatePotionEffectsInferiors = value; - } - - public void setAfterUpdatePotionEffectsSuperiors(String[] value) - { - afterUpdatePotionEffectsSuperiors = value; - } - - public void setAfterUpdatePotionEffectsInferiors(String[] value) - { - afterUpdatePotionEffectsInferiors = value; - } - - public String[] getBeforeUpdateRiddenSuperiors() - { - return beforeUpdateRiddenSuperiors; - } - - public String[] getBeforeUpdateRiddenInferiors() - { - return beforeUpdateRiddenInferiors; - } - - public String[] getOverrideUpdateRiddenSuperiors() - { - return overrideUpdateRiddenSuperiors; - } - - public String[] getOverrideUpdateRiddenInferiors() - { - return overrideUpdateRiddenInferiors; - } - - public String[] getAfterUpdateRiddenSuperiors() - { - return afterUpdateRiddenSuperiors; - } - - public String[] getAfterUpdateRiddenInferiors() - { - return afterUpdateRiddenInferiors; - } - - public void setBeforeUpdateRiddenSuperiors(String[] value) - { - beforeUpdateRiddenSuperiors = value; - } - - public void setBeforeUpdateRiddenInferiors(String[] value) - { - beforeUpdateRiddenInferiors = value; - } - - public void setOverrideUpdateRiddenSuperiors(String[] value) - { - overrideUpdateRiddenSuperiors = value; - } - - public void setOverrideUpdateRiddenInferiors(String[] value) - { - overrideUpdateRiddenInferiors = value; - } - - public void setAfterUpdateRiddenSuperiors(String[] value) - { - afterUpdateRiddenSuperiors = value; - } - - public void setAfterUpdateRiddenInferiors(String[] value) - { - afterUpdateRiddenInferiors = value; - } - - public String[] getBeforeWakeUpPlayerSuperiors() - { - return beforeWakeUpPlayerSuperiors; - } - - public String[] getBeforeWakeUpPlayerInferiors() - { - return beforeWakeUpPlayerInferiors; - } - - public String[] getOverrideWakeUpPlayerSuperiors() - { - return overrideWakeUpPlayerSuperiors; - } - - public String[] getOverrideWakeUpPlayerInferiors() - { - return overrideWakeUpPlayerInferiors; - } - - public String[] getAfterWakeUpPlayerSuperiors() - { - return afterWakeUpPlayerSuperiors; - } - - public String[] getAfterWakeUpPlayerInferiors() - { - return afterWakeUpPlayerInferiors; - } - - public void setBeforeWakeUpPlayerSuperiors(String[] value) - { - beforeWakeUpPlayerSuperiors = value; - } - - public void setBeforeWakeUpPlayerInferiors(String[] value) - { - beforeWakeUpPlayerInferiors = value; - } - - public void setOverrideWakeUpPlayerSuperiors(String[] value) - { - overrideWakeUpPlayerSuperiors = value; - } - - public void setOverrideWakeUpPlayerInferiors(String[] value) - { - overrideWakeUpPlayerInferiors = value; - } - - public void setAfterWakeUpPlayerSuperiors(String[] value) - { - afterWakeUpPlayerSuperiors = value; - } - - public void setAfterWakeUpPlayerInferiors(String[] value) - { - afterWakeUpPlayerInferiors = value; - } - - public String[] getBeforeWriteEntityToNBTSuperiors() - { - return beforeWriteEntityToNBTSuperiors; - } - - public String[] getBeforeWriteEntityToNBTInferiors() - { - return beforeWriteEntityToNBTInferiors; - } - - public String[] getOverrideWriteEntityToNBTSuperiors() - { - return overrideWriteEntityToNBTSuperiors; - } - - public String[] getOverrideWriteEntityToNBTInferiors() - { - return overrideWriteEntityToNBTInferiors; - } - - public String[] getAfterWriteEntityToNBTSuperiors() - { - return afterWriteEntityToNBTSuperiors; - } - - public String[] getAfterWriteEntityToNBTInferiors() - { - return afterWriteEntityToNBTInferiors; - } - - public void setBeforeWriteEntityToNBTSuperiors(String[] value) - { - beforeWriteEntityToNBTSuperiors = value; - } - - public void setBeforeWriteEntityToNBTInferiors(String[] value) - { - beforeWriteEntityToNBTInferiors = value; - } - - public void setOverrideWriteEntityToNBTSuperiors(String[] value) - { - overrideWriteEntityToNBTSuperiors = value; - } - - public void setOverrideWriteEntityToNBTInferiors(String[] value) - { - overrideWriteEntityToNBTInferiors = value; - } - - public void setAfterWriteEntityToNBTSuperiors(String[] value) - { - afterWriteEntityToNBTSuperiors = value; - } - - public void setAfterWriteEntityToNBTInferiors(String[] value) - { - afterWriteEntityToNBTInferiors = value; - } - -} diff --git a/dependencies/main/java/api/player/server/ServerPlayerClassVisitor.java b/dependencies/main/java/api/player/server/ServerPlayerClassVisitor.java deleted file mode 100644 index 30dde5e11a..0000000000 --- a/dependencies/main/java/api/player/server/ServerPlayerClassVisitor.java +++ /dev/null @@ -1,4870 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.server; - -import java.io.*; - -import org.objectweb.asm.*; - -public final class ServerPlayerClassVisitor extends ClassVisitor -{ - public static final String targetClassName = "net.minecraft.entity.player.EntityPlayerMP"; - - private boolean hadLocalAddExhaustion; - private boolean hadLocalAddExperience; - private boolean hadLocalAddExperienceLevel; - private boolean hadLocalAddMovementStat; - private boolean hadLocalAttackEntityFrom; - private boolean hadLocalAttackTargetEntityWithCurrentItem; - private boolean hadLocalCanBreatheUnderwater; - private boolean hadLocalCanHarvestBlock; - private boolean hadLocalCanPlayerEdit; - private boolean hadLocalCanTriggerWalking; - private boolean hadLocalClonePlayer; - private boolean hadLocalDamageEntity; - private boolean hadLocalDisplayGui; - private boolean hadLocalDisplayGUIChest; - private boolean hadLocalDropOneItem; - private boolean hadLocalDropPlayerItemWithRandomChoice; - private boolean hadLocalFall; - private boolean hadLocalGetAIMoveSpeed; - private boolean hadLocalGetBreakSpeed; - private boolean hadLocalGetDistanceSq; - private boolean hadLocalGetBrightness; - private boolean hadLocalGetEyeHeight; - private boolean hadLocalHeal; - private boolean hadLocalIsEntityInsideOpaqueBlock; - private boolean hadLocalIsInWater; - private boolean hadLocalIsInsideOfMaterial; - private boolean hadLocalIsOnLadder; - private boolean hadLocalIsPlayerSleeping; - private boolean hadLocalIsSneaking; - private boolean hadLocalJump; - private boolean hadLocalKnockBack; - private boolean hadLocalMountEntity; - private boolean hadLocalMoveEntity; - private boolean hadLocalMoveEntityWithHeading; - private boolean hadLocalMoveFlying; - private boolean hadLocalOnDeath; - private boolean hadLocalOnLivingUpdate; - private boolean hadLocalOnKillEntity; - private boolean hadLocalOnStruckByLightning; - private boolean hadLocalOnUpdate; - private boolean hadLocalOnUpdateEntity; - private boolean hadLocalReadEntityFromNBT; - private boolean hadLocalSetDead; - private boolean hadLocalSetEntityActionState; - private boolean hadLocalSetPosition; - private boolean hadLocalSetSneaking; - private boolean hadLocalSetSprinting; - private boolean hadLocalSwingItem; - private boolean hadLocalUpdateEntityActionState; - private boolean hadLocalUpdatePotionEffects; - private boolean hadLocalUpdateRidden; - private boolean hadLocalWakeUpPlayer; - private boolean hadLocalWriteEntityToNBT; - - public static byte[] transform(byte[] bytes, boolean isObfuscated) - { - try - { - ByteArrayInputStream in = new ByteArrayInputStream(bytes); - ClassReader cr = new ClassReader(in); - ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); - ServerPlayerClassVisitor p = new ServerPlayerClassVisitor(cw, isObfuscated); - - cr.accept(p, 0); - - byte[] result = cw.toByteArray(); - in.close(); - return result; - } - catch(IOException ioe) - { - throw new RuntimeException(ioe); - } - } - - private final boolean isObfuscated; - - public ServerPlayerClassVisitor(ClassVisitor classVisitor, boolean isObfuscated) - { - super(262144, classVisitor); - this.isObfuscated = isObfuscated; - } - - @Override - public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) - { - String[] newInterfaces = new String[interfaces.length + 1]; - for(int i=0; i")) - return new ServerPlayerConstructorVisitor(super.visitMethod(access, name, desc, signature, exceptions), isObfuscated); - - if(name.equals(isObfuscated ? "a" : "addExhaustion") && desc.equals("(F)V")) - { - hadLocalAddExhaustion = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddExhaustion", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "n" : "addExperience") && desc.equals("(I)V")) - { - hadLocalAddExperience = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddExperience", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "addExperienceLevel") && desc.equals("(I)V")) - { - hadLocalAddExperienceLevel = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddExperienceLevel", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "l" : "addMovementStat") && desc.equals("(DDD)V")) - { - hadLocalAddMovementStat = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddMovementStat", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "attackEntityFrom") && desc.equals(isObfuscated ? "(Lrh;F)Z" : "(Lnet/minecraft/util/DamageSource;F)Z")) - { - hadLocalAttackEntityFrom = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAttackEntityFrom", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "f" : "attackEntityPlayerMPEntityWithCurrentItem") && desc.equals(isObfuscated ? "(Lrw;)V" : "(Lnet/minecraft/entity/Entity;)V")) - { - hadLocalAttackTargetEntityWithCurrentItem = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAttackTargetEntityWithCurrentItem", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "bE" : "canBreatheUnderwater") && desc.equals("()Z")) - { - hadLocalCanBreatheUnderwater = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanBreatheUnderwater", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "b" : "canHarvestBlock") && desc.equals(isObfuscated ? "(Lars;)Z" : "(Lnet/minecraft/block/state/IBlockState;)Z")) - { - hadLocalCanHarvestBlock = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanHarvestBlock", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "canPlayerEdit") && desc.equals(isObfuscated ? "(Lcm;Lct;Ladz;)Z" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z")) - { - hadLocalCanPlayerEdit = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanPlayerEdit", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "af" : "canTriggerWalking") && desc.equals("()Z")) - { - hadLocalCanTriggerWalking = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanTriggerWalking", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "clonePlayer") && desc.equals(isObfuscated ? "(Lzs;Z)V" : "(Lnet/minecraft/entity/player/EntityPlayer;Z)V")) - { - hadLocalClonePlayer = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localClonePlayer", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "d" : "damageEntity") && desc.equals(isObfuscated ? "(Lrh;F)V" : "(Lnet/minecraft/util/DamageSource;F)V")) - { - hadLocalDamageEntity = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDamageEntity", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "displayGui") && desc.equals(isObfuscated ? "(Lqs;)V" : "(Lnet/minecraft/world/IInteractionObject;)V")) - { - hadLocalDisplayGui = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDisplayGui", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "displayGUIChest") && desc.equals(isObfuscated ? "(Lql;)V" : "(Lnet/minecraft/inventory/IInventory;)V")) - { - hadLocalDisplayGUIChest = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDisplayGUIChest", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "dropItem") && desc.equals(isObfuscated ? "(Z)Lyk;" : "(Z)Lnet/minecraft/entity/item/EntityItem;")) - { - hadLocalDropOneItem = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDropOneItem", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "dropItem") && desc.equals(isObfuscated ? "(Ladz;Z)Lyk;" : "(Lnet/minecraft/item/ItemStack;Z)Lnet/minecraft/entity/item/EntityItem;")) - { - hadLocalDropPlayerItemWithRandomChoice = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDropPlayerItemWithRandomChoice", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "e" : "fall") && desc.equals("(FF)V")) - { - hadLocalFall = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localFall", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "cp" : "getAIMoveSpeed") && desc.equals("()F")) - { - hadLocalGetAIMoveSpeed = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetAIMoveSpeed", desc, signature, exceptions); - } - - if(name.equals("getDigSpeed") && desc.equals(isObfuscated ? "(Lars;Lcm;)F" : "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F")) - { - hadLocalGetBreakSpeed = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetBreakSpeed", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "e" : "getDistanceSq") && desc.equals("(DDD)D")) - { - hadLocalGetDistanceSq = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetDistanceSq", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "e" : "getBrightness") && desc.equals("(F)F")) - { - hadLocalGetBrightness = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetBrightness", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "bq" : "getEyeHeight") && desc.equals("()F")) - { - hadLocalGetEyeHeight = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetEyeHeight", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "b" : "heal") && desc.equals("(F)V")) - { - hadLocalHeal = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localHeal", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "av" : "isEntityInsideOpaqueBlock") && desc.equals("()Z")) - { - hadLocalIsEntityInsideOpaqueBlock = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsEntityInsideOpaqueBlock", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "aj" : "isInWater") && desc.equals("()Z")) - { - hadLocalIsInWater = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsInWater", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "isInsideOfMaterial") && desc.equals(isObfuscated ? "(Laxx;)Z" : "(Lnet/minecraft/block/material/Material;)Z")) - { - hadLocalIsInsideOfMaterial = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsInsideOfMaterial", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "m_" : "isOnLadder") && desc.equals("()Z")) - { - hadLocalIsOnLadder = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsOnLadder", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "cq" : "isPlayerSleeping") && desc.equals("()Z")) - { - hadLocalIsPlayerSleeping = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsPlayerSleeping", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "aM" : "isSneaking") && desc.equals("()Z")) - { - hadLocalIsSneaking = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsSneaking", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "cl" : "jump") && desc.equals("()V")) - { - hadLocalJump = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localJump", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "knockBack") && desc.equals(isObfuscated ? "(Lrw;FDD)V" : "(Lnet/minecraft/entity/Entity;FDD)V")) - { - hadLocalKnockBack = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localKnockBack", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "startRiding") && desc.equals(isObfuscated ? "(Lrw;Z)Z" : "(Lnet/minecraft/entity/Entity;Z)Z")) - { - hadLocalMountEntity = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMountEntity", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "d" : "moveEntity") && desc.equals("(DDD)V")) - { - hadLocalMoveEntity = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMoveEntity", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "g" : "moveEntityWithHeading") && desc.equals("(FF)V")) - { - hadLocalMoveEntityWithHeading = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMoveEntityWithHeading", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "moveRelative") && desc.equals("(FFF)V")) - { - hadLocalMoveFlying = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMoveFlying", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "onDeath") && desc.equals(isObfuscated ? "(Lrh;)V" : "(Lnet/minecraft/util/DamageSource;)V")) - { - hadLocalOnDeath = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnDeath", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "n" : "onLivingUpdate") && desc.equals("()V")) - { - hadLocalOnLivingUpdate = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnLivingUpdate", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "b" : "onKillEntity") && desc.equals(isObfuscated ? "(Lsf;)V" : "(Lnet/minecraft/entity/EntityLivingBase;)V")) - { - hadLocalOnKillEntity = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnKillEntity", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "onStruckByLightning") && desc.equals(isObfuscated ? "(Lyh;)V" : "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V")) - { - hadLocalOnStruckByLightning = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnStruckByLightning", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "m" : "onUpdate") && desc.equals("()V")) - { - hadLocalOnUpdate = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnUpdate", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "k_" : "onUpdateEntity") && desc.equals("()V")) - { - hadLocalOnUpdateEntity = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnUpdateEntity", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "readEntityFromNBT") && desc.equals(isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V")) - { - hadLocalReadEntityFromNBT = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localReadEntityFromNBT", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "T" : "setDead") && desc.equals("()V")) - { - hadLocalSetDead = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetDead", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "setEntityActionState") && desc.equals("(FFZZ)V")) - { - hadLocalSetEntityActionState = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetEntityActionState", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "b" : "setPosition") && desc.equals("(DDD)V")) - { - hadLocalSetPosition = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetPosition", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "e" : "setSneaking") && desc.equals("(Z)V")) - { - hadLocalSetSneaking = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetSneaking", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "f" : "setSprinting") && desc.equals("(Z)V")) - { - hadLocalSetSprinting = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetSprinting", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "swingArm") && desc.equals(isObfuscated ? "(Lqr;)V" : "(Lnet/minecraft/util/EnumHand;)V")) - { - hadLocalSwingItem = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSwingItem", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "cr" : "updateEntityActionState") && desc.equals("()V")) - { - hadLocalUpdateEntityActionState = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localUpdateEntityActionState", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "bO" : "updatePotionEffects") && desc.equals("()V")) - { - hadLocalUpdatePotionEffects = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localUpdatePotionEffects", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "aw" : "updateRidden") && desc.equals("()V")) - { - hadLocalUpdateRidden = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localUpdateRidden", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "a" : "wakeUpPlayer") && desc.equals("(ZZZ)V")) - { - hadLocalWakeUpPlayer = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localWakeUpPlayer", desc, signature, exceptions); - } - - if(name.equals(isObfuscated ? "b" : "writeEntityToNBT") && desc.equals(isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V")) - { - hadLocalWriteEntityToNBT = true; - return super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localWriteEntityToNBT", desc, signature, exceptions); - } - - return super.visitMethod(access, name, desc, signature, exceptions); - } - - @Override - public void visitEnd() - { - MethodVisitor mv; - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "addExhaustion", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "addExhaustion", "(Lapi/player/server/IServerPlayerAPI;F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realAddExhaustion", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "addExhaustion", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superAddExhaustion", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "addExhaustion", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalAddExhaustion) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddExhaustion", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "addExhaustion", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "n" : "addExperience", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "addExperience", "(Lapi/player/server/IServerPlayerAPI;I)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realAddExperience", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "n" : "addExperience", "(I)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superAddExperience", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "n" : "addExperience", "(I)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalAddExperience) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddExperience", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "n" : "addExperience", "(I)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "addExperienceLevel", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "addExperienceLevel", "(Lapi/player/server/IServerPlayerAPI;I)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realAddExperienceLevel", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "addExperienceLevel", "(I)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superAddExperienceLevel", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "addExperienceLevel", "(I)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalAddExperienceLevel) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddExperienceLevel", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "addExperienceLevel", "(I)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "l" : "addMovementStat", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "addMovementStat", "(Lapi/player/server/IServerPlayerAPI;DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realAddMovementStat", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "l" : "addMovementStat", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superAddMovementStat", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "l" : "addMovementStat", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalAddMovementStat) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAddMovementStat", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "l" : "addMovementStat", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "attackEntityFrom", "" + (isObfuscated ? "(Lrh;F)Z" : "(Lnet/minecraft/util/DamageSource;F)Z") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "attackEntityFrom", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/util/DamageSource;F)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realAttackEntityFrom", "(Lnet/minecraft/util/DamageSource;F)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "attackEntityFrom", "" + (isObfuscated ? "(Lrh;F)Z" : "(Lnet/minecraft/util/DamageSource;F)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superAttackEntityFrom", "(Lnet/minecraft/util/DamageSource;F)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "attackEntityFrom", "" + (isObfuscated ? "(Lrh;F)Z" : "(Lnet/minecraft/util/DamageSource;F)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalAttackEntityFrom) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAttackEntityFrom", "(Lnet/minecraft/util/DamageSource;F)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "attackEntityFrom", "" + (isObfuscated ? "(Lrh;F)Z" : "(Lnet/minecraft/util/DamageSource;F)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "f" : "attackEntityPlayerMPEntityWithCurrentItem", "" + (isObfuscated ? "(Lrw;)V" : "(Lnet/minecraft/entity/Entity;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "attackTargetEntityWithCurrentItem", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/entity/Entity;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realAttackTargetEntityWithCurrentItem", "(Lnet/minecraft/entity/Entity;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "f" : "attackEntityPlayerMPEntityWithCurrentItem", "" + (isObfuscated ? "(Lrw;)V" : "(Lnet/minecraft/entity/Entity;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superAttackTargetEntityWithCurrentItem", "(Lnet/minecraft/entity/Entity;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "f" : "attackEntityPlayerMPEntityWithCurrentItem", "" + (isObfuscated ? "(Lrw;)V" : "(Lnet/minecraft/entity/Entity;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalAttackTargetEntityWithCurrentItem) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localAttackTargetEntityWithCurrentItem", "(Lnet/minecraft/entity/Entity;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "f" : "attackEntityPlayerMPEntityWithCurrentItem", "" + (isObfuscated ? "(Lrw;)V" : "(Lnet/minecraft/entity/Entity;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "bE" : "canBreatheUnderwater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "canBreatheUnderwater", "(Lapi/player/server/IServerPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realCanBreatheUnderwater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bE" : "canBreatheUnderwater", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superCanBreatheUnderwater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "bE" : "canBreatheUnderwater", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalCanBreatheUnderwater) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanBreatheUnderwater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "bE" : "canBreatheUnderwater", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "b" : "canHarvestBlock", "" + (isObfuscated ? "(Lars;)Z" : "(Lnet/minecraft/block/state/IBlockState;)Z") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "canHarvestBlock", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/block/state/IBlockState;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realCanHarvestBlock", "(Lnet/minecraft/block/state/IBlockState;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "b" : "canHarvestBlock", "" + (isObfuscated ? "(Lars;)Z" : "(Lnet/minecraft/block/state/IBlockState;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superCanHarvestBlock", "(Lnet/minecraft/block/state/IBlockState;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "b" : "canHarvestBlock", "" + (isObfuscated ? "(Lars;)Z" : "(Lnet/minecraft/block/state/IBlockState;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalCanHarvestBlock) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanHarvestBlock", "(Lnet/minecraft/block/state/IBlockState;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "b" : "canHarvestBlock", "" + (isObfuscated ? "(Lars;)Z" : "(Lnet/minecraft/block/state/IBlockState;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "canPlayerEdit", "" + (isObfuscated ? "(Lcm;Lct;Ladz;)Z" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitVarInsn(Opcodes.ALOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "canPlayerEdit", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realCanPlayerEdit", "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitVarInsn(Opcodes.ALOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "canPlayerEdit", "" + (isObfuscated ? "(Lcm;Lct;Ladz;)Z" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superCanPlayerEdit", "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitVarInsn(Opcodes.ALOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "canPlayerEdit", "" + (isObfuscated ? "(Lcm;Lct;Ladz;)Z" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalCanPlayerEdit) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanPlayerEdit", "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitVarInsn(Opcodes.ALOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "canPlayerEdit", "" + (isObfuscated ? "(Lcm;Lct;Ladz;)Z" : "(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;Lnet/minecraft/item/ItemStack;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "af" : "canTriggerWalking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "canTriggerWalking", "(Lapi/player/server/IServerPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realCanTriggerWalking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "af" : "canTriggerWalking", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superCanTriggerWalking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "af" : "canTriggerWalking", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalCanTriggerWalking) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localCanTriggerWalking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "af" : "canTriggerWalking", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "clonePlayer", "" + (isObfuscated ? "(Lzs;Z)V" : "(Lnet/minecraft/entity/player/EntityPlayer;Z)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "clonePlayer", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/entity/player/EntityPlayer;Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realClonePlayer", "(Lnet/minecraft/entity/player/EntityPlayer;Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "clonePlayer", "" + (isObfuscated ? "(Lzs;Z)V" : "(Lnet/minecraft/entity/player/EntityPlayer;Z)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superClonePlayer", "(Lnet/minecraft/entity/player/EntityPlayer;Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "clonePlayer", "" + (isObfuscated ? "(Lzs;Z)V" : "(Lnet/minecraft/entity/player/EntityPlayer;Z)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalClonePlayer) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localClonePlayer", "(Lnet/minecraft/entity/player/EntityPlayer;Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "clonePlayer", "" + (isObfuscated ? "(Lzs;Z)V" : "(Lnet/minecraft/entity/player/EntityPlayer;Z)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "d" : "damageEntity", "" + (isObfuscated ? "(Lrh;F)V" : "(Lnet/minecraft/util/DamageSource;F)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "damageEntity", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/util/DamageSource;F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realDamageEntity", "(Lnet/minecraft/util/DamageSource;F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "d" : "damageEntity", "" + (isObfuscated ? "(Lrh;F)V" : "(Lnet/minecraft/util/DamageSource;F)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superDamageEntity", "(Lnet/minecraft/util/DamageSource;F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "d" : "damageEntity", "" + (isObfuscated ? "(Lrh;F)V" : "(Lnet/minecraft/util/DamageSource;F)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalDamageEntity) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDamageEntity", "(Lnet/minecraft/util/DamageSource;F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "d" : "damageEntity", "" + (isObfuscated ? "(Lrh;F)V" : "(Lnet/minecraft/util/DamageSource;F)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "displayGui", "" + (isObfuscated ? "(Lqs;)V" : "(Lnet/minecraft/world/IInteractionObject;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "displayGui", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/world/IInteractionObject;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realDisplayGui", "(Lnet/minecraft/world/IInteractionObject;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "displayGui", "" + (isObfuscated ? "(Lqs;)V" : "(Lnet/minecraft/world/IInteractionObject;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superDisplayGui", "(Lnet/minecraft/world/IInteractionObject;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "displayGui", "" + (isObfuscated ? "(Lqs;)V" : "(Lnet/minecraft/world/IInteractionObject;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalDisplayGui) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDisplayGui", "(Lnet/minecraft/world/IInteractionObject;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "displayGui", "" + (isObfuscated ? "(Lqs;)V" : "(Lnet/minecraft/world/IInteractionObject;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "displayGUIChest", "" + (isObfuscated ? "(Lql;)V" : "(Lnet/minecraft/inventory/IInventory;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "displayGUIChest", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/inventory/IInventory;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realDisplayGUIChest", "(Lnet/minecraft/inventory/IInventory;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "displayGUIChest", "" + (isObfuscated ? "(Lql;)V" : "(Lnet/minecraft/inventory/IInventory;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superDisplayGUIChest", "(Lnet/minecraft/inventory/IInventory;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "displayGUIChest", "" + (isObfuscated ? "(Lql;)V" : "(Lnet/minecraft/inventory/IInventory;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalDisplayGUIChest) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDisplayGUIChest", "(Lnet/minecraft/inventory/IInventory;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "displayGUIChest", "" + (isObfuscated ? "(Lql;)V" : "(Lnet/minecraft/inventory/IInventory;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Z)Lyk;" : "(Z)Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "dropOneItem", "(Lapi/player/server/IServerPlayerAPI;Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realDropOneItem", "(Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Z)Lyk;" : "(Z)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superDropOneItem", "(Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Z)Lyk;" : "(Z)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalDropOneItem) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDropOneItem", "(Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Z)Lyk;" : "(Z)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Ladz;Z)Lyk;" : "(Lnet/minecraft/item/ItemStack;Z)Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "dropPlayerItemWithRandomChoice", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/item/ItemStack;Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realDropPlayerItemWithRandomChoice", "(Lnet/minecraft/item/ItemStack;Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Ladz;Z)Lyk;" : "(Lnet/minecraft/item/ItemStack;Z)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superDropPlayerItemWithRandomChoice", "(Lnet/minecraft/item/ItemStack;Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Ladz;Z)Lyk;" : "(Lnet/minecraft/item/ItemStack;Z)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalDropPlayerItemWithRandomChoice) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localDropPlayerItemWithRandomChoice", "(Lnet/minecraft/item/ItemStack;Z)" + (isObfuscated ? "Lyk;" : "Lnet/minecraft/entity/item/EntityItem;") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "dropItem", "" + (isObfuscated ? "(Ladz;Z)Lyk;" : "(Lnet/minecraft/item/ItemStack;Z)Lnet/minecraft/entity/item/EntityItem;") + "", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "e" : "fall", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "fall", "(Lapi/player/server/IServerPlayerAPI;FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realFall", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "e" : "fall", "(FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superFall", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "e" : "fall", "(FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalFall) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localFall", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "e" : "fall", "(FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "cp" : "getAIMoveSpeed", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "getAIMoveSpeed", "(Lapi/player/server/IServerPlayerAPI;)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetAIMoveSpeed", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cp" : "getAIMoveSpeed", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetAIMoveSpeed", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "cp" : "getAIMoveSpeed", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetAIMoveSpeed) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetAIMoveSpeed", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "cp" : "getAIMoveSpeed", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, "getDigSpeed", "" + (isObfuscated ? "(Lars;Lcm;)F" : "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "getBreakSpeed", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetBreakSpeed", "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", "getDigSpeed", "" + (isObfuscated ? "(Lars;Lcm;)F" : "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F") + "", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetBreakSpeed", "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", "getDigSpeed", "" + (isObfuscated ? "(Lars;Lcm;)F" : "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F") + "", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetBreakSpeed) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetBreakSpeed", "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", "getDigSpeed", "" + (isObfuscated ? "(Lars;Lcm;)F" : "(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;)F") + "", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "e" : "getDistanceSq", "(DDD)D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "getDistanceSq", "(Lapi/player/server/IServerPlayerAPI;DDD)D", false); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetDistanceSq", "(DDD)D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "e" : "getDistanceSq", "(DDD)D", false); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetDistanceSq", "(DDD)D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "e" : "getDistanceSq", "(DDD)D", false); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetDistanceSq) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetDistanceSq", "(DDD)D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "e" : "getDistanceSq", "(DDD)D", false); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "e" : "getBrightness", "(F)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "getBrightness", "(Lapi/player/server/IServerPlayerAPI;F)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetBrightness", "(F)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "e" : "getBrightness", "(F)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetBrightness", "(F)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "e" : "getBrightness", "(F)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetBrightness) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetBrightness", "(F)F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "e" : "getBrightness", "(F)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "bq" : "getEyeHeight", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "getEyeHeight", "(Lapi/player/server/IServerPlayerAPI;)F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realGetEyeHeight", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bq" : "getEyeHeight", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superGetEyeHeight", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "bq" : "getEyeHeight", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalGetEyeHeight) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localGetEyeHeight", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "bq" : "getEyeHeight", "()F", false); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "b" : "heal", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "heal", "(Lapi/player/server/IServerPlayerAPI;F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realHeal", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "b" : "heal", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superHeal", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "b" : "heal", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalHeal) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localHeal", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "b" : "heal", "(F)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "av" : "isEntityInsideOpaqueBlock", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "isEntityInsideOpaqueBlock", "(Lapi/player/server/IServerPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realIsEntityInsideOpaqueBlock", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "av" : "isEntityInsideOpaqueBlock", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superIsEntityInsideOpaqueBlock", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "av" : "isEntityInsideOpaqueBlock", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalIsEntityInsideOpaqueBlock) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsEntityInsideOpaqueBlock", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "av" : "isEntityInsideOpaqueBlock", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "aj" : "isInWater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "isInWater", "(Lapi/player/server/IServerPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realIsInWater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aj" : "isInWater", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superIsInWater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "aj" : "isInWater", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalIsInWater) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsInWater", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "aj" : "isInWater", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "isInsideOfMaterial", "" + (isObfuscated ? "(Laxx;)Z" : "(Lnet/minecraft/block/material/Material;)Z") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "isInsideOfMaterial", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/block/material/Material;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realIsInsideOfMaterial", "(Lnet/minecraft/block/material/Material;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "isInsideOfMaterial", "" + (isObfuscated ? "(Laxx;)Z" : "(Lnet/minecraft/block/material/Material;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superIsInsideOfMaterial", "(Lnet/minecraft/block/material/Material;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "isInsideOfMaterial", "" + (isObfuscated ? "(Laxx;)Z" : "(Lnet/minecraft/block/material/Material;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalIsInsideOfMaterial) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsInsideOfMaterial", "(Lnet/minecraft/block/material/Material;)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "isInsideOfMaterial", "" + (isObfuscated ? "(Laxx;)Z" : "(Lnet/minecraft/block/material/Material;)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "m_" : "isOnLadder", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "isOnLadder", "(Lapi/player/server/IServerPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realIsOnLadder", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "m_" : "isOnLadder", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superIsOnLadder", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "m_" : "isOnLadder", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalIsOnLadder) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsOnLadder", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "m_" : "isOnLadder", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "cq" : "isPlayerSleeping", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "isPlayerSleeping", "(Lapi/player/server/IServerPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realIsPlayerSleeping", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cq" : "isPlayerSleeping", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superIsPlayerSleeping", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "cq" : "isPlayerSleeping", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalIsPlayerSleeping) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsPlayerSleeping", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "cq" : "isPlayerSleeping", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "aM" : "isSneaking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "isSneaking", "(Lapi/player/server/IServerPlayerAPI;)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realIsSneaking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aM" : "isSneaking", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superIsSneaking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "aM" : "isSneaking", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalIsSneaking) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localIsSneaking", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "aM" : "isSneaking", "()Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "cl" : "jump", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "jump", "(Lapi/player/server/IServerPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realJump", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cl" : "jump", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superJump", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "cl" : "jump", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalJump) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localJump", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "cl" : "jump", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "knockBack", "" + (isObfuscated ? "(Lrw;FDD)V" : "(Lnet/minecraft/entity/Entity;FDD)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "knockBack", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/entity/Entity;FDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realKnockBack", "(Lnet/minecraft/entity/Entity;FDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "knockBack", "" + (isObfuscated ? "(Lrw;FDD)V" : "(Lnet/minecraft/entity/Entity;FDD)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superKnockBack", "(Lnet/minecraft/entity/Entity;FDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "knockBack", "" + (isObfuscated ? "(Lrw;FDD)V" : "(Lnet/minecraft/entity/Entity;FDD)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalKnockBack) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localKnockBack", "(Lnet/minecraft/entity/Entity;FDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "knockBack", "" + (isObfuscated ? "(Lrw;FDD)V" : "(Lnet/minecraft/entity/Entity;FDD)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "startRiding", "" + (isObfuscated ? "(Lrw;Z)Z" : "(Lnet/minecraft/entity/Entity;Z)Z") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "mountEntity", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/entity/Entity;Z)Z", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realMountEntity", "(Lnet/minecraft/entity/Entity;Z)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "startRiding", "" + (isObfuscated ? "(Lrw;Z)Z" : "(Lnet/minecraft/entity/Entity;Z)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superMountEntity", "(Lnet/minecraft/entity/Entity;Z)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "startRiding", "" + (isObfuscated ? "(Lrw;Z)Z" : "(Lnet/minecraft/entity/Entity;Z)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalMountEntity) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMountEntity", "(Lnet/minecraft/entity/Entity;Z)Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "startRiding", "" + (isObfuscated ? "(Lrw;Z)Z" : "(Lnet/minecraft/entity/Entity;Z)Z") + "", false); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "d" : "moveEntity", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "moveEntity", "(Lapi/player/server/IServerPlayerAPI;DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realMoveEntity", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "d" : "moveEntity", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superMoveEntity", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "d" : "moveEntity", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalMoveEntity) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMoveEntity", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "d" : "moveEntity", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "g" : "moveEntityWithHeading", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "moveEntityWithHeading", "(Lapi/player/server/IServerPlayerAPI;FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realMoveEntityWithHeading", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "g" : "moveEntityWithHeading", "(FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superMoveEntityWithHeading", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "g" : "moveEntityWithHeading", "(FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalMoveEntityWithHeading) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMoveEntityWithHeading", "(FF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "g" : "moveEntityWithHeading", "(FF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "moveRelative", "(FFF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.FLOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "moveFlying", "(Lapi/player/server/IServerPlayerAPI;FFF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realMoveFlying", "(FFF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.FLOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "moveRelative", "(FFF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superMoveFlying", "(FFF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.FLOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "moveRelative", "(FFF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalMoveFlying) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localMoveFlying", "(FFF)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.FLOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "moveRelative", "(FFF)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "onDeath", "" + (isObfuscated ? "(Lrh;)V" : "(Lnet/minecraft/util/DamageSource;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "onDeath", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/util/DamageSource;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realOnDeath", "(Lnet/minecraft/util/DamageSource;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "onDeath", "" + (isObfuscated ? "(Lrh;)V" : "(Lnet/minecraft/util/DamageSource;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superOnDeath", "(Lnet/minecraft/util/DamageSource;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "onDeath", "" + (isObfuscated ? "(Lrh;)V" : "(Lnet/minecraft/util/DamageSource;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalOnDeath) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnDeath", "(Lnet/minecraft/util/DamageSource;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "onDeath", "" + (isObfuscated ? "(Lrh;)V" : "(Lnet/minecraft/util/DamageSource;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "n" : "onLivingUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "onLivingUpdate", "(Lapi/player/server/IServerPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realOnLivingUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "n" : "onLivingUpdate", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superOnLivingUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "n" : "onLivingUpdate", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalOnLivingUpdate) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnLivingUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "n" : "onLivingUpdate", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "b" : "onKillEntity", "" + (isObfuscated ? "(Lsf;)V" : "(Lnet/minecraft/entity/EntityLivingBase;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "onKillEntity", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/entity/EntityLivingBase;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realOnKillEntity", "(Lnet/minecraft/entity/EntityLivingBase;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "b" : "onKillEntity", "" + (isObfuscated ? "(Lsf;)V" : "(Lnet/minecraft/entity/EntityLivingBase;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superOnKillEntity", "(Lnet/minecraft/entity/EntityLivingBase;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "b" : "onKillEntity", "" + (isObfuscated ? "(Lsf;)V" : "(Lnet/minecraft/entity/EntityLivingBase;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalOnKillEntity) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnKillEntity", "(Lnet/minecraft/entity/EntityLivingBase;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "b" : "onKillEntity", "" + (isObfuscated ? "(Lsf;)V" : "(Lnet/minecraft/entity/EntityLivingBase;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "onStruckByLightning", "" + (isObfuscated ? "(Lyh;)V" : "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "onStruckByLightning", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/entity/effect/EntityLightningBolt;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realOnStruckByLightning", "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "onStruckByLightning", "" + (isObfuscated ? "(Lyh;)V" : "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superOnStruckByLightning", "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "onStruckByLightning", "" + (isObfuscated ? "(Lyh;)V" : "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalOnStruckByLightning) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnStruckByLightning", "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "onStruckByLightning", "" + (isObfuscated ? "(Lyh;)V" : "(Lnet/minecraft/entity/effect/EntityLightningBolt;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "m" : "onUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "onUpdate", "(Lapi/player/server/IServerPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realOnUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "m" : "onUpdate", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superOnUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "m" : "onUpdate", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalOnUpdate) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnUpdate", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "m" : "onUpdate", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "k_" : "onUpdateEntity", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "onUpdateEntity", "(Lapi/player/server/IServerPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realOnUpdateEntity", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "k_" : "onUpdateEntity", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superOnUpdateEntity", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "k_" : "onUpdateEntity", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalOnUpdateEntity) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localOnUpdateEntity", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "k_" : "onUpdateEntity", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "readEntityFromNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "readEntityFromNBT", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/nbt/NBTTagCompound;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realReadEntityFromNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "readEntityFromNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superReadEntityFromNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "readEntityFromNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalReadEntityFromNBT) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localReadEntityFromNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "readEntityFromNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "T" : "setDead", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "setDead", "(Lapi/player/server/IServerPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSetDead", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "T" : "setDead", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSetDead", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "T" : "setDead", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalSetDead) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetDead", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "T" : "setDead", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "setEntityActionState", "(FFZZ)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitVarInsn(Opcodes.ILOAD, 4); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "setEntityActionState", "(Lapi/player/server/IServerPlayerAPI;FFZZ)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSetEntityActionState", "(FFZZ)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitVarInsn(Opcodes.ILOAD, 4); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "setEntityActionState", "(FFZZ)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSetEntityActionState", "(FFZZ)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitVarInsn(Opcodes.ILOAD, 4); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "setEntityActionState", "(FFZZ)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalSetEntityActionState) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetEntityActionState", "(FFZZ)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitVarInsn(Opcodes.FLOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitVarInsn(Opcodes.ILOAD, 4); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "setEntityActionState", "(FFZZ)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "b" : "setPosition", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "setPosition", "(Lapi/player/server/IServerPlayerAPI;DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSetPosition", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "b" : "setPosition", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSetPosition", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "b" : "setPosition", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalSetPosition) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetPosition", "(DDD)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitVarInsn(Opcodes.DLOAD, 3); - mv.visitVarInsn(Opcodes.DLOAD, 5); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "b" : "setPosition", "(DDD)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "e" : "setSneaking", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "setSneaking", "(Lapi/player/server/IServerPlayerAPI;Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSetSneaking", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "e" : "setSneaking", "(Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSetSneaking", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "e" : "setSneaking", "(Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalSetSneaking) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetSneaking", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "e" : "setSneaking", "(Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "f" : "setSprinting", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "setSprinting", "(Lapi/player/server/IServerPlayerAPI;Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSetSprinting", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "f" : "setSprinting", "(Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSetSprinting", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "f" : "setSprinting", "(Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalSetSprinting) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSetSprinting", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "f" : "setSprinting", "(Z)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "swingArm", "" + (isObfuscated ? "(Lqr;)V" : "(Lnet/minecraft/util/EnumHand;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "swingItem", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/util/EnumHand;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realSwingItem", "(Lnet/minecraft/util/EnumHand;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "swingArm", "" + (isObfuscated ? "(Lqr;)V" : "(Lnet/minecraft/util/EnumHand;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superSwingItem", "(Lnet/minecraft/util/EnumHand;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "swingArm", "" + (isObfuscated ? "(Lqr;)V" : "(Lnet/minecraft/util/EnumHand;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalSwingItem) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localSwingItem", "(Lnet/minecraft/util/EnumHand;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "swingArm", "" + (isObfuscated ? "(Lqr;)V" : "(Lnet/minecraft/util/EnumHand;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "cr" : "updateEntityActionState", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "updateEntityActionState", "(Lapi/player/server/IServerPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realUpdateEntityActionState", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cr" : "updateEntityActionState", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superUpdateEntityActionState", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "cr" : "updateEntityActionState", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalUpdateEntityActionState) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localUpdateEntityActionState", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "cr" : "updateEntityActionState", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "bO" : "updatePotionEffects", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "updatePotionEffects", "(Lapi/player/server/IServerPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realUpdatePotionEffects", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bO" : "updatePotionEffects", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superUpdatePotionEffects", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "bO" : "updatePotionEffects", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalUpdatePotionEffects) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localUpdatePotionEffects", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "bO" : "updatePotionEffects", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "aw" : "updateRidden", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "updateRidden", "(Lapi/player/server/IServerPlayerAPI;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realUpdateRidden", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aw" : "updateRidden", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superUpdateRidden", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "aw" : "updateRidden", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalUpdateRidden) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localUpdateRidden", "()V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "aw" : "updateRidden", "()V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "a" : "wakeUpPlayer", "(ZZZ)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "wakeUpPlayer", "(Lapi/player/server/IServerPlayerAPI;ZZZ)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realWakeUpPlayer", "(ZZZ)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "wakeUpPlayer", "(ZZZ)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superWakeUpPlayer", "(ZZZ)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "wakeUpPlayer", "(ZZZ)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalWakeUpPlayer) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localWakeUpPlayer", "(ZZZ)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitVarInsn(Opcodes.ILOAD, 2); - mv.visitVarInsn(Opcodes.ILOAD, 3); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "a" : "wakeUpPlayer", "(ZZZ)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC, isObfuscated ? "b" : "writeEntityToNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "writeEntityToNBT", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/nbt/NBTTagCompound;)V", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "realWriteEntityToNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "b" : "writeEntityToNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "superWriteEntityToNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "b" : "writeEntityToNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - if(!hadLocalWriteEntityToNBT) - { - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "localWriteEntityToNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESPECIAL, isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer", isObfuscated ? "b" : "writeEntityToNBT", "" + (isObfuscated ? "(Ldr;)V" : "(Lnet/minecraft/nbt/NBTTagCompound;)V") + "", false); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - } - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getActiveItemStackField", isObfuscated ? "()Ladz;" : "()Lnet/minecraft/item/ItemStack;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bo" : "activeItemStack", isObfuscated ? "Ladz;" : "Lnet/minecraft/item/ItemStack;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setActiveItemStackField", isObfuscated ? "(Ladz;)V" : "(Lnet/minecraft/item/ItemStack;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bo" : "activeItemStack", isObfuscated ? "Ladz;" : "Lnet/minecraft/item/ItemStack;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getActiveItemStackUseCountField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bp" : "activeItemStackUseCount", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setActiveItemStackUseCountField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bp" : "activeItemStackUseCount", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getAddedToChunkField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ab" : "addedToChunk", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setAddedToChunkField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ab" : "addedToChunk", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getArrowHitTimerField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ay" : "arrowHitTimer", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setArrowHitTimerField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ay" : "arrowHitTimer", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getAttackedAtYawField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aB" : "attackedAtYaw", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setAttackedAtYawField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aB" : "attackedAtYaw", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getAttackingPlayerField", isObfuscated ? "()Lzs;" : "()Lnet/minecraft/entity/player/EntityPlayer;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aT" : "attackingPlayer", isObfuscated ? "Lzs;" : "Lnet/minecraft/entity/player/EntityPlayer;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setAttackingPlayerField", isObfuscated ? "(Lzs;)V" : "(Lnet/minecraft/entity/player/EntityPlayer;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aT" : "attackingPlayer", isObfuscated ? "Lzs;" : "Lnet/minecraft/entity/player/EntityPlayer;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getCachedUniqueIdStringField", "()Ljava/lang/String;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "as" : "cachedUniqueIdString", "Ljava/lang/String;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setCachedUniqueIdStringField", "(Ljava/lang/String;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "as" : "cachedUniqueIdString", "Ljava/lang/String;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getCameraPitchField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aL" : "cameraPitch", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setCameraPitchField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aL" : "cameraPitch", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getCameraYawField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bz" : "cameraYaw", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setCameraYawField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bz" : "cameraYaw", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getCapabilitiesField", isObfuscated ? "()Lzq;" : "()Lnet/minecraft/entity/player/PlayerCapabilities;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bL" : "capabilities", isObfuscated ? "Lzq;" : "Lnet/minecraft/entity/player/PlayerCapabilities;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setCapabilitiesField", isObfuscated ? "(Lzq;)V" : "(Lnet/minecraft/entity/player/PlayerCapabilities;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bL" : "capabilities", isObfuscated ? "Lzq;" : "Lnet/minecraft/entity/player/PlayerCapabilities;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChasingPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bE" : "chasingPosX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChasingPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bE" : "chasingPosX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChasingPosYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bF" : "chasingPosY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChasingPosYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bF" : "chasingPosY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChasingPosZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bG" : "chasingPosZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChasingPosZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bG" : "chasingPosZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChatColoursField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ci" : "chatColours", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChatColoursField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ci" : "chatColours", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChatVisibilityField", isObfuscated ? "()Lzs$b;" : "()Lnet/minecraft/entity/player/EntityPlayer$EnumChatVisibility;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ch" : "chatVisibility", isObfuscated ? "Lzs$b;" : "Lnet/minecraft/entity/player/EntityPlayer$EnumChatVisibility;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChatVisibilityField", isObfuscated ? "(Lzs$b;)V" : "(Lnet/minecraft/entity/player/EntityPlayer$EnumChatVisibility;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ch" : "chatVisibility", isObfuscated ? "Lzs$b;" : "Lnet/minecraft/entity/player/EntityPlayer$EnumChatVisibility;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChunkCoordXField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ac" : "chunkCoordX", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChunkCoordXField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ac" : "chunkCoordX", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChunkCoordYField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ad" : "chunkCoordY", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChunkCoordYField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ad" : "chunkCoordY", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getChunkCoordZField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ae" : "chunkCoordZ", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setChunkCoordZField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ae" : "chunkCoordZ", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getCombinedHealthField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bW" : "lastHealthScore", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setCombinedHealthField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bW" : "lastHealthScore", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getCurrentWindowIdField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cm" : "currentWindowId", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setCurrentWindowIdField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cm" : "currentWindowId", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getDataWatcherField", isObfuscated ? "()Lkk;" : "()Lnet/minecraft/network/datasync/EntityDataManager;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "Z" : "dataManager", isObfuscated ? "Lkk;" : "Lnet/minecraft/network/datasync/EntityDataManager;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setDataWatcherField", isObfuscated ? "(Lkk;)V" : "(Lnet/minecraft/network/datasync/EntityDataManager;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "Z" : "dataManager", isObfuscated ? "Lkk;" : "Lnet/minecraft/network/datasync/EntityDataManager;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getDeadField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aV" : "dead", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setDeadField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aV" : "dead", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getDeathTimeField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aC" : "deathTime", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setDeathTimeField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aC" : "deathTime", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getDestroyedItemsNetCacheField", "()Ljava/util/List;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bU" : "entityRemoveQueue", "Ljava/util/List;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getDimensionField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "an" : "dimension", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setDimensionField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "an" : "dimension", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getDistanceWalkedModifiedField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "J" : "distanceWalkedModified", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setDistanceWalkedModifiedField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "J" : "distanceWalkedModified", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getDistanceWalkedOnStepModifiedField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "K" : "distanceWalkedOnStepModified", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setDistanceWalkedOnStepModifiedField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "K" : "distanceWalkedOnStepModified", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getEntityAgeField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aW" : "entityAge", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setEntityAgeField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aW" : "entityAge", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getEntityCollisionReductionField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "R" : "entityCollisionReduction", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setEntityCollisionReductionField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "R" : "entityCollisionReduction", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getEntityUniqueIDField", "()Ljava/util/UUID;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ar" : "entityUniqueID", "Ljava/util/UUID;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setEntityUniqueIDField", "(Ljava/util/UUID;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ar" : "entityUniqueID", "Ljava/util/UUID;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getExperienceField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bO" : "experience", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setExperienceField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bO" : "experience", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getExperienceLevelField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bM" : "experienceLevel", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setExperienceLevelField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bM" : "experienceLevel", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getExperienceTotalField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bN" : "experienceTotal", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setExperienceTotalField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bN" : "experienceTotal", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFallDistanceField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "L" : "fallDistance", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setFallDistanceField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "L" : "fallDistance", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFireResistanceField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "U" : "fireResistance", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setFireResistanceField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "U" : "fireResistance", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFirstUpdateField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "X" : "firstUpdate", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setFirstUpdateField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "X" : "firstUpdate", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFishEntityField", isObfuscated ? "()Lyd;" : "()Lnet/minecraft/entity/projectile/EntityFishHook;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bR" : "fishEntity", isObfuscated ? "Lyd;" : "Lnet/minecraft/entity/projectile/EntityFishHook;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setFishEntityField", isObfuscated ? "(Lyd;)V" : "(Lnet/minecraft/entity/projectile/EntityFishHook;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bR" : "fishEntity", isObfuscated ? "Lyd;" : "Lnet/minecraft/entity/projectile/EntityFishHook;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFlagsField", isObfuscated ? "()Lkh;" : "()Lnet/minecraft/network/datasync/DataParameter;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aa" : "FLAGS", isObfuscated ? "Lkh;" : "Lnet/minecraft/network/datasync/DataParameter;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFlyToggleTimerField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bx" : "flyToggleTimer", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setFlyToggleTimerField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bx" : "flyToggleTimer", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getFoodStatsField", isObfuscated ? "()Labb;" : "()Lnet/minecraft/util/FoodStats;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bw" : "foodStats", isObfuscated ? "Labb;" : "Lnet/minecraft/util/FoodStats;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setFoodStatsField", isObfuscated ? "(Labb;)V" : "(Lnet/minecraft/util/FoodStats;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bw" : "foodStats", isObfuscated ? "Labb;" : "Lnet/minecraft/util/FoodStats;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getForceSpawnField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "k" : "forceSpawn", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setForceSpawnField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "k" : "forceSpawn", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getGlowingField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "at" : "glowing", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setGlowingField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "at" : "glowing", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHandStatesField", isObfuscated ? "()Lkh;" : "()Lnet/minecraft/network/datasync/DataParameter;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "au" : "HAND_STATES", isObfuscated ? "Lkh;" : "Lnet/minecraft/network/datasync/DataParameter;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHeightField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "H" : "height", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHeightField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "H" : "height", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHundredEightyField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bb" : "unused180", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHundredEightyField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bb" : "unused180", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHurtResistantTimeField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "W" : "hurtResistantTime", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHurtResistantTimeField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "W" : "hurtResistantTime", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getHurtTimeField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "az" : "hurtTime", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setHurtTimeField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "az" : "hurtTime", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIgnoreFrustumCheckField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ai" : "ignoreFrustumCheck", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIgnoreFrustumCheckField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ai" : "ignoreFrustumCheck", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInPortalField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "al" : "inPortal", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInPortalField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "al" : "inPortal", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInWaterField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "V" : "inWater", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInWaterField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "V" : "inWater", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInteractionManagerField", isObfuscated ? "()Llv;" : "()Lnet/minecraft/server/management/PlayerInteractionManager;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "c" : "interactionManager", isObfuscated ? "Llv;" : "Lnet/minecraft/server/management/PlayerInteractionManager;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInterpTargetXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bj" : "interpEntityPlayerMPX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInterpTargetXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bj" : "interpEntityPlayerMPX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInterpTargetYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bk" : "interpEntityPlayerMPY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInterpTargetYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bk" : "interpEntityPlayerMPY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInterpTargetYawField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bm" : "interpEntityPlayerMPYaw", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInterpTargetYawField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bm" : "interpEntityPlayerMPYaw", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInterpTargetZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bl" : "interpEntityPlayerMPZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInterpTargetZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bl" : "interpEntityPlayerMPZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInventoryField", isObfuscated ? "()Lzr;" : "()Lnet/minecraft/entity/player/InventoryPlayer;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bt" : "inventory", isObfuscated ? "Lzr;" : "Lnet/minecraft/entity/player/InventoryPlayer;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInventoryField", isObfuscated ? "(Lzr;)V" : "(Lnet/minecraft/entity/player/InventoryPlayer;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bt" : "inventory", isObfuscated ? "Lzr;" : "Lnet/minecraft/entity/player/InventoryPlayer;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInventoryContainerField", isObfuscated ? "()Labd;" : "()Lnet/minecraft/inventory/Container;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bu" : "inventoryContainer", isObfuscated ? "Labd;" : "Lnet/minecraft/inventory/Container;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInventoryContainerField", isObfuscated ? "(Labd;)V" : "(Lnet/minecraft/inventory/Container;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bu" : "inventoryContainer", isObfuscated ? "Labd;" : "Lnet/minecraft/inventory/Container;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getInvulnerableDimensionChangeField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cl" : "invulnerableDimensionChange", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setInvulnerableDimensionChangeField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cl" : "invulnerableDimensionChange", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsAirBorneField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aj" : "isAirBorne", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsAirBorneField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aj" : "isAirBorne", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsChangingQuantityOnlyField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "f" : "isChangingQuantityOnly", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsChangingQuantityOnlyField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "f" : "isChangingQuantityOnly", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsCollidedField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "C" : "isCollided", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsCollidedField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "C" : "isCollided", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsCollidedHorizontallyField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "A" : "isCollidedHorizontally", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsCollidedHorizontallyField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "A" : "isCollidedHorizontally", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsCollidedVerticallyField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "B" : "isCollidedVertically", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsCollidedVerticallyField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "B" : "isCollidedVertically", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsDeadField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "F" : "isDead", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsDeadField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "F" : "isDead", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsImmuneToFireField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "Y" : "isImmuneToFire", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsImmuneToFireField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "Y" : "isImmuneToFire", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsInWebField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "E" : "isInWeb", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsInWebField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "E" : "isInWeb", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsJumpingField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "be" : "isJumping", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsJumpingField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "be" : "isJumping", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getIsSwingInProgressField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "av" : "isSwingInProgress", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setIsSwingInProgressField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "av" : "isSwingInProgress", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getJumpMovementFactorField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aS" : "jumpMovementFactor", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setJumpMovementFactorField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aS" : "jumpMovementFactor", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastAirScoreField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bY" : "lastAirScore", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastAirScoreField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bY" : "lastAirScore", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastArmorScoreField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bZ" : "lastArmorScore", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastArmorScoreField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bZ" : "lastArmorScore", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastDamageField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bd" : "lastDamage", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastDamageField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bd" : "lastDamage", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastExperienceField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cf" : "lastExperience", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastExperienceField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cf" : "lastExperience", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastExperienceScoreField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cb" : "lastExperienceScore", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastExperienceScoreField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cb" : "lastExperienceScore", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastFoodLevelField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cd" : "lastFoodLevel", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastFoodLevelField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cd" : "lastFoodLevel", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastFoodScoreField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bX" : "lastFoodScore", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastFoodScoreField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bX" : "lastFoodScore", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastHealthField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cc" : "lastHealth", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastHealthField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cc" : "lastHealth", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastLevelScoreField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ca" : "lastLevelScore", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastLevelScoreField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ca" : "lastLevelScore", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastPortalPosField", isObfuscated ? "()Lcm;" : "()Lnet/minecraft/util/math/BlockPos;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ao" : "lastPortalPos", isObfuscated ? "Lcm;" : "Lnet/minecraft/util/math/BlockPos;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastPortalPosField", isObfuscated ? "(Lcm;)V" : "(Lnet/minecraft/util/math/BlockPos;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ao" : "lastPortalPos", isObfuscated ? "Lcm;" : "Lnet/minecraft/util/math/BlockPos;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastPortalVecField", isObfuscated ? "()Lbcb;" : "()Lnet/minecraft/util/math/Vec3d;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ap" : "lastPortalVec", isObfuscated ? "Lbcb;" : "Lnet/minecraft/util/math/Vec3d;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastPortalVecField", isObfuscated ? "(Lbcb;)V" : "(Lnet/minecraft/util/math/Vec3d;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ap" : "lastPortalVec", isObfuscated ? "Lbcb;" : "Lnet/minecraft/util/math/Vec3d;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastTickPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "M" : "lastTickPosX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastTickPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "M" : "lastTickPosX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastTickPosYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "N" : "lastTickPosY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastTickPosYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "N" : "lastTickPosY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLastTickPosZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "O" : "lastTickPosZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLastTickPosZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "O" : "lastTickPosZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLimbSwingField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aI" : "limbSwing", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLimbSwingField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aI" : "limbSwing", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLimbSwingAmountField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aH" : "limbSwingAmount", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setLimbSwingAmountField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aH" : "limbSwingAmount", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getLoggerField", "()Lorg/apache/logging/log4j/Logger;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bS" : "LOGGER", "Lorg/apache/logging/log4j/Logger;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMainHandField", isObfuscated ? "()Lkh;" : "()Lnet/minecraft/network/datasync/DataParameter;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bs" : "MAIN_HAND", isObfuscated ? "Lkh;" : "Lnet/minecraft/network/datasync/DataParameter;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getManagedPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "d" : "managedPosX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setManagedPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "d" : "managedPosX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getManagedPosZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "e" : "managedPosZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setManagedPosZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "e" : "managedPosZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMaxHurtResistantTimeField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aJ" : "maxHurtResistantTime", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMaxHurtResistantTimeField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aJ" : "maxHurtResistantTime", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMaxHurtTimeField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aA" : "maxHurtTime", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMaxHurtTimeField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aA" : "maxHurtTime", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMcServerField", "()Lnet/minecraft/server/MinecraftServer;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "b" : "mcServer", "Lnet/minecraft/server/MinecraftServer;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMotionXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "s" : "motionX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMotionXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "s" : "motionX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMotionYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "t" : "motionY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMotionYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "t" : "motionY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMotionZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "u" : "motionZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMotionZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "u" : "motionZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMoveForwardField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bg" : "moveForward", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMoveForwardField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bg" : "moveForward", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMoveStrafingField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bf" : "moveStrafing", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMoveStrafingField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bf" : "moveStrafing", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getMovedDistanceField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aZ" : "movedDistance", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setMovedDistanceField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aZ" : "movedDistance", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getNewPosRotationIncrementsField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bi" : "newPosRotationIncrements", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setNewPosRotationIncrementsField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bi" : "newPosRotationIncrements", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getNewPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bn" : "interpEntityPlayerMPPitch", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setNewPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bn" : "interpEntityPlayerMPPitch", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getNoClipField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "Q" : "noClip", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setNoClipField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "Q" : "noClip", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getOnGroundField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "z" : "onGround", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setOnGroundField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "z" : "onGround", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getOnGroundSpeedFactorField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aY" : "onGroundSpeedFactor", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setOnGroundSpeedFactorField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aY" : "onGroundSpeedFactor", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getOpenContainerField", isObfuscated ? "()Labd;" : "()Lnet/minecraft/inventory/Container;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bv" : "openContainer", isObfuscated ? "Labd;" : "Lnet/minecraft/inventory/Container;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setOpenContainerField", isObfuscated ? "(Labd;)V" : "(Lnet/minecraft/inventory/Container;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bv" : "openContainer", isObfuscated ? "Labd;" : "Lnet/minecraft/inventory/Container;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPingField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "g" : "ping", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPingField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "g" : "ping", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPlayerConqueredTheEndField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "h" : "playerConqueredTheEnd", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPlayerConqueredTheEndField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "h" : "playerConqueredTheEnd", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPlayerLastActiveTimeField", "()J", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cj" : "playerLastActiveTime", "J"); - mv.visitInsn(Opcodes.LRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPlayerLastActiveTimeField", "(J)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.LLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cj" : "playerLastActiveTime", "J"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPlayerLocationField", isObfuscated ? "()Lcm;" : "()Lnet/minecraft/util/math/BlockPos;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bI" : "bedLocation", isObfuscated ? "Lcm;" : "Lnet/minecraft/util/math/BlockPos;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPlayerLocationField", isObfuscated ? "(Lcm;)V" : "(Lnet/minecraft/util/math/BlockPos;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bI" : "bedLocation", isObfuscated ? "Lcm;" : "Lnet/minecraft/util/math/BlockPos;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPlayerModelFlagField", isObfuscated ? "()Lkh;" : "()Lnet/minecraft/network/datasync/DataParameter;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "br" : "PLAYER_MODEL_FLAG", isObfuscated ? "Lkh;" : "Lnet/minecraft/network/datasync/DataParameter;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPlayerNetServerHandlerField", isObfuscated ? "()Lme;" : "()Lnet/minecraft/network/NetHandlerPlayServer;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "connection", isObfuscated ? "Lme;" : "Lnet/minecraft/network/NetHandlerPlayServer;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPlayerNetServerHandlerField", isObfuscated ? "(Lme;)V" : "(Lnet/minecraft/network/NetHandlerPlayServer;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "a" : "connection", isObfuscated ? "Lme;" : "Lnet/minecraft/network/NetHandlerPlayServer;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPortalCounterField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "am" : "portalCounter", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPortalCounterField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "am" : "portalCounter", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "p" : "posX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "p" : "posX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPosYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "q" : "posY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPosYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "q" : "posY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPosZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "r" : "posZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPosZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "r" : "posZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevCameraPitchField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aK" : "prevCameraPitch", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevCameraPitchField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aK" : "prevCameraPitch", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevCameraYawField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "by" : "prevCameraYaw", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevCameraYawField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "by" : "prevCameraYaw", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevChasingPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bB" : "prevChasingPosX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevChasingPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bB" : "prevChasingPosX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevChasingPosYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bC" : "prevChasingPosY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevChasingPosYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bC" : "prevChasingPosY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevChasingPosZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bD" : "prevChasingPosZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevChasingPosZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bD" : "prevChasingPosZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevDistanceWalkedModifiedField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "I" : "prevDistanceWalkedModified", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevDistanceWalkedModifiedField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "I" : "prevDistanceWalkedModified", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevLimbSwingAmountField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aG" : "prevLimbSwingAmount", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevLimbSwingAmountField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aG" : "prevLimbSwingAmount", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevMovedDistanceField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ba" : "prevMovedDistance", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevMovedDistanceField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ba" : "prevMovedDistance", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevOnGroundSpeedFactorField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aX" : "prevOnGroundSpeedFactor", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevOnGroundSpeedFactorField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aX" : "prevOnGroundSpeedFactor", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevPosXField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "m" : "prevPosX", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevPosXField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "m" : "prevPosX", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevPosYField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "n" : "prevPosY", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevPosYField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "n" : "prevPosY", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevPosZField", "()D", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "o" : "prevPosZ", "D"); - mv.visitInsn(Opcodes.DRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevPosZField", "(D)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.DLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "o" : "prevPosZ", "D"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevRenderYawOffsetField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aP" : "prevRenderYawOffset", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevRenderYawOffsetField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aP" : "prevRenderYawOffset", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevRotationPitchField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "y" : "prevRotationPitch", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevRotationPitchField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "y" : "prevRotationPitch", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevRotationYawField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "x" : "prevRotationYaw", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevRotationYawField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "x" : "prevRotationYaw", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevRotationYawHeadField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aR" : "prevRotationYawHead", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevRotationYawHeadField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aR" : "prevRotationYawHead", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPrevSwingProgressField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aD" : "prevSwingProgress", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPrevSwingProgressField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aD" : "prevSwingProgress", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getPreventEntitySpawningField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "i" : "preventEntitySpawning", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setPreventEntitySpawningField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "i" : "preventEntitySpawning", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRandField", "()Ljava/util/Random;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "S" : "rand", "Ljava/util/Random;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRandField", "(Ljava/util/Random;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "S" : "rand", "Ljava/util/Random;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRandomNumberBetweenOneHundredthAndTwoHundredthField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aN" : "randomUnused1", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRandomNumberBetweenOneHundredthAndTwoHundredthField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aN" : "randomUnused1", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRandomNumberBetweenZeroAndTwelveThousandThreeHundredNinetyEightField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aM" : "randomUnused2", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRandomNumberBetweenZeroAndTwelveThousandThreeHundredNinetyEightField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aM" : "randomUnused2", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRandomYawVelocityField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bh" : "randomYawVelocity", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRandomYawVelocityField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bh" : "randomYawVelocity", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRecentlyHitField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aU" : "recentlyHit", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRecentlyHitField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aU" : "recentlyHit", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRenderOffsetXField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bJ" : "renderOffsetX", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRenderOffsetXField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bJ" : "renderOffsetX", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRenderOffsetYField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cn" : "renderOffsetY", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRenderOffsetYField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cn" : "renderOffsetY", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRenderOffsetZField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bK" : "renderOffsetZ", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRenderOffsetZField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bK" : "renderOffsetZ", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRenderYawOffsetField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aO" : "renderYawOffset", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRenderYawOffsetField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aO" : "renderYawOffset", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRespawnInvulnerabilityTicksField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cg" : "respawnInvulnerabilityTicks", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRespawnInvulnerabilityTicksField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "cg" : "respawnInvulnerabilityTicks", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRideCooldownField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "j" : "rideCooldown", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRideCooldownField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "j" : "rideCooldown", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRotationPitchField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "w" : "rotationPitch", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRotationPitchField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "w" : "rotationPitch", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRotationYawField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "v" : "rotationYaw", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRotationYawField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "v" : "rotationYaw", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getRotationYawHeadField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aQ" : "rotationYawHead", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setRotationYawHeadField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aQ" : "rotationYawHead", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getScoreValueField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bc" : "scoreValue", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setScoreValueField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bc" : "scoreValue", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getServerPosXField", "()J", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "af" : "serverPosX", "J"); - mv.visitInsn(Opcodes.LRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setServerPosXField", "(J)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.LLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "af" : "serverPosX", "J"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getServerPosYField", "()J", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ag" : "serverPosY", "J"); - mv.visitInsn(Opcodes.LRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setServerPosYField", "(J)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.LLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ag" : "serverPosY", "J"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getServerPosZField", "()J", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ah" : "serverPosZ", "J"); - mv.visitInsn(Opcodes.LRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setServerPosZField", "(J)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.LLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ah" : "serverPosZ", "J"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSleepingField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bH" : "sleeping", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSleepingField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bH" : "sleeping", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSpectatingEntityField", isObfuscated ? "()Lrw;" : "()Lnet/minecraft/entity/Entity;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ck" : "spectatingEntity", isObfuscated ? "Lrw;" : "Lnet/minecraft/entity/Entity;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSpectatingEntityField", isObfuscated ? "(Lrw;)V" : "(Lnet/minecraft/entity/Entity;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ck" : "spectatingEntity", isObfuscated ? "Lrw;" : "Lnet/minecraft/entity/Entity;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSpeedInAirField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bQ" : "speedInAir", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSpeedInAirField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bQ" : "speedInAir", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSpeedOnGroundField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bP" : "speedOnGround", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSpeedOnGroundField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bP" : "speedOnGround", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getStatsFileField", isObfuscated ? "()Lnr;" : "()Lnet/minecraft/stats/StatisticsManagerServer;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bV" : "statsFile", isObfuscated ? "Lnr;" : "Lnet/minecraft/stats/StatisticsManagerServer;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getStepHeightField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "P" : "stepHeight", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setStepHeightField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "P" : "stepHeight", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSwingProgressField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aE" : "swingProgress", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSwingProgressField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aE" : "swingProgress", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSwingProgressIntField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ax" : "swingProgressInt", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSwingProgressIntField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ax" : "swingProgressInt", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getSwingingHandField", isObfuscated ? "()Lqr;" : "()Lnet/minecraft/util/EnumHand;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aw" : "swingingHand", isObfuscated ? "Lqr;" : "Lnet/minecraft/util/EnumHand;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setSwingingHandField", isObfuscated ? "(Lqr;)V" : "(Lnet/minecraft/util/EnumHand;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aw" : "swingingHand", isObfuscated ? "Lqr;" : "Lnet/minecraft/util/EnumHand;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTeleportDirectionField", isObfuscated ? "()Lct;" : "()Lnet/minecraft/util/EnumFacing;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aq" : "teleportDirection", isObfuscated ? "Lct;" : "Lnet/minecraft/util/EnumFacing;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTeleportDirectionField", isObfuscated ? "(Lct;)V" : "(Lnet/minecraft/util/EnumFacing;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aq" : "teleportDirection", isObfuscated ? "Lct;" : "Lnet/minecraft/util/EnumFacing;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTicksElytraFlyingField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bq" : "ticksElytraFlying", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTicksElytraFlyingField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bq" : "ticksElytraFlying", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTicksExistedField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "T" : "ticksExisted", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTicksExistedField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "T" : "ticksExisted", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTicksSinceLastSwingField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aF" : "ticksSinceLastSwing", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTicksSinceLastSwingField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "aF" : "ticksSinceLastSwing", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTimeUntilPortalField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ak" : "timeUntilPortal", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTimeUntilPortalField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ak" : "timeUntilPortal", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getTranslatorField", "()Ljava/lang/String;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bT" : "language", "Ljava/lang/String;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setTranslatorField", "(Ljava/lang/String;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bT" : "language", "Ljava/lang/String;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getVelocityChangedField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "D" : "velocityChanged", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setVelocityChangedField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "D" : "velocityChanged", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getWasHungryField", "()Z", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ce" : "wasHungry", "Z"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setWasHungryField", "(Z)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "ce" : "wasHungry", "Z"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getWidthField", "()F", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "G" : "width", "F"); - mv.visitInsn(Opcodes.FRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setWidthField", "(F)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.FLOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "G" : "width", "F"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getWorldObjField", isObfuscated ? "()Laid;" : "()Lnet/minecraft/world/World;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "l" : "worldObj", isObfuscated ? "Laid;" : "Lnet/minecraft/world/World;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setWorldObjField", isObfuscated ? "(Laid;)V" : "(Lnet/minecraft/world/World;)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "l" : "worldObj", isObfuscated ? "Laid;" : "Lnet/minecraft/world/World;"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getXpCooldownField", "()I", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bA" : "xpCooldown", "I"); - mv.visitInsn(Opcodes.IRETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "setXpCooldownField", "(I)V", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ILOAD, 1); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", isObfuscated ? "bA" : "xpCooldown", "I"); - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getServerPlayerBase", "(Ljava/lang/String;)Lapi/player/server/ServerPlayerBase;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "getServerPlayerBase", "(Lapi/player/server/IServerPlayerAPI;Ljava/lang/String;)Lapi/player/server/ServerPlayerBase;", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getServerPlayerBaseIds", "()Ljava/util/Set;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "getServerPlayerBaseIds", "(Lapi/player/server/IServerPlayerAPI;)Ljava/util/Set;", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "dynamic", "(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "dynamic", "(Lapi/player/server/IServerPlayerAPI;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;", false); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getServerPlayerAPI", "()Lapi/player/server/ServerPlayerAPI;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn(Opcodes.GETFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", "serverPlayerAPI", "Lapi/player/server/ServerPlayerAPI;"); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - mv = cv.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "getEntityPlayerMP", isObfuscated ? "()Llu;" : "()Lnet/minecraft/entity/player/EntityPlayerMP;", null, null); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitInsn(Opcodes.ARETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - - cv.visitField(Opcodes.ACC_PRIVATE | Opcodes.ACC_FINAL, "serverPlayerAPI", "Lapi/player/server/ServerPlayerAPI;", null, null); - } -} diff --git a/dependencies/main/java/api/player/server/ServerPlayerConstructorVisitor.java b/dependencies/main/java/api/player/server/ServerPlayerConstructorVisitor.java deleted file mode 100644 index 1353966c5b..0000000000 --- a/dependencies/main/java/api/player/server/ServerPlayerConstructorVisitor.java +++ /dev/null @@ -1,66 +0,0 @@ -// ================================================================== -// This file is part of Player API. -// -// Player API is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// Player API is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and the GNU General Public License along with Player API. -// If not, see . -// ================================================================== - -package api.player.server; - -import org.objectweb.asm.*; - -public final class ServerPlayerConstructorVisitor extends MethodVisitor -{ - private final boolean isObfuscated; - - public ServerPlayerConstructorVisitor(MethodVisitor paramMethodVisitor, boolean isObfuscated) - { - super(262144, paramMethodVisitor); - this.isObfuscated = isObfuscated; - } - - @Override - public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) - { - super.visitMethodInsn(opcode, owner, name, desc, itf); - if(name.equals("") && owner.equals(isObfuscated ? "zs" : "net/minecraft/entity/player/EntityPlayer")) - { - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "create", "(Lapi/player/server/IServerPlayerAPI;)Lapi/player/server/ServerPlayerAPI;", false); - mv.visitFieldInsn(Opcodes.PUTFIELD, isObfuscated ? "lu" : "net/minecraft/entity/player/EntityPlayerMP", "serverPlayerAPI", "Lapi/player/server/ServerPlayerAPI;"); - - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitVarInsn(Opcodes.ALOAD, 3); - mv.visitVarInsn(Opcodes.ALOAD, 4); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "beforeLocalConstructing", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/world/WorldServer;Lcom/mojang/authlib/GameProfile;Lnet/minecraft/server/management/PlayerInteractionManager;)V", false); - } - } - - public void visitInsn(int opcode) - { - if(opcode == Opcodes.RETURN) - { - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitVarInsn(Opcodes.ALOAD, 2); - mv.visitVarInsn(Opcodes.ALOAD, 3); - mv.visitVarInsn(Opcodes.ALOAD, 4); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "api/player/server/ServerPlayerAPI", "afterLocalConstructing", "(Lapi/player/server/IServerPlayerAPI;Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/world/WorldServer;Lcom/mojang/authlib/GameProfile;Lnet/minecraft/server/management/PlayerInteractionManager;)V", false); - } - super.visitInsn(opcode); - } -} diff --git a/dependencies/main/java/appeng/api/AEApi.java b/dependencies/main/java/appeng/api/AEApi.java deleted file mode 100644 index baa06a573a..0000000000 --- a/dependencies/main/java/appeng/api/AEApi.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api; - - -import java.lang.reflect.Field; - -import appeng.api.exceptions.CoreInaccessibleException; - - -/** - * Entry point for api. - * - * Available IMCs: - */ -public enum AEApi -{ - ; - - private static final String CORE_API_FQN = "appeng.core.Api"; - private static final String CORE_API_FIELD = "INSTANCE"; - private static final IAppEngApi HELD_API; - - static - { - try - { - final Class apiClass = Class.forName( CORE_API_FQN ); - final Field apiField = apiClass.getField( CORE_API_FIELD ); - - HELD_API = (IAppEngApi) apiField.get( apiClass ); - } - catch( final ClassNotFoundException e ) - { - throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FQN + " class, without it being declared." ); - } - catch( final NoSuchFieldException e ) - { - throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FIELD + " field in " + CORE_API_FQN + " without it being declared." ); - } - catch( final IllegalAccessException e ) - { - throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FIELD + " field in " + CORE_API_FQN + " without enough access permissions." ); - } - } - - /** - * API Entry Point. - * - * @return the {@link IAppEngApi} - */ - public static IAppEngApi instance() - { - return HELD_API; - } - -} diff --git a/dependencies/main/java/appeng/api/AEInjectable.java b/dependencies/main/java/appeng/api/AEInjectable.java deleted file mode 100644 index 0ddb29c2d6..0000000000 --- a/dependencies/main/java/appeng/api/AEInjectable.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api; - - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - -/** - * Marks interfaces that can be used as injectable constructor arguments for an {@link AEPlugin}. - */ -@Target( ElementType.TYPE ) -@Retention( RetentionPolicy.RUNTIME ) -public @interface AEInjectable -{} diff --git a/dependencies/main/java/appeng/api/AEPlugin.java b/dependencies/main/java/appeng/api/AEPlugin.java deleted file mode 100644 index f9623585d3..0000000000 --- a/dependencies/main/java/appeng/api/AEPlugin.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api; - - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - -/** - * Use this annotation on a class in your Mod to have it instantiated during the initialization phase of Applied - * Energistics. - * AE expects your class to have a single constructor and can supply certain arguments to your constructor using - * dependency injection. - */ -@Target( ElementType.TYPE ) -@Retention( RetentionPolicy.RUNTIME ) -@Documented -public @interface AEPlugin -{} diff --git a/dependencies/main/java/appeng/api/IAppEngApi.java b/dependencies/main/java/appeng/api/IAppEngApi.java deleted file mode 100644 index 7ef6a667c7..0000000000 --- a/dependencies/main/java/appeng/api/IAppEngApi.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api; - - -import appeng.api.definitions.IDefinitions; -import appeng.api.exceptions.FailedConnection; -import appeng.api.features.IRegistryContainer; -import appeng.api.networking.IGridBlock; -import appeng.api.networking.IGridConnection; -import appeng.api.networking.IGridNode; -import appeng.api.parts.IPartHelper; -import appeng.api.storage.IStorageHelper; - -@AEInjectable -public interface IAppEngApi -{ - /** - * @return Registry Container for the numerous registries in AE2. - */ - IRegistryContainer registries(); - - /** - * @return helper for working with storage data types. - */ - IStorageHelper storage(); - - /** - * @return helper for working with grids, and buses. - */ - IPartHelper partHelper(); - - /** - * @return an accessible list of all AE definitions - */ - IDefinitions definitions(); - - /** - * create a grid node for your {@link appeng.api.networking.IGridHost} - * - * @param block grid block - * - * @return grid node of block - */ - IGridNode createGridNode( IGridBlock block ); - - /** - * create a connection between two {@link appeng.api.networking.IGridNode} - * - * @param a to be connected gridnode - * @param b to be connected gridnode - * - * @throws appeng.api.exceptions.FailedConnection - */ - IGridConnection createGridConnection( IGridNode a, IGridNode b ) throws FailedConnection; -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/client/BakingPipeline.java b/dependencies/main/java/appeng/api/client/BakingPipeline.java deleted file mode 100644 index 37418c08e8..0000000000 --- a/dependencies/main/java/appeng/api/client/BakingPipeline.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.client; - - -import java.util.List; - -import com.google.common.collect.ImmutableList; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.util.EnumFacing; - -/** - * TODO: Needs to be moved to an internal class. API is only allowed to contain interfaces and/or data. - * - * @deprecated - */ -@Deprecated -public class BakingPipeline implements BakingPipelineElement -{ - - private final ImmutableList> pipeline; - - public BakingPipeline( BakingPipelineElement... pipeline ) - { - this.pipeline = ImmutableList.copyOf( pipeline ); - } - - /** - * TODO: fix generics - */ - @Override - public List pipe( List things, IBakedModel parent, IBlockState state, EnumFacing side, long rand ) - { - for( BakingPipelineElement pipe : pipeline ) - { - things = pipe.pipe( things, parent, state, side, rand ); - } - return things; - } - -} diff --git a/dependencies/main/java/appeng/api/client/BakingPipelineElement.java b/dependencies/main/java/appeng/api/client/BakingPipelineElement.java deleted file mode 100644 index b3ef084e4b..0000000000 --- a/dependencies/main/java/appeng/api/client/BakingPipelineElement.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.client; - - -import java.util.List; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.util.EnumFacing; - - -public interface BakingPipelineElement -{ - - public List pipe( List elements, IBakedModel parent, IBlockState state, EnumFacing side, long rand ); - -} diff --git a/dependencies/main/java/appeng/api/config/AccessRestriction.java b/dependencies/main/java/appeng/api/config/AccessRestriction.java deleted file mode 100644 index 6788d744e9..0000000000 --- a/dependencies/main/java/appeng/api/config/AccessRestriction.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum AccessRestriction -{ - NO_ACCESS( 0 ), READ( 1 ), WRITE( 2 ), READ_WRITE( 3 ); - - private final int permissionBit; - - AccessRestriction( final int v ) - { - this.permissionBit = v; - } - - public boolean hasPermission( final AccessRestriction ar ) - { - return ( this.permissionBit & ar.permissionBit ) == ar.permissionBit; - } - - public AccessRestriction restrictPermissions( final AccessRestriction ar ) - { - return this.getPermByBit( this.permissionBit & ar.permissionBit ); - } - - private AccessRestriction getPermByBit( final int bit ) - { - switch( bit ) - { - default: - case 0: - return NO_ACCESS; - case 1: - return READ; - case 2: - return WRITE; - case 3: - return READ_WRITE; - } - } - - public AccessRestriction addPermissions( final AccessRestriction ar ) - { - return this.getPermByBit( this.permissionBit | ar.permissionBit ); - } - - public AccessRestriction removePermissions( final AccessRestriction ar ) - { - return this.getPermByBit( this.permissionBit & ( ~ar.permissionBit ) ); - } -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/ActionItems.java b/dependencies/main/java/appeng/api/config/ActionItems.java deleted file mode 100644 index 9cb6fbf28d..0000000000 --- a/dependencies/main/java/appeng/api/config/ActionItems.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum ActionItems -{ - WRENCH, CLOSE, STASH, ENCODE, SUBSTITUTION -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/Actionable.java b/dependencies/main/java/appeng/api/config/Actionable.java deleted file mode 100644 index 8e5f1f5422..0000000000 --- a/dependencies/main/java/appeng/api/config/Actionable.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum Actionable -{ - /** - * Perform the intended action. - */ - MODULATE, - - /** - * Pretend to perform the action. - */ - SIMULATE -} diff --git a/dependencies/main/java/appeng/api/config/CondenserOutput.java b/dependencies/main/java/appeng/api/config/CondenserOutput.java deleted file mode 100644 index cb9efae00b..0000000000 --- a/dependencies/main/java/appeng/api/config/CondenserOutput.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum CondenserOutput -{ - - TRASH, // 0 - - MATTER_BALLS, // 256 - - SINGULARITY; // 250,000 - - public int requiredPower = 0; - -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/CopyMode.java b/dependencies/main/java/appeng/api/config/CopyMode.java deleted file mode 100644 index 7f2f39969c..0000000000 --- a/dependencies/main/java/appeng/api/config/CopyMode.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum CopyMode -{ - CLEAR_ON_REMOVE, KEEP_ON_REMOVE -} diff --git a/dependencies/main/java/appeng/api/config/FullnessMode.java b/dependencies/main/java/appeng/api/config/FullnessMode.java deleted file mode 100644 index c52d4228f3..0000000000 --- a/dependencies/main/java/appeng/api/config/FullnessMode.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum FullnessMode -{ - EMPTY, HALF, FULL -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/FuzzyMode.java b/dependencies/main/java/appeng/api/config/FuzzyMode.java deleted file mode 100644 index 84c36c78fa..0000000000 --- a/dependencies/main/java/appeng/api/config/FuzzyMode.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum FuzzyMode -{ - // Note that percentage damaged, is the inverse of percentage durability. - IGNORE_ALL( -1 ), - PERCENT_99( 0 ), - PERCENT_75( 25 ), - PERCENT_50( 50 ), - PERCENT_25( 75 ); - - public final float breakPoint; - public final float percentage; - - FuzzyMode( final float p ) - { - this.percentage = p; - this.breakPoint = p / 100.0f; - } - - public int calculateBreakPoint( final int maxDamage ) - { - return (int) ( ( this.percentage * maxDamage ) / 100.0f ); - } - -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/IncludeExclude.java b/dependencies/main/java/appeng/api/config/IncludeExclude.java deleted file mode 100644 index 53f0bbeb76..0000000000 --- a/dependencies/main/java/appeng/api/config/IncludeExclude.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum IncludeExclude -{ - WHITELIST, BLACKLIST -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/ItemSubstitution.java b/dependencies/main/java/appeng/api/config/ItemSubstitution.java deleted file mode 100644 index 330dba7dad..0000000000 --- a/dependencies/main/java/appeng/api/config/ItemSubstitution.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum ItemSubstitution -{ - ENABLED, DISABLED; -} diff --git a/dependencies/main/java/appeng/api/config/LevelEmitterMode.java b/dependencies/main/java/appeng/api/config/LevelEmitterMode.java deleted file mode 100644 index dcdd0ef88c..0000000000 --- a/dependencies/main/java/appeng/api/config/LevelEmitterMode.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum LevelEmitterMode -{ - - STORED_AMOUNT, - - STORABLE_AMOUNT - -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/LevelType.java b/dependencies/main/java/appeng/api/config/LevelType.java deleted file mode 100644 index 0787abb750..0000000000 --- a/dependencies/main/java/appeng/api/config/LevelType.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum LevelType -{ - - ITEM_LEVEL, - - ENERGY_LEVEL - -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/ModSettings.java b/dependencies/main/java/appeng/api/config/ModSettings.java deleted file mode 100644 index b122584460..0000000000 --- a/dependencies/main/java/appeng/api/config/ModSettings.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum ModSettings -{ - -} diff --git a/dependencies/main/java/appeng/api/config/NetworkEmitterMode.java b/dependencies/main/java/appeng/api/config/NetworkEmitterMode.java deleted file mode 100644 index 03efd7c982..0000000000 --- a/dependencies/main/java/appeng/api/config/NetworkEmitterMode.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum NetworkEmitterMode -{ - - POWER_LEVEL, - - BOOTING, - - CHANNEL_ERROR - -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/OperationMode.java b/dependencies/main/java/appeng/api/config/OperationMode.java deleted file mode 100644 index f2c8ff30e0..0000000000 --- a/dependencies/main/java/appeng/api/config/OperationMode.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum OperationMode -{ - FILL, EMPTY -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/OutputMode.java b/dependencies/main/java/appeng/api/config/OutputMode.java deleted file mode 100644 index f9bcffa579..0000000000 --- a/dependencies/main/java/appeng/api/config/OutputMode.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum OutputMode -{ - EXPORT_ONLY, EXPORT_OR_CRAFT, CRAFT_ONLY -} diff --git a/dependencies/main/java/appeng/api/config/PowerMultiplier.java b/dependencies/main/java/appeng/api/config/PowerMultiplier.java deleted file mode 100644 index dd50e79eb5..0000000000 --- a/dependencies/main/java/appeng/api/config/PowerMultiplier.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum PowerMultiplier -{ - ONE, CONFIG; - - /** - * please do not edit this value, it is set when AE loads its config files. - */ - public double multiplier = 1.0; - - public double multiply( final double in ) - { - return in * this.multiplier; - } - - public double divide( final double in ) - { - return in / this.multiplier; - } -} diff --git a/dependencies/main/java/appeng/api/config/PowerUnits.java b/dependencies/main/java/appeng/api/config/PowerUnits.java deleted file mode 100644 index 3111e7d9dc..0000000000 --- a/dependencies/main/java/appeng/api/config/PowerUnits.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum PowerUnits -{ - AE( "gui.appliedenergistics2.units.appliedenergstics" ), // Native Units - AE Energy - EU( "gui.appliedenergistics2.units.ic2" ), // IndustrialCraft 2 - Energy Units - RF( "gui.appliedenergistics2.units.rf" ); // RF - Redstone Flux - - /** - * unlocalized name for the power unit. - */ - public final String unlocalizedName; - /** - * please do not edit this value, it is set when AE loads its config files. - */ - public double conversionRatio = 1.0; - - PowerUnits( final String un ) - { - this.unlocalizedName = un; - } - - /** - * do power conversion using AE's conversion rates. - * - * Example: PowerUnits.EU.convertTo( PowerUnits.AE, 32 ); - * - * will normally returns 64, as it will convert the EU, to AE with AE's power settings. - * - * @param target target power unit - * @param value value - * - * @return value converted to target units, from this units. - */ - public double convertTo( final PowerUnits target, final double value ) - { - return ( value * this.conversionRatio ) / target.conversionRatio; - } - -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/RedstoneMode.java b/dependencies/main/java/appeng/api/config/RedstoneMode.java deleted file mode 100644 index 0bb5a54da7..0000000000 --- a/dependencies/main/java/appeng/api/config/RedstoneMode.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum RedstoneMode -{ - IGNORE, LOW_SIGNAL, HIGH_SIGNAL, SIGNAL_PULSE -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/RelativeDirection.java b/dependencies/main/java/appeng/api/config/RelativeDirection.java deleted file mode 100644 index a81d20473f..0000000000 --- a/dependencies/main/java/appeng/api/config/RelativeDirection.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum RelativeDirection -{ - LEFT, RIGHT, UP, DOW -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/SchedulingMode.java b/dependencies/main/java/appeng/api/config/SchedulingMode.java deleted file mode 100644 index 395bf1ece8..0000000000 --- a/dependencies/main/java/appeng/api/config/SchedulingMode.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum SchedulingMode -{ - DEFAULT, ROUNDROBIN, RANDOM -} diff --git a/dependencies/main/java/appeng/api/config/SearchBoxMode.java b/dependencies/main/java/appeng/api/config/SearchBoxMode.java deleted file mode 100644 index 5fececcc84..0000000000 --- a/dependencies/main/java/appeng/api/config/SearchBoxMode.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum SearchBoxMode -{ - AUTOSEARCH, MANUAL_SEARCH, JEI_AUTOSEARCH, JEI_MANUAL_SEARCH -} diff --git a/dependencies/main/java/appeng/api/config/SecurityPermissions.java b/dependencies/main/java/appeng/api/config/SecurityPermissions.java deleted file mode 100644 index c3e69062a2..0000000000 --- a/dependencies/main/java/appeng/api/config/SecurityPermissions.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -/** - * Represent the security systems basic permissions, these are not for anti-griefing, they are part of the mod as a - * gameplay feature. - */ -public enum SecurityPermissions -{ - /** - * required to insert items into the network via terminal ( also used for machines based on the owner of the - * network, which is determined by its Security Block. ) - */ - INJECT, - - /** - * required to extract items from the network via terminal ( also used for machines based on the owner of the - * network, which is determined by its Security Block. ) - */ - EXTRACT, - - /** - * required to request crafting from the network via terminal. - */ - CRAFT, - - /** - * required to modify automation, and make modifications to the networks physical layout. - */ - BUILD, - - /** - * required to modify the security blocks settings. - */ - SECURITY; - - private final String unlocalizedName = "gui.appliedenergistics2.security." + this.name().toLowerCase(); - - public String getUnlocalizedName() - { - return this.unlocalizedName + ".name"; - } - - public String getUnlocalizedTip() - { - return this.unlocalizedName + ".tip"; - } -} diff --git a/dependencies/main/java/appeng/api/config/Settings.java b/dependencies/main/java/appeng/api/config/Settings.java deleted file mode 100644 index e031439e62..0000000000 --- a/dependencies/main/java/appeng/api/config/Settings.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -import java.util.EnumSet; - -import javax.annotation.Nonnull; - - -public enum Settings -{ - LEVEL_EMITTER_MODE( EnumSet.allOf( LevelEmitterMode.class ) ), - - REDSTONE_EMITTER( EnumSet.of( RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL ) ), REDSTONE_CONTROLLED( EnumSet.allOf( RedstoneMode.class ) ), - - CONDENSER_OUTPUT( EnumSet.allOf( CondenserOutput.class ) ), - - POWER_UNITS( EnumSet.allOf( PowerUnits.class ) ), ACCESS( EnumSet.of( AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE ) ), - - SORT_DIRECTION( EnumSet.allOf( SortDir.class ) ), SORT_BY( EnumSet.allOf( SortOrder.class ) ), - - SEARCH_TOOLTIPS( EnumSet.of( YesNo.YES, YesNo.NO ) ), VIEW_MODE( EnumSet.allOf( ViewItems.class ) ), SEARCH_MODE( EnumSet.allOf( SearchBoxMode.class ) ), - - ACTIONS( EnumSet.allOf( ActionItems.class ) ), IO_DIRECTION( EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT ) ), - - BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ), OPERATION_MODE( EnumSet.allOf( OperationMode.class ) ), - - FULLNESS_MODE( EnumSet.allOf( FullnessMode.class ) ), CRAFT_ONLY( EnumSet.of( YesNo.YES, YesNo.NO ) ), - - FUZZY_MODE( EnumSet.allOf( FuzzyMode.class ) ), LEVEL_TYPE( EnumSet.allOf( LevelType.class ) ), - - TERMINAL_STYLE( EnumSet.of( TerminalStyle.TALL, TerminalStyle.SMALL ) ), COPY_MODE( EnumSet.allOf( CopyMode.class ) ), - - INTERFACE_TERMINAL( EnumSet.of( YesNo.YES, YesNo.NO ) ), CRAFT_VIA_REDSTONE( EnumSet.of( YesNo.YES, YesNo.NO ) ), - - STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ), - - SCHEDULING_MODE( EnumSet.allOf( SchedulingMode.class ) ); - - private final EnumSet> values; - - Settings( @Nonnull final EnumSet> possibleOptions ) - { - if( possibleOptions.isEmpty() ) - { - throw new IllegalArgumentException( "Tried to instantiate an empty setting." ); - } - - this.values = possibleOptions; - } - - public EnumSet> getPossibleValues() - { - return this.values; - } - -} diff --git a/dependencies/main/java/appeng/api/config/SortDir.java b/dependencies/main/java/appeng/api/config/SortDir.java deleted file mode 100644 index 654fda0dc2..0000000000 --- a/dependencies/main/java/appeng/api/config/SortDir.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum SortDir -{ - ASCENDING, DESCENDING -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/SortOrder.java b/dependencies/main/java/appeng/api/config/SortOrder.java deleted file mode 100644 index 51cde4e64b..0000000000 --- a/dependencies/main/java/appeng/api/config/SortOrder.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum SortOrder -{ - NAME, AMOUNT, MOD, INVTWEAKS -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/StorageFilter.java b/dependencies/main/java/appeng/api/config/StorageFilter.java deleted file mode 100644 index 64f63f704c..0000000000 --- a/dependencies/main/java/appeng/api/config/StorageFilter.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum StorageFilter -{ - - NONE, - - EXTRACTABLE_ONLY - -} diff --git a/dependencies/main/java/appeng/api/config/TerminalStyle.java b/dependencies/main/java/appeng/api/config/TerminalStyle.java deleted file mode 100644 index d8687e1a30..0000000000 --- a/dependencies/main/java/appeng/api/config/TerminalStyle.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum TerminalStyle -{ - - TALL, - - FULL, - - SMALL - -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/TunnelType.java b/dependencies/main/java/appeng/api/config/TunnelType.java deleted file mode 100644 index b42d285680..0000000000 --- a/dependencies/main/java/appeng/api/config/TunnelType.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum TunnelType -{ - ME, // Network Tunnel - IC2_POWER, // EU Tunnel - RF_POWER, // RF Tunnel - REDSTONE, // Redstone Tunnel - FLUID, // Fluid Tunnel - ITEM, // Item Tunnel - LIGHT, // Light Tunnel - BUNDLED_REDSTONE, // Bundled Redstone Tunnel - COMPUTER_MESSAGE // Computer Message Tunnel -} diff --git a/dependencies/main/java/appeng/api/config/Upgrades.java b/dependencies/main/java/appeng/api/config/Upgrades.java deleted file mode 100644 index 8a3303ec13..0000000000 --- a/dependencies/main/java/appeng/api/config/Upgrades.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.item.ItemStack; - -import appeng.api.definitions.IItemDefinition; - - -public enum Upgrades -{ - /** - * Gold Tier Upgrades. - */ - CAPACITY( 0 ), REDSTONE( 0 ), CRAFTING( 0 ), - - /** - * Diamond Tier Upgrades. - */ - FUZZY( 1 ), SPEED( 1 ), INVERTER( 1 ); - - private final int tier; - private final Map supportedMax = new HashMap<>(); - - Upgrades( final int tier ) - { - this.tier = tier; - } - - /** - * @return list of Items/Blocks that support this upgrade, and how many it supports. - */ - public Map getSupported() - { - return this.supportedMax; - } - - /** - * Registers a specific amount of this upgrade into a specific machine - * - * @param item machine in which this upgrade can be installed - * @param maxSupported amount how many upgrades can be installed - */ - public void registerItem( final IItemDefinition item, final int maxSupported ) - { - item.maybeStack( 1 ).ifPresent( is -> this.registerItem( is, maxSupported ) ); - } - - /** - * Registers a specific amount of this upgrade into a specific machine - * - * @param stack machine in which this upgrade can be installed - * @param maxSupported amount how many upgrades can be installed - */ - public void registerItem( final ItemStack stack, final int maxSupported ) - { - if( stack != null ) - { - this.supportedMax.put( stack, maxSupported ); - } - } - - public int getTier() - { - return this.tier; - } -} diff --git a/dependencies/main/java/appeng/api/config/ViewItems.java b/dependencies/main/java/appeng/api/config/ViewItems.java deleted file mode 100644 index a87e0aa219..0000000000 --- a/dependencies/main/java/appeng/api/config/ViewItems.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum ViewItems -{ - ALL, STORED, CRAFTABLE -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/config/YesNo.java b/dependencies/main/java/appeng/api/config/YesNo.java deleted file mode 100644 index c6bfcd6028..0000000000 --- a/dependencies/main/java/appeng/api/config/YesNo.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.config; - - -public enum YesNo -{ - YES, NO, UNDECIDED -} diff --git a/dependencies/main/java/appeng/api/definitions/IBlockDefinition.java b/dependencies/main/java/appeng/api/definitions/IBlockDefinition.java deleted file mode 100644 index 9545df4340..0000000000 --- a/dependencies/main/java/appeng/api/definitions/IBlockDefinition.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api.definitions; - - -import java.util.Optional; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; - - -public interface IBlockDefinition extends IItemDefinition -{ - /** - * @return the {@link Block} implementation if applicable - */ - Optional maybeBlock(); - - /** - * @return the {@link ItemBlock} implementation if applicable - */ - Optional maybeItemBlock(); - - /** - * Compare Block with world. - * - * @param world world of block - * @param pos location - * - * @return if the block is placed in the world at the specific location. - */ - boolean isSameAs( IBlockAccess world, BlockPos pos ); -} diff --git a/dependencies/main/java/appeng/api/definitions/IBlocks.java b/dependencies/main/java/appeng/api/definitions/IBlocks.java deleted file mode 100644 index 714d11d4bd..0000000000 --- a/dependencies/main/java/appeng/api/definitions/IBlocks.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.definitions; - - -/** - * A list of all blocks in AE - */ -public interface IBlocks -{ - /* - * world gen - */ - IBlockDefinition quartzOre(); - - IBlockDefinition quartzOreCharged(); - - IBlockDefinition matrixFrame(); - - /* - * decorative - */ - IBlockDefinition quartzBlock(); - - IBlockDefinition quartzPillar(); - - IBlockDefinition chiseledQuartzBlock(); - - IBlockDefinition quartzGlass(); - - IBlockDefinition quartzVibrantGlass(); - - IBlockDefinition quartzFixture(); - - IBlockDefinition fluixBlock(); - - IBlockDefinition skyStoneBlock(); - - IBlockDefinition smoothSkyStoneBlock(); - - IBlockDefinition skyStoneBrick(); - - IBlockDefinition skyStoneSmallBrick(); - - IBlockDefinition skyStoneChest(); - - IBlockDefinition smoothSkyStoneChest(); - - IBlockDefinition skyCompass(); - - IBlockDefinition skyStoneStairs(); - - IBlockDefinition smoothSkyStoneStairs(); - - IBlockDefinition skyStoneBrickStairs(); - - IBlockDefinition skyStoneSmallBrickStairs(); - - IBlockDefinition fluixStairs(); - - IBlockDefinition quartzStairs(); - - IBlockDefinition chiseledQuartzStairs(); - - IBlockDefinition quartzPillarStairs(); - - IBlockDefinition skyStoneSlab(); - - IBlockDefinition smoothSkyStoneSlab(); - - IBlockDefinition skyStoneBrickSlab(); - - IBlockDefinition skyStoneSmallBrickSlab(); - - IBlockDefinition fluixSlab(); - - IBlockDefinition quartzSlab(); - - IBlockDefinition chiseledQuartzSlab(); - - IBlockDefinition quartzPillarSlab(); - - /* - * misc - */ - ITileDefinition grindstone(); - - ITileDefinition crank(); - - ITileDefinition inscriber(); - - ITileDefinition wirelessAccessPoint(); - - ITileDefinition charger(); - - IBlockDefinition tinyTNT(); - - ITileDefinition securityStation(); - - /* - * quantum Network Bridge - */ - ITileDefinition quantumRing(); - - ITileDefinition quantumLink(); - - /* - * spatial iO - */ - ITileDefinition spatialPylon(); - - ITileDefinition spatialIOPort(); - - /* - * Bus / cables - */ - ITileDefinition multiPart(); - - /* - * machines - */ - ITileDefinition controller(); - - ITileDefinition drive(); - - ITileDefinition chest(); - - ITileDefinition iface(); - - ITileDefinition cellWorkbench(); - - ITileDefinition iOPort(); - - ITileDefinition condenser(); - - ITileDefinition energyAcceptor(); - - ITileDefinition vibrationChamber(); - - ITileDefinition quartzGrowthAccelerator(); - - ITileDefinition energyCell(); - - ITileDefinition energyCellDense(); - - ITileDefinition energyCellCreative(); - - // rv1 - ITileDefinition craftingUnit(); - - ITileDefinition craftingAccelerator(); - - ITileDefinition craftingStorage1k(); - - ITileDefinition craftingStorage4k(); - - ITileDefinition craftingStorage16k(); - - ITileDefinition craftingStorage64k(); - - ITileDefinition craftingMonitor(); - - ITileDefinition molecularAssembler(); - - ITileDefinition lightDetector(); - - ITileDefinition paint(); -} diff --git a/dependencies/main/java/appeng/api/definitions/IComparableDefinition.java b/dependencies/main/java/appeng/api/definitions/IComparableDefinition.java deleted file mode 100644 index ad8ff24689..0000000000 --- a/dependencies/main/java/appeng/api/definitions/IComparableDefinition.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api.definitions; - - -import net.minecraft.item.ItemStack; - - -/** - * Interface to compare a definition with an itemstack or a block - * - * @author thatsIch - * @version rv2 - * @since rv2 - */ -public interface IComparableDefinition -{ - /** - * Compare {@link ItemStack} with this - * - * @param comparableStack compared item - * - * @return true if the item stack is a matching item. - */ - boolean isSameAs( ItemStack comparableStack ); -} diff --git a/dependencies/main/java/appeng/api/definitions/IDefinitions.java b/dependencies/main/java/appeng/api/definitions/IDefinitions.java deleted file mode 100644 index 354f8899f0..0000000000 --- a/dependencies/main/java/appeng/api/definitions/IDefinitions.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.definitions; - - -/** - * All definitions in AE - */ -public interface IDefinitions -{ - /** - * @return an accessible list of all of AE's blocks - */ - IBlocks blocks(); - - /** - * @return an accessible list of all of AE's Items - */ - IItems items(); - - /** - * @return an accessible list of all of AE's materials; materials are items - */ - IMaterials materials(); - - /** - * @return an accessible list of all of AE's parts, parts are items - */ - IParts parts(); -} diff --git a/dependencies/main/java/appeng/api/definitions/IItemDefinition.java b/dependencies/main/java/appeng/api/definitions/IItemDefinition.java deleted file mode 100644 index a0c6e5ed72..0000000000 --- a/dependencies/main/java/appeng/api/definitions/IItemDefinition.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.definitions; - - -import java.util.Optional; - -import javax.annotation.Nonnull; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - - -public interface IItemDefinition extends IComparableDefinition -{ - /** - * @return the unique name of the definition which will be used to register the underlying structure. Will never be - * null - */ - @Nonnull - String identifier(); - - /** - * @return the {@link Item} Implementation if applicable - */ - Optional maybeItem(); - - /** - * @return an {@link ItemStack} with specified quantity of this item. - */ - Optional maybeStack( int stackSize ); - - /** - * @return true if definition is enabled - */ - boolean isEnabled(); -} diff --git a/dependencies/main/java/appeng/api/definitions/IItems.java b/dependencies/main/java/appeng/api/definitions/IItems.java deleted file mode 100644 index 5ea20f2ad5..0000000000 --- a/dependencies/main/java/appeng/api/definitions/IItems.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.definitions; - - -import appeng.api.util.AEColoredItemDefinition; - - -/** - * A list of all items in AE - */ -public interface IItems -{ - IItemDefinition certusQuartzAxe(); - - IItemDefinition certusQuartzHoe(); - - IItemDefinition certusQuartzShovel(); - - IItemDefinition certusQuartzPick(); - - IItemDefinition certusQuartzSword(); - - IItemDefinition certusQuartzWrench(); - - IItemDefinition certusQuartzKnife(); - - IItemDefinition netherQuartzAxe(); - - IItemDefinition netherQuartzHoe(); - - IItemDefinition netherQuartzShovel(); - - IItemDefinition netherQuartzPick(); - - IItemDefinition netherQuartzSword(); - - IItemDefinition netherQuartzWrench(); - - IItemDefinition netherQuartzKnife(); - - IItemDefinition entropyManipulator(); - - IItemDefinition wirelessTerminal(); - - IItemDefinition biometricCard(); - - IItemDefinition chargedStaff(); - - IItemDefinition massCannon(); - - IItemDefinition memoryCard(); - - IItemDefinition networkTool(); - - IItemDefinition portableCell(); - - IItemDefinition cellCreative(); - - IItemDefinition viewCell(); - - IItemDefinition cell1k(); - - IItemDefinition cell4k(); - - IItemDefinition cell16k(); - - IItemDefinition cell64k(); - - IItemDefinition spatialCell2(); - - IItemDefinition spatialCell16(); - - IItemDefinition spatialCell128(); - - IItemDefinition facade(); - - IItemDefinition crystalSeed(); - - // rv1 - IItemDefinition encodedPattern(); - - IItemDefinition colorApplicator(); - - AEColoredItemDefinition coloredPaintBall(); - - AEColoredItemDefinition coloredLumenPaintBall(); -} diff --git a/dependencies/main/java/appeng/api/definitions/IMaterials.java b/dependencies/main/java/appeng/api/definitions/IMaterials.java deleted file mode 100644 index 54868b1fab..0000000000 --- a/dependencies/main/java/appeng/api/definitions/IMaterials.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.definitions; - - -/** - * A list of all materials in AE - */ -public interface IMaterials -{ - IItemDefinition cell2SpatialPart(); - - IItemDefinition cell16SpatialPart(); - - IItemDefinition cell128SpatialPart(); - - IItemDefinition silicon(); - - IItemDefinition skyDust(); - - IItemDefinition calcProcessorPress(); - - IItemDefinition engProcessorPress(); - - IItemDefinition logicProcessorPress(); - - IItemDefinition calcProcessorPrint(); - - IItemDefinition engProcessorPrint(); - - IItemDefinition logicProcessorPrint(); - - IItemDefinition siliconPress(); - - IItemDefinition siliconPrint(); - - IItemDefinition namePress(); - - IItemDefinition logicProcessor(); - - IItemDefinition calcProcessor(); - - IItemDefinition engProcessor(); - - IItemDefinition basicCard(); - - IItemDefinition advCard(); - - IItemDefinition purifiedCertusQuartzCrystal(); - - IItemDefinition purifiedNetherQuartzCrystal(); - - IItemDefinition purifiedFluixCrystal(); - - IItemDefinition cell1kPart(); - - IItemDefinition cell4kPart(); - - IItemDefinition cell16kPart(); - - IItemDefinition cell64kPart(); - - IItemDefinition emptyStorageCell(); - - IItemDefinition cardRedstone(); - - IItemDefinition cardSpeed(); - - IItemDefinition cardCapacity(); - - IItemDefinition cardFuzzy(); - - IItemDefinition cardInverter(); - - IItemDefinition cardCrafting(); - - IItemDefinition enderDust(); - - IItemDefinition flour(); - - IItemDefinition goldDust(); - - IItemDefinition ironDust(); - - IItemDefinition fluixDust(); - - IItemDefinition certusQuartzDust(); - - IItemDefinition netherQuartzDust(); - - IItemDefinition matterBall(); - - IItemDefinition ironNugget(); - - IItemDefinition certusQuartzCrystal(); - - IItemDefinition certusQuartzCrystalCharged(); - - IItemDefinition fluixCrystal(); - - IItemDefinition fluixPearl(); - - IItemDefinition woodenGear(); - - IItemDefinition wirelessReceiver(); - - IItemDefinition wirelessBooster(); - - IItemDefinition annihilationCore(); - - IItemDefinition formationCore(); - - IItemDefinition singularity(); - - IItemDefinition qESingularity(); - - IItemDefinition blankPattern(); -} diff --git a/dependencies/main/java/appeng/api/definitions/IParts.java b/dependencies/main/java/appeng/api/definitions/IParts.java deleted file mode 100644 index 315eb72c5d..0000000000 --- a/dependencies/main/java/appeng/api/definitions/IParts.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.definitions; - - -import appeng.api.util.AEColoredItemDefinition; - - -/** - * A list of all parts in AE - */ -public interface IParts -{ - AEColoredItemDefinition cableSmart(); - - AEColoredItemDefinition cableCovered(); - - AEColoredItemDefinition cableGlass(); - - AEColoredItemDefinition cableDense(); - - AEColoredItemDefinition lumenCableSmart(); - - AEColoredItemDefinition lumenCableCovered(); - - AEColoredItemDefinition lumenCableGlass(); - - AEColoredItemDefinition lumenCableDense(); - - IItemDefinition quartzFiber(); - - IItemDefinition toggleBus(); - - IItemDefinition invertedToggleBus(); - - IItemDefinition storageBus(); - - IItemDefinition importBus(); - - IItemDefinition exportBus(); - - IItemDefinition iface(); - - IItemDefinition levelEmitter(); - - IItemDefinition annihilationPlane(); - - IItemDefinition identityAnnihilationPlane(); - - IItemDefinition formationPlane(); - - IItemDefinition p2PTunnelME(); - - IItemDefinition p2PTunnelRedstone(); - - IItemDefinition p2PTunnelItems(); - - IItemDefinition p2PTunnelFluids(); - - IItemDefinition p2PTunnelEU(); - - // IItemDefinition p2PTunnelRF(); - - IItemDefinition p2PTunnelLight(); - - // IItemDefinition p2PTunnelOpenComputers(); - - IItemDefinition cableAnchor(); - - IItemDefinition monitor(); - - IItemDefinition semiDarkMonitor(); - - IItemDefinition darkMonitor(); - - IItemDefinition interfaceTerminal(); - - IItemDefinition patternTerminal(); - - IItemDefinition craftingTerminal(); - - IItemDefinition terminal(); - - IItemDefinition storageMonitor(); - - IItemDefinition conversionMonitor(); -} diff --git a/dependencies/main/java/appeng/api/definitions/ITileDefinition.java b/dependencies/main/java/appeng/api/definitions/ITileDefinition.java deleted file mode 100644 index b6115520a5..0000000000 --- a/dependencies/main/java/appeng/api/definitions/ITileDefinition.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api.definitions; - - -import java.util.Optional; - -import net.minecraft.tileentity.TileEntity; - - -public interface ITileDefinition extends IBlockDefinition -{ - /** - * @return the {@link TileEntity} Class if applicable. - */ - Optional> maybeEntity(); -} diff --git a/dependencies/main/java/appeng/api/events/LocatableEventAnnounce.java b/dependencies/main/java/appeng/api/events/LocatableEventAnnounce.java deleted file mode 100644 index 94caf847ae..0000000000 --- a/dependencies/main/java/appeng/api/events/LocatableEventAnnounce.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.events; - - -import net.minecraftforge.fml.common.eventhandler.Event; - -import appeng.api.features.ILocatable; - - -/** - * Input Event: - * - * Used to Notify the Location Registry of objects, and their availability. - */ -public class LocatableEventAnnounce extends Event -{ - - public final ILocatable target; - public final LocatableEvent change; - - public LocatableEventAnnounce( final ILocatable o, final LocatableEvent ev ) - { - this.target = o; - this.change = ev; - } - - public enum LocatableEvent - { - /** - * Adds the locatable to the registry - */ - REGISTER, - - /** - * Removes the locatable from the registry - */ - UNREGISTER - } -} diff --git a/dependencies/main/java/appeng/api/exceptions/AppEngException.java b/dependencies/main/java/appeng/api/exceptions/AppEngException.java deleted file mode 100644 index 478cfd77e4..0000000000 --- a/dependencies/main/java/appeng/api/exceptions/AppEngException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.exceptions; - - -public class AppEngException extends Exception -{ - - private static final long serialVersionUID = -9051434206368465494L; - - public AppEngException( final String t ) - { - super( t ); - } -} diff --git a/dependencies/main/java/appeng/api/exceptions/CoreInaccessibleException.java b/dependencies/main/java/appeng/api/exceptions/CoreInaccessibleException.java deleted file mode 100644 index b8750f9159..0000000000 --- a/dependencies/main/java/appeng/api/exceptions/CoreInaccessibleException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api.exceptions; - - -public class CoreInaccessibleException extends RuntimeException -{ - public CoreInaccessibleException( final String message ) - { - super( message ); - } -} diff --git a/dependencies/main/java/appeng/api/exceptions/ExistingConnectionException.java b/dependencies/main/java/appeng/api/exceptions/ExistingConnectionException.java deleted file mode 100644 index 7c5fe25b65..0000000000 --- a/dependencies/main/java/appeng/api/exceptions/ExistingConnectionException.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.exceptions; - - -import appeng.api.networking.IGridNode; - - -/** - * Exception occurred because of an already existing connection between the two {@link IGridNode}s - * - * Intended to signal an internal exception and not intended to be thrown by - * any 3rd party module. - * - * @author yueh - * @version rv3 - * @since rv3 - */ -public class ExistingConnectionException extends FailedConnection -{ - - private static final long serialVersionUID = 2975450379720353182L; - private static final String DEFAULT_MESSAGE = "Connection between both nodes already exists."; - - public ExistingConnectionException() - { - super( DEFAULT_MESSAGE ); - } - - public ExistingConnectionException( String message ) - { - super( message ); - } - -} diff --git a/dependencies/main/java/appeng/api/exceptions/FailedConnection.java b/dependencies/main/java/appeng/api/exceptions/FailedConnection.java deleted file mode 100644 index de1bbc7137..0000000000 --- a/dependencies/main/java/appeng/api/exceptions/FailedConnection.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.exceptions; - - -import appeng.api.networking.IGridNode; - - -/** - * Exception indicating a failed connection between two {@link IGridNode}s. - * - * Intended to signal an internal exception and not intended to be thrown by - * any 3rd party module. - * - * See any subclass for a more specific reason. - * - * @author AlgorithmX2 - * @author yueh - * @version rv3 - * @since rv0 - */ -public class FailedConnection extends Exception -{ - - private static final long serialVersionUID = -2544208090248293753L; - - public FailedConnection() - { - } - - public FailedConnection( String message ) - { - super( message ); - } -} diff --git a/dependencies/main/java/appeng/api/exceptions/MissingDefinition.java b/dependencies/main/java/appeng/api/exceptions/MissingDefinition.java deleted file mode 100644 index 0280c208a3..0000000000 --- a/dependencies/main/java/appeng/api/exceptions/MissingDefinition.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api.exceptions; - - -public class MissingDefinition extends RuntimeException -{ - public MissingDefinition( final String message ) - { - super( message ); - } -} diff --git a/dependencies/main/java/appeng/api/exceptions/MissingIngredientError.java b/dependencies/main/java/appeng/api/exceptions/MissingIngredientError.java deleted file mode 100644 index 81fe40d371..0000000000 --- a/dependencies/main/java/appeng/api/exceptions/MissingIngredientError.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.exceptions; - - -public class MissingIngredientError extends Exception -{ - - private static final long serialVersionUID = -998858343831371697L; - - public MissingIngredientError( final String n ) - { - super( n ); - } -} diff --git a/dependencies/main/java/appeng/api/exceptions/ModNotInstalled.java b/dependencies/main/java/appeng/api/exceptions/ModNotInstalled.java deleted file mode 100644 index a3c5eb0566..0000000000 --- a/dependencies/main/java/appeng/api/exceptions/ModNotInstalled.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.exceptions; - - -public class ModNotInstalled extends Exception -{ - - private static final long serialVersionUID = -9052435206368425494L; - - public ModNotInstalled( final String t ) - { - super( t ); - } -} diff --git a/dependencies/main/java/appeng/api/exceptions/NullNodeConnectionException.java b/dependencies/main/java/appeng/api/exceptions/NullNodeConnectionException.java deleted file mode 100644 index 8410fc7fcf..0000000000 --- a/dependencies/main/java/appeng/api/exceptions/NullNodeConnectionException.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.exceptions; - - -/** - * Exception due to trying to connect one or more null values. - * - * Intended to signal an internal exception and not intended to be thrown by - * any 3rd party module. - * - * @author yueh - * @version rv3 - * @since rv3 - */ -public class NullNodeConnectionException extends FailedConnection -{ - - private static final long serialVersionUID = -2143719383495321764L; - private static final String DEFAULT_MESSAGE = "Connection forged between null entities."; - - public NullNodeConnectionException() - { - super( DEFAULT_MESSAGE ); - } - - public NullNodeConnectionException( String message ) - { - super( message ); - } - -} diff --git a/dependencies/main/java/appeng/api/exceptions/RecipeError.java b/dependencies/main/java/appeng/api/exceptions/RecipeError.java deleted file mode 100644 index d4d6f90a4c..0000000000 --- a/dependencies/main/java/appeng/api/exceptions/RecipeError.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.exceptions; - - -public class RecipeError extends Exception -{ - - private static final long serialVersionUID = -6602870588617670262L; - - public RecipeError( final String n ) - { - super( n ); - } -} diff --git a/dependencies/main/java/appeng/api/exceptions/RegistrationError.java b/dependencies/main/java/appeng/api/exceptions/RegistrationError.java deleted file mode 100644 index 205df3e9ac..0000000000 --- a/dependencies/main/java/appeng/api/exceptions/RegistrationError.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.exceptions; - - -public class RegistrationError extends Exception -{ - - private static final long serialVersionUID = -6602870588617670263L; - - public RegistrationError( final String n ) - { - super( n ); - } -} diff --git a/dependencies/main/java/appeng/api/exceptions/SecurityConnectionException.java b/dependencies/main/java/appeng/api/exceptions/SecurityConnectionException.java deleted file mode 100644 index d21044e83c..0000000000 --- a/dependencies/main/java/appeng/api/exceptions/SecurityConnectionException.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.exceptions; - - -/** - * Exception due to trying to connect different security realms. - * - * Intended to signal an internal exception and not intended to be thrown by - * any 3rd party module. - * - * @author yueh - * @version rv3 - * @since rv3 - */ -public class SecurityConnectionException extends FailedConnection -{ - private static final long serialVersionUID = 5048714900434215426L; - private static final String DEFAULT_MESSAGE = "Connection failed due to different security realms."; - - public SecurityConnectionException() - { - super( DEFAULT_MESSAGE ); - } - - public SecurityConnectionException( String message ) - { - super( message ); - } - -} diff --git a/dependencies/main/java/appeng/api/features/IGrinderRecipe.java b/dependencies/main/java/appeng/api/features/IGrinderRecipe.java deleted file mode 100644 index 2a2cd44237..0000000000 --- a/dependencies/main/java/appeng/api/features/IGrinderRecipe.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import java.util.Optional; - -import javax.annotation.Nonnull; - -import net.minecraft.item.ItemStack; - - -/** - * Registration Records for {@link IGrinderRegistry} - */ -public interface IGrinderRecipe -{ - - /** - * the current input - * - * @return input that the grinder will accept. - */ - @Nonnull - ItemStack getInput(); - - /** - * gets the current output - * - * @return output that the grinder will produce - */ - @Nonnull - ItemStack getOutput(); - - /** - * gets the current output - * - * @return output that the grinder will produce - */ - @Nonnull - Optional getOptionalOutput(); - - /** - * gets the current output - * - * @return output that the grinder will produce - */ - Optional getSecondOptionalOutput(); - - /** - * 0.0 - 1.0 the chance that the optional output will be generated. - * - * @return chance of optional output - */ - @Nonnull - float getOptionalChance(); - - /** - * 0.0 - 1.0 the chance that the optional output will be generated. - * - * @return second optional output chance - */ - float getSecondOptionalChance(); - - /** - * Amount of turns required to process the item. - * - * @return number of turns it takes to produce the output from the input. - */ - int getRequiredTurns(); - -} diff --git a/dependencies/main/java/appeng/api/features/IGrinderRegistry.java b/dependencies/main/java/appeng/api/features/IGrinderRegistry.java deleted file mode 100644 index 2a5e8d15e2..0000000000 --- a/dependencies/main/java/appeng/api/features/IGrinderRegistry.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import java.util.Collection; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import net.minecraft.item.ItemStack; - - -/** - * Lets you manipulate Grinder Recipes, by adding or editing existing ones. - */ -public interface IGrinderRegistry -{ - - /** - * An immutable list of the currently registered recipes. - * - * @return currentlyRegisteredRecipes - */ - @Nonnull - Collection getRecipes(); - - /** - * Add a new recipe with a single input and output and how many turns it requires. - * - * Will ignore duplicate recipes with the same input item. - * - * @param in The {@link ItemStack} to grind. - * @param out The {@link ItemStack} to output. - * @param turns Amount of turns to turn the input into the output, with turns > 0. - */ - void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, int turns ); - - /** - * Add a new recipe with an input, output and a single optional output. - * - * Will ignore duplicate recipes with the same input item. - * - * @param in The {@link ItemStack} to grind. - * @param out The {@link ItemStack} to output. - * @param optional The optional {@link ItemStack} to output of a certain chance. - * @param chance Chance to get the optional output within 0.0 - 1.0 - * @param turns Amount of turns to turn the input into the output, with turns > 0. - */ - void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, int turns ); - - /** - * add a new recipe with optional outputs, duplicates will not be added. - * - * Will ignore duplicate recipes with the same input item. - * - * @param in The {@link ItemStack} to grind. - * @param out The {@link ItemStack} to output. - * @param optional The first optional {@link ItemStack} to output of a certain chance. - * @param chance Chance to get the first optional output within 0.0 - 1.0 - * @param optional2 The second optional {@link ItemStack} to output of a certain chance. - * @param chance2 chance to get the second optional output within 0.0 - 1.0 - * @param turns Amount of turns to turn the input into the output, with turns > 0. - * - */ - void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, @Nonnull ItemStack optional2, float chance2, int turns ); - - /** - * Remove the specific from the recipe list. - * - * @param recipe The recipe to be removed. - * @return true, if it was removed - */ - boolean removeRecipe( @Nonnull IGrinderRecipe recipe ); - - /** - * Searches for a recipe for a given input, and returns it. - * - * @param input The {@link ItemStack} to be grinded. - * - * @return identified recipe or null - */ - @Nullable - IGrinderRecipe getRecipeForInput( @Nonnull ItemStack input ); - - /** - * Allows do add a custom ratio from an ore to dust when being grinded. - * - * The default ratio is 1 ore to 2 dusts. - * - * These have to be added before any recipe is registered. Otherwise it will use the default value. - * - * @param oredictName The name of the ore; - * @param ratio The amount, must be > 0; - */ - void addDustRatio( @Nonnull String oredictName, int ratio ); - - /** - * Remove a custom ratio for a specific ore name. - * - * Will use the default of 2 value afterwards. - * - * @param oredictName The name of the ore; - */ - boolean removeDustRatio( @Nonnull String oredictName ); - -} diff --git a/dependencies/main/java/appeng/api/features/IInscriberRecipe.java b/dependencies/main/java/appeng/api/features/IInscriberRecipe.java deleted file mode 100644 index 810c6138f7..0000000000 --- a/dependencies/main/java/appeng/api/features/IInscriberRecipe.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api.features; - - -import java.util.List; -import java.util.Optional; - -import javax.annotation.Nonnull; - -import net.minecraft.item.ItemStack; - - -/** - * Registration Records for {@link IInscriberRegistry} - * - * You have to pay attention though, that recipes are not mirrored, - * where the top and bottom slots are switching places. - * - * This is applied on runtime. - * - * @author thatsIch - * @version rv2 - * @since rv2 - */ -public interface IInscriberRecipe -{ - /** - * the current inputs - * - * @return inputs the inscriber will accept - */ - @Nonnull - List getInputs(); - - /** - * gets the current output - * - * @return output that the recipe will produce - */ - @Nonnull - ItemStack getOutput(); - - /** - * gets the top optional - * - * @return item which is used top - */ - @Nonnull - Optional getTopOptional(); - - /** - * gets the bottom optional - * - * @return item which is used bottom - */ - @Nonnull - Optional getBottomOptional(); - - /** - * type of inscriber process - * - * @return type of process the inscriber is doing - */ - @Nonnull - InscriberProcessType getProcessType(); -} diff --git a/dependencies/main/java/appeng/api/features/IInscriberRecipeBuilder.java b/dependencies/main/java/appeng/api/features/IInscriberRecipeBuilder.java deleted file mode 100644 index a8ad18c38a..0000000000 --- a/dependencies/main/java/appeng/api/features/IInscriberRecipeBuilder.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api.features; - - -import java.util.Collection; - -import javax.annotation.Nonnull; - -import net.minecraft.item.ItemStack; - - -/** - * Builder for an inscriber recipe - * - * @author thatsIch - * @version rv2 - * @since rv2 - */ -public interface IInscriberRecipeBuilder -{ - /** - * Creates an inscriber recipe with inputs. - * Needs to be invoked. - * - * @param inputs new inputs for the recipe - * - * @return currently used builder - */ - @Nonnull - IInscriberRecipeBuilder withInputs( @Nonnull Collection inputs ); - - /** - * Creates an inscriber recipe with output. - * Needs to be invoked. - * - * @param output new output for the recipe - * - * @return currently used builder - */ - @Nonnull - IInscriberRecipeBuilder withOutput( @Nonnull ItemStack output ); - - /** - * Creates an inscriber recipe with top. - * Either this or bot needs to be invoked. - * - * @param topOptional new top for the recipe - * - * @return currently used builder - */ - @Nonnull - IInscriberRecipeBuilder withTopOptional( @Nonnull ItemStack topOptional ); - - /** - * Creates an inscriber recipe with bot. - * Either this or top needs to be invoked. - * - * @param bottomOptional new bot for the recipe - * - * @return currently used builder - */ - @Nonnull - IInscriberRecipeBuilder withBottomOptional( @Nonnull ItemStack bottomOptional ); - - /** - * Creates an inscriber recipe with type. - * Needs to be invoked. - * - * @param type new type for the recipe - * - * @return currently used builder - */ - @Nonnull - IInscriberRecipeBuilder withProcessType( @Nonnull InscriberProcessType type ); - - /** - * Finalizes the process of making the recipe. - * Needs to be invoked to fetch inscriber recipe. - * - * @return legal inscriber recipe - * - * @throws IllegalStateException when input is not defined - * @throws IllegalStateException when input has no size - * @throws IllegalStateException when output is not defined - * @throws IllegalStateException when both optionals are not defined - * @throws IllegalStateException when process type is not defined - */ - @Nonnull - IInscriberRecipe build(); -} diff --git a/dependencies/main/java/appeng/api/features/IInscriberRegistry.java b/dependencies/main/java/appeng/api/features/IInscriberRegistry.java deleted file mode 100644 index 11fdf0b00b..0000000000 --- a/dependencies/main/java/appeng/api/features/IInscriberRegistry.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api.features; - - -import java.util.Collection; -import java.util.Set; - -import javax.annotation.Nonnull; - -import net.minecraft.item.ItemStack; - - -/** - * Lets you manipulate Inscriber Recipes, by adding or editing existing ones. - * - * @author thatsIch - * @version rv3 - * @since rv2 - */ -public interface IInscriberRegistry -{ - /** - * An immutable copy of currently registered recipes. - * - * Use the provided methods to actually modify the inscriber recipes. - * - * @see IInscriberRegistry#addRecipe(IInscriberRecipe) - * @see IInscriberRegistry#removeRecipe(IInscriberRecipe) - * - * @return currentlyRegisteredRecipes - */ - @Nonnull - Collection getRecipes(); - - /** - * Optional items which are used in the top or bottom slot. - * - * @return set of all optional items - */ - @Nonnull - Set getOptionals(); - - /** - * Get all registered items which are valid inputs. - * - * @return set of all input items - */ - @Nonnull - Set getInputs(); - - /** - * Extensible way to create an inscriber recipe. - * - * @return builder for inscriber recipes - */ - @Nonnull - IInscriberRecipeBuilder builder(); - - /** - * add a new recipe the easy way, duplicates will not be added. - * Added recipes will be automatically added to the optionals and inputs. - * - * @param recipe new recipe - * - * @throws IllegalArgumentException if null is added - */ - void addRecipe( IInscriberRecipe recipe ); - - /** - * Removes all equal recipes from the registry. - * - * @param toBeRemovedRecipe to be removed recipe, can be null, makes just no sense. - */ - void removeRecipe( IInscriberRecipe toBeRemovedRecipe ); - -} diff --git a/dependencies/main/java/appeng/api/features/IItemComparison.java b/dependencies/main/java/appeng/api/features/IItemComparison.java deleted file mode 100644 index b7d2b982b8..0000000000 --- a/dependencies/main/java/appeng/api/features/IItemComparison.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -public interface IItemComparison -{ - boolean sameAsPrecise( IItemComparison comp ); - - boolean sameAsFuzzy( IItemComparison comp ); -} diff --git a/dependencies/main/java/appeng/api/features/IItemComparisonProvider.java b/dependencies/main/java/appeng/api/features/IItemComparisonProvider.java deleted file mode 100644 index c432c0baf9..0000000000 --- a/dependencies/main/java/appeng/api/features/IItemComparisonProvider.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import net.minecraft.item.ItemStack; - - -/** - * Provider for special comparisons. when an item is encountered AE Will request - * if the comparison function handles the item, by trying to request a - * IItemComparison class. - */ -public interface IItemComparisonProvider -{ - - /** - * should return a new IItemComparison, or return null if it doesn't handle - * the supplied item. - * - * @param is item - * - * @return IItemComparison, or null - */ - IItemComparison getComparison( ItemStack is ); - - /** - * Simple test for support ( AE generally skips this and calls the above function. ) - * - * @param stack item - * - * @return true, if getComparison will return a valid IItemComparison Object - */ - boolean canHandle( ItemStack stack ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/features/ILocatable.java b/dependencies/main/java/appeng/api/features/ILocatable.java deleted file mode 100644 index c64a937fc0..0000000000 --- a/dependencies/main/java/appeng/api/features/ILocatable.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import appeng.api.events.LocatableEventAnnounce; - - -/** - * A registration record for the {@link ILocatableRegistry} use the {@link LocatableEventAnnounce} event on the Forge - * Event bus to update the registry. - */ -public interface ILocatable -{ - - /** - * @return the serial for a locatable object - */ - long getLocatableSerial(); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/features/ILocatableRegistry.java b/dependencies/main/java/appeng/api/features/ILocatableRegistry.java deleted file mode 100644 index d73305c2aa..0000000000 --- a/dependencies/main/java/appeng/api/features/ILocatableRegistry.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -/** - * A Registry for locatable items, works based on serial numbers. - */ -public interface ILocatableRegistry -{ - - /** - * Gets the {@link ILocatable} with the registered serial, if available - * - * @param serial serial - * - * @return requestedObject, or null, if the object does not exist anymore - */ - ILocatable getLocatableBy( long serial ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/features/IMatterCannonAmmoRegistry.java b/dependencies/main/java/appeng/api/features/IMatterCannonAmmoRegistry.java deleted file mode 100644 index 586470afa0..0000000000 --- a/dependencies/main/java/appeng/api/features/IMatterCannonAmmoRegistry.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import net.minecraft.item.ItemStack; - - -public interface IMatterCannonAmmoRegistry -{ - - /** - * register a new ammo, generally speaking this is based off of atomic weight to make it easier to guess at - * - * @param ammo new ammo - * @param weight atomic weight - */ - void registerAmmo( ItemStack ammo, double weight ); - - /** - * get the penetration value for a particular ammo, 0 indicates a non-ammo. - * - * @param is ammo - * - * @return 0 or a valid penetration value. - */ - float getPenetration( ItemStack is ); -} diff --git a/dependencies/main/java/appeng/api/features/INetworkEncodable.java b/dependencies/main/java/appeng/api/features/INetworkEncodable.java deleted file mode 100644 index d44ebecae3..0000000000 --- a/dependencies/main/java/appeng/api/features/INetworkEncodable.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import net.minecraft.item.ItemStack; - - -public interface INetworkEncodable -{ - - /** - * Used to get the current key from the item. - * - * @param item item - * - * @return string key of item - */ - String getEncryptionKey( ItemStack item ); - - /** - * Encode the wireless frequency via the Controller. - * - * @param item the wireless terminal. - * @param encKey the wireless encryption key. - * @param name null for now. - */ - void setEncryptionKey( ItemStack item, String encKey, String name ); -} diff --git a/dependencies/main/java/appeng/api/features/IP2PTunnelRegistry.java b/dependencies/main/java/appeng/api/features/IP2PTunnelRegistry.java deleted file mode 100644 index 4679422f45..0000000000 --- a/dependencies/main/java/appeng/api/features/IP2PTunnelRegistry.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import javax.annotation.Nullable; - -import net.minecraft.item.ItemStack; - -import appeng.api.config.TunnelType; - - -/** - * A Registry for how p2p Tunnels are attuned - */ -public interface IP2PTunnelRegistry -{ - - /** - * Allows third parties to register items from their mod as potential - * attunements for AE's P2P Tunnels - * - * @param trigger - the item which triggers attunement. Nullable, but then ignored - * @param type - the type of tunnel. Nullable, but then ignored - */ - void addNewAttunement( @Nullable ItemStack trigger, @Nullable TunnelType type ); - - /** - * returns null if no attunement can be found. - * - * @param trigger attunement trigger - * - * @return null if no attunement can be found or attunement - */ - @Nullable - TunnelType getTunnelTypeByItem( ItemStack trigger ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/features/IPlayerRegistry.java b/dependencies/main/java/appeng/api/features/IPlayerRegistry.java deleted file mode 100644 index d63cef9c8c..0000000000 --- a/dependencies/main/java/appeng/api/features/IPlayerRegistry.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import javax.annotation.Nullable; - -import com.mojang.authlib.GameProfile; - -import net.minecraft.entity.player.EntityPlayer; - - -/** - * Maintains a save specific list of userids and username combinations this greatly simplifies storage internally and - * gives a common place to look up and get IDs for the security framework. - */ -public interface IPlayerRegistry -{ - - /** - * @param gameProfile user game profile - * - * @return user id of a username. - */ - int getID( GameProfile gameProfile ); - - /** - * @param player player - * - * @return user id of a player entity. - */ - int getID( EntityPlayer player ); - - /** - * @param playerID to be found player id - * - * @return PlayerEntity, or null if the player could not be found. - */ - @Nullable - EntityPlayer findPlayer( int playerID ); -} diff --git a/dependencies/main/java/appeng/api/features/IRecipeHandlerRegistry.java b/dependencies/main/java/appeng/api/features/IRecipeHandlerRegistry.java deleted file mode 100644 index a208cbf373..0000000000 --- a/dependencies/main/java/appeng/api/features/IRecipeHandlerRegistry.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import javax.annotation.Nullable; - -import appeng.api.recipes.ICraftHandler; -import appeng.api.recipes.IRecipeHandler; -import appeng.api.recipes.ISubItemResolver; - - -/** - * @author AlgorithmX2 - * @author thatsIch - * @version rv3 - 10.08.2015 - * @since rv0 - */ -public interface IRecipeHandlerRegistry -{ - - /** - * Add a new Recipe Handler to the parser. - * - * MUST BE CALLED IN PRE-INIT - * - * @param name name of crafthandler - * @param handler class of crafthandler - */ - void addNewCraftHandler( String name, Class handler ); - - /** - * Add a new resolver to the parser. - * - * MUST BE CALLED IN PRE-INIT - * - * @param sir sub item resolver - */ - void addNewSubItemResolver( ISubItemResolver sir ); - - /** - * @param name name of crafting handler - * - * @return A recipe handler by name, returns null on failure. - */ - @Nullable - ICraftHandler getCraftHandlerFor( String name ); - - /** - * @return a new recipe handler, which can be used to parse, and read recipe files. - */ - IRecipeHandler createNewRecipehandler(); - - /** - * resolve sub items by name. - * - * @param nameSpace namespace of item - * @param itemName full name of item - * - * @return ResolverResult or ResolverResultSet or null if could not resolve - */ - @Nullable - Object resolveItem( String nameSpace, String itemName ); -} diff --git a/dependencies/main/java/appeng/api/features/IRegistryContainer.java b/dependencies/main/java/appeng/api/features/IRegistryContainer.java deleted file mode 100644 index 393187f97e..0000000000 --- a/dependencies/main/java/appeng/api/features/IRegistryContainer.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import appeng.api.AEInjectable; -import appeng.api.movable.IMovableRegistry; -import appeng.api.networking.IGridCacheRegistry; -import appeng.api.parts.IPartModels; -import appeng.api.storage.ICellRegistry; - - -/** - * @author AlgorithmX2 - * @author thatsIch - * @version rv2 - * @since rv0 - */ -@AEInjectable -public interface IRegistryContainer -{ - - /** - * Use the movable registry to white list your tiles. - */ - IMovableRegistry movable(); - - /** - * Add new Grid Caches for use during run time, only use during loading phase. - */ - IGridCacheRegistry gridCache(); - - /** - * Add additional special comparison functionality, AE Uses this internally for Bees. - */ - ISpecialComparisonRegistry specialComparison(); - - /** - * Lets you register your items as wireless terminals - */ - IWirelessTermRegistry wireless(); - - /** - * Allows you to register new cell types, these will function in drives - */ - ICellRegistry cell(); - - /** - * Manage grinder recipes via API - */ - IGrinderRegistry grinder(); - - /** - * Manage inscriber recipes via API - */ - IInscriberRegistry inscriber(); - - /** - * get access to the locatable registry - */ - ILocatableRegistry locatable(); - - /** - * get access to the p2p tunnel registry. - */ - IP2PTunnelRegistry p2pTunnel(); - - /** - * get access to the ammo registry. - */ - IMatterCannonAmmoRegistry matterCannon(); - - /** - * get access to the player registry - */ - IPlayerRegistry players(); - - /** - * get access to the ae2 recipe api - */ - IRecipeHandlerRegistry recipes(); - - /** - * get access to the world-gen api. - */ - IWorldGen worldgen(); - - /** - * Register your IPart models before using them. - */ - IPartModels partModels(); -} diff --git a/dependencies/main/java/appeng/api/features/ISpecialComparisonRegistry.java b/dependencies/main/java/appeng/api/features/ISpecialComparisonRegistry.java deleted file mode 100644 index c55bf17576..0000000000 --- a/dependencies/main/java/appeng/api/features/ISpecialComparisonRegistry.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import net.minecraft.item.ItemStack; - - -/** - * A Registry of any special comparison handlers for AE To use. - */ -public interface ISpecialComparisonRegistry -{ - - /** - * return TheHandler or null. - * - * @param stack item - * - * @return a handler it found for a specific item - */ - IItemComparison getSpecialComparison( ItemStack stack ); - - /** - * Register a new special comparison function with AE. - * - * @param prov comparison provider - */ - void addComparisonProvider( IItemComparisonProvider prov ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/features/IWirelessTermHandler.java b/dependencies/main/java/appeng/api/features/IWirelessTermHandler.java deleted file mode 100644 index 2d26716a45..0000000000 --- a/dependencies/main/java/appeng/api/features/IWirelessTermHandler.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -import appeng.api.util.IConfigManager; - - -/** - * A handler for a wireless terminal. - */ -public interface IWirelessTermHandler extends INetworkEncodable -{ - - /** - * @param is wireless terminal - * - * @return true, if usePower, hasPower, etc... can be called for the provided item - */ - boolean canHandle( ItemStack is ); - - /** - * use an amount of power, in AE units - * - * @param amount is in AE units ( 5 per MJ ), if you return false, the item should be dead and return false for - * hasPower - * @param is wireless terminal - * - * @return true if wireless terminal uses power - */ - boolean usePower( EntityPlayer player, double amount, ItemStack is ); - - /** - * gets the power status of the item. - * - * @param is wireless terminal - * - * @return returns true if there is any power left. - */ - boolean hasPower( EntityPlayer player, double amount, ItemStack is ); - - /** - * Return the config manager for the wireless terminal. - * - * @param is wireless terminal - * - * @return config manager of wireless terminal - */ - IConfigManager getConfigManager( ItemStack is ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/features/IWirelessTermRegistry.java b/dependencies/main/java/appeng/api/features/IWirelessTermRegistry.java deleted file mode 100644 index afab120121..0000000000 --- a/dependencies/main/java/appeng/api/features/IWirelessTermRegistry.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - - -/** - * Registration record for a Custom Cell handler. - */ -public interface IWirelessTermRegistry -{ - - /** - * add this handler to the list of other wireless handler. - * - * @param handler wireless handler - */ - void registerWirelessHandler( IWirelessTermHandler handler ); - - /** - * @param is item which might have a handler - * - * @return true if there is a handler for this item - */ - boolean isWirelessTerminal( ItemStack is ); - - /** - * @param is item with handler - * - * @return a register handler for the item in question, or null if there - * isn't one - */ - IWirelessTermHandler getWirelessTerminalHandler( ItemStack is ); - - /** - * opens the wireless terminal gui, the wireless terminal item, must be in - * the active slot on the tool bar. - */ - void openWirelessTerminalGui( ItemStack item, World w, EntityPlayer player ); -} diff --git a/dependencies/main/java/appeng/api/features/IWorldGen.java b/dependencies/main/java/appeng/api/features/IWorldGen.java deleted file mode 100644 index 725bb70caa..0000000000 --- a/dependencies/main/java/appeng/api/features/IWorldGen.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.features; - - -import net.minecraft.world.World; -import net.minecraft.world.WorldProvider; - - -public interface IWorldGen -{ - - void disableWorldGenForProviderID( WorldGenType type, Class provider ); - - void enableWorldGenForDimension( WorldGenType type, int dimID ); - - void disableWorldGenForDimension( WorldGenType type, int dimID ); - - boolean isWorldGenEnabled( WorldGenType type, World w ); - - enum WorldGenType - { - CERTUS_QUARTZ, CHARGED_CERTUS_QUARTZ, METEORITES - } -} diff --git a/dependencies/main/java/appeng/api/features/InscriberProcessType.java b/dependencies/main/java/appeng/api/features/InscriberProcessType.java deleted file mode 100644 index d28ef0a2b2..0000000000 --- a/dependencies/main/java/appeng/api/features/InscriberProcessType.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api.features; - - -public enum InscriberProcessType -{ - /** - * uses the optionals as catalyst - */ - INSCRIBE, - - /** - * spends the optionals - */ - PRESS -} diff --git a/dependencies/main/java/appeng/api/implementations/ICraftingPatternItem.java b/dependencies/main/java/appeng/api/implementations/ICraftingPatternItem.java deleted file mode 100644 index a8bdbaac89..0000000000 --- a/dependencies/main/java/appeng/api/implementations/ICraftingPatternItem.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations; - - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import appeng.api.networking.crafting.ICraftingPatternDetails; - - -/** - * Implemented on {@link Item} - */ -public interface ICraftingPatternItem -{ - - /** - * Access Details about a pattern - * - * @param is pattern - * @param w crafting world - * - * @return details of pattern - */ - ICraftingPatternDetails getPatternForItem( ItemStack is, World w ); -} diff --git a/dependencies/main/java/appeng/api/implementations/IPowerChannelState.java b/dependencies/main/java/appeng/api/implementations/IPowerChannelState.java deleted file mode 100644 index ee55879296..0000000000 --- a/dependencies/main/java/appeng/api/implementations/IPowerChannelState.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations; - - -/** - * This is intended for use on the client side to provide details to WAILA. - */ -public interface IPowerChannelState -{ - - /** - * @return true if the part/tile is powered. - */ - boolean isPowered(); - - /** - * @return true if the part/tile isActive - */ - boolean isActive(); -} diff --git a/dependencies/main/java/appeng/api/implementations/IUpgradeableHost.java b/dependencies/main/java/appeng/api/implementations/IUpgradeableHost.java deleted file mode 100644 index bbc728e1f7..0000000000 --- a/dependencies/main/java/appeng/api/implementations/IUpgradeableHost.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations; - - -import net.minecraft.tileentity.TileEntity; - -import appeng.api.config.Upgrades; -import appeng.api.implementations.tiles.ISegmentedInventory; -import appeng.api.util.IConfigurableObject; - - -public interface IUpgradeableHost extends IConfigurableObject, ISegmentedInventory -{ - - /** - * determine how many of an upgrade are installed. - */ - int getInstalledUpgrades( Upgrades u ); - - /** - * the tile... - * - * @return tile entity - */ - TileEntity getTile(); -} diff --git a/dependencies/main/java/appeng/api/implementations/TransitionResult.java b/dependencies/main/java/appeng/api/implementations/TransitionResult.java deleted file mode 100644 index 9eec763e89..0000000000 --- a/dependencies/main/java/appeng/api/implementations/TransitionResult.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations; - - -/** - * Defines the result of performing a transition from the world into a storage - * cell, if its possible, and what the energy usage is. - */ -public class TransitionResult -{ - public final boolean success; - public final double energyUsage; - - public TransitionResult( final boolean _success, final double power ) - { - this.success = _success; - this.energyUsage = power; - } -} diff --git a/dependencies/main/java/appeng/api/implementations/guiobjects/IGuiItem.java b/dependencies/main/java/appeng/api/implementations/guiobjects/IGuiItem.java deleted file mode 100644 index 0a52d461ab..0000000000 --- a/dependencies/main/java/appeng/api/implementations/guiobjects/IGuiItem.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.guiobjects; - - -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - - -/** - * Implemented on Item objects, to return objects used to manage, and interact - * with the contents. - */ -public interface IGuiItem -{ - - IGuiItemObject getGuiObject( ItemStack is, World world, BlockPos pos ); -} diff --git a/dependencies/main/java/appeng/api/implementations/guiobjects/IGuiItemObject.java b/dependencies/main/java/appeng/api/implementations/guiobjects/IGuiItemObject.java deleted file mode 100644 index 3421873946..0000000000 --- a/dependencies/main/java/appeng/api/implementations/guiobjects/IGuiItemObject.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.guiobjects; - - -import net.minecraft.item.ItemStack; - - -public interface IGuiItemObject -{ - - ItemStack getItemStack(); -} diff --git a/dependencies/main/java/appeng/api/implementations/guiobjects/INetworkTool.java b/dependencies/main/java/appeng/api/implementations/guiobjects/INetworkTool.java deleted file mode 100644 index 4e0dc95897..0000000000 --- a/dependencies/main/java/appeng/api/implementations/guiobjects/INetworkTool.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.guiobjects; - - -import net.minecraft.inventory.IInventory; - -import appeng.api.networking.IGridHost; - - -/** - * Obtained via {@link IGuiItem} getGuiObject - */ -public interface INetworkTool extends IInventory, IGuiItemObject -{ - - IGridHost getGridHost(); // null for most purposes. -} diff --git a/dependencies/main/java/appeng/api/implementations/guiobjects/IPortableCell.java b/dependencies/main/java/appeng/api/implementations/guiobjects/IPortableCell.java deleted file mode 100644 index 7a80a00b56..0000000000 --- a/dependencies/main/java/appeng/api/implementations/guiobjects/IPortableCell.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.guiobjects; - - -import appeng.api.networking.energy.IEnergySource; -import appeng.api.storage.IMEMonitor; -import appeng.api.storage.ITerminalHost; -import appeng.api.storage.data.IAEItemStack; - - -/** - * Obtained via {@link IGuiItem} getGuiObject - */ -public interface IPortableCell extends ITerminalHost, IMEMonitor, IEnergySource, IGuiItemObject -{ - -} diff --git a/dependencies/main/java/appeng/api/implementations/items/IAEItemPowerStorage.java b/dependencies/main/java/appeng/api/implementations/items/IAEItemPowerStorage.java deleted file mode 100644 index 0ca4ff49cb..0000000000 --- a/dependencies/main/java/appeng/api/implementations/items/IAEItemPowerStorage.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.items; - - -import net.minecraft.item.ItemStack; - -import appeng.api.config.AccessRestriction; -import appeng.api.networking.energy.IAEPowerStorage; - - -/** - * Basically the same as {@link IAEPowerStorage}, but for items. - */ -public interface IAEItemPowerStorage -{ - - /** - * Inject amt, power into the device, it will store what it can, and return - * the amount unable to be stored. - * - * @return amount unable to be stored - */ - double injectAEPower( ItemStack is, double amt ); - - /** - * Attempt to extract power from the device, it will extract what it can and - * return it. - * - * @param amt to be extracted power from device - * - * @return what it could extract - */ - double extractAEPower( ItemStack is, double amt ); - - /** - * @return the current maximum power ( this can change :P ) - */ - double getAEMaxPower( ItemStack is ); - - /** - * @return the current AE Power Level, this may exceed getMEMaxPower() - */ - double getAECurrentPower( ItemStack is ); - - /** - * Control the power flow by telling what the network can do, either add? or - * subtract? or both! - * - * @return access restriction of network - */ - AccessRestriction getPowerFlow( ItemStack is ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/implementations/items/IAEWrench.java b/dependencies/main/java/appeng/api/implementations/items/IAEWrench.java deleted file mode 100644 index afba8aa425..0000000000 --- a/dependencies/main/java/appeng/api/implementations/items/IAEWrench.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.items; - - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; - - -/** - * Implemented on AE's wrench(s) as a substitute for if BC's API is not - * available. - */ -public interface IAEWrench -{ - - /** - * Check if the wrench can be used. - * - * @param player wrenching player - * @param pos of block. - * - * @return true if wrench can be used - */ - boolean canWrench( ItemStack wrench, EntityPlayer player, BlockPos pos ); -} diff --git a/dependencies/main/java/appeng/api/implementations/items/IBiometricCard.java b/dependencies/main/java/appeng/api/implementations/items/IBiometricCard.java deleted file mode 100644 index b1128f45d3..0000000000 --- a/dependencies/main/java/appeng/api/implementations/items/IBiometricCard.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.items; - - -import java.util.EnumSet; - -import com.mojang.authlib.GameProfile; - -import net.minecraft.item.ItemStack; - -import appeng.api.config.SecurityPermissions; -import appeng.api.features.IPlayerRegistry; -import appeng.api.networking.security.ISecurityRegistry; - - -public interface IBiometricCard -{ - - /** - * Set the {@link GameProfile} to null, to clear it. - */ - void setProfile( ItemStack itemStack, GameProfile username ); - - /** - * @return {@link GameProfile} of the player encoded on this card, or a blank string. - */ - GameProfile getProfile( ItemStack is ); - - /** - * @param itemStack card - * - * @return the full list of permissions encoded on the card. - */ - EnumSet getPermissions( ItemStack itemStack ); - - /** - * Check if a permission is encoded on the card. - * - * @param permission card - * - * @return true if this permission is set on the card. - */ - boolean hasPermission( ItemStack is, SecurityPermissions permission ); - - /** - * remove a permission from the item stack. - * - * @param itemStack card - * @param permission to be removed permission - */ - void removePermission( ItemStack itemStack, SecurityPermissions permission ); - - /** - * add a permission to the item stack. - * - * @param itemStack card - * @param permission to be added permission - */ - void addPermission( ItemStack itemStack, SecurityPermissions permission ); - - /** - * lets you handle submission of security values on the card for custom behavior. - * - * @param registry security registry - * @param pr player registry - * @param is card - */ - void registerPermissions( ISecurityRegistry registry, IPlayerRegistry pr, ItemStack is ); -} diff --git a/dependencies/main/java/appeng/api/implementations/items/IGrowableCrystal.java b/dependencies/main/java/appeng/api/implementations/items/IGrowableCrystal.java deleted file mode 100644 index 489e2b89cb..0000000000 --- a/dependencies/main/java/appeng/api/implementations/items/IGrowableCrystal.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.items; - - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.item.ItemStack; - - -public interface IGrowableCrystal -{ - - ItemStack triggerGrowth( ItemStack is ); - - float getMultiplier( Block blk, Material mat ); -} diff --git a/dependencies/main/java/appeng/api/implementations/items/IItemGroup.java b/dependencies/main/java/appeng/api/implementations/items/IItemGroup.java deleted file mode 100644 index 3d3f8cc0f9..0000000000 --- a/dependencies/main/java/appeng/api/implementations/items/IItemGroup.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.items; - - -import java.util.Set; - -import net.minecraft.item.ItemStack; - - -/** - * Lets you specify the name of the group of items this falls under. - */ -public interface IItemGroup -{ - - /** - * returning null, is the same as not implementing the interface at all. - * - * @param is item - * - * @return an unlocalized string to use for the items group name. - */ - String getUnlocalizedGroupName( Set otherItems, ItemStack is ); -} diff --git a/dependencies/main/java/appeng/api/implementations/items/IMemoryCard.java b/dependencies/main/java/appeng/api/implementations/items/IMemoryCard.java deleted file mode 100644 index 1772a2a412..0000000000 --- a/dependencies/main/java/appeng/api/implementations/items/IMemoryCard.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.items; - - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - - -/** - * Memory Card API - * - * AE's Memory Card Item Class implements this interface. - */ -public interface IMemoryCard -{ - - /** - * Configures the data stored on the memory card, the SettingsName, will be - * localized when displayed. - * - * @param is item - * @param SettingsName unlocalized string that represents the tile entity. - * @param data may contain a String called "tooltip" which is is a - * unlocalized string displayed after the settings name, optional - * but can be used to add details to the card for later. - */ - void setMemoryCardContents( ItemStack is, String SettingsName, NBTTagCompound data ); - - /** - * returns the settings name provided by a previous call to - * setMemoryCardContents, or "AppEng.GuiITooltip.Blank" if there was no - * previous call to setMemoryCardContents. - * - * @param is item - * - * @return setting name - */ - String getSettingsName( ItemStack is ); - - /** - * @param is item - * - * @return the NBT Data previously saved by setMemoryCardContents, or an - * empty NBTCompound - */ - NBTTagCompound getData( ItemStack is ); - - /** - * notify the user of a outcome related to the memory card. - * - * @param player that used the card. - * @param msg which message to send. - */ - void notifyUser( EntityPlayer player, MemoryCardMessages msg ); -} diff --git a/dependencies/main/java/appeng/api/implementations/items/ISpatialStorageCell.java b/dependencies/main/java/appeng/api/implementations/items/ISpatialStorageCell.java deleted file mode 100644 index 7ae8f453ff..0000000000 --- a/dependencies/main/java/appeng/api/implementations/items/ISpatialStorageCell.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.items; - - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import appeng.api.implementations.TransitionResult; -import appeng.api.util.WorldCoord; - - -/** - * Implemented on a {@link Item} - */ -public interface ISpatialStorageCell -{ - - /** - * @param is spatial storage cell - * - * @return true if this item is a spatial storage cell - */ - boolean isSpatialStorage( ItemStack is ); - - /** - * @param is spatial storage cell - * - * @return the maximum size of the spatial storage cell along any given axis - */ - int getMaxStoredDim( ItemStack is ); - - /** - * @param is spatial storage cell - * - * @return the world for this cell - */ - World getWorld( ItemStack is ); - - /** - * get the currently stored size. - * - * @param is spatial storage cell - * - * @return size of spatial - */ - WorldCoord getStoredSize( ItemStack is ); - - /** - * Minimum coordinates in its world for the storage cell. - * - * @param is spatial storage cell - * - * @return minimum coordinate of dimension - */ - WorldCoord getMin( ItemStack is ); - - /** - * Maximum coordinates in its world for the storage cell. - * - * @param is spatial storage cell - * - * @return maximum coordinate of dimension - */ - WorldCoord getMax( ItemStack is ); - - /** - * Perform a spatial swap with the contents of the cell, and the world. - * - * @param is spatial storage cell - * @param w world of spatial - * @param min min coord - * @param max max coord - * @param doTransition transition - * - * @return result of transition - */ - TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, boolean doTransition ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/implementations/items/IStorageCell.java b/dependencies/main/java/appeng/api/implementations/items/IStorageCell.java deleted file mode 100644 index b2b35463fc..0000000000 --- a/dependencies/main/java/appeng/api/implementations/items/IStorageCell.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.items; - - -import net.minecraft.item.ItemStack; - -import appeng.api.storage.ICellWorkbenchItem; -import appeng.api.storage.data.IAEItemStack; - - -/** - * Any item which implements this can be treated as an IMEInventory via - * Util.getCell / Util.isCell It automatically handles the internals and NBT - * data, which is both nice, and bad for you! - * - * Good cause it means you don't have to do anything, bad because you have - * little to no control over it. - * - * The standard AE implementation only provides 1-63 Types - */ -public interface IStorageCell extends ICellWorkbenchItem -{ - - /** - * It wont work if the return is not a multiple of 8. - * The limit is ({@link Integer#MAX_VALUE} + 1) / 8. - * - * @param cellItem item - * - * @return number of bytes - */ - int getBytes( ItemStack cellItem ); - - /** - * Determines the number of bytes used for any type included on the cell. - * - * @param cellItem item - * - * @return number of bytes - */ - int getBytesPerType( ItemStack cellItem ); - - /** - * Must be between 1 and 63, indicates how many types you want to store on - * the item. - * - * @param cellItem item - * - * @return number of types - */ - int getTotalTypes( ItemStack cellItem ); - - /** - * Allows you to fine tune which items are allowed on a given cell, if you - * don't care, just return false; As the handler for this type of cell is - * still the default cells, the normal AE black list is also applied. - * - * @param cellItem item - * @param requestedAddition requested addition - * - * @return true to preventAdditionOfItem - */ - boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition ); - - /** - * Allows you to specify if this storage cell can be stored inside other - * storage cells, only set this for special items like the matter cannon - * that are not general purpose storage. - * - * @return true if the storage cell can be stored inside other storage - * cells, this is generally false, except for certain situations - * such as the matter cannon. - */ - boolean storableInStorageCell(); - - /** - * Allows an item to selectively enable or disable its status as a storage - * cell. - * - * @param i item - * - * @return if the ItemStack should behavior as a storage cell. - */ - boolean isStorageCell( ItemStack i ); - - /** - * @return drain in ae/t this storage cell will use. - */ - double getIdleDrain(); -} diff --git a/dependencies/main/java/appeng/api/implementations/items/IStorageComponent.java b/dependencies/main/java/appeng/api/implementations/items/IStorageComponent.java deleted file mode 100644 index b1958f9fcd..0000000000 --- a/dependencies/main/java/appeng/api/implementations/items/IStorageComponent.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.items; - - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - - -/** - * Implemented on a {@link Item} - */ -public interface IStorageComponent -{ - - /** - * This isn't necessarily the same as if you make a storage cell out of it, - * but all of AE's default cells do it that way, its currently only used for - * the condenser. - * - * @param is item - * - * @return number of bytes - */ - int getBytes( ItemStack is ); - - /** - * Just true or false for the item stack. - * - * @param is item - * - * @return true if item is a storage component - */ - boolean isStorageComponent( ItemStack is ); -} diff --git a/dependencies/main/java/appeng/api/implementations/items/IUpgradeModule.java b/dependencies/main/java/appeng/api/implementations/items/IUpgradeModule.java deleted file mode 100644 index 0b06911e0f..0000000000 --- a/dependencies/main/java/appeng/api/implementations/items/IUpgradeModule.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.items; - - -import net.minecraft.item.ItemStack; - -import appeng.api.config.Upgrades; - - -public interface IUpgradeModule -{ - - /** - * @param itemstack item with potential upgrades - * - * @return null, or a valid upgrade type. - */ - Upgrades getType( ItemStack itemstack ); -} diff --git a/dependencies/main/java/appeng/api/implementations/items/MemoryCardMessages.java b/dependencies/main/java/appeng/api/implementations/items/MemoryCardMessages.java deleted file mode 100644 index 0162131489..0000000000 --- a/dependencies/main/java/appeng/api/implementations/items/MemoryCardMessages.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.items; - - -/** - * Status Results for use with {@link IMemoryCard} - */ -public enum MemoryCardMessages -{ - INVALID_MACHINE, SETTINGS_LOADED, SETTINGS_SAVED, SETTINGS_CLEARED -} diff --git a/dependencies/main/java/appeng/api/implementations/parts/IPartCable.java b/dependencies/main/java/appeng/api/implementations/parts/IPartCable.java deleted file mode 100644 index d730b9a79c..0000000000 --- a/dependencies/main/java/appeng/api/implementations/parts/IPartCable.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.parts; - - -import java.util.EnumSet; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.EnumFacing; - -import appeng.api.networking.IGridHost; -import appeng.api.parts.BusSupport; -import appeng.api.parts.IPart; -import appeng.api.parts.IPartHost; -import appeng.api.util.AECableType; -import appeng.api.util.AEColor; -import appeng.api.util.AEPartLocation; - - -/** - * Implemented on the {@link IPart}s cable objects that can be placed at {@link AEPartLocation}.UNKNOWN in - * {@link IPartHost}s - */ -public interface IPartCable extends IPart, IGridHost -{ - - /** - * does this cable support buses? - */ - BusSupport supportsBuses(); - - /** - * @return the current color of the cable. - */ - AEColor getCableColor(); - - /** - * @return the Cable type. - */ - AECableType getCableConnectionType(); - - /** - * Change the color of the cable, this should cost a small amount of dye, or something. - * - * @param newColor new color - * - * @return if the color change was successful. - */ - boolean changeColor( AEColor newColor, EntityPlayer who ); - - /** - * Change sides on the cables node. - * - * Called by AE, do not invoke. - * - * @param sides sides of cable - */ - void setValidSides( EnumSet sides ); - - /** - * used to tests if a cable connects to neighbors visually. - * - * @param side neighbor side - * - * @return true if this side is currently connects to an external block. - */ - boolean isConnected( EnumFacing side ); - -} diff --git a/dependencies/main/java/appeng/api/implementations/parts/IPartMonitor.java b/dependencies/main/java/appeng/api/implementations/parts/IPartMonitor.java deleted file mode 100644 index 8b788e8447..0000000000 --- a/dependencies/main/java/appeng/api/implementations/parts/IPartMonitor.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.parts; - - -import appeng.api.networking.IGridHost; -import appeng.api.parts.IPart; - - -/** - * Implemented by all screen like parts provided by AE. - */ -public interface IPartMonitor extends IPart, IGridHost -{ - - /** - * @return if the device is online you should check this before providing - * any other information. - */ - boolean isPowered(); -} diff --git a/dependencies/main/java/appeng/api/implementations/parts/IPartStorageMonitor.java b/dependencies/main/java/appeng/api/implementations/parts/IPartStorageMonitor.java deleted file mode 100644 index 9bdfe650c1..0000000000 --- a/dependencies/main/java/appeng/api/implementations/parts/IPartStorageMonitor.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.parts; - - -import appeng.api.networking.IGridHost; -import appeng.api.parts.IPart; -import appeng.api.storage.data.IAEStack; -import appeng.api.util.INetworkToolAgent; - - -/** - * The Storage monitor is a {@link IPart} located on the sides of a IPartHost - */ -public interface IPartStorageMonitor extends IPartMonitor, IPart, IGridHost, INetworkToolAgent -{ - - /** - * @return the item being displayed on the storage monitor, in AEStack Form, can be either a IAEItemStack or an - * IAEFluidStack the quantity is important remember to use getStackSize() on the IAEStack, and not on the - * FluidStack/ItemStack acquired from it. - */ - IAEStack getDisplayed(); - - /** - * @return the current locked state of the Storage Monitor - */ - boolean isLocked(); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/implementations/tiles/IChestOrDrive.java b/dependencies/main/java/appeng/api/implementations/tiles/IChestOrDrive.java deleted file mode 100644 index 0be1d00304..0000000000 --- a/dependencies/main/java/appeng/api/implementations/tiles/IChestOrDrive.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.tiles; - - -import appeng.api.networking.IGridHost; -import appeng.api.storage.ICellContainer; -import appeng.api.util.IOrientable; - - -public interface IChestOrDrive extends ICellContainer, IGridHost, IOrientable -{ - - /** - * @return how many slots are available. Chest has 1, Drive has 10. - */ - int getCellCount(); - - /** - * 0 - cell is missing. - * - * 1 - green, - * - * 2 - orange, - * - * 3 - red - * - * @param slot slot index - * - * @return status of the slot, one of the above indices. - */ - int getCellStatus( int slot ); - - /** - * @return if the device is online you should check this before providing any other information. - */ - boolean isPowered(); - - /** - * @param slot slot index - * - * @return is the cell currently blinking to show activity. - */ - boolean isCellBlinking( int slot ); -} diff --git a/dependencies/main/java/appeng/api/implementations/tiles/IColorableTile.java b/dependencies/main/java/appeng/api/implementations/tiles/IColorableTile.java deleted file mode 100644 index 89232749ea..0000000000 --- a/dependencies/main/java/appeng/api/implementations/tiles/IColorableTile.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.tiles; - - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.EnumFacing; - -import appeng.api.util.AEColor; - - -public interface IColorableTile -{ - - AEColor getColor(); - - boolean recolourBlock( EnumFacing side, AEColor colour, EntityPlayer who ); -} diff --git a/dependencies/main/java/appeng/api/implementations/tiles/ICraftingMachine.java b/dependencies/main/java/appeng/api/implementations/tiles/ICraftingMachine.java deleted file mode 100644 index f3e3ee2c91..0000000000 --- a/dependencies/main/java/appeng/api/implementations/tiles/ICraftingMachine.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.tiles; - - -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.util.EnumFacing; - -import appeng.api.networking.crafting.ICraftingPatternDetails; - - -public interface ICraftingMachine -{ - - /** - * inserts a crafting plan, and the necessary items into the crafting machine. - * - * @param patternDetails details of pattern - * @param table crafting table - * @param ejectionDirection ejection direction - * - * @return if it was accepted, all or nothing. - */ - boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table, EnumFacing ejectionDirection ); - - /** - * check if the crafting machine is accepting pushes via pushPattern, if this is false, all calls to push will fail, - * you can try inserting into the inventory instead. - * - * @return true, if pushPattern can complete, if its false push will always be false. - */ - boolean acceptsPlans(); -} diff --git a/dependencies/main/java/appeng/api/implementations/tiles/ICrankable.java b/dependencies/main/java/appeng/api/implementations/tiles/ICrankable.java deleted file mode 100644 index d2e7715aa3..0000000000 --- a/dependencies/main/java/appeng/api/implementations/tiles/ICrankable.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.tiles; - - -import net.minecraft.util.EnumFacing; - - -/** - * Crank/Crankable API, - * - * Tiles that Implement this can receive power, from the crank, and have the - * crank placed on them. - * - * Tiles that access other tiles that implement this method can act as Cranks. - * - * This interface must be implemented by a tile entity. - */ -public interface ICrankable -{ - - /** - * Test if the crank can turn, return false if there is no work to be done. - * - * @return if crank should be allowed to turn. - */ - boolean canTurn(); - - /** - * The crank has completed one turn. - */ - void applyTurn(); - - /** - * @return true if the crank can attach on the given side. - */ - boolean canCrankAttach( EnumFacing directionToCrank ); -} diff --git a/dependencies/main/java/appeng/api/implementations/tiles/ICrystalGrowthAccelerator.java b/dependencies/main/java/appeng/api/implementations/tiles/ICrystalGrowthAccelerator.java deleted file mode 100644 index 9d8a9c29d5..0000000000 --- a/dependencies/main/java/appeng/api/implementations/tiles/ICrystalGrowthAccelerator.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.tiles; - - -public interface ICrystalGrowthAccelerator -{ - - boolean isPowered(); -} diff --git a/dependencies/main/java/appeng/api/implementations/tiles/IMEChest.java b/dependencies/main/java/appeng/api/implementations/tiles/IMEChest.java deleted file mode 100644 index 794b45d7d9..0000000000 --- a/dependencies/main/java/appeng/api/implementations/tiles/IMEChest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.tiles; - - -import appeng.api.networking.energy.IEnergySource; - - -public interface IMEChest extends IChestOrDrive, IEnergySource -{ - -} diff --git a/dependencies/main/java/appeng/api/implementations/tiles/ISegmentedInventory.java b/dependencies/main/java/appeng/api/implementations/tiles/ISegmentedInventory.java deleted file mode 100644 index c73a8a53f8..0000000000 --- a/dependencies/main/java/appeng/api/implementations/tiles/ISegmentedInventory.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.tiles; - - -import net.minecraft.inventory.IInventory; - - -public interface ISegmentedInventory -{ - - /** - * Access an internal inventory, note, not all inventories contain real items, some may be ghost items, and treating - * them a real inventories will result in duplication. - * - * @param name inventory name - * - * @return inventory with inventory name - */ - IInventory getInventoryByName( String name ); -} diff --git a/dependencies/main/java/appeng/api/implementations/tiles/IViewCellStorage.java b/dependencies/main/java/appeng/api/implementations/tiles/IViewCellStorage.java deleted file mode 100644 index 4a81ae12bf..0000000000 --- a/dependencies/main/java/appeng/api/implementations/tiles/IViewCellStorage.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.tiles; - - -import net.minecraft.inventory.IInventory; - - -public interface IViewCellStorage -{ - - /** - * should contains at least 5 slot, the first 5 - * - * @return inventory with at least 5 slot - */ - IInventory getViewCellStorage(); -} diff --git a/dependencies/main/java/appeng/api/implementations/tiles/IWirelessAccessPoint.java b/dependencies/main/java/appeng/api/implementations/tiles/IWirelessAccessPoint.java deleted file mode 100644 index 038bc52db0..0000000000 --- a/dependencies/main/java/appeng/api/implementations/tiles/IWirelessAccessPoint.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.implementations.tiles; - - -import appeng.api.networking.IGrid; -import appeng.api.networking.security.IActionHost; -import appeng.api.util.DimensionalCoord; - - -public interface IWirelessAccessPoint extends IActionHost -{ - - /** - * @return location of WAP - */ - DimensionalCoord getLocation(); - - /** - * @return max range for this WAP - */ - double getRange(); - - /** - * @return can you use this WAP? - */ - boolean isActive(); - - /** - * @return grid of linked WAP - */ - IGrid getGrid(); -} diff --git a/dependencies/main/java/appeng/api/movable/IMovableHandler.java b/dependencies/main/java/appeng/api/movable/IMovableHandler.java deleted file mode 100644 index 9c08aed52d..0000000000 --- a/dependencies/main/java/appeng/api/movable/IMovableHandler.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.movable; - - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - - -public interface IMovableHandler -{ - - /** - * if you return true from this, your saying you can handle the class, not - * that single entity, you cannot opt out of single entities. - * - * @param myClass tile entity class - * @param tile tile entity - * - * @return true if it can handle moving - */ - boolean canHandle( Class myClass, TileEntity tile ); - - /** - * request that the handler move the the tile from its current location to - * the new one. the tile has already been invalidated, and the blocks have - * already been fully moved. - * - * Potential Example: - * - *
-	 * {
-	 * 	@code
-	 * 	Chunk c = world.getChunkFromBlockCoords( x, z );
-	 * 	c.setChunkBlockTileEntity( x & 0xF, y + y, z & 0xF, tile );
-	 *
-	 * 	if( c.isChunkLoaded )
-	 * 	{
-	 * 		world.addTileEntity( tile );
-	 * 		world.markBlockForUpdate( x, y, z );
-	 * 	}
-	 * }
-	 * 
- * - * @param tile to be moved tile - * @param world world of tile - * @param newPosition the new location - */ - void moveTile( TileEntity tile, World world, BlockPos newPosition ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/movable/IMovableRegistry.java b/dependencies/main/java/appeng/api/movable/IMovableRegistry.java deleted file mode 100644 index be11050b55..0000000000 --- a/dependencies/main/java/appeng/api/movable/IMovableRegistry.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.movable; - - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; - - -/** - * Used to determine if a tile is marked as movable, a block will be considered movable, if... - * - * 1. The Tile or its super classes have been white listed with whiteListTileEntity. - * - * 2. The Tile has been register with the IMC ( which basically calls whiteListTileEntity. ) - * - * 3. The Tile implements IMovableTile 4. A IMovableHandler is register that returns canHandle = true for the Tile - * Entity Class - * - * IMC Example: FMLInterModComms.sendMessage( "appliedenergistics2", "movabletile", "appeng.common.AppEngTile" ); - * - * The movement process is as follows, - * - * 1. IMovableTile.prepareToMove() or TileEntity.invalidate() depending on your opt-in method. 2. The tile will be - * removed from the world. 3. Its world, coordinates will be changed. *** this can be overridden with a IMovableHandler - * *** 4. It will then be re-added to the world, or a new world. 5. TileEntity.validate() 6. IMovableTile.doneMoving ( - * if you implemented IMovableTile ) - * - * Please note, this is a 100% white list only feature, I will never opt in any non-vanilla, non-AE blocks. If you do - * not want to support your tiles being moved, you don't have to do anything. - * - * I appreciate anyone that takes the effort to get their tiles to work with this system to create a better use - * experience. - * - * If you need a build of deobf build of AE for testing, do not hesitate to ask. - */ -public interface IMovableRegistry -{ - - /** - * Black list a block from movement, please only use this to prevent exploits. - * - * You can also use the IMC, FMLInterModComms.sendMessage( "appliedenergistics2", "whitelist-spatial", - * "appeng.common.AppEngTile" ); - * - * @param blk block - */ - void blacklistBlock( Block blk ); - - /** - * White list your tile entity with the registry. - * - * You can also use the IMC, FMLInterModComms.sendMessage( "appliedenergistics2", "blacklist-block-spatial", new - * ItemStack(...) ); - * - * If you tile is handled with IMovableHandler or IMovableTile you do not need to white list it. - */ - void whiteListTileEntity( Class c ); - - /** - * @param te to be moved tile entity - * - * @return true if the tile has accepted your request to move it - */ - boolean askToMove( TileEntity te ); - - /** - * tells the tile you are done moving it. - * - * @param te moved tile entity - */ - void doneMoving( TileEntity te ); - - /** - * add a new handler movable handler. - * - * @param handler moving handler - */ - void addHandler( IMovableHandler handler ); - - /** - * handlers are used to perform movement, this allows you to override AE's internal version. - * - * only valid after askToMove(...) = true - * - * @param te tile entity - * - * @return moving handler of tile entity - */ - IMovableHandler getHandler( TileEntity te ); - - /** - * @return a copy of the default handler - */ - IMovableHandler getDefaultHandler(); - - /** - * @param blk block - * - * @return true if this block is blacklisted - */ - boolean isBlacklisted( Block blk ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/movable/IMovableTile.java b/dependencies/main/java/appeng/api/movable/IMovableTile.java deleted file mode 100644 index feaaff2879..0000000000 --- a/dependencies/main/java/appeng/api/movable/IMovableTile.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.movable; - - -/** - * You can implement this, or use the IMovableRegistry to white list your tile, - * please see the registry for more information. - */ -public interface IMovableTile -{ - - /** - * notification that your block will be moved, called instead of invalidate, - * return false to prevent movement. - * - * @return false to prevent movement - */ - boolean prepareToMove(); - - /** - * notification that your block was moved, called after validate. - */ - void doneMoving(); -} diff --git a/dependencies/main/java/appeng/api/networking/GridFlags.java b/dependencies/main/java/appeng/api/networking/GridFlags.java deleted file mode 100644 index c296eb64ed..0000000000 --- a/dependencies/main/java/appeng/api/networking/GridFlags.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -/** - * Various flags to determine network node behavior. - */ -public enum GridFlags -{ - /** - * import/export buses, terminals, and other devices that use network features, will use this setting. - */ - REQUIRE_CHANNEL, - - /** - * P2P ME tunnels use this setting. - */ - COMPRESSED_CHANNEL, - - /** - * cannot carry channels over this node. - */ - CANNOT_CARRY, - - /** - * Used by P2P Tunnels to prevent tunnels from tunneling recursively. - */ - CANNOT_CARRY_COMPRESSED, - - /** - * This node can transmit 32 signals, this should only apply to Tier2 Cable, P2P Tunnels, and Quantum Network - * Bridges. - */ - DENSE_CAPACITY, - - /** - * This block is part of a multiblock, used in conjunction with REQUIRE_CHANNEL, and {@link IGridMultiblock} see - * this - * interface for details. - */ - MULTIBLOCK, - - /** - * Indicates which path might be preferred, this only matters if two routes of equal length exist, ad only changes - * the order they are processed in. - */ - PREFERRED -} diff --git a/dependencies/main/java/appeng/api/networking/GridNotification.java b/dependencies/main/java/appeng/api/networking/GridNotification.java deleted file mode 100644 index 0815fc698f..0000000000 --- a/dependencies/main/java/appeng/api/networking/GridNotification.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -public enum GridNotification -{ - /** - * the visible connections for this node have changed, useful for cable. - */ - CONNECTIONS_CHANGED, -} diff --git a/dependencies/main/java/appeng/api/networking/IGrid.java b/dependencies/main/java/appeng/api/networking/IGrid.java deleted file mode 100644 index d06ba8d7ea..0000000000 --- a/dependencies/main/java/appeng/api/networking/IGrid.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -import appeng.api.networking.events.MENetworkEvent; -import appeng.api.util.IReadOnlyCollection; - - -/** - * Gives you access to Grid based information. - * - * Don't Implement. - */ -public interface IGrid -{ - - /** - * Get Access to various grid modules - * - * @param iface face - * - * @return the IGridCache you requested. - */ - C getCache( Class iface ); - - /** - * Post an event into the network event bus. - * - * @param ev - event to post - * - * @return returns ev back to original poster - */ - MENetworkEvent postEvent( MENetworkEvent ev ); - - /** - * Post an event into the network event bus, but direct it at a single node. - * - * @param ev event to post - * - * @return returns ev back to original poster - */ - MENetworkEvent postEventTo( IGridNode node, MENetworkEvent ev ); - - /** - * get a list of the diversity of classes, you can use this to better detect which machines your interested in, - * rather then iterating the entire grid to test them. - * - * @return IReadOnlyCollection of all available host types (Of Type IGridHost). - */ - IReadOnlyCollection> getMachinesClasses(); - - /** - * Get machines on the network. - * - * @param gridHostClass class of the grid host - * - * @return IMachineSet of all nodes belonging to hosts of specified class. - */ - IMachineSet getMachines( Class gridHostClass ); - - /** - * @return IReadOnlyCollection for all nodes on the network, node visitors are preferred. - */ - IReadOnlyCollection getNodes(); - - /** - * @return true if the last node has been removed from the grid. - */ - boolean isEmpty(); - - /** - * @return the node considered the pivot point of the grid. - */ - IGridNode getPivot(); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/networking/IGridBlock.java b/dependencies/main/java/appeng/api/networking/IGridBlock.java deleted file mode 100644 index 87baf84de8..0000000000 --- a/dependencies/main/java/appeng/api/networking/IGridBlock.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -import java.util.EnumSet; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; - -import appeng.api.parts.IPart; -import appeng.api.util.AEColor; -import appeng.api.util.DimensionalCoord; - - -/** - * An Implementation is required to create your node for IGridHost - * - * Implement for use with IGridHost - */ -public interface IGridBlock -{ - - /** - * how much power to drain per tick as part of idle network usage. - * - * if the value of this changes, you must post a MENetworkPowerIdleChange - * - * @return ae/t to use. - */ - double getIdlePowerUsage(); - - /** - * Various flags that AE uses to modify basic behavior for various parts of the network. - * - * @return Set of flags for this IGridBlock - */ - EnumSet getFlags(); - - /** - * generally speaking you will return true for this, the one exception is buses, or worm holes where the node - * represents something that isn't a real connection in the world, but rather one represented internally to the - * block. - * - * @return if the world can connect to this node, and the node can connect to the world. - */ - boolean isWorldAccessible(); - - /** - * @return current location of this node - */ - DimensionalCoord getLocation(); - - /** - * @return Transparent, or a valid color, NULL IS NOT A VALID RETURN - */ - AEColor getGridColor(); - - /** - * Notifies your IGridBlock that changes were made to your connections - */ - void onGridNotification( GridNotification notification ); - - /** - * Update Blocks network/connection/booting status. grid, - * - * @param grid grid - * @param channelsInUse used channels - */ - void setNetworkStatus( IGrid grid, int channelsInUse ); - - /** - * Determine which sides of the block can be connected too, only used when isWorldAccessible returns true, not used - * for {@link IPart} implementations. - */ - EnumSet getConnectableSides(); - - /** - * @return the IGridHost for the node, this will be an IGridPart or a TileEntity generally speaking. - */ - IGridHost getMachine(); - - /** - * called when the grid for the node has changed, the general grid state should not be trusted at this point. - */ - void gridChanged(); - - /** - * Determines what item stack is used to render this node in the GUI. - * - * @return the render item stack to use to render this node, null is valid, and will not show this node. - */ - ItemStack getMachineRepresentation(); -} diff --git a/dependencies/main/java/appeng/api/networking/IGridCache.java b/dependencies/main/java/appeng/api/networking/IGridCache.java deleted file mode 100644 index e692f23722..0000000000 --- a/dependencies/main/java/appeng/api/networking/IGridCache.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -/** - * Allows you to create a network wise service, AE2 uses these for providing - * item, spatial, and tunnel services. - * - * Any Class that implements this, should have a public default constructor that - * takes a single argument of type IGrid. - */ -public interface IGridCache -{ - - /** - * Called each tick for the network, allows you to have active network wide - * behaviors. - */ - void onUpdateTick(); - - /** - * inform your cache, that a machine was removed from the grid. - * - * Important: Do not trust the grids state in this method, interact only - * with the node you are passed, if you need to manage other grid - * information, do it on the next updateTick. - * - * @param gridNode removed from that grid - * @param machine to be removed machine - */ - void removeNode( IGridNode gridNode, IGridHost machine ); - - /** - * informs you cache that a machine was added to the grid. - * - * Important: Do not trust the grids state in this method, interact only - * with the node you are passed, if you need to manage other grid - * information, do it on the next updateTick. - * - * @param gridNode added to grid node - * @param machine to be added machine - */ - void addNode( IGridNode gridNode, IGridHost machine ); - - /** - * Called when a grid splits into two grids, AE will call a split as it - * Iteratively processes changes. The destination should receive half, and - * the current cache should receive half. - * - * @param destinationStorage storage which receives half of old grid - */ - void onSplit( IGridStorage destinationStorage ); - - /** - * Called when two grids merge into one, AE will call a join as it - * Iteratively processes changes. Use this method to incorporate all the - * data from the source into your cache. - * - * @param sourceStorage old storage - */ - void onJoin( IGridStorage sourceStorage ); - - /** - * Called when saving changes, - * - * @param destinationStorage storage - */ - void populateGridStorage( IGridStorage destinationStorage ); -} diff --git a/dependencies/main/java/appeng/api/networking/IGridCacheRegistry.java b/dependencies/main/java/appeng/api/networking/IGridCacheRegistry.java deleted file mode 100644 index b54df8daed..0000000000 --- a/dependencies/main/java/appeng/api/networking/IGridCacheRegistry.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -import java.util.HashMap; - - -/** - * A registry of grid caches to extend grid functionality. - */ -public interface IGridCacheRegistry -{ - - /** - * Register a new grid cache for use during operation, must be called during the loading phase. - * - * @param iface grid cache class - */ - void registerGridCache( Class iface, Class implementation ); - - /** - * requests a new INSTANCE of a grid cache for use, used internally - * - * @param grid grid - * - * @return a new HashMap of IGridCaches from the registry, called from IGrid when constructing a new grid. - */ - HashMap, IGridCache> createCacheInstance( IGrid grid ); -} diff --git a/dependencies/main/java/appeng/api/networking/IGridConnection.java b/dependencies/main/java/appeng/api/networking/IGridConnection.java deleted file mode 100644 index 20cbcbe49c..0000000000 --- a/dependencies/main/java/appeng/api/networking/IGridConnection.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -import appeng.api.util.AEPartLocation; - - -/** - * Access to AE's internal grid connections. - * - * Messing with connection is generally completely unnecessary, you should be able to just use IGridNode.updateState() - * to have AE manage them for you. - * - * Don't Implement. - */ -public interface IGridConnection -{ - - /** - * lets you get the opposing node of the connection by passing your own node. - * - * @param gridNode current grid node - * - * @return the IGridNode which represents the opposite side of the connection. - */ - IGridNode getOtherSide( IGridNode gridNode ); - - /** - * determine the direction of the connection based on your node. - * - * @param gridNode current grid node - * - * @return the direction of the connection, only valid for in world connections. - */ - AEPartLocation getDirection( IGridNode gridNode ); - - /** - * by destroying a connection you may create new grids, and trigger un-expected behavior, you should only destroy - * connections if you created them. - */ - void destroy(); - - /** - * @return node A - */ - IGridNode a(); - - /** - * @return node B - */ - IGridNode b(); - - /** - * @return if the connection is invisible this returns false - */ - boolean hasDirection(); - - /** - * @return how many channels pass over this connections. - */ - int getUsedChannels(); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/networking/IGridConnectionVisitor.java b/dependencies/main/java/appeng/api/networking/IGridConnectionVisitor.java deleted file mode 100644 index 1842589e08..0000000000 --- a/dependencies/main/java/appeng/api/networking/IGridConnectionVisitor.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -public interface IGridConnectionVisitor extends IGridVisitor -{ - - /** - * Called for each connection on the network. - * - * @param n the connection. - */ - void visitConnection( IGridConnection n ); -} diff --git a/dependencies/main/java/appeng/api/networking/IGridHost.java b/dependencies/main/java/appeng/api/networking/IGridHost.java deleted file mode 100644 index bd272c8955..0000000000 --- a/dependencies/main/java/appeng/api/networking/IGridHost.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -import net.minecraft.tileentity.TileEntity; - -import appeng.api.parts.IPart; -import appeng.api.util.AECableType; -import appeng.api.util.AEPartLocation; - - -/** - * Implement to create a networked {@link TileEntity} or {@link IPart} must - * be implemented for a part, or tile entity to become part of a grid. - */ -public interface IGridHost -{ - - /** - * get the grid node for a particular side of a block, you can return null, - * by returning a valid node later and calling updateState, you can join the - * Grid when your block is ready. - * - * @param dir feel free to ignore this, most blocks will use the same node - * for every side. - * - * @return a new IGridNode, create these with - * AEApi.INSTANCE().createGridNode( MyIGridBlock ) - */ - IGridNode getGridNode( AEPartLocation dir ); - - /** - * Determines how cables render when they connect to this block. Priority is - * Smart > Covered > Glass - * - * @param dir direction - */ - AECableType getCableConnectionType( AEPartLocation dir ); - - /** - * break this host, its violating security rules, just break your block, or part. - */ - void securityBreak(); -} diff --git a/dependencies/main/java/appeng/api/networking/IGridMultiblock.java b/dependencies/main/java/appeng/api/networking/IGridMultiblock.java deleted file mode 100644 index 7c3844bb7b..0000000000 --- a/dependencies/main/java/appeng/api/networking/IGridMultiblock.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -import java.util.Iterator; - - -/** - * An extension of IGridBlock, only means something when your getFlags() contains REQUIRE_CHANNEL, when done properly it - * will call the method to get a list of all related nodes and give each of them a channel simultaneously for the entire - * set. This means your entire Multiblock can work with a single channel, instead of one channel per block. - */ -public interface IGridMultiblock extends IGridBlock -{ - - /** - * Used to acquire a list of all nodes that are part of the multiblock. - * - * @return an iterator that will iterate all the nodes for the multiblock. ( read-only iterator expected. ) - */ - Iterator getMultiblockNodes(); -} diff --git a/dependencies/main/java/appeng/api/networking/IGridNode.java b/dependencies/main/java/appeng/api/networking/IGridNode.java deleted file mode 100644 index 667db3876e..0000000000 --- a/dependencies/main/java/appeng/api/networking/IGridNode.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -import java.util.EnumSet; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -import appeng.api.IAppEngApi; -import appeng.api.util.AEPartLocation; -import appeng.api.util.IReadOnlyCollection; - - -/** - * Gives you a view into your Nodes connections and information. - * - * updateState, getGrid, destroy are required to implement a proper IGridHost. - * - * Don't Implement; Acquire from {@link IAppEngApi}.createGridNode - */ -public interface IGridNode -{ - - /** - * lets you walk the grid stating at the current node using a IGridVisitor, generally not needed, please use only if - * required. - * - * @param visitor visitor - */ - void beginVisit( IGridVisitor visitor ); - - /** - * inform the node that your IGridBlock has changed its internal state, and force the node to update. - * - * ALWAYS make sure that your tile entity is in the world, and has its node properly saved to be returned from the - * host before updating state, - * - * If your entity is not in the world, or if you IGridHost returns a different node for the same side you will - * likely crash the game. - */ - void updateState(); - - /** - * get the machine represented by the node. - * - * @return grid host - */ - IGridHost getMachine(); - - /** - * get the grid for the node, this can change at a moments notice. - * - * @return grid - */ - IGrid getGrid(); - - /** - * By destroying your node, you destroy any connections, and its existence in the grid, use in invalidate, or - * onChunkUnload - */ - void destroy(); - - /** - * @return the world the node is located in - */ - World getWorld(); - - /** - * @return a set of the connected sides, INTERNAL represents an invisible connection - */ - EnumSet getConnectedSides(); - - /** - * lets you iterate a nodes connections - * - * @return grid connections - */ - IReadOnlyCollection getConnections(); - - /** - * @return the IGridBlock for this node - */ - IGridBlock getGridBlock(); - - /** - * Reflects the networks status, returns true only if the network is powered, and the network is not booting, this - * also takes into account channels. - * - * @return true if is Network node active, and participating. - */ - boolean isActive(); - - /** - * this should be called for each node you create, if you have a nodeData compound to load from, you can store all - * your nods on a single compound using name. - * - * Important: You must call this before updateState. - * - * @param name nbt name - * @param nodeData to be loaded data - */ - void loadFromNBT( String name, NBTTagCompound nodeData ); - - /** - * this should be called for each node you maintain, you can save all your nodes to the same tag with different - * names, if you fail to complete the load / save procedure, network state may be lost between game load/saves. - * - * @param name nbt name - * @param nodeData to be saved data - */ - void saveToNBT( String name, NBTTagCompound nodeData ); - - /** - * @return if the node's channel requirements are currently met, use this for display purposes, use isActive for - * status. - */ - boolean meetsChannelRequirements(); - - /** - * see if this node has a certain flag - * - * @param flag flags - * - * @return true if has flag - */ - boolean hasFlag( GridFlags flag ); - - /** - * @return the ownerID this represents the person who placed the node. - */ - int getPlayerID(); - - /** - * tell the node who was responsible for placing it, failure to do this may result in in-compatibility with the - * security system. Called instead of loadFromNBT when initially placed, once set never required again, the value is - * saved with the Node NBT. - * - * @param playerID new player id - */ - void setPlayerID( int playerID ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/networking/IGridStorage.java b/dependencies/main/java/appeng/api/networking/IGridStorage.java deleted file mode 100644 index 0f9e9b7b55..0000000000 --- a/dependencies/main/java/appeng/api/networking/IGridStorage.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -import net.minecraft.nbt.NBTTagCompound; - - -public interface IGridStorage -{ - - /** - * @return an NBTTagCompound that can be read, and written too. - */ - NBTTagCompound dataObject(); - - /** - * @return the id for this grid storage object, used internally - */ - long getID(); -} diff --git a/dependencies/main/java/appeng/api/networking/IGridVisitor.java b/dependencies/main/java/appeng/api/networking/IGridVisitor.java deleted file mode 100644 index 41ac4f475b..0000000000 --- a/dependencies/main/java/appeng/api/networking/IGridVisitor.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -/** - * Simple Visitor pattern access to network nodes. - */ -public interface IGridVisitor -{ - - /** - * Called for each node on the network. - * - * By returning false your informing the host to stop visiting nodes beyond the current node. - * - * @param n the current node. - * - * @return true to continue visiting nodes beyond this node. - */ - boolean visitNode( IGridNode n ); -} diff --git a/dependencies/main/java/appeng/api/networking/IMachineSet.java b/dependencies/main/java/appeng/api/networking/IMachineSet.java deleted file mode 100644 index 7d57b52cfe..0000000000 --- a/dependencies/main/java/appeng/api/networking/IMachineSet.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking; - - -import appeng.api.util.IReadOnlyCollection; - - -public interface IMachineSet extends IReadOnlyCollection -{ - - /** - * @return the machine class for this set. - */ - Class getMachineClass(); -} diff --git a/dependencies/main/java/appeng/api/networking/crafting/CraftingItemList.java b/dependencies/main/java/appeng/api/networking/crafting/CraftingItemList.java deleted file mode 100644 index c84c275d72..0000000000 --- a/dependencies/main/java/appeng/api/networking/crafting/CraftingItemList.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.crafting; - - -public enum CraftingItemList -{ - ALL, STORAGE, ACTIVE, PENDING -} diff --git a/dependencies/main/java/appeng/api/networking/crafting/ICraftingCPU.java b/dependencies/main/java/appeng/api/networking/crafting/ICraftingCPU.java deleted file mode 100644 index 5dbc40e87a..0000000000 --- a/dependencies/main/java/appeng/api/networking/crafting/ICraftingCPU.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.crafting; - - -import appeng.api.networking.security.BaseActionSource; -import appeng.api.networking.storage.IBaseMonitor; -import appeng.api.storage.data.IAEItemStack; - - -public interface ICraftingCPU extends IBaseMonitor -{ - - /** - * @return true if the CPU currently has a job. - */ - boolean isBusy(); - - /** - * @return the action source for the CPU. - */ - BaseActionSource getActionSource(); - - /** - * @return the available storage in bytes - */ - long getAvailableStorage(); - - /** - * @return the number of co-processors in the CPU. - */ - int getCoProcessors(); - - /** - * @return an empty string or the name of the cpu. - */ - String getName(); -} diff --git a/dependencies/main/java/appeng/api/networking/crafting/ICraftingCallback.java b/dependencies/main/java/appeng/api/networking/crafting/ICraftingCallback.java deleted file mode 100644 index 096b722600..0000000000 --- a/dependencies/main/java/appeng/api/networking/crafting/ICraftingCallback.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.crafting; - - -public interface ICraftingCallback -{ - - /** - * this call back is synchronized with the world you passed. - * - * @param job - final job - */ - void calculationComplete( ICraftingJob job ); -} diff --git a/dependencies/main/java/appeng/api/networking/crafting/ICraftingGrid.java b/dependencies/main/java/appeng/api/networking/crafting/ICraftingGrid.java deleted file mode 100644 index 7e0cc94ec5..0000000000 --- a/dependencies/main/java/appeng/api/networking/crafting/ICraftingGrid.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.crafting; - - -import java.util.concurrent.Future; - -import com.google.common.collect.ImmutableCollection; -import com.google.common.collect.ImmutableSet; - -import net.minecraft.world.World; - -import appeng.api.networking.IGrid; -import appeng.api.networking.IGridCache; -import appeng.api.networking.security.BaseActionSource; -import appeng.api.storage.data.IAEItemStack; - - -public interface ICraftingGrid extends IGridCache -{ - - /** - * @param whatToCraft requested craft - * @param world crafting world - * @param slot slot index - * @param details pattern details - * - * @return a collection of crafting patterns for the item in question. - */ - ImmutableCollection getCraftingFor( IAEItemStack whatToCraft, ICraftingPatternDetails details, int slot, World world ); - - /** - * Begin calculating a crafting job. - * - * @param world crafting world - * @param grid network - * @param actionSrc source - * @param craftWhat result - * @param callback callback - * -- optional - * - * @return a future which will at an undetermined point in the future get you the {@link ICraftingJob} do not wait - * on this, your be waiting forever. - */ - Future beginCraftingJob( World world, IGrid grid, BaseActionSource actionSrc, IAEItemStack craftWhat, ICraftingCallback callback ); - - /** - * Submit the job to the Crafting system for processing. - * - * @param job - the crafting job from beginCraftingJob - * @param requestingMachine - a machine if its being requested via automation, may be null. - * @param target - can be null - * @param prioritizePower - if cpu is null, this determine if the system should prioritize power, or if it should - * find the lower - * end cpus, automatic processes generally should pick lower end cpus. - * @param src - the action source to use when starting the job, this will be used for extracting items, should - * usually be the same as the one provided to beginCraftingJob. - * - * @return null ( if failed ) or an {@link ICraftingLink} other wise, if you send requestingMachine you need to - * properly keep track of this and handle the nbt saving and loading of the object as well as the - * {@link ICraftingRequester} methods. if you send null, this object should be discarded after verifying the - * return state. - */ - ICraftingLink submitJob( ICraftingJob job, ICraftingRequester requestingMachine, ICraftingCPU target, boolean prioritizePower, BaseActionSource src ); - - /** - * @return list of all the crafting cpus on the grid - */ - ImmutableSet getCpus(); - - /** - * @param what to be requested item - * - * @return true if the item can be requested via a crafting emitter. - */ - boolean canEmitFor( IAEItemStack what ); - - /** - * is this item being crafted? - * - * @param aeStackInSlot item being crafted - * - * @return true if it is being crafting - */ - boolean isRequesting( IAEItemStack aeStackInSlot ); -} diff --git a/dependencies/main/java/appeng/api/networking/crafting/ICraftingJob.java b/dependencies/main/java/appeng/api/networking/crafting/ICraftingJob.java deleted file mode 100644 index 5590123030..0000000000 --- a/dependencies/main/java/appeng/api/networking/crafting/ICraftingJob.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.crafting; - - -import appeng.api.storage.data.IAEItemStack; -import appeng.api.storage.data.IItemList; - - -public interface ICraftingJob -{ - - /** - * @return if this job is a simulation, simulations cannot be submitted and only represent 1 possible future - * crafting job with fake items. - */ - boolean isSimulation(); - - /** - * @return total number of bytes to process this job. - */ - long getByteTotal(); - - /** - * Populates the plan list with stack size, and requestable values that represent the stored, and crafting job - * contents respectively. - * - * @param plan plan - */ - void populatePlan( IItemList plan ); - - /** - * @return the final output of the job. - */ - IAEItemStack getOutput(); -} diff --git a/dependencies/main/java/appeng/api/networking/crafting/ICraftingLink.java b/dependencies/main/java/appeng/api/networking/crafting/ICraftingLink.java deleted file mode 100644 index b397672440..0000000000 --- a/dependencies/main/java/appeng/api/networking/crafting/ICraftingLink.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.crafting; - - -import net.minecraft.nbt.NBTTagCompound; - - -public interface ICraftingLink -{ - - /** - * @return true if the job was canceled. - */ - boolean isCanceled(); - - /** - * @return true if the job was completed. - */ - boolean isDone(); - - /** - * cancels the job. - */ - void cancel(); - - /** - * @return true if this link was generated without a requesting machine, such as a player generated request. - */ - boolean isStandalone(); - - /** - * write the link to an NBT Tag - * - * @param tag to be written data - */ - void writeToNBT( NBTTagCompound tag ); - - /** - * @return the crafting ID for this link. - */ - String getCraftingID(); -} diff --git a/dependencies/main/java/appeng/api/networking/crafting/ICraftingMedium.java b/dependencies/main/java/appeng/api/networking/crafting/ICraftingMedium.java deleted file mode 100644 index 6f1578908e..0000000000 --- a/dependencies/main/java/appeng/api/networking/crafting/ICraftingMedium.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.crafting; - - -import net.minecraft.inventory.InventoryCrafting; - - -/** - * A place to send Items for crafting purposes, this is considered part of AE's External crafting system. - */ -public interface ICraftingMedium -{ - - /** - * instruct a medium to create the item represented by the pattern+details, the items on the table, and where if - * possible the output should be directed. - * - * @param patternDetails details - * @param table crafting table - * - * @return if the pattern was successfully pushed. - */ - boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table ); - - /** - * @return if this is false, the crafting engine will refuse to send new jobs to this medium. - */ - boolean isBusy(); -} diff --git a/dependencies/main/java/appeng/api/networking/crafting/ICraftingPatternDetails.java b/dependencies/main/java/appeng/api/networking/crafting/ICraftingPatternDetails.java deleted file mode 100644 index 5f90e2c01f..0000000000 --- a/dependencies/main/java/appeng/api/networking/crafting/ICraftingPatternDetails.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.crafting; - - -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import appeng.api.implementations.ICraftingPatternItem; -import appeng.api.storage.data.IAEItemStack; - - -/** - * do not implement provided by {@link ICraftingPatternItem} - * - * caching this INSTANCE will increase performance of validation and checks. - */ -public interface ICraftingPatternDetails -{ - - /** - * @return source item. - */ - ItemStack getPattern(); - - /** - * @param slotIndex specific slot index - * @param itemStack item in slot - * @param world crafting world - * - * @return if an item can be used in the specific slot for this pattern. - */ - boolean isValidItemForSlot( int slotIndex, ItemStack itemStack, World world ); - - /** - * @return if this pattern is a crafting pattern ( work bench ) - */ - boolean isCraftable(); - - /** - * @return a list of the inputs, will include nulls. - */ - IAEItemStack[] getInputs(); - - /** - * @return a list of the inputs, will be clean - */ - IAEItemStack[] getCondensedInputs(); - - /** - * @return a list of the outputs, will be clean - */ - IAEItemStack[] getCondensedOutputs(); - - /** - * @return a list of the outputs, will include nulls. - */ - IAEItemStack[] getOutputs(); - - /** - * @return if this pattern is enabled to support substitutions. - */ - boolean canSubstitute(); - - /** - * Allow using this INSTANCE of the pattern details to preform the crafting action with performance enhancements. - * - * @param craftingInv inventory - * @param world crafting world - * - * @return the crafted ( work bench ) item. - */ - ItemStack getOutput( InventoryCrafting craftingInv, World world ); - - /** - * Get the priority of this pattern - * - * @return the priority of this pattern - */ - int getPriority(); - - /** - * Set the priority the of this pattern. - * - * @param priority priority of pattern - */ - void setPriority( int priority ); -} diff --git a/dependencies/main/java/appeng/api/networking/crafting/ICraftingProvider.java b/dependencies/main/java/appeng/api/networking/crafting/ICraftingProvider.java deleted file mode 100644 index 79f89d448e..0000000000 --- a/dependencies/main/java/appeng/api/networking/crafting/ICraftingProvider.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.crafting; - - -import appeng.api.networking.events.MENetworkCraftingPatternChange; - - -/** - * Allows a IGridHost to provide crafting patterns to the network, post a {@link MENetworkCraftingPatternChange} to tell - * AE2 to update. - */ -public interface ICraftingProvider extends ICraftingMedium -{ - - /** - * called when the network is looking for possible crafting jobs. - * - * @param craftingTracker crafting helper - */ - void provideCrafting( ICraftingProviderHelper craftingTracker ); -} diff --git a/dependencies/main/java/appeng/api/networking/crafting/ICraftingProviderHelper.java b/dependencies/main/java/appeng/api/networking/crafting/ICraftingProviderHelper.java deleted file mode 100644 index ba666de9bb..0000000000 --- a/dependencies/main/java/appeng/api/networking/crafting/ICraftingProviderHelper.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.crafting; - - -import appeng.api.storage.data.IAEItemStack; - - -/** - * Passed to a ICraftingProvider as a interface to manipulate the available crafting jobs. - */ -public interface ICraftingProviderHelper -{ - - /** - * Add new Pattern to AE's crafting cache. - */ - void addCraftingOption( ICraftingMedium medium, ICraftingPatternDetails api ); - - /** - * Set an item can Emitable - */ - void setEmitable( IAEItemStack what ); -} diff --git a/dependencies/main/java/appeng/api/networking/crafting/ICraftingRequester.java b/dependencies/main/java/appeng/api/networking/crafting/ICraftingRequester.java deleted file mode 100644 index e1684a1242..0000000000 --- a/dependencies/main/java/appeng/api/networking/crafting/ICraftingRequester.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.crafting; - - -import com.google.common.collect.ImmutableSet; - -import appeng.api.config.Actionable; -import appeng.api.networking.security.IActionHost; -import appeng.api.storage.data.IAEItemStack; - - -public interface ICraftingRequester extends IActionHost -{ - - /** - * called when the host is added to the grid, and should return all crafting links it poses so they can be connected - * with the cpu that hosts the job. - * - * @return set of jobs, or an empty list. - */ - ImmutableSet getRequestedJobs(); - - /** - * items are injected into the requester as they are completed, any items that cannot be taken, or are unwanted can - * be returned. - * - * @param items item - * @param mode action mode - * - * @return unwanted item - */ - IAEItemStack injectCraftedItems( ICraftingLink link, IAEItemStack items, Actionable mode ); - - /** - * called when the job changes from in progress, to either complete, or canceled. - * - * after this call the crafting link is "dead" and should be discarded. - */ - void jobStateChange( ICraftingLink link ); -} diff --git a/dependencies/main/java/appeng/api/networking/crafting/ICraftingWatcher.java b/dependencies/main/java/appeng/api/networking/crafting/ICraftingWatcher.java deleted file mode 100644 index 0f32147fed..0000000000 --- a/dependencies/main/java/appeng/api/networking/crafting/ICraftingWatcher.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.crafting; - - -import appeng.api.storage.data.IAEStack; - - -/** - * DO NOT IMPLEMENT. - * - * Will be injected when adding an {@link ICraftingWatcherHost} to a grid. - */ -public interface ICraftingWatcher -{ - /** - * Add a specific {@link IAEStack} to watch. - * - * Supports multiple values, duplicate ones will not be added. - * - * @param stack - * @return true, if successfully added. - */ - boolean add( IAEStack stack ); - - /** - * Remove a specific {@link IAEStack} from the watcher. - * - * @param stack - * @return true, if successfully removed. - */ - boolean remove( IAEStack stack ); - - /** - * Removes all watched stacks and resets the watcher to a clean state. - */ - void reset(); -} diff --git a/dependencies/main/java/appeng/api/networking/crafting/ICraftingWatcherHost.java b/dependencies/main/java/appeng/api/networking/crafting/ICraftingWatcherHost.java deleted file mode 100644 index a18f4aa915..0000000000 --- a/dependencies/main/java/appeng/api/networking/crafting/ICraftingWatcherHost.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.crafting; - - -import appeng.api.storage.data.IAEItemStack; - - -public interface ICraftingWatcherHost -{ - - /** - * provides the ICraftingWatcher for this host, for the current network, is called when the hot changes networks. - * You do not need to clear your old watcher, its already been removed by the time this gets called. - * - * @param newWatcher crafting watcher for this host - */ - void updateWatcher( ICraftingWatcher newWatcher ); - - /** - * Called when a crafting status changes. - * - * @param craftingGrid current crafting grid - * @param what change - */ - void onRequestChange( ICraftingGrid craftingGrid, IAEItemStack what ); -} diff --git a/dependencies/main/java/appeng/api/networking/energy/IAEPowerStorage.java b/dependencies/main/java/appeng/api/networking/energy/IAEPowerStorage.java deleted file mode 100644 index 7cb1ac10ff..0000000000 --- a/dependencies/main/java/appeng/api/networking/energy/IAEPowerStorage.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.energy; - - -import appeng.api.config.AccessRestriction; -import appeng.api.config.Actionable; - - -/** - * Used to access information about AE's various power accepting blocks for monitoring purposes. - */ -public interface IAEPowerStorage extends IEnergySource -{ - - /** - * Inject amt, power into the device, it will store what it can, and return the amount unable to be stored. - * - * @param amt to be injected amount - * @param mode action mode - * - * @return amount of power which was unable to be stored - */ - double injectAEPower( double amt, Actionable mode ); - - /** - * @return the current maximum power ( this can change :P ) - */ - double getAEMaxPower(); - - /** - * @return the current AE Power Level, this may exceed getMEMaxPower() - */ - double getAECurrentPower(); - - /** - * Checked on network reset to see if your block can be used as a public power storage ( use getPowerFlow to control - * the behavior ) - * - * @return true if it can be used as a public power storage - */ - boolean isAEPublicPowerStorage(); - - /** - * Control the power flow by telling what the network can do, either add? or subtract? or both! - * - * @return access restriction what the network can do - */ - AccessRestriction getPowerFlow(); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/networking/energy/IEnergyGrid.java b/dependencies/main/java/appeng/api/networking/energy/IEnergyGrid.java deleted file mode 100644 index 666b353214..0000000000 --- a/dependencies/main/java/appeng/api/networking/energy/IEnergyGrid.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.energy; - - -import appeng.api.config.Actionable; -import appeng.api.networking.IGridCache; -import appeng.api.networking.events.MENetworkPowerStatusChange; - - -/** - * AE's Power system. - */ -public interface IEnergyGrid extends IGridCache, IEnergySource, IEnergyGridProvider -{ - - /** - * @return the current calculated idle energy drain each tick, is used internally to drain power for each tick. - */ - double getIdlePowerUsage(); - - /** - * @return the average power drain over the past 10 ticks, includes idle usage during this time, and all use of - * extractPower. - */ - double getAvgPowerUsage(); - - /** - * @return the average energy injected into the system per tick, for the last 10 ticks. - */ - double getAvgPowerInjection(); - - /** - * AE maintains an idle draw of power separate from active power draw, it condenses this into a single operation - * that determines the networks "powered state" if the network is considered off-line, your machines should not - * function. - * - * {@link MENetworkPowerStatusChange} events are posted when this value changes if you need to be notified of the - * change, most machines can simply test the value when they operate. - * - * @return if the network is powered or not. - */ - boolean isNetworkPowered(); - - /** - * AE will accept any power, and store it, to maintain sanity please don't send more then 10,000 at a time. - * - * IMPORTANT: Network power knows no bounds, for less spamy power flow, networks can store more then their allotted - * storage, however, it should be kept to a minimum, to help with this, this method returns the networks current - * OVERFLOW, this is not energy you can store some where else, its already stored in the network, you can extract it - * if you want, however it it owned by the network, this is different then IAEEnergyStore - * - * Another important note, is that if a network that had overflow is deleted, its power is gone, this is one of the - * reasons why keeping overflow to a minimum is important. - * - * @param amt power to inject into the network - * @param mode should the action be simulated or performed? - * - * @return the amount of power that the network has OVER the limit. - */ - double injectPower( double amt, Actionable mode ); - - /** - * this is should be considered an estimate, and not relied upon for real calculations. - * - * @return estimated available power. - */ - double getStoredPower(); - - /** - * this is should be considered an estimate, and not relied upon for real calculations. - * - * @return estimated available power. - */ - double getMaxStoredPower(); - - /** - * Calculation will be capped at maxRequired, this improves performance by limiting the number of nodes needed to - * calculate the demand. - * - * @return Amount of power required to charge the grid, in AE. - */ - double getEnergyDemand( double maxRequired ); -} diff --git a/dependencies/main/java/appeng/api/networking/energy/IEnergyGridProvider.java b/dependencies/main/java/appeng/api/networking/energy/IEnergyGridProvider.java deleted file mode 100644 index b24af8e326..0000000000 --- a/dependencies/main/java/appeng/api/networking/energy/IEnergyGridProvider.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.energy; - - -import java.util.Set; - -import appeng.api.config.Actionable; - - -/** - * internal use only. - */ -public interface IEnergyGridProvider -{ - /** - * internal use only - */ - double extractAEPower( double amt, Actionable mode, Set seen ); - - /** - * internal use only - */ - double injectAEPower( double amt, Actionable mode, Set seen ); - - /** - * internal use only - */ - double getEnergyDemand( double d, Set seen ); -} diff --git a/dependencies/main/java/appeng/api/networking/energy/IEnergySource.java b/dependencies/main/java/appeng/api/networking/energy/IEnergySource.java deleted file mode 100644 index b1185dfa2f..0000000000 --- a/dependencies/main/java/appeng/api/networking/energy/IEnergySource.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.energy; - - -import appeng.api.config.Actionable; -import appeng.api.config.PowerMultiplier; - - -public interface IEnergySource -{ - - /** - * Extract power from the network. - * - * @param amt extracted power - * @param mode should the action be simulated or performed? - * - * @return returns extracted power. - */ - double extractAEPower( double amt, Actionable mode, PowerMultiplier usePowerMultiplier ); -} diff --git a/dependencies/main/java/appeng/api/networking/energy/IEnergyWatcher.java b/dependencies/main/java/appeng/api/networking/energy/IEnergyWatcher.java deleted file mode 100644 index 2744940178..0000000000 --- a/dependencies/main/java/appeng/api/networking/energy/IEnergyWatcher.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.energy; - - -/** - * DO NOT IMPLEMENT. - * - * Will be injected when adding an {@link IEnergyWatcherHost} to a grid. - */ -public interface IEnergyWatcher -{ - /** - * Add a specific threshold to watch. - * - * Supports multiple values, duplicate ones will not be added. - * - * @param amount - * @return true, if successfully added. - */ - boolean add( double amount ); - - /** - * Remove a specific threshold from the watcher. - * - * @param amount - * @return true, if successfully removed. - */ - boolean remove( double amount ); - - /** - * Removes all thresholds and resets the watcher to a clean state. - */ - void reset(); - -} diff --git a/dependencies/main/java/appeng/api/networking/energy/IEnergyWatcherHost.java b/dependencies/main/java/appeng/api/networking/energy/IEnergyWatcherHost.java deleted file mode 100644 index 5f5237f0de..0000000000 --- a/dependencies/main/java/appeng/api/networking/energy/IEnergyWatcherHost.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.energy; - - -public interface IEnergyWatcherHost -{ - - /** - * provides the IEnergyWatcher for this host, for the current network, is called when the hot changes networks. You - * do not need to clear your old watcher, its already been removed by the time this gets called. - * - * @param newWatcher new watcher - */ - void updateWatcher( IEnergyWatcher newWatcher ); - - /** - * Called when a threshold is crossed. - * - * @param energyGrid grid - */ - void onThresholdPass( IEnergyGrid energyGrid ); -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkBootingStatusChange.java b/dependencies/main/java/appeng/api/networking/events/MENetworkBootingStatusChange.java deleted file mode 100644 index febd98024b..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkBootingStatusChange.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -import appeng.api.networking.IGridNode; - - -/** - * Posted by the network when the booting status of the network goes up - * or down, the change is reflected via {@link IGridNode}.isActive() - * - * Note: Most machines just need to check {@link IGridNode}.isActive() - */ -public class MENetworkBootingStatusChange extends MENetworkEvent -{ - -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkCellArrayUpdate.java b/dependencies/main/java/appeng/api/networking/events/MENetworkCellArrayUpdate.java deleted file mode 100644 index 42cb405f0e..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkCellArrayUpdate.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -/** - * Posted by storage devices to inform AE to refresh its storage structure. - * - * This is done in cases such as a storage cell being removed or added to a - * drive. - * - * you do not need to send this event when your node is added / removed from the - * grid. - */ -public class MENetworkCellArrayUpdate extends MENetworkEvent -{ - -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkChannelChanged.java b/dependencies/main/java/appeng/api/networking/events/MENetworkChannelChanged.java deleted file mode 100644 index b866311415..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkChannelChanged.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -import appeng.api.networking.IGridNode; - - -/** - * Posted by storage devices to inform AE the channel cache that the included node has changed its mind about its - * channel requirements. - */ -public class MENetworkChannelChanged extends MENetworkEvent -{ - - public final IGridNode node; - - public MENetworkChannelChanged( final IGridNode n ) - { - this.node = n; - } -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkChannelsChanged.java b/dependencies/main/java/appeng/api/networking/events/MENetworkChannelsChanged.java deleted file mode 100644 index cb2566f445..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkChannelsChanged.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -import appeng.api.networking.IGridHost; - - -/** - * Posted to the {@link IGridHost} when the channels on the node connections are altered. - * - * Never posted IGridCaches. - */ -public class MENetworkChannelsChanged extends MENetworkEvent -{ - -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkControllerChange.java b/dependencies/main/java/appeng/api/networking/events/MENetworkControllerChange.java deleted file mode 100644 index 040a3d4aa5..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkControllerChange.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -/** - * Event posted when the networks controller state changes, this can be from no - * controller to 1 controller, or any time the network changes from conflicted - * to not conflicted. - */ -public class MENetworkControllerChange extends MENetworkEvent -{ - -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java b/dependencies/main/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java deleted file mode 100644 index 4a92e28cf9..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -import appeng.api.networking.IGridNode; - - -public class MENetworkCraftingCpuChange extends MENetworkEvent -{ - - public final IGridNode node; - - public MENetworkCraftingCpuChange( final IGridNode n ) - { - this.node = n; - } -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java b/dependencies/main/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java deleted file mode 100644 index 77b6a2e33a..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -import appeng.api.networking.IGridNode; -import appeng.api.networking.crafting.ICraftingProvider; - - -public class MENetworkCraftingPatternChange extends MENetworkEvent -{ - - public final ICraftingProvider provider; - public final IGridNode node; - - public MENetworkCraftingPatternChange( final ICraftingProvider p, final IGridNode n ) - { - this.provider = p; - this.node = n; - } -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkEvent.java b/dependencies/main/java/appeng/api/networking/events/MENetworkEvent.java deleted file mode 100644 index 4c50e59de4..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkEvent.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -import appeng.api.networking.IGrid; - - -/** - * Part of AE's Event Bus. - * - * Posted via {@link IGrid}.postEvent or {@link IGrid}.postEventTo - */ -public class MENetworkEvent -{ - - private int visited = 0; - private boolean canceled = false; - - /** - * Call to prevent AE from posting the event to any further objects. - */ - public void cancel() - { - this.canceled = true; - } - - /** - * called by AE after each object is called to cancel any future calls. - * - * @return true to cancel future calls - */ - public boolean isCanceled() - { - return this.canceled; - } - - /** - * the number of objects that were visited by the event. - * - * @return number of visitors - */ - public int getVisitedObjects() - { - return this.visited; - } - - /** - * Called by AE after iterating the event subscribers. - * - * @param v current number of visitors - */ - public void setVisitedObjects( final int v ) - { - this.visited = v; - } -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkEventSubscribe.java b/dependencies/main/java/appeng/api/networking/events/MENetworkEventSubscribe.java deleted file mode 100644 index 198f5306fa..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkEventSubscribe.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -import appeng.api.networking.IGridCache; -import appeng.api.networking.IGridHost; - - -/** - * Usable on any {@link IGridHost}, or {@link IGridCache} - */ -@Retention( RetentionPolicy.RUNTIME ) -public @interface MENetworkEventSubscribe -{ - -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkPostCacheConstruction.java b/dependencies/main/java/appeng/api/networking/events/MENetworkPostCacheConstruction.java deleted file mode 100644 index 1fddaa8aed..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkPostCacheConstruction.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -/** - * Posted after all the caches are available, but before the grid is fully - * constructed, can be used to perform cross cache construction processes. - */ -public class MENetworkPostCacheConstruction extends MENetworkEvent -{ - -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkPowerIdleChange.java b/dependencies/main/java/appeng/api/networking/events/MENetworkPowerIdleChange.java deleted file mode 100644 index a9000064d7..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkPowerIdleChange.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -import appeng.api.networking.IGridNode; - - -/** - * Implementers of a IGridBlock must post this event when your getIdlePowerUsage - * starts returning a new value, if you do not post this event the network will - * not change the idle draw. - * - * you do not need to send this event when your node is added / removed from the grid. - */ -public class MENetworkPowerIdleChange extends MENetworkEvent -{ - - public final IGridNode node; - - public MENetworkPowerIdleChange( final IGridNode nodeThatChanged ) - { - this.node = nodeThatChanged; - } -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkPowerStatusChange.java b/dependencies/main/java/appeng/api/networking/events/MENetworkPowerStatusChange.java deleted file mode 100644 index b60bdfe593..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkPowerStatusChange.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -import appeng.api.networking.IGridNode; -import appeng.api.networking.energy.IEnergyGrid; - - -/** - * Posted by the network when the power status of the network goes up or down, - * the change is reflected via the {@link IEnergyGrid}.isNetworkPowered() or via {@link IGridNode}.isActive() - * - * Note: Most machines just need to check {@link IGridNode}.isActive() - */ -public class MENetworkPowerStatusChange extends MENetworkEvent -{ - -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkPowerStorage.java b/dependencies/main/java/appeng/api/networking/events/MENetworkPowerStorage.java deleted file mode 100644 index 0afde8d821..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkPowerStorage.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -import appeng.api.networking.energy.IAEPowerStorage; - - -/** - * informs the network, that a {@link IAEPowerStorage} block that had either run, - * out of power, or was full, is no longer in that state. - * - * failure to post this event when your {@link IAEPowerStorage} changes state will - * result in your block not charging, or not-discharging. - * - * you do not need to send this event when your node is added / removed from the grid. - */ -public class MENetworkPowerStorage extends MENetworkEvent -{ - - public final IAEPowerStorage storage; - public final PowerEventType type; - - public MENetworkPowerStorage( final IAEPowerStorage t, final PowerEventType y ) - { - this.storage = t; - this.type = y; - } - - public enum PowerEventType - { - /** - * informs the network this tile is ready to receive power again. - */ - REQUEST_POWER, - - /** - * informs the network this tile is ready to provide power again. - */ - PROVIDE_POWER - } -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkSecurityChange.java b/dependencies/main/java/appeng/api/networking/events/MENetworkSecurityChange.java deleted file mode 100644 index 968d84752f..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkSecurityChange.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -/** - * Posted by the security framework when permissions change - */ -public class MENetworkSecurityChange extends MENetworkEvent -{ - -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkSpatialEvent.java b/dependencies/main/java/appeng/api/networking/events/MENetworkSpatialEvent.java deleted file mode 100644 index 20cfc11779..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkSpatialEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -import appeng.api.networking.IGridHost; - - -/** - * An event that is posted whenever a spatial IO is active, called for IGridCache - */ -public class MENetworkSpatialEvent extends MENetworkEvent -{ - public final IGridHost host; - public final double spatialEnergyUsage; - - /** - * @param SpatialIO ( INSTANCE of the SpatialIO block ) - * @param EnergyUsage ( the amount of energy that the SpatialIO uses) - */ - public MENetworkSpatialEvent( final IGridHost SpatialIO, final double EnergyUsage ) - { - this.host = SpatialIO; - this.spatialEnergyUsage = EnergyUsage; - } -} diff --git a/dependencies/main/java/appeng/api/networking/events/MENetworkStorageEvent.java b/dependencies/main/java/appeng/api/networking/events/MENetworkStorageEvent.java deleted file mode 100644 index 60f159c533..0000000000 --- a/dependencies/main/java/appeng/api/networking/events/MENetworkStorageEvent.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.events; - - -import appeng.api.storage.IMEMonitor; -import appeng.api.storage.StorageChannel; - - -/** - * posted by the network when the networks Storage Changes, you can use the currentItems list to check levels, and - * update status. - * - * this is the least useful method of getting info about changes in the network. - * - * Do not modify the list or its contents in anyway. - */ -public class MENetworkStorageEvent extends MENetworkEvent -{ - - public final IMEMonitor monitor; - public final StorageChannel channel; - - public MENetworkStorageEvent( final IMEMonitor o, final StorageChannel chan ) - { - this.monitor = o; - this.channel = chan; - } -} diff --git a/dependencies/main/java/appeng/api/networking/pathing/ControllerState.java b/dependencies/main/java/appeng/api/networking/pathing/ControllerState.java deleted file mode 100644 index 0bb0e5e1a8..0000000000 --- a/dependencies/main/java/appeng/api/networking/pathing/ControllerState.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.pathing; - - -public enum ControllerState -{ - /** - * No controller blocks are present in the network. - */ - NO_CONTROLLER, - - /** - * Controller rules followed, booting enabled. - */ - CONTROLLER_ONLINE, - - /** - * Controller rules not followed, lock up while booting. - */ - CONTROLLER_CONFLICT -} diff --git a/dependencies/main/java/appeng/api/networking/pathing/IPathingGrid.java b/dependencies/main/java/appeng/api/networking/pathing/IPathingGrid.java deleted file mode 100644 index f9a592eee4..0000000000 --- a/dependencies/main/java/appeng/api/networking/pathing/IPathingGrid.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.pathing; - - -import appeng.api.networking.IGridCache; - - -public interface IPathingGrid extends IGridCache -{ - - /** - * @return true if the network is in its booting stage - */ - boolean isNetworkBooting(); - - /** - * @return the controller state of the network, useful if you want to - * require a controller for a feature. - */ - ControllerState getControllerState(); - - /** - * trigger a network reset, booting, path-finding and all. - */ - void repath(); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/networking/security/BaseActionSource.java b/dependencies/main/java/appeng/api/networking/security/BaseActionSource.java deleted file mode 100644 index 1a7b6e79a1..0000000000 --- a/dependencies/main/java/appeng/api/networking/security/BaseActionSource.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.security; - -/** - * TODO: Consider refactoring. - */ -public class BaseActionSource -{ - - public boolean isPlayer() - { - return false; - } - - public boolean isMachine() - { - return false; - } -} diff --git a/dependencies/main/java/appeng/api/networking/security/IActionHost.java b/dependencies/main/java/appeng/api/networking/security/IActionHost.java deleted file mode 100644 index 90c056d808..0000000000 --- a/dependencies/main/java/appeng/api/networking/security/IActionHost.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.security; - - -import appeng.api.networking.IGridHost; -import appeng.api.networking.IGridNode; - - -public interface IActionHost extends IGridHost -{ - - /** - * Used to for calculating security rules, you must supply a node from your - * IGridHost for the security test, this should be the primary node for the - * machine, unless the action is preformed by a non primary node. - * - * @return the the gridnode that actions from this IGridHost are preformed - * by. - */ - IGridNode getActionableNode(); -} diff --git a/dependencies/main/java/appeng/api/networking/security/ISecurityGrid.java b/dependencies/main/java/appeng/api/networking/security/ISecurityGrid.java deleted file mode 100644 index 9dd0ad09a4..0000000000 --- a/dependencies/main/java/appeng/api/networking/security/ISecurityGrid.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.security; - - -import net.minecraft.entity.player.EntityPlayer; - -import appeng.api.config.SecurityPermissions; -import appeng.api.networking.IGridCache; - - -public interface ISecurityGrid extends IGridCache -{ - - /** - * @return true if a security provider is in the network ( and only 1 ) - */ - boolean isAvailable(); - - /** - * Check if a player has permissions. - * - * @param player to be checked player - * @param perm checked permissions - * - * @return true if the player has permissions. - */ - boolean hasPermission( EntityPlayer player, SecurityPermissions perm ); - - /** - * Check if a player has permissions. - * - * @param playerID id of player - * @param perm checked permissions - * - * @return true if the player has permissions. - */ - boolean hasPermission( int playerID, SecurityPermissions perm ); - - /** - * @return PlayerID of the admin, or owner, this is the person who placed the security block. - */ - int getOwner(); -} diff --git a/dependencies/main/java/appeng/api/networking/security/ISecurityProvider.java b/dependencies/main/java/appeng/api/networking/security/ISecurityProvider.java deleted file mode 100644 index 049d2e6403..0000000000 --- a/dependencies/main/java/appeng/api/networking/security/ISecurityProvider.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.security; - - -import java.util.EnumSet; -import java.util.HashMap; - -import appeng.api.config.SecurityPermissions; - - -/** - * Implemented on Security Terminal to interface with security cache. - */ -public interface ISecurityProvider -{ - - /** - * used to represent the security key for the network, should be based on a unique timestamp. - * - * @return unique key. - */ - long getSecurityKey(); - - /** - * Push permission data into security cache. - * - * @param playerPerms player permissions - */ - void readPermissions( HashMap> playerPerms ); - - /** - * @return is security on or off? - */ - boolean isSecurityEnabled(); - - /** - * @return player ID for who placed the security provider. - */ - int getOwner(); -} diff --git a/dependencies/main/java/appeng/api/networking/security/ISecurityRegistry.java b/dependencies/main/java/appeng/api/networking/security/ISecurityRegistry.java deleted file mode 100644 index 77ed8df331..0000000000 --- a/dependencies/main/java/appeng/api/networking/security/ISecurityRegistry.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.security; - - -import java.util.EnumSet; - -import appeng.api.config.SecurityPermissions; - - -/** - * Used by vanilla Security Terminal to post biometric data into the security cache. - */ -public interface ISecurityRegistry -{ - - /** - * Submit Permissions into the register. - * - * @param playerID player id - * @param permissions permissions of player - */ - void addPlayer( int playerID, EnumSet permissions ); -} diff --git a/dependencies/main/java/appeng/api/networking/security/MachineSource.java b/dependencies/main/java/appeng/api/networking/security/MachineSource.java deleted file mode 100644 index 7a6924eeba..0000000000 --- a/dependencies/main/java/appeng/api/networking/security/MachineSource.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.security; - -/** - * TODO: Consider refactoring. - */ -public class MachineSource extends BaseActionSource -{ - - public final IActionHost via; - - public MachineSource( final IActionHost v ) - { - this.via = v; - } - - @Override - public boolean isMachine() - { - return true; - } -} diff --git a/dependencies/main/java/appeng/api/networking/security/PlayerSource.java b/dependencies/main/java/appeng/api/networking/security/PlayerSource.java deleted file mode 100644 index 76e047e698..0000000000 --- a/dependencies/main/java/appeng/api/networking/security/PlayerSource.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.security; - - -import net.minecraft.entity.player.EntityPlayer; - -/** - * TODO: Consider refactoring. - */ -public class PlayerSource extends BaseActionSource -{ - - public final EntityPlayer player; - public final IActionHost via; - - public PlayerSource( final EntityPlayer p, final IActionHost v ) - { - this.player = p; - this.via = v; - } - - @Override - public boolean isPlayer() - { - return true; - } -} diff --git a/dependencies/main/java/appeng/api/networking/spatial/ISpatialCache.java b/dependencies/main/java/appeng/api/networking/spatial/ISpatialCache.java deleted file mode 100644 index 68259ad166..0000000000 --- a/dependencies/main/java/appeng/api/networking/spatial/ISpatialCache.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.spatial; - - -import appeng.api.networking.IGridCache; -import appeng.api.util.DimensionalCoord; - - -public interface ISpatialCache extends IGridCache -{ - - /** - * @return true if a region is defined at all, it doesn't have to be valid, but all points must be in the same - * world. - */ - boolean hasRegion(); - - /** - * @return true if the region defined is valid according to all rules. - */ - boolean isValidRegion(); - - /** - * @return the minimum anchor point for the spatial region. - */ - DimensionalCoord getMin(); - - /** - * @return the maximum anchor point for the spatial region. - */ - DimensionalCoord getMax(); - - /** - * @return how many AE units are required to preform the activation - */ - long requiredPower(); - - /** - * @return current 100% - 0% efficiency. - */ - float currentEfficiency(); -} diff --git a/dependencies/main/java/appeng/api/networking/storage/IBaseMonitor.java b/dependencies/main/java/appeng/api/networking/storage/IBaseMonitor.java deleted file mode 100644 index 2d906ee329..0000000000 --- a/dependencies/main/java/appeng/api/networking/storage/IBaseMonitor.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.storage; - - -import appeng.api.storage.IMEMonitorHandlerReceiver; -import appeng.api.storage.data.IAEStack; - - -public interface IBaseMonitor -{ - - /** - * add a new Listener to the monitor, be sure to properly remove yourself when your done. - */ - void addListener( IMEMonitorHandlerReceiver l, Object verificationToken ); - - /** - * remove a Listener to the monitor. - */ - void removeListener( IMEMonitorHandlerReceiver l ); -} diff --git a/dependencies/main/java/appeng/api/networking/storage/IStackWatcher.java b/dependencies/main/java/appeng/api/networking/storage/IStackWatcher.java deleted file mode 100644 index c734eb78de..0000000000 --- a/dependencies/main/java/appeng/api/networking/storage/IStackWatcher.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.storage; - - -import appeng.api.storage.data.IAEStack; - - -/** - * DO NOT IMPLEMENT. - * - * Will be injected when adding an {@link IStackWatcherHost} to a grid. - */ -public interface IStackWatcher -{ - /** - * Add a specific {@link IAEStack} to watch. - * - * Supports multiple values, duplicate ones will not be added. - * - * @param stack - * @return true, if successfully added. - */ - boolean add( IAEStack stack ); - - /** - * Remove a specific {@link IAEStack} from the watcher. - * - * @param stack - * @return true, if successfully removed. - */ - boolean remove( IAEStack stack ); - - /** - * Removes all watched stacks and resets the watcher to a clean state. - */ - void reset(); -} diff --git a/dependencies/main/java/appeng/api/networking/storage/IStackWatcherHost.java b/dependencies/main/java/appeng/api/networking/storage/IStackWatcherHost.java deleted file mode 100644 index ca411821fc..0000000000 --- a/dependencies/main/java/appeng/api/networking/storage/IStackWatcherHost.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.storage; - - -import appeng.api.networking.security.BaseActionSource; -import appeng.api.storage.StorageChannel; -import appeng.api.storage.data.IAEStack; -import appeng.api.storage.data.IItemList; - - -public interface IStackWatcherHost -{ - - /** - * provides the IStackWatcher for this host, for the current network, is called when the hot changes networks. You - * do not need to clear your old watcher, its already been removed by the time this gets called. - * - * @param newWatcher stack watcher - */ - void updateWatcher( IStackWatcher newWatcher ); - - /** - * Called when a watched item changes amounts. - * - * @param o changed item list - * @param fullStack old stack - * @param diffStack new stack - * @param src action source - * @param chan storage channel - */ - void onStackChange( IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan ); -} diff --git a/dependencies/main/java/appeng/api/networking/storage/IStorageGrid.java b/dependencies/main/java/appeng/api/networking/storage/IStorageGrid.java deleted file mode 100644 index 31e8277f04..0000000000 --- a/dependencies/main/java/appeng/api/networking/storage/IStorageGrid.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.storage; - - -import appeng.api.networking.IGridCache; -import appeng.api.networking.IGridHost; -import appeng.api.networking.security.BaseActionSource; -import appeng.api.storage.ICellContainer; -import appeng.api.storage.ICellProvider; -import appeng.api.storage.IStorageMonitorable; -import appeng.api.storage.StorageChannel; -import appeng.api.storage.data.IAEStack; - - -/** - * Common base class for item / fluid storage caches. - */ -public interface IStorageGrid extends IGridCache, IStorageMonitorable -{ - - /** - * Used to inform the network of alterations to the storage system that fall outside of the standard Network - * operations, Examples, ME Chest inputs from the world, or a Storage Bus detecting modifications made to the chest - * by an outside force. - * - * Expects the input to have either a negative or a positive stack size to correspond to the injection, or - * extraction operation. - * - * @param input injected items - */ - void postAlterationOfStoredItems( StorageChannel chan, Iterable input, BaseActionSource src ); - - /** - * Used to add a cell provider to the storage system - * - * THIS IT NOT FOR USE {@link IGridHost} THAT PROVIDE {@link ICellContainer} - those are automatically handled by - * the storage system. - * - * @param cc to be added cell provider - */ - void registerCellProvider( ICellProvider cc ); - - /** - * remove a provider added with addCellContainer - */ - void unregisterCellProvider( ICellProvider cc ); -} diff --git a/dependencies/main/java/appeng/api/networking/ticking/IGridTickable.java b/dependencies/main/java/appeng/api/networking/ticking/IGridTickable.java deleted file mode 100644 index c5d1035093..0000000000 --- a/dependencies/main/java/appeng/api/networking/ticking/IGridTickable.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.ticking; - - -import appeng.api.networking.IGridNode; - - -/** - * Implement on IGridHosts which want to use AE's Network Ticking Feature. - */ -public interface IGridTickable -{ - - /** - * Important note regarding IGridTickables with more then one one node, - * - * If your IGridHost hosts multiple nodes, it may be on multiple grids, or - * its node may be present on the same grid multiple times, this is as - * designed, however if you choose to use the grid to tick these Hosts you - * must be aware that they they should probably pick a single node to tick - * for, and not tick for each node. - * - */ - - /** - * You can return null, if you wish to tick using MC's ticking mechanism, or - * you can return a valid TickingRequest to tell AE a guide for which type - * of responsiveness your device wants. - * - * this will be called for your tile any time your tile changes grids, this - * can happen at any time, so if your using the sleep feature you may wish - * to preserve your sleep, in the result of this method. or you can simply - * reset it. - * - * @return null or a valid new TickingRequest - */ - TickingRequest getTickingRequest( IGridNode node ); - - /** - * AE lets you adjust your tick rate based on the results of your tick, if - * your block as accomplished work you may wish to increase the ticking - * speed, if your block is idle you may wish to slow it down. - * - * Its up to you. - * - * Note: this is never called if you return null from getTickingRequest. - * - * @param TicksSinceLastCall the number of world ticks that were skipped since your last - * tick, you can use this to adjust speed of processing or adjust - * your tick rate. - * - * @return tick rate adjustment. - */ - TickRateModulation tickingRequest( IGridNode node, int TicksSinceLastCall ); -} diff --git a/dependencies/main/java/appeng/api/networking/ticking/ITickManager.java b/dependencies/main/java/appeng/api/networking/ticking/ITickManager.java deleted file mode 100644 index 6c5d7de829..0000000000 --- a/dependencies/main/java/appeng/api/networking/ticking/ITickManager.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.ticking; - - -import appeng.api.networking.IGridCache; -import appeng.api.networking.IGridNode; - - -/** - * The network tick manager. - */ -public interface ITickManager extends IGridCache -{ - - /** - * immediately sets the node to tick, only valid if your node is marked as "Alertable" in its TickingRequest - * - * Sleeping Devices Still Alertable, when your tile is alerted its new status is determined by the result of its - * tick. - * - * @param node gridnode - */ - boolean alertDevice( IGridNode node ); - - /** - * disables ticking for your device. - * - * @param node gridnode - * - * @return if the call was successful. - */ - boolean sleepDevice( IGridNode node ); - - /** - * enables ticking for your device, undoes a sleepDevice call. - * - * @param node gridnode - * - * @return if the call was successful. - */ - boolean wakeDevice( IGridNode node ); -} diff --git a/dependencies/main/java/appeng/api/networking/ticking/TickRateModulation.java b/dependencies/main/java/appeng/api/networking/ticking/TickRateModulation.java deleted file mode 100644 index 35e83b921b..0000000000 --- a/dependencies/main/java/appeng/api/networking/ticking/TickRateModulation.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.ticking; - - -public enum TickRateModulation -{ - /** - * same as idle, but also puts the node to sleep. - */ - SLEEP, - - /** - * set tick rate to maximum. - */ - IDLE, - - /** - * decrease the tick rate marginally. - */ - SLOWER, - - /** - * continue at current rate. - */ - SAME, - - /** - * increase the tick rate marginally. - */ - FASTER, - - /** - * changes the tick rate to the minimum tick rate. - */ - URGENT -} diff --git a/dependencies/main/java/appeng/api/networking/ticking/TickingRequest.java b/dependencies/main/java/appeng/api/networking/ticking/TickingRequest.java deleted file mode 100644 index d14cab92c1..0000000000 --- a/dependencies/main/java/appeng/api/networking/ticking/TickingRequest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.networking.ticking; - - -/** - * Describes how your tiles ticking is executed. - */ -public class TickingRequest -{ - - /** - * the minimum number of ticks that must pass between ticks. - * - * Valid Values are : 1+ - * - * Suggested is 5-20 - */ - public final int minTickRate; - - /** - * the maximum number of ticks that can pass between ticks, if this value is - * exceeded the tile must tick. - * - * Valid Values are 1+ - * - * Suggested is 20-40 - */ - public final int maxTickRate; - - /** - * Determines the current expected state of your node, if your node expects - * to be sleeping, then return true. - */ - public final boolean isSleeping; - - /** - * True only if you call {@link ITickManager}.alertDevice( IGridNode ); - */ - public final boolean canBeAlerted; - - public TickingRequest( final int min, final int max, final boolean sleep, final boolean alertable ) - { - this.minTickRate = min; - this.maxTickRate = max; - this.isSleeping = sleep; - this.canBeAlerted = alertable; - } -} diff --git a/dependencies/main/java/appeng/api/package-info.java b/dependencies/main/java/appeng/api/package-info.java deleted file mode 100644 index a703183e58..0000000000 --- a/dependencies/main/java/appeng/api/package-info.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -@API( apiVersion = "@aeversion@", owner = "appliedenergistics2", provides = "appliedenergistics2|API" ) -package appeng.api; - - -import net.minecraftforge.fml.common.API; diff --git a/dependencies/main/java/appeng/api/parts/BusSupport.java b/dependencies/main/java/appeng/api/parts/BusSupport.java deleted file mode 100644 index 3f552620ac..0000000000 --- a/dependencies/main/java/appeng/api/parts/BusSupport.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -public enum BusSupport -{ - CABLE, - - DENSE_CABLE - -} diff --git a/dependencies/main/java/appeng/api/parts/CableRenderMode.java b/dependencies/main/java/appeng/api/parts/CableRenderMode.java deleted file mode 100644 index d232caab92..0000000000 --- a/dependencies/main/java/appeng/api/parts/CableRenderMode.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -public enum CableRenderMode -{ - STANDARD( false ), - - CABLE_VIEW( true ); - - public final boolean transparentFacades; - public final boolean opaqueFacades; - - CableRenderMode( final boolean hideFacades ) - { - this.transparentFacades = hideFacades; - this.opaqueFacades = !hideFacades; - } -} diff --git a/dependencies/main/java/appeng/api/parts/IAlphaPassItem.java b/dependencies/main/java/appeng/api/parts/IAlphaPassItem.java deleted file mode 100644 index f6bccaecb1..0000000000 --- a/dependencies/main/java/appeng/api/parts/IAlphaPassItem.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -import net.minecraft.item.ItemStack; - - -public interface IAlphaPassItem -{ - - /** - * Extend, and return true to enable a second pass for your parts in the bus rendering pipe line. - * - * @param is item - * - * @return true to enable a second pass for your parts in the bus rendering pipe line. - */ - boolean useAlphaPass( ItemStack is ); -} diff --git a/dependencies/main/java/appeng/api/parts/IBoxProvider.java b/dependencies/main/java/appeng/api/parts/IBoxProvider.java deleted file mode 100644 index a03230ef12..0000000000 --- a/dependencies/main/java/appeng/api/parts/IBoxProvider.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -public interface IBoxProvider -{ - - /** - * add your collision information to the the list. - * - * @param boxes collision boxes - */ - void getBoxes( IPartCollisionHelper boxes ); -} diff --git a/dependencies/main/java/appeng/api/parts/ICustomCableConnection.java b/dependencies/main/java/appeng/api/parts/ICustomCableConnection.java deleted file mode 100644 index 8c578f63c4..0000000000 --- a/dependencies/main/java/appeng/api/parts/ICustomCableConnection.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -import appeng.api.util.AECableType; - - -public interface ICustomCableConnection -{ - - /** - * @return This controls the cable connection to the node. -1 to render connection yourself. - */ - public float getCableConnectionLength( AECableType cable ); - -} diff --git a/dependencies/main/java/appeng/api/parts/IFacadeContainer.java b/dependencies/main/java/appeng/api/parts/IFacadeContainer.java deleted file mode 100644 index 16b0221c35..0000000000 --- a/dependencies/main/java/appeng/api/parts/IFacadeContainer.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; - -import net.minecraft.nbt.NBTTagCompound; - -import appeng.api.util.AEPartLocation; - - -/** - * Used Internally. - * - * not intended for implementation. - */ -public interface IFacadeContainer -{ - - /** - * Attempts to add the {@link IFacadePart} to the given side. - * - * @return true if the facade as successfully added. - */ - boolean addFacade( IFacadePart a ); - - /** - * Removed the facade on the given side, or does nothing. - */ - void removeFacade( IPartHost host, AEPartLocation side ); - - /** - * @return the {@link IFacadePart} for a given side, or null. - */ - IFacadePart getFacade( AEPartLocation s ); - - /** - * rotate the facades left. - */ - void rotateLeft(); - - /** - * write nbt data - * - * @param data to be written data - */ - void writeToNBT( NBTTagCompound data ); - - /** - * read from stream - * - * @param data to be read data - * - * @return true if it was readable - * - * @throws IOException - */ - boolean readFromStream( ByteBuf data ) throws IOException; - - /** - * read from NBT - * - * @param data to be read data - */ - void readFromNBT( NBTTagCompound data ); - - /** - * write to stream - * - * @param data to be written data - * - * @throws IOException - */ - void writeToStream( ByteBuf data ) throws IOException; - - /** - * @return true if there are no facades. - */ - boolean isEmpty(); -} diff --git a/dependencies/main/java/appeng/api/parts/IFacadePart.java b/dependencies/main/java/appeng/api/parts/IFacadePart.java deleted file mode 100644 index cbddd62a20..0000000000 --- a/dependencies/main/java/appeng/api/parts/IFacadePart.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -import javax.annotation.Nullable; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import appeng.api.util.AEPartLocation; - - -/** - * Used Internally. - * - * not intended for implementation. - */ -public interface IFacadePart -{ - - /** - * used to save the part. - */ - ItemStack getItemStack(); - - /** - * used to collide, and pick the part - * - * @param ch collision helper - * @param e colliding entity - */ - void getBoxes( IPartCollisionHelper ch, Entity e ); - - /** - * @return side the facade is in - */ - AEPartLocation getSide(); - - Item getItem(); - - int getItemDamage(); - - boolean notAEFacade(); - - boolean isTransparent(); - - /** - * The item that this facade masquerades as. - */ - @Nullable - ItemStack getTextureItem(); - - /** - * @return The block state used for rendering. - */ - IBlockState getBlockState(); - -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/parts/IPart.java b/dependencies/main/java/appeng/api/parts/IPart.java deleted file mode 100644 index 0f6602b963..0000000000 --- a/dependencies/main/java/appeng/api/parts/IPart.java +++ /dev/null @@ -1,327 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -import java.io.IOException; -import java.util.List; -import java.util.Random; - -import javax.annotation.Nonnull; - -import io.netty.buffer.ByteBuf; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import appeng.api.networking.IGridNode; -import appeng.api.util.AECableType; -import appeng.api.util.AEColor; -import appeng.api.util.AEPartLocation; - - -public interface IPart extends IBoxProvider, ICustomCableConnection -{ - - /** - * get an ItemStack that represents the bus, should contain the settings for whatever, can also be used in - * conjunction with removePart to take a part off and drop it or something. - * - * This is used to drop the bus, and to save the bus, when saving the bus, wrenched is false, and writeToNBT will be - * called to save important details about the part, if the part is wrenched include in your NBT Data any settings - * you might want to keep around, you can restore those settings when constructing your part. - * - * @param type , what kind of ItemStack to return? - * - * @return item of part - */ - ItemStack getItemStack( PartItemStack type ); - - /** - * Render dynamic portions of this part, as part of the cable bus TESR. This part has to return true for - * {@link #requireDynamicRender()} in order for - * this method to be called. - */ - @SideOnly( Side.CLIENT ) - default void renderDynamic( double x, double y, double z, float partialTicks, int destroyStage ) - { - } - - /** - * return true only if your part require dynamic rendering, must be consistent. - * - * @return true to enable renderDynamic - */ - boolean requireDynamicRender(); - - /** - * @return if the bus has a solid side, and you can place random stuff on it like torches or levers - */ - boolean isSolid(); - - /** - * @return true if this part can connect to redstone ( also MFR Rednet ) - */ - boolean canConnectRedstone(); - - /** - * Write the part information for saving, the part will be saved with getItemStack(false) and this method will be - * called after to load settings, inventory or other values from the world. - * - * @param data to be written nbt data - */ - void writeToNBT( NBTTagCompound data ); - - /** - * Read the previously written NBT Data. this is the mirror for writeToNBT - * - * @param data to be read nbt data - */ - void readFromNBT( NBTTagCompound data ); - - /** - * @return get the amount of light produced by the bus - */ - int getLightLevel(); - - /** - * does this part act like a ladder? - * - * @param entity climbing entity - * - * @return true if entity can climb - */ - boolean isLadder( EntityLivingBase entity ); - - /** - * a block around the bus's host has been changed. - */ - void onNeighborChanged(); - - /** - * @return output redstone on facing side - */ - int isProvidingStrongPower(); - - /** - * @return output redstone on facing side - */ - int isProvidingWeakPower(); - - /** - * write data to bus packet. - * - * @param data to be written data - * - * @throws IOException - */ - void writeToStream( ByteBuf data ) throws IOException; - - /** - * read data from bus packet. - * - * @param data to be read data - * - * @return true will re-draw the part. - * - * @throws IOException - */ - boolean readFromStream( ByteBuf data ) throws IOException; - - /** - * get the Grid Node for the Bus, be sure your IGridBlock is NOT isWorldAccessible, if it is your going to cause - * crashes. - * - * or null if you don't have a grid node. - * - * @return grid node - */ - IGridNode getGridNode(); - - /** - * called when an entity collides with the bus. - * - * @param entity colliding entity - */ - void onEntityCollision( Entity entity ); - - /** - * called when your part is being removed from the world. - */ - void removeFromWorld(); - - /** - * called when your part is being added to the world. - */ - void addToWorld(); - - /** - * used for tunnels. - * - * @return a grid node that represents the external facing side, these must be isWorldAccessible with the correct - * faces marked as external - */ - IGridNode getExternalFacingNode(); - - /** - * called by the Part host to keep your part informed. - * - * @param host part side - * @param tile tile entity of part - */ - void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile ); - - /** - * Called when you right click the part, very similar to Block.onActivateBlock - * - * @param player right clicking player - * @param pos position of block - * - * @return if your activate method performed something. - */ - boolean onActivate( EntityPlayer player, EnumHand hand, Vec3d pos ); - - /** - * Called when you right click the part, very similar to Block.onActivateBlock - * - * @param player shift right clicking player - * @param pos position of block - * - * @return if your activate method performed something, you should use false unless you really need it. - */ - boolean onShiftActivate( EntityPlayer player, EnumHand hand, Vec3d pos ); - - /** - * Add drops to the items being dropped into the world, if your item stores its contents when wrenched use the - * wrenched boolean to control what data is saved vs dropped when it is broken. - * - * @param drops item drops if wrenched - * @param wrenched control flag for wrenched vs broken - */ - void getDrops( List drops, boolean wrenched ); - - /** - * @return 0 - 8, reasonable default 3-4, this controls the cable connection to the node. -1 to render connection - * yourself. - */ - @Override - public float getCableConnectionLength( AECableType cable ); - - /** - * same as Block.randomDisplayTick, for but parts. - * - * @param world world of block - * @param pos location of block - * @param r random - */ - void randomDisplayTick( World world, BlockPos pos, Random r ); - - /** - * Called when placed in the world by a player, this happens before addWorld. - * - * @param player placing player - * @param held held item - * @param side placing side - */ - void onPlacement( EntityPlayer player, EnumHand hand, ItemStack held, AEPartLocation side ); - - /** - * Used to determine which parts can be placed on what cables. - * - * @param what placed part - * - * @return true if the part can be placed on this support. - */ - boolean canBePlacedOn( BusSupport what ); - - /** - * This method is used when a chunk is rebuilt to determine how this part should be rendered. The returned models - * should represent the - * part oriented north. They will be automatically rotated to match the part's actual orientation. Tint indices 1-4 - * can be used in the - * models to access the parts color. - * - *
- *
Tint Index 1
- *
The {@link AEColor#blackVariant dark variant color} of the cable that this part is attached to.
- *
Tint Index 2
- *
The {@link AEColor#mediumVariant color} of the cable that this part is attached to.
- *
Tint Index 3
- *
The {@link AEColor#whiteVariant bright variant color} of the cable that this part is attached to.
- *
Tint Index 4
- *
A color variant that is between the cable's {@link AEColor#mediumVariant color} and its - * {@link AEColor#whiteVariant bright variant}.
- *
- * - * Important: All models must have been registered via the {@link IPartModels} API before use. - */ - @Nonnull - default IPartModel getStaticModels() - { - return new IPartModel() - { - }; - } - - /** - * Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be - * forwarded to parts on the appropriate - * side. - * - * @see TileEntity#hasCapability(Capability, EnumFacing) - * - * @return True if your part has the requested capability. - */ - default boolean hasCapability( Capability capabilityClass ) - { - return false; - } - - /** - * Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be - * forwarded to parts on the appropriate - * side. - * - * @see TileEntity#getCapability(Capability, EnumFacing) - * - * @return The capability or null. - */ - default T getCapability( Capability capabilityClass ) - { - return null; - } - -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/parts/IPartCollisionHelper.java b/dependencies/main/java/appeng/api/parts/IPartCollisionHelper.java deleted file mode 100644 index 6d428fe911..0000000000 --- a/dependencies/main/java/appeng/api/parts/IPartCollisionHelper.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -import net.minecraft.util.EnumFacing; - - -public interface IPartCollisionHelper -{ - - /** - * add a collision box, expects 0.0 - 16.0 block coords. - * - * No complaints about the size, I like using pixels :P - * - * @param minX minimal x collision - * @param minY minimal y collision - * @param minZ minimal z collision - * @param maxX maximal x collision - * @param maxY maximal y collision - * @param maxZ maximal z collision - */ - void addBox( double minX, double minY, double minZ, double maxX, double maxY, double maxZ ); - - /** - * @return east in world space. - */ - EnumFacing getWorldX(); - - /** - * @return up in world space. - */ - EnumFacing getWorldY(); - - /** - * @return forward in world space. - */ - EnumFacing getWorldZ(); - - /** - * @return true if this test is to get the BB Collision information. - */ - boolean isBBCollision(); -} diff --git a/dependencies/main/java/appeng/api/parts/IPartHelper.java b/dependencies/main/java/appeng/api/parts/IPartHelper.java deleted file mode 100644 index d8ed38ff64..0000000000 --- a/dependencies/main/java/appeng/api/parts/IPartHelper.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumActionResult; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - - -public interface IPartHelper -{ - /** - * Register a new layer with the part layer system, this allows you to write an in between between tile entities and - * parts. - * - * AE By Default includes, - * - * 1. ISidedInventory ( and by extension IInventory. ) - * - * 2. IFluidHandler Forge Fluids - * - * 3. IPowerEmitter BC Power output. - * - * 4. IPowerReceptor BC Power input. - * - * 5. IEnergySink IC2 Power input. - * - * 6. IEnergySource IC2 Power output. - * - * 7. IPipeConnection BC Pipe Connections - * - * As long as a valid layer is registered for a interface you can simply implement that interface on a part get - * implement it. - * - * @return true on success, false on failure, usually a error will be logged as well. - */ - boolean registerNewLayer( String string, String layerInterface ); - - /** - * use in use item, to try and place a IBusItem - * - * @param is ItemStack of an item which implements {@link IPartItem} - * @param pos pos of part - * @param side side which the part should be on - * @param player player placing part - * @param world part in world - * - * @return true if placing was successful - */ - EnumActionResult placeBus( ItemStack is, BlockPos pos, EnumFacing side, EntityPlayer player, EnumHand hand, World world ); - - /** - * @return the render mode - */ - CableRenderMode getCableRenderMode(); -} diff --git a/dependencies/main/java/appeng/api/parts/IPartHost.java b/dependencies/main/java/appeng/api/parts/IPartHost.java deleted file mode 100644 index 0f8c26e4a1..0000000000 --- a/dependencies/main/java/appeng/api/parts/IPartHost.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -import java.util.Set; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; -import net.minecraft.util.math.Vec3d; - -import appeng.api.util.AEColor; -import appeng.api.util.AEPartLocation; -import appeng.api.util.DimensionalCoord; - - -/** - * Implemented on AE's TileEntity. - * - * Do Not Implement - */ -public interface IPartHost extends ICustomCableConnection -{ - - /** - * @return the facade container - */ - IFacadeContainer getFacadeContainer(); - - /** - * Test if you can add a part to the specified side of the Part Host, {@link AEPartLocation}.UNKNOWN is used to - * represent the cable in the middle. - * - * @param part to be added part - * @param side part placed onto side - * - * @return returns false if the part cannot be added. - */ - boolean canAddPart( ItemStack part, AEPartLocation side ); - - /** - * try to add a new part to the specified side, returns false if it failed to be added. - * - * @param is new part - * @param side onto side - * @param owner with owning player - * - * @return null if the item failed to add, the side it was placed on other wise ( may different for cables, - * {@link AEPartLocation}.UNKNOWN ) - */ - AEPartLocation addPart( ItemStack is, AEPartLocation side, EntityPlayer owner, EnumHand hand ); - - /** - * Get part by side ( center is {@link AEPartLocation}.UNKNOWN ) - * - * @param side side of part - * - * @return the part located on the specified side, or null if there is no part. - */ - IPart getPart( AEPartLocation side ); - - /** - * Get part by side, this method cannot aquire the center part, you must use the other varient of getPart. - * - * @param side side of part - * - * @return the part located on the specified side, or null if there is no part. - */ - IPart getPart( EnumFacing side ); - - /** - * removes the part on the side, this doesn't drop it or anything, if you don't do something with it, its just - * "gone" and its never coming back; think about it. - * - * if you want to drop the part you must request it prior to removing it. - * - * @param side side of part - * @param suppressUpdate - used if you need to replace a part's INSTANCE, without really removing it first. - */ - void removePart( AEPartLocation side, boolean suppressUpdate ); - - /** - * something changed, might want to send a packet to clients to update state. - */ - void markForUpdate(); - - /** - * @return the physical location of the part host in the universe. - */ - DimensionalCoord getLocation(); - - /** - * @return the tile entity for the host, this can either be an FMP tile, or a AE tile - */ - TileEntity getTile(); - - /** - * @return the color of the host type ( this is determined by the middle cable. ) if no cable is present, it returns - * {@link AEColor} .Transparent other wise it returns the color of the cable in the center. - */ - AEColor getColor(); - - /** - * destroys the part container, for internal use. - */ - void clearContainer(); - - /** - * Used to test for FMP microblock blocking internally. - * - * @return returns if microblocks are blocking this cable path. - */ - boolean isBlocked( EnumFacing side ); - - /** - * finds the part located at the position ( pos must be relative, not global ) - * - * @param pos part position - * - * @return a new SelectedPart, this is never null. - */ - SelectedPart selectPart( Vec3d pos ); - - /** - * can be used by parts to trigger the tile or part to save. - */ - void markForSave(); - - /** - * part of the {@link LayerBase} - */ - void partChanged(); - - /** - * get the redstone state of host on this side, this value is cached internally. - * - * @param side side of part - * - * @return true of the part host is receiving redstone from an external source. - */ - boolean hasRedstone( AEPartLocation side ); - - /** - * returns false if this block contains any parts or facades, true other wise. - */ - boolean isEmpty(); - - /** - * @return a mutable list of flags you can adjust to track state. - */ - Set getLayerFlags(); - - /** - * remove host from world... - */ - void cleanup(); - - /** - * notify neighbors uf updated status. - */ - void notifyNeighbors(); - - /** - * true if the tile is in the world, other wise false. - * - * @return true if tile is in world - */ - boolean isInWorld(); - -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/parts/IPartItem.java b/dependencies/main/java/appeng/api/parts/IPartItem.java deleted file mode 100644 index 82146958c5..0000000000 --- a/dependencies/main/java/appeng/api/parts/IPartItem.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -import javax.annotation.Nullable; - -import net.minecraft.item.ItemStack; - -//@formatter:off - - -/** - * This is a pretty basic requirement, once you implement the interface, and createPartFromItemStack - * - * you must register your bus with the Bus renderer, using AEApi.INSTANCE().partHelper().setItemBusRenderer( this ); - * - * then simply add this, and call AE's Bus Placement Code. - * - *
- * 
- *
- * {@literal @}Override
- * public default EnumActionResult onItemUse(ItemStack is, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
- *	{
- *		return AEApi.instance().partHelper().placeBus( is, pos, side, player, hand, world );
- *	}
- * 
- * 
- */ -public interface IPartItem

-{ - - /** - * create a new part INSTANCE, from the item stack. - * - * @param is item - * - * @return part from item - */ - @Nullable - P createPartFromItemStack( ItemStack is ); - -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/parts/IPartModel.java b/dependencies/main/java/appeng/api/parts/IPartModel.java deleted file mode 100644 index 0173ba4b2b..0000000000 --- a/dependencies/main/java/appeng/api/parts/IPartModel.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -import java.util.Collections; -import java.util.List; - -import javax.annotation.Nonnull; - -import net.minecraft.util.ResourceLocation; - - -/** - * A container to store a collection of {@link ResourceLocation} as models for a part as well as other properties. - */ -public interface IPartModel -{ - - /** - * A solid {@link IPartModel} indicates that the rendering requires a cable connection, which will also result in - * creating an intersection for the cable. - * - * This should be true for pretty much all parts. - * - * @return true for a solid part. - */ - default boolean requireCableConnection() - { - return true; - } - - /** - * A collection of {@link ResourceLocation} used as models for a part. - * - * @return a collection of models, never null. - */ - @Nonnull - default List getModels() - { - return Collections.emptyList(); - } - -} diff --git a/dependencies/main/java/appeng/api/parts/IPartModels.java b/dependencies/main/java/appeng/api/parts/IPartModels.java deleted file mode 100644 index 332386957b..0000000000 --- a/dependencies/main/java/appeng/api/parts/IPartModels.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api.parts; - - -import java.util.Arrays; -import java.util.Collection; - -import net.minecraft.util.ResourceLocation; - -import appeng.api.AEInjectable; - - -/** - * Allows registration of part models that can then be used in {@link IPart#getStaticModels()}. - */ -@AEInjectable -public interface IPartModels -{ - - /** - * Allows registration of part models that can then be used in {@link IPart#getStaticModels()}. - * - * Models can be registered multiple times without causing issues. - * - * This method must be called during the pre-init phase (as part of your plugin's constructor). - */ - void registerModels( Collection partModels ); - - /** - * Convenience overload of {@link #registerModels(Collection)} - */ - default void registerModels( ResourceLocation... partModels ) - { - registerModels( Arrays.asList( partModels ) ); - } -} diff --git a/dependencies/main/java/appeng/api/parts/LayerBase.java b/dependencies/main/java/appeng/api/parts/LayerBase.java deleted file mode 100644 index a5c1df88ef..0000000000 --- a/dependencies/main/java/appeng/api/parts/LayerBase.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -import java.util.Set; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; - -import appeng.api.util.AEPartLocation; - - -/** - * All Layers must extends this, this get part implementation is provided to interface with the parts, however a real - * implementation will be used at runtime. - * - * TODO: Consider removing and replacing with capabilities. - */ -public abstract class LayerBase extends TileEntity // implements IPartHost -{ - - /** - * Grants access for the layer to the parts of the host. - * - * This Method looks silly, that is because its not used at runtime, a real implementation will be used instead. - * - * @param side side of part - * - * @return the part for the requested side. - */ - public IPart getPart( final AEPartLocation side ) - { - return null; // place holder. - } - - /** - * Grants access for the layer to the parts of the host. - * - * This Method looks silly, that is because its not used at runtime, a real implementation will be used instead. - * - * @param side side of part - * - * @return the part for the requested side. - */ - public IPart getPart( final EnumFacing side ) - { - return null; // place holder. - } - - /** - * called when the parts change in the container, YOU MUST CALL super.PartChanged(); - */ - public void notifyNeighbors() - { - } - - /** - * called when the parts change in the container, YOU MUST CALL super.PartChanged(); - */ - public void partChanged() - { - } - - /** - * @return a mutable list of flags you can adjust to track state. - */ - public Set getLayerFlags() - { - return null; // place holder. - } - - public void markForSave() - { - // something! - } -} diff --git a/dependencies/main/java/appeng/api/parts/LayerFlags.java b/dependencies/main/java/appeng/api/parts/LayerFlags.java deleted file mode 100644 index 89e6359331..0000000000 --- a/dependencies/main/java/appeng/api/parts/LayerFlags.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - -/** - * TODO: Consider removing and replacing with capabilities. - */ -public enum LayerFlags -{ - - IC2_ENET - -} diff --git a/dependencies/main/java/appeng/api/parts/PartItemStack.java b/dependencies/main/java/appeng/api/parts/PartItemStack.java deleted file mode 100644 index e619c420df..0000000000 --- a/dependencies/main/java/appeng/api/parts/PartItemStack.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -public enum PartItemStack -{ - PICK, - - BREAK, - - WRENCH, - - NETWORK, - - WORLD -} diff --git a/dependencies/main/java/appeng/api/parts/SelectedPart.java b/dependencies/main/java/appeng/api/parts/SelectedPart.java deleted file mode 100644 index 84396d6169..0000000000 --- a/dependencies/main/java/appeng/api/parts/SelectedPart.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.parts; - - -import appeng.api.util.AEPartLocation; - - -/** - * Reports a selected part from the IPartHost - * - */ -public class SelectedPart -{ - - /** - * selected part. - */ - public final IPart part; - - /** - * facade part. - */ - public final IFacadePart facade; - - /** - * side the part is mounted too, or {@link AEPartLocation}.UNKNOWN for cables. - */ - public final AEPartLocation side; - - public SelectedPart() - { - this.part = null; - this.facade = null; - this.side = AEPartLocation.INTERNAL; - } - - public SelectedPart( final IPart part, final AEPartLocation side ) - { - this.part = part; - this.facade = null; - this.side = side; - } - - public SelectedPart( final IFacadePart facade, final AEPartLocation side ) - { - this.part = null; - this.facade = facade; - this.side = side; - } -} diff --git a/dependencies/main/java/appeng/api/recipes/ICraftHandler.java b/dependencies/main/java/appeng/api/recipes/ICraftHandler.java deleted file mode 100644 index bd94b2dad2..0000000000 --- a/dependencies/main/java/appeng/api/recipes/ICraftHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.recipes; - - -import java.util.List; - -import appeng.api.exceptions.MissingIngredientError; -import appeng.api.exceptions.RecipeError; -import appeng.api.exceptions.RegistrationError; - - -public interface ICraftHandler -{ - - /** - * Called when your recipe handler receives a newly parsed list of inputs/outputs. - * - * @param input parsed inputs - * @param output parsed outputs - * - * @throws RecipeError - */ - void setup( List> input, List> output ) throws RecipeError; - - /** - * called when all recipes are parsed, and your required to register your recipe. - * - * @throws RegistrationError - * @throws MissingIngredientError - */ - void register() throws RegistrationError, MissingIngredientError; -} diff --git a/dependencies/main/java/appeng/api/recipes/IIngredient.java b/dependencies/main/java/appeng/api/recipes/IIngredient.java deleted file mode 100644 index 2878022d31..0000000000 --- a/dependencies/main/java/appeng/api/recipes/IIngredient.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.recipes; - - -import net.minecraft.item.ItemStack; - -import appeng.api.exceptions.MissingIngredientError; -import appeng.api.exceptions.RegistrationError; - - -public interface IIngredient -{ - - /** - * Acquire a single input stack for the current recipe, if more then one ItemStack is possible a - * RegistrationError exception will be thrown, ignore these and let the system handle the error. - * - * @return a single ItemStack for the recipe handler. - * - * @throws RegistrationError - * @throws MissingIngredientError - */ - ItemStack getItemStack() throws RegistrationError, MissingIngredientError; - - /** - * Acquire a list of all the input stacks for the current recipe, this is for handlers that support - * multiple inputs per slot. - * - * @return an array of ItemStacks for the recipe handler. - * - * @throws RegistrationError - * @throws MissingIngredientError - */ - ItemStack[] getItemStackSet() throws RegistrationError, MissingIngredientError; - - /** - * If you wish to support air, you must test before getting the ItemStack, or ItemStackSet - * - * @return true if this slot contains no ItemStack, this is passed as "_" - */ - boolean isAir(); - - /** - * @return The Name Space of the item. Prefer getItemStack or getItemStackSet - */ - String getNameSpace(); - - /** - * @return The Name of the item. Prefer getItemStack or getItemStackSet - */ - String getItemName(); - - /** - * @return The Damage Value of the item. Prefer getItemStack or getItemStackSet - */ - int getDamageValue(); - - /** - * @return The Damage Value of the item. Prefer getItemStack or getItemStackSet - */ - int getQty(); - - /** - * Bakes the lists in for faster runtime look-ups. - * - * @throws MissingIngredientError - * @throws RegistrationError - */ - void bake() throws RegistrationError, MissingIngredientError; -} diff --git a/dependencies/main/java/appeng/api/recipes/IRecipeHandler.java b/dependencies/main/java/appeng/api/recipes/IRecipeHandler.java deleted file mode 100644 index 58c2b4a71c..0000000000 --- a/dependencies/main/java/appeng/api/recipes/IRecipeHandler.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.recipes; - - -/** - * Represents the AE2 Recipe Loading/Reading Class - */ -public interface IRecipeHandler -{ - - /** - * Call when you want to read recipes in from a file based on a loader - * - * @param loader recipe loader - * @param path path of file - */ - void parseRecipes( IRecipeLoader loader, String path ); - - /** - * this loads the read recipes into minecraft, should be called in Init. - */ - void injectRecipes(); -} diff --git a/dependencies/main/java/appeng/api/recipes/IRecipeLoader.java b/dependencies/main/java/appeng/api/recipes/IRecipeLoader.java deleted file mode 100644 index 277ef988e6..0000000000 --- a/dependencies/main/java/appeng/api/recipes/IRecipeLoader.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.recipes; - - -import java.io.BufferedReader; - -import javax.annotation.Nonnull; - - -public interface IRecipeLoader -{ - /** - * @param filePath the path to the to be loaded file - * - * @return reader handler of the file - * - * @throws Exception if reading goes wrong - */ - BufferedReader getFile( @Nonnull String filePath ) throws Exception; -} diff --git a/dependencies/main/java/appeng/api/recipes/ISubItemResolver.java b/dependencies/main/java/appeng/api/recipes/ISubItemResolver.java deleted file mode 100644 index 1013986db0..0000000000 --- a/dependencies/main/java/appeng/api/recipes/ISubItemResolver.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.recipes; - - -public interface ISubItemResolver -{ - /** - * @param namespace namespace of sub item - * @param fullName name of sub item - * - * @return either a ResolveResult, or a ResolverResultSet - */ - Object resolveItemByName( String namespace, String fullName ); -} diff --git a/dependencies/main/java/appeng/api/recipes/ResolverResult.java b/dependencies/main/java/appeng/api/recipes/ResolverResult.java deleted file mode 100644 index 5140557694..0000000000 --- a/dependencies/main/java/appeng/api/recipes/ResolverResult.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.recipes; - - -import net.minecraft.nbt.NBTTagCompound; - - -public class ResolverResult -{ - - public final String itemName; - public final int damageValue; - public final NBTTagCompound compound; - - public ResolverResult( final String name, final int damage ) - { - this.itemName = name; - this.damageValue = damage; - this.compound = null; - } - - public ResolverResult( final String name, final int damage, final NBTTagCompound data ) - { - this.itemName = name; - this.damageValue = damage; - this.compound = data; - } -} diff --git a/dependencies/main/java/appeng/api/recipes/ResolverResultSet.java b/dependencies/main/java/appeng/api/recipes/ResolverResultSet.java deleted file mode 100644 index 7705d8304c..0000000000 --- a/dependencies/main/java/appeng/api/recipes/ResolverResultSet.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.recipes; - - -import java.util.Arrays; -import java.util.List; - -import net.minecraft.item.ItemStack; - - -public class ResolverResultSet -{ - - public final String name; - public final List results; - - public ResolverResultSet( final String myName, final ItemStack... set ) - { - this.results = Arrays.asList( set ); - this.name = myName; - } -} diff --git a/dependencies/main/java/appeng/api/storage/ICellContainer.java b/dependencies/main/java/appeng/api/storage/ICellContainer.java deleted file mode 100644 index 4445dd3e46..0000000000 --- a/dependencies/main/java/appeng/api/storage/ICellContainer.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import appeng.api.networking.security.IActionHost; - - -/** - * Represents an {@link appeng.api.networking.IGridHost} that contributes to storage, such as a ME Chest, or ME Drive. - */ -public interface ICellContainer extends IActionHost, ICellProvider, ISaveProvider -{ - - /** - * tell the Cell container that this slot should blink, the slot number is relative to the - * - * @param slot slot index - */ - void blinkCell( int slot ); -} diff --git a/dependencies/main/java/appeng/api/storage/ICellHandler.java b/dependencies/main/java/appeng/api/storage/ICellHandler.java deleted file mode 100644 index 9d52241586..0000000000 --- a/dependencies/main/java/appeng/api/storage/ICellHandler.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -import appeng.api.implementations.tiles.IChestOrDrive; - - -/** - * Registration record for {@link ICellRegistry} - */ -public interface ICellHandler -{ - - /** - * return true if the provided item is handled by your cell handler. ( AE May choose to skip this method, and just - * request a handler ) - * - * @param is to be checked item - * - * @return return true, if getCellHandler will not return null. - */ - boolean isCell( ItemStack is ); - - /** - * If you cannot handle the provided item, return null - * - * @param is a storage cell item. - * @param host anytime the contents of your storage cell changes it should use this to request a save, please - * note, this value can be null. - * @param channel the storage channel requested. - * - * @return a new IMEHandler for the provided item - */ - IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider host, StorageChannel channel ); - - /** - * Called when the storage cell is planed in an ME Chest and the user tries to open the terminal side, if your item - * is not available via ME Chests simply tell the user they can't use it, or something, other wise you should open - * your gui and display the cell to the user. - * - * @param player player opening chest gui - * @param chest to be opened chest - * @param cellHandler cell handler - * @param inv inventory handler - * @param is item - * @param chan storage channel - */ - void openChestGui( EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler inv, ItemStack is, StorageChannel chan ); - - /** - * 0 - cell is missing. - * - * 1 - green, ( usually means available room for types or items. ) - * - * 2 - orange, ( usually means available room for items, but not types. ) - * - * 3 - red, ( usually means the cell is 100% full ) - * - * @param is the cell item. ( use the handler for any details you can ) - * @param handler the handler for the cell is provides for reference, you can cast this to your handler. - * - * @return get the status of the cell based on its contents. - */ - int getStatusForCell( ItemStack is, IMEInventory handler ); - - /** - * @return the ae/t to drain for this storage cell inside a chest/drive. - */ - double cellIdleDrain( ItemStack is, IMEInventory handler ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/storage/ICellInventory.java b/dependencies/main/java/appeng/api/storage/ICellInventory.java deleted file mode 100644 index 13494b8d1f..0000000000 --- a/dependencies/main/java/appeng/api/storage/ICellInventory.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -import appeng.api.config.FuzzyMode; -import appeng.api.storage.data.IAEItemStack; - - -public interface ICellInventory extends IMEInventory -{ - - /** - * @return the item stack of this storage cell. - */ - ItemStack getItemStack(); - - /** - * @return idle cost for this Storage Cell - */ - double getIdleDrain(); - - /** - * @return fuzzy setting - */ - FuzzyMode getFuzzyMode(); - - /** - * @return access configured list - */ - IInventory getConfigInventory(); - - /** - * @return access installed upgrades. - */ - IInventory getUpgradesInventory(); - - /** - * @return How many bytes are used for each type? - */ - int getBytesPerType(); - - /** - * @return true if a new item type can be added. - */ - boolean canHoldNewItem(); - - /** - * @return total byte storage. - */ - long getTotalBytes(); - - /** - * @return how many bytes are free. - */ - long getFreeBytes(); - - /** - * @return how many bytes are in use. - */ - long getUsedBytes(); - - /** - * @return max number of types. - */ - long getTotalItemTypes(); - - /** - * @return how many items are stored. - */ - long getStoredItemCount(); - - /** - * @return how many items types are currently stored. - */ - long getStoredItemTypes(); - - /** - * @return how many item types remain. - */ - long getRemainingItemTypes(); - - /** - * @return how many more items can be stored. - */ - long getRemainingItemCount(); - - /** - * @return how many items can be added without consuming another byte. - */ - int getUnusedItemCount(); - - /** - * @return the status number for this drive. - */ - int getStatusForCell(); -} diff --git a/dependencies/main/java/appeng/api/storage/ICellInventoryHandler.java b/dependencies/main/java/appeng/api/storage/ICellInventoryHandler.java deleted file mode 100644 index 3f1e77ad90..0000000000 --- a/dependencies/main/java/appeng/api/storage/ICellInventoryHandler.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import appeng.api.config.IncludeExclude; -import appeng.api.storage.data.IAEItemStack; - - -public interface ICellInventoryHandler extends IMEInventoryHandler -{ - - /** - * @return get access to the Cell Inventory. - */ - ICellInventory getCellInv(); - - boolean isPreformatted(); - - boolean isFuzzy(); - - IncludeExclude getIncludeExcludeMode(); -} diff --git a/dependencies/main/java/appeng/api/storage/ICellProvider.java b/dependencies/main/java/appeng/api/storage/ICellProvider.java deleted file mode 100644 index af849bf41e..0000000000 --- a/dependencies/main/java/appeng/api/storage/ICellProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import java.util.List; - - -/** - * Allows you to provide cells via non IGridHosts directly to the storage system, drives, and similar features should go - * though {@link ICellContainer} and be automatically handled by the storage system. - */ -public interface ICellProvider -{ - - /** - * Inventory of the tile for use with ME, should always return an valid list, never NULL. - * - * You must return the correct Handler for the correct channel, if your handler returns a IAEItemStack handler, for - * a Fluid Channel stuffs going to explode, same with the reverse. - * - * @return a valid list of handlers, NEVER NULL - */ - List getCellArray( StorageChannel channel ); - - /** - * the storage's priority. - * - * Positive and negative are supported - */ - int getPriority(); -} diff --git a/dependencies/main/java/appeng/api/storage/ICellRegistry.java b/dependencies/main/java/appeng/api/storage/ICellRegistry.java deleted file mode 100644 index 9b4941d725..0000000000 --- a/dependencies/main/java/appeng/api/storage/ICellRegistry.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import net.minecraft.item.ItemStack; - -import appeng.api.IAppEngApi; - - -/** - * Storage Cell Registry, used for specially implemented cells, if you just want to make a item act like a cell, or new - * cell with different bytes, then you should probably consider IStorageCell instead its considerably simpler. - * - * Do not Implement, obtained via {@link IAppEngApi}.getCellRegistry() - */ -public interface ICellRegistry -{ - - /** - * Register a new handler. - * - * @param handler cell handler - */ - void addCellHandler( ICellHandler handler ); - - /** - * return true, if you can get a InventoryHandler for the item passed. - * - * @param is to be checked item - * - * @return true if the provided item, can be handled by a handler in AE, ( AE May choose to skip this and just get - * the handler instead. ) - */ - boolean isCellHandled( ItemStack is ); - - /** - * get the handler, for the requested type. - * - * @param is to be checked item - * - * @return the handler registered for this item type. - */ - ICellHandler getHandler( ItemStack is ); - - /** - * returns an IMEInventoryHandler for the provided item. - * - * @param is item with inventory handler - * @param host can be null, or the hosting tile / part. - * @param chan the storage channel to request the handler for. - * - * @return new IMEInventoryHandler, or null if there isn't one. - */ - IMEInventoryHandler getCellInventory( ItemStack is, ISaveProvider host, StorageChannel chan ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/storage/ICellWorkbenchItem.java b/dependencies/main/java/appeng/api/storage/ICellWorkbenchItem.java deleted file mode 100644 index 668095c6e7..0000000000 --- a/dependencies/main/java/appeng/api/storage/ICellWorkbenchItem.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -import appeng.api.config.FuzzyMode; - - -public interface ICellWorkbenchItem -{ - - /** - * if this return false, the item will not be treated as a cell, and cannot be inserted into the work bench. - * - * @param is item - * - * @return true if the item should be editable in the cell workbench. - */ - boolean isEditable( ItemStack is ); - - /** - * used to edit the upgrade slots on your cell, should have a capacity of 0-24, you are also responsible for - * implementing the valid checks, and any storage/usage of them. - * - * onInventoryChange will be called when saving is needed. - */ - IInventory getUpgradesInventory( ItemStack is ); - - /** - * Used to extract, or mirror the contents of the work bench onto the cell. - * - * - This should have exactly 63 slots, any more, or less might cause issues. - * - * onInventoryChange will be called when saving is needed. - */ - IInventory getConfigInventory( ItemStack is ); - - /** - * @return the current fuzzy status. - */ - FuzzyMode getFuzzyMode( ItemStack is ); - - /** - * sets the setting on the cell. - */ - void setFuzzyMode( ItemStack is, FuzzyMode fzMode ); -} diff --git a/dependencies/main/java/appeng/api/storage/IMEInventory.java b/dependencies/main/java/appeng/api/storage/IMEInventory.java deleted file mode 100644 index c6896004e2..0000000000 --- a/dependencies/main/java/appeng/api/storage/IMEInventory.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import appeng.api.config.Actionable; -import appeng.api.networking.security.BaseActionSource; -import appeng.api.storage.data.IAEStack; -import appeng.api.storage.data.IItemList; - - -/** - * AE's Equivalent to IInventory, used to reading contents, and manipulating contents of ME Inventories. - * - * Implementations should COMPLETELY ignore stack size limits from an external view point, Meaning that you can inject - * Integer.MAX_VALUE items and it should work as defined, or be able to extract Integer.MAX_VALUE and have it work as - * defined, Translations to MC's max stack size are external to the AE API. - * - * If you want to request a stack of an item, you should should determine that prior to requesting the stack from the - * inventory. - */ -public interface IMEInventory -{ - - /** - * Store new items, or simulate the addition of new items into the ME Inventory. - * - * @param input item to add. - * @param type action type - * @param src action source - * - * @return returns the number of items not added. - */ - StackType injectItems( StackType input, Actionable type, BaseActionSource src ); - - /** - * Extract the specified item from the ME Inventory - * - * @param request item to request ( with stack size. ) - * @param mode simulate, or perform action? - * - * @return returns the number of items extracted, null - */ - StackType extractItems( StackType request, Actionable mode, BaseActionSource src ); - - /** - * request a full report of all available items, storage. - * - * @param out the IItemList the results will be written too - * - * @return returns same list that was passed in, is passed out - */ - IItemList getAvailableItems( IItemList out ); - - /** - * @return the type of channel your handler should be part of - */ - StorageChannel getChannel(); -} diff --git a/dependencies/main/java/appeng/api/storage/IMEInventoryHandler.java b/dependencies/main/java/appeng/api/storage/IMEInventoryHandler.java deleted file mode 100644 index f774091733..0000000000 --- a/dependencies/main/java/appeng/api/storage/IMEInventoryHandler.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import appeng.api.config.AccessRestriction; -import appeng.api.storage.data.IAEStack; - - -/** - * Thin logic layer that can be swapped with different IMEInventory implementations, used to handle features related to - * storage, that are Separate from the storage medium itself. - * - * @param - */ -public interface IMEInventoryHandler extends IMEInventory -{ - - /** - * determine if items can be injected/extracted. - * - * @return the access - */ - AccessRestriction getAccess(); - - /** - * determine if a particular item is prioritized for this inventory handler, if it is, then it will be added to this - * inventory prior to any non-prioritized inventories. - * - * @param input - item that might be added - * - * @return if its prioritized - */ - boolean isPrioritized( StackType input ); - - /** - * determine if an item can be accepted and stored. - * - * @param input - item that might be added - * - * @return if the item can be added - */ - boolean canAccept( StackType input ); - - /** - * determine what the priority of the inventory is. - * - * @return the priority, zero is default, positive and negative are supported. - */ - int getPriority(); - - /** - * pass back value for blinkCell. - * - * @return the slot index for the cell that this represents in the storage unit, the method on the - * {@link ICellContainer} will be called with this value, only trust the return value of this method if you - * are the implementer of this. - */ - int getSlot(); - - /** - * AE Uses a two pass placement system, the first pass checks contents and tries to find a place where the item - * belongs, however in some cases you can save processor time, or require that the second, or first pass is simply - * ignored, this allows you to do that. - * - * @param i - pass number ( 1 or 2 ) - * - * @return true, if this inventory is valid for this pass. - */ - boolean validForPass( int i ); -} diff --git a/dependencies/main/java/appeng/api/storage/IMEMonitor.java b/dependencies/main/java/appeng/api/storage/IMEMonitor.java deleted file mode 100644 index 752691e2f1..0000000000 --- a/dependencies/main/java/appeng/api/storage/IMEMonitor.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import appeng.api.networking.storage.IBaseMonitor; -import appeng.api.storage.data.IAEStack; -import appeng.api.storage.data.IItemList; - - -public interface IMEMonitor extends IMEInventoryHandler, IBaseMonitor -{ - - /** - * This method is discouraged when accessing data via a IMEMonitor - */ - @Override - @Deprecated - IItemList getAvailableItems( IItemList out ); - - /** - * Get access to the full item list of the network, preferred over {@link IMEInventory} .getAvailableItems(...) - * - * @return full storage list. - */ - IItemList getStorageList(); -} diff --git a/dependencies/main/java/appeng/api/storage/IMEMonitorHandlerReceiver.java b/dependencies/main/java/appeng/api/storage/IMEMonitorHandlerReceiver.java deleted file mode 100644 index 30bbb7451a..0000000000 --- a/dependencies/main/java/appeng/api/storage/IMEMonitorHandlerReceiver.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import appeng.api.networking.security.BaseActionSource; -import appeng.api.networking.storage.IBaseMonitor; -import appeng.api.storage.data.IAEStack; - - -public interface IMEMonitorHandlerReceiver -{ - - /** - * return true if this object should remain as a listener. - * - * @param verificationToken to be checked object - * - * @return true if object should remain as a listener - */ - boolean isValid( Object verificationToken ); - - /** - * called when changes are made to the Monitor, but only if listener is still valid. - * - * @param change done change - */ - void postChange( IBaseMonitor monitor, Iterable change, BaseActionSource actionSource ); - - /** - * called when the list updates its contents, this is mostly for handling power events. - */ - void onListUpdate(); -} diff --git a/dependencies/main/java/appeng/api/storage/ISaveProvider.java b/dependencies/main/java/appeng/api/storage/ISaveProvider.java deleted file mode 100644 index 7c046826c3..0000000000 --- a/dependencies/main/java/appeng/api/storage/ISaveProvider.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -public interface ISaveProvider -{ - - void saveChanges( IMEInventory cellInventory ); -} diff --git a/dependencies/main/java/appeng/api/storage/IStorageHelper.java b/dependencies/main/java/appeng/api/storage/IStorageHelper.java deleted file mode 100644 index c48b0e0aa3..0000000000 --- a/dependencies/main/java/appeng/api/storage/IStorageHelper.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; - -import appeng.api.networking.crafting.ICraftingLink; -import appeng.api.networking.crafting.ICraftingRequester; -import appeng.api.networking.energy.IEnergySource; -import appeng.api.networking.security.BaseActionSource; -import appeng.api.storage.data.IAEFluidStack; -import appeng.api.storage.data.IAEItemStack; -import appeng.api.storage.data.IItemList; - - -public interface IStorageHelper -{ - - /** - * load a crafting link from nbt data. - * - * @param data to be loaded data - * - * @return crafting link - */ - ICraftingLink loadCraftingLink( NBTTagCompound data, ICraftingRequester req ); - - /** - * @param is An ItemStack - * - * @return a new INSTANCE of {@link IAEItemStack} from a MC {@link ItemStack} - */ - IAEItemStack createItemStack( ItemStack is ); - - /** - * @param is A FluidStack - * - * @return a new INSTANCE of {@link IAEFluidStack} from a Forge {@link FluidStack} - */ - IAEFluidStack createFluidStack( FluidStack is ); - - /** - * @return a new INSTANCE of {@link IItemList} for items - */ - IItemList createItemList(); - - /** - * @return a new INSTANCE of {@link IItemList} for fluids - */ - IItemList createFluidList(); - - /** - * Read a AE Item Stack from a byte stream, returns a AE item stack or null. - * - * @param input to be loaded data - * - * @return item based of data - * - * @throws IOException if file could not be read - */ - IAEItemStack readItemFromPacket( ByteBuf input ) throws IOException; - - /** - * Read a AE Fluid Stack from a byte stream, returns a AE fluid stack or null. - * - * @param input to be loaded data - * - * @return fluid based on data - * - * @throws IOException if file could not be written - */ - IAEFluidStack readFluidFromPacket( ByteBuf input ) throws IOException; - - /** - * use energy from energy, to remove request items from cell, at the request of src. - * - * @param energy to be drained energy source - * @param cell cell of requested items - * @param request requested items - * @param src action source - * - * @return items that successfully extracted. - */ - IAEItemStack poweredExtraction( IEnergySource energy, IMEInventory cell, IAEItemStack request, BaseActionSource src ); - - /** - * use energy from energy, to inject input items into cell, at the request of src - * - * @param energy to be added energy source - * @param cell injected cell - * @param input to be injected items - * @param src action source - * - * @return items that failed to insert. - */ - IAEItemStack poweredInsert( IEnergySource energy, IMEInventory cell, IAEItemStack input, BaseActionSource src ); -} diff --git a/dependencies/main/java/appeng/api/storage/IStorageMonitorable.java b/dependencies/main/java/appeng/api/storage/IStorageMonitorable.java deleted file mode 100644 index 0954980955..0000000000 --- a/dependencies/main/java/appeng/api/storage/IStorageMonitorable.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import appeng.api.storage.data.IAEFluidStack; -import appeng.api.storage.data.IAEItemStack; - - -/** - * Exposes the monitorable network inventories of a grid node that choses to export them. - * This interface can only be obtained using Forge capabilities for {@link IStorageMonitorableAccessor}. - */ -public interface IStorageMonitorable -{ - - /** - * Access the item inventory for the monitorable storage. - */ - IMEMonitor getItemInventory(); - - /** - * Access the fluid inventory for the monitorable storage. - */ - IMEMonitor getFluidInventory(); -} diff --git a/dependencies/main/java/appeng/api/storage/IStorageMonitorableAccessor.java b/dependencies/main/java/appeng/api/storage/IStorageMonitorableAccessor.java deleted file mode 100644 index 33b0f30632..0000000000 --- a/dependencies/main/java/appeng/api/storage/IStorageMonitorableAccessor.java +++ /dev/null @@ -1,26 +0,0 @@ - -package appeng.api.storage; - - -import javax.annotation.Nullable; - -import appeng.api.networking.security.BaseActionSource; - - -/** - * Allows storage buses to request access to another ME network so it can be used as a subnetwork. - * This interface is used in conjunction with capabilities, so when an object of this is obtained, - * it already knows about which face the access was requested from. - *

- * To get access to the capability for this, use @CapabilityInject with this interface as the argument - * to the annotation. - */ -public interface IStorageMonitorableAccessor -{ - - /** - * @return Null if the network cannot be accessed by the given action source (i.e. security doesn't permit it). - */ - @Nullable - IStorageMonitorable getInventory( BaseActionSource src ); -} diff --git a/dependencies/main/java/appeng/api/storage/ITerminalHost.java b/dependencies/main/java/appeng/api/storage/ITerminalHost.java deleted file mode 100644 index f802b6d654..0000000000 --- a/dependencies/main/java/appeng/api/storage/ITerminalHost.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import appeng.api.util.IConfigurableObject; - - -public interface ITerminalHost extends IStorageMonitorable, IConfigurableObject -{ - -} diff --git a/dependencies/main/java/appeng/api/storage/MEMonitorHandler.java b/dependencies/main/java/appeng/api/storage/MEMonitorHandler.java deleted file mode 100644 index b962f3d1f9..0000000000 --- a/dependencies/main/java/appeng/api/storage/MEMonitorHandler.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map.Entry; - -import com.google.common.collect.ImmutableList; - -import appeng.api.config.AccessRestriction; -import appeng.api.config.Actionable; -import appeng.api.networking.security.BaseActionSource; -import appeng.api.storage.data.IAEStack; -import appeng.api.storage.data.IItemList; - - -/** - * Common implementation of a simple class that monitors injection/extraction of a inventory to send events to a list of - * listeners. - * - * @param - * @deprecated - * - * TODO: Needs to be redesigned to solve performance issues. Also should not be part of the API as class. - */ -@Deprecated -public class MEMonitorHandler implements IMEMonitor -{ - - private final IMEInventoryHandler internalHandler; - private final IItemList cachedList; - private final HashMap, Object> listeners = new HashMap, Object>(); - - protected boolean hasChanged = true; - - public MEMonitorHandler( final IMEInventoryHandler t ) - { - this.internalHandler = t; - this.cachedList = t.getChannel().createList(); - } - - public MEMonitorHandler( final IMEInventoryHandler t, final StorageChannel chan ) - { - this.internalHandler = t; - this.cachedList = chan.createList(); - } - - @Override - public void addListener( final IMEMonitorHandlerReceiver l, final Object verificationToken ) - { - this.listeners.put( l, verificationToken ); - } - - @Override - public void removeListener( final IMEMonitorHandlerReceiver l ) - { - this.listeners.remove( l ); - } - - @Override - public StackType injectItems( final StackType input, final Actionable mode, final BaseActionSource src ) - { - if( mode == Actionable.SIMULATE ) - { - return this.getHandler().injectItems( input, mode, src ); - } - return this.monitorDifference( input.copy(), this.getHandler().injectItems( input, mode, src ), false, src ); - } - - protected IMEInventoryHandler getHandler() - { - return this.internalHandler; - } - - private StackType monitorDifference( final IAEStack original, final StackType leftOvers, final boolean extraction, final BaseActionSource src ) - { - final StackType diff = (StackType) original.copy(); - - if( extraction ) - { - diff.setStackSize( leftOvers == null ? 0 : -leftOvers.getStackSize() ); - } - else if( leftOvers != null ) - { - diff.decStackSize( leftOvers.getStackSize() ); - } - - if( diff.getStackSize() != 0 ) - { - this.postChangesToListeners( ImmutableList.of( diff ), src ); - } - - return leftOvers; - } - - protected void postChangesToListeners( final Iterable changes, final BaseActionSource src ) - { - this.notifyListenersOfChange( changes, src ); - } - - protected void notifyListenersOfChange( final Iterable diff, final BaseActionSource src ) - { - this.hasChanged = true;// need to update the cache. - final Iterator, Object>> i = this.getListeners(); - while( i.hasNext() ) - { - final Entry, Object> o = i.next(); - final IMEMonitorHandlerReceiver receiver = o.getKey(); - if( receiver.isValid( o.getValue() ) ) - { - receiver.postChange( this, diff, src ); - } - else - { - i.remove(); - } - } - } - - protected Iterator, Object>> getListeners() - { - return this.listeners.entrySet().iterator(); - } - - @Override - public StackType extractItems( final StackType request, final Actionable mode, final BaseActionSource src ) - { - if( mode == Actionable.SIMULATE ) - { - return this.getHandler().extractItems( request, mode, src ); - } - return this.monitorDifference( request.copy(), this.getHandler().extractItems( request, mode, src ), true, src ); - } - - @Override - public StorageChannel getChannel() - { - return this.getHandler().getChannel(); - } - - @Override - public AccessRestriction getAccess() - { - return this.getHandler().getAccess(); - } - - @Override - public IItemList getStorageList() - { - if( this.hasChanged ) - { - this.hasChanged = false; - this.cachedList.resetStatus(); - return this.getAvailableItems( this.cachedList ); - } - - return this.cachedList; - } - - @Override - public boolean isPrioritized( final StackType input ) - { - return this.getHandler().isPrioritized( input ); - } - - @Override - public boolean canAccept( final StackType input ) - { - return this.getHandler().canAccept( input ); - } - - @Override - public IItemList getAvailableItems( final IItemList out ) - { - return this.getHandler().getAvailableItems( out ); - } - - @Override - public int getPriority() - { - return this.getHandler().getPriority(); - } - - @Override - public int getSlot() - { - return this.getHandler().getSlot(); - } - - @Override - public boolean validForPass( final int i ) - { - return this.getHandler().validForPass( i ); - } - -} diff --git a/dependencies/main/java/appeng/api/storage/StorageChannel.java b/dependencies/main/java/appeng/api/storage/StorageChannel.java deleted file mode 100644 index 2e57310f34..0000000000 --- a/dependencies/main/java/appeng/api/storage/StorageChannel.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage; - - -import appeng.api.AEApi; -import appeng.api.storage.data.IAEFluidStack; -import appeng.api.storage.data.IAEItemStack; -import appeng.api.storage.data.IAEStack; -import appeng.api.storage.data.IItemList; - - -public enum StorageChannel -{ - /** - * AE2's Default Storage. - */ - ITEMS( IAEItemStack.class ), - - /** - * AE2's Fluid Based Storage ( mainly added to better support ExtraCells ) - */ - FLUIDS( IAEFluidStack.class ); - - public final Class type; - - StorageChannel( final Class t ) - { - this.type = t; - } - - public IItemList createList() - { - if( this == ITEMS ) - { - return AEApi.instance().storage().createItemList(); - } - else - { - return AEApi.instance().storage().createFluidList(); - } - } -} diff --git a/dependencies/main/java/appeng/api/storage/data/IAEFluidStack.java b/dependencies/main/java/appeng/api/storage/data/IAEFluidStack.java deleted file mode 100644 index b33bfa6260..0000000000 --- a/dependencies/main/java/appeng/api/storage/data/IAEFluidStack.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage.data; - - -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - - -/** - * An alternate version of FluidStack for AE to keep tabs on things easier, and - * to support larger storage. stackSizes of getFluidStack will be capped. - * - * You may hold on to these if you want, just make sure you let go of them when - * your not using them. - * - * Don't Implement. - * - * Construct with Util.createFluidStack( FluidStack ) - */ -public interface IAEFluidStack extends IAEStack -{ - - /** - * creates a standard Forge FluidStack for the fluid. - * - * @return new FluidStack - */ - FluidStack getFluidStack(); - - /** - * Combines two IAEItemStacks via addition. - * - * @param option , to add to the current one. - */ - @Override - void add( IAEFluidStack option ); - - /** - * create a AE Fluid clone. - * - * @return the copy. - */ - @Override - IAEFluidStack copy(); - - /** - * quick way to get access to the Forge Fluid Definition. - * - * @return fluid definition - */ - Fluid getFluid(); -} diff --git a/dependencies/main/java/appeng/api/storage/data/IAEItemStack.java b/dependencies/main/java/appeng/api/storage/data/IAEItemStack.java deleted file mode 100644 index 3da0fdb5b2..0000000000 --- a/dependencies/main/java/appeng/api/storage/data/IAEItemStack.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage.data; - - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - - -/** - * An alternate version of ItemStack for AE to keep tabs on things easier, and to support larger storage. stackSizes of - * getItemStack will be capped. - * - * You may hold on to these if you want, just make sure you let go of them when your not using them. - * - * Don't Implement. - * - * Construct with Util.createItemStack( ItemStack ) - */ -public interface IAEItemStack extends IAEStack -{ - - /** - * creates a standard MC ItemStack for the item. - * - * @return new ItemStack - */ - ItemStack getItemStack(); - - /** - * is there NBT Data for this item? - * - * @return if there is - */ - boolean hasTagCompound(); - - /** - * Combines two IAEItemStacks via addition. - * - * @param option to add to the current one. - */ - @Override - void add( IAEItemStack option ); - - /** - * create a AE Item clone - * - * @return the copy - */ - @Override - IAEItemStack copy(); - - /** - * quick way to get access to the MC Item Definition. - * - * @return item definition - */ - Item getItem(); - - /** - * @return the items damage value - */ - int getItemDamage(); - - /** - * Compare the Ore Dictionary ID for this to another item. - */ - boolean sameOre( IAEItemStack is ); - - /** - * compare the item/damage/nbt of the stack. - * - * @param otherStack to be compared item - * - * @return true if it is the same type (same item, damage, nbt) - */ - boolean isSameType( IAEItemStack otherStack ); - - /** - * compare the item/damage/nbt of the stack. - * - * @param stored to be compared item - * - * @return true if it is the same type (same item, damage, nbt) - */ - boolean isSameType( ItemStack stored ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/storage/data/IAEStack.java b/dependencies/main/java/appeng/api/storage/data/IAEStack.java deleted file mode 100644 index adc877cf33..0000000000 --- a/dependencies/main/java/appeng/api/storage/data/IAEStack.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage.data; - - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; - -import net.minecraft.nbt.NBTTagCompound; - -import appeng.api.config.FuzzyMode; -import appeng.api.storage.StorageChannel; - - -public interface IAEStack -{ - - /** - * add two stacks together - * - * @param is added item - */ - void add( StackType is ); - - /** - * number of items in the stack. - * - * @return basically ItemStack.stackSize - */ - long getStackSize(); - - /** - * changes the number of items in the stack. - * - * @param stackSize , ItemStack.stackSize = N - */ - StackType setStackSize( long stackSize ); - - /** - * Same as getStackSize, but for requestable items. ( LP ) - * - * @return basically itemStack.stackSize but for requestable items. - */ - long getCountRequestable(); - - /** - * Same as setStackSize, but for requestable items. ( LP ) - * - * @return basically itemStack.stackSize = N but for setStackSize items. - */ - StackType setCountRequestable( long countRequestable ); - - /** - * true, if the item can be crafted. - * - * @return true, if it can be crafted. - */ - boolean isCraftable(); - - /** - * change weather the item can be crafted. - * - * @param isCraftable can item be crafted - */ - StackType setCraftable( boolean isCraftable ); - - /** - * clears, requestable, craftable, and stack sizes. - */ - StackType reset(); - - /** - * returns true, if the item can be crafted, requested, or extracted. - * - * @return isThisRecordMeaningful - */ - boolean isMeaningful(); - - /** - * Adds more to the stack size... - * - * @param i additional stack size - */ - void incStackSize( long i ); - - /** - * removes some from the stack size. - */ - void decStackSize( long i ); - - /** - * adds items to the requestable - * - * @param i increased amount of requested items - */ - void incCountRequestable( long i ); - - /** - * removes items from the requestable - * - * @param i decreased amount of requested items - */ - void decCountRequestable( long i ); - - /** - * write to a NBTTagCompound. - * - * @param i to be written data - */ - void writeToNBT( NBTTagCompound i ); - - /** - * Compare stacks using precise logic. - * - * a IAEItemStack to another AEItemStack or a ItemStack. - * - * or - * - * IAEFluidStack, FluidStack - * - * @param obj compared object - * - * @return true if they are the same. - */ - @Override - boolean equals( Object obj ); - - /** - * compare stacks using fuzzy logic - * - * a IAEItemStack to another AEItemStack or a ItemStack. - * - * @param st stacks - * @param mode used fuzzy mode - * - * @return true if two stacks are equal based on AE Fuzzy Comparison. - */ - boolean fuzzyComparison( Object st, FuzzyMode mode ); - - /** - * Slower for disk saving, but smaller/more efficient for packets. - * - * @param data to be written data - * - * @throws IOException - */ - void writeToPacket( ByteBuf data ) throws IOException; - - /** - * Clone the Item / Fluid Stack - * - * @return a new Stack, which is copied from the original. - */ - StackType copy(); - - /** - * create an empty stack. - * - * @return a new stack, which represents an empty copy of the original. - */ - StackType empty(); - - /** - * obtain the NBT Data for the item. - * - * @return nbt data - */ - IAETagCompound getTagCompound(); - - /** - * @return true if the stack is a {@link IAEItemStack} - */ - boolean isItem(); - - /** - * @return true if the stack is a {@link IAEFluidStack} - */ - boolean isFluid(); - - /** - * @return ITEM or FLUID - */ - StorageChannel getChannel(); -} diff --git a/dependencies/main/java/appeng/api/storage/data/IAETagCompound.java b/dependencies/main/java/appeng/api/storage/data/IAETagCompound.java deleted file mode 100644 index bd4b57b8b4..0000000000 --- a/dependencies/main/java/appeng/api/storage/data/IAETagCompound.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage.data; - - -import net.minecraft.nbt.NBTTagCompound; - -import appeng.api.features.IItemComparison; - - -/** - * Don't cast this... either compare with it, or copy it. - * - * Don't Implement. - */ -public interface IAETagCompound -{ - - /** - * @return a copy ( the copy will not be a IAETagCompound, it will be a NBTTagCompound ) - */ - NBTTagCompound getNBTTagCompoundCopy(); - - /** - * compare to other NBTTagCompounds or IAETagCompounds - * - * @param a compared object - * - * @return true, if they are the same. - */ - @Override - boolean equals( Object a ); - - /** - * @return the special comparison for this tag - */ - IItemComparison getSpecialComparison(); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/storage/data/IItemContainer.java b/dependencies/main/java/appeng/api/storage/data/IItemContainer.java deleted file mode 100644 index 049a52f87f..0000000000 --- a/dependencies/main/java/appeng/api/storage/data/IItemContainer.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage.data; - - -import java.util.Collection; - -import appeng.api.config.FuzzyMode; - - -/** - * Represents a list of items in AE. - * - * Don't Implement. - * - * Construct with Util.createItemList() - */ -public interface IItemContainer -{ - - /** - * add a stack to the list, this will merge the stack with an item already in the list if found. - * - * @param option added stack - */ - void add( StackType option ); // adds stack as is - - /** - * @param i compared item - * - * @return a stack equivalent to the stack passed in, but with the correct stack size information, or null if its - * not present - */ - StackType findPrecise( StackType i ); - - /** - * @param input compared item - * - * @return a list of relevant fuzzy matched stacks - */ - Collection findFuzzy( StackType input, FuzzyMode fuzzy ); - - /** - * @return true if there are no items in the list - */ - boolean isEmpty(); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/storage/data/IItemList.java b/dependencies/main/java/appeng/api/storage/data/IItemList.java deleted file mode 100644 index 113ad87fa2..0000000000 --- a/dependencies/main/java/appeng/api/storage/data/IItemList.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.storage.data; - - -import java.util.Iterator; - - -/** - * Represents a list of items in AE. - * - * Don't Implement. - * - * Construct with Util.createItemList() - */ -public interface IItemList extends IItemContainer, Iterable -{ - - /** - * add a stack to the list stackSize is used to add to stackSize, this will merge the stack with an item already in - * the list if found. - * - * @param option stacktype option - */ - void addStorage( StackType option ); // adds a stack as stored - - /** - * add a stack to the list as craftable, this will merge the stack with an item already in the list if found. - * - * @param option stacktype option - */ - void addCrafting( StackType option ); - - /** - * add a stack to the list, stack size is used to add to requestable, this will merge the stack with an item already - * in the list if found. - * - * @param option stacktype option - */ - void addRequestable( StackType option ); // adds a stack as requestable - - /** - * @return the first item in the list - */ - StackType getFirstItem(); - - /** - * @return the number of items in the list - */ - int size(); - - /** - * allows you to iterate the list. - */ - @Override - Iterator iterator(); - - /** - * resets stack sizes to 0. - */ - void resetStatus(); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/util/AEAxisAlignedBB.java b/dependencies/main/java/appeng/api/util/AEAxisAlignedBB.java deleted file mode 100644 index 70776b79d9..0000000000 --- a/dependencies/main/java/appeng/api/util/AEAxisAlignedBB.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api.util; - - -import net.minecraft.util.math.AxisAlignedBB; - - -/** - * Mutable stand in for Axis Aligned BB, this was used to prevent GC Thrashing.. Related code could also be re-written. - * - * TODO: Replace with interface and maybe factory should it ever be needed for addons. - */ -public class AEAxisAlignedBB -{ - public double minX; - public double minY; - public double minZ; - public double maxX; - public double maxY; - public double maxZ; - - public AxisAlignedBB getBoundingBox() - { - return new AxisAlignedBB( this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ ); - } - - public AEAxisAlignedBB( final double a, final double b, final double c, final double d, final double e, final double f ) - { - this.minX = a; - this.minY = b; - this.minZ = c; - this.maxX = d; - this.maxY = e; - this.maxZ = f; - } - - public static AEAxisAlignedBB fromBounds( final double a, final double b, final double c, final double d, final double e, final double f ) - { - return new AEAxisAlignedBB( a, b, c, d, e, f ); - } - - public static AEAxisAlignedBB fromBounds( final AxisAlignedBB bb ) - { - return new AEAxisAlignedBB( bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ ); - } -} diff --git a/dependencies/main/java/appeng/api/util/AECableType.java b/dependencies/main/java/appeng/api/util/AECableType.java deleted file mode 100644 index 33cee58289..0000000000 --- a/dependencies/main/java/appeng/api/util/AECableType.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.util; - - -public enum AECableType -{ - /** - * No Cable present. - */ - NONE, - - /** - * Connections to this block should render as glass. - */ - GLASS, - - /** - * Connections to this block should render as covered. - */ - COVERED, - - /** - * Connections to this block should render as smart. - */ - SMART, - - /** - * Dense Cable, represents a tier 2 block that can carry 32 channels. - */ - DENSE; - - public static final AECableType[] VALIDCABLES = { - GLASS, - COVERED, - SMART, - DENSE - }; - -} diff --git a/dependencies/main/java/appeng/api/util/AEColor.java b/dependencies/main/java/appeng/api/util/AEColor.java deleted file mode 100644 index cd650cc80a..0000000000 --- a/dependencies/main/java/appeng/api/util/AEColor.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.util; - - -import java.util.Arrays; -import java.util.List; - -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.item.EnumDyeColor; -import net.minecraft.util.text.translation.I18n; - - -/** - * List of all colors supported by AE, their names, and various colors for display. - * - * Should be the same order as Dyes, excluding Transparent. - */ -public enum AEColor -{ - - WHITE( "gui.appliedenergistics2.White", EnumDyeColor.WHITE, 0xBEBEBE, 0xDBDBDB, 0xFAFAFA ), - - ORANGE( "gui.appliedenergistics2.Orange", EnumDyeColor.ORANGE, 0xF99739, 0xFAAE44, 0xF4DEC3 ), - - MAGENTA( "gui.appliedenergistics2.Magenta", EnumDyeColor.MAGENTA, 0x821E82, 0xB82AB8, 0xC598C8 ), - - LIGHT_BLUE( "gui.appliedenergistics2.LightBlue", EnumDyeColor.LIGHT_BLUE, 0x628DCB, 0x82ACE7, 0xD8F6FF ), - - YELLOW( "gui.appliedenergistics2.Yellow", EnumDyeColor.YELLOW, 0xFFF7AA, 0xF8FF4A, 0xFFFFE8 ), - - LIME( "gui.appliedenergistics2.Lime", EnumDyeColor.LIME, 0x7CFF4A, 0xBBFF51, 0xE7F7D7 ), - - PINK( "gui.appliedenergistics2.Pink", EnumDyeColor.PINK, 0xDC8DB5, 0xF8B5D7, 0xF7DEEB ), - - GRAY( "gui.appliedenergistics2.Gray", EnumDyeColor.GRAY, 0x7C7C7C, 0xA0A0A0, 0xC9C9C9 ), - - LIGHT_GRAY( "gui.appliedenergistics2.LightGray", EnumDyeColor.SILVER, 0x9D9D9D, 0xCDCDCD, 0xEFEFEF ), - - CYAN( "gui.appliedenergistics2.Cyan", EnumDyeColor.CYAN, 0x2F9BA5, 0x51AAC6, 0xAEDDF4 ), - - PURPLE( "gui.appliedenergistics2.Purple", EnumDyeColor.PURPLE, 0x8230B2, 0xA453CE, 0xC7A3CC ), - - BLUE( "gui.appliedenergistics2.Blue", EnumDyeColor.BLUE, 0x2D29A0, 0x514AFF, 0xDDE6FF ), - - BROWN( "gui.appliedenergistics2.Brown", EnumDyeColor.BROWN, 0x724E35, 0xB7967F, 0xE0D2C8 ), - - GREEN( "gui.appliedenergistics2.Green", EnumDyeColor.GREEN, 0x45A021, 0x60E32E, 0xE3F2E3 ), - - RED( "gui.appliedenergistics2.Red", EnumDyeColor.RED, 0xA50029, 0xFF003C, 0xFFE6ED ), - - BLACK( "gui.appliedenergistics2.Black", EnumDyeColor.BLACK, 0x2B2B2B, 0x565656, 0x848484 ), - - TRANSPARENT( "gui.appliedenergistics2.Fluix", null, 0x1B2344, 0x895CA8, 0xD7BBEC ); - - public static final List VALID_COLORS = Arrays.asList( WHITE, ORANGE, MAGENTA, LIGHT_BLUE, YELLOW, LIME, PINK, GRAY, LIGHT_GRAY, CYAN, PURPLE, BLUE, BROWN, GREEN, RED, BLACK ); - - /** - * The {@link BakedQuad#getTintIndex() tint index} that can normally be used to get the {@link #blackVariant dark variant} of the apprioriate AE color. - */ - public static final int TINTINDEX_DARK = 1; - - /** - * The {@link BakedQuad#getTintIndex() tint index} that can normally be used to get the {@link #mediumVariant medium variant} of the apprioriate AE color. - */ - public static final int TINTINDEX_MEDIUM = 2; - - /** - * The {@link BakedQuad#getTintIndex() tint index} that can normally be used to get the {@link #whiteVariant bright variant} of the apprioriate AE color. - */ - public static final int TINTINDEX_BRIGHT = 3; - - /** - * The {@link BakedQuad#getTintIndex() tint index} that can normally be used to get a color between the {@link #mediumVariant medium} - * and {@link #whiteVariant bright variant} of the apprioriate AE color. - */ - public static final int TINTINDEX_MEDIUM_BRIGHT = 4; - - /** - * Unlocalized name for color. - */ - public final String unlocalizedName; - - /** - * Darkest Variant of the color, nearly black; as a RGB HEX Integer - */ - public final int blackVariant; - - /** - * The Variant of the color that is used to represent the color normally; as a RGB HEX Integer - */ - public final int mediumVariant; - - /** - * Lightest Variant of the color, nearly white; as a RGB HEX Integer - */ - public final int whiteVariant; - - /** - * Vanilla Dye Equivilient - */ - public final EnumDyeColor dye; - - AEColor( final String unlocalizedName, final EnumDyeColor dye, final int blackHex, final int medHex, final int whiteHex ) - { - this.unlocalizedName = unlocalizedName; - this.blackVariant = blackHex; - this.mediumVariant = medHex; - this.whiteVariant = whiteHex; - this.dye = dye; - } - - /** - * Will return a variant of this color based on the given tint index. - * - * @param tintIndex A tint index as it can be used for {@link BakedQuad#getTintIndex()}. - * @return The appropriate color variant, or -1. - */ - public int getVariantByTintIndex( int tintIndex ) - { - switch( tintIndex ) - { - // Please note that tintindex 0 is hardcoded for the block breaking particles. Returning anything other than -1 for tintindex=0 here - // will cause issues with those particles - case 0: - return -1; - case TINTINDEX_DARK: - return blackVariant; - case TINTINDEX_MEDIUM: - return mediumVariant; - case TINTINDEX_BRIGHT: - return whiteVariant; - case TINTINDEX_MEDIUM_BRIGHT: - final int light = whiteVariant; - final int dark = mediumVariant; - return ( ( ( ( ( light >> 16 ) & 0xff ) + ( ( dark >> 16 ) & 0xff ) ) / 2 ) << 16 ) | ( ( ( ( ( light >> 8 ) & 0xff ) + ( ( dark >> 8 ) & 0xff ) ) / 2 ) << 8 ) | ( ( ( ( light ) & 0xff ) + ( ( dark ) & 0xff ) ) / 2 ); - default: - return -1; - } - } - - /** - * Logic to see which colors match each other.. special handle for Transparent - */ - public boolean matches( final AEColor color ) - { - return this == TRANSPARENT || color == TRANSPARENT || this == color; - } - - @Override - public String toString() - { - return I18n.translateToLocal( this.unlocalizedName ); - } - -} diff --git a/dependencies/main/java/appeng/api/util/AEColoredItemDefinition.java b/dependencies/main/java/appeng/api/util/AEColoredItemDefinition.java deleted file mode 100644 index 71367e8627..0000000000 --- a/dependencies/main/java/appeng/api/util/AEColoredItemDefinition.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.util; - - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - - -public interface AEColoredItemDefinition -{ - - /** - * @return the {@link Block} Implementation if applicable - */ - Block block( AEColor color ); - - /** - * @return the {@link Item} Implementation if applicable - */ - Item item( AEColor color ); - - /** - * @return the {@link TileEntity} Class if applicable. - */ - Class entity( AEColor color ); - - /** - * @return an {@link ItemStack} with specified quantity of this item. - */ - ItemStack stack( AEColor color, int stackSize ); - - /** - * @param stackSize - stack size of the result. - * - * @return an array of all colors. - */ - ItemStack[] allStacks( int stackSize ); - - /** - * Compare {@link ItemStack} with this - * - * @param color compared color of item - * @param comparableItem compared item - * - * @return true if the item stack is a matching item. - */ - boolean sameAs( AEColor color, ItemStack comparableItem ); -} diff --git a/dependencies/main/java/appeng/api/util/AEPartLocation.java b/dependencies/main/java/appeng/api/util/AEPartLocation.java deleted file mode 100644 index 92fc7523ed..0000000000 --- a/dependencies/main/java/appeng/api/util/AEPartLocation.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.api.util; - - -import net.minecraft.util.EnumFacing; - - -/** - * Stand in for previous Forge Direction, Several uses of this class are simply legacy where as some uses of this class - * are intended. - */ -public enum AEPartLocation -{ - /** - * Negative Y - */ - DOWN( 0, -1, 0 ), - - /** - * Positive Y - */ - UP( 0, 1, 0 ), - - /** - * Negative Z - */ - NORTH( 0, 0, -1 ), - - /** - * Positive Z - */ - SOUTH( 0, 0, 1 ), - - /** - * Negative X - */ - WEST( -1, 0, 0 ), - - /** - * Posative X - */ - EAST( 1, 0, 0 ), - - /** - * Center or inside of the block. - */ - INTERNAL( 0, 0, 0 ); - - public final int xOffset; - public final int yOffset; - public final int zOffset; - - private static final EnumFacing[] facings = { EnumFacing.DOWN, EnumFacing.UP, EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.WEST, EnumFacing.EAST, null }; - private static final int[] OPPOSITES = { 1, 0, 3, 2, 5, 4, 6 }; - - public static final AEPartLocation[] SIDE_LOCATIONS = { DOWN, UP, NORTH, SOUTH, WEST, EAST }; - - private AEPartLocation( final int x, final int y, final int z ) - { - this.xOffset = x; - this.yOffset = y; - this.zOffset = z; - } - - /** - * @return Part Location - */ - public static AEPartLocation fromOrdinal( final int id ) - { - if( id >= 0 && id < SIDE_LOCATIONS.length ) - { - return SIDE_LOCATIONS[id]; - } - - return INTERNAL; - } - - /** - * 100% chance of success. - * - * @param side - * @return proper Part Location for a facing enum. - */ - public static AEPartLocation fromFacing( final EnumFacing side ) - { - if( side == null ) - { - return INTERNAL; - } - return values()[side.ordinal()]; - } - - /** - * @return Opposite Part Location, INTERNAL remains INTERNAL. - */ - public AEPartLocation getOpposite() - { - return fromOrdinal( OPPOSITES[this.ordinal()] ); - } - - /** - * @return EnumFacing Equivalence, if Center returns null. - */ - public EnumFacing getFacing() - { - return facings[this.ordinal()]; - } - -} diff --git a/dependencies/main/java/appeng/api/util/DimensionalCoord.java b/dependencies/main/java/appeng/api/util/DimensionalCoord.java deleted file mode 100644 index 6b03a80b41..0000000000 --- a/dependencies/main/java/appeng/api/util/DimensionalCoord.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.util; - - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - - -/** - * Represents a location in the Minecraft Universe - */ -public class DimensionalCoord extends WorldCoord -{ - - private final World w; - private final int dimId; - - public DimensionalCoord( final DimensionalCoord s ) - { - super( s.x, s.y, s.z ); - this.w = s.w; - this.dimId = s.dimId; - } - - public DimensionalCoord( final TileEntity s ) - { - super( s ); - this.w = s.getWorld(); - this.dimId = this.w.provider.getDimension(); - } - - public DimensionalCoord( final World _w, final int x, final int y, final int z ) - { - super( x, y, z ); - this.w = _w; - this.dimId = _w.provider.getDimension(); - } - - public DimensionalCoord( final World _w, final BlockPos pos ) - { - super( pos ); - this.w = _w; - this.dimId = _w.provider.getDimension(); - } - - @Override - public DimensionalCoord copy() - { - return new DimensionalCoord( this ); - } - - @Override - public int hashCode() - { - return super.hashCode() ^ this.dimId; - } - - @Override - public boolean equals( final Object obj ) - { - return obj instanceof DimensionalCoord && this.isEqual( (DimensionalCoord) obj ); - } - - public boolean isEqual( final DimensionalCoord c ) - { - return this.x == c.x && this.y == c.y && this.z == c.z && c.w == this.w; - } - - @Override - public String toString() - { - return "dimension=" + this.dimId + ", " + super.toString(); - } - - public boolean isInWorld( final World world ) - { - return this.w == world; - } - - public World getWorld() - { - return this.w; - } - -} diff --git a/dependencies/main/java/appeng/api/util/ICommonTile.java b/dependencies/main/java/appeng/api/util/ICommonTile.java deleted file mode 100644 index e6431aa492..0000000000 --- a/dependencies/main/java/appeng/api/util/ICommonTile.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.util; - - -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - - -public interface ICommonTile -{ - - /** - * implemented on AE's Tile Entities, Gets a list of drops that the entity will normally drop, this doesn't include - * the block itself. - * - * @param world world of tile entity - * @param pos location of the block - * @param drops drops of tile entity - */ - void getDrops( World world, BlockPos pos, List drops ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/util/IConfigManager.java b/dependencies/main/java/appeng/api/util/IConfigManager.java deleted file mode 100644 index 9b4dad4ccc..0000000000 --- a/dependencies/main/java/appeng/api/util/IConfigManager.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.util; - - -import java.util.Set; - -import net.minecraft.nbt.NBTTagCompound; - -import appeng.api.config.Settings; - - -/** - * Used to adjust settings on an object, - * - * Obtained via {@link IConfigurableObject} - */ -public interface IConfigManager -{ - - /** - * get a list of different settings - * - * @return enum set of settings - */ - Set getSettings(); - - /** - * used to initialize the configuration manager, should be called for all settings. - * - * @param settingName name of setting - * @param defaultValue default value of setting - */ - void registerSetting( Settings settingName, Enum defaultValue ); - - /** - * Get Value of a particular setting - * - * @param settingName name of setting - * - * @return value of setting - */ - Enum getSetting( Settings settingName ); - - /** - * Change setting - * - * @param settingName to be changed setting - * @param newValue new value for setting - * - * @return changed setting - */ - Enum putSetting( Settings settingName, Enum newValue ); - - /** - * write all settings to the NBT Tag so they can be read later. - * - * @param destination to be written nbt tag - */ - void writeToNBT( NBTTagCompound destination ); - - /** - * Only works after settings have been registered - * - * @param src to be read nbt tag - */ - void readFromNBT( NBTTagCompound src ); -} diff --git a/dependencies/main/java/appeng/api/util/IConfigurableObject.java b/dependencies/main/java/appeng/api/util/IConfigurableObject.java deleted file mode 100644 index e25e74035f..0000000000 --- a/dependencies/main/java/appeng/api/util/IConfigurableObject.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.util; - - -/** - * Implemented by various Tiles or Parts in AE - */ -public interface IConfigurableObject -{ - - /** - * get the config manager for the object. - */ - IConfigManager getConfigManager(); -} diff --git a/dependencies/main/java/appeng/api/util/INetworkToolAgent.java b/dependencies/main/java/appeng/api/util/INetworkToolAgent.java deleted file mode 100644 index 01a2808314..0000000000 --- a/dependencies/main/java/appeng/api/util/INetworkToolAgent.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.util; - -import net.minecraft.util.math.RayTraceResult; - -/** - * Implement on Tile or part to customize if the info gui opens, or an action is preformed. - */ -public interface INetworkToolAgent -{ - - boolean showNetworkInfo( RayTraceResult where ); -} diff --git a/dependencies/main/java/appeng/api/util/IOrientable.java b/dependencies/main/java/appeng/api/util/IOrientable.java deleted file mode 100644 index 6a5a366579..0000000000 --- a/dependencies/main/java/appeng/api/util/IOrientable.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.util; - - -import net.minecraft.util.EnumFacing; - - -/** - * Nearly all of AE's Tile Entities implement IOrientable. - * - * and it can be used to manipulate the direction of some machines, most of these orientations are purely visual. - * - * AE also responds to Block.rotateBlock - */ -public interface IOrientable -{ - - /** - * @return true or false, if the tile rotation is meaningful, or even changeable - */ - boolean canBeRotated(); - - /** - * @return the direction the tile is facing - */ - EnumFacing getForward(); - - /** - * @return the direction top of the tile - */ - EnumFacing getUp(); - - /** - * Update the orientation - * - * @param Forward new forward direction - * @param Up new upwards direction - */ - void setOrientation( EnumFacing Forward, EnumFacing Up ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/util/IOrientableBlock.java b/dependencies/main/java/appeng/api/util/IOrientableBlock.java deleted file mode 100644 index 297af6b785..0000000000 --- a/dependencies/main/java/appeng/api/util/IOrientableBlock.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.util; - - -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; - - -/** - * Implemented on many of AE's non Tile Entity Blocks as a way to get a IOrientable. - */ -public interface IOrientableBlock -{ - - /** - * @return if this block uses metadata to store its rotation. - */ - boolean usesMetadata(); - - /** - * @param world world of block - * @param x x pos of block - * @param y y pos of block - * @param z z pos of block - * - * @return a IOrientable if applicable - */ - IOrientable getOrientable( IBlockAccess world, BlockPos z ); -} \ No newline at end of file diff --git a/dependencies/main/java/appeng/api/util/IReadOnlyCollection.java b/dependencies/main/java/appeng/api/util/IReadOnlyCollection.java deleted file mode 100644 index 84e042ae7b..0000000000 --- a/dependencies/main/java/appeng/api/util/IReadOnlyCollection.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.util; - - -public interface IReadOnlyCollection extends Iterable -{ - - /** - * @return the objects in in the set. - */ - int size(); - - /** - * @return true if there are objects in the set - */ - boolean isEmpty(); - - /** - * @return return true if the object is part of the set. - */ - boolean contains( Object node ); -} diff --git a/dependencies/main/java/appeng/api/util/WorldCoord.java b/dependencies/main/java/appeng/api/util/WorldCoord.java deleted file mode 100644 index 75d10853a0..0000000000 --- a/dependencies/main/java/appeng/api/util/WorldCoord.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package appeng.api.util; - - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; - - -/** - * Represents a relative coordinate, either relative to another object, or - * relative to the origin of a dimension. - * - * TODO: Consider replacing with {@link BlockPos} - */ -public class WorldCoord -{ - - public int x; - public int y; - public int z; - - public WorldCoord( final TileEntity s ) - { - this( s.getPos() ); - } - - public WorldCoord( final int _x, final int _y, final int _z ) - { - this.x = _x; - this.y = _y; - this.z = _z; - } - - public WorldCoord( final BlockPos pos ) - { - this.x = pos.getX(); - this.y = pos.getY(); - this.z = pos.getZ(); - } - - public WorldCoord subtract( final AEPartLocation direction, final int length ) - { - this.x -= direction.xOffset * length; - this.y -= direction.yOffset * length; - this.z -= direction.zOffset * length; - return this; - } - - public WorldCoord add( final int _x, final int _y, final int _z ) - { - this.x += _x; - this.y += _y; - this.z += _z; - return this; - } - - public WorldCoord subtract( final int _x, final int _y, final int _z ) - { - this.x -= _x; - this.y -= _y; - this.z -= _z; - return this; - } - - public WorldCoord multiple( final int _x, final int _y, final int _z ) - { - this.x *= _x; - this.y *= _y; - this.z *= _z; - return this; - } - - public WorldCoord divide( final int _x, final int _y, final int _z ) - { - this.x /= _x; - this.y /= _y; - this.z /= _z; - return this; - } - - /** - * Will Return NULL if it's at some diagonal! - */ - public AEPartLocation directionTo( final WorldCoord loc ) - { - final int ox = this.x - loc.x; - final int oy = this.y - loc.y; - final int oz = this.z - loc.z; - - final int xlen = Math.abs( ox ); - final int ylen = Math.abs( oy ); - final int zlen = Math.abs( oz ); - - if( loc.isEqual( this.copy().add( AEPartLocation.EAST, xlen ) ) ) - { - return AEPartLocation.EAST; - } - - if( loc.isEqual( this.copy().add( AEPartLocation.WEST, xlen ) ) ) - { - return AEPartLocation.WEST; - } - - if( loc.isEqual( this.copy().add( AEPartLocation.NORTH, zlen ) ) ) - { - return AEPartLocation.NORTH; - } - - if( loc.isEqual( this.copy().add( AEPartLocation.SOUTH, zlen ) ) ) - { - return AEPartLocation.SOUTH; - } - - if( loc.isEqual( this.copy().add( AEPartLocation.UP, ylen ) ) ) - { - return AEPartLocation.UP; - } - - if( loc.isEqual( this.copy().add( AEPartLocation.DOWN, ylen ) ) ) - { - return AEPartLocation.DOWN; - } - - return null; - } - - public boolean isEqual( final WorldCoord c ) - { - return this.x == c.x && this.y == c.y && this.z == c.z; - } - - public WorldCoord add( final AEPartLocation direction, final int length ) - { - this.x += direction.xOffset * length; - this.y += direction.yOffset * length; - this.z += direction.zOffset * length; - return this; - } - - public WorldCoord copy() - { - return new WorldCoord( this.x, this.y, this.z ); - } - - @Override - public int hashCode() - { - return ( this.y << 24 ) ^ this.x ^ this.z; - } - - @Override - public boolean equals( final Object obj ) - { - return obj instanceof WorldCoord && this.isEqual( (WorldCoord) obj ); - } - - public BlockPos getPos() - { - return new BlockPos( this.x, this.y, this.z ); - } - - @Override - public String toString() - { - return "x=" + this.x + ", y=" + this.y + ", z=" + this.z; - } -} diff --git a/dependencies/main/java/biomesoplenty/api/item/BOPItems.java b/dependencies/main/java/biomesoplenty/api/item/BOPItems.java deleted file mode 100644 index a919ac8b9f..0000000000 --- a/dependencies/main/java/biomesoplenty/api/item/BOPItems.java +++ /dev/null @@ -1,133 +0,0 @@ -/******************************************************************************* - * Copyright 2014-2016, the Biomes O' Plenty Team - * - * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. - * - * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. - ******************************************************************************/ - -package biomesoplenty.api.item; - -import net.minecraft.item.Item; - -/** - * This is a composite of this class for different MC versions of BOP, so that Galacticraft compiles - * correctly against the BOP API in a development environment across all MC versions. - * The buckets are not in BOP for MC 1.10+! The amethyst items and darts are not in BOP for MC 1.8.9! - * (So take care if referencing those items!) - * - * This class will not be included in Galacticraft's .jar for distribution. - */ -public class BOPItems -{ - - public static Item berries; - public static Item shroompowder; - public static Item peach; - public static Item saladfruit; - public static Item saladveggie; - public static Item saladshroom; - public static Item earth; - public static Item persimmon; - public static Item filled_honeycomb; - public static Item ambrosia; - public static Item turnip; - public static Item pear; - public static Item ricebowl; - - public static Item fleshchunk; - public static Item mudball; - public static Item turnip_seeds; - public static Item crystal_shard; - public static Item terrestrial_artifact; - public static Item flax_string; - public static Item honeycomb; - public static Item gem; - public static Item ash; - public static Item mud_brick; - public static Item blue_dye; - public static Item brown_dye; - public static Item green_dye; - public static Item white_dye; - public static Item black_dye; - public static Item soul; - public static Item pixie_dust; - public static Item ichor; - public static Item pinecone; - public static Item other_slab; - - public static Item dart; - public static Item dart_blower; - - public static Item sacred_oak_door; - public static Item cherry_door; - public static Item umbran_door; - public static Item fir_door; - public static Item ethereal_door; - public static Item magic_door; - public static Item mangrove_door; - public static Item palm_door; - public static Item redwood_door; - public static Item willow_door; - public static Item pine_door; - public static Item hellbark_door; - public static Item jacaranda_door; - public static Item mahogany_door; - public static Item ebony_door; - public static Item eucalyptus_door; - - public static Item wood_slab_0; - public static Item wood_slab_1; - - public static Item wading_boots; - public static Item flippers; - public static Item plain_flower_band; - public static Item lush_flower_band; - public static Item exotic_flower_band; - public static Item dull_flower_band; - - public static Item mud_helmet; - public static Item mud_chestplate; - public static Item mud_leggings; - public static Item mud_boots; - public static Item amethyst_helmet; - public static Item amethyst_chestplate; - public static Item amethyst_leggings; - public static Item amethyst_boots; - - public static Item mud_axe; - public static Item mud_hoe; - public static Item mud_pickaxe; - public static Item mud_shovel; - public static Item mud_sword; - public static Item amethyst_axe; - public static Item amethyst_hoe; - public static Item amethyst_pickaxe; - public static Item amethyst_shovel; - public static Item amethyst_sword; - - public static Item mud_scythe; - public static Item wood_scythe; - public static Item stone_scythe; - public static Item iron_scythe; - public static Item gold_scythe; - public static Item diamond_scythe; - public static Item amethyst_scythe; - - public static Item biome_finder; - public static Item biome_essence; - public static Item enderporter; - public static Item flower_basket; - public static Item jar_empty; - public static Item jar_filled; - - public static Item honey_bucket; - public static Item blood_bucket; - public static Item poison_bucket; - public static Item hot_spring_water_bucket; - - public static Item record_wanderer; - public static Item record_corruption; - - public static Item spawn_egg; -} diff --git a/dependencies/main/java/codechicken/core/CCUpdateChecker.java b/dependencies/main/java/codechicken/core/CCUpdateChecker.java deleted file mode 100644 index 4ab6257674..0000000000 --- a/dependencies/main/java/codechicken/core/CCUpdateChecker.java +++ /dev/null @@ -1,109 +0,0 @@ -package codechicken.core; - -import codechicken.core.launch.CodeChickenCorePlugin; -import com.google.common.base.Function; -import net.minecraft.client.Minecraft; -import net.minecraft.util.text.TextComponentString; -import net.minecraftforge.common.ForgeVersion; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.versioning.ComparableVersion; -import net.minecraftforge.fml.relauncher.FMLInjectionData; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.*; -import java.util.ArrayList; - -public class CCUpdateChecker { - private static final ArrayList updates = new ArrayList(); - - private static class ThreadUpdateCheck extends Thread { - private final URL url; - private final Function handler; - - public ThreadUpdateCheck(URL url, Function handler) { - this.url = url; - this.handler = handler; - - setName("CodeChicken Update Checker"); - } - - @Override - public void run() { - try { - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - conn.setRequestMethod("GET"); - conn.setConnectTimeout(5000); - conn.setReadTimeout(5000); - BufferedReader read = new BufferedReader(new InputStreamReader(conn.getInputStream())); - String ret = read.readLine(); - read.close(); - if (ret == null) { - ret = ""; - } - handler.apply(ret); - } catch (SocketTimeoutException ignored) { - } catch (UnknownHostException ignored) { - } catch (IOException iox) { - iox.printStackTrace(); - } - } - } - - public static void tick() { - Minecraft mc = Minecraft.getMinecraft(); - if (!mc.inGameHasFocus) { - return; - } - - synchronized (updates) { - for (String updateMessage : updates) { - mc.thePlayer.addChatMessage(new TextComponentString(updateMessage)); - } - updates.clear(); - } - } - - public static void addUpdateMessage(String s) { - synchronized (updates) { - updates.add(s); - } - } - - public static String mcVersion() { - return (String) FMLInjectionData.data()[4]; - } - - public static void updateCheck(final String mod, final String version) { - updateCheck("http://www.chickenbones.net/Files/notification/version.php?" + - "version=" + mcVersion() + "&" + - "file=" + mod, new Function() { - @Override - public Void apply(String ret) { - if (!ret.startsWith("Ret: ")) { - CodeChickenCorePlugin.logger.error("Failed to check update for " + mod + " returned: " + ret); - return null; - } - ComparableVersion newVersion = new ComparableVersion(ret.substring(5)); - if (newVersion.compareTo(new ComparableVersion(version)) > 0) { - ModDescriptionEnhancer.setUpdateStatus(mod, ForgeVersion.Status.OUTDATED, newVersion); - addUpdateMessage("Version " + newVersion + " of " + mod + " is available"); - } - return null; - } - }); - } - - public static void updateCheck(String mod) { - updateCheck(mod, Loader.instance().getIndexedModList().get(mod).getVersion()); - } - - public static void updateCheck(String url, Function handler) { - try { - new ThreadUpdateCheck(new URL(url), handler).start(); - } catch (MalformedURLException e) { - CodeChickenCorePlugin.logger.error("Malformed URL: " + url, e); - } - } -} \ No newline at end of file diff --git a/dependencies/main/java/codechicken/core/ModDescriptionEnhancer.java b/dependencies/main/java/codechicken/core/ModDescriptionEnhancer.java deleted file mode 100644 index 884b1ce171..0000000000 --- a/dependencies/main/java/codechicken/core/ModDescriptionEnhancer.java +++ /dev/null @@ -1,55 +0,0 @@ -package codechicken.core; - -import codechicken.lib.util.ReflectionManager; -import net.minecraft.util.text.TextFormatting; -import net.minecraftforge.common.ForgeVersion; -import net.minecraftforge.common.ForgeVersion.CheckResult; -import net.minecraftforge.common.ForgeVersion.Status; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.ModContainer; -import net.minecraftforge.fml.common.versioning.ComparableVersion; - -import java.util.HashMap; -import java.util.Map; - -@SuppressWarnings("unchecked") -public class ModDescriptionEnhancer { - public static void enhanceMod(Object mod) { - ModContainer mc = FMLCommonHandler.instance().findContainerFor(mod); - mc.getMetadata().description = enhanceDesc(mc.getMetadata().description); - } - - public static String enhanceDesc(String desc) { - int supportersIdx = desc.indexOf("Supporters:"); - if (supportersIdx < 0) { - return desc; - } - - String supportersList = desc.substring(supportersIdx); - supportersList = supportersList.replaceAll("\\b(\\w+)\\b", TextFormatting.AQUA + "$1"); - return desc.substring(0, supportersIdx) + supportersList; - } - - public static void setUpdateStatus(String modId, Status status, ComparableVersion version) { - try { - ModContainer modContainer = FMLCommonHandler.instance().findContainerFor(modId); - Map changes = new HashMap(); - CheckResult result = ReflectionManager.newInstance(CheckResult.class, status, version, changes, ""); - setUpdateStatus(modContainer, result); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void setUpdateStatus(ModContainer container, CheckResult result) { - try { - Map resultMap = ReflectionManager.getField(ForgeVersion.class, Map.class, null, "results"); - synchronized (resultMap) { - resultMap.put(container, result); - } - - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/dependencies/main/java/codechicken/core/commands/CoreCommand.java b/dependencies/main/java/codechicken/core/commands/CoreCommand.java deleted file mode 100644 index b872312607..0000000000 --- a/dependencies/main/java/codechicken/core/commands/CoreCommand.java +++ /dev/null @@ -1,102 +0,0 @@ -package codechicken.core.commands; - -import codechicken.lib.util.ServerUtils; -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.TextComponentTranslation; -import net.minecraft.world.WorldServer; -import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.fml.common.FMLCommonHandler; - -import java.util.ArrayList; -import java.util.List; - -public abstract class CoreCommand implements ICommand { - public static void chatT(ICommandSender sender, String s, Object... params) { - sender.addChatMessage(new TextComponentTranslation(s, params)); - } - - public static void chatOpsT(String s, Object... params) { - for (EntityPlayerMP player : ServerUtils.getPlayers()) { - if (FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().canSendCommands(player.getGameProfile())) { - player.addChatMessage(new TextComponentTranslation(s, params)); - } - } - } - - public abstract boolean isOpOnly(); - - @Override - public String getCommandUsage(ICommandSender commandSender) { - return "/" + getCommandName() + " help"; - } - - @Override - public void execute(MinecraftServer server, ICommandSender sender, String[] args) { - if (args.length < minimumParameters() || args.length == 1 && args[0].equals("help")) { - printHelp(sender); - return; - } - - String command = getCommandName(); - for (String arg : args) { - command += " " + arg; - } - - handleCommand(command, sender.getName(), args, sender); - } - - public abstract void handleCommand(String command, String playername, String[] args, ICommandSender listener); - - public abstract void printHelp(ICommandSender sender); - - public final EntityPlayerMP getPlayer(String name) { - return ServerUtils.getPlayer(name); - } - - public WorldServer getWorld(int dimension) { - return DimensionManager.getWorld(dimension); - } - - public WorldServer getWorld(EntityPlayer player) { - return (WorldServer) player.worldObj; - } - - @Override - public int compareTo(ICommand o) { - return getCommandName().compareTo(o.getCommandName()); - } - - @Override - public List getCommandAliases() { - return new ArrayList(); - } - - @Override - public List getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public boolean isUsernameIndex(String[] args, int index) { - return false; - } - - @Override - public boolean checkPermission(MinecraftServer server, ICommandSender commandSender) { - if (isOpOnly()) { - if (commandSender instanceof EntityPlayer) { - return FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().canSendCommands(((EntityPlayer) commandSender).getGameProfile()); - } - - return commandSender instanceof MinecraftServer; - } - return true; - } - - public abstract int minimumParameters(); -} diff --git a/dependencies/main/java/codechicken/core/commands/PlayerCommand.java b/dependencies/main/java/codechicken/core/commands/PlayerCommand.java deleted file mode 100644 index 728ce340bf..0000000000 --- a/dependencies/main/java/codechicken/core/commands/PlayerCommand.java +++ /dev/null @@ -1,33 +0,0 @@ -package codechicken.core.commands; - -import codechicken.lib.raytracer.RayTracer; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.WorldServer; - -public abstract class PlayerCommand extends CoreCommand { - @Override - public boolean checkPermission(MinecraftServer server, ICommandSender player) { - return super.checkPermission(server, player) && player instanceof EntityPlayer; - } - - @Override - public void handleCommand(String command, String playername, String[] args, ICommandSender listener) { - EntityPlayerMP player = (EntityPlayerMP) listener; - handleCommand(getWorld(player), player, args); - } - - public abstract void handleCommand(WorldServer world, EntityPlayerMP player, String[] args); - - public static BlockPos traceBlock(EntityPlayerMP player, float reach) { - return RayTracer.retrace(player, reach).getBlockPos(); - } - - public static Entity traceEntity(EntityPlayerMP player, float reach) { - return RayTracer.retrace(player, reach).entityHit; - } -} diff --git a/dependencies/main/java/codechicken/core/commands/ServerCommand.java b/dependencies/main/java/codechicken/core/commands/ServerCommand.java deleted file mode 100644 index b1303e806a..0000000000 --- a/dependencies/main/java/codechicken/core/commands/ServerCommand.java +++ /dev/null @@ -1,22 +0,0 @@ -package codechicken.core.commands; - -import net.minecraft.command.ICommandSender; -import net.minecraft.server.MinecraftServer; - -public abstract class ServerCommand extends CoreCommand { - @Override - public void execute(MinecraftServer server, ICommandSender sender, String[] args) { - handleCommand(args, (MinecraftServer) sender); - } - - @Override - public boolean checkPermission(MinecraftServer server, ICommandSender sender) { - return super.checkPermission(server, sender) && sender instanceof MinecraftServer; - } - - public abstract void handleCommand(String[] args, MinecraftServer listener); - - public final boolean isOpOnly() { - return false; - } -} diff --git a/dependencies/main/java/codechicken/core/fluid/ExtendedFluidTank.java b/dependencies/main/java/codechicken/core/fluid/ExtendedFluidTank.java deleted file mode 100644 index 0b05927421..0000000000 --- a/dependencies/main/java/codechicken/core/fluid/ExtendedFluidTank.java +++ /dev/null @@ -1,105 +0,0 @@ -package codechicken.core.fluid; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidTank; - -public class ExtendedFluidTank implements IFluidTank { - private FluidStack fluid; - private boolean changeType; - private int capacity; - - public ExtendedFluidTank(FluidStack type, int capacity) { - if (type == null) { - type = FluidUtils.emptyFluid(); - changeType = true; - } - fluid = FluidUtils.copy(type, 0); - this.capacity = capacity; - } - - public ExtendedFluidTank(int capacity) { - this(null, capacity); - } - - @Override - public FluidStack getFluid() { - return fluid.copy(); - } - - @Override - public int getCapacity() { - return capacity; - } - - public boolean canAccept(FluidStack type) { - return type == null || (fluid.amount == 0 && changeType) || fluid.isFluidEqual(type); - } - - @Override - public int fill(FluidStack resource, boolean doFill) { - if (resource == null) { - return 0; - } - - if (!canAccept(resource)) { - return 0; - } - - int tofill = Math.min(getCapacity() - fluid.amount, resource.amount); - if (doFill && tofill > 0) { - if (!fluid.isFluidEqual(resource)) { - fluid = FluidUtils.copy(resource, fluid.amount + tofill); - } else { - fluid.amount += tofill; - } - onLiquidChanged(); - } - - return tofill; - } - - @Override - public FluidStack drain(int maxDrain, boolean doDrain) { - if (fluid.amount == 0 || maxDrain <= 0) { - return null; - } - - int todrain = Math.min(maxDrain, fluid.amount); - if (doDrain && todrain > 0) { - fluid.amount -= todrain; - onLiquidChanged(); - } - return FluidUtils.copy(fluid, todrain); - } - - public FluidStack drain(FluidStack resource, boolean doDrain) { - if (resource == null || !resource.isFluidEqual(fluid)) { - return null; - } - - return drain(resource.amount, doDrain); - } - - public void onLiquidChanged() { - } - - public void fromTag(NBTTagCompound tag) { - fluid = FluidUtils.read(tag); - } - - public NBTTagCompound toTag() { - return FluidUtils.write(fluid, new NBTTagCompound()); - } - - @Override - public int getFluidAmount() { - return fluid.amount; - } - - @Override - public FluidTankInfo getInfo() { - return new FluidTankInfo(this); - } -} diff --git a/dependencies/main/java/codechicken/core/fluid/FluidUtils.java b/dependencies/main/java/codechicken/core/fluid/FluidUtils.java deleted file mode 100644 index 065d841744..0000000000 --- a/dependencies/main/java/codechicken/core/fluid/FluidUtils.java +++ /dev/null @@ -1,98 +0,0 @@ -package codechicken.core.fluid; - -import codechicken.lib.inventory.InventoryUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumHand; -import net.minecraftforge.fluids.*; -import net.minecraftforge.fluids.capability.IFluidHandler; - -public class FluidUtils { - public static int B = FluidContainerRegistry.BUCKET_VOLUME; - public static FluidStack water = new FluidStack(FluidRegistry.WATER, 1000); - public static FluidStack lava = new FluidStack(FluidRegistry.LAVA, 1000); - - public static boolean fillTankWithContainer(IFluidHandler tank, EntityPlayer player) { - ItemStack stack = player.getHeldItem(EnumHand.MAIN_HAND); - FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(stack); - - if (liquid == null) { - return false; - } - - if (tank.fill(liquid, false) != liquid.amount && !player.capabilities.isCreativeMode) { - return false; - } - - tank.fill(liquid, true); - - if (!player.capabilities.isCreativeMode) { - InventoryUtils.consumeItem(player.inventory, player.inventory.currentItem); - } - - player.inventoryContainer.detectAndSendChanges(); - return true; - } - - public static boolean emptyTankIntoContainer(IFluidHandler tank, EntityPlayer player, FluidStack tankLiquid) { - ItemStack stack = player.getHeldItem(EnumHand.MAIN_HAND); - - if (!FluidContainerRegistry.isEmptyContainer(stack)) { - return false; - } - - ItemStack filled = FluidContainerRegistry.fillFluidContainer(tankLiquid, stack); - FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(filled); - - if (liquid == null || filled == null) { - return false; - } - - tank.drain(liquid.amount, true); - - if (!player.capabilities.isCreativeMode) { - if (stack.stackSize == 1) { - player.inventory.setInventorySlotContents(player.inventory.currentItem, filled); - } else if (player.inventory.addItemStackToInventory(filled)) { - stack.stackSize--; - } else { - return false; - } - } - - player.inventoryContainer.detectAndSendChanges(); - return true; - } - - public static FluidStack copy(FluidStack liquid, int quantity) { - liquid = liquid.copy(); - liquid.amount = quantity; - return liquid; - } - - public static FluidStack read(NBTTagCompound tag) { - FluidStack stack = FluidStack.loadFluidStackFromNBT(tag); - return stack != null ? stack : new FluidStack(new Fluid("none", null, null), 0); - } - - public static NBTTagCompound write(FluidStack fluid, NBTTagCompound tag) { - return fluid == null || fluid.getFluid() == null ? new NBTTagCompound() : fluid.writeToNBT(new NBTTagCompound()); - } - - public static int getLuminosity(FluidStack stack, double density) { - Fluid fluid = stack.getFluid(); - if (fluid == null) { - return 0; - } - int light = fluid.getLuminosity(stack); - if (fluid.isGaseous()) { - light = (int) (light * density); - } - return light; - } - - public static FluidStack emptyFluid() { - return new FluidStack(water, 0); - } -} diff --git a/dependencies/main/java/codechicken/core/fluid/TankAccess.java b/dependencies/main/java/codechicken/core/fluid/TankAccess.java deleted file mode 100644 index 57460c8add..0000000000 --- a/dependencies/main/java/codechicken/core/fluid/TankAccess.java +++ /dev/null @@ -1,28 +0,0 @@ -package codechicken.core.fluid; - -import net.minecraft.util.EnumFacing; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; - -@Deprecated -public class TankAccess { - public IFluidHandler tank; - public EnumFacing face; - - public TankAccess(IFluidHandler tank, EnumFacing face) { - this.tank = tank; - this.face = face; - } - - public TankAccess(IFluidHandler tank, int side) { - this(tank, EnumFacing.values()[side]); - } - - public int fill(FluidStack resource, boolean doFill) { - return tank.fill(face, resource, doFill); - } - - public FluidStack drain(int maxDrain, boolean doDrain) { - return tank.drain(face, maxDrain, doDrain); - } -} diff --git a/dependencies/main/java/codechicken/core/gui/ClickCounter.java b/dependencies/main/java/codechicken/core/gui/ClickCounter.java deleted file mode 100644 index 76a423c4ef..0000000000 --- a/dependencies/main/java/codechicken/core/gui/ClickCounter.java +++ /dev/null @@ -1,55 +0,0 @@ -package codechicken.core.gui; - -import com.google.common.base.Objects; - -import java.util.Map; -import java.util.TreeMap; - -public class ClickCounter { - public class ClickCount { - public T clicked; - public long time; - public int count; - - public boolean update(T clicked) { - if (!Objects.equal(this.clicked, clicked)) { - this.clicked = clicked; - count = 0; - time = Long.MIN_VALUE; - return false; - } - return true; - } - } - - public Map buttons = new TreeMap(); - - public ClickCount getCount(int button) { - ClickCount c = buttons.get(button); - if (c == null) { - buttons.put(button, c = new ClickCount()); - } - return c; - } - - public void mouseDown(T clicked, int button) { - ClickCount c = getCount(button); - c.update(clicked); - } - - public int mouseUp(T clicked, int button) { - ClickCount c = getCount(button); - if (!c.update(clicked)) { - return 0; - } - - long time = System.currentTimeMillis(); - if (time - c.time < 500) { - c.count++; - } else { - c.count = 1; - } - c.time = time; - return c.count; - } -} diff --git a/dependencies/main/java/codechicken/core/gui/GuiCCButton.java b/dependencies/main/java/codechicken/core/gui/GuiCCButton.java deleted file mode 100644 index e8fa8076e5..0000000000 --- a/dependencies/main/java/codechicken/core/gui/GuiCCButton.java +++ /dev/null @@ -1,77 +0,0 @@ -package codechicken.core.gui; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.init.SoundEvents; - -public class GuiCCButton extends GuiWidget { - public String text; - public String actionCommand; - private boolean isEnabled = true; - public boolean visible = true; - - public GuiCCButton(int x, int y, int width, int height, String text) { - super(x, y, width, height); - this.text = text; - } - - public void setText(String s) { - text = s; - } - - public boolean isEnabled() { - return isEnabled; - } - - public void setEnabled(boolean b) { - isEnabled = b; - } - - @Override - public void mouseClicked(int x, int y, int button) { - if (isEnabled && pointInside(x, y) && actionCommand != null) { - sendAction(actionCommand, button); - Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.UI_BUTTON_CLICK, 1.0F)); - } - } - - @Override - public void draw(int mousex, int mousey, float frame) { - if (!visible) { - return; - } - - drawButtonTex(mousex, mousey); - if (text != null) { - drawText(mousex, mousey); - } - } - - public void drawButtonTex(int mousex, int mousey) { - GlStateManager.color(1, 1, 1, 1); - renderEngine.bindTexture(guiTex); - int state = getButtonTex(mousex, mousey); - drawTexturedModalRect(x, y, 0, 46 + state * 20, width / 2, height / 2);//top left - drawTexturedModalRect(x + width / 2, y, 200 - width / 2, 46 + state * 20, width / 2, height / 2);//top right - drawTexturedModalRect(x, y + height / 2, 0, 46 + state * 20 + 20 - height / 2, width / 2, height / 2);//bottom left - drawTexturedModalRect(x + width / 2, y + height / 2, 200 - width / 2, 46 + state * 20 + 20 - height / 2, width / 2, height / 2);//bottom right - } - - public int getButtonTex(int mousex, int mousey) { - return !isEnabled ? 0 : pointInside(mousex, mousey) ? 2 : 1; - } - - public void drawText(int mousex, int mousey) { - drawCenteredString(fontRenderer, text, x + width / 2, y + (height - 8) / 2, getTextColour(mousex, mousey)); - } - - public int getTextColour(int mousex, int mousey) { - return !isEnabled ? 0xFFA0A0A0 : pointInside(mousex, mousey) ? 0xFFFFFFA0 : 0xFFE0E0E0; - } - - public GuiCCButton setActionCommand(String string) { - actionCommand = string; - return this; - } -} diff --git a/dependencies/main/java/codechicken/core/gui/GuiCCTextField.java b/dependencies/main/java/codechicken/core/gui/GuiCCTextField.java deleted file mode 100644 index b1097db368..0000000000 --- a/dependencies/main/java/codechicken/core/gui/GuiCCTextField.java +++ /dev/null @@ -1,175 +0,0 @@ -package codechicken.core.gui; - -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.util.ChatAllowedCharacters; -import org.lwjgl.input.Keyboard; - -public class GuiCCTextField extends GuiWidget { - private String text; - private boolean isFocused; - private boolean isEnabled; - - public int maxStringLength; - public int cursorCounter; - public String actionCommand; - - private String allowedCharacters; - - public GuiCCTextField(int x, int y, int width, int height, String text) { - super(x, y, width, height); - isFocused = false; - isEnabled = true; - this.text = text; - } - - public GuiCCTextField setActionCommand(String s) { - actionCommand = s; - return this; - } - - public void setText(String s) { - if (s.equals(text)) { - return; - } - - String oldText = text; - text = s; - onTextChanged(oldText); - } - - public void onTextChanged(String oldText) { - } - - public final String getText() { - return text; - } - - public final boolean isEnabled() { - return isEnabled; - } - - public void setEnabled(boolean b) { - isEnabled = b; - if (!isEnabled && isFocused) { - setFocused(false); - } - } - - public final boolean isFocused() { - return isFocused; - } - - @Override - public void update() { - cursorCounter++; - } - - @Override - public void keyTyped(char c, int keycode) { - if (!isEnabled || !isFocused) { - return; - } - - /*if(c == '\t')//tab - { - parentGuiScreen.selectNextField(); - }*/ - if (c == '\026')//paste - { - String s = GuiScreen.getClipboardString(); - if (s == null || s.equals("")) { - return; - } - - for (int i = 0; i < s.length(); i++) { - if (text.length() == maxStringLength) { - return; - } - - char tc = s.charAt(i); - if (canAddChar(tc)) { - setText(text + tc); - } - } - } - if (keycode == Keyboard.KEY_RETURN) { - setFocused(false); - sendAction(actionCommand, getText()); - } - - if (keycode == Keyboard.KEY_BACK && text.length() > 0) { - setText(text.substring(0, text.length() - 1)); - } - - if ((text.length() < maxStringLength || maxStringLength == 0) && canAddChar(c)) { - setText(text + c); - } - } - - public boolean canAddChar(char c) { - return allowedCharacters == null ? ChatAllowedCharacters.isAllowedCharacter(c) : allowedCharacters.indexOf(c) >= 0; - } - - @Override - public void mouseClicked(int x, int y, int button) { - if (isEnabled && pointInside(x, y)) { - setFocused(true); - if (button == 1) { - setText(""); - } - } else { - setFocused(false); - } - } - - public void setFocused(boolean focus) { - if (focus == isFocused) { - return; - } - isFocused = focus; - onFocusChanged(); - } - - public void onFocusChanged() { - if (isFocused) { - cursorCounter = 0; - } - } - - @Override - public void draw(int i, int j, float f) { - drawBackground(); - drawText(); - } - - public void drawBackground() { - drawRect(x - 1, y - 1, x + width + 1, y + height + 1, 0xffa0a0a0); - drawRect(x, y, x + width, y + height, 0xff000000); - } - - public String getDrawText() { - String s = getText(); - if (isEnabled && isFocused && (cursorCounter / 6) % 2 == 0) { - s += "_"; - } - return s; - } - - public void drawText() { - drawString(fontRenderer, getDrawText(), x + 4, y + height / 2 - 4, getTextColour()); - } - - public int getTextColour() { - return isEnabled ? 0xe0e0e0 : 0x707070; - } - - public GuiCCTextField setMaxStringLength(int i) { - maxStringLength = i; - return this; - } - - public GuiCCTextField setAllowedCharacters(String s) { - allowedCharacters = s; - return this; - } -} diff --git a/dependencies/main/java/codechicken/core/gui/GuiScreenWidget.java b/dependencies/main/java/codechicken/core/gui/GuiScreenWidget.java deleted file mode 100644 index ab1c33d860..0000000000 --- a/dependencies/main/java/codechicken/core/gui/GuiScreenWidget.java +++ /dev/null @@ -1,139 +0,0 @@ -package codechicken.core.gui; - -import codechicken.lib.gui.GuiDraw; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.GlStateManager; -import org.lwjgl.input.Mouse; - -import java.awt.*; -import java.io.IOException; -import java.util.ArrayList; - -public class GuiScreenWidget extends GuiScreen implements IGuiActionListener { - public ArrayList widgets = new ArrayList(); - public int xSize, ySize, guiTop, guiLeft; - - public GuiScreenWidget() { - this(176, 166); - } - - public GuiScreenWidget(int xSize, int ySize) { - super(); - this.xSize = xSize; - this.ySize = ySize; - } - - @Override - public void initGui() { - guiTop = (height - ySize) / 2; - guiLeft = (width - xSize) / 2; - if (!widgets.isEmpty()) { - resize(); - } - } - - public void reset() { - widgets.clear(); - initGui(); - addWidgets(); - resize(); - } - - @Override - public void setWorldAndResolution(Minecraft mc, int i, int j) { - boolean init = this.mc == null; - super.setWorldAndResolution(mc, i, j); - if (init) { - addWidgets(); - resize(); - } - } - - public void add(GuiWidget widget) { - widgets.add(widget); - widget.onAdded(this); - } - - @Override - public void drawScreen(int mousex, int mousey, float f) { - GlStateManager.translate(guiLeft, guiTop, 0); - drawBackground(); - for (GuiWidget widget : widgets) { - widget.draw(mousex - guiLeft, mousey - guiTop, f); - } - drawForeground(); - GlStateManager.translate(-guiLeft, -guiTop, 0); - } - - public void drawBackground() { - } - - public void drawForeground() { - } - - @Override - protected void mouseClicked(int x, int y, int button) throws IOException { - super.mouseClicked(x, y, button); - for (GuiWidget widget : widgets) { - widget.mouseClicked(x - guiLeft, y - guiTop, button); - } - } - - @Override - protected void mouseReleased(int x, int y, int button) { - super.mouseReleased(x, y, button); - for (GuiWidget widget : widgets) { - widget.mouseReleased(x - guiLeft, y - guiTop, button); - } - } - - @Override - protected void mouseClickMove(int x, int y, int button, long time) { - super.mouseClickMove(x, y, button, time); - for (GuiWidget widget : widgets) { - widget.mouseDragged(x - guiLeft, y - guiTop, button, time); - } - } - - @Override - public void updateScreen() { - super.updateScreen(); - if (mc.currentScreen == this) { - for (GuiWidget widget : widgets) { - widget.update(); - } - } - } - - @Override - public void keyTyped(char c, int keycode) throws IOException { - super.keyTyped(c, keycode); - for (GuiWidget widget : widgets) { - widget.keyTyped(c, keycode); - } - } - - @Override - public void handleMouseInput() throws IOException { - super.handleMouseInput(); - int i = Mouse.getEventDWheel(); - if (i != 0) { - Point p = GuiDraw.getMousePosition(); - int scroll = i > 0 ? 1 : -1; - for (GuiWidget widget : widgets) { - widget.mouseScrolled(p.x, p.y, scroll); - } - } - } - - @Override - public void actionPerformed(String ident, Object... params) { - } - - public void resize() { - } - - public void addWidgets() { - } -} diff --git a/dependencies/main/java/codechicken/core/gui/GuiScrollPane.java b/dependencies/main/java/codechicken/core/gui/GuiScrollPane.java deleted file mode 100644 index 764c7fd79d..0000000000 --- a/dependencies/main/java/codechicken/core/gui/GuiScrollPane.java +++ /dev/null @@ -1,221 +0,0 @@ -package codechicken.core.gui; - -import codechicken.lib.math.MathHelper; -import codechicken.lib.vec.Rectangle4i; - -import java.awt.*; - -public abstract class GuiScrollPane extends GuiWidget { - protected int scrollclicky = -1; - protected float scrollpercent; - protected int scrollmousey; - protected float percentscrolled; - - public int marginleft; - public int margintop; - public int marginright; - public int marginbottom; - - public GuiScrollPane(int x, int y, int width, int height) { - super(x, y, width, height); - } - - public void setMargins(int left, int top, int right, int bottom) { - marginleft = left; - margintop = top; - marginright = right; - marginbottom = bottom; - } - - public Rectangle windowBounds() { - return new Rectangle(x + marginleft, y + margintop, width - marginleft - marginright, height - margintop - marginbottom); - } - - public abstract int contentHeight(); - - public Dimension scrollbarDim() { - int h = (int) ((windowBounds().getHeight() / contentHeight()) * height); - return new Dimension(5, h > height ? height : h < height / 15 ? height / 15 : h); - } - - public Rectangle scrollbarBounds() { - Dimension dim = scrollbarDim(); - return new Rectangle(x + width - dim.width, y + (int) ((height - dim.height) * percentscrolled + 0.4999), dim.width, dim.height); - } - - public void scrollUp() { - scroll(-5); - } - - public void scrollDown() { - scroll(5); - } - - public void scroll(int i) { - percentscrolled += i * height / (float) (2 * contentHeight()); - calculatePercentScrolled(); - } - - public void calculatePercentScrolled() { - int barempty = height - scrollbarDim().height; - if (isScrolling()) { - int scrolldiff = scrollmousey - scrollclicky; - percentscrolled = scrolldiff / (float) barempty + scrollpercent; - } - percentscrolled = (float) MathHelper.clip(percentscrolled, 0, 1); - } - - public boolean isScrolling() { - return scrollclicky >= 0; - } - - public boolean hasScrollbar() { - return contentHeight() > height; - } - - /** - * @return -1 for left, 0 for none, 1 for right - */ - public int scrollbarGuideAlignment() { - return -1; - } - - public void showSlot(int sloty, int slotHeight) { - Rectangle w = windowBounds(); - if (sloty + slotHeight > w.y + w.height) { - int diff = sloty - (w.y + w.height - slotHeight); - percentscrolled += diff / (double) (contentHeight() - w.height); - calculatePercentScrolled(); - } else if (sloty < w.y) { - int diff = w.y - sloty; - percentscrolled -= diff / (double) (contentHeight() - w.height); - calculatePercentScrolled(); - } - } - - @Override - public void mouseClicked(int mx, int my, int button) { - Rectangle sbar = scrollbarBounds(); - Rectangle w = windowBounds(); - int barempty = height - sbar.height; - - if (button == 0 && - sbar.height < height && //the scroll bar can move (not full length) - mx >= sbar.x && mx <= sbar.x + sbar.width && - my >= y && my <= y + height)//in the scroll pane - { - if (my < sbar.y) { - percentscrolled = (my - y) / (float) barempty; - calculatePercentScrolled(); - } else if (my > sbar.y + sbar.height) { - percentscrolled = (my - y - sbar.height + 1) / (float) barempty; - calculatePercentScrolled(); - } else { - scrollclicky = my; - scrollpercent = percentscrolled; - scrollmousey = my; - } - } else if (w.contains(mx, my)) { - slotDown(mx - w.x, my - w.y + scrolledPixels(), button); - } - } - - /** - * Mouse down on slot area - * Coordinates relative to slot content area - */ - public void slotDown(int mx, int my, int button) { - } - - /** - * Mouse up on slot area - * Coordinates relative to slot content area - */ - public void slotUp(int mx, int my, int button) { - } - - @Override - public void mouseReleased(int mx, int my, int button) { - Rectangle w = windowBounds(); - if (isScrolling() && button == 0)//we were scrolling and we released mouse - { - scrollclicky = -1; - } else if (w.contains(mx, my)) { - slotUp(mx - w.x, my - w.y + scrolledPixels(), button); - } - } - - @Override - public void mouseDragged(int mousex, int mousey, int button, long time) { - if (isScrolling()) { - int scrolldiff = mousey - scrollclicky; - int sbarh = scrollbarDim().height; - int barupallowed = (int) ((height - sbarh) * scrollpercent + 0.5); - int bardownallowed = (height - sbarh) - barupallowed; - - if (-scrolldiff > barupallowed) { - scrollmousey = scrollclicky - barupallowed; - } else if (scrolldiff > bardownallowed) { - scrollmousey = scrollclicky + bardownallowed; - } else { - scrollmousey = mousey; - } - - calculatePercentScrolled(); - } - } - - public int scrolledPixels() { - int scrolled = (int) ((contentHeight() - windowBounds().height) * percentscrolled + 0.5); - if (scrolled < 0) { - scrolled = 0; - } - return scrolled; - } - - public Rectangle4i bounds() { - return new Rectangle4i(x, y, width, height); - } - - public boolean contains(int mx, int my) { - return bounds().contains(mx, my); - } - - @Override - public void draw(int mx, int my, float frame) { - Rectangle w = windowBounds(); - drawBackground(frame); - drawContent(mx - w.x, my + scrolledPixels() - w.y, frame); - drawOverlay(frame); - drawScrollbar(frame); - } - - public void drawBackground(float frame) { - drawRect(x, y, x + width, y + height, 0xff000000); - } - - public abstract void drawContent(int mx, int my, float frame); - - public void drawOverlay(float frame) { - //outlines - drawRect(x, y - 1, x + width, y, 0xffa0a0a0);//top - drawRect(x, y + height, x + width, y + height + 1, 0xffa0a0a0);//bottom - drawRect(x - 1, y - 1, x, y + height + 1, 0xffa0a0a0);//left - drawRect(x + width, y - 1, x + width + 1, y + height + 1, 0xffa0a0a0);//right - } - - public void drawScrollbar(float frame) { - Rectangle r = scrollbarBounds(); - - drawRect(r.x, r.y, r.x + r.width, r.y + r.height, 0xFF8B8B8B);//corners - drawRect(r.x, r.y, r.x + r.width - 1, r.y + r.height - 1, 0xFFF0F0F0);//topleft up - drawRect(r.x + 1, r.y + 1, r.x + r.width, r.y + r.height, 0xFF555555);//bottom right down - drawRect(r.x + 1, r.y + 1, r.x + r.width - 1, r.y + r.height - 1, 0xFFC6C6C6);//scrollbar - - int algn = scrollbarGuideAlignment(); - if (algn != 0) { - drawRect(algn > 0 ? r.x + r.width : r.x - 1, y, r.x, y + height, 0xFF808080);//lineguide - } - } - -} diff --git a/dependencies/main/java/codechicken/core/gui/GuiScrollSlot.java b/dependencies/main/java/codechicken/core/gui/GuiScrollSlot.java deleted file mode 100644 index f33f315dfb..0000000000 --- a/dependencies/main/java/codechicken/core/gui/GuiScrollSlot.java +++ /dev/null @@ -1,169 +0,0 @@ -package codechicken.core.gui; - -import org.lwjgl.input.Keyboard; - -import java.awt.*; - -public abstract class GuiScrollSlot extends GuiScrollPane { - protected String actionCommand; - public boolean focused; - protected ClickCounter click = new ClickCounter(); - public boolean smoothScroll = true; - - public GuiScrollSlot(int x, int y, int width, int height) { - super(x, y, width, height); - setMargins(3, 2, 3, 2); - } - - public GuiScrollSlot setActionCommand(String s) { - actionCommand = s; - return this; - } - - public void setSmoothScroll(boolean b) { - smoothScroll = b; - } - - public abstract int getSlotHeight(int slot); - - protected abstract int getNumSlots(); - - public void selectNext() { - } - - public void selectPrev() { - } - - /** - * Coordinates are relative to slot area - */ - protected abstract void slotClicked(int slot, int button, int mx, int my, int count); - - protected abstract void drawSlot(int slot, int x, int y, int mx, int my, float frame); - - protected void unfocus() { - } - - public void setFocused(boolean focus) { - focused = focus; - if (!focused) { - unfocus(); - } - } - - @Override - public int contentHeight() { - return getSlotY(getNumSlots()); - } - - public int getSlotY(int slot) { - int h = 0; - for (int i = 0; i < slot; i++) { - h += getSlotHeight(i); - } - return h; - } - - public int getSlot(int my) { - if (my < 0) { - return -1; - } - - int y = 0; - for (int i = 0; i < getNumSlots(); i++) { - int h = getSlotHeight(i); - if (my >= y && my < y + h) { - return i; - } - y += h; - } - return -1; - } - - public int getClickedSlot(int my) { - return getSlot(my - windowBounds().y + scrolledPixels()); - } - - @Override - public int scrolledPixels() { - int scrolled = super.scrolledPixels(); - if (!smoothScroll) { - int slot = getSlot(scrolled); - int sloty = getSlotY(slot); - int sloth = getSlotHeight(slot); - scrolled = sloty + (int) ((scrolled - sloty) / (double) sloth + 0.5) * sloth; - } - return scrolled; - } - - /** - * @return -1 for left, 1 for right - */ - public int scrollbarAlignment() { - return 1; - } - - @Override - public int scrollbarGuideAlignment() { - return scrollbarAlignment(); - } - - @Override - public Rectangle scrollbarBounds() { - Rectangle r = super.scrollbarBounds(); - if (scrollbarAlignment() == -1) { - r.x = x; - } - return r; - } - - public void showSlot(int slot) { - showSlot(getSlotY(slot), getSlotHeight(slot)); - } - - @Override - public void slotDown(int mx, int my, int button) { - int slot = getSlot(my); - click.mouseDown(slot >= 0 ? slot : null, button); - } - - @Override - public void slotUp(int mx, int my, int button) { - int slot = getSlot(my); - int c = click.mouseUp(slot >= 0 ? slot : null, button); - if (c > 0 && slot >= 0) { - slotClicked(slot, button, mx, my - getSlotY(slot), c); - } - } - - @Override - public void keyTyped(char c, int keycode) { - if (!focused) { - return; - } - - if (keycode == Keyboard.KEY_UP) { - selectPrev(); - } - if (keycode == Keyboard.KEY_DOWN) { - selectNext(); - } - if (keycode == Keyboard.KEY_RETURN && actionCommand != null) { - sendAction(actionCommand); - } - } - - @Override - public void drawContent(int mx, int my, float frame) { - int scrolled = scrolledPixels(); - Rectangle w = windowBounds(); - int y = 0; - for (int slot = 0; slot < getNumSlots(); slot++) { - int h = getSlotHeight(slot); - if (y + h > scrolled && y < scrolled + w.height) { - drawSlot(slot, w.x, w.y + y - scrolledPixels(), mx, my - y, frame); - } - y += h; - } - } -} diff --git a/dependencies/main/java/codechicken/core/gui/GuiWidget.java b/dependencies/main/java/codechicken/core/gui/GuiWidget.java deleted file mode 100644 index ed4905fe95..0000000000 --- a/dependencies/main/java/codechicken/core/gui/GuiWidget.java +++ /dev/null @@ -1,74 +0,0 @@ -package codechicken.core.gui; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.util.ResourceLocation; - -public class GuiWidget extends Gui { - protected static final ResourceLocation guiTex = new ResourceLocation("textures/gui/widgets.png"); - - public GuiScreen parentScreen; - public TextureManager renderEngine; - public FontRenderer fontRenderer; - - public int x; - public int y; - public int width; - public int height; - - public GuiWidget(int x, int y, int width, int height) { - setSize(x, y, width, height); - } - - public void setSize(int x, int y, int width, int height) { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } - - public boolean pointInside(int px, int py) { - return px >= x && px < x + width && py >= y && py < y + height; - } - - public void sendAction(String actionCommand, Object... params) { - sendAction(parentScreen, actionCommand, params); - } - - public static void sendAction(GuiScreen screen, String actionCommand, Object... params) { - if (actionCommand != null && screen instanceof IGuiActionListener) { - ((IGuiActionListener) screen).actionPerformed(actionCommand, params); - } - } - - public void mouseClicked(int x, int y, int button) { - } - - public void mouseReleased(int x, int y, int button) { - } - - public void mouseDragged(int x, int y, int button, long time) { - } - - public void update() { - } - - public void draw(int mousex, int mousey, float frame) { - } - - public void keyTyped(char c, int keycode) { - } - - public void mouseScrolled(int x, int y, int scroll) { - } - - public void onAdded(GuiScreen s) { - Minecraft mc = Minecraft.getMinecraft(); - parentScreen = s; - renderEngine = mc.renderEngine; - fontRenderer = mc.fontRendererObj; - } -} diff --git a/dependencies/main/java/codechicken/core/gui/IGuiActionListener.java b/dependencies/main/java/codechicken/core/gui/IGuiActionListener.java deleted file mode 100644 index 04a187cda6..0000000000 --- a/dependencies/main/java/codechicken/core/gui/IGuiActionListener.java +++ /dev/null @@ -1,5 +0,0 @@ -package codechicken.core.gui; - -public interface IGuiActionListener { - void actionPerformed(String actionCommand, Object... params); -} \ No newline at end of file diff --git a/dependencies/main/java/codechicken/core/internal/CCCEventHandler.java b/dependencies/main/java/codechicken/core/internal/CCCEventHandler.java deleted file mode 100644 index 31ddc556f9..0000000000 --- a/dependencies/main/java/codechicken/core/internal/CCCEventHandler.java +++ /dev/null @@ -1,16 +0,0 @@ -package codechicken.core.internal; - -import codechicken.core.CCUpdateChecker; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; - -public class CCCEventHandler { - - @SubscribeEvent - public void clientTick(TickEvent.ClientTickEvent event) { - if (event.phase == Phase.END) { - CCUpdateChecker.tick(); - } - } -} diff --git a/dependencies/main/java/codechicken/core/inventory/ContainerExtended.java b/dependencies/main/java/codechicken/core/inventory/ContainerExtended.java deleted file mode 100644 index fddda563c5..0000000000 --- a/dependencies/main/java/codechicken/core/inventory/ContainerExtended.java +++ /dev/null @@ -1,247 +0,0 @@ -package codechicken.core.inventory; - -import codechicken.lib.packet.PacketCustom; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.*; -import net.minecraft.item.ItemStack; - -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; - -public abstract class ContainerExtended extends Container implements IContainerListener { - public LinkedList playerCrafters = new LinkedList(); - - public ContainerExtended() { - listeners.add(this); - } - - @Override - public void addListener(IContainerListener icrafting) { - if (icrafting instanceof EntityPlayerMP) { - playerCrafters.add((EntityPlayerMP) icrafting); - sendContainerAndContentsToPlayer(this, getInventory(), Arrays.asList((EntityPlayerMP) icrafting)); - detectAndSendChanges(); - } else { - super.addListener(icrafting); - } - } - - @Override - public void removeListener(IContainerListener icrafting) { - if (icrafting instanceof EntityPlayerMP) { - playerCrafters.remove(icrafting); - } else { - super.removeListener(icrafting); - } - } - - @Override - public void updateCraftingInventory(Container container, List list) { - sendContainerAndContentsToPlayer(container, list, playerCrafters); - } - - @Override - public void sendAllWindowProperties(Container p_175173_1_, IInventory p_175173_2_) { - } - - public void sendContainerAndContentsToPlayer(Container container, List list, List playerCrafters) { - LinkedList largeStacks = new LinkedList(); - for (int i = 0; i < list.size(); i++) { - ItemStack stack = list.get(i); - if (stack != null && stack.stackSize > Byte.MAX_VALUE) { - list.set(i, null); - largeStacks.add(stack); - } else { - largeStacks.add(null); - } - } - - for (EntityPlayerMP player : playerCrafters) { - player.updateCraftingInventory(container, list); - } - - for (int i = 0; i < largeStacks.size(); i++) { - ItemStack stack = largeStacks.get(i); - if (stack != null) { - sendLargeStack(stack, i, playerCrafters); - } - } - } - - public void sendLargeStack(ItemStack stack, int slot, List players) { - } - - @Override - public void sendProgressBarUpdate(Container container, int i, int j) { - for (EntityPlayerMP player : playerCrafters) { - player.sendProgressBarUpdate(container, i, j); - } - } - - @Override - public void sendSlotContents(Container container, int slot, ItemStack stack) { - if (stack != null && stack.stackSize > Byte.MAX_VALUE) { - sendLargeStack(stack, slot, playerCrafters); - } else { - for (EntityPlayerMP player : playerCrafters) { - player.sendSlotContents(container, slot, stack); - } - } - } - - @Override - public ItemStack slotClick(int slot, int dragType, ClickType clickType, EntityPlayer player) { - if (slot >= 0 && slot < inventorySlots.size()) { - Slot actualSlot = getSlot(slot); - if (actualSlot instanceof SlotHandleClicks) { - return ((SlotHandleClicks) actualSlot).slotClick(this, player, dragType, clickType); - } - } - return super.slotClick(slot, dragType, clickType, player); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int slotIndex) { - ItemStack transferredStack = null; - Slot slot = inventorySlots.get(slotIndex); - - if (slot != null && slot.getHasStack()) { - ItemStack stack = slot.getStack(); - transferredStack = stack.copy(); - - if (!doMergeStackAreas(slotIndex, stack)) { - return null; - } - - if (stack.stackSize == 0) { - slot.putStack(null); - } else { - slot.onSlotChanged(); - } - } - - return transferredStack; - } - - @Override - public boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean reverse) { - boolean merged = false; - int slotIndex = reverse ? endIndex - 1 : startIndex; - - if (stack == null) { - return false; - } - - if (stack.isStackable())//search for stacks to increase - { - while (stack.stackSize > 0 && (reverse ? slotIndex >= startIndex : slotIndex < endIndex)) { - Slot slot = inventorySlots.get(slotIndex); - ItemStack slotStack = slot.getStack(); - - if (slotStack != null && slotStack.getItem() == stack.getItem() && - (!stack.getHasSubtypes() || stack.getItemDamage() == slotStack.getItemDamage()) && - ItemStack.areItemStackTagsEqual(stack, slotStack)) { - int totalStackSize = slotStack.stackSize + stack.stackSize; - int maxStackSize = Math.min(stack.getMaxStackSize(), slot.getSlotStackLimit()); - if (totalStackSize <= maxStackSize) { - stack.stackSize = 0; - slotStack.stackSize = totalStackSize; - slot.onSlotChanged(); - merged = true; - } else if (slotStack.stackSize < maxStackSize) { - stack.stackSize -= maxStackSize - slotStack.stackSize; - slotStack.stackSize = maxStackSize; - slot.onSlotChanged(); - merged = true; - } - } - - slotIndex += reverse ? -1 : 1; - } - } - - if (stack.stackSize > 0)//normal transfer :) - { - slotIndex = reverse ? endIndex - 1 : startIndex; - - while (stack.stackSize > 0 && (reverse ? slotIndex >= startIndex : slotIndex < endIndex)) { - Slot slot = this.inventorySlots.get(slotIndex); - - if (!slot.getHasStack() && slot.isItemValid(stack)) { - int maxStackSize = Math.min(stack.getMaxStackSize(), slot.getSlotStackLimit()); - if (stack.stackSize <= maxStackSize) { - slot.putStack(stack.copy()); - slot.onSlotChanged(); - stack.stackSize = 0; - merged = true; - } else { - slot.putStack(stack.splitStack(maxStackSize)); - slot.onSlotChanged(); - merged = true; - } - } - - slotIndex += reverse ? -1 : 1; - } - } - - return merged; - } - - public boolean doMergeStackAreas(int slotIndex, ItemStack stack) { - return false; - } - - protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) { - bindPlayerInventory(inventoryPlayer, 8, 84); - } - - protected void bindPlayerInventory(InventoryPlayer inventoryPlayer, int x, int y) { - for (int row = 0; row < 3; row++) { - for (int col = 0; col < 9; col++) { - addSlotToContainer(new Slot(inventoryPlayer, col + row * 9 + 9, x + col * 18, y + row * 18)); - } - } - for (int slot = 0; slot < 9; slot++) { - addSlotToContainer(new Slot(inventoryPlayer, slot, x + slot * 18, y + 58)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - return true; - } - - public void sendContainerPacket(PacketCustom packet) { - for (EntityPlayerMP player : playerCrafters) { - packet.sendToPlayer(player); - } - } - - /** - * May be called from a client packet handler to handle additional info - */ - public void handleOutputPacket(PacketCustom packet) { - } - - /** - * May be called from a server packet handler to handle additional info - */ - public void handleInputPacket(PacketCustom packet) { - } - - /** - * May be called from a server packet handler to handle client input - */ - public void handleGuiChange(int ID, int value) { - } - - public void sendProgressBarUpdate(int barID, int value) { - for (IContainerListener crafting : listeners) { - crafting.sendProgressBarUpdate(this, barID, value); - } - } -} diff --git a/dependencies/main/java/codechicken/core/inventory/ContainerSynchronised.java b/dependencies/main/java/codechicken/core/inventory/ContainerSynchronised.java deleted file mode 100644 index 4a0bf5b7c1..0000000000 --- a/dependencies/main/java/codechicken/core/inventory/ContainerSynchronised.java +++ /dev/null @@ -1,60 +0,0 @@ -package codechicken.core.inventory; - -import codechicken.lib.packet.PacketCustom; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public abstract class ContainerSynchronised extends ContainerExtended { - private ArrayList syncVars = new ArrayList(); - - public abstract PacketCustom createSyncPacket(); - - @Override - public final void detectAndSendChanges() { - super.detectAndSendChanges(); - - for (int i = 0; i < syncVars.size(); i++) { - IContainerSyncVar var = syncVars.get(i); - if (var.changed()) { - PacketCustom packet = createSyncPacket(); - packet.writeByte(i); - var.writeChange(packet); - sendContainerPacket(packet); - var.reset(); - } - } - } - - @Override - public void sendContainerAndContentsToPlayer(Container container, List list, List playerCrafters) { - super.sendContainerAndContentsToPlayer(container, list, playerCrafters); - for (int i = 0; i < syncVars.size(); i++) { - IContainerSyncVar var = syncVars.get(i); - PacketCustom packet = createSyncPacket(); - packet.writeByte(i); - var.writeChange(packet); - var.reset(); - for (EntityPlayerMP player : playerCrafters) { - packet.sendToPlayer(player); - } - } - } - - public void addSyncVar(IContainerSyncVar var) { - syncVars.add(var); - } - - @Override - public final void handleOutputPacket(PacketCustom packet) { - syncVars.get(packet.readUByte()).readChange(packet); - } - - public List getSyncedVars() { - return Collections.unmodifiableList(syncVars); - } -} diff --git a/dependencies/main/java/codechicken/core/inventory/GuiContainerWidget.java b/dependencies/main/java/codechicken/core/inventory/GuiContainerWidget.java deleted file mode 100644 index 53be82e5a9..0000000000 --- a/dependencies/main/java/codechicken/core/inventory/GuiContainerWidget.java +++ /dev/null @@ -1,123 +0,0 @@ -package codechicken.core.inventory; - -import codechicken.core.gui.GuiWidget; -import codechicken.core.gui.IGuiActionListener; -import codechicken.lib.gui.GuiDraw; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.inventory.Container; -import org.lwjgl.input.Mouse; - -import java.awt.*; -import java.io.IOException; -import java.util.ArrayList; - -public class GuiContainerWidget extends GuiContainer implements IGuiActionListener { - public ArrayList widgets = new ArrayList(); - - public GuiContainerWidget(Container inventorySlots) { - this(inventorySlots, 176, 166); - } - - public GuiContainerWidget(Container inventorySlots, int xSize, int ySize) { - super(inventorySlots); - this.xSize = xSize; - this.ySize = ySize; - } - - @Override - public void setWorldAndResolution(Minecraft mc, int i, int j) { - super.setWorldAndResolution(mc, i, j); - if (widgets.isEmpty()) { - addWidgets(); - } - } - - public void add(GuiWidget widget) { - widgets.add(widget); - widget.onAdded(this); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float f, int mousex, int mousey) { - GlStateManager.translate(guiLeft, guiTop, 0); - drawBackground(); - for (GuiWidget widget : widgets) { - widget.draw(mousex - guiLeft, mousey - guiTop, f); - } - - GlStateManager.translate(-guiLeft, -guiTop, 0); - } - - public void drawBackground() { - } - - @Override - protected void mouseClicked(int x, int y, int button) throws IOException { - super.mouseClicked(x, y, button); - for (GuiWidget widget : widgets) { - widget.mouseClicked(x - guiLeft, y - guiTop, button); - } - } - - @Override - protected void mouseReleased(int x, int y, int button) { - super.mouseReleased(x, y, button); - for (GuiWidget widget : widgets) { - widget.mouseReleased(x - guiLeft, y - guiTop, button); - } - } - - @Override - protected void mouseClickMove(int x, int y, int button, long time) { - super.mouseClickMove(x, y, button, time); - for (GuiWidget widget : widgets) { - widget.mouseDragged(x - guiLeft, y - guiTop, button, time); - } - } - - @Override - public void updateScreen() { - super.updateScreen(); - if (mc.currentScreen == this) { - for (GuiWidget widget : widgets) { - widget.update(); - } - } - } - - @Override - public void keyTyped(char c, int keycode) throws IOException { - super.keyTyped(c, keycode); - for (GuiWidget widget : widgets) { - widget.keyTyped(c, keycode); - } - } - - @Override - public void handleMouseInput() throws IOException { - super.handleMouseInput(); - int i = Mouse.getEventDWheel(); - if (i != 0) { - Point p = GuiDraw.getMousePosition(); - int scroll = i > 0 ? 1 : -1; - for (GuiWidget widget : widgets) { - widget.mouseScrolled(p.x, p.y, scroll); - } - } - } - - @Override - public void actionPerformed(String ident, Object... params) { - } - - public void addWidgets() { - } - - @Override - public void onGuiClosed() { - super.onGuiClosed(); - widgets.clear(); - } -} diff --git a/dependencies/main/java/codechicken/core/inventory/IContainerSyncVar.java b/dependencies/main/java/codechicken/core/inventory/IContainerSyncVar.java deleted file mode 100644 index c1e3b708a0..0000000000 --- a/dependencies/main/java/codechicken/core/inventory/IContainerSyncVar.java +++ /dev/null @@ -1,13 +0,0 @@ -package codechicken.core.inventory; - -import codechicken.lib.packet.PacketCustom; - -public interface IContainerSyncVar { - boolean changed(); - - void reset(); - - void writeChange(PacketCustom packet); - - void readChange(PacketCustom packet); -} diff --git a/dependencies/main/java/codechicken/core/inventory/IntegerSync.java b/dependencies/main/java/codechicken/core/inventory/IntegerSync.java deleted file mode 100644 index a9280663dd..0000000000 --- a/dependencies/main/java/codechicken/core/inventory/IntegerSync.java +++ /dev/null @@ -1,29 +0,0 @@ -package codechicken.core.inventory; - -import codechicken.lib.packet.PacketCustom; - -public abstract class IntegerSync implements IContainerSyncVar { - public int c_value; - - @Override - public boolean changed() { - return getValue() != c_value; - } - - @Override - public void reset() { - c_value = getValue(); - } - - @Override - public void writeChange(PacketCustom packet) { - packet.writeInt(getValue()); - } - - @Override - public void readChange(PacketCustom packet) { - c_value = packet.readInt(); - } - - public abstract int getValue(); -} diff --git a/dependencies/main/java/codechicken/core/inventory/MappedInventoryAccess.java b/dependencies/main/java/codechicken/core/inventory/MappedInventoryAccess.java deleted file mode 100644 index e4922a57a9..0000000000 --- a/dependencies/main/java/codechicken/core/inventory/MappedInventoryAccess.java +++ /dev/null @@ -1,145 +0,0 @@ -package codechicken.core.inventory; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.util.text.ITextComponent; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class MappedInventoryAccess implements IInventory { - public interface InventoryAccessor { - boolean canAccessSlot(int slot); - } - - public static final InventoryAccessor fullAccess = new InventoryAccessor() { - public boolean canAccessSlot(int slot) { - return true; - } - }; - - private ArrayList slotMap = new ArrayList(); - private IInventory inv; - private ArrayList accessors = new ArrayList(); - - public MappedInventoryAccess(IInventory inv, InventoryAccessor... accessors) { - this.inv = inv; - Collections.addAll(this.accessors, accessors); - reset(); - } - - public void reset() { - slotMap.clear(); - nextslot: - for (int i = 0; i < inv.getSizeInventory(); i++) { - for (InventoryAccessor a : accessors) { - if (!a.canAccessSlot(i)) { - continue nextslot; - } - } - - slotMap.add(i); - } - } - - @Override - public int getSizeInventory() { - return slotMap.size(); - } - - @Override - public ItemStack getStackInSlot(int slot) { - return inv.getStackInSlot(slotMap.get(slot)); - } - - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inv.decrStackSize(slotMap.get(slot), amount); - } - - @Override - public ItemStack removeStackFromSlot(int slot) { - return inv.removeStackFromSlot(slotMap.get(slot)); - } - - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inv.setInventorySlotContents(slotMap.get(slot), stack); - } - - @Override - public int getInventoryStackLimit() { - return inv.getInventoryStackLimit(); - } - - @Override - public void markDirty() { - inv.markDirty(); - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inv.isUseableByPlayer(player); - } - - public void addAccessor(InventoryAccessor accessor) { - accessors.add(accessor); - reset(); - } - - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inv.isItemValidForSlot(slotMap.get(slot), stack); - } - - @Override - public void openInventory(EntityPlayer player) { - inv.openInventory(player); - } - - @Override - public void closeInventory(EntityPlayer player) { - inv.closeInventory(player); - } - - @Override - public int getField(int id) { - return inv.getField(id); - } - - @Override - public void setField(int id, int value) { - inv.setField(id, value); - } - - @Override - public int getFieldCount() { - return inv.getFieldCount(); - } - - @Override - public void clear() { - inv.clear(); - } - - @Override - public String getName() { - return inv.getName(); - } - - @Override - public boolean hasCustomName() { - return inv.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inv.getDisplayName(); - } - - public List accessors() { - return accessors; - } -} diff --git a/dependencies/main/java/codechicken/core/inventory/SlotDummy.java b/dependencies/main/java/codechicken/core/inventory/SlotDummy.java deleted file mode 100644 index 6e2f364cd5..0000000000 --- a/dependencies/main/java/codechicken/core/inventory/SlotDummy.java +++ /dev/null @@ -1,69 +0,0 @@ -package codechicken.core.inventory; - -import codechicken.lib.inventory.InventoryUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ClickType; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -public class SlotDummy extends SlotHandleClicks { - public final int stackLimit; - - public SlotDummy(IInventory inv, int slot, int x, int y) { - this(inv, slot, x, y, 64); - } - - public SlotDummy(IInventory inv, int slot, int x, int y, int limit) { - super(inv, slot, x, y); - stackLimit = limit; - } - - @Override - public ItemStack slotClick(ContainerExtended container, EntityPlayer player, int button, ClickType clickType) { - ItemStack held = player.inventory.getItemStack(); - boolean shift = clickType == ClickType.QUICK_MOVE; - slotClick(held, button, shift); - return null; - } - - public void slotClick(ItemStack held, int button, boolean shift) { - ItemStack tstack = getStack(); - if (held != null && (tstack == null || !InventoryUtils.canStack(held, tstack))) { - int quantity = Math.min(held.stackSize, stackLimit); - if (shift) { - quantity = Math.min(stackLimit, held.getMaxStackSize() * 16); - } - if (button == 1) { - quantity = 1; - } - putStack(InventoryUtils.copyStack(held, quantity)); - } else if (tstack != null) { - int inc; - if (held != null) { - inc = button == 1 ? -held.stackSize : held.stackSize; - if (shift) { - inc *= 16; - } - } else { - inc = button == 1 ? -1 : 1; - if (shift) { - inc *= 16; - } - } - int quantity = tstack.stackSize + inc; - if (quantity <= 0) { - putStack(null); - } else { - putStack(InventoryUtils.copyStack(tstack, quantity)); - } - } - } - - @Override - public void putStack(ItemStack stack) { - if (stack != null && stack.stackSize > stackLimit) { - stack = InventoryUtils.copyStack(stack, stackLimit); - } - super.putStack(stack); - } -} diff --git a/dependencies/main/java/codechicken/core/inventory/SlotDummyOutput.java b/dependencies/main/java/codechicken/core/inventory/SlotDummyOutput.java deleted file mode 100644 index 30b5d3756f..0000000000 --- a/dependencies/main/java/codechicken/core/inventory/SlotDummyOutput.java +++ /dev/null @@ -1,17 +0,0 @@ -package codechicken.core.inventory; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ClickType; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -public class SlotDummyOutput extends SlotHandleClicks { - public SlotDummyOutput(IInventory inv, int slot, int x, int y) { - super(inv, slot, x, y); - } - - @Override - public ItemStack slotClick(ContainerExtended container, EntityPlayer player, int button, ClickType clickType) { - return null; - } -} diff --git a/dependencies/main/java/codechicken/core/inventory/SlotHandleClicks.java b/dependencies/main/java/codechicken/core/inventory/SlotHandleClicks.java deleted file mode 100644 index ead7471e14..0000000000 --- a/dependencies/main/java/codechicken/core/inventory/SlotHandleClicks.java +++ /dev/null @@ -1,15 +0,0 @@ -package codechicken.core.inventory; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ClickType; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public abstract class SlotHandleClicks extends Slot { - public SlotHandleClicks(IInventory inv, int slot, int x, int y) { - super(inv, slot, x, y); - } - - public abstract ItemStack slotClick(ContainerExtended container, EntityPlayer player, int button, ClickType clickType); -} diff --git a/dependencies/main/java/codechicken/core/launch/CodeChickenCorePlugin.java b/dependencies/main/java/codechicken/core/launch/CodeChickenCorePlugin.java deleted file mode 100644 index f48bf9ee1e..0000000000 --- a/dependencies/main/java/codechicken/core/launch/CodeChickenCorePlugin.java +++ /dev/null @@ -1,60 +0,0 @@ -package codechicken.core.launch; - -import codechicken.core.CCUpdateChecker; -import codechicken.core.internal.CCCEventHandler; -import codechicken.lib.CodeChickenLib; -import codechicken.lib.config.ConfigFile; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.Mod.EventHandler; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.relauncher.FMLInjectionData; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import java.io.File; - -@Mod(modid = "CodeChickenCore", name = "CodeChicken Core", dependencies = "required-after:CodeChickenLib@[" + CodeChickenLib.version + ",)", acceptedMinecraftVersions = CodeChickenLib.mcVersion, certificateFingerprint = "f1850c39b2516232a2108a7bd84d1cb5df93b261") -public class CodeChickenCorePlugin { - public static final String version = "${mod_version}"; - - public static File minecraftDir; - public static String currentMcVersion; - public static Logger logger = LogManager.getLogger("CodeChickenCore"); - - public static ConfigFile config; - - public static void loadConfig() { - if (config == null) { - config = new ConfigFile(new File(minecraftDir, "config/CodeChickenCore.cfg")).setComment("CodeChickenCore configuration file."); - } - } - - public CodeChickenCorePlugin() { - if (minecraftDir != null) { - return;//get called twice, once for IFMLCallHook - } - - minecraftDir = (File) FMLInjectionData.data()[6]; - currentMcVersion = (String) FMLInjectionData.data()[4]; - - loadConfig(); - } - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - FingerprintChecker.runFingerprintChecks(); - } - - @EventHandler - public void init(FMLInitializationEvent event) { - if (event.getSide().isClient()) { - if (config.getTag("checkUpdates").getBooleanValue(true)) { - CCUpdateChecker.updateCheck("CodeChickenCore"); - } - - MinecraftForge.EVENT_BUS.register(new CCCEventHandler()); - } - } -} diff --git a/dependencies/main/java/codechicken/core/launch/DepLoader.java b/dependencies/main/java/codechicken/core/launch/DepLoader.java deleted file mode 100644 index e48106f64e..0000000000 --- a/dependencies/main/java/codechicken/core/launch/DepLoader.java +++ /dev/null @@ -1,853 +0,0 @@ -package codechicken.core.launch; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import net.minecraft.launchwrapper.LaunchClassLoader; -import net.minecraftforge.fml.common.FMLLog; -import net.minecraftforge.fml.common.asm.transformers.ModAccessTransformer; -import net.minecraftforge.fml.common.versioning.ComparableVersion; -import net.minecraftforge.fml.relauncher.*; -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import sun.misc.URLClassPath; -import sun.net.util.URLUtil; - -import javax.swing.*; -import javax.swing.event.HyperlinkEvent; -import javax.swing.event.HyperlinkListener; -import java.awt.*; -import java.awt.Dialog.ModalityType; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.*; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; -import java.net.URLConnection; -import java.nio.ByteBuffer; -import java.util.*; -import java.util.List; -import java.util.Map.Entry; -import java.util.jar.Attributes; -import java.util.jar.JarFile; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -/** - * For autodownloading stuff. - * This is really unoriginal, mostly ripped off FML, credits to cpw. - */ -@Deprecated -public class DepLoader implements IFMLLoadingPlugin, IFMLCallHook { - private static ByteBuffer downloadBuffer = ByteBuffer.allocateDirect(1 << 23); - private static final String owner = "DepLoader"; - private static DepLoadInst inst; - private static final Logger logger = LogManager.getLogger(owner); - - public interface IYellAtPeople { - void addYellingData(String data); - - void displayYellingData(); - } - - public static class YellGui extends JOptionPane implements IYellAtPeople { - private ArrayList yellingData = new ArrayList(); - - @Override - public void addYellingData(String data) { - yellingData.add(data); - } - - @Override - public void displayYellingData() { - StringBuilder builder = new StringBuilder(); - builder.append(""); - for (String data : yellingData) { - builder.append("
"); - builder.append(data); - } - builder.append(""); - JEditorPane ep = new JEditorPane("text/html", builder.toString()); - ep.setAutoscrolls(true); - ep.setEditable(false); - ep.setOpaque(false); - ep.addHyperlinkListener(new HyperlinkListener() { - @Override - public void hyperlinkUpdate(HyperlinkEvent event) { - try { - if (event.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) { - Desktop.getDesktop().browse(event.getURL().toURI()); - } - } catch (Exception ignored) { - } - } - }); - JOptionPane.showMessageDialog(null, ep, "DepLoader is Deprecated!", -1); - } - } - - public static class YellServer implements IYellAtPeople { - private ArrayList yellingData = new ArrayList(); - - @Override - public void addYellingData(String data) { - yellingData.add(data); - } - - @Override - public void displayYellingData() { - for (String string : yellingData) { - FMLLog.severe(string); - } - try { - Thread.sleep(10000); - } catch (InterruptedException ignored) { - } - } - } - - public interface IDownloadDisplay { - void resetProgress(int sizeGuess); - - void setPokeThread(Thread currentThread); - - void updateProgress(int fullLength); - - boolean shouldStopIt(); - - void updateProgressString(String string, Object... data); - - Object makeDialog(); - - void showErrorDialog(String name, String url); - } - - @SuppressWarnings("serial") - public static class Downloader extends JOptionPane implements IDownloadDisplay { - private JDialog container; - private JLabel currentActivity; - private JProgressBar progress; - boolean stopIt; - Thread pokeThread; - - private Box makeProgressPanel() { - Box box = Box.createVerticalBox(); - box.add(Box.createRigidArea(new Dimension(0, 10))); - JLabel welcomeLabel = new JLabel("" + owner + " is setting up your minecraft environment"); - box.add(welcomeLabel); - welcomeLabel.setAlignmentY(LEFT_ALIGNMENT); - welcomeLabel = new JLabel("Please wait, " + owner + " has some tasks to do before you can play"); - welcomeLabel.setAlignmentY(LEFT_ALIGNMENT); - box.add(welcomeLabel); - box.add(Box.createRigidArea(new Dimension(0, 10))); - currentActivity = new JLabel("Currently doing ..."); - box.add(currentActivity); - box.add(Box.createRigidArea(new Dimension(0, 10))); - progress = new JProgressBar(0, 100); - progress.setStringPainted(true); - box.add(progress); - box.add(Box.createRigidArea(new Dimension(0, 30))); - return box; - } - - @Override - public JDialog makeDialog() { - if (container != null) { - return container; - } - - setMessageType(JOptionPane.INFORMATION_MESSAGE); - setMessage(makeProgressPanel()); - setOptions(new Object[] { "Stop" }); - addPropertyChangeListener(new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - if (evt.getSource() == Downloader.this && evt.getPropertyName() == VALUE_PROPERTY) { - requestClose("This will stop minecraft from launching\nAre you sure you want to do this?"); - } - } - }); - container = new JDialog(null, "Hello", ModalityType.MODELESS); - container.setResizable(false); - container.setLocationRelativeTo(null); - container.add(this); - this.updateUI(); - container.pack(); - container.setMinimumSize(container.getPreferredSize()); - container.setVisible(true); - container.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); - container.addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent e) { - requestClose("Closing this window will stop minecraft from launching\nAre you sure you wish to do this?"); - } - }); - return container; - } - - protected void requestClose(String message) { - int shouldClose = JOptionPane.showConfirmDialog(container, message, "Are you sure you want to stop?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); - if (shouldClose == JOptionPane.YES_OPTION) { - container.dispose(); - } - - stopIt = true; - if (pokeThread != null) { - pokeThread.interrupt(); - } - } - - @Override - public void updateProgressString(String progressUpdate, Object... data) { - //FMLLog.finest(progressUpdate, data); - if (currentActivity != null) { - currentActivity.setText(String.format(progressUpdate, data)); - } - } - - @Override - public void resetProgress(int sizeGuess) { - if (progress != null) { - progress.getModel().setRangeProperties(0, 0, 0, sizeGuess, false); - } - } - - @Override - public void updateProgress(int fullLength) { - if (progress != null) { - progress.getModel().setValue(fullLength); - } - } - - @Override - public void setPokeThread(Thread currentThread) { - this.pokeThread = currentThread; - } - - @Override - public boolean shouldStopIt() { - return stopIt; - } - - @Override - public void showErrorDialog(String name, String url) { - JEditorPane ep = new JEditorPane("text/html", "" + owner + " was unable to download required library " + name + "
Check your internet connection and try restarting or download it manually from" + "
" + url + " and put it in your mods folder" + ""); - - ep.setEditable(false); - ep.setOpaque(false); - ep.addHyperlinkListener(new HyperlinkListener() { - @Override - public void hyperlinkUpdate(HyperlinkEvent event) { - try { - if (event.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) { - Desktop.getDesktop().browse(event.getURL().toURI()); - } - } catch (Exception e) { - } - } - }); - - JOptionPane.showMessageDialog(null, ep, "A download error has occured", JOptionPane.ERROR_MESSAGE); - } - } - - public static class DummyDownloader implements IDownloadDisplay { - @Override - public void resetProgress(int sizeGuess) { - } - - @Override - public void setPokeThread(Thread currentThread) { - } - - @Override - public void updateProgress(int fullLength) { - } - - @Override - public boolean shouldStopIt() { - return false; - } - - @Override - public void updateProgressString(String string, Object... data) { - } - - @Override - public Object makeDialog() { - return null; - } - - @Override - public void showErrorDialog(String name, String url) { - } - } - - public static class VersionedFile { - public final Pattern pattern; - public final String filename; - public final ComparableVersion version; - public final String name; - - public VersionedFile(String filename, Pattern pattern) { - this.pattern = pattern; - this.filename = filename; - Matcher m = pattern.matcher(filename); - if (m.matches()) { - name = m.group(1); - version = new ComparableVersion(m.group(2)); - } else { - name = null; - version = null; - } - } - - public boolean matches() { - return name != null; - } - } - - public static class Dependency { - /** - * Zip file to extract packed dependencies from - */ - public File source; - public String repo; - public String packed; - public VersionedFile file; - public String testClass; - public boolean coreLib; - - public String existing; - - /** - * Flag set to add this dep to the classpath immediately because it is required for a coremod. - */ - - public Dependency(File source, String repo, String packed, VersionedFile file, String testClass, boolean coreLib) { - this.source = source; - this.repo = repo; - this.packed = packed; - this.file = file; - this.coreLib = coreLib; - this.testClass = testClass; - } - - public void set(Dependency dep) { - this.source = dep.source; - this.repo = dep.repo; - this.packed = dep.packed; - this.file = dep.file; - } - } - - public static class DepLoadInst { - private File modsDir; - private File v_modsDir; - private IDownloadDisplay downloadMonitor; - private JDialog popupWindow; - - private Map depMap = new HashMap(); - private HashSet depSet = new HashSet(); - - private File scanning; - private LaunchClassLoader loader = (LaunchClassLoader) DepLoader.class.getClassLoader(); - - public DepLoadInst() { - String mcVer = (String) FMLInjectionData.data()[4]; - File mcDir = (File) FMLInjectionData.data()[6]; - - modsDir = new File(mcDir, "mods"); - v_modsDir = new File(mcDir, "mods/" + mcVer); - if (!v_modsDir.exists()) { - v_modsDir.mkdirs(); - } - } - - private void addClasspath(File file) { - try { - loader.addURL(file.toURI().toURL()); - } catch (MalformedURLException e) { - throw new RuntimeException(e); - } - } - - private void deleteMod(File mod) { - if (mod.delete()) { - return; - } - - try { - URL url = mod.toURI().toURL(); - Field f_ucp = URLClassLoader.class.getDeclaredField("ucp"); - Field f_loaders = URLClassPath.class.getDeclaredField("loaders"); - Field f_lmap = URLClassPath.class.getDeclaredField("lmap"); - f_ucp.setAccessible(true); - f_loaders.setAccessible(true); - f_lmap.setAccessible(true); - - URLClassPath ucp = (URLClassPath) f_ucp.get(loader); - Closeable loader = ((Map) f_lmap.get(ucp)).remove(URLUtil.urlNoFragString(url)); - if (loader != null) { - loader.close(); - ((List) f_loaders.get(ucp)).remove(loader); - } - } catch (Exception e) { - e.printStackTrace(); - } - - if (!mod.delete()) { - mod.deleteOnExit(); - String msg = owner + " was unable to delete file " + mod.getPath() + " the game will now try to delete it on exit. If this dialog appears again, delete it manually."; - logger.error(msg); - if (!GraphicsEnvironment.isHeadless()) { - JOptionPane.showMessageDialog(null, msg, "An update error has occured", JOptionPane.ERROR_MESSAGE); - } - - System.exit(1); - } - } - - private void install(Dependency dep) { - popupWindow = (JDialog) downloadMonitor.makeDialog(); - - if (!extract(dep)) { - download(dep); - } - - dep.existing = dep.file.filename; - scanDepInfo(new File(v_modsDir, dep.existing)); - } - - private boolean extract(Dependency dep) { - if (dep.packed == null) { - return false; - } - - ZipFile zip = null; - try { - zip = new ZipFile(dep.source); - ZipEntry libEntry = zip.getEntry(dep.packed + dep.file.filename); - if (libEntry == null) { - return false; - } - - downloadMonitor.updateProgressString("Extracting file %s\n", dep.source.getPath() + '!' + libEntry.toString()); - logger.info("Extracting file " + dep.source.getPath() + '!' + libEntry.toString()); - - download(zip.getInputStream(libEntry), (int) libEntry.getSize(), dep); - - downloadMonitor.updateProgressString("Extraction complete"); - logger.info("Extraction complete"); - } catch (Exception e) { - installError(e, dep, "extraction"); - } finally { - try { - if (zip != null) { - zip.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - return true; - } - - private void download(Dependency dep) { - try { - URL libDownload = new URL(dep.repo + dep.file.filename); - downloadMonitor.updateProgressString("Downloading file %s", libDownload.toString()); - logger.info("Downloading file " + libDownload.toString()); - URLConnection connection = libDownload.openConnection(); - connection.setConnectTimeout(5000); - connection.setReadTimeout(5000); - connection.setRequestProperty("User-Agent", "" + owner + " Downloader"); - download(connection.getInputStream(), connection.getContentLength(), dep); - downloadMonitor.updateProgressString("Download complete"); - logger.info("Download complete"); - } catch (Exception e) { - installError(e, dep, "download"); - } - } - - private void installError(Exception e, Dependency dep, String s) { - if (downloadMonitor.shouldStopIt()) { - logger.error("You have stopped the " + s + " before it could complete"); - System.exit(1); - } - downloadMonitor.showErrorDialog(dep.file.filename, dep.repo + '/' + dep.file.filename); - throw new RuntimeException(s + " error", e); - } - - private void download(InputStream is, int sizeGuess, Dependency dep) throws Exception { - File target = new File(v_modsDir, dep.file.filename); - if (sizeGuess > downloadBuffer.capacity()) { - throw new Exception(String.format("The file %s is too large to be downloaded by " + owner + " - the download is invalid", target.getName())); - } - - downloadBuffer.clear(); - - int read, fullLength = 0; - - downloadMonitor.resetProgress(sizeGuess); - try { - downloadMonitor.setPokeThread(Thread.currentThread()); - byte[] buffer = new byte[1024]; - while ((read = is.read(buffer)) >= 0) { - downloadBuffer.put(buffer, 0, read); - fullLength += read; - if (downloadMonitor.shouldStopIt()) { - break; - } - - downloadMonitor.updateProgress(fullLength); - } - is.close(); - downloadMonitor.setPokeThread(null); - downloadBuffer.limit(fullLength); - downloadBuffer.position(0); - } catch (InterruptedIOException e) { - // We were interrupted by the stop button. We're stopping now.. clear interruption flag. - Thread.interrupted(); - throw new Exception("Stop"); - } - - if (!target.exists()) { - target.createNewFile(); - } - - downloadBuffer.position(0); - FileOutputStream fos = new FileOutputStream(target); - fos.getChannel().write(downloadBuffer); - fos.close(); - } - - private String checkExisting(Dependency dep) { - for (File f : modsDir.listFiles()) { - VersionedFile vfile = new VersionedFile(f.getName(), dep.file.pattern); - if (!vfile.matches() || !vfile.name.equals(dep.file.name)) { - continue; - } - - if (f.renameTo(new File(v_modsDir, f.getName()))) { - continue; - } - - deleteMod(f); - } - - for (File f : v_modsDir.listFiles()) { - VersionedFile vfile = new VersionedFile(f.getName(), dep.file.pattern); - if (!vfile.matches() || !vfile.name.equals(dep.file.name)) { - continue; - } - - int cmp = vfile.version.compareTo(dep.file.version); - if (cmp < 0) { - logger.info("Deleted old version " + f.getName()); - deleteMod(f); - return null; - } - if (cmp > 0) { - logger.info("Warning: version of " + dep.file.name + ", " + vfile.version + " is newer than request " + dep.file.version); - return f.getName(); - } - return f.getName();//found dependency - } - return null; - } - - public void load() { - scanDepInfos(); - if (depMap.isEmpty()) { - return; - } - boolean dontYell = Boolean.parseBoolean(System.getProperty("deploader.dontYellAtPeople", "false")); - if (!dontYell) { - yellAtPeople(); - } - forceRemoveCCL(); - - loadDeps(); - activateDeps(); - } - - private void activateDeps() { - for (Dependency dep : depMap.values()) { - File file = new File(v_modsDir, dep.existing); - if (!searchCoreMod(file) && dep.coreLib) { - addClasspath(file); - } - } - } - - /** - * Looks for FMLCorePlugin attributes and adds to CoreModManager - */ - private boolean searchCoreMod(File coreMod) { - JarFile jar = null; - Attributes mfAttributes; - try { - jar = new JarFile(coreMod); - if (jar.getManifest() == null) { - return false; - } - - ModAccessTransformer.addJar(jar); - mfAttributes = jar.getManifest().getMainAttributes(); - } catch (IOException ioe) { - FMLRelaunchLog.log(Level.ERROR, ioe, "Unable to read the jar file %s - ignoring", coreMod.getName()); - return false; - } finally { - try { - if (jar != null) { - jar.close(); - } - } catch (IOException ignored) { - } - } - - String fmlCorePlugin = mfAttributes.getValue("FMLCorePlugin"); - if (fmlCorePlugin == null) { - return false; - } - - addClasspath(coreMod); - - try { - if (!mfAttributes.containsKey(new Attributes.Name("FMLCorePluginContainsFMLMod"))) { - FMLRelaunchLog.finer("Adding %s to the list of known coremods, it will not be examined again", coreMod.getName()); - CoreModManager.getIgnoredMods().add(coreMod.getName()); - } else { - FMLRelaunchLog.finer("Found FMLCorePluginContainsFMLMod marker in %s, it will be examined later for regular @Mod instances", coreMod.getName()); - CoreModManager.getReparseableCoremods().add(coreMod.getName()); - } - Method m_loadCoreMod = CoreModManager.class.getDeclaredMethod("loadCoreMod", LaunchClassLoader.class, String.class, File.class); - m_loadCoreMod.setAccessible(true); - m_loadCoreMod.invoke(null, loader, fmlCorePlugin, coreMod); - } catch (Exception e) { - throw new RuntimeException(e); - } - - return true; - } - - private void loadDeps() { - downloadMonitor = FMLLaunchHandler.side().isClient() ? new Downloader() : new DummyDownloader(); - try { - while (!depSet.isEmpty()) { - Iterator it = depSet.iterator(); - Dependency dep = depMap.get(it.next()); - it.remove(); - load(dep); - } - } finally { - if (popupWindow != null) { - popupWindow.setVisible(false); - popupWindow.dispose(); - } - } - } - - private void load(Dependency dep) { - dep.existing = checkExisting(dep); - if (dep.existing == null && DepLoader.class.getResource("/" + dep.testClass.replace('.', '/') + ".class") == null) { - install(dep); - } - } - - private List modFiles() { - List list = new LinkedList(); - list.addAll(Arrays.asList(modsDir.listFiles())); - list.addAll(Arrays.asList(v_modsDir.listFiles())); - return list; - } - - private void scanDepInfos() { - for (File file : modFiles()) { - if (!file.getName().endsWith(".jar") && !file.getName().endsWith(".zip")) { - continue; - } - - scanDepInfo(file); - } - } - - private void scanDepInfo(File file) { - try { - scanning = file; - ZipFile zip = new ZipFile(file); - ZipEntry e = zip.getEntry("dependencies.info"); - if (e != null) { - loadJSon(zip.getInputStream(e)); - } - - zip.close(); - } catch (Exception e) { - logger.error("Failed to load dependencies.info from " + file.getName() + " as JSON", e); - } - } - - private void loadJSon(InputStream input) throws IOException { - InputStreamReader reader = new InputStreamReader(input); - JsonElement root = new JsonParser().parse(reader); - if (root.isJsonArray()) { - loadJSonArr(root); - } else { - loadJson(root.getAsJsonObject()); - } - reader.close(); - } - - private void loadJSonArr(JsonElement root) throws IOException { - for (JsonElement node : root.getAsJsonArray()) { - loadJson(node.getAsJsonObject()); - } - } - - private void loadJson(JsonObject node) throws IOException { - boolean obfuscated = ((LaunchClassLoader) DepLoader.class.getClassLoader()).getClassBytes("net.minecraft.world.World") == null; - - String repo = node.has("repo") ? node.get("repo").getAsString() : null; - String packed = node.has("packed") ? node.get("packed").getAsString() : null; - String testClass = node.get("class").getAsString(); - - String filename = node.get("file").getAsString(); - if (!obfuscated && node.has("dev")) { - filename = node.get("dev").getAsString(); - } - - boolean coreLib = node.has("coreLib") && node.get("coreLib").getAsBoolean(); - - Pattern pattern = null; - try { - if (node.has("pattern")) { - pattern = Pattern.compile(node.get("pattern").getAsString()); - } - } catch (PatternSyntaxException e) { - logger.error("Invalid filename pattern: " + node.get("pattern"), e); - } - if (pattern == null) { - pattern = Pattern.compile("(\\w+).*?([\\d\\.]+)[-\\w]*\\.[^\\d]+"); - } - - VersionedFile file = new VersionedFile(filename, pattern); - if (!file.matches()) { - throw new RuntimeException("Invalid filename format for dependency: " + filename); - } - - addDep(new Dependency(scanning, repo, packed, file, testClass, coreLib)); - } - - private void addDep(Dependency newDep) { - Dependency oldDep = depMap.get(newDep.file.name); - if (oldDep == null) { - depMap.put(newDep.file.name, newDep); - depSet.add(newDep.file.name); - return; - } - - //combine newer info from newDep into oldDep - oldDep.coreLib |= newDep.coreLib; - int cmp = newDep.file.version.compareTo(oldDep.file.version); - if (cmp == 1) { - oldDep.set(newDep); - } else if (cmp == 0) { - if (oldDep.repo == null) { - oldDep.repo = newDep.repo; - } - if (oldDep.packed == null) { - oldDep.source = newDep.source; - oldDep.packed = newDep.packed; - } - } - } - - public void yellAtPeople() { - IYellAtPeople yellAtPeople = FMLLaunchHandler.side().isClient() ? new YellGui() : new YellServer(); - yellAtPeople.addYellingData("The CodeChicken Dependency Downloader is being phased out and has detected mods using it."); - yellAtPeople.addYellingData("The downloader will function as normal but this message serves as a log of what mods are using it."); - yellAtPeople.addYellingData("If you are a mod dev, Please phase out all use of the dependency downloader."); - yellAtPeople.addYellingData("If you are a normal user, you can follow the instructions at the bottom of the window if you would like."); - yellAtPeople.addYellingData("The following mods are being requested to download..."); - yellAtPeople.addYellingData(""); - for (Entry entry : depMap.entrySet()) { - yellAtPeople.addYellingData("\"" + entry.getValue().source.getName() + "\"" + " Wants: " + entry.getKey() + "-" + entry.getValue().file.version); - } - yellAtPeople.addYellingData(""); - yellAtPeople.addYellingData(""); - yellAtPeople.addYellingData("Don't be alarmed by this window, it is simply so i can log what mods are using the Dependency Downloader."); - yellAtPeople.addYellingData("If you would like to report this please follow instructions listed here."); - yellAtPeople.addYellingData("Click the OK button to continue."); - - yellAtPeople.displayYellingData(); - } - - private void forceRemoveCCL() { - if (depSet.contains("CodeChickenLib")) { - depSet.remove("CodeChickenLib"); - depMap.remove("CodeChickenLib"); - } - try { - File[] files = v_modsDir.listFiles(); - if (files != null) { - for (File file : files) { - if (file.getName().contains("CodeChickenLib") && file.getName().endsWith(".jar")) { - FMLLog.info("Found old CCL [%s] attempting delete..", file.getName()); - deleteMod(file); - } - } - } - } catch (Exception e) { - throw new RuntimeException(e); - } - } - } - - public static void load() { - if (inst == null) { - inst = new DepLoadInst(); - inst.load(); - } - } - - @Override - public String[] getASMTransformerClass() { - return null; - } - - @Override - public String getModContainerClass() { - return null; - } - - @Override - public String getSetupClass() { - return getClass().getName(); - } - - @Override - public void injectData(Map data) { - } - - @Override - public Void call() { - load(); - - return null; - } - - @Override - public String getAccessTransformerClass() { - return null; - } -} diff --git a/dependencies/main/java/codechicken/core/launch/FingerprintChecker.java b/dependencies/main/java/codechicken/core/launch/FingerprintChecker.java deleted file mode 100644 index 9a3a8305a5..0000000000 --- a/dependencies/main/java/codechicken/core/launch/FingerprintChecker.java +++ /dev/null @@ -1,86 +0,0 @@ -package codechicken.core.launch; - -import codechicken.lib.fingerprint.FingerprintViolatedCrashCallable; -import com.google.common.collect.ImmutableList; -import net.minecraftforge.fml.common.*; -import org.apache.logging.log4j.Level; - -import java.security.cert.Certificate; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -/** - * Created by covers1624 on 13/12/2016. - * To be packaged in each mod runtime, used to cross verify jar fingerprints. - * Idea behind this: - * A malicious user would have to override the fingerprint data in all mod jars this is packaged with in order to avoid detection. - * This is not to be used as DRM. It is used simply to provide cross verification of jars. - */ -public class FingerprintChecker { - - private static final Map modCertMap = new HashMap(); - private static final List invalidMods = new ArrayList(); - - static { - //@formatter:off - modCertMap.put("CodeChickenLib" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("CodeChickenCore" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("ChickenChunks" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("EnderStorage" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("Translocator" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("NotEnoughItems" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("forgemultipartcbe" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - //@formatter:on - } - - public static void runFingerprintChecks() { - try { - ModContainer activeContainer = Loader.instance().activeModContainer(); - for (Entry modEntry : Loader.instance().getIndexedModList().entrySet()) { - for (Entry certEntry : modCertMap.entrySet()) { - if (modEntry.getKey().equals(certEntry.getKey())) { - Object modInstance = modEntry.getValue().getMod(); - if (modInstance == null) { - FMLLog.log(activeContainer.getModId() + " Fingerprint Verification", Level.FATAL, "Unable to do Fingerprint Verification for mod %s! ModContainer returned a null mod instance!", modEntry.getKey()); - break; - } - if (modInstance.getClass().getName().contains("net.minecraftforge.")) { - FMLLog.log(activeContainer.getModId() + " Fingerprint Verification", Level.FATAL, "Unable to do Fingerprint Verification for mod %s! ModContainer returned is a suspected FML class! [%s]", modEntry.getKey(), modInstance.getClass().getName()); - } - - Certificate[] certificates = modInstance.getClass().getProtectionDomain().getCodeSource().getCertificates(); - ImmutableList.Builder certBuilder = ImmutableList.builder(); - if (certificates != null) { - for (Certificate cert : certificates) { - certBuilder.add(CertificateHelper.getFingerprint(cert)); - } - } - - ImmutableList certList = certBuilder.build(); - - String expectedFingerprint = certEntry.getValue(); - - if (expectedFingerprint != null && !expectedFingerprint.isEmpty()) { - if (!certList.contains(expectedFingerprint)) { - FMLLog.log(activeContainer.getModId() + " Fingerprint Verification", Level.FATAL, "The fingerprint for mod %s is invalid! Expected: %s", modEntry.getKey(), expectedFingerprint); - invalidMods.add(modEntry.getKey()); - break; - } else { - FMLLog.log(activeContainer.getModId() + " Fingerprint Verification", Level.DEBUG, "Valid fingerprint found for mod %s.", modEntry.getKey()); - } - } - - break; - } - } - } - FMLCommonHandler.instance().registerCrashCallable(new FingerprintViolatedCrashCallable(activeContainer.getModId(), invalidMods)); - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/dependencies/main/java/codechicken/lib/CodeChickenLib.java b/dependencies/main/java/codechicken/lib/CodeChickenLib.java deleted file mode 100644 index cdf0daa298..0000000000 --- a/dependencies/main/java/codechicken/lib/CodeChickenLib.java +++ /dev/null @@ -1,50 +0,0 @@ -package codechicken.lib; - -import codechicken.lib.fingerprint.FingerprintChecker; -import codechicken.lib.internal.proxy.CommonProxy; -import codechicken.lib.util.FuelUtils; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.Mod.EventHandler; -import net.minecraftforge.fml.common.SidedProxy; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.common.event.FMLServerStartingEvent; -import net.minecraftforge.fml.common.registry.GameRegistry; -import net.minecraftforge.fml.relauncher.FMLInjectionData; - -import java.io.File; - -/** - * Created by covers1624 on 12/10/2016. - */ -@Mod (modid = CodeChickenLib.MOD_ID, name = CodeChickenLib.MOD_NAME, acceptedMinecraftVersions = CodeChickenLib.mcVersion, certificateFingerprint = "f1850c39b2516232a2108a7bd84d1cb5df93b261") -public class CodeChickenLib { - - public static final String MOD_ID = "CodeChickenLib"; - public static final String MOD_NAME = "CodeChicken Lib"; - public static final String version = "${mod_version}"; - public static final String mcVersion = "[1.10.2]"; - - public static final File minecraftDir = (File) FMLInjectionData.data()[6]; - - @SidedProxy (clientSide = "codechicken.lib.internal.proxy.ClientProxy", serverSide = "codechicken.lib.internal.proxy.CommonProxy") - public static CommonProxy proxy; - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - FingerprintChecker.runFingerprintChecks(); - GameRegistry.registerFuelHandler(new FuelUtils()); - proxy.preInit(); - } - - @EventHandler - public void init(FMLInitializationEvent event) { - proxy.init(); - } - - @EventHandler - public void onServerStartingEvent(FMLServerStartingEvent event) { - proxy.serverStarting(event); - } - -} diff --git a/dependencies/main/java/codechicken/lib/asm/ASMBlock.java b/dependencies/main/java/codechicken/lib/asm/ASMBlock.java deleted file mode 100644 index 981336a054..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/ASMBlock.java +++ /dev/null @@ -1,191 +0,0 @@ -package codechicken.lib.asm; - -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; -import com.google.common.collect.ImmutableMap; -import org.objectweb.asm.tree.AbstractInsnNode; -import org.objectweb.asm.tree.InsnList; -import org.objectweb.asm.tree.JumpInsnNode; -import org.objectweb.asm.tree.LabelNode; - -import java.util.*; -import java.util.Map.Entry; - -import static org.objectweb.asm.tree.AbstractInsnNode.*; - -public class ASMBlock { - - public InsnListSection list; - private BiMap labels; - - public ASMBlock(InsnListSection list, BiMap labels) { - this.list = list; - this.labels = labels; - } - - public ASMBlock(InsnListSection list) { - this(list, HashBiMap.create()); - } - - public ASMBlock(InsnList list) { - this(new InsnListSection(list)); - } - - public ASMBlock() { - this(new InsnListSection()); - } - - public LabelNode getOrAdd(String s) { - LabelNode l = get(s); - if (l == null) { - labels.put(s, l = new LabelNode()); - } - return l; - } - - public LabelNode get(String s) { - return labels.get(s); - } - - public void replaceLabels(Map labelMap, Set usedLabels) { - for (AbstractInsnNode insn : list) { - switch (insn.getType()) { - case LABEL: - AbstractInsnNode insn2 = insn.clone(labelMap); - if (insn2 == insn)//identity mapping - { - continue; - } - if (usedLabels.contains(insn2)) { - throw new IllegalStateException("LabelNode cannot be a part of two InsnLists"); - } - list.replace(insn, insn2); - break; - case JUMP_INSN: - case FRAME: - case LOOKUPSWITCH_INSN: - case TABLESWITCH_INSN: - list.replace(insn, insn.clone(labelMap)); - } - } - - for (Entry entry : labelMap.entrySet()) { - String key = labels.inverse().get(entry.getKey()); - if (key != null) { - labels.put(key, entry.getValue()); - } - } - } - - public void replaceLabels(Map labelMap) { - replaceLabels(labelMap, Collections.EMPTY_SET); - } - - public void replaceLabel(String s, LabelNode l) { - LabelNode old = get(s); - if (old != null) { - replaceLabels(ImmutableMap.of(old, l)); - } - } - - /** - * Pulls all common labels from other into this - * - * @return this - */ - public ASMBlock mergeLabels(ASMBlock other) { - if (labels.isEmpty() || other.labels.isEmpty()) { - return this; - } - - //common labels, give them our nodes - HashMap labelMap = list.identityLabelMap(); - for (Entry entry : other.labels.entrySet()) { - LabelNode old = labels.get(entry.getKey()); - if (old != null) { - labelMap.put(old, entry.getValue()); - } - } - HashSet usedLabels = new HashSet(); - for (AbstractInsnNode insn = other.list.list.getFirst(); insn != null; insn = insn.getNext()) { - if (insn.getType() == LABEL) { - usedLabels.add((LabelNode) insn); - } - } - - replaceLabels(labelMap, usedLabels); - return this; - } - - /** - * Like mergeLabels but pulls insns from other list into this so LabelNodes can be transferred - * - * @return this - */ - public ASMBlock pullLabels(ASMBlock other) { - other.list.remove(); - return mergeLabels(other); - } - - public ASMBlock copy() { - BiMap labels = HashBiMap.create(); - Map labelMap = list.cloneLabels(); - - for (Entry entry : this.labels.entrySet()) { - labels.put(entry.getKey(), labelMap.get(entry.getValue())); - } - - return new ASMBlock(list.copy(labelMap), labels); - } - - public ASMBlock applyLabels(InsnListSection list2) { - if (labels.isEmpty()) { - return new ASMBlock(list2); - } - - Set cFlowLabels1 = labels.values(); - Set cFlowLabels2 = InsnComparator.getControlFlowLabels(list2); - ASMBlock block = new ASMBlock(list2); - - HashMap labelMap = new HashMap(); - - for (int i = 0, k = 0; i < list.size() && k < list2.size(); ) { - AbstractInsnNode insn1 = list.get(i); - if (!InsnComparator.insnImportant(insn1, cFlowLabels1)) { - i++; - continue; - } - - AbstractInsnNode insn2 = list2.get(k); - if (!InsnComparator.insnImportant(insn2, cFlowLabels2)) { - k++; - continue; - } - - if (insn1.getOpcode() != insn2.getOpcode()) { - throw new IllegalArgumentException("Lists do not match:\n" + list + "\n\n" + list2); - } - - switch (insn1.getType()) { - case LABEL: - labelMap.put((LabelNode) insn1, (LabelNode) insn2); - break; - case JUMP_INSN: - labelMap.put(((JumpInsnNode) insn1).label, ((JumpInsnNode) insn2).label); - break; - } - i++; - k++; - } - - for (Entry entry : labels.entrySet()) { - block.labels.put(entry.getKey(), labelMap.get(entry.getValue())); - } - - return block; - } - - public InsnList rawListCopy() { - return list.copy().list; - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/ASMHelper.java b/dependencies/main/java/codechicken/lib/asm/ASMHelper.java deleted file mode 100644 index dd0b8f55ea..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/ASMHelper.java +++ /dev/null @@ -1,213 +0,0 @@ -package codechicken.lib.asm; - -import codechicken.lib.config.ConfigFile; -import codechicken.lib.config.DefaultingConfigFile; -import net.minecraft.launchwrapper.Launch; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.tree.*; -import org.objectweb.asm.util.ASMifier; -import org.objectweb.asm.util.Textifier; -import org.objectweb.asm.util.TraceClassVisitor; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class ASMHelper { - - public static ConfigFile config = loadConfig(); - public static Logger logger = LogManager.getLogger("CCL ASM"); - - private static ConfigFile loadConfig() { - try {//weak reference for environments without FML - File mcDir = (File) ((Object[]) Class.forName("net.minecraftforge.fml.relauncher.FMLInjectionData").getMethod("data").invoke(null))[6]; - File file = new File(mcDir, "config/CodeChickenLib.cfg"); - boolean obf = true; - try {//TODO Move the config initializer to a better spot.. - obf = Launch.classLoader.getClassBytes("net.minecraft.world.World") == null; - } catch (Exception ignored) { - } - if (obf) { - return new DefaultingConfigFile(file); - } else { - return new ConfigFile(file).setComment("CodeChickenLib development configuration file."); - } - } catch (Exception ignored) { - return null;//no config for these systems - } - } - - public interface Acceptor { - - void accept(ClassVisitor cv) throws IOException; - } - - public static MethodNode findMethod(ObfMapping methodmap, ClassNode cnode) { - for (MethodNode mnode : cnode.methods) { - if (methodmap.matches(mnode)) { - return mnode; - } - } - return null; - } - - public static FieldNode findField(ObfMapping fieldmap, ClassNode cnode) { - for (FieldNode fnode : cnode.fields) { - if (fieldmap.matches(fnode)) { - return fnode; - } - } - return null; - } - - public static ClassNode createClassNode(byte[] bytes) { - return createClassNode(bytes, 0); - } - - public static ClassNode createClassNode(byte[] bytes, int flags) { - ClassNode cnode = new ClassNode(); - ClassReader reader = new ClassReader(bytes); - reader.accept(cnode, flags); - return cnode; - } - - public static byte[] createBytes(ClassNode cnode, int flags) { - ClassWriter cw = new CC_ClassWriter(flags); - cnode.accept(cw); - return cw.toByteArray(); - } - - public static Map cloneLabels(InsnList list) { - return new InsnListSection(list).cloneLabels(); - } - - public static InsnList cloneInsnList(InsnList list) { - return new InsnListSection(list).copy().list; - } - - public static InsnList cloneInsnList(Map labelMap, InsnList list) { - return new InsnListSection(list).copy(labelMap).list; - } - - public static List cloneTryCatchBlocks(Map labelMap, List tcblocks) { - ArrayList clone = new ArrayList(); - for (TryCatchBlockNode node : tcblocks) { - clone.add(new TryCatchBlockNode(labelMap.get(node.start), labelMap.get(node.end), labelMap.get(node.handler), node.type)); - } - - return clone; - } - - public static List cloneLocals(Map labelMap, List locals) { - ArrayList clone = new ArrayList(locals.size()); - for (LocalVariableNode node : locals) { - clone.add(new LocalVariableNode(node.name, node.desc, node.signature, labelMap.get(node.start), labelMap.get(node.end), node.index)); - } - - return clone; - } - - public static void copy(MethodNode src, MethodNode dst) { - Map labelMap = cloneLabels(src.instructions); - dst.instructions = cloneInsnList(labelMap, src.instructions); - dst.tryCatchBlocks = cloneTryCatchBlocks(labelMap, src.tryCatchBlocks); - if (src.localVariables != null) { - dst.localVariables = cloneLocals(labelMap, src.localVariables); - } - dst.visibleAnnotations = src.visibleAnnotations; - dst.invisibleAnnotations = src.invisibleAnnotations; - dst.visitMaxs(src.maxStack, src.maxLocals); - } - - public static String toString(InsnList list) { - return new InsnListSection(list).toString(); - } - - public static int getLocal(List list, String name) { - int found = -1; - for (LocalVariableNode node : list) { - if (node.name.equals(name)) { - if (found >= 0) { - throw new RuntimeException("Duplicate local variable: " + name + " not coded to handle this scenario."); - } - - found = node.index; - } - } - return found; - } - - public static void replaceMethod(MethodNode original, MethodNode replacement) { - original.instructions.clear(); - if (original.localVariables != null) { - original.localVariables.clear(); - } - if (original.tryCatchBlocks != null) { - original.tryCatchBlocks.clear(); - } - replacement.accept(original); - } - - public static void dump(Acceptor acceptor, File file, boolean filterImportant, boolean sortLocals, boolean textify) { - try { - if (!file.getParentFile().exists()) { - file.getParentFile().mkdirs(); - } - if (!file.exists()) { - file.createNewFile(); - } - - PrintWriter pout = new PrintWriter(file); - ClassVisitor cv = new TraceClassVisitor(null, textify ? new Textifier() : new ASMifier(), pout); - if (filterImportant) { - cv = new ImportantInsnVisitor(cv); - } - if (sortLocals) { - cv = new LocalVariablesSorterVisitor(cv); - } - acceptor.accept(cv); - pout.close(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public static void dump(Acceptor acceptor, File file, boolean filterImportant, boolean sortLocals) { - dump(acceptor, file, filterImportant, sortLocals, config.getTag("textify").getBooleanValue(true)); - } - - public static void dump(final byte[] bytes, File file, boolean filterImportant, boolean sortLocals) { - dump(new Acceptor() { - @Override - public void accept(ClassVisitor cv) { - new ClassReader(bytes).accept(cv, ClassReader.EXPAND_FRAMES); - } - }, file, filterImportant, sortLocals); - } - - public static void dump(final InputStream is, File file, boolean filterImportant, boolean sortLocals) { - dump(new Acceptor() { - @Override - public void accept(ClassVisitor cv) throws IOException { - new ClassReader(is).accept(cv, ClassReader.EXPAND_FRAMES); - } - }, file, filterImportant, sortLocals); - } - - public static void dump(final ClassNode cnode, File file, boolean filterImportant, boolean sortLocals) { - dump(new Acceptor() { - @Override - public void accept(ClassVisitor cv) { - cnode.accept(cv); - } - }, file, filterImportant, sortLocals); - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/ASMReader.java b/dependencies/main/java/codechicken/lib/asm/ASMReader.java deleted file mode 100644 index 95acb61483..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/ASMReader.java +++ /dev/null @@ -1,311 +0,0 @@ -package codechicken.lib.asm; - -import org.objectweb.asm.tree.AbstractInsnNode; -import org.objectweb.asm.tree.*; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.HashMap; -import java.util.Map; - -import static org.objectweb.asm.Opcodes.*; -import static org.objectweb.asm.tree.AbstractInsnNode.*; - -public class ASMReader { - - public static Map opCodes = new HashMap(); - public static byte[] TYPE; - - static { - opCodes.put("NOP", NOP); - opCodes.put("ACONST_NULL", ACONST_NULL); - opCodes.put("ICONST_M1", ICONST_M1); - opCodes.put("ICONST_0", ICONST_0); - opCodes.put("ICONST_1", ICONST_1); - opCodes.put("ICONST_2", ICONST_2); - opCodes.put("ICONST_3", ICONST_3); - opCodes.put("ICONST_4", ICONST_4); - opCodes.put("ICONST_5", ICONST_5); - opCodes.put("LCONST_0", LCONST_0); - opCodes.put("LCONST_1", LCONST_1); - opCodes.put("FCONST_0", FCONST_0); - opCodes.put("FCONST_1", FCONST_1); - opCodes.put("FCONST_2", FCONST_2); - opCodes.put("DCONST_0", DCONST_0); - opCodes.put("DCONST_1", DCONST_1); - opCodes.put("BIPUSH", BIPUSH); - opCodes.put("SIPUSH", SIPUSH); - opCodes.put("LDC", LDC); - opCodes.put("ILOAD", ILOAD); - opCodes.put("LLOAD", LLOAD); - opCodes.put("FLOAD", FLOAD); - opCodes.put("DLOAD", DLOAD); - opCodes.put("ALOAD", ALOAD); - opCodes.put("IALOAD", IALOAD); - opCodes.put("LALOAD", LALOAD); - opCodes.put("FALOAD", FALOAD); - opCodes.put("DALOAD", DALOAD); - opCodes.put("AALOAD", AALOAD); - opCodes.put("BALOAD", BALOAD); - opCodes.put("CALOAD", CALOAD); - opCodes.put("SALOAD", SALOAD); - opCodes.put("ISTORE", ISTORE); - opCodes.put("LSTORE", LSTORE); - opCodes.put("FSTORE", FSTORE); - opCodes.put("DSTORE", DSTORE); - opCodes.put("ASTORE", ASTORE); - opCodes.put("IASTORE", IASTORE); - opCodes.put("LASTORE", LASTORE); - opCodes.put("FASTORE", FASTORE); - opCodes.put("DASTORE", DASTORE); - opCodes.put("AASTORE", AASTORE); - opCodes.put("BASTORE", BASTORE); - opCodes.put("CASTORE", CASTORE); - opCodes.put("SASTORE", SASTORE); - opCodes.put("POP", POP); - opCodes.put("POP2", POP2); - opCodes.put("DUP", DUP); - opCodes.put("DUP_X1", DUP_X1); - opCodes.put("DUP_X2", DUP_X2); - opCodes.put("DUP2", DUP2); - opCodes.put("DUP2_X1", DUP2_X1); - opCodes.put("DUP2_X2", DUP2_X2); - opCodes.put("SWAP", SWAP); - opCodes.put("IADD", IADD); - opCodes.put("LADD", LADD); - opCodes.put("FADD", FADD); - opCodes.put("DADD", DADD); - opCodes.put("ISUB", ISUB); - opCodes.put("LSUB", LSUB); - opCodes.put("FSUB", FSUB); - opCodes.put("DSUB", DSUB); - opCodes.put("IMUL", IMUL); - opCodes.put("LMUL", LMUL); - opCodes.put("FMUL", FMUL); - opCodes.put("DMUL", DMUL); - opCodes.put("IDIV", IDIV); - opCodes.put("LDIV", LDIV); - opCodes.put("FDIV", FDIV); - opCodes.put("DDIV", DDIV); - opCodes.put("IREM", IREM); - opCodes.put("LREM", LREM); - opCodes.put("FREM", FREM); - opCodes.put("DREM", DREM); - opCodes.put("INEG", INEG); - opCodes.put("LNEG", LNEG); - opCodes.put("FNEG", FNEG); - opCodes.put("DNEG", DNEG); - opCodes.put("ISHL", ISHL); - opCodes.put("LSHL", LSHL); - opCodes.put("ISHR", ISHR); - opCodes.put("LSHR", LSHR); - opCodes.put("IUSHR", IUSHR); - opCodes.put("LUSHR", LUSHR); - opCodes.put("IAND", IAND); - opCodes.put("LAND", LAND); - opCodes.put("IOR", IOR); - opCodes.put("LOR", LOR); - opCodes.put("IXOR", IXOR); - opCodes.put("LXOR", LXOR); - opCodes.put("IINC", IINC); - opCodes.put("I2L", I2L); - opCodes.put("I2F", I2F); - opCodes.put("I2D", I2D); - opCodes.put("L2I", L2I); - opCodes.put("L2F", L2F); - opCodes.put("L2D", L2D); - opCodes.put("F2I", F2I); - opCodes.put("F2L", F2L); - opCodes.put("F2D", F2D); - opCodes.put("D2I", D2I); - opCodes.put("D2L", D2L); - opCodes.put("D2F", D2F); - opCodes.put("I2B", I2B); - opCodes.put("I2C", I2C); - opCodes.put("I2S", I2S); - opCodes.put("LCMP", LCMP); - opCodes.put("FCMPL", FCMPL); - opCodes.put("FCMPG", FCMPG); - opCodes.put("DCMPL", DCMPL); - opCodes.put("DCMPG", DCMPG); - opCodes.put("IFEQ", IFEQ); - opCodes.put("IFNE", IFNE); - opCodes.put("IFLT", IFLT); - opCodes.put("IFGE", IFGE); - opCodes.put("IFGT", IFGT); - opCodes.put("IFLE", IFLE); - opCodes.put("IF_ICMPEQ", IF_ICMPEQ); - opCodes.put("IF_ICMPNE", IF_ICMPNE); - opCodes.put("IF_ICMPLT", IF_ICMPLT); - opCodes.put("IF_ICMPGE", IF_ICMPGE); - opCodes.put("IF_ICMPGT", IF_ICMPGT); - opCodes.put("IF_ICMPLE", IF_ICMPLE); - opCodes.put("IF_ACMPEQ", IF_ACMPEQ); - opCodes.put("IF_ACMPNE", IF_ACMPNE); - opCodes.put("GOTO", GOTO); - opCodes.put("JSR", JSR); - opCodes.put("RET", RET); - opCodes.put("TABLESWITCH", TABLESWITCH); - opCodes.put("LOOKUPSWITCH", LOOKUPSWITCH); - opCodes.put("IRETURN", IRETURN); - opCodes.put("LRETURN", LRETURN); - opCodes.put("FRETURN", FRETURN); - opCodes.put("DRETURN", DRETURN); - opCodes.put("ARETURN", ARETURN); - opCodes.put("RETURN", RETURN); - opCodes.put("GETSTATIC", GETSTATIC); - opCodes.put("PUTSTATIC", PUTSTATIC); - opCodes.put("GETFIELD", GETFIELD); - opCodes.put("PUTFIELD", PUTFIELD); - opCodes.put("INVOKEVIRTUAL", INVOKEVIRTUAL); - opCodes.put("INVOKESPECIAL", INVOKESPECIAL); - opCodes.put("INVOKESTATIC", INVOKESTATIC); - opCodes.put("INVOKEINTERFACE", INVOKEINTERFACE); - opCodes.put("INVOKEDYNAMIC", INVOKEDYNAMIC); - opCodes.put("NEW", NEW); - opCodes.put("NEWARRAY", NEWARRAY); - opCodes.put("ANEWARRAY", ANEWARRAY); - opCodes.put("ARRAYLENGTH", ARRAYLENGTH); - opCodes.put("ATHROW", ATHROW); - opCodes.put("CHECKCAST", CHECKCAST); - opCodes.put("INSTANCEOF", INSTANCEOF); - opCodes.put("MONITORENTER", MONITORENTER); - opCodes.put("MONITOREXIT", MONITOREXIT); - opCodes.put("MULTIANEWARRAY", MULTIANEWARRAY); - opCodes.put("IFNULL", IFNULL); - opCodes.put("IFNONNULL", IFNONNULL); - - //derived from classWriter, mapped to AbstractInsnNode - TYPE = new byte[200]; - String s = "AAAAAAAAAAAAAAAABBJ__CCCCC____________________AAAAAAAACC" + "CCC____________________AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHCLMAA" + "AAAAEEEEFFFFGDBDAADDAA_NHH"; - for (int i = 0; i < s.length(); i++) { - TYPE[i] = (byte) (s.charAt(i) - 'A'); - } - } - - public static Map loadResource(String res) { - return loadResource(ASMHelper.class.getResourceAsStream(res), res); - } - - public static Map loadResource(InputStream in, String res) { - HashMap blocks = new HashMap(); - String current = "unnamed"; - ASMBlock block = new ASMBlock(); - try { - BufferedReader r = new BufferedReader(new InputStreamReader(in)); - String line; - while ((line = r.readLine()) != null) { - { - int hpos = line.indexOf('#'); - if (hpos >= 0) { - line = line.substring(0, hpos); - } - } - line = line.trim(); - if (line.length() == 0) { - continue; - } - if (line.startsWith("list ")) { - if (block.list.size() > 0) { - blocks.put(current, block); - } - current = line.substring(5); - block = new ASMBlock(); - continue; - } - - try { - AbstractInsnNode insn = null; - String[] split = line.replace(" : ", ":").split(" "); - Integer i_opcode = opCodes.get(split[0]); - if (i_opcode == null) { - if (split[0].equals("LINENUMBER")) { - insn = new LineNumberNode(Integer.parseInt(split[1]), block.getOrAdd(split[2])); - } else if (split[0].startsWith("L")) { - insn = block.getOrAdd(split[0]); - } else { - throw new Exception("Unknown opcode " + split[0]); - } - } else { - int opcode = i_opcode; - switch (TYPE[opcode]) { - case INSN: - insn = new InsnNode(opcode); - break; - case INT_INSN: - insn = new IntInsnNode(opcode, Integer.parseInt(split[1])); - break; - case VAR_INSN: - insn = new VarInsnNode(opcode, Integer.parseInt(split[1])); - break; - case TYPE_INSN: - insn = new ObfMapping(split[1]).toClassloading().toInsn(opcode); - break; - case FIELD_INSN: - case METHOD_INSN: - StringBuilder sb = new StringBuilder(); - for (int i = 1; i < split.length; i++) { - sb.append(split[i]); - } - insn = ObfMapping.fromDesc(sb.toString()).toClassloading().toInsn(opcode); - break; - case INVOKE_DYNAMIC_INSN: - throw new Exception("Found INVOKEDYNAMIC while reading"); - case JUMP_INSN: - insn = new JumpInsnNode(opcode, block.getOrAdd(split[1])); - break; - case LDC_INSN: - String cst = split[1]; - if (cst.equals("*")) { - insn = new LdcInsnNode(null); - } else if (cst.endsWith("\"")) { - insn = new LdcInsnNode(cst.substring(1, cst.length() - 1)); - } else if (cst.endsWith("L")) { - insn = new LdcInsnNode(Long.valueOf(cst.substring(0, cst.length() - 1))); - } else if (cst.endsWith("F")) { - insn = new LdcInsnNode(Float.valueOf(cst.substring(0, cst.length() - 1))); - } else if (cst.endsWith("D")) { - insn = new LdcInsnNode(Double.valueOf(cst.substring(0, cst.length() - 1))); - } else if (cst.contains(".")) { - insn = new LdcInsnNode(Double.valueOf(cst)); - } else { - insn = new LdcInsnNode(Integer.valueOf(cst)); - } - break; - case IINC_INSN: - insn = new IincInsnNode(opcode, Integer.parseInt(split[1])); - break; - case LABEL: - throw new Exception("Use L# for labels"); - case TABLESWITCH_INSN: - case LOOKUPSWITCH_INSN: - throw new Exception("I don't know how to deal with this insn type"); - case MULTIANEWARRAY_INSN: - insn = new MultiANewArrayInsnNode(split[1], Integer.parseInt(split[2])); - break; - case FRAME: - throw new Exception("Use ClassWriter.COMPUTE_FRAMES"); - } - } - - if (insn != null) { - block.list.add(insn); - } - } catch (Exception e) { - System.err.println("Error while reading ASM Block " + current + " from " + res + ", line: " + line); - e.printStackTrace(); - } - } - - r.close(); - if (block.list.size() > 0) { - blocks.put(current, block); - } - } catch (IOException e) { - throw new RuntimeException("Failed to read ASM resource: " + res, e); - } - return blocks; - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/CCLCorePlugin.java b/dependencies/main/java/codechicken/lib/asm/CCLCorePlugin.java deleted file mode 100644 index 8da96d44be..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/CCLCorePlugin.java +++ /dev/null @@ -1,103 +0,0 @@ -package codechicken.lib.asm; - -import net.minecraft.launchwrapper.Launch; -import net.minecraftforge.fml.relauncher.FMLInjectionData; -import net.minecraftforge.fml.relauncher.IFMLCallHook; -import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; -import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import java.io.File; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.jar.Attributes; -import java.util.jar.JarFile; -import java.util.jar.Manifest; - -@TransformerExclusions ({ "codechicken.lib.asm", "codechicken.lib.config", "codechicken.lib.fingerprint" }) -public class CCLCorePlugin implements IFMLLoadingPlugin, IFMLCallHook { - - public static Logger logger = LogManager.getLogger("CodeChicken Lib"); - - @Override - public String[] getASMTransformerClass() { - return new String[] { "codechicken.lib.asm.ClassHeirachyManager", "codechicken.lib.asm.CCL_ASMTransformer" }; - } - - @Override - public String getModContainerClass() { - return null; - } - - @Override - public String getSetupClass() { - return getClass().getName(); - } - - @Override - public void injectData(Map data) { - - } - - @Override - public String getAccessTransformerClass() { - return null; - } - - @Override - public Void call() throws Exception { - scanMods(); - new ASMHelper(); - return null; - } - - private void scanMods() { - File modsDir = new File((File) FMLInjectionData.data()[6], "mods"); - for (File file : modsDir.listFiles()) { - scanMod(file); - } - File versionModsDir = new File(modsDir, (String) FMLInjectionData.data()[4]); - if (versionModsDir.exists()) { - File[] files = versionModsDir.listFiles(); - if (files != null) { - for (File file : files) { - scanMod(file); - } - } - } - } - - private void scanMod(File file) { - if (!file.getName().endsWith(".jar") && !file.getName().endsWith(".zip")) { - return; - } - - try { - JarFile jar = new JarFile(file); - try { - Manifest manifest = jar.getManifest(); - if (manifest == null) { - return; - } - Attributes attr = manifest.getMainAttributes(); - if (attr == null) { - return; - } - - String transformer = attr.getValue("CCTransformerExclusions"); - if (transformer != null) { - List exclusions = Arrays.asList(transformer.split(",")); - for (String ex : exclusions) { - Launch.classLoader.addTransformerExclusion(ex); - } - } - } finally { - jar.close(); - } - } catch (Exception e) { - logger.error("CodeChickenLib: Failed to read jar file: " + file.getName(), e); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/CCL_ASMTransformer.java b/dependencies/main/java/codechicken/lib/asm/CCL_ASMTransformer.java deleted file mode 100644 index a1c5c03f41..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/CCL_ASMTransformer.java +++ /dev/null @@ -1,31 +0,0 @@ -package codechicken.lib.asm; - -import codechicken.lib.asm.ModularASMTransformer.MethodInjector; -import net.minecraft.launchwrapper.IClassTransformer; - -import java.util.Map; - -/** - * Created by covers1624 on 15/02/2017. - * - * Internal CCL class for ASM. - */ -public class CCL_ASMTransformer implements IClassTransformer { - - private ModularASMTransformer transformer = new ModularASMTransformer(); - - public CCL_ASMTransformer() { - Map blocks = ASMReader.loadResource("/assets/ccl/asm/hooks.asm"); - - ObfMapping mapping = new ObfMapping("net/minecraft/client/renderer/block/model/ModelBlockDefinition", "func_178331_a", "(Ljava/io/Reader;)Lnet/minecraft/client/renderer/block/model/ModelBlockDefinition;"); - transformer.add(new MethodInjector(mapping, blocks.get("i_BlockStateLoader"), true)); - - mapping = new ObfMapping("net/minecraft/client/renderer/ItemRenderer", "func_187461_a", "(Lnet/minecraft/item/ItemStack;)V"); - transformer.add(new MethodInjector(mapping, blocks.get("i_renderMapFirstPerson"), true)); - } - - @Override - public byte[] transform(String name, String transformedName, byte[] basicClass) { - return transformer.transform(name, basicClass); - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/CC_ClassWriter.java b/dependencies/main/java/codechicken/lib/asm/CC_ClassWriter.java deleted file mode 100644 index f0da66770a..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/CC_ClassWriter.java +++ /dev/null @@ -1,33 +0,0 @@ -package codechicken.lib.asm; - -import org.objectweb.asm.ClassWriter; - -public class CC_ClassWriter extends ClassWriter { - - private final boolean runtime; - - public CC_ClassWriter(int flags) { - this(flags, false); - } - - public CC_ClassWriter(int flags, boolean runtime) { - super(flags); - this.runtime = runtime; - } - - @Override - protected String getCommonSuperClass(String type1, String type2) { - String c = type1.replace('/', '.'); - String d = type2.replace('/', '.'); - if (ClassHeirachyManager.classExtends(d, c)) { - return type1; - } - if (ClassHeirachyManager.classExtends(c, d)) { - return type2; - } - do - c = ClassHeirachyManager.getSuperClass(c, runtime); while (!ClassHeirachyManager.classExtends(d, c)); - - return c.replace('.', '/'); - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/ClassHeirachyManager.java b/dependencies/main/java/codechicken/lib/asm/ClassHeirachyManager.java deleted file mode 100644 index ee16cbc3da..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/ClassHeirachyManager.java +++ /dev/null @@ -1,181 +0,0 @@ -package codechicken.lib.asm; - -import net.minecraft.launchwrapper.IClassTransformer; -import net.minecraft.launchwrapper.Launch; -import net.minecraft.launchwrapper.LaunchClassLoader; -import net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; -import org.objectweb.asm.tree.ClassNode; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; - -/** - * This is added as a class transformer if CodeChickenCore is installed. Adding it as a class transformer will speed evaluation up slightly by automatically caching superclasses when they are first loaded. - */ -public class ClassHeirachyManager implements IClassTransformer { - - public static class SuperCache { - - String superclass; - public HashSet parents = new HashSet(); - private boolean flattened; - - public void add(String parent) { - parents.add(parent); - } - - public void flatten() { - if (flattened) { - return; - } - - for (String s : new ArrayList(parents)) { - SuperCache c = declareClass(s); - if (c != null) { - c.flatten(); - parents.addAll(c.parents); - } - } - flattened = true; - } - } - - public static HashMap superclasses = new HashMap(); - private static LaunchClassLoader cl = Launch.classLoader; - - public static String toKey(String name) { - if (ObfMapping.obfuscated) { - name = FMLDeobfuscatingRemapper.INSTANCE.map(name.replace('.', '/')).replace('/', '.'); - } - return name; - } - - public static String unKey(String name) { - if (ObfMapping.obfuscated) { - name = FMLDeobfuscatingRemapper.INSTANCE.unmap(name.replace('.', '/')).replace('/', '.'); - } - return name; - } - - /** - * @param name The class in question - * @param superclass The class being extended - * @return true if clazz extends, either directly or indirectly, superclass. - */ - public static boolean classExtends(String name, String superclass) { - name = toKey(name); - superclass = toKey(superclass); - - if (name.equals(superclass)) { - return true; - } - - SuperCache cache = declareClass(name); - if (cache == null)//just can't handle this - { - return false; - } - - cache.flatten(); - return cache.parents.contains(superclass); - } - - private static SuperCache declareClass(String name) { - name = toKey(name); - SuperCache cache = superclasses.get(name); - - if (cache != null) { - return cache; - } - - try { - byte[] bytes = cl.getClassBytes(unKey(name)); - if (bytes != null) { - cache = declareASM(bytes); - } - } catch (Exception e) { - } - - if (cache != null) { - return cache; - } - - try { - cache = declareReflection(name); - } catch (ClassNotFoundException e) { - } - - return cache; - } - - private static SuperCache declareReflection(String name) throws ClassNotFoundException { - Class aclass = Class.forName(name); - - SuperCache cache = getOrCreateCache(name); - if (aclass.isInterface()) { - cache.superclass = "java.lang.Object"; - } else if (name.equals("java.lang.Object")) { - return cache; - } else { - cache.superclass = toKey(aclass.getSuperclass().getName()); - } - - cache.add(cache.superclass); - for (Class iclass : aclass.getInterfaces()) { - cache.add(toKey(iclass.getName())); - } - - return cache; - } - - private static SuperCache declareASM(byte[] bytes) { - ClassNode node = ASMHelper.createClassNode(bytes); - String name = toKey(node.name); - - SuperCache cache = getOrCreateCache(name); - cache.superclass = toKey(node.superName.replace('/', '.')); - cache.add(cache.superclass); - for (String iclass : node.interfaces) { - cache.add(toKey(iclass.replace('/', '.'))); - } - - return cache; - } - - @Override - public byte[] transform(String name, String tname, byte[] bytes) { - if (bytes == null) { - return null; - } - - if (!superclasses.containsKey(tname)) { - declareASM(bytes); - } - - return bytes; - } - - public static SuperCache getOrCreateCache(String name) { - SuperCache cache = superclasses.get(name); - if (cache == null) { - superclasses.put(name, cache = new SuperCache()); - } - return cache; - } - - public static String getSuperClass(String name, boolean runtime) { - name = toKey(name); - SuperCache cache = declareClass(name); - if (cache == null) { - return "java.lang.Object"; - } - - cache.flatten(); - String s = cache.superclass; - if (!runtime) { - s = FMLDeobfuscatingRemapper.INSTANCE.unmap(s); - } - return s; - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/ImportantInsnVisitor.java b/dependencies/main/java/codechicken/lib/asm/ImportantInsnVisitor.java deleted file mode 100644 index c6b32eda54..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/ImportantInsnVisitor.java +++ /dev/null @@ -1,36 +0,0 @@ -package codechicken.lib.asm; - -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.tree.MethodNode; - -public class ImportantInsnVisitor extends ClassVisitor { - - public class ImportantInsnMethodVisitor extends MethodVisitor { - - MethodVisitor delegate; - - public ImportantInsnMethodVisitor(int access, String name, String desc, String signature, String[] exceptions) { - super(Opcodes.ASM4, new MethodNode(access, name, desc, signature, exceptions)); - delegate = cv.visitMethod(access, name, desc, signature, exceptions); - } - - @Override - public void visitEnd() { - super.visitEnd(); - MethodNode mnode = (MethodNode) mv; - mnode.instructions = InsnComparator.getImportantList(mnode.instructions); - mnode.accept(delegate); - } - } - - public ImportantInsnVisitor(ClassVisitor cv) { - super(Opcodes.ASM4, cv); - } - - @Override - public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { - return new ImportantInsnMethodVisitor(access, name, desc, signature, exceptions); - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/InsnComparator.java b/dependencies/main/java/codechicken/lib/asm/InsnComparator.java deleted file mode 100644 index 1c735e5003..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/InsnComparator.java +++ /dev/null @@ -1,200 +0,0 @@ -package codechicken.lib.asm; - -import com.google.common.base.Function; -import com.google.common.collect.Maps; -import org.objectweb.asm.tree.AbstractInsnNode; -import org.objectweb.asm.tree.*; - -import java.util.*; - -import static org.objectweb.asm.tree.AbstractInsnNode.*; - -public class InsnComparator { - - public static boolean varInsnEqual(VarInsnNode insn1, VarInsnNode insn2) { - return insn1.var == -1 || insn2.var == -1 || insn1.var == insn2.var; - } - - public static boolean methodInsnEqual(MethodInsnNode insn1, MethodInsnNode insn2) { - return insn1.owner.equals(insn2.owner) && insn1.name.equals(insn2.name) && insn1.desc.equals(insn2.desc); - } - - public static boolean fieldInsnEqual(FieldInsnNode insn1, FieldInsnNode insn2) { - return insn1.owner.equals(insn2.owner) && insn1.name.equals(insn2.name) && insn1.desc.equals(insn2.desc); - } - - public static boolean ldcInsnEqual(LdcInsnNode insn1, LdcInsnNode insn2) { - return insn1.cst == null || insn2.cst == null || insn1.cst.equals(insn2.cst); - } - - public static boolean typeInsnEqual(TypeInsnNode insn1, TypeInsnNode insn2) { - return insn1.desc.equals("*") || insn2.desc.equals("*") || insn1.desc.equals(insn2.desc); - } - - public static boolean iincInsnEqual(IincInsnNode node1, IincInsnNode node2) { - return node1.var == node2.var && node1.incr == node2.incr; - } - - public static boolean intInsnEqual(IntInsnNode node1, IntInsnNode node2) { - return node1.operand == -1 || node2.operand == -1 || node1.operand == node2.operand; - } - - public static boolean insnEqual(AbstractInsnNode node1, AbstractInsnNode node2) { - if (node1.getOpcode() != node2.getOpcode()) { - return false; - } - - switch (node2.getType()) { - case VAR_INSN: - return varInsnEqual((VarInsnNode) node1, (VarInsnNode) node2); - case TYPE_INSN: - return typeInsnEqual((TypeInsnNode) node1, (TypeInsnNode) node2); - case FIELD_INSN: - return fieldInsnEqual((FieldInsnNode) node1, (FieldInsnNode) node2); - case METHOD_INSN: - return methodInsnEqual((MethodInsnNode) node1, (MethodInsnNode) node2); - case LDC_INSN: - return ldcInsnEqual((LdcInsnNode) node1, (LdcInsnNode) node2); - case IINC_INSN: - return iincInsnEqual((IincInsnNode) node1, (IincInsnNode) node2); - case INT_INSN: - return intInsnEqual((IntInsnNode) node1, (IntInsnNode) node2); - default: - return true; - } - } - - public static boolean insnImportant(AbstractInsnNode insn, Set controlFlowLabels) { - switch (insn.getType()) { - case LINE: - case FRAME: - return false; - case LABEL: - return controlFlowLabels.contains(insn); - default: - return true; - } - } - - public static Set getControlFlowLabels(InsnListSection list) { - return getControlFlowLabels(list.list); - } - - public static Set getControlFlowLabels(InsnList list) { - HashSet controlFlowLabels = new HashSet(); - for (AbstractInsnNode insn = list.getFirst(); insn != null; insn = insn.getNext()) { - switch (insn.getType()) { - case JUMP_INSN: - JumpInsnNode jinsn = (JumpInsnNode) insn; - controlFlowLabels.add(jinsn.label); - break; - case TABLESWITCH_INSN: - TableSwitchInsnNode tsinsn = (TableSwitchInsnNode) insn; - controlFlowLabels.add(tsinsn.dflt); - for (LabelNode label : tsinsn.labels) { - controlFlowLabels.add(label); - } - break; - case LOOKUPSWITCH_INSN: - LookupSwitchInsnNode lsinsn = (LookupSwitchInsnNode) insn; - controlFlowLabels.add(lsinsn.dflt); - for (LabelNode label : lsinsn.labels) { - controlFlowLabels.add(label); - } - break; - } - } - return controlFlowLabels; - } - - public static InsnList getImportantList(InsnList list) { - return getImportantList(new InsnListSection(list)).list; - } - - public static InsnListSection getImportantList(InsnListSection list) { - if (list.size() == 0) { - return list; - } - - Set controlFlowLabels = getControlFlowLabels(list); - Map labelMap = Maps.asMap(controlFlowLabels, new Function() { - @Override - public LabelNode apply(LabelNode input) { - return input; - } - }); - - InsnListSection importantNodeList = new InsnListSection(); - for (AbstractInsnNode insn : list) { - if (insnImportant(insn, controlFlowLabels)) { - importantNodeList.add(insn.clone(labelMap)); - } - } - - return importantNodeList; - } - - public static List find(InsnListSection haystack, InsnListSection needle) { - Set controlFlowLabels = getControlFlowLabels(haystack); - LinkedList list = new LinkedList(); - for (int start = 0; start <= haystack.size() - needle.size(); start++) { - InsnListSection section = matches(haystack.drop(start), needle, controlFlowLabels); - if (section != null) { - list.add(section); - start = section.end - 1; - } - } - - return list; - } - - public static List find(InsnList haystack, InsnListSection needle) { - return find(new InsnListSection(haystack), needle); - } - - public static InsnListSection matches(InsnListSection haystack, InsnListSection needle, Set controlFlowLabels) { - int h = 0, n = 0; - for (; h < haystack.size() && n < needle.size(); h++) { - AbstractInsnNode insn = haystack.get(h); - if (!insnImportant(insn, controlFlowLabels)) { - continue; - } - - if (!insnEqual(haystack.get(h), needle.get(n))) { - return null; - } - n++; - } - if (n != needle.size()) { - return null; - } - - return haystack.take(h); - } - - public static InsnListSection findOnce(InsnListSection haystack, InsnListSection needle) { - List list = find(haystack, needle); - if (list.size() != 1) { - throw new RuntimeException("Needle found " + list.size() + " times in Haystack:\n" + haystack + "\n\n" + needle); - } - - return list.get(0); - } - - public static InsnListSection findOnce(InsnList haystack, InsnListSection needle) { - return findOnce(new InsnListSection(haystack), needle); - } - - public static List findN(InsnListSection haystack, InsnListSection needle) { - List list = find(haystack, needle); - if (list.isEmpty()) { - throw new RuntimeException("Needle not found in Haystack:\n" + haystack + "\n\n" + needle); - } - - return list; - } - - public static List findN(InsnList haystack, InsnListSection needle) { - return findN(new InsnListSection(haystack), needle); - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/InsnListSection.java b/dependencies/main/java/codechicken/lib/asm/InsnListSection.java deleted file mode 100644 index dd47505336..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/InsnListSection.java +++ /dev/null @@ -1,260 +0,0 @@ -package codechicken.lib.asm; - -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.tree.AbstractInsnNode; -import org.objectweb.asm.tree.*; -import org.objectweb.asm.util.Textifier; -import org.objectweb.asm.util.TraceMethodVisitor; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import static org.objectweb.asm.tree.AbstractInsnNode.*; - -/** - * A section of an InsnList, may become invalid if the insn list is modified - */ -public class InsnListSection implements Iterable { - - private class InsnListSectionIterator implements Iterator { - - int i = 0; - - @Override - public boolean hasNext() { - return i < size(); - } - - @Override - public AbstractInsnNode next() { - return get(i++); - } - - @Override - public void remove() { - InsnListSection.this.remove(--i); - } - } - - public InsnList list; - public int start; - public int end; - - public InsnListSection(InsnList list, int start, int end) { - this.list = list; - this.start = start; - this.end = end; - } - - public InsnListSection(InsnList list, AbstractInsnNode first, AbstractInsnNode last) { - this(list, list.indexOf(first), list.indexOf(last) + 1); - } - - public InsnListSection(InsnList list) { - this(list, 0, list.size()); - } - - public InsnListSection() { - this(new InsnList()); - } - - public void accept(MethodVisitor mv) { - for (AbstractInsnNode insn : this) { - insn.accept(mv); - } - } - - public AbstractInsnNode getFirst() { - return size() == 0 ? null : list.get(start); - } - - public AbstractInsnNode getLast() { - return size() == 0 ? null : list.get(end - 1); - } - - public int size() { - return end - start; - } - - public AbstractInsnNode get(int i) { - return list.get(start + i); - } - - public void set(int i, AbstractInsnNode insn) { - list.set(get(i), insn); - } - - public void remove(int i) { - list.remove(get(i)); - end--; - } - - public void replace(AbstractInsnNode location, AbstractInsnNode insn) { - list.set(location, insn); - } - - public void add(AbstractInsnNode insn) { - list.add(insn); - end++; - } - - public void insertBefore(InsnList insns) { - int s = insns.size(); - if (this.list.size() == 0) { - list.insert(insns); - } else { - list.insertBefore(list.get(start), insns); - } - start += s; - end += s; - } - - public void insert(InsnList insns) { - if (end == 0) { - list.insert(insns); - } else { - list.insert(list.get(end - 1), insns); - } - } - - public void replace(InsnList insns) { - int s = insns.size(); - remove(); - insert(insns); - end = start + s; - } - - public void remove() { - while (end != start) { - remove(0); - } - } - - public void setLast(AbstractInsnNode last) { - end = list.indexOf(last) + 1; - } - - public void setFirst(AbstractInsnNode first) { - start = list.indexOf(first); - } - - public InsnListSection drop(int n) { - return slice(n, size()); - } - - public InsnListSection take(int n) { - return slice(0, n); - } - - public InsnListSection slice(int start, int end) { - return new InsnListSection(list, this.start + start, this.start + end); - } - - /** - * Removes leading and trailing labels and line number nodes that don't affect control flow - * - * @return this - */ - public InsnListSection trim(Set controlFlowLabels) { - while (start < end && !InsnComparator.insnImportant(getFirst(), controlFlowLabels)) { - start++; - } - - while (start < end && !InsnComparator.insnImportant(getLast(), controlFlowLabels)) { - end--; - } - - return this; - } - - public String toString() { - Textifier t = new Textifier(); - accept(new TraceMethodVisitor(t)); - StringWriter sw = new StringWriter(); - t.print(new PrintWriter(sw)); - return sw.toString(); - } - - public void println() { - System.out.println(toString()); - } - - public HashMap identityLabelMap() { - HashMap labelMap = new HashMap(); - for (AbstractInsnNode insn : this) { - switch (insn.getType()) { - case LABEL: - labelMap.put((LabelNode) insn, (LabelNode) insn); - break; - case JUMP_INSN: - labelMap.put(((JumpInsnNode) insn).label, ((JumpInsnNode) insn).label); - break; - case LOOKUPSWITCH_INSN: - LookupSwitchInsnNode linsn = (LookupSwitchInsnNode) insn; - labelMap.put(linsn.dflt, linsn.dflt); - for (LabelNode label : linsn.labels) { - labelMap.put(label, label); - } - break; - case TABLESWITCH_INSN: - TableSwitchInsnNode tinsn = (TableSwitchInsnNode) insn; - labelMap.put(tinsn.dflt, tinsn.dflt); - for (LabelNode label : tinsn.labels) { - labelMap.put(label, label); - } - break; - case FRAME: - FrameNode fnode = (FrameNode) insn; - if (fnode.local != null) { - for (Object o : fnode.local) { - if (o instanceof LabelNode) { - labelMap.put((LabelNode) o, (LabelNode) o); - } - } - } - if (fnode.stack != null) { - for (Object o : fnode.stack) { - if (o instanceof LabelNode) { - labelMap.put((LabelNode) o, (LabelNode) o); - } - } - } - break; - } - } - - return labelMap; - } - - public Map cloneLabels() { - Map labelMap = identityLabelMap(); - for (Entry entry : labelMap.entrySet()) { - entry.setValue(new LabelNode()); - } - - return labelMap; - } - - public InsnListSection copy() { - return copy(cloneLabels()); - } - - public InsnListSection copy(Map labelMap) { - InsnListSection copy = new InsnListSection(); - for (AbstractInsnNode insn : this) { - copy.add(insn.clone(labelMap)); - } - - return copy; - } - - @Override - public Iterator iterator() { - return new InsnListSectionIterator(); - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/LocalVariablesSorterVisitor.java b/dependencies/main/java/codechicken/lib/asm/LocalVariablesSorterVisitor.java deleted file mode 100644 index 2b1fb1aad3..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/LocalVariablesSorterVisitor.java +++ /dev/null @@ -1,36 +0,0 @@ -package codechicken.lib.asm; - -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.commons.LocalVariablesSorter; - -import java.util.Set; - -public class LocalVariablesSorterVisitor extends ClassVisitor { - - public Set methods; - public String owner; - - public LocalVariablesSorterVisitor(Set methods, ClassVisitor cv) { - super(Opcodes.ASM4, cv); - this.methods = methods; - } - - public LocalVariablesSorterVisitor(ClassVisitor cv) { - this(null, cv); - } - - @Override - public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { - super.visit(version, access, name, signature, superName, interfaces); - owner = name; - } - - @Override - public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { - MethodVisitor mv = cv.visitMethod(access, name, desc, signature, exceptions); - return methods == null || methods.contains(new ObfMapping(owner, name, desc)) ? new LocalVariablesSorter(access, desc, mv) : mv; - } -} - diff --git a/dependencies/main/java/codechicken/lib/asm/MethodASMifier.java b/dependencies/main/java/codechicken/lib/asm/MethodASMifier.java deleted file mode 100644 index 9d00a50527..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/MethodASMifier.java +++ /dev/null @@ -1,73 +0,0 @@ -package codechicken.lib.asm; - -import net.minecraft.launchwrapper.Launch; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.util.Printer; -import org.objectweb.asm.util.TraceMethodVisitor; - -import java.io.File; -import java.io.PrintWriter; - -import static org.objectweb.asm.Opcodes.ASM4; - -public class MethodASMifier extends ClassVisitor { - - PrintWriter printWriter; - ObfMapping method; - Printer asmifier; - - public MethodASMifier(ObfMapping method, Printer printer, PrintWriter printWriter) { - super(ASM4); - this.method = method; - this.printWriter = printWriter; - asmifier = printer; - } - - @Override - public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { - if (method.matches(name, desc)) { - Printer localPrinter = asmifier.visitMethod(access, name, desc, signature, exceptions); - return new TraceMethodVisitor(null, localPrinter); - } - - return null; - } - - @Override - public void visitEnd() { - asmifier.visitClassEnd(); - asmifier.print(printWriter); - super.visitEnd(); - } - - public static void printMethod(ObfMapping method, Printer printer, File toFile) { - try { - printMethod(method, Launch.classLoader.getClassBytes(method.javaClass()), printer, toFile); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void printMethod(ObfMapping method, byte[] bytes, Printer printer, File toFile) { - try { - if (!toFile.getParentFile().exists()) { - toFile.getParentFile().mkdirs(); - } - if (!toFile.exists()) { - toFile.createNewFile(); - } - - PrintWriter printWriter = new PrintWriter(toFile); - - ClassVisitor cv = new MethodASMifier(method, printer, printWriter); - ClassReader cr = new ClassReader(bytes); - cr.accept(cv, 0); - - printWriter.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/ModularASMTransformer.java b/dependencies/main/java/codechicken/lib/asm/ModularASMTransformer.java deleted file mode 100644 index 91edeafb34..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/ModularASMTransformer.java +++ /dev/null @@ -1,345 +0,0 @@ -package codechicken.lib.asm; - -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.tree.ClassNode; -import org.objectweb.asm.tree.InsnList; -import org.objectweb.asm.tree.MethodNode; - -import java.io.File; -import java.io.FileOutputStream; -import java.util.*; - -import static codechicken.lib.asm.ASMHelper.*; - -//TODO Java doc all the internal class constructors. -public class ModularASMTransformer { - - /** - * Contains a list of transformers for a given class. - * Also contains some basic logic for doing the actual transform. - */ - public static class ClassNodeTransformerList { - - List transformers = new LinkedList(); - HashSet methodsToSort = new HashSet(); - - public void add(ClassNodeTransformer t) { - transformers.add(t); - t.addMethodsToSort(methodsToSort); - } - - public byte[] transform(byte[] bytes) { - ClassNode cnode = new ClassNode(); - ClassReader reader = new ClassReader(bytes); - ClassVisitor cv = cnode; - if (!methodsToSort.isEmpty()) { - cv = new LocalVariablesSorterVisitor(methodsToSort, cv); - } - reader.accept(cv, ClassReader.EXPAND_FRAMES); - - try { - int writeFlags = 0; - for (ClassNodeTransformer t : transformers) { - t.transform(cnode); - writeFlags |= t.writeFlags; - } - - bytes = createBytes(cnode, writeFlags); - if (config.getTag("dump_asm_raw").getBooleanValue(false)) { - File file = new File("asm/ccl_modular/" + cnode.name.replace('/', '#') + ".class"); - FileOutputStream fos = new FileOutputStream(file); - fos.write(bytes); - fos.flush(); - fos.close(); - - } else if (config.getTag("dump_asm").getBooleanValue(true)) { - dump(bytes, new File("asm/ccl_modular/" + cnode.name.replace('/', '#') + ".txt"), false, false); - } - return bytes; - } catch (Exception e) { - dump(bytes, new File("asm/ccl_modular/" + cnode.name.replace('/', '#') + ".txt"), false, false); - throw new RuntimeException(e); - } - } - } - - /** - * Parent to all transformer's. - */ - public static abstract class ClassNodeTransformer { - - public int writeFlags; - - public ClassNodeTransformer(int writeFlags) { - this.writeFlags = writeFlags; - } - - public ClassNodeTransformer() { - this(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); - } - - public abstract String className(); - - public abstract void transform(ClassNode cnode); - - public void addMethodsToSort(Set set) { - } - } - - /** - * Base Method transformer. - */ - public static abstract class MethodTransformer extends ClassNodeTransformer { - - public final ObfMapping method; - - public MethodTransformer(ObfMapping method) { - this.method = method.toClassloading(); - } - - @Override - public String className() { - return method.javaClass(); - } - - @Override - public void transform(ClassNode cnode) { - MethodNode mv = findMethod(method, cnode); - if (mv == null) { - throw new RuntimeException("Method not found: " + method); - } - - try { - transform(mv); - } catch (Exception e) { - throw new RuntimeException("Error transforming method: " + method, e); - } - } - - public abstract void transform(MethodNode mv); - } - - /** - * Writes a method containing the provided InsnList with the ObfMapping as the method name and desc. - */ - public static class MethodWriter extends ClassNodeTransformer { - - public final int access; - public final ObfMapping method; - public final String[] exceptions; - public InsnList list; - - public MethodWriter(int access, ObfMapping method) { - this(access, method, null, (InsnList) null); - } - - public MethodWriter(int access, ObfMapping method, InsnList list) { - this(access, method, null, list); - } - - public MethodWriter(int access, ObfMapping method, ASMBlock block) { - this(access, method, null, block); - } - - public MethodWriter(int access, ObfMapping method, String[] exceptions) { - this(access, method, exceptions, (InsnList) null); - } - - public MethodWriter(int access, ObfMapping method, String[] exceptions, InsnList list) { - this.access = access; - this.method = method.toClassloading(); - this.exceptions = exceptions; - this.list = list; - } - - public MethodWriter(int access, ObfMapping method, String[] exceptions, ASMBlock block) { - this(access, method, exceptions, block.rawListCopy()); - } - - @Override - public String className() { - return method.javaClass(); - } - - @Override - public void transform(ClassNode cnode) { - MethodNode mv = findMethod(method, cnode); - if (mv == null) { - mv = (MethodNode) method.visitMethod(cnode, access, exceptions); - } else { - mv.access = access; - mv.instructions.clear(); - if (mv.localVariables != null) { - mv.localVariables.clear(); - } - if (mv.tryCatchBlocks != null) { - mv.tryCatchBlocks.clear(); - } - } - - write(mv); - } - - public void write(MethodNode mv) { - logger.debug("Writing method " + method); - list.accept(mv); - } - } - - /** - * Injects a call before or after the needle. - * If needle is null it will inject at the start or end of the method. - */ - public static class MethodInjector extends MethodTransformer { - - public ASMBlock needle; - public ASMBlock injection; - public boolean before; - - public MethodInjector(ObfMapping method, ASMBlock needle, ASMBlock injection, boolean before) { - super(method); - this.needle = needle; - this.injection = injection; - this.before = before; - } - - public MethodInjector(ObfMapping method, ASMBlock injection, boolean before) { - this(method, null, injection, before); - } - - public MethodInjector(ObfMapping method, InsnList needle, InsnList injection, boolean before) { - this(method, new ASMBlock(needle), new ASMBlock(injection), before); - } - - public MethodInjector(ObfMapping method, InsnList injection, boolean before) { - this(method, null, new ASMBlock(injection), before); - } - - @Override - public void addMethodsToSort(Set set) { - set.add(method); - } - - @Override - public void transform(MethodNode mv) { - if (needle == null) { - logger.debug("Injecting " + (before ? "before" : "after") + " method " + method); - if (before) { - mv.instructions.insert(injection.rawListCopy()); - } else { - mv.instructions.add(injection.rawListCopy()); - } - } else { - for (InsnListSection key : InsnComparator.findN(mv.instructions, needle.list)) { - logger.debug("Injecting " + (before ? "before" : "after") + " method " + method + " @ " + key.start + " - " + key.end); - ASMBlock injectBlock = injection.copy().mergeLabels(needle.applyLabels(key)); - - if (before) { - key.insertBefore(injectBlock.list.list); - } else { - key.insert(injectBlock.list.list); - } - } - } - } - } - - /** - * Replaces a specific needle with a specific replacement. - * Can replace more than one needle. - */ - public static class MethodReplacer extends MethodTransformer { - - public ASMBlock needle; - public ASMBlock replacement; - - public MethodReplacer(ObfMapping method, ASMBlock needle, ASMBlock replacement) { - super(method); - this.needle = needle; - this.replacement = replacement; - } - - public MethodReplacer(ObfMapping method, InsnList needle, InsnList replacement) { - this(method, new ASMBlock(needle), new ASMBlock(replacement)); - } - - @Override - public void addMethodsToSort(Set set) { - set.add(method); - } - - @Override - public void transform(MethodNode mv) { - for (InsnListSection key : InsnComparator.findN(mv.instructions, needle.list)) { - logger.debug("Replacing method " + method + " @ " + key.start + " - " + key.end); - ASMBlock replaceBlock = replacement.copy().pullLabels(needle.applyLabels(key)); - key.insert(replaceBlock.list.list); - } - } - } - - /** - * Writes a field to a class. - * ObfMapping contains the class to put the field. - */ - public static class FieldWriter extends ClassNodeTransformer { - - public final ObfMapping field; - public final int access; - public final Object value; - - public FieldWriter(int access, ObfMapping field, Object value) { - this.field = field.toClassloading(); - this.access = access; - this.value = value; - } - - public FieldWriter(int access, ObfMapping field) { - this(access, field, null); - } - - @Override - public String className() { - return field.javaClass(); - } - - @Override - public void transform(ClassNode cnode) { - field.visitField(cnode, access, value); - } - } - - public HashMap transformers = new HashMap(); - - /** - * Adds a ClassNodeTransformer to this transformer. - * - * @param t Transformer to add. - */ - public void add(ClassNodeTransformer t) { - ClassNodeTransformerList list = transformers.get(t.className()); - if (list == null) { - transformers.put(t.className(), list = new ClassNodeTransformerList()); - } - list.add(t); - } - - /** - * Runs the transform. - * - * @param name name of the class being loaded. - * @param bytes Class bytes. - * @return Returns null if the class passed is null, returns original class if there are no transformers for a given class. - * Otherwise returns transformed class. - */ - public byte[] transform(String name, byte[] bytes) { - if (bytes == null) { - return null; - } - - ClassNodeTransformerList list = transformers.get(name); - return list == null ? bytes : list.transform(bytes); - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/ObfMapping.java b/dependencies/main/java/codechicken/lib/asm/ObfMapping.java deleted file mode 100644 index 7d4414ed0f..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/ObfMapping.java +++ /dev/null @@ -1,446 +0,0 @@ -package codechicken.lib.asm; - -import codechicken.lib.config.ConfigTag; -import com.google.common.base.Charsets; -import com.google.common.base.Objects; -import com.google.common.base.Strings; -import com.google.common.io.LineProcessor; -import com.google.common.io.Resources; -import net.minecraft.launchwrapper.Launch; -import net.minecraftforge.common.ForgeVersion; -import net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; -import net.minecraftforge.fml.relauncher.FMLInjectionData; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.FieldVisitor; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.commons.Remapper; -import org.objectweb.asm.tree.*; - -import javax.swing.*; -import java.io.File; -import java.io.IOException; -import java.lang.reflect.Field; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -public class ObfMapping { - - public static class ObfRemapper extends Remapper { - - private HashMap fields = new HashMap(); - private HashMap funcs = new HashMap(); - - public ObfRemapper() { - try { - Field rawFieldMapsField = FMLDeobfuscatingRemapper.class.getDeclaredField("rawFieldMaps"); - Field rawMethodMapsField = FMLDeobfuscatingRemapper.class.getDeclaredField("rawMethodMaps"); - rawFieldMapsField.setAccessible(true); - rawMethodMapsField.setAccessible(true); - Map> rawFieldMaps = (Map>) rawFieldMapsField.get(FMLDeobfuscatingRemapper.INSTANCE); - Map> rawMethodMaps = (Map>) rawMethodMapsField.get(FMLDeobfuscatingRemapper.INSTANCE); - - if (rawFieldMaps == null) { - throw new IllegalStateException("codechicken.lib.asm.ObfMapping loaded too early. Make sure all references are in or after the asm transformer load stage"); - } - - for (Map map : rawFieldMaps.values()) { - for (Entry entry : map.entrySet()) { - if (entry.getValue().startsWith("field")) { - fields.put(entry.getValue(), entry.getKey().substring(0, entry.getKey().indexOf(':'))); - } - } - } - for (Map map : rawMethodMaps.values()) { - for (Entry entry : map.entrySet()) { - if (entry.getValue().startsWith("func")) { - funcs.put(entry.getValue(), entry.getKey().substring(0, entry.getKey().indexOf('('))); - } - } - } - - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - @Override - public String mapMethodName(String owner, String name, String desc) { - String s = funcs.get(name); - return s == null ? name : s; - } - - @Override - public String mapFieldName(String owner, String name, String desc) { - String s = fields.get(name); - return s == null ? name : s; - } - - @Override - public String map(String typeName) { - return FMLDeobfuscatingRemapper.INSTANCE.unmap(typeName); - } - - public String unmap(String typeName) { - return FMLDeobfuscatingRemapper.INSTANCE.map(typeName); - } - - public boolean isObf(String typeName) { - return !map(typeName).equals(typeName) || !unmap(typeName).equals(typeName); - } - } - - public static class MCPRemapper extends Remapper implements LineProcessor { - - public static File[] getConfFiles() { - - // check for GradleStart system vars - if (!Strings.isNullOrEmpty(System.getProperty("net.minecraftforge.gradle.GradleStart.srg.notch-srg"))) { - File notchSrg = new File(System.getProperty("net.minecraftforge.gradle.GradleStart.srg.notch-srg")); - File csvDir = new File(System.getProperty("net.minecraftforge.gradle.GradleStart.csvDir")); - - if (notchSrg.exists() && csvDir.exists()) { - File fieldCsv = new File(csvDir, "fields.csv"); - File methodCsv = new File(csvDir, "methods.csv"); - - if (notchSrg.exists() && fieldCsv.exists() && methodCsv.exists()) { - return new File[] { notchSrg, fieldCsv, methodCsv }; - } - } - } - - ConfigTag tag = ASMHelper.config.getTag("mappingDir").setComment("Path to directory holding packaged.srg, fields.csv and methods.csv for mcp remapping"); - for (int i = 0; i < DIR_GUESSES + DIR_ASKS; i++) { - File dir = confDirectoryGuess(i, tag); - if (dir == null || dir.isFile()) { - continue; - } - - File[] mappings; - try { - mappings = parseConfDir(dir); - } catch (Exception e) { - if (i >= DIR_GUESSES) { - e.printStackTrace(); - } - continue; - } - - tag.setValue(dir.getPath()); - return mappings; - } - - throw new RuntimeException("Failed to select mappings directory, set it manually in the config"); - } - - private static final int DIR_GUESSES = 4; - private static final int DIR_ASKS = 3; - - public static File confDirectoryGuess(int i, ConfigTag tag) { - File mcDir = (File) FMLInjectionData.data()[6]; - switch (i) { - case 0: - return tag.value != null ? new File(tag.getValue()) : null; - case 1: - return new File(mcDir, "../conf"); - case 2: - return new File(mcDir, "../build/unpacked/conf"); - case 3: - return new File(System.getProperty("user.home"), ".gradle/caches/minecraft/net/minecraftforge/forge/" + FMLInjectionData.data()[4] + "-" + ForgeVersion.getVersion() + "/unpacked/conf"); - default: - JFileChooser fc = new JFileChooser(mcDir); - fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - fc.setDialogTitle("Select an mcp conf dir for the deobfuscator."); - int ret = fc.showDialog(null, "Select"); - return ret == JFileChooser.APPROVE_OPTION ? fc.getSelectedFile() : null; - } - } - - public static File[] parseConfDir(File confDir) { - File srgDir = new File(confDir, "conf"); - if (!srgDir.exists()) { - srgDir = confDir; - } - - File srgs = new File(srgDir, "packaged.srg"); - if (!srgs.exists()) { - srgs = new File(srgDir, "joined.srg"); - } - if (!srgs.exists()) { - throw new RuntimeException("Could not find packaged.srg or joined.srg"); - } - - File mapDir = new File(confDir, "mappings"); - if (!mapDir.exists()) { - mapDir = confDir; - } - - File methods = new File(mapDir, "methods.csv"); - if (!methods.exists()) { - throw new RuntimeException("Could not find methods.csv"); - } - File fields = new File(mapDir, "fields.csv"); - if (!fields.exists()) { - throw new RuntimeException("Could not find fields.csv"); - } - - return new File[] { srgs, methods, fields }; - } - - private HashMap fields = new HashMap(); - private HashMap funcs = new HashMap(); - - public MCPRemapper() { - File[] mappings = getConfFiles(); - try { - Resources.readLines(mappings[1].toURI().toURL(), Charsets.UTF_8, this); - Resources.readLines(mappings[2].toURI().toURL(), Charsets.UTF_8, this); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public String mapMethodName(String owner, String name, String desc) { - String s = funcs.get(name); - return s == null ? name : s; - } - - @Override - public String mapFieldName(String owner, String name, String desc) { - String s = fields.get(name); - return s == null ? name : s; - } - - @Override - public boolean processLine(String line) throws IOException { - int i = line.indexOf(','); - String srg = line.substring(0, i); - int i2 = i + 1; - i = line.indexOf(',', i2); - String mcp = line.substring(i2, i); - (srg.startsWith("func") ? funcs : fields).put(srg, mcp); - return true; - } - - @Override - public Void getResult() { - return null; - } - } - - public static ObfRemapper obfMapper = new ObfRemapper(); - public static Remapper mcpMapper = null; - - public static void loadMCPRemapper() { - if (mcpMapper == null) { - mcpMapper = new MCPRemapper(); - } - } - - public static final boolean obfuscated; - - static { - boolean obf = true; - try { - obf = Launch.classLoader.getClassBytes("net.minecraft.world.World") == null; - } catch (IOException ignored) { - } - obfuscated = obf; - if (!obf) { - loadMCPRemapper(); - } - } - - public String s_owner; - public String s_name; - public String s_desc; - - public ObfMapping(String owner) { - this(owner, "", ""); - } - - public ObfMapping(String owner, String name, String desc) { - this.s_owner = owner; - this.s_name = name; - this.s_desc = desc; - - if (s_owner.contains(".")) { - throw new IllegalArgumentException(s_owner); - } - } - - public ObfMapping(ObfMapping descmap, String subclass) { - this(subclass, descmap.s_name, descmap.s_desc); - } - - public static ObfMapping fromDesc(String s) { - int lastDot = s.lastIndexOf('.'); - if (lastDot < 0) { - return new ObfMapping(s, "", ""); - } - int sep = s.indexOf('(');//methods - int sep_end = sep; - if (sep < 0) { - sep = s.indexOf(' ');//some stuffs - sep_end = sep + 1; - } - if (sep < 0) { - sep = s.indexOf(':');//fields - sep_end = sep + 1; - } - if (sep < 0) { - return new ObfMapping(s.substring(0, lastDot), s.substring(lastDot + 1), ""); - } - - return new ObfMapping(s.substring(0, lastDot), s.substring(lastDot + 1, sep), s.substring(sep_end)); - } - - public ObfMapping subclass(String subclass) { - return new ObfMapping(this, subclass); - } - - public boolean matches(MethodNode node) { - return s_name.equals(node.name) && s_desc.equals(node.desc); - } - - public boolean matches(MethodInsnNode node) { - return s_owner.equals(node.owner) && s_name.equals(node.name) && s_desc.equals(node.desc); - } - - public AbstractInsnNode toInsn(int opcode) { - if (isClass()) { - return new TypeInsnNode(opcode, s_owner); - } else if (isMethod()) { - return new MethodInsnNode(opcode, s_owner, s_name, s_desc); - } else { - return new FieldInsnNode(opcode, s_owner, s_name, s_desc); - } - } - - public void visitTypeInsn(MethodVisitor mv, int opcode) { - mv.visitTypeInsn(opcode, s_owner); - } - - public void visitMethodInsn(MethodVisitor mv, int opcode) { - mv.visitMethodInsn(opcode, s_owner, s_name, s_desc); - } - - public void visitFieldInsn(MethodVisitor mv, int opcode) { - mv.visitFieldInsn(opcode, s_owner, s_name, s_desc); - } - - public MethodVisitor visitMethod(ClassVisitor visitor, int access, String[] exceptions) { - return visitor.visitMethod(access, s_name, s_desc, null, exceptions); - } - - public FieldVisitor visitField(ClassVisitor visitor, int access, Object value) { - return visitor.visitField(access, s_name, s_desc, null, value); - } - - public boolean isClass(String name) { - return name.replace('.', '/').equals(s_owner); - } - - public boolean matches(String name, String desc) { - return s_name.equals(name) && s_desc.equals(desc); - } - - public boolean matches(FieldNode node) { - return s_name.equals(node.name) && s_desc.equals(node.desc); - } - - public boolean matches(FieldInsnNode node) { - return s_owner.equals(node.owner) && s_name.equals(node.name) && s_desc.equals(node.desc); - } - - public String javaClass() { - return s_owner.replace('/', '.'); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof ObfMapping)) { - return false; - } - - ObfMapping desc = (ObfMapping) obj; - return s_owner.equals(desc.s_owner) && s_name.equals(desc.s_name) && s_desc.equals(desc.s_desc); - } - - @Override - public int hashCode() { - return Objects.hashCode(s_desc, s_name, s_owner); - } - - @Override - public String toString() { - if (s_name.length() == 0) { - return "[" + s_owner + "]"; - } - if (s_desc.length() == 0) { - return "[" + s_owner + "." + s_name + "]"; - } - return "[" + (isMethod() ? methodDesc() : fieldDesc()) + "]"; - } - - public String methodDesc() { - return s_owner + "." + s_name + s_desc; - } - - public String fieldDesc() { - return s_owner + "." + s_name + ":" + s_desc; - } - - public boolean isClass() { - return s_name.length() == 0; - } - - public boolean isMethod() { - return s_desc.contains("("); - } - - public boolean isField() { - return !isClass() && !isMethod(); - } - - public ObfMapping map(Remapper mapper) { - if (mapper == null) { - return this; - } - - if (isMethod()) { - s_name = mapper.mapMethodName(s_owner, s_name, s_desc); - } else if (isField()) { - s_name = mapper.mapFieldName(s_owner, s_name, s_desc); - } - - s_owner = mapper.mapType(s_owner); - - if (isMethod()) { - s_desc = mapper.mapMethodDesc(s_desc); - } else if (s_desc.length() > 0) { - s_desc = mapper.mapDesc(s_desc); - } - - return this; - } - - public ObfMapping toRuntime() { - map(mcpMapper); - return this; - } - - public ObfMapping toClassloading() { - if (!obfuscated) { - map(mcpMapper); - } else if (obfMapper.isObf(s_owner)) { - map(obfMapper); - } - return this; - } - - public ObfMapping copy() { - return new ObfMapping(s_owner, s_name, s_desc); - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/discovery/ClassDiscoverer.java b/dependencies/main/java/codechicken/lib/asm/discovery/ClassDiscoverer.java deleted file mode 100644 index 5632a15a60..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/discovery/ClassDiscoverer.java +++ /dev/null @@ -1,138 +0,0 @@ -package codechicken.lib.asm.discovery; - -import codechicken.lib.asm.ASMHelper; -import codechicken.lib.asm.CCLCorePlugin; -import codechicken.lib.util.CommonUtils; -import net.minecraft.launchwrapper.Launch; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.ModClassLoader; -import net.minecraftforge.fml.common.ModContainer; -import org.objectweb.asm.tree.ClassNode; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - -public class ClassDiscoverer { - - public IStringMatcher matcher; - public String[] superclasses; - public ArrayList> classes; - public ModClassLoader modClassLoader; - - public ClassDiscoverer(IStringMatcher matcher, Class... superclasses) { - this.matcher = matcher; - this.superclasses = new String[superclasses.length]; - for (int i = 0; i < superclasses.length; i++) { - this.superclasses[i] = superclasses[i].getName().replace('.', '/'); - } - - classes = new ArrayList>(); - modClassLoader = Loader.instance().getModClassLoader(); - } - - public ClassDiscoverer(Class... superclasses) { - this(new IStringMatcher() { - public boolean matches(String test) { - return true; - } - }, superclasses); - } - - public ArrayList> findClasses() { - try { - findClasspathMods(); - } catch (Exception e) { - throw new RuntimeException(e); - } - return classes; - } - - private void checkAddClass(String resource) { - try { - String classname = resource.replace(".class", "").replace("\\", ".").replace("/", "."); - byte[] bytes = Launch.classLoader.getClassBytes(classname); - if (bytes == null) { - return; - } - - ClassNode cnode = ASMHelper.createClassNode(bytes); - for (String superclass : superclasses) { - if (!cnode.interfaces.contains(superclass) && !cnode.superName.equals(superclass)) { - return; - } - } - - addClass(classname); - } catch (IOException e) { - CCLCorePlugin.logger.error("Unable to load class: " + resource, e); - } - } - - private void addClass(String classname) { - try { - Class class1 = Class.forName(classname, true, modClassLoader); - classes.add(class1); - } catch (Throwable t) { - CCLCorePlugin.logger.error("Unable to load class: " + classname, t); - } - } - - private void findClasspathMods() { - List mods = Loader.instance().getActiveModList(); - HashSet searched = new HashSet(); - for (ModContainer mod : mods) { - File source = mod.getSource(); - if (source == null || searched.contains(source.getAbsolutePath())) { - continue; - } - searched.add(source.getAbsolutePath()); - - if (source.isFile()) { - CCLCorePlugin.logger.debug("Found a mod container %s, examining for codechicken classes", source.getAbsolutePath()); - try { - readFromZipFile(source); - } catch (Exception e) { - CCLCorePlugin.logger.error("Failed to scan " + source.getAbsolutePath() + ", the zip file is invalid", e); - } - } else if (source.isDirectory()) { - CCLCorePlugin.logger.debug("Found a minecraft related directory at %s, examining for codechicken classes", source.getAbsolutePath()); - readFromDirectory(source, source); - } - } - } - - private void readFromZipFile(File file) throws IOException { - FileInputStream fileinputstream = new FileInputStream(file); - ZipInputStream zipinputstream = new ZipInputStream(fileinputstream); - do { - ZipEntry zipentry = zipinputstream.getNextEntry(); - if (zipentry == null) { - break; - } - String fullname = zipentry.getName().replace('\\', '/'); - int pos = fullname.lastIndexOf('/'); - String name = pos == -1 ? fullname : fullname.substring(pos + 1); - if (!zipentry.isDirectory() && matcher.matches(name)) { - checkAddClass(fullname); - } - } while (true); - fileinputstream.close(); - } - - private void readFromDirectory(File directory, File basedirectory) { - for (File child : directory.listFiles()) { - if (child.isDirectory()) { - readFromDirectory(child, basedirectory); - } else if (child.isFile() && matcher.matches(child.getName())) { - String fullname = CommonUtils.getRelativePath(basedirectory, child); - checkAddClass(fullname); - } - } - } -} diff --git a/dependencies/main/java/codechicken/lib/asm/discovery/IStringMatcher.java b/dependencies/main/java/codechicken/lib/asm/discovery/IStringMatcher.java deleted file mode 100644 index 45f69d3fdb..0000000000 --- a/dependencies/main/java/codechicken/lib/asm/discovery/IStringMatcher.java +++ /dev/null @@ -1,7 +0,0 @@ -package codechicken.lib.asm.discovery; - -//TODO Predicate? -public interface IStringMatcher { - - boolean matches(String test); -} diff --git a/dependencies/main/java/codechicken/lib/block/BlockMultiTile.java b/dependencies/main/java/codechicken/lib/block/BlockMultiTile.java deleted file mode 100644 index 7c3f4c7e70..0000000000 --- a/dependencies/main/java/codechicken/lib/block/BlockMultiTile.java +++ /dev/null @@ -1,55 +0,0 @@ -package codechicken.lib.block; - -import net.minecraft.block.Block; -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.block.material.Material; -import net.minecraft.item.Item; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.fml.common.FMLLog; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.registry.GameRegistry; -import org.apache.logging.log4j.Level; - -/** - * Created by covers1624 on 3/27/2016. - */ -public class BlockMultiTile extends Block implements ITileEntityProvider { - - @SuppressWarnings ("unchecked") - private Class[] tileEntityMap = new Class[16]; - - public BlockMultiTile(Material material) { - super(material); - } - - public void registerSubItemAndTile(int meta, String name, Class clazz) { - GameRegistry.registerTileEntity(clazz, Loader.instance().activeModContainer().getModId() + ":" + name); - addSubItemAndTile(meta, name, clazz); - } - - public void addSubItemAndTile(int meta, String name, Class clazz) { - addTileEntityMapping(meta, clazz); - setItemName(meta, name); - } - - public void setItemName(int meta, String name) { - Item item = Item.getItemFromBlock(this); - ((ItemBlockMultiType) item).registerSubItem(meta, name); - } - - public void addTileEntityMapping(int meta, Class clazz) { - this.tileEntityMap[meta] = clazz; - } - - @Override - public TileEntity createNewTileEntity(World worldIn, int meta) { - Class clazz = tileEntityMap[meta]; - try { - return clazz.getDeclaredConstructor(new Class[0]).newInstance(); - } catch (Exception e) { - FMLLog.log("CodeChicken Lib", Level.FATAL, "Unable to create tile with meta of %s", meta); - return null; - } - } -} diff --git a/dependencies/main/java/codechicken/lib/block/IParticleProvider.java b/dependencies/main/java/codechicken/lib/block/IParticleProvider.java deleted file mode 100644 index ff261266ed..0000000000 --- a/dependencies/main/java/codechicken/lib/block/IParticleProvider.java +++ /dev/null @@ -1,10 +0,0 @@ -package codechicken.lib.block; - -/** - * Created by covers1624 on 20/11/2016. - */ -public interface IParticleProvider extends IType { - - String getParticleTexture(); - -} diff --git a/dependencies/main/java/codechicken/lib/block/IType.java b/dependencies/main/java/codechicken/lib/block/IType.java deleted file mode 100644 index 6445f14a91..0000000000 --- a/dependencies/main/java/codechicken/lib/block/IType.java +++ /dev/null @@ -1,15 +0,0 @@ -package codechicken.lib.block; - -import net.minecraft.block.properties.IProperty; -import net.minecraft.util.IStringSerializable; - -/** - * Created by covers1624 on 20/11/2016. - */ -public interface IType extends IStringSerializable { - - IProperty getTypeProperty(); - - int meta(); - -} diff --git a/dependencies/main/java/codechicken/lib/block/ItemBlockMultiType.java b/dependencies/main/java/codechicken/lib/block/ItemBlockMultiType.java deleted file mode 100644 index 26aa8e5181..0000000000 --- a/dependencies/main/java/codechicken/lib/block/ItemBlockMultiType.java +++ /dev/null @@ -1,55 +0,0 @@ -package codechicken.lib.block; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Created by covers1624 on 3/27/2016. - */ -//TODO Merge Model variant code in to here. maybe. -public class ItemBlockMultiType extends ItemBlock { - - private HashMap names = new HashMap(); - - public ItemBlockMultiType(Block block) { - super(block); - setMaxDamage(0); - setHasSubtypes(true); - } - - @Override - public int getMetadata(int meta) { - return meta; - } - - public ItemBlockMultiType registerBulkArray(String[] names) { - for (int i = 0; i < names.length; i++) { - registerSubItem(i, names[i]); - } - return this; - } - - public ItemBlockMultiType registerSubItem(int meta, String name) { - names.put(meta, name); - return this; - } - - @Override - public String getUnlocalizedName(ItemStack stack) { - return "tile." + names.get(stack.getItemDamage()); - } - - @Override - public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) { - for (Map.Entry entry : names.entrySet()) { - subItems.add(new ItemStack(this, 1, entry.getKey())); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/block/StateReference.java b/dependencies/main/java/codechicken/lib/block/StateReference.java deleted file mode 100644 index 85bb6aa5bc..0000000000 --- a/dependencies/main/java/codechicken/lib/block/StateReference.java +++ /dev/null @@ -1,14 +0,0 @@ -package codechicken.lib.block; - -import codechicken.lib.block.property.PropertyEnumFacingAll; -import codechicken.lib.block.property.PropertyEnumFacingHoz; - -/** - * Created by covers1624 on 3/28/2016. - */ -public class StateReference { - - public static final PropertyEnumFacingHoz FACING_HOZ = PropertyEnumFacingHoz.create("facinghoz"); - public static final PropertyEnumFacingAll FACING_ALL = PropertyEnumFacingAll.create("facingall"); - -} diff --git a/dependencies/main/java/codechicken/lib/block/property/PropertyEnumFacingAll.java b/dependencies/main/java/codechicken/lib/block/property/PropertyEnumFacingAll.java deleted file mode 100644 index f5779280db..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/PropertyEnumFacingAll.java +++ /dev/null @@ -1,21 +0,0 @@ -package codechicken.lib.block.property; - -import com.google.common.collect.Lists; -import net.minecraft.block.properties.PropertyDirection; -import net.minecraft.util.EnumFacing; - -import java.util.Collection; - -/** - * Created by covers1624 on 3/27/2016. - */ -public class PropertyEnumFacingAll extends PropertyDirection { - - protected PropertyEnumFacingAll(String name, Collection values) { - super(name, values); - } - - public static PropertyEnumFacingAll create(String name) { - return new PropertyEnumFacingAll(name, Lists.newArrayList(EnumFacing.VALUES)); - } -} diff --git a/dependencies/main/java/codechicken/lib/block/property/PropertyEnumFacingHoz.java b/dependencies/main/java/codechicken/lib/block/property/PropertyEnumFacingHoz.java deleted file mode 100644 index 0502626042..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/PropertyEnumFacingHoz.java +++ /dev/null @@ -1,22 +0,0 @@ -package codechicken.lib.block.property; - -import com.google.common.collect.Lists; -import net.minecraft.block.properties.PropertyDirection; -import net.minecraft.util.EnumFacing; - -import java.util.Collection; - -/** - * Created by covers1624 on 3/27/2016. - */ -public class PropertyEnumFacingHoz extends PropertyDirection { - - protected PropertyEnumFacingHoz(String name, Collection values) { - super(name, values); - } - - public static PropertyEnumFacingHoz create(String name) { - return new PropertyEnumFacingHoz(name, Lists.newArrayList(EnumFacing.HORIZONTALS)); - } - -} diff --git a/dependencies/main/java/codechicken/lib/block/property/PropertyInteger.java b/dependencies/main/java/codechicken/lib/block/property/PropertyInteger.java deleted file mode 100644 index 586f9f50ef..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/PropertyInteger.java +++ /dev/null @@ -1,48 +0,0 @@ -package codechicken.lib.block.property; - -import com.google.common.base.Optional; -import com.google.common.collect.ImmutableSet; -import net.minecraft.block.properties.PropertyHelper; - -import java.util.Collection; - -/** - * Created by covers1624 on 5/23/2016. - */ -public class PropertyInteger extends PropertyHelper { - - private final ImmutableSet valueSet; - - public PropertyInteger(String name, Collection values) { - super(name, Integer.class); - valueSet = ImmutableSet.copyOf(values); - } - - //EG, 16 = 0 - 15, 4 = 0 - 3 - public PropertyInteger(String name, int max) { - super(name, Integer.class); - ImmutableSet.Builder builder = ImmutableSet.builder(); - for (int i = 0; i < max; i++) { - builder.add(i); - } - valueSet = builder.build(); - } - - @Override - public Collection getAllowedValues() { - return valueSet; - } - - @Override - public Optional parseValue(String value) { - if (valueSet.contains(Integer.valueOf(value))) { - return Optional.of(Integer.valueOf(value)); - } - return Optional.absent(); - } - - @Override - public String getName(Integer value) { - return String.valueOf(value); - } -} diff --git a/dependencies/main/java/codechicken/lib/block/property/PropertyString.java b/dependencies/main/java/codechicken/lib/block/property/PropertyString.java deleted file mode 100644 index 9c263e1e2c..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/PropertyString.java +++ /dev/null @@ -1,52 +0,0 @@ -package codechicken.lib.block.property; - -import com.google.common.base.Optional; -import com.google.common.collect.ImmutableList; -import net.minecraft.block.properties.PropertyHelper; - -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -/** - * Created by covers1624 on 2/6/2016. - */ -public class PropertyString extends PropertyHelper { - - private final List valuesSet; - - public PropertyString(String name, Collection values) { - super(name, String.class); - valuesSet = new LinkedList(values); - } - - public PropertyString(String name, String... values) { - super(name, String.class); - valuesSet = new LinkedList(); - Collections.addAll(valuesSet, values); - } - - public List values() { - return ImmutableList.copyOf(valuesSet); - } - - @Override - public Collection getAllowedValues() { - return ImmutableList.copyOf(valuesSet); - } - - @Override - public Optional parseValue(String value) { - if (valuesSet.contains(value)) { - return Optional.of(value); - } - return Optional.absent(); - } - - @Override - public String getName(String value) { - return value; - } -} - diff --git a/dependencies/main/java/codechicken/lib/block/property/TileEntityProperty.java b/dependencies/main/java/codechicken/lib/block/property/TileEntityProperty.java deleted file mode 100644 index bda47941f1..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/TileEntityProperty.java +++ /dev/null @@ -1,39 +0,0 @@ -package codechicken.lib.block.property; - -import com.google.common.base.Objects; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.property.IUnlistedProperty; - -/** - * Created by covers1624 on 5/10/2016. - * Used to store a TileEntity as an UnlistedProperty for the use of baking models, useful for anything to do with tile access dependent baking. - */ -public class TileEntityProperty implements IUnlistedProperty { - - private String name; - - public TileEntityProperty(String name) { - this.name = name; - } - - @Override - public String getName() { - return name; - } - - @Override - public boolean isValid(TileEntity value) { - return true; - } - - @Override - public Class getType() { - return TileEntity.class; - } - - @Override - public String valueToString(TileEntity value) { - Object worldID = value.hasWorldObj() ? value.getWorld().provider.getDimension() : "NoWorld!"; - return Objects.toStringHelper(value).add("position", value.getPos().toString()).add("worldID", worldID).toString(); - } -} diff --git a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedBooleanProperty.java b/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedBooleanProperty.java deleted file mode 100644 index 8303399732..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedBooleanProperty.java +++ /dev/null @@ -1,21 +0,0 @@ -package codechicken.lib.block.property.unlisted; - -/** - * Created by covers1624 on 28/10/2016. - */ -public class UnlistedBooleanProperty extends UnlistedPropertyBase { - - public UnlistedBooleanProperty(String name) { - super(name); - } - - @Override - public Class getType() { - return Boolean.class; - } - - @Override - public String valueToString(Boolean value) { - return value.toString(); - } -} diff --git a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedByteArrayProperty.java b/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedByteArrayProperty.java deleted file mode 100644 index 307af6758c..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedByteArrayProperty.java +++ /dev/null @@ -1,31 +0,0 @@ -package codechicken.lib.block.property.unlisted; - -import com.google.common.base.Objects; -import com.google.common.base.Objects.ToStringHelper; - -/** - * Created by covers1624 on 21/02/2017. - */ -public class UnlistedByteArrayProperty extends UnlistedPropertyBase { - - public UnlistedByteArrayProperty(String name) { - super(name); - } - - @Override - public Class getType() { - return byte[].class; - } - - @Override - public String valueToString(byte[] value) { - ToStringHelper helper = Objects.toStringHelper("ByteArray"); - if (value != null) { - for (int i1 = 0; i1 < value.length; i1++) { - byte i = value[i1]; - helper.add("Index:" + i1, i); - } - } - return helper.toString(); - } -} diff --git a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedByteProperty.java b/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedByteProperty.java deleted file mode 100644 index 41c1c33f46..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedByteProperty.java +++ /dev/null @@ -1,21 +0,0 @@ -package codechicken.lib.block.property.unlisted; - -/** - * Created by covers1624 on 28/10/2016. - */ -public class UnlistedByteProperty extends UnlistedPropertyBase { - - public UnlistedByteProperty(String name) { - super(name); - } - - @Override - public Class getType() { - return Byte.class; - } - - @Override - public String valueToString(Byte value) { - return value.toString(); - } -} diff --git a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedEnumFacingProperty.java b/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedEnumFacingProperty.java deleted file mode 100644 index f9b81b5661..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedEnumFacingProperty.java +++ /dev/null @@ -1,23 +0,0 @@ -package codechicken.lib.block.property.unlisted; - -import net.minecraft.util.EnumFacing; - -/** - * Created by covers1624 on 23/11/2016. - */ -public class UnlistedEnumFacingProperty extends UnlistedPropertyBase { - - public UnlistedEnumFacingProperty(String name) { - super(name); - } - - @Override - public Class getType() { - return EnumFacing.class; - } - - @Override - public String valueToString(EnumFacing value) { - return value.toString(); - } -} diff --git a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedFluidStackProperty.java b/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedFluidStackProperty.java deleted file mode 100644 index bbdc89c46f..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedFluidStackProperty.java +++ /dev/null @@ -1,24 +0,0 @@ -package codechicken.lib.block.property.unlisted; - -import com.google.common.base.Objects; -import net.minecraftforge.fluids.FluidStack; - -/** - * Created by covers1624 on 30/10/2016. - */ -public class UnlistedFluidStackProperty extends UnlistedPropertyBase { - - public UnlistedFluidStackProperty(String name) { - super(name); - } - - @Override - public Class getType() { - return FluidStack.class; - } - - @Override - public String valueToString(FluidStack value) { - return Objects.toStringHelper("FluidStack").add("Fluid", value.getFluid().getName()).add("Amount", value.amount).add("Tag", value.tag.toString()).toString(); - } -} diff --git a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedIntArrayProperty.java b/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedIntArrayProperty.java deleted file mode 100644 index 9fa4a9251c..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedIntArrayProperty.java +++ /dev/null @@ -1,31 +0,0 @@ -package codechicken.lib.block.property.unlisted; - -import com.google.common.base.Objects; -import com.google.common.base.Objects.ToStringHelper; - -/** - * Created by covers1624 on 21/02/2017. - */ -public class UnlistedIntArrayProperty extends UnlistedPropertyBase { - - public UnlistedIntArrayProperty(String name) { - super(name); - } - - @Override - public Class getType() { - return int[].class; - } - - @Override - public String valueToString(int[] value) { - ToStringHelper helper = Objects.toStringHelper("IntArray"); - if (value != null) { - for (int i1 = 0; i1 < value.length; i1++) { - int i = value[i1]; - helper.add("Index:" + i1, i); - } - } - return helper.toString(); - } -} diff --git a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedIntegerProperty.java b/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedIntegerProperty.java deleted file mode 100644 index 7ebb17fbe2..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedIntegerProperty.java +++ /dev/null @@ -1,21 +0,0 @@ -package codechicken.lib.block.property.unlisted; - -/** - * Created by covers1624 on 28/10/2016. - */ -public class UnlistedIntegerProperty extends UnlistedPropertyBase { - - public UnlistedIntegerProperty(String name) { - super(name); - } - - @Override - public Class getType() { - return Integer.class; - } - - @Override - public String valueToString(Integer value) { - return value.toString(); - } -} diff --git a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedMapProperty.java b/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedMapProperty.java deleted file mode 100644 index 28b5961feb..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedMapProperty.java +++ /dev/null @@ -1,41 +0,0 @@ -package codechicken.lib.block.property.unlisted; - -import java.util.Map; - -/** - * Created by covers1624 on 25/10/2016. - */ -public class UnlistedMapProperty extends UnlistedPropertyBase { - - private IMapStringGenerator generator = null; - - public UnlistedMapProperty(String name) { - super(name); - } - - public UnlistedMapProperty setStringGenerator(IMapStringGenerator generator) { - if (generator == null) { - this.generator = generator; - } - return this; - } - - @Override - public Class getType() { - return Map.class; - } - - @Override - public String valueToString(Map value) { - if (value == null) { - return "null"; - } - return generator != null ? generator.makeString(value) : value.toString(); - } - - public interface IMapStringGenerator { - - String makeString(Map map); - } - -} diff --git a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedPropertyBase.java b/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedPropertyBase.java deleted file mode 100644 index 4604b82797..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedPropertyBase.java +++ /dev/null @@ -1,25 +0,0 @@ -package codechicken.lib.block.property.unlisted; - -import net.minecraftforge.common.property.IUnlistedProperty; - -/** - * Created by covers1624 on 30/10/2016. - */ -public abstract class UnlistedPropertyBase implements IUnlistedProperty { - - protected final String name; - - public UnlistedPropertyBase(String name) { - this.name = name; - } - - @Override - public String getName() { - return name; - } - - @Override - public boolean isValid(V value) { - return true; - } -} diff --git a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedResourceLocationProperty.java b/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedResourceLocationProperty.java deleted file mode 100644 index 39b68fa0a2..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedResourceLocationProperty.java +++ /dev/null @@ -1,23 +0,0 @@ -package codechicken.lib.block.property.unlisted; - -import net.minecraft.util.ResourceLocation; - -/** - * Created by covers1624 on 28/10/2016. - */ -public class UnlistedResourceLocationProperty extends UnlistedPropertyBase { - - public UnlistedResourceLocationProperty(String name) { - super(name); - } - - @Override - public Class getType() { - return ResourceLocation.class; - } - - @Override - public String valueToString(ResourceLocation value) { - return value.toString(); - } -} diff --git a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedSpriteProperty.java b/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedSpriteProperty.java deleted file mode 100644 index 8dc3333f75..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedSpriteProperty.java +++ /dev/null @@ -1,27 +0,0 @@ -package codechicken.lib.block.property.unlisted; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -/** - * Created by covers1624 on 25/10/2016. - */ -@SideOnly (Side.CLIENT) -public class UnlistedSpriteProperty extends UnlistedPropertyBase { - - public UnlistedSpriteProperty(String name) { - super(name); - } - - @SuppressWarnings ("unchecked") - public Class getType() { - return TextureAtlasSprite.class; - } - - @Override - public String valueToString(TextureAtlasSprite value) { - return value.toString(); - } - -} diff --git a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedStringProperty.java b/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedStringProperty.java deleted file mode 100644 index 29214ec712..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedStringProperty.java +++ /dev/null @@ -1,21 +0,0 @@ -package codechicken.lib.block.property.unlisted; - -/** - * Created by covers1624 on 28/10/2016. - */ -public class UnlistedStringProperty extends UnlistedPropertyBase { - - public UnlistedStringProperty(String name) { - super(name); - } - - @Override - public Class getType() { - return String.class; - } - - @Override - public String valueToString(String value) { - return value; - } -} diff --git a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedTileEntityProperty.java b/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedTileEntityProperty.java deleted file mode 100644 index 9c4948a43c..0000000000 --- a/dependencies/main/java/codechicken/lib/block/property/unlisted/UnlistedTileEntityProperty.java +++ /dev/null @@ -1,23 +0,0 @@ -package codechicken.lib.block.property.unlisted; - -import net.minecraft.tileentity.TileEntity; - -/** - * Created by covers1624 on 28/02/2017. - */ -public class UnlistedTileEntityProperty extends UnlistedPropertyBase { - - public UnlistedTileEntityProperty(String name) { - super(name); - } - - @Override - public Class getType() { - return TileEntity.class; - } - - @Override - public String valueToString(TileEntity value) { - return value.toString(); - } -} diff --git a/dependencies/main/java/codechicken/lib/colour/Colour.java b/dependencies/main/java/codechicken/lib/colour/Colour.java deleted file mode 100644 index 569854789e..0000000000 --- a/dependencies/main/java/codechicken/lib/colour/Colour.java +++ /dev/null @@ -1,208 +0,0 @@ -package codechicken.lib.colour; - -import codechicken.lib.config.ConfigTag.IConfigType; -import codechicken.lib.math.MathHelper; -import codechicken.lib.util.Copyable; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public abstract class Colour implements Copyable { - - public static IConfigType configRGB = new IConfigType() { - @Override - public String configValue(Colour entry) { - String s = Long.toString(((long) entry.rgb()) << 32 >>> 32, 16); - while (s.length() < 6) { - s = "0" + s; - } - return "0x" + s.toUpperCase(); - } - - private final Pattern patternRGB = Pattern.compile("(\\d+),(\\d+),(\\d+)"); - - @Override - public Colour valueOf(String text) throws Exception { - Matcher matcherRGB = patternRGB.matcher(text.replaceAll("\\s", "")); - if (matcherRGB.matches()) { - return new ColourRGBA(Integer.parseInt(matcherRGB.group(1)), Integer.parseInt(matcherRGB.group(2)), Integer.parseInt(matcherRGB.group(3)), 0xFF); - } - - int hex = (int) Long.parseLong(text.replace("0x", ""), 16); - return new ColourRGBA(hex << 8 | 0xFF); - } - }; - - public byte r; - public byte g; - public byte b; - public byte a; - - public Colour(int r, int g, int b, int a) { - this.r = (byte) r; - this.g = (byte) g; - this.b = (byte) b; - this.a = (byte) a; - } - - public Colour(Colour colour) { - r = colour.r; - g = colour.g; - b = colour.b; - a = colour.a; - } - - @SideOnly (Side.CLIENT) - public void glColour() { - GlStateManager.color((r & 0xFF) / 255F, (g & 0xFF) / 255F, (b & 0xFF) / 255F, (a & 0xFF) / 255F); - } - - @SideOnly (Side.CLIENT) - public void glColour(int a) { - GlStateManager.color((r & 0xFF) / 255F, (g & 0xFF) / 255F, (b & 0xFF) / 255F, a / 255F); - } - - public abstract int pack(); - - public abstract float[] packArray(); - - @Override - public String toString() { - return getClass().getSimpleName() + "[0x" + Integer.toHexString(pack()).toUpperCase() + "]"; - } - - public Colour add(Colour colour2) { - a += colour2.a; - r += colour2.r; - g += colour2.g; - b += colour2.b; - return this; - } - - public Colour sub(Colour colour2) { - int ia = (a & 0xFF) - (colour2.a & 0xFF); - int ir = (r & 0xFF) - (colour2.r & 0xFF); - int ig = (g & 0xFF) - (colour2.g & 0xFF); - int ib = (b & 0xFF) - (colour2.b & 0xFF); - a = (byte) (ia < 0 ? 0 : ia); - r = (byte) (ir < 0 ? 0 : ir); - g = (byte) (ig < 0 ? 0 : ig); - b = (byte) (ib < 0 ? 0 : ib); - return this; - } - - public Colour invert() { - a = (byte) (0xFF - (a & 0xFF)); - r = (byte) (0xFF - (r & 0xFF)); - g = (byte) (0xFF - (g & 0xFF)); - b = (byte) (0xFF - (b & 0xFF)); - return this; - } - - public Colour multiply(Colour colour2) { - a = (byte) ((a & 0xFF) * ((colour2.a & 0xFF) / 255D)); - r = (byte) ((r & 0xFF) * ((colour2.r & 0xFF) / 255D)); - g = (byte) ((g & 0xFF) * ((colour2.g & 0xFF) / 255D)); - b = (byte) ((b & 0xFF) * ((colour2.b & 0xFF) / 255D)); - return this; - } - - public Colour scale(double d) { - a = (byte) ((a & 0xFF) * d); - r = (byte) ((r & 0xFF) * d); - g = (byte) ((g & 0xFF) * d); - b = (byte) ((b & 0xFF) * d); - return this; - } - - public Colour interpolate(Colour colour2, double d) { - return this.add(colour2.copy().sub(this).scale(d)); - } - - public Colour multiplyC(double d) { - r = (byte) MathHelper.clip((r & 0xFF) * d, 0, 255); - g = (byte) MathHelper.clip((g & 0xFF) * d, 0, 255); - b = (byte) MathHelper.clip((b & 0xFF) * d, 0, 255); - - return this; - } - - public abstract Colour copy(); - - public int rgb() { - return (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF); - } - - public int argb() { - return (a & 0xFF) << 24 | (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF); - } - - public int rgba() { - return (r & 0xFF) << 24 | (g & 0xFF) << 16 | (b & 0xFF) << 8 | (a & 0xFF); - } - - public abstract Colour set(int colour); - - public Colour set(Colour colour) { - r = colour.r; - g = colour.g; - b = colour.b; - a = colour.a; - return this; - } - - public static int packRGBA(byte r, byte g, byte b, byte a) { - return (r & 0xFF) << 24 | (g & 0xFF) << 16 | (b & 0xFF) << 8 | (a & 0xFF); - } - - public static int packARGB(byte r, byte g, byte b, byte a) { - return (a & 0xFF) << 24 | (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF); - } - - public static int packRGBA(int r, int g, int b, int a) { - return r << 24 | g << 16 | b << 8 | a; - } - - public static int packARGB(int r, int g, int b, int a) { - return a << 24 | r << 16 | g << 8 | b; - } - - public static int packRGBA(double r, double g, double b, double a) { - return (int) (r * 255) << 24 | (int) (g * 255) << 16 | (int) (b * 255) << 8 | (int) (a * 255); - } - - public static int packARGB(double r, double g, double b, double a) { - return (int) (a * 255) << 24 | (int) (r * 255) << 16 | (int) (g * 255) << 8 | (int) (b * 255); - } - - public static int packRGBA(float[] data) { - return packRGBA(data[0], data[1], data[2], data[3]); - } - - public static int packARGB(float[] data) { - return packARGB(data[0], data[1], data[2], data[3]); - } - - public static void glColourRGBA(int colour) { - float r = ((colour >> 24) & 0xFF) / 255F; - float g = ((colour >> 16) & 0xFF) / 255F; - float b = ((colour >> 8) & 0xFF) / 255F; - float a = (colour & 0xFF) / 255F; - GlStateManager.color(r, g, b, a); - } - - public static void glColourARGB(int colour) { - float r = ((colour >> 16) & 0xFF) / 255F; - float g = ((colour >> 8) & 0xFF) / 255F; - float b = (colour & 0xFF) / 255F; - float a = ((colour >> 24 & 0xFF)) / 255F; - GlStateManager.color(r, g, b, a); - } - - public boolean equals(Colour colour) { - return colour != null && rgba() == colour.rgba(); - } -} diff --git a/dependencies/main/java/codechicken/lib/colour/ColourARGB.java b/dependencies/main/java/codechicken/lib/colour/ColourARGB.java deleted file mode 100644 index 9d3a9ddbc9..0000000000 --- a/dependencies/main/java/codechicken/lib/colour/ColourARGB.java +++ /dev/null @@ -1,37 +0,0 @@ -package codechicken.lib.colour; - -public class ColourARGB extends Colour { - - public ColourARGB(int colour) { - super((colour >> 16) & 0xFF, (colour >> 8) & 0xFF, colour & 0xFF, (colour >> 24) & 0xFF); - } - - public ColourARGB(int a, int r, int g, int b) { - super(r, g, b, a); - } - - public ColourARGB(ColourARGB colour) { - super(colour); - } - - public ColourARGB copy() { - return new ColourARGB(this); - } - - @Override - public Colour set(int colour) { - return set(new ColourARGB(colour)); - } - - public int pack() { - return pack(this); - } - - public float[] packArray() { - return new float[] { (a & 0xFF) / 255, (r & 0xFF) / 255, (g & 0xFF) / 255, (b & 0xFF) / 255 }; - } - - public static int pack(Colour colour) { - return (colour.a & 0xFF) << 24 | (colour.r & 0xFF) << 16 | (colour.g & 0xFF) << 8 | (colour.b & 0xFF); - } -} diff --git a/dependencies/main/java/codechicken/lib/colour/ColourRGBA.java b/dependencies/main/java/codechicken/lib/colour/ColourRGBA.java deleted file mode 100644 index 328c57cf4a..0000000000 --- a/dependencies/main/java/codechicken/lib/colour/ColourRGBA.java +++ /dev/null @@ -1,67 +0,0 @@ -package codechicken.lib.colour; - -public class ColourRGBA extends Colour { - - public ColourRGBA(int colour) { - super((colour >> 24) & 0xFF, (colour >> 16) & 0xFF, (colour >> 8) & 0xFF, colour & 0xFF); - } - - public ColourRGBA(double r, double g, double b, double a) { - super((int) (255 * r), (int) (255 * g), (int) (255 * b), (int) (255 * a)); - } - - public ColourRGBA(int r, int g, int b, int a) { - super(r, g, b, a); - } - - public ColourRGBA(float[] data) { - this(data[0], data[1], data[2], data[3]); - } - - public ColourRGBA(ColourRGBA colour) { - super(colour); - } - - public int pack() { - return pack(this); - } - - public float[] packArray() { - return new float[] { (r & 0xFF) / 255, (g & 0xFF) / 255, (b & 0xFF) / 255, (a & 0xFF) / 255 }; - } - - @Override - public Colour copy() { - return new ColourRGBA(this); - } - - @Override - public Colour set(int colour) { - return set(new ColourRGBA(colour)); - } - - public static int pack(Colour colour) { - return (colour.r & 0xFF) << 24 | (colour.g & 0xFF) << 16 | (colour.b & 0xFF) << 8 | (colour.a & 0xFF); - } - - public static int multiply(int c1, int c2) { - if (c1 == -1) { - return c2; - } - if (c2 == -1) { - return c1; - } - int r = (((c1 >>> 24) * (c2 >>> 24)) & 0xFF00) << 16; - int g = (((c1 >> 16 & 0xFF) * (c2 >> 16 & 0xFF)) & 0xFF00) << 8; - int b = ((c1 >> 8 & 0xFF) * (c2 >> 8 & 0xFF)) & 0xFF00; - int a = ((c1 & 0xFF) * (c2 & 0xFF)) >> 8; - return r | g | b | a; - } - - public static int multiplyC(int c, float f) { - int r = (int) ((c >>> 24) * f); - int g = (int) ((c >> 16 & 0xFF) * f); - int b = (int) ((c >> 8 & 0xFF) * f); - return r << 24 | g << 16 | b << 8 | c & 0xFF; - } -} diff --git a/dependencies/main/java/codechicken/lib/colour/CustomGradient.java b/dependencies/main/java/codechicken/lib/colour/CustomGradient.java deleted file mode 100644 index 382e8323e4..0000000000 --- a/dependencies/main/java/codechicken/lib/colour/CustomGradient.java +++ /dev/null @@ -1,35 +0,0 @@ -package codechicken.lib.colour; - -import codechicken.lib.math.MathHelper; -import codechicken.lib.texture.TextureUtils; -import net.minecraft.util.ResourceLocation; - -import java.awt.image.BufferedImage; - -public class CustomGradient { - - public int[] gradient; - - public CustomGradient(ResourceLocation textureFile) { - BufferedImage img = TextureUtils.loadBufferedImage(textureFile); - if (img == null) { - throw new RuntimeException("File not found: " + textureFile.toString()); - } - - int[] data = new int[img.getWidth()]; - img.getRGB(0, 0, img.getWidth(), 1, data, 0, img.getWidth()); - gradient = new int[img.getWidth()]; - for (int i = 0; i < data.length; i++) { - gradient[i] = (data[i] << 8) | (((data[i]) >> 24) & 0xFF); - } - } - - public ColourRGBA getColour(double position) { - return new ColourRGBA(getColourI(position)); - } - - public int getColourI(double position) { - int off = (int) MathHelper.clip(gradient.length * position, 0, gradient.length - 1); - return gradient[off]; - } -} diff --git a/dependencies/main/java/codechicken/lib/colour/EnumColour.java b/dependencies/main/java/codechicken/lib/colour/EnumColour.java deleted file mode 100644 index 5bb9923438..0000000000 --- a/dependencies/main/java/codechicken/lib/colour/EnumColour.java +++ /dev/null @@ -1,193 +0,0 @@ -package codechicken.lib.colour; - -import codechicken.lib.util.TripleABC; -import com.google.common.collect.ImmutableList; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IStringSerializable; -import net.minecraftforge.oredict.OreDictionary; - -/** - * Created by covers1624 on 16/09/2016. - */ -public enum EnumColour implements IStringSerializable { - //Formatted like this due to the cancerous nature of the constructors.. - //TODO Should we have our own localizations for this? - //@formatter:off - WHITE ("white", "dyeWhite", "item.fireworksCharge.white", 0xFFFFFF), - ORANGE ("orange", "dyeOrange", "item.fireworksCharge.orange", 0xC06300), - MAGENTA ("magenta", "dyeMagenta", "item.fireworksCharge.magenta", 0xB51AB5), - LIGHT_BLUE("light_blue", "dyeLightBlue", "item.fireworksCharge.lightBlue", 0x6F84F1), - YELLOW ("yellow", "dyeYellow", "item.fireworksCharge.yellow", 0xBFBF00), - LIME ("lime", "dyeLime", "item.fireworksCharge.lime", 0x6BF100), - PINK ("pink", "dyePink", "item.fireworksCharge.pink", 0xF14675), - GRAY ("gray", "dyeGray", "item.fireworksCharge.gray", 0x535353), - LIGHT_GRAY("light_gray", "dyeLightGray", "item.fireworksCharge.silver", 0x939393), - CYAN ("cyan", "dyeCyan", "item.fireworksCharge.cyan", 0x008787), - PURPLE ("purple", "dyePurple", "item.fireworksCharge.purple", 0x5E00C0), - BLUE ("blue", "dyeBlue", "item.fireworksCharge.blue", 0x1313C0), - BROWN ("brown", "dyeBrown", "item.fireworksCharge.brown", 0x4F2700), - GREEN ("green", "dyeGreen", "item.fireworksCharge.green", 0x088700), - RED ("red", "dyeRed", "item.fireworksCharge.red", 0xA20F06), - BLACK ("black", "dyeBlack", "item.fireworksCharge.black", 0x1F1F1F); - //@formatter:on - - private String minecraftName; - private String oreDictionaryName; - private String unlocalizedName; - private int rgb; - - private static final ImmutableList> mixMap; - - EnumColour(String minecraftName, String oreDictionaryName, String unlocalizedName, int rgb) { - this.minecraftName = minecraftName; - this.oreDictionaryName = oreDictionaryName; - this.unlocalizedName = unlocalizedName; - this.rgb = rgb; - } - - @Override - public String getName() { - return minecraftName; - } - - public String getMinecraftName() { - return minecraftName; - } - - public String getOreDictionaryName() { - return oreDictionaryName; - } - - public String getUnlocalizedName() { - return unlocalizedName; - } - - public int getWoolDamage() { - return ordinal(); - } - - public int getDyeDamage() { - return 15 - ordinal(); - } - - public int rgba() { - return rgba(0xFF); - } - - public int rgba(int alpha) { - return rgb << 8 | (alpha & 0xFF); - } - - public int argb() { - return argb(0xFF); - } - - public int argb(int alpha) { - return (alpha & 0xFF) << 24 | rgb; - } - - public int rgb() { - return rgb; - } - - public float rF() { - return (rgb >> 16 & 255) / 255.0f; - } - - public float gF() { - return (rgb >> 8 & 255) / 255.0f; - } - - public float bF() { - return (rgb & 255) / 255.0f; - } - - public ColourRGBA getColour() { - return getColour(0xFF); - } - - public ColourRGBA getColour(int alpha) { - return new ColourRGBA(rgba(alpha)); - } - - public EnumColour mix(EnumColour b) { - return mix(this, b); - } - - public static EnumColour mix(EnumColour a, EnumColour b) { - if (a == b) { - return a; - } - synchronized (mixMap) { - for (TripleABC triple : mixMap) { - if ((triple.getA().equals(a) && triple.getB().equals(b)) || (triple.getA().equals(b) && triple.getB().equals(a))) { - return triple.getC(); - } - } - } - return null; - } - - public static EnumColour fromWoolID(int id) { - return values()[id]; - } - - public static EnumColour fromDyeID(int id) { - return values()[15 - id]; - } - - public static EnumColour fromOreDictID(String id) { - for (EnumColour c : values()) { - if (c.getOreDictionaryName().equals(id)) { - return c; - } - } - return null; - } - - public static EnumColour fromStack(ItemStack stack) { - for (int id : OreDictionary.getOreIDs(stack)) { - EnumColour c = fromOreDictID(OreDictionary.getOreName(id)); - if (c != null) { - return c; - } - } - return null; - } - - public static EnumColour fromName(String name) { - for (EnumColour colour : values()) { - if (colour.getName().equalsIgnoreCase(name)) { - return colour; - } - } - return null; - } - - static { - ImmutableList.Builder> builder = ImmutableList.builder(); - //WHITE - builder.add(getTriple(YELLOW, RED, ORANGE)); - builder.add(getTriple(PINK, PURPLE, MAGENTA)); - builder.add(getTriple(WHITE, BLUE, LIGHT_BLUE)); - //YELLOW - builder.add(getTriple(WHITE, GREEN, LIME)); - builder.add(getTriple(WHITE, RED, PINK)); - builder.add(getTriple(WHITE, BLACK, GRAY)); - builder.add(getTriple(WHITE, GRAY, LIGHT_GRAY)); - builder.add(getTriple(BLUE, GREEN, CYAN)); - builder.add(getTriple(BLUE, RED, PURPLE)); - //Blue - builder.add(getTriple(ORANGE, RED, BROWN)); - builder.add(getTriple(YELLOW, BLUE, GREEN)); - //RED - //BLACK - - mixMap = builder.build(); - } - - private static TripleABC getTriple(EnumColour a, EnumColour b, EnumColour result) { - return new TripleABC(a, b, result); - } - -} diff --git a/dependencies/main/java/codechicken/lib/config/ConfigFile.java b/dependencies/main/java/codechicken/lib/config/ConfigFile.java deleted file mode 100644 index 4e01079084..0000000000 --- a/dependencies/main/java/codechicken/lib/config/ConfigFile.java +++ /dev/null @@ -1,117 +0,0 @@ -package codechicken.lib.config; - -import java.io.*; - -public class ConfigFile extends ConfigTagParent { - - public static final byte[] crlf = new byte[] { 0xD, 0xA }; - - public File file; - private boolean loading; - - public ConfigFile(File file) { - newlinemode = 2; - load(file); - } - - protected ConfigFile() { - } - - protected void load(File file) { - try { - if (!file.getParentFile().exists()) { - file.getParentFile().mkdirs(); - } - if (!file.exists()) { - file.createNewFile(); - } - } catch (IOException e) { - throw new RuntimeException(e); - } - this.file = file; - loadConfig(); - } - - protected void loadConfig() { - loading = true; - BufferedReader reader; - try { - reader = new BufferedReader(new FileReader(file)); - - while (true) { - reader.mark(2000); - String line = reader.readLine(); - if (line != null && line.startsWith("#")) { - if (comment == null || comment.equals("")) { - comment = line.substring(1); - } else { - comment = comment + "\n" + line.substring(1); - } - } else { - reader.reset(); - break; - } - } - loadChildren(reader); - reader.close(); - - } catch (IOException e) { - throw new RuntimeException(e); - } - - loading = false; - } - - @Override - public ConfigFile setComment(String header) { - super.setComment(header); - return this; - } - - @Override - public ConfigFile setSortMode(int mode) { - super.setSortMode(mode); - return this; - } - - @Override - public String getNameQualifier() { - return ""; - } - - public static String readLine(BufferedReader reader) throws IOException { - String line = reader.readLine(); - return line == null ? null : line.replace("\t", ""); - } - - public static void writeLine(PrintWriter writer, String line, int tabs) { - for (int i = 0; i < tabs; i++) { - writer.print('\t'); - } - - writer.println(line); - } - - public void saveConfig() { - if (loading) { - return; - } - - PrintWriter writer; - try { - writer = new PrintWriter(file); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } - - writeComment(writer, 0); - ConfigFile.writeLine(writer, "", 0); - saveTagTree(writer, 0, ""); - writer.flush(); - writer.close(); - } - - public boolean isLoading() { - return loading; - } -} diff --git a/dependencies/main/java/codechicken/lib/config/ConfigTag.java b/dependencies/main/java/codechicken/lib/config/ConfigTag.java deleted file mode 100644 index 1dd11d13bd..0000000000 --- a/dependencies/main/java/codechicken/lib/config/ConfigTag.java +++ /dev/null @@ -1,252 +0,0 @@ -package codechicken.lib.config; - -import java.io.PrintWriter; - -public class ConfigTag extends ConfigTagParent { - - public ConfigTagParent parent; - public String name; - public String qualifiedname; - public String value; - public boolean brace; - public boolean newline; - public int position = Integer.MAX_VALUE; - - private int IDBase; - - public interface IConfigType { - - String configValue(T entry); - - T valueOf(String text) throws Exception; - } - - public ConfigTag(ConfigTagParent parent, String name) { - this.parent = parent; - this.name = name; - qualifiedname = parent.getNameQualifier() + name; - newline = parent.newlinemode == 2; - parent.addChild(this); - } - - @Override - public String getNameQualifier() { - return qualifiedname + "."; - } - - @Override - public void saveConfig() { - parent.saveConfig(); - } - - /** - * Called when the tag is loaded from a config file as opposed to constructed by a mod - * - * @return this - */ - public ConfigTag onLoaded() { - return this; - } - - public void setValue(String value) { - this.value = value; - saveConfig(); - } - - public void setDefaultValue(String defaultValue) { - if (value == null) { - value = defaultValue; - saveConfig(); - } - } - - public void setIntValue(int i) { - setValue(Integer.toString(i)); - } - - public void setBooleanValue(boolean b) { - setValue(Boolean.toString(b)); - } - - public void setHexValue(int i) { - setValue("0x" + Long.toString(((long) i) << 32 >>> 32, 16)); - } - - public void set(IConfigType type, T entry) { - setValue(type.configValue(entry)); - } - - public String getValue() { - return value; - } - - public String getValue(String defaultValue) { - setDefaultValue(defaultValue); - return value; - } - - public int getIntValue() { - return Integer.parseInt(getValue()); - } - - public int getIntValue(int defaultValue) { - try { - if (value != null) { - return getIntValue(); - } - } catch (NumberFormatException ignored) { - } - - setIntValue(defaultValue); - return defaultValue; - } - - public boolean getBooleanValue() { - String value = getValue(); - if (value != null && (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("yes"))) { - return true; - } else if (value != null && (value.equalsIgnoreCase("false") || value.equalsIgnoreCase("no"))) { - return false; - } - - throw new NumberFormatException(qualifiedname + ".value=" + value); - } - - public boolean getBooleanValue(boolean defaultValue) { - try { - if (value != null) { - return getBooleanValue(); - } - } catch (NumberFormatException ignored) { - } - - setBooleanValue(defaultValue); - return defaultValue; - } - - public int getHexValue() { - return (int) Long.parseLong(getValue().replace("0x", ""), 16); - } - - public int getHexValue(int defaultValue) { - try { - if (value != null) { - return getHexValue(); - } - } catch (NumberFormatException ignored) { - } - - setHexValue(defaultValue); - return defaultValue; - } - - public T get(IConfigType type) { - try { - return type.valueOf(getValue()); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public T get(IConfigType type, T defaultValue) { - try { - if (value != null) { - return get(type); - } - } catch (Exception ignored) { - } - - set(type, defaultValue); - return defaultValue; - } - - public void save(PrintWriter writer, int tabs, String bracequalifier, boolean first) { - String vname; - if (qualifiedname.contains(".") && bracequalifier.length() > 0) { - vname = qualifiedname.substring(bracequalifier.length() + 1); - } else { - vname = qualifiedname; - } - - if (newline && !first) { - ConfigFile.writeLine(writer, "", tabs); - } - - writeComment(writer, tabs); - if (value != null) { - ConfigFile.writeLine(writer, vname + "=" + value, tabs); - } - - if (!hasChildTags()) { - return; - } - - if (brace) { - if (value == null) { - ConfigFile.writeLine(writer, vname, tabs); - } - ConfigFile.writeLine(writer, "{", tabs); - saveTagTree(writer, tabs + 1, qualifiedname); - ConfigFile.writeLine(writer, "}", tabs); - } else { - saveTagTree(writer, tabs, bracequalifier); - } - } - - @Override - public ConfigTag setComment(String comment) { - super.setComment(comment); - return this; - } - - @Override - public ConfigTag setSortMode(int mode) { - super.setSortMode(mode); - return this; - } - - public ConfigTag setNewLine(boolean b) { - newline = b; - saveConfig(); - return this; - } - - public ConfigTag useBraces() { - brace = true; - if (parent.newlinemode == 1) { - newline = true; - } - - saveConfig(); - return this; - } - - public ConfigTag setPosition(int pos) { - position = pos; - saveConfig(); - return this; - } - - public boolean containsTag(String tagname) { - return getTag(tagname, false) != null; - } - - public int getId(String name, int defaultValue) { - return getTag(name).getIntValue(defaultValue); - } - - public int getId(String name) { - int ret = getId(name, IDBase); - IDBase = ret + 1; - return ret; - } - - public int getAcheivementId(String name, int defaultValue) { - return getTag(name).getIntValue(defaultValue); - } - - public ConfigTag setBaseID(int i) { - IDBase = i; - return this; - } -} diff --git a/dependencies/main/java/codechicken/lib/config/ConfigTagParent.java b/dependencies/main/java/codechicken/lib/config/ConfigTagParent.java deleted file mode 100644 index be5d683f7d..0000000000 --- a/dependencies/main/java/codechicken/lib/config/ConfigTagParent.java +++ /dev/null @@ -1,215 +0,0 @@ -package codechicken.lib.config; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.*; -import java.util.Map.Entry; - -public abstract class ConfigTagParent { - - public static class TagOrderComparator implements Comparator { - - int sortMode; - - public TagOrderComparator(int sortMode) { - this.sortMode = sortMode; - } - - public int compare(ConfigTag o1, ConfigTag o2) { - if (o1.position != o2.position) { - return compareInt(o1.position, o2.position); - } - if (o1.brace != o2.brace) { - return o1.brace ? 1 : -1;//braced one goes after - } - switch (sortMode) { - case 1: - if (o1.value.equals(o2.value)) { - return 0; - } - if (o1.value == null) { - return 1; - } - if (o2.value == null) { - return -1; - } - return o1.value.compareTo(o2.value); - default: - return o1.name.compareTo(o2.name); - } - } - - private int compareInt(int a, int b) { - return a == b ? 0 : a < b ? -1 : 1; - } - } - - private TreeMap childtags = new TreeMap(); - public String comment; - /** - * 0 = name, 1 = value - */ - public int sortMode = 0; - /** - * The mode for determining when child tags should leave a blank line between them and the one above - * 0 = never, 1 = when braced, 2 = always - */ - public int newlinemode = 1; - - public abstract void saveConfig(); - - public abstract String getNameQualifier(); - - public ConfigTagParent setComment(String comment) { - this.comment = comment; - saveConfig(); - return this; - } - - public ConfigTagParent setSortMode(int mode) { - sortMode = mode; - saveConfig(); - return this; - } - - public ConfigTagParent setNewLineMode(int mode) { - newlinemode = mode; - for (Entry entry : childtags.entrySet()) { - ConfigTag tag = entry.getValue(); - if (newlinemode == 0) { - tag.newline = false; - } else if (newlinemode == 1) { - tag.newline = tag.brace; - } else if (newlinemode == 2) { - tag.newline = true; - } - } - saveConfig(); - return this; - } - - public Map childTagMap() { - return childtags; - } - - public boolean hasChildTags() { - return !childtags.isEmpty(); - } - - public boolean containsTag(String tagname) { - return getTag(tagname, false) != null; - } - - public ConfigTag getNewTag(String tagname) { - return new ConfigTag(this, tagname); - } - - public ConfigTag getTag(String tagname, boolean create) { - int dotpos = tagname.indexOf("."); - String basetagname = dotpos == -1 ? tagname : tagname.substring(0, dotpos); - ConfigTag basetag = childtags.get(basetagname); - if (basetag == null) { - if (!create) { - return null; - } - - basetag = getNewTag(basetagname); - saveConfig(); - } - if (dotpos == -1) { - return basetag; - } - - return basetag.getTag(tagname.substring(dotpos + 1), create); - } - - public ConfigTag getTag(String tagname) { - return getTag(tagname, true); - } - - public boolean removeTag(String tagname) { - ConfigTag tag = getTag(tagname, false); - if (tag == null) { - return false; - } - - int dotpos = tagname.lastIndexOf("."); - String lastpart = dotpos == -1 ? tagname : tagname.substring(dotpos + 1, tagname.length()); - if (tag.parent != null) { - boolean ret = tag.parent.childtags.remove(lastpart) != null; - if (ret) { - saveConfig(); - } - return ret; - } - - return false; - } - - public void addChild(ConfigTag tag) { - childtags.put(tag.name, tag); - } - - public ArrayList getSortedTagList() { - ArrayList taglist = new ArrayList(childtags.size()); - for (Entry tag : childtags.entrySet()) { - taglist.add((T) tag.getValue()); - } - - Collections.sort(taglist, new TagOrderComparator(sortMode)); - return taglist; - } - - public void loadChildren(BufferedReader reader) { - String comment = ""; - String bracequalifier = ""; - try { - while (true) { - String line = ConfigFile.readLine(reader); - if (line == null) { - break; - } - if (line.startsWith("#")) { - if (comment.equals("")) { - comment = line.substring(1); - } else { - comment = comment + "\n" + line.substring(1); - } - } else if (line.contains("=")) { - String qualifiedname = line.substring(0, line.indexOf("=")); - getTag(qualifiedname).onLoaded().setComment(comment).setValue(line.substring(line.indexOf("=") + 1)); - comment = ""; - bracequalifier = qualifiedname; - } else if (line.equals("{")) { - getTag(bracequalifier).setComment(comment).useBraces().loadChildren(reader); - comment = ""; - bracequalifier = ""; - } else if (line.equals("}")) { - break; - } else { - bracequalifier = line; - } - } - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public void saveTagTree(PrintWriter writer, int tabs, String bracequalifier) { - boolean first = true; - for (ConfigTag tag : getSortedTagList()) { - tag.save(writer, tabs, bracequalifier, first); - first = false; - } - } - - public void writeComment(PrintWriter writer, int tabs) { - if (comment != null && !comment.equals("")) { - String[] comments = comment.split("\n"); - for (int i = 0; i < comments.length; i++) { - ConfigFile.writeLine(writer, "#" + comments[i], tabs); - } - } - } -} diff --git a/dependencies/main/java/codechicken/lib/config/DefaultingConfigFile.java b/dependencies/main/java/codechicken/lib/config/DefaultingConfigFile.java deleted file mode 100644 index 829aa40eee..0000000000 --- a/dependencies/main/java/codechicken/lib/config/DefaultingConfigFile.java +++ /dev/null @@ -1,20 +0,0 @@ -package codechicken.lib.config; - -import java.io.File; - -public class DefaultingConfigFile extends ConfigFile { - - public DefaultingConfigFile(File file) { - super(); - if (file.exists()) { - load(file); - } - } - - @Override - public void saveConfig() { - if (file != null) { - super.saveConfig(); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/config/SimpleProperties.java b/dependencies/main/java/codechicken/lib/config/SimpleProperties.java deleted file mode 100644 index 652d088eeb..0000000000 --- a/dependencies/main/java/codechicken/lib/config/SimpleProperties.java +++ /dev/null @@ -1,128 +0,0 @@ -package codechicken.lib.config; - -import java.io.*; -import java.nio.charset.Charset; -import java.util.HashMap; -import java.util.Map.Entry; - -public class SimpleProperties { - - public HashMap propertyMap = new HashMap(); - public File propertyFile; - public boolean saveOnChange = false; - public String encoding; - - private boolean loading = false; - - public SimpleProperties(File file, boolean saveOnChange, String encoding) { - propertyFile = file; - this.saveOnChange = saveOnChange; - this.encoding = encoding; - } - - public SimpleProperties(File file, boolean saveOnChange) { - this(file, saveOnChange, Charset.defaultCharset().name()); - } - - public SimpleProperties(File file) { - this(file, true); - } - - public void load() { - clear(); - loading = true; - - try { - BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(propertyFile), encoding)); - while (true) { - String read = reader.readLine(); - if (read == null) { - break; - } - - int equalIndex = read.indexOf('='); - if (equalIndex == -1) { - continue; - } - - setProperty(read.substring(0, equalIndex), read.substring(equalIndex + 1)); - } - reader.close(); - } catch (Exception e) { - throw new RuntimeException(e); - } - loading = false; - } - - public void save() { - try { - PrintStream writer = new PrintStream(propertyFile); - - for (Entry entry : propertyMap.entrySet()) { - writer.println(entry.getKey() + "=" + entry.getValue()); - } - - writer.close(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public void clear() { - propertyMap.clear(); - } - - public boolean hasProperty(String key) { - return propertyMap.containsKey(key); - } - - public void removeProperty(String key) { - if (propertyMap.remove(key) != null && saveOnChange && !loading) { - save(); - } - } - - public void setProperty(String key, int value) { - setProperty(key, Integer.toString(value)); - } - - public void setProperty(String key, boolean value) { - setProperty(key, Boolean.toString(value)); - } - - public void setProperty(String key, String value) { - propertyMap.put(key, value); - if (saveOnChange && !loading) { - save(); - } - } - - public int getProperty(String property, int defaultvalue) { - try { - return Integer.parseInt(getProperty(property, Integer.toString(defaultvalue))); - } catch (NumberFormatException nfe) { - return defaultvalue; - } - } - - public boolean getProperty(String property, boolean defaultvalue) { - try { - return Boolean.parseBoolean(getProperty(property, Boolean.toString(defaultvalue))); - } catch (NumberFormatException nfe) { - return defaultvalue; - } - } - - public String getProperty(String property, String defaultvalue) { - String value = propertyMap.get(property); - if (value == null) { - setProperty(property, defaultvalue); - return defaultvalue; - } - return value; - } - - public String getProperty(String property) { - return propertyMap.get(property); - } -} diff --git a/dependencies/main/java/codechicken/lib/data/MCDataHandler.java b/dependencies/main/java/codechicken/lib/data/MCDataHandler.java deleted file mode 100644 index 30e2d984fc..0000000000 --- a/dependencies/main/java/codechicken/lib/data/MCDataHandler.java +++ /dev/null @@ -1,8 +0,0 @@ -package codechicken.lib.data; - -/** - * Created by covers1624 on 5/28/2016. - */ -public interface MCDataHandler extends MCDataInput, MCDataOutput { - -} diff --git a/dependencies/main/java/codechicken/lib/data/MCDataIO.java b/dependencies/main/java/codechicken/lib/data/MCDataIO.java deleted file mode 100644 index a5d3de4329..0000000000 --- a/dependencies/main/java/codechicken/lib/data/MCDataIO.java +++ /dev/null @@ -1,134 +0,0 @@ -package codechicken.lib.data; - -import com.google.common.base.Charsets; -import io.netty.handler.codec.EncoderException; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class MCDataIO { - - /** - * PacketBuffer.readVarIntFromBuffer - */ - public static int readVarInt(MCDataInput in) { - int i = 0; - int j = 0; - byte b0; - - do { - b0 = in.readByte(); - i |= (b0 & 127) << j++ * 7; - - if (j > 5) { - throw new RuntimeException("VarInt too big"); - } - } while ((b0 & 128) == 128); - - return i; - } - - public static int readVarShort(MCDataInput in) { - int low = in.readUShort(); - int high = 0; - if ((low & 0x8000) != 0) { - low = low & 0x7FFF; - high = in.readUByte(); - } - return ((high & 0xFF) << 15) | low; - } - - public static String readString(MCDataInput in) { - return new String(in.readArray(in.readVarInt()), Charsets.UTF_8); - } - - public static ItemStack readItemStack(MCDataInput in) { - ItemStack item = null; - short itemID = in.readShort(); - - if (itemID >= 0) { - int stackSize = in.readVarInt(); - short damage = in.readShort(); - item = new ItemStack(Item.getItemById(itemID), stackSize, damage); - item.setTagCompound(in.readNBTTagCompound()); - } - - return item; - } - - public static FluidStack readFluidStack(MCDataInput in) { - FluidStack fluid = null; - String fluidName = in.readString(); - - if (fluidName.length() > 0) { - fluid = new FluidStack(FluidRegistry.getFluid(fluidName), in.readVarInt(), in.readNBTTagCompound()); - } - - return fluid; - } - - /** - * PacketBuffer.writeVarIntToBuffer - */ - public static void writeVarInt(MCDataOutput out, int i) { - while ((i & 0x80) != 0) { - out.writeByte(i & 0x7F | 0x80); - i >>>= 7; - } - - out.writeByte(i); - } - - /** - * ByteBufUtils.readVarShort - */ - public static void writeVarShort(MCDataOutput out, int s) { - int low = s & 0x7FFF; - int high = (s & 0x7F8000) >> 15; - if (high != 0) { - low |= 0x8000; - } - out.writeShort(low); - if (high != 0) { - out.writeByte(high); - } - } - - /** - * PacketBuffer.writeString - */ - public static void writeString(MCDataOutput out, String string) { - byte[] abyte = string.getBytes(Charsets.UTF_8); - if (abyte.length > 32767) { - throw new EncoderException("String too big (was " + string.length() + " bytes encoded, max " + 32767 + ")"); - } - - out.writeVarInt(abyte.length); - out.writeArray(abyte); - } - - /** - * Supports large stacks by writing stackSize as a varInt - */ - public static void writeItemStack(MCDataOutput out, ItemStack stack) { - if (stack == null) { - out.writeShort(-1); - } else { - out.writeShort(Item.getIdFromItem(stack.getItem())); - out.writeVarInt(stack.stackSize); - out.writeShort(stack.getItemDamage()); - out.writeNBTTagCompound(stack.getItem().getShareTag() ? stack.getTagCompound() : null); - } - } - - public static void writeFluidStack(MCDataOutput out, FluidStack fluid) { - if (fluid == null || FluidRegistry.getFluidName(fluid) == null) { - out.writeString(""); - } else { - out.writeString(FluidRegistry.getFluidName(fluid)); - out.writeVarInt(fluid.amount); - out.writeNBTTagCompound(fluid.tag); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/data/MCDataInput.java b/dependencies/main/java/codechicken/lib/data/MCDataInput.java deleted file mode 100644 index aea7147c9c..0000000000 --- a/dependencies/main/java/codechicken/lib/data/MCDataInput.java +++ /dev/null @@ -1,47 +0,0 @@ -package codechicken.lib.data; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.math.BlockPos; -import net.minecraftforge.fluids.FluidStack; - -public interface MCDataInput { - - long readLong(); - - int readInt(); - - short readShort(); - - int readUShort(); - - byte readByte(); - - short readUByte(); - - double readDouble(); - - float readFloat(); - - boolean readBoolean(); - - char readChar(); - - int readVarShort(); - - int readVarInt(); - - long readVarLong(); - - byte[] readArray(int length); - - String readString(); - - BlockPos readPos(); - - NBTTagCompound readNBTTagCompound(); - - ItemStack readItemStack(); - - FluidStack readFluidStack(); -} diff --git a/dependencies/main/java/codechicken/lib/data/MCDataInputStream.java b/dependencies/main/java/codechicken/lib/data/MCDataInputStream.java deleted file mode 100644 index 210a36c895..0000000000 --- a/dependencies/main/java/codechicken/lib/data/MCDataInputStream.java +++ /dev/null @@ -1,17 +0,0 @@ -package codechicken.lib.data; - -import java.io.InputStream; - -public class MCDataInputStream extends InputStream { - - private MCDataInput in; - - public MCDataInputStream(MCDataInput in) { - this.in = in; - } - - @Override - public int read() { - return in.readByte() & 0xFF; - } -} diff --git a/dependencies/main/java/codechicken/lib/data/MCDataOutput.java b/dependencies/main/java/codechicken/lib/data/MCDataOutput.java deleted file mode 100644 index 3f178e617d..0000000000 --- a/dependencies/main/java/codechicken/lib/data/MCDataOutput.java +++ /dev/null @@ -1,44 +0,0 @@ -package codechicken.lib.data; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.math.BlockPos; -import net.minecraftforge.fluids.FluidStack; - -public interface MCDataOutput { - - MCDataOutput writeLong(long l); - - MCDataOutput writeInt(int i); - - MCDataOutput writeShort(int s); - - MCDataOutput writeByte(int b); - - MCDataOutput writeDouble(double d); - - MCDataOutput writeFloat(float f); - - MCDataOutput writeBoolean(boolean b); - - MCDataOutput writeChar(char c); - - MCDataOutput writeVarInt(int i); - - MCDataOutput writeVarShort(int s); - - MCDataOutput writeArray(byte[] array); - - MCDataOutput writeString(String s); - - MCDataOutput writePos(BlockPos pos); - - MCDataOutput writeNBTTagCompound(NBTTagCompound tag); - - /** - * Supports large stacks by writing stackSize as a varInt - */ - MCDataOutput writeItemStack(ItemStack stack); - - MCDataOutput writeFluidStack(FluidStack liquid); -} diff --git a/dependencies/main/java/codechicken/lib/data/MCDataOutputStream.java b/dependencies/main/java/codechicken/lib/data/MCDataOutputStream.java deleted file mode 100644 index ec9cfd86b4..0000000000 --- a/dependencies/main/java/codechicken/lib/data/MCDataOutputStream.java +++ /dev/null @@ -1,17 +0,0 @@ -package codechicken.lib.data; - -import java.io.OutputStream; - -public class MCDataOutputStream extends OutputStream { - - private MCDataOutput out; - - public MCDataOutputStream(MCDataOutput out) { - this.out = out; - } - - @Override - public void write(int b) { - out.writeByte(b); - } -} diff --git a/dependencies/main/java/codechicken/lib/data/MCDataOutputWrapper.java b/dependencies/main/java/codechicken/lib/data/MCDataOutputWrapper.java deleted file mode 100644 index a48e1366b8..0000000000 --- a/dependencies/main/java/codechicken/lib/data/MCDataOutputWrapper.java +++ /dev/null @@ -1,150 +0,0 @@ -package codechicken.lib.data; - -import io.netty.handler.codec.EncoderException; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.math.BlockPos; -import net.minecraftforge.fluids.FluidStack; - -import java.io.DataOutput; -import java.io.IOException; - -public class MCDataOutputWrapper implements MCDataOutput { - - public DataOutput dataout; - - public MCDataOutputWrapper(DataOutput out) { - dataout = out; - } - - public MCDataOutputWrapper writeBoolean(boolean b) { - try { - dataout.writeBoolean(b); - } catch (IOException e) { - throw new EncoderException(e); - } - return this; - } - - public MCDataOutputWrapper writeByte(int b) { - try { - dataout.writeByte(b); - } catch (IOException e) { - throw new EncoderException(e); - } - return this; - } - - public MCDataOutputWrapper writeShort(int s) { - try { - dataout.writeShort(s); - } catch (IOException e) { - throw new EncoderException(e); - } - return this; - } - - public MCDataOutputWrapper writeInt(int i) { - try { - dataout.writeInt(i); - } catch (IOException e) { - throw new EncoderException(e); - } - return this; - } - - public MCDataOutputWrapper writeFloat(float f) { - try { - dataout.writeFloat(f); - } catch (IOException e) { - throw new EncoderException(e); - } - return this; - } - - public MCDataOutputWrapper writeDouble(double d) { - try { - dataout.writeDouble(d); - } catch (IOException e) { - throw new EncoderException(e); - } - return this; - } - - public MCDataOutputWrapper writeLong(long l) { - try { - dataout.writeLong(l); - } catch (IOException e) { - throw new EncoderException(e); - } - return this; - } - - @Override - public MCDataOutputWrapper writeChar(char c) { - try { - dataout.writeChar(c); - } catch (IOException e) { - throw new EncoderException(e); - } - return this; - } - - @Override - public MCDataOutput writeVarInt(int i) { - MCDataIO.writeVarInt(this, i); - return this; - } - - @Override - public MCDataOutput writeVarShort(int s) { - MCDataIO.writeVarShort(this, s); - return this; - } - - public MCDataOutputWrapper writeArray(byte[] barray) { - try { - dataout.write(barray); - } catch (IOException e) { - throw new EncoderException(e); - } - return this; - } - - @Override - public MCDataOutputWrapper writePos(BlockPos pos) { - writeInt(pos.getX()); - writeInt(pos.getY()); - writeInt(pos.getZ()); - return this; - } - - public MCDataOutputWrapper writeString(String s) { - MCDataIO.writeString(this, s); - return this; - } - - public MCDataOutputWrapper writeItemStack(ItemStack stack) { - MCDataIO.writeItemStack(this, stack); - return this; - } - - public MCDataOutputWrapper writeNBTTagCompound(NBTTagCompound nbt) { - if (nbt == null) { - this.writeByte(0); - } else { - try { - CompressedStreamTools.write(nbt, dataout); - } catch (IOException ioexception) { - throw new EncoderException(ioexception); - } - } - return this; - } - - public MCDataOutputWrapper writeFluidStack(FluidStack fluid) { - MCDataIO.writeFluidStack(this, fluid); - return this; - } -} diff --git a/dependencies/main/java/codechicken/lib/data/NBTHelper.java b/dependencies/main/java/codechicken/lib/data/NBTHelper.java deleted file mode 100644 index 0e3d633743..0000000000 --- a/dependencies/main/java/codechicken/lib/data/NBTHelper.java +++ /dev/null @@ -1,33 +0,0 @@ -package codechicken.lib.data; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -/** - * Created by covers1624 on 6/3/2016. - */ -public class NBTHelper { - - public static void writeFluidStack(NBTTagCompound tag, FluidStack fluid) { - if (fluid == null || FluidRegistry.getFluidName(fluid) == null) { - tag.setString("id", ""); - } else { - tag.setString("id", FluidRegistry.getFluidName(fluid)); - tag.setInteger("amount", fluid.amount); - tag.setTag("tag", fluid.tag); - } - } - - public static FluidStack readFluidStack(NBTTagCompound tag) { - FluidStack fluid = null; - String fluidName = tag.getString("id"); - - if (fluidName.length() > 0) { - fluid = new FluidStack(FluidRegistry.getFluid(fluidName), tag.getInteger("amount"), tag.getCompoundTag("tag")); - } - - return fluid; - } - -} diff --git a/dependencies/main/java/codechicken/lib/fingerprint/FingerprintChecker.java b/dependencies/main/java/codechicken/lib/fingerprint/FingerprintChecker.java deleted file mode 100644 index 4517df72e4..0000000000 --- a/dependencies/main/java/codechicken/lib/fingerprint/FingerprintChecker.java +++ /dev/null @@ -1,85 +0,0 @@ -package codechicken.lib.fingerprint; - -import com.google.common.collect.ImmutableList; -import net.minecraftforge.fml.common.*; -import org.apache.logging.log4j.Level; - -import java.security.cert.Certificate; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -/** - * Created by covers1624 on 13/12/2016. - * To be packaged in each mod runtime, used to cross verify jar fingerprints. - * Idea behind this: - * A malicious user would have to override the fingerprint data in all mod jars this is packaged with in order to avoid detection. - * This is not to be used as DRM. It is used simply to provide cross verification of jars. - */ -public class FingerprintChecker { - - private static final Map modCertMap = new HashMap(); - private static final List invalidMods = new ArrayList(); - - static { - //@formatter:off - modCertMap.put("CodeChickenLib" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("CodeChickenCore" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("ChickenChunks" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("EnderStorage" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("Translocator" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("NotEnoughItems" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("forgemultipartcbe" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - //@formatter:on - } - - public static void runFingerprintChecks() { - try { - ModContainer activeContainer = Loader.instance().activeModContainer(); - for (Entry modEntry : Loader.instance().getIndexedModList().entrySet()) { - for (Entry certEntry : modCertMap.entrySet()) { - if (modEntry.getKey().equals(certEntry.getKey())) { - Object modInstance = modEntry.getValue().getMod(); - if (modInstance == null) { - FMLLog.log(activeContainer.getModId() + " Fingerprint Verification", Level.FATAL, "Unable to do Fingerprint Verification for mod %s! ModContainer returned a null mod instance!", modEntry.getKey()); - break; - } - if (modInstance.getClass().getName().contains("net.minecraftforge.")) { - FMLLog.log(activeContainer.getModId() + " Fingerprint Verification", Level.FATAL, "Unable to do Fingerprint Verification for mod %s! ModContainer returned is a suspected FML class! [%s]", modEntry.getKey(), modInstance.getClass().getName()); - } - - Certificate[] certificates = modInstance.getClass().getProtectionDomain().getCodeSource().getCertificates(); - ImmutableList.Builder certBuilder = ImmutableList.builder(); - if (certificates != null) { - for (Certificate cert : certificates) { - certBuilder.add(CertificateHelper.getFingerprint(cert)); - } - } - - ImmutableList certList = certBuilder.build(); - - String expectedFingerprint = certEntry.getValue(); - - if (expectedFingerprint != null && !expectedFingerprint.isEmpty()) { - if (!certList.contains(expectedFingerprint)) { - FMLLog.log(activeContainer.getModId() + " Fingerprint Verification", Level.FATAL, "The fingerprint for mod %s is invalid! Expected: %s", modEntry.getKey(), expectedFingerprint); - invalidMods.add(modEntry.getKey()); - break; - } else { - FMLLog.log(activeContainer.getModId() + " Fingerprint Verification", Level.DEBUG, "Valid fingerprint found for mod %s.", modEntry.getKey()); - } - } - - break; - } - } - } - FMLCommonHandler.instance().registerCrashCallable(new FingerprintViolatedCrashCallable(activeContainer.getModId(), invalidMods)); - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/dependencies/main/java/codechicken/lib/fingerprint/FingerprintViolatedCrashCallable.java b/dependencies/main/java/codechicken/lib/fingerprint/FingerprintViolatedCrashCallable.java deleted file mode 100644 index b0e4653e46..0000000000 --- a/dependencies/main/java/codechicken/lib/fingerprint/FingerprintViolatedCrashCallable.java +++ /dev/null @@ -1,37 +0,0 @@ -package codechicken.lib.fingerprint; - -import com.google.common.collect.ImmutableList; -import net.minecraftforge.fml.common.ICrashCallable; - -import java.util.List; - -/** - * Created by covers1624 on 12/12/2016. - * TODO, report all good when no invalid mods are found. - */ -public class FingerprintViolatedCrashCallable implements ICrashCallable { - - private final String mod; - private final ImmutableList invalidMods; - - public FingerprintViolatedCrashCallable(String mod, List invalidMods) { - this.mod = mod; - this.invalidMods = ImmutableList.copyOf(invalidMods); - } - - @Override - public String getLabel() { - return mod + " Invalid Fingerprint Reports"; - } - - @Override - public String call() throws Exception { - StringBuilder builder = new StringBuilder(); - for (String invalidMod : invalidMods) { - builder.append("\n\t\t"); - builder.append(invalidMod); - builder.append(" has an invalid fingerprint."); - } - return builder.toString(); - } -} diff --git a/dependencies/main/java/codechicken/lib/gui/GuiDraw.java b/dependencies/main/java/codechicken/lib/gui/GuiDraw.java deleted file mode 100644 index 1606a47873..0000000000 --- a/dependencies/main/java/codechicken/lib/gui/GuiDraw.java +++ /dev/null @@ -1,406 +0,0 @@ -package codechicken.lib.gui; - -import codechicken.lib.colour.Colour; -import codechicken.lib.math.MathHelper; -import codechicken.lib.texture.TextureUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.VertexBuffer; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.TextFormatting; -import net.minecraftforge.client.event.RenderTooltipEvent; -import net.minecraftforge.common.MinecraftForge; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; - -import javax.annotation.Nullable; -import java.awt.*; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class GuiDraw { - - public static class GuiHook extends Gui { - - public void setZLevel(float f) { - zLevel = f; - } - - public float getZLevel() { - return zLevel; - } - - public void incZLevel(float f) { - zLevel += f; - } - - @Override - public void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6) { - super.drawGradientRect(par1, par2, par3, par4, par5, par6); - } - } - - public static final GuiHook gui = new GuiHook(); - public static FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; - public static TextureManager renderEngine = Minecraft.getMinecraft().renderEngine; - - public static void drawRect(int x, int y, int w, int h, int colour) { - drawGradientRect(x, y, w, h, colour, colour); - } - - public static void drawGradientRectDirect(int left, int top, int right, int bottom, int colour1, int colour2) { - gui.drawGradientRect(left, top, right, bottom, colour1, colour2); - } - - public static void drawGradientRect(int x, int y, int w, int h, int colour1, int colour2) { - gui.drawGradientRect(x, y, x + w, y + h, colour1, colour2); - } - - public static void drawTexturedModalRect(int x, int y, int tx, int ty, int w, int h) { - gui.drawTexturedModalRect(x, y, tx, ty, w, h); - } - - public static void drawLine(int x1, int y1, int x2, int y2, float thickness, int colour) { - GlStateManager.glLineWidth(thickness); - GlStateManager.disableTexture2D(); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - Colour.glColourRGBA(colour); - - VertexBuffer vb = Tessellator.getInstance().getBuffer(); - vb.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); - vb.pos(x1, y1, gui.getZLevel()).endVertex(); - vb.pos(x2, y2, gui.getZLevel()).endVertex(); - vb.finishDrawing(); - - GlStateManager.resetColor(); - GlStateManager.disableBlend(); - GlStateManager.enableTexture2D(); - } - - public static void drawString(String text, int x, int y, int colour, boolean shadow) { - if (shadow) { - fontRenderer.drawStringWithShadow(text, x, y, colour); - } else { - fontRenderer.drawString(text, x, y, colour); - } - } - - public static void drawString(String text, int x, int y, int colour) { - drawString(text, x, y, colour, true); - } - - public static void drawStringC(String text, int x, int y, int w, int h, int colour, boolean shadow) { - drawString(text, x + (w - getStringWidth(text)) / 2, y + (h - 8) / 2, colour, shadow); - } - - public static void drawStringC(String text, int x, int y, int w, int h, int colour) { - drawStringC(text, x, y, w, h, colour, true); - } - - public static void drawStringC(String text, int x, int y, int colour, boolean shadow) { - drawString(text, x - getStringWidth(text) / 2, y, colour, shadow); - } - - public static void drawStringC(String text, int x, int y, int colour) { - drawStringC(text, x, y, colour, true); - } - - public static void drawStringR(String text, int x, int y, int colour, boolean shadow) { - drawString(text, x - getStringWidth(text), y, colour, shadow); - } - - public static void drawStringR(String text, int x, int y, int colour) { - drawStringR(text, x, y, colour, true); - } - - public static int getStringWidth(String s) { - if (s == null || s.equals("")) { - return 0; - } - return fontRenderer.getStringWidth(TextFormatting.getTextWithoutFormattingCodes(s)); - } - - //TODO, getDisplaySize. - public static Dimension displaySize() { - Minecraft mc = Minecraft.getMinecraft(); - ScaledResolution res = new ScaledResolution(mc); - return new Dimension(res.getScaledWidth(), res.getScaledHeight()); - } - - //TODO, getDisplayRes - public static Dimension displayRes() { - Minecraft mc = Minecraft.getMinecraft(); - return new Dimension(mc.displayWidth, mc.displayHeight); - } - - public static Point getMousePosition(int eventX, int eventY) { - Dimension size = displaySize(); - Dimension res = displayRes(); - return new Point(eventX * size.width / res.width, size.height - eventY * size.height / res.height - 1); - } - - public static Point getMousePosition() { - return getMousePosition(Mouse.getX(), Mouse.getY()); - } - - public static void changeTexture(String s) { - TextureUtils.changeTexture(s); - } - - public static void changeTexture(ResourceLocation r) { - TextureUtils.changeTexture(r); - } - - public static void drawTip(int x, int y, String text) { - drawMultilineTip(x, y, Arrays.asList(text)); - } - - /** - * Append a string in the tooltip list with TOOLTIP_LINESPACE to have a small gap between it and the next line - */ - public static final String TOOLTIP_LINESPACE = "\u00A7h"; - /** - * Have a string in the tooltip list with TOOLTIP_HANDLER + getTipLineId(handler) for a custom handler - */ - @Deprecated - public static final String TOOLTIP_HANDLER = "\u00A7x"; - @Deprecated - private static List tipLineHandlers = new ArrayList(); - - @Deprecated//This is dead as there are forge events. - public interface ITooltipLineHandler { - - Dimension getSize(); - - void draw(int x, int y); - } - - @Deprecated - public static int getTipLineId(ITooltipLineHandler handler) { - return -1; - } - - public static ITooltipLineHandler getTipLine(String line) { - return null; - } - - @Deprecated - public static void drawMultilineTip(int x, int y, List list) { - drawMultilineTip(null, x, y, list); - } - - public static void drawMultilineTip(@Nullable ItemStack stack, int x, int y, List lines) { - //TODO TOOLTIP_LINESPACE support, pr forge to clip the box in the top bound of the screen + TOOLTIP_LINESPACE - /*if (lines.isEmpty()) { - return; - } - - GlStateManager.disableRescaleNormal(); - RenderHelper.disableStandardItemLighting(); - GlStateManager.disableDepth(); - - int w = 0; - int h = -2; - for (int i = 0; i < lines.size(); i++) { - String s = lines.get(i); - ITooltipLineHandler line = getTipLine(s); - Dimension d = line != null ? line.getSize() : new Dimension(getStringWidth(s), lines.get(i).endsWith(TOOLTIP_LINESPACE) && i + 1 < lines.size() ? 12 : 10); - w = Math.max(w, d.width); - h += d.height; - } - - if (x < 8) { - x = 8; - } else if (x > displaySize().width - w - 8) { - x -= 24 + w;//flip side of cursor - if (x < 8) { - x = 8; - } - } - y = (int) MathHelper.clip(y, 8, displaySize().height - 8 - h); - - gui.incZLevel(300); - drawTooltipBox(x - 4, y - 4, w + 7, h + 7); - for (String s : lines) { - ITooltipLineHandler line = getTipLine(s); - if (line != null) { - line.draw(x, y); - y += line.getSize().height; - } else { - fontRenderer.drawStringWithShadow(s, x, y, -1); - y += s.endsWith(TOOLTIP_LINESPACE) ? 12 : 10; - } - } - - tipLineHandlers.clear(); - gui.incZLevel(-300); - - GlStateManager.enableDepth(); - RenderHelper.enableStandardItemLighting(); - GlStateManager.enableRescaleNormal();*/ - - ScaledResolution res = new ScaledResolution(Minecraft.getMinecraft()); - int screenWidth = res.getScaledWidth(); - int screenHeight = res.getScaledHeight(); - - if (lines.isEmpty()) { - return; - } - - RenderTooltipEvent.Pre event = new RenderTooltipEvent.Pre(stack, lines, x, y, screenWidth, screenHeight, -1, fontRenderer); - if (MinecraftForge.EVENT_BUS.post(event)) { - return; - } - x = event.getX(); - y = event.getY(); - screenWidth = event.getScreenWidth(); - screenHeight = event.getScreenHeight(); - int maxTextWidth = event.getMaxWidth(); - FontRenderer font = event.getFontRenderer(); - - GlStateManager.disableRescaleNormal(); - RenderHelper.disableStandardItemLighting(); - GlStateManager.disableLighting(); - GlStateManager.disableDepth(); - - if (x < 8) { - x = 8; - } - y = MathHelper.clip(y, 8, displaySize().height - 8); - int tooltipTextWidth = 0; - - for (String textLine : lines) { - int textLineWidth = font.getStringWidth(textLine); - - if (textLineWidth > tooltipTextWidth) { - tooltipTextWidth = textLineWidth; - } - } - - boolean needsWrap = false; - - int titleLinesCount = 1; - int tooltipX = x + 12; - if (tooltipX + tooltipTextWidth + 4 > screenWidth) { - tooltipX = x - 16 - tooltipTextWidth; - if (tooltipX < 4) // if the tooltip doesn't fit on the screen - { - if (x > screenWidth / 2) { - tooltipTextWidth = x - 12 - 8; - } else { - tooltipTextWidth = screenWidth - 16 - x; - } - needsWrap = true; - } - } - - if (maxTextWidth > 0 && tooltipTextWidth > maxTextWidth) { - tooltipTextWidth = maxTextWidth; - needsWrap = true; - } - - if (needsWrap) { - int wrappedTooltipWidth = 0; - List wrappedTextLines = new ArrayList(); - for (int i = 0; i < lines.size(); i++) { - String textLine = lines.get(i); - List wrappedLine = font.listFormattedStringToWidth(textLine, tooltipTextWidth); - if (i == 0) { - titleLinesCount = wrappedLine.size(); - } - - for (String line : wrappedLine) { - int lineWidth = font.getStringWidth(line); - if (lineWidth > wrappedTooltipWidth) { - wrappedTooltipWidth = lineWidth; - } - wrappedTextLines.add(line); - } - } - tooltipTextWidth = wrappedTooltipWidth; - lines = wrappedTextLines; - - if (x > screenWidth / 2) { - tooltipX = x - 16 - tooltipTextWidth; - } else { - tooltipX = x; - } - } - - int tooltipY = y; - int tooltipHeight = 8; - - if (lines.size() > 1) { - tooltipHeight += (lines.size() - 1) * 10; - if (lines.size() > titleLinesCount) { - tooltipHeight += 2; // gap between title lines and next lines - } - } - - if (tooltipY + tooltipHeight + 6 > screenHeight) { - tooltipY = screenHeight - tooltipHeight - 6; - } - - int backgroundColor = 0xF0100010; - drawGradientRectDirect(tooltipX - 3, tooltipY - 4, tooltipX + tooltipTextWidth + 3, tooltipY - 3, backgroundColor, backgroundColor); - drawGradientRectDirect(tooltipX - 3, tooltipY + tooltipHeight + 3, tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 4, backgroundColor, backgroundColor); - drawGradientRectDirect(tooltipX - 3, tooltipY - 3, tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 3, backgroundColor, backgroundColor); - drawGradientRectDirect(tooltipX - 4, tooltipY - 3, tooltipX - 3, tooltipY + tooltipHeight + 3, backgroundColor, backgroundColor); - drawGradientRectDirect(tooltipX + tooltipTextWidth + 3, tooltipY - 3, tooltipX + tooltipTextWidth + 4, tooltipY + tooltipHeight + 3, backgroundColor, backgroundColor); - int borderColorStart = 0x505000FF; - int borderColorEnd = (borderColorStart & 0xFEFEFE) >> 1 | borderColorStart & 0xFF000000; - drawGradientRectDirect(tooltipX - 3, tooltipY - 3 + 1, tooltipX - 3 + 1, tooltipY + tooltipHeight + 3 - 1, borderColorStart, borderColorEnd); - drawGradientRectDirect(tooltipX + tooltipTextWidth + 2, tooltipY - 3 + 1, tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 3 - 1, borderColorStart, borderColorEnd); - drawGradientRectDirect(tooltipX - 3, tooltipY - 3, tooltipX + tooltipTextWidth + 3, tooltipY - 3 + 1, borderColorStart, borderColorStart); - drawGradientRectDirect(tooltipX - 3, tooltipY + tooltipHeight + 2, tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 3, borderColorEnd, borderColorEnd); - - MinecraftForge.EVENT_BUS.post(new RenderTooltipEvent.PostBackground(stack, lines, tooltipX, tooltipY, font, tooltipTextWidth, tooltipHeight)); - int tooltipTop = tooltipY; - - for (int lineNumber = 0; lineNumber < lines.size(); ++lineNumber) { - String line = lines.get(lineNumber); - font.drawStringWithShadow(line, (float) tooltipX, (float) tooltipY, -1); - - if (lineNumber + 1 == titleLinesCount) { - tooltipY += 2; - } - - tooltipY += 10; - } - - MinecraftForge.EVENT_BUS.post(new RenderTooltipEvent.PostText(stack, lines, tooltipX, tooltipTop, font, tooltipTextWidth, tooltipHeight)); - - GlStateManager.enableLighting(); - GlStateManager.enableDepth(); - RenderHelper.enableStandardItemLighting(); - GlStateManager.enableRescaleNormal(); - - } - - @Deprecated//TODO 1.11, update this to do what is done in the other method(vague, i know what it means tho :P) - public static void drawTooltipBox(int x, int y, int w, int h) { - int bg = 0xf0100010; - drawGradientRect(x + 1, y, w - 1, 1, bg, bg); - drawGradientRect(x + 1, y + h, w - 1, 1, bg, bg); - drawGradientRect(x + 1, y + 1, w - 1, h - 1, bg, bg);//center - drawGradientRect(x, y + 1, 1, h - 1, bg, bg); - drawGradientRect(x + w, y + 1, 1, h - 1, bg, bg); - int grad1 = 0x505000ff; - int grad2 = 0x5028007F; - drawGradientRect(x + 1, y + 2, 1, h - 3, grad1, grad2); - drawGradientRect(x + w - 1, y + 2, 1, h - 3, grad1, grad2); - - drawGradientRect(x + 1, y + 1, w - 1, 1, grad1, grad1); - drawGradientRect(x + 1, y + h - 1, w - 1, 1, grad2, grad2); - } -} diff --git a/dependencies/main/java/codechicken/lib/gui/IGuiPacketSender.java b/dependencies/main/java/codechicken/lib/gui/IGuiPacketSender.java deleted file mode 100644 index aca3fe929c..0000000000 --- a/dependencies/main/java/codechicken/lib/gui/IGuiPacketSender.java +++ /dev/null @@ -1,8 +0,0 @@ -package codechicken.lib.gui; - -import net.minecraft.entity.player.EntityPlayerMP; - -public interface IGuiPacketSender { - - void sendPacket(EntityPlayerMP player, int windowId); -} diff --git a/dependencies/main/java/codechicken/lib/gui/SimpleCreativeTab.java b/dependencies/main/java/codechicken/lib/gui/SimpleCreativeTab.java deleted file mode 100644 index c6bbb4776e..0000000000 --- a/dependencies/main/java/codechicken/lib/gui/SimpleCreativeTab.java +++ /dev/null @@ -1,81 +0,0 @@ -package codechicken.lib.gui; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.FMLLog; -import net.minecraftforge.fml.common.registry.ForgeRegistries; - -/** - * Created by covers1624 on 7/11/2016. - * Provides a Simple way to create a CreativeTab - * TODO BlockState parsing. - */ -public class SimpleCreativeTab extends CreativeTabs { - - private ItemStack tabIcon; - private final String name; - private final int meta; - - /** - * Create a SimpleCreativeTab! - * The tab icon will be "baked" when the icon is requested the first time. - * If the item cannot be found it will throw a RuntimeException, This can be avoided by setting "-Dccl.ignoreInvalidTabItem=true" in your command line args, this will default the tab to Redstone. - * - * @param tabLabel The label to be displayed, This WILL be localized by minecraft. - * @param tabIcon The item to find in the Item Registry e.g "minecraft:redstone" or "chickenchunks:chickenChunkLoader" - */ - public SimpleCreativeTab(String tabLabel, String tabIcon) { - this(tabLabel, tabIcon, 0); - } - - /** - * Create a SimpleCreativeTab! - * The tab icon will be "baked" when the icon is requested the first time. - * If the item cannot be found it will throw a RuntimeException, This can be avoided by setting "-Dccl.ignoreInvalidTabItem=true" in your command line args, this will default the tab to Redstone. - * - * @param tabLabel The label to be displayed, This WILL be localized by minecraft. - * @param tabIcon The item to find in the Item Registry e.g "minecraft:redstone" or "chickenchunks:chickenChunkLoader" - * @param meta The metadata of the item. - */ - public SimpleCreativeTab(String tabLabel, String tabIcon, int meta) { - super(tabLabel); - this.name = tabIcon; - this.meta = meta; - } - - /** - * "Bakes" the SimpleCreativeTab when the icon is requested the first time. - * If the item cannot be found it will throw a RuntimeException. - * This can be avoided by setting "-Dccl.ignoreInvalidTabItem=true" in your command line args. - * This will default the tab to Redstone. - */ - private void bakeTab() { - ResourceLocation location = new ResourceLocation(name); - Item item = ForgeRegistries.ITEMS.getValue(location); - if (item == null) { - if (Boolean.parseBoolean(System.getProperty("ccl.ignoreInvalidTabItem", "false"))) { - FMLLog.warning("Unable to find [%s] in the Item Registry. Please ensure the name for the item is correct. Unable to craft SimpleCreativeTab icon."); - tabIcon = new ItemStack(Items.REDSTONE); - } else { - throw new RuntimeException("Unable to find [%s] in the Item Registry. Please ensure the name for the item is correct. Unable to craft SimpleCreativeTab icon!"); - } - } - tabIcon = new ItemStack(item, 1, meta); - } - - @Override - public Item getTabIconItem() { - return Items.REDSTONE; - } - - @Override - public ItemStack getIconItemStack() { - if (tabIcon == null) { - bakeTab(); - } - return tabIcon; - } -} diff --git a/dependencies/main/java/codechicken/lib/internal/command/DevEnvCommand.java b/dependencies/main/java/codechicken/lib/internal/command/DevEnvCommand.java deleted file mode 100644 index 0e3c264640..0000000000 --- a/dependencies/main/java/codechicken/lib/internal/command/DevEnvCommand.java +++ /dev/null @@ -1,90 +0,0 @@ -package codechicken.lib.internal.command; - -import codechicken.lib.raytracer.RayTracer; -import codechicken.lib.thread.TaskProfiler; -import codechicken.lib.thread.TaskProfiler.ProfilerResult; -import codechicken.lib.util.BlockStateUtils; -import net.minecraft.block.state.IBlockState; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.text.TextComponentString; - -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by covers1624 on 9/01/2017. - */ -public class DevEnvCommand implements ICommand { - - @Override - public String getCommandName() { - return "devStuff"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "Does dev stuff."; - } - - @Override - public List getCommandAliases() { - return new ArrayList(); - } - - @Override - public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { - if (sender instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) sender; - RayTraceResult trace = RayTracer.retrace(player); - if (trace == null) { - addMessage(sender, "Null trace."); - return; - } - IBlockState state = player.worldObj.getBlockState(trace.getBlockPos()); - addMessage(sender, state); - TaskProfiler timer = new TaskProfiler(); - timer.startOnce("task"); - int hash = BlockStateUtils.hashBlockState(state.getBlock().getExtendedState(state, player.worldObj, trace.getBlockPos())); - ProfilerResult result = timer.endOnce(); - - addMessage(sender, "Hash: " + hash); - - addMessage(sender, "Time: " + result.time / 1000); - - } else { - addMessage(sender, "You are not an EntityPlayer.."); - } - - } - - private static void addMessage(ICommandSender sender, Object object, Object... format) { - sender.addChatMessage(new TextComponentString(String.format(String.valueOf(object), format))); - } - - @Override - public boolean checkPermission(MinecraftServer server, ICommandSender sender) { - return true; - } - - @Override - public List getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos) { - return new ArrayList(); - } - - @Override - public boolean isUsernameIndex(String[] args, int index) { - return false; - } - - @Override - public int compareTo(ICommand o) { - return 0; - } -} diff --git a/dependencies/main/java/codechicken/lib/internal/command/client/DumpModelLocationsCommand.java b/dependencies/main/java/codechicken/lib/internal/command/client/DumpModelLocationsCommand.java deleted file mode 100644 index 38dff396a2..0000000000 --- a/dependencies/main/java/codechicken/lib/internal/command/client/DumpModelLocationsCommand.java +++ /dev/null @@ -1,76 +0,0 @@ -package codechicken.lib.internal.command.client; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.client.renderer.block.statemap.BlockStateMapper; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.TextComponentString; -import net.minecraftforge.fml.common.FMLLog; - -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.Map.Entry; - -/** - * Created by covers1624 on 19/12/2016. - * TODO Items. - */ -public class DumpModelLocationsCommand implements ICommand { - - @Override - public String getCommandName() { - return "dumpModelLocations"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "Takes the item in your hand and dumps all model locations."; - } - - @Override - public List getCommandAliases() { - return new ArrayList(); - } - - @Override - public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { - ItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItemMainhand(); - if (stack != null && stack.getItem() instanceof ItemBlock) { - Block block = Block.getBlockFromItem(stack.getItem()); - BlockStateMapper stateMapper = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getBlockStateMapper(); - for (Entry entry : stateMapper.getVariants(block).entrySet()) { - sender.addChatMessage(new TextComponentString(entry.getKey().toString() + " | " + entry.getValue().toString())); - FMLLog.info(entry.getKey().toString() + " | " + entry.getValue().toString()); - } - } - } - - @Override - public boolean checkPermission(MinecraftServer server, ICommandSender sender) { - return true; - } - - @Override - public List getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos) { - return new ArrayList(); - } - - @Override - public boolean isUsernameIndex(String[] args, int index) { - return false; - } - - @Override - public int compareTo(ICommand o) { - return 0; - } -} diff --git a/dependencies/main/java/codechicken/lib/internal/command/client/NukeCCModelCacheCommand.java b/dependencies/main/java/codechicken/lib/internal/command/client/NukeCCModelCacheCommand.java deleted file mode 100644 index 83a0b15ee5..0000000000 --- a/dependencies/main/java/codechicken/lib/internal/command/client/NukeCCModelCacheCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -package codechicken.lib.internal.command.client; - -import codechicken.lib.model.blockbakery.BlockBakery; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.TextComponentString; - -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by covers1624 on 30/12/2016. - */ -public class NukeCCModelCacheCommand implements ICommand { - - @Override - public String getCommandName() { - return "nukeCCModelCache"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "Clears all of CCL's BakedModel cache, requiring models to be re-baked.\nReally only useful for debugging in dev.\nOnly works on blocks / items that use CCL's BakedModel pipe."; - } - - @Override - public List getCommandAliases() { - return new ArrayList(); - } - - @Override - public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { - BlockBakery.nukeModelCache(); - sender.addChatMessage(new TextComponentString("Model cache nuked!")); - } - - @Override - public boolean checkPermission(MinecraftServer server, ICommandSender sender) { - return true; - } - - @Override - public List getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos) { - return new ArrayList(); - } - - @Override - public boolean isUsernameIndex(String[] args, int index) { - return false; - } - - @Override - public int compareTo(ICommand o) { - return 0; - } -} diff --git a/dependencies/main/java/codechicken/lib/internal/proxy/ClientProxy.java b/dependencies/main/java/codechicken/lib/internal/proxy/ClientProxy.java deleted file mode 100644 index f6513ccff7..0000000000 --- a/dependencies/main/java/codechicken/lib/internal/proxy/ClientProxy.java +++ /dev/null @@ -1,37 +0,0 @@ -package codechicken.lib.internal.proxy; - -import codechicken.lib.internal.command.client.DumpModelLocationsCommand; -import codechicken.lib.internal.command.client.NukeCCModelCacheCommand; -import codechicken.lib.model.blockbakery.BlockBakery; -import codechicken.lib.model.blockbakery.loader.CCBakeryModelLoader; -import codechicken.lib.model.cube.CCCubeLoader; -import codechicken.lib.render.CCRenderEventHandler; -import codechicken.lib.render.block.CCExtendedBlockRendererDispatcher; -import codechicken.lib.render.item.CCRenderItem; -import codechicken.lib.render.item.map.MapRenderRegistry; -import net.minecraftforge.client.ClientCommandHandler; -import net.minecraftforge.client.model.ModelLoaderRegistry; -import net.minecraftforge.common.MinecraftForge; - -/** - * Created by covers1624 on 23/11/2016. - */ -public class ClientProxy extends CommonProxy { - - @Override - public void preInit() { - BlockBakery.init(); - CCRenderEventHandler.init(); - MinecraftForge.EVENT_BUS.register(new MapRenderRegistry()); - ModelLoaderRegistry.registerLoader(CCCubeLoader.INSTANCE); - ModelLoaderRegistry.registerLoader(CCBakeryModelLoader.INSTANCE); - ClientCommandHandler.instance.registerCommand(new DumpModelLocationsCommand()); - ClientCommandHandler.instance.registerCommand(new NukeCCModelCacheCommand()); - } - - @Override - public void init() { - CCExtendedBlockRendererDispatcher.init(); - CCRenderItem.init(); - } -} diff --git a/dependencies/main/java/codechicken/lib/internal/proxy/CommonProxy.java b/dependencies/main/java/codechicken/lib/internal/proxy/CommonProxy.java deleted file mode 100644 index b21701d0b4..0000000000 --- a/dependencies/main/java/codechicken/lib/internal/proxy/CommonProxy.java +++ /dev/null @@ -1,24 +0,0 @@ -package codechicken.lib.internal.proxy; - -import net.minecraftforge.fml.common.event.FMLServerStartingEvent; - -/** - * Created by covers1624 on 23/11/2016. - */ -public class CommonProxy { - - public void preInit() { - - } - - public void init() { - - } - - public void serverStarting(FMLServerStartingEvent event) { - //if (!ObfMapping.obfuscated) { - // event.registerServerCommand(new DevEnvCommand()); - //} - } - -} diff --git a/dependencies/main/java/codechicken/lib/inventory/InventoryCopy.java b/dependencies/main/java/codechicken/lib/inventory/InventoryCopy.java deleted file mode 100644 index 748497df28..0000000000 --- a/dependencies/main/java/codechicken/lib/inventory/InventoryCopy.java +++ /dev/null @@ -1,135 +0,0 @@ -package codechicken.lib.inventory; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.TextComponentString; - -/** - * Creates a copy of an IInventory for extended simulation - */ -public class InventoryCopy implements IInventory { - - public boolean[] accessible; - public ItemStack[] items; - public IInventory inv; - - public InventoryCopy(IInventory inv) { - items = new ItemStack[inv.getSizeInventory()]; - accessible = new boolean[inv.getSizeInventory()]; - this.inv = inv; - update(); - } - - public void update() { - for (int i = 0; i < items.length; i++) { - ItemStack stack = inv.getStackInSlot(i); - if (stack != null) { - items[i] = stack.copy(); - } - } - } - - public InventoryCopy open(InventoryRange access) { - int lslot = access.lastSlot(); - if (lslot > accessible.length) { - boolean[] l_accessible = new boolean[lslot]; - ItemStack[] l_items = new ItemStack[lslot]; - System.arraycopy(accessible, 0, l_accessible, 0, accessible.length); - System.arraycopy(items, 0, l_items, 0, items.length); - accessible = l_accessible; - items = l_items; - } - - for (int slot : access.slots) { - accessible[slot] = true; - } - return this; - } - - @Override - public int getSizeInventory() { - return items.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - return items[slot]; - } - - public ItemStack decrStackSize(int slot, int amount) { - return InventoryUtils.decrStackSize(this, slot, amount); - } - - @Override - public ItemStack removeStackFromSlot(int slot) { - return InventoryUtils.removeStackFromSlot(this, slot); - } - - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - items[slot] = stack; - markDirty(); - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return true; - } - - @Override - public int getInventoryStackLimit() { - return 64; - } - - @Override - public void markDirty() { - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return inv.isItemValidForSlot(i, itemstack); - } - - @Override - public void openInventory(EntityPlayer player) { - } - - @Override - public void closeInventory(EntityPlayer player) { - } - - @Override - public int getField(int id) { - return 0; - } - - @Override - public void setField(int id, int value) { - } - - @Override - public int getFieldCount() { - return 0; - } - - @Override - public void clear() { - } - - @Override - public String getName() { - return "copy"; - } - - @Override - public boolean hasCustomName() { - return true; - } - - @Override - public ITextComponent getDisplayName() { - return new TextComponentString(getName()); - } -} diff --git a/dependencies/main/java/codechicken/lib/inventory/InventoryNBT.java b/dependencies/main/java/codechicken/lib/inventory/InventoryNBT.java deleted file mode 100644 index 470f62b9a1..0000000000 --- a/dependencies/main/java/codechicken/lib/inventory/InventoryNBT.java +++ /dev/null @@ -1,124 +0,0 @@ -package codechicken.lib.inventory; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.TextComponentString; - -/** - * IInventory implementation which saves and loads from an NBT tag - */ -public class InventoryNBT implements IInventory { - - protected ItemStack[] items; - protected NBTTagCompound tag; - - public InventoryNBT(int size, NBTTagCompound tag) { - this.tag = tag; - items = new ItemStack[size]; - readNBT(); - } - - private void writeNBT() { - tag.setTag("items", InventoryUtils.writeItemStacksToTag(items, getInventoryStackLimit())); - } - - private void readNBT() { - if (tag.hasKey("items")) { - InventoryUtils.readItemStacksFromTag(items, tag.getTagList("items", 10)); - } - } - - @Override - public int getSizeInventory() { - return items.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - return items[slot]; - } - - @Override - public ItemStack decrStackSize(int slot, int amount) { - return InventoryUtils.decrStackSize(this, slot, amount); - } - - @Override - public ItemStack removeStackFromSlot(int slot) { - return InventoryUtils.removeStackFromSlot(this, slot); - } - - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - items[slot] = stack; - markDirty(); - } - - @Override - public int getInventoryStackLimit() { - return 64; - } - - @Override - public void markDirty() { - writeNBT(); - } - - @Override - public void clear() { - for (int i = 0; i < items.length; i++) { - items[i] = null; - } - markDirty(); - } - - @Override - public int getField(int id) { - return 0; - } - - @Override - public void setField(int id, int value) { - } - - @Override - public int getFieldCount() { - return 0; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer var1) { - return true; - } - - @Override - public void openInventory(EntityPlayer player) { - } - - @Override - public void closeInventory(EntityPlayer player) { - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return true; - } - - @Override - public String getName() { - return "NBT"; - } - - @Override - public boolean hasCustomName() { - return true; - } - - @Override - public ITextComponent getDisplayName() { - return new TextComponentString(getName()); - } -} diff --git a/dependencies/main/java/codechicken/lib/inventory/InventoryRange.java b/dependencies/main/java/codechicken/lib/inventory/InventoryRange.java deleted file mode 100644 index 5155bf1a0c..0000000000 --- a/dependencies/main/java/codechicken/lib/inventory/InventoryRange.java +++ /dev/null @@ -1,75 +0,0 @@ -package codechicken.lib.inventory; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; - -/** - * Inventory wrapper for unified ISided/IInventory access - */ -public class InventoryRange { - - public IInventory inv; - public EnumFacing face; - public ISidedInventory sidedInv; - public int[] slots; - - @Deprecated// Use EnumFacing version. - public InventoryRange(IInventory inv, int side) { - this(inv, EnumFacing.values()[side]); - } - - public InventoryRange(IInventory inv, EnumFacing side) { - this.inv = inv; - this.face = side; - if (inv instanceof ISidedInventory) { - sidedInv = (ISidedInventory) inv; - slots = sidedInv.getSlotsForFace(face); - } else { - slots = new int[inv.getSizeInventory()]; - for (int i = 0; i < slots.length; i++) { - slots[i] = i; - } - } - } - - public InventoryRange(IInventory inv) { - this(inv, EnumFacing.DOWN); - } - - public InventoryRange(IInventory inv, int fslot, int lslot) { - this.inv = inv; - slots = new int[lslot - fslot]; - for (int i = 0; i < slots.length; i++) { - slots[i] = fslot + i; - } - } - - public InventoryRange(IInventory inv, InventoryRange access) { - this.inv = inv; - this.slots = access.slots; - this.face = access.face; - if (inv instanceof ISidedInventory) { - sidedInv = (ISidedInventory) inv; - } - } - - public boolean canInsertItem(int slot, ItemStack item) { - return sidedInv == null ? inv.isItemValidForSlot(slot, item) : sidedInv.canInsertItem(slot, item, face); - } - - public boolean canExtractItem(int slot, ItemStack item) { - return sidedInv == null ? inv.isItemValidForSlot(slot, item) : sidedInv.canExtractItem(slot, item, face); - } - - public int lastSlot() { - int last = 0; - for (int slot : slots) { - if (slot > last) { - last = slot; - } - } - return last; - } -} diff --git a/dependencies/main/java/codechicken/lib/inventory/InventorySimple.java b/dependencies/main/java/codechicken/lib/inventory/InventorySimple.java deleted file mode 100644 index 2eb52f9b5f..0000000000 --- a/dependencies/main/java/codechicken/lib/inventory/InventorySimple.java +++ /dev/null @@ -1,159 +0,0 @@ -package codechicken.lib.inventory; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.TextComponentString; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.items.CapabilityItemHandler; -import net.minecraftforge.items.wrapper.InvWrapper; - -/** - * Simple IInventory implementation with an array of items, name and maximum stack size - */ -public class InventorySimple implements IInventory, ICapabilityProvider { - - public ItemStack[] items; - public int limit; - public String name; - - public InventorySimple(ItemStack[] items, int limit, String name) { - this.items = items; - this.limit = limit; - this.name = name; - } - - public InventorySimple(ItemStack[] items, String name) { - this(items, 64, name); - } - - public InventorySimple(ItemStack[] items, int limit) { - this(items, limit, "inv"); - } - - public InventorySimple(ItemStack[] items) { - this(items, 64, "inv"); - } - - public InventorySimple(int size, int limit, String name) { - this(new ItemStack[size], limit, name); - } - - public InventorySimple(int size, int limit) { - this(size, limit, "inv"); - } - - public InventorySimple(int size, String name) { - this(size, 64, name); - } - - public InventorySimple(int size) { - this(size, 64, "inv"); - } - - @Override - public int getSizeInventory() { - return items.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - return items[slot]; - } - - @Override - public ItemStack decrStackSize(int slot, int amount) { - return InventoryUtils.decrStackSize(this, slot, amount); - } - - @Override - public ItemStack removeStackFromSlot(int slot) { - return InventoryUtils.removeStackFromSlot(this, slot); - } - - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - items[slot] = stack; - markDirty(); - } - - @Override - public int getInventoryStackLimit() { - return limit; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer var1) { - return true; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return true; - } - - @Override - public void markDirty() { - } - - @Override - public void openInventory(EntityPlayer player) { - } - - @Override - public void closeInventory(EntityPlayer player) { - } - - @Override - public int getField(int id) { - return 0; - } - - @Override - public void setField(int id, int value) { - } - - @Override - public int getFieldCount() { - return 0; - } - - @Override - public void clear() { - for (int i = 0; i < items.length; i++) { - items[i] = null; - } - } - - @Override - public String getName() { - return "name"; - } - - @Override - public boolean hasCustomName() { - return true; - } - - @Override - public ITextComponent getDisplayName() { - return new TextComponentString(getName()); - } - - @Override - public boolean hasCapability(Capability capability, EnumFacing facing) { - return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY; - } - - @SuppressWarnings ("unchecked") - @Override - public T getCapability(Capability capability, EnumFacing facing) { - if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { - return (T) new InvWrapper(this); - } - return null; - } -} diff --git a/dependencies/main/java/codechicken/lib/inventory/InventoryUtils.java b/dependencies/main/java/codechicken/lib/inventory/InventoryUtils.java deleted file mode 100644 index 37ce96c924..0000000000 --- a/dependencies/main/java/codechicken/lib/inventory/InventoryUtils.java +++ /dev/null @@ -1,372 +0,0 @@ -package codechicken.lib.inventory; - -import codechicken.lib.vec.Vector3; -import com.google.common.base.Objects; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.inventory.InventoryLargeChest; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTPrimitive; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumFacing.Plane; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.items.CapabilityItemHandler; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.wrapper.EmptyHandler; -import net.minecraftforge.items.wrapper.InvWrapper; -import net.minecraftforge.items.wrapper.SidedInvWrapper; - -public class InventoryUtils { - - public static boolean hasItemHandlerCap(TileEntity tileEntity, EnumFacing face) { - return tileEntity != null && (tileEntity.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, face) || tileEntity instanceof ISidedInventory || tileEntity instanceof IInventory); - } - - public static IItemHandler getItemHandlerCap(TileEntity tileEntity, EnumFacing face) { - if (tileEntity.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, face)) { - return tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, face); - } else if (tileEntity instanceof ISidedInventory) { - return new SidedInvWrapper(((ISidedInventory) tileEntity), face); - } else if (tileEntity instanceof IInventory) { - return new InvWrapper(((IInventory) tileEntity)); - } - return new EmptyHandler(); - } - - /** - * Constructor for ItemStack with tag - */ - public static ItemStack newItemStack(Item item, int size, int damage, NBTTagCompound tag) { - ItemStack stack = new ItemStack(item, size, damage); - stack.setTagCompound(tag); - return stack; - } - - /** - * Gets the actual damage of an item without asking the Item - */ - public static int actualDamage(ItemStack stack) { - return Items.DIAMOND.getDamage(stack); - } - - /** - * Static default implementation for IInventory method - */ - public static ItemStack decrStackSize(IInventory inv, int slot, int size) { - ItemStack item = inv.getStackInSlot(slot); - - if (item != null) { - if (item.stackSize <= size) { - inv.setInventorySlotContents(slot, null); - inv.markDirty(); - return item; - } - ItemStack itemstack1 = item.splitStack(size); - if (item.stackSize == 0) { - inv.setInventorySlotContents(slot, null); - } else { - inv.setInventorySlotContents(slot, item); - } - - inv.markDirty(); - return itemstack1; - } - return null; - } - - /** - * Static default implementation for IInventory method - */ - public static ItemStack removeStackFromSlot(IInventory inv, int slot) { - ItemStack stack = inv.getStackInSlot(slot); - inv.setInventorySlotContents(slot, null); - return stack; - } - - /** - * @return The quantity of items from addition that can be added to base - */ - public static int incrStackSize(ItemStack base, ItemStack addition) { - if (canStack(base, addition)) { - return incrStackSize(base, addition.stackSize); - } - - return 0; - } - - /** - * @return The quantity of items from addition that can be added to base - */ - public static int incrStackSize(ItemStack base, int addition) { - int totalSize = base.stackSize + addition; - - if (totalSize <= base.getMaxStackSize()) { - return addition; - } else if (base.stackSize < base.getMaxStackSize()) { - return base.getMaxStackSize() - base.stackSize; - } - - return 0; - } - - /** - * NBT item saving function - */ - public static NBTTagList writeItemStacksToTag(ItemStack[] items) { - return writeItemStacksToTag(items, 64); - } - - /** - * NBT item saving function with support for stack sizes > 32K - */ - public static NBTTagList writeItemStacksToTag(ItemStack[] items, int maxQuantity) { - NBTTagList tagList = new NBTTagList(); - for (int i = 0; i < items.length; i++) { - if (items[i] != null) { - NBTTagCompound tag = new NBTTagCompound(); - tag.setShort("Slot", (short) i); - items[i].writeToNBT(tag); - - if (maxQuantity > Short.MAX_VALUE) { - tag.setInteger("Quantity", items[i].stackSize); - } else if (maxQuantity > Byte.MAX_VALUE) { - tag.setShort("Quantity", (short) items[i].stackSize); - } - - tagList.appendTag(tag); - } - } - return tagList; - } - - /** - * NBT item loading function with support for stack sizes > 32K - */ - public static void readItemStacksFromTag(ItemStack[] items, NBTTagList tagList) { - for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = tagList.getCompoundTagAt(i); - int b = tag.getShort("Slot"); - items[b] = ItemStack.loadItemStackFromNBT(tag); - if (tag.hasKey("Quantity")) { - items[b].stackSize = ((NBTPrimitive) tag.getTag("Quantity")).getInt(); - } - } - } - - /** - * Spawns an itemstack in the world at a location - */ - public static void dropItem(ItemStack stack, World world, Vector3 dropLocation) { - EntityItem item = new EntityItem(world, dropLocation.x, dropLocation.y, dropLocation.z, stack); - item.motionX = world.rand.nextGaussian() * 0.05; - item.motionY = world.rand.nextGaussian() * 0.05 + 0.2F; - item.motionZ = world.rand.nextGaussian() * 0.05; - world.spawnEntityInWorld(item); - } - - /** - * Copies an itemstack with a new quantity - */ - public static ItemStack copyStack(ItemStack stack, int quantity) { - if (stack == null) { - return null; - } - - stack = stack.copy(); - stack.stackSize = quantity; - return stack; - } - - /** - * Gets the maximum quantity of an item that can be inserted into inv - */ - public static int getInsertibleQuantity(InventoryRange inv, ItemStack stack) { - int quantity = 0; - stack = copyStack(stack, Integer.MAX_VALUE); - for (int slot : inv.slots) { - quantity += fitStackInSlot(inv, slot, stack); - } - - return quantity; - } - - public static int getInsertibleQuantity(IInventory inv, ItemStack stack) { - return getInsertibleQuantity(new InventoryRange(inv), stack); - } - - public static int fitStackInSlot(InventoryRange inv, int slot, ItemStack stack) { - ItemStack base = inv.inv.getStackInSlot(slot); - if (!canStack(base, stack) || !inv.canInsertItem(slot, stack)) { - return 0; - } - - int fit = base != null ? incrStackSize(base, inv.inv.getInventoryStackLimit() - base.stackSize) : inv.inv.getInventoryStackLimit(); - return Math.min(fit, stack.stackSize); - } - - public static int fitStackInSlot(IInventory inv, int slot, ItemStack stack) { - return fitStackInSlot(new InventoryRange(inv), slot, stack); - } - - /** - * @param simulate If set to true, no items will actually be inserted - * @return The number of items unable to be inserted - */ - public static int insertItem(InventoryRange inv, ItemStack stack, boolean simulate) { - stack = stack.copy(); - for (int pass = 0; pass < 2; pass++) { - for (int slot : inv.slots) { - ItemStack base = inv.inv.getStackInSlot(slot); - if ((pass == 0) == (base == null)) { - continue; - } - int fit = fitStackInSlot(inv, slot, stack); - if (fit == 0) { - continue; - } - - if (base != null) { - stack.stackSize -= fit; - if (!simulate) { - base.stackSize += fit; - inv.inv.setInventorySlotContents(slot, base); - } - } else { - if (!simulate) { - inv.inv.setInventorySlotContents(slot, copyStack(stack, fit)); - } - stack.stackSize -= fit; - } - if (stack.stackSize == 0) { - return 0; - } - } - } - return stack.stackSize; - } - - public static int insertItem(IInventory inv, ItemStack stack, boolean simulate) { - return insertItem(new InventoryRange(inv), stack, simulate); - } - - /** - * Gets the stack in slot if it can be extracted - */ - public static ItemStack getExtractableStack(InventoryRange inv, int slot) { - ItemStack stack = inv.inv.getStackInSlot(slot); - if (stack == null || !inv.canExtractItem(slot, stack)) { - return null; - } - - return stack; - } - - public static ItemStack getExtractableStack(IInventory inv, int slot) { - return getExtractableStack(new InventoryRange(inv), slot); - } - - public static boolean areStacksIdentical(ItemStack stack1, ItemStack stack2) { - if (stack1 == null || stack2 == null) { - return stack1 == stack2; - } - - return stack1.getItem() == stack2.getItem() && stack1.getItemDamage() == stack2.getItemDamage() && stack1.stackSize == stack2.stackSize && Objects.equal(stack1.getTagCompound(), stack2.getTagCompound()); - } - - /** - * Gets an IInventory from a coordinate with support for double chests - */ - public static IInventory getInventory(World world, BlockPos pos) { - return getInventory(world.getTileEntity(pos)); - } - - public static IInventory getInventory(TileEntity tile) { - if (!(tile instanceof IInventory)) { - return null; - } - - if (tile instanceof TileEntityChest) { - return getChest((TileEntityChest) tile); - } - return (IInventory) tile; - } - - public static IInventory getChest(TileEntityChest chest) { - for (EnumFacing fside : Plane.HORIZONTAL) { - if (chest.getWorld().getBlockState(chest.getPos().offset(fside)).getBlock() == chest.getBlockType()) { - return new InventoryLargeChest("container.chestDouble", (TileEntityChest) chest.getWorld().getTileEntity(chest.getPos().offset(fside)), chest); - } - } - return chest; - } - - public static boolean canStack(ItemStack stack1, ItemStack stack2) { - return stack1 == null || stack2 == null || (stack1.getItem() == stack2.getItem() && (!stack2.getHasSubtypes() || stack2.getItemDamage() == stack1.getItemDamage()) && ItemStack.areItemStackTagsEqual(stack2, stack1)) && stack1.isStackable(); - } - - /** - * Consumes one item from slot in inv with support for containers. - */ - public static void consumeItem(IInventory inv, int slot) { - ItemStack stack = inv.getStackInSlot(slot); - Item item = stack.getItem(); - if (item.hasContainerItem(stack)) { - ItemStack container = item.getContainerItem(stack); - inv.setInventorySlotContents(slot, container); - } else { - inv.decrStackSize(slot, 1); - } - } - - /** - * Gets the size of the stack in a slot. Returns 0 on null stacks - */ - public static int stackSize(IInventory inv, int slot) { - ItemStack stack = inv.getStackInSlot(slot); - return stack == null ? 0 : stack.stackSize; - } - - /** - * Drops all items from inv using removeStackFromSlot - */ - public static void dropOnClose(EntityPlayer player, IInventory inv) { - for (int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack stack = inv.removeStackFromSlot(i); - if (stack != null) { - player.dropItem(stack, false); - } - } - } - - public static NBTTagCompound savePersistant(ItemStack stack, NBTTagCompound tag) { - stack.writeToNBT(tag); - tag.removeTag("id"); - tag.setString("name", stack.getItem().getRegistryName().toString()); - return tag; - } - - public static ItemStack loadPersistant(NBTTagCompound tag) { - String name = tag.getString("name"); - Item item = Item.REGISTRY.getObject(new ResourceLocation(name)); - if (item == null) { - return null; - } - int count = tag.hasKey("Count") ? tag.getByte("Count") : 1; - int damage = tag.hasKey("Damage") ? tag.getShort("Damage") : 0; - ItemStack stack = new ItemStack(item, count, damage); - if (tag.hasKey("tag", 10)) { - stack.setTagCompound(tag.getCompoundTag("tag")); - } - return stack; - } -} diff --git a/dependencies/main/java/codechicken/lib/inventory/ItemKey.java b/dependencies/main/java/codechicken/lib/inventory/ItemKey.java deleted file mode 100644 index 2e3beb3418..0000000000 --- a/dependencies/main/java/codechicken/lib/inventory/ItemKey.java +++ /dev/null @@ -1,65 +0,0 @@ -package codechicken.lib.inventory; - -import com.google.common.base.Objects; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.oredict.OreDictionary; - -import static codechicken.lib.inventory.InventoryUtils.actualDamage; - -/** - * Comparable ItemStack with a hashCode implementation. - */ -public class ItemKey implements Comparable { - - public ItemStack stack; - private int hashcode = 0; - - public ItemKey(ItemStack k) { - stack = k; - } - - public ItemKey(Item item, int damage) { - this(new ItemStack(item, 1, damage)); - } - - public ItemKey(Item item, NBTTagCompound tag) { - this(item, OreDictionary.WILDCARD_VALUE, tag); - } - - public ItemKey(Item item, int damage, NBTTagCompound tag) { - this(item, damage); - stack.setTagCompound(tag); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof ItemKey)) { - return false; - } - - ItemKey k = (ItemKey) obj; - return stack.getItem() == k.stack.getItem() && actualDamage(stack) == actualDamage(k.stack) && Objects.equal(stack.getTagCompound(), k.stack.getTagCompound()); - } - - @Override - public int hashCode() { - return hashcode != 0 ? hashcode : (hashcode = Objects.hashCode(stack.getItem(), actualDamage(stack), stack.getTagCompound())); - } - - public int compareInt(int a, int b) { - return a == b ? 0 : a < b ? -1 : 1; - } - - @Override - public int compareTo(ItemKey o) { - if (stack.getItem() != o.stack.getItem()) { - return compareInt(Item.getIdFromItem(stack.getItem()), Item.getIdFromItem(o.stack.getItem())); - } - if (actualDamage(stack) != actualDamage(o.stack)) { - return compareInt(actualDamage(stack), actualDamage(o.stack)); - } - return 0; - } -} diff --git a/dependencies/main/java/codechicken/lib/item/ItemMultiType.java b/dependencies/main/java/codechicken/lib/item/ItemMultiType.java deleted file mode 100644 index bbbaae0f14..0000000000 --- a/dependencies/main/java/codechicken/lib/item/ItemMultiType.java +++ /dev/null @@ -1,147 +0,0 @@ -package codechicken.lib.item; - -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.ModelLoader; -import net.minecraftforge.fml.common.FMLLog; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import net.minecraftforge.oredict.OreDictionary; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Created by covers1624 on 3/27/2016. - * TODO cleanup. - */ -public class ItemMultiType extends Item { - - private HashMap names = new HashMap(); - private HashMap rarityMap = new HashMap(); - private int nextVariant = 0; - private boolean hasRegistered = false; - private boolean registerToStackRegistry = false; - - /** - * @param registryName The name to be registered with." - */ - public ItemMultiType(CreativeTabs tab, String registryName) { - setRegistryName(registryName); - setMaxDamage(0); - setHasSubtypes(true); - setCreativeTab(tab); - setUnlocalizedName(new ResourceLocation(registryName).getResourcePath()); - setMaxStackSize(64); - } - - @Override - public ItemMultiType setUnlocalizedName(String unlocalizedName) { - super.setUnlocalizedName(unlocalizedName); - return this; - } - - public ItemMultiType setUseStackRegistry() { - registerToStackRegistry = true; - return this; - } - - public ItemStack registerSubItem(int meta, String name) { - if (names.containsKey(meta)) { - FMLLog.warning("[ItemMultiType.%s]: Variant %s with meta %s is already registered to %s with meta %s", getRegistryName(), name, meta, names.get(meta), meta); - } - names.put(meta, name); - ItemStack stack = new ItemStack(this, 1, meta); - incVariant(); - return stack; - } - - public ItemStack registerSubItem(int meta, String name, EnumRarity rarity) { - rarityMap.put(meta, rarity); - return registerSubItem(meta, name); - } - - public ItemStack registerSubItemOreDict(int meta, String name) { - ItemStack stack = registerSubItem(meta, name); - OreDictionary.registerOre(name, stack); - if (registerToStackRegistry) { - ItemStackRegistry.registerCustomItemStack(name, stack); - } - return stack; - } - - public ItemStack registerSubItemOreDict(int meta, String name, EnumRarity rarity) { - rarityMap.put(meta, rarity); - return registerSubItemOreDict(meta, name); - } - - public ItemStack registerSubItem(String name) { - return registerSubItem(nextVariant, name); - } - - public ItemStack registerSubItem(String name, EnumRarity rarity) { - rarityMap.put(nextVariant, rarity); - return registerSubItem(name); - } - - public ItemStack registerSubItemOreDict(String name) { - ItemStack stack = registerSubItem(nextVariant, name); - OreDictionary.registerOre(name, stack); - if (registerToStackRegistry) { - ItemStackRegistry.registerCustomItemStack(name, stack); - } - return stack; - } - - public ItemStack registerSubItemOreDict(String name, EnumRarity rarity) { - rarityMap.put(nextVariant, rarity); - return registerSubItemOreDict(name); - } - - private void incVariant() { - if (names.containsKey(nextVariant)) { - nextVariant++; - while (names.containsKey(nextVariant)) { - nextVariant++; - } - } - } - - @SuppressWarnings ("ConstantConditions") - @SideOnly (Side.CLIENT) - public void registerModelVariants() { - if (!hasRegistered) { - for (Map.Entry entry : names.entrySet()) { - ModelResourceLocation location = new ModelResourceLocation(getRegistryName(), "type=" + entry.getValue().toLowerCase()); - ModelLoader.setCustomModelResourceLocation(this, entry.getKey(), location); - } - hasRegistered = true; - } - } - - @Override - public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) { - for (Map.Entry entry : names.entrySet()) { - subItems.add(new ItemStack(itemIn, 1, entry.getKey())); - } - } - - @Override - public String getUnlocalizedName(ItemStack stack) { - int meta = stack.getItemDamage(); - return getUnlocalizedName() + "." + names.get(meta); - } - - @Override - public EnumRarity getRarity(ItemStack stack) { - if (rarityMap.containsKey(stack.getItemDamage())) { - return rarityMap.get(stack.getItemDamage()); - } - return super.getRarity(stack); - } -} diff --git a/dependencies/main/java/codechicken/lib/item/ItemStackRegistry.java b/dependencies/main/java/codechicken/lib/item/ItemStackRegistry.java deleted file mode 100644 index 4c1e9b5bfa..0000000000 --- a/dependencies/main/java/codechicken/lib/item/ItemStackRegistry.java +++ /dev/null @@ -1,52 +0,0 @@ -package codechicken.lib.item; - -import com.google.common.collect.HashBasedTable; -import com.google.common.collect.Table; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.registry.ForgeRegistries; - -/** - * Created by covers1624 on 22/10/2016. - * TODO, We need to find another way to do this. - */ -public class ItemStackRegistry { - - private static Table stackRegistry = HashBasedTable.create(); - - public static void registerCustomItemStack(String name, ItemStack stack) { - stackRegistry.put(Loader.instance().activeModContainer().getModId(), name, stack); - } - - public static ItemStack findItemStack(String modId, String name, int stackSize) { - ItemStack foundStack = findItemStack(modId, name); - if (foundStack != null) { - ItemStack copy = foundStack.copy(); - copy.stackSize = Math.min(stackSize, copy.getMaxStackSize()); - return copy; - } - return null; - } - - public static ItemStack findItemStack(String modId, String name) { - ItemStack stack = stackRegistry.get(modId, name); - if (stack == null) { - Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(modId, name)); - if (item != null) { - stack = new ItemStack(item, 0, 0); - } - } - if (stack == null) { - Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(modId, name)); - if (block != null && block != Blocks.AIR) { - stack = new ItemStack(block, 0, Short.MAX_VALUE); - } - } - return stack; - } - -} diff --git a/dependencies/main/java/codechicken/lib/item/filtering/IItemFilter.java b/dependencies/main/java/codechicken/lib/item/filtering/IItemFilter.java deleted file mode 100644 index 7834b6c7fb..0000000000 --- a/dependencies/main/java/codechicken/lib/item/filtering/IItemFilter.java +++ /dev/null @@ -1,20 +0,0 @@ -package codechicken.lib.item.filtering; - -import net.minecraft.item.ItemStack; - -/** - * This is an item filter. - * Implement it and do stuff, Its pretty simple. - * There are some default filters provided as well. - */ -public interface IItemFilter { - - /** - * Checks to see if the item matches the filter. - * True means the item is allowed, false the item is not allowed. - * - * @param item Item to check. - * @return True if the item matches the filter. - */ - boolean matches(ItemStack item); -} diff --git a/dependencies/main/java/codechicken/lib/item/filtering/IItemFilterProvider.java b/dependencies/main/java/codechicken/lib/item/filtering/IItemFilterProvider.java deleted file mode 100644 index 6f9df2aba1..0000000000 --- a/dependencies/main/java/codechicken/lib/item/filtering/IItemFilterProvider.java +++ /dev/null @@ -1,13 +0,0 @@ -package codechicken.lib.item.filtering; - -/** - * Defines a class that can obtain filters, Really only used in NEI but here because reasons. - */ -public interface IItemFilterProvider { - - /** - * Provides an item filter. May be called from any thread. Returned filter should only reference objects with immutable state. - */ - IItemFilter getFilter(); - -} diff --git a/dependencies/main/java/codechicken/lib/lighting/LC.java b/dependencies/main/java/codechicken/lib/lighting/LC.java deleted file mode 100644 index 828e76d971..0000000000 --- a/dependencies/main/java/codechicken/lib/lighting/LC.java +++ /dev/null @@ -1,91 +0,0 @@ -package codechicken.lib.lighting; - -import codechicken.lib.util.Copyable; -import codechicken.lib.util.VectorUtils; -import codechicken.lib.vec.Rotation; -import codechicken.lib.vec.Vector3; - -public class LC implements Copyable { - - public int side; - public float fa; - public float fb; - public float fc; - public float fd; - - public LC() { - this(0, 0, 0, 0, 0); - } - - public LC(int s, float a, float b, float c, float d) { - side = s; - fa = a; - fb = b; - fc = c; - fd = d; - } - - public LC set(int s, float a, float b, float c, float d) { - side = s; - fa = a; - fb = b; - fc = c; - fd = d; - return this; - } - - public LC set(LC lc) { - return set(lc.side, lc.fa, lc.fb, lc.fc, lc.fd); - } - - public LC compute(Vector3 vec, Vector3 normal) { - int side = VectorUtils.findSide(normal); - if (side < 0) { - return set(12, 1, 0, 0, 0); - } - return compute(vec, side); - } - - public LC compute(Vector3 vec, int side) { - boolean offset = false; - switch (side) { - case 0: - offset = vec.y <= 0; - break; - case 1: - offset = vec.y >= 1; - break; - case 2: - offset = vec.z <= 0; - break; - case 3: - offset = vec.z >= 1; - break; - case 4: - offset = vec.x <= 0; - break; - case 5: - offset = vec.x >= 1; - break; - } - if (!offset) { - side += 6; - } - return computeO(vec, side); - } - - public LC computeO(Vector3 vec, int side) { - Vector3 v1 = Rotation.axes[((side & 0xE) + 3) % 6]; - Vector3 v2 = Rotation.axes[((side & 0xE) + 5) % 6]; - float d1 = (float) vec.scalarProject(v1); - float d2 = 1 - d1; - float d3 = (float) vec.scalarProject(v2); - float d4 = 1 - d3; - return set(side, d2 * d4, d2 * d3, d1 * d4, d1 * d3); - } - - @Override - public LC copy() { - return new LC(side, fa, fb, fc, fd); - } -} diff --git a/dependencies/main/java/codechicken/lib/lighting/LightMatrix.java b/dependencies/main/java/codechicken/lib/lighting/LightMatrix.java deleted file mode 100644 index 24b7505c26..0000000000 --- a/dependencies/main/java/codechicken/lib/lighting/LightMatrix.java +++ /dev/null @@ -1,173 +0,0 @@ -package codechicken.lib.lighting; - -import codechicken.lib.colour.ColourRGBA; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.IVertexOperation; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; - -/** - * Note that when using the class as a vertex transformer, the vertices are assumed to be within the BB (x, y, z) -> (x+1, y+1, z+1) - */ -public class LightMatrix implements IVertexOperation { - - public static final int operationIndex = CCRenderState.registerOperation(); - - public int computed = 0; - public float[][] ao = new float[13][4]; - public int[][] brightness = new int[13][4]; - - public IBlockAccess access; - public BlockPos pos = BlockPos.ORIGIN; - - private int sampled = 0; - private float[] aSamples = new float[27]; - private int[] bSamples = new int[27]; - - /** - * The 9 positions in the sample array for each side, sides >= 6 are centered on sample 13 (the block itself) - */ - //@formatter:off - public static final int[][] ssamplem = new int[][]{ - { 0, 1, 2, 3, 4, 5, 6, 7, 8 }, - {18,19,20,21,22,23,24,25,26 }, - { 0, 9,18, 1,10,19, 2,11,20 }, - { 6,15,24, 7,16,25, 8,17,26 }, - { 0, 3, 6, 9,12,15,18,21,24 }, - { 2, 5, 8,11,14,17,20,23,26 }, - { 9,10,11,12,13,14,15,16,17 }, - { 9,10,11,12,13,14,15,16,17 }, - { 3,12,21, 4,13,22, 5,14,23 }, - { 3,12,21, 4,13,22, 5,14,23 }, - { 1, 4, 7,10,13,16,19,22,25 }, - { 1, 4, 7,10,13,16,19,22,25 }, - {13,13,13,13,13,13,13,13,13 }}; - public static final int[][] qsamplem = new int[][] {//the positions in the side sample array for each corner - {0,1,3,4}, - {5,1,2,4}, - {6,7,3,4}, - {5,7,8,4}}; - public static final float[] sideao = new float[]{ - 0.5F, 1F, 0.8F, 0.8F, 0.6F, 0.6F, - 0.5F, 1F, 0.8F, 0.8F, 0.6F, 0.6F, - 1F }; - - //@formatter:on - /*static - { - int[][] os = new int[][]{ - {0,-1,0}, - {0, 1,0}, - {0,0,-1}, - {0,0, 1}, - {-1,0,0}, - { 1,0,0}}; - - for(int s = 0; s < 12; s++) - { - int[] d0 = s < 6 ? new int[]{os[s][0]+1, os[s][1]+1, os[s][2]+1} : new int[]{1, 1, 1}; - int[] d1 = os[((s&0xE)+3)%6]; - int[] d2 = os[((s&0xE)+5)%6]; - for(int a = -1; a <= 1; a++) - for(int b = -1; b <= 1; b++) - ssamplem[s][(a+1)*3+b+1] = (d0[1]+d1[1]*a+d2[1]*b)*9+(d0[2]+d1[2]*a+d2[2]*b)*3+(d0[0]+d1[0]*a+d2[0]*b); - } - System.out.println(Arrays.deepToString(ssamplem)); - }*/ - - public void locate(IBlockAccess a, BlockPos bPos) { - access = a; - pos = bPos; - computed = 0; - sampled = 0; - } - - public void sample(int i) { - if ((sampled & 1 << i) == 0) { - BlockPos bp = new BlockPos(pos.getX() + (i % 3) - 1, pos.getY() + (i / 9) - 1, pos.getZ() + (i / 3 % 3) - 1); - IBlockState b = access.getBlockState(bp); - bSamples[i] = access.getCombinedLight(bp, b.getLightValue(access, bp)); - aSamples[i] = b.getBlock().getAmbientOcclusionLightValue(b); - sampled |= 1 << i; - } - } - - public int[] brightness(int side) { - sideSample(side); - return brightness[side]; - } - - public float[] ao(int side) { - sideSample(side); - return ao[side]; - } - - public void sideSample(int side) { - if ((computed & 1 << side) == 0) { - int[] ssample = ssamplem[side]; - for (int q = 0; q < 4; q++) { - int[] qsample = qsamplem[q]; - if (Minecraft.isAmbientOcclusionEnabled()) { - interp(side, q, ssample[qsample[0]], ssample[qsample[1]], ssample[qsample[2]], ssample[qsample[3]]); - } else { - interp(side, q, ssample[4], ssample[4], ssample[4], ssample[4]); - } - } - computed |= 1 << side; - } - } - - protected void interp(int s, int q, int a, int b, int c, int d) { - sample(a); - sample(b); - sample(c); - sample(d); - ao[s][q] = interpAO(aSamples[a], aSamples[b], aSamples[c], aSamples[d]) * sideao[s]; - brightness[s][q] = interpBrightness(bSamples[a], bSamples[b], bSamples[c], bSamples[d]); - } - - public static float interpAO(float a, float b, float c, float d) { - return (a + b + c + d) / 4F; - } - - public static int interpBrightness(int a, int b, int c, int d) { - if (a == 0) { - a = d; - } - if (b == 0) { - b = d; - } - if (c == 0) { - c = d; - } - return (a + b + c + d) >> 2 & 0xFF00FF; - } - - @Override - public boolean load(CCRenderState state) { - if (!state.computeLighting) { - return false; - } - - state.pipeline.addDependency(state.colourAttrib); - state.pipeline.addDependency(state.lightCoordAttrib); - return true; - } - - @Override - public void operate(CCRenderState state) { - LC lc = state.lc; - float[] a = ao(lc.side); - float f = (a[0] * lc.fa + a[1] * lc.fb + a[2] * lc.fc + a[3] * lc.fd); - int[] b = brightness(lc.side); - state.colour = ColourRGBA.multiplyC(state.colour, f); - state.brightness = (int) (b[0] * lc.fa + b[1] * lc.fb + b[2] * lc.fc + b[3] * lc.fd) & 0xFF00FF; - } - - @Override - public int operationID() { - return operationIndex; - } -} diff --git a/dependencies/main/java/codechicken/lib/lighting/LightModel.java b/dependencies/main/java/codechicken/lib/lighting/LightModel.java deleted file mode 100644 index 32a35352ed..0000000000 --- a/dependencies/main/java/codechicken/lib/lighting/LightModel.java +++ /dev/null @@ -1,111 +0,0 @@ -package codechicken.lib.lighting; - -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.IVertexOperation; -import codechicken.lib.vec.Rotation; -import codechicken.lib.vec.Vector3; - -public class LightModel implements IVertexOperation { - - public static final int operationIndex = CCRenderState.registerOperation(); - - public static class Light { - - public Vector3 ambient = new Vector3(); - public Vector3 diffuse = new Vector3(); - public Vector3 position; - - public Light(Vector3 pos) { - position = pos.copy().normalize(); - } - - public Light setDiffuse(Vector3 vec) { - diffuse.set(vec); - return this; - } - - public Light setAmbient(Vector3 vec) { - ambient.set(vec); - return this; - } - } - - public static LightModel standardLightModel; - - static { - standardLightModel = new LightModel().setAmbient(new Vector3(0.4, 0.4, 0.4)).addLight(new Light(new Vector3(0.2, 1, -0.7)).setDiffuse(new Vector3(0.6, 0.6, 0.6))).addLight(new Light(new Vector3(-0.2, 1, 0.7)).setDiffuse(new Vector3(0.6, 0.6, 0.6))); - } - - private Vector3 ambient = new Vector3(); - private Light[] lights = new Light[8]; - private int lightCount; - - public LightModel addLight(Light light) { - lights[lightCount++] = light; - return this; - } - - public LightModel setAmbient(Vector3 vec) { - ambient.set(vec); - return this; - } - - /** - * @param colour The pre-lighting vertex colour. RGBA format - * @param normal The normal at the vertex - * @return The lighting applied colour - */ - public int apply(int colour, Vector3 normal) { - Vector3 n_colour = ambient.copy(); - for (int l = 0; l < lightCount; l++) { - Light light = lights[l]; - double n_l = light.position.dotProduct(normal); - double f = n_l > 0 ? 1 : 0; - n_colour.x += light.ambient.x + f * light.diffuse.x * n_l; - n_colour.y += light.ambient.y + f * light.diffuse.y * n_l; - n_colour.z += light.ambient.z + f * light.diffuse.z * n_l; - } - - if (n_colour.x > 1) { - n_colour.x = 1; - } - if (n_colour.y > 1) { - n_colour.y = 1; - } - if (n_colour.z > 1) { - n_colour.z = 1; - } - - n_colour.multiply((colour >>> 24) / 255D, (colour >> 16 & 0xFF) / 255D, (colour >> 8 & 0xFF) / 255D); - return (int) (n_colour.x * 255) << 24 | (int) (n_colour.y * 255) << 16 | (int) (n_colour.z * 255) << 8 | colour & 0xFF; - } - - @Override - public boolean load(CCRenderState state) { - if (!state.computeLighting) { - return false; - } - - state.pipeline.addDependency(state.normalAttrib); - state.pipeline.addDependency(state.colourAttrib); - return true; - } - - @Override - public void operate(CCRenderState state) { - state.colour = apply(state.colour, state.normal); - } - - @Override - public int operationID() { - return operationIndex; - } - - public PlanarLightModel reducePlanar() { - int[] colours = new int[6]; - for (int i = 0; i < 6; i++) { - colours[i] = apply(-1, Rotation.axes[i]); - } - return new PlanarLightModel(colours); - } -} diff --git a/dependencies/main/java/codechicken/lib/lighting/PlanarLightMatrix.java b/dependencies/main/java/codechicken/lib/lighting/PlanarLightMatrix.java deleted file mode 100644 index d04823d84c..0000000000 --- a/dependencies/main/java/codechicken/lib/lighting/PlanarLightMatrix.java +++ /dev/null @@ -1,55 +0,0 @@ -package codechicken.lib.lighting; - -import codechicken.lib.render.CCRenderState; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; - -public class PlanarLightMatrix extends PlanarLightModel { - - public static final int operationIndex = CCRenderState.registerOperation(); - public static PlanarLightMatrix instance = new PlanarLightMatrix(); - - public IBlockAccess access; - public BlockPos pos = BlockPos.ORIGIN; - - private int sampled = 0; - public int[] brightness = new int[6]; - - public PlanarLightMatrix() { - super(PlanarLightModel.standardLightModel.colours); - } - - public PlanarLightMatrix locate(IBlockAccess a, BlockPos bPos) { - access = a; - pos = bPos; - sampled = 0; - return this; - } - - public int brightness(int side) { - if ((sampled & 1 << side) == 0) { - IBlockState b = access.getBlockState(pos); - brightness[side] = access.getCombinedLight(pos, b.getBlock().getLightValue(b, access, pos)); - sampled |= 1 << side; - } - return brightness[side]; - } - - @Override - public boolean load(CCRenderState state) { - state.pipeline.addDependency(state.sideAttrib); - return true; - } - - @Override - public void operate(CCRenderState state) { - super.operate(state); - state.brightness = brightness(state.side); - } - - @Override - public int operationID() { - return operationIndex; - } -} diff --git a/dependencies/main/java/codechicken/lib/lighting/PlanarLightModel.java b/dependencies/main/java/codechicken/lib/lighting/PlanarLightModel.java deleted file mode 100644 index d280d9d9bd..0000000000 --- a/dependencies/main/java/codechicken/lib/lighting/PlanarLightModel.java +++ /dev/null @@ -1,40 +0,0 @@ -package codechicken.lib.lighting; - -import codechicken.lib.colour.ColourRGBA; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.IVertexOperation; - -/** - * Faster precomputed version of LightModel that only works for axis planar sides - */ -public class PlanarLightModel implements IVertexOperation { - - public static PlanarLightModel standardLightModel = LightModel.standardLightModel.reducePlanar(); - - public int[] colours; - - public PlanarLightModel(int[] colours) { - this.colours = colours; - } - - @Override - public boolean load(CCRenderState state) { - if (!state.computeLighting) { - return false; - } - - state.pipeline.addDependency(state.sideAttrib); - state.pipeline.addDependency(state.colourAttrib); - return true; - } - - @Override - public void operate(CCRenderState state) { - state.colour = ColourRGBA.multiply(state.colour, colours[state.side]); - } - - @Override - public int operationID() { - return LightModel.operationIndex; - } -} diff --git a/dependencies/main/java/codechicken/lib/lighting/SimpleBrightnessModel.java b/dependencies/main/java/codechicken/lib/lighting/SimpleBrightnessModel.java deleted file mode 100644 index 71efc8e026..0000000000 --- a/dependencies/main/java/codechicken/lib/lighting/SimpleBrightnessModel.java +++ /dev/null @@ -1,57 +0,0 @@ -package codechicken.lib.lighting; - -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.IVertexOperation; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; - -/** - * Simple brightness model that only works for axis planar sides - */ -public class SimpleBrightnessModel implements IVertexOperation { - - public static final int operationIndex = CCRenderState.registerOperation(); - public static SimpleBrightnessModel instance = new SimpleBrightnessModel(); - - public IBlockAccess access; - public BlockPos pos = BlockPos.ORIGIN; - - private int sampled = 0; - private int[] samples = new int[6]; - private BlockPos c = BlockPos.ORIGIN; - - public void locate(IBlockAccess a, BlockPos bPos) { - access = a; - pos = bPos; - sampled = 0; - } - - public int sample(int side) { - if ((sampled & 1 << side) == 0) { - c = pos.offset(EnumFacing.VALUES[side]); - IBlockState b = access.getBlockState(c); - samples[side] = access.getCombinedLight(c, b.getBlock().getLightValue(b, access, c)); - sampled |= 1 << side; - } - return samples[side]; - } - - @Override - public boolean load(CCRenderState state) { - - state.pipeline.addDependency(state.sideAttrib); - return true; - } - - @Override - public void operate(CCRenderState state) { - state.brightness = sample(state.side); - } - - @Override - public int operationID() { - return operationIndex; - } -} diff --git a/dependencies/main/java/codechicken/lib/math/MathHelper.java b/dependencies/main/java/codechicken/lib/math/MathHelper.java deleted file mode 100644 index ff6b591e5e..0000000000 --- a/dependencies/main/java/codechicken/lib/math/MathHelper.java +++ /dev/null @@ -1,312 +0,0 @@ -package codechicken.lib.math; - -import net.minecraft.util.math.BlockPos; - -//TODO cleanup. -public class MathHelper { - - public static final double phi = 1.618033988749894; - public static final double pi = Math.PI; - public static final double todeg = 57.29577951308232; - public static final double torad = 0.017453292519943; - public static final double sqrt2 = 1.414213562373095; - - public static double[] SIN_TABLE = new double[65536]; - - static { - for (int i = 0; i < 65536; ++i) { - SIN_TABLE[i] = Math.sin(i / 65536D * 2 * Math.PI); - } - - SIN_TABLE[0] = 0; - SIN_TABLE[16384] = 1; - SIN_TABLE[32768] = 0; - SIN_TABLE[49152] = 1; - } - - public static double sin(double d) { - return SIN_TABLE[(int) ((float) d * 10430.378F) & 65535]; - } - - public static double cos(double d) { - return SIN_TABLE[(int) ((float) d * 10430.378F + 16384.0F) & 65535]; - } - - /** - * @param a The value - * @param b The value to approach - * @param max The maximum step - * @return the closed value to b no less than max from a - */ - public static float approachLinear(float a, float b, float max) { - return (a > b) ? (a - b < max ? b : a - max) : (b - a < max ? b : a + max); - } - - /** - * @param a The value - * @param b The value to approach - * @param max The maximum step - * @return the closed value to b no less than max from a - */ - public static double approachLinear(double a, double b, double max) { - return (a > b) ? (a - b < max ? b : a - max) : (b - a < max ? b : a + max); - } - - /** - * @param a The first value - * @param b The second value - * @param d The interpolation factor, between 0 and 1 - * @return a+(b-a)*d - */ - public static float interpolate(float a, float b, float d) { - return a + (b - a) * d; - } - - /** - * @param a The first value - * @param b The second value - * @param d The interpolation factor, between 0 and 1 - * @return a+(b-a)*d - */ - public static double interpolate(double a, double b, double d) { - return a + (b - a) * d; - } - - /** - * @param a The value - * @param b The value to approach - * @param ratio The ratio to reduce the difference by - * @return a+(b-a)*ratio - */ - public static double approachExp(double a, double b, double ratio) { - return a + (b - a) * ratio; - } - - /** - * @param a The value - * @param b The value to approach - * @param ratio The ratio to reduce the difference by - * @param cap The maximum amount to advance by - * @return a+(b-a)*ratio - */ - public static double approachExp(double a, double b, double ratio, double cap) { - double d = (b - a) * ratio; - if (Math.abs(d) > cap) { - d = Math.signum(d) * cap; - } - return a + d; - } - - /** - * @param a The value - * @param b The value to approach - * @param ratio The ratio to reduce the difference by - * @param c The value to retreat from - * @param kick The difference when a == c - * @return - */ - public static double retreatExp(double a, double b, double c, double ratio, double kick) { - double d = (Math.abs(c - a) + kick) * ratio; - if (d > Math.abs(b - a)) { - return b; - } - return a + Math.signum(b - a) * d; - } - - /** - * @param value The value - * @param min The min value - * @param max The max value - * @return The clipped value between min and max - */ - public static double clip(double value, double min, double max) { - if (value > max) { - value = max; - } - if (value < min) { - value = min; - } - return value; - } - - /** - * @param value The value - * @param min The min value - * @param max The max value - * @return The clipped value between min and max - */ - public static float clip(float value, float min, float max) { - if (value > max) { - value = max; - } - if (value < min) { - value = min; - } - return value; - } - - /** - * @param value The value - * @param min The min value - * @param max The max value - * @return The clipped value between min and max - */ - public static int clip(int value, int min, int max) { - if (value > max) { - value = max; - } - if (value < min) { - value = min; - } - return value; - } - - /** - * Maps a value range to another value range. - * - * @param valueIn The value to map. - * @param inMin The minimum of the input value range. - * @param inMax The maximum of the input value range - * @param outMin The minimum of the output value range. - * @param outMax The maximum of the output value range. - * @return The mapped value. - */ - public static double map(double valueIn, double inMin, double inMax, double outMin, double outMax) { - return (valueIn - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; - } - - /** - * Maps a value range to another value range. - * - * @param valueIn The value to map. - * @param inMin The minimum of the input value range. - * @param inMax The maximum of the input value range - * @param outMin The minimum of the output value range. - * @param outMax The maximum of the output value range. - * @return The mapped value. - */ - public static float map(float valueIn, float inMin, float inMax, float outMin, float outMax) { - return (valueIn - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; - } - - /** - * Rounds the number of decimal places based on the given multiplier.
- * e.g.
- * Input: 17.5245743
- * multiplier: 1000
- * Output: 17.534
- * multiplier: 10
- * Output 17.5

- * - * @param number The input value. - * @param multiplier The multiplier. - * @return The input rounded to a number of decimal places based on the multiplier. - */ - public static double round(double number, double multiplier) { - return Math.round(number * multiplier) / multiplier; - } - - /** - * Rounds the number of decimal places based on the given multiplier.
- * e.g.
- * Input: 17.5245743
- * multiplier: 1000
- * Output: 17.534
- * multiplier: 10
- * Output 17.5

- * - * @param number The input value. - * @param multiplier The multiplier. - * @return The input rounded to a number of decimal places based on the multiplier. - */ - public static float round(float number, float multiplier) { - return Math.round(number * multiplier) / multiplier; - } - - /** - * @return min <= value <= max - */ - public static boolean between(double min, double value, double max) { - return min <= value && value <= max; - } - - public static int approachExpI(int a, int b, double ratio) { - int r = (int) Math.round(approachExp(a, b, ratio)); - return r == a ? b : r; - } - - public static int retreatExpI(int a, int b, int c, double ratio, int kick) { - int r = (int) Math.round(retreatExp(a, b, c, ratio, kick)); - return r == a ? b : r; - } - - public static int floor(double d) { - return net.minecraft.util.math.MathHelper.floor_double(d); - } - - public static int floor(float d) { - return net.minecraft.util.math.MathHelper.floor_float(d); - } - - public static int ceil(double d) { - return net.minecraft.util.math.MathHelper.ceiling_double_int(d); - } - - public static int ceil(float d) { - return net.minecraft.util.math.MathHelper.ceiling_float_int(d); - } - - public static float sqrt(float f) { - return net.minecraft.util.math.MathHelper.sqrt_float(f); - } - - public static float sqrt(double f) { - return net.minecraft.util.math.MathHelper.sqrt_double(f); - } - - public static int roundAway(double d) { - return (int) (d < 0 ? Math.floor(d) : Math.ceil(d)); - } - - public static int compare(int a, int b) { - return a == b ? 0 : a < b ? -1 : 1; - } - - public static int compare(double a, double b) { - return a == b ? 0 : a < b ? -1 : 1; - } - - public static int absSum(BlockPos pos) { - return (pos.getX() < 0 ? -pos.getX() : pos.getX()) + (pos.getY() < 0 ? -pos.getY() : pos.getY()) + (pos.getZ() < 0 ? -pos.getZ() : pos.getZ()); - } - - public static boolean isAxial(BlockPos pos) { - return pos.getX() == 0 ? (pos.getY() == 0 || pos.getZ() == 0) : (pos.getY() == 0 && pos.getZ() == 0); - } - - public static int toSide(BlockPos pos) { - if (!isAxial(pos)) { - return -1; - } - if (pos.getY() < 0) { - return 0; - } - if (pos.getY() > 0) { - return 1; - } - if (pos.getZ() < 0) { - return 2; - } - if (pos.getZ() > 0) { - return 3; - } - if (pos.getX() < 0) { - return 4; - } - if (pos.getX() > 0) { - return 5; - } - - return -1; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/BakedModelProperties.java b/dependencies/main/java/codechicken/lib/model/BakedModelProperties.java deleted file mode 100644 index eb33d7a3e9..0000000000 --- a/dependencies/main/java/codechicken/lib/model/BakedModelProperties.java +++ /dev/null @@ -1,60 +0,0 @@ -package codechicken.lib.model; - -import codechicken.lib.util.Copyable; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; - -/** - * Created by covers1624 on 19/11/2016. - */ -public class BakedModelProperties implements Copyable { - - private final boolean isAO; - private final boolean isGui3D; - private final boolean isBuiltInRenderer; - private final TextureAtlasSprite particle; - - public BakedModelProperties(boolean isAO, boolean isGui3D) { - this(isAO, isGui3D, false, null); - } - - public BakedModelProperties(BakedModelProperties properties, TextureAtlasSprite sprite) { - this(properties.isAmbientOcclusion(), properties.isGui3d(), properties.isBuiltInRenderer(), sprite); - } - - public BakedModelProperties(boolean isAO, boolean isGui3D, TextureAtlasSprite sprite) { - this(isAO, isGui3D, false, sprite); - } - - public BakedModelProperties(boolean isAO, boolean isGui3D, boolean isBuiltInRenderer, TextureAtlasSprite particle) { - this.isAO = isAO; - this.isGui3D = isGui3D; - this.isBuiltInRenderer = isBuiltInRenderer; - this.particle = particle; - } - - public static BakedModelProperties createFromModel(IBakedModel model) { - return new BakedModelProperties(model.isAmbientOcclusion(), model.isGui3d(), model.isBuiltInRenderer(), model.getParticleTexture()); - } - - public boolean isAmbientOcclusion() { - return isAO; - } - - public boolean isGui3d() { - return isGui3D; - } - - public boolean isBuiltInRenderer() { - return isBuiltInRenderer; - } - - public TextureAtlasSprite getParticleTexture() { - return particle; - } - - @Override - public BakedModelProperties copy() { - return new BakedModelProperties(isAO, isGui3D, isBuiltInRenderer, particle); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/CCMultiModel.java b/dependencies/main/java/codechicken/lib/model/CCMultiModel.java deleted file mode 100644 index d9276c4cc7..0000000000 --- a/dependencies/main/java/codechicken/lib/model/CCMultiModel.java +++ /dev/null @@ -1,91 +0,0 @@ -package codechicken.lib.model; - -import codechicken.lib.model.bakedmodels.PerspectiveAwareMultiModel; -import codechicken.lib.texture.TextureUtils; -import com.google.common.base.Function; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.IModel; -import net.minecraftforge.common.model.IModelState; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -/** - * Created by covers1624 on 16/12/2016. - */ -public class CCMultiModel implements IModel { - - private final IModel base; - private final BakedModelProperties baseProperties; - private final List subModels; - - public CCMultiModel(IModel base, BakedModelProperties baseProperties, List subModels) { - this.base = base; - this.baseProperties = baseProperties; - this.subModels = subModels; - } - - @Override - public Collection getDependencies() { - List deps = new ArrayList(); - if (base != null) { - deps.addAll(base.getDependencies()); - } - for (IModel subModel : subModels) { - deps.addAll(subModel.getDependencies()); - } - return deps; - } - - @Override - public Collection getTextures() { - List deps = new ArrayList(); - if (base != null) { - deps.addAll(base.getTextures()); - } - for (IModel subModel : subModels) { - deps.addAll(subModel.getTextures()); - } - return deps; - } - - @Override - public IBakedModel bake(IModelState state, VertexFormat format, Function bakedTextureGetter) { - IBakedModel baseBakedModel = null; - if (base != null) { - baseBakedModel = base.bake(state, format, bakedTextureGetter); - } - List subBakedModels = new ArrayList(); - TextureAtlasSprite particle = null; - if (baseBakedModel != null) { - particle = baseBakedModel.getParticleTexture(); - } - for (IModel subModel : subModels) { - TextureAtlasSprite particleCandidate = null; - IBakedModel bakedSubModel = subModel.bake(subModel.getDefaultState(), format, bakedTextureGetter); - subBakedModels.add(bakedSubModel); - if (particle == null || particle == TextureUtils.getMissingSprite()) { - if (particleCandidate == null || particleCandidate == TextureUtils.getMissingSprite()) { - particleCandidate = bakedSubModel.getParticleTexture(); - } - if (particleCandidate != null || particleCandidate != TextureUtils.getMissingSprite()) { - particle = particleCandidate; - } - } - } - if (particle == null) { - particle = TextureUtils.getMissingSprite(); - } - - return new PerspectiveAwareMultiModel(baseBakedModel, subBakedModels, state, new BakedModelProperties(baseProperties, particle)); - } - - @Override - public IModelState getDefaultState() { - return base.getDefaultState(); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/CCOverrideBakedBlockModel.java b/dependencies/main/java/codechicken/lib/model/CCOverrideBakedBlockModel.java deleted file mode 100644 index c9b6c08db0..0000000000 --- a/dependencies/main/java/codechicken/lib/model/CCOverrideBakedBlockModel.java +++ /dev/null @@ -1,83 +0,0 @@ -package codechicken.lib.model; - -import codechicken.lib.model.loader.CCBakedModelLoader; -import codechicken.lib.texture.TextureUtils; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.EnumFacing; - -import javax.annotation.Nullable; -import java.util.LinkedList; -import java.util.List; - -/** - * Created by covers1624 on 7/31/2016. - */ -@Deprecated -public class CCOverrideBakedBlockModel implements IBakedModel { - - private final String particle; - private final boolean isAmbientOcclusion; - private final ItemOverrideList overrideList; - - public CCOverrideBakedBlockModel(String particle) { - this(particle, ItemOverrideList.NONE); - } - - public CCOverrideBakedBlockModel(String particle, ItemOverrideList overrideList) { - this(particle, false, overrideList); - } - - public CCOverrideBakedBlockModel(String particle, boolean isAmbientOcclusion, ItemOverrideList overrideList) { - this.particle = particle; - this.isAmbientOcclusion = isAmbientOcclusion; - this.overrideList = overrideList; - } - - @Override - public List getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { - LinkedList quads = new LinkedList(); - if (state == null) { - return quads; - } - IBakedModel correctModel = CCBakedModelLoader.getModel(state); - if (correctModel != null) { - quads.addAll(correctModel.getQuads(state, side, rand)); - } - return quads; - } - - @Override - public boolean isAmbientOcclusion() { - return isAmbientOcclusion; - } - - @Override - public boolean isGui3d() { - return false; - } - - @Override - public boolean isBuiltInRenderer() { - return false; - } - - @Override - public TextureAtlasSprite getParticleTexture() { - return TextureUtils.getTexture(particle); - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } - - @Override - public ItemOverrideList getOverrides() { - return overrideList; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/CCOverrideBakedModel.java b/dependencies/main/java/codechicken/lib/model/CCOverrideBakedModel.java deleted file mode 100644 index ceb085d8a2..0000000000 --- a/dependencies/main/java/codechicken/lib/model/CCOverrideBakedModel.java +++ /dev/null @@ -1,13 +0,0 @@ -package codechicken.lib.model; - -/** - * Created by covers1624 on 7/25/2016. - * Default implementation for CCOverrideListHandler. - */ -@Deprecated -public class CCOverrideBakedModel extends SimpleOverrideBakedModel { - - public CCOverrideBakedModel() { - super(new CCOverrideListHandler()); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/CCOverrideListHandler.java b/dependencies/main/java/codechicken/lib/model/CCOverrideListHandler.java deleted file mode 100644 index 3744845c32..0000000000 --- a/dependencies/main/java/codechicken/lib/model/CCOverrideListHandler.java +++ /dev/null @@ -1,32 +0,0 @@ -package codechicken.lib.model; - -import codechicken.lib.model.loader.CCBakedModelLoader; -import com.google.common.collect.ImmutableList; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemOverride; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Created by covers1624 on 7/25/2016. - *

- * Default implementation for CCBakedModelLoader. - */ -@Deprecated -public class CCOverrideListHandler extends ItemOverrideList { - - public CCOverrideListHandler() { - super(ImmutableList.of()); - } - - @Override - public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) { - IBakedModel model = CCBakedModelLoader.getModel(stack); - if (model == null) { - return originalModel; - } - return model; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/DummyBakedModel.java b/dependencies/main/java/codechicken/lib/model/DummyBakedModel.java deleted file mode 100644 index 1743131235..0000000000 --- a/dependencies/main/java/codechicken/lib/model/DummyBakedModel.java +++ /dev/null @@ -1,56 +0,0 @@ -package codechicken.lib.model; - -import com.google.common.collect.ImmutableList; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.EnumFacing; - -import javax.annotation.Nullable; -import java.util.List; - -/** - * Created by covers1624 on 7/25/2016. - * A baked model to make minecraft shut the fuck up with baked model errors. - * TODO, Json support. - */ -public class DummyBakedModel implements IBakedModel { - - @Override - public List getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { - return ImmutableList.of(); - } - - @Override - public boolean isAmbientOcclusion() { - return false; - } - - @Override - public boolean isGui3d() { - return false; - } - - @Override - public boolean isBuiltInRenderer() { - return false; - } - - @Override - public TextureAtlasSprite getParticleTexture() { - return null; - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } - - @Override - public ItemOverrideList getOverrides() { - return ItemOverrideList.NONE; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/ModelRegistryHelper.java b/dependencies/main/java/codechicken/lib/model/ModelRegistryHelper.java deleted file mode 100644 index 14e750105f..0000000000 --- a/dependencies/main/java/codechicken/lib/model/ModelRegistryHelper.java +++ /dev/null @@ -1,107 +0,0 @@ -package codechicken.lib.model; - -import codechicken.lib.render.item.IItemRenderer; -import codechicken.lib.texture.TextureUtils; -import codechicken.lib.util.TransformUtils; -import com.google.common.base.Function; -import com.google.common.collect.Maps; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.ItemMeshDefinition; -import net.minecraft.client.renderer.block.model.BuiltInModel; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.client.renderer.block.statemap.IStateMapper; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.registry.IRegistry; -import net.minecraftforge.client.event.ModelBakeEvent; -import net.minecraftforge.client.model.ModelLoader; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.commons.lang3.tuple.Pair; - -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -//TODO General cleanup, move to a less modular fashion now that CCL is a ModContainer. -public class ModelRegistryHelper { - - private static List> registerModels = new LinkedList>(); - private static List modelBakeCallbacks = new LinkedList(); - - static { - MinecraftForge.EVENT_BUS.register(new ModelRegistryHelper()); - } - - public static void registerCallback(IModelBakeCallback callback) { - modelBakeCallbacks.add(callback); - } - - public static void register(ModelResourceLocation location, IBakedModel model) { - registerModels.add(new ImmutablePair(location, model)); - } - - /** - * Inserts the item renderer at itemRegistry.getNameForObject(block)#inventory and binds it to the item with a custom mesh definition - */ - public static void registerItemRenderer(Item item, IItemRenderer renderer) { - final ModelResourceLocation modelLoc = new ModelResourceLocation(item.getRegistryName(), "inventory"); - register(modelLoc, renderer); - ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() { - @Override - public ModelResourceLocation getModelLocation(ItemStack stack) { - return modelLoc; - } - }); - } - - @SubscribeEvent - public void onModelBake(ModelBakeEvent event) { - for (Pair pair : registerModels) { - event.getModelRegistry().putObject(pair.getKey(), pair.getValue()); - } - for (IModelBakeCallback callback : modelBakeCallbacks) { - callback.onModelBake(event.getModelRegistry()); - } - } - - /** - * Creates a dummy model at blockRegistry.getNameForObject(block)#particle for all states of the block overriding getParticleTexture - */ - public static void setParticleTexture(Block block, final ResourceLocation tex) { - final ModelResourceLocation modelLoc = new ModelResourceLocation(block.getRegistryName(), "particle"); - register(modelLoc, new BuiltInModel(TransformUtils.DEFAULT_BLOCK.toVanillaTransform(), ItemOverrideList.NONE) { - @Override - public TextureAtlasSprite getParticleTexture() { - return TextureUtils.getTexture(tex); - } - }); - ModelLoader.setCustomStateMapper(block, new IStateMapper() { - @Override - public Map putStateModelLocations(Block blockIn) { - return Maps.toMap(blockIn.getBlockState().getValidStates(), new Function() { - @Override - public ModelResourceLocation apply(IBlockState input) { - return modelLoc; - } - }); - } - }); - } - - public interface IModelBakeCallback { - - /** - * A Simple callback for model baking. - * - * @param modelRegistry - */ - void onModelBake(IRegistry modelRegistry); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/PerspectiveAwareModelProperties.java b/dependencies/main/java/codechicken/lib/model/PerspectiveAwareModelProperties.java deleted file mode 100644 index 152a8c4125..0000000000 --- a/dependencies/main/java/codechicken/lib/model/PerspectiveAwareModelProperties.java +++ /dev/null @@ -1,34 +0,0 @@ -package codechicken.lib.model; - -import codechicken.lib.util.TransformUtils; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraftforge.common.model.IModelState; - -/** - * Created by covers1624 on 21/02/2017. - */ -public class PerspectiveAwareModelProperties { - - public static final PerspectiveAwareModelProperties DEFAULT_ITEM = new PerspectiveAwareModelProperties(TransformUtils.DEFAULT_ITEM, true, false); - public static final PerspectiveAwareModelProperties DEFAULT_BLOCK = new PerspectiveAwareModelProperties(TransformUtils.DEFAULT_BLOCK, true, true); - - private final IModelState modelState; - private final BakedModelProperties properties; - - public PerspectiveAwareModelProperties(IModelState state, boolean isAO, boolean isGui3D) { - this(state, isAO, isGui3D, false, null); - } - - public PerspectiveAwareModelProperties(IModelState state, boolean isAO, boolean isGui3D, boolean isBuiltInRenderer, TextureAtlasSprite particle) { - this.modelState = state; - properties = new BakedModelProperties(isAO, isGui3D, isBuiltInRenderer, particle); - } - - public IModelState getModelState() { - return modelState; - } - - public BakedModelProperties getProperties() { - return properties; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/SimpleBakedBlockModel.java b/dependencies/main/java/codechicken/lib/model/SimpleBakedBlockModel.java deleted file mode 100644 index 16b18a5299..0000000000 --- a/dependencies/main/java/codechicken/lib/model/SimpleBakedBlockModel.java +++ /dev/null @@ -1,66 +0,0 @@ -package codechicken.lib.model; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.EnumFacing; - -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -/** - * Created by covers1624 on 8/4/2016. - */ -@Deprecated -public class SimpleBakedBlockModel implements IBakedModel { - - public List quads; - - public SimpleBakedBlockModel(List quads) { - //Copy the quads because reasons. - this.quads = new LinkedList(quads); - } - - @Override - public List getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { - if (side == null) { - return quads; - } - return new ArrayList(); - } - - @Override - public boolean isAmbientOcclusion() { - return false; - } - - @Override - public boolean isGui3d() { - return false; - } - - @Override - public boolean isBuiltInRenderer() { - return false; - } - - @Override - public TextureAtlasSprite getParticleTexture() { - return null; - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return null; - } - - @Override - public ItemOverrideList getOverrides() { - return null; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/SimpleBakedItemModel.java b/dependencies/main/java/codechicken/lib/model/SimpleBakedItemModel.java deleted file mode 100644 index ffc54b986a..0000000000 --- a/dependencies/main/java/codechicken/lib/model/SimpleBakedItemModel.java +++ /dev/null @@ -1,100 +0,0 @@ -package codechicken.lib.model; - -import codechicken.lib.util.TransformUtils; -import com.google.common.base.Function; -import com.google.common.collect.ImmutableList; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.IPerspectiveAwareModel; -import net.minecraftforge.client.model.ItemLayerModel; -import org.apache.commons.lang3.tuple.Pair; - -import javax.annotation.Nullable; -import javax.vecmath.Matrix4f; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by covers1624 on 7/18/2016. - * TODO, Cleanup and move to bakedmodels package. - */ -public class SimpleBakedItemModel implements IPerspectiveAwareModel { - - private ImmutableList quads; - private TextureAtlasSprite sprite; - private ResourceLocation spriteName; - - public SimpleBakedItemModel(ResourceLocation sprite) { - spriteName = sprite; - } - - @Override - public List getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { - if (state == null && side == null) { - if (quads == null) { - bake(); - } - return quads; - } - return new ArrayList(); - } - - @Override - public boolean isAmbientOcclusion() { - return false; - } - - @Override - public boolean isGui3d() { - return false; - } - - @Override - public boolean isBuiltInRenderer() { - return false; - } - - @Override - public TextureAtlasSprite getParticleTexture() { - return sprite; - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } - - @Override - public ItemOverrideList getOverrides() { - return ItemOverrideList.NONE; - } - - @Override - public Pair handlePerspective(TransformType cameraTransformType) { - return MapWrapper.handlePerspective(this, TransformUtils.DEFAULT_ITEM.getTransforms(), cameraTransformType); - } - - private void bake() { - Function bakedTextureGetter = new Function() { - @Override - public TextureAtlasSprite apply(ResourceLocation input) { - return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString()); - } - }; - IBakedModel layerModel = new ItemLayerModel(ImmutableList.of(spriteName)).bake(TransformUtils.DEFAULT_ITEM, DefaultVertexFormats.ITEM, bakedTextureGetter); - ImmutableList.Builder quadBuilder = ImmutableList.builder(); - quadBuilder.addAll(layerModel.getQuads(null, null, 0)); - this.quads = quadBuilder.build(); - this.sprite = bakedTextureGetter.apply(spriteName); - } - -} diff --git a/dependencies/main/java/codechicken/lib/model/SimpleOverrideBakedModel.java b/dependencies/main/java/codechicken/lib/model/SimpleOverrideBakedModel.java deleted file mode 100644 index eeb6c66dce..0000000000 --- a/dependencies/main/java/codechicken/lib/model/SimpleOverrideBakedModel.java +++ /dev/null @@ -1,61 +0,0 @@ -package codechicken.lib.model; - -import com.google.common.collect.ImmutableList; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.EnumFacing; - -import java.util.List; - -/** - * Created by covers1624 on 7/25/2016. - * This defines a model that's soul purpose is to act as a wrapper for an ItemOverrideList. - * TODO Cleanup, BakedModelProperties support and move to bakedmodels package. - */ -public class SimpleOverrideBakedModel implements IBakedModel { - - private ItemOverrideList overrideList; - - public SimpleOverrideBakedModel(ItemOverrideList overrideList) { - this.overrideList = overrideList; - } - - @Override - public List getQuads(IBlockState state, EnumFacing side, long rand) { - return ImmutableList.of(); - } - - @Override - public boolean isAmbientOcclusion() { - return false; - } - - @Override - public boolean isGui3d() { - return false; - } - - @Override - public boolean isBuiltInRenderer() { - return false; - } - - @Override - public TextureAtlasSprite getParticleTexture() { - return null; - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } - - @Override - public ItemOverrideList getOverrides() { - return overrideList; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/SimplePerspectiveAwareBakedModel.java b/dependencies/main/java/codechicken/lib/model/SimplePerspectiveAwareBakedModel.java deleted file mode 100644 index 9c2dc1c6ea..0000000000 --- a/dependencies/main/java/codechicken/lib/model/SimplePerspectiveAwareBakedModel.java +++ /dev/null @@ -1,91 +0,0 @@ -package codechicken.lib.model; - -import codechicken.lib.render.CCModelState; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.client.model.IPerspectiveAwareModel; -import net.minecraftforge.common.model.TRSRTransformation; -import org.apache.commons.lang3.tuple.Pair; - -import javax.annotation.Nullable; -import javax.vecmath.Matrix4f; -import java.util.List; - -/** - * Created by covers1624 on 7/25/2016. - * A simple IPerspectiveAwareModel see SimplePerspectiveAwareLayerModelBakery for baking to this. - *

- * Basically a wrapper for baked quads and IPerspectiveAwareModel. - */ -@Deprecated -public class SimplePerspectiveAwareBakedModel implements IPerspectiveAwareModel { - - private final ImmutableMap transforms; - private final ImmutableList quads; - private final TextureAtlasSprite particle; - - public SimplePerspectiveAwareBakedModel(List quads, CCModelState modelState) { - this(quads, null, modelState.getTransforms()); - } - - public SimplePerspectiveAwareBakedModel(List quads, ImmutableMap transforms) { - this(quads, null, transforms); - } - - public SimplePerspectiveAwareBakedModel(List quads, TextureAtlasSprite particle, ImmutableMap transforms) { - this.transforms = transforms; - this.quads = ImmutableList.copyOf(quads); - this.particle = particle; - } - - @Override - public List getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { - if (side == null) { - return quads; - } - return ImmutableList.of(); - } - - @Override - public Pair handlePerspective(TransformType cameraTransformType) { - return MapWrapper.handlePerspective(this, transforms, cameraTransformType); - } - - @Override - public boolean isAmbientOcclusion() { - return false; - } - - @Override - public boolean isGui3d() { - return false; - } - - @Override - public boolean isBuiltInRenderer() { - return false; - } - - @Override - public TextureAtlasSprite getParticleTexture() { - return particle; - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } - - @Override - public ItemOverrideList getOverrides() { - return ItemOverrideList.NONE; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/StateOverrideIModel.java b/dependencies/main/java/codechicken/lib/model/StateOverrideIModel.java deleted file mode 100644 index 67cc3c3027..0000000000 --- a/dependencies/main/java/codechicken/lib/model/StateOverrideIModel.java +++ /dev/null @@ -1,77 +0,0 @@ -package codechicken.lib.model; - -import com.google.common.base.Function; -import com.google.common.collect.ImmutableMap; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.*; -import net.minecraftforge.common.model.IModelState; - -import java.util.Collection; - -/** - * Created by covers1624 on 17/12/2016. - * TODO Decide on a standard place for CCL's IModels. - */ -public class StateOverrideIModel implements IModel, IRetexturableModel, IModelCustomData, IModelSimpleProperties, IModelUVLock { - - private IModel wrapped; - private final IModelState wrappedState; - - public StateOverrideIModel(IModel wrapped, IModelState wrappedState) { - this.wrapped = wrapped; - this.wrappedState = wrappedState; - } - - @Override - public Collection getDependencies() { - return wrapped.getDependencies(); - } - - @Override - public Collection getTextures() { - return wrapped.getTextures(); - } - - @Override - public IBakedModel bake(IModelState state, VertexFormat format, Function bakedTextureGetter) { - return wrapped.bake(state, format, bakedTextureGetter); - } - - @Override - public IModelState getDefaultState() { - return wrappedState; - } - - @Override - public IModel retexture(ImmutableMap textures) { - wrapped = ModelProcessingHelper.retexture(wrapped, textures); - return this; - } - - @Override - public IModel uvlock(boolean value) { - wrapped = ModelProcessingHelper.uvlock(wrapped, value); - return this; - } - - @Override - public IModel smoothLighting(boolean value) { - wrapped = ModelProcessingHelper.smoothLighting(wrapped, value); - return this; - } - - @Override - public IModel gui3d(boolean value) { - wrapped = ModelProcessingHelper.gui3d(wrapped, value); - return this; - } - - @Override - public IModel process(ImmutableMap customData) { - wrapped = ModelProcessingHelper.customData(wrapped, customData); - return this; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/bakedmodels/AbstractBakedPropertiesModel.java b/dependencies/main/java/codechicken/lib/model/bakedmodels/AbstractBakedPropertiesModel.java deleted file mode 100644 index 7e8f2428d6..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakedmodels/AbstractBakedPropertiesModel.java +++ /dev/null @@ -1,43 +0,0 @@ -package codechicken.lib.model.bakedmodels; - -import codechicken.lib.model.BakedModelProperties; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; - -/** - * Created by covers1624 on 1/02/2017. - */ -public abstract class AbstractBakedPropertiesModel implements IBakedModel { - - private final BakedModelProperties properties; - - public AbstractBakedPropertiesModel(BakedModelProperties properties) { - this.properties = properties; - } - - @Override - public boolean isAmbientOcclusion() { - return properties.isAmbientOcclusion(); - } - - @Override - public boolean isGui3d() { - return properties.isGui3d(); - } - - @Override - public boolean isBuiltInRenderer() { - return properties.isBuiltInRenderer(); - } - - @Override - public TextureAtlasSprite getParticleTexture() { - return properties.getParticleTexture(); - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareBakedModel.java b/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareBakedModel.java deleted file mode 100644 index d53dd1589c..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareBakedModel.java +++ /dev/null @@ -1,94 +0,0 @@ -package codechicken.lib.model.bakedmodels; - -import codechicken.lib.model.BakedModelProperties; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.client.model.IPerspectiveAwareModel; -import net.minecraftforge.common.model.IModelState; -import org.apache.commons.lang3.tuple.Pair; - -import javax.annotation.Nullable; -import javax.vecmath.Matrix4f; -import java.util.List; -import java.util.Map; - -/** - * Created by covers1624 on 25/11/2016. - */ -public class PerspectiveAwareBakedModel implements IPerspectiveAwareModel { - - private final ImmutableMap> faceQuads; - private final ImmutableList generalQuads; - private final IModelState state; - private final BakedModelProperties properties; - - public PerspectiveAwareBakedModel(Map> faceQuads, IModelState state, BakedModelProperties properties) { - this(faceQuads, ImmutableList.of(), state, properties); - } - - public PerspectiveAwareBakedModel(List generalQuads, IModelState state, BakedModelProperties properties) { - this(ImmutableMap.>of(), generalQuads, state, properties); - } - - public PerspectiveAwareBakedModel(Map> faceQuads, List generalQuads, IModelState state, BakedModelProperties properties) { - this.faceQuads = ImmutableMap.copyOf(faceQuads); - this.generalQuads = ImmutableList.copyOf(generalQuads); - this.state = state; - this.properties = properties.copy(); - } - - @Override - public List getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { - if (side == null) { - return generalQuads; - } else { - if (faceQuads.containsKey(side)) { - return faceQuads.get(side); - } - } - return ImmutableList.of(); - } - - @Override - public Pair handlePerspective(TransformType cameraTransformType) { - return MapWrapper.handlePerspective(this, state, cameraTransformType); - } - - @Override - public boolean isAmbientOcclusion() { - return properties.isAmbientOcclusion(); - } - - @Override - public boolean isGui3d() { - return properties.isGui3d(); - } - - @Override - public boolean isBuiltInRenderer() { - return properties.isBuiltInRenderer(); - } - - @Override - public TextureAtlasSprite getParticleTexture() { - return properties.getParticleTexture(); - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } - - @Override - public ItemOverrideList getOverrides() { - return ItemOverrideList.NONE; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareLayeredModel.java b/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareLayeredModel.java deleted file mode 100644 index f4ebc24937..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareLayeredModel.java +++ /dev/null @@ -1,100 +0,0 @@ -package codechicken.lib.model.bakedmodels; - -import codechicken.lib.model.BakedModelProperties; -import com.google.common.collect.ImmutableMap; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.client.model.IPerspectiveAwareModel; -import net.minecraftforge.common.model.IModelState; -import org.apache.commons.lang3.tuple.Pair; - -import javax.annotation.Nullable; -import javax.vecmath.Matrix4f; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * Created by covers1624 on 19/11/2016. - */ -public class PerspectiveAwareLayeredModel implements IPerspectiveAwareModel { - - private final ImmutableMap>> layerFaceQuadMap; - private final ImmutableMap> layerGeneralQuads; - private final IModelState state; - private final BakedModelProperties properties; - - public PerspectiveAwareLayeredModel(Map>> layerFaceQuadMap, IModelState state, BakedModelProperties properties) { - this(layerFaceQuadMap, ImmutableMap.>of(), state, properties); - } - - public PerspectiveAwareLayeredModel(Map>> layerFaceQuadMap, Map> layerGeneralQuads, IModelState state, BakedModelProperties properties) { - this.layerFaceQuadMap = ImmutableMap.copyOf(layerFaceQuadMap); - this.layerGeneralQuads = ImmutableMap.copyOf(layerGeneralQuads); - this.state = state; - this.properties = properties.copy(); - - } - - @Override - public List getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { - BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer(); - if (layer == null) { - layer = BlockRenderLayer.SOLID;//Default to solid. Constructor param?? - } - if (side == null) { - if (layerGeneralQuads.containsKey(layer)) { - return layerGeneralQuads.get(layer); - } - } else if (layerFaceQuadMap.containsKey(layer)) { - Map> faceQuadMap = layerFaceQuadMap.get(layer); - if (faceQuadMap.containsKey(side)) { - return faceQuadMap.get(side); - } - } - return new ArrayList(); - } - - @Override - public boolean isAmbientOcclusion() { - return properties.isAmbientOcclusion(); - } - - @Override - public boolean isGui3d() { - return properties.isGui3d(); - } - - @Override - public boolean isBuiltInRenderer() { - return properties.isBuiltInRenderer(); - } - - @Override - public TextureAtlasSprite getParticleTexture() { - return properties.getParticleTexture(); - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } - - @Override - public ItemOverrideList getOverrides() { - return ItemOverrideList.NONE; - } - - @Override - public Pair handlePerspective(TransformType cameraTransformType) { - return MapWrapper.handlePerspective(this, state, cameraTransformType); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareLayeredModelWrapper.java b/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareLayeredModelWrapper.java deleted file mode 100644 index abd2ff03ac..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareLayeredModelWrapper.java +++ /dev/null @@ -1,87 +0,0 @@ -package codechicken.lib.model.bakedmodels; - -import codechicken.lib.model.BakedModelProperties; -import com.google.common.collect.ImmutableMap; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.client.model.IPerspectiveAwareModel; -import net.minecraftforge.common.model.IModelState; -import org.apache.commons.lang3.tuple.Pair; - -import javax.annotation.Nullable; -import javax.vecmath.Matrix4f; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * Created by covers1624 on 19/11/2016. - */ -public class PerspectiveAwareLayeredModelWrapper implements IPerspectiveAwareModel { - - private final ImmutableMap layerModelMap; - private final IModelState state; - private final BakedModelProperties properties; - - public PerspectiveAwareLayeredModelWrapper(Map layerModelMap, IModelState state, BakedModelProperties properties) { - - this.layerModelMap = ImmutableMap.copyOf(layerModelMap); - this.state = state; - this.properties = properties.copy(); - } - - @Override - public List getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { - BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer(); - if (layer == null) { - layer = BlockRenderLayer.SOLID; - } - if (layerModelMap.containsKey(layer)) { - return layerModelMap.get(layer).getQuads(state, side, rand); - } - return new ArrayList(); - } - - @Override - public boolean isAmbientOcclusion() { - return properties.isAmbientOcclusion(); - } - - @Override - public boolean isGui3d() { - return properties.isGui3d(); - } - - @Override - public boolean isBuiltInRenderer() { - return properties.isBuiltInRenderer(); - } - - @Override - public TextureAtlasSprite getParticleTexture() { - return properties.getParticleTexture(); - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } - - @Override - public ItemOverrideList getOverrides() { - return ItemOverrideList.NONE; - } - - @Override - public Pair handlePerspective(TransformType cameraTransformType) { - return MapWrapper.handlePerspective(this, state, cameraTransformType); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareMultiModel.java b/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareMultiModel.java deleted file mode 100644 index 03111eb066..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareMultiModel.java +++ /dev/null @@ -1,84 +0,0 @@ -package codechicken.lib.model.bakedmodels; - -import codechicken.lib.model.BakedModelProperties; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.client.model.IPerspectiveAwareModel; -import net.minecraftforge.common.model.IModelState; -import org.apache.commons.lang3.tuple.Pair; - -import javax.annotation.Nullable; -import javax.vecmath.Matrix4f; -import java.util.LinkedList; -import java.util.List; - -/** - * Created by covers1624 on 16/12/2016. - */ -public class PerspectiveAwareMultiModel implements IPerspectiveAwareModel { - - private final IBakedModel baseModel; - private final List subModels; - private final IModelState baseState; - private final BakedModelProperties properties; - - public PerspectiveAwareMultiModel(IBakedModel baseModel, List subModels, IModelState baseState, BakedModelProperties properties) { - this.baseModel = baseModel; - this.subModels = subModels; - this.baseState = baseState; - this.properties = properties; - } - - @Override - public List getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { - List quads = new LinkedList(); - if (baseModel != null) { - quads.addAll(baseModel.getQuads(state, side, rand)); - } - for (IBakedModel subModel : subModels) { - quads.addAll(subModel.getQuads(state, side, rand)); - } - return quads; - } - - @Override - public boolean isAmbientOcclusion() { - return properties.isAmbientOcclusion(); - } - - @Override - public boolean isGui3d() { - return properties.isGui3d(); - } - - @Override - public boolean isBuiltInRenderer() { - return properties.isBuiltInRenderer(); - } - - @Override - public TextureAtlasSprite getParticleTexture() { - return properties.getParticleTexture(); - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } - - @Override - public ItemOverrideList getOverrides() { - return ItemOverrideList.NONE; - } - - @Override - public Pair handlePerspective(TransformType cameraTransformType) { - return MapWrapper.handlePerspective(this, baseState, cameraTransformType); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareOverrideModel.java b/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareOverrideModel.java deleted file mode 100644 index 562d187ea7..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakedmodels/PerspectiveAwareOverrideModel.java +++ /dev/null @@ -1,59 +0,0 @@ -package codechicken.lib.model.bakedmodels; - -import codechicken.lib.model.BakedModelProperties; -import com.google.common.collect.ImmutableList; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemOverrideList; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.client.model.IPerspectiveAwareModel; -import net.minecraftforge.common.model.IModelState; -import org.apache.commons.lang3.tuple.Pair; - -import javax.annotation.Nullable; -import javax.vecmath.Matrix4f; -import java.util.List; - -/** - * Created by covers1624 on 1/02/2017. - */ -public class PerspectiveAwareOverrideModel extends AbstractBakedPropertiesModel implements IPerspectiveAwareModel { - - private final ItemOverrideList overrideList; - private final IModelState state; - private final List quads; - - public PerspectiveAwareOverrideModel(ItemOverrideList overrideList, IModelState state, BakedModelProperties properties) { - super(properties); - this.state = state; - this.overrideList = overrideList; - this.quads = ImmutableList.of(); - } - - public PerspectiveAwareOverrideModel(ItemOverrideList overrideList, IModelState state, BakedModelProperties properties, List quads) { - super(properties); - this.state = state; - this.overrideList = overrideList; - this.quads = quads; - } - - @Override - public List getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { - if (state == null && side == null) { - return quads; - } - return ImmutableList.of(); - } - - @Override - public ItemOverrideList getOverrides() { - return overrideList; - } - - @Override - public Pair handlePerspective(TransformType cameraTransformType) { - return MapWrapper.handlePerspective(this, state, cameraTransformType); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/bakery/BlockModelBakery.java b/dependencies/main/java/codechicken/lib/model/bakery/BlockModelBakery.java deleted file mode 100644 index 2ca6e1dbaf..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakery/BlockModelBakery.java +++ /dev/null @@ -1,628 +0,0 @@ -package codechicken.lib.model.bakery; - -import codechicken.lib.colour.Colour; -import codechicken.lib.colour.ColourRGBA; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.util.EnumFacing; - -import java.util.LinkedList; - -/** - * Created by covers1624 on 8/3/2016. - * TODO, Move the back end of this to the BakingVertexBuffer wrapped through the CCL render pipe. - */ -@Deprecated// Use CCModel.generateBlock(0, new Cuboid6()).apply -public class BlockModelBakery { - - public boolean flipTexture; - public boolean renderFromInside = false; - - public double renderMinX; - public double renderMaxX; - public double renderMinY; - public double renderMaxY; - public double renderMinZ; - public double renderMaxZ; - - public int uvRotateEast, uvRotateWest, uvRotateSouth, uvRotateNorth, uvRotateTop, uvRotateBottom; - - public Colour colourTopLeft = new ColourRGBA(0xFFFFFFFF); - public Colour colourBottomLeft = new ColourRGBA(0xFFFFFFFF); - public Colour colourBottomRight = new ColourRGBA(0xFFFFFFFF); - public Colour colourTopRight = new ColourRGBA(0xFFFFFFFF); - - private CCQuadBakery quadBakery; - private LinkedList quadList = new LinkedList(); - - public BlockModelBakery() { - this(DefaultVertexFormats.BLOCK); - } - - public BlockModelBakery(VertexFormat format) { - quadBakery = new CCQuadBakery(format, null); - reset(); - } - - public void reset() { - quadList.clear(); - colourTopLeft = new ColourRGBA(0xFFFFFFFF); - colourBottomLeft = new ColourRGBA(0xFFFFFFFF); - colourBottomRight = new ColourRGBA(0xFFFFFFFF); - colourTopRight = new ColourRGBA(0xFFFFFFFF); - - uvRotateEast = 0; - uvRotateWest = 0; - uvRotateSouth = 0; - uvRotateNorth = 0; - uvRotateTop = 0; - uvRotateBottom = 0; - - flipTexture = false; - renderFromInside = false; - - setRenderBounds(0.0, 0.0, 0.0, 1.0, 1.0, 1.0); - } - - public LinkedList finishBaking() { - return new LinkedList(quadList); - } - - public CCQuadBakery getQuadBakery() { - return quadBakery; - } - - public void setRenderBounds(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { - - this.renderMinX = minX; - this.renderMaxX = maxX; - this.renderMinY = minY; - this.renderMaxY = maxY; - this.renderMinZ = minZ; - this.renderMaxZ = maxZ; - - } - - public void bakeFace(TextureAtlasSprite sprite, EnumFacing face) { - switch (face) { - - case DOWN: - bakeFaceYNeg(sprite); - break; - case UP: - bakeFaceYPos(sprite); - break; - case NORTH: - bakeFaceZNeg(sprite); - break; - case SOUTH: - bakeFaceZPos(sprite); - break; - case WEST: - bakeFaceXNeg(sprite); - break; - case EAST: - bakeFaceXPos(sprite); - break; - } - } - - public void bakeFaceYNeg(TextureAtlasSprite sprite) { - bakeFaceYNeg(0, 0, 0, sprite); - } - - public void bakeFaceYNeg(double posX, double posY, double posZ, TextureAtlasSprite sprite) { - quadBakery.startBakingQuads().setSprite(sprite); - - double d3 = (double) sprite.getInterpolatedU(this.renderMinX * 16.0D); - double d4 = (double) sprite.getInterpolatedU(this.renderMaxX * 16.0D); - double d5 = (double) sprite.getInterpolatedV(this.renderMinZ * 16.0D); - double d6 = (double) sprite.getInterpolatedV(this.renderMaxZ * 16.0D); - double d7; - if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { - d3 = (double) sprite.getMinU(); - d4 = (double) sprite.getMaxU(); - } - - if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { - d5 = (double) sprite.getMinV(); - d6 = (double) sprite.getMaxV(); - } - - if (this.flipTexture) { - d7 = d3; - d3 = d4; - d4 = d7; - } - - d7 = d4; - double d8 = d3; - double d9 = d5; - double d10 = d6; - - if (this.uvRotateBottom == 2) { - d3 = (double) sprite.getInterpolatedU(this.renderMinZ * 16.0D); - d5 = (double) sprite.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); - d4 = (double) sprite.getInterpolatedU(this.renderMaxZ * 16.0D); - d6 = (double) sprite.getInterpolatedV(16.0D - this.renderMinX * 16.0D); - d9 = d5; - d10 = d6; - d7 = d3; - d8 = d4; - d5 = d6; - d6 = d9; - } else if (this.uvRotateBottom == 1) { - d3 = (double) sprite.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); - d5 = (double) sprite.getInterpolatedV(this.renderMinX * 16.0D); - d4 = (double) sprite.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); - d6 = (double) sprite.getInterpolatedV(this.renderMaxX * 16.0D); - d7 = d4; - d8 = d3; - d3 = d4; - d4 = d8; - d9 = d6; - d10 = d5; - } else if (this.uvRotateBottom == 3) { - d3 = (double) sprite.getInterpolatedU(16.0D - this.renderMinX * 16.0D); - d4 = (double) sprite.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); - d5 = (double) sprite.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); - d6 = (double) sprite.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); - d7 = d4; - d8 = d3; - d9 = d5; - d10 = d6; - } - - double d11 = posX + this.renderMinX; - double d12 = posX + this.renderMaxX; - double d13 = posY + this.renderMinY; - double d14 = posZ + this.renderMinZ; - double d15 = posZ + this.renderMaxZ; - - if (this.renderFromInside) { - d11 = posX + this.renderMaxX; - d12 = posX + this.renderMinX; - } - - quadBakery.setColour(colourTopLeft).addVertexWithUV(d11, d13, d15, d8, d10); - quadBakery.setColour(colourBottomLeft).addVertexWithUV(d11, d13, d14, d3, d5); - quadBakery.setColour(colourBottomRight).addVertexWithUV(d12, d13, d14, d7, d9); - quadBakery.setColour(colourTopRight).addVertexWithUV(d12, d13, d15, d4, d6); - - quadList.addAll(quadBakery.finishBaking()); - } - - public void bakeFaceYPos(TextureAtlasSprite sprite) { - bakeFaceYPos(0, 0, 0, sprite); - } - - public void bakeFaceYPos(double posX, double posY, double posZ, TextureAtlasSprite sprite) { - quadBakery.startBakingQuads().setSprite(sprite); - - double d3 = (double) sprite.getInterpolatedU(this.renderMinX * 16.0D); - double d4 = (double) sprite.getInterpolatedU(this.renderMaxX * 16.0D); - double d5 = (double) sprite.getInterpolatedV(this.renderMinZ * 16.0D); - double d6 = (double) sprite.getInterpolatedV(this.renderMaxZ * 16.0D); - double d7; - - if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { - d3 = (double) sprite.getMinU(); - d4 = (double) sprite.getMaxU(); - } - - if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { - d5 = (double) sprite.getMinV(); - d6 = (double) sprite.getMaxV(); - } - - if (this.flipTexture) { - d7 = d3; - d3 = d4; - d4 = d7; - } - - d7 = d4; - double d8 = d3; - double d9 = d5; - double d10 = d6; - - if (this.uvRotateTop == 1) { - d3 = (double) sprite.getInterpolatedU(this.renderMinZ * 16.0D); - d5 = (double) sprite.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); - d4 = (double) sprite.getInterpolatedU(this.renderMaxZ * 16.0D); - d6 = (double) sprite.getInterpolatedV(16.0D - this.renderMinX * 16.0D); - d9 = d5; - d10 = d6; - d7 = d3; - d8 = d4; - d5 = d6; - d6 = d9; - } else if (this.uvRotateTop == 2) { - d3 = (double) sprite.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); - d5 = (double) sprite.getInterpolatedV(this.renderMinX * 16.0D); - d4 = (double) sprite.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); - d6 = (double) sprite.getInterpolatedV(this.renderMaxX * 16.0D); - d7 = d4; - d8 = d3; - d3 = d4; - d4 = d8; - d9 = d6; - d10 = d5; - } else if (this.uvRotateTop == 3) { - d3 = (double) sprite.getInterpolatedU(16.0D - this.renderMinX * 16.0D); - d4 = (double) sprite.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); - d5 = (double) sprite.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); - d6 = (double) sprite.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); - d7 = d4; - d8 = d3; - d9 = d5; - d10 = d6; - } - - double d11 = posX + this.renderMinX; - double d12 = posX + this.renderMaxX; - double d13 = posY + this.renderMaxY; - double d14 = posZ + this.renderMinZ; - double d15 = posZ + this.renderMaxZ; - - if (this.renderFromInside) { - d11 = posX + this.renderMaxX; - d12 = posX + this.renderMinX; - } - - quadBakery.setColour(colourTopLeft).addVertexWithUV(d12, d13, d15, d4, d6); - quadBakery.setColour(colourBottomLeft).addVertexWithUV(d12, d13, d14, d7, d9); - quadBakery.setColour(colourBottomRight).addVertexWithUV(d11, d13, d14, d3, d5); - quadBakery.setColour(colourTopRight).addVertexWithUV(d11, d13, d15, d8, d10); - - quadList.addAll(quadBakery.finishBaking()); - } - - public void bakeFaceZNeg(TextureAtlasSprite sprite) { - bakeFaceZNeg(0, 0, 0, sprite); - } - - public void bakeFaceZNeg(double posX, double posY, double posZ, TextureAtlasSprite sprite) { - quadBakery.startBakingQuads().setSprite(sprite); - - double d3 = (double) sprite.getInterpolatedU(this.renderMinX * 16.0D); - double d4 = (double) sprite.getInterpolatedU(this.renderMaxX * 16.0D); - - double d5 = (double) sprite.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); - double d6 = (double) sprite.getInterpolatedV(16.0D - this.renderMinY * 16.0D); - double d7; - - if (this.flipTexture) { - d7 = d3; - d3 = d4; - d4 = d7; - } - - if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { - d3 = (double) sprite.getMinU(); - d4 = (double) sprite.getMaxU(); - } - - if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { - d5 = (double) sprite.getMinV(); - d6 = (double) sprite.getMaxV(); - } - - d7 = d4; - double d8 = d3; - double d9 = d5; - double d10 = d6; - - if (this.uvRotateEast == 2) { - d3 = (double) sprite.getInterpolatedU(this.renderMinY * 16.0D); - d4 = (double) sprite.getInterpolatedU(this.renderMaxY * 16.0D); - d5 = (double) sprite.getInterpolatedV(16.0D - this.renderMinX * 16.0D); - d6 = (double) sprite.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); - d9 = d5; - d10 = d6; - d7 = d3; - d8 = d4; - d5 = d6; - d6 = d9; - } else if (this.uvRotateEast == 1) { - d3 = (double) sprite.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); - d4 = (double) sprite.getInterpolatedU(16.0D - this.renderMinY * 16.0D); - d5 = (double) sprite.getInterpolatedV(this.renderMaxX * 16.0D); - d6 = (double) sprite.getInterpolatedV(this.renderMinX * 16.0D); - d7 = d4; - d8 = d3; - d3 = d4; - d4 = d8; - d9 = d6; - d10 = d5; - } else if (this.uvRotateEast == 3) { - d3 = (double) sprite.getInterpolatedU(16.0D - this.renderMinX * 16.0D); - d4 = (double) sprite.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); - d5 = (double) sprite.getInterpolatedV(this.renderMaxY * 16.0D); - d6 = (double) sprite.getInterpolatedV(this.renderMinY * 16.0D); - d7 = d4; - d8 = d3; - d9 = d5; - d10 = d6; - } - - double d11 = posX + this.renderMinX; - double d12 = posX + this.renderMaxX; - double d13 = posY + this.renderMinY; - double d14 = posY + this.renderMaxY; - double d15 = posZ + this.renderMinZ; - - if (this.renderFromInside) { - d11 = posX + this.renderMaxX; - d12 = posX + this.renderMinX; - } - - quadBakery.setColour(colourTopLeft).addVertexWithUV(d11, d14, d15, d7, d9); - quadBakery.setColour(colourBottomLeft).addVertexWithUV(d12, d14, d15, d3, d5); - quadBakery.setColour(colourBottomRight).addVertexWithUV(d12, d13, d15, d8, d10); - quadBakery.setColour(colourTopRight).addVertexWithUV(d11, d13, d15, d4, d6); - - quadList.addAll(quadBakery.finishBaking()); - } - - public void bakeFaceZPos(TextureAtlasSprite sprite) { - bakeFaceZPos(0, 0, 0, sprite); - } - - public void bakeFaceZPos(double posX, double posY, double posZ, TextureAtlasSprite sprite) { - quadBakery.startBakingQuads().setSprite(sprite); - - double d3 = (double) sprite.getInterpolatedU(this.renderMinX * 16.0D); - double d4 = (double) sprite.getInterpolatedU(this.renderMaxX * 16.0D); - double d5 = (double) sprite.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); - double d6 = (double) sprite.getInterpolatedV(16.0D - this.renderMinY * 16.0D); - double d7; - - if (this.flipTexture) { - d7 = d3; - d3 = d4; - d4 = d7; - } - - if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { - d3 = (double) sprite.getMinU(); - d4 = (double) sprite.getMaxU(); - } - - if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { - d5 = (double) sprite.getMinV(); - d6 = (double) sprite.getMaxV(); - } - - d7 = d4; - double d8 = d3; - double d9 = d5; - double d10 = d6; - - if (this.uvRotateWest == 1) { - d3 = (double) sprite.getInterpolatedU(this.renderMinY * 16.0D); - d6 = (double) sprite.getInterpolatedV(16.0D - this.renderMinX * 16.0D); - d4 = (double) sprite.getInterpolatedU(this.renderMaxY * 16.0D); - d5 = (double) sprite.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); - d9 = d5; - d10 = d6; - d7 = d3; - d8 = d4; - d5 = d6; - d6 = d9; - } else if (this.uvRotateWest == 2) { - d3 = (double) sprite.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); - d5 = (double) sprite.getInterpolatedV(this.renderMinX * 16.0D); - d4 = (double) sprite.getInterpolatedU(16.0D - this.renderMinY * 16.0D); - d6 = (double) sprite.getInterpolatedV(this.renderMaxX * 16.0D); - d7 = d4; - d8 = d3; - d3 = d4; - d4 = d8; - d9 = d6; - d10 = d5; - } else if (this.uvRotateWest == 3) { - d3 = (double) sprite.getInterpolatedU(16.0D - this.renderMinX * 16.0D); - d4 = (double) sprite.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); - d5 = (double) sprite.getInterpolatedV(this.renderMaxY * 16.0D); - d6 = (double) sprite.getInterpolatedV(this.renderMinY * 16.0D); - d7 = d4; - d8 = d3; - d9 = d5; - d10 = d6; - } - - double d11 = posX + this.renderMinX; - double d12 = posX + this.renderMaxX; - double d13 = posY + this.renderMinY; - double d14 = posY + this.renderMaxY; - double d15 = posZ + this.renderMaxZ; - - if (this.renderFromInside) { - d11 = posX + this.renderMaxX; - d12 = posX + this.renderMinX; - } - - quadBakery.setColour(colourTopLeft).addVertexWithUV(d11, d14, d15, d3, d5); - quadBakery.setColour(colourBottomLeft).addVertexWithUV(d11, d13, d15, d8, d10); - quadBakery.setColour(colourBottomRight).addVertexWithUV(d12, d13, d15, d4, d6); - quadBakery.setColour(colourTopRight).addVertexWithUV(d12, d14, d15, d7, d9); - - quadList.addAll(quadBakery.finishBaking()); - } - - public void bakeFaceXNeg(TextureAtlasSprite sprite) { - bakeFaceXNeg(0, 0, 0, sprite); - } - - public void bakeFaceXNeg(double posX, double posY, double posZ, TextureAtlasSprite sprite) { - quadBakery.startBakingQuads().setSprite(sprite); - - double d3 = (double) sprite.getInterpolatedU(this.renderMinZ * 16.0D); - double d4 = (double) sprite.getInterpolatedU(this.renderMaxZ * 16.0D); - double d5 = (double) sprite.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); - double d6 = (double) sprite.getInterpolatedV(16.0D - this.renderMinY * 16.0D); - double d7; - - if (this.flipTexture) { - d7 = d3; - d3 = d4; - d4 = d7; - } - - if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { - d3 = (double) sprite.getMinU(); - d4 = (double) sprite.getMaxU(); - } - - if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { - d5 = (double) sprite.getMinV(); - d6 = (double) sprite.getMaxV(); - } - - d7 = d4; - double d8 = d3; - double d9 = d5; - double d10 = d6; - - if (this.uvRotateNorth == 1) { - d3 = (double) sprite.getInterpolatedU(this.renderMinY * 16.0D); - d5 = (double) sprite.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); - d4 = (double) sprite.getInterpolatedU(this.renderMaxY * 16.0D); - d6 = (double) sprite.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); - d9 = d5; - d10 = d6; - d7 = d3; - d8 = d4; - d5 = d6; - d6 = d9; - } else if (this.uvRotateNorth == 2) { - d3 = (double) sprite.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); - d5 = (double) sprite.getInterpolatedV(this.renderMinZ * 16.0D); - d4 = (double) sprite.getInterpolatedU(16.0D - this.renderMinY * 16.0D); - d6 = (double) sprite.getInterpolatedV(this.renderMaxZ * 16.0D); - d7 = d4; - d8 = d3; - d3 = d4; - d4 = d8; - d9 = d6; - d10 = d5; - } else if (this.uvRotateNorth == 3) { - d3 = (double) sprite.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); - d4 = (double) sprite.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); - d5 = (double) sprite.getInterpolatedV(this.renderMaxY * 16.0D); - d6 = (double) sprite.getInterpolatedV(this.renderMinY * 16.0D); - d7 = d4; - d8 = d3; - d9 = d5; - d10 = d6; - } - - double d11 = posX + this.renderMinX; - double d12 = posY + this.renderMinY; - double d13 = posY + this.renderMaxY; - double d14 = posZ + this.renderMinZ; - double d15 = posZ + this.renderMaxZ; - - if (this.renderFromInside) { - d14 = posZ + this.renderMaxZ; - d15 = posZ + this.renderMinZ; - } - - quadBakery.setColour(colourTopLeft).addVertexWithUV(d11, d13, d15, d7, d9); - quadBakery.setColour(colourBottomLeft).addVertexWithUV(d11, d13, d14, d3, d5); - quadBakery.setColour(colourBottomRight).addVertexWithUV(d11, d12, d14, d8, d10); - quadBakery.setColour(colourTopRight).addVertexWithUV(d11, d12, d15, d4, d6); - - quadList.addAll(quadBakery.finishBaking()); - } - - public void bakeFaceXPos(TextureAtlasSprite sprite) { - bakeFaceXPos(0, 0, 0, sprite); - } - - public void bakeFaceXPos(double posX, double posY, double posZ, TextureAtlasSprite sprite) { - quadBakery.startBakingQuads().setSprite(sprite); - - double d3 = (double) sprite.getInterpolatedU(this.renderMinZ * 16.0D); - double d4 = (double) sprite.getInterpolatedU(this.renderMaxZ * 16.0D); - - double d5 = (double) sprite.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); - double d6 = (double) sprite.getInterpolatedV(16.0D - this.renderMinY * 16.0D); - double d7; - - if (this.flipTexture) { - d7 = d3; - d3 = d4; - d4 = d7; - } - - if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { - d3 = (double) sprite.getMinU(); - d4 = (double) sprite.getMaxU(); - } - - if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { - d5 = (double) sprite.getMinV(); - d6 = (double) sprite.getMaxV(); - } - - d7 = d4; - double d8 = d3; - double d9 = d5; - double d10 = d6; - - if (this.uvRotateSouth == 2) { - d3 = (double) sprite.getInterpolatedU(this.renderMinY * 16.0D); - d5 = (double) sprite.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); - d4 = (double) sprite.getInterpolatedU(this.renderMaxY * 16.0D); - d6 = (double) sprite.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); - d9 = d5; - d10 = d6; - d7 = d3; - d8 = d4; - d5 = d6; - d6 = d9; - } else if (this.uvRotateSouth == 1) { - d3 = (double) sprite.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); - d5 = (double) sprite.getInterpolatedV(this.renderMaxZ * 16.0D); - d4 = (double) sprite.getInterpolatedU(16.0D - this.renderMinY * 16.0D); - d6 = (double) sprite.getInterpolatedV(this.renderMinZ * 16.0D); - d7 = d4; - d8 = d3; - d3 = d4; - d4 = d8; - d9 = d6; - d10 = d5; - } else if (this.uvRotateSouth == 3) { - d3 = (double) sprite.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); - d4 = (double) sprite.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); - d5 = (double) sprite.getInterpolatedV(this.renderMaxY * 16.0D); - d6 = (double) sprite.getInterpolatedV(this.renderMinY * 16.0D); - d7 = d4; - d8 = d3; - d9 = d5; - d10 = d6; - } - - double d11 = posX + this.renderMaxX; - double d12 = posY + this.renderMinY; - double d13 = posY + this.renderMaxY; - double d14 = posZ + this.renderMinZ; - double d15 = posZ + this.renderMaxZ; - - if (this.renderFromInside) { - d14 = posZ + this.renderMaxZ; - d15 = posZ + this.renderMinZ; - } - - quadBakery.setColour(colourTopLeft).addVertexWithUV(d11, d12, d15, d8, d10); - quadBakery.setColour(colourBottomLeft).addVertexWithUV(d11, d12, d14, d4, d6); - quadBakery.setColour(colourBottomRight).addVertexWithUV(d11, d13, d14, d7, d9); - quadBakery.setColour(colourTopRight).addVertexWithUV(d11, d13, d15, d3, d5); - - quadList.addAll(quadBakery.finishBaking()); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/bakery/CCModelBakery.java b/dependencies/main/java/codechicken/lib/model/bakery/CCModelBakery.java deleted file mode 100644 index 888de94afd..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakery/CCModelBakery.java +++ /dev/null @@ -1,96 +0,0 @@ -package codechicken.lib.model.bakery; - -import codechicken.lib.render.CCModel; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.buffer.BakingVertexBuffer; -import codechicken.lib.render.pipeline.IVertexOperation; -import codechicken.lib.render.pipeline.IVertexSource; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.client.renderer.vertex.VertexFormat; - -import java.util.List; - -/** - * Created by covers1624 on 8/20/2016. - * Uses the CCL RenderPipe to bake a CCModel to an array of BakedQuads with the provided VertexFormat. - */ -@Deprecated// Use CCRenderState with a BakingVertexBuffer bound. -public class CCModelBakery { - - /** - * Bakes a CCModel to a List of BakedQuads. - * Assumes DefaultVertexFormats.BLOCK. - * Assumes you want to bake the entire model. - * - * @param model Model to bake. - * @param ops Any Operations to apply. - * @return The BakedQuads for the model. - */ - public static List bakeModel(CCModel model, IVertexOperation... ops) { - return bakeModel(model, 0, model.getVertices().length, ops); - } - - /** - * Bakes a CCModel to a List of BakedQuads. - * Assumes DefaultVertexFormats.BLOCK. - * - * @param model Model to bake. - * @param start The first vertex index to bake. - * @param end The Vertex index to bake until. - * @param ops Any Operations to apply. - * @return The BakedQuads for the model. - */ - public static List bakeModel(CCModel model, int start, int end, IVertexOperation... ops) { - return bakeModel(model, DefaultVertexFormats.ITEM, start, end, ops); - } - - /** - * Bakes a CCModel to a List of BakedQuads. - * Assumes you want to bake the entire model. - * - * @param model Model to bake. - * @param format VertexFormat to bake to. - * @param ops Any Operations to apply. - * @return The BakedQuads for the model. - */ - public static List bakeModel(CCModel model, VertexFormat format, IVertexOperation... ops) { - return bakeModel(model, format, 0, model.getVertices().length, ops); - } - - /** - * Bakes a IVertexSource model to a List of BakedQuads. - * - * @param model Vertex source to bake. - * @param format VertexFormat to bake to. - * @param start The first vertex index to bake. - * @param end The Vertex index to bake until. - * @param ops Any Operations to apply. - * @return The BakedQuads for the model. - */ - public static List bakeModel(CCModel model, VertexFormat format, int start, int end, IVertexOperation... ops) { - return bakeModel(model, model.vp == 3, format, start, end, ops); - } - - /** - * Bakes a IVertexSource model to a List of BakedQuads. - * - * @param model Vertex source to bake. - * @param isTriangles Specifies if the model's vertices are triangles. - * @param format VertexFormat to bake to, You almost always want this to be ITEM. - * @param start The first vertex index to bake. - * @param end The Vertex index to bake until. - * @param ops Any Operations to apply. - * @return The BakedQuads for the model. - */ - public static List bakeModel(IVertexSource model, boolean isTriangles, VertexFormat format, int start, int end, IVertexOperation... ops) { - BakingVertexBuffer buffer = BakingVertexBuffer.create(); - buffer.begin(isTriangles ? 4 : 7, format); - CCRenderState ccrs = CCRenderState.instance(); - ccrs.bind(buffer); - ccrs.setPipeline(model, start, end, ops); - ccrs.render(); - buffer.finishDrawing(); - return buffer.bake(); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/bakery/CCQuad.java b/dependencies/main/java/codechicken/lib/model/bakery/CCQuad.java deleted file mode 100644 index 09a5511b5b..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakery/CCQuad.java +++ /dev/null @@ -1,309 +0,0 @@ -package codechicken.lib.model.bakery; - -import codechicken.lib.colour.Colour; -import codechicken.lib.colour.ColourRGBA; -import codechicken.lib.util.ArrayUtils; -import codechicken.lib.util.Copyable; -import codechicken.lib.util.VectorUtils; -import codechicken.lib.vec.Transformation; -import codechicken.lib.vec.Vector3; -import codechicken.lib.vec.Vertex5; -import codechicken.lib.vec.uv.UV; -import codechicken.lib.vec.uv.UVTransformation; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.client.renderer.vertex.VertexFormatElement; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.client.model.pipeline.IVertexConsumer; -import net.minecraftforge.client.model.pipeline.IVertexProducer; -import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad; - -import java.util.LinkedList; -import java.util.List; - -/** - * Created by covers1624 on 8/20/2016. - * Basically just a holder for quads before baking. - */ -public class CCQuad implements Copyable, IVertexProducer { - - public Vertex5[] vertices = new Vertex5[4]; - public Vector3[] normals = new Vector3[4]; - public Colour[] colours = new Colour[4]; - public Integer[] lightMaps = new Integer[4]; - - public EnumFacing face = null; - public int tintIndex = -1; - public boolean applyDifuseLighting = true; - public TextureAtlasSprite sprite; - - public CCQuad() { - } - - public CCQuad(Vertex5... vertices) { - if (vertices.length > 4) { - throw new IllegalArgumentException("CCQuad is a... Quad.. only 3 or 4 vertices allowed!"); - } - for (int i = 0; i < 4; i++) { - this.vertices[i] = vertices[i].copy(); - } - } - - public CCQuad(BakedQuad quad) { - this(); - - VertexFormat format = quad.getFormat(); - face = quad.getFace(); - tintIndex = quad.getTintIndex(); - sprite = quad.getSprite(); - ArrayUtils.fillArray(vertices, new Vertex5()); - UnpackingVertexConsumer consumer = new UnpackingVertexConsumer(quad.getFormat()); - quad.pipe(consumer); - float[][][] unpackedData = consumer.getUnpackedData(); - for (int v = 0; v < 4; v++) { - for (int e = 0; e < format.getElementCount(); e++) { - float[] data = unpackedData[v][e]; - switch (format.getElement(e).getUsage()) { - case POSITION: - vertices[v].vec.set(data); - break; - case NORMAL: - normals[v] = new Vector3(data); - break; - case COLOR: - colours[v] = new ColourRGBA(data[0], data[1], data[2], data[3]); - break; - case UV: - if (format.getElement(e).getIndex() == 0) { - vertices[v].uv.set(data[0], data[1]); - } else {//TODO This SHOULD be fine..... - lightMaps[v] = (int) (data[1] * 65535 / 32) << 20 | (int) (data[0] * 65535 / 32) << 4; - } - break; - default: - break; - } - } - } - if (!format.hasColor()) { - ArrayUtils.fillArray(colours, new ColourRGBA(0xFFFFFFFF)); - } - if (!format.hasUvOffset(1)) { - ArrayUtils.fillArray(lightMaps, 0); - } - if (!format.hasNormal()) { - computeNormals(); - } - } - - public CCQuad(CCQuad quad) { - this(); - for (int i = 0; i < vertices.length; i++) { - vertices[i] = quad.vertices[i].copy(); - } - for (int i = 0; i < vertices.length; i++) { - normals[i] = quad.normals[i].copy(); - } - for (int i = 0; i < vertices.length; i++) { - colours[i] = quad.colours[i].copy(); - } - System.arraycopy(quad.lightMaps, 0, lightMaps, 0, vertices.length); - face = quad.face; - tintIndex = quad.tintIndex; - applyDifuseLighting = quad.applyDifuseLighting; - sprite = quad.sprite; - } - - public void apply(Transformation... transforms) { - for (Transformation t : transforms) { - apply(t); - } - } - - public void apply(UVTransformation... transforms) { - for (UVTransformation t : transforms) { - apply(t); - } - } - - public void apply(Transformation t) { - quadulate(); - if (ArrayUtils.countNoNull(normals) != 4) { - computeNormals(); - } - for (int i = 0; i < 4; i++) { - Vertex5 vert = vertices[i]; - Vector3 normal = normals[i]; - t.apply(vert.vec); - t.applyN(normal); - } - } - - public void apply(UVTransformation t) { - quadulate(); - for (int i = 0; i < 4; i++) { - Vertex5 vert = vertices[i]; - t.apply(vert.uv); - } - } - - public boolean isQuads() { - int counter = ArrayUtils.countNoNull(vertices); - return counter == 4; - } - - public boolean hasTint() { - return tintIndex != -1; - } - - /** - * Quadulates the quad by copying any element at index 2 to index 3 only if there are 3 of any given element. - */ - public void quadulate() { - int verticesCount = ArrayUtils.countNoNull(vertices); - int normalCount = ArrayUtils.countNoNull(normals); - int colourCount = ArrayUtils.countNoNull(colours); - int lightMapCount = ArrayUtils.countNoNull(lightMaps); - if (verticesCount == 3) { - vertices[3] = vertices[2].copy(); - } - if (normalCount == 3) { - normals[3] = normals[2].copy(); - } - if (colourCount == 3) { - colours[3] = colours[2].copy(); - } - if (lightMapCount == 3) { - lightMaps[3] = lightMaps[2]; - } - } - - /** - * Creates a set of normals for the quad. - * Will attempt to Quadulate the model first. - */ - public void computeNormals() { - if (ArrayUtils.countNoNull(normals) != 4) { - quadulate(); - Vector3 normal = VectorUtils.calculateNormal(vertices[0].vec, vertices[1].vec, vertices[3].vec); - - for (int i = 0; i < 4; i++) { - normals[i] = normal.copy(); - } - } - } - - public EnumFacing getQuadFace() { - if (face == null) { - if (ArrayUtils.countNoNull(normals) != 4) { - computeNormals(); - } - face = VectorUtils.calcNormalSide(normals[0]); - } - return face; - } - - public BakedQuad bake() { - return bake(DefaultVertexFormats.BLOCK); - } - - public BakedQuad bake(VertexFormat format) { - quadulate(); - computeNormals(); - UnpackedBakedQuad.Builder quadBuilder = new UnpackedBakedQuad.Builder(format); - quadBuilder.setApplyDiffuseLighting(applyDifuseLighting); - quadBuilder.setTexture(sprite); - quadBuilder.setQuadOrientation(getQuadFace()); - quadBuilder.setQuadTint(tintIndex); - for (int v = 0; v < 4; v++) { - for (int e = 0; e < format.getElementCount(); e++) { - VertexFormatElement element = format.getElement(e); - switch (element.getUsage()) { - case POSITION: - Vector3 pos = vertices[v].vec; - quadBuilder.put(e, (float) pos.x, (float) pos.y, (float) pos.z, 1); - break; - case NORMAL: - Vector3 normal = normals[v]; - quadBuilder.put(e, (float) normal.x, (float) normal.y, (float) normal.z, 0); - break; - case COLOR: - Colour colour = colours[v]; - quadBuilder.put(e, (colour.r & 0xFF) / 255, (colour.g & 0xFF) / 255, (colour.b & 0xFF) / 255, (colour.a & 0xFF) / 255); - break; - case UV: - if (element.getIndex() == 0) { - UV uv = vertices[v].uv; - quadBuilder.put(e, (float) uv.u, (float) uv.v, 0, 1); - } else { - int brightness = lightMaps[v]; - quadBuilder.put(e, (float) ((brightness >> 4) & 15 * 32) / 65535, (float) ((brightness >> 20) & 15 * 32) / 65535, 0, 1); - } - break; - case PADDING: - case GENERIC: - default: - quadBuilder.put(e); - } - } - } - return quadBuilder.build(); - } - - @Override - public void pipe(IVertexConsumer consumer) { - quadulate(); - computeNormals(); - consumer.setApplyDiffuseLighting(applyDifuseLighting); - consumer.setTexture(sprite); - consumer.setQuadOrientation(getQuadFace()); - consumer.setQuadTint(tintIndex); - for (int v = 0; v < 4; v++) { - for (int e = 0; e < consumer.getVertexFormat().getElementCount(); e++) { - VertexFormatElement element = consumer.getVertexFormat().getElement(e); - switch (element.getUsage()) { - case POSITION: - Vector3 pos = vertices[v].vec; - consumer.put(e, (float) pos.x, (float) pos.y, (float) pos.z, 1); - break; - case NORMAL: - Vector3 normal = normals[v]; - consumer.put(e, (float) normal.x, (float) normal.y, (float) normal.z, 0); - break; - case COLOR: - Colour colour = colours[v]; - consumer.put(e, (colour.r & 0xFF) / 255, (colour.g & 0xFF) / 255, (colour.b & 0xFF) / 255, (colour.a & 0xFF) / 255); - break; - case UV: - if (element.getIndex() == 0) { - UV uv = vertices[v].uv; - consumer.put(e, (float) uv.u, (float) uv.v, 0, 1); - } else { - int brightness = lightMaps[v]; - consumer.put(e, (float) ((brightness >> 4) & 15 * 32) / 65535, (float) ((brightness >> 20) & 15 * 32) / 65535, 0, 1); - } - break; - case PADDING: - case GENERIC: - default: - consumer.put(e); - } - } - } - } - - public static List fromArray(List bakedQuads) { - List quads = new LinkedList(); - for (BakedQuad quad : bakedQuads) { - quads.add(new CCQuad(quad)); - } - return quads; - } - - @Override - public CCQuad copy() { - return new CCQuad(this); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/bakery/CCQuadBakery.java b/dependencies/main/java/codechicken/lib/model/bakery/CCQuadBakery.java deleted file mode 100644 index 7b66783ef1..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakery/CCQuadBakery.java +++ /dev/null @@ -1,202 +0,0 @@ -package codechicken.lib.model.bakery; - -import codechicken.lib.colour.Colour; -import codechicken.lib.colour.ColourRGBA; -import codechicken.lib.vec.Vector3; -import codechicken.lib.vec.Vertex5; -import codechicken.lib.vec.uv.UV; -import com.google.common.collect.ImmutableList; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.util.EnumFacing; - -import java.util.LinkedList; - -/** - * Created by covers1624 on 8/2/2016. - * Bakes Quads.. - */ -@Deprecated//TODO a Tessellator style BakingVertexBuffer. -public class CCQuadBakery { - - private VertexFormat format; - private TextureAtlasSprite sprite; - private EnumFacing face; - - //Temp storage - private UV uv = new UV(); - private Vector3 normal = null; - private Colour colour = new ColourRGBA(0xFFFFFFFF); - private int brightness = 0; - - private boolean isBakingTriModel = false; - private boolean applyDifuseLighting = true; - private LinkedList bakedQuads = null; - - //Active storage. - private CCQuad quad = null; - private int index = 0; - - public CCQuadBakery(TextureAtlasSprite sprite) { - this(DefaultVertexFormats.BLOCK, sprite); - } - - public CCQuadBakery(VertexFormat format, TextureAtlasSprite sprite) { - this.format = format; - this.sprite = sprite; - } - - public CCQuadBakery startBakingQuads() { - return startBaking(false); - } - - public CCQuadBakery startBakingTriangles() { - return startBaking(true); - } - - //TODO Have the QuadBakery bake from any DrawMode to any DrawMode and from any VertexFormat to any VertexFormat. - //TODO Maybe a custom BakedQuad that holds all the raw info still, might make it more possible / cleaner for a VF > VF converter. - private CCQuadBakery startBaking(boolean isTriangles) { - if (quad != null || bakedQuads != null) { - throw new IllegalStateException("Quads are still baking or baking has not finished yet!"); - } - isBakingTriModel = isTriangles; - bakedQuads = new LinkedList(); - return this; - } - - public ImmutableList finishBaking() { - if (quad != null) { - throw new IllegalStateException("Quads are still baking!"); - } - if (bakedQuads == null) { - throw new IllegalStateException("The bakery has no baked quads!"); - } - ImmutableList returnQuads = ImmutableList.copyOf(bakedQuads); - reset(); - return returnQuads; - } - - public boolean hasIncompleteQuad() { - return quad != null; - } - - public void reset() { - applyDifuseLighting = true; - isBakingTriModel = false; - bakedQuads = null; - quad = null; - index = 0; - } - - public CCQuadBakery setSprite(TextureAtlasSprite sprite) { - if (this.sprite == sprite) { - return this; - } - if (quad != null) { - throw new IllegalStateException("Unable to set sprite whilst quad is still baking!"); - } - this.sprite = sprite; - return this; - } - - public CCQuadBakery setFace(EnumFacing face) { - if (quad != null) { - throw new IllegalStateException("Unable to set face whilst quad is still baking!"); - } - this.face = face; - return this; - } - - public CCQuadBakery disableDifuseLighting() { - return setDifuseLightingState(false); - } - - public CCQuadBakery setDifuseLightingState(boolean state) { - applyDifuseLighting = state; - return this; - } - - public CCQuadBakery setColour(int colour) { - return setColour(new ColourRGBA(colour)); - } - - public CCQuadBakery setColour(Colour colour) { - this.colour = colour.copy(); - return this; - } - - public CCQuadBakery setLightMap(int brightness) { - this.brightness = brightness; - return this; - //return setLightMap(new UV((double) ((brightness >> 4) & 15 * 32) / 65535, (double) ((brightness >> 20) & 15 * 32) / 65535)); - } - - public CCQuadBakery setNormal(Vector3 normal) { - this.normal = normal; - return this; - } - - public CCQuadBakery setUV(double u, double v) { - return setUV(new UV(u, v)); - } - - public CCQuadBakery setUV(UV uv) { - this.uv = uv.copy(); - return this; - } - - public CCQuadBakery addVertexWithUV(Vector3 vertex, double u, double v) { - return addVertexWithUV(vertex, new UV(u, v)); - } - - public CCQuadBakery addVertexWithUV(double x, double y, double z, UV uv) { - return addVertexWithUV(new Vector3(x, y, z), uv); - } - - public CCQuadBakery addVertexWithUV(double x, double y, double z, double u, double v) { - return addVertexWithUV(new Vector3(x, y, z), new UV(u, v)); - } - - public CCQuadBakery addVertexWithUV(Vector3 vertex, UV uv) { - return addVertexWithUV(new Vertex5(vertex, uv)); - } - - public CCQuadBakery addVertexWithUV(Vertex5 vertex) { - setUV(vertex.uv); - return addVertex(vertex.vec); - } - - public CCQuadBakery addVertex(double x, double y, double z) { - return addVertex(new Vector3(x, y, z)); - } - - public CCQuadBakery addVertex(Vector3 vertex) { - if (quad == null) { - quad = new CCQuad(); - if (face != null) { - quad.face = face; - } - quad.sprite = sprite; - quad.applyDifuseLighting = applyDifuseLighting; - index = 0; - } - quad.vertices[index] = new Vertex5(vertex.copy(), uv.copy()); - quad.normals[index] = normal != null ? normal.copy() : null; - quad.colours[index] = colour.copy(); - quad.lightMaps[index] = brightness; - index++; - - int max = isBakingTriModel ? 3 : 4; - - if (index == max) { - index = 0; - bakedQuads.add(quad.bake(format)); - quad = null; - } - return this; - } - -} diff --git a/dependencies/main/java/codechicken/lib/model/bakery/ItemModelBakery.java b/dependencies/main/java/codechicken/lib/model/bakery/ItemModelBakery.java deleted file mode 100644 index e8b847cc83..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakery/ItemModelBakery.java +++ /dev/null @@ -1,42 +0,0 @@ -package codechicken.lib.model.bakery; - -import codechicken.lib.util.TransformUtils; -import com.google.common.base.Optional; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraftforge.client.model.ItemLayerModel; -import net.minecraftforge.common.model.IModelPart; -import net.minecraftforge.common.model.IModelState; - -import java.util.LinkedList; -import java.util.List; - -/** - * Created by covers1624 on 13/02/2017. - */ -public class ItemModelBakery { - - public static List bakeItem(List sprites) { - return bakeItem(sprites, DefaultVertexFormats.ITEM, TransformUtils.DEFAULT_ITEM); - } - - public static List bakeItem(List sprites, IModelState state) { - return bakeItem(sprites, DefaultVertexFormats.ITEM, state); - } - - public static List bakeItem(List sprites, VertexFormat format) { - return bakeItem(sprites, format, TransformUtils.DEFAULT_ITEM); - } - - public static List bakeItem(List sprites, VertexFormat format, IModelState state) { - List quads = new LinkedList(); - for (int i = 0; i < sprites.size(); i++) { - TextureAtlasSprite sprite = sprites.get(i); - quads.addAll(ItemLayerModel.getQuadsForSprite(i, sprite, format, state.apply(Optional.absent()))); - } - return quads; - } - -} diff --git a/dependencies/main/java/codechicken/lib/model/bakery/PlanarFaceBakery.java b/dependencies/main/java/codechicken/lib/model/bakery/PlanarFaceBakery.java deleted file mode 100644 index c95f8b34f3..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakery/PlanarFaceBakery.java +++ /dev/null @@ -1,227 +0,0 @@ -package codechicken.lib.model.bakery; - -import codechicken.lib.colour.Colour; -import codechicken.lib.colour.ColourRGBA; -import codechicken.lib.util.VertexDataUtils; -import codechicken.lib.vec.Cuboid6; -import codechicken.lib.vec.Vector3; -import codechicken.lib.vec.Vertex5; -import codechicken.lib.vec.uv.IconTransformation; -import codechicken.lib.vec.uv.UV; -import codechicken.lib.vec.uv.UVTransformation; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.client.renderer.vertex.VertexFormatElement; -import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.client.model.pipeline.LightUtil; -import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad; - -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; - -/** - * Created by covers1624 on 26/10/2016. - */ -//TODO General cleanup. -public class PlanarFaceBakery { - - public static BakedQuad bakeFace(EnumFacing face, TextureAtlasSprite sprite) { - return bakeFace(face, sprite, DefaultVertexFormats.ITEM); - } - - public static BakedQuad bakeFace(EnumFacing face, TextureAtlasSprite sprite, VertexFormat format) { - return bakeFace(face, sprite, format, 0xFFFFFFFF); - } - - public static BakedQuad bakeFace(EnumFacing face, TextureAtlasSprite sprite, VertexFormat format, int colour) { - return bakeFace(face, sprite, format, new ColourRGBA(colour)); - } - - public static BakedQuad bakeFace(EnumFacing face, TextureAtlasSprite sprite, VertexFormat format, Colour colour) { - UVTransformation t = new IconTransformation(sprite); - - double x1 = Cuboid6.full.min.x; - double x2 = Cuboid6.full.max.x; - double y1 = Cuboid6.full.min.y; - double y2 = Cuboid6.full.max.y; - double z1 = Cuboid6.full.min.z; - double z2 = Cuboid6.full.max.z; - double u1; - double u2; - double v1; - double v2; - Vertex5 vert1; - Vertex5 vert2; - Vertex5 vert3; - Vertex5 vert4; - - switch (face) { - case DOWN: - u1 = x1; - v1 = z1; - u2 = x2; - v2 = z2; - vert1 = new Vertex5(x1, y1, z2, u1, v2); - vert2 = new Vertex5(x1, y1, z1, u1, v1); - vert3 = new Vertex5(x2, y1, z1, u2, v1); - vert4 = new Vertex5(x2, y1, z2, u2, v2); - return buildQuad(format, sprite, face, colour, t, vert1, vert2, vert3, vert4); - case UP: - u1 = x1; - v1 = z1; - u2 = x2; - v2 = z2; - vert1 = new Vertex5(x2, y2, z2, u2, v2); - vert2 = new Vertex5(x2, y2, z1, u2, v1); - vert3 = new Vertex5(x1, y2, z1, u1, v1); - vert4 = new Vertex5(x1, y2, z2, u1, v2); - return buildQuad(format, sprite, face, colour, t, vert1, vert2, vert3, vert4); - case NORTH: - u1 = 1 - x1; - v1 = 1 - y2; - u2 = 1 - x2; - v2 = 1 - y1; - vert1 = new Vertex5(x1, y1, z1, u1, v2); - vert2 = new Vertex5(x1, y2, z1, u1, v1); - vert3 = new Vertex5(x2, y2, z1, u2, v1); - vert4 = new Vertex5(x2, y1, z1, u2, v2); - return buildQuad(format, sprite, face, colour, t, vert1, vert2, vert3, vert4); - case SOUTH: - u1 = x1; - v1 = 1 - y2; - u2 = x2; - v2 = 1 - y1; - vert1 = new Vertex5(x2, y1, z2, u2, v2); - vert2 = new Vertex5(x2, y2, z2, u2, v1); - vert3 = new Vertex5(x1, y2, z2, u1, v1); - vert4 = new Vertex5(x1, y1, z2, u1, v2); - return buildQuad(format, sprite, face, colour, t, vert1, vert2, vert3, vert4); - case WEST: - u1 = z1; - v1 = 1 - y2; - u2 = z2; - v2 = 1 - y1; - vert1 = new Vertex5(x1, y1, z2, u2, v2); - vert2 = new Vertex5(x1, y2, z2, u2, v1); - vert3 = new Vertex5(x1, y2, z1, u1, v1); - vert4 = new Vertex5(x1, y1, z1, u1, v2); - return buildQuad(format, sprite, face, colour, t, vert1, vert2, vert3, vert4); - - case EAST: - u1 = 1 - z1; - v1 = 1 - y2; - u2 = 1 - z2; - v2 = 1 - y1; - vert1 = new Vertex5(x2, y1, z1, u1, v2); - vert2 = new Vertex5(x2, y2, z1, u1, v1); - vert3 = new Vertex5(x2, y2, z2, u2, v1); - vert4 = new Vertex5(x2, y1, z2, u2, v2); - return buildQuad(format, sprite, face, colour, t, vert1, vert2, vert3, vert4); - } - //This case will never happen. only here due to INTELLIJ NOT SHUTTING UP ABOUT POTENTIAL NULLPOINTERS! - return new BakedQuad(null, 1, null, null, true, null); - } - - private static BakedQuad buildQuad(VertexFormat format, TextureAtlasSprite sprite, EnumFacing face, Colour colour, UVTransformation t, Vertex5 v1, Vertex5 v2, Vertex5 v3, Vertex5 v4) { - UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(format); - builder.setQuadTint(-1); - builder.setQuadOrientation(face); - builder.setTexture(sprite); - - t.apply(v1.uv); - t.apply(v2.uv); - t.apply(v3.uv); - t.apply(v4.uv); - putVertex(builder, format, face, v1, colour); - putVertex(builder, format, face, v2, colour); - putVertex(builder, format, face, v3, colour); - putVertex(builder, format, face, v4, colour); - - return VertexDataUtils.copyQuad(builder.build()); - } - - private static void putVertex(UnpackedBakedQuad.Builder builder, VertexFormat format, EnumFacing face, Vertex5 vert, Colour colour) { - for (int e = 0; e < format.getElementCount(); e++) { - VertexFormatElement element = format.getElement(e); - switch (element.getUsage()) { - - case POSITION: - Vector3 vec = vert.vec; - builder.put(e, (float) vec.x, (float) vec.y, (float) vec.z, 1); - break; - case NORMAL: - builder.put(e, face.getFrontOffsetX(), face.getFrontOffsetY(), face.getFrontOffsetZ(), 0); - break; - case COLOR: - builder.put(e, (colour.r & 0xFF) / 255F, (colour.g & 0xFF) / 255F, (colour.b & 0xFF) / 255F, (colour.a & 0xFF) / 255F); - break; - case UV: - UV uv = vert.uv; - builder.put(e, (float) uv.u, (float) uv.v, 0, 1); - break; - default: - builder.put(e); - break; - } - } - } - - public static List shadeQuadFaces(BakedQuad... quads) { - return shadeQuadFaces(Arrays.asList(quads)); - } - - public static List shadeQuadFaces(List quads) { - LinkedList shadedQuads = new LinkedList(); - for (BakedQuad quad : quads) { - int[] rawData = quad.getVertexData(); - for (int v = 0; v < 4; v++) { - for (int e = 0; e < quad.getFormat().getElementCount(); e++) { - VertexFormatElement element = quad.getFormat().getElement(e); - if (element.getUsage() == EnumUsage.COLOR) { - float[] data = new float[4]; - LightUtil.unpack(rawData, data, quad.getFormat(), v, e); - - data = diffuseFaceLight(quad.getFace(), data); - - LightUtil.pack(data, rawData, quad.getFormat(), v, e); - } - } - } - shadedQuads.add(new BakedQuad(rawData, quad.getTintIndex(), quad.getFace(), quad.getSprite(), quad.shouldApplyDiffuseLighting(), quad.getFormat())); - } - - return shadedQuads; - } - - private static float[] diffuseFaceLight(EnumFacing face, float[] colour) { - double diffuse; - switch (face) { - case DOWN: - diffuse = 0.5D; - break; - case NORTH: - case SOUTH: - diffuse = 0.8D; - break; - case WEST: - case EAST: - diffuse = 0.6D; - break; - case UP: - default: - diffuse = 1.0D; - break; - } - - colour[0] *= diffuse; - colour[1] *= diffuse; - colour[2] *= diffuse; - - return colour; - } - -} diff --git a/dependencies/main/java/codechicken/lib/model/bakery/SimplePerspectiveAwareLayerModelBakery.java b/dependencies/main/java/codechicken/lib/model/bakery/SimplePerspectiveAwareLayerModelBakery.java deleted file mode 100644 index 74820a10f2..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakery/SimplePerspectiveAwareLayerModelBakery.java +++ /dev/null @@ -1,40 +0,0 @@ -package codechicken.lib.model.bakery; - -import codechicken.lib.model.BakedModelProperties; -import codechicken.lib.model.bakedmodels.PerspectiveAwareBakedModel; -import codechicken.lib.texture.TextureUtils; -import com.google.common.collect.ImmutableList; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.ItemLayerModel; -import net.minecraftforge.common.model.IModelState; - -import java.util.Arrays; - -/** - * Created by covers1624 on 7/25/2016. - */ -//TODO Find better name and integrate with IModel / Jsons. -public class SimplePerspectiveAwareLayerModelBakery { - - private final ResourceLocation baseTexture; - private final ResourceLocation[] layers; - - public SimplePerspectiveAwareLayerModelBakery(ResourceLocation baseTexture, ResourceLocation... layers) { - this.baseTexture = baseTexture; - this.layers = layers; - } - - public IBakedModel bake(IModelState state) { - - ImmutableList.Builder quadBuilder = ImmutableList.builder(); - ImmutableList textureLayers = ImmutableList.builder().add(baseTexture).addAll(Arrays.asList(layers)).build(); - - IBakedModel layerModel = new ItemLayerModel(textureLayers).bake(state, DefaultVertexFormats.ITEM, TextureUtils.bakedTextureGetter); - quadBuilder.addAll(layerModel.getQuads(null, null, 0)); - - return new PerspectiveAwareBakedModel(quadBuilder.build(), state, BakedModelProperties.createFromModel(layerModel)); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/bakery/UnpackingVertexConsumer.java b/dependencies/main/java/codechicken/lib/model/bakery/UnpackingVertexConsumer.java deleted file mode 100644 index d294c5a059..0000000000 --- a/dependencies/main/java/codechicken/lib/model/bakery/UnpackingVertexConsumer.java +++ /dev/null @@ -1,66 +0,0 @@ -package codechicken.lib.model.bakery; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.client.model.pipeline.IVertexConsumer; - -/** - * Created by covers1624 on 5/11/2016. - * TODO Document. - */ -public class UnpackingVertexConsumer implements IVertexConsumer { - - public int tintIndex; - public EnumFacing face; - public VertexFormat format; - public boolean applyDiffuesLight; - public TextureAtlasSprite sprite; - - public float[][][] unpackedData; - - private int vertices = 0; - - public UnpackingVertexConsumer(VertexFormat format) { - this.format = format; - unpackedData = new float[4][format.getElementCount()][4]; - } - - @Override - public VertexFormat getVertexFormat() { - return format; - } - - @Override - public void setQuadTint(int tint) { - tintIndex = tint; - } - - @Override - public void setQuadOrientation(EnumFacing orientation) { - face = orientation; - } - - @Override - public void setApplyDiffuseLighting(boolean diffuse) { - applyDiffuesLight = diffuse; - } - - @Override - public void setTexture(TextureAtlasSprite texture) { - sprite = texture; - } - - @Override - public void put(int element, float... data) { - System.arraycopy(data, 0, unpackedData[vertices][element], 0, data.length); - if (element == getVertexFormat().getElementCount() - 1) { - vertices++; - } - } - - public float[][][] getUnpackedData() { - return unpackedData; - } - -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/BlockBakery.java b/dependencies/main/java/codechicken/lib/model/blockbakery/BlockBakery.java deleted file mode 100644 index eff3d97101..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/BlockBakery.java +++ /dev/null @@ -1,343 +0,0 @@ -package codechicken.lib.model.blockbakery; - -import codechicken.lib.model.BakedModelProperties; -import codechicken.lib.model.ModelRegistryHelper; -import codechicken.lib.model.ModelRegistryHelper.IModelBakeCallback; -import codechicken.lib.model.PerspectiveAwareModelProperties; -import codechicken.lib.model.bakedmodels.PerspectiveAwareBakedModel; -import codechicken.lib.model.bakedmodels.PerspectiveAwareLayeredModel; -import codechicken.lib.model.bakery.PlanarFaceBakery; -import codechicken.lib.texture.IItemBlockTextureProvider; -import codechicken.lib.texture.IWorldBlockTextureProvider; -import codechicken.lib.texture.TextureUtils; -import codechicken.lib.util.TransformUtils; -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.client.resources.IResourceManager; -import net.minecraft.client.resources.IResourceManagerReloadListener; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.registry.IRegistry; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.client.model.ModelLoaderRegistry; -import net.minecraftforge.common.property.IExtendedBlockState; -import net.minecraftforge.fml.common.FMLLog; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; - -/** - * Created by covers1624 on 25/10/2016. - */ -//TODO, We need a hook for CCRenderItem to allow switching the model being rendered on ItemOverrideList.handleItemState, possibly an interface. -//TODO, BlockBakery > CachedModelBakery? dunno. -@SideOnly (Side.CLIENT) -public class BlockBakery implements IResourceManagerReloadListener { - - private static boolean DEBUG = Boolean.parseBoolean(System.getProperty("ccl.debugBakeryLogging")); - - private static Cache keyModelCache = CacheBuilder.newBuilder().expireAfterAccess(30, TimeUnit.MINUTES).build(); - - private static Map itemKeyGeneratorMap = new HashMap(); - private static Map blockKeyGeneratorMap = new HashMap(); - private static IBakedModel missingModel; - - public static final IBlockStateKeyGenerator defaultBlockKeyGenerator = new IBlockStateKeyGenerator() { - @Override - public String generateKey(IExtendedBlockState state) { - if (state.getBlock() instanceof IWorldBlockTextureProvider) { - Map> layerFaceSpriteMap = state.getValue(BlockBakeryProperties.LAYER_FACE_SPRITE_MAP); - StringBuilder builder = new StringBuilder(state.getBlock().getRegistryName() + ","); - for (Entry> layerEntry : layerFaceSpriteMap.entrySet()) { - builder.append(layerEntry.getKey().toString()).append(","); - for (Entry faceSpriteEntry : layerEntry.getValue().entrySet()) { - builder.append(faceSpriteEntry.getKey()).append(",").append(faceSpriteEntry.getValue().getIconName()).append(","); - } - } - return builder.toString(); - } - return state.getBlock().getRegistryName().toString() + "|" + state.getBlock().getMetaFromState(state); - } - }; - - public static final IItemStackKeyGenerator defaultItemKeyGenerator = new IItemStackKeyGenerator() { - @Override - public String generateKey(ItemStack stack) { - return stack.getItem().getRegistryName().toString() + "|" + stack.getMetadata(); - } - }; - - public static void init() { - TextureUtils.registerReloadListener(new BlockBakery()); - ModelRegistryHelper.registerCallback(new IModelBakeCallback() { - @Override - public void onModelBake(IRegistry modelRegistry) { - missingModel = ModelLoaderRegistry.getMissingModel().bake(TransformUtils.DEFAULT_BLOCK, DefaultVertexFormats.ITEM, TextureUtils.bakedTextureGetter); - } - }); - } - - public static IBlockStateKeyGenerator getKeyGenerator(Block block) { - if (blockKeyGeneratorMap.containsKey(block)) { - return blockKeyGeneratorMap.get(block); - } - return defaultBlockKeyGenerator; - } - - public static IItemStackKeyGenerator getKeyGenerator(Item item) { - if (itemKeyGeneratorMap.containsKey(item)) { - return itemKeyGeneratorMap.get(item); - } - return defaultItemKeyGenerator; - } - - public static void registerBlockKeyGenerator(Block block, IBlockStateKeyGenerator generator) { - if (blockKeyGeneratorMap.containsKey(block)) { - throw new IllegalArgumentException("Unable to register IBlockStateKeyGenerator as one is already registered for block:" + block.getRegistryName()); - } - blockKeyGeneratorMap.put(block, generator); - } - - public static void registerItemKeyGenerator(Item item, IItemStackKeyGenerator generator) { - if (itemKeyGeneratorMap.containsKey(item)) { - throw new IllegalArgumentException("Unable to register IItemStackKeyGenerator as one is already registered for item: " + item.getRegistryName()); - } - itemKeyGeneratorMap.put(item, generator); - } - - //TODO, Move this to pass IExtendedBlockState, IBlockAccess, BlockPos. Leave tile usage to - public static IBlockState handleExtendedState(IExtendedBlockState state, TileEntity tileEntity) { - Block block = state.getBlock(); - - if (block instanceof IBakeryBlock) { - return ((IBakeryBlock) block).getCustomBakery().handleState(state, tileEntity); - } else if (block instanceof IWorldBlockTextureProvider) { - IWorldBlockTextureProvider provider = ((IWorldBlockTextureProvider) block); - Map> layerFaceSpriteMap = new HashMap>(); - for (BlockRenderLayer layer : BlockRenderLayer.values()) { - if (block.canRenderInLayer(state, layer)) { - Map faceSpriteMap = new HashMap(); - for (EnumFacing face : EnumFacing.VALUES) { - TextureAtlasSprite sprite = provider.getTexture(face, state, layer, tileEntity.getWorld(), tileEntity.getPos()); - if (sprite != null) { - faceSpriteMap.put(face, sprite); - } - } - layerFaceSpriteMap.put(layer, faceSpriteMap); - } - } - state = state.withProperty(BlockBakeryProperties.LAYER_FACE_SPRITE_MAP, layerFaceSpriteMap); - } - return state; - } - - public static IBakedModel getCachedItemModel(ItemStack stack) { - IBakedModel model; - IItemStackKeyGenerator generator = getKeyGenerator(stack.getItem()); - String key = generator.generateKey(stack); - model = keyModelCache.getIfPresent(key); - if (model == null) { - model = generateItemModel(stack); - if (DEBUG) { - FMLLog.info("Baking item model: " + key); - } - if (model != missingModel) { - keyModelCache.put(key, model); - } - } - return model; - - } - - public static IBakedModel generateItemModel(ItemStack stack) { - Item item = stack.getItem(); - if (item instanceof ItemBlock) { - Block block = Block.getBlockFromItem(item); - if (block instanceof IBakeryBlock) { - ICustomBlockBakery bakery = ((IBakeryBlock) block).getCustomBakery(); - List generalQuads = new LinkedList(); - Map> faceQuads = new HashMap>(); - generalQuads.addAll(bakery.bakeItemQuads(null, stack)); - - for (EnumFacing face : EnumFacing.VALUES) { - List quads = new LinkedList(); - - quads.addAll(PlanarFaceBakery.shadeQuadFaces(bakery.bakeItemQuads(face, stack))); - - faceQuads.put(face, quads); - } - - BakedModelProperties properties = new BakedModelProperties(true, true, null); - return new PerspectiveAwareBakedModel(faceQuads, generalQuads, TransformUtils.DEFAULT_BLOCK, properties); - - } else if (block instanceof IItemBlockTextureProvider) { - IItemBlockTextureProvider provider = ((IItemBlockTextureProvider) block); - Map> faceQuadMap = new HashMap>(); - for (EnumFacing face : EnumFacing.VALUES) { - List faceQuads = new LinkedList(); - - faceQuads.addAll(PlanarFaceBakery.shadeQuadFaces(PlanarFaceBakery.bakeFace(face, provider.getTexture(face, stack), DefaultVertexFormats.ITEM))); - - faceQuadMap.put(face, faceQuads); - } - BakedModelProperties properties = new BakedModelProperties(true, true, null); - return new PerspectiveAwareBakedModel(faceQuadMap, TransformUtils.DEFAULT_BLOCK, properties); - } - } else { - if (item instanceof IBakeryItem) { - IItemBakery bakery = ((IBakeryItem) item).getBakery(); - List generalQuads = new LinkedList(); - Map> faceQuads = new HashMap>(); - generalQuads.addAll(bakery.bakeItemQuads(null, stack)); - - for (EnumFacing face : EnumFacing.VALUES) { - List quads = new LinkedList(); - - quads.addAll(bakery.bakeItemQuads(face, stack)); - - faceQuads.put(face, quads); - } - - PerspectiveAwareModelProperties bakeryProperties = PerspectiveAwareModelProperties.DEFAULT_ITEM; - - try { - bakeryProperties = bakery.getModelProperties(stack); - } catch (Exception ignored) { - } - - BakedModelProperties properties = bakeryProperties.getProperties(); - return new PerspectiveAwareBakedModel(faceQuads, generalQuads, bakeryProperties.getModelState(), properties); - } - } - return missingModel; - } - - public static IBakedModel getCachedModel(IExtendedBlockState state) { - IBakedModel model; - IBlockStateKeyGenerator keyGenerator = getKeyGenerator(state.getBlock()); - String key = keyGenerator.generateKey(state); - model = keyModelCache.getIfPresent(key); - if (model == null) { - model = generateModel(state); - if (DEBUG) { - FMLLog.info("Baking block model: " + key); - } - if (model != missingModel) { - keyModelCache.put(key, model); - } - } - return model; - } - - public static IBakedModel generateModel(IExtendedBlockState state) { - if (state.getBlock() instanceof IBakeryBlock) { - ICustomBlockBakery bakery = ((IBakeryBlock) state.getBlock()).getCustomBakery(); - if (bakery instanceof ISimpleBlockBakery) { - ISimpleBlockBakery simpleBakery = ((ISimpleBlockBakery) bakery); - List generalQuads = new LinkedList(); - Map> faceQuads = new HashMap>(); - generalQuads.addAll(simpleBakery.bakeQuads(null, state)); - - for (EnumFacing face : EnumFacing.VALUES) { - List quads = new LinkedList(); - - quads.addAll(simpleBakery.bakeQuads(face, state)); - - faceQuads.put(face, quads); - } - BakedModelProperties properties = new BakedModelProperties(true, true, null); - return new PerspectiveAwareBakedModel(faceQuads, generalQuads, TransformUtils.DEFAULT_BLOCK, properties); - } - if (bakery instanceof ILayeredBlockBakery) { - ILayeredBlockBakery layeredBakery = ((ILayeredBlockBakery) bakery); - Map>> layerFaceQuadMap = new HashMap>>(); - Map> layerGeneralQuads = new HashMap>(); - for (BlockRenderLayer layer : BlockRenderLayer.values()) { - if (state.getBlock().canRenderInLayer(state, layer)) { - LinkedList quads = new LinkedList(); - quads.addAll(layeredBakery.bakeLayerFace(null, layer, state)); - layerGeneralQuads.put(layer, quads); - } - } - - for (BlockRenderLayer layer : BlockRenderLayer.values()) { - if (state.getBlock().canRenderInLayer(state, layer)) { - Map> faceQuadMap = new HashMap>(); - for (EnumFacing face : EnumFacing.VALUES) { - List quads = new LinkedList(); - quads.addAll(layeredBakery.bakeLayerFace(face, layer, state)); - faceQuadMap.put(face, quads); - } - layerFaceQuadMap.put(layer, faceQuadMap); - } - } - BakedModelProperties properties = new BakedModelProperties(true, true, null); - return new PerspectiveAwareLayeredModel(layerFaceQuadMap, layerGeneralQuads, TransformUtils.DEFAULT_BLOCK, properties); - } - } - if (state.getBlock() instanceof IWorldBlockTextureProvider) { - Map>> layerFaceQuadMap = generateLayerFaceQuadMap(state); - BakedModelProperties properties = new BakedModelProperties(true, true, null); - return new PerspectiveAwareLayeredModel(layerFaceQuadMap, TransformUtils.DEFAULT_BLOCK, properties); - } /*else if (state.getBlock() instanceof IBlockTextureProvider) { - IBlockTextureProvider provider = ((IBlockTextureProvider) state.getBlock()); - int meta = state.getBlock().getMetaFromState(state); - - Map> quadFaceMap = new HashMap>(); - for (EnumFacing face : EnumFacing.VALUES) { - LinkedList quads = new LinkedList(); - - quads.add(PlanarFaceBakery.bakeFace(face, provider.getTexture(face, meta))); - - quadFaceMap.put(face, quads); - } - BakedModelProperties properties = new BakedModelProperties(true, true, null); - return new PerspectiveAwareBakedModel(quadFaceMap, TransformUtils.DEFAULT_BLOCK, properties); - - }*/ - return missingModel; - } - - public static Map>> generateLayerFaceQuadMap(IExtendedBlockState state) { - Map> layerFaceSpriteMap = state.getValue(BlockBakeryProperties.LAYER_FACE_SPRITE_MAP); - Map>> layerFaceQuadMap = new HashMap>>(); - for (BlockRenderLayer layer : layerFaceSpriteMap.keySet()) { - Map faceSpriteMap = layerFaceSpriteMap.get(layer); - Map> faceQuadMap = new HashMap>(); - for (EnumFacing face : faceSpriteMap.keySet()) { - List quads = new LinkedList(); - quads.add(PlanarFaceBakery.bakeFace(face, faceSpriteMap.get(face))); - faceQuadMap.put(face, quads); - } - layerFaceQuadMap.put(layer, faceQuadMap); - } - return layerFaceQuadMap; - } - - @Override - public void onResourceManagerReload(IResourceManager resourceManager) { - nukeModelCache(); - } - - public static void nukeModelCache() { - keyModelCache.invalidateAll(); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/BlockBakeryProperties.java b/dependencies/main/java/codechicken/lib/model/blockbakery/BlockBakeryProperties.java deleted file mode 100644 index d8934a8e8e..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/BlockBakeryProperties.java +++ /dev/null @@ -1,38 +0,0 @@ -package codechicken.lib.model.blockbakery; - -import codechicken.lib.block.property.unlisted.UnlistedMapProperty; -import codechicken.lib.block.property.unlisted.UnlistedMapProperty.IMapStringGenerator; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; - -import java.util.Map; -import java.util.Map.Entry; - -/** - * Created by covers1624 on 26/12/2016. - * TODO, Maybe move away from this, Instead of storing the entire render context inside the state, store the important data, then compute if necessary, will require changes basically everywhere. - */ -public class BlockBakeryProperties { - - public static final UnlistedMapProperty LAYER_FACE_SPRITE_MAP; - - static { - LAYER_FACE_SPRITE_MAP = new UnlistedMapProperty("layer_face_sprite"); - - LAYER_FACE_SPRITE_MAP.setStringGenerator(new IMapStringGenerator() { - @SuppressWarnings ("unchecked") - @Override - public String makeString(Map map) { - StringBuilder builder = new StringBuilder(); - for (Entry> layerEntry : ((Map>) map).entrySet()) { - builder.append(layerEntry.getKey().toString()).append(","); - for (Entry faceSpriteEntry : layerEntry.getValue().entrySet()) { - builder.append(faceSpriteEntry.getKey()).append(",").append(faceSpriteEntry.getValue().getIconName()).append(","); - } - } - return builder.toString(); - } - }); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/CCBakeryModel.java b/dependencies/main/java/codechicken/lib/model/blockbakery/CCBakeryModel.java deleted file mode 100644 index 3ccb0ee243..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/CCBakeryModel.java +++ /dev/null @@ -1,71 +0,0 @@ -package codechicken.lib.model.blockbakery; - -import codechicken.lib.texture.TextureUtils; -import com.google.common.collect.ImmutableList; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.*; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; -import net.minecraftforge.common.property.IExtendedBlockState; - -import javax.annotation.Nullable; -import java.util.List; - -/** - * Created by covers1624 on 26/10/2016. - */ -public class CCBakeryModel implements IBakedModel { - - private final String particle; - - public CCBakeryModel(String particle) { - this.particle = particle; - } - - @Override - public List getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { - return BlockBakery.getCachedModel((IExtendedBlockState) state).getQuads(state, side, rand); - } - - @Override - public boolean isAmbientOcclusion() { - return true; - } - - @Override - public boolean isGui3d() { - return false; - } - - @Override - public boolean isBuiltInRenderer() { - return false; - } - - @Override - public TextureAtlasSprite getParticleTexture() { - return TextureUtils.getTexture(particle); - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } - - @Override - public ItemOverrideList getOverrides() { - return new ItemOverrideList(ImmutableList.of()) { - @Override - public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) { - IBakedModel model = BlockBakery.getCachedItemModel(stack); - if (model == null) { - return originalModel; - } - return model; - } - }; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/IBakeryBlock.java b/dependencies/main/java/codechicken/lib/model/blockbakery/IBakeryBlock.java deleted file mode 100644 index 800c67131a..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/IBakeryBlock.java +++ /dev/null @@ -1,18 +0,0 @@ -package codechicken.lib.model.blockbakery; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -/** - * Created by covers1624 on 28/10/2016. - * TODO Document. - * TODO, Refactor, IBakeryBlock > IBakeryProvider - * TODO, Item and block implementation support. - */ -public interface IBakeryBlock { - - @SideOnly (Side.CLIENT) - //TODO ICustomBakery - ICustomBlockBakery getCustomBakery(); - -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/IBakeryItem.java b/dependencies/main/java/codechicken/lib/model/blockbakery/IBakeryItem.java deleted file mode 100644 index 4c872c5a9b..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/IBakeryItem.java +++ /dev/null @@ -1,18 +0,0 @@ -package codechicken.lib.model.blockbakery; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -/** - * Implement this on an item and register a model with an ItemOverrideList.handleItemState calling BlockBakery.getCachedItemModel to use this. - * Make sure you register an IItemStackKeyGenerator - * - * Created by covers1624 on 12/02/2017. - */ -@Deprecated//Still safe to use, 1.11 will have lots of changes to this entire pipeline. -public interface IBakeryItem { - - @SideOnly (Side.CLIENT) - IItemBakery getBakery(); - -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/IBlockStateKeyGenerator.java b/dependencies/main/java/codechicken/lib/model/blockbakery/IBlockStateKeyGenerator.java deleted file mode 100644 index cbd299a6e9..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/IBlockStateKeyGenerator.java +++ /dev/null @@ -1,13 +0,0 @@ -package codechicken.lib.model.blockbakery; - -import net.minecraftforge.common.property.IExtendedBlockState; - -/** - * Created by covers1624 on 26/11/2016. - * TODO Document. - */ -public interface IBlockStateKeyGenerator { - - String generateKey(IExtendedBlockState state); - -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/ICustomBlockBakery.java b/dependencies/main/java/codechicken/lib/model/blockbakery/ICustomBlockBakery.java deleted file mode 100644 index caa2d8f3d2..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/ICustomBlockBakery.java +++ /dev/null @@ -1,27 +0,0 @@ -package codechicken.lib.model.blockbakery; - -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.common.property.IExtendedBlockState; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.List; - -/** - * Created by covers1624 on 28/10/2016. - * TODO Document. - * TODO ICustomBlockBakery > IItemBakery - * TODO new Base class ICustomBakery - */ -public interface ICustomBlockBakery { - - //TODO Move to IBlockBakery. - @SideOnly (Side.CLIENT) - IExtendedBlockState handleState(IExtendedBlockState state, TileEntity tileEntity); - - @SideOnly (Side.CLIENT) - List bakeItemQuads(EnumFacing face, ItemStack stack); -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/IItemBakery.java b/dependencies/main/java/codechicken/lib/model/blockbakery/IItemBakery.java deleted file mode 100644 index a3f4fa20d2..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/IItemBakery.java +++ /dev/null @@ -1,29 +0,0 @@ -package codechicken.lib.model.blockbakery; - -import codechicken.lib.model.PerspectiveAwareModelProperties; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.List; - -/** - * Created by covers1624 on 12/02/2017. - */ -public interface IItemBakery { - - @SideOnly (Side.CLIENT) - List bakeItemQuads(EnumFacing face, ItemStack stack); - - /** - * Allows ItemModels to define a custom properties. Suitable for thinks like fake blocks. - * As this method has been added after release, we could potentially break binary compatibility. - * Suitable checks have been added where this method is called to preserve such compatibility. - * - * @return The transforms to use for the model. - */ - @SideOnly (Side.CLIENT) - PerspectiveAwareModelProperties getModelProperties(ItemStack stack); -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/IItemStackKeyGenerator.java b/dependencies/main/java/codechicken/lib/model/blockbakery/IItemStackKeyGenerator.java deleted file mode 100644 index 6f76a3d17a..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/IItemStackKeyGenerator.java +++ /dev/null @@ -1,13 +0,0 @@ -package codechicken.lib.model.blockbakery; - -import net.minecraft.item.ItemStack; - -/** - * Created by covers1624 on 2/11/2016. - * TODO Document. - */ -public interface IItemStackKeyGenerator { - - String generateKey(ItemStack stack); - -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/ILayeredBlockBakery.java b/dependencies/main/java/codechicken/lib/model/blockbakery/ILayeredBlockBakery.java deleted file mode 100644 index b2a74cf450..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/ILayeredBlockBakery.java +++ /dev/null @@ -1,21 +0,0 @@ -package codechicken.lib.model.blockbakery; - -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.common.property.IExtendedBlockState; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.List; - -/** - * Created by covers1624 on 28/10/2016. - * TODO Document. - */ -public interface ILayeredBlockBakery extends ICustomBlockBakery { - - @SideOnly (Side.CLIENT) - List bakeLayerFace(EnumFacing face, BlockRenderLayer layer, IExtendedBlockState state); - -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/ISimpleBlockBakery.java b/dependencies/main/java/codechicken/lib/model/blockbakery/ISimpleBlockBakery.java deleted file mode 100644 index 056e344a06..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/ISimpleBlockBakery.java +++ /dev/null @@ -1,19 +0,0 @@ -package codechicken.lib.model.blockbakery; - -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.common.property.IExtendedBlockState; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.List; - -/** - * Created by covers1624 on 28/10/2016. - * TODO Document. - */ -public interface ISimpleBlockBakery extends ICustomBlockBakery { - - @SideOnly (Side.CLIENT) - List bakeQuads(EnumFacing face, IExtendedBlockState state); -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/SimpleBlockRenderer.java b/dependencies/main/java/codechicken/lib/model/blockbakery/SimpleBlockRenderer.java deleted file mode 100644 index 80ca2ecc5e..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/SimpleBlockRenderer.java +++ /dev/null @@ -1,90 +0,0 @@ -package codechicken.lib.model.blockbakery; - -import codechicken.lib.render.CCModel; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.buffer.BakingVertexBuffer; -import codechicken.lib.texture.TextureUtils.IIconRegister; -import codechicken.lib.util.TripleABC; -import codechicken.lib.util.VertexDataUtils; -import codechicken.lib.vec.Cuboid6; -import codechicken.lib.vec.Rotation; -import codechicken.lib.vec.Vector3; -import codechicken.lib.vec.uv.UVTransformation; -import com.google.common.collect.ImmutableList; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.common.property.IExtendedBlockState; - -import java.util.List; - -/** - * Created by covers1624 on 26/12/2016. - * TODO Document. - */ -public abstract class SimpleBlockRenderer implements ISimpleBlockBakery, IIconRegister { - - //TODO Face based models. - private static final CCModel[][] models = new CCModel[6][4]; - - static { - CCModel model = CCModel.quadModel(24).generateBlock(0, Cuboid6.full); - for (int s = 0; s < 6; s++) { - for (int r = 0; r < 4; r++) { - CCModel m = model.copy().apply(Rotation.sideOrientation(s, r).at(Vector3.center)); - m.computeNormals(); - models[s][r] = m; - } - } - } - - public abstract TripleABC getWorldTransforms(IExtendedBlockState state); - - public abstract TripleABC getItemTransforms(ItemStack stack); - - public abstract boolean shouldCull(); - - @Override - public IExtendedBlockState handleState(IExtendedBlockState state, TileEntity tileEntity) { - return state; - } - - @Override - public List bakeQuads(EnumFacing face, IExtendedBlockState state) { - BakingVertexBuffer buffer = BakingVertexBuffer.create(); - TripleABC worldData = getWorldTransforms(state); - CCRenderState ccrs = CCRenderState.instance(); - ccrs.reset(); - ccrs.startDrawing(0x7, DefaultVertexFormats.ITEM, buffer); - models[worldData.getA()][worldData.getB()].render(ccrs, worldData.getC()); - buffer.finishDrawing(); - List quads = buffer.bake(); - if (face == null && !shouldCull()) { - return quads; - } else if (face != null) { - return VertexDataUtils.sortFaceData(quads).get(face); - } - return ImmutableList.of(); - } - - @Override - public List bakeItemQuads(EnumFacing face, ItemStack stack) { - BakingVertexBuffer buffer = BakingVertexBuffer.create(); - TripleABC worldData = getItemTransforms(stack); - CCRenderState ccrs = CCRenderState.instance(); - ccrs.reset(); - ccrs.startDrawing(0x7, DefaultVertexFormats.ITEM, buffer); - models[worldData.getA()][worldData.getB()].render(ccrs, worldData.getC()); - buffer.finishDrawing(); - List quads = buffer.bake(); - - if (face == null && !shouldCull()) { - return quads; - } else if (face != null) { - return VertexDataUtils.sortFaceData(quads).get(face); - } - return ImmutableList.of(); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/loader/BakeryModel.java b/dependencies/main/java/codechicken/lib/model/blockbakery/loader/BakeryModel.java deleted file mode 100644 index fbad1bd4c5..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/loader/BakeryModel.java +++ /dev/null @@ -1,44 +0,0 @@ -package codechicken.lib.model.blockbakery.loader; - -import codechicken.lib.model.blockbakery.CCBakeryModel; -import com.google.common.base.Function; -import com.google.common.collect.ImmutableList; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.IModel; -import net.minecraftforge.common.model.IModelState; -import net.minecraftforge.common.model.TRSRTransformation; - -import java.util.Collection; - -/** - * Basically a wrapper to allow the use of the BlockBakery from a json file. - * Created by covers1624 on 13/02/2017. - */ -public class BakeryModel implements IModel { - - public static final BakeryModel INSTANCE = new BakeryModel(); - - @Override - public Collection getDependencies() { - return ImmutableList.of(); - } - - @Override - public Collection getTextures() { - return ImmutableList.of(); - } - - @Override - public IBakedModel bake(IModelState state, VertexFormat format, Function bakedTextureGetter) { - return new CCBakeryModel(""); - } - - @Override - public IModelState getDefaultState() { - //This doesn't matter as we are a wrapper. - return TRSRTransformation.identity(); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/loader/CCBakeryModelLoader.java b/dependencies/main/java/codechicken/lib/model/blockbakery/loader/CCBakeryModelLoader.java deleted file mode 100644 index 5f051ff131..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/loader/CCBakeryModelLoader.java +++ /dev/null @@ -1,30 +0,0 @@ -package codechicken.lib.model.blockbakery.loader; - -import net.minecraft.client.resources.IResourceManager; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.ICustomModelLoader; -import net.minecraftforge.client.model.IModel; - -/** - * Basically a wrapper to allow the use of the BlockBakery from a json file. - * Created by covers1624 on 13/02/2017. - */ -public class CCBakeryModelLoader implements ICustomModelLoader { - - public static final CCBakeryModelLoader INSTANCE = new CCBakeryModelLoader(); - - @Override - public void onResourceManagerReload(IResourceManager resourceManager) { - } - - @Override - public boolean accepts(ResourceLocation modelLocation) { - String path = modelLocation.getResourcePath(); - return modelLocation.getResourceDomain().equals("ccl") && (path.equals("bakery") || path.equals("models/block/bakery") || path.equals("models/item/bakery")); - } - - @Override - public IModel loadModel(ResourceLocation modelLocation) throws Exception { - return BakeryModel.INSTANCE; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/sub/SubBlockBakery.java b/dependencies/main/java/codechicken/lib/model/blockbakery/sub/SubBlockBakery.java deleted file mode 100644 index b074d3051c..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/sub/SubBlockBakery.java +++ /dev/null @@ -1,121 +0,0 @@ -package codechicken.lib.model.blockbakery.sub; - -import codechicken.lib.model.blockbakery.*; -import codechicken.lib.texture.TextureUtils.IIconRegister; -import com.google.common.collect.ImmutableList; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.common.property.IExtendedBlockState; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Created by covers1624 on 26/12/2016. - * TODO Document. - */ -public class SubBlockBakery implements ILayeredBlockBakery, IIconRegister { - - private final Map subBakeries = new HashMap(); - private final SubBlockStateKeyGenerator blockKeyGenerator = new SubBlockStateKeyGenerator(); - private final SubItemStackKeyGenerator itemKeyGenerator = new SubItemStackKeyGenerator(); - - public void registerSubBakery(int meta, ICustomBlockBakery bakery) { - subBakeries.put(meta, bakery); - } - - public void registerSubBakery(int meta, ICustomBlockBakery bakery, IBlockStateKeyGenerator blockKeyGen) { - registerSubBakery(meta, bakery, blockKeyGen, null); - } - - public void registerSubBakery(int meta, ICustomBlockBakery bakery, IItemStackKeyGenerator itemKeyGen) { - registerSubBakery(meta, bakery, null, itemKeyGen); - } - - public void registerSubBakery(int meta, ICustomBlockBakery bakery, IBlockStateKeyGenerator blockKeyGen, IItemStackKeyGenerator itemKeyGen) { - subBakeries.put(meta, bakery); - if (blockKeyGen != null) { - blockKeyGenerator.register(meta, blockKeyGen); - } - if (itemKeyGen != null) { - itemKeyGenerator.register(meta, itemKeyGen); - } - } - - public SubBlockBakery registerKeyGens(Block block) { - registerBlockKeyGen(block); - registerItemKeyGen(Item.getItemFromBlock(block)); - return this; - } - - public SubBlockBakery registerBlockKeyGen(Block block) { - BlockBakery.registerBlockKeyGenerator(block, blockKeyGenerator); - return this; - } - - public SubBlockBakery registerItemKeyGen(Item block) { - BlockBakery.registerItemKeyGenerator(block, itemKeyGenerator); - return this; - } - - public SubBlockStateKeyGenerator getBlockKeyGen() { - return blockKeyGenerator; - } - - public SubItemStackKeyGenerator getItemKeyGen() { - return itemKeyGenerator; - } - - @Override - @SideOnly (Side.CLIENT) - public List bakeLayerFace(EnumFacing face, BlockRenderLayer layer, IExtendedBlockState state) { - ICustomBlockBakery bakery = subBakeries.get(state.getBlock().getMetaFromState(state)); - if (bakery instanceof ISimpleBlockBakery) { - if (state.getBlock().canRenderInLayer(state, layer)) { - return ((ISimpleBlockBakery) bakery).bakeQuads(face, state); - } - } else if (bakery instanceof ILayeredBlockBakery) { - return ((ILayeredBlockBakery) bakery).bakeLayerFace(face, layer, state); - } - return ImmutableList.of(); - } - - @Override - @SideOnly (Side.CLIENT) - public IExtendedBlockState handleState(IExtendedBlockState state, TileEntity tileEntity) { - ICustomBlockBakery bakery = subBakeries.get(state.getBlock().getMetaFromState(state)); - if (bakery == null) { - return state; - } - return bakery.handleState(state, tileEntity); - } - - @Override - @SideOnly (Side.CLIENT) - public List bakeItemQuads(EnumFacing face, ItemStack stack) { - ICustomBlockBakery bakery = subBakeries.get(stack.getMetadata()); - if (bakery == null) { - return ImmutableList.of(); - } - return bakery.bakeItemQuads(face, stack); - } - - @Override - @SideOnly (Side.CLIENT) - public void registerIcons(TextureMap textureMap) { - for (ICustomBlockBakery bakery : subBakeries.values()) { - if (bakery instanceof IIconRegister) { - ((IIconRegister) bakery).registerIcons(textureMap); - } - } - } -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/sub/SubBlockStateKeyGenerator.java b/dependencies/main/java/codechicken/lib/model/blockbakery/sub/SubBlockStateKeyGenerator.java deleted file mode 100644 index a3d347bd1b..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/sub/SubBlockStateKeyGenerator.java +++ /dev/null @@ -1,31 +0,0 @@ -package codechicken.lib.model.blockbakery.sub; - -import codechicken.lib.model.blockbakery.BlockBakery; -import codechicken.lib.model.blockbakery.IBlockStateKeyGenerator; -import net.minecraftforge.common.property.IExtendedBlockState; - -import java.util.HashMap; -import java.util.Map; - -/** - * Created by covers1624 on 27/12/2016. - * TODO Document. - */ -public class SubBlockStateKeyGenerator implements IBlockStateKeyGenerator { - - private final Map subKeyGenMap = new HashMap(); - - public void register(int meta, IBlockStateKeyGenerator subGenerator) { - subKeyGenMap.put(meta, subGenerator); - } - - @Override - public String generateKey(IExtendedBlockState state) { - int meta = state.getBlock().getMetaFromState(state); - if (subKeyGenMap.containsKey(meta)) { - IBlockStateKeyGenerator keyGenerator = subKeyGenMap.get(meta); - return keyGenerator.generateKey(state); - } - return BlockBakery.defaultBlockKeyGenerator.generateKey(state); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/blockbakery/sub/SubItemStackKeyGenerator.java b/dependencies/main/java/codechicken/lib/model/blockbakery/sub/SubItemStackKeyGenerator.java deleted file mode 100644 index c7b4845401..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockbakery/sub/SubItemStackKeyGenerator.java +++ /dev/null @@ -1,31 +0,0 @@ -package codechicken.lib.model.blockbakery.sub; - -import codechicken.lib.model.blockbakery.BlockBakery; -import codechicken.lib.model.blockbakery.IItemStackKeyGenerator; -import net.minecraft.item.ItemStack; - -import java.util.HashMap; -import java.util.Map; - -/** - * Created by covers1624 on 30/12/2016. - * TODO Document. - */ -public class SubItemStackKeyGenerator implements IItemStackKeyGenerator { - - private final Map subKeyGenMap = new HashMap(); - - public void register(int meta, IItemStackKeyGenerator subGenerator) { - subKeyGenMap.put(meta, subGenerator); - } - - @Override - public String generateKey(ItemStack stack) { - int meta = stack.getMetadata(); - if (subKeyGenMap.containsKey(meta)) { - IItemStackKeyGenerator generator = subKeyGenMap.get(meta); - return generator.generateKey(stack); - } - return BlockBakery.defaultItemKeyGenerator.generateKey(stack); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/blockstate/CCBlockStateLoader.java b/dependencies/main/java/codechicken/lib/model/blockstate/CCBlockStateLoader.java deleted file mode 100644 index 6bcbb35e07..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockstate/CCBlockStateLoader.java +++ /dev/null @@ -1,279 +0,0 @@ -package codechicken.lib.model.blockstate; - -import codechicken.lib.util.ArrayUtils; -import com.google.common.base.Throwables; -import com.google.common.collect.Lists; -import com.google.gson.*; -import com.google.gson.stream.JsonReader; -import net.minecraft.client.renderer.block.model.ModelBlockDefinition; -import net.minecraft.client.renderer.block.model.ModelRotation; -import net.minecraft.client.renderer.block.model.Variant; -import net.minecraft.client.renderer.block.model.VariantList; -import net.minecraft.util.JsonUtils; -import net.minecraftforge.client.model.BlockStateLoader; -import net.minecraftforge.common.model.TRSRTransformation; -import org.apache.commons.io.IOUtils; - -import java.io.Reader; -import java.io.StringReader; -import java.util.*; -import java.util.Map.Entry; - -/** - * Created by covers1624 on 17/11/2016. - * TODO, ASM copy instructions from ModelBlockDefinition to bouncer method here, in case someone is doing the same thing as me. - * TODO, Vanilla Predicate support inside json. Maybe allow variants inside predicates?? - * TODO, Allow all unhandled BlockState Json data to be passed to custom IModels. - * TODO, Allow automatic assigning of IItemRenderer callbacks from json. - * TODO, Allow the BlockBakery to assign blocks models from json. - * TODO, Custom Sided particle system from json maybe / support for sided particles loaded from this loader. - */ -public class CCBlockStateLoader { - - public static final Gson GSON = new GsonBuilder().registerTypeAdapter(CCVariant.class, new CCVariant.Deserializer()).create(); - - public static ModelBlockDefinition handleLoad(Reader reader, Gson vanillaGSON) { - try { - String json = IOUtils.toString(reader); - ModelBlockDefinition cclDef = load(json); - if (cclDef != null) { - return cclDef; - } - return BlockStateLoader.load(new StringReader(json), vanillaGSON); - } catch (Exception e) { - Throwables.propagate(e); - } - return null; - } - - public static ModelBlockDefinition load(String json) { - try { - JsonParser parser = new JsonParser(); - JsonReader reader = new JsonReader(new StringReader(json)); - reader.setLenient(true); - JsonObject object = parser.parse(reader).getAsJsonObject(); - if (JsonUtils.hasField(object, "ccl_marker")) { - - String marker = JsonUtils.getString(object, "ccl_marker"); - List variantSets = new ArrayList(); - for (JsonElement element : object.getAsJsonArray("variant_sets")) { - variantSets.add(element.getAsString()); - } - - String textureDomain = ""; - if (object.has("texture_domain")) { - textureDomain = object.get("texture_domain").getAsString(); - } - - CCVariant defaultVariant = null; - if (object.has("defaults")) { - defaultVariant = GSON.fromJson(object.get("defaults"), CCVariant.class); - } - Map> variants = parseVariants(object.getAsJsonObject("variants")); - - Map>> subModels = parseSubModels(object.getAsJsonObject("sub_model")); - - Map compiledVariants = new LinkedHashMap(); - Map> compiledSubModelVariants = new LinkedHashMap>(); - - List possibleCombos = new ArrayList(); - - for (String variantSet : variantSets) { - Map> variantValueMap = generateVariantValueMap(Arrays.asList(variantSet.split(",")), variants, subModels); - possibleCombos.addAll(generatePossibleCombos(variantValueMap)); - } - - for (String var : possibleCombos) { - Map kvArray = ArrayUtils.convertKeyValueArrayToMap(var.split(",")); - CCVariant finalVariant = new CCVariant(); - if (defaultVariant != null) { - finalVariant = defaultVariant.copy(); - } - compiledVariants.put(var, compileVariant(finalVariant.copy(), kvArray, variants)); - - } - for (Entry>> subModelVariantEntry : subModels.entrySet()) { - Map compiledVariants2 = new LinkedHashMap(); - for (String var : possibleCombos) { - Map kvArray = ArrayUtils.convertKeyValueArrayToMap(var.split(",")); - CCVariant finalVariant = new CCVariant(); - if (defaultVariant != null) { - finalVariant = defaultVariant.copy(); - } - compiledVariants2.put(var, compileVariant(finalVariant.copy(), kvArray, subModelVariantEntry.getValue())); - } - compiledSubModelVariants.put(subModelVariantEntry.getKey(), compiledVariants2); - } - - Map variantList = new HashMap(); - for (Entry entry : compiledVariants.entrySet()) { - Map subModelVariants = getSubModelsForKey(entry.getKey(), compiledSubModelVariants); - List vars = new ArrayList(); - CCVariant variant = entry.getValue(); - - boolean uvLock = variant.uvLock.or(false); - boolean smooth = variant.smooth.or(true); - boolean gui3d = variant.gui3d.or(true); - int weight = variant.weight.or(1); - - if (variant.model != null && subModelVariants.size() == 0 && variant.textures.size() == 0 && variant.customData.size() == 0 && variant.state.orNull() instanceof ModelRotation) { - vars.add(new Variant(variant.model, ((ModelRotation) variant.state.get()), uvLock, weight)); - } else if (subModelVariants.size() == 0) { - vars.add(new CCFinalVariant(variant.model, variant.state.or(TRSRTransformation.identity()), uvLock, smooth, gui3d, weight, variant.textures, textureDomain, variant.customData)); - } else { - vars.add(new CCFinalMultiVariant(variant, textureDomain, subModelVariants)); - } - variantList.put(entry.getKey(), new VariantList(vars)); - } - return new ModelBlockDefinition(variantList, null); - - } - } catch (Exception e) { - e.printStackTrace(); - Throwables.propagate(e); - } - return null; - } - - public static Map> parseVariants(JsonObject variantElement) { - Map> variants = new LinkedHashMap>(); - for (Entry variantsEntry : variantElement.entrySet()) { - String variantName = variantsEntry.getKey(); - Map variantValues = variants.get(variantName); - if (variantValues == null) { - variantValues = new LinkedHashMap(); - variants.put(variantName, variantValues); - } - for (Entry variantEntry : variantsEntry.getValue().getAsJsonObject().entrySet()) { - String variantValue = variantEntry.getKey(); - CCVariant variant = GSON.fromJson(variantEntry.getValue(), CCVariant.class); - variantValues.put(variantValue, variant); - } - } - return variants; - } - - public static Map>> parseSubModels(JsonObject object) { - Map>> subModels = new LinkedHashMap>>(); - - if (object != null) { - for (Entry subModelEntry : object.entrySet()) { - subModels.put(subModelEntry.getKey(), parseVariants(subModelEntry.getValue().getAsJsonObject().getAsJsonObject("variants"))); - } - } - - return subModels; - } - - public static CCVariant compileVariant(CCVariant finalVariant, Map kvArray, Map> variants) { - for (Entry entry : kvArray.entrySet()) { - for (Entry> variantsEntry : variants.entrySet()) { - if (entry.getKey().equals(variantsEntry.getKey())) { - Map variantMap = variantsEntry.getValue(); - if (variantMap.containsKey(entry.getValue())) { - finalVariant = finalVariant.with(variantMap.get(entry.getValue())); - } - } - } - } - for (Entry entry : kvArray.entrySet()) { - for (Entry> variantsEntry : variants.entrySet()) { - if (entry.getKey().equals(variantsEntry.getKey())) { - Map variantMap = variantsEntry.getValue(); - if (variantMap.containsKey(entry.getValue())) { - finalVariant = variantMap.get(entry.getValue()).applySubOverrides(finalVariant, kvArray); - } - } - } - } - return finalVariant; - } - - public static Map getSubModelsForKey(String key, Map> subModels) { - Map subModelVariants = new LinkedHashMap(); - for (Entry> subModelEntry : subModels.entrySet()) { - for (Entry variantEntry : subModelEntry.getValue().entrySet()) { - if (variantEntry.getKey().equals(key)) { - subModelVariants.put(subModelEntry.getKey(), variantEntry.getValue()); - } - } - } - return subModelVariants; - } - - /** - * Generates a list of strings for all possible combos of Key=Value. - * Per key value list can have more than 1 valid value. - *

- * Credits to brandon3055 who wrote this for me! - * - * @param variantValueMap A map of all possible Keys to all possible values per key. - * @return A compiled list of all possible combos. - */ - public static List generatePossibleCombos(Map> variantValueMap) { - List possibleCombos = new ArrayList(); - - List keys = Lists.newArrayList(variantValueMap.keySet()); - - int comboCount = 1; - for (String key : variantValueMap.keySet()) { - comboCount *= variantValueMap.get(key).size(); - } - - int[] indexes = new int[variantValueMap.size()]; - for (int l = 0; l < comboCount; l++) { - for (int in = 0; in < indexes.length; in++) { - indexes[in]++; - if (indexes[in] >= variantValueMap.get(keys.get(in)).size()) { - indexes[in] = 0; - } else { - break; - } - } - - String combo = ""; - for (int i = 0; i < indexes.length; i++) { - combo += keys.get(i) + "=" + variantValueMap.get(keys.get(i)).get(indexes[i]) + ","; - } - possibleCombos.add(combo.substring(0, combo.length() - 1)); - } - return possibleCombos; - } - - /** - * Generates a map of Key -> List(Value) from the provided CCVariants. - * - * @param keys The keys to get all values for. - * @param variants The CCVariants parsed from json. - * @return Map of Key to value lists. - */ - public static Map> generateVariantValueMap(List keys, Map> variants, Map>> subModels) { - Map> variantValueMap = new LinkedHashMap>(); - for (String variant : keys) { - List variantValues = new ArrayList(); - for (String variantName : variants.keySet()) { - if (variantName.equals(variant) && variants.containsKey(variant)) { - variantValues.addAll(variants.get(variant).keySet()); - } - - for (CCVariant subVariant : variants.get(variantName).values()) { - variantValues.addAll(subVariant.getPossibleVariantValues(variant)); - } - } - for (Map> subModelVariants : subModels.values()) { - for (String variantName : subModelVariants.keySet()) { - if (variantName.equals(variant) && subModelVariants.containsKey(variant)) { - variantValues.addAll(subModelVariants.get(variant).keySet()); - } - - for (CCVariant subVariant : subModelVariants.get(variantName).values()) { - variantValues.addAll(subVariant.getPossibleVariantValues(variant)); - } - } - } - variantValueMap.put(variant, variantValues); - } - return variantValueMap; - } - -} diff --git a/dependencies/main/java/codechicken/lib/model/blockstate/CCFinalMultiVariant.java b/dependencies/main/java/codechicken/lib/model/blockstate/CCFinalMultiVariant.java deleted file mode 100644 index 096092a693..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockstate/CCFinalMultiVariant.java +++ /dev/null @@ -1,72 +0,0 @@ -package codechicken.lib.model.blockstate; - -import codechicken.lib.model.BakedModelProperties; -import codechicken.lib.model.CCMultiModel; -import codechicken.lib.model.StateOverrideIModel; -import net.minecraft.client.renderer.block.model.ModelRotation; -import net.minecraft.client.renderer.block.model.Variant; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.IModel; -import net.minecraftforge.client.model.ModelLoaderRegistry; -import net.minecraftforge.common.model.IModelState; -import net.minecraftforge.common.model.TRSRTransformation; - -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -/** - * Created by covers1624 on 16/12/2016. - */ -public class CCFinalMultiVariant extends Variant { - - private Variant baseVariant; - private BakedModelProperties baseProperties; - private List finalVariants = new LinkedList(); - private IModelState state; - - public CCFinalMultiVariant(CCVariant baseVariant, String textureDomain, Map subModels) { - super(baseVariant.model == null ? new ResourceLocation("builtin/missing") : baseVariant.model, baseVariant.state.get() instanceof ModelRotation ? ((ModelRotation) baseVariant.state.get()) : ModelRotation.X0_Y0, baseVariant.uvLock.or(false), baseVariant.weight.or(1)); - state = baseVariant.state.get(); - this.baseVariant = makeFinalVariant(baseVariant, textureDomain); - this.baseProperties = new BakedModelProperties(baseVariant.smooth.or(true), baseVariant.gui3d.or(true)); - for (CCVariant subModel : subModels.values()) { - finalVariants.add(makeFinalVariant(baseVariant.copy().with(subModel), textureDomain)); - } - } - - @Override - public IModel process(IModel base) { - boolean hasBase = base != ModelLoaderRegistry.getMissingModel(); - if (hasBase) { - base = baseVariant.process(base); - } - - List subModels = new LinkedList(); - for (Variant variant : finalVariants) { - if (!variant.getModelLocation().equals(new ResourceLocation("builtin/missing"))) { - IModel subModel = ModelLoaderRegistry.getModelOrLogError(variant.getModelLocation(), "Unable to load subModel's Model: " + variant.getModelLocation()); - subModels.add(variant.process(new StateOverrideIModel(subModel, variant.getState()))); - } - } - - return new CCMultiModel(hasBase ? base : null, baseProperties, subModels); - } - - @Override - public IModelState getState() { - return state; - } - - private static Variant makeFinalVariant(CCVariant variant, String textureDomain) { - boolean uvLock = variant.uvLock.or(false); - boolean smooth = variant.smooth.or(true); - boolean gui3d = variant.gui3d.or(true); - int weight = variant.weight.or(1); - if (variant.model != null && variant.textures.size() == 0 && variant.customData.size() == 0 && variant.state.orNull() instanceof ModelRotation) { - return new Variant(variant.model, ((ModelRotation) variant.state.get()), uvLock, weight); - } else { - return new CCFinalVariant(variant.model, variant.state.or(TRSRTransformation.identity()), uvLock, smooth, gui3d, weight, variant.textures, textureDomain, variant.customData); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/model/blockstate/CCFinalVariant.java b/dependencies/main/java/codechicken/lib/model/blockstate/CCFinalVariant.java deleted file mode 100644 index d97de65685..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockstate/CCFinalVariant.java +++ /dev/null @@ -1,72 +0,0 @@ -package codechicken.lib.model.blockstate; - -import com.google.common.collect.ImmutableMap; -import net.minecraft.client.renderer.block.model.ModelRotation; -import net.minecraft.client.renderer.block.model.Variant; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.IModel; -import net.minecraftforge.client.model.ModelLoaderRegistry; -import net.minecraftforge.client.model.ModelProcessingHelper; -import net.minecraftforge.common.model.IModelState; - -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -/** - * Created by covers1624 on 19/11/2016. - * Here because ForgeVariant is yet again private.. - * Credits to fry. - */ -public class CCFinalVariant extends Variant { - - private final IModelState state; - private final boolean smooth; - private final boolean gui3d; - private final ImmutableMap customData; - private final ImmutableMap textures; - - public CCFinalVariant(ResourceLocation model, IModelState state, boolean uvLock, boolean smooth, boolean gui3d, int weight, Map textures, String textureDomain, Map customData) { - super(model == null ? new ResourceLocation("builtin/missing") : model, state instanceof ModelRotation ? ((ModelRotation) state) : ModelRotation.X0_Y0, uvLock, weight); - this.state = state; - this.smooth = smooth; - this.gui3d = gui3d; - - Map newTextures = new HashMap(); - for (Entry entry : textures.entrySet()) { - String prefixedTexture = entry.getValue(); - if (!entry.getValue().contains(":")) { - prefixedTexture = textureDomain + ":" + prefixedTexture; - } - newTextures.put(entry.getKey(), prefixedTexture); - } - this.textures = ImmutableMap.copyOf(newTextures); - this.customData = ImmutableMap.copyOf(customData); - } - - public static IModel runModelHooks(IModel base, boolean smooth, boolean gui3d, boolean uvlock, ImmutableMap textureMap, ImmutableMap customData) { - base = ModelProcessingHelper.customData(base, customData); - base = ModelProcessingHelper.retexture(base, textureMap); - base = ModelProcessingHelper.smoothLighting(base, smooth); - base = ModelProcessingHelper.gui3d(base, gui3d); - base = ModelProcessingHelper.uvlock(base, uvlock); - return base; - } - - @Override - public IModel process(IModel base) { - - boolean hasBase = base != ModelLoaderRegistry.getMissingModel(); - - if (hasBase) { - base = runModelHooks(base, smooth, gui3d, isUvLock(), textures, customData); - } - - return base; - } - - @Override - public IModelState getState() { - return state; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/blockstate/CCVariant.java b/dependencies/main/java/codechicken/lib/model/blockstate/CCVariant.java deleted file mode 100644 index 205416a2f3..0000000000 --- a/dependencies/main/java/codechicken/lib/model/blockstate/CCVariant.java +++ /dev/null @@ -1,210 +0,0 @@ -package codechicken.lib.model.blockstate; - -import codechicken.lib.util.Copyable; -import codechicken.lib.util.TransformUtils; -import com.google.common.base.Objects; -import com.google.common.base.Objects.ToStringHelper; -import com.google.common.base.Optional; -import com.google.gson.*; -import net.minecraft.util.JsonUtils; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.model.IModelState; - -import java.lang.reflect.Type; -import java.util.*; -import java.util.Map.Entry; - -/** - * Created by covers1624 on 18/11/2016. - */ -public class CCVariant implements Copyable { - - protected ResourceLocation model; - protected Optional state = Optional.absent(); - protected Optional uvLock = Optional.absent(); - protected Optional smooth = Optional.absent(); - protected Optional gui3d = Optional.absent(); - protected Optional weight = Optional.absent(); - protected Map textures = new HashMap(); - protected Map customData = new HashMap(); - protected Map> subVariants = new LinkedHashMap>(); - - public CCVariant() { - } - - public CCVariant(CCVariant variant) { - this.model = variant.model; - this.state = variant.state; - this.uvLock = variant.uvLock; - this.smooth = variant.smooth; - this.gui3d = variant.gui3d; - this.weight = variant.weight; - this.textures = new HashMap(variant.textures); - this.customData = new HashMap(customData); - this.subVariants = new LinkedHashMap>(variant.subVariants); - } - - public CCVariant with(CCVariant other) { - if (this.model == null || other.model != null) { - this.model = other.model; - } - - if (other.state.isPresent()) { - this.state = other.state; - } - if (other.uvLock.isPresent()) { - this.uvLock = other.uvLock; - } - if (other.smooth.isPresent()) { - this.smooth = other.smooth; - } - if (other.gui3d.isPresent()) { - this.gui3d = other.gui3d; - } - if (other.weight.isPresent()) { - this.weight = other.weight; - } - HashMap newTextures = new HashMap(); - newTextures.putAll(textures); - newTextures.putAll(other.textures); - this.textures = new LinkedHashMap(newTextures); - HashMap newCustomData = new HashMap(); - newCustomData.putAll(customData); - newCustomData.putAll(other.customData); - this.customData = new LinkedHashMap(newCustomData); - return this; - } - - public List getPossibleVariantNames() { - List variantNames = new ArrayList(); - for (String variantName : subVariants.keySet()) { - variantNames.add(variantName); - for (CCVariant subVariant : subVariants.get(variantName).values()) { - variantNames.addAll(subVariant.getPossibleVariantNames()); - } - } - return variantNames; - } - - public List getPossibleVariantValues(String variant) { - List variantValues = new ArrayList(); - for (String variantName : subVariants.keySet()) { - if (variantName.equals(variant) && subVariants.containsKey(variant)) { - variantValues.addAll(subVariants.get(variant).keySet()); - } - - for (CCVariant subVariant : subVariants.get(variantName).values()) { - variantValues.addAll(subVariant.getPossibleVariantValues(variant)); - } - } - return variantValues; - } - - public CCVariant applySubOverrides(CCVariant parent, Map kvArray) { - CCVariant finalVariant = parent; - for (Entry entry : kvArray.entrySet()) { - for (Entry> variantsEntry : subVariants.entrySet()) { - if (entry.getKey().equals(variantsEntry.getKey())) { - Map variantMap = variantsEntry.getValue(); - if (variantMap.containsKey(entry.getValue())) { - finalVariant = finalVariant.with(variantMap.get(entry.getValue())); - } - } - } - } - - for (Entry entry : kvArray.entrySet()) { - for (Entry> variantsEntry : subVariants.entrySet()) { - if (entry.getKey().equals(variantsEntry.getKey())) { - Map variantMap = variantsEntry.getValue(); - if (variantMap.containsKey(entry.getValue())) { - finalVariant = variantMap.get(entry.getValue()).applySubOverrides(finalVariant, kvArray); - } - } - } - } - return finalVariant; - } - - @Override - public CCVariant copy() { - return new CCVariant(this); - } - - public static class Deserializer implements JsonDeserializer { - - public static ResourceLocation getBlockLocation(String location) { - ResourceLocation tmp = new ResourceLocation(location); - return new ResourceLocation(tmp.getResourceDomain(), "block/" + tmp.getResourcePath()); - } - - @Override - public CCVariant deserialize(JsonElement element, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - CCVariant variant = new CCVariant(); - JsonObject json = element.getAsJsonObject(); - - if (json.has("model")) { - JsonElement modelElement = json.get("model"); - if (modelElement.isJsonNull()) { - variant.model = null; - } else { - variant.model = getBlockLocation(modelElement.getAsString()); - } - } - - if (json.has("textures")) { - for (Entry entry : json.get("textures").getAsJsonObject().entrySet()) { - if (entry.getValue().isJsonNull()) { - variant.textures.put(entry.getKey(), ""); - } else { - variant.textures.put(entry.getKey(), entry.getValue().getAsString()); - } - } - } - - variant.state = TransformUtils.parseFromJson(json); - - if (json.has("uvlock")) { - variant.uvLock = Optional.of(JsonUtils.getBoolean(json, "uvlock")); - } - - if (json.has("smooth_lighting")) { - variant.smooth = Optional.of(JsonUtils.getBoolean(json, "smooth_lighting")); - } - - if (json.has("gui3d")) { - variant.gui3d = Optional.of(JsonUtils.getBoolean(json, "gui3d")); - } - - if (json.has("weight")) { - variant.weight = Optional.of(JsonUtils.getInt(json, "weight")); - } - - if (json.has("variants")) { - variant.subVariants.putAll(CCBlockStateLoader.parseVariants(json.getAsJsonObject("variants"))); - } - - if (json.has("custom")) { - for (Entry e : json.get("custom").getAsJsonObject().entrySet()) { - if (e.getValue().isJsonNull()) { - variant.customData.put(e.getKey(), null); - } else { - variant.customData.put(e.getKey(), e.getValue().toString()); - } - } - } - - return variant; - } - } - - @Override - public String toString() { - ToStringHelper helper = Objects.toStringHelper("CCVariant"); - helper.add("Model", model); - helper.add("IModelState", state); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - helper.add("Textures:", gson.toJson(textures, Map.class)); - return helper.toString(); - } -} diff --git a/dependencies/main/java/codechicken/lib/model/cube/CCCubeLoader.java b/dependencies/main/java/codechicken/lib/model/cube/CCCubeLoader.java deleted file mode 100644 index e8456d2f59..0000000000 --- a/dependencies/main/java/codechicken/lib/model/cube/CCCubeLoader.java +++ /dev/null @@ -1,29 +0,0 @@ -package codechicken.lib.model.cube; - -import net.minecraft.client.resources.IResourceManager; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.ICustomModelLoader; -import net.minecraftforge.client.model.IModel; - -/** - * Created by covers1624 on 19/11/2016. - */ -public class CCCubeLoader implements ICustomModelLoader { - - public static final CCCubeLoader INSTANCE = new CCCubeLoader(); - - @Override - public void onResourceManagerReload(IResourceManager resourceManager) { - } - - @Override - public boolean accepts(ResourceLocation modelLocation) { - String path = modelLocation.getResourcePath(); - return modelLocation.getResourceDomain().equals("ccl") && (path.equals("cube") || path.equals("models/block/cube") || path.equals("models/item/cube")); - } - - @Override - public IModel loadModel(ResourceLocation modelLocation) throws Exception { - return CCModelCube.INSTANCE; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/cube/CCModelCube.java b/dependencies/main/java/codechicken/lib/model/cube/CCModelCube.java deleted file mode 100644 index 47802541dd..0000000000 --- a/dependencies/main/java/codechicken/lib/model/cube/CCModelCube.java +++ /dev/null @@ -1,158 +0,0 @@ -package codechicken.lib.model.cube; - -import codechicken.lib.model.BakedModelProperties; -import codechicken.lib.model.bakedmodels.PerspectiveAwareLayeredModelWrapper; -import codechicken.lib.texture.TextureUtils; -import com.google.common.base.Function; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.*; -import net.minecraftforge.common.model.IModelState; -import net.minecraftforge.common.model.TRSRTransformation; - -import java.util.*; -import java.util.Map.Entry; - -/** - * Created by covers1624 on 19/11/2016. - * TODO Document that this exists and what it does to jsons. - */ -public class CCModelCube implements IModel, IRetexturableModel, IModelSimpleProperties { - - public static String[] layerNames = { "solid", "cutout_mipped", "cutout", "translucent" }; - public static Map nameToLayer = new HashMap() { - { - put("solid", BlockRenderLayer.SOLID); - put("cutout_mipped", BlockRenderLayer.CUTOUT_MIPPED); - put("cutout", BlockRenderLayer.CUTOUT); - put("translucent", BlockRenderLayer.TRANSLUCENT); - } - }; - - public static CCModelCube INSTANCE = new CCModelCube(); - - private final ImmutableMap> layerFaceSpriteMap; - private boolean isAO; - private boolean gui3d; - - public CCModelCube() { - this(new HashMap>()); - } - - public CCModelCube(Map> layerFaceSpriteMap) { - this.layerFaceSpriteMap = ImmutableMap.copyOf(layerFaceSpriteMap); - } - - @Override - public Collection getDependencies() { - return Collections.singletonList(new ResourceLocation("minecraft:block/cube")); - } - - @Override - public Collection getTextures() { - List textures = new ArrayList(); - for (Entry> layerEnrty : layerFaceSpriteMap.entrySet()) { - for (Entry faceEntry : layerEnrty.getValue().entrySet()) { - textures.add(new ResourceLocation(faceEntry.getValue())); - } - } - return ImmutableList.copyOf(textures); - } - - @Override - public IBakedModel bake(IModelState state, VertexFormat format, Function bakedTextureGetter) { - - Map layerModelMap = new HashMap(); - TextureAtlasSprite particle = TextureUtils.getMissingSprite(); - for (Entry> layerEntry : layerFaceSpriteMap.entrySet()) { - Map kvTextures = new HashMap(); - for (Entry faceEntry : layerEntry.getValue().entrySet()) { - if (faceEntry.getKey() == null) { - kvTextures.put("particle", faceEntry.getValue()); - } else { - kvTextures.put(faceEntry.getKey().getName(), faceEntry.getValue()); - } - } - IModel vanillaModel = ModelLoaderRegistry.getModelOrLogError(new ResourceLocation("minecraft:block/cube"), "Unable to get vanilla model wrapper.."); - vanillaModel = ModelProcessingHelper.retexture(vanillaModel, ImmutableMap.copyOf(addMissing(kvTextures))); - IBakedModel model = vanillaModel.bake(state, format, bakedTextureGetter); - - if (layerEntry.getKey() == BlockRenderLayer.SOLID) { - particle = model.getParticleTexture(); - } - - layerModelMap.put(layerEntry.getKey(), model); - } - - return new PerspectiveAwareLayeredModelWrapper(layerModelMap, state, new BakedModelProperties(isAO, gui3d, particle)); - } - - private static Map addMissing(Map textures) { - Map newTextures = new HashMap(textures); - for (EnumFacing face : EnumFacing.VALUES) { - if (!textures.containsKey(face.getName())) { - newTextures.put("#" + face.getName(), ""); - } - } - return newTextures; - } - - @Override - public IModelState getDefaultState() { - return TRSRTransformation.identity(); - } - - @Override - public IModel retexture(ImmutableMap textures) { - Map> layerFaceSpriteMap = new HashMap>(); - - for (Entry entry : textures.entrySet()) { - EnumFacing face = getFaceForKey(entry.getKey()); - BlockRenderLayer layer = getLayerForTexKey(entry.getKey()); - Map faceMap = layerFaceSpriteMap.get(layer); - if (faceMap == null) { - faceMap = new HashMap(); - layerFaceSpriteMap.put(layer, faceMap); - } - faceMap.put(face, entry.getValue()); - } - - return new CCModelCube(layerFaceSpriteMap); - } - - private static BlockRenderLayer getLayerForTexKey(String key) { - String layerName = "solid"; - for (String l : layerNames) { - if (key.endsWith(l)) { - layerName = l; - } - } - return nameToLayer.get(layerName); - } - - public static EnumFacing getFaceForKey(String key) { - String faceName = key; - if (key.contains("_")) { - faceName = key.substring(0, key.indexOf("_")); - } - return EnumFacing.byName(faceName); - } - - @Override - public IModel smoothLighting(boolean value) { - this.isAO = value; - return this; - } - - @Override - public IModel gui3d(boolean value) { - this.gui3d = value; - return this; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/loader/CCBakedModelLoader.java b/dependencies/main/java/codechicken/lib/model/loader/CCBakedModelLoader.java deleted file mode 100644 index 525a0fa553..0000000000 --- a/dependencies/main/java/codechicken/lib/model/loader/CCBakedModelLoader.java +++ /dev/null @@ -1,215 +0,0 @@ -package codechicken.lib.model.loader; - -import codechicken.lib.model.loader.IBakedModelLoader.IModKeyProvider; -import codechicken.lib.texture.TextureUtils; -import codechicken.lib.texture.TextureUtils.IIconRegister; -import codechicken.lib.thread.RestartableTask; -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import com.google.common.collect.ImmutableList; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.resources.IResourceManager; -import net.minecraft.client.resources.IResourceManagerReloadListener; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.FMLLog; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.LoaderState; -import org.apache.logging.log4j.Level; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.Callable; -import java.util.concurrent.TimeUnit; - -/** - * Created by covers1624 on 7/25/2016. - * This is a flexible IBakedModel loader, It runs off IBakedModelLoaders and IModKeyProviders. - * When getModel(ItemStack) is called it will first try and obtain a IModKeyProvider, If no KeyProvider is found then it returns a null model. - * It then calls IModKeyProvider.createKey(ItemStack) if this returns null a null model is returned. - * It will then check the cache for a key -> IBakedModel reference, if the cache contains a model it is returned otherwise it bakes a model using IBakedModelLoader. - *

- * To use this call registerLoader(IBakedModelLoader) from PRE INIT! - * //TODO This system needs to be scrapped for the new BlockBakery system that was newly implemented. - */ -@Deprecated -public class CCBakedModelLoader implements IIconRegister, IResourceManagerReloadListener { - - public static final CCBakedModelLoader INSTANCE = new CCBakedModelLoader(); - - //TODO use cache factories. - private static final Cache modelCache = CacheBuilder.newBuilder().expireAfterAccess(30, TimeUnit.MINUTES).build(); - private static final Map modelBakeQue = new HashMap(); - - private static final ModelBakeTask bakingTask = new ModelBakeTask(); - - private static final Map modKeyProviders = new HashMap(); - private static final Map modelLoaders = new HashMap(); - - static { - TextureUtils.addIconRegister(INSTANCE); - TextureUtils.registerReloadListener(INSTANCE); - } - - /** - * Registers a IModKeyProvider and IBakedModelLoader. - * - * @param loader Registers a loader. - */ - public static void registerLoader(IBakedModelLoader loader) { - if (Loader.instance().hasReachedState(LoaderState.INITIALIZATION)) { - throw new RuntimeException("Unable to register IBakedModelLoader after Pre Initialization! Please register as the first thing you do in Pre Init!"); - } - if (modelLoaders.containsValue(loader)) { - throw new RuntimeException("Unable to register IBakedModelLoader as it has already been registered!"); - } - - IModKeyProvider provider = loader.createKeyProvider(); - FMLLog.log("CodeChicken Lib", Level.INFO, "Registered loader for mod: %s", provider.getMod()); - modelLoaders.put(provider, loader); - modKeyProviders.put(provider.getMod(), provider); - } - - @Override - public void registerIcons(TextureMap textureMap) { - for (ResourceLocation location : getTextures()) { - textureMap.registerSprite(location); - } - } - - @Override - public void onResourceManagerReload(IResourceManager resourceManager) { - modelCache.invalidateAll(); - } - - public static void clearCache() { - synchronized (modelCache) { - modelCache.invalidateAll(); - } - } - - private static Collection getTextures() { - ImmutableList.Builder builder = ImmutableList.builder(); - for (IBakedModelLoader loader : modelLoaders.values()) { - loader.addTextures(builder); - } - return builder.build(); - } - - public static synchronized IBakedModel getModel(IBlockState state) { - if (state.getBlock() == null || state.getBlock().getRegistryName() == null) { - return null; - } - ResourceLocation location = state.getBlock().getRegistryName(); - final IModKeyProvider provider = modKeyProviders.get(location.getResourceDomain()); - if (provider == null) { - FMLLog.bigWarning("Unable to find IModKeyProvider for domain %s!", location.getResourceDomain()); - return null; - } - final String key = provider.createKey(state); - if (key == null) { - return null; - } - String mapKey = location.toString() + "|" + key; - synchronized (modelCache) { - try { - return modelCache.get(mapKey, new Callable() { - @Override - public IBakedModel call() throws Exception { - return modelLoaders.get(provider).bakeModel(key); - } - }); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - } - - /** - * Call this from ItemOverrideList.handleItemState() - * - * @param stack The ItemStack to attempt to obtain a model for. - * @return The baked model if it can be found/generated, else null. - */ - public static synchronized IBakedModel getModel(ItemStack stack) { - if (stack.getItem() == null || stack.getItem().getRegistryName() == null) { - return null; - } - ResourceLocation location = stack.getItem().getRegistryName(); - IModKeyProvider provider = modKeyProviders.get(location.getResourceDomain()); - if (provider == null) { - FMLLog.bigWarning("Unable to find IModKeyProvider for domain %s!", location.getResourceDomain()); - return null; - } - String key = provider.createKey(stack); - if (key == null) { - return null; - } - String mapKey = location.toString() + "|" + key; - synchronized (modelCache) { - if (modelCache.getIfPresent(mapKey) == null) { - if (modelBakeQue.containsKey(mapKey)) { - return null; - } else { - bakingTask.stop(); - synchronized (modelBakeQue) { - modelBakeQue.put(mapKey, provider); - } - bakingTask.restart(); - } - } - return modelCache.getIfPresent(mapKey); - } - } - - public static class ModelBakeTask extends RestartableTask { - - public ModelBakeTask() { - super("CodeChicken Lib Dynamic model baking"); - } - - @Override - public void execute() { - Map localQue; - synchronized (modelBakeQue) { - localQue = new HashMap(modelBakeQue); - } - Iterator> queIterator = localQue.entrySet().iterator(); - while (queIterator.hasNext()) { - if (interrupted()) { - return; - } - Entry entry = queIterator.next(); - try { - IBakedModelLoader loader = modelLoaders.get(entry.getValue()); - String key = stripMapHeader(entry.getKey()); - IBakedModel model = loader.bakeModel(key); - queIterator.remove(); - - if (model != null) { - synchronized (modelCache) { - modelCache.put(entry.getKey(), model); - } - } - } catch (Exception e) { - FMLLog.log("CodeChickenLib Dyn Model baking", Level.FATAL, e, "A fatal exception has occurred whilst baking a model with key: %s", entry.getKey()); - } finally { - synchronized (modelBakeQue) { - modelBakeQue.remove(entry.getKey()); - } - } - } - } - - private static String stripMapHeader(String mapKey) { - int firstPipe = mapKey.indexOf('|'); - return mapKey.substring(firstPipe + 1); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/model/loader/IBakedModelLoader.java b/dependencies/main/java/codechicken/lib/model/loader/IBakedModelLoader.java deleted file mode 100644 index 4a6a3ebab7..0000000000 --- a/dependencies/main/java/codechicken/lib/model/loader/IBakedModelLoader.java +++ /dev/null @@ -1,77 +0,0 @@ -package codechicken.lib.model.loader; - -import com.google.common.collect.ImmutableList; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -/** - * Created by covers1624 on 7/25/2016. - *

- * This defines a sub bakery of CCBakedModelLoader - * See EnderStorage's EnderStorageBakedModelProvider for a "Default" implementation. - */ -@Deprecated -public interface IBakedModelLoader { - - /** - * This defines a Mod Key provider. - */ - @Deprecated - interface IModKeyProvider { - - /** - * Gets the mod to operate for. - * - * @return The mod id used in your Item.setRegistryName() CAPS SENSITIVE. - */ - String getMod(); - - /** - * Creates a unique key for your item that you can use to create models for. - * Return something like "key1=value1,key2=value2,key3=value3" but can realistically be what ever you want. - * - * @param stack Stack to create a key for. - * @return The key created, null if the item is not supported. - */ - String createKey(ItemStack stack); - - /** - * Creates a unique key for your BlockState that you can use to create models for. - * Return something like "key1=value1,key2=value2,key3=value3" but can realistically be what ever you want. - *

- * This should be used to create a key for the BlockState, handle the face culling in the model you return! - * - * @param state IBlockState to create a key for. - * @return The key created, null if IBlockState is not supported. - */ - String createKey(IBlockState state); - } - - /** - * Used to associate a IModKeyProvider with a IBakedModelLoader. - * - * @return Your key provider. - */ - IModKeyProvider createKeyProvider(); - - /** - * Any textures you want added to the texture map. - * - * @param builder The Builder to add textures to. - */ - void addTextures(ImmutableList.Builder builder); - - /** - * Uses the key provided from the IModKeyProvider to bake a model from your unique key. - * Form your key you should have some sort of indication of what exactly you are baking. - *

- * If it is a "In World" model then it can just be a simple wrapper as the override model just calls getQuads. - * - * @param key Your Unique key. - * @return The baked model created, null if it cannot for some reason. - */ - IBakedModel bakeModel(String key); - -} diff --git a/dependencies/main/java/codechicken/lib/model/modelbase/CCModelBase.java b/dependencies/main/java/codechicken/lib/model/modelbase/CCModelBase.java deleted file mode 100644 index 9417a8f710..0000000000 --- a/dependencies/main/java/codechicken/lib/model/modelbase/CCModelBase.java +++ /dev/null @@ -1,74 +0,0 @@ -package codechicken.lib.model.modelbase; - -import codechicken.lib.render.CCModel; -import codechicken.lib.vec.uv.UV; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import net.minecraft.client.renderer.VertexBuffer; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; - -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Random; - -/** - * Created by covers1624 on 8/24/2016. - * TODO, instead of just copying how vanillas works, create a wrapper that pulls data from existing ModelBases and allows some sort of Animation callback. - */ -public abstract class CCModelBase { - - public float swingProgress; - public boolean isRiding; - public boolean isChild = true; - public List boxList = Lists.newArrayList(); - private final Map modelTextureMap = Maps.newHashMap(); - public int textureWidth = 64; - public int textureHeight = 32; - - public CCModelRenderer getRandomModelBox(Random rand) { - return this.boxList.get(rand.nextInt(this.boxList.size())); - } - - protected void setTextureOffset(String partName, int x, int y) { - this.modelTextureMap.put(partName, new UV(x, y)); - } - - public UV getTextureOffset(String partName) { - return this.modelTextureMap.get(partName); - } - - public static void copyModelAngles(CCModelRenderer source, CCModelRenderer dest) { - dest.rotateAngleX = source.rotateAngleX; - dest.rotateAngleY = source.rotateAngleY; - dest.rotateAngleZ = source.rotateAngleZ; - dest.rotationPointX = source.rotationPointX; - dest.rotationPointY = source.rotationPointY; - dest.rotationPointZ = source.rotationPointZ; - } - - public void setModelAttributes(CCModelBase model) { - this.swingProgress = model.swingProgress; - this.isRiding = model.isRiding; - this.isChild = model.isChild; - } - - public static void renderModels(float scale, VertexBuffer buffer, TextureAtlasSprite sprite, CCModelRenderer... modelRenders) { - LinkedList models = new LinkedList(); - for (CCModelRenderer modelRenderer : modelRenders) { - models.add(modelRenderer.bake(scale)); - } - CCModel model = CCModel.combine(models); - - //TODO - //CCRenderState.bind(buffer); - //boolean startDrawing = !CCRenderState.isDrawing(); - //if (startDrawing) { - // CCRenderState.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); - //} - //model.render(); - //if (startDrawing) { - // CCRenderState.draw(); - //} - } -} diff --git a/dependencies/main/java/codechicken/lib/model/modelbase/CCModelBox.java b/dependencies/main/java/codechicken/lib/model/modelbase/CCModelBox.java deleted file mode 100644 index 5b0ffde5e1..0000000000 --- a/dependencies/main/java/codechicken/lib/model/modelbase/CCModelBox.java +++ /dev/null @@ -1,130 +0,0 @@ -package codechicken.lib.model.modelbase; - -import codechicken.lib.colour.Colour; -import codechicken.lib.colour.ColourRGBA; -import codechicken.lib.model.bakery.CCQuad; -import codechicken.lib.vec.Vertex5; - -/** - * Created by covers1624 on 8/24/2016. - * TODO CCModel. - */ -public class CCModelBox { - - private final CCQuad[] quads; - public final float posX1; - public final float posY1; - public final float posZ1; - public final float posX2; - public final float posY2; - public final float posZ2; - public String boxName; - - public CCModelBox(CCModelRenderer renderer, int textureX, int textureY, float xOffset, float yOffset, float zOffset, int width, int height, int depth, float scaleFactor) { - this(renderer, textureX, textureY, xOffset, yOffset, zOffset, width, height, depth, scaleFactor, renderer.mirror); - } - - public CCModelBox(CCModelRenderer renderer, int textureX, int textureY, float xOffset, float yOffset, float zOffset, int width, int height, int depth, float scaleFactor, boolean mirrored) { - - this.posX1 = xOffset; - this.posY1 = yOffset; - this.posZ1 = zOffset; - this.posX2 = xOffset + (float) width; - this.posY2 = yOffset + (float) height; - this.posZ2 = zOffset + (float) depth; - this.quads = new CCQuad[6]; - float f = xOffset + (float) width; - float f1 = yOffset + (float) height; - float f2 = zOffset + (float) depth; - xOffset = xOffset - scaleFactor; - yOffset = yOffset - scaleFactor; - zOffset = zOffset - scaleFactor; - f = f + scaleFactor; - f1 = f1 + scaleFactor; - f2 = f2 + scaleFactor; - - if (mirrored) { - float f3 = f; - f = xOffset; - xOffset = f3; - } - Vertex5[] verts = new Vertex5[8]; - verts[0] = new Vertex5(xOffset, yOffset, zOffset, 0.0F, 0.0F); - verts[1] = new Vertex5(f, yOffset, zOffset, 0.0F, 8.0F); - verts[2] = new Vertex5(f, f1, zOffset, 8.0F, 8.0F); - verts[3] = new Vertex5(xOffset, f1, zOffset, 8.0F, 0.0F); - verts[4] = new Vertex5(xOffset, yOffset, f2, 0.0F, 0.0F); - verts[5] = new Vertex5(f, yOffset, f2, 0.0F, 8.0F); - verts[6] = new Vertex5(f, f1, f2, 8.0F, 8.0F); - verts[7] = new Vertex5(xOffset, f1, f2, 8.0F, 0.0F); - quads[0] = setTextureCoords(new CCQuad(verts[5], verts[1], verts[2], verts[6]), textureX + depth + width, textureY + depth, textureX + depth + width + depth, textureY + depth + height, renderer.textureWidth, renderer.textureHeight); - quads[1] = setTextureCoords(new CCQuad(verts[0], verts[4], verts[7], verts[3]), textureX, textureY + depth, textureX + depth, textureY + depth + height, renderer.textureWidth, renderer.textureHeight); - quads[2] = setTextureCoords(new CCQuad(verts[5], verts[4], verts[0], verts[1]), textureX + depth, textureY, textureX + depth + width, textureY + depth, renderer.textureWidth, renderer.textureHeight); - quads[3] = setTextureCoords(new CCQuad(verts[2], verts[3], verts[7], verts[6]), textureX + depth + width, textureY + depth, textureX + depth + width + width, textureY, renderer.textureWidth, renderer.textureHeight); - quads[4] = setTextureCoords(new CCQuad(verts[1], verts[0], verts[3], verts[2]), textureX + depth, textureY + depth, textureX + depth + width, textureY + depth + height, renderer.textureWidth, renderer.textureHeight); - quads[5] = setTextureCoords(new CCQuad(verts[4], verts[5], verts[6], verts[7]), textureX + depth + width + depth, textureY + depth, textureX + depth + width + depth + width, textureY + depth + height, renderer.textureWidth, renderer.textureHeight); - for (CCQuad quad : quads) { - quad.computeNormals(); - fillQuadData(quad); - if (mirrored) { - flipQuad(quad); - } - } - } - - private CCQuad setTextureCoords(CCQuad quad, int texCoordU1, int texCoordV1, int texCoordU2, int texCoordV2, double textureWidth, double textureHeight) { - double f = 0.0D / textureWidth; - double f1 = 0.0D / textureHeight; - quad.vertices[0].uv.set(texCoordU2 / textureWidth - f, texCoordV1 / textureHeight + f1); - quad.vertices[1].uv.set(texCoordU1 / textureWidth + f, texCoordV1 / textureHeight + f1); - quad.vertices[2].uv.set(texCoordU1 / textureWidth + f, texCoordV2 / textureHeight - f1); - quad.vertices[2].uv.set(texCoordU2 / textureWidth - f, texCoordV2 / textureHeight - f1); - return quad; - } - - private CCQuad fillQuadData(CCQuad quad) { - Colour[] colours = new Colour[quad.colours.length]; - for (int i = 0; i < quad.colours.length; i++) { - Colour colour = quad.colours[i]; - if (colour == null) { - colour = new ColourRGBA(0xFFFFFFFF); - } - colours[i] = colour; - } - quad.colours = colours; - - Integer[] lightMaps = new Integer[quad.lightMaps.length]; - for (int i = 0; i < quad.lightMaps.length; i++) { - Integer lightMap = quad.lightMaps[i]; - if (lightMap == null) { - lightMap = 0; - } - lightMaps[i] = lightMap; - } - quad.lightMaps = lightMaps; - return quad; - } - - public CCQuad flipQuad(CCQuad quad) { - Vertex5[] verts = new Vertex5[4]; - verts[0] = quad.vertices[3]; - verts[1] = quad.vertices[2]; - verts[2] = quad.vertices[1]; - verts[3] = quad.vertices[0]; - quad.vertices = verts; - return quad; - } - - public CCQuad[] getQuads() { - CCQuad[] quads = new CCQuad[this.quads.length]; - for (int i = 0; i < quads.length; i++) { - quads[i] = this.quads[i].copy(); - } - return quads; - } - - public CCModelBox setBoxName(String name) { - this.boxName = name; - return this; - } -} diff --git a/dependencies/main/java/codechicken/lib/model/modelbase/CCModelRenderer.java b/dependencies/main/java/codechicken/lib/model/modelbase/CCModelRenderer.java deleted file mode 100644 index b2cdf5af7e..0000000000 --- a/dependencies/main/java/codechicken/lib/model/modelbase/CCModelRenderer.java +++ /dev/null @@ -1,279 +0,0 @@ -package codechicken.lib.model.modelbase; - -import codechicken.lib.model.bakery.CCQuad; -import codechicken.lib.render.CCModel; -import codechicken.lib.vec.*; -import codechicken.lib.vec.uv.UV; -import com.google.common.collect.Lists; -import net.minecraft.client.renderer.VertexBuffer; -import org.lwjgl.opengl.GL11; - -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -/** - * Created by covers1624 on 8/24/2016. - * A ModelRenderer that is compatible with FastTESR's. - * TODO See CCModelBase's comment, - */ -public class CCModelRenderer { - - public float textureWidth; - public float textureHeight; - private int textureOffsetX; - private int textureOffsetY; - public float rotationPointX; - public float rotationPointY; - public float rotationPointZ; - public float rotateAngleX; - public float rotateAngleY; - public float rotateAngleZ; - public boolean mirror; - public boolean showModel; - public boolean isHidden; - - private CCModel compiledModel; - public boolean compiled; - - public List cubeList; - public List childModels; - public final String boxName; - private final CCModelBase baseModel; - public float offsetX; - public float offsetY; - public float offsetZ; - - public CCModelRenderer(CCModelBase model, String boxNameIn) { - this.textureWidth = 64.0F; - this.textureHeight = 32.0F; - this.showModel = true; - this.cubeList = Lists.newArrayList(); - this.baseModel = model; - model.boxList.add(this); - this.boxName = boxNameIn; - this.setTextureSize(model.textureWidth, model.textureHeight); - } - - public CCModelRenderer(CCModelBase model) { - this(model, null); - } - - public CCModelRenderer(CCModelBase model, int texOffX, int texOffY) { - this(model); - this.setTextureOffset(texOffX, texOffY); - } - - public void addChild(CCModelRenderer renderer) { - if (this.childModels == null) { - this.childModels = Lists.newArrayList(); - } - - this.childModels.add(renderer); - } - - public CCModelRenderer setTextureOffset(int x, int y) { - this.textureOffsetX = x; - this.textureOffsetY = y; - return this; - } - - public CCModelRenderer addBox(String partName, float offX, float offY, float offZ, int width, int height, int depth) { - partName = this.boxName + "." + partName; - UV textureOffset = this.baseModel.getTextureOffset(partName); - this.setTextureOffset((int) textureOffset.u, (int) textureOffset.v); - this.cubeList.add((new CCModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, 0.0F)).setBoxName(partName)); - return this; - } - - public CCModelRenderer addBox(float offX, float offY, float offZ, int width, int height, int depth) { - this.cubeList.add(new CCModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, 0.0F)); - return this; - } - - public CCModelRenderer addBox(float offX, float offY, float offZ, int width, int height, int depth, boolean mirrored) { - this.cubeList.add(new CCModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, 0.0F, mirrored)); - return this; - } - - public void addBox(float offX, float offY, float offZ, int width, int height, int depth, float scaleFactor) { - this.cubeList.add(new CCModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, scaleFactor)); - } - - public void setRotationPoint(float rotationPointXIn, float rotationPointYIn, float rotationPointZIn) { - this.rotationPointX = rotationPointXIn; - this.rotationPointY = rotationPointYIn; - this.rotationPointZ = rotationPointZIn; - } - - public void render(float scale, VertexBuffer buffer) { - //TODO - //CCRenderState.bind(buffer); - //boolean startDrawing = !CCRenderState.isDrawing(); - //if (startDrawing) { - // CCRenderState.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); - //} - //bake(scale).render(); - //if (startDrawing) { - // CCRenderState.draw(); - //} - } - - public CCModel bake(float scale) { - if (!this.isHidden) { - if (this.showModel) { - if (!this.compiled) { - this.compileModel(scale); - } - LinkedList transforms = new LinkedList(); - LinkedList finalModelElements = new LinkedList(); - transforms.add(new Translation(offsetX, offsetY, offsetZ)); - //GlStateManager.translate(this.offsetX, this.offsetY, this.offsetZ); - - if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { - if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) { - //GlStateManager.callList(this.displayList); - finalModelElements.add(compiledModel.copy()); - if (this.childModels != null) { - for (CCModelRenderer modelRenderer : childModels) { - finalModelElements.add(modelRenderer.bake(scale).copy()); - } - } - } else { - transforms.add(new Translation(rotationPointX * scale, rotationPointY * scale, rotationPointZ * scale)); - //GlStateManager.translate(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); - //GlStateManager.callList(this.displayList); - finalModelElements.add(compiledModel.copy()); - - if (this.childModels != null) { - for (CCModelRenderer modelRenderer : childModels) { - finalModelElements.add(modelRenderer.bake(scale).copy()); - } - } - - //GlStateManager.translate(-this.rotationPointX * scale, -this.rotationPointY * scale, -this.rotationPointZ * scale); - } - } else { - //GlStateManager.pushMatrix(); - //GlStateManager.translate(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); - transforms.add(new Translation(rotationPointX * scale, rotationPointY * scale, rotationPointZ * scale)); - - if (this.rotateAngleZ != 0.0F) { - transforms.add(new Rotation(rotateAngleZ, new Vector3(0, 0, 1).normalize())); - //GlStateManager.rotate(this.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F); - } - - if (this.rotateAngleY != 0.0F) { - transforms.add(new Rotation(rotateAngleY, new Vector3(0, 1, 0).normalize())); - //GlStateManager.rotate(this.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); - } - - if (this.rotateAngleX != 0.0F) { - transforms.add(new Rotation(rotateAngleZ, new Vector3(1, 0, 0).normalize())); - //GlStateManager.rotate(this.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F); - } - finalModelElements.add(compiledModel.copy()); - //GlStateManager.callList(this.displayList); - - if (this.childModels != null) { - for (CCModelRenderer modelRenderer : childModels) { - finalModelElements.add(modelRenderer.bake(scale).copy()); - } - } - - //GlStateManager.popMatrix(); - } - - //GlStateManager.translate(-this.offsetX, -this.offsetY, -this.offsetZ); - return CCModel.combine(finalModelElements).apply(new TransformationList(transforms.toArray(new Transformation[transforms.size()]))); - } - } - return CCModel.newModel(GL11.GL_QUADS); - } - - /*public void renderWithRotation(float scale, VertexBuffer buffer) { - if (!this.isHidden) { - if (this.showModel) { - if (!this.compiled) { - this.compileModel(scale, buffer.getVertexFormat()); - } - - GlStateManager.pushMatrix(); - GlStateManager.translate(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); - - if (this.rotateAngleY != 0.0F) { - GlStateManager.rotate(this.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); - } - - if (this.rotateAngleX != 0.0F) { - GlStateManager.rotate(this.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F); - } - - if (this.rotateAngleZ != 0.0F) { - GlStateManager.rotate(this.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F); - } - - GlStateManager.callList(this.displayList); - GlStateManager.popMatrix(); - } - } - }*/ - - //@SideOnly(Side.CLIENT) - /*public void postRender(float scale, VertexBuffer buffer) { - if (!this.isHidden) { - if (this.showModel) { - if (!this.compiled) { - this.compileModel(scale, buffer.getVertexFormat()); - } - - if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { - if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) { - GlStateManager.translate(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); - } - } else { - GlStateManager.translate(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); - - if (this.rotateAngleZ != 0.0F) { - GlStateManager.rotate(this.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F); - } - - if (this.rotateAngleY != 0.0F) { - GlStateManager.rotate(this.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); - } - - if (this.rotateAngleX != 0.0F) { - GlStateManager.rotate(this.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F); - } - } - } - } - }*/ - - private CCModel compileModel(float scale) { - if (compiled) { - return compiledModel; - } - - CCModel model = CCModel.newModel(GL11.GL_QUADS); - LinkedList vertices = new LinkedList(); - for (CCModelBox box : cubeList) { - for (CCQuad quad : box.getQuads()) { - Collections.addAll(vertices, quad.vertices); - } - } - model.verts = vertices.toArray(new Vertex5[vertices.size()]); - model.computeNormals(); - - compiledModel = model.copy().apply(new Scale(scale)); - - this.compiled = true; - return compiledModel; - } - - public CCModelRenderer setTextureSize(int textureWidthIn, int textureHeightIn) { - this.textureWidth = (float) textureWidthIn; - this.textureHeight = (float) textureHeightIn; - return this; - } -} diff --git a/dependencies/main/java/codechicken/lib/packet/ICustomPacketTile.java b/dependencies/main/java/codechicken/lib/packet/ICustomPacketTile.java deleted file mode 100644 index a760696f20..0000000000 --- a/dependencies/main/java/codechicken/lib/packet/ICustomPacketTile.java +++ /dev/null @@ -1,12 +0,0 @@ -package codechicken.lib.packet; - -import codechicken.lib.data.MCDataInput; -import codechicken.lib.data.MCDataOutput; - -public interface ICustomPacketTile { - - void writeToPacket(MCDataOutput packet); - - void readFromPacket(MCDataInput packet); - -} diff --git a/dependencies/main/java/codechicken/lib/packet/PacketCustom.java b/dependencies/main/java/codechicken/lib/packet/PacketCustom.java deleted file mode 100644 index 8301937e46..0000000000 --- a/dependencies/main/java/codechicken/lib/packet/PacketCustom.java +++ /dev/null @@ -1,583 +0,0 @@ -package codechicken.lib.packet; - -import codechicken.lib.data.MCDataHandler; -import codechicken.lib.data.MCDataIO; -import com.google.common.collect.Maps; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.channel.SimpleChannelInboundHandler; -import io.netty.handler.codec.EncoderException; -import io.netty.util.AttributeKey; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.INetHandler; -import net.minecraft.network.NetHandlerPlayServer; -import net.minecraft.network.Packet; -import net.minecraft.network.PacketBuffer; -import net.minecraft.network.play.INetHandlerPlayClient; -import net.minecraft.network.play.INetHandlerPlayServer; -import net.minecraft.network.play.server.SPacketUpdateTileEntity; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.management.PlayerChunkMapEntry; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.ModContainer; -import net.minecraftforge.fml.common.network.FMLEmbeddedChannel; -import net.minecraftforge.fml.common.network.FMLOutboundHandler; -import net.minecraftforge.fml.common.network.NetworkHandshakeEstablished; -import net.minecraftforge.fml.common.network.NetworkRegistry; -import net.minecraftforge.fml.common.network.handshake.NetworkDispatcher; -import net.minecraftforge.fml.common.network.internal.FMLProxyPacket; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.io.IOException; -import java.util.EnumMap; -import java.util.zip.Deflater; -import java.util.zip.Inflater; - -public final class PacketCustom extends PacketBuffer implements MCDataHandler { - - public interface ICustomPacketHandler { - - } - - public interface IClientPacketHandler extends ICustomPacketHandler { - - void handlePacket(PacketCustom packetCustom, Minecraft mc, INetHandlerPlayClient handler); - } - - public interface IServerPacketHandler extends ICustomPacketHandler { - - void handlePacket(PacketCustom packetCustom, EntityPlayerMP sender, INetHandlerPlayServer handler); - } - - public static AttributeKey cclHandler = new AttributeKey("ccl:handler"); - - @ChannelHandler.Sharable - public static class CustomInboundHandler extends SimpleChannelInboundHandler { - - public EnumMap handlers = Maps.newEnumMap(Side.class); - - @Override - public void handlerAdded(ChannelHandlerContext ctx) throws Exception { - super.handlerAdded(ctx); - ctx.channel().attr(cclHandler).set(this); - } - - @Override - protected void channelRead0(ChannelHandlerContext ctx, FMLProxyPacket msg) throws Exception { - handlers.get(ctx.channel().attr(NetworkRegistry.CHANNEL_SOURCE).get()).handle(ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL).get(), new PacketCustom(msg.payload())); - } - } - - private interface CustomHandler { - - void handle(INetHandler handler, String channel, PacketCustom packet); - } - - public static class ClientInboundHandler implements CustomHandler { - - private IClientPacketHandler handler; - - public ClientInboundHandler(ICustomPacketHandler handler) { - this.handler = (IClientPacketHandler) handler; - } - - @Override - public void handle(final INetHandler netHandler, final String channel, final PacketCustom packet) { - if (netHandler instanceof INetHandlerPlayClient) { - Minecraft mc = Minecraft.getMinecraft(); - if (!mc.isCallingFromMinecraftThread()) { - mc.addScheduledTask(new Runnable() { - public void run() { - handle(netHandler, channel, packet); - } - }); - } else { - handler.handlePacket(packet, mc, (INetHandlerPlayClient) netHandler); - } - } else { - System.err.println("Invalid INetHandler for PacketCustom on channel: " + channel); - } - } - } - - public static class ServerInboundHandler implements CustomHandler { - - private IServerPacketHandler handler; - - public ServerInboundHandler(ICustomPacketHandler handler) { - this.handler = (IServerPacketHandler) handler; - } - - @Override - public void handle(final INetHandler netHandler, final String channel, final PacketCustom packet) { - if (netHandler instanceof NetHandlerPlayServer) { - MinecraftServer mc = FMLCommonHandler.instance().getMinecraftServerInstance(); - if (!mc.isCallingFromMinecraftThread()) { - mc.addScheduledTask(new Runnable() { - public void run() { - handle(netHandler, channel, packet); - } - }); - } else { - handler.handlePacket(packet, ((NetHandlerPlayServer) netHandler).playerEntity, (INetHandlerPlayServer) netHandler); - } - } else { - System.err.println("Invalid INetHandler for PacketCustom on channel: " + channel); - } - } - } - - public interface IHandshakeHandler { - - void handshakeReceived(NetHandlerPlayServer netHandler); - } - - public static class HandshakeInboundHandler extends ChannelInboundHandlerAdapter { - - public IHandshakeHandler handler; - - public HandshakeInboundHandler(IHandshakeHandler handler) { - this.handler = handler; - } - - @Override - public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { - if (evt instanceof NetworkHandshakeEstablished) { - INetHandler netHandler = ((NetworkDispatcher) ctx.channel().attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).get()).getNetHandler(); - if (netHandler instanceof NetHandlerPlayServer) { - handler.handshakeReceived((NetHandlerPlayServer) netHandler); - } - } else { - ctx.fireUserEventTriggered(evt); - } - } - } - - public static String channelName(Object channelKey) { - if (channelKey instanceof String) { - return (String) channelKey; - } - if (channelKey instanceof ModContainer) { - String s = ((ModContainer) channelKey).getModId(); - if (s.length() > 20) { - throw new IllegalArgumentException("Mod ID (" + s + ") too long for use as channel (20 chars). Use a string identifier"); - } - return s; - } - - ModContainer mc = FMLCommonHandler.instance().findContainerFor(channelKey); - if (mc != null) { - return mc.getModId(); - } - - throw new IllegalArgumentException("Invalid channel: " + channelKey); - } - - public static FMLEmbeddedChannel getOrCreateChannel(String channelName, Side side) { - if (!NetworkRegistry.INSTANCE.hasChannel(channelName, side)) { - NetworkRegistry.INSTANCE.newChannel(channelName, new CustomInboundHandler()); - } - return NetworkRegistry.INSTANCE.getChannel(channelName, side); - } - - public static void assignHandler(Object channelKey, ICustomPacketHandler handler) { - String channelName = channelName(channelKey); - Side side = handler instanceof IServerPacketHandler ? Side.SERVER : Side.CLIENT; - FMLEmbeddedChannel channel = getOrCreateChannel(channelName, side); - channel.attr(cclHandler).get().handlers.put(side, side == Side.SERVER ? new ServerInboundHandler(handler) : new ClientInboundHandler(handler)); - } - - public static void assignHandshakeHandler(Object channelKey, IHandshakeHandler handler) { - FMLEmbeddedChannel channel = getOrCreateChannel(channelName(channelKey), Side.SERVER); - channel.pipeline().addLast(new HandshakeInboundHandler(handler)); - } - - private String channel; - private int type; - - public PacketCustom(ByteBuf payload) { - super(payload); - - type = readUnsignedByte(); - if (type > 0x80) { - decompress(); - } - type &= 0x7F; - } - - public PacketCustom(Object channelKey, int type) { - super(Unpooled.buffer()); - if (type <= 0 || type >= 0x80) { - throw new IllegalArgumentException("Packet type: " + type + " is not within required 0 < t < 0x80"); - } - - this.channel = channelName(channelKey); - this.type = type; - writeByte(type); - } - - /** - * Decompresses the remaining ByteBuf (after type has been read) using Snappy - */ - private void decompress() { - Inflater inflater = new Inflater(); - try { - int len = readVarInt(); - byte[] out = new byte[len]; - inflater.setInput(array(), readerIndex(), readableBytes()); - inflater.inflate(out); - clear(); - writeArray(out); - - } catch (Exception e) { - throw new EncoderException(e); - } finally { - inflater.end(); - } - } - - /** - * Compresses the payload ByteBuf after the type byte - */ - private void do_compress() { - Deflater deflater = new Deflater(); - try { - readerIndex(1); - int len = readableBytes(); - deflater.setInput(array(), readerIndex(), len); - deflater.finish(); - byte[] out = new byte[len]; - int clen = deflater.deflate(out); - if (clen >= len - 5 || !deflater.finished())//not worth compressing, gets larger - { - return; - } - clear(); - writeByte(type | 0x80); - writeVarInt(len); - writeArray(out); - } catch (Exception e) { - throw new EncoderException(e); - } finally { - readerIndex(0); - deflater.end(); - } - } - - public boolean incoming() { - return channel == null; - } - - public int getType() { - return type & 0x7F; - } - - public PacketCustom compress() { - if (incoming()) { - throw new IllegalStateException("Tried to compress an incoming packet"); - } - if ((type & 0x80) != 0) { - throw new IllegalStateException("Packet already compressed"); - } - type |= 0x80; - return this; - } - - @Override - public PacketCustom writeBoolean(boolean b) { - super.writeBoolean(b); - return this; - } - - @Override - public PacketCustom writeByte(int b) { - super.writeByte(b); - return this; - } - - @Override - public PacketCustom writeShort(int s) { - super.writeShort(s); - return this; - } - - @Override - public PacketCustom writeInt(int i) { - super.writeInt(i); - return this; - } - - @Override - public PacketCustom writeFloat(float f) { - super.writeFloat(f); - return this; - } - - @Override - public PacketCustom writeDouble(double d) { - super.writeDouble(d); - return this; - } - - @Override - public PacketCustom writeLong(long l) { - super.writeLong(l); - return this; - } - - @Override - public PacketCustom writeChar(char c) { - super.writeChar(c); - return this; - } - - @Override - - public PacketCustom writeVarInt(int i) { - writeVarIntToBuffer(i); - return this; - } - - @Override - public PacketCustom writeVarShort(int s) { - MCDataIO.writeVarShort(this, s); - return this; - } - - @Override - public PacketCustom writeArray(byte[] barray) { - writeBytes(barray); - return this; - } - - @Override - public PacketCustom writeString(String s) { - super.writeString(s); - return this; - } - - public PacketCustom writeLocation(ResourceLocation loc) { - writeString(loc.toString()); - return this; - } - - @Override - public PacketCustom writePos(BlockPos pos) { - writeInt(pos.getX()); - writeInt(pos.getY()); - writeInt(pos.getZ()); - return this; - } - - @Override - public PacketCustom writeBlockPos(BlockPos pos) { - return writePos(pos); - } - - @Override - public PacketCustom writeItemStack(ItemStack stack) { - MCDataIO.writeItemStack(this, stack); - return this; - } - - @Override - public PacketCustom writeNBTTagCompound(NBTTagCompound tag) { - writeNBTTagCompoundToBuffer(tag); - return this; - } - - @Override - public PacketCustom writeFluidStack(FluidStack fluid) { - MCDataIO.writeFluidStack(this, fluid); - return this; - } - - public short readUByte() { - return readUnsignedByte(); - } - - public int readUShort() { - return readUnsignedShort(); - } - - @Override - public int readVarShort() { - return MCDataIO.readVarShort(this); - } - - @Override - public int readVarInt() { - return readVarIntFromBuffer(); - } - - @Override - public BlockPos readPos() { - return new BlockPos(readInt(), readInt(), readInt()); - } - - @Override - public BlockPos readBlockPos() { - return readPos(); - } - - @Override - public byte[] readArray(int length) { - return readBytes(length).array(); - } - - @Override - public String readString() { - return readStringFromBuffer(32767); - } - - //TODO 1.11 pull to MC data in / out. - public ResourceLocation readLocation() { - return new ResourceLocation(readString()); - } - - @Override - public ItemStack readItemStack() { - return MCDataIO.readItemStack(this); - } - - @Override - public NBTTagCompound readNBTTagCompound() { - try { - return readNBTTagCompoundFromBuffer(); - } catch (IOException e) { - throw new EncoderException(e); - } - } - - @Override - public FluidStack readFluidStack() { - return MCDataIO.readFluidStack(this); - } - - public FMLProxyPacket toPacket() { - if (incoming()) { - throw new IllegalStateException("Tried to write an incoming packet"); - } - - if (readableBytes() > 32000 || (type & 0x80) != 0) { - do_compress(); - } - - return new FMLProxyPacket(new PacketBuffer(copy()), channel); - } - - public NBTTagCompound toNBTTag(NBTTagCompound tagCompound) { - tagCompound.setByteArray("CCL:data", array()); - return tagCompound; - } - - public NBTTagCompound toNBTTag() { - NBTTagCompound tagCompound = new NBTTagCompound(); - tagCompound.setByteArray("CCL:data", array()); - return tagCompound; - } - - public static PacketCustom fromNBTTag(NBTTagCompound tagCompound) { - return new PacketCustom(Unpooled.copiedBuffer(tagCompound.getByteArray("CCL:data"))); - } - - public SPacketUpdateTileEntity toTilePacket(BlockPos pos) { - return new SPacketUpdateTileEntity(pos, 0, toNBTTag()); - } - - @SideOnly (Side.CLIENT) - public static PacketCustom fromTilePacket(SPacketUpdateTileEntity tilePacket) { - return fromNBTTag(tilePacket.getNbtCompound()); - } - - public void sendToPlayer(EntityPlayer player) { - sendToPlayer(toPacket(), player); - } - - public static void sendToPlayer(Packet packet, EntityPlayer player) { - if (player == null) { - sendToClients(packet); - } else { - ((EntityPlayerMP) player).connection.sendPacket(packet); - } - } - - public void sendToClients() { - sendToClients(toPacket()); - } - - public static void sendToClients(Packet packet) { - FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().sendPacketToAllPlayers(packet); - } - - public void sendPacketToAllAround(BlockPos pos, double range, int dim) { - sendPacketToAllAround(pos.getX(), pos.getY(), pos.getZ(), range, dim); - } - - public void sendPacketToAllAround(double x, double y, double z, double range, int dim) { - sendToAllAround(toPacket(), x, y, z, range, dim); - } - - public static void sendToAllAround(Packet packet, double x, double y, double z, double range, int dim) { - FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().sendToAllNearExcept(null, x, y, z, range, dim, packet); - } - - public void sendToDimension(int dim) { - sendToDimension(toPacket(), dim); - } - - public static void sendToDimension(Packet packet, int dim) { - FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().sendPacketToAllPlayersInDimension(packet, dim); - } - - public void sendToChunk(TileEntity tile) { - sendToChunk(tile.getWorld(), tile.getPos().getX() >> 4, tile.getPos().getZ() >> 4); - } - - public void sendToChunk(World world, int chunkX, int chunkZ) { - sendToChunk(toPacket(), world, chunkX, chunkZ); - } - - public static void sendToChunk(Packet packet, World world, int chunkX, int chunkZ) { - PlayerChunkMapEntry playerInstance = ((WorldServer) world).getPlayerChunkMap().getEntry(chunkX, chunkZ); - if (playerInstance != null) { - playerInstance.sendPacket(packet); - } - } - - public void sendToOps() { - sendToOps(toPacket()); - } - - public static void sendToOps(Packet packet) { - for (EntityPlayerMP player : FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerList()) { - if (FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().canSendCommands(player.getGameProfile())) { - sendToPlayer(packet, player); - } - } - } - - @SideOnly (Side.CLIENT) - public void sendToServer() { - sendToServer(toPacket()); - } - - @SideOnly (Side.CLIENT) - public static void sendToServer(Packet packet) { - Minecraft.getMinecraft().getConnection().sendPacket(packet); - } -} diff --git a/dependencies/main/java/codechicken/lib/raytracer/CuboidRayTraceResult.java b/dependencies/main/java/codechicken/lib/raytracer/CuboidRayTraceResult.java deleted file mode 100644 index 5261c0ff3e..0000000000 --- a/dependencies/main/java/codechicken/lib/raytracer/CuboidRayTraceResult.java +++ /dev/null @@ -1,54 +0,0 @@ -package codechicken.lib.raytracer; - -import codechicken.lib.vec.Vector3; -import net.minecraft.entity.Entity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; - -/** - * Created by covers1624 on 8/9/2016. - * This class is kind of special as if you return this in Block.collisionRayTrace, when the blocks HitBox is rendered it will cancel and use the cuboid provided here. - * This is to get around the fact that it is currently impossible to determine from Block.getSelectedBoundingBox what sub box to render as you have absolutely no player context to do a trace. - */ -public class CuboidRayTraceResult extends DistanceRayTraceResult { - - public IndexedCuboid6 cuboid6; - - /** - * Optional flag that disables auto rendering of this trace result. Useful when - * you wish to use this class to retain the Cuboid6 box but would like to render - * it yourself. - */ - public boolean disableAutoHitboxRender = false; - - public CuboidRayTraceResult(Entity entity, Vector3 hit, IndexedCuboid6 cuboid, double dist) { - super(entity, hit, cuboid.data, dist); - this.cuboid6 = cuboid; - } - - public CuboidRayTraceResult(Vector3 hit, BlockPos pos, EnumFacing side, IndexedCuboid6 cuboid, double dist) { - super(hit, pos, side, cuboid.data, dist); - this.cuboid6 = cuboid; - } - - public CuboidRayTraceResult(Vector3 hit, EnumFacing side, IndexedCuboid6 cuboid6, double dist) { - super(hit, side, cuboid6.data, dist); - this.cuboid6 = cuboid6; - } - - /** - * This will create a new instance of a DistanceRayTraceResult. - * You will not be able to TypeCast this back to a CuboidRayTraceResult. - * This can be used to avoid CCL's HitBox render taking over down the line. - * - * @return - */ - public DistanceRayTraceResult getAsTraceResult() { - return new DistanceRayTraceResult(new Vector3(hitVec), sideHit, hitInfo, dist); - } - - @Override - public String toString() { - return super.toString().replace("}", "") + ", cuboid=" + cuboid6.toString() + "}"; - } -} diff --git a/dependencies/main/java/codechicken/lib/raytracer/DistanceRayTraceResult.java b/dependencies/main/java/codechicken/lib/raytracer/DistanceRayTraceResult.java deleted file mode 100644 index d1d6113702..0000000000 --- a/dependencies/main/java/codechicken/lib/raytracer/DistanceRayTraceResult.java +++ /dev/null @@ -1,60 +0,0 @@ -package codechicken.lib.raytracer; - -import codechicken.lib.vec.Vector3; -import net.minecraft.entity.Entity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.RayTraceResult; - -//TODO Copyable. -public class DistanceRayTraceResult extends RayTraceResult implements Comparable { - - /** - * The square distance from the start of the raytrace. - */ - public double dist; - - public DistanceRayTraceResult(Entity entity, Vector3 hit, Object data, double dist) { - super(entity, hit.vec3()); - setData(data); - this.dist = dist; - } - - public DistanceRayTraceResult(Vector3 hit, EnumFacing side, Object data, double dist) { - super(hit.vec3(), side); - this.dist = dist; - setData(data); - } - - public DistanceRayTraceResult(Vector3 hit, BlockPos pos, EnumFacing side, Object data, double dist) { - super(hit.vec3(), side, pos); - setData(data); - this.dist = dist; - } - - public void setData(Object data) { - if (data instanceof Integer) { - subHit = (Integer) data; - } - hitInfo = data; - } - - @Deprecated//TODO Is this actually needed.. Can remove an AT line if not needed. - public void setPos(BlockPos pos) { - this.blockPos = pos; - } - - public void offsetHit(BlockPos pos) { - hitVec = hitVec.addVector(pos.getX(), pos.getY(), pos.getZ()); - } - - @Override - public int compareTo(DistanceRayTraceResult o) { - return dist == o.dist ? 0 : dist < o.dist ? -1 : 1; - } - - @Override - public String toString() { - return super.toString().replace("}", "") + ", subHit=" + subHit + ", sqDist: " + dist + "}"; - } -} diff --git a/dependencies/main/java/codechicken/lib/raytracer/ICuboidProvider.java b/dependencies/main/java/codechicken/lib/raytracer/ICuboidProvider.java deleted file mode 100644 index d62223ca0e..0000000000 --- a/dependencies/main/java/codechicken/lib/raytracer/ICuboidProvider.java +++ /dev/null @@ -1,19 +0,0 @@ -package codechicken.lib.raytracer; - -import java.util.List; - -/** - * Created by covers1624 on 8/10/2016. - * This is a completely random interface, mainly used to have a standard method to get cuboids from a tile. - * For a somewhat standard impl, use the first index in the array to indicate the blocks bounds, and anything else for other clickable's or boxes. - */ -public interface ICuboidProvider { - - /** - * Everything must return pure bounds not offset by the tiles position. - * - * @return A list of cuboids for a tile. - */ - List getIndexedCuboids(); - -} diff --git a/dependencies/main/java/codechicken/lib/raytracer/IndexedCuboid6.java b/dependencies/main/java/codechicken/lib/raytracer/IndexedCuboid6.java deleted file mode 100644 index 66738a9c29..0000000000 --- a/dependencies/main/java/codechicken/lib/raytracer/IndexedCuboid6.java +++ /dev/null @@ -1,94 +0,0 @@ -package codechicken.lib.raytracer; - -import codechicken.lib.math.MathHelper; -import codechicken.lib.vec.Cuboid6; -import codechicken.lib.vec.Vector3; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.AxisAlignedBB; - -public class IndexedCuboid6 extends Cuboid6 { - - public Object data; - - public IndexedCuboid6(Object data, Cuboid6 cuboid) { - super(cuboid); - this.data = data; - } - - public IndexedCuboid6(Object data, AxisAlignedBB box) { - super(box); - this.data = data; - } - - public CuboidRayTraceResult calculateIntercept(Vector3 start, Vector3 end) { - Vector3 hit = null; - EnumFacing sideHit = null; - double dist = Double.MAX_VALUE; - - for (EnumFacing face : EnumFacing.values()) { - Vector3 suspectHit = null; - switch (face) { - case DOWN: - suspectHit = start.copy().XZintercept(end, min.y); - break; - case UP: - suspectHit = start.copy().XZintercept(end, max.y); - break; - case NORTH: - suspectHit = start.copy().XYintercept(end, min.z); - break; - case SOUTH: - suspectHit = start.copy().XYintercept(end, max.z); - break; - case WEST: - suspectHit = start.copy().YZintercept(end, min.x); - break; - case EAST: - suspectHit = start.copy().YZintercept(end, max.x); - break; - } - - if (suspectHit == null) { - continue; - } - - switch (face) { - - case DOWN: - case UP: - if (!MathHelper.between(min.x, suspectHit.x, max.x) || !MathHelper.between(min.z, suspectHit.z, max.z)) { - continue; - } - break; - case NORTH: - case SOUTH: - if (!MathHelper.between(min.x, suspectHit.x, max.x) || !MathHelper.between(min.y, suspectHit.y, max.y)) { - continue; - } - break; - case WEST: - case EAST: - if (!MathHelper.between(min.y, suspectHit.y, max.y) || !MathHelper.between(min.z, suspectHit.z, max.z)) { - continue; - } - break; - } - double suspectDist = suspectHit.copy().subtract(start).magSquared(); - if (suspectDist < dist) { - sideHit = face; - dist = suspectDist; - hit = suspectHit; - } - } - - if (sideHit != null && hit != null) { - return new CuboidRayTraceResult(hit, sideHit, this, dist); - } - return null; - } - - @Override - public IndexedCuboid6 copy() { - return new IndexedCuboid6(data, this); - } -} diff --git a/dependencies/main/java/codechicken/lib/raytracer/RayTracer.java b/dependencies/main/java/codechicken/lib/raytracer/RayTracer.java deleted file mode 100644 index 864d8e1640..0000000000 --- a/dependencies/main/java/codechicken/lib/raytracer/RayTracer.java +++ /dev/null @@ -1,256 +0,0 @@ -package codechicken.lib.raytracer; - -import codechicken.lib.vec.Cuboid6; -import codechicken.lib.vec.Vector3; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -public class RayTracer { - - /** - * @param start The vector to start RayTracing from. - * @param end The Vector to stop RayTracing at. - * @param cuboids The cuboids to check for a hit. - * @param pos The position offset for the start and end vector. - * @return The closest hit to the start vector. - * //TODO 1.11, Re arrange args to (start, end, pos, cuboids) - */ - public static CuboidRayTraceResult rayTraceCuboidsClosest(Vec3d start, Vec3d end, List cuboids, BlockPos pos) { - return rayTraceCuboidsClosest(new Vector3(start), new Vector3(end), cuboids, pos); - } - - /** - * @param start The vector to start RayTracing from. - * @param end The Vector to stop RayTracing at. - * @param cuboids The cuboids to check for a hit. - * @param pos The position offset for the start and end vector. - * @return The closest hit to the start vector. - * //TODO 1.11, Re arrange args to (start, end, pos, cuboids) - */ - public static CuboidRayTraceResult rayTraceCuboidsClosest(Vector3 start, Vector3 end, List cuboids, BlockPos pos) { - List results = new ArrayList(); - for (IndexedCuboid6 cuboid6 : cuboids) { - CuboidRayTraceResult hit = rayTrace(pos, start, end, cuboid6); - results.add(hit); - } - CuboidRayTraceResult closestHit = null; - double curClosest = Double.MAX_VALUE; - for (CuboidRayTraceResult hit : results) { - if (hit != null) { - if (curClosest > hit.dist) { - closestHit = hit; - curClosest = hit.dist; - } - } - } - return closestHit; - } - - /** - * This method goes by the assumption you don't care about IndexedCuboids and their extra data. - * Useful for adding hitboxes to blocks that don't actually do anything but visuals. - * - * @param start The vector to start RayTracing from. - * @param end The vector to stop RayTracing at. - * @param pos The position offset for the start and enc vector. - * @param boxes The cuboids to trace. - * @return The closest hit to the start vector. - */ - public static CuboidRayTraceResult rayTraceCuboidsClosest(Vector3 start, Vector3 end, BlockPos pos, AxisAlignedBB... boxes) { - List cuboidList = new LinkedList(); - if (boxes != null) { - for (AxisAlignedBB box : boxes) { - cuboidList.add(new IndexedCuboid6(0, box)); - } - } - return rayTraceCuboidsClosest(start, end, cuboidList, pos); - } - - /** - * This method goes by the assumption you don't care about IndexedCuboids and their extra data. - * Useful for adding hitboxes to blocks that don't actually do anything but visuals. - * - * @param start The vector to start RayTracing from. - * @param end The vector to stop RayTracing at. - * @param pos The position offset for the start and enc vector. - * @param boxes The cuboids to trace. - * @return The closest hit to the start vector. - */ - public static CuboidRayTraceResult rayTraceCuboidsClosest(Vec3d start, Vec3d end, BlockPos pos, AxisAlignedBB... boxes) { - List cuboidList = new LinkedList(); - if (boxes != null) { - for (AxisAlignedBB box : boxes) { - cuboidList.add(new IndexedCuboid6(0, box)); - } - } - return rayTraceCuboidsClosest(start, end, cuboidList, pos); - } - - /** - * This method goes by the assumption you don't care about IndexedCuboids and their extra data. - * Useful for adding hitboxes to blocks that don't actually do anything but visuals. - * - * @param start The vector to start RayTracing from. - * @param end The vector to stop RayTracing at. - * @param pos The position offset for the start and enc vector. - * @param cuboids The cuboids to trace. - * @return The closest hit to the start vector. - */ - public static CuboidRayTraceResult rayTraceCuboidsClosest(Vector3 start, Vector3 end, BlockPos pos, Cuboid6... cuboids) { - List cuboidList = new LinkedList(); - if (cuboids != null) { - for (Cuboid6 cuboid : cuboids) { - cuboidList.add(new IndexedCuboid6(0, cuboid)); - } - } - return rayTraceCuboidsClosest(start, end, cuboidList, pos); - } - - /** - * This method goes by the assumption you don't care about IndexedCuboids and their extra data. - * Useful for adding hitboxes to blocks that don't actually do anything but visuals. - * - * @param start The vector to start RayTracing from. - * @param end The vector to stop RayTracing at. - * @param pos The position offset for the start and enc vector. - * @param cuboids The cuboids to trace. - * @return The closest hit to the start vector. - */ - public static CuboidRayTraceResult rayTraceCuboidsClosest(Vec3d start, Vec3d end, BlockPos pos, Cuboid6... cuboids) { - List cuboidList = new LinkedList(); - if (cuboids != null) { - for (Cuboid6 cuboid : cuboids) { - cuboidList.add(new IndexedCuboid6(0, cuboid)); - } - } - return rayTraceCuboidsClosest(start, end, cuboidList, pos); - } - - /** - * @param start The vector to start RayTracing from. - * @param end The Vector to stop RayTracing at. - * @param pos The position offset for the start and end vector. - * @param cuboids The cuboids to check for a hit. - * @return The closest hit to the start vector. - */ - public static CuboidRayTraceResult rayTraceCuboidsClosest(Vector3 start, Vector3 end, BlockPos pos, IndexedCuboid6... cuboids) { - List cuboidList = new LinkedList(); - if (cuboids != null) { - Collections.addAll(cuboidList, cuboids); - } - return rayTraceCuboidsClosest(start, end, cuboidList, pos); - } - - /** - * @param start The vector to start RayTracing from. - * @param end The Vector to stop RayTracing at. - * @param pos The position offset for the start and end vector. - * @param cuboids The cuboids to check for a hit. - * @return The closest hit to the start vector. - */ - public static CuboidRayTraceResult rayTraceCuboidsClosest(Vec3d start, Vec3d end, BlockPos pos, IndexedCuboid6... cuboids) { - List cuboidList = new LinkedList(); - if (cuboids != null) { - Collections.addAll(cuboidList, cuboids); - } - return rayTraceCuboidsClosest(start, end, cuboidList, pos); - } - - /** - * Ray traces from start to end, if the ray intercepts the cuboid it returns a new CuboidRayTraceResult. - * - * @param pos The BlockPosition to subtract from the start and end vector. - * @param start The vector to start RayTracing from. - * @param end The vector to end RayTracing at. - * @param cuboid The cuboid to check for an intercept. - * @return A new CuboidRayTraceResult if successful, null if fail. - */ - public static CuboidRayTraceResult rayTrace(BlockPos pos, Vector3 start, Vector3 end, IndexedCuboid6 cuboid) { - Vector3 startRay = start.copy().subtract(pos); - Vector3 endRay = end.copy().subtract(pos); - RayTraceResult bbResult = cuboid.aabb().calculateIntercept(startRay.vec3(), endRay.vec3()); - - if (bbResult != null) { - Vector3 hitVec = new Vector3(bbResult.hitVec).add(pos); - EnumFacing sideHit = bbResult.sideHit; - double dist = hitVec.copy().subtract(start).magSquared(); - return new CuboidRayTraceResult(hitVec, pos, sideHit, cuboid, dist); - } - return null; - } - - public static RayTraceResult retraceBlock(World world, EntityPlayer player, BlockPos pos) { - Vec3d startVec = getStartVec(player); - Vec3d endVec = getEndVec(player); - return world.getBlockState(pos).collisionRayTrace(world, pos, startVec, endVec); - } - - private static double getBlockReachDistance_server(EntityPlayerMP player) { - return player.interactionManager.getBlockReachDistance(); - } - - @SideOnly (Side.CLIENT) - private static double getBlockReachDistance_client() { - return Minecraft.getMinecraft().playerController.getBlockReachDistance(); - } - - public static RayTraceResult retrace(EntityPlayer player) { - return retrace(player, getBlockReachDistance(player)); - } - - public static RayTraceResult retrace(EntityPlayer player, boolean stopOnFluid) { - Vec3d startVec = getStartVec(player); - Vec3d endVec = getEndVec(player); - return player.worldObj.rayTraceBlocks(startVec, endVec, stopOnFluid, false, true); - } - - public static RayTraceResult retrace(EntityPlayer player, double reach, boolean stopOnFluids) { - Vec3d startVec = getStartVec(player); - Vec3d endVec = getEndVec(player, reach); - return player.worldObj.rayTraceBlocks(startVec, endVec, stopOnFluids, false, true); - } - - public static RayTraceResult retrace(EntityPlayer player, double reach) { - return retrace(player, reach, true); - } - - public static Vec3d getCorrectedHeadVec(EntityPlayer player) { - Vector3 v = Vector3.fromEntity(player).add(0, player.getEyeHeight(), 0); - return v.vec3(); - } - - public static Vec3d getStartVec(EntityPlayer player) { - return getCorrectedHeadVec(player); - } - - public static double getBlockReachDistance(EntityPlayer player) { - return player.worldObj.isRemote ? getBlockReachDistance_client() : player instanceof EntityPlayerMP ? getBlockReachDistance_server((EntityPlayerMP) player) : 5D; - } - - public static Vec3d getEndVec(EntityPlayer player) { - Vec3d headVec = getCorrectedHeadVec(player); - Vec3d lookVec = player.getLook(1.0F); - double reach = getBlockReachDistance(player); - return headVec.addVector(lookVec.xCoord * reach, lookVec.yCoord * reach, lookVec.zCoord * reach); - } - - public static Vec3d getEndVec(EntityPlayer player, double reach) { - Vec3d headVec = getCorrectedHeadVec(player); - Vec3d lookVec = player.getLook(1.0F); - return headVec.addVector(lookVec.xCoord * reach, lookVec.yCoord * reach, lookVec.zCoord * reach); - } -} diff --git a/dependencies/main/java/codechicken/lib/render/BlockRenderer.java b/dependencies/main/java/codechicken/lib/render/BlockRenderer.java deleted file mode 100644 index ea5c7eba26..0000000000 --- a/dependencies/main/java/codechicken/lib/render/BlockRenderer.java +++ /dev/null @@ -1,207 +0,0 @@ -package codechicken.lib.render; - -import codechicken.lib.lighting.LC; -import codechicken.lib.render.pipeline.IVertexSource; -import codechicken.lib.render.pipeline.attribute.AttributeKey; -import codechicken.lib.render.pipeline.attribute.LightCoordAttribute; -import codechicken.lib.render.pipeline.attribute.SideAttribute; -import codechicken.lib.vec.Cuboid6; -import codechicken.lib.vec.Vertex5; - -//TODO Ability to use this without lighting. -public class BlockRenderer { - - public static class BlockFace implements IVertexSource { - - public Vertex5[] verts = new Vertex5[] { new Vertex5(), new Vertex5(), new Vertex5(), new Vertex5() }; - public LC[] lightCoords = new LC[] { new LC(), new LC(), new LC(), new LC() }; - public boolean lcComputed = false; - public int side; - - @Override - public Vertex5[] getVertices() { - return verts; - } - - @Override - public T getAttributes(AttributeKey attr) { - return LightCoordAttribute.attributeKey.equals(attr) && lcComputed ? (T) lightCoords : null; - } - - @Override - public boolean hasAttribute(AttributeKey attr) { - return SideAttribute.attributeKey.equals(attr) || LightCoordAttribute.attributeKey.equals(attr) && lcComputed; - } - - @Override - public void prepareVertex(CCRenderState state) { - state.side = side; - } - - public BlockFace computeLightCoords() { - if (!lcComputed) { - for (int i = 0; i < 4; i++) { - lightCoords[i].compute(verts[i].vec, side); - } - lcComputed = true; - } - return this; - } - - public BlockFace loadCuboidFace(Cuboid6 c, int side) { - double x1 = c.min.x; - double x2 = c.max.x; - double y1 = c.min.y; - double y2 = c.max.y; - double z1 = c.min.z; - double z2 = c.max.z; - double u1; - double u2; - double v1; - double v2; - this.side = side; - lcComputed = false; - - switch (side) { - case 0: - u1 = x1; - v1 = z1; - u2 = x2; - v2 = z2; - verts[0].set(x1, y1, z2, u1, v2, 0); - verts[1].set(x1, y1, z1, u1, v1, 0); - verts[2].set(x2, y1, z1, u2, v1, 0); - verts[3].set(x2, y1, z2, u2, v2, 0); - break; - case 1: - u1 = x1; - v1 = z1; - u2 = x2; - v2 = z2; - verts[0].set(x2, y2, z2, u2, v2, 1); - verts[1].set(x2, y2, z1, u2, v1, 1); - verts[2].set(x1, y2, z1, u1, v1, 1); - verts[3].set(x1, y2, z2, u1, v2, 1); - break; - case 2: - u1 = 1 - x1; - v1 = 1 - y2; - u2 = 1 - x2; - v2 = 1 - y1; - verts[0].set(x1, y1, z1, u1, v2, 2); - verts[1].set(x1, y2, z1, u1, v1, 2); - verts[2].set(x2, y2, z1, u2, v1, 2); - verts[3].set(x2, y1, z1, u2, v2, 2); - break; - case 3: - u1 = x1; - v1 = 1 - y2; - u2 = x2; - v2 = 1 - y1; - verts[0].set(x2, y1, z2, u2, v2, 3); - verts[1].set(x2, y2, z2, u2, v1, 3); - verts[2].set(x1, y2, z2, u1, v1, 3); - verts[3].set(x1, y1, z2, u1, v2, 3); - break; - case 4: - u1 = z1; - v1 = 1 - y2; - u2 = z2; - v2 = 1 - y1; - verts[0].set(x1, y1, z2, u2, v2, 4); - verts[1].set(x1, y2, z2, u2, v1, 4); - verts[2].set(x1, y2, z1, u1, v1, 4); - verts[3].set(x1, y1, z1, u1, v2, 4); - break; - case 5: - u1 = 1 - z1; - v1 = 1 - y2; - u2 = 1 - z2; - v2 = 1 - y1; - verts[0].set(x2, y1, z1, u1, v2, 5); - verts[1].set(x2, y2, z1, u1, v1, 5); - verts[2].set(x2, y2, z2, u2, v1, 5); - verts[3].set(x2, y1, z2, u2, v2, 5); - } - return this; - } - } - - public static class FullBlock implements IVertexSource { - - public Vertex5[] verts = CCModel.quadModel(24).generateBlock(0, Cuboid6.full).verts; - public LC[] lightCoords = new LC[24]; - - public FullBlock() { - for (int i = 0; i < 24; i++) { - lightCoords[i] = new LC().compute(verts[i].vec, i / 4); - } - } - - @Override - public Vertex5[] getVertices() { - return verts; - } - - @Override - public T getAttributes(AttributeKey attr) { - return LightCoordAttribute.attributeKey.equals(attr) ? (T) lightCoords : null; - } - - @Override - public boolean hasAttribute(AttributeKey attr) { - return SideAttribute.attributeKey.equals(attr) || LightCoordAttribute.attributeKey.equals(attr); - } - - @Override - public void prepareVertex(CCRenderState state) { - state.side = state.vertexIndex >> 2; - } - } - - public static FullBlock fullBlock = new FullBlock(); - - public static void renderFullBlock(CCRenderState state, int sideMask) { - state.setModel(fullBlock); - renderFaces(state, sideMask); - } - - /** - * Renders faces of a block-like model based on a sideMask. Eg for side 2, verts 8-11 will be rendered - * - * @param sideMask A mask of faces not to render - */ - public static void renderFaces(CCRenderState state, int sideMask) { - if (sideMask == 0x3F) { - return; - } - for (int s = 0; s < 6; s++) { - if ((sideMask & 1 << s) == 0) { - state.setVertexRange(s * 4, (s + 1) * 4); - state.render(); - } - } - } - - private static BlockFace face = new BlockFace(); - - /** - * Renders faces of a cuboid with texture coordinates mapped to match a standard minecraft block - * - * @param bounds The bounding cuboid to render - * @param sideMask A mask of faces not to render - */ - public static void renderCuboid(CCRenderState state, Cuboid6 bounds, int sideMask) { - if (sideMask == 0x3F) { - return; - } - - state.setModel(face); - for (int s = 0; s < 6; s++) { - if ((sideMask & 1 << s) == 0) { - face.loadCuboidFace(bounds, s); - state.render(); - } - } - } -} diff --git a/dependencies/main/java/codechicken/lib/render/CCIconRegister.java b/dependencies/main/java/codechicken/lib/render/CCIconRegister.java deleted file mode 100644 index fb67fa327f..0000000000 --- a/dependencies/main/java/codechicken/lib/render/CCIconRegister.java +++ /dev/null @@ -1,52 +0,0 @@ -package codechicken.lib.render; - -import codechicken.lib.texture.TextureUtils; -import codechicken.lib.texture.TextureUtils.IIconRegister; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.ResourceLocation; - -import java.util.ArrayList; - -/** - * Created by covers1624 on 5/22/2016. - */ -public class CCIconRegister implements IIconRegister { - - public static ArrayList locations = new ArrayList(); - - static { - TextureUtils.addIconRegister(new CCIconRegister()); - } - - @Override - public void registerIcons(TextureMap textureMap) { - for (ResourceLocation texture : locations) { - textureMap.registerSprite(texture); - } - } - - public static void registerTexture(String texture) { - registerTexture(new ResourceLocation(texture)); - } - - public static void registerTexture(ResourceLocation location) { - locations.add(location); - } - - public static void registerBlockTexture(String string) { - registerBlockTexture(new ResourceLocation(string)); - } - - public static void registerBlockTexture(ResourceLocation location) { - registerTexture(new ResourceLocation(location.getResourceDomain(), "blocks/" + location.getResourcePath())); - } - - public static void registerItemTexture(String string) { - registerItemTexture(new ResourceLocation(string)); - } - - public static void registerItemTexture(ResourceLocation location) { - registerTexture(new ResourceLocation(location.getResourceDomain(), "items/" + location.getResourcePath())); - } - -} diff --git a/dependencies/main/java/codechicken/lib/render/CCModel.java b/dependencies/main/java/codechicken/lib/render/CCModel.java deleted file mode 100644 index 13c4b5695e..0000000000 --- a/dependencies/main/java/codechicken/lib/render/CCModel.java +++ /dev/null @@ -1,901 +0,0 @@ -package codechicken.lib.render; - -import codechicken.lib.lighting.LC; -import codechicken.lib.lighting.LightModel; -import codechicken.lib.render.pipeline.IVertexOperation; -import codechicken.lib.render.pipeline.IVertexSource; -import codechicken.lib.render.pipeline.VertexAttribute; -import codechicken.lib.render.pipeline.attribute.*; -import codechicken.lib.render.pipeline.attribute.AttributeKey.AttributeKeyRegistry; -import codechicken.lib.util.ArrayUtils; -import codechicken.lib.util.Copyable; -import codechicken.lib.util.VectorUtils; -import codechicken.lib.vec.*; -import codechicken.lib.vec.uv.UV; -import codechicken.lib.vec.uv.UVTransformation; -import codechicken.lib.vec.uv.UVTranslation; - -import java.util.*; - -import static codechicken.lib.vec.Rotation.sideRotations; - -public class CCModel implements IVertexSource, Copyable { - - private static class PositionNormalEntry { - - public Vector3 pos; - public LinkedList normals = new LinkedList(); - - public PositionNormalEntry(Vector3 position) { - pos = position; - } - - public boolean positionEqual(Vector3 v) { - return pos.x == v.x && pos.y == v.y && pos.z == v.z; - } - - public PositionNormalEntry addNormal(Vector3 normal) { - normals.add(normal); - return this; - } - } - - public final int vertexMode; - public final int vp; - public Vertex5[] verts; - public ArrayList attributes = new ArrayList(); - - protected CCModel(int vertexMode) { - if (vertexMode != 7 && vertexMode != 4) { - throw new IllegalArgumentException("Models must be GL_QUADS or GL_TRIANGLES"); - } - - this.vertexMode = vertexMode; - vp = vertexMode == 7 ? 4 : 3; - } - - public Vector3[] normals() { - return getAttributes(NormalAttribute.attributeKey); - } - - @Override - public Vertex5[] getVertices() { - return verts; - } - - @Override - public T getAttributes(AttributeKey attr) { - if (attr.attributeKeyIndex < attributes.size()) { - return (T) attributes.get(attr.attributeKeyIndex); - } - return null; - } - - @Override - public boolean hasAttribute(AttributeKey attr) { - return attr.attributeKeyIndex < attributes.size() && attributes.get(attr.attributeKeyIndex) != null; - } - - @Override - public void prepareVertex(CCRenderState state) { - } - - public T getOrAllocate(AttributeKey attr) { - T array = getAttributes(attr); - if (array == null) { - while (attributes.size() <= attr.attributeKeyIndex) { - attributes.add(null); - } - attributes.set(attr.attributeKeyIndex, array = attr.newArray(verts.length)); - } - return array; - } - - /** - * Each pixel corresponds to one unit of position when generating the model - * - * @param i Vertex index to start generating at - * @param x1 The minX bound of the box - * @param y1 The minY bound of the box - * @param z1 The minZ bound of the box - * @param w The width of the box - * @param h The height of the box - * @param d The depth of the box - * @param tx The distance of the top left corner of the texture map from the left in pixels - * @param ty The distance of the top left corner of the texture map from the top in pixels - * @param tw The width of the texture in pixels - * @param th The height of the texture in pixels - * @param f The scale of the model, pixels per block, normally 16 - * @return The generated model - */ - public CCModel generateBox(int i, double x1, double y1, double z1, double w, double h, double d, double tx, double ty, double tw, double th, double f) { - double u1, v1, u2, v2; - double x2 = x1 + w; - double y2 = y1 + h; - double z2 = z1 + d; - x1 /= f; - x2 /= f; - y1 /= f; - y2 /= f; - z1 /= f; - z2 /= f; - - //bottom face - u1 = (tx + d + w) / tw; - v1 = (ty + d) / th; - u2 = (tx + d * 2 + w) / tw; - v2 = ty / th; - verts[i++] = new Vertex5(x1, y1, z2, u1, v2); - verts[i++] = new Vertex5(x1, y1, z1, u1, v1); - verts[i++] = new Vertex5(x2, y1, z1, u2, v1); - verts[i++] = new Vertex5(x2, y1, z2, u2, v2); - - //top face - u1 = (tx + d) / tw; - v1 = (ty + d) / th; - u2 = (tx + d + w) / tw; - v2 = ty / th; - verts[i++] = new Vertex5(x2, y2, z2, u2, v2); - verts[i++] = new Vertex5(x2, y2, z1, u2, v1); - verts[i++] = new Vertex5(x1, y2, z1, u1, v1); - verts[i++] = new Vertex5(x1, y2, z2, u1, v2); - - //front face - u1 = (tx + d + w) / tw; - v1 = (ty + d) / th; - u2 = (tx + d) / tw; - v2 = (ty + d + h) / th; - verts[i++] = new Vertex5(x1, y2, z1, u2, v1); - verts[i++] = new Vertex5(x2, y2, z1, u1, v1); - verts[i++] = new Vertex5(x2, y1, z1, u1, v2); - verts[i++] = new Vertex5(x1, y1, z1, u2, v2); - - //back face - u1 = (tx + d * 2 + w * 2) / tw; - v1 = (ty + d) / th; - u2 = (tx + d * 2 + w) / tw; - v2 = (ty + d + h) / th; - verts[i++] = new Vertex5(x1, y2, z2, u1, v1); - verts[i++] = new Vertex5(x1, y1, z2, u1, v2); - verts[i++] = new Vertex5(x2, y1, z2, u2, v2); - verts[i++] = new Vertex5(x2, y2, z2, u2, v1); - - //left face - u1 = (tx + d) / tw; - v1 = (ty + d) / th; - u2 = (tx) / tw; - v2 = (ty + d + h) / th; - verts[i++] = new Vertex5(x1, y2, z2, u2, v1); - verts[i++] = new Vertex5(x1, y2, z1, u1, v1); - verts[i++] = new Vertex5(x1, y1, z1, u1, v2); - verts[i++] = new Vertex5(x1, y1, z2, u2, v2); - - //right face - u1 = (tx + d * 2 + w) / tw; - v1 = (ty + d) / th; - u2 = (tx + d + w) / tw; - v2 = (ty + d + h) / th; - verts[i++] = new Vertex5(x2, y1, z2, u1, v2); - verts[i++] = new Vertex5(x2, y1, z1, u2, v2); - verts[i++] = new Vertex5(x2, y2, z1, u2, v1); - verts[i++] = new Vertex5(x2, y2, z2, u1, v1); - - return this; - } - - /** - * Generates a box, uv mapped to be the same as a minecraft block with the same bounds - * - * @param i The vertex index to start generating at - * @param bounds The bounds of the block, 0 to 1 - * @return The generated model. When rendering an icon will need to be supplied for the UV transformation. - */ - public CCModel generateBlock(int i, Cuboid6 bounds) { - return generateBlock(i, bounds, 0); - } - - public CCModel generateBlock(int i, Cuboid6 bounds, int mask) { - return generateBlock(i, bounds.min.x, bounds.min.y, bounds.min.z, bounds.max.x, bounds.max.y, bounds.max.z, mask); - } - - public CCModel generateBlock(int i, double x1, double y1, double z1, double x2, double y2, double z2) { - return generateBlock(i, x1, y1, z1, x2, y2, z2, 0); - } - - /** - * Generates a box, uv mapped to be the same as a minecraft block with the same bounds - * - * @param i The vertex index to start generating at - * @param x1 minX - * @param y1 minY - * @param z1 minZ - * @param x2 maxX - * @param y2 maxY - * @param z2 maxZ - * @param mask A bitmask of sides NOT to generate. I high bit at index s means side s will not be generated - * @return The generated model. When rendering an icon will need to be supplied for the UV transformation. - */ - public CCModel generateBlock(int i, double x1, double y1, double z1, double x2, double y2, double z2, int mask) { - double u1, v1, u2, v2; - - if ((mask & 1) == 0) {//bottom face - u1 = x1; - v1 = z1; - u2 = x2; - v2 = z2; - verts[i++] = new Vertex5(x1, y1, z2, u1, v2, 0); - verts[i++] = new Vertex5(x1, y1, z1, u1, v1, 0); - verts[i++] = new Vertex5(x2, y1, z1, u2, v1, 0); - verts[i++] = new Vertex5(x2, y1, z2, u2, v2, 0); - } - - if ((mask & 2) == 0) {//top face - u1 = x1; - v1 = z1; - u2 = x2; - v2 = z2; - verts[i++] = new Vertex5(x2, y2, z2, u2, v2, 1); - verts[i++] = new Vertex5(x2, y2, z1, u2, v1, 1); - verts[i++] = new Vertex5(x1, y2, z1, u1, v1, 1); - verts[i++] = new Vertex5(x1, y2, z2, u1, v2, 1); - } - - if ((mask & 4) == 0) {//east face - u1 = 1 - x1; - v1 = 1 - y2; - u2 = 1 - x2; - v2 = 1 - y1; - verts[i++] = new Vertex5(x1, y1, z1, u1, v2, 2); - verts[i++] = new Vertex5(x1, y2, z1, u1, v1, 2); - verts[i++] = new Vertex5(x2, y2, z1, u2, v1, 2); - verts[i++] = new Vertex5(x2, y1, z1, u2, v2, 2); - } - - if ((mask & 8) == 0) {//west face - u1 = x1; - v1 = 1 - y2; - u2 = x2; - v2 = 1 - y1; - verts[i++] = new Vertex5(x2, y1, z2, u2, v2, 3); - verts[i++] = new Vertex5(x2, y2, z2, u2, v1, 3); - verts[i++] = new Vertex5(x1, y2, z2, u1, v1, 3); - verts[i++] = new Vertex5(x1, y1, z2, u1, v2, 3); - } - - if ((mask & 0x10) == 0) {//north face - u1 = z1; - v1 = 1 - y2; - u2 = z2; - v2 = 1 - y1; - verts[i++] = new Vertex5(x1, y1, z2, u2, v2, 4); - verts[i++] = new Vertex5(x1, y2, z2, u2, v1, 4); - verts[i++] = new Vertex5(x1, y2, z1, u1, v1, 4); - verts[i++] = new Vertex5(x1, y1, z1, u1, v2, 4); - } - - if ((mask & 0x20) == 0) {//south face - u1 = 1 - z1; - v1 = 1 - y2; - u2 = 1 - z2; - v2 = 1 - y1; - verts[i++] = new Vertex5(x2, y1, z1, u1, v2, 5); - verts[i++] = new Vertex5(x2, y2, z1, u1, v1, 5); - verts[i++] = new Vertex5(x2, y2, z2, u2, v1, 5); - verts[i++] = new Vertex5(x2, y1, z2, u2, v2, 5); - } - - return this; - } - - /** - * Generates a model using 2 Cuboids. - * c1 defines the size of the top face. - * c2 defines the size of the bottom face. - * the sides are generated on an angle between c1 and c2. - * - * @param i The vertex index to start generating at - * @param c1 The top face cuboid. - * @param c2 The bottom face cuboid. - * @return - */ - @Deprecated - public CCModel generateDualCuboidBlock(int i, Cuboid6 c1, Cuboid6 c2) { - double x11 = c1.min.x; - double y11 = c1.min.y; - double z11 = c1.min.z; - double x12 = c1.max.x; - double y12 = c1.max.y; - double z12 = c1.max.z; - - double x21 = c2.min.x; - double y21 = c2.min.y; - double z21 = c2.min.z; - double x22 = c2.max.x; - double y22 = c2.max.y; - double z22 = c2.max.z; - - double u11, v11, u12, v12; - double u21, v21, u22, v22; - - //bottom face - u11 = x11; - v11 = z11; - u12 = x12; - v12 = z12; - verts[i++] = new Vertex5(x11, y11, z12, u11, v12, 0); - verts[i++] = new Vertex5(x11, y11, z11, u11, v11, 0); - verts[i++] = new Vertex5(x12, y11, z11, u12, v11, 0); - verts[i++] = new Vertex5(x12, y11, z12, u12, v12, 0); - - //top face - u21 = x21; - v21 = z21; - u22 = x22; - v22 = z22; - verts[i++] = new Vertex5(x22, y22, z22, u22, v22, 1); - verts[i++] = new Vertex5(x22, y22, z21, u22, v21, 1); - verts[i++] = new Vertex5(x21, y22, z21, u21, v21, 1); - verts[i++] = new Vertex5(x21, y22, z22, u21, v22, 1); - - //east face - u11 = 1 - x11; - v11 = 1 - y12; - u12 = 1 - x12; - v12 = 1 - y11; - - u21 = 1 - x21; - v21 = 1 - y22; - u22 = 1 - x22; - v22 = 1 - y21; - - verts[i++] = new Vertex5(x11, y11, z11, u11, v12, 2); - verts[i++] = new Vertex5(x21, y22, z21, u21, v21, 2); - verts[i++] = new Vertex5(x22, y22, z21, u22, v21, 2); - verts[i++] = new Vertex5(x12, y11, z11, u12, v12, 2); - - //west face - u11 = x11; - v11 = 1 - y12; - u12 = x12; - v12 = 1 - y11; - - u21 = x21; - v21 = 1 - y22; - u22 = x22; - v22 = 1 - y21; - - verts[i++] = new Vertex5(x12, y11, z12, u12, v12, 3); - verts[i++] = new Vertex5(x22, y22, z22, u22, v21, 3); - verts[i++] = new Vertex5(x21, y22, z22, u21, v21, 3); - verts[i++] = new Vertex5(x11, y11, z12, u11, v12, 3); - - //north face - u11 = z11; - v11 = 1 - y12; - u12 = z12; - v12 = 1 - y11; - - u21 = z21; - v21 = 1 - y22; - u22 = z22; - v22 = 1 - y21; - - verts[i++] = new Vertex5(x11, y11, z12, u12, v12, 4); - verts[i++] = new Vertex5(x21, y22, z22, u22, v21, 4); - verts[i++] = new Vertex5(x21, y22, z21, u21, v21, 4); - verts[i++] = new Vertex5(x11, y11, z11, u11, v12, 4); - - //south face - u11 = 1 - z11; - v11 = 1 - y12; - u12 = 1 - z12; - v12 = 1 - y11; - - u21 = 1 - z21; - v21 = 1 - y22; - u22 = 1 - z22; - v22 = 1 - y21; - - verts[i++] = new Vertex5(x12, y11, z11, u11, v12, 5); - verts[i++] = new Vertex5(x22, y22, z21, u21, v21, 5); - verts[i++] = new Vertex5(x22, y22, z22, u22, v21, 5); - verts[i++] = new Vertex5(x12, y11, z12, u12, v12, 5); - - return this; - } - - public CCModel computeNormals() { - return computeNormals(0, verts.length); - } - - /** - * Computes the normals of all faces in the model. - * Uses the cross product of the vectors along 2 sides of the face - * - * @param start The first vertex to generate normals for - * @param length The number of vertices to generate normals for. Note this must be a multiple of 3 for triangles or 4 for quads - * @return The model - */ - public CCModel computeNormals(int start, int length) { - if (length % vp != 0 || start % vp != 0) { - throw new IllegalArgumentException("Cannot generate normals across polygons"); - } - - Vector3[] normals = getOrAllocate(NormalAttribute.attributeKey); - for (int k = 0; k < length; k += vp) { - int i = k + start; - Vector3 diff1 = verts[i + 1].vec.copy().subtract(verts[i].vec); - Vector3 diff2 = verts[i + vp - 1].vec.copy().subtract(verts[i].vec); - normals[i] = diff1.crossProduct(diff2).normalize(); - for (int d = 1; d < vp; d++) { - normals[i + d] = normals[i].copy(); - } - } - - return this; - } - - /** - * Computes lighting using the normals add a light model - * If the model is rotated, the lighting will no longer be valid - * - * @return The model - */ - public CCModel computeLighting(LightModel light) { - Vector3[] normals = normals(); - int[] colours = getAttributes(LightingAttribute.attributeKey); - if (colours == null) { - colours = getOrAllocate(LightingAttribute.attributeKey); - Arrays.fill(colours, -1); - } - for (int k = 0; k < verts.length; k++) { - colours[k] = light.apply(colours[k], normals[k]); - } - return this; - } - - public CCModel setColour(int c) { - int[] colours = getOrAllocate(ColourAttribute.attributeKey); - Arrays.fill(colours, c); - return this; - } - - /** - * Computes the minecraft lighting coordinates for use with a LightMatrix - * - * @return The model - */ - public CCModel computeLightCoords() { - LC[] lcs = getOrAllocate(LightCoordAttribute.attributeKey); - Vector3[] normals = normals(); - for (int i = 0; i < verts.length; i++) { - lcs[i] = new LC().compute(verts[i].vec, normals[i]); - } - return this; - } - - /** - * Averages all normals at the same position to produce a smooth lighting effect. - * - * @return The model - */ - public CCModel smoothNormals() { - ArrayList map = new ArrayList(); - Vector3[] normals = normals(); - nextvert: - for (int k = 0; k < verts.length; k++) { - Vector3 vec = verts[k].vec; - for (PositionNormalEntry e : map) { - if (e.positionEqual(vec)) { - e.addNormal(normals[k]); - continue nextvert; - } - } - - map.add(new PositionNormalEntry(vec).addNormal(normals[k])); - } - - for (PositionNormalEntry e : map) { - if (e.normals.size() <= 1) { - continue; - } - - Vector3 new_n = new Vector3(); - for (Vector3 n : e.normals) { - new_n.add(n); - } - - new_n.normalize(); - for (Vector3 n : e.normals) { - n.set(new_n); - } - } - - return this; - } - - public CCModel apply(Transformation t) { - for (int k = 0; k < verts.length; k++) { - verts[k].apply(t); - } - - Vector3[] normals = normals(); - if (normals != null) { - for (int k = 0; k < normals.length; k++) { - t.applyN(normals[k]); - } - } - - return this; - } - - public CCModel apply(UVTransformation uvt) { - for (int k = 0; k < verts.length; k++) { - verts[k].apply(uvt); - } - - return this; - } - - public CCModel expand(int extraVerts) { - int newLen = verts.length + extraVerts; - verts = Arrays.copyOf(verts, newLen); - for (int i = 0; i < attributes.size(); i++) { - if (attributes.get(i) != null) { - attributes.set(i, VertexAttribute.copyOf((AttributeKey) AttributeKeyRegistry.getAttributeKey(i), attributes.get(i), newLen)); - } - } - - return this; - } - - public void render(CCRenderState state, double x, double y, double z, double u, double v) { - render(state, new Vector3(x, y, z).translation(), new UVTranslation(u, v)); - } - - public void render(CCRenderState state, double x, double y, double z, UVTransformation u) { - render(state, new Vector3(x, y, z).translation(), u); - } - - public void render(CCRenderState state, Transformation t, double u, double v) { - render(state, t, new UVTranslation(u, v)); - } - - public void render(CCRenderState state, IVertexOperation... ops) { - render(state, 0, verts.length, ops); - } - - /** - * Renders vertices start through start+length-1 of the model - * - * @param start The first vertex index to render - * @param end The vertex index to render until - * @param ops Operations to apply - */ - public void render(CCRenderState state, int start, int end, IVertexOperation... ops) { - state.setPipeline(this, start, end, ops); - state.render(); - } - - public static CCModel quadModel(int numVerts) { - return newModel(7, numVerts); - } - - public static CCModel triModel(int numVerts) { - return newModel(4, numVerts); - } - - public static CCModel newModel(int vertexMode, int numVerts) { - CCModel model = newModel(vertexMode); - model.verts = new Vertex5[numVerts]; - return model; - } - - public static CCModel newModel(int vertexMode) { - return new CCModel(vertexMode); - } - - public static CCModel createModel(List verts, List uvs, List normals, int vertexMode, List polys) { - int vp = vertexMode == 7 ? 4 : 3; - if (polys.size() < vp || polys.size() % vp != 0) { - throw new IllegalArgumentException("Invalid number of vertices for model: " + polys.size()); - } - - boolean hasNormals = polys.get(0)[2] > 0; - CCModel model = CCModel.newModel(vertexMode, polys.size()); - if (hasNormals) { - model.getOrAllocate(NormalAttribute.attributeKey); - } - - for (int i = 0; i < polys.size(); i++) { - int[] ai = polys.get(i); - Vector3 vert = verts.get(ai[0] - 1).copy(); - Vector3 uv = ai[1] <= 0 ? new Vector3() : uvs.get(ai[1] - 1).copy(); - if (ai[2] > 0 != hasNormals) { - throw new IllegalArgumentException("Normals are an all or nothing deal here."); - } - - model.verts[i] = new Vertex5(vert, uv.x, uv.y); - if (hasNormals) { - model.normals()[i] = normals.get(ai[2] - 1).copy(); - } - } - - return model; - } - - /** - * Brings the UV coordinates of each face closer to the center UV by d. - * Useful for fixing texture seams - */ - public CCModel shrinkUVs(double d) { - for (int k = 0; k < verts.length; k += vp) { - UV uv = new UV(); - for (int i = 0; i < vp; i++) { - uv.add(verts[k + i].uv); - } - uv.multiply(1D / vp); - for (int i = 0; i < vp; i++) { - Vertex5 vert = verts[k + i]; - vert.uv.u += vert.uv.u < uv.u ? d : -d; - vert.uv.v += vert.uv.v < uv.v ? d : -d; - } - } - return this; - } - - /** - * @param side1 The side of this model - * @param side2 The side of the new model - * @param point The point to rotate around - * @return A copy of this model rotated to the appropriate side - */ - public CCModel sidedCopy(int side1, int side2, Vector3 point) { - return copy().apply(new TransformationList(sideRotations[side1].inverse(), sideRotations[side2]).at(point)); - } - - /** - * Copies length vertices and normals - */ - public static void copy(CCModel src, int srcpos, CCModel dst, int destpos, int length) { - for (int k = 0; k < length; k++) { - dst.verts[destpos + k] = src.verts[srcpos + k].copy(); - } - - for (int i = 0; i < src.attributes.size(); i++) { - if (src.attributes.get(i) != null) { - ArrayUtils.arrayCopy(src.attributes.get(i), srcpos, dst.getOrAllocate(AttributeKeyRegistry.getAttributeKey(i)), destpos, length); - } - } - } - - /** - * Generate models rotated to the other 5 sides of the block - * - * @param models An array of 6 models - * @param side The side of this model - * @param point The rotation point - */ - public static void generateSidedModels(CCModel[] models, int side, Vector3 point) { - for (int s = 0; s < 6; s++) { - if (s == side) { - continue; - } - - models[s] = models[side].sidedCopy(side, s, point); - } - } - - /** - * Generate models rotated to the other 3 horizontal of the block - * - * @param models An array of 4 models - * @param side The side of this model - * @param point The rotation point - */ - public static void generateSidedModelsH(CCModel[] models, int side, Vector3 point) { - for (int s = 2; s < 6; s++) { - if (s == side) { - continue; - } - - models[s] = models[side].sidedCopy(side, s, point); - } - } - - public CCModel backfacedCopy() { - return generateBackface(this, 0, copy(), 0, verts.length); - } - - /** - * Generates copies of faces with clockwise vertices - * - * @return The model - */ - public static CCModel generateBackface(CCModel src, int srcpos, CCModel dst, int destpos, int length) { - int vp = src.vp; - if (srcpos % vp != 0 || destpos % vp != 0 || length % vp != 0) { - throw new IllegalArgumentException("Vertices do not align with polygons"); - } - - int[][] o = new int[][] { { 0, 0 }, { 1, vp - 1 }, { 2, vp - 2 }, { 3, vp - 3 } }; - for (int i = 0; i < length; i++) { - int b = (i / vp) * vp; - int d = i % vp; - int di = destpos + b + o[d][1]; - int si = srcpos + b + o[d][0]; - dst.verts[di] = src.verts[si].copy(); - for (int a = 0; a < src.attributes.size(); a++) { - if (src.attributes.get(a) != null) { - ArrayUtils.arrayCopy(src.attributes.get(a), si, dst.getOrAllocate(AttributeKeyRegistry.getAttributeKey(a)), di, 1); - } - } - - if (dst.normals() != null && dst.normals()[di] != null) { - dst.normals()[di].negate(); - } - } - return dst; - } - - /** - * Generates sided copies of vertices into this model. - * Assumes that your model has been generated at vertex side*(numVerts/6) - */ - public CCModel generateSidedParts(int side, Vector3 point) { - if (verts.length % (6 * vp) != 0) { - throw new IllegalArgumentException("Invalid number of vertices for sided part generation"); - } - int length = verts.length / 6; - - for (int s = 0; s < 6; s++) { - if (s == side) { - continue; - } - - generateSidedPart(side, s, point, length * side, length * s, length); - } - - return this; - } - - /** - * Generates sided copies of vertices into this model. - * Assumes that your model has been generated at vertex side*(numVerts/4) - */ - public CCModel generateSidedPartsH(int side, Vector3 point) { - if (verts.length % (4 * vp) != 0) { - throw new IllegalArgumentException("Invalid number of vertices for sided part generation"); - } - int length = verts.length / 4; - - for (int s = 2; s < 6; s++) { - if (s == side) { - continue; - } - - generateSidedPart(side, s, point, length * (side - 2), length * (s - 2), length); - } - - return this; - } - - /** - * Generates a sided copy of verts into this model - */ - public CCModel generateSidedPart(int side1, int side2, Vector3 point, int srcpos, int destpos, int length) { - return apply(new TransformationList(sideRotations[side1].inverse(), sideRotations[side2]).at(point), srcpos, destpos, length); - } - - /** - * Generates a rotated copy of verts into this model - */ - public CCModel apply(Transformation t, int srcpos, int destpos, int length) { - for (int k = 0; k < length; k++) { - verts[destpos + k] = verts[srcpos + k].copy(); - verts[destpos + k].vec.apply(t); - } - - Vector3[] normals = normals(); - if (normals != null) { - for (int k = 0; k < length; k++) { - normals[destpos + k] = normals[srcpos + k].copy(); - t.applyN(normals[destpos + k]); - } - } - - return this; - } - - public static CCModel combine(Collection models) { - if (models.isEmpty()) { - return null; - } - - int numVerts = 0; - int vertexMode = -1; - for (CCModel model : models) { - if (vertexMode == -1) { - vertexMode = model.vertexMode; - } - if (vertexMode != model.vertexMode) { - throw new IllegalArgumentException("Cannot combine models with different vertex modes"); - } - - numVerts += model.verts.length; - } - - CCModel c_model = newModel(vertexMode, numVerts); - int i = 0; - for (CCModel model : models) { - copy(model, 0, c_model, i, model.verts.length); - i += model.verts.length; - } - - return c_model; - } - - public CCModel twoFacedCopy() { - CCModel model = newModel(vertexMode, verts.length * 2); - copy(this, 0, model, 0, verts.length); - return generateBackface(model, 0, model, verts.length, verts.length); - } - - public CCModel copy() { - CCModel model = newModel(vertexMode, verts.length); - copy(this, 0, model, 0, verts.length); - return model; - } - - /** - * @return The average of all vertices, for bones. - */ - public Vector3 collapse() { - Vector3 v = new Vector3(); - for (Vertex5 vert : verts) { - v.add(vert.vec); - } - v.multiply(1 / (double) verts.length); - return v; - } - - public CCModel zOffset(Cuboid6 offsets) { - for (int k = 0; k < verts.length; k++) { - Vertex5 vert = verts[k]; - Vector3 normal = normals()[k]; - switch (VectorUtils.findSide(normal)) { - case 0: - vert.vec.y += offsets.min.y; - break; - case 1: - vert.vec.y += offsets.max.y; - break; - case 2: - vert.vec.z += offsets.min.z; - break; - case 3: - vert.vec.z += offsets.max.z; - break; - case 4: - vert.vec.x += offsets.min.x; - break; - case 5: - vert.vec.x += offsets.max.x; - break; - } - } - return this; - } - - /** - * @return A Cuboid6 containing all the verts in this model - */ - public Cuboid6 bounds() { - Vector3 vec1 = verts[0].vec; - Cuboid6 c = new Cuboid6(vec1.copy(), vec1.copy()); - for (int i = 1; i < verts.length; i++) { - c.enclose(verts[i].vec); - } - return c; - } -} diff --git a/dependencies/main/java/codechicken/lib/render/CCModelLibrary.java b/dependencies/main/java/codechicken/lib/render/CCModelLibrary.java deleted file mode 100644 index 1a662055cc..0000000000 --- a/dependencies/main/java/codechicken/lib/render/CCModelLibrary.java +++ /dev/null @@ -1,83 +0,0 @@ -package codechicken.lib.render; - -import codechicken.lib.vec.Quat; -import codechicken.lib.vec.Vector3; -import codechicken.lib.vec.Vertex5; - -import static codechicken.lib.math.MathHelper.phi; - -//TODO Maybe expand to some more platonic solids at some point. -public class CCModelLibrary { - - public static CCModel icosahedron4; - public static CCModel icosahedron7; - - private static int i; - - static { - generateIcosahedron(); - } - - private static void generateIcosahedron() { - Vector3[] verts = new Vector3[12]; - - verts[0] = new Vector3(-1, phi, 0); - verts[1] = new Vector3(1, phi, 0); - verts[2] = new Vector3(1, -phi, 0); - verts[3] = new Vector3(-1, -phi, 0); - - verts[4] = new Vector3(0, -1, phi); - verts[5] = new Vector3(0, 1, phi); - verts[6] = new Vector3(0, 1, -phi); - verts[7] = new Vector3(0, -1, -phi); - - verts[8] = new Vector3(phi, 0, -1); - verts[9] = new Vector3(phi, 0, 1); - verts[10] = new Vector3(-phi, 0, 1); - verts[11] = new Vector3(-phi, 0, -1); - - Quat quat = Quat.aroundAxis(0, 0, 1, Math.atan(1 / phi)); - for (Vector3 vec : verts) { - quat.rotate(vec); - } - - icosahedron4 = CCModel.newModel(4, 60); - icosahedron7 = CCModel.newModel(7, 80); - - i = 0; - //top - addIcosahedronTriangle(verts[1], 0.5, 0, verts[0], 0, 0.25, verts[5], 1, 0.25); - addIcosahedronTriangle(verts[1], 0.5, 0, verts[5], 0, 0.25, verts[9], 1, 0.25); - addIcosahedronTriangle(verts[1], 0.5, 0, verts[9], 0, 0.25, verts[8], 1, 0.25); - addIcosahedronTriangle(verts[1], 0.5, 0, verts[8], 0, 0.25, verts[6], 1, 0.25); - addIcosahedronTriangle(verts[1], 0.5, 0, verts[6], 0, 0.25, verts[0], 1, 0.25); - //centre 1vert top - addIcosahedronTriangle(verts[0], 0.5, 0.25, verts[11], 0, 0.75, verts[10], 1, 0.75); - addIcosahedronTriangle(verts[5], 0.5, 0.25, verts[10], 0, 0.75, verts[4], 1, 0.75); - addIcosahedronTriangle(verts[9], 0.5, 0.25, verts[4], 0, 0.75, verts[2], 1, 0.75); - addIcosahedronTriangle(verts[8], 0.5, 0.25, verts[2], 0, 0.75, verts[7], 1, 0.75); - addIcosahedronTriangle(verts[6], 0.5, 0.25, verts[7], 0, 0.75, verts[11], 1, 0.75); - //centre 1vert bottom - addIcosahedronTriangle(verts[2], 0.5, 0.75, verts[8], 0, 0.25, verts[9], 1, 0.25); - addIcosahedronTriangle(verts[7], 0.5, 0.75, verts[6], 0, 0.25, verts[8], 1, 0.25); - addIcosahedronTriangle(verts[11], 0.5, 0.75, verts[0], 0, 0.25, verts[6], 1, 0.25); - addIcosahedronTriangle(verts[10], 0.5, 0.75, verts[5], 0, 0.25, verts[0], 1, 0.25); - addIcosahedronTriangle(verts[4], 0.5, 0.75, verts[9], 0, 0.25, verts[5], 1, 0.25); - //bottom - addIcosahedronTriangle(verts[3], 0.5, 1, verts[2], 0, 0.75, verts[4], 1, 0.75); - addIcosahedronTriangle(verts[3], 0.5, 1, verts[7], 0, 0.75, verts[2], 1, 0.75); - addIcosahedronTriangle(verts[3], 0.5, 1, verts[11], 0, 0.75, verts[7], 1, 0.75); - addIcosahedronTriangle(verts[3], 0.5, 1, verts[10], 0, 0.75, verts[11], 1, 0.75); - addIcosahedronTriangle(verts[3], 0.5, 1, verts[4], 0, 0.75, verts[10], 1, 0.75); - - icosahedron4.computeNormals().smoothNormals(); - icosahedron7.computeNormals().smoothNormals(); - } - - private static void addIcosahedronTriangle(Vector3 vec1, double u1, double v1, Vector3 vec2, double u2, double v2, Vector3 vec3, double u3, double v3) { - icosahedron4.verts[i * 3] = icosahedron7.verts[i * 4] = new Vertex5(vec1, u1, v1); - icosahedron4.verts[i * 3 + 1] = icosahedron7.verts[i * 4 + 1] = new Vertex5(vec2, u2, v2); - icosahedron4.verts[i * 3 + 2] = icosahedron7.verts[i * 4 + 2] = icosahedron7.verts[i * 4 + 3] = new Vertex5(vec3, u3, v3); - i++; - } -} diff --git a/dependencies/main/java/codechicken/lib/render/CCModelState.java b/dependencies/main/java/codechicken/lib/render/CCModelState.java deleted file mode 100644 index a6352b8597..0000000000 --- a/dependencies/main/java/codechicken/lib/render/CCModelState.java +++ /dev/null @@ -1,79 +0,0 @@ -package codechicken.lib.render; - -import com.google.common.base.Optional; -import com.google.common.collect.ImmutableMap; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ItemTransformVec3f; -import net.minecraftforge.client.model.IPerspectiveAwareModel.MapWrapper; -import net.minecraftforge.common.model.IModelPart; -import net.minecraftforge.common.model.IModelState; -import net.minecraftforge.common.model.TRSRTransformation; - -/** - * Created by covers1624 on 5/16/2016. - * Same as a SimpleModelState except has a getter for the Transform map. - * TODO Fix toVanillaTransform. - */ -public class CCModelState implements IModelState { - - private final ImmutableMap map; - private final Optional defaultTransform; - - public CCModelState(ImmutableMap map) { - this(map, Optional.absent()); - } - - public CCModelState(ImmutableMap map, Optional defaultTransform) { - this.map = map; - this.defaultTransform = defaultTransform; - } - - public Optional apply(Optional part) { - if (!part.isPresent() || !(part.get() instanceof TransformType) || !map.containsKey(part.get())) { - return defaultTransform; - } - return Optional.fromNullable(map.get(part.get())); - } - - public ImmutableMap getTransforms() { - return MapWrapper.getTransforms(this); - } - - @SuppressWarnings ("deprecation")//TODO, This seems to create invalid transforms. - public ItemCameraTransforms toVanillaTransform() { - ItemTransformVec3f thirdPLeft = ItemTransformVec3f.DEFAULT; - ItemTransformVec3f thirdPRight = ItemTransformVec3f.DEFAULT; - ItemTransformVec3f firstPLeft = ItemTransformVec3f.DEFAULT; - ItemTransformVec3f firstPRight = ItemTransformVec3f.DEFAULT; - ItemTransformVec3f head = ItemTransformVec3f.DEFAULT; - ItemTransformVec3f gui = ItemTransformVec3f.DEFAULT; - ItemTransformVec3f ground = ItemTransformVec3f.DEFAULT; - ItemTransformVec3f fixed = ItemTransformVec3f.DEFAULT; - if (map.containsKey(TransformType.THIRD_PERSON_LEFT_HAND)) { - thirdPLeft = map.get(TransformType.THIRD_PERSON_LEFT_HAND).toItemTransform(); - } - if (map.containsKey(TransformType.THIRD_PERSON_RIGHT_HAND)) { - thirdPRight = map.get(TransformType.THIRD_PERSON_RIGHT_HAND).toItemTransform(); - } - if (map.containsKey(TransformType.FIRST_PERSON_LEFT_HAND)) { - firstPLeft = map.get(TransformType.FIRST_PERSON_LEFT_HAND).toItemTransform(); - } - if (map.containsKey(TransformType.FIRST_PERSON_RIGHT_HAND)) { - firstPRight = map.get(TransformType.FIRST_PERSON_RIGHT_HAND).toItemTransform(); - } - if (map.containsKey(TransformType.HEAD)) { - head = map.get(TransformType.HEAD).toItemTransform(); - } - if (map.containsKey(TransformType.GUI)) { - gui = map.get(TransformType.GUI).toItemTransform(); - } - if (map.containsKey(TransformType.GROUND)) { - ground = map.get(TransformType.GROUND).toItemTransform(); - } - if (map.containsKey(TransformType.FIXED)) { - fixed = map.get(TransformType.FIXED).toItemTransform(); - } - return new ItemCameraTransforms(thirdPLeft, thirdPRight, firstPLeft, firstPRight, head, gui, ground, fixed); - } -} diff --git a/dependencies/main/java/codechicken/lib/render/CCOBJParser.java b/dependencies/main/java/codechicken/lib/render/CCOBJParser.java deleted file mode 100644 index d987b0924b..0000000000 --- a/dependencies/main/java/codechicken/lib/render/CCOBJParser.java +++ /dev/null @@ -1,289 +0,0 @@ -package codechicken.lib.render; - -import codechicken.lib.vec.RedundantTransformation; -import codechicken.lib.vec.Transformation; -import codechicken.lib.vec.Vector3; -import codechicken.lib.vec.uv.UV; -import net.minecraft.client.Minecraft; -import net.minecraft.util.ResourceLocation; - -import java.io.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Created by covers1624 on 6/21/2016. - * TODO Support MatLib files. - * TODO Custom Mat file for loading LightModels, calculating normals and applying the lighting and rotations. - */ -public class CCOBJParser { - - private static final Pattern vertPattern = Pattern.compile("v(?: ([\\d\\.+-]+))+"); - private static final Pattern uvwPattern = Pattern.compile("vt(?: ([\\d\\.+-]+))+"); - private static final Pattern normalPattern = Pattern.compile("vn(?: ([\\d\\.+-]+))+"); - private static final Pattern polyPattern = Pattern.compile("f(?: ((?:\\d*)(?:/\\d*)?(?:/\\d*)?))+"); - public static final Matcher vertMatcher = vertPattern.matcher(""); - public static final Matcher uvwMatcher = uvwPattern.matcher(""); - public static final Matcher normalMatcher = normalPattern.matcher(""); - public static final Matcher polyMatcher = polyPattern.matcher(""); - - /** - * Parses vertices, texture coords, normals and polygons from a WaveFront Obj file - * - * @param res The resource for the obj file - * @return A map of group names to models - */ - public static Map parseObjModels(ResourceLocation res) { - return parseObjModels(res, null); - } - - /** - * Parses vertices, texture coords, normals and polygons from a WaveFront Obj file - * - * @param res The resource for the obj file - * @param coordSystem The cooridnate system transformation to apply - * @return A map of group names to models - */ - public static Map parseObjModels(ResourceLocation res, Transformation coordSystem) { - return parseObjModels(res, 4, coordSystem); - } - - /** - * Parses vertices, texture coords, normals and polygons from a WaveFront Obj file - * - * @param res The resource for the obj file - * @param vertexMode The vertex mode to create the model for (GL_TRIANGLES or GL_QUADS) - * @param coordSystem The cooridnate system transformation to apply - * @return A map of group names to models - */ - public static Map parseObjModels(ResourceLocation res, int vertexMode, Transformation coordSystem) { - try { - return parseObjModels(Minecraft.getMinecraft().getResourceManager().getResource(res).getInputStream(), vertexMode, coordSystem); - } catch (Exception e) { - throw new RuntimeException("failed to load model: " + res, e); - } - } - - /** - * Parses vertices, texture coords, normals and polygons from a WaveFront Obj file - * - * @param input An input stream to a obj file - * @param vertexMode The vertex mode to create the model for (GL_TRIANGLES or GL_QUADS) - * @param coordSystem The cooridnate system transformation to apply - * @return A map of group names to models - * @throws IOException - */ - public static Map parseObjModels(InputStream input, int vertexMode, Transformation coordSystem) throws IOException { - if (coordSystem == null) { - coordSystem = new RedundantTransformation(); - } - int vp = vertexMode == 7 ? 4 : 3; - - HashMap modelMap = new HashMap(); - ArrayList verts = new ArrayList(); - ArrayList uvs = new ArrayList(); - ArrayList normals = new ArrayList(); - ArrayList polys = new ArrayList(); - String modelName = "unnamed"; - - BufferedReader reader = new BufferedReader(new InputStreamReader(input)); - - String line; - while ((line = reader.readLine()) != null) { - line = line.replaceAll("\\s+", " ").trim(); - if (line.startsWith("#") || line.length() == 0) { - continue; - } - - if (line.startsWith("v ")) { - assertMatch(vertMatcher, line); - double[] values = parseDoubles(line.substring(2), " "); - illegalAssert(values.length >= 3, "Vertices must have x, y and z components"); - Vector3 vert = new Vector3(values[0], values[1], values[2]); - coordSystem.apply(vert); - verts.add(vert); - continue; - } - if (line.startsWith("vt ")) { - assertMatch(uvwMatcher, line); - double[] values = parseDoubles(line.substring(3), " "); - illegalAssert(values.length >= 2, "Tex Coords must have u, and v components"); - uvs.add(new Vector3(values[0], 1 - values[1], 0)); - continue; - } - if (line.startsWith("vn ")) { - assertMatch(normalMatcher, line); - double[] values = parseDoubles(line.substring(3), " "); - illegalAssert(values.length >= 3, "Normals must have x, y and z components"); - Vector3 norm = new Vector3(values[0], values[1], values[2]).normalize(); - coordSystem.applyN(norm); - normals.add(norm); - continue; - } - if (line.startsWith("f ")) { - assertMatch(polyMatcher, line); - String[] av = line.substring(2).split(" "); - illegalAssert(av.length >= 3, "Polygons must have at least 3 vertices"); - int[][] polyVerts = new int[av.length][3]; - for (int i = 0; i < av.length; i++) { - String[] as = av[i].split("/"); - for (int p = 0; p < as.length; p++) { - if (as[p].length() > 0) { - polyVerts[i][p] = Integer.parseInt(as[p]); - } - } - } - if (vp == 3) { - triangulate(polys, polyVerts); - } else { - quadulate(polys, polyVerts); - } - } - if (line.startsWith("g ")) { - if (!polys.isEmpty()) { - modelMap.put(modelName, CCModel.createModel(verts, uvs, normals, vertexMode, polys)); - polys.clear(); - } - modelName = line.substring(2); - } - } - - if (!polys.isEmpty()) { - modelMap.put(modelName, CCModel.createModel(verts, uvs, normals, vertexMode, polys)); - } - - return modelMap; - } - - /** - * Exports an Map of CCModels to a File. - * - * @param models Map of models to export. - * @param p PrintWriter to write the model to. - */ - public static void exportObj(Map models, PrintWriter p) { - List verts = new ArrayList(); - List uvs = new ArrayList(); - List normals = new ArrayList(); - List polys = new ArrayList(); - for (Map.Entry e : models.entrySet()) { - p.println("g " + e.getKey()); - CCModel m = e.getValue(); - - int vStart = verts.size(); - int uStart = uvs.size(); - int nStart = normals.size(); - boolean hasNormals = m.normals() != null; - polys.clear(); - - for (int i = 0; i < m.verts.length; i++) { - int[] ia = new int[hasNormals ? 3 : 2]; - ia[0] = addIndex(verts, m.verts[i].vec); - ia[1] = addIndex(uvs, m.verts[i].uv); - if (hasNormals) { - ia[2] = addIndex(normals, m.normals()[i]); - } - polys.add(ia); - } - - if (vStart < verts.size()) { - p.println(); - for (int i = vStart; i < verts.size(); i++) { - Vector3 v = verts.get(i); - p.format("v %s %s %s\n", clean(v.x), clean(v.y), clean(v.z)); - } - } - if (uStart < uvs.size()) { - p.println(); - for (int i = uStart; i < uvs.size(); i++) { - UV uv = uvs.get(i); - p.format("vt %s %s\n", clean(uv.u), clean(uv.v)); - } - } - if (nStart < normals.size()) { - p.println(); - for (int i = nStart; i < normals.size(); i++) { - Vector3 n = normals.get(i); - p.format("vn %s %s %s\n", clean(n.x), clean(n.y), clean(n.z)); - } - } - - p.println(); - for (int i = 0; i < polys.size(); i++) { - if (i % m.vp == 0) { - p.format("f"); - } - int[] ia = polys.get(i); - if (hasNormals) { - p.format(" %d/%d/%d", ia[0], ia[1], ia[2]); - } else { - p.format(" %d/%d", ia[0], ia[1]); - } - if (i % m.vp == m.vp - 1) { - p.println(); - } - } - } - } - - private static int addIndex(List list, T elem) { - int i = list.indexOf(elem) + 1; - if (i == 0) { - list.add(elem); - i = list.size(); - } - return i; - } - - private static String clean(double d) { - return d == (int) d ? Integer.toString((int) d) : Double.toString(d); - } - - private static void assertMatch(Matcher m, String s) { - m.reset(s); - illegalAssert(m.matches(), "Malformed line: " + s); - } - - private static void illegalAssert(boolean b, String err) { - if (!b) { - throw new IllegalArgumentException(err); - } - } - - private static double[] parseDoubles(String s, String token) { - String[] as = s.split(token); - double[] values = new double[as.length]; - for (int i = 0; i < as.length; i++) { - values[i] = Double.parseDouble(as[i]); - } - return values; - } - - private static void triangulate(List polys, int[][] polyVerts) { - for (int i = 2; i < polyVerts.length; i++) { - polys.add(polyVerts[0]); - polys.add(polyVerts[i]); - polys.add(polyVerts[i - 1]); - } - } - - private static void quadulate(List polys, int[][] polyVerts) { - if (polyVerts.length == 4) { - polys.add(polyVerts[0]); - polys.add(polyVerts[3]); - polys.add(polyVerts[2]); - polys.add(polyVerts[1]); - } else { - for (int i = 2; i < polyVerts.length; i++) { - polys.add(polyVerts[0]); - polys.add(polyVerts[i]); - polys.add(polyVerts[i - 1]); - polys.add(polyVerts[i - 1]); - } - } - } -} diff --git a/dependencies/main/java/codechicken/lib/render/CCRSConsumer.java b/dependencies/main/java/codechicken/lib/render/CCRSConsumer.java deleted file mode 100644 index 1459fee901..0000000000 --- a/dependencies/main/java/codechicken/lib/render/CCRSConsumer.java +++ /dev/null @@ -1,86 +0,0 @@ -package codechicken.lib.render; - -import codechicken.lib.colour.Colour; -import codechicken.lib.vec.Vector3; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.client.renderer.vertex.VertexFormatElement; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraftforge.client.model.pipeline.IVertexConsumer; - -/** - * Created by covers1624 on 15/01/2017. - * TODO, Maybe merge with CCRS?? - */ -public class CCRSConsumer implements IVertexConsumer { - - private final CCRenderState ccrs; - private Vector3 offset = Vector3.zero; - - public CCRSConsumer(CCRenderState ccrs) { - this.ccrs = ccrs; - } - - @Override - public VertexFormat getVertexFormat() { - return ccrs.getVertexFormat(); - } - - @Override - public void setTexture(TextureAtlasSprite texture) { - ccrs.sprite = texture; - } - - @Override - public void put(int e, float... data) { - VertexFormat format = getVertexFormat(); - - VertexFormatElement fmte = format.getElement(e); - switch (fmte.getUsage()) { - case POSITION: - ccrs.vert.vec.set(data).add(offset); - break; - case UV: - if (fmte.getIndex() == 0) { - ccrs.vert.uv.set(data[0], data[1]); - } else { - ccrs.brightness = (int) (data[1] * 65535 / 32) << 20 | (int) (data[0] * 65535 / 32) << 4; - } - break; - case COLOR: - ccrs.colour = Colour.packRGBA(data); - break; - case NORMAL: - ccrs.normal.set(data); - break; - case PADDING: - break; - default: - throw new UnsupportedOperationException("Generic vertex format element"); - } - if (e == format.getElementCount() - 1) { - ccrs.writeVert(); - } - } - - public void setOffset(Vector3 offset) { - this.offset = offset; - } - - public void setOffset(BlockPos offset) { - this.offset = Vector3.fromBlockPos(offset); - } - - @Override - public void setQuadTint(int tint) { - } - - @Override - public void setQuadOrientation(EnumFacing orientation) { - } - - @Override - public void setApplyDiffuseLighting(boolean diffuse) { - } -} diff --git a/dependencies/main/java/codechicken/lib/render/CCRenderEventHandler.java b/dependencies/main/java/codechicken/lib/render/CCRenderEventHandler.java deleted file mode 100644 index 0135f0ae99..0000000000 --- a/dependencies/main/java/codechicken/lib/render/CCRenderEventHandler.java +++ /dev/null @@ -1,56 +0,0 @@ -package codechicken.lib.render; - -import codechicken.lib.raytracer.CuboidRayTraceResult; -import codechicken.lib.vec.Vector3; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.RayTraceResult.Type; -import net.minecraftforge.client.event.DrawBlockHighlightEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public class CCRenderEventHandler { - - public static int renderTime; - public static float renderFrame; - - private static boolean hasInit = false; - - public static void init() { - if (!hasInit) { - MinecraftForge.EVENT_BUS.register(new CCRenderEventHandler()); - hasInit = true; - } - } - - @SubscribeEvent - public void clientTick(TickEvent.ClientTickEvent event) { - if (event.phase == Phase.END) { - renderTime++; - } - } - - @SubscribeEvent - public void renderTick(TickEvent.RenderTickEvent event) { - if (event.phase == Phase.START) { - renderFrame = event.renderTickTime; - } - } - - @SideOnly (Side.CLIENT) - @SubscribeEvent//TODO Change event priority. - public void onBlockHighlight(DrawBlockHighlightEvent event) { - BlockPos pos = event.getTarget().getBlockPos(); - - //We have found a CuboidRayTraceResult, Lets render it properly.. - RayTraceResult hit = event.getTarget(); - if (hit.typeOfHit == Type.BLOCK && hit instanceof CuboidRayTraceResult && !((CuboidRayTraceResult) hit).disableAutoHitboxRender) { - event.setCanceled(true); - RenderUtils.renderHitBox(event.getPlayer(), ((CuboidRayTraceResult) event.getTarget()).cuboid6.copy().add(new Vector3(pos)), event.getPartialTicks()); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/render/CCRenderState.java b/dependencies/main/java/codechicken/lib/render/CCRenderState.java deleted file mode 100644 index 5fefa35b2f..0000000000 --- a/dependencies/main/java/codechicken/lib/render/CCRenderState.java +++ /dev/null @@ -1,297 +0,0 @@ -package codechicken.lib.render; - -import codechicken.lib.colour.Colour; -import codechicken.lib.colour.ColourRGBA; -import codechicken.lib.lighting.LC; -import codechicken.lib.lighting.LightMatrix; -import codechicken.lib.render.buffer.BakingVertexBuffer; -import codechicken.lib.render.pipeline.CCRenderPipeline; -import codechicken.lib.render.pipeline.IVertexOperation; -import codechicken.lib.render.pipeline.IVertexSource; -import codechicken.lib.render.pipeline.VertexAttribute; -import codechicken.lib.render.pipeline.attribute.*; -import codechicken.lib.vec.Vector3; -import codechicken.lib.vec.Vertex5; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.VertexBuffer; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.client.renderer.vertex.VertexFormatElement; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import org.lwjgl.opengl.GL11; - -import java.util.List; - -/** - * The core of the CodeChickenLib render system. - * Where possible assign a local var of CCRenderState to avoid millions of calls to instance(); - * Uses a ThreadLocal system to assign each thread their own CCRenderState so we can use it in Multithreaded chunk batching. - * TODO, proper piping of BakedQuads and CCBakedQuads. - */ -public class CCRenderState { - - private static int nextOperationIndex; - - public static int registerOperation() { - return nextOperationIndex++; - } - - public static int operationCount() { - return nextOperationIndex; - } - - //Each attrib needs to be assigned in this order to have a valid operation index. - public final VertexAttribute normalAttrib = new NormalAttribute(); - public final VertexAttribute colourAttrib = new ColourAttribute(); - public final VertexAttribute lightingAttrib = new LightingAttribute(); - public final VertexAttribute sideAttrib = new SideAttribute(); - public final VertexAttribute lightCoordAttrib = new LightCoordAttribute(); - - private static final ThreadLocal instances = new ThreadLocal() { - @Override - protected CCRenderState initialValue() { - return new CCRenderState(); - } - }; - private static final CCRenderState bakingRenderState = new CCRenderState(); - - //pipeline state - public IVertexSource model; - public int firstVertexIndex; - public int lastVertexIndex; - public int vertexIndex; - public CCRenderPipeline pipeline; - @SideOnly (Side.CLIENT) - public VertexBuffer r; - @SideOnly (Side.CLIENT) - public VertexFormat fmt; - - //context - public int baseColour; - public int alphaOverride; - public boolean computeLighting; - public LightMatrix lightMatrix = new LightMatrix(); - - //vertex outputs - public final Vertex5 vert = new Vertex5(); - public final Vector3 normal = new Vector3(); - public int colour; - public int brightness; - - //attribute storage - public int side; - public LC lc = new LC(); - @SideOnly (Side.CLIENT) - public TextureAtlasSprite sprite; - - private CCRenderState() { - pipeline = new CCRenderPipeline(this); - - } - - public static CCRenderState instance() { - return instances.get(); - } - - public static CCRenderState getBakingRenderState() { - return bakingRenderState; - } - - public void reset() { - model = null; - pipeline.reset(); - computeLighting = true; - baseColour = alphaOverride = -1; - } - - public void preRenderWorld(IBlockAccess world, BlockPos pos) { - this.reset(); - this.colour = 0xFFFFFFFF; - this.setBrightness(world, pos); - } - - public void setPipeline(IVertexOperation... ops) { - pipeline.setPipeline(ops); - } - - public void setPipeline(IVertexSource model, int start, int end, IVertexOperation... ops) { - pipeline.reset(); - pipeline.forceFormatAttributes = false; - setModel(model, start, end); - pipeline.forceFormatAttributes = true; - pipeline.setPipeline(ops); - } - - public void bindModel(IVertexSource model) { - if (this.model != model) { - this.model = model; - pipeline.rebuild(); - } - } - - public void setModel(IVertexSource source) { - setModel(source, 0, source.getVertices().length); - } - - public void setModel(IVertexSource source, int start, int end) { - bindModel(source); - setVertexRange(start, end); - } - - public void setVertexRange(int start, int end) { - firstVertexIndex = start; - lastVertexIndex = end; - } - - public void renderQuads(List quads) { - VertexBuffer buffer = startDrawing(GL11.GL_QUADS, quads.get(0).getFormat()); - for (BakedQuad quad : quads) { - buffer.addVertexData(quad.getVertexData()); - } - draw(); - } - - public void render(IVertexOperation... ops) { - setPipeline(ops); - render(); - } - - public void render() { - Vertex5[] verts = model.getVertices(); - for (vertexIndex = firstVertexIndex; vertexIndex < lastVertexIndex; vertexIndex++) { - model.prepareVertex(this); - vert.set(verts[vertexIndex]); - runPipeline(); - writeVert(); - } - } - - public void runPipeline() { - pipeline.operate(); - } - - public void writeVert() { - if (r instanceof BakingVertexBuffer) { - ((BakingVertexBuffer) r).setSprite(sprite); - } - for (int e = 0; e < fmt.getElementCount(); e++) { - VertexFormatElement fmte = fmt.getElement(e); - switch (fmte.getUsage()) { - case POSITION: - r.pos(vert.vec.x, vert.vec.y, vert.vec.z); - break; - case UV: - if (fmte.getIndex() == 0) { - r.tex(vert.uv.u, vert.uv.v); - } else { - r.lightmap(brightness >> 16 & 65535, brightness & 65535); - } - break; - case COLOR: - if (r.isColorDisabled()) { - //-_- Fucking mojang.. - r.nextVertexFormatIndex(); - } else { - r.color(colour >>> 24, colour >> 16 & 0xFF, colour >> 8 & 0xFF, alphaOverride >= 0 ? alphaOverride : colour & 0xFF); - } - break; - case NORMAL: - r.normal((float) normal.x, (float) normal.y, (float) normal.z); - break; - case PADDING: - break; - default: - throw new UnsupportedOperationException("Generic vertex format element"); - } - } - r.endVertex(); - } - - public void pushColour() { - GlStateManager.color((colour >>> 24) / 255F, (colour >> 16 & 0xFF) / 255F, (colour >> 8 & 0xFF) / 255F, (alphaOverride >= 0 ? alphaOverride : colour & 0xFF) / 255F); - } - - public void setBrightness(IBlockAccess world, BlockPos pos) { - brightness = world.getBlockState(pos).getBlock().getPackedLightmapCoords(world.getBlockState(pos), world, pos); - } - - public void pullLightmap() { - brightness = (int) OpenGlHelper.lastBrightnessY << 16 | (int) OpenGlHelper.lastBrightnessX; - } - - public void pushLightmap() { - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, brightness & 0xFFFF, brightness >>> 16); - } - - public void setFluidColour(FluidStack fluidStack) { - setFluidColour(fluidStack, 0xFF); - } - - public void setFluidColour(FluidStack fluidStack, int alpha) { - this.colour = fluidStack.getFluid().getColor(fluidStack) << 8 | alpha; - } - - public void setColour(Colour colour) { - this.colour = colour.rgba(); - } - - public ColourRGBA getColour() { - return new ColourRGBA(colour); - } - - @SideOnly (Side.CLIENT) - public VertexBuffer startDrawing(int mode, VertexFormat format) { - VertexBuffer r = Tessellator.getInstance().getBuffer(); - r.begin(mode, format); - bind(r); - return r; - } - - @SideOnly (Side.CLIENT) - public VertexBuffer startDrawing(int mode, VertexFormat format, VertexBuffer buffer) { - buffer.begin(mode, format); - bind(buffer); - return buffer; - } - - @SideOnly (Side.CLIENT) - public void bind(VertexBuffer r) { - this.r = r; - fmt = r.getVertexFormat(); - } - - @SideOnly (Side.CLIENT) - public VertexBuffer getBuffer() { - return r; - } - - @SideOnly (Side.CLIENT) - public VertexFormat getVertexFormat() { - return fmt; - } - - public void draw() { - Tessellator.getInstance().draw(); - } - - /** - * Polls the currently bound VertexBuffer to see if it is drawing. - * If no buffer is bound it checks Tessellator.getInstance.getBuffer. - * - * @return If the buffer is drawing. - */ - public boolean isDrawing() { - if (r != null) { - return r.isDrawing; - } else { - return Tessellator.getInstance().getBuffer().isDrawing; - } - } -} diff --git a/dependencies/main/java/codechicken/lib/render/DigIconParticle.java b/dependencies/main/java/codechicken/lib/render/DigIconParticle.java deleted file mode 100644 index cc43d54bf3..0000000000 --- a/dependencies/main/java/codechicken/lib/render/DigIconParticle.java +++ /dev/null @@ -1,92 +0,0 @@ -package codechicken.lib.render; - -import codechicken.lib.render.particle.CustomParticleHandler; -import codechicken.lib.vec.Cuboid6; -import net.minecraft.client.particle.Particle; -import net.minecraft.client.particle.ParticleManager; -import net.minecraft.client.renderer.VertexBuffer; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.entity.Entity; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; - -public class DigIconParticle extends Particle { - - public DigIconParticle(World world, double x, double y, double z, double dx, double dy, double dz, TextureAtlasSprite icon) { - super(world, x, y, z, dx, dy, dz); - particleTexture = icon; - particleGravity = 1; - particleRed = particleGreen = particleBlue = 0.6F; - particleScale /= 2.0F; - } - - public static DigIconParticle newLandingParticle(World world, double x, double y, double z, double dx, double dy, double dz, TextureAtlasSprite icon) { - DigIconParticle particle = new DigIconParticle(world, x, y, z, dx, dy, dz, icon); - particle.motionX = dx; - particle.motionY = dy; - particle.motionZ = dz; - return particle; - } - - @Override - public int getFXLayer() { - return 1; - } - - public void setScale(float scale) { - particleScale = scale; - } - - public float getScale() { - return particleScale; - } - - public void setMaxAge(int age) { - particleMaxAge = age; - } - - public int getMaxAge() { - return particleMaxAge; - } - - /** - * copy pasted from ParticleBreaking - * //TODO Doc. - */ - @Override - public void renderParticle(VertexBuffer vertexBuffer, Entity entity, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) { - float f = ((float) this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; - float f1 = f + 0.015609375F; - float f2 = ((float) this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; - float f3 = f2 + 0.015609375F; - float f4 = 0.1F * this.particleScale; - - if (this.particleTexture != null) { - f = this.particleTexture.getInterpolatedU((double) (this.particleTextureJitterX / 4.0F * 16.0F)); - f1 = this.particleTexture.getInterpolatedU((double) ((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); - f2 = this.particleTexture.getInterpolatedV((double) (this.particleTextureJitterY / 4.0F * 16.0F)); - f3 = this.particleTexture.getInterpolatedV((double) ((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); - } - - float f5 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) partialTicks - interpPosX); - float f6 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) partialTicks - interpPosY); - float f7 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) partialTicks - interpPosZ); - int i = this.getBrightnessForRender(partialTicks); - int j = i >> 16 & 65535; - int k = i & 65535; - vertexBuffer.pos((double) (f5 - rotationX * f4 - rotationXY * f4), (double) (f6 - rotationZ * f4), (double) (f7 - rotationYZ * f4 - rotationXZ * f4)).tex((double) f, (double) f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); - vertexBuffer.pos((double) (f5 - rotationX * f4 + rotationXY * f4), (double) (f6 + rotationZ * f4), (double) (f7 - rotationYZ * f4 + rotationXZ * f4)).tex((double) f, (double) f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); - vertexBuffer.pos((double) (f5 + rotationX * f4 + rotationXY * f4), (double) (f6 + rotationZ * f4), (double) (f7 + rotationYZ * f4 + rotationXZ * f4)).tex((double) f1, (double) f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); - vertexBuffer.pos((double) (f5 + rotationX * f4 - rotationXY * f4), (double) (f6 - rotationZ * f4), (double) (f7 + rotationYZ * f4 - rotationXZ * f4)).tex((double) f1, (double) f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); - } - - @Deprecated//Use CustomParticleHandler.addBlockHitEffects This will be removed in 1.11 - public static void addBlockHitEffects(World world, Cuboid6 bounds, int side, TextureAtlasSprite icon, ParticleManager effectRenderer) { - CustomParticleHandler.addBlockHitEffects(world, bounds, EnumFacing.VALUES[side], icon, effectRenderer); - } - - @Deprecated//Use CustomParticleHandler.addBlockDestroyEffects This will be removed in 1.11 - public static void addBlockDestroyEffects(World world, Cuboid6 bounds, TextureAtlasSprite[] icons, ParticleManager effectRenderer) { - CustomParticleHandler.addBlockDestroyEffects(world, bounds, icons, effectRenderer); - } -} diff --git a/dependencies/main/java/codechicken/lib/render/QBImporter.java b/dependencies/main/java/codechicken/lib/render/QBImporter.java deleted file mode 100644 index 2990847591..0000000000 --- a/dependencies/main/java/codechicken/lib/render/QBImporter.java +++ /dev/null @@ -1,808 +0,0 @@ -package codechicken.lib.render; - -import codechicken.lib.texture.TextureDataHolder; -import codechicken.lib.texture.TextureUtils; -import codechicken.lib.vec.*; -import codechicken.lib.vec.uv.UV; -import codechicken.lib.vec.uv.UVScale; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.ResourceLocation; - -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.io.*; -import java.util.*; - -//TODO, Is this needed anymore? -public class QBImporter { - - private static class ImagePackNode { - - Rectangle4i rect; - ImagePackNode child1; - ImagePackNode child2; - QBImage packed; - - public ImagePackNode(int x, int y, int w, int h) { - rect = new Rectangle4i(x, y, w, h); - } - - public boolean pack(QBImage img) { - if (child1 != null) { - return child1.pack(img) || child2.pack(img); - } - - if (packed != null) { - return false; - } - - int fit = getFit(img.width(), img.height()); - if (fit == 0) { - return false; - } - - if ((fit & 2) != 0) {//exact fit - packed = img; - img.packSlot = rect; - img.packT = new ImageTransform((fit & 1) << 2); - return true; - } - - int w = (fit & 1) == 0 ? img.width() : img.height(); - int h = (fit & 1) == 0 ? img.height() : img.width(); - - if (rect.w - w > rect.h - h) {//create split with biggest leftover space - child1 = new ImagePackNode(rect.x, rect.y, w, rect.h); - child2 = new ImagePackNode(rect.x + w, rect.y, rect.w - w, rect.h); - } else { - child1 = new ImagePackNode(rect.x, rect.y, rect.w, h); - child2 = new ImagePackNode(rect.x, rect.y + h, rect.w, rect.h - h); - } - return child1.pack(img); - } - - private int getFit(int w, int h) { - if (w == rect.w && h == rect.h) { - return 2; - } - if (w == rect.h && h == rect.w) { - return 3; - } - if (rect.w >= w && rect.h >= h) { - return 4; - } - if (rect.w >= h && rect.h >= w) { - return 5; - } - - return 0; - } - - private static void nextSize(Rectangle4i rect, boolean square) { - if (square) { - rect.w <<= 1; - rect.h <<= 1; - } else { - if (rect.w == rect.h) { - rect.w *= 2; - } else { - rect.h *= 2; - } - } - } - - public static ImagePackNode pack(List images, boolean square) { - Collections.sort(images); - - int area = 0; - for (QBImage img : images) { - area += img.area(); - } - - ImagePackNode node = new ImagePackNode(0, 0, 2, 2); - while (node.rect.area() < area) { - nextSize(node.rect, square); - } - - while (true) { - boolean packed = true; - for (QBImage img : images) { - if (!node.pack(img)) { - packed = false; - break; - } - } - - if (packed) { - return node; - } - - node.child1 = node.child2 = null; - nextSize(node.rect, square); - } - } - - public BufferedImage toImage() { - BufferedImage img = new BufferedImage(rect.w, rect.h, BufferedImage.TYPE_INT_ARGB); - write(img); - return img; - } - - private void write(BufferedImage img) { - if (child1 != null) { - child1.write(img); - child2.write(img); - } else if (packed != null) { - ImageTransform t = packed.packT; - for (int u = 0; u < rect.w; u++) { - for (int v = 0; v < rect.h; v++) { - int rgba = t.access(packed, u, v); - img.setRGB(u + rect.x, v + rect.y, rgba >>> 8 | rgba << 24); - } - } - } - } - } - - private static class ImageTransform { - - int transform; - - public ImageTransform(int i) { - transform = i; - } - - public ImageTransform() { - this(0); - } - - public boolean transpose() { - return (transform & 4) != 0; - } - - public boolean flipU() { - return (transform & 1) != 0; - } - - public boolean flipV() { - return (transform & 2) != 0; - } - - public int access(QBImage img, int u, int v) { - if (transpose()) { - int tmp = u; - u = v; - v = tmp; - } - if (flipU()) { - u = img.width() - 1 - u; - } - if (flipV()) { - v = img.height() - 1 - v; - } - - return img.data[u][v]; - } - - public UV transform(UV uv) { - if (transpose()) { - double tmp = uv.u; - uv.u = uv.v; - uv.v = tmp; - } - if (flipU()) { - uv.u = 1 - uv.u; - } - if (flipV()) { - uv.v = 1 - uv.v; - } - - return uv; - } - } - - public static class QBImage implements Comparable { - - int[][] data; - ImageTransform packT; - Rectangle4i packSlot; - - public int width() { - return data.length; - } - - public int height() { - return data[0].length; - } - - public int area() { - return width() * height(); - } - - @Override - public int compareTo(QBImage o) { - int a = area(); - int b = o.area(); - return a > b ? -1 : a == b ? 0 : 1; - } - - public ImageTransform transformTo(QBImage img) { - if (width() == img.width() && height() == img.height()) { - for (int i = 0; i < 4; i++) { - ImageTransform t = new ImageTransform(i); - if (equals(img, t)) { - return t; - } - } - } - if (width() == img.height() && height() == img.width()) { - for (int i = 4; i < 8; i++) { - ImageTransform t = new ImageTransform(i); - if (equals(img, t)) { - return t; - } - } - } - return null; - } - - public boolean equals(QBImage img, ImageTransform t) { - for (int u = 0; u < img.width(); u++) { - for (int v = 0; v < img.height(); v++) { - if (t.access(this, u, v) != img.data[u][v]) { - return false; - } - } - } - - return true; - } - - public void transform(UV uv) { - packT.transform(uv); - uv.u *= packSlot.w; - uv.v *= packSlot.h; - uv.u += packSlot.x; - uv.v += packSlot.y; - } - } - - private static final int[][] vertOrder = new int[][] {//clockwise because MC is left handed - { 3, 0 }, { 1, 0 }, { 1, 2 }, { 3, 2 } }; - - public static class QBQuad { - - public Vertex5[] verts = new Vertex5[4]; - public QBImage image = new QBImage(); - public ImageTransform t = new ImageTransform(); - public int side; - - public QBQuad(int side) { - this.side = side; - } - - public void applyImageT() { - for (Vertex5 vert : verts) { - t.transform(vert.uv); - image.transform(vert.uv); - } - } - - public static QBQuad restore(Rectangle4i flat, int side, double d, QBImage img) { - QBQuad quad = new QBQuad(side); - quad.image = img; - - Transformation t = new Scale(-1, 1, -1).with(Rotation.sideOrientation(side, 0)).with(new Translation(new Vector3().setSide(side, d))); - quad.verts[0] = new Vertex5(flat.x, 0, flat.y, 0, 0); - quad.verts[1] = new Vertex5(flat.x + flat.w, 0, flat.y, 1, 0); - quad.verts[2] = new Vertex5(flat.x + flat.w, 0, flat.y + flat.h, 1, 1); - quad.verts[3] = new Vertex5(flat.x, 0, flat.y + flat.h, 0, 1); - for (Vertex5 vert : quad.verts) { - vert.apply(t); - } - - return quad; - } - - public Rectangle4i flatten() { - Transformation t = Rotation.sideOrientation(side, 0).inverse().with(new Scale(-1, 0, -1)); - Vector3 vmin = verts[0].vec.copy().apply(t); - Vector3 vmax = verts[2].vec.copy().apply(t); - return new Rectangle4i((int) vmin.x, (int) vmin.z, (int) (vmax.x - vmin.x), (int) (vmax.z - vmin.z)); - } - } - - public static class QBCuboid { - - public QBMatrix mat; - public CuboidCoord c; - public int sides; - - public QBCuboid(QBMatrix mat, CuboidCoord c) { - this.mat = mat; - this.c = c; - sides = 0; - } - - public static boolean intersects(QBCuboid a, QBCuboid b) { - CuboidCoord c = a.c; - CuboidCoord d = b.c; - return c.min.x <= d.max.x && d.min.x <= c.max.x && c.min.y <= d.max.y && d.min.y <= c.max.y && c.min.z <= d.max.z && d.min.z <= c.max.z; - } - - public static void clip(QBCuboid a, QBCuboid b) { - if (intersects(a, b)) { - a.clip(b); - b.clip(a); - } - } - - public void clip(QBCuboid o) { - CuboidCoord d = o.c; - for (int a = 0; a < 6; a += 2) { - int a1 = (a + 2) % 6; - int a2 = (a + 4) % 6; - if (c.getSide(a1 + 1) <= d.getSide(a1 + 1) && c.getSide(a1) >= d.getSide(a1) && c.getSide(a2 + 1) <= d.getSide(a2 + 1) && c.getSide(a2) >= d.getSide(a2)) { - - if (c.getSide(a) <= d.getSide(a + 1) && c.getSide(a) >= d.getSide(a)) { - c.setSide(a, d.getSide(a + 1) + 1); - sides |= 1 << a; - } - if (c.getSide(a + 1) >= d.getSide(a) && c.getSide(a + 1) <= d.getSide(a + 1)) { - c.setSide(a + 1, d.getSide(a) - 1); - sides |= 2 << a; - } - } - } - } - - public void extractQuads(List quads) { - Cuboid6 box = c.bounds(); - for (int s = 0; s < 6; s++) { - if ((sides & 1 << s) == 0) { - quads.add(extractQuad(s, box)); - } - } - } - - private QBQuad extractQuad(int side, Cuboid6 box) { - double[] da = new double[3]; - da[side >> 1] = box.getSide(side); - - QBQuad quad = new QBQuad(side); - for (int i = 0; i < 4; i++) { - int rU = vertOrder[i][0]; - int rV = vertOrder[i][1]; - int sideU = Rotation.rotateSide(side, rU); - int sideV = Rotation.rotateSide(side, rV); - da[sideU >> 1] = box.getSide(sideU); - da[sideV >> 1] = box.getSide(sideV); - quad.verts[i] = new Vertex5(Vector3.fromAxes(da), (3 - rU) / 2, rV / 2); - } - - int sideU = Rotation.rotateSide(side, 1); - int sideV = Rotation.rotateSide(side, 2); - quad.image.data = new int[c.size(sideU)][c.size(sideV)]; - QBImage image = quad.image; - - int[] ia = new int[3]; - ia[side >> 1] = c.getSide(side); - ia[sideU >> 1] = c.getSide(sideU ^ 1); - ia[sideV >> 1] = c.getSide(sideV ^ 1); - BlockCoord b = BlockCoord.fromAxes(ia); - BlockCoord bU = BlockCoord.sideOffsets[sideU]; - BlockCoord bV = BlockCoord.sideOffsets[sideV]; - for (int u = 0; u < image.width(); u++) { - for (int v = 0; v < image.height(); v++) { - image.data[u][v] = mat.matrix[b.x + bU.x * u + bV.x * v][b.y + bU.y * u + bV.y * v][b.z + bU.z * u + bV.z * v]; - } - } - - return quad; - } - } - - public static class QBMatrix { - - public String name; - public BlockCoord pos; - public BlockCoord size; - public int[][][] matrix; - - public void readMatrix(DataInputStream din, boolean compressed) throws IOException { - if (compressed) { - int z = 0; - while (z < size.z) { - int index = 0; - - while (true) { - int data = din.readInt(); - - if (data == NEXTSLICEFLAG) { - break; - } - - if (data == CODEFLAG) { - int count = readTni(din); - data = din.readInt(); - - for (int j = 0; j < count; j++, index++) { - matrix[index % size.x][index / size.x][z] = data; - } - } else { - matrix[index % size.x][index / size.x][z] = data; - index++; - } - } - z++; - } - } else { - for (int z = 0; z < size.z; z++) { - for (int y = 0; y < size.y; y++) { - for (int x = 0; x < size.x; x++) { - matrix[x][y][z] = din.readInt(); - } - } - } - } - } - - public void convertBGRAtoRGBA() { - for (int z = 0; z < size.z; z++) { - for (int y = 0; y < size.y; y++) { - for (int x = 0; x < size.x; x++) { - int i = matrix[x][y][z]; - matrix[x][y][z] = Integer.reverseBytes(i >>> 8) | i & 0xFF; - } - } - } - } - - private boolean voxelFull(boolean[][][] solid, CuboidCoord c) { - for (BlockCoord b : c) { - if (matrix[b.x][b.y][b.z] == 0) { - return false; - } - } - for (BlockCoord b : c) { - solid[b.x][b.y][b.z] = false; - } - return true; - } - - private QBCuboid expand(boolean[][][] solid, BlockCoord b) { - CuboidCoord c = new CuboidCoord(b); - solid[b.x][b.y][b.z] = false; - - for (int s = 0; s < 6; s++) { - CuboidCoord slice = c.copy(); - slice.expand(s ^ 1, -(slice.size(s) - 1)); - slice.expand(s, 1); - - while (slice.getSide(s) >= 0 && slice.getSide(s) < size.getSide(s)) { - if (!voxelFull(solid, slice)) { - break; - } - slice.expand(s ^ 1, -1); - slice.expand(s, 1); - c.expand(s, 1); - } - } - return new QBCuboid(this, c); - } - - public List rectangulate() { - List list = new ArrayList(); - boolean[][][] solid = new boolean[size.x][size.y][size.z]; - for (int z = 0; z < size.z; z++) { - for (int y = 0; y < size.y; y++) { - for (int x = 0; x < size.x; x++) { - solid[x][y][z] = matrix[x][y][z] != 0; - } - } - } - - for (int x = 0; x < size.x; x++) { - for (int z = 0; z < size.z; z++) { - for (int y = 0; y < size.y; y++) { - if (solid[x][y][z]) { - list.add(expand(solid, new BlockCoord(x, y, z))); - } - } - } - } - - for (int i = 0; i < list.size(); i++) { - for (int j = i + 1; j < list.size(); j++) { - QBCuboid.clip(list.get(i), list.get(j)); - } - } - - return list; - } - - public List extractQuads(boolean texturePlanes) { - List quads = new LinkedList(); - for (QBCuboid c : rectangulate()) { - c.extractQuads(quads); - } - - if (texturePlanes) { - optimisePlanes(quads); - } - - return quads; - } - - private void optimisePlanes(List quads) { - Multimap map = HashMultimap.create(); - for (QBQuad quad : quads) { - map.put(quad.side | ((int) quad.verts[0].vec.getSide(quad.side)) << 3, quad); - } - - quads.clear(); - for (Integer key : map.keySet()) { - Collection plane = map.get(key); - if (plane.size() == 1) { - quads.add(plane.iterator().next()); - continue; - } - - int side = key & 7; - Rectangle4i rect = null; - for (QBQuad q : plane) { - if (rect == null) { - rect = q.flatten(); - } else { - rect.include(q.flatten()); - } - } - - QBImage img = new QBImage(); - img.data = new int[rect.w][rect.h]; - for (QBQuad q : plane) { - QBImage from = q.image; - Rectangle4i r = q.flatten(); - int du = r.x - rect.x; - int dv = r.y - rect.y; - for (int u = 0; u < from.width(); u++) { - for (int v = 0; v < from.height(); v++) { - img.data[du + u][dv + v] = from.data[u][v]; - } - } - } - - quads.add(QBQuad.restore(rect, side, key >> 3, img)); - } - } - - public CCModel buildModel(List quads, BufferedImage img, boolean scaleMC) { - CCModel m = CCModel.quadModel(quads.size() * 4); - int i = 0; - for (QBQuad quad : quads) { - quad.applyImageT(); - m.verts[i++] = quad.verts[0]; - m.verts[i++] = quad.verts[1]; - m.verts[i++] = quad.verts[2]; - m.verts[i++] = quad.verts[3]; - } - m.apply(new UVScale(1D / img.getWidth(), 1D / img.getHeight())); - m.apply(new Translation(pos.x, pos.y, pos.z)); - if (scaleMC) { - m.apply(new Scale(1 / 16D)); - } - m.computeNormals(); - return m; - } - - private static void addImages(List quads, List images) { - for (QBQuad q : quads) { - QBImage img = q.image; - boolean matched = false; - for (QBImage img2 : images) { - ImageTransform t = img.transformTo(img2); - if (t != null) { - q.t = t; - q.image = img2; - matched = true; - break; - } - } - if (!matched) { - images.add(img); - } - } - } - } - - public static final int TEXTUREPLANES = 1; - public static final int SQUARETEXTURE = 2; - public static final int MERGETEXTURES = 4; - public static final int SCALEMC = 8; - - public static class QBModel { - - public QBMatrix[] matrices; - public boolean rightHanded; - - public RasterisedModel toRasterisedModel(int flags) { - List qbImages = new ArrayList(); - List> modelQuads = new ArrayList>(); - List images = new ArrayList(); - - boolean texturePlanes = (flags & TEXTUREPLANES) != 0; - boolean squareTextures = (flags & SQUARETEXTURE) != 0; - boolean mergeTextures = (flags & MERGETEXTURES) != 0; - boolean scaleMC = (flags & SCALEMC) != 0; - - for (QBMatrix mat : matrices) { - List quads = mat.extractQuads(texturePlanes); - modelQuads.add(quads); - QBMatrix.addImages(quads, qbImages); - if (!mergeTextures) { - images.add(ImagePackNode.pack(qbImages, squareTextures).toImage()); - qbImages.clear(); - } - } - - if (mergeTextures) { - images.add(ImagePackNode.pack(qbImages, squareTextures).toImage()); - } - - RasterisedModel m = new RasterisedModel(images); - for (int i = 0; i < matrices.length; i++) { - QBMatrix mat = matrices[i]; - BufferedImage img = images.get(mergeTextures ? 0 : i); - m.add(mat.name, mat.buildModel(modelQuads.get(i), img, scaleMC)); - } - return m; - } - } - - public static class RasterisedModel { - - private class Holder { - - CCModel m; - int img; - - public Holder(CCModel m, int img) { - this.m = m; - this.img = img; - } - } - - private Map map = new HashMap(); - private List images; - - public RasterisedModel(List images) { - this.images = images; - } - - public void add(String name, CCModel m) { - map.put(name, new Holder(m, Math.min(map.size(), images.size() - 1))); - } - - public CCModel getModel(String key) { - return map.get(key).m; - } - - public TextureAtlasSprite getIcon(String key, TextureMap textureMap) { - int img = map.get(key).img; - String iconName = "QBModel" + hashCode() + "_img"; - TextureAtlasSprite icon = textureMap.getTextureExtry(iconName); - if (icon != null) { - return icon; - } - - return TextureUtils.getTextureSpecial(textureMap, iconName).addTexture(new TextureDataHolder(images.get(img))); - } - - private void exportImg(BufferedImage img, File imgFile) throws IOException { - if (!imgFile.exists()) { - imgFile.createNewFile(); - } - ImageIO.write(img, "PNG", imgFile); - } - - public void export(File objFile, File imgDir) { - try { - if (!objFile.exists()) { - objFile.createNewFile(); - } - if (!imgDir.exists()) { - imgDir.mkdirs(); - } - - Map modelMap = new HashMap(); - for (Map.Entry e : map.entrySet()) { - modelMap.put(e.getKey(), e.getValue().m); - } - - PrintWriter p = new PrintWriter(objFile); - CCOBJParser.exportObj(modelMap, p); - p.close(); - - if (images.size() < map.size()) { - exportImg(images.get(0), new File(imgDir, objFile.getName().replaceAll("(.+)\\..+", "$1.png"))); - } else { - for (Map.Entry e : map.entrySet()) { - exportImg(images.get(e.getValue().img), new File(imgDir, e.getKey() + ".png")); - } - } - - } catch (IOException e) { - throw new RuntimeException(e); - } - } - } - - private static String readAsciiString(DataInputStream din) throws IOException { - byte[] bytes = new byte[din.readByte() & 0xFF]; - din.readFully(bytes); - return new String(bytes, "US-ASCII"); - } - - private static int readTni(DataInputStream din) throws IOException { - return Integer.reverseBytes(din.readInt()); - } - - private static final int CODEFLAG = Integer.reverseBytes(2); - private static final int NEXTSLICEFLAG = Integer.reverseBytes(6); - - public static QBModel loadQB(InputStream input) throws IOException { - DataInputStream din = new DataInputStream(input); - - QBModel m = new QBModel(); - int version = din.readInt(); - int colorFormat = din.readInt(); - m.rightHanded = din.readInt() != 0; - boolean compressed = din.readInt() != 0; - boolean visEncoded = din.readInt() != 0; - - if (visEncoded) { - throw new IllegalArgumentException("Encoded Visiblity States not supported"); - } - - m.matrices = new QBMatrix[readTni(din)]; - for (int i = 0; i < m.matrices.length; i++) { - QBMatrix mat = new QBMatrix(); - m.matrices[i] = mat; - mat.name = readAsciiString(din); - mat.size = new BlockCoord(readTni(din), readTni(din), readTni(din)); - mat.pos = new BlockCoord(readTni(din), readTni(din), readTni(din)); - mat.matrix = new int[mat.size.x][mat.size.y][mat.size.z]; - mat.readMatrix(din, compressed); - if (colorFormat == 1) { - mat.convertBGRAtoRGBA(); - } - } - - return m; - } - - public static QBModel loadQB(ResourceLocation res) { - try { - return loadQB(Minecraft.getMinecraft().getResourceManager().getResource(res).getInputStream()); - } catch (Exception e) { - throw new RuntimeException("failed to load model: " + res, e); - } - } - - public static QBModel loadQB(File file) { - try { - FileInputStream fin = new FileInputStream(file); - try { - return loadQB(fin); - } finally { - fin.close(); - } - } catch (Exception e) { - throw new RuntimeException("failed to load model: " + file.getPath(), e); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/render/RenderUtils.java b/dependencies/main/java/codechicken/lib/render/RenderUtils.java deleted file mode 100644 index 935c88f315..0000000000 --- a/dependencies/main/java/codechicken/lib/render/RenderUtils.java +++ /dev/null @@ -1,444 +0,0 @@ -package codechicken.lib.render; - -import codechicken.lib.texture.TextureUtils; -import codechicken.lib.vec.*; -import codechicken.lib.vec.uv.IconTransformation; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.RenderGlobal; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.VertexBuffer; -import net.minecraft.client.renderer.entity.RenderEntityItem; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.client.shader.Framebuffer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import org.lwjgl.opengl.GL11; - -//TODO Document and reorder things in here. -public class RenderUtils { - - private static Vector3[] vectors = new Vector3[8]; - private static RenderEntityItem uniformRenderItem; - private static boolean hasInitRenderItem; - - private static ThreadLocal iconTransformCache = new ThreadLocal() { - @Override - protected IconTransformation initialValue() { - return new IconTransformation(TextureUtils.getBlockTexture("stone")); - } - }; - - private static EntityItem entityItem; - - static { - for (int i = 0; i < vectors.length; i++) { - vectors[i] = new Vector3(); - } - - entityItem = new EntityItem(null); - entityItem.hoverStart = 0; - } - - private static void loadItemRenderer() { - if (!hasInitRenderItem) { - Minecraft minecraft = Minecraft.getMinecraft(); - uniformRenderItem = new RenderEntityItem(minecraft.getRenderManager(), minecraft.getRenderItem()); - hasInitRenderItem = true; - } - } - - public static void renderFluidQuad(Vector3 point1, Vector3 point2, Vector3 point3, Vector3 point4, TextureAtlasSprite icon, double res) { - renderFluidQuad(point2, vectors[0].set(point4).subtract(point1), vectors[1].set(point1).subtract(point2), icon, res); - } - - /** - * Draws a tessellated quadrilateral bottom to top, left to right - * - * @param base The bottom left corner of the quad - * @param wide The bottom of the quad - * @param high The left side of the quad - * @param res Units per icon - */ - public static void renderFluidQuad(Vector3 base, Vector3 wide, Vector3 high, TextureAtlasSprite icon, double res) { - VertexBuffer r = CCRenderState.instance().getBuffer(); - double u1 = icon.getMinU(); - double du = icon.getMaxU() - icon.getMinU(); - double v2 = icon.getMaxV(); - double dv = icon.getMaxV() - icon.getMinV(); - - double wlen = wide.mag(); - double hlen = high.mag(); - - double x = 0; - while (x < wlen) { - double rx = wlen - x; - if (rx > res) { - rx = res; - } - - double y = 0; - while (y < hlen) { - double ry = hlen - y; - if (ry > res) { - ry = res; - } - - Vector3 dx1 = vectors[2].set(wide).multiply(x / wlen); - Vector3 dx2 = vectors[3].set(wide).multiply((x + rx) / wlen); - Vector3 dy1 = vectors[4].set(high).multiply(y / hlen); - Vector3 dy2 = vectors[5].set(high).multiply((y + ry) / hlen); - - r.pos(base.x + dx1.x + dy2.x, base.y + dx1.y + dy2.y, base.z + dx1.z + dy2.z).tex(u1, v2 - ry / res * dv).endVertex(); - r.pos(base.x + dx1.x + dy1.x, base.y + dx1.y + dy1.y, base.z + dx1.z + dy1.z).tex(u1, v2).endVertex(); - r.pos(base.x + dx2.x + dy1.x, base.y + dx2.y + dy1.y, base.z + dx2.z + dy1.z).tex(u1 + rx / res * du, v2).endVertex(); - r.pos(base.x + dx2.x + dy2.x, base.y + dx2.y + dy2.y, base.z + dx2.z + dy2.z).tex(u1 + rx / res * du, v2 - ry / res * dv).endVertex(); - - y += ry; - } - - x += rx; - } - } - - public static void translateToWorldCoords(Entity entity, float frame) { - double interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * frame; - double interpPosY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * frame; - double interpPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * frame; - - GlStateManager.translate(-interpPosX, -interpPosY, -interpPosZ); - } - - public static void drawCuboidOutline(Cuboid6 c) { - CCRenderState state = CCRenderState.instance(); - VertexBuffer r = state.startDrawing(3, DefaultVertexFormats.POSITION); - r.pos(c.min.x, c.min.y, c.min.z).endVertex(); - r.pos(c.max.x, c.min.y, c.min.z).endVertex(); - r.pos(c.max.x, c.min.y, c.max.z).endVertex(); - r.pos(c.min.x, c.min.y, c.max.z).endVertex(); - r.pos(c.min.x, c.min.y, c.min.z).endVertex(); - state.draw(); - state.startDrawing(3, DefaultVertexFormats.POSITION); - r.pos(c.min.x, c.max.y, c.min.z).endVertex(); - r.pos(c.max.x, c.max.y, c.min.z).endVertex(); - r.pos(c.max.x, c.max.y, c.max.z).endVertex(); - r.pos(c.min.x, c.max.y, c.max.z).endVertex(); - r.pos(c.min.x, c.max.y, c.min.z).endVertex(); - state.draw(); - state.startDrawing(1, DefaultVertexFormats.POSITION); - r.pos(c.min.x, c.min.y, c.min.z).endVertex(); - r.pos(c.min.x, c.max.y, c.min.z).endVertex(); - r.pos(c.max.x, c.min.y, c.min.z).endVertex(); - r.pos(c.max.x, c.max.y, c.min.z).endVertex(); - r.pos(c.max.x, c.min.y, c.max.z).endVertex(); - r.pos(c.max.x, c.max.y, c.max.z).endVertex(); - r.pos(c.min.x, c.min.y, c.max.z).endVertex(); - r.pos(c.min.x, c.max.y, c.max.z).endVertex(); - state.draw(); - } - - public static void renderFluidCuboid(Cuboid6 bound, TextureAtlasSprite tex, double res) { - renderFluidQuad(//bottom - new Vector3(bound.min.x, bound.min.y, bound.min.z), new Vector3(bound.max.x, bound.min.y, bound.min.z), new Vector3(bound.max.x, bound.min.y, bound.max.z), new Vector3(bound.min.x, bound.min.y, bound.max.z), tex, res); - renderFluidQuad(//top - new Vector3(bound.min.x, bound.max.y, bound.min.z), new Vector3(bound.min.x, bound.max.y, bound.max.z), new Vector3(bound.max.x, bound.max.y, bound.max.z), new Vector3(bound.max.x, bound.max.y, bound.min.z), tex, res); - renderFluidQuad(//-x - new Vector3(bound.min.x, bound.max.y, bound.min.z), new Vector3(bound.min.x, bound.min.y, bound.min.z), new Vector3(bound.min.x, bound.min.y, bound.max.z), new Vector3(bound.min.x, bound.max.y, bound.max.z), tex, res); - renderFluidQuad(//+x - new Vector3(bound.max.x, bound.max.y, bound.max.z), new Vector3(bound.max.x, bound.min.y, bound.max.z), new Vector3(bound.max.x, bound.min.y, bound.min.z), new Vector3(bound.max.x, bound.max.y, bound.min.z), tex, res); - renderFluidQuad(//-z - new Vector3(bound.max.x, bound.max.y, bound.min.z), new Vector3(bound.max.x, bound.min.y, bound.min.z), new Vector3(bound.min.x, bound.min.y, bound.min.z), new Vector3(bound.min.x, bound.max.y, bound.min.z), tex, res); - renderFluidQuad(//+z - new Vector3(bound.min.x, bound.max.y, bound.max.z), new Vector3(bound.min.x, bound.min.y, bound.max.z), new Vector3(bound.max.x, bound.min.y, bound.max.z), new Vector3(bound.max.x, bound.max.y, bound.max.z), tex, res); - } - - public static void renderBlockOverlaySide(int x, int y, int z, int side, double tx1, double tx2, double ty1, double ty2) { - double[] points = new double[] { x - 0.009, x + 1.009, y - 0.009, y + 1.009, z - 0.009, z + 1.009 }; - - VertexBuffer r = Tessellator.getInstance().getBuffer(); - //TODO - switch (side) { - case 0: - r.pos(points[0], points[2], points[4]).tex(tx1, ty1).endVertex(); - r.pos(points[1], points[2], points[4]).tex(tx2, ty1).endVertex(); - r.pos(points[1], points[2], points[5]).tex(tx2, ty2).endVertex(); - r.pos(points[0], points[2], points[5]).tex(tx1, ty2).endVertex(); - break; - case 1: - r.pos(points[1], points[3], points[4]).tex(tx2, ty1).endVertex(); - r.pos(points[0], points[3], points[4]).tex(tx1, ty1).endVertex(); - r.pos(points[0], points[3], points[5]).tex(tx1, ty2).endVertex(); - r.pos(points[1], points[3], points[5]).tex(tx2, ty2).endVertex(); - break; - case 2: - r.pos(points[0], points[3], points[4]).tex(tx2, ty1).endVertex(); - r.pos(points[1], points[3], points[4]).tex(tx1, ty1).endVertex(); - r.pos(points[1], points[2], points[4]).tex(tx1, ty2).endVertex(); - r.pos(points[0], points[2], points[4]).tex(tx2, ty2).endVertex(); - break; - case 3: - r.pos(points[1], points[3], points[5]).tex(tx2, ty1).endVertex(); - r.pos(points[0], points[3], points[5]).tex(tx1, ty1).endVertex(); - r.pos(points[0], points[2], points[5]).tex(tx1, ty2).endVertex(); - r.pos(points[1], points[2], points[5]).tex(tx2, ty2).endVertex(); - break; - case 4: - r.pos(points[0], points[3], points[5]).tex(tx2, ty1).endVertex(); - r.pos(points[0], points[3], points[4]).tex(tx1, ty1).endVertex(); - r.pos(points[0], points[2], points[4]).tex(tx1, ty2).endVertex(); - r.pos(points[0], points[2], points[5]).tex(tx2, ty2).endVertex(); - break; - case 5: - r.pos(points[1], points[3], points[4]).tex(tx2, ty1).endVertex(); - r.pos(points[1], points[3], points[5]).tex(tx1, ty1).endVertex(); - r.pos(points[1], points[2], points[5]).tex(tx1, ty2).endVertex(); - r.pos(points[1], points[2], points[4]).tex(tx2, ty2).endVertex(); - break; - } - } - - public static void renderHitBox(EntityPlayer player, Cuboid6 cuboid, float partialTicks) { - GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); - GlStateManager.glLineWidth(2.0F); - GlStateManager.disableTexture2D(); - GlStateManager.depthMask(false); - double xPos = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) partialTicks; - double yPos = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) partialTicks; - double zPos = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) partialTicks; - RenderGlobal.drawSelectionBoundingBox(cuboid.aabb().expandXyz(0.0020000000949949026D).offset(-xPos, -yPos, -zPos), 0.0F, 0.0F, 0.0F, 0.4F); - GlStateManager.depthMask(true); - GlStateManager.enableTexture2D(); - GlStateManager.disableBlend(); - } - - public static void drawSelectionBoundingBox(AxisAlignedBB boundingBox) { - - Tessellator tessellator = Tessellator.getInstance(); - VertexBuffer vertexbuffer = tessellator.getBuffer(); - vertexbuffer.begin(3, DefaultVertexFormats.POSITION); - vertexbuffer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).endVertex(); - vertexbuffer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).endVertex(); - vertexbuffer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ).endVertex(); - vertexbuffer.pos(boundingBox.minX, boundingBox.minY, boundingBox.maxZ).endVertex(); - vertexbuffer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).endVertex(); - tessellator.draw(); - vertexbuffer.begin(3, DefaultVertexFormats.POSITION); - vertexbuffer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).endVertex(); - vertexbuffer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ).endVertex(); - vertexbuffer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ).endVertex(); - vertexbuffer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ).endVertex(); - vertexbuffer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).endVertex(); - tessellator.draw(); - vertexbuffer.begin(1, DefaultVertexFormats.POSITION); - vertexbuffer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).endVertex(); - vertexbuffer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).endVertex(); - vertexbuffer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).endVertex(); - vertexbuffer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ).endVertex(); - vertexbuffer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ).endVertex(); - vertexbuffer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ).endVertex(); - vertexbuffer.pos(boundingBox.minX, boundingBox.minY, boundingBox.maxZ).endVertex(); - vertexbuffer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ).endVertex(); - tessellator.draw(); - } - - /** - * Checks to see if the FluidStack should be rendered. - * - * @param stack FluidStack to render. - * @return Weather to render or not. - */ - public static boolean shouldRenderFluid(FluidStack stack) { - return stack.amount > 0 && stack.getFluid() != null; - } - - /** - * Sets the colour of the fluid and returns the texture - * - * @param stack The fluid stack to render - * @return The icon of the fluid - */ - public static TextureAtlasSprite prepareFluidRender(FluidStack stack, int alpha) { - Fluid fluid = stack.getFluid(); - CCRenderState.instance().colour = fluid.getColor(stack) << 8 | alpha; - return TextureUtils.getTexture(fluid.getStill()); - } - - /** - * Disables lighting, enables blending and changes to the blocks texture - */ - public static void preFluidRender() { - GlStateManager.disableLighting(); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - TextureUtils.bindBlockTexture(); - } - - /** - * Re-enables lighting and disables blending. - */ - public static void postFluidRender() { - GlStateManager.enableLighting(); - GlStateManager.disableBlend(); - } - - public static double fluidDensityToAlpha(double density) { - return Math.pow(density, 0.4); - } - - /** - * Renders a fluid within a bounding box. - * Assumes that CCRenderstate is already drawing with appropriate gl state. For a separate draw call see renderFluidCuboidGL - * If the fluid is a liquid it will render as a normal tank with height equal to density/bound.height. - * If the fluid is a gas, it will render the full box with an alpha equal to density. - * Warning, bound will be mutated if the fluid is a liquid - * - * @param stack The fluid to render. - * @param bound The box within which the fluid is contained. - * @param density The volume of fluid / the capacity of the tank. For gases this determines the alpha, for liquids this determines the height. - * @param res The resolution to render at. - */ - public static void renderFluidCuboid(FluidStack stack, Cuboid6 bound, double density, double res) { - if (!shouldRenderFluid(stack)) { - return; - } - - int alpha = 255; - if (stack.getFluid().isGaseous()) { - alpha = (int) (fluidDensityToAlpha(density) * 255); - } else { - bound.max.y = bound.min.y + (bound.max.y - bound.min.y) * density; - } - - renderFluidCuboid(bound, prepareFluidRender(stack, alpha), res); - } - - public static void renderFluidCuboidGL(FluidStack stack, Cuboid6 bound, double density, double res) { - if (!shouldRenderFluid(stack)) { - return; - } - - preFluidRender(); - CCRenderState state = CCRenderState.instance(); - state.startDrawing(7, DefaultVertexFormats.POSITION_TEX); - renderFluidCuboid(stack, bound, density, res); - state.pushColour(); - state.draw(); - postFluidRender(); - } - - /** - * Assumes that CCRenderstate is already drawing with appropriate gl state. For a separate draw call see renderFluidGaugeGL - */ - public static void renderFluidGauge(FluidStack stack, Rectangle4i rect, double density, double res) { - if (!shouldRenderFluid(stack)) { - return; - } - - int alpha = 255; - if (stack.getFluid().isGaseous()) { - alpha = (int) (fluidDensityToAlpha(density) * 255); - } else { - int height = (int) (rect.h * density); - rect.y += rect.h - height; - rect.h = height; - } - CCRenderState state = CCRenderState.instance(); - state.startDrawing(7, DefaultVertexFormats.POSITION_TEX); - renderFluidQuad(new Vector3(rect.x, rect.y + rect.h, 0), new Vector3(rect.w, 0, 0), new Vector3(0, -rect.h, 0), prepareFluidRender(stack, alpha), res); - state.draw(); - postFluidRender(); - } - - public static void renderFluidGaugeGL(FluidStack stack, Rectangle4i rect, double density, double res) { - if (!shouldRenderFluid(stack)) { - return; - } - - preFluidRender(); - CCRenderState state = CCRenderState.instance(); - state.startDrawing(7, DefaultVertexFormats.POSITION_TEX); - renderFluidGauge(stack, rect, density, res); - state.pushColour(); - state.draw(); - } - - public static Matrix4 getMatrix(Vector3 position, Rotation rotation, double scale) { - return new Matrix4().translate(position).apply(new Scale(scale)).apply(rotation); - } - - /** - * Renders items and blocks in the world at 0,0,0 with transformations that size them appropriately - */ - public static void renderItemUniform(ItemStack item) { - renderItemUniform(item, 0); - } - - /* - * Renders items and blocks in the world at 0,0,0 with transformations that size them appropriately - * - * @param spin The spin angle of the item around the y axis in degrees - */ - public static void renderItemUniform(ItemStack item, double spin) { - loadItemRenderer(); - //IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(item, ENTITY); - //boolean is3D = customRenderer != null && customRenderer.shouldUseRenderHelper(ENTITY, item, BLOCK_3D); - - //boolean larger = false; - //if (item.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item.getItem()).getRenderType())) { - // int renderType = Block.getBlockFromItem(item.getItem()).getRenderType(); - // larger = !(renderType == 1 || renderType == 19 || renderType == 12 || renderType == 2); - //} else if (is3D) { - // larger = true; - //} - - //double d = 2; - //double d1 = 1 / d; - //if (larger) { - // GLStateManager.scale(d, d, d); - //} - - GlStateManager.color(1, 1, 1, 1); - - entityItem.setEntityItemStack(item); - uniformRenderItem.doRender(entityItem, 0, 0.06, 0, 0, (float) (spin * 9 / Math.PI)); - - //if (larger) { - // GLStateManager.scale(d1, d1, d1); - //}*/ - } - - /** - * Checks if stencil buffer is supported and attempts to enable it if so. - */ - public static boolean checkEnableStencil() { - Framebuffer fb = Minecraft.getMinecraft().getFramebuffer(); - return fb.isStencilEnabled() || fb.enableStencil(); - } - - public static float getPearlBob(double time) { - return (float) Math.sin(time / 25 * 3.141593) * 0.1F; - } - - public static int getTimeOffset(BlockPos pos) { - return getTimeOffset(pos.getX(), pos.getY(), pos.getZ()); - } - - public static int getTimeOffset(int x, int y, int z) { - return x * 3 + y * 5 + z * 9; - } - - public static IconTransformation getIconTransformation(TextureAtlasSprite sprite) { - IconTransformation transformation = iconTransformCache.get(); - transformation.icon = sprite; - return transformation; - } - -} diff --git a/dependencies/main/java/codechicken/lib/render/block/BlockRenderingRegistry.java b/dependencies/main/java/codechicken/lib/render/block/BlockRenderingRegistry.java deleted file mode 100644 index b0c64e131b..0000000000 --- a/dependencies/main/java/codechicken/lib/render/block/BlockRenderingRegistry.java +++ /dev/null @@ -1,110 +0,0 @@ -package codechicken.lib.render.block; - -import codechicken.lib.model.SimpleBakedBlockModel; -import codechicken.lib.render.buffer.BakingVertexBuffer; -import codechicken.lib.texture.TextureUtils; -import codechicken.lib.util.ReflectionManager; -import com.google.common.collect.ImmutableList; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.BlockModelRenderer; -import net.minecraft.client.renderer.BlockRendererDispatcher; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.VertexBuffer; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.EnumBlockRenderType; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.EnumHelper; -import net.minecraftforge.fml.relauncher.ReflectionHelper; - -import java.lang.reflect.Field; -import java.util.HashMap; -import java.util.Map; - -/** - * Created by covers1624 on 8/09/2016. - * TODO Start phase out of this system. - */ -public class BlockRenderingRegistry { - - private static final Map blockRendererList = new HashMap(); - private static final ImmutableList vanillaRenderTypes = ImmutableList.copyOf(EnumBlockRenderType.values()); - - private static boolean initialized = false; - - static { - init(); - } - - public static void init() { - if (!initialized) { - Minecraft mc = Minecraft.getMinecraft(); - BlockRendererDispatcher parentDispatcher = mc.getBlockRendererDispatcher(); - CCBlockRendererDispatcher newDispatcher = new CCBlockRendererDispatcher(parentDispatcher, mc.getBlockColors()); - - Field field = ReflectionHelper.findField(Minecraft.class, "blockRenderDispatcher", "field_175618_aM", "aR"); - ReflectionManager.set(field, mc, newDispatcher); - - TextureUtils.addIconRegister(newDispatcher); - - initialized = true; - } - } - - public static EnumBlockRenderType createRenderType(String name) { - return EnumHelper.addEnum(EnumBlockRenderType.class, name, new Class[0]); - } - - public static boolean canHandle(EnumBlockRenderType type) { - return blockRendererList.containsKey(type); - } - - public static void registerRenderer(EnumBlockRenderType type, ICCBlockRenderer renderer) { - if (vanillaRenderTypes.contains(type)) { - throw new IllegalArgumentException("Invalid EnumBlockRenderType! " + type.name()); - } - if (blockRendererList.containsKey(type)) { - throw new IllegalArgumentException("Unable to register duplicate render type!" + type.name()); - } - blockRendererList.put(type, renderer); - } - - static void renderBlockDamage(IBlockAccess world, BlockPos pos, IBlockState state, TextureAtlasSprite sprite) { - ICCBlockRenderer renderer = blockRendererList.get(state.getRenderType()); - if (renderer != null) { - state = state.getActualState(world, pos); - //TODO This needs to be optimized, probably not the most efficient thing in the world.. - VertexBuffer parent = Tessellator.getInstance().getBuffer(); - BakingVertexBuffer buffer = BakingVertexBuffer.create(); - buffer.setTranslation(-pos.getX(), -pos.getY(), -pos.getZ()); - buffer.begin(7, parent.getVertexFormat()); - renderer.handleRenderBlockDamage(world, pos, state, sprite, buffer); - buffer.finishDrawing(); - BlockModelRenderer modelRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer(); - modelRenderer.renderModel(world, new SimpleBakedBlockModel(buffer.bake()), state, pos, parent, true); - } - } - - static boolean renderBlock(IBlockAccess world, BlockPos pos, IBlockState state, VertexBuffer buffer) { - ICCBlockRenderer renderer = blockRendererList.get(state.getRenderType()); - if (renderer != null) { - return renderer.renderBlock(world, pos, state, buffer); - } - return false; - } - - static void renderBlockBrightness(IBlockState state, float brightness) { - ICCBlockRenderer renderer = blockRendererList.get(state.getRenderType()); - if (renderer != null) { - renderer.renderBrightness(state, brightness); - } - } - - static void registerTextures(TextureMap map) { - for (ICCBlockRenderer renderer : blockRendererList.values()) { - renderer.registerTextures(map); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/render/block/CCBlockRendererDispatcher.java b/dependencies/main/java/codechicken/lib/render/block/CCBlockRendererDispatcher.java deleted file mode 100644 index 6a57fbeddd..0000000000 --- a/dependencies/main/java/codechicken/lib/render/block/CCBlockRendererDispatcher.java +++ /dev/null @@ -1,91 +0,0 @@ -package codechicken.lib.render.block; - -import codechicken.lib.texture.TextureUtils; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.BlockModelRenderer; -import net.minecraft.client.renderer.BlockModelShapes; -import net.minecraft.client.renderer.BlockRendererDispatcher; -import net.minecraft.client.renderer.VertexBuffer; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.color.BlockColors; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.crash.CrashReport; -import net.minecraft.crash.CrashReportCategory; -import net.minecraft.util.ReportedException; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.WorldType; - -/** - * Created by covers1624 on 8/09/2016. - * TODO Move back end of this to CCExtendedBlockRenderDispatcher - */ -public class CCBlockRendererDispatcher extends BlockRendererDispatcher implements TextureUtils.IIconRegister { - - public final BlockRendererDispatcher parentDispatcher; - - public CCBlockRendererDispatcher(BlockRendererDispatcher dispatcher, BlockColors blockColours) { - super(dispatcher.getBlockModelShapes(), blockColours); - parentDispatcher = dispatcher; - } - - @Override - public void renderBlockDamage(IBlockState state, BlockPos pos, TextureAtlasSprite texture, IBlockAccess blockAccess) { - if (BlockRenderingRegistry.canHandle(state.getRenderType())) { - BlockRenderingRegistry.renderBlockDamage(blockAccess, pos, state, texture); - } else { - parentDispatcher.renderBlockDamage(state, pos, texture, blockAccess); - } - } - - @Override - public boolean renderBlock(IBlockState state, BlockPos pos, IBlockAccess blockAccess, VertexBuffer worldRendererIn) { - try { - if (BlockRenderingRegistry.canHandle(state.getRenderType())) { - if (blockAccess.getWorldType() != WorldType.DEBUG_WORLD) { - try { - state = state.getActualState(blockAccess, pos); - } catch (Exception ignored) { - //Noise.. - } - } - return BlockRenderingRegistry.renderBlock(blockAccess, pos, state, worldRendererIn); - } - } catch (Throwable throwable) { - CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tessellating CCL block in world"); - CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being tessellated"); - CrashReportCategory.addBlockInfo(crashreportcategory, pos, state.getBlock(), state.getBlock().getMetaFromState(state)); - throw new ReportedException(crashreport); - } - return parentDispatcher.renderBlock(state, pos, blockAccess, worldRendererIn); - } - - @Override - public void renderBlockBrightness(IBlockState state, float brightness) { - if (BlockRenderingRegistry.canHandle(state.getRenderType())) { - BlockRenderingRegistry.renderBlockBrightness(state, brightness); - } - super.renderBlockBrightness(state, brightness); - } - - @Override - public void registerIcons(TextureMap textureMap) { - BlockRenderingRegistry.registerTextures(textureMap); - } - - @Override - public BlockModelRenderer getBlockModelRenderer() { - return parentDispatcher.getBlockModelRenderer(); - } - - @Override - public IBakedModel getModelForState(IBlockState state) { - return parentDispatcher.getModelForState(state); - } - - @Override - public BlockModelShapes getBlockModelShapes() { - return parentDispatcher.getBlockModelShapes(); - } -} diff --git a/dependencies/main/java/codechicken/lib/render/block/CCExtendedBlockRendererDispatcher.java b/dependencies/main/java/codechicken/lib/render/block/CCExtendedBlockRendererDispatcher.java deleted file mode 100644 index eb718efbc9..0000000000 --- a/dependencies/main/java/codechicken/lib/render/block/CCExtendedBlockRendererDispatcher.java +++ /dev/null @@ -1,94 +0,0 @@ -package codechicken.lib.render.block; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.BlockModelRenderer; -import net.minecraft.client.renderer.BlockModelShapes; -import net.minecraft.client.renderer.BlockRendererDispatcher; -import net.minecraft.client.renderer.VertexBuffer; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.color.BlockColors; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.crash.CrashReport; -import net.minecraft.crash.CrashReportCategory; -import net.minecraft.util.EnumBlockRenderType; -import net.minecraft.util.ReportedException; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.WorldType; - -/** - * Created by covers1624 on 26/10/2016. - * TODO remove IExtendedModel. - */ -public class CCExtendedBlockRendererDispatcher extends BlockRendererDispatcher { - - private final BlockRendererDispatcher parentDispatcher; - - private static boolean initialized = false; - - public CCExtendedBlockRendererDispatcher(BlockRendererDispatcher parentDispatcher, BlockColors blockColors) { - super(parentDispatcher.getBlockModelShapes(), blockColors); - this.parentDispatcher = parentDispatcher; - } - - public static void init() { - if (!initialized) { - Minecraft mc = Minecraft.getMinecraft(); - BlockRendererDispatcher parentDispatcher = mc.getBlockRendererDispatcher(); - CCExtendedBlockRendererDispatcher newDispatcher = new CCExtendedBlockRendererDispatcher(parentDispatcher, mc.getBlockColors()); - - mc.blockRenderDispatcher = newDispatcher; - initialized = true; - } - } - - @Override - public boolean renderBlock(IBlockState state, BlockPos pos, IBlockAccess blockAccess, VertexBuffer worldRendererIn) { - try { - EnumBlockRenderType enumblockrendertype = state.getRenderType(); - - if (enumblockrendertype == EnumBlockRenderType.MODEL && blockAccess.getWorldType() != WorldType.DEBUG_WORLD) { - IBakedModel model = this.getModelForState(state); - if (!(model instanceof IExtendedModel)) { - return parentDispatcher.renderBlock(state, pos, blockAccess, worldRendererIn); - } - state = state.getBlock().getExtendedState(state, blockAccess, pos); - model = ((IExtendedModel) model).handleExtendedModel(model, state); - return parentDispatcher.getBlockModelRenderer().renderModel(blockAccess, model, state, pos, worldRendererIn, true); - } else { - return parentDispatcher.renderBlock(state, pos, blockAccess, worldRendererIn); - } - } catch (Throwable throwable) { - CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block in world"); - CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being tesselated"); - CrashReportCategory.addBlockInfo(crashreportcategory, pos, state.getBlock(), state.getBlock().getMetaFromState(state)); - throw new ReportedException(crashreport); - } - } - - @Override - public void renderBlockDamage(IBlockState state, BlockPos pos, TextureAtlasSprite texture, IBlockAccess blockAccess) { - parentDispatcher.renderBlockDamage(state, pos, texture, blockAccess); - } - - @Override - public void renderBlockBrightness(IBlockState state, float brightness) { - parentDispatcher.renderBlockBrightness(state, brightness); - } - - @Override - public BlockModelRenderer getBlockModelRenderer() { - return parentDispatcher.getBlockModelRenderer(); - } - - @Override - public IBakedModel getModelForState(IBlockState state) { - return parentDispatcher.getModelForState(state); - } - - @Override - public BlockModelShapes getBlockModelShapes() { - return parentDispatcher.getBlockModelShapes(); - } -} diff --git a/dependencies/main/java/codechicken/lib/render/block/ICCBlockRenderer.java b/dependencies/main/java/codechicken/lib/render/block/ICCBlockRenderer.java deleted file mode 100644 index 46d54cf585..0000000000 --- a/dependencies/main/java/codechicken/lib/render/block/ICCBlockRenderer.java +++ /dev/null @@ -1,23 +0,0 @@ -package codechicken.lib.render.block; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.VertexBuffer; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; - -/** - * Created by covers1624 on 8/09/2016. - * TODO, Some sort of automatic block breaking texture stuff. - */ -public interface ICCBlockRenderer { - - void handleRenderBlockDamage(IBlockAccess world, BlockPos pos, IBlockState state, TextureAtlasSprite sprite, VertexBuffer buffer); - - boolean renderBlock(IBlockAccess world, BlockPos pos, IBlockState state, VertexBuffer buffer); - - void renderBrightness(IBlockState state, float brightness); - - void registerTextures(TextureMap map); -} diff --git a/dependencies/main/java/codechicken/lib/render/block/IExtendedModel.java b/dependencies/main/java/codechicken/lib/render/block/IExtendedModel.java deleted file mode 100644 index 6875887fcd..0000000000 --- a/dependencies/main/java/codechicken/lib/render/block/IExtendedModel.java +++ /dev/null @@ -1,26 +0,0 @@ -package codechicken.lib.render.block; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.block.model.IBakedModel; - -/** - * Created by covers1624 on 26/10/2016. - * Implementing this on a IBakedModel will allow you to have interaction similar to Block#getExtendedState. - * You can return an entirely different model for this or just set some flags. What ever you want. - * Useful for on-the-fly model baking, where you need to generate from an IExtendedBlockState. - */ -@Deprecated -public interface IExtendedModel extends IBakedModel { - - /** - * You can return what ever model you like. - * This is fired from BlockRendererDispatcher#renderBlock before blockModelRenderer#renderModel, - * but after getExtendedState. - * - * @param prevModel The model that was going to be rendered. - * @param state The IBlockState returned from getExtendedState. - * @return Another IBakedModel, can be different, same, whatever. - */ - IBakedModel handleExtendedModel(IBakedModel prevModel, IBlockState state); - -} diff --git a/dependencies/main/java/codechicken/lib/render/buffer/BakingVertexBuffer.java b/dependencies/main/java/codechicken/lib/render/buffer/BakingVertexBuffer.java deleted file mode 100644 index 2a780a0a16..0000000000 --- a/dependencies/main/java/codechicken/lib/render/buffer/BakingVertexBuffer.java +++ /dev/null @@ -1,176 +0,0 @@ -package codechicken.lib.render.buffer; - -import codechicken.lib.math.MathHelper; -import codechicken.lib.texture.TextureUtils; -import codechicken.lib.util.VectorUtils; -import codechicken.lib.util.VertexDataUtils; -import codechicken.lib.vec.Vector3; -import codechicken.lib.vec.uv.UV; -import com.google.common.collect.ImmutableList; -import net.minecraft.client.renderer.VertexBuffer; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.client.model.pipeline.LightUtil; -import net.minecraftforge.fml.common.FMLLog; -import org.apache.logging.log4j.Level; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; - -/** - * Created by covers1624 on 4/10/2016. - * Creates a List of BakedQuads from a VertexBuffer. That's it really.. - * //TODO, support triangles & quadulate. - */ -public class BakingVertexBuffer extends VertexBuffer { - - private HashMap spriteMap; - private boolean useSprites = true; - private boolean useDiffuseLighting = true; - - private static ThreadLocal threadBuffers = new ThreadLocal() { - @Override - protected BakingVertexBuffer initialValue() { - return new BakingVertexBuffer(0x200000); - } - }; - - public static BakingVertexBuffer create() { - return threadBuffers.get(); - } - - private BakingVertexBuffer(int bufferSizeIn) { - super(bufferSizeIn); - } - - @Override - public void begin(int glMode, VertexFormat format) { - if (glMode != 7) { - throw new IllegalArgumentException("Unable to bake GL Mode, only Quads supported! To bake triangles pipe through CCQuad then quadulate."); - } - super.begin(glMode, format); - } - - @Override - public void reset() { - spriteMap = new HashMap(); - useSprites = true; - useDiffuseLighting = true; - super.reset(); - } - - /** - * Sets the sprite for a specific vertex. - * - * @param sprite The sprite to set. - */ - public BakingVertexBuffer setSprite(TextureAtlasSprite sprite) { - spriteMap.put(MathHelper.floor(getVertexCount() / 4D), sprite); - return this; - } - - /** - * Sets the baker to ignore all sprite calculations and just use the missing icon. - * This should only be used in cases where you know the quads are not going to be transformed by another mod at any point. - */ - public BakingVertexBuffer ignoreSprites() { - useSprites = false; - return this; - } - - /** - * Sets the baker to use any set vertex range sprite, or calculate sprites for a given UV mapping. - * This is enabled by default. - */ - public BakingVertexBuffer useSprites() { - useSprites = true; - return this; - } - - /** - * Disables DiffuseLighting on quads. - */ - public BakingVertexBuffer dissableDiffuseLighting() { - useDiffuseLighting = false; - return this; - } - - /** - * Enables DiffuseLighting on quads. - * This is enabled by default. - */ - public BakingVertexBuffer enableDiffuseLighting() { - useDiffuseLighting = true; - return this; - } - - /** - * Bakes the data inside the VertexBuffer to a baked quad. - * - * @return The list of quads baked. - */ - public List bake() { - if (isDrawing) { - FMLLog.log("CodeChickenLib", Level.WARN, new IllegalStateException("Bake called before finishDrawing!"), "Someone is calling bake before finishDrawing!"); - finishDrawing(); - } - State state = getVertexState(); - VertexFormat format = state.getVertexFormat(); - if (!format.hasUvOffset(0)) { - throw new IllegalStateException("Unable to bake format that does not have UV mappings!"); - } - int[] rawBuffer = Arrays.copyOf(state.getRawBuffer(), state.getRawBuffer().length); - - List quads = new LinkedList(); - TextureAtlasSprite sprite = TextureUtils.getMissingSprite(); - - int curr = 0; - int next = format.getNextOffset(); - int i = 0; - while (rawBuffer.length >= next) { - int[] quadData = Arrays.copyOfRange(rawBuffer, curr, next); - Vector3 normal = new Vector3(); - if (format.hasNormal()) { - //Grab first normal. - float[] normalData = new float[4]; - LightUtil.unpack(quadData, normalData, format, 0, VertexDataUtils.getNormalElement(format)); - normal = Vector3.fromArray(normalData); - } else { - //No normal provided in format, so we calculate. - float[][] posData = new float[4][4]; - for (int v = 0; v < 4; v++) { - LightUtil.unpack(quadData, posData[v], format, v, VertexDataUtils.getPositionElement(format)); - } - normal.set(VectorUtils.calculateNormal(Vector3.fromArray(posData[0]), Vector3.fromArray(posData[1]), Vector3.fromArray(posData[3]))); - } - if (useSprites) { - //Attempt to get sprite for vertex. - if (spriteMap.containsKey(i)) { - //Use provided sprite for vertex. - sprite = spriteMap.get(i); - } else { - //Sprite not found for vertex, so we attempt to calculate the sprite. - float[] uvData = new float[4]; - LightUtil.unpack(quadData, uvData, format, 0, VertexDataUtils.getUVElement(format)); - UV uv = new UV(uvData[0], uvData[1]); - sprite = VertexDataUtils.getSpriteForUV(TextureUtils.getTextureMap(), uv); - } - } - //Use normal to calculate facing. - EnumFacing facing = VectorUtils.calcNormalSide(normal); - if (facing == null) { - facing = EnumFacing.UP; - } - BakedQuad quad = new BakedQuad(quadData, -1, facing, sprite, useDiffuseLighting, format); - quads.add(quad); - curr = next; - next += format.getNextOffset(); - i++; - } - return ImmutableList.copyOf(quads); - } -} diff --git a/dependencies/main/java/codechicken/lib/render/item/CCRenderItem.java b/dependencies/main/java/codechicken/lib/render/item/CCRenderItem.java deleted file mode 100644 index ffc7d72c41..0000000000 --- a/dependencies/main/java/codechicken/lib/render/item/CCRenderItem.java +++ /dev/null @@ -1,306 +0,0 @@ -package codechicken.lib.render.item; - -import codechicken.lib.asm.ObfMapping; -import codechicken.lib.render.state.GlStateManagerHelper; -import codechicken.lib.util.ReflectionManager; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.ItemModelMesher; -import net.minecraft.client.renderer.RenderItem; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.resources.IResourceManager; -import net.minecraft.crash.CrashReport; -import net.minecraft.crash.CrashReportCategory; -import net.minecraft.crash.ICrashReportDetail; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ReportedException; -import net.minecraft.world.World; -import net.minecraftforge.client.ForgeHooksClient; -import net.minecraftforge.client.model.IPerspectiveAwareModel; -import org.apache.commons.lang3.tuple.Pair; - -import javax.annotation.Nullable; -import javax.vecmath.Matrix4f; - -/** - * Created by covers1624 on 17/10/2016. - * TODO, Generify how this works. might be different from vanilla in the end but we should probably try and sniff off if the model is ours at an earlier date. - * TODO, Some sort of registry over IMC for mods to add their own hooks to this. - */ -public class CCRenderItem extends RenderItem { - - private final RenderItem parent; - private static CCRenderItem instance; - private static boolean hasInit; - - //Because forge has this private. - private static final Matrix4f flipX; - - static { - flipX = new Matrix4f(); - flipX.setIdentity(); - flipX.m00 = -1; - } - - public CCRenderItem(RenderItem renderItem) { - super(renderItem.textureManager, renderItem.itemModelMesher.getModelManager(), renderItem.itemColors); - ReflectionManager.setField(new ObfMapping("net/minecraft/client/renderer/RenderItem", "field_175059_m", ""), renderItem, renderItem.itemModelMesher); - this.parent = renderItem; - } - - public static void init() { - if (!hasInit) { - instance = new CCRenderItem(Minecraft.getMinecraft().getRenderItem()); - ObfMapping mapping = new ObfMapping("net/minecraft/client/Minecraft", "field_175621_X", ""); - ReflectionManager.setField(mapping, Minecraft.getMinecraft(), instance); - hasInit = true; - } - } - - public static CCRenderItem instance() { - init(); - return instance; - } - - @Override - public void renderItem(ItemStack stack, IBakedModel model) { - if (stack != null && model instanceof IItemRenderer) { - IItemRenderer renderer = (IItemRenderer) model; - boolean shouldHandleRender = true; - try {//Catch AME's from new method. - shouldHandleRender = true;//renderer.shouldHandleRender(stack); - } catch (AbstractMethodError ignored) { - } - if (shouldHandleRender) { - GlStateManager.pushMatrix(); - GlStateManager.translate(-0.5F, -0.5F, -0.5F); - - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GlStateManager.enableRescaleNormal(); - GlStateManagerHelper.pushState(); - renderer.renderItem(stack); - GlStateManagerHelper.popState(); - GlStateManager.popMatrix(); - return; - } - } - parent.renderItem(stack, model); - } - - private IBakedModel handleTransforms(ItemStack stack, IBakedModel model, TransformType transformType, boolean isLeftHand) { - if (model instanceof IMatrixTransform) { - ((IMatrixTransform) model).getTransform(transformType, isLeftHand).glApply(); - } else if (model instanceof IGLTransform) { - ((IGLTransform) model).applyTransforms(transformType, isLeftHand); - } else if (model instanceof IPerspectiveAwareModel) { - model = ForgeHooksClient.handleCameraTransforms(model, transformType, isLeftHand); - } else if (model instanceof IStackPerspectiveAwareModel) { - Pair pair = ((IStackPerspectiveAwareModel) model).handlePerspective(stack, transformType); - - if (pair.getRight() != null) { - Matrix4f matrix = new Matrix4f(pair.getRight()); - if (isLeftHand) { - matrix.mul(flipX, matrix); - matrix.mul(matrix, flipX); - } - ForgeHooksClient.multiplyCurrentGlMatrix(matrix); - } - return pair.getLeft(); - } - return model; - } - - private boolean isValidModel(IBakedModel model) { - return model instanceof IItemRenderer || model instanceof IGLTransform || model instanceof IMatrixTransform || model instanceof IStackPerspectiveAwareModel; - } - - @Override - public void renderItemModel(ItemStack stack, IBakedModel bakedModel, TransformType transform, boolean leftHanded) { - if (stack.getItem() != null) { - if (isValidModel(bakedModel)) { - this.textureManager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - this.textureManager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GlStateManager.enableRescaleNormal(); - GlStateManager.alphaFunc(516, 0.1F); - GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); - GlStateManager.pushMatrix(); - - bakedModel = handleTransforms(stack, bakedModel, transform, leftHanded); - - this.renderItem(stack, bakedModel); - GlStateManager.cullFace(GlStateManager.CullFace.BACK); - GlStateManager.popMatrix(); - GlStateManager.disableRescaleNormal(); - GlStateManager.disableBlend(); - this.textureManager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - this.textureManager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap(); - } else { - parent.zLevel = this.zLevel; - parent.renderItemModel(stack, bakedModel, transform, leftHanded); - } - } - } - - @Override - public void renderItemModelIntoGUI(ItemStack stack, int x, int y, IBakedModel bakedModel) { - if (isValidModel(bakedModel)) { - GlStateManager.pushMatrix(); - this.textureManager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - this.textureManager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false); - GlStateManager.enableRescaleNormal(); - GlStateManager.enableAlpha(); - GlStateManager.alphaFunc(516, 0.1F); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.setupGuiTransform(x, y, bakedModel.isGui3d()); - - bakedModel = handleTransforms(stack, bakedModel, ItemCameraTransforms.TransformType.GUI, false); - - this.renderItem(stack, bakedModel); - GlStateManager.disableAlpha(); - GlStateManager.disableRescaleNormal(); - GlStateManager.disableLighting(); - GlStateManager.popMatrix(); - this.textureManager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - this.textureManager.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap(); - } else { - parent.zLevel = this.zLevel; - parent.renderItemModelIntoGUI(stack, x, y, bakedModel); - } - } - - // region Other Overrides - - @Override - public void renderItem(ItemStack stack, TransformType cameraTransformType) { - if (stack != null) { - IBakedModel bakedModel = this.getItemModelWithOverrides(stack, (World) null, (EntityLivingBase) null); - if (isValidModel(bakedModel)) { - this.renderItemModel(stack, bakedModel, cameraTransformType, false); - } - parent.zLevel = this.zLevel; - parent.renderItem(stack, cameraTransformType); - } - } - - @Override - public void renderItem(ItemStack stack, EntityLivingBase livingBase, TransformType transform, boolean leftHanded) { - if (stack != null && livingBase != null && stack.getItem() != null) { - IBakedModel bakedModel = this.getItemModelWithOverrides(stack, livingBase.worldObj, livingBase); - if (isValidModel(bakedModel)) { - this.renderItemModel(stack, bakedModel, transform, leftHanded); - } else { - parent.zLevel = this.zLevel; - parent.renderItem(stack, livingBase, transform, leftHanded); - } - } - } - - @Override - public void renderItemIntoGUI(ItemStack stack, int x, int y) { - IBakedModel bakedModel = this.getItemModelWithOverrides(stack, (World) null, (EntityLivingBase) null); - if (isValidModel(bakedModel)) { - this.renderItemModelIntoGUI(stack, x, y, bakedModel); - } else { - parent.zLevel = this.zLevel; - parent.renderItemIntoGUI(stack, x, y); - } - } - - @Override - public void renderItemAndEffectIntoGUI(ItemStack stack, int xPosition, int yPosition) { - this.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().thePlayer, stack, xPosition, yPosition); - } - - @Override - public void renderItemAndEffectIntoGUI(@Nullable EntityLivingBase livingBase, final ItemStack stack, int x, int y) { - if (stack != null && stack.getItem() != null) { - try { - - IBakedModel model = this.getItemModelWithOverrides(stack, (World) null, livingBase); - if (isValidModel(model)) { - this.zLevel += 50.0F; - this.renderItemModelIntoGUI(stack, x, y, model); - this.zLevel -= 50.0F; - } else { - parent.zLevel = this.zLevel; - parent.renderItemAndEffectIntoGUI(livingBase, stack, x, y); - } - - } catch (Throwable throwable) { - CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering item"); - CrashReportCategory crashreportcategory = crashreport.makeCategory("Item being rendered"); - crashreportcategory.setDetail("Item Type", new ICrashReportDetail() { - public String call() throws Exception { - return String.valueOf((Object) stack.getItem()); - } - }); - crashreportcategory.setDetail("Item Aux", new ICrashReportDetail() { - public String call() throws Exception { - return String.valueOf(stack.getMetadata()); - } - }); - crashreportcategory.setDetail("Item NBT", new ICrashReportDetail() { - public String call() throws Exception { - return String.valueOf((Object) stack.getTagCompound()); - } - }); - crashreportcategory.setDetail("Item Foil", new ICrashReportDetail() { - public String call() throws Exception { - return String.valueOf(stack.hasEffect()); - } - }); - throw new ReportedException(crashreport); - } - } - } - - // endregion - - // region parentOverrides - @Override - public void registerItems() { - //We don't want to register any more items as we are just a wrapper. - } - - @Override - public void registerItem(Item item, int subType, String identifier) { - //Pass this through because why not. - parent.registerItem(item, subType, identifier); - } - - @Override - public void isNotRenderingEffectsInGUI(boolean isNot) { - parent.isNotRenderingEffectsInGUI(isNot); - } - - @Override - public ItemModelMesher getItemModelMesher() { - return parent.getItemModelMesher(); - } - - @Override - public boolean shouldRenderItemIn3D(ItemStack stack) { - return parent.shouldRenderItemIn3D(stack); - } - - @Override - public IBakedModel getItemModelWithOverrides(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entitylivingbaseIn) { - return parent.getItemModelWithOverrides(stack, worldIn, entitylivingbaseIn); - } - - @Override - public void onResourceManagerReload(IResourceManager resourceManager) { - parent.onResourceManagerReload(resourceManager); - } - - //endregion -} diff --git a/dependencies/main/java/codechicken/lib/render/item/EntityRendererHooks.java b/dependencies/main/java/codechicken/lib/render/item/EntityRendererHooks.java deleted file mode 100644 index 073a4970d8..0000000000 --- a/dependencies/main/java/codechicken/lib/render/item/EntityRendererHooks.java +++ /dev/null @@ -1,129 +0,0 @@ -package codechicken.lib.render.item; - -import codechicken.lib.asm.ObfMapping; -import codechicken.lib.util.ReflectionManager; -import net.minecraft.client.renderer.RenderItem; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.entity.Entity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import net.minecraftforge.client.event.GuiOpenEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.client.GuiModList; -import net.minecraftforge.fml.client.registry.IRenderFactory; -import net.minecraftforge.fml.client.registry.RenderingRegistry; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.FMLLog; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.Mod.EventHandler; -import net.minecraftforge.fml.common.ModContainer; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.lang.reflect.Field; -import java.util.ArrayList; - -/** - * Created by covers1624 on 31/10/2016. - */ -//Used to make sure all references to RenderItem are of CCL's overridden renderer. -@Mod (modid = "ccl-entityhook") -//TODO Find another way to do this, Maybe an ASM hook to load the CCRenderItem. -public class EntityRendererHooks { - - private static boolean hasSanitized; - - public static EntityRendererHooks instance; - - public EntityRendererHooks() { - instance = this; - } - - @EventHandler - @SideOnly (Side.CLIENT) - public void preInt(FMLPreInitializationEvent event) { - MinecraftForge.EVENT_BUS.register(instance); - RenderingRegistry.registerEntityRenderingHandler(DummyEntity.class, new IRenderFactory() { - @Override - public Render createRenderFor(RenderManager manager) { - sanitizeEntityRenderers(manager); - return new Render(manager) { - @Override - protected ResourceLocation getEntityTexture(DummyEntity entity) { - return null; - } - }; - } - }); - } - - @SuppressWarnings ("unchecked") - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void onGuiInit(GuiOpenEvent event) { - try { - if (event.getGui() instanceof GuiModList) { - ModContainer container = FMLCommonHandler.instance().findContainerFor(instance); - Field field = ReflectionManager.getField(new ObfMapping("net/minecraftforge/fml/client/GuiModList", "mods", "")); - ArrayList mods = (ArrayList) field.get(event.getGui()); - if (mods.contains(container)) { - mods.remove(container); - } else { - FMLLog.warning("CCL's Dummy mod was not found inside the mod gui list!"); - } - - } - } catch (Exception e) { - throw new RuntimeException("Unable to hide CCL Dummy mod from the mods gui!.", e); - } - } - - @SideOnly (Side.CLIENT) - public static void sanitizeEntityRenderers(RenderManager renderManager) { - if (!hasSanitized) { - try { - for (Render render : renderManager.entityRenderMap.values()) { - if (render != null) { - for (Field field : render.getClass().getDeclaredFields()) { - if (field.getType().equals(RenderItem.class)) { - field.setAccessible(true); - field.set(render, CCRenderItem.instance()); - } - } - } - } - } catch (Exception e) { - throw new RuntimeException("Unable to reflect an EntityRenderer!", e); - } - hasSanitized = true; - } - } - - @SideOnly (Side.CLIENT) - public class DummyEntity extends Entity { - - public DummyEntity(World worldIn) { - super(worldIn); - } - - @Override - protected void entityInit() { - - } - - @Override - protected void readEntityFromNBT(NBTTagCompound compound) { - - } - - @Override - protected void writeEntityToNBT(NBTTagCompound compound) { - - } - } - -} diff --git a/dependencies/main/java/codechicken/lib/render/item/IGLTransform.java b/dependencies/main/java/codechicken/lib/render/item/IGLTransform.java deleted file mode 100644 index bdb4de5c0f..0000000000 --- a/dependencies/main/java/codechicken/lib/render/item/IGLTransform.java +++ /dev/null @@ -1,13 +0,0 @@ -package codechicken.lib.render.item; - -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; - -/** - * Created by covers1624 on 18/10/2016. - * Used to manually apply OpenGL transforms based on the TransformType. - */ -public interface IGLTransform extends IBakedModel { - - void applyTransforms(TransformType transformType, boolean isLeftHand); -} diff --git a/dependencies/main/java/codechicken/lib/render/item/IItemRenderer.java b/dependencies/main/java/codechicken/lib/render/item/IItemRenderer.java deleted file mode 100644 index 3748beb941..0000000000 --- a/dependencies/main/java/codechicken/lib/render/item/IItemRenderer.java +++ /dev/null @@ -1,20 +0,0 @@ -package codechicken.lib.render.item; - -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.item.ItemStack; - -/** - * Hooks to the location of RenderItem#renderItem(ItemStack, IBakedModel) - */ -//TODO, We need a perspective aware IItemRenderer -public interface IItemRenderer extends IBakedModel { - - /** - * Used as a CallBack to render a TileEntity / Item after Transforms have been applied. - * - * @param item Stack to render. - */ - void renderItem(ItemStack item); - - //boolean shouldHandleRender(ItemStack stack); -} diff --git a/dependencies/main/java/codechicken/lib/render/item/IMatrixTransform.java b/dependencies/main/java/codechicken/lib/render/item/IMatrixTransform.java deleted file mode 100644 index a9ccb759e6..0000000000 --- a/dependencies/main/java/codechicken/lib/render/item/IMatrixTransform.java +++ /dev/null @@ -1,14 +0,0 @@ -package codechicken.lib.render.item; - -import codechicken.lib.vec.Matrix4; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; - -/** - * Created by covers1624 on 18/10/2016. - * Used to define IITemRenderer to apply transforms using a Matrix4 - */ -public interface IMatrixTransform extends IBakedModel { - - Matrix4 getTransform(TransformType transformType, boolean isLeftHand); -} diff --git a/dependencies/main/java/codechicken/lib/render/item/IStackPerspectiveAwareModel.java b/dependencies/main/java/codechicken/lib/render/item/IStackPerspectiveAwareModel.java deleted file mode 100644 index b937a5eda9..0000000000 --- a/dependencies/main/java/codechicken/lib/render/item/IStackPerspectiveAwareModel.java +++ /dev/null @@ -1,17 +0,0 @@ -package codechicken.lib.render.item; - -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.item.ItemStack; -import org.apache.commons.lang3.tuple.Pair; - -import javax.vecmath.Matrix4f; - -/** - * Created by covers1624 on 5/11/2016. - * Basically the same as IPerspectiveAwareModel. Except you have reference to the ItemStack you are rendering for. - */ -public interface IStackPerspectiveAwareModel extends IBakedModel { - - Pair handlePerspective(ItemStack stack, TransformType cameraTransformType); -} diff --git a/dependencies/main/java/codechicken/lib/render/item/map/IMapRenderer.java b/dependencies/main/java/codechicken/lib/render/item/map/IMapRenderer.java deleted file mode 100644 index 2c419b2310..0000000000 --- a/dependencies/main/java/codechicken/lib/render/item/map/IMapRenderer.java +++ /dev/null @@ -1,34 +0,0 @@ -package codechicken.lib.render.item.map; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.storage.MapData; - -import javax.annotation.Nullable; - -/** - * Created by covers1624 on 15/02/2017. - * Used to handle the rendering of map data for your custom maps. - */ -public interface IMapRenderer { - - /** - * If the IMapRenderer should handle rendering the data from this map. - * - * @param stack The ItemStack to render map data from. - * @param data The Map data contained inside this Map. - * @param inFrame If the ItemStack is inside an ItemFrame. - * @return Should this IMapRenderer handle with this context. - */ - boolean shouldHandle(ItemStack stack, @Nullable MapData data, boolean inFrame); - - /** - * If this is called you are expected to do something. - * This is ONLY called if shouldHandle returns true. - * - * @param stack The ItemStack to render the map data from. - * @param data The MapData contained in the ItemStack. - * @param inFrame If the ItemStack is inside an ItemFrame. - */ - void renderMap(ItemStack stack, @Nullable MapData data, boolean inFrame); - -} diff --git a/dependencies/main/java/codechicken/lib/render/item/map/MapRenderRegistry.java b/dependencies/main/java/codechicken/lib/render/item/map/MapRenderRegistry.java deleted file mode 100644 index a3f82db491..0000000000 --- a/dependencies/main/java/codechicken/lib/render/item/map/MapRenderRegistry.java +++ /dev/null @@ -1,50 +0,0 @@ -package codechicken.lib.render.item.map; - -import net.minecraft.client.Minecraft; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.storage.MapData; -import net.minecraftforge.client.event.RenderItemInFrameEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -import java.util.IdentityHashMap; - -/** - * Created by covers1624 on 15/02/2017. - * TODO PR for 1.11 to add this as an event. - */ -public class MapRenderRegistry { - - private static IdentityHashMap mapRenderers = new IdentityHashMap(); - - public static boolean shouldHandle(ItemStack stack, boolean inFrame) { - IMapRenderer mapRenderer = mapRenderers.get(stack.getItem()); - if (mapRenderer != null) { - MapData data = Items.FILLED_MAP.getMapData(stack, Minecraft.getMinecraft().theWorld); - return mapRenderer.shouldHandle(stack, data, inFrame); - } - return false; - } - - public static void handleRender(ItemStack stack, boolean inFrame) { - IMapRenderer mapRenderer = mapRenderers.get(stack.getItem()); - if (mapRenderer != null) { - MapData data = Items.FILLED_MAP.getMapData(stack, Minecraft.getMinecraft().theWorld); - mapRenderer.renderMap(stack, data, inFrame); - } - } - - public static void registerMapRenderer(Item item, IMapRenderer mapRenderer) { - mapRenderers.put(item, mapRenderer); - } - - @SubscribeEvent - public void onItemFrameRender(RenderItemInFrameEvent event) { - if (shouldHandle(event.getItem(), true)) { - event.setCanceled(true); - handleRender(event.getItem(), true); - } - } - -} diff --git a/dependencies/main/java/codechicken/lib/render/particle/CustomParticleHandler.java b/dependencies/main/java/codechicken/lib/render/particle/CustomParticleHandler.java deleted file mode 100644 index 6183ae0429..0000000000 --- a/dependencies/main/java/codechicken/lib/render/particle/CustomParticleHandler.java +++ /dev/null @@ -1,85 +0,0 @@ -package codechicken.lib.render.particle; - -import codechicken.lib.render.DigIconParticle; -import codechicken.lib.texture.IWorldBlockTextureProvider; -import codechicken.lib.vec.Cuboid6; -import codechicken.lib.vec.Vector3; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.particle.ParticleManager; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.world.World; - -/** - * Created by covers1624 on 21/11/2016. - * TODO, we need to support landing particles and Maybe some ASM to add this to all blocks that CCL supports. - */ -public class CustomParticleHandler { - - public static void addHitEffects(IBlockState state, World world, RayTraceResult trace, ParticleManager particleManager, IWorldBlockTextureProvider provider) { - TextureAtlasSprite sprite = provider.getTexture(trace.sideHit, state, BlockRenderLayer.SOLID, world, trace.getBlockPos()); - Cuboid6 cuboid = new Cuboid6(state.getBoundingBox(world, trace.getBlockPos())).add(trace.getBlockPos()); - addBlockHitEffects(world, cuboid, trace.sideHit, sprite, particleManager); - } - - public static void addDestroyEffects(World world, BlockPos pos, ParticleManager particleManager, IWorldBlockTextureProvider provider) { - TextureAtlasSprite[] sprites = new TextureAtlasSprite[6]; - IBlockState state = world.getBlockState(pos); - for (EnumFacing face : EnumFacing.VALUES) { - sprites[face.ordinal()] = provider.getTexture(face, state, BlockRenderLayer.SOLID, world, pos); - } - Cuboid6 cuboid = new Cuboid6(state.getBoundingBox(world, pos)).add(pos); - addBlockDestroyEffects(world, cuboid, sprites, particleManager); - } - - public static void addBlockHitEffects(World world, Cuboid6 bounds, EnumFacing side, TextureAtlasSprite icon, ParticleManager particleManager) { - float border = 0.1F; - Vector3 diff = bounds.max.copy().subtract(bounds.min).add(-2 * border); - diff.x *= world.rand.nextDouble(); - diff.y *= world.rand.nextDouble(); - diff.z *= world.rand.nextDouble(); - Vector3 pos = diff.add(bounds.min).add(border); - - if (side == EnumFacing.DOWN) { - diff.y = bounds.min.y - border; - } - if (side == EnumFacing.UP) { - diff.y = bounds.max.y + border; - } - if (side == EnumFacing.NORTH) { - diff.z = bounds.min.z - border; - } - if (side == EnumFacing.SOUTH) { - diff.z = bounds.max.z + border; - } - if (side == EnumFacing.WEST) { - diff.x = bounds.min.x - border; - } - if (side == EnumFacing.EAST) { - diff.x = bounds.max.x + border; - } - - particleManager.addEffect(new DigIconParticle(world, pos.x, pos.y, pos.z, 0, 0, 0, icon).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); - } - - public static void addBlockDestroyEffects(World world, Cuboid6 bounds, TextureAtlasSprite[] icons, ParticleManager particleManager) { - Vector3 diff = bounds.max.copy().subtract(bounds.min); - Vector3 center = bounds.min.copy().add(bounds.max).multiply(0.5); - Vector3 density = diff.copy().multiply(4).celi(); - - for (int i = 0; i < density.x; ++i) { - for (int j = 0; j < density.y; ++j) { - for (int k = 0; k < density.z; ++k) { - double x = bounds.min.x + (i + 0.5) * diff.x / density.x; - double y = bounds.min.y + (j + 0.5) * diff.y / density.y; - double z = bounds.min.z + (k + 0.5) * diff.z / density.z; - particleManager.addEffect(new DigIconParticle(world, x, y, z, x - center.x, y - center.y, z - center.z, icons[world.rand.nextInt(icons.length)])); - } - } - } - } - -} diff --git a/dependencies/main/java/codechicken/lib/render/pipeline/CCRenderPipeline.java b/dependencies/main/java/codechicken/lib/render/pipeline/CCRenderPipeline.java deleted file mode 100644 index 2e84dd8295..0000000000 --- a/dependencies/main/java/codechicken/lib/render/pipeline/CCRenderPipeline.java +++ /dev/null @@ -1,168 +0,0 @@ -package codechicken.lib.render.pipeline; - -import codechicken.lib.render.CCRenderState; - -import java.util.ArrayList; - -public class CCRenderPipeline { - - public class PipelineBuilder { - - CCRenderState renderState; - - public PipelineBuilder(CCRenderState renderState) { - this.renderState = renderState; - } - - public PipelineBuilder add(IVertexOperation op) { - ops.add(op); - return this; - } - - public PipelineBuilder add(IVertexOperation... ops) { - for (int i = 0; i < ops.length; i++) { - CCRenderPipeline.this.ops.add(ops[i]); - } - return this; - } - - public void build() { - rebuild(); - } - - public void render() { - rebuild(); - renderState.render(); - } - } - - private class PipelineNode { - - public ArrayList deps = new ArrayList(); - public IVertexOperation op; - - public void add() { - if (op == null) { - return; - } - - for (int i = 0; i < deps.size(); i++) { - deps.get(i).add(); - } - deps.clear(); - sorted.add(op); - op = null; - } - } - - private CCRenderState renderState; - - //By default we want to force format attributes. - public boolean forceFormatAttributes = true; - - private ArrayList attribs = new ArrayList(); - private ArrayList ops = new ArrayList(); - private ArrayList nodes = new ArrayList(); - private ArrayList sorted = new ArrayList(); - private PipelineNode loading; - private PipelineBuilder builder; - - public CCRenderPipeline(CCRenderState renderState) { - this.renderState = renderState; - builder = new PipelineBuilder(renderState); - } - - public void setPipeline(IVertexOperation... ops) { - this.ops.clear(); - for (int i = 0; i < ops.length; i++) { - this.ops.add(ops[i]); - } - rebuild(); - } - - public void reset() { - ops.clear(); - unbuild(); - } - - private void unbuild() { - for (int i = 0; i < attribs.size(); i++) { - attribs.get(i).active = false; - } - attribs.clear(); - sorted.clear(); - } - - public void rebuild() { - - if (forceFormatAttributes) { - if (renderState.fmt.hasNormal()) { - addAttribute(renderState.normalAttrib); - } - if (renderState.fmt.hasColor()) { - addAttribute(renderState.colourAttrib); - } - if (renderState.computeLighting) { - addAttribute(renderState.lightingAttrib); - } - } - - if (ops.isEmpty() || renderState.model == null) { - return; - } - - //ensure enough nodes for all ops - while (nodes.size() < CCRenderState.operationCount()) { - nodes.add(new PipelineNode()); - } - unbuild(); - - for (int i = 0; i < ops.size(); i++) { - IVertexOperation op = ops.get(i); - loading = nodes.get(op.operationID()); - boolean loaded = op.load(renderState); - if (loaded) { - loading.op = op; - } - - if (op instanceof VertexAttribute) { - if (loaded) { - attribs.add((VertexAttribute) op); - } else { - ((VertexAttribute) op).active = false; - } - } - } - - for (int i = 0; i < nodes.size(); i++) { - nodes.get(i).add(); - } - } - - public void addRequirement(int opRef) { - loading.deps.add(nodes.get(opRef)); - } - - public void addDependency(VertexAttribute attrib) { - loading.deps.add(nodes.get(attrib.operationID())); - addAttribute(attrib); - } - - public void addAttribute(VertexAttribute attrib) { - if (!attrib.active) { - ops.add(attrib); - attrib.active = true; - } - } - - public void operate() { - for (int i = 0; i < sorted.size(); i++) { - sorted.get(i).operate(renderState); - } - } - - public PipelineBuilder builder() { - ops.clear(); - return builder; - } -} diff --git a/dependencies/main/java/codechicken/lib/render/pipeline/ColourMultiplier.java b/dependencies/main/java/codechicken/lib/render/pipeline/ColourMultiplier.java deleted file mode 100644 index 2b7721ff55..0000000000 --- a/dependencies/main/java/codechicken/lib/render/pipeline/ColourMultiplier.java +++ /dev/null @@ -1,41 +0,0 @@ -package codechicken.lib.render.pipeline; - -import codechicken.lib.colour.ColourRGBA; -import codechicken.lib.render.CCRenderState; - -public class ColourMultiplier implements IVertexOperation { - - private static ColourMultiplier instance = new ColourMultiplier(-1); - - public static ColourMultiplier instance(int colour) { - instance.colour = colour; - return instance; - } - - public static final int operationIndex = CCRenderState.registerOperation(); - public int colour; - - public ColourMultiplier(int colour) { - this.colour = colour; - } - - @Override - public boolean load(CCRenderState state) { - if (colour == -1) { - return false; - } - - state.pipeline.addDependency(state.colourAttrib); - return true; - } - - @Override - public void operate(CCRenderState state) { - state.colour = ColourRGBA.multiply(state.colour, colour); - } - - @Override - public int operationID() { - return operationIndex; - } -} diff --git a/dependencies/main/java/codechicken/lib/render/pipeline/IVertexOperation.java b/dependencies/main/java/codechicken/lib/render/pipeline/IVertexOperation.java deleted file mode 100644 index 57a14ffdcc..0000000000 --- a/dependencies/main/java/codechicken/lib/render/pipeline/IVertexOperation.java +++ /dev/null @@ -1,26 +0,0 @@ -package codechicken.lib.render.pipeline; - -import codechicken.lib.render.CCRenderState; - -/** - * Represents an operation to be run for each vertex that operates on and modifies the current state - */ -public interface IVertexOperation { - - /** - * Load any required references and add dependencies to the pipeline based on the current model (may be null) - * Return false if this operation is redundant in the pipeline with the given model - */ - boolean load(CCRenderState state); - - /** - * Perform the operation on the current render state - */ - void operate(CCRenderState state); - - /** - * Get the unique id representing this type of operation. Duplicate operation IDs within the pipeline may have unexpected results. - * ID shoulld be obtained from CCRenderState.registerOperation() and stored in a static variable - */ - int operationID(); -} diff --git a/dependencies/main/java/codechicken/lib/render/pipeline/IVertexSource.java b/dependencies/main/java/codechicken/lib/render/pipeline/IVertexSource.java deleted file mode 100644 index e09aef18d8..0000000000 --- a/dependencies/main/java/codechicken/lib/render/pipeline/IVertexSource.java +++ /dev/null @@ -1,32 +0,0 @@ -package codechicken.lib.render.pipeline; - -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.attribute.AttributeKey; -import codechicken.lib.vec.Vertex5; - -/** - * Created by covers1624 on 10/10/2016. - */ -public interface IVertexSource { - - Vertex5[] getVertices(); - - /** - * Gets an array of vertex attributes - * - * @param attr The vertex attribute to get - * @param The attribute array type - * @return An array, or null if not computed - */ - T getAttributes(AttributeKey attr); - - /** - * @return True if the specified attribute is provided by this model, either by returning an array from getAttributes or by setting the state in prepareVertex - */ - boolean hasAttribute(AttributeKey attr); - - /** - * Callback to set CCRenderState for a vertex before the pipeline runs - */ - void prepareVertex(CCRenderState state); -} diff --git a/dependencies/main/java/codechicken/lib/render/pipeline/VertexAttribute.java b/dependencies/main/java/codechicken/lib/render/pipeline/VertexAttribute.java deleted file mode 100644 index a3225f425d..0000000000 --- a/dependencies/main/java/codechicken/lib/render/pipeline/VertexAttribute.java +++ /dev/null @@ -1,39 +0,0 @@ -package codechicken.lib.render.pipeline; - -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.attribute.AttributeKey; -import codechicken.lib.util.ArrayUtils; - -/** - * Management class for a vertex attribute such as colour, normal etc - * This class should handle the loading of the attribute from an array provided by IVertexSource.getAttributes or the computation of this attribute from others - * - * @param The array type for this attribute eg. int[], Vector3[] - */ -public abstract class VertexAttribute implements IVertexOperation { - - private final int operationIndex = CCRenderState.registerOperation(); - - /** - * Set to true when the attribute is part of the pipeline. Should only be managed by CCRenderState when constructing the pipeline - */ - public boolean active = false; - - /** - * Construct a new array for storage of vertex attributes in a model - */ - public abstract T newArray(int length); - - public abstract String getAttribName(); - - @Override - public int operationID() { - return operationIndex; - } - - public static R copyOf(AttributeKey attr, R src, int length) { - R dst = attr.newArray(length); - ArrayUtils.arrayCopy(src, 0, dst, 0, ((Object[]) src).length); - return dst; - } -} diff --git a/dependencies/main/java/codechicken/lib/render/pipeline/attribute/AttributeKey.java b/dependencies/main/java/codechicken/lib/render/pipeline/attribute/AttributeKey.java deleted file mode 100644 index 743281a039..0000000000 --- a/dependencies/main/java/codechicken/lib/render/pipeline/attribute/AttributeKey.java +++ /dev/null @@ -1,40 +0,0 @@ -package codechicken.lib.render.pipeline.attribute; - -import com.google.common.collect.ImmutableList; - -import java.util.ArrayList; -import java.util.List; - -/** - * Created by covers1624 on 10/10/2016. - * Used to lookup and create new arrays for an attribute without a hard dep on an attribute instance. - */ -public abstract class AttributeKey { - - public final int attributeKeyIndex; - - public AttributeKey() { - attributeKeyIndex = AttributeKeyRegistry.registerAttributeKey(this); - } - - public abstract T newArray(int length); - - public static class AttributeKeyRegistry { - - private static ArrayList> attributeKeys = new ArrayList>(); - - private static int registerAttributeKey(AttributeKey attr) { - attributeKeys.add(attr); - return attributeKeys.size() - 1; - } - - public static AttributeKey getAttributeKey(int index) { - return attributeKeys.get(index); - } - - public static List> getRegisteredAttributeKeys() { - return ImmutableList.copyOf(attributeKeys); - } - } - -} diff --git a/dependencies/main/java/codechicken/lib/render/pipeline/attribute/ColourAttribute.java b/dependencies/main/java/codechicken/lib/render/pipeline/attribute/ColourAttribute.java deleted file mode 100644 index 9c02f2cdac..0000000000 --- a/dependencies/main/java/codechicken/lib/render/pipeline/attribute/ColourAttribute.java +++ /dev/null @@ -1,45 +0,0 @@ -package codechicken.lib.render.pipeline.attribute; - -import codechicken.lib.colour.ColourRGBA; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.VertexAttribute; - -/** - * Sets colour in CCRS to the specified colour in the model. - */ -public class ColourAttribute extends VertexAttribute { - - public static final AttributeKey attributeKey = new AttributeKey() { - @Override - public int[] newArray(int length) { - return new int[length]; - } - }; - - private int[] colourRef; - - @Override - public int[] newArray(int length) { - return new int[length]; - } - - @Override - public String getAttribName() { - return "colourAttrib"; - } - - @Override - public boolean load(CCRenderState state) { - colourRef = state.model.getAttributes(ColourAttribute.attributeKey); - return colourRef != null || !state.model.hasAttribute(ColourAttribute.attributeKey); - } - - @Override - public void operate(CCRenderState state) { - if (colourRef != null) { - state.colour = ColourRGBA.multiply(state.baseColour, colourRef[state.vertexIndex]); - } else { - state.colour = state.baseColour; - } - } -} diff --git a/dependencies/main/java/codechicken/lib/render/pipeline/attribute/LightCoordAttribute.java b/dependencies/main/java/codechicken/lib/render/pipeline/attribute/LightCoordAttribute.java deleted file mode 100644 index cd9f3edafe..0000000000 --- a/dependencies/main/java/codechicken/lib/render/pipeline/attribute/LightCoordAttribute.java +++ /dev/null @@ -1,56 +0,0 @@ -package codechicken.lib.render.pipeline.attribute; - -import codechicken.lib.lighting.LC; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.VertexAttribute; -import codechicken.lib.vec.Transformation; -import codechicken.lib.vec.Vector3; - -/** - * Uses the position of the lightmatrix to compute LC if not provided - */ -public class LightCoordAttribute extends VertexAttribute { - - public static final AttributeKey attributeKey = new AttributeKey() { - @Override - public LC[] newArray(int length) { - return new LC[length]; - } - }; - - private LC[] lcRef; - private Vector3 vec = new Vector3();//for computation - private Vector3 pos = new Vector3(); - - @Override - public LC[] newArray(int length) { - return new LC[length]; - } - - @Override - public String getAttribName() { - return "lightCoordAttrib"; - } - - @Override - public boolean load(CCRenderState state) { - lcRef = state.model.getAttributes(LightCoordAttribute.attributeKey); - if (state.model.hasAttribute(LightCoordAttribute.attributeKey)) { - return lcRef != null; - } - - pos.set(new Vector3(state.lightMatrix.pos)); - state.pipeline.addDependency(state.sideAttrib); - state.pipeline.addRequirement(Transformation.operationIndex); - return true; - } - - @Override - public void operate(CCRenderState state) { - if (lcRef != null) { - state.lc.set(lcRef[state.vertexIndex]); - } else { - state.lc.compute(vec.set(state.vert.vec).subtract(pos), state.side); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/render/pipeline/attribute/LightingAttribute.java b/dependencies/main/java/codechicken/lib/render/pipeline/attribute/LightingAttribute.java deleted file mode 100644 index 9d1c4175d5..0000000000 --- a/dependencies/main/java/codechicken/lib/render/pipeline/attribute/LightingAttribute.java +++ /dev/null @@ -1,49 +0,0 @@ -package codechicken.lib.render.pipeline.attribute; - -import codechicken.lib.colour.ColourRGBA; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.VertexAttribute; - -/** - * Created by covers1624 on 10/10/2016. - */ -public class LightingAttribute extends VertexAttribute { - - public static final AttributeKey attributeKey = new AttributeKey() { - @Override - public int[] newArray(int length) { - return new int[length]; - } - }; - - private int[] colourRef; - - @Override - public int[] newArray(int length) { - return new int[length]; - } - - @Override - public String getAttribName() { - return "lightingAttrib"; - } - - @Override - public boolean load(CCRenderState state) { - if (!state.computeLighting || !state.fmt.hasColor() || !state.model.hasAttribute(LightingAttribute.attributeKey)) { - return false; - } - - colourRef = state.model.getAttributes(LightingAttribute.attributeKey); - if (colourRef != null) { - state.pipeline.addDependency(state.colourAttrib); - return true; - } - return false; - } - - @Override - public void operate(CCRenderState state) { - state.colour = ColourRGBA.multiply(state.colour, colourRef[state.vertexIndex]); - } -} diff --git a/dependencies/main/java/codechicken/lib/render/pipeline/attribute/NormalAttribute.java b/dependencies/main/java/codechicken/lib/render/pipeline/attribute/NormalAttribute.java deleted file mode 100644 index f8649e9afd..0000000000 --- a/dependencies/main/java/codechicken/lib/render/pipeline/attribute/NormalAttribute.java +++ /dev/null @@ -1,54 +0,0 @@ -package codechicken.lib.render.pipeline.attribute; - -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.VertexAttribute; -import codechicken.lib.vec.Rotation; -import codechicken.lib.vec.Vector3; - -/** - * Apples normals to the render operation. If the model is a planar model it uses known normals. - */ -public class NormalAttribute extends VertexAttribute { - - public static final AttributeKey attributeKey = new AttributeKey() { - @Override - public Vector3[] newArray(int length) { - return new Vector3[length]; - } - }; - - private Vector3[] normalRef; - - @Override - public Vector3[] newArray(int length) { - return new Vector3[length]; - } - - @Override - public String getAttribName() { - return "normalAttrib"; - } - - @Override - public boolean load(CCRenderState state) { - normalRef = state.model.getAttributes(NormalAttribute.attributeKey); - if (state.model.hasAttribute(NormalAttribute.attributeKey)) { - return normalRef != null; - } - - if (state.model.hasAttribute(SideAttribute.attributeKey)) { - state.pipeline.addDependency(state.sideAttrib); - return true; - } - throw new IllegalStateException("Normals requested but neither normal or side attrutes are provided by the model"); - } - - @Override - public void operate(CCRenderState state) { - if (normalRef != null) { - state.normal.set(normalRef[state.vertexIndex]); - } else { - state.normal.set(Rotation.axes[state.side]); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/render/pipeline/attribute/SideAttribute.java b/dependencies/main/java/codechicken/lib/render/pipeline/attribute/SideAttribute.java deleted file mode 100644 index 042cede201..0000000000 --- a/dependencies/main/java/codechicken/lib/render/pipeline/attribute/SideAttribute.java +++ /dev/null @@ -1,50 +0,0 @@ -package codechicken.lib.render.pipeline.attribute; - -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.VertexAttribute; -import codechicken.lib.util.VectorUtils; - -/** - * Sets the side state in CCRS based on the provided model. If the model does not have side data it requires normals. - */ -public class SideAttribute extends VertexAttribute { - - public static final AttributeKey attributeKey = new AttributeKey() { - @Override - public int[] newArray(int length) { - return new int[length]; - } - }; - - private int[] sideRef; - - @Override - public int[] newArray(int length) { - return new int[length]; - } - - @Override - public String getAttribName() { - return "sideAttrib"; - } - - @Override - public boolean load(CCRenderState state) { - sideRef = state.model.getAttributes(SideAttribute.attributeKey); - if (state.model.hasAttribute(SideAttribute.attributeKey)) { - return sideRef != null; - } - - state.pipeline.addDependency(state.normalAttrib); - return true; - } - - @Override - public void operate(CCRenderState state) { - if (sideRef != null) { - state.side = sideRef[state.vertexIndex]; - } else { - state.side = VectorUtils.findSide(state.normal); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/render/shader/ShaderProgram.java b/dependencies/main/java/codechicken/lib/render/shader/ShaderProgram.java deleted file mode 100644 index b5a480b4d7..0000000000 --- a/dependencies/main/java/codechicken/lib/render/shader/ShaderProgram.java +++ /dev/null @@ -1,173 +0,0 @@ -package codechicken.lib.render.shader; - -import codechicken.lib.render.shader.pipeline.CCShaderPipeline; -import codechicken.lib.render.shader.pipeline.attribute.IShaderOperation; -import org.lwjgl.opengl.ARBFragmentShader; -import org.lwjgl.opengl.ARBShaderObjects; -import org.lwjgl.opengl.ARBVertexShader; -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.vector.Matrix4f; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; - -import static org.lwjgl.opengl.ARBShaderObjects.*; - -public class ShaderProgram { - - private int programID; - public CCShaderPipeline pipeline = new CCShaderPipeline(this); - private ArrayList ops = new ArrayList(); - - public ShaderProgram() { - programID = glCreateProgramObjectARB(); - if (programID == 0) { - throw new RuntimeException("Unable to allocate shader program object."); - } - } - - public void attachShaderOperation(IShaderOperation operation) { - ops.add(operation); - } - - public void bindShader() { - glUseProgramObjectARB(programID); - } - - /** - * Allows you to bind the shader for use outside an IShaderOperation. - * You can still pass variables to the shader using an IShaderOperation. - * - * Call this before you do your rendering. - * Then call ShaderProgram.unbindShader() when you have finished rendering. - */ - public void freeBindShader() { - pipeline.reset(); - pipeline.setPipeline(ops); - - glUseProgramObjectARB(programID); - pipeline.operate(); - } - - public static void unbindShader() { - glUseProgramObjectARB(0); - } - - public void runShader() { - pipeline.reset(); - pipeline.setPipeline(ops); - - bindShader(); - pipeline.operate(); - unbindShader(); - } - - public ShaderProgram attachVert(String resource) { - return attach(ARBVertexShader.GL_VERTEX_SHADER_ARB, resource); - } - - public ShaderProgram attachFrag(String resource) { - return attach(ARBFragmentShader.GL_FRAGMENT_SHADER_ARB, resource); - } - - public ShaderProgram attach(int shaderType, String resource) { - InputStream stream = ShaderProgram.class.getResourceAsStream(resource); - if (stream == null) { - throw new RuntimeException("Unable to locate resource: " + resource); - } - - return attach(shaderType, stream); - } - - public ShaderProgram attach(int shaderType, InputStream stream) { - if (stream == null) { - throw new RuntimeException("Invalid shader inputstream"); - } - - int shaderID = 0; - try { - shaderID = glCreateShaderObjectARB(shaderType); - if (shaderID == 0) { - throw new RuntimeException("Unable to allocate shader object."); - } - - try { - glShaderSourceARB(shaderID, asString(stream)); - } catch (IOException e) { - throw new RuntimeException("Error reading inputstream.", e); - } - - glCompileShaderARB(shaderID); - if (glGetObjectParameteriARB(shaderID, GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE) { - throw new RuntimeException("Error compiling shader: " + getInfoLog(shaderID)); - } - - glAttachObjectARB(programID, shaderID); - } catch (RuntimeException e) { - glDeleteObjectARB(shaderID); - throw e; - } - return this; - } - - /** - * Call this once you have bound your frag and vert shader. - */ - public ShaderProgram validate() { - glLinkProgramARB(programID); - if (glGetObjectParameteriARB(programID, GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) { - throw new RuntimeException("Error linking program: " + getInfoLog(programID)); - } - - glValidateProgramARB(programID); - if (glGetObjectParameteriARB(programID, GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) { - throw new RuntimeException("Error validating program: " + getInfoLog(programID)); - } - return this; - } - - public static String asString(InputStream stream) throws IOException { - StringBuilder sb = new StringBuilder(); - BufferedReader bin = new BufferedReader(new InputStreamReader(stream)); - String line; - while ((line = bin.readLine()) != null) { - sb.append(line).append('\n'); - } - stream.close(); - return sb.toString(); - } - - private static String getInfoLog(int shaderID) { - return glGetInfoLogARB(shaderID, glGetObjectParameteriARB(shaderID, GL_OBJECT_INFO_LOG_LENGTH_ARB)); - } - - public int getUniformLoc(String name) { - return ARBShaderObjects.glGetUniformLocationARB(programID, name); - } - - public int getAttribLoc(String name) { - return ARBVertexShader.glGetAttribLocationARB(programID, name); - } - - public void uniformTexture(String name, int textureIndex) { - ARBShaderObjects.glUniform1iARB(getUniformLoc(name), textureIndex); - } - - public void glVertexAttributeMat4(int loc, Matrix4f matrix) { - ARBVertexShader.glVertexAttrib4fARB(loc, matrix.m00, matrix.m01, matrix.m02, matrix.m03); - ARBVertexShader.glVertexAttrib4fARB(loc + 1, matrix.m10, matrix.m11, matrix.m12, matrix.m13); - ARBVertexShader.glVertexAttrib4fARB(loc + 2, matrix.m20, matrix.m21, matrix.m22, matrix.m23); - ARBVertexShader.glVertexAttrib4fARB(loc + 3, matrix.m30, matrix.m31, matrix.m32, matrix.m33); - } - - /** - * This method will completely remove the shader. - */ - public void cleanup() { - ops.clear(); - ARBShaderObjects.glDeleteObjectARB(programID); - } -} diff --git a/dependencies/main/java/codechicken/lib/render/shader/pipeline/CCShaderPipeline.java b/dependencies/main/java/codechicken/lib/render/shader/pipeline/CCShaderPipeline.java deleted file mode 100644 index b3b9152b86..0000000000 --- a/dependencies/main/java/codechicken/lib/render/shader/pipeline/CCShaderPipeline.java +++ /dev/null @@ -1,135 +0,0 @@ -package codechicken.lib.render.shader.pipeline; - -import codechicken.lib.render.shader.ShaderProgram; -import codechicken.lib.render.shader.pipeline.attribute.IShaderOperation; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * Created by covers1624 on 18/10/2016. - */ -public class CCShaderPipeline { - - private static int nextOperationIndex; - - public static int registerOperation() { - return nextOperationIndex++; - } - - public static int operationCount() { - return nextOperationIndex; - } - - public class PipelineBuilder { - - public CCShaderPipeline.PipelineBuilder add(IShaderOperation op) { - ops.add(op); - return this; - } - - public CCShaderPipeline.PipelineBuilder add(IShaderOperation... ops) { - for (int i = 0; i < ops.length; i++) { - CCShaderPipeline.this.ops.add(ops[i]); - } - return this; - } - - public void build() { - rebuild(); - } - } - - private class PipelineNode { - - public ArrayList deps = new ArrayList(); - public IShaderOperation op; - - public void add() { - if (op == null) { - return; - } - - for (int i = 0; i < deps.size(); i++) { - deps.get(i).add(); - } - deps.clear(); - sorted.add(op); - op = null; - } - } - - private ShaderProgram program; - - private ArrayList ops = new ArrayList(); - private ArrayList nodes = new ArrayList(); - private ArrayList sorted = new ArrayList(); - private CCShaderPipeline.PipelineNode loading; - private CCShaderPipeline.PipelineBuilder builder = new CCShaderPipeline.PipelineBuilder(); - - public CCShaderPipeline(ShaderProgram program) { - this.program = program; - } - - public void setPipeline(IShaderOperation... ops) { - this.ops.clear(); - Collections.addAll(this.ops, ops); - rebuild(); - } - - public void setPipeline(List ops) { - this.ops.clear(); - this.ops.addAll(ops); - rebuild(); - } - - public void reset() { - ops.clear(); - unbuild(); - } - - private void unbuild() { - sorted.clear(); - } - - public void rebuild() { - - if (ops.isEmpty()) { - return; - } - - //ensure enough nodes for all ops - while (nodes.size() < operationCount()) { - nodes.add(new CCShaderPipeline.PipelineNode()); - } - unbuild(); - - for (IShaderOperation op : ops) { - loading = nodes.get(op.operationID()); - boolean loaded = op.load(program); - if (loaded) { - loading.op = op; - } - } - - for (PipelineNode node : nodes) { - node.add(); - } - } - - public void addRequirement(int opRef) { - loading.deps.add(nodes.get(opRef)); - } - - public void operate() { - for (IShaderOperation op : sorted) { - op.operate(program); - } - } - - public CCShaderPipeline.PipelineBuilder builder() { - ops.clear(); - return builder; - } -} diff --git a/dependencies/main/java/codechicken/lib/render/shader/pipeline/attribute/IShaderOperation.java b/dependencies/main/java/codechicken/lib/render/shader/pipeline/attribute/IShaderOperation.java deleted file mode 100644 index b5dcf2a674..0000000000 --- a/dependencies/main/java/codechicken/lib/render/shader/pipeline/attribute/IShaderOperation.java +++ /dev/null @@ -1,15 +0,0 @@ -package codechicken.lib.render.shader.pipeline.attribute; - -import codechicken.lib.render.shader.ShaderProgram; - -/** - * Created by covers1624 on 18/10/2016. - */ -public interface IShaderOperation { - - boolean load(ShaderProgram program); - - void operate(ShaderProgram program); - - int operationID(); -} diff --git a/dependencies/main/java/codechicken/lib/render/shader/pipeline/attribute/ShaderRenderTimeOperation.java b/dependencies/main/java/codechicken/lib/render/shader/pipeline/attribute/ShaderRenderTimeOperation.java deleted file mode 100644 index 6239026375..0000000000 --- a/dependencies/main/java/codechicken/lib/render/shader/pipeline/attribute/ShaderRenderTimeOperation.java +++ /dev/null @@ -1,37 +0,0 @@ -package codechicken.lib.render.shader.pipeline.attribute; - -import codechicken.lib.render.shader.ShaderProgram; -import codechicken.lib.render.shader.pipeline.CCShaderPipeline; -import codechicken.lib.util.ClientUtils; -import org.lwjgl.opengl.ARBShaderObjects; - -import java.util.HashMap; - -/** - * Created by covers1624 on 18/10/2016. - */ -public class ShaderRenderTimeOperation implements IShaderOperation { - - public static final int operationID = CCShaderPipeline.registerOperation(); - private final HashMap shaderRenderTimeCache = new HashMap(); - - @Override - public boolean load(ShaderProgram program) { - return true; - } - - @Override - public void operate(ShaderProgram program) { - float renderTime = (float) ClientUtils.getRenderTime(); - if (renderTime != shaderRenderTimeCache.get(program)) { - int location = program.getAttribLoc("time"); - ARBShaderObjects.glUniform1fARB(location, renderTime); - shaderRenderTimeCache.put(program, renderTime); - } - } - - @Override - public int operationID() { - return operationID; - } -} diff --git a/dependencies/main/java/codechicken/lib/render/state/GlStateManagerHelper.java b/dependencies/main/java/codechicken/lib/render/state/GlStateManagerHelper.java deleted file mode 100644 index 650cc45a5a..0000000000 --- a/dependencies/main/java/codechicken/lib/render/state/GlStateManagerHelper.java +++ /dev/null @@ -1,356 +0,0 @@ -package codechicken.lib.render.state; - -import com.google.common.base.Objects; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.GlStateManager.*; - -import java.util.ArrayList; -import java.util.LinkedList; - -/** - * Created by covers1624 on 10/10/2016. - * Dumps specific GL states from GlStateManager - * Ability to push and pop most of the GL state. - * TODO Ability to auto compare between different saved states. So basically a GlLeak analyser. - * TODO Support both Raw GL and GLStateManager, would be useful for detecting GLLeaks that occur due to raw GL calls. - * TODO Support all the things. - */ -public class GlStateManagerHelper { - - public static enum State { - GL_ALPHA_TEST { - @Override - public String getState() { - AlphaState alphaState = GlStateManager.alphaState; - return Objects.toStringHelper(name()).add("Func", alphaState.func).add("Ref", alphaState.ref).add("Enabled", String.valueOf(alphaState.alphaTest.currentState).toUpperCase()).toString(); - } - - @Override - public void pushState(SavedState state) { - state.alphaTest = GlStateManager.alphaState.alphaTest.currentState; - state.alphaFunc = GlStateManager.alphaState.func; - state.alphaRef = GlStateManager.alphaState.ref; - } - - @Override - public void popState(SavedState pre, SavedState post) { - if (pre.alphaTest) { - GlStateManager.enableAlpha(); - } else { - GlStateManager.disableAlpha(); - } - GlStateManager.alphaFunc(pre.alphaFunc, pre.alphaRef); - } - }, - GL_LIGHTING { - @Override - public String getState() { - return Objects.toStringHelper(name()).add("Enabled", parseBoolState(GlStateManager.lightingState)).toString(); - } - - @Override - public void pushState(SavedState state) { - state.lighting = GlStateManager.lightingState.currentState; - } - - @Override - public void popState(SavedState pre, SavedState post) { - if (pre.lighting) { - GlStateManager.enableLighting(); - } else { - GlStateManager.disableLighting(); - } - } - }, - GL_BLEND { - @Override - public String getState() { - BlendState blendState = GlStateManager.blendState; - //@formatter:off - return Objects.toStringHelper(name()) - .add("SrcFactor", parseFactor(blendState.srcFactor)) .add("DstFactor", parseFactor(blendState.dstFactor)) - .add("SrcFactorAlpha", parseFactor(blendState.srcFactorAlpha)).add("DstFactorAlpha", parseFactor(blendState.dstFactorAlpha)) - .add("Enabled", parseBoolState(blendState.blend)).toString(); - //@formatter:on - } - - @Override - public void pushState(SavedState state) { - state.blend = GlStateManager.blendState.blend.currentState; - state.blendSrcFactor = GlStateManager.blendState.srcFactor; - state.blendDstFactor = GlStateManager.blendState.dstFactor; - state.blendSrcFactorAlpha = GlStateManager.blendState.srcFactorAlpha; - state.blendDstFactorAlpha = GlStateManager.blendState.dstFactorAlpha; - } - - @Override - public void popState(SavedState pre, SavedState post) { - if (pre.blend) { - GlStateManager.enableBlend(); - } else { - GlStateManager.disableBlend(); - } - if (pre.blendSrcFactorAlpha != post.blendSrcFactorAlpha || pre.blendDstFactorAlpha != post.blendDstFactorAlpha) { - GlStateManager.tryBlendFuncSeparate(pre.blendSrcFactor, pre.blendDstFactor, pre.blendSrcFactorAlpha, pre.blendDstFactorAlpha); - } else { - GlStateManager.blendFunc(pre.blendSrcFactor, post.blendDstFactor); - } - } - - private String parseFactor(int factor) { - switch (factor) { - case 32771: - return "CONSTANT_ALPHA"; - case 32769: - return "CONSTANT_COLOR"; - case 772: - return "DST_ALPHA"; - case 774: - return "DST_COLOR"; - case 1: - return "ONE"; - case 32772: - return "ONE_MINUS_CONSTANT_ALPHA"; - case 32770: - return "ONE_MINUS_CONSTANT_COLOR"; - case 773: - return "ONE_MINUS_DST_ALPHA"; - case 775: - return "ONE_MINUS_DST_COLOR"; - case 771: - return "ONE_MINUS_SRC_ALPHA"; - case 769: - return "ONE_MINUS_SRC_COLOR"; - case 770: - return "SRC_ALPHA"; - case 776: - return "SRC_ALPHA_SATURATE"; - case 768: - return "SRC_COLOR"; - case 0: - return "ZERO"; - default: - return "UNKNOWN:" + factor; - - } - } - - }, - GL_DEPTH_TEST { - @Override - public String getState() { - DepthState depthState = GlStateManager.depthState; - return Objects.toStringHelper(name()).add("Func", parseFunc(depthState.depthFunc)).add("Mask", String.valueOf(depthState.maskEnabled).toUpperCase()).add("Enabled", parseBoolState(depthState.depthTest)).toString(); - } - - @Override - public void pushState(SavedState state) { - state.depthTest = GlStateManager.depthState.depthTest.currentState; - state.depthMaskEnabled = GlStateManager.depthState.maskEnabled; - state.depthFunc = GlStateManager.depthState.depthFunc; - } - - @Override - public void popState(SavedState pre, SavedState post) { - if (pre.depthTest) { - GlStateManager.enableDepth(); - } else { - GlStateManager.disableDepth(); - } - GlStateManager.depthMask(pre.depthMaskEnabled); - GlStateManager.depthFunc(pre.depthFunc); - } - - private String parseFunc(int func) { - switch (func) { - case 0x200: - return "GL_NEVER"; - case 0x201: - return "GL_LESS"; - case 0x202: - return "GL_EQUAL"; - case 0x203: - return "GL_LEQUAL"; - case 0x204: - return "GL_GREATER"; - case 0x205: - return "GL_NOTEQUAL"; - case 0x206: - return "GL_GEQUAL"; - case 0x207: - return "GL_ALWAYS"; - default: - return "UNKNOWN:" + func; - - } - } - }, - GL_CULL_FACE { - @Override - public String getState() { - CullState cullState = GlStateManager.cullState; - return Objects.toStringHelper(name()).add("Mode", parseMode(cullState.mode)).add("Enabled", parseBoolState(cullState.cullFace)).toString(); - } - - @Override - public void pushState(SavedState state) { - state.cull = GlStateManager.cullState.cullFace.currentState; - state.cullMode = GlStateManager.cullState.mode; - } - - @Override - public void popState(SavedState pre, SavedState post) { - - if (pre.cull) { - GlStateManager.enableCull(); - } else { - GlStateManager.disableCull(); - } - GlStateManager.cullFace(pre.cullMode); - } - - private String parseMode(int mode) { - switch (mode) { - case 1028: - return "FRONT"; - case 1029: - return "BACK"; - case 1032: - return "FRONT_AND_BACK"; - default: - return "UNKNOWN:" + mode; - - } - } - - }, - GL_RESCALE_NORMAL { - @Override - public String getState() { - return Objects.toStringHelper(name()).add("Enabled", parseBoolState(GlStateManager.rescaleNormalState)).toString(); - } - - @Override - public void pushState(SavedState state) { - state.rescaleNormal = GlStateManager.rescaleNormalState.currentState; - } - - @Override - public void popState(SavedState pre, SavedState post) { - if (pre.rescaleNormal) { - GlStateManager.enableRescaleNormal(); - } else { - GlStateManager.disableRescaleNormal(); - } - } - - }; - - public abstract String getState(); - - public abstract void pushState(SavedState state); - - public abstract void popState(SavedState pre, SavedState post); - } - - public static class SavedState { - - private ArrayList savedStates = new ArrayList(); - - boolean alphaTest; - int alphaFunc; - float alphaRef; - - boolean lighting; - - boolean blend; - int blendSrcFactor; - int blendDstFactor; - int blendSrcFactorAlpha; - int blendDstFactorAlpha; - - boolean depthTest; - boolean depthMaskEnabled; - int depthFunc; - - boolean cull; - int cullMode; - - boolean rescaleNormal; - - private SavedState() { - } - - private static SavedState createSavedState(SavedState state) { - return createSavedState(state.savedStates.toArray(new State[state.savedStates.size()])); - } - - private static SavedState createSavedState(State... states) { - SavedState saveState = new SavedState(); - for (State state : states) { - state.pushState(saveState); - saveState.savedStates.add(state); - } - return saveState; - } - - private static void applyState(SavedState pre, SavedState post) { - for (State state : pre.savedStates) { - state.popState(pre, post); - } - } - - } - - private static final LinkedList savedStates = new LinkedList(); - - private static String parseBoolState(BooleanState boolState) { - return String.valueOf(boolState.currentState).toUpperCase(); - } - - public static String dumpGLState(State... states) { - StringBuilder builder = new StringBuilder(); - builder.append("GlStateManager { "); - for (int i = 0; i < states.length; i++) { - State state = states[i]; - builder.append(state.getState()); - if (i != states.length - 1) { - builder.append(", "); - } - } - - builder.append(" }"); - return builder.toString(); - } - - public static void pushState() { - SavedState state = SavedState.createSavedState(State.values()); - savedStates.addLast(state); - } - - public static void pushStates(State... states) { - if (states == null || states.length == 0) { - states = State.values(); - } - SavedState state = SavedState.createSavedState(states); - savedStates.addLast(state); - } - - public static void pushState(State[] states) { - if (states == null || states.length == 0) { - states = State.values(); - } - SavedState state = SavedState.createSavedState(states); - savedStates.addLast(state); - } - - public static void popState() { - if (savedStates.isEmpty()) { - throw new IllegalStateException("Unable to pop the GL state as there is no saved state!"); - } - SavedState pre = savedStates.removeLast(); - SavedState post = SavedState.createSavedState(pre); - SavedState.applyState(pre, post); - } - -} diff --git a/dependencies/main/java/codechicken/lib/texture/CustomIResource.java b/dependencies/main/java/codechicken/lib/texture/CustomIResource.java deleted file mode 100644 index fc715d0f7b..0000000000 --- a/dependencies/main/java/codechicken/lib/texture/CustomIResource.java +++ /dev/null @@ -1,69 +0,0 @@ -package codechicken.lib.texture; - -import net.minecraft.client.resources.IResource; -import net.minecraft.client.resources.data.IMetadataSection; -import net.minecraft.util.ResourceLocation; - -import javax.annotation.Nullable; -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * Created by covers1624 on 2/11/2016. - * TODO Document. - */ -public class CustomIResource implements IResource { - - private ResourceLocation location; - private InputStream stream; - private IResource wrapped; - - public CustomIResource(ResourceLocation location, BufferedImage image, IResource wrapped) { - try { - this.location = location; - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ImageIO.write(image, "png", baos); - stream = new ByteArrayInputStream(baos.toByteArray()); - this.wrapped = wrapped; - - } catch (Exception e) { - throw new RuntimeException("Unable to create CustomIResource", e); - } - } - - @Override - public ResourceLocation getResourceLocation() { - return location; - } - - @Override - public InputStream getInputStream() { - return stream; - } - - @Override - public boolean hasMetadata() { - return wrapped.hasMetadata(); - } - - @Nullable - @Override - public T getMetadata(String sectionName) { - return wrapped.getMetadata(sectionName); - } - - @Override - public String getResourcePackName() { - return wrapped.getResourcePackName(); - } - - @Override - public void close() throws IOException { - wrapped.close(); - stream.close(); - } -} diff --git a/dependencies/main/java/codechicken/lib/texture/IItemBlockTextureProvider.java b/dependencies/main/java/codechicken/lib/texture/IItemBlockTextureProvider.java deleted file mode 100644 index 1cc0f075ab..0000000000 --- a/dependencies/main/java/codechicken/lib/texture/IItemBlockTextureProvider.java +++ /dev/null @@ -1,15 +0,0 @@ -package codechicken.lib.texture; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; - -/** - * Created by covers1624 on 30/10/2016. - * TODO Document. - */ -public interface IItemBlockTextureProvider { - - TextureAtlasSprite getTexture(EnumFacing side, ItemStack stack); - -} diff --git a/dependencies/main/java/codechicken/lib/texture/IWorldBlockTextureProvider.java b/dependencies/main/java/codechicken/lib/texture/IWorldBlockTextureProvider.java deleted file mode 100644 index 913b12141d..0000000000 --- a/dependencies/main/java/codechicken/lib/texture/IWorldBlockTextureProvider.java +++ /dev/null @@ -1,27 +0,0 @@ -package codechicken.lib.texture; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; - -/** - * Created by covers1624 on 25/11/2016. - */ -public interface IWorldBlockTextureProvider extends IItemBlockTextureProvider { - - /** - * Gets the texture for the given face of an in world block. - * - * @param side The side to get the texture for. - * @param state The state of the block. - * @param layer The layer needed. - * @param world The world the block is in. - * @param pos The position of the block. - * @return The texture, null if there is no texture for the arguments, {@link TextureUtils#getMissingSprite()} if the arguments are invalid. - */ - TextureAtlasSprite getTexture(EnumFacing side, IBlockState state, BlockRenderLayer layer, IBlockAccess world, BlockPos pos); - -} diff --git a/dependencies/main/java/codechicken/lib/texture/ManagedTextureFX.java b/dependencies/main/java/codechicken/lib/texture/ManagedTextureFX.java deleted file mode 100644 index 19ecc73440..0000000000 --- a/dependencies/main/java/codechicken/lib/texture/ManagedTextureFX.java +++ /dev/null @@ -1,27 +0,0 @@ -package codechicken.lib.texture; - -public class ManagedTextureFX extends TextureFX { - - public boolean changed; - - public ManagedTextureFX(int size, String name) { - super(size, name); - imageData = new int[size * size]; - } - - @Override - public void setup() { - } - - public void setData(int[] data) { - System.arraycopy(data, 0, imageData, 0, imageData.length); - changed = true; - } - - @Override - public boolean changed() { - boolean r = changed; - changed = false; - return r; - } -} diff --git a/dependencies/main/java/codechicken/lib/texture/PlaceholderTexture.java b/dependencies/main/java/codechicken/lib/texture/PlaceholderTexture.java deleted file mode 100644 index 84afd5ab75..0000000000 --- a/dependencies/main/java/codechicken/lib/texture/PlaceholderTexture.java +++ /dev/null @@ -1,22 +0,0 @@ -package codechicken.lib.texture; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.resources.IResourceManager; -import net.minecraft.util.ResourceLocation; - -public class PlaceholderTexture extends TextureAtlasSprite { - - protected PlaceholderTexture(String par1) { - super(par1); - } - - @Override - public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location) { - return true; - } - - @Override - public boolean load(IResourceManager manager, ResourceLocation location) { - return true; - } -} diff --git a/dependencies/main/java/codechicken/lib/texture/SpriteSheetManager.java b/dependencies/main/java/codechicken/lib/texture/SpriteSheetManager.java deleted file mode 100644 index 49839fcd95..0000000000 --- a/dependencies/main/java/codechicken/lib/texture/SpriteSheetManager.java +++ /dev/null @@ -1,121 +0,0 @@ -package codechicken.lib.texture; - -import codechicken.lib.texture.TextureUtils.IIconRegister; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.ArrayList; -import java.util.HashMap; - -public class SpriteSheetManager { - - @SideOnly (Side.CLIENT) - public static class SpriteSheet implements IIconRegister { - - private int tilesX; - private int tilesY; - private ArrayList newSprites = new ArrayList(); - private TextureSpecial[] sprites; - private ResourceLocation resource; - private TextureDataHolder texture; - private int spriteWidth; - private int spriteHeight; - - public int atlasIndex; - - private SpriteSheet(int tilesX, int tilesY, ResourceLocation textureFile) { - this.tilesX = tilesX; - this.tilesY = tilesY; - this.resource = textureFile; - sprites = new TextureSpecial[tilesX * tilesY]; - } - - public void requestIndicies(int... indicies) { - for (int i : indicies) { - setupSprite(i); - } - } - - @Override - public void registerIcons(TextureMap textureMap) { - if (TextureUtils.refreshTexture(textureMap, resource.getResourcePath())) { - reloadTexture(); - for (TextureSpecial sprite : sprites) { - if (sprite != null) { - textureMap.setTextureEntry(sprite.getIconName(), sprite); - } - } - } else { - for (int i : newSprites) { - textureMap.setTextureEntry(sprites[i].getIconName(), sprites[i]); - } - } - newSprites.clear(); - } - - public TextureSpecial setupSprite(int i) { - if (sprites[i] == null) { - String name = resource + "_" + i; - sprites[i] = new TextureSpecial(name).baseFromSheet(this, i); - newSprites.add(i); - } - return sprites[i]; - } - - private void reloadTexture() { - texture = TextureUtils.loadTexture(resource); - spriteWidth = texture.width / tilesX; - spriteHeight = texture.height / tilesY; - } - - public TextureAtlasSprite getSprite(int index) { - TextureAtlasSprite i = sprites[index]; - if (i == null) { - throw new IllegalArgumentException("Sprite at index: " + index + " from texture file " + resource + " was not preloaded."); - } - return i; - } - - public TextureDataHolder createSprite(int spriteIndex) { - int sx = spriteIndex % tilesX; - int sy = spriteIndex / tilesX; - TextureDataHolder sprite = new TextureDataHolder(spriteWidth, spriteHeight); - TextureUtils.copySubImg(texture.data, texture.width, sx * spriteWidth, sy * spriteHeight, spriteWidth, spriteHeight, sprite.data, spriteWidth, 0, 0); - return sprite; - } - - public int spriteWidth() { - return spriteWidth; - } - - public int spriteHeight() { - return spriteHeight; - } - - public TextureSpecial bindTextureFX(int i, TextureFX textureFX) { - return setupSprite(i).addTextureFX(textureFX); - } - - public SpriteSheet selfRegister(int atlas) { - TextureUtils.addIconRegister(this); - return this; - } - } - - private static HashMap spriteSheets = new HashMap(); - - public static SpriteSheet getSheet(ResourceLocation resource) { - return getSheet(16, 16, resource); - } - - public static SpriteSheet getSheet(int tilesX, int tilesY, ResourceLocation resource) { - SpriteSheet sheet = spriteSheets.get(resource.toString()); - if (sheet == null) { - spriteSheets.put(resource.toString(), sheet = new SpriteSheet(tilesX, tilesY, resource)); - } - return sheet; - } -} diff --git a/dependencies/main/java/codechicken/lib/texture/TextureDataHolder.java b/dependencies/main/java/codechicken/lib/texture/TextureDataHolder.java deleted file mode 100644 index e411308440..0000000000 --- a/dependencies/main/java/codechicken/lib/texture/TextureDataHolder.java +++ /dev/null @@ -1,34 +0,0 @@ -package codechicken.lib.texture; - -import java.awt.image.BufferedImage; - -public class TextureDataHolder { - - public int width; - public int height; - public int[] data; - - public TextureDataHolder(int width, int height) { - this.width = width; - this.height = height; - data = new int[width * height]; - } - - public TextureDataHolder(int[] data, int width) { - this.data = data; - this.width = width; - height = data.length / width; - } - - public TextureDataHolder(BufferedImage img) { - this(img.getWidth(), img.getHeight()); - img.getRGB(0, 0, width, height, data, 0, width); - } - - public TextureDataHolder copyData() { - int[] copy = new int[data.length]; - System.arraycopy(data, 0, copy, 0, data.length); - data = copy; - return this; - } -} diff --git a/dependencies/main/java/codechicken/lib/texture/TextureFX.java b/dependencies/main/java/codechicken/lib/texture/TextureFX.java deleted file mode 100644 index 4ca8147509..0000000000 --- a/dependencies/main/java/codechicken/lib/texture/TextureFX.java +++ /dev/null @@ -1,60 +0,0 @@ -package codechicken.lib.texture; - -import codechicken.lib.texture.SpriteSheetManager.SpriteSheet; -import net.minecraft.client.Minecraft; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -@SideOnly (Side.CLIENT) -public class TextureFX { - - public int[] imageData; - public int tileSizeBase = 16; - public int tileSizeSquare = 256; - public int tileSizeMask = 15; - public int tileSizeSquareMask = 255; - - public boolean anaglyphEnabled; - public TextureSpecial texture; - - public TextureFX(int spriteIndex, SpriteSheet sheet) { - texture = sheet.bindTextureFX(spriteIndex, this); - } - - public TextureFX(int size, String name) { - texture = new TextureSpecial(name).blank(size).selfRegister().addTextureFX(this); - } - - public TextureFX setAtlas(int index) { - texture.atlasIndex = index; - return this; - } - - public void setup() { - imageData = new int[tileSizeSquare]; - } - - public void onTextureDimensionsUpdate(int width, int height) { - if (width != height) { - throw new IllegalArgumentException("Non-Square textureFX not supported (" + width + ":" + height + ")"); - } - - tileSizeBase = width; - tileSizeSquare = tileSizeBase * tileSizeBase; - tileSizeMask = tileSizeBase - 1; - tileSizeSquareMask = tileSizeSquare - 1; - setup(); - } - - public void update() { - anaglyphEnabled = Minecraft.getMinecraft().gameSettings.anaglyph; - onTick(); - } - - public void onTick() { - } - - public boolean changed() { - return true; - } -} diff --git a/dependencies/main/java/codechicken/lib/texture/TextureSpecial.java b/dependencies/main/java/codechicken/lib/texture/TextureSpecial.java deleted file mode 100644 index c0b8781209..0000000000 --- a/dependencies/main/java/codechicken/lib/texture/TextureSpecial.java +++ /dev/null @@ -1,170 +0,0 @@ -package codechicken.lib.texture; - -import codechicken.lib.texture.SpriteSheetManager.SpriteSheet; -import codechicken.lib.texture.TextureUtils.IIconRegister; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.PngSizeInfo; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.texture.TextureUtil; -import net.minecraft.client.resources.IResourceManager; -import net.minecraft.client.settings.GameSettings; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.util.ArrayList; - -@SideOnly (Side.CLIENT) -public class TextureSpecial extends TextureAtlasSprite implements IIconRegister { - - //sprite sheet fields - private int spriteIndex; - private SpriteSheet spriteSheet; - - //textureFX fields - private TextureFX textureFX; - private int mipmapLevels; - private int rawWidth; - private int rawHeight; - - private int blankSize = -1; - private ArrayList baseTextures; - - private boolean selfRegister; - public int atlasIndex; - - protected TextureSpecial(String par1) { - super(par1); - } - - public TextureSpecial addTexture(TextureDataHolder t) { - if (baseTextures == null) { - baseTextures = new ArrayList(); - } - baseTextures.add(t); - return this; - } - - public TextureSpecial baseFromSheet(SpriteSheet spriteSheet, int spriteIndex) { - this.spriteSheet = spriteSheet; - this.spriteIndex = spriteIndex; - return this; - } - - public TextureSpecial addTextureFX(TextureFX fx) { - textureFX = fx; - return this; - } - - @Override - public void initSprite(int sheetWidth, int sheetHeight, int originX, int originY, boolean rotated) { - super.initSprite(sheetWidth, sheetHeight, originX, originY, rotated); - if (textureFX != null) { - textureFX.onTextureDimensionsUpdate(width, height); - } - } - - @Override - public void updateAnimation() { - if (textureFX != null) { - textureFX.update(); - if (textureFX.changed()) { - int[][] mipmaps = new int[mipmapLevels + 1][]; - mipmaps[0] = textureFX.imageData; - mipmaps = TextureUtil.generateMipmapData(mipmapLevels, width, mipmaps); - TextureUtil.uploadTextureMipmap(mipmaps, width, height, originX, originY, false, false); - } - } - } - - @Override - public void loadSprite(PngSizeInfo sizeInfo, boolean animationMeta) { - rawWidth = sizeInfo.pngWidth; - rawHeight = sizeInfo.pngHeight; - try { - super.loadSprite(sizeInfo, false); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - @Override - public void generateMipmaps(int p_147963_1_) { - super.generateMipmaps(p_147963_1_); - mipmapLevels = p_147963_1_; - } - - @Override - public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location) { - return true; - } - - public void addFrame(int[] data, int width, int height) { - GameSettings settings = Minecraft.getMinecraft().gameSettings; - BufferedImage[] images = new BufferedImage[settings.mipmapLevels + 1]; - images[0] = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); - images[0].setRGB(0, 0, width, height, data, 0, width); - - //Workaround for mojang's change to TextureAtlasSprite loading. - resetSprite(); - this.width = images[0].getWidth(); - this.height = images[0].getHeight(); - int[][] aInt = new int[settings.mipmapLevels + 1][]; - aInt[0] = new int[images[0].getWidth() * images[0].getHeight()]; - images[0].getRGB(0, 0, images[0].getWidth(), images[0].getHeight(), aInt[0], 0, images[0].getWidth()); - framesTextureData.add(aInt); - } - - @Override - public boolean load(IResourceManager manager, ResourceLocation location) { - if (baseTextures != null) { - for (TextureDataHolder tex : baseTextures) { - addFrame(tex.data, tex.width, tex.height); - } - } else if (spriteSheet != null) { - TextureDataHolder tex = spriteSheet.createSprite(spriteIndex); - addFrame(tex.data, tex.width, tex.height); - } else if (blankSize > 0) { - addFrame(new int[blankSize * blankSize], blankSize, blankSize); - } - - if (framesTextureData.isEmpty()) { - throw new RuntimeException("No base frame for texture: " + getIconName()); - } - - return false; - } - - @Override - public boolean hasAnimationMetadata() { - return textureFX != null || super.hasAnimationMetadata(); - } - - @Override - public int getFrameCount() { - if (textureFX != null) { - return 1; - } - - return super.getFrameCount(); - } - - public TextureSpecial blank(int size) { - blankSize = size; - return this; - } - - public TextureSpecial selfRegister() { - selfRegister = true; - TextureUtils.addIconRegister(this); - return this; - } - - @Override - public void registerIcons(TextureMap textureMap) { - textureMap.setTextureEntry(getIconName(), this); - } -} diff --git a/dependencies/main/java/codechicken/lib/texture/TextureUtils.java b/dependencies/main/java/codechicken/lib/texture/TextureUtils.java deleted file mode 100644 index ac62db079a..0000000000 --- a/dependencies/main/java/codechicken/lib/texture/TextureUtils.java +++ /dev/null @@ -1,311 +0,0 @@ -package codechicken.lib.texture; - -import codechicken.lib.colour.Colour; -import codechicken.lib.colour.ColourARGB; -import com.google.common.base.Function; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.resources.IReloadableResourceManager; -import net.minecraft.client.resources.IResource; -import net.minecraft.client.resources.IResourceManagerReloadListener; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -public class TextureUtils { - - //TODO, Move this somewhere else. - public interface IIconRegister { - - @SideOnly (Side.CLIENT) - void registerIcons(TextureMap textureMap); - } - - static { - MinecraftForge.EVENT_BUS.register(new TextureUtils()); - } - - private static ArrayList iconRegisters = new ArrayList(); - - public static Function bakedTextureGetter = new Function() { - @Override - public TextureAtlasSprite apply(ResourceLocation input) { - return getTexture(input); - } - }; - - //TODO Rename this. - public static void addIconRegister(IIconRegister registrar) { - iconRegisters.add(registrar); - } - - public static void registerReloadListener(IResourceManagerReloadListener reloadListener) { - //If this crashes people need to stop using reflection.. - getResourceManager().registerReloadListener(reloadListener); - } - - @SubscribeEvent - public void textureLoad(TextureStitchEvent.Pre event) { - for (IIconRegister reg : iconRegisters) { - reg.registerIcons(event.getMap()); - } - } - - /** - * @return an array of ARGB pixel data - */ - public static int[] loadTextureData(ResourceLocation resource) { - return loadTexture(resource).data; - } - - public static Colour[] loadTextureColours(ResourceLocation resource) { - int[] idata = loadTextureData(resource); - Colour[] data = new Colour[idata.length]; - for (int i = 0; i < data.length; i++) { - data[i] = new ColourARGB(idata[i]); - } - return data; - } - - //TODO Move to some sort of IO Utils. - public static InputStream getTextureResource(ResourceLocation textureFile) throws IOException { - return Minecraft.getMinecraft().getResourceManager().getResource(textureFile).getInputStream(); - } - - public static BufferedImage loadBufferedImage(ResourceLocation textureFile) { - try { - return loadBufferedImage(getTextureResource(textureFile)); - } catch (Exception e) { - System.err.println("Failed to load texture file: " + textureFile); - e.printStackTrace(); - } - return null; - } - - public static BufferedImage loadBufferedImage(InputStream in) throws IOException { - BufferedImage img = ImageIO.read(in); - in.close(); - return img; - } - - public static void copySubImg(int[] fromTex, int fromWidth, int fromX, int fromY, int width, int height, int[] toTex, int toWidth, int toX, int toY) { - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - int fp = (y + fromY) * fromWidth + x + fromX; - int tp = (y + toX) * toWidth + x + toX; - - toTex[tp] = fromTex[fp]; - } - } - } - - public static TextureAtlasSprite getBlankIcon(int size, TextureMap textureMap) { - String s = "blank_" + size; - TextureAtlasSprite icon = textureMap.getTextureExtry(s); - if (icon == null) { - textureMap.setTextureEntry(s, icon = new TextureSpecial(s).blank(size)); - } - - return icon; - } - - public static TextureSpecial getTextureSpecial(TextureMap textureMap, String name) { - if (textureMap.getTextureExtry(name) != null) { - throw new IllegalStateException("Texture: " + name + " is already registered"); - } - - TextureSpecial icon = new TextureSpecial(name); - textureMap.setTextureEntry(name, icon); - return icon; - } - - public static void prepareTexture(int target, int texture, int min_mag_filter, int wrap) { - GlStateManager.glTexParameteri(target, GL11.GL_TEXTURE_MIN_FILTER, min_mag_filter); - GlStateManager.glTexParameteri(target, GL11.GL_TEXTURE_MAG_FILTER, min_mag_filter); - if (target == GL11.GL_TEXTURE_2D) { - GlStateManager.bindTexture(target); - } else { - GL11.glBindTexture(target, texture); - } - - switch (target) { - case GL12.GL_TEXTURE_3D: - GlStateManager.glTexParameteri(target, GL12.GL_TEXTURE_WRAP_R, wrap); - case GL11.GL_TEXTURE_2D: - GlStateManager.glTexParameteri(target, GL11.GL_TEXTURE_WRAP_T, wrap); - case GL11.GL_TEXTURE_1D: - GlStateManager.glTexParameteri(target, GL11.GL_TEXTURE_WRAP_S, wrap); - } - } - - public static TextureDataHolder loadTexture(ResourceLocation resource) { - BufferedImage img = loadBufferedImage(resource); - if (img == null) { - throw new RuntimeException("Texture not found: " + resource); - } - return new TextureDataHolder(img); - } - - /** - * Uses an empty placeholder texture to tell if the map has been reloaded since the last call to refresh texture and the texture with name needs to be reacquired to be valid - */ - public static boolean refreshTexture(TextureMap map, String name) { - if (map.getTextureExtry(name) == null) { - map.setTextureEntry(name, new PlaceholderTexture(name)); - return true; - } - return false; - } - - /*public static IIcon safeIcon(IIcon icon) { - if (icon == null) - icon = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); - - return icon; - }*/ - - public static TextureManager getTextureManager() { - return Minecraft.getMinecraft().renderEngine; - } - - public static TextureMap getTextureMap() { - return Minecraft.getMinecraft().getTextureMapBlocks(); - } - - public static IReloadableResourceManager getResourceManager() { - return (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager(); - } - - public static TextureAtlasSprite getMissingSprite() { - return getTextureMap().getMissingSprite(); - } - - public static TextureAtlasSprite getTexture(String location) { - return getTextureMap().getAtlasSprite(location); - } - - public static TextureAtlasSprite getTexture(ResourceLocation location) { - return getTexture(location.toString()); - } - - public static TextureAtlasSprite getBlockTexture(String string) { - return getBlockTexture(new ResourceLocation(string)); - } - - public static TextureAtlasSprite getBlockTexture(ResourceLocation location) { - return getTexture(new ResourceLocation(location.getResourceDomain(), "blocks/" + location.getResourcePath())); - } - - public static TextureAtlasSprite getItemTexture(String string) { - return getItemTexture(new ResourceLocation(string)); - } - - public static TextureAtlasSprite getItemTexture(ResourceLocation location) { - return getTexture(new ResourceLocation(location.getResourceDomain(), "items/" + location.getResourcePath())); - } - - public static IResource getResource(String location) throws IOException { - return getResource(new ResourceLocation(location)); - } - - public static IResource getResource(ResourceLocation location) throws IOException { - return getResourceManager().getResource(location); - } - - public static void changeTexture(String texture) { - changeTexture(new ResourceLocation(texture)); - } - - public static void changeTexture(ResourceLocation texture) { - getTextureManager().bindTexture(texture); - } - - public static void disableMipmap(String texture) { - disableMipmap(new ResourceLocation(texture)); - } - - public static void disableMipmap(ResourceLocation texture) { - getTextureManager().getTexture(texture).setBlurMipmap(false, false); - } - - public static void restoreLastMipmap(String texture) { - restoreLastMipmap(new ResourceLocation(texture)); - } - - public static void restoreLastMipmap(ResourceLocation location) { - getTextureManager().getTexture(location).restoreLastBlurMipmap(); - } - - public static void bindBlockTexture() { - changeTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - } - - public static void dissableBlockMipmap() { - disableMipmap(TextureMap.LOCATION_BLOCKS_TEXTURE); - } - - public static void restoreBlockMipmap() { - restoreLastMipmap(TextureMap.LOCATION_BLOCKS_TEXTURE); - } - - public static TextureAtlasSprite[] getSideIconsForBlock(IBlockState state) { - TextureAtlasSprite[] sideSprites = new TextureAtlasSprite[6]; - TextureAtlasSprite missingSprite = getMissingSprite(); - for (int i = 0; i < 6; i++) { - TextureAtlasSprite[] sprites = getIconsForBlock(state, i); - TextureAtlasSprite sideSprite = missingSprite; - if (sprites.length != 0) { - sideSprite = sprites[0]; - } - sideSprites[i] = sideSprite; - } - return sideSprites; - } - - public static TextureAtlasSprite[] getIconsForBlock(IBlockState state, int side) { - return getIconsForBlock(state, EnumFacing.values()[side]); - } - - public static TextureAtlasSprite[] getIconsForBlock(IBlockState state, EnumFacing side) { - IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(state); - if (model != null) { - List quads = model.getQuads(state, side, 0); - if (quads != null && quads.size() > 0) { - TextureAtlasSprite[] sprites = new TextureAtlasSprite[quads.size()]; - for (int i = 0; i < quads.size(); i++) { - sprites[i] = quads.get(i).getSprite(); - } - return sprites; - } - } - return new TextureAtlasSprite[0]; - } - - public static TextureAtlasSprite getParticleIconForBlock(IBlockState state) { - IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(state); - if (model != null) { - return model.getParticleTexture(); - } - return null; - } - -} diff --git a/dependencies/main/java/codechicken/lib/thread/ProfileTimer.java b/dependencies/main/java/codechicken/lib/thread/ProfileTimer.java deleted file mode 100644 index 50990198df..0000000000 --- a/dependencies/main/java/codechicken/lib/thread/ProfileTimer.java +++ /dev/null @@ -1,40 +0,0 @@ -package codechicken.lib.thread; - -public class ProfileTimer { - - public double decay; - public long startTime; - public long nanoTime; - public int scanCount; - public int logScans; - public String logName; - - public ProfileTimer() { - this(0.98); - } - - public ProfileTimer(double decay) { - this.decay = decay; - } - - public ProfileTimer log(String logName, int scans) { - this.logScans = scans; - this.logName = logName; - return this; - } - - public void start() { - startTime = System.nanoTime(); - } - - public void end() { - long t = System.nanoTime() - startTime; - nanoTime = (long) (nanoTime * decay + t * (1 - decay)); - - scanCount++; - if (logScans > 0 && scanCount % logScans == 0) { - System.out.println("Profiled " + logName + " " + nanoTime + "ns"); - } - - } -} diff --git a/dependencies/main/java/codechicken/lib/thread/ReentrantCheck.java b/dependencies/main/java/codechicken/lib/thread/ReentrantCheck.java deleted file mode 100644 index d23e4cd0b2..0000000000 --- a/dependencies/main/java/codechicken/lib/thread/ReentrantCheck.java +++ /dev/null @@ -1,31 +0,0 @@ -package codechicken.lib.thread; - -public class ReentrantCheck { - - private boolean entered; - - public ReentrantCheck() { - entered = false; - } - - public boolean entered() { - return entered; - } - - public void enter() { - entered = true; - } - - public void exit() { - entered = false; - } - - public static ThreadLocal threadLocal() { - return new ThreadLocal() { - @Override - protected ReentrantCheck initialValue() { - return new ReentrantCheck(); - } - }; - } -} diff --git a/dependencies/main/java/codechicken/lib/thread/RestartableTask.java b/dependencies/main/java/codechicken/lib/thread/RestartableTask.java deleted file mode 100644 index 54562b890a..0000000000 --- a/dependencies/main/java/codechicken/lib/thread/RestartableTask.java +++ /dev/null @@ -1,103 +0,0 @@ -package codechicken.lib.thread; - -/** - * Provides an abstract way to have a task run and restart if needed whilst still operating. - * It is recommended to implement - */ -public abstract class RestartableTask { - - public final String name; - private Thread thread; - private volatile boolean restart; - private volatile boolean stopped; - - private ThreadOperationTimer timer; - - public RestartableTask(String name) { - this.name = name; - } - - private void start() { - thread = new Thread(name) { - @Override - public void run() { - do { - while (stopped) { - try { - Thread.sleep(1); - } catch (InterruptedException ignored) { - } - } - if (!restart) { - execute(); - } - } while (!finish()); - } - }; - thread.start(); - } - - private synchronized boolean finish() { - if (restart) { - restart = false; - return false; - } else { - clearTasks(); - return true; - } - } - - /** - * Clears the current task. - * Not recommended to be called directly. - */ - public void clearTasks() { - thread = null; - timer = null; - } - - /** - * Marks the Task to be restarted. - * You may call this to start the process too. - */ - public synchronized void restart() { - if (thread != null) { - stopped = false; - restart = true; - } else { - start(); - } - } - - /** - * Stops execution until restart is called. If a thread is running, the restart flag will be set, and the thread will be paused once the execute method exits. - */ - public synchronized void stop() { - if (thread != null) { - stopped = true; - restart = true; - } - } - - /** - * This must be implemented in your execute method, if this returns true it means you need to get your operation in to a restartable state and prepare for a restart. - * - * @return True if the process should end. - */ - public boolean interrupted() { - return restart; - } - - public synchronized ThreadOperationTimer getTimer(int timeout) { - if (timer == null) { - timer = ThreadOperationTimer.start(thread, timeout); - } - return timer; - } - - /** - * Main call point for the RestartableTask, this is where you will put your logic to be called. - * Make sure you implement some sort of bail out system if interrupted() is true. - */ - public abstract void execute(); -} diff --git a/dependencies/main/java/codechicken/lib/thread/TaskProfiler.java b/dependencies/main/java/codechicken/lib/thread/TaskProfiler.java deleted file mode 100644 index 42522e826f..0000000000 --- a/dependencies/main/java/codechicken/lib/thread/TaskProfiler.java +++ /dev/null @@ -1,78 +0,0 @@ -package codechicken.lib.thread; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -public class TaskProfiler { - - public static class ProfilerResult { - - public final String name; - public final long time; - public final double fraction; - - public ProfilerResult(String name, long time, long totalTime) { - this.name = name; - this.time = time; - fraction = time / (double) totalTime; - } - } - - public HashMap times = new HashMap(); - - public String currentSection; - private long startTime; - private long totalTime; - - private long startTimeOnce; - private String currentOnceSection; - - public void start(String section) { - if (currentSection != null) { - end(); - } - - currentSection = section; - startTime = System.nanoTime(); - } - - public void end() { - long time = System.nanoTime() - startTime; - totalTime += time; - - Long prev = times.get(currentSection); - if (prev == null) { - prev = 0L; - } - times.put(currentSection, prev + time); - currentSection = null; - } - - public void startOnce(String name) { - currentOnceSection = name; - startTimeOnce = System.nanoTime(); - } - - public ProfilerResult endOnce() { - long end = System.nanoTime() - startTimeOnce; - return new ProfilerResult(currentOnceSection, end, end); - } - - public List getResults() { - ArrayList results = new ArrayList(times.size()); - for (Entry e : times.entrySet()) { - results.add(new ProfilerResult(e.getKey(), e.getValue(), totalTime)); - } - return results; - } - - public void clear() { - if (currentSection != null) { - end(); - } - times.clear(); - totalTime = 0; - } -} diff --git a/dependencies/main/java/codechicken/lib/thread/ThreadOperationTimer.java b/dependencies/main/java/codechicken/lib/thread/ThreadOperationTimer.java deleted file mode 100644 index 92a710fe7f..0000000000 --- a/dependencies/main/java/codechicken/lib/thread/ThreadOperationTimer.java +++ /dev/null @@ -1,78 +0,0 @@ -package codechicken.lib.thread; - -import codechicken.lib.asm.ObfMapping; -import com.google.common.base.Objects; - -/** - * Used to control how long a thread can run for before a TimeoutException is thrown. - */ -public class ThreadOperationTimer extends Thread { - - @SuppressWarnings ("serial") - public static class TimeoutException extends RuntimeException { - - public final Object operation; - - public TimeoutException(String msg, Object op) { - super(msg); - operation = op; - } - } - - private Thread thread; - private Object operation; - private long opTime; - private long limit; - - private ThreadOperationTimer(Thread thread, int limit) { - super(thread.getName() + " Operation Timer"); - this.thread = thread; - this.limit = limit; - } - - public synchronized void setLimit(int limit) { - this.limit = limit; - } - - public void reset() { - reset(null); - } - - public synchronized void reset(Object op) { - operation = op; - opTime = System.currentTimeMillis(); - } - - public synchronized void update(Object op) { - if (!Objects.equal(operation, op)) { - operation = op; - opTime = System.currentTimeMillis(); - } - } - - @SuppressWarnings ("deprecation") - @Override - public void run() { - if (ObfMapping.obfuscated) { - return;//don't run this thread in a source environment - } - - while (thread.isAlive()) { - synchronized (this) { - if (operation != null && System.currentTimeMillis() - opTime > limit) { - thread.stop(new TimeoutException("Operation took too long", operation)); - } - } - try { - Thread.sleep(50); - } catch (InterruptedException ie) { - } - } - } - - public static ThreadOperationTimer start(Thread thread, int limit) { - ThreadOperationTimer t = new ThreadOperationTimer(thread, limit); - t.start(); - return t; - } -} diff --git a/dependencies/main/java/codechicken/lib/tile/IActiveTile.java b/dependencies/main/java/codechicken/lib/tile/IActiveTile.java deleted file mode 100644 index 1a054c9584..0000000000 --- a/dependencies/main/java/codechicken/lib/tile/IActiveTile.java +++ /dev/null @@ -1,12 +0,0 @@ -package codechicken.lib.tile; - -/** - * Created by covers1624 on 3/28/2016. - */ -public interface IActiveTile { - - boolean isActive(); - - void setActive(boolean active); - -} diff --git a/dependencies/main/java/codechicken/lib/tile/IDisplayTickTile.java b/dependencies/main/java/codechicken/lib/tile/IDisplayTickTile.java deleted file mode 100644 index 2f2af84b09..0000000000 --- a/dependencies/main/java/codechicken/lib/tile/IDisplayTickTile.java +++ /dev/null @@ -1,19 +0,0 @@ -package codechicken.lib.tile; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.Random; - -/** - * Created by covers1624 on 3/28/2016. - */ -public interface IDisplayTickTile { - - @SideOnly (Side.CLIENT) - void randomDisplayTick(World world, BlockPos position, IBlockState state, Random random); - -} diff --git a/dependencies/main/java/codechicken/lib/tile/IGuiTile.java b/dependencies/main/java/codechicken/lib/tile/IGuiTile.java deleted file mode 100644 index 705d92de1b..0000000000 --- a/dependencies/main/java/codechicken/lib/tile/IGuiTile.java +++ /dev/null @@ -1,13 +0,0 @@ -package codechicken.lib.tile; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -/** - * Created by covers1624 on 3/28/2016. - */ -public interface IGuiTile { - - void openGui(World world, BlockPos pos, EntityPlayer player); -} diff --git a/dependencies/main/java/codechicken/lib/tile/IHarvestTile.java b/dependencies/main/java/codechicken/lib/tile/IHarvestTile.java deleted file mode 100644 index 1fe7119f00..0000000000 --- a/dependencies/main/java/codechicken/lib/tile/IHarvestTile.java +++ /dev/null @@ -1,13 +0,0 @@ -package codechicken.lib.tile; - -import net.minecraft.item.ItemStack; - -import java.util.List; - -/** - * Created by covers1624 on 3/28/2016. - */ -public interface IHarvestTile { - - List getHarvestItems(); -} diff --git a/dependencies/main/java/codechicken/lib/tile/IPlacingTypeTile.java b/dependencies/main/java/codechicken/lib/tile/IPlacingTypeTile.java deleted file mode 100644 index d14ad15d01..0000000000 --- a/dependencies/main/java/codechicken/lib/tile/IPlacingTypeTile.java +++ /dev/null @@ -1,13 +0,0 @@ -package codechicken.lib.tile; - -/** - * Created by covers1624 on 3/28/2016. - */ -//TODO Enum. -public interface IPlacingTypeTile { - - boolean getPlacing(); - - void setPlacing(boolean placing); - -} diff --git a/dependencies/main/java/codechicken/lib/tile/IRedstoneActiveTile.java b/dependencies/main/java/codechicken/lib/tile/IRedstoneActiveTile.java deleted file mode 100644 index cc3fb0865c..0000000000 --- a/dependencies/main/java/codechicken/lib/tile/IRedstoneActiveTile.java +++ /dev/null @@ -1,12 +0,0 @@ -package codechicken.lib.tile; - -/** - * Created by covers1624 on 7/3/2016. - */ -public interface IRedstoneActiveTile { - - void setTileActive(); - - void setTileInactive(); - -} diff --git a/dependencies/main/java/codechicken/lib/tile/IRotatableTile.java b/dependencies/main/java/codechicken/lib/tile/IRotatableTile.java deleted file mode 100644 index 016c0ff4f8..0000000000 --- a/dependencies/main/java/codechicken/lib/tile/IRotatableTile.java +++ /dev/null @@ -1,13 +0,0 @@ -package codechicken.lib.tile; - -import net.minecraft.util.EnumFacing; - -public interface IRotatableTile extends IPlacingTypeTile { - - void doRotation(boolean shift); - - EnumFacing getRotation(); - - void setRotation(EnumFacing facing); - -} diff --git a/dependencies/main/java/codechicken/lib/tool/LibDownloader.java b/dependencies/main/java/codechicken/lib/tool/LibDownloader.java deleted file mode 100644 index 0de10de9d3..0000000000 --- a/dependencies/main/java/codechicken/lib/tool/LibDownloader.java +++ /dev/null @@ -1,111 +0,0 @@ -package codechicken.lib.tool; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; -import java.net.URLConnection; -import java.nio.ByteBuffer; -import java.util.LinkedList; -import java.util.List; - -public class LibDownloader { - - private static String[] libs = new String[] { "org/ow2/asm/asm-debug-all/5.0.3/asm-debug-all-5.0.3.jar", "com/google/guava/guava/14.0/guava-14.0.jar", "net/sf/jopt-simple/jopt-simple/4.5/jopt-simple-4.5.jar", "org/apache/logging/log4j/log4j-core/2.0-beta9/log4j-core-2.0-beta9.jar", "org/apache/logging/log4j/log4j-api/2.0-beta9/log4j-api-2.0-beta9.jar" }; - private static File libDir = new File("lib"); - - private static ByteBuffer downloadBuffer = ByteBuffer.allocateDirect(1 << 23); - - public static void load() { - if (!libDir.exists()) { - libDir.mkdir(); - } - if (!libDir.isDirectory()) { - throw new RuntimeException("/lib is not a directory"); - } - - List missing = checkExists(); - for (String lib : missing) { - download(lib); - } - addPaths(libs); - } - - private static void addPaths(String[] libs) { - try { - URLClassLoader cl = (URLClassLoader) ClassLoader.getSystemClassLoader(); - Method m_addURL = URLClassLoader.class.getDeclaredMethod("addURL", URL.class); - m_addURL.setAccessible(true); - for (String lib : libs) { - m_addURL.invoke(cl, new File(libDir, fileName(lib)).toURI().toURL()); - } - } catch (Exception e) { - throw new RuntimeException("Failed to add libraries to classpath", e); - } - } - - private static void download(String lib) { - File libFile = new File(libDir, fileName(lib)); - try { - URL libDownload = new URL("http://repo1.maven.org/maven2/" + lib); - URLConnection connection = libDownload.openConnection(); - connection.setConnectTimeout(5000); - connection.setReadTimeout(5000); - connection.setRequestProperty("User-Agent", "CodeChickenLib Downloader"); - int sizeGuess = connection.getContentLength(); - download(connection.getInputStream(), sizeGuess, libFile); - } catch (Exception e) { - libFile.delete(); - throw new RuntimeException("A download error occured", e); - } - } - - private static void download(InputStream is, int sizeGuess, File target) throws Exception { - String name = target.getName(); - if (sizeGuess > downloadBuffer.capacity()) { - throw new Exception(String.format("The file %s is too large to be downloaded", name)); - } - - downloadBuffer.clear(); - - int bytesRead, fullLength = 0; - - System.out.format("Downloading lib %s", name); - byte[] smallBuffer = new byte[1024]; - while ((bytesRead = is.read(smallBuffer)) >= 0) { - downloadBuffer.put(smallBuffer, 0, bytesRead); - fullLength += bytesRead; - System.out.format("\rDownloading lib %s %d%%", name, fullLength * 100 / sizeGuess); - } - System.out.format("\rDownloaded lib %s \n", name); - is.close(); - downloadBuffer.limit(fullLength); - - if (!target.exists()) { - target.createNewFile(); - } - - downloadBuffer.position(0); - FileOutputStream fos = new FileOutputStream(target); - fos.getChannel().write(downloadBuffer); - fos.close(); - } - - private static String fileName(String lib) { - return lib.replaceAll(".+/", ""); - } - - private static List checkExists() { - LinkedList list = new LinkedList(); - for (String lib : libs) { - File file = new File(libDir, fileName(lib)); - if (!file.exists()) { - list.add(lib); - } - } - return list; - } - -} diff --git a/dependencies/main/java/codechicken/lib/tool/MCStripTransformer.java b/dependencies/main/java/codechicken/lib/tool/MCStripTransformer.java deleted file mode 100644 index d9ad82dfa0..0000000000 --- a/dependencies/main/java/codechicken/lib/tool/MCStripTransformer.java +++ /dev/null @@ -1,49 +0,0 @@ -package codechicken.lib.tool; - -import codechicken.lib.asm.ASMHelper; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.asm.commons.Remapper; -import org.objectweb.asm.commons.RemappingMethodAdapter; -import org.objectweb.asm.tree.ClassNode; -import org.objectweb.asm.tree.MethodNode; - -import java.util.Iterator; - -public class MCStripTransformer { - - public static class ReferenceDetector extends Remapper { - - boolean found = false; - - @Override - public String map(String typeName) { - if (typeName.startsWith("net/minecraft") || !typeName.contains("/")) { - found = true; - } - return typeName; - } - } - - public static byte[] transform(byte[] bytes) { - ClassNode cnode = ASMHelper.createClassNode(bytes, ClassReader.EXPAND_FRAMES); - - boolean changed = false; - Iterator it = cnode.methods.iterator(); - while (it.hasNext()) { - MethodNode mnode = it.next(); - ReferenceDetector r = new ReferenceDetector(); - mnode.accept(new RemappingMethodAdapter(mnode.access, mnode.desc, new MethodVisitor(Opcodes.ASM4) { - }, r)); - if (r.found) { - it.remove(); - changed = true; - } - } - if (changed) { - bytes = ASMHelper.createBytes(cnode, 0); - } - return bytes; - } -} diff --git a/dependencies/main/java/codechicken/lib/tool/Main.java b/dependencies/main/java/codechicken/lib/tool/Main.java deleted file mode 100644 index 039121ca0a..0000000000 --- a/dependencies/main/java/codechicken/lib/tool/Main.java +++ /dev/null @@ -1,14 +0,0 @@ -package codechicken.lib.tool; - -public class Main { - - public static void main(String[] args) { - LibDownloader.load(); - try { - Class c_toolMain = new StripClassLoader().loadClass("codechicken.lib.tool.ToolMain"); - c_toolMain.getDeclaredMethod("main", String[].class).invoke(null, new Object[] { args }); - } catch (Exception e) { - throw new RuntimeException(e); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/tool/StripClassLoader.java b/dependencies/main/java/codechicken/lib/tool/StripClassLoader.java deleted file mode 100644 index 1a2f86db3c..0000000000 --- a/dependencies/main/java/codechicken/lib/tool/StripClassLoader.java +++ /dev/null @@ -1,53 +0,0 @@ -package codechicken.lib.tool; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLClassLoader; - -public class StripClassLoader extends URLClassLoader { - - public StripClassLoader() { - super(new URL[0], StripClassLoader.class.getClassLoader()); - } - - @Override - public Class loadClass(String name) throws ClassNotFoundException { - if (!name.startsWith("codechicken.lib")) { - return super.loadClass(name); - } - - try { - String resName = name.replace('.', '/') + ".class"; - InputStream res = getResourceAsStream(resName); - if (res == null) { - throw new ClassNotFoundException("Could not find resource: " + resName); - } - byte[] bytes = readFully(res); - bytes = transform(bytes); - return defineClass(name, bytes, 0, bytes.length); - - } catch (IOException e) { - throw new ClassNotFoundException(name, e); - } - } - - public static byte[] readFully(InputStream is) throws IOException { - ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - - int read; - byte[] data = new byte[16384]; - while ((read = is.read(data, 0, data.length)) > 0) { - buffer.write(data, 0, read); - } - - return buffer.toByteArray(); - } - - private byte[] transform(byte[] bytes) { - - bytes = MCStripTransformer.transform(bytes); - return bytes; - } -} diff --git a/dependencies/main/java/codechicken/lib/tool/ToolMain.java b/dependencies/main/java/codechicken/lib/tool/ToolMain.java deleted file mode 100644 index 46dd0353f3..0000000000 --- a/dependencies/main/java/codechicken/lib/tool/ToolMain.java +++ /dev/null @@ -1,48 +0,0 @@ -package codechicken.lib.tool; - -import codechicken.lib.tool.module.ModuleQBConverter; - -public class ToolMain { - - public interface Module { - - void main(String[] args); - - String name(); - - void printHelp(); - } - - public static Module[] modules = new Module[] { new ModuleQBConverter() }; - - private static void printHelp() { - System.out.println("Usage: [module] [args]"); - System.out.println(" Modules: "); - for (Module m : modules) { - System.out.println(" - " + m.name()); - } - System.out.println("-h [module] for module help"); - } - - public static void main(String[] args) { - if (args.length > 0) { - for (Module m : modules) { - if (args[0].equals(m.name())) { - String[] args2 = new String[args.length - 1]; - System.arraycopy(args, 1, args2, 0, args2.length); - m.main(args2); - return; - } - } - if (args[0].equals("-h") && args.length >= 2) { - for (Module m : modules) { - if (args[1].equals(m.name())) { - m.printHelp(); - return; - } - } - } - } - printHelp(); - } -} diff --git a/dependencies/main/java/codechicken/lib/tool/module/JOptModule.java b/dependencies/main/java/codechicken/lib/tool/module/JOptModule.java deleted file mode 100644 index 5493399578..0000000000 --- a/dependencies/main/java/codechicken/lib/tool/module/JOptModule.java +++ /dev/null @@ -1,42 +0,0 @@ -package codechicken.lib.tool.module; - -import codechicken.lib.tool.ToolMain; -import joptsimple.OptionException; -import joptsimple.OptionParser; -import joptsimple.OptionSet; - -import java.io.IOException; - -public abstract class JOptModule implements ToolMain.Module { - - OptionParser parser = new OptionParser(); - - @Override - public void main(String[] args) { - OptionSet options; - try { - options = parser.parse(args); - } catch (OptionException ex) { - System.err.println(ex.getLocalizedMessage()); - System.exit(-1); - return; - } - - try { - main(parser, options); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - protected abstract void main(OptionParser parser, OptionSet options); - - @Override - public void printHelp() { - try { - parser.printHelpOn(System.out); - } catch (IOException e) { - e.printStackTrace(); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/tool/module/ModuleQBConverter.java b/dependencies/main/java/codechicken/lib/tool/module/ModuleQBConverter.java deleted file mode 100644 index 1110edcede..0000000000 --- a/dependencies/main/java/codechicken/lib/tool/module/ModuleQBConverter.java +++ /dev/null @@ -1,82 +0,0 @@ -package codechicken.lib.tool.module; - -import codechicken.lib.render.QBImporter; -import joptsimple.OptionParser; -import joptsimple.OptionSet; - -import java.io.File; - -import static java.util.Arrays.asList; - -public class ModuleQBConverter extends JOptModule { - - public ModuleQBConverter() { - parser.acceptsAll(asList("?", "h", "help"), "Show the help"); - parser.acceptsAll(asList("i", "input"), "comma separated list of paths to models (.qb or directories)").withRequiredArg().ofType(File.class).withValuesSeparatedBy(',').required(); - parser.acceptsAll(asList("o", "out"), "Output Directory").withRequiredArg().ofType(File.class); - parser.acceptsAll(asList("o2", "textureplanes"), "2nd level optimisation. Merges coplanar polygons. Increases texture size"); - parser.acceptsAll(asList("s", "squaretextures"), "Produce square textures"); - parser.acceptsAll(asList("t", "mergetextures"), "Use the same texture for all models"); - parser.acceptsAll(asList("r", "scalemc"), "Resize model to mc standard (shrink by factor of 16)"); - } - - protected void main(OptionParser parser, OptionSet options) { - int flags = 0; - if (options.has("o2")) { - flags |= QBImporter.TEXTUREPLANES; - } - if (options.has("s")) { - flags |= QBImporter.SQUARETEXTURE; - } - if (options.has("t")) { - flags |= QBImporter.MERGETEXTURES; - } - if (options.has("r")) { - flags |= QBImporter.SCALEMC; - } - - File[] input = options.valuesOf("input").toArray(new File[0]); - File[] outDir = new File[input.length]; - if (options.has("out")) { - File output = (File) options.valueOf("out"); - if (output.isFile()) { - throw new RuntimeException("Output Path is not a directory"); - } - if (!output.exists()) { - output.mkdirs(); - } - - for (int i = 0; i < input.length; i++) { - outDir[i] = output; - } - } else { - for (int i = 0; i < input.length; i++) { - outDir[i] = input[i].isDirectory() ? input[i] : input[i].getParentFile(); - } - } - - for (int i = 0; i < input.length; i++) { - File file = input[i]; - if (file.isDirectory()) { - for (File file2 : file.listFiles()) { - if (file2.getName().endsWith(".qb")) { - convert(file2, outDir[i], flags); - } - } - } else { - convert(file, outDir[i], flags); - } - } - } - - private void convert(File in, File outDir, int flags) { - System.out.println("Converting: " + in.getName()); - QBImporter.RasterisedModel m = QBImporter.loadQB(in).toRasterisedModel(flags); - m.export(new File(outDir, in.getName().replace(".qb", ".obj")), outDir); - } - - @Override - public String name() { - return "QBConverter"; - } -} diff --git a/dependencies/main/java/codechicken/lib/util/ArrayUtils.java b/dependencies/main/java/codechicken/lib/util/ArrayUtils.java deleted file mode 100644 index 30507cce7c..0000000000 --- a/dependencies/main/java/codechicken/lib/util/ArrayUtils.java +++ /dev/null @@ -1,234 +0,0 @@ -package codechicken.lib.util; - -import com.google.common.base.Function; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Created by covers1624 on 3/27/2016. - */ -public class ArrayUtils { - - /** - * Converts an String array to lowercase. - * - * @param array Array to convert. - * @return Converted array. - */ - public static String[] arrayToLowercase(String[] array) { - String[] copy = new String[array.length]; - for (int i = 0; i < array.length; i++) { - copy[i] = array[i].toLowerCase(); - } - return copy; - } - - /** - * Converts and array of "key=value" to a map. - * - * @param array Array to convert. - * @return Map of values. - */ - public static Map convertKeyValueArrayToMap(String[] array) { - HashMap map = new HashMap(); - for (String entry : array) { - String[] split = entry.split("="); - map.put(split[0], split[1]); - } - return map; - } - - /** - * Prefixes a string array with the desired value. - * - * @param prefix The prefix to apply. - * @param list The list to apply the prefix to. - * @return The list with the prefix applied. - */ - public static List prefixStringList(String prefix, List list) { - List finalList = new ArrayList(); - for (String string : list) { - finalList.add(prefix + string); - } - return finalList; - } - - /** - * Checks if a map contains all keys passed in. - * - * @param map Map to check. - * @param keys Keys that must exist. - * @param The type of data in the map key. - * @return False if fail. - */ - public static boolean containsKeys(Map map, T... keys) { - for (T object : keys) { - if (!map.containsKey(object)) { - return false; - } - } - return true; - } - - /** - * Adds the value at the first null index in the array. - * - * @param array Array to add to. - * @param value Value to add. - * @param Type of value. - */ - public static void addToArrayFirstNull(T[] array, T value) { - int nullIndex = -1; - for (int i = 0; i < array.length; i++) { - T v = array[i]; - if (v == null) { - nullIndex = i; - break; - } - } - if (nullIndex == -1) {//We aren't able to expand it as we are using generics. - throw new RuntimeException("Unable to add to array as it is full! Expand it before adding to it!"); - } - array[nullIndex] = value; - } - - /** - * Adds all elements from the array that are not null to the list. - * - * @param array Array to grab from. - * @param list List to add to. - * @param What we are dealing with. - * @return The modified list. - */ - public static List addAllNoNull(T[] array, List list) { - for (T value : array) { - if (value != null) { - list.add(value); - } - } - return list; - } - - /** - * Checks if the array is all null. - * - * @param array The array to check. - * @param What we are dealing with. - * @return True if the array only contains nulls. - */ - public static boolean isEmpty(T[] array) { - for (T value : array) { - if (value != null) { - return false; - } - } - return true; - } - - /** - * Counts the elements in the array that are not null. - * - * @param array The array to check. - * @param What we are dealing with. - * @return The count of non-null objects in the array. - */ - public static int countNoNull(T[] array) { - int counter = 0; - for (T value : array) { - if (value != null) { - counter++; - } - } - return counter; - } - - /** - * Fills the array with the specified value. - * If the value is an instance of Copyable it will call copy. - * - * @param array Array to fill. - * @param value Value to fill with. - * @param What we are dealing with. - */ - @SuppressWarnings ("unchecked") - public static void fillArray(T[] array, T value) { - for (int i = 0; i < array.length; i++) { - T newValue = value; - if (value instanceof Copyable) { - newValue = ((Copyable) value).copy(); - } - array[i] = newValue; - } - } - - /** - * Apples the Specified function to the entire array and returns a new List of the result. - * The input to the function may be null. - * - * @param function The function to apply. - * @param array The array to apply the function to. - * @param The Input generic. - * @param The Output generic. - * @return A list of the output of the specified function. - */ - public static List applyArray(Function function, I... array) { - List finalList = new ArrayList(); - for (I i : array) { - finalList.add(function.apply(i)); - } - - return finalList; - } - - /** - * Basically a wrapper for System.arraycopy with support for CCL Copyable's - * - * @param src The source array. - * @param srcPos Starting position in the source array. - * @param dst The destination array. - * @param destPos Starting position in the destination array. - * @param length The number of elements to copy. - */ - public static void arrayCopy(Object src, int srcPos, Object dst, int destPos, int length) { - System.arraycopy(src, srcPos, dst, destPos, length); - if (dst instanceof Copyable[]) { - Object[] oa = (Object[]) dst; - Copyable[] c = (Copyable[]) dst; - for (int i = destPos; i < destPos + length; i++) { - if (c[i] != null) { - oa[i] = c[i].copy(); - } - } - } - } - - /** - * Returns the index of the first occurrence of the specified element in the array. - * Will return -1 if the element is non existent in the array. - * - * @param array The array to search. - * @param object Element to find. - * @param What we are dealing with. - * @return The index in the array of the object. - */ - public static int indexOf(T[] array, T object) { - if (object == null) { - for (int i = 0; i < array.length; i++) { - if (array[i] == null) { - return i; - } - } - } else { - for (int i = 0; i < array.length; i++) { - if (object.equals(array[i])) { - return i; - } - } - } - return -1; - } - -} diff --git a/dependencies/main/java/codechicken/lib/util/BlockStateUtils.java b/dependencies/main/java/codechicken/lib/util/BlockStateUtils.java deleted file mode 100644 index e553ea9063..0000000000 --- a/dependencies/main/java/codechicken/lib/util/BlockStateUtils.java +++ /dev/null @@ -1,41 +0,0 @@ -package codechicken.lib.util; - -import com.google.common.base.Objects; -import com.google.common.base.Optional; -import net.minecraft.block.state.IBlockState; -import net.minecraftforge.common.property.IExtendedBlockState; -import net.minecraftforge.common.property.IUnlistedProperty; - -import java.util.LinkedList; -import java.util.List; -import java.util.Map.Entry; - -/** - * Created by covers1624 on 13/01/2017. - */ -public class BlockStateUtils { - - public static int hashBlockState(IBlockState state) { - if (state instanceof IExtendedBlockState) { - return hashBlockState((IExtendedBlockState) state); - } - return hashBlockState_(state); - } - - public static int hashBlockState_(IBlockState state) { - return Objects.hashCode(state.toString()); - } - - @SuppressWarnings ("unchecked") - private static int hashBlockState(IExtendedBlockState state) { - List toHash = new LinkedList(); - toHash.add(state.toString()); - toHash.add("meta=" + state.getBlock().getMetaFromState(state)); - for (Entry, Optional> entry : state.getUnlistedProperties().entrySet()) { - IUnlistedProperty property = entry.getKey(); - toHash.add(property.getName() + "=" + property.valueToString(state.getValue(property))); - } - return Objects.hashCode(toHash.toArray()); - } - -} diff --git a/dependencies/main/java/codechicken/lib/util/BlockUtils.java b/dependencies/main/java/codechicken/lib/util/BlockUtils.java deleted file mode 100644 index 3b718b5bd9..0000000000 --- a/dependencies/main/java/codechicken/lib/util/BlockUtils.java +++ /dev/null @@ -1,81 +0,0 @@ -package codechicken.lib.util; - -import codechicken.lib.vec.Vector3; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import java.util.LinkedList; -import java.util.List; - -/** - * Created by covers1624 on 6/30/2016. - * TODO Nuke things in here that aren't needed anymore. - */ -public class BlockUtils { - - /** - * Generates a bounding box. - * - * @param pos Position of block. - * @param dir Direction to create Box. - * @param vector3 Size of the box. - */ - public static AxisAlignedBB getBox(BlockPos pos, EnumFacing dir, Vector3 vector3) { - return new AxisAlignedBB(pos, pos.add(vector3.x, vector3.y, vector3.z)); - } - - /** - * Checks if an entity is in range of the position passed in. - * - * @param pos Position of block. - * @param entity Entity to check. - * @param range Range to check. - * @return True if entity in range. - */ - public static boolean isEntityInRange(BlockPos pos, Entity entity, int range) { - return entity.getDistanceSq(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D) <= range; - } - - /** - * Simply fires a lighting update for a block. - * - * @param world World for the update. - * @param position Pos to update. - */ - public static void fireLightUpdate(World world, BlockPos position) { - world.notifyLightSet(position); - } - - /** - * Fires a block update. - * Assumes the BlockState has not changed but a update is still needed. - * - * @param world - * @param pos - *///TODO fireBlockUpdate(TileEntity). - public static void fireBlockUpdate(World world, BlockPos pos) { - IBlockState state = world.getBlockState(pos); - world.notifyBlockUpdate(pos, state, state, 3); - } - - /** - * Gets the adjacent blocks for a position. - * - * @param pos Main position. - * @param includeVertical Weather to include vertical facings. - * @return List of adjacent blocks. - */ - public static List getAdjacent(BlockPos pos, boolean includeVertical) { - LinkedList adjacentPositions = new LinkedList(); - for (EnumFacing step : (includeVertical ? EnumFacing.VALUES : EnumFacing.HORIZONTALS)) { - adjacentPositions.add(pos.offset(step)); - } - - return adjacentPositions; - } - -} diff --git a/dependencies/main/java/codechicken/lib/util/CCDirection.java b/dependencies/main/java/codechicken/lib/util/CCDirection.java deleted file mode 100644 index 17b771e007..0000000000 --- a/dependencies/main/java/codechicken/lib/util/CCDirection.java +++ /dev/null @@ -1,103 +0,0 @@ -package codechicken.lib.util; - -import net.minecraft.util.EnumFacing; -import net.minecraft.util.IStringSerializable; - -/** - * Created by covers1624 on 5/17/2016. - */ -@Deprecated//Brandon this isn't needed anymore, use null and special case it instead of UNKNOWN -public enum CCDirection implements IStringSerializable { - - /** - * -Y - */ - DOWN(0, -1, 0), - - /** - * +Y - */ - UP(0, 1, 0), - - /** - * -Z - */ - NORTH(0, 0, -1), - - /** - * +Z - */ - SOUTH(0, 0, 1), - - /** - * -X - */ - WEST(-1, 0, 0), - - /** - * +X - */ - EAST(1, 0, 0), - - /** - * Used only by getOrientation, for invalid inputs - */ - UNKNOWN(0, 0, 0); - - public final int offsetX; - public final int offsetY; - public final int offsetZ; - public final int flag; - public static final CCDirection[] VALID_DIRECTIONS = { DOWN, UP, NORTH, SOUTH, WEST, EAST }; - public static final int[] OPPOSITES = { 1, 0, 3, 2, 5, 4, 6 }; - // Left hand rule rotation matrix for all possible axes of rotation - public static final int[][] ROTATION_MATRIX = {// - { 0, 1, 4, 5, 3, 2, 6 },// - { 0, 1, 5, 4, 2, 3, 6 },// - { 5, 4, 2, 3, 0, 1, 6 },// - { 4, 5, 2, 3, 1, 0, 6 },// - { 2, 3, 1, 0, 4, 5, 6 },// - { 3, 2, 0, 1, 4, 5, 6 },// - { 0, 1, 2, 3, 4, 5, 6 },// - }; - - CCDirection(int x, int y, int z) { - offsetX = x; - offsetY = y; - offsetZ = z; - flag = 1 << ordinal(); - } - - public static CCDirection getOrientation(int id) { - if (id >= 0 && id < VALID_DIRECTIONS.length) { - return VALID_DIRECTIONS[id]; - } - return UNKNOWN; - } - - public CCDirection getOpposite() { - return getOrientation(OPPOSITES[ordinal()]); - } - - public CCDirection getRotation(CCDirection axis) { - return getOrientation(ROTATION_MATRIX[axis.ordinal()][ordinal()]); - } - - public EnumFacing getFacing(CCDirection direction) { - if (direction != UNKNOWN) { - return EnumFacing.getFront(direction.ordinal()); - } else { - return null; - } - } - - public CCDirection getDirection(EnumFacing facing) { - return facing == null ? UNKNOWN : VALID_DIRECTIONS[facing.getIndex()]; - } - - @Override - public String getName() { - return name().toLowerCase(); - } - -} diff --git a/dependencies/main/java/codechicken/lib/util/ClientUtils.java b/dependencies/main/java/codechicken/lib/util/ClientUtils.java deleted file mode 100644 index 50e19608b9..0000000000 --- a/dependencies/main/java/codechicken/lib/util/ClientUtils.java +++ /dev/null @@ -1,58 +0,0 @@ -package codechicken.lib.util; - -import codechicken.lib.render.CCRenderEventHandler; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.network.NetworkManager; -import net.minecraft.world.World; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public class ClientUtils extends CommonUtils { - - private static Minecraft mc() { - return Minecraft.getMinecraft(); - } - - public static World getWorld() { - return mc().theWorld; - } - - public static boolean inWorld() { - return mc().getConnection() != null; - } - - public static void openSMPGui(int windowId, GuiScreen gui) { - mc().displayGuiScreen(gui); - if (windowId != 0) { - mc().thePlayer.openContainer.windowId = windowId; - } - } - - public static float getRenderFrame() { - return CCRenderEventHandler.renderFrame; - } - - public static double getRenderTime() { - return CCRenderEventHandler.renderTime + getRenderFrame(); - } - - public static String getServerIP() { - try { - NetworkManager networkManager = mc().getConnection().getNetworkManager(); - String s = networkManager.getRemoteAddress().toString(); - s = s.substring(s.indexOf("/") + 1); - return s; - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - @SideOnly (Side.CLIENT) - public static String getWorldSaveName() { - return mc().isSingleplayer() ? FMLCommonHandler.instance().getMinecraftServerInstance().getFolderName() : null; - } -} diff --git a/dependencies/main/java/codechicken/lib/util/CommonUtils.java b/dependencies/main/java/codechicken/lib/util/CommonUtils.java deleted file mode 100644 index 913e93a207..0000000000 --- a/dependencies/main/java/codechicken/lib/util/CommonUtils.java +++ /dev/null @@ -1,59 +0,0 @@ -package codechicken.lib.util; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.relauncher.FMLInjectionData; - -import java.io.File; - -public class CommonUtils { - - public static boolean isClientWorld(World world) { - return world.isRemote; - } - - public static boolean isServerWorld(World world) { - return !world.isRemote; - } - - public static boolean isClient() { - return FMLCommonHandler.instance().getSide().isClient(); - } - - public static File getSaveLocation(World world) { - File base = DimensionManager.getCurrentSaveRootDirectory(); - return world.provider.getDimension() == 0 ? base : new File(base, world.provider.getSaveFolder()); - } - - public static File getSaveLocation(int dim) { - return getSaveLocation(DimensionManager.getWorld(dim)); - } - - public static String getWorldName(World world) { - return world.getWorldInfo().getWorldName(); - } - - public static int getDimension(World world) { - return world.provider.getDimension(); - } - - public static File getMinecraftDir() { - return (File) FMLInjectionData.data()[6]; - } - - public static String getRelativePath(File parent, File child) { - if (parent.isFile() || !child.getPath().startsWith(parent.getPath())) { - return null; - } - return child.getPath().substring(parent.getPath().length() + 1); - } - - @Deprecated - public static void registerHandledEntity(Class entityClass, String identifier) { - EntityList.CLASS_TO_NAME.put(entityClass, identifier); - EntityList.NAME_TO_CLASS.put(identifier, entityClass); - } -} diff --git a/dependencies/main/java/codechicken/lib/util/ContainerUtils.java b/dependencies/main/java/codechicken/lib/util/ContainerUtils.java deleted file mode 100644 index 3ea10f77d0..0000000000 --- a/dependencies/main/java/codechicken/lib/util/ContainerUtils.java +++ /dev/null @@ -1,37 +0,0 @@ -package codechicken.lib.util; - -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; - -/** - * Created by covers1624 on 30/08/2016. - */ -@Deprecated -public class ContainerUtils { - - public static void bindPlayerInventory(Container container, InventoryPlayer inventoryPlayer, int xStart, int yStart) { - // Main inventory - for (int i = 0; i < 3; i++) {// Rows, 3 Rows - for (int j = 0; j < 9; j++) {// Columns, 9 Slots per row - int slot = j + i * 9 + 9; - int x = xStart + j * 18; - int y = yStart + i * 18; - addSlotToContainer(container, new Slot(inventoryPlayer, slot, x, y)); - } - } - - // Hotbar - for (int i = 0; i < 9; i++) { - addSlotToContainer(container, new Slot(inventoryPlayer, i, xStart + i * 18, yStart + 58)); - } - } - - public static Slot addSlotToContainer(Container container, Slot slot) { - slot.slotNumber = container.inventorySlots.size(); - //Covers1624Lib.logger.info(slot.slotNumber); - container.inventorySlots.add(slot); - container.inventoryItemStacks.add(null); - return slot; - } -} diff --git a/dependencies/main/java/codechicken/lib/util/Copyable.java b/dependencies/main/java/codechicken/lib/util/Copyable.java deleted file mode 100644 index fff6f32e5e..0000000000 --- a/dependencies/main/java/codechicken/lib/util/Copyable.java +++ /dev/null @@ -1,6 +0,0 @@ -package codechicken.lib.util; - -public interface Copyable { - - T copy(); -} diff --git a/dependencies/main/java/codechicken/lib/util/EntityUtils.java b/dependencies/main/java/codechicken/lib/util/EntityUtils.java deleted file mode 100644 index ec581bc7a4..0000000000 --- a/dependencies/main/java/codechicken/lib/util/EntityUtils.java +++ /dev/null @@ -1,32 +0,0 @@ -package codechicken.lib.util; - -import codechicken.lib.vec.Vector3; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.SoundEvents; -import net.minecraft.util.SoundCategory; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.living.EnderTeleportEvent; - -/** - * Created by covers1624 on 17/10/2016. - */ -//TODO Nuke. -public class EntityUtils { - - public static int entityId = 0; - - public static int nextEntityId() { - return entityId++; - } - - public static boolean teleportEntityTo(EntityLivingBase entity, Vector3 location) { - EnderTeleportEvent event = new EnderTeleportEvent(entity, location.x, location.y, location.z, 0); - if (MinecraftForge.EVENT_BUS.post(event)) { - return false; - } - entity.setPositionAndUpdate(event.getTargetX(), event.getTargetY(), event.getTargetZ()); - SoundUtils.playSoundAt(entity, SoundCategory.BLOCKS, SoundEvents.ENTITY_ENDERMEN_TELEPORT); - return true; - } - -} diff --git a/dependencies/main/java/codechicken/lib/util/FontUtils.java b/dependencies/main/java/codechicken/lib/util/FontUtils.java deleted file mode 100644 index 7e4a18f75a..0000000000 --- a/dependencies/main/java/codechicken/lib/util/FontUtils.java +++ /dev/null @@ -1,67 +0,0 @@ -package codechicken.lib.util; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.item.ItemStack; - -public class FontUtils { - - public static FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; - - public static void drawCenteredString(String s, int xCenter, int y, int colour) { - fontRenderer.drawString(s, xCenter - fontRenderer.getStringWidth(s) / 2, y, colour); - } - - public static void drawRightString(String s, int xRight, int y, int colour) { - fontRenderer.drawString(s, xRight - fontRenderer.getStringWidth(s), y, colour); - } - - public static final String[] prefixes = new String[] { "K", "M", "G" }; - - public static void drawItemQuantity(int x, int y, ItemStack item, String quantity, int mode) { - if (item == null || (quantity == null && item.stackSize <= 1)) { - return; - } - - if (quantity == null) { - switch (mode) { - case 2: - int q = item.stackSize; - String postfix = ""; - for (int p = 0; p < 3 && q > 1000; p++) { - q /= 1000; - postfix = prefixes[p]; - } - quantity = Integer.toString(q) + postfix; - break; - case 1: - quantity = ""; - if (item.stackSize / 64 > 0) { - quantity += item.stackSize / 64 + "s"; - } - if (item.stackSize % 64 > 0) { - quantity += item.stackSize % 64; - } - break; - default: - quantity = Integer.toString(item.stackSize); - break; - } - } - - double scale = quantity.length() > 2 ? 0.5 : 1; - double sheight = 8 * scale; - double swidth = fontRenderer.getStringWidth(quantity) * scale; - - GlStateManager.disableLighting(); - GlStateManager.disableDepth(); - GlStateManager.pushMatrix(); - GlStateManager.translate(x + 16 - swidth, y + 16 - sheight, 0); - GlStateManager.scale(scale, scale, 1); - fontRenderer.drawStringWithShadow(quantity, 0, 0, 0xFFFFFF); - GlStateManager.popMatrix(); - GlStateManager.enableLighting(); - GlStateManager.enableDepth(); - } -} diff --git a/dependencies/main/java/codechicken/lib/util/FuelUtils.java b/dependencies/main/java/codechicken/lib/util/FuelUtils.java deleted file mode 100644 index 254715f8f7..0000000000 --- a/dependencies/main/java/codechicken/lib/util/FuelUtils.java +++ /dev/null @@ -1,37 +0,0 @@ -package codechicken.lib.util; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.IFuelHandler; - -import java.util.HashMap; - -/** - * Created by covers1624 on 17/10/2016. - */ -public class FuelUtils implements IFuelHandler { - - private static HashMap fuelBurnMap = new HashMap(); - - @Override - public int getBurnTime(ItemStack fuel) { - - if (fuelBurnMap.containsKey(fuel)) { - return fuelBurnMap.get(fuel); - } - return -1; - } - - public static void registerFuel(ItemStack stack, int burn) { - fuelBurnMap.put(stack, burn); - } - - public static void registerFuel(Block block, int burn) { - registerFuel(new ItemStack(block), burn); - } - - public static void registerFuel(Item item, int burn) { - registerFuel(new ItemStack(item), burn); - } -} diff --git a/dependencies/main/java/codechicken/lib/util/ItemNBTUtils.java b/dependencies/main/java/codechicken/lib/util/ItemNBTUtils.java deleted file mode 100644 index 4d2d3217f5..0000000000 --- a/dependencies/main/java/codechicken/lib/util/ItemNBTUtils.java +++ /dev/null @@ -1,389 +0,0 @@ -package codechicken.lib.util; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; - -import java.util.UUID; - -/** - * Created by covers1624 on 6/30/2016. - */ -public class ItemNBTUtils { - - /** - * Checks if an ItemStack has an NBTTag. - * - * @param stack Stack to check. - * @return If tag is in existence. - */ - public static boolean hasTag(ItemStack stack) { - return stack.hasTagCompound(); - } - - /** - * Sets the tag on an ItemStack. - * - * @param stack Stack to set tag on. - * @param tagCompound Tag to set on item. - */ - public static void setTag(ItemStack stack, NBTTagCompound tagCompound) { - stack.setTagCompound(tagCompound); - } - - /** - * Gets the NBTTag associated with an ItemStack. - * - * @param stack Stack to get tag from. - * @return Tag from the ItemStack. - */ - public static NBTTagCompound getTag(ItemStack stack) { - return stack.getTagCompound(); - } - - /** - * Checks if an NBTTag exists on an item and if not it will create a new one. - * - * @param stack Stack to check. - * @return The Tag on the item. - */ - public static NBTTagCompound validateTagExists(ItemStack stack) { - if (!hasTag(stack)) { - setTag(stack, new NBTTagCompound()); - } - return getTag(stack); - } - - /** - * Checks if an ItemStack has an NBTTag on an ItemStack with the specified Key and Value. - * - * @param stack Stack to check. - * @param key Key to check for. - * @return False if key does not exist or if the tag does not exist. - */ - public static boolean hasKey(ItemStack stack, String key) { - return hasTag(stack) && getTag(stack).hasKey(key); - } - - /** - * Checks if an ItemStack has an NBTTag of a specific type and name. - * - * @param stack Stack to check. - * @param key Key to check for. - * @param nbtType Primitive NBT Type. - * @return False if key does not exist or if the tag does not exist. - */ - public static boolean hasKey(ItemStack stack, String key, int nbtType) { - return hasTag(stack) && getTag(stack).hasKey(key, nbtType); - } - - /** - * Removes a key from the ItemStacks NBTTag. - * - * @param stack Stack to edit. - * @param key Key to remove. - */ - public static void removeTag(ItemStack stack, String key) { - if (hasTag(stack)) { - getTag(stack).removeTag(key); - } - } - - //region Setters - - /** - * Sets a byte on an ItemStack with the specified Key and Value. - * - * @param stack Stack to set. - * @param key Key. - * @param b Value. - */ - public static void setByte(ItemStack stack, String key, byte b) { - validateTagExists(stack); - getTag(stack).setByte(key, b); - } - - /** - * Sets a short on an ItemStack with the specified Key and Value. - * - * @param stack Stack to set. - * @param key Key. - * @param s Value. - */ - public static void setShort(ItemStack stack, String key, short s) { - validateTagExists(stack); - getTag(stack).setShort(key, s); - } - - /** - * Sets a int on an ItemStack with the specified Key and Value. - * - * @param stack Stack to set. - * @param key Key. - * @param i Value. - */ - public static void setInteger(ItemStack stack, String key, int i) { - validateTagExists(stack); - getTag(stack).setInteger(key, i); - } - - /** - * Sets a long on an ItemStack with the specified Key and Value. - * - * @param stack Stack to set. - * @param key Key. - * @param l Value. - */ - public static void setLong(ItemStack stack, String key, long l) { - validateTagExists(stack); - getTag(stack).setLong(key, l); - } - - /** - * Sets a UUID on an ItemStack with the specified Key and Value. - * - * @param stack Stack to set. - * @param key Key. - * @param uuid Value. - */ - public static void setUUID(ItemStack stack, String key, UUID uuid) { - validateTagExists(stack); - getTag(stack).setUniqueId(key, uuid); - } - - /** - * Sets a float on an ItemStack with the specified Key and Value. - * - * @param stack Stack to set. - * @param key Key. - * @param f Value. - */ - public static void setFloat(ItemStack stack, String key, float f) { - validateTagExists(stack); - getTag(stack).setFloat(key, f); - } - - /** - * Sets a double on an ItemStack with the specified Key and Value. - * - * @param stack Stack to set. - * @param key Key. - * @param d Value. - */ - public static void setDouble(ItemStack stack, String key, double d) { - validateTagExists(stack); - getTag(stack).setDouble(key, d); - } - - /** - * Sets a String on an ItemStack with the specified Key and Value. - * - * @param stack Stack to set. - * @param key Key. - * @param s Value. - */ - public static void setString(ItemStack stack, String key, String s) { - validateTagExists(stack); - getTag(stack).setString(key, s); - } - - /** - * Sets a byte array on an ItemStack with the specified Key and Value. - * - * @param stack Stack to set. - * @param key Key. - * @param b Value. - */ - public static void setByteArray(ItemStack stack, String key, byte[] b) { - validateTagExists(stack); - getTag(stack).setByteArray(key, b); - } - - /** - * Sets a int array on an ItemStack with the specified Key and Value. - * - * @param stack Stack to set. - * @param key Key. - * @param i Value. - */ - public static void setIntArray(ItemStack stack, String key, int[] i) { - validateTagExists(stack); - getTag(stack).setIntArray(key, i); - } - - /** - * Sets a boolean on an ItemStack with the specified Key and Value. - * - * @param stack Stack to set. - * @param key Key. - * @param b Value. - */ - public static void setBoolean(ItemStack stack, String key, boolean b) { - validateTagExists(stack); - getTag(stack).setBoolean(key, b); - } - - //endregion - - //region Getters - - /** - * Gets a byte from an ItemStacks NBTTag. - * - * @param stack Stack key exists on. - * @param key Key for the value. - * @return Value. - */ - public static byte getByte(ItemStack stack, String key) { - validateTagExists(stack); - return getTag(stack).getByte(key); - } - - /** - * Gets a short from an ItemStacks NBTTag. - * - * @param stack Stack key exists on. - * @param key Key for the value. - * @return Value. - */ - public static short getShort(ItemStack stack, String key) { - validateTagExists(stack); - return getTag(stack).getShort(key); - } - - /** - * Gets a int from an ItemStacks NBTTag. - * - * @param stack Stack key exists on. - * @param key Key for the value. - * @return Value. - */ - public static int getInteger(ItemStack stack, String key) { - validateTagExists(stack); - return getTag(stack).getInteger(key); - } - - /** - * Gets a long from an ItemStacks NBTTag. - * - * @param stack Stack key exists on. - * @param key Key for the value. - * @return Value. - */ - public static long getLong(ItemStack stack, String key) { - validateTagExists(stack); - return getTag(stack).getLong(key); - } - - /** - * Gets a UUID from an ItemStacks NBTTag. - * - * @param stack Stack key exists on. - * @param key Key for the value. - * @return Value. - */ - public static UUID getUUID(ItemStack stack, String key) { - validateTagExists(stack); - return getTag(stack).getUniqueId(key); - } - - /** - * Gets a float from an ItemStacks NBTTag. - * - * @param stack Stack key exists on. - * @param key Key for the value. - * @return Value. - */ - public static float getFloat(ItemStack stack, String key) { - validateTagExists(stack); - return getTag(stack).getFloat(key); - } - - /** - * Gets a double from an ItemStacks NBTTag. - * - * @param stack Stack key exists on. - * @param key Key for the value. - * @return Value. - */ - public static double getDouble(ItemStack stack, String key) { - validateTagExists(stack); - return getTag(stack).getDouble(key); - } - - /** - * Gets a String from an ItemStacks NBTTag. - * - * @param stack Stack key exists on. - * @param key Key for the value. - * @return Value. - */ - public static String getString(ItemStack stack, String key) { - validateTagExists(stack); - return getTag(stack).getString(key); - } - - /** - * Gets a byte array from an ItemStacks NBTTag. - * - * @param stack Stack key exists on. - * @param key Key for the value. - * @return Value. - */ - public static byte[] getByteArray(ItemStack stack, String key) { - validateTagExists(stack); - return getTag(stack).getByteArray(key); - } - - /** - * Gets a int array from an ItemStacks NBTTag. - * - * @param stack Stack key exists on. - * @param key Key for the value. - * @return Value. - */ - public static int[] getIntArray(ItemStack stack, String key) { - validateTagExists(stack); - return getTag(stack).getIntArray(key); - } - - /** - * Gets a boolean from an ItemStacks NBTTag. - * - * @param stack Stack key exists on. - * @param key Key for the value. - * @return Value. - */ - public static boolean getBoolean(ItemStack stack, String key) { - validateTagExists(stack); - return getTag(stack).getBoolean(key); - } - - /** - * Gets a NBTTagCompound from an ItemStacks NBTTag. - * - * @param stack Stack key exists on. - * @param key Key for the value. - * @return Value. - */ - public static NBTTagCompound getCompoundTag(ItemStack stack, String key) { - validateTagExists(stack); - return getTag(stack).getCompoundTag(key); - } - - /** - * Gets a NBTTagList from an ItemStacks NBTTag. - * - * @param stack Stack key exists on. - * @param key Key for the value. - * @param type Primitive NBT Type the List should be made up of. - * @return Value. - */ - public static NBTTagList getTagList(ItemStack stack, String key, int type) { - validateTagExists(stack); - return getTag(stack).getTagList(key, type); - } - - //endregion - -} diff --git a/dependencies/main/java/codechicken/lib/util/ItemUtils.java b/dependencies/main/java/codechicken/lib/util/ItemUtils.java deleted file mode 100644 index 05e91342e2..0000000000 --- a/dependencies/main/java/codechicken/lib/util/ItemUtils.java +++ /dev/null @@ -1,188 +0,0 @@ -package codechicken.lib.util; - -import codechicken.lib.inventory.InventoryUtils; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntityFurnace; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; - -import java.util.List; - -/** - * Created by covers1624 on 6/30/2016. - * TODO, InventoryUtils needs to have things merged to here and such. - */ -public class ItemUtils { - - public static boolean isPlayerHoldingSomething(EntityPlayer player) { - return player.getHeldItemMainhand() != null || player.getHeldItemOffhand() != null; - } - - public static ItemStack getHeldStack(EntityPlayer player) { - ItemStack stack = player.getHeldItemMainhand(); - if (stack == null) { - stack = player.getHeldItemOffhand(); - } - return stack; - } - - /** - * Drops an item in the world at the given BlockPos - * - * @param world World to drop the item. - * @param pos Location to drop item. - * @param stack ItemStack to drop. - * @param velocity The velocity to add. - */ - public static void dropItem(World world, BlockPos pos, ItemStack stack, double velocity) { - double xVelocity = world.rand.nextFloat() * velocity + (1.0D - velocity) * 0.5D; - double yVelocity = world.rand.nextFloat() * velocity + (1.0D - velocity) * 0.5D; - double zVelocity = world.rand.nextFloat() * velocity + (1.0D - velocity) * 0.5D; - EntityItem entityItem = new EntityItem(world, pos.getX() + xVelocity, pos.getY() + yVelocity, pos.getZ() + zVelocity, stack); - entityItem.setPickupDelay(10); - world.spawnEntityInWorld(entityItem); - } - - /** - * Drops an item in the world at the given BlockPos - * - * @param world World to drop the item. - * @param pos Location to drop item. - * @param stack ItemStack to drop. - */ - public static void dropItem(World world, BlockPos pos, ItemStack stack) { - dropItem(world, pos, stack, 0.7D); - } - - /** - * Drops all the items in an IInventory on the ground. - * - * @param world World to drop the item. - * @param pos Position to drop item. - * @param inventory IInventory to drop. - */ - public static void dropInventory(World world, BlockPos pos, IInventory inventory) { - for (int i = 0; i < inventory.getSizeInventory(); i++) { - ItemStack stack = inventory.getStackInSlot(i); - if (stack != null && stack.stackSize > 0) { - dropItem(world, pos, stack); - } - } - } - - /** - * Copy's an ItemStack. - * - * @param stack Stack to copy. - * @param stackSize Size of the new stack. - * @return The new stack. - */ - public static ItemStack copyStack(ItemStack stack, int stackSize) { - return InventoryUtils.copyStack(stack, stackSize); - } - - /** - * Ejects an item with .3 velocity in the given direction. - * - * @param world World to spawn the item. - * @param pos Location for item to spawn. - * @param stack Stack to spawn. - * @param dir Direction to shoot. - */ - public static void ejectItem(World world, BlockPos pos, ItemStack stack, EnumFacing dir) { - pos.offset(dir); - EntityItem entity = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, stack); - entity.motionX = 0.0; - entity.motionY = 0.0; - entity.motionZ = 0.0; - - switch (dir) { - case DOWN: - entity.motionY = -0.3; - break; - case UP: - entity.motionY = 0.3; - break; - case NORTH: - entity.motionZ = -0.3; - break; - case SOUTH: - entity.motionZ = 0.3; - break; - case WEST: - entity.motionX = -0.3; - break; - case EAST: - entity.motionX = 0.3; - break; - default: - } - - entity.setPickupDelay(10); - world.spawnEntityInWorld(entity); - } - - /** - * Ejects an list of items with .3 velocity in the given direction. - * - * @param world World to spawn the item. - * @param pos Location for item to spawn. - * @param stacks Stack to spawn. - * @param dir Direction to shoot. - */ - public static void ejectItems(World world, BlockPos pos, List stacks, EnumFacing dir) { - for (ItemStack stack : stacks) { - ejectItem(world, pos, stack, dir); - } - } - - /** - * Gets the burn time for a given ItemStack. - * Will return 0 if there is no burn time on the item. - * - * @param itemStack Stack to get Burn time on. - * @return Burn time for the Stack. - */ - public static int getBurnTime(ItemStack itemStack) { - return TileEntityFurnace.getItemBurnTime(itemStack); - } - - /** - * Compares an ItemStack, Useful for comparators. - * - * @param stack1 First Stack. - * @param stack2 Second Stack. - * @return Returns the difference. - */ - public static int compareItemStack(ItemStack stack1, ItemStack stack2) { - int itemStack1ID = Item.getIdFromItem(stack1.getItem()); - int itemStack2ID = Item.getIdFromItem(stack1.getItem()); - return itemStack1ID != itemStack2ID ? itemStack1ID - itemStack2ID : (stack1.getItemDamage() == stack2.getItemDamage() ? 0 : (stack1.getItem().getHasSubtypes() ? stack1.getItemDamage() - stack2.getItemDamage() : 0)); - } - - /** - * @param stack1 The {@link ItemStack} being compared. - * @param stack2 The {@link ItemStack} to compare to. - * @return whether the two items are the same in terms of damage and itemID. - */ - public static boolean areStacksSameType(ItemStack stack1, ItemStack stack2) { - return stack1 != null && stack2 != null && (stack1.getItem() == stack2.getItem() && (!stack2.getHasSubtypes() || stack2.getItemDamage() == stack1.getItemDamage()) && ItemStack.areItemStackTagsEqual(stack2, stack1)); - } - - /** - * {@link ItemStack}s with damage 32767 are wildcards allowing all damages. Eg all colours of wool are allowed to create Beds. - * - * @param stack1 The {@link ItemStack} being compared. - * @param stack2 The {@link ItemStack} to compare to. - * @return whether the two items are the same from the perspective of a crafting inventory. - */ - public static boolean areStacksSameTypeCrafting(ItemStack stack1, ItemStack stack2) { - return stack1 != null && stack2 != null && stack1.getItem() == stack2.getItem() && (stack1.getItemDamage() == stack2.getItemDamage() || stack1.getItemDamage() == OreDictionary.WILDCARD_VALUE || stack2.getItemDamage() == OreDictionary.WILDCARD_VALUE || stack1.getItem().isDamageable()); - } -} diff --git a/dependencies/main/java/codechicken/lib/util/LangProxy.java b/dependencies/main/java/codechicken/lib/util/LangProxy.java deleted file mode 100644 index d930e05fde..0000000000 --- a/dependencies/main/java/codechicken/lib/util/LangProxy.java +++ /dev/null @@ -1,20 +0,0 @@ -package codechicken.lib.util; - -import net.minecraft.util.text.translation.I18n; - -public class LangProxy { - - public final String namespace; - - public LangProxy(String namespace) { - this.namespace = namespace + "."; - } - - public String translate(String key) { - return I18n.translateToLocal(namespace + key); - } - - public String format(String key, Object... params) { - return I18n.translateToLocalFormatted(namespace + key, params); - } -} diff --git a/dependencies/main/java/codechicken/lib/util/ReflectionManager.java b/dependencies/main/java/codechicken/lib/util/ReflectionManager.java deleted file mode 100644 index 66a3725954..0000000000 --- a/dependencies/main/java/codechicken/lib/util/ReflectionManager.java +++ /dev/null @@ -1,336 +0,0 @@ -package codechicken.lib.util; - -import codechicken.lib.asm.ObfMapping; -import org.objectweb.asm.Type; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.HashMap; - -//TODO Clean cruft and move basically everything to OBFMapping. -public class ReflectionManager { - - public static HashMap, Class> primitiveWrappers = new HashMap, Class>(); - - static { - primitiveWrappers.put(Integer.TYPE, Integer.class); - primitiveWrappers.put(Short.TYPE, Short.class); - primitiveWrappers.put(Byte.TYPE, Byte.class); - primitiveWrappers.put(Long.TYPE, Long.class); - primitiveWrappers.put(Double.TYPE, Double.class); - primitiveWrappers.put(Float.TYPE, Float.class); - primitiveWrappers.put(Boolean.TYPE, Boolean.class); - primitiveWrappers.put(Character.TYPE, Character.class); - } - - public static boolean isInstance(Class class1, Object obj) { - Class primitive = primitiveWrappers.get(class1); - if (primitive != null) { - if (primitive == Long.class && Long.class.isInstance(obj)) { - return true; - } - if ((primitive == Long.class || primitive == Integer.class) && Integer.class.isInstance(obj)) { - return true; - } - if ((primitive == Long.class || primitive == Integer.class || primitive == Short.class) && Short.class.isInstance(obj)) { - return true; - } - if ((primitive == Long.class || primitive == Integer.class || primitive == Short.class || primitive == Byte.class) && Integer.class.isInstance(obj)) { - return true; - } - - if (primitive == Double.class && Double.class.isInstance(obj)) { - return true; - } - if ((primitive == Double.class || primitive == Float.class) && Float.class.isInstance(obj)) { - return true; - } - - return primitive.isInstance(obj); - } - return class1.isInstance(obj); - } - - public static Class findClass(String name) { - return findClass(name, true); - } - - public static boolean classExists(String name) { - return findClass(name, false) != null; - } - - public static Class findClass(ObfMapping mapping) { - return findClass(mapping, true); - } - - public static Class findClass(ObfMapping mapping, boolean init) { - try { - return Class.forName(mapping.javaClass(), init, ReflectionManager.class.getClassLoader()); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static Class findClass(String name, boolean init) { - try { - return Class.forName(name, init, ReflectionManager.class.getClassLoader()); - } catch (ClassNotFoundException cnfe) { - try { - return Class.forName("net.minecraft.src." + name, init, ReflectionManager.class.getClassLoader()); - } catch (ClassNotFoundException cnfe2) { - return null; - } - } - } - - public static void setField(ObfMapping mapping, Object instance, Object value) { - try { - Field field = getField(mapping); - field.setAccessible(true); - field.set(instance, value); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static void setField(Class class1, Object instance, String name, Object value) throws IllegalArgumentException, IllegalAccessException { - setField(class1, instance, new String[] { name }, value); - } - - public static void setField(Class class1, Object instance, String[] names, Object value) throws IllegalArgumentException, IllegalAccessException { - for (Field field : class1.getDeclaredFields()) { - boolean match = false; - for (String name : names) { - if (field.getName().equals(name)) { - match = true; - break; - } - } - if (!match) { - continue; - } - - field.setAccessible(true); - field.set(instance, value); - return; - } - } - - public static void setField(Class class1, Object instance, int fieldindex, Object value) throws IllegalArgumentException, IllegalAccessException { - Field field = class1.getDeclaredFields()[fieldindex]; - field.setAccessible(true); - field.set(instance, value); - } - - /** - * Static function - * void return type - * single name - */ - @Deprecated - public static void callMethod(Class class1, String name, Object... params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { - callMethod(class1, null, new String[] { name }, params); - } - - /** - * Static function - * void return type - * single name - */ - @Deprecated - public static void callMethod(Class class1, String[] names, Object... params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { - callMethod(class1, null, names, params); - } - - /** - * void return type - * single name - */ - @Deprecated - public static void callMethod(Class class1, Object instance, String name, Object... params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { - callMethod(class1, null, instance, new String[] { name }, params); - } - - /** - * void return type - */ - @Deprecated - public static void callMethod(Class class1, Object instance, String[] names, Object... params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { - callMethod(class1, null, instance, names, params); - } - - /** - * Static method - * single name - */ - @Deprecated - public static R callMethod(Class class1, Class returntype, String name, Object... params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { - return callMethod(class1, returntype, null, new String[] { name }, params); - } - - /** - * Static method - */ - @Deprecated - public static R callMethod(Class class1, Class returntype, String[] names, Object... params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { - return callMethod(class1, returntype, null, names, params); - } - - /** - * sinlge name - */ - @Deprecated - public static R callMethod(Class class1, Class returntype, Object instance, String name, Object... params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { - return callMethod(class1, returntype, instance, new String[] { name }, params); - } - - @Deprecated - public static R callMethod(Class class1, Class returntype, Object instance, String[] names, Object... params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { - nextMethod: - for (Method method : class1.getDeclaredMethods()) { - boolean match = false; - for (String name : names) { - if (method.getName().equals(name)) { - match = true; - break; - } - } - if (!match) { - continue; - } - - Class[] paramtypes = method.getParameterTypes(); - if (paramtypes.length != params.length) { - continue; - } - - for (int i = 0; i < params.length; i++) { - if (!isInstance(paramtypes[i], params[i])) { - continue nextMethod; - } - } - - method.setAccessible(true); - return (R) method.invoke(instance, params); - } - return null; - } - - public static R callMethod(ObfMapping mapping, Class returnType, Object instance, Object... params) { - try { - return callMethod_Unsafe(mapping, returnType, instance, params); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static R callMethod_Unsafe(ObfMapping mapping, Class returnType, Object instance, Object... params) throws InvocationTargetException, IllegalAccessException { - mapping.toRuntime(); - Class clazz = findClass(mapping); - Method method = null; - for (Method m : clazz.getDeclaredMethods()) { - if (m.getName().equals(mapping.s_name) && Type.getMethodDescriptor(m).equals(mapping.s_desc)) { - method = m; - break; - } - } - if (method != null) { - method.setAccessible(true); - return (R) method.invoke(instance, params); - } - return null; - } - - public static T getField(Class class1, Class fieldType, Object instance, int fieldIndex) throws IllegalArgumentException, IllegalAccessException { - Field field = class1.getDeclaredFields()[fieldIndex]; - field.setAccessible(true); - return (T) field.get(instance); - } - - public static T getField(Class class1, Class fieldType, Object instance, String fieldName) { - try { - Field field = class1.getDeclaredField(fieldName); - field.setAccessible(true); - return (T) field.get(instance); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static T newInstance(Class class1, Object... params) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { - nextMethod: - for (Constructor constructor : class1.getDeclaredConstructors()) { - Class[] paramtypes = constructor.getParameterTypes(); - if (paramtypes.length != params.length) { - continue; - } - - for (int i = 0; i < params.length; i++) { - if (!isInstance(paramtypes[i], params[i])) { - continue nextMethod; - } - } - - constructor.setAccessible(true); - return (T) constructor.newInstance(params); - } - return null; - } - - public static boolean hasField(Class class1, String fieldName) { - try { - class1.getDeclaredField(fieldName); - return true; - } catch (NoSuchFieldException nfe) { - return false; - } - } - - public static T get(Field field, Class class1) { - return get(field, class1, null); - } - - public static T get(Field field, Class class1, Object instance) { - try { - return (T) field.get(instance); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static void set(Field field, Object value) { - set(field, null, value); - } - - public static void set(Field field, Object instance, Object value) { - try { - field.set(instance, value); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static V getField(ObfMapping mapping, Object instance, Class clazz) { - try { - Field field = getField(mapping); - return (V) field.get(instance); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static Field getField(ObfMapping mapping) { - mapping.toRuntime(); - - try { - Class clazz = ReflectionManager.class.getClassLoader().loadClass(mapping.javaClass()); - Field field = clazz.getDeclaredField(mapping.s_name); - field.setAccessible(true); - return field; - } catch (Exception e) { - throw new RuntimeException(e); - } - } -} diff --git a/dependencies/main/java/codechicken/lib/util/RotationUtils.java b/dependencies/main/java/codechicken/lib/util/RotationUtils.java deleted file mode 100644 index e9836c240f..0000000000 --- a/dependencies/main/java/codechicken/lib/util/RotationUtils.java +++ /dev/null @@ -1,177 +0,0 @@ -package codechicken.lib.util; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; - -/** - * Contains a bunch of stuff to do with rotation. - * Created by covers1624 on 6/30/2016. - */ -public class RotationUtils { - - /** - * Gets the rotation for placing a block only on the horizon. - * - * @param entity Entity placing block. - * @return Direction placed. - */ - public static EnumFacing getPlacedRotationHorizontal(EntityLivingBase entity) { - int facing = MathHelper.floor_double((entity.rotationYaw * 4F) / 360F + 0.5D) & 3; - return entityRotationToSide(facing).getOpposite(); - } - - /** - * Gets rotation for placing a block, Will use Up and Down. - * - * @param pos Pos placement is happening. - * @param entity Entity placing block. - * @return Direction placed. - */ - public static EnumFacing getPlacedRotation(BlockPos pos, EntityLivingBase entity) { - int entityRotation = (int) Math.floor(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - if (Math.abs(entity.posX - pos.getX()) < 2.0D && Math.abs(entity.posZ - pos.getZ()) < 2.0D) { - - double eyeDistance = entity.posY + 1.82D - pos.getY(); - - if (eyeDistance > 2.0D) { - return EnumFacing.DOWN; - } - - if (eyeDistance < 0.0D) { - return EnumFacing.UP; - } - } - - return entityRotationToSide(entityRotation); - } - - /** - * Short hand for getPlacedRotationHorizontal and getPlacedRotation. - * - * @param pos Pos placement is happening. - * @param entity Entity placing block. - * @param onlyHorizon True if should only obey the horizon. - * @return Direction placed. - */ - public static EnumFacing getPlacedRotation(BlockPos pos, EntityLivingBase entity, boolean onlyHorizon) { - if (onlyHorizon) { - return getPlacedRotationHorizontal(entity); - } - return getPlacedRotation(pos, entity); - } - - /** - * Rotate this Facing around the Y axis counter-clockwise (NORTH => WEST => SOUTH => EAST => NORTH) - * - * @param facing Current facing. - * @return Next facing. - */ - public static EnumFacing rotateCounterClockwise(EnumFacing facing) { - switch (facing) { - case NORTH: - return EnumFacing.WEST; - case EAST: - return EnumFacing.NORTH; - case SOUTH: - return EnumFacing.EAST; - case WEST: - return EnumFacing.SOUTH; - default: - throw new IllegalStateException("Unable to get CCW facing of " + facing); - } - } - - /** - * Rotate this Facing around the Y axis counter-clockwise (NORTH => EAST => SOUTH => WEST => NORTH) - * - * @param facing Current facing. - * @return Next facing. - */ - public static EnumFacing rotateClockwise(EnumFacing facing) { - switch (facing) { - case NORTH: - return EnumFacing.EAST; - case EAST: - return EnumFacing.SOUTH; - case SOUTH: - return EnumFacing.WEST; - case WEST: - return EnumFacing.NORTH; - default: - throw new IllegalStateException("Unable to get CW facing of " + facing); - } - } - - /** - * Rotate this Facing around all axises counter-clockwise (NORTH => SOUTH => EAST => WEST => UP => DOWN => NORTH) - * - * @param facing Current facing. - * @return Next facing. - */ - public static EnumFacing rotateForward(EnumFacing facing) { - switch (facing) { - case NORTH: - return EnumFacing.DOWN; - case DOWN: - return EnumFacing.UP; - case UP: - return EnumFacing.WEST; - case WEST: - return EnumFacing.EAST; - case EAST: - return EnumFacing.SOUTH; - case SOUTH: - return EnumFacing.NORTH; - } - return EnumFacing.NORTH; - } - - /** - * Rotate this Facing around all axises counter-clockwise (NORTH => DOWN => UP => WEST => EAST => SOUTH => NORTH) - * - * @param facing Current facing. - * @return Next facing. - */ - public static EnumFacing rotateBackwards(EnumFacing facing) { - switch (facing) { - case NORTH: - return EnumFacing.SOUTH; - case SOUTH: - return EnumFacing.EAST; - case EAST: - return EnumFacing.WEST; - case WEST: - return EnumFacing.UP; - case UP: - return EnumFacing.DOWN; - case DOWN: - return EnumFacing.NORTH; - } - return EnumFacing.NORTH; - } - - /** - * Turns Entity rotation in to EnumFacing. - * - * @param rotation The entity rotation, Generally MathHelper.floor_double((entity.rotationYaw * 4F) / 360F + 0.5D) & 3; - * @return The rotation in EnumFacing. - */ - public static EnumFacing entityRotationToSide(int rotation) { - switch (rotation) { - case 0: - return EnumFacing.SOUTH; - - case 1: - return EnumFacing.WEST; - - case 2: - return EnumFacing.NORTH; - - default: - return EnumFacing.EAST; - } - } - -} diff --git a/dependencies/main/java/codechicken/lib/util/ServerUtils.java b/dependencies/main/java/codechicken/lib/util/ServerUtils.java deleted file mode 100644 index 4b5a2fcf97..0000000000 --- a/dependencies/main/java/codechicken/lib/util/ServerUtils.java +++ /dev/null @@ -1,90 +0,0 @@ -package codechicken.lib.util; - -import codechicken.lib.gui.IGuiPacketSender; -import com.mojang.authlib.GameProfile; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.inventory.Container; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.management.PlayerProfileCache.ProfileEntry; -import net.minecraft.util.math.ChunkPos; -import net.minecraft.util.text.ITextComponent; -import net.minecraftforge.fml.common.FMLCommonHandler; - -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; - -/** - * Created by covers1624 on 22/10/2016. - */ -public class ServerUtils { - - public static MinecraftServer mc() { - return FMLCommonHandler.instance().getMinecraftServerInstance(); - } - - public static EntityPlayerMP getPlayer(String playername) { - return mc().getPlayerList().getPlayerByUsername(playername); - } - - public static List getPlayers() { - return mc().getPlayerList().getPlayerList(); - } - - public static ArrayList getPlayersInDimension(int dimension) { - ArrayList players = new ArrayList(); - for (EntityPlayer p : getPlayers()) { - if (p.dimension == dimension) { - players.add(p); - } - } - - return players; - } - - public static boolean isPlayerLoadingChunk(EntityPlayerMP player, ChunkPos chunk) { - return player.getServerWorld().getPlayerChunkMap().contains(chunk.chunkXPos, chunk.chunkZPos); - } - - public static GameProfile getGameProfile(String username) { - EntityPlayer player = getPlayer(username); - if (player != null) { - return player.getGameProfile(); - } - - //try and access it in the cache without forcing a save - username = username.toLowerCase(Locale.ROOT); - ProfileEntry cachedEntry = mc().getPlayerProfileCache().usernameToProfileEntryMap.get(username); - if (cachedEntry != null) { - return cachedEntry.getGameProfile(); - } - - //load it from the cache - return mc().getPlayerProfileCache().getGameProfileForUsername(username); - } - - public static boolean isPlayerOP(String username) { - GameProfile prof = getGameProfile(username); - return prof != null && mc().getPlayerList().canSendCommands(prof); - } - - public static boolean isPlayerOwner(String username) { - return mc().isSinglePlayer() && mc().getServerOwner().equalsIgnoreCase(username); - } - - public static void sendChatToAll(ITextComponent msg) { - for (EntityPlayer p : getPlayers()) { - p.addChatComponentMessage(msg); - } - } - - public static void openSMPContainer(EntityPlayerMP player, Container container, IGuiPacketSender packetSender) { - player.getNextWindowId(); - player.closeContainer(); - packetSender.sendPacket(player, player.currentWindowId); - player.openContainer = container; - player.openContainer.windowId = player.currentWindowId; - player.openContainer.addListener(player); - } -} diff --git a/dependencies/main/java/codechicken/lib/util/SoundUtils.java b/dependencies/main/java/codechicken/lib/util/SoundUtils.java deleted file mode 100644 index a4b385a099..0000000000 --- a/dependencies/main/java/codechicken/lib/util/SoundUtils.java +++ /dev/null @@ -1,42 +0,0 @@ -package codechicken.lib.util; - -import codechicken.lib.vec.Vector3; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.SoundCategory; -import net.minecraft.util.SoundEvent; -import net.minecraft.world.World; - -/** - * Created by covers1624 on 17/10/2016. - */ -public class SoundUtils { - - public static void playSoundAt(Entity entity, SoundCategory category, SoundEvent sound, float volume, float pitch, boolean distanceDelay) { - entity.worldObj.playSound(entity.posX, entity.posY, entity.posZ, sound, category, volume, pitch, distanceDelay); - } - - public static void playSoundAt(Entity entity, SoundCategory category, SoundEvent sound, float volume, float pitch) { - EntityPlayer player = null; - - //only assigning player on client as if triggered on server the player passed here would be omitted from hearing the sound - if (entity.worldObj.isRemote && entity instanceof EntityPlayer) { - player = (EntityPlayer) entity; - } - - entity.worldObj.playSound(player, entity.posX, entity.posY, entity.posZ, sound, category, volume, pitch); - } - - public static void playSoundAt(Entity entity, SoundCategory category, SoundEvent sound) { - playSoundAt(entity, category, sound, 1.0F, 1.0F); - } - - public static void playSoundAt(Vector3 pos, World world, SoundCategory category, SoundEvent sound, float volume, float pitch, boolean distanceDelay) { - world.playSound(pos.x, pos.y, pos.z, sound, category, volume, pitch, distanceDelay); - } - - public static void playSoundAt(Vector3 pos, World world, SoundCategory category, SoundEvent sound, float volume, float pitch) { - world.playSound(pos.x, pos.y, pos.z, sound, category, volume, pitch, false); - } - -} diff --git a/dependencies/main/java/codechicken/lib/util/TileEntityUtils.java b/dependencies/main/java/codechicken/lib/util/TileEntityUtils.java deleted file mode 100644 index d729ef2be2..0000000000 --- a/dependencies/main/java/codechicken/lib/util/TileEntityUtils.java +++ /dev/null @@ -1,62 +0,0 @@ -package codechicken.lib.util; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.InventoryLargeChest; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.items.CapabilityItemHandler; -import net.minecraftforge.items.IItemHandler; - -/** - * Created by covers1624 on 6/30/2016. - */ -public class TileEntityUtils { - - /** - * Retrieves an IInventory at the given location, Useful for receiving the entire inventory of a double chest. - */ - public static IInventory getInventory(World world, BlockPos pos) { - TileEntity tileEntity = world.getTileEntity(pos); - if (tileEntity instanceof IInventory) { - IInventory inventory = (IInventory) tileEntity; - if (inventory instanceof TileEntityChest) { - TileEntityChest first = (TileEntityChest) tileEntity; - TileEntityChest second = null; - for (BlockPos adjacentPos : BlockUtils.getAdjacent(pos, false)) { - TileEntity suspect = world.getTileEntity(adjacentPos); - if (suspect instanceof TileEntityChest) { - second = (TileEntityChest) suspect; - break; - } - } - if (second != null) { - return new InventoryLargeChest("large chest", first, second); - } - } - return inventory; - } - return null; - } - - /** - * Gets an IItemHandler at the given position. If the capability doesn't exist it returns null. - * - * @param world World the tile is in. - * @param pos Position the tile is at. - * @param facing The face of the tile to get the capability for. - * @return The IItemHandler existing on the tile. - */ - public static IItemHandler getIItemHandler(World world, BlockPos pos, EnumFacing facing) { - TileEntity tileEntity = world.getTileEntity(pos); - if (tileEntity != null) { - if (tileEntity.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing)) { - return tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing); - } - } - return null; - } - -} diff --git a/dependencies/main/java/codechicken/lib/util/TransformUtils.java b/dependencies/main/java/codechicken/lib/util/TransformUtils.java deleted file mode 100644 index 8b729ea762..0000000000 --- a/dependencies/main/java/codechicken/lib/util/TransformUtils.java +++ /dev/null @@ -1,229 +0,0 @@ -package codechicken.lib.util; - -import codechicken.lib.render.CCModelState; -import codechicken.lib.vec.Matrix4; -import com.google.common.base.Optional; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Maps; -import com.google.gson.*; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.block.model.ModelRotation; -import net.minecraft.util.JsonUtils; -import net.minecraftforge.client.model.ForgeBlockStateV1.TRSRDeserializer; -import net.minecraftforge.common.model.IModelState; -import net.minecraftforge.common.model.TRSRTransformation; - -import javax.vecmath.Vector3f; -import java.util.EnumMap; - -/** - * Created by covers1624 on 5/16/2016. - * This is mostly just extracted from the ForgeBlockStateV1. - * Credits to Rain Warrior. - *

- * If you have an idea for another transform just make a pull request. - */ -public class TransformUtils { - - private static final TRSRTransformation flipX = new TRSRTransformation(null, null, new Vector3f(-1, 1, 1), null); - - public static final Gson GSON = new GsonBuilder().registerTypeAdapter(TRSRTransformation.class, TRSRDeserializer.INSTANCE).create(); - - public static final CCModelState DEFAULT_BLOCK; - public static final CCModelState DEFAULT_ITEM; - public static final CCModelState DEFAULT_TOOL; - public static final CCModelState DEFAULT_BOW; - public static final CCModelState DEFAULT_HANDHELD_ROD; - - static { - TRSRTransformation thirdPerson = get(0, 2.5f, 0, 75, 45, 0, 0.375f); - TRSRTransformation firstPerson; - - ImmutableMap.Builder defaultBlockBuilder = ImmutableMap.builder(); - defaultBlockBuilder.put(TransformType.GUI, get(0, 0, 0, 30, 225, 0, 0.625f)); - defaultBlockBuilder.put(TransformType.GROUND, get(0, 3, 0, 0, 0, 0, 0.25f)); - defaultBlockBuilder.put(TransformType.FIXED, get(0, 0, 0, 0, 0, 0, 0.5f)); - defaultBlockBuilder.put(TransformType.THIRD_PERSON_RIGHT_HAND, thirdPerson); - defaultBlockBuilder.put(TransformType.THIRD_PERSON_LEFT_HAND, leftify(thirdPerson)); - defaultBlockBuilder.put(TransformType.FIRST_PERSON_RIGHT_HAND, get(0, 0, 0, 0, 45, 0, 0.4f)); - defaultBlockBuilder.put(TransformType.FIRST_PERSON_LEFT_HAND, get(0, 0, 0, 0, 225, 0, 0.4f)); - DEFAULT_BLOCK = new CCModelState(defaultBlockBuilder.build()); - - thirdPerson = get(0, 3, 1, 0, 0, 0, 0.55f); - firstPerson = get(1.13f, 3.2f, 1.13f, 0, -90, 25, 0.68f); - ImmutableMap.Builder defaultItemBuilder = ImmutableMap.builder(); - defaultItemBuilder.put(TransformType.GROUND, get(0, 2, 0, 0, 0, 0, 0.5f)); - defaultItemBuilder.put(TransformType.HEAD, get(0, 13, 7, 0, 180, 0, 1)); - defaultItemBuilder.put(TransformType.THIRD_PERSON_RIGHT_HAND, thirdPerson); - defaultItemBuilder.put(TransformType.THIRD_PERSON_LEFT_HAND, leftify(thirdPerson)); - defaultItemBuilder.put(TransformType.FIRST_PERSON_RIGHT_HAND, firstPerson); - defaultItemBuilder.put(TransformType.FIRST_PERSON_LEFT_HAND, leftify(firstPerson)); - DEFAULT_ITEM = new CCModelState(defaultItemBuilder.build()); - - ImmutableMap.Builder defaultToolBuilder = ImmutableMap.builder(); - defaultToolBuilder.put(TransformType.GROUND, get(0, 2, 0, 0, 0, 0, 0.5f)); - defaultToolBuilder.put(TransformType.THIRD_PERSON_RIGHT_HAND, get(0, 4, 0.5F, 0, -90, 55, 0.85F)); - defaultToolBuilder.put(TransformType.THIRD_PERSON_LEFT_HAND, get(0, 4, 0.5f, 0, 90, -55, 0.85f)); - defaultToolBuilder.put(TransformType.FIRST_PERSON_RIGHT_HAND, get(1.13f, 3.2f, 1.13f, 0, -90, 25, 0.68f)); - defaultToolBuilder.put(TransformType.FIRST_PERSON_LEFT_HAND, get(1.13f, 3.2f, 1.13f, 0, 90, -25, 0.68f)); - DEFAULT_TOOL = new CCModelState(defaultToolBuilder.build()); - - ImmutableMap.Builder defaultBowBuilder = ImmutableMap.builder(); - defaultBowBuilder.put(TransformType.GROUND, get(0, 2, 0, 0, 0, 0, 0.5f)); - defaultBowBuilder.put(TransformType.THIRD_PERSON_RIGHT_HAND, get(-1F, -2F, 2.5F, -80, 260, -40, 0.9F)); - defaultBowBuilder.put(TransformType.THIRD_PERSON_LEFT_HAND, get(-1F, -2F, 2.5F, -80, -280, 40, 0.9f)); - defaultBowBuilder.put(TransformType.FIRST_PERSON_RIGHT_HAND, get(1.13F, 3.2F, 1.13F, 0, -90, 25, 0.68f)); - defaultBowBuilder.put(TransformType.FIRST_PERSON_LEFT_HAND, get(1.13f, 3.2f, 1.13f, 0, 90, -25, 0.68f)); - DEFAULT_BOW = new CCModelState(defaultBowBuilder.build()); - - ImmutableMap.Builder defaultRodBuilder = ImmutableMap.builder(); - defaultRodBuilder.put(TransformType.GROUND, get(0, 2, 0, 0, 0, 0, 0.5f)); - defaultRodBuilder.put(TransformType.THIRD_PERSON_RIGHT_HAND, get(0F, 4F, 2.5F, 0, 90, 55, 0.85F)); - defaultRodBuilder.put(TransformType.THIRD_PERSON_LEFT_HAND, get(0F, 4F, 2.5F, 0, -90, -55, 0.85f)); - defaultRodBuilder.put(TransformType.FIRST_PERSON_RIGHT_HAND, get(0F, 1.6F, 0.8F, 0, 90, 25, 0.68f)); - defaultRodBuilder.put(TransformType.FIRST_PERSON_LEFT_HAND, get(0F, 1.6F, 0.8F, 0, -90, -25, 0.68f)); - DEFAULT_HANDHELD_ROD = new CCModelState(defaultRodBuilder.build()); - } - - public static TRSRTransformation get(float tx, float ty, float tz, float rx, float ry, float rz, float s) { - return TRSRTransformation.blockCenterToCorner(new TRSRTransformation(new Vector3f(tx / 16, ty / 16, tz / 16), TRSRTransformation.quatFromXYZDegrees(new Vector3f(rx, ry, rz)), new Vector3f(s, s, s), null)); - } - - public static TRSRTransformation leftify(TRSRTransformation transform) { - return TRSRTransformation.blockCenterToCorner(flipX.compose(TRSRTransformation.blockCornerToCenter(transform)).compose(flipX)); - } - - /** - * Reimplementation from ForgeBlockStateV1's variant Deserializer. - * - * @param json The Json that contains either ModelRotation x,y,TRSRTransforms or CCL defaults. - * @return A IModelState. - */ - public static Optional parseFromJson(JsonObject json) { - Optional ret = Optional.absent(); - if (json.has("x") || json.has("y")) { - int x = JsonUtils.getInt(json, "x", 0); - int y = JsonUtils.getInt(json, "y", 0); - ModelRotation rot = ModelRotation.getModelRotation(x, y); - ret = Optional.of(new TRSRTransformation(rot)); - if (!ret.isPresent()) { - throw new JsonParseException("Invalid BlockModelRotation x: " + x + " y: " + y); - } - } - if (json.has("transform")) { - JsonElement transformElement = json.get("transform"); - if (transformElement.isJsonPrimitive() && transformElement.getAsJsonPrimitive().isString()) { - String transform = transformElement.getAsString(); - if (transform.equals("identity")) { - ret = Optional.of(TRSRTransformation.identity()); - } else if (transform.equals("ccl:default-block")) { - ret = Optional.of(DEFAULT_BLOCK); - } else if (transform.equals("ccl:default-item")) { - ret = Optional.of(DEFAULT_ITEM); - } else if (transform.equals("ccl:default-tool")) { - ret = Optional.of(DEFAULT_TOOL); - } else if (transform.equals("ccl:default-bow")) { - ret = Optional.of(DEFAULT_BOW); - } else if (transform.equals("ccl:default-handheld-rod")) { - ret = Optional.of(DEFAULT_HANDHELD_ROD); - } - } else if (!transformElement.isJsonObject()) { - try { - TRSRTransformation base = GSON.fromJson(transformElement, TRSRTransformation.class); - ret = Optional.of(TRSRTransformation.blockCenterToCorner(base)); - } catch (JsonParseException e) { - throw new JsonParseException("transform: expected a string, object or valid base transformation, got: " + transformElement); - } - } else { - JsonObject transform = transformElement.getAsJsonObject(); - EnumMap transforms = Maps.newEnumMap(TransformType.class); - if (transform.has("thirdperson")) { - TRSRTransformation t = GSON.fromJson(transform.get("thirdperson"), TRSRTransformation.class); - transform.remove("thirdperson"); - transforms.put(TransformType.THIRD_PERSON_RIGHT_HAND, TRSRTransformation.blockCenterToCorner(t)); - } - if (transform.has("thirdperson_righthand")) { - TRSRTransformation t = GSON.fromJson(transform.get("thirdperson_righthand"), TRSRTransformation.class); - transform.remove("thirdperson_righthand"); - transforms.put(TransformType.THIRD_PERSON_RIGHT_HAND, TRSRTransformation.blockCenterToCorner(t)); - } - if (transform.has("thirdperson_lefthand")) { - TRSRTransformation t = GSON.fromJson(transform.get("thirdperson_lefthand"), TRSRTransformation.class); - transform.remove("thirdperson_lefthand"); - transforms.put(TransformType.THIRD_PERSON_LEFT_HAND, TRSRTransformation.blockCenterToCorner(t)); - } - if (transform.has("firstperson")) { - TRSRTransformation t = GSON.fromJson(transform.get("firstperson"), TRSRTransformation.class); - transform.remove("firstperson"); - transforms.put(TransformType.FIRST_PERSON_RIGHT_HAND, TRSRTransformation.blockCenterToCorner(t)); - } - if (transform.has("firstperson_righthand")) { - TRSRTransformation t = GSON.fromJson(transform.get("firstperson_righthand"), TRSRTransformation.class); - transform.remove("firstperson_righthand"); - transforms.put(TransformType.FIRST_PERSON_RIGHT_HAND, TRSRTransformation.blockCenterToCorner(t)); - } - if (transform.has("firstperson_lefthand")) { - TRSRTransformation t = GSON.fromJson(transform.get("firstperson_lefthand"), TRSRTransformation.class); - transform.remove("firstperson_lefthand"); - transforms.put(TransformType.FIRST_PERSON_LEFT_HAND, TRSRTransformation.blockCenterToCorner(t)); - } - if (transform.has("head")) { - TRSRTransformation t = GSON.fromJson(transform.get("head"), TRSRTransformation.class); - transform.remove("head"); - transforms.put(TransformType.HEAD, TRSRTransformation.blockCenterToCorner(t)); - } - if (transform.has("gui")) { - TRSRTransformation t = GSON.fromJson(transform.get("gui"), TRSRTransformation.class); - transform.remove("gui"); - transforms.put(TransformType.GUI, TRSRTransformation.blockCenterToCorner(t)); - } - if (transform.has("ground")) { - TRSRTransformation t = GSON.fromJson(transform.get("ground"), TRSRTransformation.class); - transform.remove("ground"); - transforms.put(TransformType.GROUND, TRSRTransformation.blockCenterToCorner(t)); - } - if (transform.has("fixed")) { - TRSRTransformation t = GSON.fromJson(transform.get("fixed"), TRSRTransformation.class); - transform.remove("fixed"); - transforms.put(TransformType.FIXED, TRSRTransformation.blockCenterToCorner(t)); - } - int k = transform.entrySet().size(); - if (transform.has("matrix")) { - k--; - } - if (transform.has("translation")) { - k--; - } - if (transform.has("rotation")) { - k--; - } - if (transform.has("scale")) { - k--; - } - if (transform.has("post-rotation")) { - k--; - } - if (k > 0) { - throw new JsonParseException("transform: allowed keys: 'thirdperson', 'firstperson', 'gui', 'head', 'matrix', 'translation', 'rotation', 'scale', 'post-rotation'"); - } - TRSRTransformation base = TRSRTransformation.identity(); - if (!transform.entrySet().isEmpty()) { - base = GSON.fromJson(transform, TRSRTransformation.class); - base = TRSRTransformation.blockCenterToCorner(base); - } - IModelState state; - if (transforms.isEmpty()) { - state = base; - } else { - state = new CCModelState(Maps.immutableEnumMap(transforms), Optional.of(base)); - } - ret = Optional.of(state); - } - } - return ret; - } - - public static TRSRTransformation fromMatrix4(Matrix4 matrix4) { - return new TRSRTransformation(matrix4.toMatrix4f()); - } -} diff --git a/dependencies/main/java/codechicken/lib/util/TripleABC.java b/dependencies/main/java/codechicken/lib/util/TripleABC.java deleted file mode 100644 index 4f07f45fb5..0000000000 --- a/dependencies/main/java/codechicken/lib/util/TripleABC.java +++ /dev/null @@ -1,30 +0,0 @@ -package codechicken.lib.util; - -/** - * Created by covers1624 on 8/29/2016. - * TODO Copyable. - */ -public class TripleABC { - - private final A a; - private final B b; - private final C c; - - public TripleABC(A a, B b, C c) { - this.a = a; - this.b = b; - this.c = c; - } - - public A getA() { - return a; - } - - public B getB() { - return b; - } - - public C getC() { - return c; - } -} diff --git a/dependencies/main/java/codechicken/lib/util/VectorUtils.java b/dependencies/main/java/codechicken/lib/util/VectorUtils.java deleted file mode 100644 index 787c0f47cf..0000000000 --- a/dependencies/main/java/codechicken/lib/util/VectorUtils.java +++ /dev/null @@ -1,78 +0,0 @@ -package codechicken.lib.util; - -import codechicken.lib.vec.Vector3; -import net.minecraft.util.EnumFacing; - -/** - * Created by covers1624 on 4/10/2016. - */ -public class VectorUtils { - - /** - * Calculates a normal for the given vertices. - * - * @param vertices The vertices to calculate a normal for, Expected to be a length of 3. - * @return The normal. - */ - public static Vector3 calculateNormal(Vector3... vertices) { - Vector3 diff1 = vertices[1].copy().subtract(vertices[0]); - Vector3 diff2 = vertices[2].copy().subtract(vertices[0]); - return diff1.crossProduct(diff2).normalize().copy(); - } - - /** - * Calculates the int direction a normal is facing. - * - * @param normal The normal to calculate from. - * @return The direction the normal is facing. - */ - public static int findSide(Vector3 normal) { - if (normal.y <= -0.99) { - return 0; - } - if (normal.y >= 0.99) { - return 1; - } - if (normal.z <= -0.99) { - return 2; - } - if (normal.z >= 0.99) { - return 3; - } - if (normal.x <= -0.99) { - return 4; - } - if (normal.x >= 0.99) { - return 5; - } - return -1; - } - - /** - * Calculates the EnumFacing for a given normal. - * - * @param normal The normal to calculate from. - * @return The direction the normal is facing. - */ - public static EnumFacing calcNormalSide(Vector3 normal) { - if (normal.y <= -0.99) { - return EnumFacing.DOWN; - } - if (normal.y >= 0.99) { - return EnumFacing.UP; - } - if (normal.z <= -0.99) { - return EnumFacing.NORTH; - } - if (normal.z >= 0.99) { - return EnumFacing.SOUTH; - } - if (normal.x <= -0.99) { - return EnumFacing.WEST; - } - if (normal.x >= 0.99) { - return EnumFacing.EAST; - } - return null; - } -} diff --git a/dependencies/main/java/codechicken/lib/util/VertexDataUtils.java b/dependencies/main/java/codechicken/lib/util/VertexDataUtils.java deleted file mode 100644 index d37e43c106..0000000000 --- a/dependencies/main/java/codechicken/lib/util/VertexDataUtils.java +++ /dev/null @@ -1,145 +0,0 @@ -package codechicken.lib.util; - -import codechicken.lib.math.MathHelper; -import codechicken.lib.vec.uv.UV; -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.vertex.VertexFormat; -import net.minecraft.client.renderer.vertex.VertexFormatElement; -import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.client.model.pipeline.LightUtil; -import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Created by covers1624 on 4/10/2016. - * Utilities for anything to do with raw vertex data access. - */ -public class VertexDataUtils { - - /** - * Gets the position for the element 'position' in the elements list for use in LightUtil.pack/unpack for a given format. - * - * @param format The format. - * @return The element position, -1 if it does not exist. - */ - public static int getPositionElement(VertexFormat format) { - for (int e = 0; e < format.getElementCount(); e++) { - if (format.getElement(e).isPositionElement()) { - return e; - } - } - return -1; - } - - /** - * Gets the position for the element 'normal' in the elements list for use in LightUtil.pack/unpack for a given format. - * - * @param format The format. - * @return The element position, -1 if it does not exist. - */ - public static int getNormalElement(VertexFormat format) { - for (int e = 0; e < format.getElementCount(); e++) { - if (format.getElement(e).getUsage() == EnumUsage.NORMAL) { - return e; - } - } - return -1; - } - - /** - * Gets the position for the element 'uv' in the elements list for use in LightUtil.pack/unpack for a given format. - * - * @param format The format. - * @return The element position, -1 if it does not exist. - */ - public static int getUVElement(VertexFormat format) { - for (int e = 0; e < format.getElementCount(); e++) { - if (format.getElement(e).getUsage() == EnumUsage.UV && format.getElement(e).getIndex() == 0) { - return e; - } - } - return -1; - } - - /** - * Gets the position for the element provided in the elements list for use in LightUtil.pack/unpack for a given format. - * - * @param format The format. - * @param element THe element to get. - * @return The element position, -1 if it does not exist. - */ - public static int getElement(VertexFormat format, VertexFormatElement element) { - for (int e = 0; e < format.getElementCount(); e++) { - if (format.getElement(e).equals(element)) { - return e; - } - } - return -1; - } - - /** - * Attempts to get the TextureAtlasSprite for a given UV mapping. - * This is not threaded and will search EVERY sprite loaded in the texture map. - * This is meant to be a last resort, where possible always try to avoid using this or have this be fired. - * TODO Improve searching by caching value ranges somehow. - * - * @param textureMap The TextureMap to search. - * @param uv The UV mapping to find. - * @return The TextureAtlasSprite found, returns missing icon if it hasn't been found. - */ - public static TextureAtlasSprite getSpriteForUV(TextureMap textureMap, UV uv) { - for (TextureAtlasSprite sprite : textureMap.mapUploadedSprites.values()) { - if (MathHelper.between(sprite.getMinU(), uv.u, sprite.getMaxU()) && MathHelper.between(sprite.getMinV(), uv.v, sprite.getMaxV())) { - return sprite; - } - } - return textureMap.getMissingSprite(); - } - - /** - * Copies the data from a UnpackedBakedQuad to a normal baked quad to save space in ram. - * - * @param quad The UnpackedBakedQuad to copy from. - * @return The copied BakedQuad. - */ - public static BakedQuad copyQuad(UnpackedBakedQuad quad) { - return new BakedQuad(quad.getVertexData(), quad.getTintIndex(), quad.getFace(), quad.getSprite(), quad.shouldApplyDiffuseLighting(), quad.getFormat()); - } - - public static Map> sortFaceData(List quads) { - Map> faceQuadMap = new HashMap>(); - for (BakedQuad quad : quads) { - List faceQuads = faceQuadMap.get(quad.getFace()); - if (faceQuads == null) { - faceQuads = new ArrayList(); - faceQuadMap.put(quad.getFace(), faceQuads); - } - faceQuads.add(quad); - } - return faceQuadMap; - } - - public static void fullyPackQuads(int[] packedData, float[][][] unpackedData, VertexFormat format) { - for (int e = 0; e < format.getElementCount(); e++) { - for (int v = 0; v < 4; v++) { - LightUtil.pack(unpackedData[v][e], packedData, format, v, e); - } - } - } - - public static void fullyUnPackQuads(int[] packedData, float[][][] unpackedData, VertexFormat format) { - for (int e = 0; e < format.getElementCount(); e++) { - for (int v = 0; v < 4; v++) { - LightUtil.unpack(packedData, unpackedData[v][e], format, v, e); - } - } - } - -} diff --git a/dependencies/main/java/codechicken/lib/vec/AxisCycle.java b/dependencies/main/java/codechicken/lib/vec/AxisCycle.java deleted file mode 100644 index 66636a57d3..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/AxisCycle.java +++ /dev/null @@ -1,36 +0,0 @@ -package codechicken.lib.vec; - -public class AxisCycle { - - public static Transformation[] cycles = new Transformation[] { new RedundantTransformation(), new VariableTransformation(new Matrix4(0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1)) { - @Override - public void apply(Vector3 vec) { - double d0 = vec.x; - double d1 = vec.y; - double d2 = vec.z; - vec.x = d2; - vec.y = d0; - vec.z = d1; - } - - @Override - public Transformation inverse() { - return cycles[2]; - } - }, new VariableTransformation(new Matrix4(0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1)) { - @Override - public void apply(Vector3 vec) { - double d0 = vec.x; - double d1 = vec.y; - double d2 = vec.z; - vec.x = d1; - vec.y = d2; - vec.z = d0; - } - - @Override - public Transformation inverse() { - return cycles[1]; - } - } }; -} diff --git a/dependencies/main/java/codechicken/lib/vec/BlockCoord.java b/dependencies/main/java/codechicken/lib/vec/BlockCoord.java deleted file mode 100644 index f822696ec2..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/BlockCoord.java +++ /dev/null @@ -1,261 +0,0 @@ -package codechicken.lib.vec; - -import codechicken.lib.math.MathHelper; -import codechicken.lib.util.Copyable; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; - -//TODO Find viability of keeping this, BlockPos is a thing now.. -//TODO, Maybe we should keep this and extend BlockPos.. -@Deprecated -public class BlockCoord implements Comparable, Copyable { - - public static final BlockCoord[] sideOffsets = new BlockCoord[] { new BlockCoord(0, -1, 0), new BlockCoord(0, 1, 0), new BlockCoord(0, 0, -1), new BlockCoord(0, 0, 1), new BlockCoord(-1, 0, 0), new BlockCoord(1, 0, 0) }; - - public int x; - public int y; - public int z; - - private BlockPos posCache; - - public BlockCoord(int x, int y, int z) { - this.x = x; - this.y = y; - this.z = z; - } - - public BlockCoord(BlockPos pos) { - this(pos.getX(), pos.getY(), pos.getZ()); - } - - public BlockCoord(Vector3 v) { - this(MathHelper.floor(v.x), MathHelper.floor(v.y), MathHelper.floor(v.z)); - } - - public BlockCoord(TileEntity tile) { - this(tile.getPos()); - } - - public BlockCoord(int[] ia) { - this(ia[0], ia[1], ia[2]); - } - - public BlockCoord() { - } - - /** - * @param ia int[]{y, z, x} - */ - public static BlockCoord fromAxes(int[] ia) { - return new BlockCoord(ia[2], ia[0], ia[1]); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof BlockCoord)) { - return false; - } - BlockCoord o2 = (BlockCoord) obj; - return x == o2.x && y == o2.y && z == o2.z; - } - - @Override - public int hashCode() { - return (x ^ z) * 31 + y; - } - - public int compareTo(BlockCoord o) { - if (x != o.x) { - return x < o.x ? 1 : -1; - } - if (y != o.y) { - return y < o.y ? 1 : -1; - } - if (z != o.z) { - return z < o.z ? 1 : -1; - } - return 0; - } - - public Vector3 toVector3Centered() { - return new Vector3(x + 0.5, y + 0.5, z + 0.5); - } - - public BlockCoord multiply(int i) { - x *= i; - y *= i; - z *= i; - return this; - } - - public double mag() { - return Math.sqrt(x * x + y * y + z * z); - } - - public int mag2() { - return x * x + y * y + z * z; - } - - public boolean isZero() { - return x == 0 && y == 0 && z == 0; - } - - public boolean isAxial() { - return x == 0 ? (y == 0 || z == 0) : (y == 0 && z == 0); - } - - public BlockCoord add(BlockCoord coord2) { - x += coord2.x; - y += coord2.y; - z += coord2.z; - return this; - } - - public BlockCoord add(int i, int j, int k) { - x += i; - y += j; - z += k; - return this; - } - - public BlockCoord sub(BlockCoord coord2) { - x -= coord2.x; - y -= coord2.y; - z -= coord2.z; - return this; - } - - public BlockCoord sub(int i, int j, int k) { - x -= i; - y -= j; - z -= k; - return this; - } - - public BlockCoord offset(int side) { - return offset(side, 1); - } - - public BlockCoord offset(int side, int amount) { - BlockCoord offset = sideOffsets[side]; - x += offset.x * amount; - y += offset.y * amount; - z += offset.z * amount; - return this; - } - - public BlockCoord inset(int side) { - return inset(side, 1); - } - - public BlockCoord inset(int side, int amount) { - return offset(side, -amount); - } - - public int getSide(int side) { - switch (side) { - case 0: - case 1: - return y; - case 2: - case 3: - return z; - case 4: - case 5: - return x; - } - throw new IndexOutOfBoundsException("Switch Falloff"); - } - - public BlockCoord setSide(int s, int v) { - switch (s) { - case 0: - case 1: - y = v; - break; - case 2: - case 3: - z = v; - break; - case 4: - case 5: - x = v; - break; - default: - throw new IndexOutOfBoundsException("Switch Falloff"); - } - return this; - } - - public int[] intArray() { - return new int[] { x, y, z }; - } - - public BlockPos pos() { - if (posCache == null || x != posCache.getX() || y != posCache.getY() || z != posCache.getZ()) { - posCache = new BlockPos(x, y, z); - } - return posCache; - } - - public BlockCoord copy() { - return new BlockCoord(x, y, z); - } - - public BlockCoord set(int i, int j, int k) { - x = i; - y = j; - z = k; - return this; - } - - public BlockCoord set(BlockCoord coord) { - return set(coord.x, coord.y, coord.z); - } - - public BlockCoord set(BlockPos pos) { - return set(pos.getX(), pos.getY(), pos.getZ()); - } - - public BlockCoord set(int[] ia) { - return set(ia[0], ia[1], ia[2]); - } - - public BlockCoord set(TileEntity tile) { - return set(tile.getPos()); - } - - public int toSide() { - if (!isAxial()) { - return -1; - } - if (y < 0) { - return 0; - } - if (y > 0) { - return 1; - } - if (z < 0) { - return 2; - } - if (z > 0) { - return 3; - } - if (x < 0) { - return 4; - } - if (x > 0) { - return 5; - } - - return -1; - } - - public int absSum() { - return (x < 0 ? -x : x) + (y < 0 ? -y : y) + (z < 0 ? -z : z); - } - - public String toString() { - return "(" + x + ", " + y + ", " + z + ")"; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/Cuboid6.java b/dependencies/main/java/codechicken/lib/vec/Cuboid6.java deleted file mode 100644 index 23e7fdbdcd..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/Cuboid6.java +++ /dev/null @@ -1,258 +0,0 @@ -package codechicken.lib.vec; - -import codechicken.lib.util.Copyable; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -public class Cuboid6 implements Copyable { - - public static Cuboid6 full = new Cuboid6(0, 0, 0, 1, 1, 1); - - public Vector3 min; - public Vector3 max; - - public Cuboid6() { - this(new Vector3(), new Vector3()); - } - - public Cuboid6(Vector3 min, Vector3 max) { - this.min = min; - this.max = max; - } - - public Cuboid6(AxisAlignedBB aabb) { - min = new Vector3(aabb.minX, aabb.minY, aabb.minZ); - max = new Vector3(aabb.maxX, aabb.maxY, aabb.maxZ); - } - - public Cuboid6(Cuboid6 cuboid) { - min = cuboid.min.copy(); - max = cuboid.max.copy(); - } - - public Cuboid6(double minx, double miny, double minz, double maxx, double maxy, double maxz) { - min = new Vector3(minx, miny, minz); - max = new Vector3(maxx, maxy, maxz); - } - - public AxisAlignedBB aabb() { - return new AxisAlignedBB(min.x, min.y, min.z, max.x, max.y, max.z); - } - - public Cuboid6 set(double minx, double miny, double minz, double maxx, double maxy, double maxz) { - min.set(minx, miny, minz); - max.set(maxx, maxy, maxz); - return this; - } - - public Cuboid6 set(Vector3 min, Vector3 max) { - return set(min.x, min.y, min.z, max.x, max.y, max.z); - } - - public Cuboid6 set(Cuboid6 c) { - return set(c.min.x, c.min.y, c.min.z, c.max.x, c.max.y, c.max.z); - } - - public Cuboid6 add(double dx, double dy, double dz) { - min.add(dx, dy, dz); - max.add(dx, dy, dz); - return this; - } - - public Cuboid6 add(double d) { - return add(d, d, d); - } - - public Cuboid6 add(Vector3 vec) { - return add(vec.x, vec.y, vec.z); - } - - public Cuboid6 add(BlockPos pos) { - return add(pos.getX(), pos.getY(), pos.getZ()); - } - - public Cuboid6 subtract(double dx, double dy, double dz) { - min.subtract(dx, dy, dz); - max.subtract(dx, dy, dz); - return this; - } - - public Cuboid6 subtract(double d) { - return subtract(d, d, d); - } - - public Cuboid6 subtract(Vector3 vec) { - return subtract(vec.x, vec.y, vec.z); - } - - public Cuboid6 subtract(BlockPos pos) { - return subtract(pos.getX(), pos.getY(), pos.getZ()); - } - - @Deprecated //Use subtract - public Cuboid6 sub(Vector3 vec) { - return subtract(vec); - } - - public Cuboid6 expand(double dx, double dy, double dz) { - min.subtract(dx, dy, dz); - max.add(dx, dy, dz); - return this; - } - - public Cuboid6 expand(double d) { - return expand(d, d, d); - } - - public Cuboid6 expand(Vector3 vec) { - return expand(vec.x, vec.y, vec.z); - } - - public Cuboid6 offset(Cuboid6 o) { - min.add(o.min); - max.add(o.max); - return this; - } - - public Cuboid6 enclose(double minx, double miny, double minz, double maxx, double maxy, double maxz) { - if (min.x > minx) { - min.x = minx; - } - if (min.y > miny) { - min.y = miny; - } - if (min.z > minz) { - min.z = minz; - } - if (max.x < maxx) { - max.x = maxx; - } - if (max.y < maxy) { - max.y = maxy; - } - if (max.z < maxz) { - max.z = maxz; - } - return this; - } - - public Cuboid6 enclose(double x, double y, double z) { - return enclose(x, y, z, x, y, z); - } - - public Cuboid6 enclose(Vector3 vec) { - return enclose(vec.x, vec.y, vec.z, vec.x, vec.y, vec.z); - } - - public Cuboid6 enclose(Cuboid6 c) { - return enclose(c.min.x, c.min.y, c.min.z, c.max.x, c.max.y, c.max.z); - } - - public boolean contains(double x, double y, double z) { - return min.x - 1E-5 <= x && min.y - 1E-5 <= y && min.z - 1E-5 <= z && max.x + 1E-5 >= x && max.y + 1E-5 >= y && max.z + 1E-5 >= z; - } - - public boolean contains(Vector3 vec) { - return contains(vec.x, vec.y, vec.z); - } - - public boolean intersects(Cuboid6 b) { - return max.x - 1E-5 > b.min.x && max.y - 1E-5 > b.min.y && max.z - 1E-5 > b.min.z && b.max.x - 1E-5 > min.x && b.max.y - 1E-5 > min.y && b.max.z - 1E-5 > min.z; - } - - public Vector3 center() { - return min.copy().add(max).multiply(0.5); - } - - public double getSide(int s) { - switch (s) { - case 0: - return min.y; - case 1: - return max.y; - case 2: - return min.z; - case 3: - return max.z; - case 4: - return min.x; - case 5: - return max.x; - } - throw new IndexOutOfBoundsException("Switch Falloff"); - } - - public Cuboid6 setSide(int s, double d) { - switch (s) { - case 0: - min.y = d; - break; - case 1: - max.y = d; - break; - case 2: - min.z = d; - break; - case 3: - max.z = d; - break; - case 4: - min.x = d; - break; - case 5: - max.x = d; - break; - default: - throw new IndexOutOfBoundsException("Switch Falloff"); - } - return this; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof Cuboid6)) { - return false; - } - Cuboid6 c = (Cuboid6) obj; - return min.equals(c.min) && max.equals(c.max); - } - - public boolean equalsT(Cuboid6 c) { - return min.equalsT(c.min) && max.equalsT(c.max); - } - - public Cuboid6 copy() { - return new Cuboid6(this); - } - - public String toString() { - MathContext cont = new MathContext(4, RoundingMode.HALF_UP); - return "Cuboid: (" + new BigDecimal(min.x, cont) + ", " + new BigDecimal(min.y, cont) + ", " + new BigDecimal(min.z, cont) + ") -> (" + new BigDecimal(max.x, cont) + ", " + new BigDecimal(max.y, cont) + ", " + new BigDecimal(max.z, cont) + ")"; - } - - public Cuboid6 apply(Transformation t) { - t.apply(min); - t.apply(max); - double temp; - if (min.x > max.x) { - temp = min.x; - min.x = max.x; - max.x = temp; - } - if (min.y > max.y) { - temp = min.y; - min.y = max.y; - max.y = temp; - } - if (min.z > max.z) { - temp = min.z; - min.z = max.z; - max.z = temp; - } - return this; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/CuboidCoord.java b/dependencies/main/java/codechicken/lib/vec/CuboidCoord.java deleted file mode 100644 index e4882bf6e3..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/CuboidCoord.java +++ /dev/null @@ -1,242 +0,0 @@ -package codechicken.lib.vec; - -import codechicken.lib.util.Copyable; -import net.minecraft.util.math.AxisAlignedBB; - -import java.util.Iterator; - -public class CuboidCoord implements Iterable, Copyable { - - public BlockCoord min; - public BlockCoord max; - - public CuboidCoord() { - min = new BlockCoord(); - max = new BlockCoord(); - } - - public CuboidCoord(BlockCoord min, BlockCoord max) { - this.min = min; - this.max = max; - } - - public CuboidCoord(BlockCoord coord) { - this(coord, coord.copy()); - } - - public CuboidCoord(int[] ia) { - this(ia[0], ia[1], ia[2], ia[3], ia[4], ia[5]); - } - - public CuboidCoord(int x1, int y1, int z1, int x2, int y2, int z2) { - this(new BlockCoord(x1, y1, z1), new BlockCoord(x2, y2, z2)); - } - - public AxisAlignedBB toAABB() { - return bounds().aabb(); - } - - public int[] intArray() { - return new int[] { min.x, min.y, min.z, max.x, max.y, max.z }; - } - - public Cuboid6 bounds() { - return new Cuboid6(min.x, min.y, min.z, max.x + 1, max.y + 1, max.z + 1); - } - - public CuboidCoord set(int x1, int y1, int z1, int x2, int y2, int z2) { - min.set(x1, y1, z1); - max.set(x2, y2, z2); - return this; - } - - public CuboidCoord set(BlockCoord min, BlockCoord max) { - return set(min.x, min.y, min.z, max.x, max.y, max.z); - } - - public CuboidCoord set(BlockCoord coord) { - return set(coord.x, coord.y, coord.z, coord.x, coord.y, coord.z); - } - - public CuboidCoord set(int[] ia) { - return set(ia[0], ia[1], ia[2], ia[3], ia[4], ia[5]); - } - - public CuboidCoord expand(int dx, int dy, int dz) { - max.add(dx, dy, dz); - min.sub(dx, dy, dz); - return this; - } - - public CuboidCoord expand(int d) { - return expand(d, d, d); - } - - public CuboidCoord expand(int side, int amount) { - if (side % 2 == 0) { //negative side - min = min.offset(side, amount); - } else { - max = max.offset(side, amount); - } - return this; - } - - public CuboidCoord include(int x, int y, int z) { - if (x < min.x) { - min.x = x; - } else if (x > max.x) { - max.x = x; - } - if (y < min.y) { - min.y = y; - } else if (y > max.y) { - max.y = y; - } - if (z < min.z) { - min.z = z; - } else if (z > max.z) { - max.z = z; - } - return this; - } - - public CuboidCoord include(BlockCoord coord) { - return include(coord.x, coord.y, coord.z); - } - - public boolean contains(int x, int y, int z) { - return x >= min.x && x <= max.x && y >= min.y && y <= max.y && z >= min.z && z <= max.z; - } - - public boolean contains(BlockCoord coord) { - return contains(coord.x, coord.y, coord.z); - } - - public boolean intersects(CuboidCoord c) { - return max.x >= c.min.x && max.y >= c.min.y && max.z >= c.min.z && min.x <= c.max.x && min.y <= c.max.y && min.z <= c.max.z; - } - - public int volume() { - return (max.x - min.x + 1) * (max.y - min.y + 1) * (max.z - min.z + 1); - } - - public Vector3 centerVec() { - return new Vector3(min.x + (max.x - min.x + 1) / 2D, min.y + (max.y - min.y + 1) / 2D, min.z + (max.z - min.z + 1) / 2D); - } - - public BlockCoord center() { - return new BlockCoord(min.x + (max.x - min.x) / 2, min.y + (max.y - min.y) / 2, min.z + (max.z - min.z) / 2); - } - - //TODO: Remove this? Does not conform... - public BlockCoord getCenter(BlockCoord store) { - store.set(min.x + (max.x - min.x) / 2, min.y + (max.y - min.y) / 2, min.z + (max.z - min.z) / 2); - return store; - } - - public int size(int s) { - switch (s) { - case 0: - case 1: - return max.y - min.y + 1; - case 2: - case 3: - return max.z - min.z + 1; - case 4: - case 5: - return max.x - min.x + 1; - default: - return 0; - } - } - - public int getSide(int s) { - switch (s) { - case 0: - return min.y; - case 1: - return max.y; - case 2: - return min.z; - case 3: - return max.z; - case 4: - return min.x; - case 5: - return max.x; - } - throw new IndexOutOfBoundsException("Switch Falloff"); - } - - public CuboidCoord setSide(int s, int v) { - switch (s) { - case 0: - min.y = v; - break; - case 1: - max.y = v; - break; - case 2: - min.z = v; - break; - case 3: - max.z = v; - break; - case 4: - min.x = v; - break; - case 5: - max.x = v; - break; - default: - throw new IndexOutOfBoundsException("Switch Falloff"); - } - return this; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof CuboidCoord)) { - return false; - } - CuboidCoord c = (CuboidCoord) obj; - return min.equals(c.min) && max.equals(c.max); - } - - public CuboidCoord copy() { - return new CuboidCoord(min.copy(), max.copy()); - } - - public Iterator iterator() { - return new Iterator() { - BlockCoord b = null; - - public boolean hasNext() { - return b == null || !b.equals(max); - } - - public BlockCoord next() { - if (b == null) { - b = min.copy(); - } else { - if (b.z != max.z) { - b.z++; - } else { - b.z = min.z; - if (b.y != max.y) { - b.y++; - } else { - b.y = min.y; - b.x++; - } - } - } - return b.copy(); - } - - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/ITransformation.java b/dependencies/main/java/codechicken/lib/vec/ITransformation.java deleted file mode 100644 index 1df3c3b736..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/ITransformation.java +++ /dev/null @@ -1,50 +0,0 @@ -package codechicken.lib.vec; - -/** - * Abstract supertype for any VectorN transformation - * - * @param The vector type - * @param The transformation type - */ -public abstract class ITransformation { - - /** - * Applies this transformation to vec - */ - public abstract void apply(Vector vec); - - /** - * @param point The point to apply this transformation around - * @return Wraps this transformation in a translation to point and then back from point - */ - public abstract Transformation at(Vector point); - - /** - * Creates a TransformationList composed of this transformation followed by t - * If this is a TransformationList, the transformation will be appended and this returned - */ - public abstract Transformation with(Transformation t); - - /** - * Returns a simplified transformation that performs this, followed by next. If such a transformation does not exist, returns null - */ - public Transformation merge(Transformation next) { - return null; - } - - /** - * Returns true if this transformation is redundant, eg. Scale(1, 1, 1), Translation(0, 0, 0) or Rotation(0, a, b, c) - */ - public boolean isRedundant() { - return false; - } - - public abstract Transformation inverse(); - - /** - * Scala ++ operator - */ - public Transformation $plus$plus(Transformation t) { - return with(t); - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/IrreversibleTransformationException.java b/dependencies/main/java/codechicken/lib/vec/IrreversibleTransformationException.java deleted file mode 100644 index 94dbcfea1a..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/IrreversibleTransformationException.java +++ /dev/null @@ -1,16 +0,0 @@ -package codechicken.lib.vec; - -@SuppressWarnings ("serial") -public class IrreversibleTransformationException extends RuntimeException { - - public ITransformation t; - - public IrreversibleTransformationException(ITransformation t) { - this.t = t; - } - - @Override - public String getMessage() { - return "The following transformation is irreversible:\n" + t; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/Line3.java b/dependencies/main/java/codechicken/lib/vec/Line3.java deleted file mode 100644 index 93589975e9..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/Line3.java +++ /dev/null @@ -1,40 +0,0 @@ -package codechicken.lib.vec; - -public class Line3 { - - public static final double tol = 0.0001D; - - public Vector3 pt1; - public Vector3 pt2; - - public Line3(Vector3 pt1, Vector3 pt2) { - this.pt1 = pt1; - this.pt2 = pt2; - } - - public Line3() { - this(new Vector3(), new Vector3()); - } - - public static boolean intersection2D(Line3 line1, Line3 line2, Vector3 store) { - // calculate differences - double xD1 = line1.pt2.x - line1.pt1.x; - double zD1 = line1.pt2.z - line1.pt1.z; - double xD2 = line2.pt2.x - line2.pt1.x; - double zD2 = line2.pt2.z - line2.pt1.z; - - double xD3 = line1.pt1.x - line2.pt1.x; - double zD3 = line1.pt1.z - line2.pt1.z; - - double div = zD2 * xD1 - xD2 * zD1; - if (div == 0)//lines are parallel - { - return false; - } - double ua = (xD2 * zD3 - zD2 * xD3) / div; - store.set(line1.pt1.x + ua * xD1, 0, line1.pt1.z + ua * zD1); - - return store.x >= Math.min(line1.pt1.x, line1.pt2.x) - tol && store.x >= Math.min(line2.pt1.x, line2.pt2.x) - tol && store.z >= Math.min(line1.pt1.z, line1.pt2.z) - tol && store.z >= Math.min(line2.pt1.z, line2.pt2.z) - tol && store.x <= Math.max(line1.pt1.x, line1.pt2.x) + tol && store.x <= Math.max(line2.pt1.x, line2.pt2.x) + tol && store.z <= Math.max(line1.pt1.z, line1.pt2.z) + tol && store.z <= Math.max(line2.pt1.z, line2.pt2.z) + tol; - - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/Matrix4.java b/dependencies/main/java/codechicken/lib/vec/Matrix4.java deleted file mode 100644 index 02f41a2d4a..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/Matrix4.java +++ /dev/null @@ -1,368 +0,0 @@ -package codechicken.lib.vec; - -import codechicken.lib.util.Copyable; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import javax.vecmath.Matrix4d; -import javax.vecmath.Matrix4f; -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.FloatBuffer; - -//TODO Decompose to individual transforms. -public class Matrix4 extends Transformation implements Copyable { - - private static FloatBuffer glBuf = ByteBuffer.allocateDirect(16 * 8).order(ByteOrder.nativeOrder()).asFloatBuffer(); - - //m - public double m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33; - - public Matrix4() { - m00 = m11 = m22 = m33 = 1; - } - - public Matrix4(double d00, double d01, double d02, double d03, double d10, double d11, double d12, double d13, double d20, double d21, double d22, double d23, double d30, double d31, double d32, double d33) { - m00 = d00; - m01 = d01; - m02 = d02; - m03 = d03; - m10 = d10; - m11 = d11; - m12 = d12; - m13 = d13; - m20 = d20; - m21 = d21; - m22 = d22; - m23 = d23; - m30 = d30; - m31 = d31; - m32 = d32; - m33 = d33; - } - - public Matrix4(Matrix4 mat) { - set(mat); - } - - public Matrix4 setIdentity() { - m00 = m11 = m22 = m33 = 1; - m01 = m02 = m03 = m10 = m12 = m13 = m20 = m21 = m23 = m30 = m31 = m32 = 0; - - return this; - } - - public Matrix4 translate(Vector3 vec) { - m03 += m00 * vec.x + m01 * vec.y + m02 * vec.z; - m13 += m10 * vec.x + m11 * vec.y + m12 * vec.z; - m23 += m20 * vec.x + m21 * vec.y + m22 * vec.z; - m33 += m30 * vec.x + m31 * vec.y + m32 * vec.z; - - return this; - } - - public Matrix4 scale(Vector3 vec) { - m00 *= vec.x; - m10 *= vec.x; - m20 *= vec.x; - m30 *= vec.x; - m01 *= vec.y; - m11 *= vec.y; - m21 *= vec.y; - m31 *= vec.y; - m02 *= vec.z; - m12 *= vec.z; - m22 *= vec.z; - m32 *= vec.z; - - return this; - } - - public Matrix4 rotate(double angle, Vector3 axis) { - double c = Math.cos(angle); - double s = Math.sin(angle); - double mc = 1.0f - c; - double xy = axis.x * axis.y; - double yz = axis.y * axis.z; - double xz = axis.x * axis.z; - double xs = axis.x * s; - double ys = axis.y * s; - double zs = axis.z * s; - - double f00 = axis.x * axis.x * mc + c; - double f10 = xy * mc + zs; - double f20 = xz * mc - ys; - - double f01 = xy * mc - zs; - double f11 = axis.y * axis.y * mc + c; - double f21 = yz * mc + xs; - - double f02 = xz * mc + ys; - double f12 = yz * mc - xs; - double f22 = axis.z * axis.z * mc + c; - - double t00 = m00 * f00 + m01 * f10 + m02 * f20; - double t10 = m10 * f00 + m11 * f10 + m12 * f20; - double t20 = m20 * f00 + m21 * f10 + m22 * f20; - double t30 = m30 * f00 + m31 * f10 + m32 * f20; - double t01 = m00 * f01 + m01 * f11 + m02 * f21; - double t11 = m10 * f01 + m11 * f11 + m12 * f21; - double t21 = m20 * f01 + m21 * f11 + m22 * f21; - double t31 = m30 * f01 + m31 * f11 + m32 * f21; - m02 = m00 * f02 + m01 * f12 + m02 * f22; - m12 = m10 * f02 + m11 * f12 + m12 * f22; - m22 = m20 * f02 + m21 * f12 + m22 * f22; - m32 = m30 * f02 + m31 * f12 + m32 * f22; - m00 = t00; - m10 = t10; - m20 = t20; - m30 = t30; - m01 = t01; - m11 = t11; - m21 = t21; - m31 = t31; - - return this; - } - - public Matrix4 rotate(Rotation rotation) { - rotation.apply(this); - return this; - } - - public Matrix4 leftMultiply(Matrix4 mat) { - double n00 = m00 * mat.m00 + m10 * mat.m01 + m20 * mat.m02 + m30 * mat.m03; - double n01 = m01 * mat.m00 + m11 * mat.m01 + m21 * mat.m02 + m31 * mat.m03; - double n02 = m02 * mat.m00 + m12 * mat.m01 + m22 * mat.m02 + m32 * mat.m03; - double n03 = m03 * mat.m00 + m13 * mat.m01 + m23 * mat.m02 + m33 * mat.m03; - double n10 = m00 * mat.m10 + m10 * mat.m11 + m20 * mat.m12 + m30 * mat.m13; - double n11 = m01 * mat.m10 + m11 * mat.m11 + m21 * mat.m12 + m31 * mat.m13; - double n12 = m02 * mat.m10 + m12 * mat.m11 + m22 * mat.m12 + m32 * mat.m13; - double n13 = m03 * mat.m10 + m13 * mat.m11 + m23 * mat.m12 + m33 * mat.m13; - double n20 = m00 * mat.m20 + m10 * mat.m21 + m20 * mat.m22 + m30 * mat.m23; - double n21 = m01 * mat.m20 + m11 * mat.m21 + m21 * mat.m22 + m31 * mat.m23; - double n22 = m02 * mat.m20 + m12 * mat.m21 + m22 * mat.m22 + m32 * mat.m23; - double n23 = m03 * mat.m20 + m13 * mat.m21 + m23 * mat.m22 + m33 * mat.m23; - double n30 = m00 * mat.m30 + m10 * mat.m31 + m20 * mat.m32 + m30 * mat.m33; - double n31 = m01 * mat.m30 + m11 * mat.m31 + m21 * mat.m32 + m31 * mat.m33; - double n32 = m02 * mat.m30 + m12 * mat.m31 + m22 * mat.m32 + m32 * mat.m33; - double n33 = m03 * mat.m30 + m13 * mat.m31 + m23 * mat.m32 + m33 * mat.m33; - - m00 = n00; - m01 = n01; - m02 = n02; - m03 = n03; - m10 = n10; - m11 = n11; - m12 = n12; - m13 = n13; - m20 = n20; - m21 = n21; - m22 = n22; - m23 = n23; - m30 = n30; - m31 = n31; - m32 = n32; - m33 = n33; - - return this; - } - - public Matrix4 multiply(Matrix4 mat) { - double n00 = m00 * mat.m00 + m01 * mat.m10 + m02 * mat.m20 + m03 * mat.m30; - double n01 = m00 * mat.m01 + m01 * mat.m11 + m02 * mat.m21 + m03 * mat.m31; - double n02 = m00 * mat.m02 + m01 * mat.m12 + m02 * mat.m22 + m03 * mat.m32; - double n03 = m00 * mat.m03 + m01 * mat.m13 + m02 * mat.m23 + m03 * mat.m33; - double n10 = m10 * mat.m00 + m11 * mat.m10 + m12 * mat.m20 + m13 * mat.m30; - double n11 = m10 * mat.m01 + m11 * mat.m11 + m12 * mat.m21 + m13 * mat.m31; - double n12 = m10 * mat.m02 + m11 * mat.m12 + m12 * mat.m22 + m13 * mat.m32; - double n13 = m10 * mat.m03 + m11 * mat.m13 + m12 * mat.m23 + m13 * mat.m33; - double n20 = m20 * mat.m00 + m21 * mat.m10 + m22 * mat.m20 + m23 * mat.m30; - double n21 = m20 * mat.m01 + m21 * mat.m11 + m22 * mat.m21 + m23 * mat.m31; - double n22 = m20 * mat.m02 + m21 * mat.m12 + m22 * mat.m22 + m23 * mat.m32; - double n23 = m20 * mat.m03 + m21 * mat.m13 + m22 * mat.m23 + m23 * mat.m33; - double n30 = m30 * mat.m00 + m31 * mat.m10 + m32 * mat.m20 + m33 * mat.m30; - double n31 = m30 * mat.m01 + m31 * mat.m11 + m32 * mat.m21 + m33 * mat.m31; - double n32 = m30 * mat.m02 + m31 * mat.m12 + m32 * mat.m22 + m33 * mat.m32; - double n33 = m30 * mat.m03 + m31 * mat.m13 + m32 * mat.m23 + m33 * mat.m33; - - m00 = n00; - m01 = n01; - m02 = n02; - m03 = n03; - m10 = n10; - m11 = n11; - m12 = n12; - m13 = n13; - m20 = n20; - m21 = n21; - m22 = n22; - m23 = n23; - m30 = n30; - m31 = n31; - m32 = n32; - m33 = n33; - - return this; - } - - public Matrix4 transpose() { - double n00 = m00; - double n10 = m01; - double n20 = m02; - double n30 = m03; - double n01 = m10; - double n11 = m11; - double n21 = m12; - double n31 = m13; - double n02 = m20; - double n12 = m21; - double n22 = m22; - double n32 = m23; - double n03 = m30; - double n13 = m31; - double n23 = m32; - double n33 = m33; - - m00 = n00; - m01 = n01; - m02 = n02; - m03 = n03; - m10 = n10; - m11 = n11; - m12 = n12; - m13 = n13; - m20 = n20; - m21 = n21; - m22 = n22; - m23 = n23; - m30 = n30; - m31 = n31; - m32 = n32; - m33 = n33; - - return this; - } - - public Matrix4 copy() { - return new Matrix4(this); - } - - public Matrix4 set(Matrix4 mat) { - m00 = mat.m00; - m01 = mat.m01; - m02 = mat.m02; - m03 = mat.m03; - m10 = mat.m10; - m11 = mat.m11; - m12 = mat.m12; - m13 = mat.m13; - m20 = mat.m20; - m21 = mat.m21; - m22 = mat.m22; - m23 = mat.m23; - m30 = mat.m30; - m31 = mat.m31; - m32 = mat.m32; - m33 = mat.m33; - - return this; - } - - public Matrix4d toMatrix4d() { - double[] matrix = new double[16]; - matrix[0] = m00; - matrix[1] = m01; - matrix[2] = m02; - matrix[3] = m03; - matrix[4] = m10; - matrix[5] = m11; - matrix[6] = m12; - matrix[7] = m13; - matrix[8] = m20; - matrix[9] = m21; - matrix[10] = m22; - matrix[11] = m23; - matrix[12] = m30; - matrix[13] = m31; - matrix[14] = m32; - matrix[15] = m33; - return new Matrix4d(matrix); - } - - public Matrix4f toMatrix4f() { - float[] matrix = new float[16]; - matrix[0] = (float) m00; - matrix[1] = (float) m01; - matrix[2] = (float) m02; - matrix[3] = (float) m03; - matrix[4] = (float) m10; - matrix[5] = (float) m11; - matrix[6] = (float) m12; - matrix[7] = (float) m13; - matrix[8] = (float) m20; - matrix[9] = (float) m21; - matrix[10] = (float) m22; - matrix[11] = (float) m23; - matrix[12] = (float) m30; - matrix[13] = (float) m31; - matrix[14] = (float) m32; - matrix[15] = (float) m33; - return new Matrix4f(matrix); - } - - @Override - public void apply(Matrix4 mat) { - mat.multiply(this); - } - - private void mult3x3(Vector3 vec) { - double x = m00 * vec.x + m01 * vec.y + m02 * vec.z; - double y = m10 * vec.x + m11 * vec.y + m12 * vec.z; - double z = m20 * vec.x + m21 * vec.y + m22 * vec.z; - - vec.x = x; - vec.y = y; - vec.z = z; - } - - @Override - public void apply(Vector3 vec) { - mult3x3(vec); - vec.add(m03, m13, m23); - } - - @Override - public void applyN(Vector3 vec) { - mult3x3(vec); - vec.normalize(); - } - - @Override - public String toString() { - MathContext cont = new MathContext(4, RoundingMode.HALF_UP); - return "[" + new BigDecimal(m00, cont) + "," + new BigDecimal(m01, cont) + "," + new BigDecimal(m02, cont) + "," + new BigDecimal(m03, cont) + "]\n" + "[" + new BigDecimal(m10, cont) + "," + new BigDecimal(m11, cont) + "," + new BigDecimal(m12, cont) + "," + new BigDecimal(m13, cont) + "]\n" + "[" + new BigDecimal(m20, cont) + "," + new BigDecimal(m21, cont) + "," + new BigDecimal(m22, cont) + "," + new BigDecimal(m23, cont) + "]\n" + "[" + new BigDecimal(m30, cont) + "," + new BigDecimal(m31, cont) + "," + new BigDecimal(m32, cont) + "," + new BigDecimal(m33, cont) + "]"; - } - - public Matrix4 apply(Transformation t) { - t.apply(this); - return this; - } - - @Override - @SideOnly (Side.CLIENT) - public void glApply() { - glBuf.put((float) m00).put((float) m10).put((float) m20).put((float) m30).put((float) m01).put((float) m11).put((float) m21).put((float) m31).put((float) m02).put((float) m12).put((float) m22).put((float) m32).put((float) m03).put((float) m13).put((float) m23).put((float) m33); - glBuf.flip(); - GlStateManager.multMatrix(glBuf); - } - - @Override - public Transformation inverse() { - throw new IrreversibleTransformationException(this);//Don't waste your cpu with matrix inverses - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/Quat.java b/dependencies/main/java/codechicken/lib/vec/Quat.java deleted file mode 100644 index ae91c230d3..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/Quat.java +++ /dev/null @@ -1,139 +0,0 @@ -package codechicken.lib.vec; - -import codechicken.lib.math.MathHelper; -import codechicken.lib.util.Copyable; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -public class Quat implements Copyable { - - public double x; - public double y; - public double z; - public double s; - - public Quat() { - s = 1; - x = 0; - y = 0; - z = 0; - } - - public Quat(Quat quat) { - x = quat.x; - y = quat.y; - z = quat.z; - s = quat.s; - } - - public Quat(double d, double d1, double d2, double d3) { - x = d1; - y = d2; - z = d3; - s = d; - } - - public Quat set(Quat quat) { - x = quat.x; - y = quat.y; - z = quat.z; - s = quat.s; - - return this; - } - - public Quat set(double d, double d1, double d2, double d3) { - x = d1; - y = d2; - z = d3; - s = d; - - return this; - } - - public static Quat aroundAxis(double ax, double ay, double az, double angle) { - return new Quat().setAroundAxis(ax, ay, az, angle); - } - - public static Quat aroundAxis(Vector3 axis, double angle) { - return aroundAxis(axis.x, axis.y, axis.z, angle); - } - - public Quat setAroundAxis(double ax, double ay, double az, double angle) { - angle *= 0.5; - double d4 = MathHelper.sin(angle); - return set(MathHelper.cos(angle), ax * d4, ay * d4, az * d4); - } - - public Quat setAroundAxis(Vector3 axis, double angle) { - return setAroundAxis(axis.x, axis.y, axis.z, angle); - } - - public Quat multiply(Quat quat) { - double d = s * quat.s - x * quat.x - y * quat.y - z * quat.z; - double d1 = s * quat.x + x * quat.s - y * quat.z + z * quat.y; - double d2 = s * quat.y + x * quat.z + y * quat.s - z * quat.x; - double d3 = s * quat.z - x * quat.y + y * quat.x + z * quat.s; - s = d; - x = d1; - y = d2; - z = d3; - - return this; - } - - public Quat rightMultiply(Quat quat) { - double d = s * quat.s - x * quat.x - y * quat.y - z * quat.z; - double d1 = s * quat.x + x * quat.s + y * quat.z - z * quat.y; - double d2 = s * quat.y - x * quat.z + y * quat.s + z * quat.x; - double d3 = s * quat.z + x * quat.y - y * quat.x + z * quat.s; - s = d; - x = d1; - y = d2; - z = d3; - - return this; - } - - public double mag() { - return Math.sqrt(x * x + y * y + z * z + s * s); - } - - public Quat normalize() { - double d = mag(); - if (d != 0) { - d = 1 / d; - x *= d; - y *= d; - z *= d; - s *= d; - } - - return this; - } - - public Quat copy() { - return new Quat(this); - } - - public void rotate(Vector3 vec) { - double d = -x * vec.x - y * vec.y - z * vec.z; - double d1 = s * vec.x + y * vec.z - z * vec.y; - double d2 = s * vec.y - x * vec.z + z * vec.x; - double d3 = s * vec.z + x * vec.y - y * vec.x; - vec.x = d1 * s - d * x - d2 * z + d3 * y; - vec.y = d2 * s - d * y + d1 * z - d3 * x; - vec.z = d3 * s - d * z - d1 * y + d2 * x; - } - - public String toString() { - MathContext cont = new MathContext(4, RoundingMode.HALF_UP); - return "Quat(" + new BigDecimal(s, cont) + ", " + new BigDecimal(x, cont) + ", " + new BigDecimal(y, cont) + ", " + new BigDecimal(z, cont) + ")"; - } - - public Rotation rotation() { - return new Rotation(this); - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/Rectangle4i.java b/dependencies/main/java/codechicken/lib/vec/Rectangle4i.java deleted file mode 100644 index 866cb7855c..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/Rectangle4i.java +++ /dev/null @@ -1,97 +0,0 @@ -package codechicken.lib.vec; - -public class Rectangle4i { - - public int x; - public int y; - public int w; - public int h; - - public Rectangle4i() { - } - - public Rectangle4i(int x, int y, int w, int h) { - this.x = x; - this.y = y; - this.w = w; - this.h = h; - } - - public int x1() { - return x; - } - - public int y1() { - return y; - } - - public int x2() { - return x + w - 1; - } - - public int y2() { - return y + h - 1; - } - - public void set(int x, int y, int w, int h) { - this.x = x; - this.y = y; - this.w = w; - this.h = h; - } - - public Rectangle4i offset(int dx, int dy) { - x += dx; - y += dy; - return this; - } - - public Rectangle4i include(int px, int py) { - if (px < x) { - expand(px - x, 0); - } - if (px >= x + w) { - expand(px - x - w + 1, 0); - } - if (py < y) { - expand(0, py - y); - } - if (py >= y + h) { - expand(0, py - y - h + 1); - } - return this; - } - - public Rectangle4i include(Rectangle4i r) { - include(r.x, r.y); - return include(r.x2(), r.y2()); - } - - public Rectangle4i expand(int px, int py) { - if (px > 0) { - w += px; - } else { - x += px; - w -= px; - } - if (py > 0) { - h += py; - } else { - y += py; - h -= py; - } - return this; - } - - public boolean contains(int px, int py) { - return x <= px && px < x + w && y <= py && py < y + h; - } - - public boolean intersects(Rectangle4i r) { - return r.x + r.w > x && r.x < x + w && r.y + r.h > y && r.y < y + h; - } - - public int area() { - return w * h; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/RedundantTransformation.java b/dependencies/main/java/codechicken/lib/vec/RedundantTransformation.java deleted file mode 100644 index e314a21518..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/RedundantTransformation.java +++ /dev/null @@ -1,49 +0,0 @@ -package codechicken.lib.vec; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public class RedundantTransformation extends Transformation { - - @Override - public void apply(Vector3 vec) { - } - - @Override - public void apply(Matrix4 mat) { - } - - @Override - public void applyN(Vector3 normal) { - } - - @Override - public Transformation at(Vector3 point) { - return this; - } - - @Override - @SideOnly (Side.CLIENT) - public void glApply() { - } - - @Override - public Transformation inverse() { - return this; - } - - @Override - public Transformation merge(Transformation next) { - return next; - } - - @Override - public boolean isRedundant() { - return true; - } - - @Override - public String toString() { - return "Nothing()"; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/Rotation.java b/dependencies/main/java/codechicken/lib/vec/Rotation.java deleted file mode 100644 index c4956392db..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/Rotation.java +++ /dev/null @@ -1,280 +0,0 @@ -package codechicken.lib.vec; - -import codechicken.lib.math.MathHelper; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -public class Rotation extends Transformation { - - /** - * Clockwise pi/2 about y looking down - */ - public static Transformation[] quarterRotations = new Transformation[] { new RedundantTransformation(), new VariableTransformation(new Matrix4(0, 0, -1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1)) { - @Override - public void apply(Vector3 vec) { - double d1 = vec.x; - double d2 = vec.z; - vec.x = -d2; - vec.z = d1; - } - - @Override - public Transformation inverse() { - return quarterRotations[3]; - } - }, new VariableTransformation(new Matrix4(-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1)) { - @Override - public void apply(Vector3 vec) { - vec.x = -vec.x; - vec.z = -vec.z; - } - - @Override - public Transformation inverse() { - return this; - } - }, new VariableTransformation(new Matrix4(0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1)) { - @Override - public void apply(Vector3 vec) { - double d1 = vec.x; - double d2 = vec.z; - vec.x = d2; - vec.z = -d1; - } - - @Override - public Transformation inverse() { - return quarterRotations[1]; - } - } }; - - public static Transformation[] sideRotations = new Transformation[] { new RedundantTransformation(), new VariableTransformation(new Matrix4(1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1)) { - @Override - public void apply(Vector3 vec) { - vec.y = -vec.y; - vec.z = -vec.z; - } - - @Override - public Transformation inverse() { - return this; - } - }, new VariableTransformation(new Matrix4(1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1)) { - @Override - public void apply(Vector3 vec) { - double d1 = vec.y; - double d2 = vec.z; - vec.y = -d2; - vec.z = d1; - } - - @Override - public Transformation inverse() { - return sideRotations[3]; - } - }, new VariableTransformation(new Matrix4(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1)) { - @Override - public void apply(Vector3 vec) { - double d1 = vec.y; - double d2 = vec.z; - vec.y = d2; - vec.z = -d1; - } - - @Override - public Transformation inverse() { - return sideRotations[2]; - } - }, new VariableTransformation(new Matrix4(0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)) { - @Override - public void apply(Vector3 vec) { - double d0 = vec.x; - double d1 = vec.y; - vec.x = d1; - vec.y = -d0; - } - - @Override - public Transformation inverse() { - return sideRotations[5]; - } - }, new VariableTransformation(new Matrix4(0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)) { - @Override - public void apply(Vector3 vec) { - double d0 = vec.x; - double d1 = vec.y; - vec.x = -d1; - vec.y = d0; - } - - @Override - public Transformation inverse() { - return sideRotations[4]; - } - } }; - - public static Vector3[] axes = new Vector3[] { new Vector3(0, -1, 0), new Vector3(0, 1, 0), new Vector3(0, 0, -1), new Vector3(0, 0, 1), new Vector3(-1, 0, 0), new Vector3(1, 0, 0) }; - - public static int[] sideRotMap = new int[] { 3, 4, 2, 5, 3, 5, 2, 4, 1, 5, 0, 4, 1, 4, 0, 5, 1, 2, 0, 3, 1, 3, 0, 2 }; - - public static int[] rotSideMap = new int[] { -1, -1, 2, 0, 1, 3, -1, -1, 2, 0, 3, 1, 2, 0, -1, -1, 3, 1, 2, 0, -1, -1, 1, 3, 2, 0, 1, 3, -1, -1, 2, 0, 3, 1, -1, -1 }; - - /** - * Rotate pi/2 * this offset for [side] about y axis before rotating to the side for the rotation indicies to line up - */ - public static int[] sideRotOffsets = new int[] { 0, 2, 2, 0, 1, 3 }; - - public static int rotateSide(int s, int r) { - return sideRotMap[s << 2 | r]; - } - - /** - * Reverse of rotateSide - */ - public static int rotationTo(int s1, int s2) { - if ((s1 & 6) == (s2 & 6)) { - throw new IllegalArgumentException("Faces " + s1 + " and " + s2 + " are opposites"); - } - return rotSideMap[s1 * 6 + s2]; - } - - /** - * @param player The placing player, used for obtaining the look vector - * @param side The side of the block being placed on - * @return The rotation for the face == side^1 - */ - public static int getSidedRotation(EntityPlayer player, int side) { - Vector3 look = new Vector3(player.getLook(1)); - double max = 0; - int maxr = 0; - for (int r = 0; r < 4; r++) { - Vector3 axis = Rotation.axes[rotateSide(side ^ 1, r)]; - double d = look.scalarProject(axis); - if (d > max) { - max = d; - maxr = r; - } - } - return maxr; - } - - /** - * @return The rotation quat for side 0 and rotation 0 to side s with rotation r - */ - public static Transformation sideOrientation(int s, int r) { - return quarterRotations[(r + sideRotOffsets[s]) % 4].with(sideRotations[s]); - } - - /** - * @param entity The placing entity, used for obtaining the look vector - * @return The side towards which the entity is most directly looking. - */ - public static int getSideFromLookAngle(EntityLivingBase entity) { - Vector3 look = new Vector3(entity.getLook(1)); - double max = 0; - int maxs = 0; - for (int s = 0; s < 6; s++) { - double d = look.scalarProject(axes[s]); - if (d > max) { - max = d; - maxs = s; - } - } - return maxs; - } - - public double angle; - public Vector3 axis; - - private Quat quat; - - public Rotation(double angle, Vector3 axis) { - this.angle = angle; - this.axis = axis; - } - - public Rotation(double angle, double x, double y, double z) { - this(angle, new Vector3(x, y, z)); - } - - public Rotation(Quat quat) { - this.quat = quat; - - angle = Math.acos(quat.s) * 2; - if (angle == 0) { - axis = new Vector3(0, 1, 0); - } else { - double sa = Math.sin(angle * 0.5); - axis = new Vector3(quat.x / sa, quat.y / sa, quat.z / sa); - } - } - - @Override - public void apply(Vector3 vec) { - if (quat == null) { - quat = Quat.aroundAxis(axis, angle); - } - - vec.rotate(quat); - } - - @Override - public void applyN(Vector3 normal) { - apply(normal); - } - - @Override - public void apply(Matrix4 mat) { - mat.rotate(angle, axis); - } - - public Quat toQuat() { - if (quat == null) { - quat = Quat.aroundAxis(axis, angle); - } - return quat; - } - - @Override - @SideOnly (Side.CLIENT) - public void glApply() { - GlStateManager.rotate((float) (angle * MathHelper.todeg), (float) axis.x, (float) axis.y, (float) axis.z); - } - - @Override - public Transformation inverse() { - return new Rotation(-angle, axis); - } - - @Override - public Transformation merge(Transformation next) { - if (next instanceof Rotation) { - Rotation r = (Rotation) next; - if (r.axis.equalsT(axis)) { - return new Rotation(angle + r.angle, axis); - } - - return new Rotation(toQuat().copy().multiply(r.toQuat())); - } - - return null; - } - - @Override - public boolean isRedundant() { - return MathHelper.between(-1E-5, angle, 1E-5); - } - - @Override - public String toString() { - MathContext cont = new MathContext(4, RoundingMode.HALF_UP); - return "Rotation(" + new BigDecimal(angle, cont) + ", " + new BigDecimal(axis.x, cont) + ", " + new BigDecimal(axis.y, cont) + ", " + new BigDecimal(axis.z, cont) + ")"; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/Scale.java b/dependencies/main/java/codechicken/lib/vec/Scale.java deleted file mode 100644 index 76f4df4d46..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/Scale.java +++ /dev/null @@ -1,71 +0,0 @@ -package codechicken.lib.vec; - -import net.minecraft.client.renderer.GlStateManager; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -public class Scale extends Transformation { - - public Vector3 factor; - - public Scale(Vector3 factor) { - this.factor = factor; - } - - public Scale(double factor) { - this(new Vector3(factor, factor, factor)); - } - - public Scale(double x, double y, double z) { - this(new Vector3(x, y, z)); - } - - @Override - public void apply(Vector3 vec) { - vec.multiply(factor); - } - - @Override - public void applyN(Vector3 normal) { - } - - @Override - public void apply(Matrix4 mat) { - mat.scale(factor); - } - - @Override - @SideOnly (Side.CLIENT) - public void glApply() { - GlStateManager.scale(factor.x, factor.y, factor.z); - } - - @Override - public Transformation inverse() { - return new Scale(1 / factor.x, 1 / factor.y, 1 / factor.z); - } - - @Override - public Transformation merge(Transformation next) { - if (next instanceof Scale) { - return new Scale(factor.copy().multiply(((Scale) next).factor)); - } - - return null; - } - - @Override - public boolean isRedundant() { - return factor.equalsT(Vector3.one); - } - - @Override - public String toString() { - MathContext cont = new MathContext(4, RoundingMode.HALF_UP); - return "Scale(" + new BigDecimal(factor.x, cont) + ", " + new BigDecimal(factor.y, cont) + ", " + new BigDecimal(factor.z, cont) + ")"; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/SwapYZ.java b/dependencies/main/java/codechicken/lib/vec/SwapYZ.java deleted file mode 100644 index ad256dd681..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/SwapYZ.java +++ /dev/null @@ -1,20 +0,0 @@ -package codechicken.lib.vec; - -public class SwapYZ extends VariableTransformation { - - public SwapYZ() { - super(new Matrix4(1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1)); - } - - @Override - public void apply(Vector3 vec) { - double vz = vec.z; - vec.z = vec.y; - vec.y = vz; - } - - @Override - public Transformation inverse() { - return this; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/Transformation.java b/dependencies/main/java/codechicken/lib/vec/Transformation.java deleted file mode 100644 index 3f9119d6cc..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/Transformation.java +++ /dev/null @@ -1,58 +0,0 @@ -package codechicken.lib.vec; - -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.IVertexOperation; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -/** - * Abstract supertype for any 3D vector transformation - */ -public abstract class Transformation extends ITransformation implements IVertexOperation { - - public static final int operationIndex = CCRenderState.registerOperation(); - - /** - * Applies this transformation to a normal (doesn't translate) - * - * @param normal The normal to transform - */ - public abstract void applyN(Vector3 normal); - - /** - * Applies this transformation to a matrix as a multiplication on the right hand side. - * - * @param mat The matrix to combine this transformation with - */ - public abstract void apply(Matrix4 mat); - - public Transformation at(Vector3 point) { - return new TransformationList(new Translation(-point.x, -point.y, -point.z), this, point.translation()); - } - - public TransformationList with(Transformation t) { - return new TransformationList(this, t); - } - - @SideOnly (Side.CLIENT) - public abstract void glApply(); - - @Override - public boolean load(CCRenderState state) { - state.pipeline.addRequirement(state.normalAttrib.operationID()); - return !isRedundant(); - } - - @Override - public void operate(CCRenderState state) { - apply(state.vert.vec); - if (state.normalAttrib.active) { - applyN(state.normal); - } - } - - @Override - public int operationID() { - return operationIndex; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/TransformationList.java b/dependencies/main/java/codechicken/lib/vec/TransformationList.java deleted file mode 100644 index aba6449c64..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/TransformationList.java +++ /dev/null @@ -1,175 +0,0 @@ -package codechicken.lib.vec; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.ArrayList; -import java.util.Iterator; - -public class TransformationList extends Transformation { - - private ArrayList transformations = new ArrayList(); - private Matrix4 mat; - - public TransformationList(Transformation... transforms) { - for (Transformation t : transforms) { - if (t instanceof TransformationList) { - transformations.addAll(((TransformationList) t).transformations); - } else { - transformations.add(t); - } - } - - compact(); - } - - public Matrix4 compile() { - if (mat == null) { - mat = new Matrix4(); - for (int i = transformations.size() - 1; i >= 0; i--) { - transformations.get(i).apply(mat); - } - } - return mat; - } - - /** - * Returns a global space matrix as opposed to an object space matrix (reverse application order) - * - * @return - */ - public Matrix4 reverseCompile() { - Matrix4 mat = new Matrix4(); - for (Transformation t : transformations) { - t.apply(mat); - } - return mat; - } - - @Override - public void apply(Vector3 vec) { - if (mat != null) { - mat.apply(vec); - } else { - for (int i = 0; i < transformations.size(); i++) { - transformations.get(i).apply(vec); - } - } - } - - @Override - public void applyN(Vector3 normal) { - if (mat != null) { - mat.applyN(normal); - } else { - for (int i = 0; i < transformations.size(); i++) { - transformations.get(i).applyN(normal); - } - } - } - - @Override - public void apply(Matrix4 mat) { - mat.multiply(compile()); - } - - @Override - public TransformationList with(Transformation t) { - if (t.isRedundant()) { - return this; - } - - mat = null;//matrix invalid - if (t instanceof TransformationList) { - transformations.addAll(((TransformationList) t).transformations); - } else { - transformations.add(t); - } - - compact(); - return this; - } - - public TransformationList prepend(Transformation t) { - if (t.isRedundant()) { - return this; - } - - mat = null;//matrix invalid - if (t instanceof TransformationList) { - transformations.addAll(0, ((TransformationList) t).transformations); - } else { - transformations.add(0, t); - } - - compact(); - return this; - } - - private void compact() { - ArrayList newList = new ArrayList(transformations.size()); - Iterator iterator = transformations.iterator(); - Transformation prev = null; - while (iterator.hasNext()) { - Transformation t = iterator.next(); - if (t.isRedundant()) { - continue; - } - - if (prev != null) { - Transformation m = prev.merge(t); - if (m == null) { - newList.add(prev); - } else if (m.isRedundant()) { - t = null; - } else { - t = m; - } - } - prev = t; - } - if (prev != null) { - newList.add(prev); - } - - if (newList.size() < transformations.size()) { - transformations = newList; - mat = null; - } - - if (transformations.size() > 3 && mat == null) { - compile(); - } - } - - @Override - public boolean isRedundant() { - return transformations.size() == 0; - } - - @Override - @SideOnly (Side.CLIENT) - public void glApply() { - for (int i = transformations.size() - 1; i >= 0; i--) { - transformations.get(i).glApply(); - } - } - - @Override - public Transformation inverse() { - TransformationList rev = new TransformationList(); - for (int i = transformations.size() - 1; i >= 0; i--) { - rev.with(transformations.get(i).inverse()); - } - return rev; - } - - @Override - public String toString() { - String s = ""; - for (Transformation t : transformations) { - s += "\n" + t.toString(); - } - return s.trim(); - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/Translation.java b/dependencies/main/java/codechicken/lib/vec/Translation.java deleted file mode 100644 index 46378bc2b8..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/Translation.java +++ /dev/null @@ -1,73 +0,0 @@ -package codechicken.lib.vec; - -import net.minecraft.client.renderer.GlStateManager; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -//TODO Constructor for BlockPos. -public class Translation extends Transformation { - - public Vector3 vec; - - public Translation(Vector3 vec) { - this.vec = vec; - } - - public Translation(double x, double y, double z) { - this(new Vector3(x, y, z)); - } - - @Override - public void apply(Vector3 vec) { - vec.add(this.vec); - } - - @Override - public void applyN(Vector3 normal) { - } - - @Override - public void apply(Matrix4 mat) { - mat.translate(vec); - } - - @Override - public Transformation at(Vector3 point) { - return this; - } - - @Override - @SideOnly (Side.CLIENT) - public void glApply() { - GlStateManager.translate(vec.x, vec.y, vec.z); - } - - @Override - public Transformation inverse() { - return new Translation(-vec.x, -vec.y, -vec.z); - } - - @Override - public Transformation merge(Transformation next) { - if (next instanceof Translation) { - return new Translation(vec.copy().add(((Translation) next).vec)); - } - - return null; - } - - @Override - public boolean isRedundant() { - return vec.equalsT(Vector3.zero); - } - - @Override - public String toString() { - MathContext cont = new MathContext(4, RoundingMode.HALF_UP); - return "Translation(" + new BigDecimal(vec.x, cont) + ", " + new BigDecimal(vec.y, cont) + ", " + new BigDecimal(vec.z, cont) + ")"; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/VariableTransformation.java b/dependencies/main/java/codechicken/lib/vec/VariableTransformation.java deleted file mode 100644 index 6f968d7b90..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/VariableTransformation.java +++ /dev/null @@ -1,29 +0,0 @@ -package codechicken.lib.vec; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public abstract class VariableTransformation extends Transformation { - - public Matrix4 mat; - - public VariableTransformation(Matrix4 mat) { - this.mat = mat; - } - - @Override - public void applyN(Vector3 normal) { - apply(normal); - } - - @Override - public void apply(Matrix4 mat) { - mat.multiply(this.mat); - } - - @Override - @SideOnly (Side.CLIENT) - public void glApply() { - mat.glApply(); - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/Vector3.java b/dependencies/main/java/codechicken/lib/vec/Vector3.java deleted file mode 100644 index 1635942b19..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/Vector3.java +++ /dev/null @@ -1,541 +0,0 @@ -package codechicken.lib.vec; - -import codechicken.lib.math.MathHelper; -import codechicken.lib.util.Copyable; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import org.lwjgl.util.vector.Vector3f; -import org.lwjgl.util.vector.Vector4f; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -public class Vector3 implements Copyable { - - public static Vector3 zero = new Vector3(); - public static Vector3 one = new Vector3(1, 1, 1); - public static Vector3 center = new Vector3(0.5, 0.5, 0.5); - - public double x; - public double y; - public double z; - - public Vector3() { - } - - public Vector3(double d, double d1, double d2) { - x = d; - y = d1; - z = d2; - } - - public Vector3(Vector3 vec) { - x = vec.x; - y = vec.y; - z = vec.z; - } - - public Vector3(double[] da) { - this(da[0], da[1], da[2]); - } - - public Vector3(float[] fa) { - this(fa[0], fa[1], fa[2]); - } - - public Vector3(Vec3d vec) { - x = vec.xCoord; - y = vec.yCoord; - z = vec.zCoord; - } - - @Deprecated // use Vector3.fromBlockPos //TODO, 1.11 move this to Vec3i - public Vector3(BlockPos pos) { - x = pos.getX(); - y = pos.getY(); - z = pos.getZ(); - } - - public static Vector3 fromBlockPos(BlockPos pos) { - return new Vector3(pos.getX(), pos.getY(), pos.getZ()); - } - - public static Vector3 fromBlockPosCenter(BlockPos pos) { - return fromBlockPos(pos).add(0.5); - } - - public static Vector3 fromEntity(Entity e) { - return new Vector3(e.posX, e.posY, e.posZ); - } - - public static Vector3 fromEntityCenter(Entity e) { - return new Vector3(e.posX, e.posY - e.getYOffset() + e.height / 2, e.posZ); - } - - public static Vector3 fromTile(TileEntity tile) { - return fromBlockPos(tile.getPos()); - } - - public static Vector3 fromTileCenter(TileEntity tile) { - return fromTile(tile).add(0.5); - } - - public static Vector3 fromAxes(double[] da) { - return new Vector3(da[2], da[0], da[1]); - } - - public static Vector3 fromAxes(float[] fa) { - return new Vector3(fa[2], fa[0], fa[1]); - } - - public static Vector3 fromArray(double[] da) { - return new Vector3(da[0], da[1], da[2]); - } - - public static Vector3 fromArray(float[] fa) { - return new Vector3(fa[0], fa[1], fa[2]); - } - - public Vec3d vec3() { - return new Vec3d(x, y, z); - } - - public BlockPos pos() { - return new BlockPos(x, y, z); - } - - @SideOnly (Side.CLIENT) - public Vector3f vector3f() { - return new Vector3f((float) x, (float) y, (float) z); - } - - @SideOnly (Side.CLIENT) - public Vector4f vector4f() { - return new Vector4f((float) x, (float) y, (float) z, 1); - } - - @SideOnly (Side.CLIENT) - public void glVertex() { - GlStateManager.glVertex3f((float) x, (float) y, (float) z); - } - - public Vector3 set(double x1, double y1, double z1) { - x = x1; - y = y1; - z = z1; - return this; - } - - public Vector3 set(double d) { - return set(d, d, d); - } - - public Vector3 set(Vector3 vec) { - return set(vec.x, vec.y, vec.z); - } - - public Vector3 set(double[] da) { - return set(da[0], da[1], da[2]); - } - - public Vector3 set(float[] fa) { - return set(fa[0], fa[1], fa[2]); - } - - public Vector3 add(double dx, double dy, double dz) { - x += dx; - y += dy; - z += dz; - return this; - } - - public Vector3 add(double d) { - return add(d, d, d); - } - - public Vector3 add(Vector3 vec) { - return add(vec.x, vec.y, vec.z); - } - - public Vector3 add(BlockPos pos) { - return add(pos.getX(), pos.getY(), pos.getZ()); - } - - public Vector3 subtract(double dx, double dy, double dz) { - x -= dx; - y -= dy; - z -= dz; - return this; - } - - public Vector3 subtract(double d) { - return subtract(d, d, d); - } - - public Vector3 subtract(Vector3 vec) { - return subtract(vec.x, vec.y, vec.z); - } - - public Vector3 subtract(BlockPos pos) { - return subtract(pos.getX(), pos.getY(), pos.getZ()); - } - - @Deprecated //Use subtract - public Vector3 sub(Vector3 vec) { - return subtract(vec); - } - - @Deprecated //Use subtract - public Vector3 sub(BlockPos pos) { - return subtract(pos); - } - - public Vector3 multiply(double fx, double fy, double fz) { - x *= fx; - y *= fy; - z *= fz; - return this; - } - - public Vector3 multiply(double f) { - return multiply(f, f, f); - } - - public Vector3 multiply(Vector3 f) { - return multiply(f.x, f.y, f.z); - } - - public Vector3 divide(double fx, double fy, double fz) { - x /= fx; - y /= fy; - z /= fz; - return this; - } - - public Vector3 divide(double f) { - return divide(f, f, f); - } - - public Vector3 divide(Vector3 vec) { - return divide(vec.x, vec.y, vec.z); - } - - public Vector3 divide(BlockPos pos) { - return divide(pos.getX(), pos.getY(), pos.getZ()); - } - - public Vector3 floor() { - x = MathHelper.floor(x); - y = MathHelper.floor(y); - z = MathHelper.floor(z); - return this; - } - - public Vector3 celi() { - x = MathHelper.ceil(x); - y = MathHelper.ceil(y); - z = MathHelper.ceil(z); - return this; - } - - public double mag() { - return Math.sqrt(x * x + y * y + z * z); - } - - public double magSquared() { - return x * x + y * y + z * z; - } - - public Vector3 negate() { - x = -x; - y = -y; - z = -z; - return this; - } - - public Vector3 normalize() { - double d = mag(); - if (d != 0) { - multiply(1 / d); - } - return this; - } - - public double dotProduct(double x1, double y1, double z1) { - return x1 * x + y1 * y + z1 * z; - } - - public double dotProduct(Vector3 vec) { - double d = vec.x * x + vec.y * y + vec.z * z; - - if (d > 1 && d < 1.00001) { - d = 1; - } else if (d < -1 && d > -1.00001) { - d = -1; - } - return d; - } - - public Vector3 crossProduct(Vector3 vec) { - double d = y * vec.z - z * vec.y; - double d1 = z * vec.x - x * vec.z; - double d2 = x * vec.y - y * vec.x; - x = d; - y = d1; - z = d2; - return this; - } - - public Vector3 perpendicular() { - if (z == 0) { - return zCrossProduct(); - } - return xCrossProduct(); - } - - public Vector3 xCrossProduct() { - double d = z; - double d1 = -y; - x = 0; - y = d; - z = d1; - return this; - } - - public Vector3 zCrossProduct() { - double d = y; - double d1 = -x; - x = d; - y = d1; - z = 0; - return this; - } - - public Vector3 yCrossProduct() { - double d = -z; - double d1 = x; - x = d; - y = 0; - z = d1; - return this; - } - - public double scalarProject(Vector3 b) { - double l = b.mag(); - return l == 0 ? 0 : dotProduct(b) / l; - } - - public Vector3 project(Vector3 b) { - double l = b.magSquared(); - if (l == 0) { - set(0, 0, 0); - return this; - } - double m = dotProduct(b) / l; - set(b).multiply(m); - return this; - } - - public Vector3 rotate(double angle, Vector3 axis) { - Quat.aroundAxis(axis.copy().normalize(), angle).rotate(this); - return this; - } - - public Vector3 rotate(Quat rotator) { - rotator.rotate(this); - return this; - } - - public double angle(Vector3 vec) { - return Math.acos(copy().normalize().dotProduct(vec.copy().normalize())); - } - - public Vector3 YZintercept(Vector3 end, double px) { - double dx = end.x - x; - double dy = end.y - y; - double dz = end.z - z; - - if (dx == 0) { - return null; - } - - double d = (px - x) / dx; - if (MathHelper.between(-1E-5, d, 1E-5)) { - return this; - } - - if (!MathHelper.between(0, d, 1)) { - return null; - } - - x = px; - y += d * dy; - z += d * dz; - return this; - } - - public Vector3 XZintercept(Vector3 end, double py) { - double dx = end.x - x; - double dy = end.y - y; - double dz = end.z - z; - - if (dy == 0) { - return null; - } - - double d = (py - y) / dy; - if (MathHelper.between(-1E-5, d, 1E-5)) { - return this; - } - - if (!MathHelper.between(0, d, 1)) { - return null; - } - - x += d * dx; - y = py; - z += d * dz; - return this; - } - - public Vector3 XYintercept(Vector3 end, double pz) { - double dx = end.x - x; - double dy = end.y - y; - double dz = end.z - z; - - if (dz == 0) { - return null; - } - - double d = (pz - z) / dz; - if (MathHelper.between(-1E-5, d, 1E-5)) { - return this; - } - - if (!MathHelper.between(0, d, 1)) { - return null; - } - - x += d * dx; - y += d * dy; - z = pz; - return this; - } - - public boolean isZero() { - return x == 0 && y == 0 && z == 0; - } - - public boolean isAxial() { - return x == 0 ? (y == 0 || z == 0) : (y == 0 && z == 0); - } - - public double getSide(int side) { - switch (side) { - case 0: - case 1: - return y; - case 2: - case 3: - return z; - case 4: - case 5: - return x; - } - throw new IndexOutOfBoundsException("Switch Falloff"); - } - - public Vector3 setSide(int s, double v) { - switch (s) { - case 0: - case 1: - y = v; - break; - case 2: - case 3: - z = v; - break; - case 4: - case 5: - x = v; - break; - default: - throw new IndexOutOfBoundsException("Switch Falloff"); - } - return this; - } - - @Override - public boolean equals(Object o) { - if (!(o instanceof Vector3)) { - return false; - } - Vector3 v = (Vector3) o; - return x == v.x && y == v.y && z == v.z; - } - - /** - * Equals method with tolerance - * - * @return true if this is equal to v within +-1E-5 - */ - public boolean equalsT(Vector3 v) { - return MathHelper.between(x - 1E-5, v.x, x + 1E-5) && MathHelper.between(y - 1E-5, v.y, y + 1E-5) && MathHelper.between(z - 1E-5, v.z, z + 1E-5); - } - - public Vector3 copy() { - return new Vector3(this); - } - - public String toString() { - MathContext cont = new MathContext(4, RoundingMode.HALF_UP); - return "Vector3(" + new BigDecimal(x, cont) + ", " + new BigDecimal(y, cont) + ", " + new BigDecimal(z, cont) + ")"; - } - - public Translation translation() { - return new Translation(this); - } - - public Vector3 apply(Transformation t) { - t.apply(this); - return this; - } - - public Vector3 $tilde() { - return normalize(); - } - - public Vector3 unary_$tilde() { - return normalize(); - } - - public Vector3 $plus(Vector3 v) { - return add(v); - } - - public Vector3 $minus(Vector3 v) { - return subtract(v); - } - - public Vector3 $times(double d) { - return multiply(d); - } - - public Vector3 $div(double d) { - return multiply(1 / d); - } - - public Vector3 $times(Vector3 v) { - return crossProduct(v); - } - - public double $dot$times(Vector3 v) { - return dotProduct(v); - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/Vertex5.java b/dependencies/main/java/codechicken/lib/vec/Vertex5.java deleted file mode 100644 index 9f759ac923..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/Vertex5.java +++ /dev/null @@ -1,77 +0,0 @@ -package codechicken.lib.vec; - -import codechicken.lib.util.Copyable; -import codechicken.lib.vec.uv.UV; -import codechicken.lib.vec.uv.UVTransformation; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -public class Vertex5 implements Copyable { - - public Vector3 vec; - public UV uv; - - public Vertex5() { - this(new Vector3(), new UV()); - } - - public Vertex5(Vector3 vert, UV uv) { - this.vec = vert; - this.uv = uv; - } - - public Vertex5(Vector3 vert, double u, double v) { - this(vert, new UV(u, v)); - } - - public Vertex5(double x, double y, double z, double u, double v) { - this(x, y, z, u, v, 0); - } - - public Vertex5(double x, double y, double z, double u, double v, int tex) { - this(new Vector3(x, y, z), new UV(u, v, tex)); - } - - public Vertex5 set(double x, double y, double z, double u, double v) { - vec.set(x, y, z); - uv.set(u, v); - return this; - } - - public Vertex5 set(double x, double y, double z, double u, double v, int tex) { - vec.set(x, y, z); - uv.set(u, v, tex); - return this; - } - - public Vertex5 set(Vertex5 vert) { - vec.set(vert.vec); - uv.set(vert.uv); - return this; - } - - public Vertex5(Vertex5 vertex5) { - this(vertex5.vec.copy(), vertex5.uv.copy()); - } - - public Vertex5 copy() { - return new Vertex5(this); - } - - public String toString() { - MathContext cont = new MathContext(4, RoundingMode.HALF_UP); - return "Vertex: (" + new BigDecimal(vec.x, cont) + ", " + new BigDecimal(vec.y, cont) + ", " + new BigDecimal(vec.z, cont) + ") " + "(" + new BigDecimal(uv.u, cont) + ", " + new BigDecimal(uv.v, cont) + ") (" + uv.tex + ")"; - } - - public Vertex5 apply(Transformation t) { - vec.apply(t); - return this; - } - - public Vertex5 apply(UVTransformation t) { - uv.apply(t); - return this; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/uv/IconTransformation.java b/dependencies/main/java/codechicken/lib/vec/uv/IconTransformation.java deleted file mode 100644 index a06d97927a..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/uv/IconTransformation.java +++ /dev/null @@ -1,31 +0,0 @@ -package codechicken.lib.vec.uv; - -import codechicken.lib.render.CCRenderState; -import codechicken.lib.vec.IrreversibleTransformationException; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; - -public class IconTransformation extends UVTransformation { - - public TextureAtlasSprite icon; - - public IconTransformation(TextureAtlasSprite icon) { - this.icon = icon; - } - - @Override - public void operate(CCRenderState state) { - super.operate(state); - state.sprite = icon; - } - - @Override - public void apply(UV uv) { - uv.u = icon.getInterpolatedU(uv.u * 16); - uv.v = icon.getInterpolatedV(uv.v * 16); - } - - @Override - public UVTransformation inverse() { - throw new IrreversibleTransformationException(this); - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/uv/IconVertexRangeUVTransform.java b/dependencies/main/java/codechicken/lib/vec/uv/IconVertexRangeUVTransform.java deleted file mode 100644 index 11b94e292c..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/uv/IconVertexRangeUVTransform.java +++ /dev/null @@ -1,112 +0,0 @@ -package codechicken.lib.vec.uv; - -import codechicken.lib.math.MathHelper; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.util.TripleABC; -import codechicken.lib.vec.IrreversibleTransformationException; -import com.google.common.collect.ImmutableList; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; - -import java.util.LinkedList; -import java.util.List; - -/** - * Created by covers1624 on 8/29/2016. - * This UVTransform is used to assign "reserved" vertex indexes for an icon transform. - */ -public class IconVertexRangeUVTransform extends UVTransformation { - - private final ImmutableList> transformMap; - - private IconVertexRangeUVTransform(List> transformMap) { - this.transformMap = ImmutableList.copyOf(transformMap); - } - - /** - * Creates a new Builder for the IconVertexRangeUVTransform. - * - * @return The Builder. - */ - public static Builder builder() { - return new Builder(); - } - - @Override - public void operate(CCRenderState state) { - UV uv = state.vert.uv; - int index = state.vertexIndex; - TextureAtlasSprite sprite = getSpriteForVertexIndex(index); - if (sprite == null) { - return; - } - uv.u = sprite.getInterpolatedU(uv.u * 16); - uv.v = sprite.getInterpolatedV(uv.v * 16); - state.sprite = getSpriteForVertexIndex(state.vertexIndex); - } - - @Override - public void apply(UV uv) { - //We override operate as we need CCRS access. - } - - @Override - public UVTransformation inverse() { - throw new IrreversibleTransformationException(this); - } - - /** - * Retrieves a TextureAtlasSprite from the internal map based on a vertex index. - * - * @param index The vertex index. - * @return Returns the Icon, Null if no transform for the vertex index. - */ - public TextureAtlasSprite getSpriteForVertexIndex(int index) { - for (TripleABC entry : transformMap) { - if (MathHelper.between(entry.getA(), index, entry.getB())) { - return entry.getC(); - } - } - return null; - } - - /** - * Builds a IconVertexRangeUVTransform. - */ - public static class Builder { - - private LinkedList> transformMap; - - private Builder() { - transformMap = new LinkedList>(); - } - - /** - * Builds the IconVertexRangeUVTransform, Should be safe to call this more than once. - * - * @return The IconVertexRangeUVTransform. - */ - public IconVertexRangeUVTransform build() { - return new IconVertexRangeUVTransform(transformMap); - } - - /** - * Reserves a range for a specific transform. - * - * @param start The start index to reserve. - * @param end The end vertex to reserve. - * @param sprite The sprite to transform to in the range. - * @return The same instance of the builder. - * @throws IllegalArgumentException Thrown if the specified vertex range is already reserved. - */ - public Builder addTransform(int start, int end, TextureAtlasSprite sprite) { - for (TripleABC entry : transformMap) { - if (MathHelper.between(entry.getA(), start, entry.getB()) || MathHelper.between(entry.getA(), end, entry.getB())) { - throw new IllegalArgumentException("Unable to have overlapping sprite transforms!"); - } - } - transformMap.add(new TripleABC(start, end, sprite)); - return this; - } - - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/uv/MultiIconTransformation.java b/dependencies/main/java/codechicken/lib/vec/uv/MultiIconTransformation.java deleted file mode 100644 index 77263e46a2..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/uv/MultiIconTransformation.java +++ /dev/null @@ -1,33 +0,0 @@ -package codechicken.lib.vec.uv; - -import codechicken.lib.render.CCRenderState; -import codechicken.lib.vec.IrreversibleTransformationException; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; - -public class MultiIconTransformation extends UVTransformation { - - public TextureAtlasSprite[] icons; - private TextureAtlasSprite icon; - - public MultiIconTransformation(TextureAtlasSprite... icons) { - this.icons = icons; - } - - @Override - public void operate(CCRenderState state) { - super.operate(state); - state.sprite = icon; - } - - @Override - public void apply(UV uv) { - icon = icons[uv.tex % icons.length]; - uv.u = icon.getInterpolatedU(uv.u * 16); - uv.v = icon.getInterpolatedV(uv.v * 16); - } - - @Override - public UVTransformation inverse() { - throw new IrreversibleTransformationException(this); - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/uv/ScaledIconTransformation.java b/dependencies/main/java/codechicken/lib/vec/uv/ScaledIconTransformation.java deleted file mode 100644 index c339b6be78..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/uv/ScaledIconTransformation.java +++ /dev/null @@ -1,29 +0,0 @@ -package codechicken.lib.vec.uv; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; - -public class ScaledIconTransformation extends IconTransformation { - - double su = 0.0F; - double sv = 0.0F; - - public ScaledIconTransformation(TextureAtlasSprite icon) { - - super(icon); - } - - public ScaledIconTransformation(TextureAtlasSprite icon, double scaleu, double scalev) { - - super(icon); - - su = scaleu; - sv = scalev; - } - - @Override - public void apply(UV texcoord) { - - texcoord.u = icon.getInterpolatedU(texcoord.u % 2 * 16) + su * (icon.getMaxU() - icon.getMinU()); - texcoord.v = icon.getInterpolatedV(texcoord.v % 2 * 16) + sv * (icon.getMaxV() - icon.getMinV()); - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/uv/UV.java b/dependencies/main/java/codechicken/lib/vec/uv/UV.java deleted file mode 100644 index 86e21daa63..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/uv/UV.java +++ /dev/null @@ -1,81 +0,0 @@ -package codechicken.lib.vec.uv; - -import codechicken.lib.util.Copyable; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -public class UV implements Copyable { - - public double u; - public double v; - public int tex; - - public UV() { - } - - public UV(double u, double v) { - this(u, v, 0); - } - - public UV(double u, double v, int tex) { - this.u = u; - this.v = v; - this.tex = tex; - } - - public UV(UV uv) { - this(uv.u, uv.v, uv.tex); - } - - public UV set(double u, double v, int tex) { - this.u = u; - this.v = v; - this.tex = tex; - return this; - } - - public UV set(double u, double v) { - return set(u, v, tex); - } - - public UV set(UV uv) { - return set(uv.u, uv.v, uv.tex); - } - - public UV copy() { - return new UV(this); - } - - public UV add(UV uv) { - u += uv.u; - v += uv.v; - return this; - } - - public UV multiply(double d) { - u *= d; - v *= d; - return this; - } - - public String toString() { - MathContext cont = new MathContext(4, RoundingMode.HALF_UP); - return "UV(" + new BigDecimal(u, cont) + ", " + new BigDecimal(v, cont) + ")"; - } - - public UV apply(UVTransformation t) { - t.apply(this); - return this; - } - - @Override - public boolean equals(Object o) { - if (!(o instanceof UV)) { - return false; - } - UV uv = (UV) o; - return u == uv.u && v == uv.v; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/uv/UVRotation.java b/dependencies/main/java/codechicken/lib/vec/uv/UVRotation.java deleted file mode 100644 index cc5747a0eb..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/uv/UVRotation.java +++ /dev/null @@ -1,53 +0,0 @@ -package codechicken.lib.vec.uv; - -import codechicken.lib.math.MathHelper; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -public class UVRotation extends UVTransformation { - - public double angle; - - /** - * @param angle The angle to rotate counterclockwise in radians - */ - public UVRotation(double angle) { - this.angle = angle; - } - - @Override - public void apply(UV uv) { - double c = MathHelper.cos(angle); - double s = MathHelper.sin(angle); - double u2 = c * uv.u + s * uv.v; - uv.v = -s * uv.u + c * uv.v; - uv.u = u2; - } - - @Override - public UVTransformation inverse() { - return new UVRotation(-angle); - } - - @Override - public UVTransformation merge(UVTransformation next) { - if (next instanceof UVRotation) { - return new UVRotation(angle + ((UVRotation) next).angle); - } - - return null; - } - - @Override - public boolean isRedundant() { - return MathHelper.between(-1E-5, angle, 1E-5); - } - - @Override - public String toString() { - MathContext cont = new MathContext(4, RoundingMode.HALF_UP); - return "UVRotation(" + new BigDecimal(angle, cont) + ")"; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/uv/UVScale.java b/dependencies/main/java/codechicken/lib/vec/uv/UVScale.java deleted file mode 100644 index 3ce0e0c721..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/uv/UVScale.java +++ /dev/null @@ -1,37 +0,0 @@ -package codechicken.lib.vec.uv; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -public class UVScale extends UVTransformation { - - double su; - double sv; - - public UVScale(double scaleu, double scalev) { - su = scaleu; - sv = scalev; - } - - public UVScale(double d) { - this(d, d); - } - - @Override - public void apply(UV uv) { - uv.u *= su; - uv.v *= sv; - } - - @Override - public UVTransformation inverse() { - return new UVScale(1 / su, 1 / sv); - } - - @Override - public String toString() { - MathContext cont = new MathContext(4, RoundingMode.HALF_UP); - return "UVScale(" + new BigDecimal(su, cont) + ", " + new BigDecimal(sv, cont) + ")"; - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/uv/UVTransformation.java b/dependencies/main/java/codechicken/lib/vec/uv/UVTransformation.java deleted file mode 100644 index 317e347fea..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/uv/UVTransformation.java +++ /dev/null @@ -1,39 +0,0 @@ -package codechicken.lib.vec.uv; - -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.IVertexOperation; -import codechicken.lib.vec.ITransformation; - -/** - * Abstract supertype for any UV transformation - */ -public abstract class UVTransformation extends ITransformation implements IVertexOperation { - - public static final int operationIndex = CCRenderState.registerOperation(); - - public UVTransformation at(UV point) { - return new UVTransformationList(new UVTranslation(-point.u, -point.v), this, new UVTranslation(point.u, point.v)); - } - - public UVTransformationList with(UVTransformation t) { - return new UVTransformationList(this, t); - } - - @Override - public boolean load(CCRenderState state) { - return !isRedundant(); - } - - @Override - public void operate(CCRenderState state) { - apply(state.vert.uv); - state.sprite = null; - } - - @Override - public int operationID() { - return operationIndex; - } -} - - diff --git a/dependencies/main/java/codechicken/lib/vec/uv/UVTransformationList.java b/dependencies/main/java/codechicken/lib/vec/uv/UVTransformationList.java deleted file mode 100644 index 0bee6fa5c1..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/uv/UVTransformationList.java +++ /dev/null @@ -1,113 +0,0 @@ -package codechicken.lib.vec.uv; - -import java.util.ArrayList; -import java.util.Iterator; - -public class UVTransformationList extends UVTransformation { - - private ArrayList transformations = new ArrayList(); - - public UVTransformationList(UVTransformation... transforms) { - for (UVTransformation t : transforms) { - if (t instanceof UVTransformationList) { - transformations.addAll(((UVTransformationList) t).transformations); - } else { - transformations.add(t); - } - } - - compact(); - } - - @Override - public void apply(UV uv) { - for (int i = 0; i < transformations.size(); i++) { - transformations.get(i).apply(uv); - } - } - - @Override - public UVTransformationList with(UVTransformation t) { - if (t.isRedundant()) { - return this; - } - - if (t instanceof UVTransformationList) { - transformations.addAll(((UVTransformationList) t).transformations); - } else { - transformations.add(t); - } - - compact(); - return this; - } - - public UVTransformationList prepend(UVTransformation t) { - if (t.isRedundant()) { - return this; - } - - if (t instanceof UVTransformationList) { - transformations.addAll(0, ((UVTransformationList) t).transformations); - } else { - transformations.add(0, t); - } - - compact(); - return this; - } - - private void compact() { - ArrayList newList = new ArrayList(transformations.size()); - Iterator iterator = transformations.iterator(); - UVTransformation prev = null; - while (iterator.hasNext()) { - UVTransformation t = iterator.next(); - if (t.isRedundant()) { - continue; - } - - if (prev != null) { - UVTransformation m = prev.merge(t); - if (m == null) { - newList.add(prev); - } else if (m.isRedundant()) { - t = null; - } else { - t = m; - } - } - prev = t; - } - if (prev != null) { - newList.add(prev); - } - - if (newList.size() < transformations.size()) { - transformations = newList; - } - } - - @Override - public boolean isRedundant() { - return transformations.size() == 0; - } - - @Override - public UVTransformation inverse() { - UVTransformationList rev = new UVTransformationList(); - for (int i = transformations.size() - 1; i >= 0; i--) { - rev.with(transformations.get(i).inverse()); - } - return rev; - } - - @Override - public String toString() { - String s = ""; - for (UVTransformation t : transformations) { - s += "\n" + t.toString(); - } - return s.trim(); - } -} diff --git a/dependencies/main/java/codechicken/lib/vec/uv/UVTranslation.java b/dependencies/main/java/codechicken/lib/vec/uv/UVTranslation.java deleted file mode 100644 index 728867c255..0000000000 --- a/dependencies/main/java/codechicken/lib/vec/uv/UVTranslation.java +++ /dev/null @@ -1,55 +0,0 @@ -package codechicken.lib.vec.uv; - -import codechicken.lib.math.MathHelper; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -public class UVTranslation extends UVTransformation { - - public double du; - public double dv; - - public UVTranslation(double u, double v) { - du = u; - dv = v; - } - - @Override - public void apply(UV uv) { - uv.u += du; - uv.v += dv; - } - - @Override - public UVTransformation at(UV point) { - return this; - } - - @Override - public UVTransformation inverse() { - return new UVTranslation(-du, -dv); - } - - @Override - public UVTransformation merge(UVTransformation next) { - if (next instanceof UVTranslation) { - UVTranslation t = (UVTranslation) next; - return new UVTranslation(du + t.du, dv + t.dv); - } - - return null; - } - - @Override - public boolean isRedundant() { - return MathHelper.between(-1E-5, du, 1E-5) && MathHelper.between(-1E-5, dv, 1E-5); - } - - @Override - public String toString() { - MathContext cont = new MathContext(4, RoundingMode.HALF_UP); - return "UVTranslation(" + new BigDecimal(du, cont) + ", " + new BigDecimal(dv, cont) + ")"; - } -} diff --git a/dependencies/main/java/codechicken/lib/world/ChunkExtension.java b/dependencies/main/java/codechicken/lib/world/ChunkExtension.java deleted file mode 100644 index 28192ed750..0000000000 --- a/dependencies/main/java/codechicken/lib/world/ChunkExtension.java +++ /dev/null @@ -1,71 +0,0 @@ -package codechicken.lib.world; - -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.Packet; -import net.minecraft.util.math.ChunkPos; -import net.minecraft.world.chunk.Chunk; - -import java.util.HashSet; - -public abstract class ChunkExtension { - - public final Chunk chunk; - public final ChunkPos coord; - public final WorldExtension world; - public HashSet watchedPlayers; - - public ChunkExtension(Chunk chunk, WorldExtension world) { - this.chunk = chunk; - coord = chunk.getChunkCoordIntPair(); - this.world = world; - watchedPlayers = new HashSet(); - } - - public void loadData(NBTTagCompound tag) { - } - - public void saveData(NBTTagCompound tag) { - } - - public void load() { - } - - public void unload() { - } - - public final void sendPacketToPlayers(Packet packet) { - for (EntityPlayerMP player : watchedPlayers) { - player.connection.sendPacket(packet); - } - } - - public final void watchPlayer(EntityPlayerMP player) { - watchedPlayers.add(player); - onWatchPlayer(player); - } - - public void onWatchPlayer(EntityPlayerMP player) { - } - - public final void unwatchPlayer(EntityPlayerMP player) { - watchedPlayers.remove(player); - onUnWatchPlayer(player); - } - - public void onUnWatchPlayer(EntityPlayerMP player) { - } - - public void sendUpdatePackets() { - } - - @Override - public int hashCode() { - return coord.chunkXPos ^ coord.chunkZPos; - } - - @Override - public boolean equals(Object o) { - return (o instanceof ChunkExtension && ((ChunkExtension) o).coord.equals(coord)) || (o instanceof ChunkPos && coord.equals(o)) || (o instanceof Long && (Long) o == (((long) coord.chunkXPos) << 32 | coord.chunkZPos)); - } -} diff --git a/dependencies/main/java/codechicken/lib/world/IChunkLoadTile.java b/dependencies/main/java/codechicken/lib/world/IChunkLoadTile.java deleted file mode 100644 index 459086f919..0000000000 --- a/dependencies/main/java/codechicken/lib/world/IChunkLoadTile.java +++ /dev/null @@ -1,12 +0,0 @@ -package codechicken.lib.world; - -/** - * Provides a callback for tile entities when a chunk is loaded, as an alternative to validate when the chunk hasn't been added to the world. - * To hook all world join/seperate events. Use this, TileEntity.validate with a worldObj.blockExists check, TileEntity.onChunkUnload and TileEntity.invalidate - * Be sure to call TileChunkLoadHook.init() from your mod during initialisation - * You could easily implement this in your own mod, but providing it here reduces the number of times the chunkTileEntityMap needs to be iterated - */ -public interface IChunkLoadTile { - - void onChunkLoad(); -} diff --git a/dependencies/main/java/codechicken/lib/world/TileChunkLoadHook.java b/dependencies/main/java/codechicken/lib/world/TileChunkLoadHook.java deleted file mode 100644 index 0e52a2380f..0000000000 --- a/dependencies/main/java/codechicken/lib/world/TileChunkLoadHook.java +++ /dev/null @@ -1,33 +0,0 @@ -package codechicken.lib.world; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.world.ChunkEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -import java.util.ArrayList; -import java.util.List; - -public class TileChunkLoadHook { - - private static boolean init; - - public static void init() { - if (init) { - return; - } - init = true; - - MinecraftForge.EVENT_BUS.register(new TileChunkLoadHook()); - } - - @SubscribeEvent - public void onChunkLoad(ChunkEvent.Load event) { - List list = new ArrayList(event.getChunk().getTileEntityMap().values()); - for (TileEntity t : list) { - if (t instanceof IChunkLoadTile) { - ((IChunkLoadTile) t).onChunkLoad(); - } - } - } -} diff --git a/dependencies/main/java/codechicken/lib/world/WorldExtension.java b/dependencies/main/java/codechicken/lib/world/WorldExtension.java deleted file mode 100644 index c44a0afb40..0000000000 --- a/dependencies/main/java/codechicken/lib/world/WorldExtension.java +++ /dev/null @@ -1,103 +0,0 @@ -package codechicken.lib.world; - -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; - -import java.util.HashMap; - -public abstract class WorldExtension { - - public final World world; - public HashMap chunkMap = new HashMap(); - - public WorldExtension(World world) { - this.world = world; - } - - public void load() { - } - - public void unload() { - } - - public void save() { - } - - public void preTick() { - } - - public void postTick() { - } - - protected final void addChunk(ChunkExtension extension) { - chunkMap.put(extension.chunk, extension); - } - - protected final void loadChunk(Chunk chunk) { - ChunkExtension extension = chunkMap.get(chunk); - if (extension != null) { - extension.load(); - } - } - - protected final void unloadChunk(Chunk chunk) { - ChunkExtension extension = chunkMap.get(chunk); - if (extension != null) { - extension.unload(); - } - } - - protected final void loadChunkData(Chunk chunk, NBTTagCompound tag) { - ChunkExtension extension = chunkMap.get(chunk); - if (extension != null) { - extension.loadData(tag); - } - } - - protected final void saveChunkData(Chunk chunk, NBTTagCompound tag) { - ChunkExtension extension = chunkMap.get(chunk); - if (extension != null) { - extension.saveData(tag); - } - } - - protected final void remChunk(Chunk chunk) { - chunkMap.remove(chunk); - } - - protected final void watchChunk(Chunk chunk, EntityPlayerMP player) { - ChunkExtension extension = chunkMap.get(chunk); - if (extension != null) { - extension.watchPlayer(player); - } - } - - protected final void unwatchChunk(Chunk chunk, EntityPlayerMP player) { - ChunkExtension extension = chunkMap.get(chunk); - if (extension != null) { - extension.unwatchPlayer(player); - } - } - - protected final void sendChunkUpdates(Chunk chunk) { - ChunkExtension extension = chunkMap.get(chunk); - if (extension != null) { - extension.sendUpdatePackets(); - } - } - - public boolean containsChunk(Chunk chunk) { - return chunkMap.containsKey(chunk); - } - - public ChunkExtension getChunkExtension(int chunkXPos, int chunkZPos) { - if (!world.isBlockLoaded(new BlockPos(chunkXPos << 4, 128, chunkZPos << 4))) { - return null; - } - - return chunkMap.get(world.getChunkFromChunkCoords(chunkXPos, chunkZPos)); - } -} diff --git a/dependencies/main/java/codechicken/lib/world/WorldExtensionInstantiator.java b/dependencies/main/java/codechicken/lib/world/WorldExtensionInstantiator.java deleted file mode 100644 index 38a4582aa9..0000000000 --- a/dependencies/main/java/codechicken/lib/world/WorldExtensionInstantiator.java +++ /dev/null @@ -1,17 +0,0 @@ -package codechicken.lib.world; - -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; - -public abstract class WorldExtensionInstantiator { - - public int instantiatorID; - - public abstract WorldExtension createWorldExtension(World world); - - public abstract ChunkExtension createChunkExtension(Chunk chunk, WorldExtension world); - - public WorldExtension getExtension(World world) { - return WorldExtensionManager.getWorldExtension(world, instantiatorID); - } -} diff --git a/dependencies/main/java/codechicken/lib/world/WorldExtensionManager.java b/dependencies/main/java/codechicken/lib/world/WorldExtensionManager.java deleted file mode 100644 index c28645b6ba..0000000000 --- a/dependencies/main/java/codechicken/lib/world/WorldExtensionManager.java +++ /dev/null @@ -1,208 +0,0 @@ -package codechicken.lib.world; - -import net.minecraft.client.Minecraft; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.world.ChunkDataEvent; -import net.minecraftforge.event.world.ChunkEvent; -import net.minecraftforge.event.world.ChunkWatchEvent.UnWatch; -import net.minecraftforge.event.world.ChunkWatchEvent.Watch; -import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.ArrayList; -import java.util.HashMap; - -public class WorldExtensionManager { - - public static class WorldExtensionEventHandler { - - @SubscribeEvent - public void onChunkDataLoad(ChunkDataEvent.Load event) { - if (!worldMap.containsKey(event.getWorld())) { - WorldExtensionManager.onWorldLoad(event.getWorld()); - } - - createChunkExtension(event.getWorld(), event.getChunk()); - - for (WorldExtension extension : worldMap.get(event.getWorld())) { - extension.loadChunkData(event.getChunk(), event.getData()); - } - } - - @SubscribeEvent - public void onChunkDataSave(ChunkDataEvent.Save event) { - for (WorldExtension extension : worldMap.get(event.getWorld())) { - extension.saveChunkData(event.getChunk(), event.getData()); - } - - if (!event.getChunk().isLoaded()) { - removeChunk(event.getWorld(), event.getChunk()); - } - } - - @SubscribeEvent - public void onChunkLoad(ChunkEvent.Load event) { - if (!worldMap.containsKey(event.getWorld())) { - WorldExtensionManager.onWorldLoad(event.getWorld()); - } - - createChunkExtension(event.getWorld(), event.getChunk()); - - for (WorldExtension extension : worldMap.get(event.getWorld())) { - extension.loadChunk(event.getChunk()); - } - } - - @SubscribeEvent - public void onChunkUnLoad(ChunkEvent.Unload event) { - if (event.getChunk().isEmpty()) { - return; - } - //TODO Maybe gate against worldMap.get returning null. Some dimension may be doing stupid things. - for (WorldExtension extension : worldMap.get(event.getWorld())) { - extension.unloadChunk(event.getChunk()); - } - - if (event.getWorld().isRemote) { - removeChunk(event.getWorld(), event.getChunk()); - } - } - - @SubscribeEvent - public void onWorldSave(WorldEvent.Save event) { - if (worldMap.containsKey(event.getWorld())) { - for (WorldExtension extension : worldMap.get(event.getWorld())) { - extension.save(); - } - } - } - - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) { - if (!worldMap.containsKey(event.getWorld())) { - WorldExtensionManager.onWorldLoad(event.getWorld()); - } - } - - @SubscribeEvent - public void onWorldUnLoad(WorldEvent.Unload event) { - if (worldMap.containsKey(event.getWorld()))//because force closing unloads a world twice - { - for (WorldExtension extension : worldMap.remove(event.getWorld())) { - extension.unload(); - } - } - } - - @SubscribeEvent - public void onChunkWatch(Watch event) { - Chunk chunk = event.getPlayer().worldObj.getChunkFromChunkCoords(event.getChunk().chunkXPos, event.getChunk().chunkZPos); - for (WorldExtension extension : worldMap.get(event.getPlayer().worldObj)) { - extension.watchChunk(chunk, event.getPlayer()); - } - } - - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void onChunkUnWatch(UnWatch event) { - Chunk chunk = event.getPlayer().worldObj.getChunkFromChunkCoords(event.getChunk().chunkXPos, event.getChunk().chunkZPos); - for (WorldExtension extension : worldMap.get(event.getPlayer().worldObj)) { - extension.unwatchChunk(chunk, event.getPlayer()); - } - } - - @SubscribeEvent - @SideOnly (Side.CLIENT) - public void clientTick(TickEvent.ClientTickEvent event) { - World world = Minecraft.getMinecraft().theWorld; - if (worldMap.containsKey(world)) { - if (event.phase == TickEvent.Phase.START) { - preTick(world); - } else { - postTick(world); - } - } - } - - @SubscribeEvent - public void serverTick(TickEvent.WorldTickEvent event) { - if (!worldMap.containsKey(event.world)) { - WorldExtensionManager.onWorldLoad(event.world); - } - - if (event.phase == TickEvent.Phase.START) { - preTick(event.world); - } else { - postTick(event.world); - } - } - } - - private static boolean initialised; - private static ArrayList extensionIntialisers = new ArrayList(); - - public static void registerWorldExtension(WorldExtensionInstantiator init) { - if (!initialised) { - init(); - } - - init.instantiatorID = extensionIntialisers.size(); - extensionIntialisers.add(init); - } - - private static void init() { - initialised = true; - MinecraftForge.EVENT_BUS.register(new WorldExtensionEventHandler()); - } - - private static HashMap worldMap = new HashMap(); - - private static void onWorldLoad(World world) { - WorldExtension[] extensions = new WorldExtension[extensionIntialisers.size()]; - for (int i = 0; i < extensions.length; i++) { - extensions[i] = extensionIntialisers.get(i).createWorldExtension(world); - } - - worldMap.put(world, extensions); - - for (WorldExtension extension : extensions) { - extension.load(); - } - } - - private static void createChunkExtension(World world, Chunk chunk) { - WorldExtension[] extensions = worldMap.get(world); - for (int i = 0; i < extensionIntialisers.size(); i++) { - if (!extensions[i].containsChunk(chunk)) { - extensions[i].addChunk(extensionIntialisers.get(i).createChunkExtension(chunk, extensions[i])); - } - } - } - - private static void removeChunk(World world, Chunk chunk) { - for (WorldExtension extension : worldMap.get(world)) { - extension.remChunk(chunk); - } - } - - private static void preTick(World world) { - for (WorldExtension extension : worldMap.get(world)) { - extension.preTick(); - } - } - - private static void postTick(World world) { - for (WorldExtension extension : worldMap.get(world)) { - extension.postTick(); - } - } - - public static WorldExtension getWorldExtension(World world, int instantiatorID) { - return worldMap.get(world)[instantiatorID]; - } -} diff --git a/dependencies/main/java/codechicken/lib/world/placement/BlockPlacementBatcher.java b/dependencies/main/java/codechicken/lib/world/placement/BlockPlacementBatcher.java deleted file mode 100644 index 8141eca48f..0000000000 --- a/dependencies/main/java/codechicken/lib/world/placement/BlockPlacementBatcher.java +++ /dev/null @@ -1,184 +0,0 @@ -package codechicken.lib.world.placement; - -import codechicken.lib.world.placement.lighting.LightingCalcEntry; -import codechicken.lib.world.placement.lighting.LightingCalcEntryBuilder; -import gnu.trove.set.hash.THashSet; -import net.minecraft.block.state.IBlockState; -import net.minecraft.init.Blocks; -import net.minecraft.network.play.server.SPacketChunkData; -import net.minecraft.server.management.PlayerChunkMap; -import net.minecraft.server.management.PlayerChunkMapEntry; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.WorldServer; -import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.Chunk.EnumCreateEntityType; -import net.minecraft.world.chunk.storage.ExtendedBlockStorage; - -import java.util.LinkedList; - -/** - * Created by covers1624 on 8/1/2016. - * TODO, Rethink this entire system, we need to cache blocks for the delayed lighting calculation. - */ -public class BlockPlacementBatcher { - - private final WorldServer serverWorld; - private THashSet modifiedChunks = new THashSet(); - private LinkedList blockLightingUpdates = new LinkedList(); - - public BlockPlacementBatcher(WorldServer serverWorld) { - this.serverWorld = serverWorld; - } - - public void setBlockState(BlockPos pos, IBlockState newState) { - if (!hasBlockStorage(pos) && newState.getBlock() == Blocks.AIR) { - return; - } - IBlockState oldState = getChunk(pos).getBlockState(pos); - if (oldState == newState) { - return; - } - setRecalcPrecipitationHeightMap(pos); - LightingCalcEntryBuilder builder = new LightingCalcEntryBuilder(); - builder.setDimension(serverWorld.provider.getDimension()); - builder.setBasePos(pos); - builder.setOldState(oldState); - builder.setNewState(newState); - builder.setOldLightOpacity(oldState.getLightOpacity(serverWorld, pos)); - - createBlockStorageIfNeeded(pos, builder); - ExtendedBlockStorage storage = getBlockStorage(pos); - Chunk chunk = getChunk(pos); - storage.set(pos.getX() & 15, pos.getY() & 15, pos.getZ() & 15, newState); - - fireBlockBreak(pos, oldState, newState); - tileEntityRemoveCheck(pos, oldState, newState); - - builder.setNewLightOpacity(newState.getLightOpacity(serverWorld, pos)); - builder.setSkyLight(chunk.getLightFor(EnumSkyBlock.SKY, pos)); - builder.setBlockLight(chunk.getLightFor(EnumSkyBlock.BLOCK, pos)); - - fireBlockPlace(pos, oldState, newState); - tileEntityPlaceCheck(pos, newState); - - setChunkModified(pos); - blockLightingUpdates.add(builder.build()); - } - - public void setChunkModified(BlockPos blockPos) { - Chunk chunk = getChunk(blockPos); - setChunkModified(chunk); - } - - public void setChunkModified(Chunk chunk) { - modifiedChunks.add(chunk); - } - - private Chunk getChunk(BlockPos pos) { - return serverWorld.getChunkFromChunkCoords(pos.getX() >> 4, pos.getZ() >> 4); - } - - private boolean hasBlockStorage(BlockPos pos) { - Chunk chunk = getChunk(pos); - return chunk.storageArrays[pos.getY() >> 4] != null; - } - - private ExtendedBlockStorage getBlockStorage(BlockPos pos) { - Chunk chunk = getChunk(pos); - return chunk.storageArrays[pos.getY() >> 4]; - } - - /** - * Creates a ExtendedBlockStorage for the given BlockPos if needed. - * - * @param pos Position to create a storage for. - * @param builder Lighting Calculation builder, can be null. - */ - private void createBlockStorageIfNeeded(BlockPos pos, LightingCalcEntryBuilder builder) { - Chunk chunk = getChunk(pos); - ExtendedBlockStorage storage = chunk.storageArrays[pos.getY() >> 4]; - if (storage == null) { - int height = chunk.heightMap[(pos.getZ() & 15) << 4 | (pos.getX() & 15)]; - storage = new ExtendedBlockStorage(pos.getY() >> 4 << 4, !serverWorld.provider.getHasNoSky()); - chunk.storageArrays[pos.getY() >> 4] = storage; - builder.setHeight(height); - if (builder != null && pos.getY() >= height) { - builder.setChunkHeightModified(); - } - } - } - - private void setRecalcPrecipitationHeightMap(BlockPos pos) { - Chunk chunk = getChunk(pos); - int i = (pos.getZ() & 15) << 4 | (pos.getX() & 15); - if (pos.getY() >= chunk.precipitationHeightMap[i] - 1) { - chunk.precipitationHeightMap[i] = -999; - } - } - - private void fireBlockBreak(BlockPos pos, IBlockState oldState, IBlockState newState) { - if (oldState.getBlock() != newState.getBlock()) { - oldState.getBlock().breakBlock(serverWorld, pos, oldState); - } - } - - private void fireBlockPlace(BlockPos pos, IBlockState oldState, IBlockState newState) { - if (oldState.getBlock() != newState.getBlock() && newState.getBlock().hasTileEntity(newState)) { - oldState.getBlock().onBlockAdded(serverWorld, pos, oldState); - } - } - - private void tileEntityRemoveCheck(BlockPos pos, IBlockState oldState, IBlockState newState) { - - TileEntity tileEntity = getChunk(pos).getTileEntity(pos, EnumCreateEntityType.CHECK); - if (tileEntity != null && tileEntity.shouldRefresh(serverWorld, pos, oldState, newState)) { - serverWorld.removeTileEntity(pos); - } - } - - private void tileEntityPlaceCheck(BlockPos pos, IBlockState newState) { - if (newState.getBlock().hasTileEntity(newState)) { - TileEntity tileEntity = getChunk(pos).getTileEntity(pos, EnumCreateEntityType.CHECK); - - if (tileEntity == null) { - tileEntity = newState.getBlock().createTileEntity(serverWorld, newState); - serverWorld.setTileEntity(pos, tileEntity); - } else { - tileEntity.updateContainingBlockInfo(); - } - } - } - - /** - * Call when finished placing blocks to que lighting and send chunk updates to the client. - */ - public void finish() { - for (Chunk chunk : modifiedChunks) { - PlayerChunkMap playerChunkMap = serverWorld.getPlayerChunkMap(); - if (playerChunkMap == null) { - return; - } - PlayerChunkMapEntry watcher = playerChunkMap.getEntry(chunk.xPosition, chunk.zPosition); - if (watcher != null) {//TODO Change chunk mask to only the sub chunks changed. - watcher.sendPacket(new SPacketChunkData(chunk, 65535)); - } - } - modifiedChunks.clear(); - BlockPlacementLightingManager.uploadToLightingQue(blockLightingUpdates); - blockLightingUpdates.clear(); - } - - public boolean isAirBlock(BlockPos pos) { - return serverWorld.isAirBlock(pos); - } - - public IBlockState getBlockState(BlockPos pos) { - ExtendedBlockStorage storage = getBlockStorage(pos); - if (storage == null) { - return Blocks.AIR.getDefaultState(); - } - return storage.get(pos.getX() & 15, pos.getY() & 15, pos.getZ() & 15); - } -} diff --git a/dependencies/main/java/codechicken/lib/world/placement/BlockPlacementLightingManager.java b/dependencies/main/java/codechicken/lib/world/placement/BlockPlacementLightingManager.java deleted file mode 100644 index 3fe7a265df..0000000000 --- a/dependencies/main/java/codechicken/lib/world/placement/BlockPlacementLightingManager.java +++ /dev/null @@ -1,93 +0,0 @@ -package codechicken.lib.world.placement; - -import codechicken.lib.world.placement.lighting.LightingCalcEntry; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.WorldServer; -import net.minecraft.world.chunk.Chunk; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.FMLLog; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; -import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; - -import java.util.Iterator; -import java.util.LinkedList; - -/** - * Created by covers1624 on 8/1/2016. - */ -public class BlockPlacementLightingManager { - - private static final LinkedList lightingQue = new LinkedList(); - public static final int lightEntriesPerTick = Integer.parseInt(System.getProperty("ccl.lightingEntriesPerTic", "100")); - - static { - MinecraftForge.EVENT_BUS.register(new BlockPlacementLightingManager()); - } - - @SubscribeEvent - public void tickEvent(ServerTickEvent serverTick) { - if (serverTick.phase == Phase.START) { - if (!lightingQue.isEmpty()) { - synchronized (lightingQue) { - FMLLog.info("Que Size: " + lightingQue.size()); - Iterator iterator = lightingQue.iterator(); - int entriesProcessed = 0; - while (iterator.hasNext()) { - if (entriesProcessed >= lightEntriesPerTick) { - break; - } - LightingCalcEntry entry = iterator.next(); - if (entry == null) { - continue; - } - WorldServer world = getServer().worldServerForDimension(entry.dimension); - Chunk chunk = getChunk(world, entry.pos); - if (entry.chunkHeightModified) { - //FMLLog.info("GeneratingSkyLightMap in Chunk: X: %s, Z: %s", entry.pos.getX() >> 4, entry.pos.getX() >> 4); - chunk.generateSkylightMap(); - } else { - if (entry.newLightOpacity > 0) { - if (entry.pos.getY() >= entry.height) { - //FMLLog.info("RelightBlock"); - chunk.relightBlock(entry.pos.getX() & 15, entry.pos.getY() + 1, entry.pos.getZ() & 15); - } - } else if (entry.pos.getY() == entry.height - 1) { - //FMLLog.info("RelightBlock"); - chunk.relightBlock(entry.pos.getX() & 15, entry.pos.getY(), entry.pos.getZ() & 15); - } - - if (entry.newLightOpacity != entry.oldLightOpacity && (entry.newLightOpacity < entry.oldLightOpacity || entry.skyLight > 0 || entry.blockLight > 0)) { - //FMLLog.info("SkyLightOcclusion at: X: %s, Z: %s", entry.pos.getX() & 15, entry.pos.getX() & 15); - chunk.propagateSkylightOcclusion(entry.pos.getX() & 15, entry.pos.getZ() & 15); - } - } - entriesProcessed++; - iterator.remove(); - } - } - } - } - } - - private static MinecraftServer getServer() { - return FMLCommonHandler.instance().getMinecraftServerInstance(); - } - - public static void uploadToLightingQue(LinkedList lightingEntries) { - addEntries(lightingEntries); - } - - public static synchronized void addEntries(LinkedList entries) { - synchronized (lightingQue) { - lightingQue.addAll(entries); - } - } - - protected static Chunk getChunk(WorldServer world, BlockPos pos) { - return world.getChunkFromChunkCoords(pos.getX() >> 4, pos.getZ() >> 4); - } - -} diff --git a/dependencies/main/java/codechicken/lib/world/placement/lighting/LightingCalcEntry.java b/dependencies/main/java/codechicken/lib/world/placement/lighting/LightingCalcEntry.java deleted file mode 100644 index 4b0f972b04..0000000000 --- a/dependencies/main/java/codechicken/lib/world/placement/lighting/LightingCalcEntry.java +++ /dev/null @@ -1,34 +0,0 @@ -package codechicken.lib.world.placement.lighting; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.math.BlockPos; - -/** - * Created by covers1624 on 8/1/2016. - */ -public class LightingCalcEntry { - - public final int dimension; - public final BlockPos pos; - public final boolean chunkHeightModified; - public final IBlockState oldState; - public final IBlockState newState; - public final int oldLightOpacity; - public final int newLightOpacity; - public final int skyLight; - public final int blockLight; - public final int height; - - public LightingCalcEntry(int dimension, BlockPos pos, boolean chunkHeightModified, IBlockState oldState, IBlockState newState, int oldLightOpacity, int newLightOpacity, int skyLight, int blockLight, int height) { - this.dimension = dimension; - this.pos = pos; - this.chunkHeightModified = chunkHeightModified; - this.oldState = oldState; - this.newState = newState; - this.oldLightOpacity = oldLightOpacity; - this.newLightOpacity = newLightOpacity; - this.skyLight = skyLight; - this.blockLight = blockLight; - this.height = height; - } -} diff --git a/dependencies/main/java/codechicken/lib/world/placement/lighting/LightingCalcEntryBuilder.java b/dependencies/main/java/codechicken/lib/world/placement/lighting/LightingCalcEntryBuilder.java deleted file mode 100644 index ed72af7841..0000000000 --- a/dependencies/main/java/codechicken/lib/world/placement/lighting/LightingCalcEntryBuilder.java +++ /dev/null @@ -1,65 +0,0 @@ -package codechicken.lib.world.placement.lighting; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.math.BlockPos; - -/** - * Created by covers1624 on 8/1/2016. - */ -public class LightingCalcEntryBuilder { - - private int dimension; - private BlockPos pos; - private boolean chunkHeightModified = false; - private IBlockState oldState; - private IBlockState newState; - private int oldLightOpacity; - private int newLightOpacity; - private int skyLight; - private int blockLight; - private int height; - - public void setDimension(int dimension) { - this.dimension = dimension; - } - - public void setBasePos(BlockPos pos) { - this.pos = pos; - } - - public void setChunkHeightModified() { - chunkHeightModified = true; - } - - public void setOldState(IBlockState state) { - oldState = state; - } - - public void setNewState(IBlockState state) { - newState = state; - } - - public void setOldLightOpacity(int lightOpacity) { - oldLightOpacity = lightOpacity; - } - - public void setNewLightOpacity(int lightOpacity) { - newLightOpacity = lightOpacity; - } - - public void setSkyLight(int light) { - skyLight = light; - } - - public void setBlockLight(int light) { - blockLight = light; - } - - public void setHeight(int height) { - this.height = height; - } - - public LightingCalcEntry build() { - return new LightingCalcEntry(dimension, pos, chunkHeightModified, oldState, newState, oldLightOpacity, newLightOpacity, skyLight, blockLight, height); - } -} diff --git a/dependencies/main/java/codechicken/nei/ButtonCycled.java b/dependencies/main/java/codechicken/nei/ButtonCycled.java deleted file mode 100644 index bd963ca2c3..0000000000 --- a/dependencies/main/java/codechicken/nei/ButtonCycled.java +++ /dev/null @@ -1,13 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.widget.Button; - -public abstract class ButtonCycled extends Button { - @Override - public Image getRenderIcon() { - return icons[index]; - } - - public int index; - public Image[] icons; -} diff --git a/dependencies/main/java/codechicken/nei/ClientHandler.java b/dependencies/main/java/codechicken/nei/ClientHandler.java deleted file mode 100644 index 7640e9153f..0000000000 --- a/dependencies/main/java/codechicken/nei/ClientHandler.java +++ /dev/null @@ -1,233 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.packet.PacketCustom; -import codechicken.lib.util.ClientUtils; -import codechicken.nei.api.ItemInfo; -import codechicken.nei.config.KeyBindings; -import codechicken.nei.network.NEIClientPacketHandler; -import codechicken.nei.util.NEIClientUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.client.gui.*; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.world.World; -import net.minecraftforge.client.event.RenderWorldLastEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.client.CustomModLoadingErrorDisplayException; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; - -import java.util.ArrayList; -import java.util.Iterator; - -public class ClientHandler { - private static ClientHandler instance; - - private ArrayList SMPmagneticItems = new ArrayList(); - private World lastworld; - private GuiScreen lastGui; - - public void addSMPMagneticItem(int i, World world) { - Entity e = world.getEntityByID(i); - if (e instanceof EntityItem) { - SMPmagneticItems.add((EntityItem) e); - } - } - - private void updateMagnetMode(World world, EntityPlayerSP player) { - if (!NEIClientConfig.getMagnetMode()) { - return; - } - - float distancexz = 16; - float distancey = 8; - double maxspeedxz = 0.5; - double maxspeedy = 0.5; - double speedxz = 0.05; - double speedy = 0.07; - - for (Iterator iterator = SMPmagneticItems.iterator(); iterator.hasNext(); ) { - EntityItem item = iterator.next(); - - if (item.cannotPickup()) { - continue; - } - if (item.isDead) { - iterator.remove(); - } - if (!NEIClientUtils.canItemFitInInventory(player, item.getEntityItem())) { - continue; - } - - double dx = player.posX - item.posX; - double dy = player.posY + player.getEyeHeight() - item.posY; - double dz = player.posZ - item.posZ; - double absxz = Math.sqrt(dx * dx + dz * dz); - double absy = Math.abs(dy); - if (absxz > distancexz || absy > distancey) { - continue; - } - - if (absxz > 1) { - dx /= absxz; - dz /= absxz; - } - - if (absy > 1) { - dy /= absy; - } - - double vx = item.motionX + speedxz * dx; - double vy = item.motionY + speedy * dy; - double vz = item.motionZ + speedxz * dz; - - double absvxz = Math.sqrt(vx * vx + vz * vz); - double absvy = Math.abs(vy); - - double rationspeedxz = absvxz / maxspeedxz; - if (rationspeedxz > 1) { - vx /= rationspeedxz; - vz /= rationspeedxz; - } - - double rationspeedy = absvy / maxspeedy; - if (rationspeedy > 1) { - vy /= rationspeedy; - } - - if (absvxz < 0.2 && absxz < 0.2) { - item.setDead(); - } - - item.setVelocity(vx, vy, vz); - } - } - - public static void preInit() { - ItemInfo.preInit(); - } - - public static void init() { - instance = new ClientHandler(); - - //GuiModListScroll.register("NotEnoughItems"); - PacketCustom.assignHandler(NEIClientPacketHandler.channel, new NEIClientPacketHandler()); - -// MinecraftForge.EVENT_BUS.register(new ContainerEventHandler()); - MinecraftForge.EVENT_BUS.register(instance); - - ItemInfo.init(); - //API.registerHighlightHandler(new DefaultHighlightHandler(), ItemInfo.Layout.HEADER); - //HUDRenderer.load(); - WorldOverlayRenderer.load(); - - KeyBindings.register(); - } - - @SubscribeEvent - public void tickEvent(TickEvent.ClientTickEvent event) { - if (event.phase == Phase.END) { - return; - } - - Minecraft mc = Minecraft.getMinecraft(); - if (mc.theWorld != null) { - if (loadWorld(mc.theWorld)) { - NEIClientConfig.setHasSMPCounterPart(false); - NEIClientConfig.setInternalEnabled(false); - - if (!Minecraft.getMinecraft().isSingleplayer() && ClientUtils.inWorld())//wait for server to initiate in singleplayer - { - NEIClientConfig.loadWorld("remote/" + ClientUtils.getServerIP().replace(':', '~')); - } - } - - if (!NEIClientConfig.isEnabled()) { - return; - } - - KeyManager.tickKeyStates(); - - NEIController.updateUnlimitedItems(mc.thePlayer.inventory); - if (mc.currentScreen == null) { - NEIController.processCreativeCycling(mc.thePlayer.inventory); - } - - updateMagnetMode(mc.theWorld, mc.thePlayer); - } - - GuiScreen gui = mc.currentScreen; - if (gui != lastGui) { - if (gui instanceof GuiMainMenu) { - lastworld = null; - } else if (gui instanceof GuiWorldSelection) { - NEIClientConfig.reloadSaves(); - } - } - lastGui = gui; - } - - @SubscribeEvent - public void tickEvent(TickEvent.RenderTickEvent event) { - //if (event.phase == Phase.END && NEIClientConfig.isEnabled()) { - //HUDRenderer.renderOverlay(); - //} - } - - @SubscribeEvent - public void renderLastEvent(RenderWorldLastEvent event) { - if (NEIClientConfig.isEnabled()) { - WorldOverlayRenderer.render(event.getPartialTicks()); - } - } - - public boolean loadWorld(World world) { - if (world != lastworld) { - SMPmagneticItems.clear(); - WorldOverlayRenderer.reset(); - lastworld = world; - return true; - } - return false; - } - - public static ClientHandler instance() { - return instance; - } - - public static RuntimeException throwCME(final String message) { - final GuiScreen errorGui = new GuiErrorScreen(null, null) { - @Override - public void handleMouseInput() { - } - - @Override - public void handleKeyboardInput() { - } - - @Override - public void drawScreen(int par1, int par2, float par3) { - drawDefaultBackground(); - String[] s_msg = message.split("\n"); - for (int i = 0; i < s_msg.length; ++i) { - drawCenteredString(fontRendererObj, s_msg[i], width / 2, height / 3 + 12 * i, 0xFFFFFFFF); - } - } - }; - - @SuppressWarnings("serial") - CustomModLoadingErrorDisplayException e = new CustomModLoadingErrorDisplayException() { - @Override - public void initGui(GuiErrorScreen errorScreen, FontRenderer fontRenderer) { - Minecraft.getMinecraft().displayGuiScreen(errorGui); - } - - @Override - public void drawScreen(GuiErrorScreen errorScreen, FontRenderer fontRenderer, int mouseRelX, int mouseRelY, float tickTime) { - } - }; - throw e; - } -} diff --git a/dependencies/main/java/codechicken/nei/ContainerEnchantmentModifier.java b/dependencies/main/java/codechicken/nei/ContainerEnchantmentModifier.java deleted file mode 100644 index 731c7a7b39..0000000000 --- a/dependencies/main/java/codechicken/nei/ContainerEnchantmentModifier.java +++ /dev/null @@ -1,340 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.texture.TextureUtils; -import codechicken.nei.network.NEIClientPacketHandler; -import codechicken.nei.util.NEIServerUtils; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ContainerEnchantment; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import java.util.ArrayList; - -/** - * This is crap code, don't ever do this. - */ -public class ContainerEnchantmentModifier extends ContainerEnchantment { - public static class EnchantmentHash { - public EnchantmentHash(Enchantment e, int i, int l) { - enchantment = e; - state = i; - level = l; - } - - Enchantment enchantment; - int state; - int level; - } - - public ArrayList slotEnchantment = new ArrayList(); - int level = 5; - - public int scrollclicky = -1; - public float scrollpercent; - public int scrollmousey; - public float percentscrolled; - public int relx = 60; - public int rely = 14; - public int height = 57; - public int cwidth = 101; - public int slotheight = 19; - public GuiEnchantmentModifier parentscreen; - - public ContainerEnchantmentModifier(InventoryPlayer inventoryplayer, World world) { - super(inventoryplayer, world, new BlockPos(0, 0, 0)); - } - - public int getNumSlots() { - return slotEnchantment.size(); - } - - public int getScrollBarHeight() { - int sbarh = (int) ((height / (float) getContentHeight()) * height); - if (sbarh > height) { - return height; - } else if (sbarh < height / 15) { - return height / 15; - } else { - return sbarh; - } - } - - public int getScrollBarWidth() { - return 7; - } - - public int getContentHeight() { - return slotheight * getNumSlots(); - } - - public int getScrolledSlots() { - int slots = getNumSlots(); - int shownslots = height / slotheight; - return (int) (percentscrolled * (slots - shownslots) + 0.5F); - } - - private int getClickedSlot(int mousey) { - return ((mousey - rely) / slotheight) + getScrolledSlots(); - } - - public void calculatePercentScrolled() { - int barempty = height - getScrollBarHeight(); - if (scrollclicky >= 0) { - int scrolldiff = scrollmousey - scrollclicky; - percentscrolled = scrolldiff / (float) barempty + scrollpercent; - } - if (percentscrolled < 0) { - percentscrolled = 0; - } - if (percentscrolled > 1) { - percentscrolled = 1; - } - int sbary = rely + (int) (barempty * percentscrolled + 0.5); - percentscrolled = (sbary - rely) / (float) barempty; - } - - public boolean clickScrollBar(int mousex, int mousey, int button) { - mousex -= parentscreen.guiLeft; - mousey -= parentscreen.guiTop; - - int barempty = height - getScrollBarHeight(); - int sbary = rely + (int) (barempty * percentscrolled + 0.5); - - if (button == 0 && - getScrollBarHeight() < height && //the scroll bar can move (not full length) - mousex >= relx + cwidth && mousex < relx + cwidth + getScrollBarWidth() && - mousey >= rely && mousey < rely + height)//in the scroll pane - { - if (mousey < sbary) { - percentscrolled = (mousey - rely) / (float) barempty; - calculatePercentScrolled(); - } else if (mousey > sbary + getScrollBarHeight()) { - percentscrolled = (mousey - rely - getScrollBarHeight() + 1) / (float) barempty; - calculatePercentScrolled(); - } else { - scrollclicky = mousey; - scrollpercent = percentscrolled; - scrollmousey = mousey; - } - return true; - } - return false; - } - - public void mouseUp(int mousex, int mousey, int button) { - if (scrollclicky >= 0 && button == 0)//we were scrolling and we released mouse - { - scrollclicky = -1; - } - } - - public boolean clickButton(int mousex, int mousey, int button) { - mousex -= parentscreen.guiLeft; - mousey -= parentscreen.guiTop; - if (mousex >= relx && mousex < relx + cwidth && - mousey >= rely && mousey <= rely + height)//in the box - { - int slot = getClickedSlot(mousey); - if (slot >= getNumSlots()) { - return false; - } - toggleSlotEnchantment(slot); - return true; - } - return false; - } - - private void toggleSlotEnchantment(int slot) { - EnchantmentHash e = slotEnchantment.get(slot); - if (e.state == 2) { - NEIClientPacketHandler.sendModifyEnchantment(Enchantment.getEnchantmentID(e.enchantment), 0, false); - e.state = 0; - } else if (e.state == 1) { - return; - } else { - NEIClientPacketHandler.sendModifyEnchantment(Enchantment.getEnchantmentID(e.enchantment), level, true); - e.state = 2; - } - updateEnchantmentOptions(GuiEnchantmentModifier.validateEnchantments()); - } - - @Deprecated - public boolean addEnchantment(int e, int level) { - return addEnchantment(Enchantment.REGISTRY.getNameForObject(Enchantment.getEnchantmentByID(e)).toString(), level); - } - - public boolean addEnchantment(String enchantmentLocation, int level) { - Enchantment enchantment = Enchantment.getEnchantmentByLocation(enchantmentLocation); - if (enchantment != null) { - inventorySlots.get(0).getStack().addEnchantment(enchantment, level); - return true; - } - return false; - } - - @Deprecated - //TODO String variant. - public void removeEnchantment(int e) { - ItemStack stack = inventorySlots.get(0).getStack(); - NBTTagList nbttaglist = stack.getEnchantmentTagList(); - if (nbttaglist != null) { - for (int i = 0; i < nbttaglist.tagCount(); i++) { - int ID = nbttaglist.getCompoundTagAt(i).getShort("id"); - if (ID == e) { - nbttaglist.removeTag(i); - if (nbttaglist.tagCount() == 0) { - stack.getTagCompound().removeTag("ench"); - } - if (stack.getTagCompound().hasNoTags()) { - stack.setTagCompound(null); - } - return; - } - } - } - } - - public boolean canInteractWith(EntityPlayer entityplayer) { - return true; - } - - public void onCraftMatrixChanged(IInventory iinventory) { - if (parentscreen != null) { - updateEnchantmentOptions(GuiEnchantmentModifier.validateEnchantments()); - } - } - - public void updateEnchantmentOptions(boolean validate) { - int numoptions = slotEnchantment.size(); - slotEnchantment.clear(); - - ItemStack toolstack = getSlot(0).getStack(); - if (toolstack == null) { - percentscrolled = 0; - return; - } - - Item item = toolstack.getItem(); - int enchantablity = item.getItemEnchantability(toolstack); - if (enchantablity == 0 && validate) { - percentscrolled = 0; - return; - } - - for (Enchantment enchantment : Enchantment.REGISTRY) { - if (enchantment == null || enchantment.type == null || (!enchantment.type.canEnchantItem(item) && validate)) { - continue; - } - int state = 0; - int level = -1; - if (NEIServerUtils.stackHasEnchantment(toolstack, Enchantment.getEnchantmentID(enchantment))) { - state = 2; - level = NEIServerUtils.getEnchantmentLevel(toolstack, Enchantment.getEnchantmentID(enchantment)); - } else if (NEIServerUtils.doesEnchantmentConflict(NEIServerUtils.getEnchantments(toolstack), enchantment) && validate) { - state = 1; - } - slotEnchantment.add(new EnchantmentHash(enchantment, state, level)); - } - if (numoptions != slotEnchantment.size()) { - percentscrolled = 0; - } - } - - public void drawSlots(GuiEnchantmentModifier gui) { - for (int slot = 0; slot < 3; slot++) { - int shade = 0; - String text = ""; - - int containerslot = slot + getScrolledSlots(); - if (containerslot + 1 > slotEnchantment.size()) { - shade = 1; - } else { - EnchantmentHash e = slotEnchantment.get(containerslot); - shade = e.state; - text = e.enchantment.getTranslatedName(e.level == -1 ? level : e.level); - if (gui.mc.fontRendererObj.getStringWidth(text) > 95 && text.contains("Projectile")) { - text = text.replace("Projectile", "Proj"); - } - if (gui.mc.fontRendererObj.getStringWidth(text) > 95 && text.contains("Protection")) { - text = text.replace("Protection", "Protect"); - } - if (gui.mc.fontRendererObj.getStringWidth(text) > 95 && text.contains("Bane of")) { - text = text.replace("Bane of ", ""); - } - } - - TextureUtils.changeTexture("textures/gui/container/enchanting_table.png"); - GlStateManager.color(1, 1, 1); - if (hasScrollBar()) { - gui.drawTexturedModalRect(relx, rely + slot * slotheight, 0, gui.ySize + slotheight * shade, cwidth - 30, slotheight); - gui.drawTexturedModalRect(relx + cwidth - 30, rely + slot * slotheight, cwidth - 23, gui.ySize + slotheight * shade, 30, slotheight); - } else { - gui.drawTexturedModalRect(relx, rely + slot * slotheight, 0, gui.ySize + slotheight * shade, cwidth + 7, slotheight); - } - - gui.getFontRenderer().drawString(text, relx + 4, rely + slot * slotheight + 5, textColourFromState(shade)); - } - } - - private boolean hasScrollBar() { - return getNumSlots() > 3; - } - - public void drawScrollBar(GuiEnchantmentModifier gui) { - if (!hasScrollBar()) { - return; - } - - int sbary = rely + (int) ((height - getScrollBarHeight()) * percentscrolled + 0.5); - int sbarx = relx + cwidth; - - Gui.drawRect(sbarx, rely, sbarx + getScrollBarWidth(), rely + height, 0xFF202020);//background - Gui.drawRect(sbarx, sbary, sbarx + getScrollBarWidth(), sbary + getScrollBarHeight(), 0xFF8B8B8B);//corners - Gui.drawRect(sbarx, sbary, sbarx + getScrollBarWidth() - 1, sbary + getScrollBarHeight() - 1, 0xFFF0F0F0);//topleft up - Gui.drawRect(sbarx + 1, sbary + 1, sbarx + getScrollBarWidth() - 1, sbary + getScrollBarHeight() - 1, 0xFF555555);//bottom right down - Gui.drawRect(sbarx + 1, sbary + 1, sbarx + getScrollBarWidth() - 2, sbary + getScrollBarHeight() - 2, 0xFFC6C6C6);//scrollbar - } - - private int textColourFromState(int shade) { - switch (shade) { - case 0: - return 0x685e4a; - case 1: - return 0x407f10; - default: - return 0xffff80; - } - } - - public void onUpdate(int mousex, int mousey) { - processScrollMouse(mousey); - } - - public void processScrollMouse(int mousey) { - mousey -= parentscreen.guiTop; - - if (scrollclicky >= 0) { - int scrolldiff = mousey - scrollclicky; - int barupallowed = (int) ((height - getScrollBarHeight()) * scrollpercent + 0.5); - int bardownallowed = (height - getScrollBarHeight()) - barupallowed; - - if (-scrolldiff > barupallowed) { - scrollmousey = scrollclicky - barupallowed; - } else if (scrolldiff > bardownallowed) { - scrollmousey = scrollclicky + bardownallowed; - } else { - scrollmousey = mousey; - } - - calculatePercentScrolled(); - } - } -} diff --git a/dependencies/main/java/codechicken/nei/ContainerPotionCreator.java b/dependencies/main/java/codechicken/nei/ContainerPotionCreator.java deleted file mode 100644 index efb725601b..0000000000 --- a/dependencies/main/java/codechicken/nei/ContainerPotionCreator.java +++ /dev/null @@ -1,171 +0,0 @@ -package codechicken.nei; - -import codechicken.core.inventory.ContainerExtended; -import codechicken.core.inventory.SlotHandleClicks; -import codechicken.lib.inventory.InventoryNBT; -import codechicken.lib.inventory.InventoryUtils; -import codechicken.lib.packet.PacketCustom; -import codechicken.nei.network.NEIClientPacketHandler; -import codechicken.nei.util.NEIClientUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ClickType; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.InventoryBasic; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; - -public class ContainerPotionCreator extends ContainerExtended { - public class SlotPotion extends Slot { - public SlotPotion(IInventory inv, int slotIndex, int x, int y) { - super(inv, slotIndex, x, y); - } - - @Override - public boolean isItemValid(ItemStack stack) { - return stack.getItem() instanceof ItemPotion; - } - - @Override - public void onSlotChanged() { - super.onSlotChanged(); - if (getHasStack()) { - ItemStack stack = getStack(); - if (!stack.hasTagCompound()) { - stack.setTagCompound(new NBTTagCompound()); - } - if (!stack.getTagCompound().hasKey("CustomPotionEffects")) { - stack.getTagCompound().setTag("CustomPotionEffects", new NBTTagList()); - } - } - } - } - - public class SlotPotionStore extends SlotHandleClicks { - public SlotPotionStore(IInventory inv, int slotIndex, int x, int y) { - super(inv, slotIndex, x, y); - } - - @Override - public ItemStack slotClick(ContainerExtended container, EntityPlayer player, int button, ClickType clickType) { - ItemStack held = player.inventory.getItemStack(); - if (button == 0 && clickType == ClickType.QUICK_MOVE) { - NEIClientUtils.cheatItem(getStack(), button, -1); - } else if (button == 1) { - putStack(null); - } else if (held != null) { - if (isItemValid(held)) { - putStack(InventoryUtils.copyStack(held, 1)); - player.inventory.setItemStack(null); - } - } else if (getHasStack()) { - player.inventory.setItemStack(getStack()); - } - - return null; - } - - @Override - public boolean isItemValid(ItemStack stack) { - return stack.getItem() instanceof ItemPotion; - } - } - - public static class InventoryPotionStore extends InventoryNBT { - public InventoryPotionStore() { - super(9, NEIClientConfig.global.nbt.getCompoundTag("potionStore")); - } - - @Override - public void markDirty() { - super.markDirty(); - NEIClientConfig.global.nbt.setTag("potionStore", tag); - NEIClientConfig.global.saveNBT(); - } - } - - InventoryPlayer playerInv; - InventoryBasic potionInv; - IInventory potionStoreInv; - - public ContainerPotionCreator(InventoryPlayer inventoryPlayer, IInventory potionStoreInv) { - playerInv = inventoryPlayer; - potionInv = new InventoryBasic("Potion", true, 1); - this.potionStoreInv = potionStoreInv; - - addSlotToContainer(new SlotPotion(potionInv, 0, 25, 102)); - for (int i = 0; i < 9; i++) { - addSlotToContainer(new SlotPotionStore(potionStoreInv, i, 8 + i * 18, 14)); - } - bindPlayerInventory(inventoryPlayer, 8, 125); - } - - @Override - public boolean doMergeStackAreas(int slotIndex, ItemStack stack) { - if (slotIndex < 10) { - return mergeItemStack(stack, 10, 46, true); - } - return mergeItemStack(stack, 0, 1, false); - } - - @Override - public boolean canInteractWith(EntityPlayer entityplayer) { - return true; - } - - @Override - public void onContainerClosed(EntityPlayer player) { - super.onContainerClosed(player); - - if (!player.worldObj.isRemote) { - InventoryUtils.dropOnClose(player, potionInv); - } - } - - @SuppressWarnings("unchecked") - @Override - public void handleInputPacket(PacketCustom packet) { - ItemStack potion = potionInv.getStackInSlot(0); - if (potion == null) { - return; - } - - boolean add = packet.readBoolean(); - Potion effect = Potion.getPotionById(packet.readUByte()); - - NBTTagList effects = potion.getTagCompound().getTagList("CustomPotionEffects", 10); - NBTTagList newEffects = new NBTTagList(); - for (int i = 0; i < effects.tagCount(); i++) { - NBTTagCompound tag = effects.getCompoundTagAt(i); - PotionEffect e = PotionEffect.readCustomPotionEffectFromNBT(tag); - if (e.getPotion() != effect) { - newEffects.appendTag(tag); - } - } - if (add) { - newEffects.appendTag(new PotionEffect(effect, packet.readInt(), packet.readUByte()).writeCustomPotionEffectToNBT(new NBTTagCompound())); - } - potion.getTagCompound().setTag("CustomPotionEffects", newEffects); - } - - public void setPotionEffect(Potion potion, int duration, int amplifier) { - PacketCustom packet = NEIClientPacketHandler.createContainerPacket(); - packet.writeBoolean(true); - packet.writeByte(Potion.getIdFromPotion(potion)); - packet.writeInt(duration); - packet.writeByte(amplifier); - packet.sendToServer(); - } - - public void removePotionEffect(Potion potion) { - PacketCustom packet = NEIClientPacketHandler.createContainerPacket(); - packet.writeBoolean(false); - packet.writeByte(Potion.getIdFromPotion(potion)); - packet.sendToServer(); - } -} \ No newline at end of file diff --git a/dependencies/main/java/codechicken/nei/DefaultHighlightHandler.java b/dependencies/main/java/codechicken/nei/DefaultHighlightHandler.java deleted file mode 100644 index b2d0f88602..0000000000 --- a/dependencies/main/java/codechicken/nei/DefaultHighlightHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.api.IHighlightHandler; -import codechicken.nei.api.ItemInfo; -import codechicken.nei.guihook.GuiContainerManager; -import net.minecraft.block.BlockRedstoneWire; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.world.World; - -import java.util.List; - -@Deprecated -public class DefaultHighlightHandler implements IHighlightHandler { - @Override - public List handleTextData(ItemStack stack, World world, EntityPlayer player, RayTraceResult rayTraceResult, List currenttip, ItemInfo.Layout layout) { - String name = null; - try { - String s = GuiContainerManager.itemDisplayNameShort(stack); - if (s != null && !s.endsWith("Unnamed")) { - name = s; - } - - if (name != null) { - currenttip.add(name); - } - } catch (Exception ignored) { - } - - IBlockState b = world.getBlockState(rayTraceResult.getBlockPos()); - if (name != null && b.getBlock() == Blocks.REDSTONE_WIRE) { - String s = "" + b.getValue(BlockRedstoneWire.POWER); - if (s.length() < 2) { - s = " " + s; - } - currenttip.set(currenttip.size() - 1, name + " " + s); - } - - return currenttip; - } - - @Override - public ItemStack identifyHighlight(World world, EntityPlayer player, RayTraceResult rayTraceResult) { - return null; - } -} diff --git a/dependencies/main/java/codechicken/nei/FastTransferManager.java b/dependencies/main/java/codechicken/nei/FastTransferManager.java deleted file mode 100644 index b31404fd43..0000000000 --- a/dependencies/main/java/codechicken/nei/FastTransferManager.java +++ /dev/null @@ -1,376 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.util.NEIClientUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.ClickType; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -import java.util.*; - -import static codechicken.nei.util.NEIServerUtils.*; - -public class FastTransferManager { - /** - * Based on the general assumption that we want to fill top to bottom, left to right - */ - public static class SlotPositionComparator implements Comparator { - Container container; - - public SlotPositionComparator(Container c) { - container = c; - } - - @Override - public int compare(Integer arg0, Integer arg1) { - Slot slot1 = container.getSlot(arg0); - Slot slot2 = container.getSlot(arg1); - - if (slot2.yDisplayPosition != slot1.yDisplayPosition) { - return slot1.yDisplayPosition - slot2.yDisplayPosition; - } - return slot1.xDisplayPosition - slot2.xDisplayPosition; - } - } - - public LinkedList> slotZones = new LinkedList>(); - public HashMap slotZoneMap = new HashMap(); - - private void generateSlotMap(Container container, ItemStack stack) { - stack = stack.copy(); - stack.stackSize = 1; - - for (int slotNo = 0; slotNo < container.inventorySlots.size(); slotNo++) { - if (slotZoneMap.containsKey(slotNo) || !container.getSlot(slotNo).isItemValid(stack)) { - continue; - } - - HashSet connectedSlots = new HashSet(); - findConnectedSlots(container, slotNo, connectedSlots); - - LinkedList zoneSlots = new LinkedList(connectedSlots); - Collections.sort(zoneSlots, new SlotPositionComparator(container)); - slotZones.add(zoneSlots); - - for (int i : zoneSlots) { - slotZoneMap.put(i, slotZones.size() - 1); - } - } - } - - private void findConnectedSlots(Container container, int slotNo, HashSet connectedSlots) { - connectedSlots.add(slotNo); - Slot slot = container.getSlot(slotNo); - final int threshold = 18; - - for (int i = 0; i < container.inventorySlots.size(); i++) { - if (connectedSlots.contains(i)) { - continue; - } - - Slot slot1 = container.getSlot(i); - if (Math.abs(slot.xDisplayPosition - slot1.xDisplayPosition) <= threshold && Math.abs(slot.yDisplayPosition - slot1.yDisplayPosition) <= threshold) { - findConnectedSlots(container, i, connectedSlots); - } - } - } - - public static int findSlotWithItem(Container container, ItemStack teststack) { - for (int slotNo = 0; slotNo < container.inventorySlots.size(); slotNo++) { - ItemStack stack = container.getSlot(slotNo).getStack(); - if (stack != null && areStacksSameType(stack, teststack)) { - return slotNo; - } - } - return -1; - } - - public static void clearSlots(Container container) { - for (int slotNo = 0; slotNo < container.inventorySlots.size(); slotNo++) { - container.inventorySlots.get(slotNo).putStack(null); - } - } - - public void performMassTransfer(GuiContainer window, int fromSlot, int toSlot, ItemStack heldStack) { - generateSlotMap(window.inventorySlots, heldStack); - - Integer fromZone = slotZoneMap.get(fromSlot); - Integer toZone = slotZoneMap.get(toSlot); - - if (fromZone == null || toZone == null || fromZone.equals(toZone)) { - return; - } - - if (NEIClientUtils.getHeldItem() != null && !areStacksSameType(heldStack, NEIClientUtils.getHeldItem())) { - return; - } - - if (!fillZoneWithHeldItem(window, toZone)) { - return; - } - - for (int transferFrom : slotZones.get(fromZone)) { - ItemStack transferStack = window.inventorySlots.getSlot(transferFrom).getStack(); - - if (!areStacksSameType(heldStack, transferStack)) { - continue; - } - - clickSlot(window, transferFrom); - if (!fillZoneWithHeldItem(window, toZone)) { - clickSlot(window, transferFrom); - return; - } - } - } - - /** - * @return The slot that one item from the source slot will end up in apon shift clicking, -1 if none. - */ - public int findShiftClickDestinationSlot(Container container, int fromSlot) { - LinkedList save = saveContainer(container); - - Slot slot = container.getSlot(fromSlot); - ItemStack stack = slot.getStack(); - if (stack == null) { - return -1; - } - - stack.stackSize = 1; - slot.putStack(stack.copy()); - - LinkedList compareBefore = saveContainer(container); - container.slotClick(fromSlot, 0, ClickType.QUICK_MOVE, Minecraft.getMinecraft().thePlayer); - LinkedList compareAfter = saveContainer(container); - - try { - //if(compareAfter.get(fromSlot) != null)//transfer failed - //return -1; - - for (int i = 0; i < compareBefore.size(); i++) { - if (i == fromSlot) { - continue; - } - - ItemStack before = compareBefore.get(i); - ItemStack after = compareAfter.get(i); - - if (!areStacksIdentical(before, after) && after != null) { - if (before == null ? areStacksSameType(stack, after) ://transfered into this empty slot - areStacksSameType(stack, after) && after.stackSize - before.stackSize > 0)//it added to this stack - { - return i; - } - } - } - - return -1; - } finally { - restoreContainer(container, save); - } - } - - public LinkedList saveContainer(Container container) { - LinkedList stacks = new LinkedList(); - for (int i = 0; i < container.inventorySlots.size(); i++) { - stacks.add(copyStack(container.getSlot(i).getStack())); - } - - return stacks; - } - - public void restoreContainer(Container container, LinkedList items) { - for (int i = 0; i < container.inventorySlots.size(); i++) { - container.getSlot(i).putStack(items.get(i)); - } - - container.slotClick(-999, 0, ClickType.PICKUP, Minecraft.getMinecraft().thePlayer); - } - - public void transferItem(GuiContainer window, int fromSlot) { - int toSlot = findShiftClickDestinationSlot(window.inventorySlots, fromSlot); - if (toSlot == -1) { - return; - } - - Slot from = window.inventorySlots.getSlot(fromSlot); - - if (from.isItemValid(from.getStack())) { - moveOneItem(window, fromSlot, toSlot); - } else//slots that you can't put stuff in - { - moveOutputSet(window, fromSlot, toSlot); - } - } - - public void moveOutputSet(GuiContainer window, int fromSlot, int toSlot) { - if (NEIClientUtils.getHeldItem() != null) { - return; - } - - clickSlot(window, fromSlot);//pickup fromSlot - if (NEIClientUtils.getHeldItem() == null)//maybe this container does auto transfers. No need to pick up the final item - { - return; - } - clickSlot(window, toSlot);//place one in toSlot - } - - public void moveOneItem(GuiContainer window, int fromSlot, int toSlot) { - clickSlot(window, fromSlot);//pickup fromSlot - clickSlot(window, toSlot, 1);//place one in toSlot - clickSlot(window, fromSlot);//place down in fromSlot - } - - public void retrieveItem(GuiContainer window, int toSlot) { - Slot slot = window.inventorySlots.getSlot(toSlot); - ItemStack slotStack = slot.getStack(); - if (slotStack == null || - slotStack.stackSize == slot.getSlotStackLimit() || - slotStack.stackSize == slotStack.getMaxStackSize()) { - return; - } - - generateSlotMap(window.inventorySlots, slotStack); - - Integer destZone = slotZoneMap.get(toSlot); - if (destZone == null)//slots that don't accept - { - return; - } - - int firstZoneSlot = findShiftClickDestinationSlot(window.inventorySlots, toSlot); - int firstZone = -1; - if (firstZoneSlot != -1) { - Integer integer = slotZoneMap.get(firstZoneSlot); - if (integer != null) { - firstZone = integer; - if (retrieveItemFromZone(window, firstZone, toSlot)) { - return; - } - } - } - - for (int zone = 0; zone < slotZones.size(); zone++) { - if (zone == destZone || zone == firstZone) { - continue; - } - - if (retrieveItemFromZone(window, zone, toSlot)) { - return; - } - } - - retrieveItemFromZone(window, destZone, toSlot); - } - - private boolean retrieveItemFromZone(GuiContainer window, int zone, int toSlot) { - ItemStack stack = window.inventorySlots.getSlot(toSlot).getStack(); - for (int i : slotZones.get(zone)) { - if (i == toSlot) { - continue; - } - - Slot slot = window.inventorySlots.getSlot(i); - ItemStack stack1 = slot.getStack(); - - if (areStacksSameType(stack, stack1) && - stack1.stackSize != slot.getSlotStackLimit() && //get from full stacks on second pass - stack1.stackSize != stack1.getMaxStackSize()) { - moveOneItem(window, i, toSlot); - return true; - } - } - - for (int i : slotZones.get(zone)) { - if (i == toSlot) { - continue; - } - - Slot slot = window.inventorySlots.getSlot(i); - ItemStack stack1 = slot.getStack(); - - if (areStacksSameType(stack, stack1)) { - moveOneItem(window, i, toSlot); - return true; - } - } - return false; - } - - public static void clickSlot(GuiContainer window, int slotIndex) { - clickSlot(window, slotIndex, 0); - } - - public static void clickSlot(GuiContainer window, int slotIndex, int button) { - clickSlot(window, slotIndex, button, ClickType.PICKUP); - } - - public static void clickSlot(GuiContainer window, int slotIndex, int button, ClickType clickType) { - GuiContainerManager.getManager(window).handleSlotClick(slotIndex, button, clickType); - } - - private boolean fillZoneWithHeldItem(GuiContainer window, int zoneIndex) { - for (int transferTo : slotZones.get(zoneIndex)) { - ItemStack held = NEIClientUtils.getHeldItem(); - - if (held == null) { - break; - } - - ItemStack inToSlot = window.inventorySlots.getSlot(transferTo).getStack(); - - if (!areStacksSameType(inToSlot, held)) { - continue; - } - - clickSlot(window, transferTo); - } - - for (int transferTo : slotZones.get(zoneIndex))//repeat on empty slots - { - ItemStack held = NEIClientUtils.getHeldItem(); - - if (held == null) { - break; - } - - ItemStack inToSlot = window.inventorySlots.getSlot(transferTo).getStack(); - - if (inToSlot != null) { - continue; - } - - clickSlot(window, transferTo); - } - - return NEIClientUtils.getHeldItem() == null; - } - - public void throwAll(GuiContainer window, int pickedUpFromSlot) { - ItemStack held = NEIClientUtils.getHeldItem(); - if (held == null) { - return; - } - - clickSlot(window, -999); - - generateSlotMap(window.inventorySlots, held); - Integer zone = slotZoneMap.get(pickedUpFromSlot); - if (zone == null) //something went wrong and we can't work out where the item was picked up from - { - return; - } - - for (int slotIndex : slotZones.get(zone)) { - Slot slot = window.inventorySlots.getSlot(slotIndex); - if (areStacksSameType(held, slot.getStack())) { - clickSlot(window, slotIndex); - clickSlot(window, -999); - } - } - } -} diff --git a/dependencies/main/java/codechicken/nei/FingerprintChecker.java b/dependencies/main/java/codechicken/nei/FingerprintChecker.java deleted file mode 100644 index 688395937b..0000000000 --- a/dependencies/main/java/codechicken/nei/FingerprintChecker.java +++ /dev/null @@ -1,86 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.fingerprint.FingerprintViolatedCrashCallable; -import com.google.common.collect.ImmutableList; -import net.minecraftforge.fml.common.*; -import org.apache.logging.log4j.Level; - -import java.security.cert.Certificate; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -/** - * Created by covers1624 on 13/12/2016. - * To be packaged in each mod runtime, used to cross verify jar fingerprints. - * Idea behind this: - * A malicious user would have to override the fingerprint data in all mod jars this is packaged with in order to avoid detection. - * This is not to be used as DRM. It is used simply to provide cross verification of jars. - */ -public class FingerprintChecker { - - private static final Map modCertMap = new HashMap(); - private static final List invalidMods = new ArrayList(); - - static { - //@formatter:off - modCertMap.put("CodeChickenLib" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("CodeChickenCore" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("ChickenChunks" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("EnderStorage" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("Translocator" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("NotEnoughItems" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - modCertMap.put("forgemultipartcbe" , "f1850c39b2516232a2108a7bd84d1cb5df93b261"); - //@formatter:on - } - - public static void runFingerprintChecks() { - try { - ModContainer activeContainer = Loader.instance().activeModContainer(); - for (Entry modEntry : Loader.instance().getIndexedModList().entrySet()) { - for (Entry certEntry : modCertMap.entrySet()) { - if (modEntry.getKey().equals(certEntry.getKey())) { - Object modInstance = modEntry.getValue().getMod(); - if (modInstance == null) { - FMLLog.log(activeContainer.getModId() + " Fingerprint Verification", Level.FATAL, "Unable to do Fingerprint Verification for mod %s! ModContainer returned a null mod instance!", modEntry.getKey()); - break; - } - if (modInstance.getClass().getName().contains("net.minecraftforge.")) { - FMLLog.log(activeContainer.getModId() + " Fingerprint Verification", Level.FATAL, "Unable to do Fingerprint Verification for mod %s! ModContainer returned is a suspected FML class! [%s]", modEntry.getKey(), modInstance.getClass().getName()); - } - - Certificate[] certificates = modInstance.getClass().getProtectionDomain().getCodeSource().getCertificates(); - ImmutableList.Builder certBuilder = ImmutableList.builder(); - if (certificates != null) { - for (Certificate cert : certificates) { - certBuilder.add(CertificateHelper.getFingerprint(cert)); - } - } - - ImmutableList certList = certBuilder.build(); - - String expectedFingerprint = certEntry.getValue(); - - if (expectedFingerprint != null && !expectedFingerprint.isEmpty()) { - if (!certList.contains(expectedFingerprint)) { - FMLLog.log(activeContainer.getModId() + " Fingerprint Verification", Level.FATAL, "The fingerprint for mod %s is invalid! Expected: %s", modEntry.getKey(), expectedFingerprint); - invalidMods.add(modEntry.getKey()); - break; - } else { - FMLLog.log(activeContainer.getModId() + " Fingerprint Verification", Level.DEBUG, "Valid fingerprint found for mod %s.", modEntry.getKey()); - } - } - - break; - } - } - } - FMLCommonHandler.instance().registerCrashCallable(new FingerprintViolatedCrashCallable(activeContainer.getModId(), invalidMods)); - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/dependencies/main/java/codechicken/nei/GuiEnchantmentModifier.java b/dependencies/main/java/codechicken/nei/GuiEnchantmentModifier.java deleted file mode 100644 index 4438d0afb7..0000000000 --- a/dependencies/main/java/codechicken/nei/GuiEnchantmentModifier.java +++ /dev/null @@ -1,106 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.texture.TextureUtils; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.world.World; - -import java.io.IOException; - -import static codechicken.nei.util.NEIClientUtils.translate; - -public class GuiEnchantmentModifier extends GuiContainer { - ContainerEnchantmentModifier container; - - public GuiEnchantmentModifier(InventoryPlayer inventoryplayer, World world) { - super(new ContainerEnchantmentModifier(inventoryplayer, world)); - container = (ContainerEnchantmentModifier) inventorySlots; - container.parentscreen = this; - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString(translate("enchant"), 12, 6, 0x404040); - fontRendererObj.drawString(translate("enchant.level"), 19, 20, 0x404040); - } - - protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { - GlStateManager.color(1, 1, 1, 1); - TextureUtils.changeTexture("textures/gui/container/enchanting_table.png"); - GlStateManager.translate(guiLeft, guiTop, 0); - drawTexturedModalRect(0, 0, 0, 0, xSize, ySize); - - container.onUpdate(i, j); - container.drawSlots(this); - container.drawScrollBar(this); - - String levelstring = "" + container.level; - fontRendererObj.drawString(levelstring, 33 - fontRendererObj.getStringWidth(levelstring) / 2, 34, 0xFF606060); - - GlStateManager.translate(-guiLeft, -guiTop, 0); - } - - public void initGui() { - super.initGui(); - - buttonList.add(new GuiNEIButton(0, width / 2 - 78, height / 2 - 52, 12, 12, "<")); - buttonList.add(new GuiNEIButton(1, width / 2 - 44, height / 2 - 52, 12, 12, ">")); - buttonList.add(new GuiNEIButton(2, width / 2 - 80, height / 2 - 15, 50, 12, lockDisplayString())); - } - - private String lockDisplayString() { - return validateEnchantments() ? translate("enchant.locked") : translate("enchant.unlocked"); - } - - public static boolean validateEnchantments() { - return NEIClientConfig.world.nbt.getBoolean("validateenchantments"); - } - - public static void toggleEnchantmentValidation() { - NEIClientConfig.world.nbt.setBoolean("validateenchantments", !validateEnchantments()); - NEIClientConfig.world.saveNBT(); - } - - protected void actionPerformed(GuiButton guibutton) { - if (guibutton.id == 0) { - changeLevel(-1); - } else if (guibutton.id == 1) { - changeLevel(1); - } else if (guibutton.id == 2) { - toggleEnchantmentValidation(); - container.updateEnchantmentOptions(validateEnchantments()); - guibutton.displayString = lockDisplayString(); - } - } - - private void changeLevel(int i) { - container.level += i; - buttonList.get(0).enabled = container.level != 1; - buttonList.get(1).enabled = container.level != 10; - } - - @Override - protected void mouseClicked(int i, int j, int k) throws IOException { - if (container.clickButton(i, j, k)) { - return; - } - if (container.clickScrollBar(i, j, k)) { - return; - } - - super.mouseClicked(i, j, k); - } - - @Override - protected void mouseReleased(int i, int j, int k) { - container.mouseUp(i, j, k); - super.mouseReleased(i, j, k); - } - - public FontRenderer getFontRenderer() { - return fontRendererObj; - } -} diff --git a/dependencies/main/java/codechicken/nei/GuiExtendedCreativeInv.java b/dependencies/main/java/codechicken/nei/GuiExtendedCreativeInv.java deleted file mode 100644 index 56ec566427..0000000000 --- a/dependencies/main/java/codechicken/nei/GuiExtendedCreativeInv.java +++ /dev/null @@ -1,56 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.texture.TextureUtils; -import codechicken.nei.api.INEIGuiHandler; -import codechicken.nei.api.TaggedInventoryArea; -import codechicken.nei.util.NEIServerUtils; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; - -import java.util.Arrays; -import java.util.List; - -public class GuiExtendedCreativeInv extends GuiContainer implements INEIGuiHandler { - public GuiExtendedCreativeInv(Container par1Container) { - super(par1Container); - ySize = 198; - } - - @Override - protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { - GlStateManager.color(1, 1, 1, 1); - TextureUtils.changeTexture("nei:textures/gui/inv.png"); - - int x = guiLeft; - int y = guiTop - 4; - - drawTexturedModalRect(x - 23, y, 0, 0, 199, 204); - } - - @Override - public VisibilityData modifyVisiblity(GuiContainer gui, VisibilityData currentVisibility) { - return currentVisibility; - } - - @Override - public Iterable getItemSpawnSlots(GuiContainer gui, ItemStack item) { - return NEIServerUtils.getRange(0, 54); - } - - @Override - public List getInventoryAreas(GuiContainer gui) { - return Arrays.asList(new TaggedInventoryArea("ExtendedCreativeInv", 0, 54, inventorySlots)); - } - - @Override - public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button) { - return false; - } - - @Override - public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) { - return false; - } -} diff --git a/dependencies/main/java/codechicken/nei/GuiNEIButton.java b/dependencies/main/java/codechicken/nei/GuiNEIButton.java deleted file mode 100644 index 026cca4af7..0000000000 --- a/dependencies/main/java/codechicken/nei/GuiNEIButton.java +++ /dev/null @@ -1,40 +0,0 @@ -package codechicken.nei; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.util.ResourceLocation; - -public class GuiNEIButton extends GuiButton { - protected static ResourceLocation guiTex = new ResourceLocation("textures/gui/widgets.png"); - - public GuiNEIButton(int i, int j, int k, int l, int i1, String s) { - super(i, j, k, l, i1, s); - } - - public void drawButton(Minecraft minecraft, int i, int j) { - if (!visible) { - return; - } - - FontRenderer fontrenderer = minecraft.fontRendererObj; - minecraft.renderEngine.bindTexture(guiTex); - GlStateManager.color(1, 1, 1, 1); - boolean flag = i >= xPosition && j >= yPosition && i < xPosition + width && j < yPosition + height; - int k = getHoverState(flag); - drawTexturedModalRect(xPosition, yPosition, 0, 46 + k * 20, width / 2, height / 2);//top left - drawTexturedModalRect(xPosition + width / 2, yPosition, 200 - width / 2, 46 + k * 20, width / 2, height / 2);//top right - drawTexturedModalRect(xPosition, yPosition + height / 2, 0, 46 + k * 20 + 20 - height / 2, width / 2, height / 2);//bottom left - drawTexturedModalRect(xPosition + width / 2, yPosition + height / 2, 200 - width / 2, 46 + k * 20 + 20 - height / 2, width / 2, height / 2);//bottom right - mouseDragged(minecraft, i, j); - - if (!enabled) { - drawCenteredString(fontrenderer, displayString, xPosition + width / 2, yPosition + (height - 8) / 2, 0xffa0a0a0); - } else if (flag) { - drawCenteredString(fontrenderer, displayString, xPosition + width / 2, yPosition + (height - 8) / 2, 0xffffa0); - } else { - drawCenteredString(fontrenderer, displayString, xPosition + width / 2, yPosition + (height - 8) / 2, 0xe0e0e0); - } - } -} diff --git a/dependencies/main/java/codechicken/nei/GuiPotionCreator.java b/dependencies/main/java/codechicken/nei/GuiPotionCreator.java deleted file mode 100644 index 02f11d6284..0000000000 --- a/dependencies/main/java/codechicken/nei/GuiPotionCreator.java +++ /dev/null @@ -1,339 +0,0 @@ -package codechicken.nei; - -import codechicken.core.gui.GuiCCButton; -import codechicken.core.gui.GuiCCTextField; -import codechicken.core.gui.GuiScrollSlot; -import codechicken.core.inventory.GuiContainerWidget; -import codechicken.lib.util.FontUtils; -import codechicken.lib.texture.TextureUtils; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.text.translation.I18n; - -import java.awt.*; -import java.util.ArrayList; - -public class GuiPotionCreator extends GuiContainerWidget { - public class GuiSlotPotionEffects extends GuiScrollSlot { - public int selectedslot = -1; - public boolean enabled = true; - private ArrayList validPotions = new ArrayList(); - - public GuiSlotPotionEffects(int x, int y) { - super(x, y, 108, 76); - for (Potion p : Potion.REGISTRY) { - if (p != null) { - validPotions.add(p); - } - } - setSmoothScroll(false); - setMargins(0, 0, 0, 0); - } - - @Override - public int getSlotHeight(int slot) { - return 19; - } - - @Override - public void drawBackground(float frame) { - super.drawBackground(frame); - drawRect(x, y, x + width, y + height, 0xFF000000); - } - - @Override - public void drawOverlay(float frame) { - } - - @Override - public int scrollbarGuideAlignment() { - return 0; - } - - @Override - public Dimension scrollbarDim() { - Dimension dim = super.scrollbarDim(); - dim.width = 7; - return dim; - } - - @Override - protected void drawSlot(int slot, int x, int y, int mx, int my, float frame) { - GlStateManager.color(1, 1, 1, 1); - Potion potion = validPotions.get(slot); - PotionEffect effect = getEffect(potion); - boolean blank = effect == null; - if (effect == null) { - effect = new PotionEffect(potion, 1200, 0); - } - int shade = selectedslot == slot ? 2 : blank ? 1 : 0; - - TextureUtils.changeTexture("textures/gui/container/enchanting_table.png"); - drawTexturedModalRect(x, y, 0, 166 + getSlotHeight(slot) * shade, width - 30, getSlotHeight(slot)); - drawTexturedModalRect(x + width - 30, y, width - 23, 166 + getSlotHeight(slot) * shade, 30, getSlotHeight(slot)); - - if (potion.hasStatusIcon()) { - TextureUtils.changeTexture("textures/gui/container/inventory.png"); - int icon = potion.getStatusIconIndex(); - drawTexturedModalRect(x + 1, y + 1, icon % 8 * 18, 198 + icon / 8 * 18, 18, 18); - } - - String name = I18n.translateToLocal(potion.getName()); - String amp = effect.getAmplifier() > 0 ? " " + translateAmplifier(effect.getAmplifier()) : ""; - int textColour = shade == 0 ? 0x685e4a : shade == 1 ? 0x407f10 : 0xffff80; - if (fontRenderer.getStringWidth(name + amp) < width - 20) { - fontRenderer.drawString(name + amp, x + 20, y + 1, textColour); - } else { - fontRenderer.drawString(name, x + 20, y + 1, textColour); - FontUtils.drawRightString(amp, x + width - 10, y + 10, textColour); - } - - String duration = Potion.getPotionDurationString(effect, 1.0F); - textColour = shade == 0 ? 0xA0A0A0 : shade == 1 ? 0x808080 : 0xCCCCCC; - fontRenderer.drawStringWithShadow(duration, x + 20, y + 10, textColour); - } - - private PotionEffect getEffect(Potion potion) { - ItemStack potionStack = container.potionInv.getStackInSlot(0); - if (potionStack != null && potionStack.hasTagCompound() && potionStack.getTagCompound().hasKey("CustomPotionEffects")) { - NBTTagList potionTagList = potionStack.getTagCompound().getTagList("CustomPotionEffects", 10); - for (int i = 0; i < potionTagList.tagCount(); i++) { - PotionEffect effect = PotionEffect.readCustomPotionEffectFromNBT(potionTagList.getCompoundTagAt(i)); - if (effect.getPotion() == potion) { - return effect; - } - } - } - return null; - } - - @Override - protected int getNumSlots() { - return validPotions.size(); - } - - @Override - protected void slotClicked(int slot, int button, int mx, int my, int count) { - if (!enabled) { - return; - } - - if (button == 0) { - select(slot); - applyEffect(); - } else if (button == 1) { - deselect(); - container.removePotionEffect(validPotions.get(slot)); - } - } - - public void selectNext() { - if (selectedslot >= 0 && selectedslot + 1 < getNumSlots()) { - select(selectedslot + 1); - showSlot(selectedslot); - } - } - - public void selectPrev() { - if (selectedslot > 0) { - select(selectedslot - 1); - showSlot(selectedslot); - } - } - - public void setEnabled(boolean b) { - if (b == enabled) { - return; - } - enabled = b; - if (!enabled) { - deselect(); - } - } - - private void select(int slot) { - selectedslot = slot; - durationField.setEnabled(true); - PotionEffect effect = getEffect(validPotions.get(slot)); - if (effect == null) { - effect = new PotionEffect(validPotions.get(slot), 1200, 0); - } - durationField.setDurationTicks(effect.getDuration()); - amplifier = effect.getAmplifier(); - validateInputButtons(); - } - - private void deselect() { - selectedslot = -1; - durationField.setEnabled(false); - ampDown.setEnabled(false); - ampUp.setEnabled(false); - } - - public Potion selectedPotion() { - return validPotions.get(selectedslot); - } - } - - public class GuiDurationField extends GuiCCTextField { - private String baseValue; - - public GuiDurationField(int x, int y, int width, int height) { - super(x, y, width, height, "100"); - setMaxStringLength(4); - setAllowedCharacters("0123456789"); - baseValue = getText(); - } - - public void setDurationTicks(int i) { - i /= 20; - String minutes = Integer.toString(i / 60); - String seconds = Integer.toString(i % 60); - if (seconds.length() == 1) { - seconds = '0' + seconds; - } - setText(minutes + seconds); - } - - @Override - public void setEnabled(boolean b) { - super.setEnabled(b); - if (!isEnabled()) { - setText("100"); - } - } - - @Override - public void onFocusChanged() { - if (isFocused()) { - baseValue = getText(); - } else { - if (!validateValue()) { - setText(baseValue); - } else { - applyEffect(); - } - } - } - - @Override - public void onTextChanged(String oldText) { - validateInputButtons(); - } - - private boolean validateValue() { - try { - int i = Integer.parseInt(getText()); - return i > 1 && getDurationTicks() < Short.MAX_VALUE && i / 100 <= 60 && i % 100 < 60; - } catch (NumberFormatException nfe) { - return false; - } - } - - @Override - public void drawText() { - String s = getText(); - String seconds = s.substring(Math.max(0, s.length() - 2), Math.max(0, s.length() - 2) + Math.min(s.length(), 2)); - String minutes = s.length() < 3 ? "" : s.substring(0, s.length() - 2); - int ty = y + height / 2 - 4; - int tcolour = getTextColour(); - FontUtils.drawCenteredString(":", x + width / 2 + 1, ty, tcolour); - FontUtils.drawRightString(seconds, x + width - 3, ty, tcolour); - FontUtils.drawRightString(minutes, x + width / 2 - 1, ty, tcolour); - } - - @Override - public int getTextColour() { - return isFocused() ? 0xCCCCCC : 0x909090; - } - - public int getDurationTicks() { - int i = Integer.parseInt(getText()); - return ((i / 100) * 60 + (i % 100)) * 20; - } - } - - int amplifier = 0; - GuiCCButton ampDown; - GuiCCButton ampUp; - GuiSlotPotionEffects slotPotionEffects; - GuiDurationField durationField; - ContainerPotionCreator container; - - public GuiPotionCreator(InventoryPlayer inventoryplayer) { - super(new ContainerPotionCreator(inventoryplayer, new ContainerPotionCreator.InventoryPotionStore()), 176, 208); - container = (ContainerPotionCreator) inventorySlots; - } - - public void applyEffect() { - if (slotPotionEffects.selectedslot >= 0) { - container.setPotionEffect(slotPotionEffects.selectedPotion(), durationField.getDurationTicks(), amplifier); - } - } - - public String translateAmplifier(int amplifier) { - switch (amplifier) { - case 0: - return "I"; - case 1: - return "II"; - case 2: - return "III"; - case 3: - return "IV"; - case 4: - return "V"; - } - return Integer.toString(amplifier); - } - - public void validateInputButtons() { - ampDown.setEnabled(amplifier > 0); - ampUp.setEnabled(amplifier < 3); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - //fontRenderer.drawString("Potion", 12, 6, 0x404040); - } - - @Override - public void drawBackground() { - TextureUtils.changeTexture("nei:textures/gui/potion.png"); - drawTexturedModalRect(0, 0, 0, 0, xSize, ySize); - - FontUtils.drawCenteredString("Favourite Potions", xSize / 2, 4, 0x404040); - fontRendererObj.drawString("Duration", 12, 40, 0x404040); - fontRendererObj.drawString("Level", 19, 73, 0x404040); - FontUtils.drawCenteredString(translateAmplifier(amplifier), 33, 86, 0xFF606060); - } - - @Override - public void addWidgets() { - add(ampDown = new GuiCCButton(10, 84, 12, 12, "<").setActionCommand("ampDown")); - add(ampUp = new GuiCCButton(44, 84, 12, 12, ">").setActionCommand("ampUp")); - add(durationField = new GuiDurationField(15, 53, 35, 12)); - add(slotPotionEffects = new GuiSlotPotionEffects(60, 38)); - } - - @Override - public void updateScreen() { - super.updateScreen(); - slotPotionEffects.setEnabled(container.potionInv.getStackInSlot(0) != null); - } - - @Override - public void actionPerformed(String ident, Object... params) { - if (ident.equals("ampDown")) { - amplifier--; - } else if (ident.equals("ampUp")) { - amplifier++; - } - applyEffect(); - validateInputButtons(); - } -} diff --git a/dependencies/main/java/codechicken/nei/HUDRenderer.java b/dependencies/main/java/codechicken/nei/HUDRenderer.java deleted file mode 100644 index 023b0b642d..0000000000 --- a/dependencies/main/java/codechicken/nei/HUDRenderer.java +++ /dev/null @@ -1,97 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.KeyManager.IKeyStateTracker; -import codechicken.nei.api.ItemInfo; -import codechicken.nei.guihook.GuiContainerManager; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.world.World; - -import java.awt.*; -import java.util.ArrayList; -import java.util.List; - -import static codechicken.lib.gui.GuiDraw.*; - -@Deprecated -public class HUDRenderer implements IKeyStateTracker { - @Override - public void tickKeyStates() { -// if (KeyBindings.get("nei.options.keys.world.highlight_tips").isPressed()) { -// ConfigTag tag = NEIClientConfig.getSetting("world.highlight_tips"); -// tag.setBooleanValue(!tag.getBooleanValue()); -// } - } - - public static void renderOverlay() { - Minecraft mc = Minecraft.getMinecraft(); - if (mc.currentScreen == null && - mc.theWorld != null && - !mc.gameSettings.keyBindPlayerList.isKeyDown() && - NEIClientConfig.getBooleanSetting("world.highlight_tips") && - mc.objectMouseOver != null && - mc.objectMouseOver.typeOfHit == RayTraceResult.Type.BLOCK) { - World world = mc.theWorld; - ArrayList items = ItemInfo.getIdentifierItems(world, mc.thePlayer, mc.objectMouseOver); - if (items.isEmpty()) { - return; - } - - int minDamage = Integer.MAX_VALUE; - ItemStack stack = null; - for (ItemStack astack : items) { - if (astack.getItem() != null && astack.getItemDamage() < minDamage) { - stack = astack; - minDamage = stack.getItemDamage(); - } - } - - renderOverlay(stack, ItemInfo.getText(stack, world, mc.thePlayer, mc.objectMouseOver), getPositioning()); - } - } - - public static void renderOverlay(ItemStack stack, List textData, Point pos) { - if ((stack == null || stack.getItem() == null) && textData.isEmpty()) { - return; - } - - int w = 0; - for (String s : textData) { - w = Math.max(w, getStringWidth(s) + 29); - } - int h = Math.max(24, 10 + 10 * textData.size()); - - Dimension size = displaySize(); - int x = (size.width - w - 1) * pos.x / 10000; - int y = (size.height - h - 1) * pos.y / 10000; - - GlStateManager.disableRescaleNormal(); - RenderHelper.disableStandardItemLighting(); - GlStateManager.disableDepth(); - - //drawTooltipBox(x, y, w, h); - - int ty = (h - 8 * textData.size()) / 2; - for (int i = 0; i < textData.size(); i++) { - drawString(textData.get(i), x + 24, y + ty + 10 * i, 0xFFA0A0A0, true); - } - - GlStateManager.enableRescaleNormal(); - RenderHelper.enableGUIStandardItemLighting(); - - if (stack != null && stack.getItem() != null) { - GuiContainerManager.drawItem(x + 5, y + h / 2 - 8, stack); - } - } - - private static Point getPositioning() { - return new Point(NEIClientConfig.getSetting("world.highlight_tips.x").getIntValue(), NEIClientConfig.getSetting("world.highlight_tips.y").getIntValue()); - } - - public static void load() { - //KeyManager.trackers.add(new HUDRenderer()); - } -} diff --git a/dependencies/main/java/codechicken/nei/Image.java b/dependencies/main/java/codechicken/nei/Image.java deleted file mode 100644 index 5290e00b7c..0000000000 --- a/dependencies/main/java/codechicken/nei/Image.java +++ /dev/null @@ -1,15 +0,0 @@ -package codechicken.nei; - -public class Image { - public int x; - public int y; - public int width; - public int height; - - public Image(int i, int j, int k, int l) { - x = i; - y = j; - width = k; - height = l; - } -} diff --git a/dependencies/main/java/codechicken/nei/InfiniteStackSizeHandler.java b/dependencies/main/java/codechicken/nei/InfiniteStackSizeHandler.java deleted file mode 100644 index cae95f8667..0000000000 --- a/dependencies/main/java/codechicken/nei/InfiniteStackSizeHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.inventory.InventoryUtils; -import codechicken.nei.api.IInfiniteItemHandler; -import codechicken.nei.util.NEIServerUtils; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; - -public class InfiniteStackSizeHandler implements IInfiniteItemHandler { - @Override - public void onPickup(ItemStack heldItem) { - heldItem.stackSize = 1; - } - - @Override - public void onPlaceInfinite(ItemStack heldItem) { - heldItem.stackSize = 111; - } - - @Override - public boolean canHandleItem(ItemStack stack) { - return !stack.isItemStackDamageable(); - } - - @Override - public boolean isItemInfinite(ItemStack stack) { - return stack.stackSize == -1 || stack.stackSize > 100; - } - - @Override - public void replenishInfiniteStack(InventoryPlayer inv, int slotNo) { - ItemStack stack = inv.getStackInSlot(slotNo); - stack.stackSize = 111; - - for (int i = 0; i < inv.getSizeInventory(); i++) { - if (i == slotNo) { - continue; - } - - if (NEIServerUtils.areStacksSameType(stack, inv.getStackInSlot(i))) { - inv.setInventorySlotContents(i, null); - } - } - } - - @Override - public ItemStack getInfiniteItem(ItemStack typeStack) { - return InventoryUtils.copyStack(typeStack, -1); - } -} diff --git a/dependencies/main/java/codechicken/nei/InfiniteToolHandler.java b/dependencies/main/java/codechicken/nei/InfiniteToolHandler.java deleted file mode 100644 index c55aea6677..0000000000 --- a/dependencies/main/java/codechicken/nei/InfiniteToolHandler.java +++ /dev/null @@ -1,37 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.api.IInfiniteItemHandler; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; - -public class InfiniteToolHandler implements IInfiniteItemHandler { - @Override - public void onPickup(ItemStack heldItem) { - heldItem.setItemDamage(0); - } - - @Override - public void onPlaceInfinite(ItemStack heldItem) { - heldItem.setItemDamage(-32000); - } - - @Override - public void replenishInfiniteStack(InventoryPlayer inv, int slotNo) { - inv.getStackInSlot(slotNo).setItemDamage(-32000); - } - - @Override - public boolean canHandleItem(ItemStack stack) { - return stack.getItem().isDamageable() && stack.getMaxStackSize() == 1; - } - - @Override - public boolean isItemInfinite(ItemStack stack) { - return stack.getItemDamage() < -30000; - } - - @Override - public ItemStack getInfiniteItem(ItemStack typeStack) { - return new ItemStack(typeStack.getItem(), 1, -32000); - } -} diff --git a/dependencies/main/java/codechicken/nei/ItemList.java b/dependencies/main/java/codechicken/nei/ItemList.java deleted file mode 100644 index 0624b2ae08..0000000000 --- a/dependencies/main/java/codechicken/nei/ItemList.java +++ /dev/null @@ -1,266 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.item.filtering.IItemFilter; -import codechicken.lib.item.filtering.IItemFilterProvider; -import codechicken.lib.thread.RestartableTask; -import codechicken.lib.thread.ThreadOperationTimer; -import codechicken.lib.thread.ThreadOperationTimer.TimeoutException; -import codechicken.nei.api.ItemInfo; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.util.LogHelper; -import codechicken.nei.util.NEIServerUtils; -import codechicken.nei.widget.ItemPanel; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ListMultimap; -import net.minecraft.client.renderer.block.model.IBakedModel; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.regex.Pattern; - -public class ItemList { - /** - * Fields are replaced atomically and contents never modified. - */ - public static volatile List items = new ArrayList(); - /** - * Fields are replaced atomically and contents never modified. - */ - public static volatile ListMultimap itemMap = ArrayListMultimap.create(); - /** - * Updates to this should be synchronised on this - */ - public static final List itemFilterers = new LinkedList(); - public static final List loadCallbacks = new LinkedList(); - - private static HashSet erroredItems = new HashSet(); - private static HashSet stackTraces = new HashSet(); - - public static class EverythingItemFilter implements IItemFilter { - @Override - public boolean matches(ItemStack item) { - return true; - } - } - - public static class NothingItemFilter implements IItemFilter { - @Override - public boolean matches(ItemStack item) { - return false; - } - } - - public static class PatternItemFilter implements IItemFilter { - public Pattern pattern; - - public PatternItemFilter(Pattern pattern) { - this.pattern = pattern; - } - - @Override - public boolean matches(ItemStack item) { - return pattern.matcher(ItemInfo.getSearchName(item)).find(); - } - } - - public static class AllMultiItemFilter implements IItemFilter { - public List filters = new LinkedList(); - - public AllMultiItemFilter(List filters) { - this.filters = filters; - } - - public AllMultiItemFilter() { - this(new LinkedList()); - } - - @Override - public boolean matches(ItemStack item) { - for (IItemFilter filter : filters) { - try { - if (!filter.matches(item)) { - return false; - } - } catch (Exception e) { - LogHelper.errorError("Exception filtering " + item + " with " + filter, e); - } - } - - return true; - } - } - - public static class AnyMultiItemFilter implements IItemFilter { - public List filters = new LinkedList(); - - public AnyMultiItemFilter(List filters) { - this.filters = filters; - } - - public AnyMultiItemFilter() { - this(new LinkedList()); - } - - @Override - public boolean matches(ItemStack item) { - for (IItemFilter filter : filters) { - try { - if (filter.matches(item)) { - return true; - } - } catch (Exception e) { - LogHelper.errorError("Exception filtering " + item + " with " + filter, e); - } - } - - return false; - } - } - - public interface ItemsLoadedCallback { - void itemsLoaded(); - } - - public static boolean itemMatchesAll(ItemStack item, List filters) { - for (IItemFilter filter : filters) { - try { - if (!filter.matches(item)) { - return false; - } - } catch (Exception e) { - LogHelper.errorError("Exception filtering " + item + " with " + filter, e); - } - } - - return true; - } - - /** - * @deprecated use getItemListFilter().matches(item) - */ - @Deprecated - public static boolean itemMatches(ItemStack item) { - return getItemListFilter().matches(item); - } - - public static IItemFilter getItemListFilter() { - return new AllMultiItemFilter(getItemFilters()); - } - - public static List getItemFilters() { - LinkedList filters = new LinkedList(); - synchronized (itemFilterers) { - for (IItemFilterProvider p : itemFilterers) { - filters.add(p.getFilter()); - } - } - return filters; - } - - public static final RestartableTask loadItems = new RestartableTask("NEI Item Loading") { - private void damageSearch(Item item, List permutations) { - HashSet damageIconSet = new HashSet(); - for (int damage = 0; damage < 16; damage++) { - try { - ItemStack stack = new ItemStack(item, 1, damage); - IBakedModel model = GuiContainerManager.getRenderItem().getItemModelMesher().getItemModel(stack); - String name = GuiContainerManager.concatenatedDisplayName(stack, false); - String s = name + "@" + (model == null ? 0 : model.hashCode()); - if (!damageIconSet.contains(s)) { - damageIconSet.add(s); - permutations.add(stack); - } - } catch (TimeoutException t) { - throw t; - } catch (Throwable t) { - NEIServerUtils.logOnce(t, stackTraces, "Ommiting " + item + ":" + damage + " " + item.getClass().getSimpleName(), item.toString()); - } - } - } - - @Override - public void execute() { - ThreadOperationTimer timer = getTimer(500); - - LinkedList items = new LinkedList(); - LinkedList permutations = new LinkedList(); - ListMultimap itemMap = ArrayListMultimap.create(); - - timer.setLimit(500); - for (Item item : Item.REGISTRY) { - if (interrupted()) { - return; - } - - if (item == null || erroredItems.contains(item)) { - continue; - } - - try { - timer.reset(item); - - permutations.clear(); - permutations.addAll(ItemInfo.itemOverrides.get(item)); - - if (permutations.isEmpty()) { - item.getSubItems(item, null, permutations); - } - - if (permutations.isEmpty()) { - damageSearch(item, permutations); - } - - permutations.addAll(ItemInfo.itemVariants.get(item)); - - timer.reset(); - items.addAll(permutations); - itemMap.putAll(item, permutations); - } catch (Throwable t) { - LogHelper.errorError("Removing item: %s from list.", t, item); - erroredItems.add(item); - } - } - - if (interrupted()) { - return; - } - ItemList.items = items; - ItemList.itemMap = itemMap; - for (ItemsLoadedCallback callback : loadCallbacks) { - callback.itemsLoaded(); - } - - updateFilter.restart(); - } - }; - - public static final RestartableTask updateFilter = new RestartableTask("NEI Item Filtering") { - @Override - public void execute() { - ArrayList filtered = new ArrayList(); - IItemFilter filter = getItemListFilter(); - for (ItemStack item : items) { - if (interrupted()) { - return; - } - - if (filter.matches(item)) { - filtered.add(item); - } - } - - if (interrupted()) { - return; - } - ItemSorter.sort(filtered); - if (interrupted()) { - return; - } - ItemPanel.updateItemList(filtered); - } - }; -} diff --git a/dependencies/main/java/codechicken/nei/ItemMobSpawner.java b/dependencies/main/java/codechicken/nei/ItemMobSpawner.java deleted file mode 100644 index b84b174929..0000000000 --- a/dependencies/main/java/codechicken/nei/ItemMobSpawner.java +++ /dev/null @@ -1,155 +0,0 @@ -package codechicken.nei; - - -import codechicken.nei.network.NEIClientPacketHandler; -import codechicken.nei.util.LogHelper; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.EntityPig; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntityMobSpawner; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.fml.common.registry.GameRegistry; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -public class ItemMobSpawner extends ItemBlock { - private static Map entityHashMap = new HashMap(); - private static Map IDtoNameMap = new HashMap(); - public static int idPig; - private static boolean loaded; - private static ItemMobSpawner instance; - - public static void register() { - //GameDataManipulator.replaceItemBlock(Blocks.MOB_SPAWNER, instance = new ItemMobSpawner()); - } - - public static void initRender() { - //SpawnerRenderer.load(instance); - } - - public ItemMobSpawner() { - super(Blocks.MOB_SPAWNER); - setHasSubtypes(true); - } - - /** - * Called from BlockMobSpawner on the client via asm generated onBlockPlacedBy - */ - public static void onBlockPlaced(World world, BlockPos pos, ItemStack stack) { - if (!NEIClientConfig.hasSMPCounterPart()) { - return; - } - - TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner) world.getTileEntity(pos); - if (tileentitymobspawner != null) { - setDefaultTag(stack); - String mobtype = IDtoNameMap.get(stack.getItemDamage()); - if (mobtype != null) { - NEIClientPacketHandler.sendMobSpawnerID(pos.getX(), pos.getY(), pos.getZ(), mobtype); - tileentitymobspawner.getSpawnerBaseLogic().setEntityName(mobtype); - } - } - } - - @Override - public void addInformation(ItemStack itemstack, EntityPlayer par2EntityPlayer, List list, boolean par4) { - setDefaultTag(itemstack); - int meta = itemstack.getItemDamage(); - if (meta == 0) { - meta = idPig; - } - Entity e = getEntity(meta); - list.add("\u00A7" + (e instanceof IMob ? "4" : "3") + IDtoNameMap.get(meta)); - } - - public static EntityLiving getEntity(int ID) { - EntityLiving e = entityHashMap.get(ID); - if (e == null) { - World world = Minecraft.getMinecraft().theWorld; - Class clazz = EntityList.ID_TO_CLASS.get(ID); - try { - e = (EntityLiving) clazz.getConstructor(World.class).newInstance(world); - } catch (Throwable t) { - if (clazz == null) { - LogHelper.error("Null class for entity (" + ID + ", " + IDtoNameMap.get(ID)); - } else { - LogHelper.errorError("Error creating instance of entity: " + clazz.getName(), t); - } - e = getEntity(idPig); - } - entityHashMap.put(ID, e); - } - return e; - } - - private static void setDefaultTag(ItemStack itemstack) { - if (!IDtoNameMap.containsKey(itemstack.getItemDamage())) { - itemstack.setItemDamage(idPig); - } - } - - public static void loadSpawners(World world) { - if (loaded) { - return; - } - loaded = true; - HashMap, String> classToStringMapping = (HashMap, String>) EntityList.CLASS_TO_NAME; - HashMap, Integer> classToIDMapping = (HashMap, Integer>) EntityList.CLASS_TO_ID; - for (Class entityClass : classToStringMapping.keySet()) { - if (!EntityLiving.class.isAssignableFrom(entityClass)) { - continue; - } - try { - EntityLiving entityliving = (EntityLiving) entityClass.getConstructor(new Class[] { World.class }).newInstance(world); - entityliving.isChild(); - - int id = classToIDMapping.get(entityClass); - String name = classToStringMapping.get(entityClass); - - if (name.equals("EnderDragon")) { - continue; - } - - IDtoNameMap.put(id, name); - - if (name.equals("Pig")) { - idPig = id; - } - } catch (Throwable ignored) { - } - } - - for (Iterator> it = IDtoNameMap.entrySet().iterator(); it.hasNext(); ) { - Entry e = it.next(); - if (getEntity(e.getKey()).getClass() == EntityPig.class && !e.getValue().equals("Pig")) { - it.remove(); - } - } - } - - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - if (!NEIClientConfig.hasSMPCounterPart()) { - list.add(new ItemStack(item)); - } else { - for (int i : IDtoNameMap.keySet()) { - list.add(new ItemStack(item, 1, i)); - } - } - } -} diff --git a/dependencies/main/java/codechicken/nei/ItemQuantityField.java b/dependencies/main/java/codechicken/nei/ItemQuantityField.java deleted file mode 100644 index 2dc8c11f0b..0000000000 --- a/dependencies/main/java/codechicken/nei/ItemQuantityField.java +++ /dev/null @@ -1,48 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.util.NEIClientUtils; - -public class ItemQuantityField extends TextField { - public ItemQuantityField(String ident) { - super(ident); - centered = true; - } - - @Override - public boolean isValid(String string) { - if (string.equals("")) { - return true; - } - - try { - return Integer.parseInt(string) >= 0; - } catch (NumberFormatException nfe) { - return false; - } - } - - public int intValue() { - return intValue(text()); - } - - public int intValue(String s) { - try { - return Integer.parseInt(s); - } catch (NumberFormatException nfe) { - return 0; - } - } - - @Override - public void loseFocus() { - setText(Integer.toString(NEIClientConfig.getItemQuantity())); - } - - @Override - public void onTextChange(String oldText) { - if (intValue(oldText) != intValue())//hacky recursion stopper - { - NEIClientUtils.setItemQuantity(intValue()); - } - } -} diff --git a/dependencies/main/java/codechicken/nei/ItemSorter.java b/dependencies/main/java/codechicken/nei/ItemSorter.java deleted file mode 100644 index bf6b29f217..0000000000 --- a/dependencies/main/java/codechicken/nei/ItemSorter.java +++ /dev/null @@ -1,203 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.config.ConfigTagParent; -import codechicken.nei.ItemList.ItemsLoadedCallback; -import codechicken.nei.api.API; -import codechicken.nei.api.ItemInfo; -import codechicken.nei.config.GuiItemSorter; -import codechicken.nei.config.OptionOpenGui; -import codechicken.nei.util.LogHelper; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.text.translation.I18n; - -import java.util.*; - -public class ItemSorter implements Comparator, ItemsLoadedCallback { - public static class SortEntry { - public String name; - public Comparator comparator; - - public SortEntry(String name, Comparator comparator) { - this.name = name; - this.comparator = comparator; - } - - public String getLocalisedName() { - return I18n.translateToLocal(name); - } - - public String getTooltip() { - String tipname = name + ".tip"; - String tip = I18n.translateToLocal(tipname); - return !tip.equals(tipname) ? tip : null; - } - } - - public static ArrayList entries = new ArrayList(); - public static ArrayList list = new ArrayList(); - public static final ItemSorter instance = new ItemSorter(); - - //optimisations - public HashMap ordering = null; - - public static void sort(ArrayList items) { - try { - Collections.sort(items, instance); - } catch (Exception e) { - LogHelper.errorError("Exception sorting item list", e); - } - } - - @Override - public int compare(ItemStack o1, ItemStack o2) { - for (SortEntry e : list) { - int c = e.comparator.compare(o1, o2); - if (c != 0) { - return c; - } - } - return 0; - } - - @Override - public void itemsLoaded() { - HashMap newMap = new HashMap(); - int i = 0; - for (ItemStack stack : ItemList.items) { - newMap.put(stack, i++); - } - ordering = newMap; - } - - public static SortEntry find(String name) { - for (SortEntry e : entries) { - if (e.name.equals(name)) { - return e; - } - } - - return null; - } - - public static int compareInt(int a, int b) { - return a == b ? 0 : a < b ? -1 : 1; - } - - public static void add(String name, Comparator comparator) { - SortEntry e = new SortEntry(name, comparator); - entries.add(e); - ArrayList nlist = new ArrayList(list); - nlist.add(e); - list = nlist;//concurrency - } - - public static void initConfig(ConfigTagParent tag) { - //minecraft, mod, id, default, meta, name - API.addSortOption("nei.itemsort.minecraft", new Comparator() { - @Override - public int compare(ItemStack o1, ItemStack o2) { - boolean m1 = "minecraft".equals(ItemInfo.itemOwners.get(o1.getItem())); - boolean m2 = "minecraft".equals(ItemInfo.itemOwners.get(o2.getItem())); - return m1 == m2 ? 0 : m1 ? -1 : 1; - } - }); - API.addSortOption("nei.itemsort.mod", new Comparator() { - @Override - public int compare(ItemStack o1, ItemStack o2) { - String mod1 = ItemInfo.itemOwners.get(o1.getItem()); - String mod2 = ItemInfo.itemOwners.get(o2.getItem()); - if (mod1 == null) { - return mod2 == null ? 0 : 1; - } - if (mod2 == null) { - return -1; - } - return mod1.compareTo(mod2); - } - }); - API.addSortOption("nei.itemsort.id", new Comparator() { - @Override - public int compare(ItemStack o1, ItemStack o2) { - int id1 = Item.getIdFromItem(o1.getItem()); - int id2 = Item.getIdFromItem(o2.getItem()); - return compareInt(id1, id2); - } - }); - API.addSortOption("nei.itemsort.default", new Comparator() { - @Override - public int compare(ItemStack o1, ItemStack o2) { - Integer order1 = instance.ordering.get(o1); - Integer order2 = instance.ordering.get(o2); - if (order1 == null) { - return order2 == null ? 0 : 1; - } - if (order2 == null) { - return -1; - } - return compareInt(order1, order2); - } - }); - API.addSortOption("nei.itemsort.damage", new Comparator() { - @Override - public int compare(ItemStack o1, ItemStack o2) { - int id1 = o1.getItemDamage(); - int id2 = o2.getItemDamage(); - return compareInt(id1, id2); - } - }); - API.addSortOption("nei.itemsort.name", new Comparator() { - @Override - public int compare(ItemStack o1, ItemStack o2) { - String name1 = ItemInfo.getSearchName(o1); - String name2 = ItemInfo.getSearchName(o2); - return name1.compareTo(name2); - } - }); - tag.getTag("inventory.itemsort").setDefaultValue(getSaveString(list)); - API.addOption(new OptionOpenGui("inventory.itemsort", GuiItemSorter.class) { - @Override - public void useGlobals() { - super.useGlobals(); - list = fromSaveString(activeTag().getValue()); - } - }); - ItemList.loadCallbacks.add(instance); - } - - public static String getSaveString(List list) { - StringBuilder sb = new StringBuilder(); - for (SortEntry e : list) { - if (sb.length() > 0) { - sb.append(','); - } - sb.append(e.name); - } - return sb.toString(); - } - - public static ArrayList fromSaveString(String s) { - if (s == null) { - return new ArrayList(entries); - } - - ArrayList list = new ArrayList(); - for (String s2 : s.split(",")) { - SortEntry e = find(s2.trim()); - if (e != null) { - list.add(e); - } - } - for (SortEntry e : entries) { - if (!list.contains(e)) { - list.add(e); - } - } - - return list; - } - - public static void loadConfig() { - list = fromSaveString(NEIClientConfig.getStringSetting("inventory.itemsort")); - } -} diff --git a/dependencies/main/java/codechicken/nei/ItemStackMap.java b/dependencies/main/java/codechicken/nei/ItemStackMap.java deleted file mode 100644 index 42c1067b31..0000000000 --- a/dependencies/main/java/codechicken/nei/ItemStackMap.java +++ /dev/null @@ -1,308 +0,0 @@ -package codechicken.nei; - -import com.google.common.base.Objects; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import static codechicken.lib.inventory.InventoryUtils.actualDamage; -import static codechicken.lib.inventory.InventoryUtils.newItemStack; -import static net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE; - -/** - * A maplike class for ItemStack keys with wildcard damage/NBT. Optimised for lookup - */ -public class ItemStackMap { - public static class StackMetaKey { - public int damage; - public NBTTagCompound tag; - - public StackMetaKey(int damage, NBTTagCompound tag) { - this.damage = damage; - this.tag = tag; - } - - public StackMetaKey(ItemStack key) { - this(actualDamage(key), key.getTagCompound()); - } - - public int hashCode() { - return Objects.hashCode(damage, tag); - } - - public boolean equals(Object o) { - if (!(o instanceof StackMetaKey)) { - return false; - } - StackMetaKey t = (StackMetaKey) o; - return damage == t.damage && Objects.equal(tag, t.tag); - } - } - - public static class Entry { - public ItemStack key; - public T value; - - public Entry(ItemStack key, T value) { - this.key = key; - this.value = value; - } - } - - public class DetailMap { - private boolean hasWildcard; - private T wildcard; - private HashMap damageMap; - private HashMap tagMap; - private HashMap metaMap; - private int size; - - public T get(ItemStack key) { - if (wildcard != null) { - return wildcard; - } - - if (damageMap != null) { - T ret = damageMap.get(actualDamage(key)); - if (ret != null) { - return ret; - } - } - if (tagMap != null) { - T ret = tagMap.get(key.getTagCompound()); - if (ret != null) { - return ret; - } - } - if (metaMap != null) { - return metaMap.get(new StackMetaKey(key)); - } - - return null; - } - - public T put(ItemStack key, T value) { - try { - switch (getKeyType(actualDamage(key), key.getTagCompound())) { - case 0: - if (metaMap == null) { - metaMap = new HashMap(); - } - return metaMap.put(new StackMetaKey(key), value); - case 1: - if (tagMap == null) { - tagMap = new HashMap(); - } - return tagMap.put(key.getTagCompound(), value); - case 2: - if (damageMap == null) { - damageMap = new HashMap(); - } - return damageMap.put(actualDamage(key), value); - case 3: - T ret = wildcard; - wildcard = value; - hasWildcard = true; - return ret; - } - } finally { - updateSize(); - } - return null; - } - - public T remove(ItemStack key) { - try { - switch (getKeyType(actualDamage(key), key.getTagCompound())) { - case 0: - return metaMap != null ? metaMap.remove(new StackMetaKey(key)) : null; - case 1: - return tagMap != null ? tagMap.remove(key.getTagCompound()) : null; - case 2: - return damageMap != null ? damageMap.remove(actualDamage(key)) : null; - case 3: - T ret = wildcard; - wildcard = null; - hasWildcard = false; - return ret; - } - } finally { - updateSize(); - } - return null; - } - - private void updateSize() { - int newSize = (hasWildcard ? 1 : 0) + - (metaMap != null ? metaMap.size() : 0) + - (tagMap != null ? tagMap.size() : 0) + - (damageMap != null ? damageMap.size() : 0); - - if (newSize != size) { - ItemStackMap.this.size += newSize - size; - size = newSize; - } - } - - public void addKeys(Item item, List list) { - if (wildcard != null) { - list.add(wildcard(item)); - } - if (damageMap != null) { - for (int damage : damageMap.keySet()) { - list.add(newItemStack(item, 1, damage, WILDCARD_TAG)); - } - } - if (tagMap != null) { - for (NBTTagCompound tag : tagMap.keySet()) { - list.add(newItemStack(item, 1, WILDCARD_VALUE, tag)); - } - } - if (metaMap != null) { - for (StackMetaKey key : metaMap.keySet()) { - list.add(newItemStack(item, 1, key.damage, key.tag)); - } - } - } - - public void addValues(List list) { - if (wildcard != null) { - list.add(wildcard); - } - if (damageMap != null) { - list.addAll(damageMap.values()); - } - if (tagMap != null) { - list.addAll(tagMap.values()); - } - if (metaMap != null) { - list.addAll(metaMap.values()); - } - } - - public void addEntries(Item item, List> list) { - if (wildcard != null) { - list.add(new Entry(newItemStack(item, 1, WILDCARD_VALUE, WILDCARD_TAG), wildcard)); - } - if (damageMap != null) { - for (Map.Entry entry : damageMap.entrySet()) { - list.add(new Entry(newItemStack(item, 1, entry.getKey(), WILDCARD_TAG), entry.getValue())); - } - } - if (tagMap != null) { - for (Map.Entry entry : tagMap.entrySet()) { - list.add(new Entry(newItemStack(item, 1, WILDCARD_VALUE, entry.getKey()), entry.getValue())); - } - } - if (metaMap != null) { - for (Map.Entry entry : metaMap.entrySet()) { - list.add(new Entry(newItemStack(item, 1, entry.getKey().damage, entry.getKey().tag), entry.getValue())); - } - } - } - } - - public static int getKeyType(int damage, NBTTagCompound tag) { - int i = 0; - if (isWildcard(damage)) { - i = 1; - } - if (isWildcard(tag)) { - i |= 2; - } - return i; - } - - public static ItemStack wildcard(Item item) { - return newItemStack(item, 1, WILDCARD_VALUE, WILDCARD_TAG); - } - - public static boolean isWildcard(int damage) { - return damage == WILDCARD_VALUE; - } - - public static boolean isWildcard(NBTTagCompound tag) { - return tag != null && tag.getBoolean("*"); - } - - public static NBTTagCompound WILDCARD_TAG; - - static { - WILDCARD_TAG = new NBTTagCompound(); - WILDCARD_TAG.setBoolean("*", true); - } - - private HashMap itemMap = new HashMap(); - private int size; - - public T get(ItemStack key) { - if (key == null || key.getItem() == null) { - return null; - } - - DetailMap map = itemMap.get(key.getItem()); - return map == null ? null : map.get(key); - } - - public void put(ItemStack key, T value) { - if (key == null || key.getItem() == null) { - return; - } - - DetailMap map = itemMap.get(key.getItem()); - if (map == null) { - itemMap.put(key.getItem(), map = new DetailMap()); - } - map.put(key, value); - } - - public void clear() { - itemMap.clear(); - } - - public T remove(ItemStack key) { - if (key == null || key.getItem() == null) { - return null; - } - - DetailMap map = itemMap.get(key.getItem()); - return map == null ? null : map.remove(key); - } - - public List keys() { - LinkedList list = new LinkedList(); - for (Map.Entry entry : itemMap.entrySet()) { - entry.getValue().addKeys(entry.getKey(), list); - } - return list; - } - - public List values() { - LinkedList list = new LinkedList(); - for (DetailMap map : itemMap.values()) { - map.addValues(list); - } - return list; - } - - public List> entries() { - LinkedList> list = new LinkedList>(); - for (Map.Entry entry : itemMap.entrySet()) { - entry.getValue().addEntries(entry.getKey(), list); - } - return list; - } - - public int size() { - return size; - } - - public boolean isEmpty() { - return size == 0; - } -} diff --git a/dependencies/main/java/codechicken/nei/ItemStackSet.java b/dependencies/main/java/codechicken/nei/ItemStackSet.java deleted file mode 100644 index 5d28e33cce..0000000000 --- a/dependencies/main/java/codechicken/nei/ItemStackSet.java +++ /dev/null @@ -1,58 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.item.filtering.IItemFilter; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class ItemStackSet extends ItemStackMap implements IItemFilter { - public ItemStackSet with(ItemStack... items) { - for (ItemStack item : items) { - add(item); - } - return this; - } - - public ItemStackSet with(Item... items) { - for (Item item : items) { - add(ItemStackMap.wildcard(item)); - } - return this; - } - - public ItemStackSet with(Block... blocks) { - for (Block block : blocks) { - add(ItemStackMap.wildcard(Item.getItemFromBlock(block))); - } - return this; - } - - public void add(ItemStack item) { - put(item, item); - } - - public boolean contains(ItemStack item) { - return get(item) != null; - } - - public boolean containsAll(Item item) { - return get(ItemStackMap.wildcard(item)) != null; - } - - @Override - public boolean matches(ItemStack item) { - return contains(item); - } - - public static ItemStackSet of(Block... blocks) { - return new ItemStackSet().with(blocks); - } - - public static ItemStackSet of(Item... items) { - return new ItemStackSet().with(items); - } - - public static ItemStackSet of(ItemStack... items) { - return new ItemStackSet().with(items); - } -} diff --git a/dependencies/main/java/codechicken/nei/KeyManager.java b/dependencies/main/java/codechicken/nei/KeyManager.java deleted file mode 100644 index e55e32ca89..0000000000 --- a/dependencies/main/java/codechicken/nei/KeyManager.java +++ /dev/null @@ -1,20 +0,0 @@ -package codechicken.nei; - -import java.util.LinkedList; - -/** - * Good old key ticker - */ -public class KeyManager { - public interface IKeyStateTracker { - void tickKeyStates(); - } - - public static LinkedList trackers = new LinkedList(); - - public static void tickKeyStates() { - for (IKeyStateTracker tracker : trackers) { - tracker.tickKeyStates(); - } - } -} diff --git a/dependencies/main/java/codechicken/nei/LayoutManager.java b/dependencies/main/java/codechicken/nei/LayoutManager.java deleted file mode 100644 index 50d50e1acd..0000000000 --- a/dependencies/main/java/codechicken/nei/LayoutManager.java +++ /dev/null @@ -1,877 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.KeyManager.IKeyStateTracker; -import codechicken.nei.api.*; -import codechicken.nei.api.layout.LayoutStyle; -import codechicken.nei.config.KeyBindings; -import codechicken.nei.guihook.*; -import codechicken.nei.layout.LayoutStyleMinecraft; -import codechicken.nei.layout.LayoutStyleTMIOld; -import codechicken.nei.network.NEIClientPacketHandler; -import codechicken.nei.widget.Button; -import codechicken.nei.widget.ItemPanel; -import codechicken.nei.widget.Label; -import codechicken.nei.widget.Widget; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.gui.inventory.GuiContainerCreative; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.InventoryEffectRenderer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import org.lwjgl.opengl.GL11; - -import java.util.HashMap; -import java.util.List; -import java.util.TreeSet; - -import static codechicken.lib.gui.GuiDraw.*; -import static codechicken.nei.NEIClientConfig.*; -import static codechicken.nei.util.NEIClientUtils.*; - -public class LayoutManager implements IContainerInputHandler, IContainerTooltipHandler, IContainerDrawHandler, IContainerObjectHandler, IKeyStateTracker { - private static LayoutManager instance; - - private static Widget inputFocused; - /** - * Sorted bottom first - */ - private static TreeSet drawWidgets; - /** - * Sorted top first - */ - private static TreeSet controlWidgets; - - private static boolean showItemPanel; - - public static ItemPanel itemPanel; - public static SubsetWidget dropDown; - public static TextField searchField; - - public static Button options; - - public static Button prev; - public static Button next; - public static Label pageLabel; - public static Button more; - public static Button less; - public static ItemQuantityField quantity; - - public static SaveLoadButton[] stateButtons; - public static Button[] deleteButtons; - - public static Button delete; - public static ButtonCycled gamemode; - public static Button rain; - public static Button magnet; - public static Button[] timeButtons = new Button[4]; - public static Button heal; - - public static IRecipeOverlayRenderer overlayRenderer; - - public static HashMap layoutStyles = new HashMap(); - - public static void load() { - API.addLayoutStyle(0, new LayoutStyleMinecraft()); - API.addLayoutStyle(1, new LayoutStyleTMIOld()); - - instance = new LayoutManager(); - KeyManager.trackers.add(instance); - GuiContainerManager.addInputHandler(instance); - GuiContainerManager.addTooltipHandler(instance); - GuiContainerManager.addDrawHandler(instance); - GuiContainerManager.addObjectHandler(instance); - init(); - } - - @Override - public void onPreDraw(GuiContainer gui) { - if (!isHidden() && isEnabled() && gui instanceof InventoryEffectRenderer)//Reset the gui to the center of the screen, for potion effect offsets etc - { - gui.guiLeft = (gui.width - gui.xSize) / 2; - gui.guiTop = (gui.height - gui.ySize) / 2; - - if (gui instanceof GuiContainerCreative && gui.buttonList.size() >= 2) { - GuiButton button1 = gui.buttonList.get(0); - GuiButton button2 = gui.buttonList.get(1); - button1.xPosition = gui.guiLeft; - button2.xPosition = gui.guiLeft + gui.xSize - 20; - } - } - } - - @Override - public void onMouseClicked(GuiContainer gui, int mousex, int mousey, int button) { - if (isHidden()) { - return; - } - - for (Widget widget : controlWidgets) { - widget.onGuiClick(mousex, mousey); - } - } - - @Override - public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) { - if (isHidden()) { - return false; - } - - if (!isEnabled()) { - return options.contains(mousex, mousey) && options.handleClick(mousex, mousey, button); - } - - for (Widget widget : controlWidgets) { - widget.onGuiClick(mousex, mousey); - if (widget.contains(mousex, mousey) ? widget.handleClick(mousex, mousey, button) : widget.handleClickExt(mousex, mousey, button)) { - return true; - } - } - - return false; - } - - @Override - public boolean objectUnderMouse(GuiContainer gui, int mousex, int mousey) { - if (!isHidden() && isEnabled()) { - for (Widget widget : controlWidgets) { - if (widget.contains(mousex, mousey)) { - return true; - } - } - } - - return false; - } - - public boolean keyTyped(GuiContainer gui, char keyChar, int keyID) { - if (isEnabled() && !isHidden()) { - if (inputFocused != null) { - return inputFocused.handleKeyPress(keyID, keyChar); - } - - for (Widget widget : controlWidgets) { - if (widget.handleKeyPress(keyID, keyChar)) { - return true; - } - } - } - - return false; - } - - @Override - public void onKeyTyped(GuiContainer gui, char keyChar, int keyID) { - } - - @Override - public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyID) { - if (KeyBindings.get("nei.options.keys.gui.hide").isActiveAndMatches(keyID)) { - toggleBooleanSetting("inventory.hidden"); - return true; - } - if (isEnabled() && !isHidden()) { - for (Widget widget : controlWidgets) { - if (inputFocused == null) { - widget.lastKeyTyped(keyID, keyChar); - } - } - } - return false; - } - - public void onMouseUp(GuiContainer gui, int mx, int my, int button) { - if (!isHidden() && isEnabled()) { - for (Widget widget : controlWidgets) { - widget.mouseUp(mx, my, button); - } - } - } - - @Override - public void onMouseDragged(GuiContainer gui, int mx, int my, int button, long heldTime) { - if (!isHidden() && isEnabled()) { - for (Widget widget : controlWidgets) { - widget.mouseDragged(mx, my, button, heldTime); - } - } - } - - @Override - public ItemStack getStackUnderMouse(GuiContainer gui, int mousex, int mousey) { - if (!isHidden() && isEnabled()) { - for (Widget widget : controlWidgets) { - ItemStack stack = widget.getStackMouseOver(mousex, mousey); - if (stack != null) { - return stack; - } - } - } - return null; - } - - public void renderObjects(GuiContainer gui, int mousex, int mousey) { - if (!isHidden()) { - layout(gui); - if (isEnabled()) { - getLayoutStyle().drawBackground(GuiContainerManager.getManager(gui)); - for (Widget widget : drawWidgets) { - widget.draw(mousex, mousey); - } - } else { - options.draw(mousex, mousey); - } - - GlStateManager.enableLighting(); - GlStateManager.disableDepth(); - } else { - showItemPanel = false; - } - } - - @Override - public void postRenderObjects(GuiContainer gui, int mousex, int mousey) { - if (!isHidden() && isEnabled()) { - for (Widget widget : drawWidgets) { - widget.postDraw(mousex, mousey); - } - } - } - - @Override - public List handleTooltip(GuiContainer gui, int mousex, int mousey, List currenttip) { - if (!isHidden() && isEnabled() && GuiContainerManager.shouldShowTooltip(gui)) { - for (Widget widget : controlWidgets) { - currenttip = widget.handleTooltip(mousex, mousey, currenttip); - } - } - return currenttip; - } - - @Override - public List handleItemDisplayName(GuiContainer gui, ItemStack stack, List currenttip) { - String overridename = ItemInfo.getNameOverride(stack); - if (overridename != null) { - currenttip.set(0, overridename); - } - - String mainname = currenttip.get(0); - if (showIDs()) { - mainname += " " + Item.getIdFromItem(stack.getItem()); - if (stack.getItemDamage() != 0) { - mainname += ":" + stack.getItemDamage(); - } - - currenttip.set(0, mainname); - } - - return currenttip; - } - - @Override - public List handleItemTooltip(GuiContainer gui, ItemStack itemstack, int mousex, int mousey, List currenttip) { - return currenttip; - } - - public static void layout(GuiContainer gui) { - VisibilityData visiblity = new VisibilityData(); - if (isHidden()) { - //showItemPanel = false; - visiblity.showNEI = false; - } - if (gui.height - gui.ySize <= 40) { - visiblity.showSearchSection = false; - } - if (gui.guiLeft - 4 < 76) { - visiblity.showWidgets = false; - } - - for (INEIGuiHandler handler : GuiInfo.guiHandlers) { - handler.modifyVisiblity(gui, visiblity); - } - - visiblity.translateDependancies(); - - getLayoutStyle().layout(gui, visiblity); - - updateWidgetVisiblities(gui, visiblity); - } - - private static void init() { - itemPanel = new ItemPanel(); - dropDown = new SubsetWidget(); - searchField = new SearchField("search"); - - options = new Button("Options") { - @Override - public boolean onButtonPress(boolean rightclick) { - if (!rightclick) { - getOptionList().openGui(getGuiContainer(), false); - return true; - } - return false; - } - - @Override - public String getRenderLabel() { - return translate("inventory.options"); - } - }; - prev = new Button("Prev") { - public boolean onButtonPress(boolean rightclick) { - if (!rightclick) { - LayoutManager.itemPanel.scroll(-1); - return true; - } - return false; - } - - @Override - public String getRenderLabel() { - return translate("inventory.prev"); - } - }; - next = new Button("Next") { - public boolean onButtonPress(boolean rightclick) { - if (!rightclick) { - LayoutManager.itemPanel.scroll(1); - return true; - } - return false; - } - - @Override - public String getRenderLabel() { - return translate("inventory.next"); - } - }; - pageLabel = new Label("(0/0)", true); - more = new Button("+") { - @Override - public boolean onButtonPress(boolean rightclick) { - if (rightclick) { - return false; - } - - int modifier = controlKey() ? 64 : shiftKey() ? 10 : 1; - - int quantity = getItemQuantity() + modifier; - if (quantity < 0) { - quantity = 0; - } - - setItemQuantity(quantity); - return true; - } - }; - less = new Button("-") { - @Override - public boolean onButtonPress(boolean rightclick) { - if (rightclick) { - return false; - } - - int modifier = controlKey() ? -64 : shiftKey() ? -10 : -1; - - int quantity = getItemQuantity() + modifier; - if (quantity < 0) { - quantity = 0; - } - - setItemQuantity(quantity); - return true; - } - }; - quantity = new ItemQuantityField("quantity"); - - stateButtons = new SaveLoadButton[7]; - deleteButtons = new Button[7]; - - for (int i = 0; i < 7; i++) { - final int savestate = i; - stateButtons[i] = new SaveLoadButton("") { - @Override - public boolean onButtonPress(boolean rightclick) { - if (isStateSaved(savestate)) { - loadState(savestate); - } else { - saveState(savestate); - } - return true; - } - - @Override - public void onTextChange() { - NBTTagCompound statelist = global.nbt.getCompoundTag("statename"); - global.nbt.setTag("statename", statelist); - - statelist.setString("" + savestate, label); - global.saveNBT(); - } - }; - deleteButtons[i] = new Button("x") { - @Override - public boolean onButtonPress(boolean rightclick) { - if (!rightclick) { - clearState(savestate); - return true; - } - return false; - } - }; - } - - delete = new Button() { - @Override - public boolean onButtonPress(boolean rightclick) { - if ((state & 0x3) == 2) { - return false; - } - - ItemStack held = getHeldItem(); - if (held != null) { - if (shiftKey()) { - deleteHeldItem(); - deleteItemsOfType(held); - } else if (rightclick) { - decreaseSlotStack(-999); - } else { - deleteHeldItem(); - } - } else if (shiftKey()) { - deleteEverything(); - } else { - NEIController.toggleDeleteMode(); - } - - return true; - } - - public String getButtonTip() { - if ((state & 0x3) != 2) { - if (shiftKey()) { - return translate("inventory.delete.inv"); - } - if (NEIController.canUseDeleteMode()) { - return getStateTip("delete", state); - } - } - return null; - } - - @Override - public void postDraw(int mousex, int mousey) { - if (contains(mousex, mousey) && getHeldItem() != null && (state & 0x3) != 2) { - GuiDraw.drawTip(mousex + 9, mousey, translate("inventory.delete." + (shiftKey() ? "all" : "one"), GuiContainerManager.itemDisplayNameShort(getHeldItem()))); - } - } - }; - gamemode = new ButtonCycled() { - @Override - public boolean onButtonPress(boolean rightclick) { - if (!rightclick) { - cycleGamemode(); - return true; - } - return false; - } - - public String getButtonTip() { - return translate("inventory.gamemode." + getNextGamemode()); - } - }; - gamemode.icons = new Image[3]; - rain = new Button() { - @Override - public boolean onButtonPress(boolean rightclick) { - if (handleDisabledButtonPress("rain", rightclick)) { - return true; - } - - if (!rightclick) { - toggleRaining(); - return true; - } - return false; - } - - public String getButtonTip() { - return getStateTip("rain", state); - } - }; - magnet = new Button() { - @Override - public boolean onButtonPress(boolean rightclick) { - if (!rightclick) { - toggleMagnetMode(); - return true; - } - return false; - } - - public String getButtonTip() { - return getStateTip("magnet", state); - } - }; - for (int i = 0; i < 4; i++) { - final int zone = i; - timeButtons[i] = new Button() { - @Override - public boolean onButtonPress(boolean rightclick) { - if (handleDisabledButtonPress(NEIActions.timeZones[zone], rightclick)) { - return true; - } - - if (!rightclick) { - setHourForward(zone * 6); - return true; - } - return false; - } - - @Override - public String getButtonTip() { - return getTimeTip(NEIActions.timeZones[zone], state); - } - - }; - } - heal = new Button() { - @Override - public boolean onButtonPress(boolean rightclick) { - if (!rightclick) { - healPlayer(); - return true; - } - return false; - } - - @Override - public String getButtonTip() { - return translate("inventory.heal"); - } - }; - - delete.state |= 0x4; - gamemode.state |= 0x4; - rain.state |= 0x4; - magnet.state |= 0x4; - } - - private static String getStateTip(String name, int state) { - String sfx = (state & 0x3) == 2 ? "enable" : (state & 0x3) == 1 ? "0" : "1"; - - return translate("inventory." + name + "." + sfx); - } - - private static String getTimeTip(String name, int state) { - String sfx = (state & 0x3) == 2 ? "enable" : "set"; - return translate("inventory." + name + "." + sfx); - } - - private static boolean handleDisabledButtonPress(String ident, boolean rightclick) { - if (!NEIActions.canDisable.contains(ident)) { - return false; - } - if (rightclick != disabledActions.contains(ident)) { - return setPropertyDisabled(ident, rightclick); - } - return false; - } - - private static boolean setPropertyDisabled(String ident, boolean disable) { - if (disable && NEIActions.base(ident).equals("time")) { - int count = 0; - for (int i = 0; i < 4; i++) { - if (disabledActions.contains(NEIActions.timeZones[i])) { - count++; - } - } - if (count == 3) { - return false; - } - } - if (hasSMPCounterPart()) { - NEIClientPacketHandler.sendSetPropertyDisabled(ident, disable); - } - - return true; - } - - @Override - public void load(GuiContainer gui) { - if (isEnabled()) { - setInputFocused(null); - - ItemList.loadItems.restart(); - overlayRenderer = null; - - getLayoutStyle().init(); - layout(gui); - } - - NEIController.load(gui); - - if (checkCreativeInv(gui) && gui.mc.currentScreen instanceof GuiContainerCreative)//override creative with creative+ - { - gui.mc.displayGuiScreen(null);//close the screen and wait for the server to open it for us - } - } - - @Override - public void refresh(GuiContainer gui) { - } - - public boolean checkCreativeInv(GuiContainer gui) { - if (gui instanceof GuiContainerCreative && invCreativeMode()) { - NEIClientPacketHandler.sendCreativeInv(true); - return true; - } else if (gui instanceof GuiExtendedCreativeInv && !invCreativeMode()) { - NEIClientPacketHandler.sendCreativeInv(false); - return true; - } - return false; - } - - public static void updateWidgetVisiblities(GuiContainer gui, VisibilityData visiblity) { - drawWidgets = new TreeSet(new WidgetZOrder(false)); - controlWidgets = new TreeSet(new WidgetZOrder(true)); - - if (!visiblity.showNEI) { - //showItemPanel = false; - return; - } - - addWidget(options); - showItemPanel = visiblity.showItemPanel; - if (visiblity.showItemPanel) { - addWidget(itemPanel); - addWidget(prev); - addWidget(next); - addWidget(pageLabel); - if (canPerformAction("item")) { - addWidget(more); - addWidget(less); - addWidget(quantity); - } - } - - if (visiblity.showSearchSection) { - addWidget(dropDown); - addWidget(searchField); - } - - if (canPerformAction("item") && hasSMPCounterPart() && visiblity.showStateButtons) { - for (int i = 0; i < 7; i++) { - addWidget(stateButtons[i]); - if (isStateSaved(i)) { - addWidget(deleteButtons[i]); - } - } - } - if (visiblity.showUtilityButtons) { - if (canPerformAction("time")) { - for (int i = 0; i < 4; i++) { - addWidget(timeButtons[i]); - } - } - if (canPerformAction("rain")) { - addWidget(rain); - } - if (canPerformAction("heal")) { - addWidget(heal); - } - if (canPerformAction("magnet")) { - addWidget(magnet); - } - if (isValidGamemode("creative") || - isValidGamemode("creative+") || - isValidGamemode("adventure")) { - addWidget(gamemode); - } - if (canPerformAction("delete")) { - addWidget(delete); - } - } - } - - public static LayoutStyle getLayoutStyle(int id) { - LayoutStyle style = layoutStyles.get(id); - if (style == null) { - style = layoutStyles.get(0); - } - return style; - } - - public static LayoutStyle getLayoutStyle() { - return getLayoutStyle(NEIClientConfig.getLayoutStyle()); - } - - private static void addWidget(Widget widget) { - drawWidgets.add(widget); - controlWidgets.add(widget); - } - - @Override - public void guiTick(GuiContainer gui) { - if (checkCreativeInv(gui)) { - return; - } - - if (!isEnabled()) { - return; - } - - for (Widget widget : controlWidgets) { - widget.update(); - } - } - - @Override - public boolean mouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) { - if (isHidden() || !isEnabled()) { - return false; - } - - for (Widget widget : controlWidgets) { - if (widget.onMouseWheel(scrolled, mousex, mousey)) { - return true; - } - } - - return false; - } - - @Override - public void onMouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) { - } - - @Override - public boolean shouldShowTooltip(GuiContainer gui) { - return itemPanel.draggedStack == null; - } - - public static Widget getInputFocused() { - return inputFocused; - } - - public static void setInputFocused(Widget widget) { - if (inputFocused != null) { - inputFocused.loseFocus(); - } - - inputFocused = widget; - if (inputFocused != null) { - inputFocused.gainFocus(); - } - } - - @Override - public void renderSlotUnderlay(GuiContainer gui, Slot slot) { - if (overlayRenderer != null) { - overlayRenderer.renderOverlay(GuiContainerManager.getManager(gui), slot); - } - } - - @Override - public void renderSlotOverlay(GuiContainer window, Slot slot) { - ItemStack item = slot.getStack(); - if (world.nbt.getBoolean("searchinventories") && (item == null ? !getSearchExpression().equals("") : !ItemList.getItemListFilter().matches(item))) { - GlStateManager.disableLighting(); - GlStateManager.translate(0, 0, 200); - drawRect(slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, 0x80000000); - GlStateManager.translate(0, 0, -200); - GlStateManager.enableLighting(); - } - } - - public static void drawIcon(int x, int y, Image image) { - changeTexture("nei:textures/nei_sprites.png"); - GlStateManager.color(1, 1, 1, 1); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - drawTexturedModalRect(x, y, image.x, image.y, image.width, image.height); - GlStateManager.disableBlend(); - } - - public static void drawButtonBackground(int x, int y, int w, int h, boolean edges, int type) { - int wtiles = 0; - int ew = w;//end width - if (w / 2 > 100) { - wtiles = (w - 200) / 50 + 1; - ew = 200; - } - - int w1 = ew / 2; - int h1 = h / 2; - int w2 = (ew + 1) / 2; - int h2 = (h + 1) / 2; - - int x2 = x + w - w2; - int y2 = y + h - h2; - - int ty = 46 + type * 20; - int te = (edges ? 0 : 1);//tex edges - - int ty1 = ty + te; - int tx1 = te; - int tx3 = 75; - //halfway the 1 is for odd number adjustment - int ty2 = ty + 20 - h2 - te; - int tx2 = 200 - w2 - te; - - changeTexture("textures/gui/widgets.png"); - drawTexturedModalRect(x, y, tx1, ty1, w1, h1);//top left - drawTexturedModalRect(x, y2, tx1, ty2, w1, h2);//bottom left - - for (int tile = 0; tile < wtiles; tile++) { - int tilex = x + w1 + 50 * tile; - drawTexturedModalRect(tilex, y, tx3, ty1, 50, h1);//top - drawTexturedModalRect(tilex, y2, tx3, ty2, 50, h2);//bottom - } - - drawTexturedModalRect(x2, y, tx2, ty1, w2, h1);//top right - drawTexturedModalRect(x2, y2, tx2, ty2, w2, h2);//bottom right - } - - public static LayoutManager instance() { - return instance; - } - - @Override - public void tickKeyStates() { - if (Minecraft.getMinecraft().currentScreen != null) { - return; - } - - if (KeyBindings.get("nei.options.keys.world.dawn").isPressed()) { - timeButtons[0].onButtonPress(false); - } - if (KeyBindings.get("nei.options.keys.world.noon").isPressed()) { - timeButtons[1].onButtonPress(false); - } - if (KeyBindings.get("nei.options.keys.world.dusk").isPressed()) { - timeButtons[2].onButtonPress(false); - } - if (KeyBindings.get("nei.options.keys.world.midnight").isPressed()) { - timeButtons[3].onButtonPress(false); - } - if (KeyBindings.get("nei.options.keys.world.rain").isPressed()) { - rain.onButtonPress(false); - } - if (KeyBindings.get("nei.options.keys.world.heal").isPressed()) { - heal.onButtonPress(false); - } - if (KeyBindings.get("nei.options.keys.world.creative").isPressed()) { - gamemode.onButtonPress(false); - } - } - - public static boolean isItemPanelActive() { - return showItemPanel; - } -} diff --git a/dependencies/main/java/codechicken/nei/NEIActions.java b/dependencies/main/java/codechicken/nei/NEIActions.java deleted file mode 100644 index 296027cc71..0000000000 --- a/dependencies/main/java/codechicken/nei/NEIActions.java +++ /dev/null @@ -1,86 +0,0 @@ -package codechicken.nei; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; - -public class NEIActions { - public static final int protocol = 0; - - public static HashMap nameActionMap = new HashMap(); - public static HashSet canDisable = new HashSet(); - - public static void addAction(String name, String base, boolean smpreq) { - NEIActions action = new NEIActions(name, base, smpreq); - nameActionMap.put(name, action); - } - - private static void addAction(String name, String base) { - addAction(name, base, false); - } - - public static void addAction(String name) { - addAction(name, name); - } - - private static void addAction(String name, boolean smpreq) { - addAction(name, name, smpreq); - } - - public static String base(String name) { - NEIActions action = nameActionMap.get(name); - return action == null ? name : action.base; - } - - public static boolean smpRequired(String name) { - return nameActionMap.get(name).smpreq; - } - - public static void init() { - addAction("time"); - addAction("dawn", "time"); - addAction("noon", "time"); - addAction("dusk", "time"); - addAction("midnight", "time"); - addAction("creative"); - addAction("creative+", true); - addAction("adventure", "creative"); - addAction("rain"); - addAction("item"); - addAction("heal"); - addAction("delete", true); - addAction("magnet", true); - addAction("enchant", true); - addAction("potion", true); - - canDisable.add("dawn"); - canDisable.add("noon"); - canDisable.add("dusk"); - canDisable.add("midnight"); - canDisable.add("rain"); - } - - public static final String[] timeZones = new String[] { "dawn", "noon", "dusk", "midnight" }; - public static final String[] gameModes = new String[] { "survival", "creative", "creative+", "adventure" }; - - public String name; - public String base; - public boolean smpreq; - - public NEIActions(String name, String base, boolean smpreq) { - this.name = name; - this.base = base; - this.smpreq = smpreq; - } - - public static List baseActions() { - List list = new LinkedList(); - for (NEIActions a : nameActionMap.values()) { - if (a.base.equals(a.name)) { - list.add(a.name); - } - } - return list; - } -} diff --git a/dependencies/main/java/codechicken/nei/NEIChestGuiHandler.java b/dependencies/main/java/codechicken/nei/NEIChestGuiHandler.java deleted file mode 100644 index 11429062f5..0000000000 --- a/dependencies/main/java/codechicken/nei/NEIChestGuiHandler.java +++ /dev/null @@ -1,29 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.api.INEIGuiAdapter; -import codechicken.nei.api.TaggedInventoryArea; -import codechicken.nei.util.NEIServerUtils; -import net.minecraft.client.gui.inventory.GuiChest; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.ContainerChest; -import net.minecraft.item.ItemStack; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -public class NEIChestGuiHandler extends INEIGuiAdapter { - public int chestSize(GuiContainer gui) { - return ((ContainerChest) gui.inventorySlots).getLowerChestInventory().getSizeInventory(); - } - - @Override - public Iterable getItemSpawnSlots(GuiContainer gui, ItemStack item) { - return gui instanceof GuiChest ? NEIServerUtils.getRange(0, chestSize(gui)) : Collections.emptyList(); - } - - @Override - public List getInventoryAreas(GuiContainer gui) { - return gui instanceof GuiChest ? Arrays.asList(new TaggedInventoryArea("Chest", 0, chestSize(gui), gui.inventorySlots)) : null; - } -} diff --git a/dependencies/main/java/codechicken/nei/NEIClientConfig.java b/dependencies/main/java/codechicken/nei/NEIClientConfig.java deleted file mode 100644 index 7ea85d65a4..0000000000 --- a/dependencies/main/java/codechicken/nei/NEIClientConfig.java +++ /dev/null @@ -1,578 +0,0 @@ -package codechicken.nei; - -import codechicken.core.*; -import codechicken.lib.asm.discovery.ClassDiscoverer; -import codechicken.lib.asm.discovery.IStringMatcher; -import codechicken.lib.config.ConfigFile; -import codechicken.lib.config.ConfigTag; -import codechicken.lib.config.ConfigTagParent; -import codechicken.lib.util.ClientUtils; -import codechicken.lib.util.CommonUtils; -import codechicken.nei.api.*; -import codechicken.nei.api.layout.LayoutStyle; -import codechicken.nei.config.*; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.util.LogHelper; -import codechicken.nei.util.NEIClientUtils; -import codechicken.obfuscator.ObfuscationRun; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.world.World; -import net.minecraft.world.storage.WorldSummary; - -import java.io.File; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map.Entry; - -public class NEIClientConfig { - private static boolean configLoaded; - private static boolean enabledOverride; - - //public static Logger logger = LogManager.getLogger("NotEnoughItems"); - public static File configDir = new File(CommonUtils.getMinecraftDir(), "config/NEI/"); - public static ConfigSet global = new ConfigSet(new File("saves/NEI/client.dat"), new ConfigFile(new File(configDir, "client.cfg"))); - public static ConfigSet world; - - public static ItemStack creativeInv[]; - private static boolean statesSaved[] = new boolean[7]; - - public static boolean hasSMPCounterpart; - public static HashSet permissableActions = new HashSet(); - public static HashSet disabledActions = new HashSet(); - public static HashSet enabledActions = new HashSet(); - - public static ItemStackSet bannedBlocks = new ItemStackSet(); - - static { - if (global.config.getTag("checkUpdates").getBooleanValue(true)) { - CCUpdateChecker.updateCheck("NotEnoughItems"); - } - linkOptionList(); - setDefaults(); - } - - private static void setDefaults() { - ConfigTagParent tag = global.config; - tag.setComment("Main configuration of NEI.\nMost of these options can be changed ingame.\nDeleting any element will restore it to it's default value"); - - tag.getTag("command").useBraces().setComment("Change these options if you have a different mod installed on the server that handles the commands differently, Eg. Bukkit Essentials"); - tag.setNewLineMode(1); - - tag.getTag("inventory.widgetsenabled").getBooleanValue(true); - API.addOption(new OptionToggleButton("inventory.widgetsenabled")); - - tag.getTag("inventory.hidden").getBooleanValue(false); - tag.getTag("inventory.cheatmode").getIntValue(2); - tag.getTag("inventory.lockmode").setComment("For those who can't help themselves.\nSet this to a mode and you will be unable to change it ingame").getIntValue(-1); - API.addOption(new OptionCycled("inventory.cheatmode", 3) { - @Override - public boolean optionValid(int index) { - return getLockedMode() == -1 || getLockedMode() == index && NEIInfo.isValidMode(index); - } - }); - checkCheatMode(); - - tag.getTag("inventory.utilities").setDefaultValue("delete, magnet"); - API.addOption(new OptionUtilities("inventory.utilities")); - - tag.getTag("inventory.gamemodes").setDefaultValue("creative, creative+, adventure"); - API.addOption(new OptionGamemodes("inventory.gamemodes")); - - tag.getTag("inventory.layoutstyle").getIntValue(0); - API.addOption(new OptionCycled("inventory.layoutstyle", 0) { - @Override - public String getPrefix() { - return translateN(name); - } - - @Override - public String getButtonText() { - return NEIClientUtils.translate("layoutstyle." + LayoutManager.getLayoutStyle(renderTag().getIntValue()).getName()); - } - - @Override - public boolean cycle() { - LinkedList list = new LinkedList(); - for (Entry entry : LayoutManager.layoutStyles.entrySet()) { - list.add(entry.getKey()); - } - - Collections.sort(list); - - int nextLayout = renderTag().getIntValue(); - if (nextLayout == list.getLast())//loop list - { - nextLayout = -1; - } - for (Integer i : list) { - if (i > nextLayout) { - nextLayout = i; - break; - } - } - - getTag().setIntValue(nextLayout); - return true; - } - }); - - ItemSorter.initConfig(tag); - - tag.getTag("inventory.itemIDs").getIntValue(1); - API.addOption(new OptionCycled("inventory.itemIDs", 3, true)); - - tag.getTag("inventory.searchmode").getIntValue(1); - API.addOption(new OptionCycled("inventory.searchmode", 3, true)); - - //tag.getTag("world.highlight_tips").getBooleanValue(false); - //tag.getTag("world.highlight_tips.x").getIntValue(5000); - //tag.getTag("world.highlight_tips.y").getIntValue(100); - //API.addOption(new OptionOpenGui("world.highlight_tips", GuiHighlightTips.class)); - - tag.getTag("inventory.profileRecipes").getBooleanValue(false); - API.addOption(new OptionToggleButton("inventory.profileRecipes", true)); - - tag.getTag("command.creative").setDefaultValue("/gamemode {0} {1}"); - API.addOption(new OptionTextField("command.creative")); - tag.getTag("command.item").setDefaultValue("/give {0} {1} {2} {3} {4}"); - API.addOption(new OptionTextField("command.item")); - tag.getTag("command.time").setDefaultValue("/time set {0}"); - API.addOption(new OptionTextField("command.time")); - tag.getTag("command.rain").setDefaultValue("/toggledownfall"); - API.addOption(new OptionTextField("command.rain")); - tag.getTag("command.heal").setDefaultValue(""); - API.addOption(new OptionTextField("command.heal")); - -// JEIIntegrationManager.initConfig(tag); -// -// API.addOption(new ItemBrowserButton("jei.itemPanel") { -// @Override -// protected void setValue(EnumItemBrowser itemBrowser) { -// JEIIntegrationManager.setItemPanelOwner(itemBrowser); -// } -// }); -// -// API.addOption(new ItemBrowserButton("jei.searchBox") { -// @Override -// public boolean isEnabled() { -// return JEIIntegrationManager.itemPannelOwner == EnumItemBrowser.JEI; -// } -// -// @Override -// protected void setValue(EnumItemBrowser itemBrowser) { -// JEIIntegrationManager.setSearchBoxOwner(itemBrowser); -// } -// }); - } - - private static void linkOptionList() { - OptionList.setOptionList(new OptionList("nei.options") { - @Override - public ConfigSet globalConfigSet() { - return global; - } - - @Override - public ConfigSet worldConfigSet() { - return world; - } - - @Override - public OptionList configBase() { - return this; - } - - @Override - public GuiOptionList getGui(GuiScreen parent, OptionList list, boolean world) { - return new GuiNEIOptionList(parent, list, world); - } - }); - } - - public static OptionList getOptionList() { - return OptionList.getOptionList("nei.options"); - } - - public static void loadWorld(String saveName) { - setInternalEnabled(true); - LogHelper.debug("Loading " + (Minecraft.getMinecraft().isSingleplayer() ? "Local" : "Remote") + " World"); - bootNEI(ClientUtils.getWorld()); - - File saveDir = new File(CommonUtils.getMinecraftDir(), "saves/NEI/" + saveName); - boolean newWorld = !saveDir.exists(); - if (newWorld) { - saveDir.mkdirs(); - } - - world = new ConfigSet(new File(saveDir, "NEI.dat"), new ConfigFile(new File(saveDir, "NEI.cfg"))); - onWorldLoad(newWorld); - } - - private static void onWorldLoad(boolean newWorld) { - world.config.setComment("World based configuration of NEI.\nMost of these options can be changed ingame.\nDeleting any element will restore it to it's default value"); - - setWorldDefaults(); - creativeInv = new ItemStack[54]; - LayoutManager.searchField.setText(getSearchExpression()); - LayoutManager.quantity.setText(Integer.toString(getItemQuantity())); - SubsetWidget.loadHidden(); - - if (newWorld && Minecraft.getMinecraft().isSingleplayer()) { - world.config.getTag("inventory.cheatmode").setIntValue(Minecraft.getMinecraft().playerController.isInCreativeMode() ? 2 : 0); - } - - NEIInfo.load(ClientUtils.getWorld()); - } - - private static void setWorldDefaults() { - NBTTagCompound nbt = world.nbt; - if (!nbt.hasKey("search")) { - nbt.setString("search", ""); - } - if (!nbt.hasKey("quantity")) { - nbt.setInteger("quantity", 0); - } - if (!nbt.hasKey("validateenchantments")) { - nbt.setBoolean("validateenchantments", false); - } - - world.saveNBT(); - } - - public static void bootNEI(World world) { - if (configLoaded) { - return; - } - - loadStates(); - //ItemVisibilityHash.loadStates(); - //vishash = new ItemVisibilityHash(); - ItemInfo.load(world); - GuiInfo.load(); - RecipeInfo.load(); - LayoutManager.load(); - NEIController.load(); - - configLoaded = true; - - ClassDiscoverer classDiscoverer = new ClassDiscoverer(new IStringMatcher() { - public boolean matches(String test) { - return test.startsWith("NEI") && test.endsWith("Config.class"); - } - }, IConfigureNEI.class); - - classDiscoverer.findClasses(); - - for (Class clazz : classDiscoverer.classes) { - try { - IConfigureNEI config = (IConfigureNEI) clazz.newInstance(); - config.loadConfig(); - NEIModContainer.plugins.add(config); - LogHelper.debug("Loaded " + clazz.getName()); - } catch (Exception e) { - LogHelper.errorError("Failed to Load " + clazz.getName(), e); - } - } - - ItemSorter.loadConfig(); - } - - public static void loadStates() { - for (int state = 0; state < 7; state++) { - statesSaved[state] = !global.nbt.getCompoundTag("save" + state).hasNoTags(); - } - } - - public static boolean isWorldSpecific(String setting) { - if (world == null) { - return false; - } - ConfigTag tag = world.config.getTag(setting, false); - return tag != null && tag.value != null; - } - - public static boolean isStateSaved(int i) { - return statesSaved[i]; - } - - public static ConfigTag getSetting(String s) { - return isWorldSpecific(s) ? world.config.getTag(s) : global.config.getTag(s); - } - - public static boolean getBooleanSetting(String s) { - return getSetting(s).getBooleanValue(); - } - - public static boolean isHidden() { - return !enabledOverride || getBooleanSetting("inventory.hidden"); - } - - public static boolean isEnabled() { - return enabledOverride && getBooleanSetting("inventory.widgetsenabled"); - } - - public static void setEnabled(boolean flag) { - getSetting("inventory.widgetsenabled").setBooleanValue(flag); - } - - public static int getItemQuantity() { - return world.nbt.getInteger("quantity"); - } - - public static int getCheatMode() { - return getIntSetting("inventory.cheatmode"); - } - - private static void checkCheatMode() { - if (getLockedMode() != -1) { - setIntSetting("inventory.cheatmode", getLockedMode()); - } - } - - public static int getLockedMode() { - return getIntSetting("inventory.lockmode"); - } - - public static int getLayoutStyle() { - return getIntSetting("inventory.layoutstyle"); - } - - public static String getStringSetting(String s) { - return getSetting(s).getValue(); - } - - public static boolean showIDs() { - int i = getIntSetting("inventory.itemIDs"); - return i == 2 || (i == 1 && isEnabled() && !isHidden()); - } - - public static void toggleBooleanSetting(String setting) { - ConfigTag tag = getSetting(setting); - tag.setBooleanValue(!tag.getBooleanValue()); - } - - public static void cycleSetting(String setting, int max) { - ConfigTag tag = getSetting(setting); - tag.setIntValue((tag.getIntValue() + 1) % max); - } - - public static int getIntSetting(String setting) { - return getSetting(setting).getIntValue(); - } - - public static void setIntSetting(String setting, int val) { - getSetting(setting).setIntValue(val); - } - - public static String getSearchExpression() { - return world.nbt.getString("search"); - } - - public static void setSearchExpression(String expression) { -// JEIIntegrationManager.setFilterText(expression); - world.nbt.setString("search", expression); - world.saveNBT(); - } - - /** - * A split off of setSearchExpression that avoids a JEI update. - * - * @param expression Search term. - */ - public static void setSearchExpression(String expression, boolean updateJEI) { - if (updateJEI) { - setSearchExpression(expression); - } else { - world.nbt.setString("search", expression); - world.saveNBT(); - } - } - - public static boolean getMagnetMode() { - return enabledActions.contains("magnet"); - } - - public static boolean invCreativeMode() { - return enabledActions.contains("creative+") && canPerformAction("creative+"); - } - - public static boolean areDamageVariantsShown() { - return hasSMPCounterPart() || getSetting("command.item").getValue().contains("{3}"); - } - - public static void clearState(int state) { - statesSaved[state] = false; - global.nbt.setTag("save" + state, new NBTTagCompound()); - global.saveNBT(); - } - - public static void loadState(int state) { - if (!statesSaved[state]) { - return; - } - - NBTTagCompound statesave = global.nbt.getCompoundTag("save" + state); - GuiContainer currentContainer = NEIClientUtils.getGuiContainer(); - LinkedList saveAreas = new LinkedList(); - saveAreas.add(new TaggedInventoryArea(Minecraft.getMinecraft().thePlayer.inventory)); - - for (INEIGuiHandler handler : GuiInfo.guiHandlers) { - List areaList = handler.getInventoryAreas(currentContainer); - if (areaList != null) { - saveAreas.addAll(areaList); - } - } - - for (TaggedInventoryArea area : saveAreas) { - if (!statesave.hasKey(area.tagName)) { - continue; - } - - for (int slot : area.slots) { - NEIClientUtils.setSlotContents(slot, null, area.isContainer()); - } - - NBTTagList areaTag = statesave.getTagList(area.tagName, 10); - for (int i = 0; i < areaTag.tagCount(); i++) { - NBTTagCompound stacksave = areaTag.getCompoundTagAt(i); - int slot = stacksave.getByte("Slot") & 0xFF; - if (!area.slots.contains(slot)) { - continue; - } - - NEIClientUtils.setSlotContents(slot, ItemStack.loadItemStackFromNBT(stacksave), area.isContainer()); - } - } - } - - public static void saveState(int state) { - NBTTagCompound statesave = global.nbt.getCompoundTag("save" + state); - GuiContainer currentContainer = NEIClientUtils.getGuiContainer(); - LinkedList saveAreas = new LinkedList(); - saveAreas.add(new TaggedInventoryArea(Minecraft.getMinecraft().thePlayer.inventory)); - - for (INEIGuiHandler handler : GuiInfo.guiHandlers) { - List areaList = handler.getInventoryAreas(currentContainer); - if (areaList != null) { - saveAreas.addAll(areaList); - } - } - - for (TaggedInventoryArea area : saveAreas) { - NBTTagList areaTag = new NBTTagList(); - - for (int i : area.slots) { - ItemStack stack = area.getStackInSlot(i); - if (stack == null) { - continue; - } - NBTTagCompound stacksave = new NBTTagCompound(); - stacksave.setByte("Slot", (byte) i); - stack.writeToNBT(stacksave); - areaTag.appendTag(stacksave); - } - statesave.setTag(area.tagName, areaTag); - } - - global.nbt.setTag("save" + state, statesave); - global.saveNBT(); - statesSaved[state] = true; - } - - public static boolean hasSMPCounterPart() { - return hasSMPCounterpart; - } - - public static void setHasSMPCounterPart(boolean flag) { - hasSMPCounterpart = flag; - permissableActions.clear(); - bannedBlocks.clear(); - disabledActions.clear(); - enabledActions.clear(); - } - - public static boolean canCheatItem(ItemStack stack) { - return canPerformAction("item") && !bannedBlocks.contains(stack); - } - - public static boolean canPerformAction(String name) { - if (!isEnabled()) { - return false; - } - - if (!modePermitsAction(name)) { - return false; - } - - String base = NEIActions.base(name); - if (hasSMPCounterpart) { - return permissableActions.contains(base); - } - - if (NEIActions.smpRequired(name)) { - return false; - } - - String cmd = getStringSetting("command." + base); - return !(cmd == null || !cmd.startsWith("/")); - - } - - private static boolean modePermitsAction(String name) { - if (getCheatMode() == 0) { - return false; - } - if (getCheatMode() == 2) { - return true; - } - - String[] actions = getStringArrSetting("inventory.utilities"); - for (String action : actions) { - if (action.equalsIgnoreCase(name)) { - return true; - } - } - - return false; - } - - public static String[] getStringArrSetting(String s) { - return getStringSetting(s).replace(" ", "").split(","); - } - - public static void setInternalEnabled(boolean b) { - enabledOverride = b; - } - - public static void reloadSaves() { - File saveDir = new File(CommonUtils.getMinecraftDir(), "saves/NEI/local"); - if (!saveDir.exists()) { - return; - } - - List saves; - try { - saves = Minecraft.getMinecraft().getSaveLoader().getSaveList(); - } catch (Exception e) { - LogHelper.errorError("Error loading saves", e); - return; - } - HashSet saveFileNames = new HashSet(); - for (WorldSummary save : saves) { - saveFileNames.add(save.getFileName()); - } - - for (File file : saveDir.listFiles()) { - if (file.isDirectory() && !saveFileNames.contains(file.getName())) { - ObfuscationRun.deleteDir(file, true); - } - } - } -} diff --git a/dependencies/main/java/codechicken/nei/NEICompatibility.java b/dependencies/main/java/codechicken/nei/NEICompatibility.java deleted file mode 100644 index 9b1c59b87e..0000000000 --- a/dependencies/main/java/codechicken/nei/NEICompatibility.java +++ /dev/null @@ -1,4 +0,0 @@ -package codechicken.nei; - -public class NEICompatibility { -} diff --git a/dependencies/main/java/codechicken/nei/NEIController.java b/dependencies/main/java/codechicken/nei/NEIController.java deleted file mode 100644 index 02d3d26269..0000000000 --- a/dependencies/main/java/codechicken/nei/NEIController.java +++ /dev/null @@ -1,305 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.api.*; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerSlotClickHandler; -import codechicken.nei.network.NEIClientPacketHandler; -import codechicken.nei.util.NEIClientUtils; -import codechicken.nei.util.NEIServerUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.gui.inventory.GuiContainerCreative; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ClickType; -import net.minecraft.inventory.Slot; -import net.minecraft.inventory.SlotCrafting; -import net.minecraft.item.ItemStack; - -import java.awt.*; -import java.util.LinkedList; - -import static codechicken.lib.gui.GuiDraw.getMousePosition; - -public class NEIController implements IContainerSlotClickHandler, IContainerInputHandler { - private static NEIController instance = new NEIController(); - - public static GuiContainerManager manager; - public static FastTransferManager fastTransferManager; - - private static boolean deleteMode; - private static int pickedUpFromSlot; - private static IInfiniteItemHandler heldStackInfinite; - - private static int selectedItem; - private ItemStack firstheld; - - public static void load() { - GuiContainerManager.addSlotClickHandler(instance); - GuiContainerManager.addInputHandler(instance); - } - - public static void load(GuiContainer gui) { - manager = GuiContainerManager.getManager(gui); - deleteMode = false; - GuiInfo.clearGuiHandlers(); - fastTransferManager = null; - if (!NEIClientConfig.isEnabled()) { - return; - } - - fastTransferManager = new FastTransferManager(); - if (gui instanceof INEIGuiHandler) { - API.registerNEIGuiHandler((INEIGuiHandler) gui); - } - } - - public static boolean isSpreading(GuiContainer gui) { - return gui.dragSplitting && gui.dragSplittingSlots.size() > 1; - } - - public static void updateUnlimitedItems(InventoryPlayer inventory) { - if (!NEIClientConfig.canPerformAction("item") || !NEIClientConfig.hasSMPCounterPart()) { - return; - } - - LinkedList beforeStacks = new LinkedList(); - for (int i = 0; i < inventory.getSizeInventory(); i++) { - beforeStacks.add(NEIServerUtils.copyStack(inventory.getStackInSlot(i))); - } - - for (int i = 0; i < inventory.getSizeInventory(); i++) { - ItemStack stack = inventory.getStackInSlot(i); - if (stack == null) { - continue; - } - - for (IInfiniteItemHandler handler : ItemInfo.infiniteHandlers) { - if (handler.canHandleItem(stack) && handler.isItemInfinite(stack)) { - handler.replenishInfiniteStack(inventory, i); - } - } - } - - for (int i = 0; i < inventory.getSizeInventory(); i++) { - ItemStack newstack = inventory.getStackInSlot(i); - - if (!NEIServerUtils.areStacksIdentical(beforeStacks.get(i), newstack)) { - inventory.setInventorySlotContents(i, beforeStacks.get(i));//restore in case of SMP fail - NEIClientUtils.setSlotContents(i, newstack, false);//sends via SMP handler ;) - } - } - } - - public static void processCreativeCycling(InventoryPlayer inventory) { - if (NEIClientConfig.invCreativeMode() && NEIClientUtils.controlKey()) { - if (selectedItem != inventory.currentItem) { - if (inventory.currentItem == selectedItem + 1 || (inventory.currentItem == 0 && selectedItem == 8))//foward - { - NEIClientPacketHandler.sendCreativeScroll(1); - inventory.currentItem = selectedItem; - } else if (inventory.currentItem == selectedItem - 1 || (inventory.currentItem == 8 && selectedItem == 0)) { - NEIClientPacketHandler.sendCreativeScroll(-1); - inventory.currentItem = selectedItem; - } - } - } - - selectedItem = inventory.currentItem; - } - - @Override - public void beforeSlotClick(GuiContainer gui, int slotIndex, int button, Slot slot, ClickType clickType) { - if (!NEIClientConfig.isEnabled()) { - return; - } - - firstheld = NEIClientUtils.getHeldItem(); - } - - @Override - public boolean handleSlotClick(GuiContainer gui, int slotIndex, int button, Slot slot, ClickType clickType, boolean eventConsumed) { - if (eventConsumed || - !NEIClientConfig.isEnabled() || - isSpreading(gui)) { - return eventConsumed; - } - - if (deleteMode && slotIndex >= 0 && slot != null) { - if (NEIClientUtils.shiftKey() && button == 0) { - ItemStack itemstack1 = slot.getStack(); - if (itemstack1 != null) { - NEIClientUtils.deleteItemsOfType(itemstack1); - } - - } else if (button == 1) { - NEIClientUtils.decreaseSlotStack(slot.slotNumber); - } else { - NEIClientUtils.deleteSlotStack(slot.slotNumber); - } - return true; - } - - if (button == 1 && slot instanceof SlotCrafting)//right click - { - for (int i1 = 0; i1 < 64; i1++)//click this slot 64 times - { - manager.handleSlotClick(slot.slotNumber, button, ClickType.PICKUP); - } - return true; - } - - if (NEIClientUtils.controlKey() && slot != null && slot.getStack() != null && slot.isItemValid(slot.getStack())) { - NEIClientUtils.cheatItem(slot.getStack(), button, 1); - return true; - } - - if (GuiInfo.hasCustomSlots(gui)) { - return false; - } - - if (slotIndex >= 0 && NEIClientUtils.shiftKey() && NEIClientUtils.getHeldItem() != null && !slot.getHasStack()) { - ItemStack held = NEIClientUtils.getHeldItem(); - manager.handleSlotClick(slot.slotNumber, button, ClickType.PICKUP); - if (slot.isItemValid(held) && !ItemInfo.fastTransferExemptions.contains(slot.getClass()) && !ItemInfo.fastTransferContainerExemptions.contains(gui.getClass())) { - fastTransferManager.performMassTransfer(gui, pickedUpFromSlot, slotIndex, held); - } - - return true; - } - - if (slotIndex == -999 && NEIClientUtils.shiftKey() && button == 0 && !ItemInfo.fastTransferContainerExemptions.contains(gui.getClass())) { - fastTransferManager.throwAll(gui, pickedUpFromSlot); - return true; - } - - return false; - } - - @Override - public void afterSlotClick(GuiContainer gui, int slotIndex, int button, Slot slot, ClickType clickType) { - if (!NEIClientConfig.isEnabled()) { - return; - } - - ItemStack nowHeld = NEIClientUtils.getHeldItem(); - - if (firstheld != nowHeld) { - pickedUpFromSlot = slotIndex; - } - - if (NEIClientConfig.canPerformAction("item") && NEIClientConfig.hasSMPCounterPart()) { - if (heldStackInfinite != null && slot != null && slot.inventory == Minecraft.getMinecraft().thePlayer.inventory) { - ItemStack stack = slot.getStack(); - if (stack != null) { - heldStackInfinite.onPlaceInfinite(stack); - } - NEIClientUtils.setSlotContents(slotIndex, stack, true); - } - - if (firstheld != nowHeld) { - heldStackInfinite = null; - } - - if (firstheld != nowHeld && nowHeld != null) { - for (IInfiniteItemHandler handler : ItemInfo.infiniteHandlers) { - if (handler.canHandleItem(nowHeld) && handler.isItemInfinite(nowHeld)) { - handler.onPickup(nowHeld); - NEIClientUtils.setSlotContents(-999, nowHeld, true); - heldStackInfinite = handler; - break; - } - } - } - } - } - - @Override - public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) { - if (!NEIClientConfig.isEnabled() || - GuiInfo.hasCustomSlots(gui) || - isSpreading(gui)) { - return false; - } - - Slot slot = GuiContainerManager.getSlotMouseOver(gui); - if (slot == null) { - return false; - } - - int slotIndex = slot.slotNumber; - - if (keyCode == Minecraft.getMinecraft().gameSettings.keyBindDrop.getKeyCode() && NEIClientUtils.shiftKey() && !ItemInfo.fastTransferContainerExemptions.contains(gui.getClass())) { - FastTransferManager.clickSlot(gui, slotIndex); - fastTransferManager.throwAll(gui, slotIndex); - FastTransferManager.clickSlot(gui, slotIndex); - - return true; - } - - return false; - } - - @Override - public boolean mouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) { - if (!NEIClientConfig.isEnabled() || GuiInfo.hasCustomSlots(gui)) { - return false; - } - - Point mousePos = getMousePosition(); - Slot mouseover = manager.window.getSlotAtPosition(mousePos.x, mousePos.y); - if (mouseover != null && mouseover.getHasStack() && !ItemInfo.fastTransferContainerExemptions.contains(gui.getClass())) { - if (scrolled > 0) { - fastTransferManager.transferItem(manager.window, mouseover.slotNumber); - } else { - fastTransferManager.retrieveItem(manager.window, mouseover.slotNumber); - } - return true; - } - return false; - } - - @Override - public boolean keyTyped(GuiContainer gui, char keyChar, int keyCode) { - return false; - } - - @Override - public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) { - return false; - } - - @Override - public void onKeyTyped(GuiContainer gui, char keyChar, int keyID) { - } - - @Override - public void onMouseClicked(GuiContainer gui, int mousex, int mousey, int button) { - } - - @Override - public void onMouseDragged(GuiContainer gui, int mousex, int mousey, int button, long heldTime) { - } - - @Override - public void onMouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) { - } - - @Override - public void onMouseUp(GuiContainer gui, int mousex, int mousey, int button) { - } - - public static boolean canUseDeleteMode() { - return !(NEIClientUtils.getGuiContainer() instanceof GuiContainerCreative); - } - - public static void toggleDeleteMode() { - if (canUseDeleteMode()) { - deleteMode = !deleteMode; - } - } - - public static boolean getDeleteMode() { - return deleteMode; - } -} diff --git a/dependencies/main/java/codechicken/nei/NEICreativeGuiHandler.java b/dependencies/main/java/codechicken/nei/NEICreativeGuiHandler.java deleted file mode 100644 index 564ceb2be7..0000000000 --- a/dependencies/main/java/codechicken/nei/NEICreativeGuiHandler.java +++ /dev/null @@ -1,22 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.api.INEIGuiAdapter; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.gui.inventory.GuiContainerCreative; -import net.minecraft.creativetab.CreativeTabs; - -public class NEICreativeGuiHandler extends INEIGuiAdapter { - @Override - public VisibilityData modifyVisiblity(GuiContainer gui, VisibilityData currentVisibility) { - if (!(gui instanceof GuiContainerCreative)) { - return currentVisibility; - } - - if (((GuiContainerCreative) gui).getSelectedTabIndex() != CreativeTabs.INVENTORY.getTabIndex()) { - currentVisibility.showItemPanel = currentVisibility.enableDeleteMode = false; - } - - return currentVisibility; - } - -} diff --git a/dependencies/main/java/codechicken/nei/NEIDummySlotHandler.java b/dependencies/main/java/codechicken/nei/NEIDummySlotHandler.java deleted file mode 100644 index 25900bcf3d..0000000000 --- a/dependencies/main/java/codechicken/nei/NEIDummySlotHandler.java +++ /dev/null @@ -1,23 +0,0 @@ -package codechicken.nei; - -import codechicken.core.inventory.ContainerExtended; -import codechicken.core.inventory.SlotDummy; -import codechicken.nei.api.INEIGuiAdapter; -import codechicken.nei.network.NEIClientPacketHandler; -import codechicken.nei.util.NEIClientUtils; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class NEIDummySlotHandler extends INEIGuiAdapter { - @Override - public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button) { - Slot slot = gui.getSlotAtPosition(mousex, mousey); - if (slot instanceof SlotDummy && slot.isItemValid(draggedStack) && gui.inventorySlots instanceof ContainerExtended) { - ((SlotDummy) slot).slotClick(draggedStack, button, NEIClientUtils.shiftKey()); - NEIClientPacketHandler.sendDummySlotSet(slot.slotNumber, slot.getStack()); - return true; - } - return false; - } -} diff --git a/dependencies/main/java/codechicken/nei/NEIModContainer.java b/dependencies/main/java/codechicken/nei/NEIModContainer.java deleted file mode 100644 index 69ecd3af20..0000000000 --- a/dependencies/main/java/codechicken/nei/NEIModContainer.java +++ /dev/null @@ -1,120 +0,0 @@ -package codechicken.nei; - -import codechicken.core.launch.CodeChickenCorePlugin; -import codechicken.lib.CodeChickenLib; -import codechicken.nei.api.IConfigureNEI; -import codechicken.nei.asm.NEICorePlugin; -import com.google.common.eventbus.EventBus; -import com.google.common.eventbus.Subscribe; -import net.minecraft.util.text.TextFormatting; -import net.minecraftforge.fml.client.FMLFileResourcePack; -import net.minecraftforge.fml.client.FMLFolderResourcePack; -import net.minecraftforge.fml.common.*; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.common.versioning.ArtifactVersion; -import net.minecraftforge.fml.common.versioning.VersionParser; -import net.minecraftforge.fml.common.versioning.VersionRange; - -import java.io.File; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - -@Mod(modid = "nei")// Fixes no resource domain being registered. -public class NEIModContainer extends DummyModContainer { - public static LinkedList plugins = new LinkedList(); - - public NEIModContainer() { - super(MetadataCollection.from(MetadataCollection.class.getResourceAsStream("/neimod.info"), "NotEnoughItems").getMetadataForId("NotEnoughItems", null)); - loadMetadata(); - } - - @Override - public Set getRequirements() { - Set deps = new HashSet(); - if (!super.getMetadata().version.contains("$")) { - deps.add(VersionParser.parseVersionReference("CodeChickenLib@[" + CodeChickenLib.version + ",)")); - deps.add(VersionParser.parseVersionReference("CodeChickenCore@[" + CodeChickenCorePlugin.version + ",)")); - deps.add(VersionParser.parseVersionReference("JEI@[3.13.2,)")); - } - return deps; - } - - @Override - public List getDependencies() { - return new LinkedList(getRequirements()); - } - - private String description; - - private void loadMetadata() { - description = super.getMetadata().description.replace("Supporters:", TextFormatting.AQUA + "Supporters:"); - } - - @Override - public ModMetadata getMetadata() { - String s_plugins = ""; - if (plugins.size() == 0) { - s_plugins += TextFormatting.RED + "No installed plugins."; - } else { - s_plugins += TextFormatting.GREEN + "Installed plugins: "; - for (int i = 0; i < plugins.size(); i++) { - if (i > 0) { - s_plugins += ", "; - } - IConfigureNEI plugin = plugins.get(i); - s_plugins += plugin.getName() + " " + plugin.getVersion(); - } - s_plugins += "."; - } - - ModMetadata meta = super.getMetadata(); - meta.description = description.replace("", s_plugins); - return meta; - } - - @Override - public boolean registerBus(EventBus bus, LoadController controller) { - bus.register(this); - return true; - } - - @Subscribe - public void preInit(FMLPreInitializationEvent event) { - FingerprintChecker.runFingerprintChecks(); - if (event.getSide().isClient()) { - ClientHandler.preInit(); - } - } - - @Subscribe - public void init(FMLInitializationEvent event) { - if (event.getSide().isClient()) { - ClientHandler.init(); - } - - ServerHandler.init(); - } - - @Override - public VersionRange acceptableMinecraftVersionRange() { - return VersionParser.parseRange(CodeChickenLib.mcVersion); - } - - @Override - public File getSource() { - return NEICorePlugin.location; - } - - @Override - public Class getCustomResourcePackClass() { - return getSource().isFile() ? FMLFileResourcePack.class : FMLFolderResourcePack.class; - } - - @Override - public Object getMod() { - return this; - } -} diff --git a/dependencies/main/java/codechicken/nei/NEIServerConfig.java b/dependencies/main/java/codechicken/nei/NEIServerConfig.java deleted file mode 100644 index 9634a823d7..0000000000 --- a/dependencies/main/java/codechicken/nei/NEIServerConfig.java +++ /dev/null @@ -1,300 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.util.CommonUtils; -import codechicken.lib.config.ConfigFile; -import codechicken.lib.inventory.InventoryUtils; -import codechicken.lib.packet.PacketCustom; -import codechicken.lib.util.ServerUtils; -import codechicken.nei.network.NEIServerPacketHandler; -import codechicken.nei.util.LogHelper; -import codechicken.nei.util.NEIServerUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.JsonToNBT; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; -import org.apache.commons.io.IOUtils; - -import java.io.File; -import java.io.FileReader; -import java.io.PrintWriter; -import java.util.*; - -public class NEIServerConfig { - private static MinecraftServer server; - - public static File saveDir; - public static ConfigFile serverConfig; - public static Map dimTags = new HashMap(); - public static HashMap playerSaves = new HashMap(); - public static ItemStackMap> bannedItems = new ItemStackMap>(); - - public static void load(World world) { - if (ServerUtils.mc() != server) { - LogHelper.debug("Loading NEI Server"); - server = ServerUtils.mc(); - saveDir = new File(DimensionManager.getCurrentSaveRootDirectory(), "NEI"); - - dimTags.clear(); - loadConfig(); - loadBannedItems(); - } - loadWorld(world); - } - - public static File getSaveDir(World world) { - return new File(CommonUtils.getSaveLocation(world), "NEI"); - } - - private static void loadWorld(World world) { - try { - File file = new File(getSaveDir(world), "world.dat"); - NBTTagCompound tag = NEIServerUtils.readNBT(file); - if (tag == null) { - tag = new NBTTagCompound(); - } - dimTags.put(world.provider.getDimension(), tag); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private static void loadConfig() { - File file = new File(saveDir, "server.cfg"); - serverConfig = new ConfigFile(file); - - serverConfig.setNewLineMode(1); - serverConfig.getTag("permissions").useBraces(); - serverConfig.getTag("permissions").setComment("List of players who can use these features.\nEg. time=CodeChicken, Friend1"); - - setDefaultFeature("time"); - setDefaultFeature("rain"); - setDefaultFeature("heal"); - setDefaultFeature("magnet"); - setDefaultFeature("creative"); - setDefaultFeature("creative+"); - setDefaultFeature("adventure"); - setDefaultFeature("enchant"); - setDefaultFeature("potion"); - setDefaultFeature("save-state"); - setDefaultFeature("item"); - setDefaultFeature("delete"); - setDefaultFeature("notify-item", "CONSOLE, OP"); - } - - private static void setDefaultFeature(String featurename, String... names) { - if (names.length == 0) { - names = new String[] { "OP" }; - } - - String list = ""; - for (int i = 0; i < names.length; i++) { - if (i >= 1) { - list += ", "; - } - list += names[i]; - } - serverConfig.getTag("permissions." + featurename).setDefaultValue(list); - } - - private static void saveWorld(int dim) { - try { - File file = new File(getSaveDir(DimensionManager.getWorld(dim)), "world.dat"); - NEIServerUtils.writeNBT(dimTags.get(dim), file); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static boolean canPlayerPerformAction(String playername, String name) { - return isPlayerInList(playername, getPlayerList("permissions." + NEIActions.base(name)), true); - } - - public static boolean isPlayerInList(String playername, Set list, boolean allowCards) { - if (playername.equals("CONSOLE")) { - return list.contains(playername); - } - - playername = playername.toLowerCase(); - - if (allowCards) { - if (list.contains("ALL")) { - return true; - } - if ((ServerUtils.isPlayerOP(playername) || ServerUtils.isPlayerOwner(playername)) && list.contains("OP")) { - return true; - } - } - - return list.contains(playername); - } - - public static boolean isActionDisabled(int dim, String name) { - return dimTags.get(dim).getBoolean("disabled" + name); - } - - public static void disableAction(int dim, String name, boolean disable) { - dimTags.get(dim).setBoolean("disabled" + name, disable); - NEIServerPacketHandler.sendActionDisabled(dim, name, disable); - saveWorld(dim); - } - - public static HashSet getPlayerList(String tag) { - String[] list = serverConfig.getTag(tag).getValue("").replace(" ", "").split(","); - return new HashSet(Arrays.asList(list)); - } - - public static void addPlayerToList(String playername, String tag) { - HashSet list = getPlayerList(tag); - - if (!playername.equals("CONSOLE") && !playername.equals("ALL") && !playername.equals("OP")) { - playername = playername.toLowerCase(); - } - - list.add(playername); - savePlayerList(tag, list); - } - - public static void remPlayerFromList(String playername, String tag) { - HashSet list = getPlayerList(tag); - - if (!playername.equals("CONSOLE") && !playername.equals("ALL") && !playername.equals("OP")) { - playername = playername.toLowerCase(); - } - - list.remove(playername); - savePlayerList(tag, list); - } - - private static void savePlayerList(String tag, Collection list) { - StringBuilder sb = new StringBuilder(); - int i = 0; - for (Iterator iterator = list.iterator(); iterator.hasNext(); i++) { - if (i != 0) { - sb.append(", "); - } - - sb.append(iterator.next()); - } - - serverConfig.getTag(tag).setValue(sb.toString()); - } - - private static void loadBannedItems() { - bannedItems.clear(); - File file = new File(saveDir, "banneditems.cfg"); - if (!file.exists()) { - bannedItems.put(new ItemStack(Blocks.COMMAND_BLOCK), new HashSet(Arrays.asList("NONE"))); - saveBannedItems(); - return; - } - try { - FileReader r = new FileReader(file); - int line = 0; - for (String s : IOUtils.readLines(r)) { - if (s.charAt(0) == '#' || s.trim().length() == 0) { - continue; - } - int delim = s.lastIndexOf('='); - if (delim < 0) { - LogHelper.error("line %s: Missing =", line); - continue; - } - try { - NBTTagCompound key = JsonToNBT.getTagFromJson(s.substring(0, delim)); - Set values = new HashSet(); - for (String s2 : s.substring(delim + 1).split(",")) { - values.add(s2.trim()); - } - bannedItems.put(InventoryUtils.loadPersistant(key), values); - } catch (Exception e) { - LogHelper.error("line %s: %s", line, e.getMessage()); - } - } - r.close(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static void saveBannedItems() { - File file = new File(saveDir, "banneditems.cfg"); - try { - if (!file.exists()) { - file.createNewFile(); - } - - PrintWriter p = new PrintWriter(file); - p.println("#Saved in this format for external editing. The format isn't that hard to figure out. If you think you're up to it, modify it here!"); - - for (ItemStackMap.Entry> entry : bannedItems.entries()) { - NBTTagCompound key = InventoryUtils.savePersistant(entry.key, new NBTTagCompound()); - key.removeTag("Count"); - if (key.getByte("Damage") == 0) { - key.removeTag("Damage"); - } - - p.print(key.toString()); - p.print("=["); - int i = 0; - for (String s : entry.value) { - if (i++ != 0) { - p.print(", "); - } - p.print(s); - } - p.println("]"); - } - p.close(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static PlayerSave forPlayer(String username) { - return playerSaves.get(username); - } - - public static void loadPlayer(EntityPlayer player) { - LogHelper.debug("Loading Player: " + player.getGameProfile().getName()); - playerSaves.put(player.getName(), new PlayerSave((EntityPlayerMP) player, new File(saveDir, "players"))); - } - - public static void unloadPlayer(EntityPlayer player) { - LogHelper.debug("Unloading Player: " + player.getName()); - PlayerSave playerSave = playerSaves.remove(player.getName()); - if (playerSave != null) { - playerSave.save(); - } - } - - public static boolean authenticatePacket(EntityPlayerMP sender, PacketCustom packet) { - switch (packet.getType()) { - case 1: - return canPlayerPerformAction(sender.getName(), "item"); - case 4: - return canPlayerPerformAction(sender.getName(), "delete"); - case 6: - return canPlayerPerformAction(sender.getName(), "magnet"); - case 7: - return canPlayerPerformAction(sender.getName(), "time"); - case 8: - return canPlayerPerformAction(sender.getName(), "heal"); - case 9: - return canPlayerPerformAction(sender.getName(), "rain"); - case 14: - case 23: - return canPlayerPerformAction(sender.getName(), "creative+"); - case 21: - case 22: - return canPlayerPerformAction(sender.getName(), "enchant"); - case 24: - return canPlayerPerformAction(sender.getName(), "potion"); - } - return true; - } -} diff --git a/dependencies/main/java/codechicken/nei/OffsetPositioner.java b/dependencies/main/java/codechicken/nei/OffsetPositioner.java deleted file mode 100644 index 8f54695c54..0000000000 --- a/dependencies/main/java/codechicken/nei/OffsetPositioner.java +++ /dev/null @@ -1,25 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.api.IStackPositioner; -import codechicken.nei.api.stack.PositionedStack; - -import java.util.ArrayList; - -public class OffsetPositioner implements IStackPositioner { - public OffsetPositioner(int x, int y) { - offsetx = x; - offsety = y; - } - - @Override - public ArrayList positionStacks(ArrayList ai) { - for (PositionedStack stack : ai) { - stack.relx += offsetx; - stack.rely += offsety; - } - return ai; - } - - public int offsetx; - public int offsety; -} diff --git a/dependencies/main/java/codechicken/nei/PlayerSave.java b/dependencies/main/java/codechicken/nei/PlayerSave.java deleted file mode 100644 index 0a6bedbe74..0000000000 --- a/dependencies/main/java/codechicken/nei/PlayerSave.java +++ /dev/null @@ -1,129 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.inventory.InventoryUtils; -import codechicken.lib.util.ServerUtils; -import codechicken.nei.network.NEIServerPacketHandler; -import codechicken.nei.util.LogHelper; -import codechicken.nei.util.NEIServerUtils; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; - -import java.io.File; -import java.util.HashSet; - -public class PlayerSave { - public EntityPlayerMP player; - - private File saveFile; - private NBTTagCompound nbt; - - public ItemStack[] creativeInv; - private boolean creativeInvDirty; - - private boolean isDirty; - private boolean wasOp; - - //runtime things - public HashSet magneticItems = new HashSet(); - - public PlayerSave(EntityPlayerMP player, File saveLocation) { - this.player = player; - wasOp = ServerUtils.mc().getPlayerList().canSendCommands(player.getGameProfile()); - - saveFile = new File(saveLocation, player.getName() + ".dat"); - if (!saveFile.getParentFile().exists()) { - saveFile.getParentFile().mkdirs(); - } - load(); - } - - private void load() { - nbt = new NBTTagCompound(); - try { - if (!saveFile.exists()) { - saveFile.createNewFile(); - } - if (saveFile.length() > 0) { - nbt = NEIServerUtils.readNBT(saveFile); - } - } catch (Exception e) { - LogHelper.errorError("Error loading player save: " + player, e); - } - - loadCreativeInv(); - } - - private void loadCreativeInv() { - creativeInv = new ItemStack[54]; - NBTTagList itemList = nbt.getTagList("creativeitems", 10); - if (itemList != null) { - InventoryUtils.readItemStacksFromTag(creativeInv, itemList); - } - } - - public void save() { - if (!isDirty) { - return; - } - - if (creativeInvDirty) { - saveCreativeInv(); - } - - try { - NEIServerUtils.writeNBT(nbt, saveFile); - isDirty = false; - } catch (Exception e) { - LogHelper.errorError("Error saving player: " + player, e); - } - } - - private void saveCreativeInv() { - NBTTagList invsave = InventoryUtils.writeItemStacksToTag(creativeInv); - nbt.setTag("creativeitems", invsave); - - creativeInvDirty = false; - } - - public void setCreativeDirty() { - creativeInvDirty = isDirty = true; - } - - public void setDirty() { - isDirty = true; - } - - public void updateOpChange() { - boolean isOp = ServerUtils.mc().getPlayerList().canSendCommands(player.getGameProfile()); - if (isOp != wasOp) { - NEIServerPacketHandler.sendHasServerSideTo(player); - wasOp = isOp; - } - } - - public boolean isActionEnabled(String name) { - return getEnabledActions().getBoolean(name); - } - - private NBTTagCompound getEnabledActions() { - NBTTagCompound tag = nbt.getCompoundTag("enabledActions"); - if (!nbt.hasKey("enabledActions")) { - nbt.setTag("enabledActions", tag); - } - return tag; - } - - public void enableAction(String name, boolean enabled) { - getEnabledActions().setBoolean(name, enabled); - NEIServerPacketHandler.sendActionEnabled(player, name, enabled); - setDirty(); - } - - public void onWorldReload() { - NEIServerPacketHandler.sendHasServerSideTo(player); - magneticItems.clear(); - } -} diff --git a/dependencies/main/java/codechicken/nei/PopupInputHandler.java b/dependencies/main/java/codechicken/nei/PopupInputHandler.java deleted file mode 100644 index 1e84bb0790..0000000000 --- a/dependencies/main/java/codechicken/nei/PopupInputHandler.java +++ /dev/null @@ -1,58 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.config.KeyBindings; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.network.NEIClientPacketHandler; -import net.minecraft.client.gui.inventory.GuiContainer; - -import static codechicken.nei.NEIClientConfig.canPerformAction; - -public class PopupInputHandler implements IContainerInputHandler { - @Override - public boolean keyTyped(GuiContainer gui, char keyChar, int keyCode) { - return false; - } - - @Override - public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) { - return false; - } - - @Override - public void onKeyTyped(GuiContainer gui, char keyChar, int keyID) { - } - - @Override - public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyID) { - if (KeyBindings.get("nei.options.keys.gui.enchant").isActiveAndMatches(keyID) && canPerformAction("enchant")) { - NEIClientPacketHandler.sendOpenEnchantmentWindow(); - return true; - } - if (KeyBindings.get("nei.options.keys.gui.potion").isActiveAndMatches(keyID) && canPerformAction("potion")) { - NEIClientPacketHandler.sendOpenPotionWindow(); - return true; - } - return false; - } - - @Override - public void onMouseClicked(GuiContainer gui, int mousex, int mousey, int button) { - } - - @Override - public void onMouseUp(GuiContainer gui, int mousex, int mousey, int button) { - } - - @Override - public boolean mouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) { - } - - @Override - public void onMouseDragged(GuiContainer gui, int mousex, int mousey, int button, long heldTime) { - } -} diff --git a/dependencies/main/java/codechicken/nei/SaveLoadButton.java b/dependencies/main/java/codechicken/nei/SaveLoadButton.java deleted file mode 100644 index 4479cc1528..0000000000 --- a/dependencies/main/java/codechicken/nei/SaveLoadButton.java +++ /dev/null @@ -1,105 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.util.NEIClientUtils; -import codechicken.nei.widget.Button; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.util.ChatAllowedCharacters; -import org.lwjgl.input.Keyboard; - -import static codechicken.lib.gui.GuiDraw.drawString; -import static codechicken.lib.gui.GuiDraw.getStringWidth; -import static codechicken.nei.util.NEIClientUtils.translate; - -public abstract class SaveLoadButton extends Button { - public SaveLoadButton(String s) { - super(s); - } - - @Override - public boolean handleClick(int mousex, int mousey, int button) { - if (button == 1) { - label = ""; - onTextChange(); - focused = true; - NEIClientUtils.playClickSound(); - return true; - } - return super.handleClick(mousex, mousey, button); - } - - public abstract void onTextChange(); - - @Override - public void onGuiClick(int i, int j) { - if (!contains(i, j)) { - focused = false; - } - } - - @Override - public boolean handleKeyPress(int keyID, char keyChar) { - if (!focused) { - return false; - } - - if (keyID == Keyboard.KEY_BACK) { - if (label.length() > 0) { - label = label.substring(0, label.length() - 1); - onTextChange(); - backdowntime = System.currentTimeMillis(); - } - } else if (keyID == Keyboard.KEY_RETURN) { - focused = false; - } else if (keyChar == 22)//paste - { - String pastestring = GuiScreen.getClipboardString(); - if (pastestring == null) { - pastestring = ""; - } - - label = label + pastestring; - onTextChange(); - } else if (ChatAllowedCharacters.isAllowedCharacter(keyChar)) { - label = label + keyChar; - onTextChange(); - } - return true; - } - - @Override - public void update() { - cursorCounter++; - if (backdowntime > 0) { - if (Keyboard.isKeyDown(Keyboard.KEY_BACK) && label.length() > 5) { - if (System.currentTimeMillis() - backdowntime > 200 / (1 + backs * 0.3F)) { - label = label.substring(0, label.length() - 1); - onTextChange(); - backdowntime = System.currentTimeMillis(); - backs++; - } - } else { - backdowntime = 0; - backs = 0; - } - } - } - - @Override - public void draw(int mousex, int mousey) { - super.draw(mousex, mousey); - if (focused && (cursorCounter / 6) % 2 == 0) { - drawString("_", x + (w + getStringWidth(getRenderLabel())) / 2, y + (h - 8) / 2, 0xFFFFFFFF); - } - } - - @Override - public String getRenderLabel() { - return translate(saved ? "load" : "save") + " " + label; - } - - public boolean saved; - public long backdowntime; - public int backs; - public int cursorCounter; - public boolean focused; -} diff --git a/dependencies/main/java/codechicken/nei/SearchField.java b/dependencies/main/java/codechicken/nei/SearchField.java deleted file mode 100644 index e3f2f7c9de..0000000000 --- a/dependencies/main/java/codechicken/nei/SearchField.java +++ /dev/null @@ -1,152 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.item.filtering.IItemFilter; -import codechicken.lib.item.filtering.IItemFilterProvider; -import codechicken.nei.ItemList.AnyMultiItemFilter; -import codechicken.nei.ItemList.EverythingItemFilter; -import codechicken.nei.ItemList.PatternItemFilter; -import codechicken.nei.api.API; -import codechicken.nei.config.KeyBindings; -import net.minecraft.util.text.TextFormatting; - -import java.util.LinkedList; -import java.util.List; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; - -import static codechicken.lib.gui.GuiDraw.drawGradientRect; -import static codechicken.lib.gui.GuiDraw.drawRect; -import static codechicken.nei.NEIClientConfig.world; - -public class SearchField extends TextField implements IItemFilterProvider { - /** - * Interface for returning a custom filter based on search field text - */ - public interface ISearchProvider { - /** - * @return false if this filter should only be used if no other non-default filters match the search string - */ - boolean isPrimary(); - - /** - * @return An item filter for items matching SearchTex null to ignore this provider - */ - IItemFilter getFilter(String searchText); - } - - private static class DefaultSearchProvider implements ISearchProvider { - @Override - public boolean isPrimary() { - return false; - } - - @Override - public IItemFilter getFilter(String searchText) { - Pattern pattern = getPattern(searchText); - return pattern == null ? null : new PatternItemFilter(pattern); - } - } - - public static List searchProviders = new LinkedList(); - - long lastclicktime; - - public SearchField(String ident) { - super(ident); - API.addItemFilter(this); - API.addSearchProvider(new DefaultSearchProvider()); - } - - public static boolean searchInventories() { - return world.nbt.getBoolean("searchinventories"); - } - - @Override - public int getTextColour() { -// if (JEIIntegrationManager.itemPannelOwner == EnumItemBrowser.JEI ? JEIIntegrationManager.getFilteredItems().size() == 0 : ItemPanel.items.size() == 0) { -// return Color.red.getRGB(); -// } - return super.getTextColour(); - } - - @Override - public void drawBox() { - if (searchInventories()) { - drawGradientRect(x, y, w, h, 0xFFFFFF00, 0xFFC0B000); - } else { - drawRect(x, y, w, h, 0xffA0A0A0); - } - drawRect(x + 1, y + 1, w - 2, h - 2, 0xFF000000); - } - - @Override - public boolean handleClick(int mousex, int mousey, int button) { - if (button == 0) { - if (focused() && (System.currentTimeMillis() - lastclicktime < 500)) {//double click - NEIClientConfig.world.nbt.setBoolean("searchinventories", !searchInventories()); - NEIClientConfig.world.saveNBT(); - } else { - lastclicktime = System.currentTimeMillis(); - } - } - return super.handleClick(mousex, mousey, button); - } - - @Override - public void onTextChange(String oldText) { - NEIClientConfig.setSearchExpression(text()); - ItemList.updateFilter.restart(); - } - - @Override - public void lastKeyTyped(int keyID, char keyChar) { - if (KeyBindings.get("nei.options.keys.gui.search").isActiveAndMatches(keyID)) { - setFocus(true); - } - } - - @Override - public String filterText(String s) { - return TextFormatting.getTextWithoutFormattingCodes(s); - } - - public static Pattern getPattern(String search) { - switch (NEIClientConfig.getIntSetting("inventory.searchmode")) { - case 0://plain - search = "\\Q" + search + "\\E"; - break; - case 1: - search = search.replace(".", "").replace("?", ".").replace("*", ".+?"); - break; - } - - Pattern pattern = null; - try { - pattern = Pattern.compile(search); - } catch (PatternSyntaxException ignored) { - } - return pattern == null || pattern.toString().length() == 0 ? null : pattern; - } - - @Override - public IItemFilter getFilter() { - String s_filter = text().toLowerCase(); - - List primary = new LinkedList(); - List secondary = new LinkedList(); - for (ISearchProvider p : searchProviders) { - IItemFilter filter = p.getFilter(s_filter); - if (filter != null) { - (p.isPrimary() ? primary : secondary).add(filter); - } - } - - if (!primary.isEmpty()) { - return new AnyMultiItemFilter(primary); - } - if (!secondary.isEmpty()) { - return new AnyMultiItemFilter(secondary); - } - return new EverythingItemFilter(); - } -} diff --git a/dependencies/main/java/codechicken/nei/ServerHandler.java b/dependencies/main/java/codechicken/nei/ServerHandler.java deleted file mode 100644 index 06a384e8e8..0000000000 --- a/dependencies/main/java/codechicken/nei/ServerHandler.java +++ /dev/null @@ -1,164 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.packet.PacketCustom; -import codechicken.nei.network.NEIClientPacketHandler; -import codechicken.nei.network.NEIServerPacketHandler; -import codechicken.nei.util.NEIServerUtils; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent; -import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; -import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; -import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; - -import java.util.List; - -public class ServerHandler { - private static ServerHandler instance; - - public static void init() { - instance = new ServerHandler(); - - PacketCustom.assignHandler(NEIClientPacketHandler.channel, new NEIServerPacketHandler()); - //FMLCommonHandler.instance().bus().register(instance); - MinecraftForge.EVENT_BUS.register(instance); - - Item.getItemFromBlock(Blocks.MOB_SPAWNER).setHasSubtypes(true); - NEIActions.init(); - } - - @SubscribeEvent - public void tickEvent(TickEvent.WorldTickEvent event) { - if (event.phase == Phase.START && !event.world.isRemote && - NEIServerConfig.dimTags.containsKey(event.world.provider.getDimension()))//fake worlds that don't call Load - { - processDisabledProperties(event.world); - } - } - - @SubscribeEvent - public void loadEvent(WorldEvent.Load event) { - if (!event.getWorld().isRemote) { - NEIServerConfig.load(event.getWorld()); - } - } - - @SubscribeEvent - public void tickEvent(TickEvent.PlayerTickEvent event) { - if (event.phase == Phase.START && event.player instanceof EntityPlayerMP) { - EntityPlayerMP player = (EntityPlayerMP) event.player; - PlayerSave save = NEIServerConfig.forPlayer(player.getName()); - if (save == null) { - return; - } - updateMagneticPlayer(player, save); - save.updateOpChange(); - save.save(); - } - } - - private void processDisabledProperties(World world) { - NEIServerUtils.advanceDisabledTimes(world); - if (NEIServerUtils.isRaining(world) && NEIServerConfig.isActionDisabled(world.provider.getDimension(), "rain")) { - NEIServerUtils.toggleRaining(world, false); - } - } - - private void updateMagneticPlayer(EntityPlayerMP player, PlayerSave save) { - if (!save.isActionEnabled("magnet") || player.isDead) { - return; - } - - float distancexz = 16; - float distancey = 8; - double maxspeedxz = 0.5; - double maxspeedy = 0.5; - double speedxz = 0.05; - double speedy = 0.07; - List items = player.worldObj.getEntitiesWithinAABB(EntityItem.class, player.getEntityBoundingBox().expand(distancexz, distancey, distancexz)); - for (EntityItem item : items) { - if (item.cannotPickup()) { - continue; - } - if (!NEIServerUtils.canItemFitInInventory(player, item.getEntityItem())) { - continue; - } - if (save.magneticItems.add(item)) { - NEIServerPacketHandler.sendAddMagneticItemTo(player, item); - } - - double dx = player.posX - item.posX; - double dy = player.posY + player.getEyeHeight() - item.posY; - double dz = player.posZ - item.posZ; - double absxz = Math.sqrt(dx * dx + dz * dz); - double absy = Math.abs(dy); - if (absxz > distancexz) { - continue; - } - - if (absxz < 1) { - item.onCollideWithPlayer(player); - } - - if (absxz > 1) { - dx /= absxz; - dz /= absxz; - } - - if (absy > 1) { - dy /= absy; - } - - double vx = item.motionX + speedxz * dx; - double vy = item.motionY + speedy * dy; - double vz = item.motionZ + speedxz * dz; - - double absvxz = Math.sqrt(vx * vx + vz * vz); - double absvy = Math.abs(vy); - - double rationspeedxz = absvxz / maxspeedxz; - if (rationspeedxz > 1) { - vx /= rationspeedxz; - vz /= rationspeedxz; - } - - double rationspeedy = absvy / maxspeedy; - if (absvy > 1) { - vy /= rationspeedy; - } - - item.motionX = vx; - item.motionY = vy; - item.motionZ = vz; - } - } - - @SubscribeEvent - public void loginEvent(PlayerLoggedInEvent event) { - NEIServerConfig.loadPlayer(event.player); - NEIServerPacketHandler.sendHasServerSideTo((EntityPlayerMP) event.player); - } - - @SubscribeEvent - public void logoutEvent(PlayerLoggedOutEvent event) { - NEIServerConfig.unloadPlayer(event.player); - } - - @SubscribeEvent - public void dimChangeEvent(PlayerChangedDimensionEvent event) { - NEIServerConfig.forPlayer(event.player.getName()).onWorldReload(); - } - - @SubscribeEvent - public void loginEvent(PlayerRespawnEvent event) { - NEIServerConfig.forPlayer(event.player.getName()).onWorldReload(); - } -} diff --git a/dependencies/main/java/codechicken/nei/SlotOP.java b/dependencies/main/java/codechicken/nei/SlotOP.java deleted file mode 100644 index bc1828303f..0000000000 --- a/dependencies/main/java/codechicken/nei/SlotOP.java +++ /dev/null @@ -1,9 +0,0 @@ -package codechicken.nei; - -public abstract class SlotOP { - public abstract String getDescription(); - - public abstract int[] getKeyBind(); - - public abstract void operate(); -} diff --git a/dependencies/main/java/codechicken/nei/SpawnerRenderer.java b/dependencies/main/java/codechicken/nei/SpawnerRenderer.java deleted file mode 100644 index 125b65ffe3..0000000000 --- a/dependencies/main/java/codechicken/nei/SpawnerRenderer.java +++ /dev/null @@ -1,121 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.model.ModelRegistryHelper; -import codechicken.lib.render.item.IItemRenderer; -import codechicken.lib.texture.TextureUtils; -import codechicken.lib.util.TransformUtils; -import codechicken.lib.util.ClientUtils; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.block.model.*; -import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; -import net.minecraftforge.client.model.IPerspectiveAwareModel; -import org.apache.commons.lang3.tuple.Pair; - -import javax.vecmath.Matrix4f; -import java.util.ArrayList; -import java.util.List; - -//import net.minecraft.entity.boss.BossStatus; - -public class SpawnerRenderer implements IItemRenderer, IPerspectiveAwareModel { - public static void load(ItemMobSpawner item) { - ModelRegistryHelper.registerItemRenderer(item, new SpawnerRenderer()); - } - - public void renderItem(ItemStack stack) { - int meta = stack.getItemDamage(); - - if (meta == 0) { - meta = ItemMobSpawner.idPig; - } - - //String bossName = BossStatus.bossName; - //int bossTimeout = BossStatus.statusBarTime; - Minecraft mc = Minecraft.getMinecraft(); - World world = mc.theWorld; - - IBakedModel baseModel = mc.getRenderItem().getItemModelMesher().getModelManager().getModel(new ModelResourceLocation("mob_spawner")); - GlStateManager.pushMatrix(); - GlStateManager.translate(.5, .5, .5); - GlStateManager.scale(2, 2, 2); - mc.getRenderItem().renderItem(stack, baseModel); - GlStateManager.popMatrix(); - - try { - Entity entity = ItemMobSpawner.getEntity(meta); - entity.setWorld(world); - float scale = 0.6F / Math.max(entity.height, entity.width); - - GlStateManager.pushMatrix(); - GlStateManager.translate(0.5, 0.4, 0.5); - GlStateManager.rotate((float) (ClientUtils.getRenderTime() * 10), 0, 1, 0); - GlStateManager.rotate(-20, 1, 0, 0); - GlStateManager.translate(0, -0.4, 0); - GlStateManager.scale(scale, scale, scale); - entity.setLocationAndAngles(0, 0, 0, 0, 0); - mc.getRenderManager().doRenderEntity(entity, 0, 0, 0, 0, 0, false); - GlStateManager.disableLighting(); - GlStateManager.popMatrix(); - - GlStateManager.enableRescaleNormal(); - OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); - GlStateManager.disableTexture2D(); - OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); - } catch (Exception e) { - if (Tessellator.getInstance().getBuffer().isDrawing) { - Tessellator.getInstance().draw(); - } - } - //BossStatus.bossName = bossName; - //BossStatus.statusBarTime = bossTimeout; - } - - @Override - public List getQuads(IBlockState state, EnumFacing side, long rand) { - return new ArrayList(); - } - - @Override - public boolean isAmbientOcclusion() { - return false; - } - - @Override - public boolean isGui3d() { - return true; - } - - @Override - public boolean isBuiltInRenderer() { - return true; - } - - @Override - public TextureAtlasSprite getParticleTexture() { - return TextureUtils.getBlockTexture("mob_spawner"); - } - - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } - - @Override - public ItemOverrideList getOverrides() { - return ItemOverrideList.NONE; - } - - @Override - public Pair handlePerspective(TransformType cameraTransformType) { - return MapWrapper.handlePerspective(this, TransformUtils.DEFAULT_BLOCK.getTransforms(), cameraTransformType); - } -} diff --git a/dependencies/main/java/codechicken/nei/SubsetWidget.java b/dependencies/main/java/codechicken/nei/SubsetWidget.java deleted file mode 100644 index c6e4f58204..0000000000 --- a/dependencies/main/java/codechicken/nei/SubsetWidget.java +++ /dev/null @@ -1,798 +0,0 @@ -package codechicken.nei; - -import codechicken.core.gui.GuiScrollSlot; -import codechicken.lib.gui.GuiDraw; -import codechicken.lib.item.filtering.IItemFilter; -import codechicken.lib.item.filtering.IItemFilterProvider; -import codechicken.lib.thread.RestartableTask; -import codechicken.lib.vec.Rectangle4i; -import codechicken.nei.ItemList.AnyMultiItemFilter; -import codechicken.nei.ItemList.ItemsLoadedCallback; -import codechicken.nei.ItemList.NothingItemFilter; -import codechicken.nei.SearchField.ISearchProvider; -import codechicken.nei.api.API; -import codechicken.nei.api.ItemInfo; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.util.LogHelper; -import codechicken.nei.util.NEIClientUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.text.TextFormatting; - -import java.awt.*; -import java.util.*; -import java.util.List; -import java.util.concurrent.atomic.AtomicReference; -import java.util.regex.Pattern; - -public class SubsetWidget extends codechicken.nei.widget.Button implements IItemFilterProvider, ItemsLoadedCallback, ISearchProvider { - public static class SubsetState { - int state = 2; - ArrayList items = new ArrayList(); - } - - public static class SubsetTag { - protected class SubsetSlot extends GuiScrollSlot { - public SubsetSlot() { - super(0, 0, 0, 0); - setSmoothScroll(false); - } - - @Override - public int getSlotHeight(int slot) { - return 18; - } - - @Override - protected int getNumSlots() { - return children.size() + state.items.size(); - } - - @Override - protected void slotClicked(int slot, int button, int mx, int my, int count) { - if (slot < sorted.size()) { - SubsetTag tag = sorted.get(slot); - if (NEIClientUtils.shiftKey()) { - String searchTag = tag.fullname;//TODO - if (searchTag.startsWith("Mod.")/* && JEIIntegrationManager.itemPannelOwner == EnumItemBrowser.JEI*/){ - searchTag = searchTag.replace("Mod.", "").replace(" ", ""); - } - LayoutManager.searchField.setText("@" + searchTag); - } else if (button == 0 && count >= 2) { - SubsetWidget.showOnly(tag); - } else { - SubsetWidget.setHidden(tag, button == 1); - } - } else { - ItemStack item = state.items.get(slot - sorted.size()); - if (NEIClientUtils.controlKey()) { - NEIClientUtils.cheatItem(item, button, -1); - } else { - SubsetWidget.setHidden(state.items.get(slot - sorted.size()), button == 1); - } - } - } - - @Override - protected void drawSlot(int slot, int x, int y, int mx, int my, float frame) { - int w = windowBounds().width; - Rectangle4i r = new Rectangle4i(x, y, w, getSlotHeight(slot)); - if (slot < sorted.size()) { - SubsetTag tag = sorted.get(slot); - LayoutManager.getLayoutStyle().drawSubsetTag(tag.displayName(), x, y, r.w, r.h, tag.state.state, r.contains(mx, my)); - } else { - ItemStack stack = state.items.get(slot - sorted.size()); - boolean hidden = SubsetWidget.isHidden(stack); - - int itemx = w / 2 - 8; - int itemy = 1; - - LayoutManager.getLayoutStyle().drawSubsetTag(null, x, y, r.w, r.h, hidden ? 0 : 2, false); - - GuiContainerManager.drawItem(x + itemx, y + itemy, stack); - if (new Rectangle4i(itemx, itemy, 16, 16).contains(mx, my)) { - SubsetWidget.hoverStack = stack; - } - } - } - - @Override - public void drawOverlay(float frame) { - } - - @Override - public void drawBackground(float frame) { - drawRect(x, y, x + width, y + height, 0xFF202020); - } - - @Override - public int scrollbarAlignment() { - return -1; - } - - @Override - public void drawScrollbar(float frame) { - if (hasScrollbar()) { - super.drawScrollbar(frame); - } - } - - @Override - public int scrollbarGuideAlignment() { - return 0; - } - } - - public final String fullname; - public final IItemFilter filter; - public TreeMap children = new TreeMap(); - public List sorted = Collections.emptyList(); - private int childwidth; - - protected String displayName; - protected SubsetState state = new SubsetState(); - protected final SubsetSlot slot = new SubsetSlot(); - private SubsetTag selectedChild; - private int visible; - - public SubsetTag(String fullname) { - this(fullname, new NothingItemFilter()); - } - - public SubsetTag(String fullname, IItemFilter filter) { - assert filter != null : "Filter cannot be null"; - this.fullname = TextFormatting.getTextWithoutFormattingCodes(fullname); - this.filter = filter; - - if (fullname != null) { - int idx = fullname.lastIndexOf('.'); - displayName = idx < 0 ? fullname : fullname.substring(idx + 1); - } - } - - public String displayName() { - return displayName; - } - - public String name() { - int idx = fullname.indexOf('.'); - return idx < 0 ? fullname : fullname.substring(idx + 1); - } - - public String parent() { - int idx = fullname.lastIndexOf('.'); - return idx < 0 ? null : fullname.substring(0, idx); - } - - private SubsetTag getTag(String name) { - int idx = name.indexOf('.'); - String childname = idx > 0 ? name.substring(0, idx) : name; - SubsetTag child = children.get(childname.toLowerCase()); - if (child == null) { - return null; - } - - return idx > 0 ? child.getTag(name.substring(idx + 1)) : child; - } - - private void recacheChildren() { - sorted = new ArrayList(children.values()); - childwidth = 0; - for (SubsetTag tag : sorted) { - childwidth = Math.max(childwidth, tag.nameWidth() + 2); - } - } - - private void addTag(SubsetTag tag) { - String name = fullname == null ? tag.fullname : tag.fullname.substring(fullname.length() + 1); - int idx = name.indexOf('.'); - - if (idx < 0) {//add or replace tag - SubsetTag prev = children.put(name.toLowerCase(), tag); - if (prev != null) {//replaced, load children - tag.children = prev.children; - tag.sorted = prev.sorted; - } - recacheChildren(); - } else { - String childname = name.substring(0, idx); - SubsetTag child = children.get(childname.toLowerCase()); - if (child == null) { - children.put(childname.toLowerCase(), child = new SubsetTag(fullname == null ? childname : fullname + '.' + childname)); - } - recacheChildren(); - child.addTag(tag); - } - } - - protected void cacheState() { - state = SubsetWidget.getState(this); - for (SubsetTag tag : sorted) { - tag.cacheState(); - } - } - - public void addFilters(List filters) { - if (filter != null) { - filters.add(filter); - } - - for (SubsetTag child : sorted) { - child.addFilters(filters); - } - } - - public void search(List tags, Pattern p) { - if (fullname != null && p.matcher(fullname.toLowerCase()).find()) { - tags.add(this); - } else { - for (SubsetTag child : sorted) { - child.search(tags, p); - } - } - } - - public void updateVisiblity(int mx, int my) { - if (selectedChild != null) { - selectedChild.updateVisiblity(mx, my); - if (!selectedChild.isVisible()) { - selectedChild = null; - } - } - - if (slot.contains(mx, my) && (selectedChild == null || !selectedChild.contains(mx, my))) { - int mslot = slot.getClickedSlot(my); - if (mslot >= 0 && mslot < sorted.size()) { - SubsetTag mtag = sorted.get(mslot); - if (mtag != null) { - if (mtag != selectedChild && selectedChild != null) { - selectedChild.setHidden(); - } - selectedChild = mtag; - selectedChild.setVisible(); - } - } - - setVisible(); - } - - if (selectedChild == null) { - countdownVisible(); - } - } - - public void setHidden() { - visible = 0; - slot.mouseReleased(0, 0, 0);//cancel any scrolling - if (selectedChild != null) { - selectedChild.setHidden(); - selectedChild = null; - } - } - - public void setVisible() { - visible = 10; - cacheState(); - } - - private void countdownVisible() { - if (visible > 0 && --visible == 0) { - setHidden(); - } - } - - public void resize(int x, int pwidth, int y) { - int mheight = area.h; - int dheight = area.y2() - y; - int cheight = slot.contentHeight(); - int height = cheight; - if (cheight > mheight) { - y = area.y; - height = mheight; - } else if (cheight > dheight) { - y = area.y2() - cheight; - } - - height = height / slot.getSlotHeight(0) * slot.getSlotHeight(0);//floor to a multiple of slot height - - int width = childwidth; - if (!state.items.isEmpty()) { - width = Math.max(childwidth, 18); - } - if (slot.contentHeight() > height) { - width += slot.scrollbarDim().width; - } - - boolean fitLeft = x - width >= area.x1(); - boolean fitRight = x + width + pwidth <= area.x2(); - if (pwidth >= 0 ? !fitRight && fitLeft : !fitLeft) { - pwidth *= -1;//swap - } - x += pwidth >= 0 ? pwidth : -width; - - slot.setSize(x, y, width, height); - slot.setMargins(slot.hasScrollbar() ? slot.scrollbarDim().width : 0, 0, 0, 0); - - if (selectedChild != null) { - y = slot.getSlotY(sorted.indexOf(selectedChild)) - slot.scrolledPixels() + slot.y; - selectedChild.resize(x, pwidth >= 0 ? width : -width, y); - } - } - - protected int nameWidth() { - return Minecraft.getMinecraft().fontRendererObj.getStringWidth(displayName()); - } - - public boolean isVisible() { - return visible > 0; - } - - public void draw(int mx, int my) { - slot.draw(mx, my, 0); - if (selectedChild != null) { - selectedChild.draw(mx, my); - } - } - - public boolean contains(int px, int py) { - return slot.contains(px, py) || selectedChild != null && selectedChild.contains(px, py); - } - - public void mouseClicked(int mx, int my, int button) { - if (selectedChild != null && selectedChild.contains(mx, my)) { - selectedChild.mouseClicked(mx, my, button); - } else if (slot.contains(mx, my)) { - slot.mouseClicked(mx, my, button); - } - } - - public void mouseDragged(int mx, int my, int button, long heldTime) { - slot.mouseDragged(mx, my, button, heldTime); - if (selectedChild != null) { - selectedChild.mouseDragged(mx, my, button, heldTime); - } - } - - public void mouseUp(int mx, int my, int button) { - slot.mouseReleased(mx, my, button); - if (selectedChild != null) { - selectedChild.mouseUp(mx, my, button); - } - } - - public boolean mouseScrolled(int mx, int my, int scroll) { - if (slot.hasScrollbar() && slot.contains(mx, my)) { - slot.scroll(scroll); - return true; - } - - if (selectedChild != null && selectedChild.mouseScrolled(mx, my, scroll)) { - return true; - } - - if (slot.hasScrollbar() && !contains(mx, my)) { - slot.scroll(scroll); - return true; - } - - return false; - } - - public boolean isScrolling() { - return slot.isScrolling() || selectedChild != null && selectedChild.isScrolling(); - } - } - - protected static final SubsetTag root = new SubsetTag(null); - public static Rectangle4i area = new Rectangle4i(); - public static ItemStack hoverStack; - - private static HashMap subsetState = new HashMap(); - /** - * All operations on this variable should be synchronised. - */ - private static final ItemStackSet hiddenItems = new ItemStackSet(); - private static final AtomicReference dirtyHiddenItems = new AtomicReference(); - - public static SubsetState getState(SubsetTag tag) { - SubsetState state = subsetState.get(tag.fullname); - return state == null ? new SubsetState() : state; - } - - public static void addTag(SubsetTag tag) { - updateState.stop(); - synchronized (root) { - root.addTag(tag); - updateState.reallocate(); - } - } - - public static SubsetTag getTag(String name) { - return name == null ? root : root.getTag(name); - } - - public static boolean isHidden(ItemStack item) { - synchronized (hiddenItems) { - return hiddenItems.contains(item); - } - } - - private static void _setHidden(SubsetTag tag, boolean hidden) { - for (ItemStack item : getState(tag).items) { - _setHidden(item, hidden); - } - for (SubsetTag child : tag.sorted) { - _setHidden(child, hidden); - } - } - - private static void _setHidden(ItemStack item, boolean hidden) { - if (hidden) { - hiddenItems.add(item); - } else { - hiddenItems.remove(item); - } - } - - public static void showOnly(SubsetTag tag) { - synchronized (hiddenItems) { - for (ItemStack item : ItemList.items) { - _setHidden(item, true); - } - setHidden(tag, false); - } - } - - public static void setHidden(SubsetTag tag, boolean hidden) { - synchronized (hiddenItems) { - _setHidden(tag, hidden); - updateHiddenItems(); - } - } - - public static void setHidden(ItemStack item, boolean hidden) { - synchronized (hiddenItems) { - _setHidden(item, hidden); - updateHiddenItems(); - } - } - - public static void unhideAll() { - synchronized (hiddenItems) { - hiddenItems.clear(); - updateHiddenItems(); - } - } - - private static void updateHiddenItems() { - prepareDirtyHiddenItems.restart(); - updateState.restart(); - } - - public static void loadHidden() { - synchronized (hiddenItems) { - hiddenItems.clear(); - } - - List itemList = new LinkedList(); - try { - NBTTagList list = NEIClientConfig.world.nbt.getTagList("hiddenItems", 10); - for (int i = 0; i < list.tagCount(); i++) { - itemList.add(ItemStack.loadItemStackFromNBT(list.getCompoundTagAt(i))); - } - } catch (Exception e) { - LogHelper.errorError("Error loading hiddenItems", e); - return; - } - - synchronized (hiddenItems) { - for (ItemStack item : itemList) { - hiddenItems.add(item); - } - } - updateState.restart(); - } - - private static void saveHidden() { - NBTTagList list = dirtyHiddenItems.getAndSet(null); - if (list != null) { - NEIClientConfig.world.nbt.setTag("hiddenItems", list); - NEIClientConfig.world.saveNBT(); - } - } - - private static final RestartableTask prepareDirtyHiddenItems = new RestartableTask("NEI Subset Save Thread") { - private List getList() { - synchronized (hiddenItems) { - return hiddenItems.values(); - } - } - - @Override - public void execute() { - NBTTagList list = new NBTTagList(); - for (ItemStack item : getList()) { - if (interrupted()) { - return; - } - NBTTagCompound tag = new NBTTagCompound(); - item.writeToNBT(tag); - list.appendTag(tag); - } - dirtyHiddenItems.set(list); - } - }; - - private static final UpdateStateTask updateState = new UpdateStateTask(); - - private static class UpdateStateTask extends RestartableTask { - private volatile boolean reallocate; - - public UpdateStateTask() { - super("NEI Subset Item Allocation"); - } - - @Override - public void clearTasks() { - super.clearTasks(); - reallocate = false; - } - - public synchronized void reallocate() { - reallocate = true; - restart(); - } - - @Override - public void execute() { - HashMap state = new HashMap(); - List tags = new LinkedList(); - synchronized (root) { - cloneStates(root, tags, state); - if (interrupted()) { - return; - } - } - - if (reallocate) { - for (ItemStack item : ItemList.items) { - if (interrupted()) { - return; - } - if (ItemInfo.isHidden(item)) { - continue; - } - for (SubsetTag tag : tags) { - if (tag.filter.matches(item)) { - state.get(tag.fullname).items.add(item); - } - } - } - } - - synchronized (root) { - calculateVisibility(root, state); - if (interrupted()) { - return; - } - } - - subsetState = state; - ItemList.updateFilter.restart(); - } - - private void cloneStates(SubsetTag tag, List tags, HashMap state) { - for (SubsetTag child : tag.sorted) { - if (interrupted()) { - return; - } - cloneStates(child, tags, state); - } - - tags.add(tag); - SubsetState sstate = new SubsetState(); - if (!reallocate) { - sstate.items = SubsetWidget.getState(tag).items; - } - state.put(tag.fullname, sstate); - } - - private void calculateVisibility(SubsetTag tag, Map state) { - SubsetState sstate = state.get(tag.fullname); - int hidden = 0; - for (SubsetTag child : tag.sorted) { - if (interrupted()) { - return; - } - calculateVisibility(child, state); - int cstate = state.get(child.fullname).state; - if (cstate == 1) { - sstate.state = 1; - } else if (cstate == 0) { - hidden++; - } - } - - if (sstate.state == 1) { - return; - } - - List items = sstate.items; - for (ItemStack item : items) { - if (interrupted()) { - return; - } - if (isHidden(item)) { - hidden++; - } - } - - if (hidden == tag.sorted.size() + items.size()) { - sstate.state = 0; - } else if (hidden > 0) { - sstate.state = 1; - } - } - } - - private long lastclicktime; - - public SubsetWidget() { - super("NEI Subsets"); - API.addItemFilter(this); - API.addSearchProvider(this); - ItemList.loadCallbacks.add(this); - } - - @Override - public void draw(int mx, int my) { - super.draw(mx, my); - - area.set(x, y + h, w, LayoutManager.searchField.y - h - y); //23 for the search box - - hoverStack = null; - if (root.isVisible()) { - root.resize(area.x, 0, area.y); - root.cacheState(); - root.draw(mx, my); - } - } - - @Override - public void update() { - Point mouse = GuiDraw.getMousePosition(); - updateVisiblity(mouse.x, mouse.y); - saveHidden(); - } - - private void updateVisiblity(int mx, int my) { - if (!root.isVisible() || root.isScrolling()) { - return; - } - - root.updateVisiblity(mx, my); - - if (!root.isVisible() && bounds().contains(mx, my)) { - root.setVisible(); - } - } - - @Override - public boolean contains(int px, int py) { - return super.contains(px, py) || root.isVisible() && root.contains(px, py); - } - - @Override - public boolean handleClick(int mx, int my, int button) { - if (root.isVisible() && root.contains(mx, my)) { - root.mouseClicked(mx, my, button); - return true; - } - - if (button == 0) { - if (System.currentTimeMillis() - lastclicktime < 500) { - unhideAll(); - } else { - root.setVisible(); - } - - NEIClientUtils.playClickSound(); - lastclicktime = System.currentTimeMillis(); - } - - return true; - } - - /** - * Not called - */ - @Override - public boolean onButtonPress(boolean rightclick) { - return false; - } - - @Override - public void mouseDragged(int mx, int my, int button, long heldTime) { - if (root.isVisible()) { - root.mouseDragged(mx, my, button, heldTime); - } - } - - @Override - public void mouseUp(int mx, int my, int button) { - if (root.isVisible()) { - root.mouseUp(mx, my, button); - } - } - - @Override - public boolean onMouseWheel(int i, int mx, int my) { - return root.isVisible() && root.mouseScrolled(mx, my, -i); - } - - @Override - public void onGuiClick(int mx, int my) { - if (!contains(mx, my)) { - root.setHidden(); - } - } - - @Override - public ItemStack getStackMouseOver(int mx, int my) { - return hoverStack; - } - - @Override - public IItemFilter getFilter() { - return new IItemFilter()//synchronise access on hiddenItems - { - @Override - public boolean matches(ItemStack item) { - synchronized (hiddenItems) { - return !hiddenItems.matches(item); - } - } - }; - } - - @Override - public boolean isPrimary() { - return true; - } - - @Override - public IItemFilter getFilter(String searchText) { - if (!searchText.startsWith("@")) { - return null; - } - - searchText = searchText.substring(1); - AnyMultiItemFilter filter = new AnyMultiItemFilter(); - SubsetTag tag = getTag(searchText); - if (tag != null) { - tag.addFilters(filter.filters); - } else { - Pattern p = SearchField.getPattern(searchText); - if (p == null) { - return null; - } - - List matching = new LinkedList(); - root.search(matching, p); - if (matching.isEmpty()) { - return null; - } - for (SubsetTag tag2 : matching) { - tag2.addFilters(filter.filters); - } - } - return filter; - } - - @Override - public void itemsLoaded() { - updateState.reallocate(); - } -} diff --git a/dependencies/main/java/codechicken/nei/TextField.java b/dependencies/main/java/codechicken/nei/TextField.java deleted file mode 100644 index d035317006..0000000000 --- a/dependencies/main/java/codechicken/nei/TextField.java +++ /dev/null @@ -1,159 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.widget.Widget; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.util.ChatAllowedCharacters; -import org.lwjgl.input.Keyboard; - -import static codechicken.lib.gui.GuiDraw.*; - -public abstract class TextField extends Widget { - public TextField(String ident) { - identifier = ident; - } - - private String text = ""; - public boolean centered; - public long backdowntime; - public int backs; - public String identifier; - public int cursorCounter; - - public int getTextColour() { - return focused() ? 0xFFE0E0E0 : 0xFF909090; - } - - public void drawBox() { - drawRect(x, y, w, h, 0xffA0A0A0); - drawRect(x + 1, y + 1, w - 2, h - 2, 0xFF000000); - } - - @Override - public void draw(int mousex, int mousey) { - drawBox(); - - String drawtext = text; - - int textWidth; - while ((textWidth = getStringWidth(drawtext)) > w - 14) { - drawtext = drawtext.substring(1); - } - - if (focused() && (cursorCounter / 6) % 2 == 0) { - drawtext = drawtext + '_'; - } - - int textx = centered ? x + (w - textWidth) / 2 : x + 4; - int texty = y + (h + 1) / 2 - 3; - - drawString(drawtext, textx, texty, getTextColour()); - } - - @Override - public void onGuiClick(int mousex, int mousey) { - if (!contains(mousex, mousey)) { - setFocus(false); - } - } - - @Override - public boolean handleClick(int mousex, int mousey, int button) { - if (button == 1) { - setText(""); - } - setFocus(true); - return true; - } - - @Override - public boolean handleKeyPress(int keyID, char keyChar) { - if (!focused()) { - return false; - } - - if (keyID == Keyboard.KEY_BACK) { - if (text.length() > 0) { - setText(text.substring(0, text.length() - 1)); - backdowntime = System.currentTimeMillis(); - } - } else if (keyID == Keyboard.KEY_RETURN || keyID == Keyboard.KEY_ESCAPE) { - setFocus(false); - onExit(); - } else if (keyChar == 22)//paste - { - String pastestring = GuiScreen.getClipboardString(); - if (pastestring == null) { - pastestring = ""; - } - - if (isValid(text + pastestring)) { - setText(text + pastestring); - } - } else if (isValid(text + keyChar)) { - setText(text + keyChar); - } - - return true; - } - - public void onExit() { - } - - public abstract void onTextChange(String oldText); - - public boolean isValid(String string) { - // Solve the problem that Minecraft can't post Chinese characters - return ChatAllowedCharacters.isAllowedCharacter(string.charAt(string.length() - 1)); - } - - @Override - public void update() { - cursorCounter++; - if (backdowntime > 0) { - if (Keyboard.isKeyDown(Keyboard.KEY_BACK) && text.length() > 0) { - if (System.currentTimeMillis() - backdowntime > 200 / (1 + backs * 0.3F)) { - setText(text.substring(0, text.length() - 1)); - backdowntime = System.currentTimeMillis(); - backs++; - } - } else { - backdowntime = 0; - backs = 0; - } - } - } - - public void setText(String s) { - String oldText = text; - text = filterText(s); - onTextChange(oldText); - } - - public void setText(String s, boolean updateJEI) { - if (updateJEI) { - setText(s); - } else { - text = filterText(s); - } - } - - public String filterText(String s) { - return s; - } - - public void setFocus(boolean focus) { - if (focus) { - LayoutManager.setInputFocused(this); - } else if (focused()) { - LayoutManager.setInputFocused(null); - } - } - - public boolean focused() { - return LayoutManager.getInputFocused() == this; - } - - public String text() { - return text; - } -} diff --git a/dependencies/main/java/codechicken/nei/VisibilityData.java b/dependencies/main/java/codechicken/nei/VisibilityData.java deleted file mode 100644 index 43da0020e6..0000000000 --- a/dependencies/main/java/codechicken/nei/VisibilityData.java +++ /dev/null @@ -1,44 +0,0 @@ -package codechicken.nei; - -public class VisibilityData { - public boolean showUtilityButtons = true; - public boolean showStateButtons = true; - /** - * Item panel and associated buttons - */ - public boolean showItemPanel = true; - /** - * Item and search section - */ - @Deprecated - public boolean showItemSection = true; - /** - * Dropdown and Item search field - */ - public boolean showSearchSection = true; - /** - * All widgets except options button - */ - public boolean showWidgets = true; - /** - * The entire NEI interface, aka hidden - */ - public boolean showNEI = true; - public boolean enableDeleteMode = true; - - public void translateDependancies() { - if (!showNEI) { - showWidgets = false; - } - if (!showWidgets) { - showSearchSection = showItemPanel = showUtilityButtons = showStateButtons = false; - } -// JEIIntegrationManager.pushChanges(this); - - //if (!showItemSection){ - // showSearchSection = showItemPanel = false; - //} else { - // showSearchSection = showItemPanel = true; - //} - } -} diff --git a/dependencies/main/java/codechicken/nei/WidgetZOrder.java b/dependencies/main/java/codechicken/nei/WidgetZOrder.java deleted file mode 100644 index 3631a6724b..0000000000 --- a/dependencies/main/java/codechicken/nei/WidgetZOrder.java +++ /dev/null @@ -1,17 +0,0 @@ -package codechicken.nei; - -import codechicken.nei.widget.Widget; - -import java.util.Comparator; - -public class WidgetZOrder implements Comparator { - boolean topFirst; - - public WidgetZOrder(boolean topFirst) { - this.topFirst = topFirst; - } - - public int compare(Widget w1, Widget w2) { - return w1.z != w2.z ? ((topFirst ? w1.z > w2.z : w1.z < w2.z) ? 1 : -1) : 1; - } -} diff --git a/dependencies/main/java/codechicken/nei/WorldOverlayRenderer.java b/dependencies/main/java/codechicken/nei/WorldOverlayRenderer.java deleted file mode 100644 index 2def5ce147..0000000000 --- a/dependencies/main/java/codechicken/nei/WorldOverlayRenderer.java +++ /dev/null @@ -1,233 +0,0 @@ -package codechicken.nei; - -import codechicken.lib.math.MathHelper; -import codechicken.lib.render.RenderUtils; -import codechicken.lib.render.state.GlStateManagerHelper; -import codechicken.lib.vec.Cuboid6; -import codechicken.nei.KeyManager.IKeyStateTracker; -import codechicken.nei.config.KeyBindings; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving.SpawnPlacementType; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import net.minecraft.world.WorldEntitySpawner; -import net.minecraft.world.biome.Biome; -import net.minecraft.world.chunk.Chunk; - -import static org.lwjgl.opengl.GL11.*; - -public class WorldOverlayRenderer implements IKeyStateTracker { - public static int mobOverlay = 0; - public static int chunkOverlay = 0; - - public static void reset() { - mobOverlay = 0; - chunkOverlay = 0; - } - - @Override - public void tickKeyStates() { - if (Minecraft.getMinecraft().currentScreen != null) { - return; - } - - if (KeyBindings.get("nei.options.keys.world.moboverlay").isPressed()) { - mobOverlay = (mobOverlay + 1) % 2; - } - if (KeyBindings.get("nei.options.keys.world.chunkoverlay").isPressed()) { - chunkOverlay = (chunkOverlay + 1) % 3; - } - } - - public static void render(float frame) { - GlStateManager.pushMatrix(); - GlStateManagerHelper.pushState(); - Entity entity = Minecraft.getMinecraft().getRenderViewEntity(); - RenderUtils.translateToWorldCoords(entity, frame); - - renderChunkBounds(entity); - renderMobSpawnOverlay(entity); - GlStateManagerHelper.popState(); - GlStateManager.popMatrix(); - } - - //TODO Improve the performance of this. - private static void renderMobSpawnOverlay(Entity entity) { - if (mobOverlay == 0) { - return; - } - - GlStateManager.disableTexture2D(); - GlStateManager.disableLighting(); - glLineWidth(1.5F); - glBegin(GL_LINES); - - GlStateManager.color(1, 0, 0); - - World world = entity.worldObj; - int x1 = (int) entity.posX; - int z1 = (int) entity.posZ; - int y1 = (int) MathHelper.clip(entity.posY, 16, world.getHeight() - 16); - - for (int x = x1 - 16; x <= x1 + 16; x++) { - for (int z = z1 - 16; z <= z1 + 16; z++) { - BlockPos pos = new BlockPos(x, y1, z); - Chunk chunk = world.getChunkFromBlockCoords(pos); - Biome biome = world.getBiome(pos); - if (biome.getSpawnableList(EnumCreatureType.MONSTER).isEmpty() || biome.getSpawningChance() <= 0) { - continue; - } - - for (int y = y1 - 16; y < y1 + 16; y++) { - int spawnMode = getSpawnMode(chunk, x, y, z); - if (spawnMode == 0) { - continue; - } - - if (spawnMode == 1) { - GlStateManager.color(1, 1, 0); - } else { - GlStateManager.color(1, 0, 0); - } - - glVertex3d(x, y + 0.004, z); - glVertex3d(x + 1, y + 0.004, z + 1); - glVertex3d(x + 1, y + 0.004, z); - glVertex3d(x, y + 0.004, z + 1); - } - } - } - - glEnd(); - GlStateManager.enableLighting(); - GlStateManager.enableTexture2D(); - } - - //private static Entity dummyEntity = new EntityPig(null); - private static Cuboid6 c = new Cuboid6(); - - private static int getSpawnMode(Chunk chunk, int x, int y, int z) { - World world = chunk.getWorld(); - BlockPos pos = new BlockPos(x, y, z); - if (!WorldEntitySpawner.canCreatureTypeSpawnAtLocation(SpawnPlacementType.ON_GROUND, world, pos) || chunk.getLightFor(EnumSkyBlock.BLOCK, pos) >= 8) { - return 0; - } - - c.set(x + 0.2, y + 0.01, z + 0.2, x + 0.8, y + 1.8, z + 0.8); - AxisAlignedBB aabb = c.aabb(); - if (!world.checkNoEntityCollision(aabb) || !world.getEntitiesWithinAABBExcludingEntity(null, aabb).isEmpty() || world.containsAnyLiquid(aabb)) { - return 0; - } - - if (chunk.getLightFor(EnumSkyBlock.SKY, pos) >= 8) { - return 1; - } - return 2; - } - - private static void renderChunkBounds(Entity entity) { - if (chunkOverlay == 0) { - return; - } - - GlStateManager.disableTexture2D(); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - GlStateManager.disableLighting(); - glLineWidth(1.5F); - glBegin(GL_LINES); - - for (int cx = -4; cx <= 4; cx++) { - for (int cz = -4; cz <= 4; cz++) { - double x1 = (entity.chunkCoordX + cx) << 4; - double z1 = (entity.chunkCoordZ + cz) << 4; - double x2 = x1 + 16; - double z2 = z1 + 16; - - double dy = 128; - double y1 = Math.floor(entity.posY - dy / 2); - double y2 = y1 + dy; - if (y1 < 0) { - y1 = 0; - y2 = dy; - } - - if (y1 > entity.worldObj.getHeight()) { - y2 = entity.worldObj.getHeight(); - y1 = y2 - dy; - } - - double dist = Math.pow(1.5, -(cx * cx + cz * cz)); - - GlStateManager.color(0.9F, 0, 0, (float) dist); - if (cx >= 0 && cz >= 0) { - glVertex3d(x2, y1, z2); - glVertex3d(x2, y2, z2); - } - if (cx >= 0 && cz <= 0) { - glVertex3d(x2, y1, z1); - glVertex3d(x2, y2, z1); - } - if (cx <= 0 && cz >= 0) { - glVertex3d(x1, y1, z2); - glVertex3d(x1, y2, z2); - } - if (cx <= 0 && cz <= 0) { - glVertex3d(x1, y1, z1); - glVertex3d(x1, y2, z1); - } - - if (chunkOverlay == 2 && cx == 0 && cz == 0) { - dy = 32; - y1 = Math.floor(entity.posY - dy / 2); - y2 = y1 + dy; - if (y1 < 0) { - y1 = 0; - y2 = dy; - } - - if (y1 > entity.worldObj.getHeight()) { - y2 = entity.worldObj.getHeight(); - y1 = y2 - dy; - } - - GlStateManager.color(0, 0.9F, 0, 0.4F); - for (double y = (int) y1; y <= y2; y++) { - glVertex3d(x2, y, z1); - glVertex3d(x2, y, z2); - glVertex3d(x1, y, z1); - glVertex3d(x1, y, z2); - glVertex3d(x1, y, z2); - glVertex3d(x2, y, z2); - glVertex3d(x1, y, z1); - glVertex3d(x2, y, z1); - } - for (double h = 1; h <= 15; h++) { - glVertex3d(x1 + h, y1, z1); - glVertex3d(x1 + h, y2, z1); - glVertex3d(x1 + h, y1, z2); - glVertex3d(x1 + h, y2, z2); - glVertex3d(x1, y1, z1 + h); - glVertex3d(x1, y2, z1 + h); - glVertex3d(x2, y1, z1 + h); - glVertex3d(x2, y2, z1 + h); - } - } - } - } - - glEnd(); - GlStateManager.enableLighting(); - GlStateManager.disableBlend(); - GlStateManager.enableTexture2D(); - } - - public static void load() { - KeyManager.trackers.add(new WorldOverlayRenderer()); - } -} diff --git a/dependencies/main/java/codechicken/nei/api/API.java b/dependencies/main/java/codechicken/nei/api/API.java deleted file mode 100644 index 3f13601f0d..0000000000 --- a/dependencies/main/java/codechicken/nei/api/API.java +++ /dev/null @@ -1,295 +0,0 @@ -package codechicken.nei.api; - -import codechicken.lib.item.filtering.IItemFilter; -import codechicken.lib.item.filtering.IItemFilterProvider; -import codechicken.nei.*; -import codechicken.nei.SearchField.ISearchProvider; -import codechicken.nei.SubsetWidget.SubsetTag; -import codechicken.nei.api.layout.LayoutStyle; -import codechicken.nei.config.KeyBindings; -import codechicken.nei.config.Option; -import codechicken.nei.recipe.*; -import net.minecraft.block.Block; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.settings.KeyBinding; -import net.minecraft.inventory.Slot; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.settings.IKeyConflictContext; -import net.minecraftforge.client.settings.KeyModifier; -import net.minecraftforge.fml.client.registry.ClientRegistry; -import org.lwjgl.input.Keyboard; - -import java.util.Collections; -import java.util.Comparator; - -/** - * This is the main class that handles item property configuration. - * WARNING: DO NOT access this class until the world has been loaded - * These methods should be called from INEIConfig implementors - */ -public class API { - /** - * Register a new Crafting Recipe handler; - * - * @param handler The handler to register - */ - public static void registerRecipeHandler(ICraftingHandler handler) { - GuiCraftingRecipe.registerRecipeHandler(handler); - } - - /** - * Register a new Usage Recipe handler; - * - * @param handler The handler to register - */ - public static void registerUsageHandler(IUsageHandler handler) { - GuiUsageRecipe.registerUsageHandler(handler); - } - - /** - * Add a gui to the default overlay renderer with the default position - * - * @param classz The class of your gui - * @param ident The identification string, currently - * {crafting, crafting2x2, smelting, fuel, brewing} - */ - public static void registerGuiOverlay(Class classz, String ident) { - registerGuiOverlay(classz, ident, 5, 11); - } - - /** - * Add a gui to the default overlay renderer with an offset - * - * @param classz The class of your gui - * @param ident The identification string, currently - * {crafting, crafting2x2, smelting, fuel, brewing} - * @param x x-offset - * @param y y-offset - */ - public static void registerGuiOverlay(Class classz, String ident, int x, int y) { - registerGuiOverlay(classz, ident, new OffsetPositioner(x, y)); - } - - /** - * Add a gui to the default overlay renderer - * - * @param classz The class of your gui - * @param ident The identification string, currently - * {crafting, crafting2x2, smelting, fuel, brewing} - * @param positioner A Stack Repositioner for moving the items to the right place - */ - public static void registerGuiOverlay(Class classz, String ident, IStackPositioner positioner) { - RecipeInfo.registerGuiOverlay(classz, ident, positioner); - } - - /** - * @param classz The class of your gui - * @param handler The handler to register - * @param ident The recipe identification string - */ - public static void registerGuiOverlayHandler(Class classz, IOverlayHandler handler, String ident) { - RecipeInfo.registerOverlayHandler(classz, handler, ident); - } - - /** - * Set the offset to be added to items to translate them into recipe coords on the actual gui, default is 5, 11. Primarily RecipeTransferRects - * - * @param classz The class of your gui - * @param x - * @param y - */ - public static void setGuiOffset(Class classz, int x, int y) { - RecipeInfo.setGuiOffset(classz, x, y); - } - - public static void registerNEIGuiHandler(INEIGuiHandler handler) { - GuiInfo.guiHandlers.add(handler); - } - - /** - * Hide an item from the item panel - * Damage values of OreDictionary.WILDCARD_VALUE and ItemStackMap.WILDCARD_TAG tags function as wildcards for their respective variables - */ - public static void hideItem(ItemStack item) { - ItemInfo.hiddenItems.add(item); - } - - /** - * Add or replace the name normally shown on the item tooltip - */ - public static void setOverrideName(ItemStack item, String name) { - ItemInfo.nameOverrides.put(item, name); - } - - /** - * Adds an item to the item panel. Any items added using this function will override the default search pattern. - * - * @param item an item with data - */ - public static void addItemListEntry(ItemStack item) { - ItemInfo.itemOverrides.put(item.getItem(), item); - } - - /** - * Sets the item variants to appear in the item panel, overriding the default search pattern for a given item - */ - public static void setItemListEntries(Item item, Iterable items) { - if (items == null) { - items = Collections.emptyList(); - } - ItemInfo.itemOverrides.replaceValues(item, items); - } - - /** - * Add a custom KeyBinding to be configured in the Controls menu. - * - * @param ident An identifier for your key, eg "shoot" - * @param defaultKey The default value, commonly obtained from {@link Keyboard} - * @deprecated use {@link ClientRegistry#registerKeyBinding(KeyBinding)} - */ - @Deprecated - public static void addKeyBind(String ident, int defaultKey) { - KeyBindings.setDefaultKeyBinding(ident, defaultKey); - } - - public static void addOption(Option option) { - NEIClientConfig.getOptionList().addOption(option); - } - - /** - * Add a new Layout Style for the NEI interface - * - * @param styleID The Unique ID to be used for storing your style in the config and cycling through avaliable styles - * @param style The style to add. - */ - public static void addLayoutStyle(int styleID, LayoutStyle style) { - LayoutManager.layoutStyles.put(styleID, style); - } - - /** - * Registers a new Infinite Item Handler. - * - * @param handler The handler to be registered. - */ - public static void addInfiniteItemHandler(IInfiniteItemHandler handler) { - ItemInfo.infiniteHandlers.addFirst(handler); - } - - /** - * Registers a new Infinite Item Handler. - * - * @param block The block to handle, null for all. - * @param handler The handler to be registered. - */ - @Deprecated - public static void registerHighlightIdentifier(Block block, IHighlightHandler handler) { - ItemInfo.highlightIdentifiers.put(block, handler); - } - - /** - * Tells NEI not to perform any Fast Transfer operations on slots of a particular class - * - * @param slotClass The class of slot to be exempted - */ - public static void addFastTransferExemptSlot(Class slotClass) { - ItemInfo.fastTransferExemptions.add(slotClass); - } - - /** - * Tells NEI not to perform any Fast Transfer operations on a GuiContainer of a specific class. - * - * @param guiClass The class of the container to be exempted - */ - public static void addFastTransferExemptContainer(Class guiClass) { - ItemInfo.fastTransferContainerExemptions.add(guiClass); - } - - /** - * Register a new text handler for the block highlight tooltip with a layout specification (HEADER, BODY or FOOTER). - * - * @param handler The handler to be registered. - * @param layout A HUDAugmenterRegistry.Layout entry. HEADER is displayed before BODY which is displayed before FOOTER. - */ - @Deprecated - public static void registerHighlightHandler(IHighlightHandler handler, ItemInfo.Layout... layout) { - ItemInfo.registerHighlightHandler(handler, layout); - } - - /** - * Register a mode handler for overriding NEI recipe/utility/cheat mode settings. - * - * @param handler The handler to be registered. - */ - public static void registerModeHandler(INEIModeHandler handler) { - NEIInfo.modeHandlers.add(handler); - } - - /** - * Register a filter provider for the item panel. - * - * @param filterProvider The filter provider to be registered. - */ - public static void addItemFilter(IItemFilterProvider filterProvider) { - synchronized (ItemList.itemFilterers) { - ItemList.itemFilterers.add(filterProvider); - } - } - - /** - * Adds a new tag to the item subset dropdown. - * - * @param name The fully qualified name, Eg Blocks.MobSpawners. NOT case sensitive - * @param filter A filter for matching items that fit in this subset - */ - public static void addSubset(String name, IItemFilter filter) { - addSubset(new SubsetTag(name, filter)); - } - - /** - * Adds a new tag to the item subset dropdown. - * - * @param name The fully qualified name, Eg Blocks.MobSpawners. NOT case sensitive - * @param items An iterable of itemstacks to be added as a subset - */ - public static void addSubset(String name, Iterable items) { - ItemStackSet filter = new ItemStackSet(); - for (ItemStack item : items) { - filter.add(item); - } - addSubset(new SubsetTag(name, filter)); - } - - /** - * Adds a new tag to the item subset dropdown. - */ - public static void addSubset(SubsetTag tag) { - SubsetWidget.addTag(tag); - } - - /** - * Adds a new search provider to the search field - */ - public static void addSearchProvider(ISearchProvider provider) { - SearchField.searchProviders.add(provider); - } - - /** - * Adds a new sorting option to the item panel sort menu - * - * @param name A unique id for this sort option. Will be used in the config for saving and translated in the options gui. Note that if the translation key name.tip exists, it will be used for a tooltip - */ - public static void addSortOption(String name, Comparator comparator) { - ItemSorter.add(name, comparator); - } - - /** - * Adds an additional item list entry for an item, sorted after the rest of the items are found through the normal process - * - * @param item The item to add the variant for - * @param variant The stack to appear in the item panel - */ - public static void addItemVariant(Item item, ItemStack variant) { - ItemInfo.itemVariants.put(item, variant); - } -} diff --git a/dependencies/main/java/codechicken/nei/api/DefaultOverlayRenderer.java b/dependencies/main/java/codechicken/nei/api/DefaultOverlayRenderer.java deleted file mode 100644 index fb37cad9c8..0000000000 --- a/dependencies/main/java/codechicken/nei/api/DefaultOverlayRenderer.java +++ /dev/null @@ -1,41 +0,0 @@ -package codechicken.nei.api; - -import codechicken.nei.api.stack.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.inventory.Slot; -import org.lwjgl.opengl.GL11; - -import java.util.ArrayList; -import java.util.List; - -public class DefaultOverlayRenderer implements IRecipeOverlayRenderer { - IStackPositioner positioner; - ArrayList ingreds; - - public DefaultOverlayRenderer(List ai, IStackPositioner positioner) { - positioner = this.positioner = positioner; - ingreds = new ArrayList(); - for (PositionedStack stack : ai) { - ingreds.add(stack.copy()); - } - ingreds = positioner.positionStacks(ingreds); - } - - @Override - public void renderOverlay(GuiContainerManager gui, Slot slot) { - GlStateManager.enableBlend(); - GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - - GuiContainerManager.setItemRenderColour(0xA0A0A0B0); - for (PositionedStack stack : ingreds) { - if (stack.relx == slot.xDisplayPosition && stack.rely == slot.yDisplayPosition) { - GuiContainerManager.drawItem(stack.relx, stack.rely, stack.item); - } - } - GuiContainerManager.setItemRenderColour(-1); - - GlStateManager.disableBlend(); - GlStateManager.enableLighting(); - } -} diff --git a/dependencies/main/java/codechicken/nei/api/GuiInfo.java b/dependencies/main/java/codechicken/nei/api/GuiInfo.java deleted file mode 100644 index b0b5ca1f8f..0000000000 --- a/dependencies/main/java/codechicken/nei/api/GuiInfo.java +++ /dev/null @@ -1,35 +0,0 @@ -package codechicken.nei.api; - -import codechicken.nei.NEIChestGuiHandler; -import codechicken.nei.NEICreativeGuiHandler; -import codechicken.nei.NEIDummySlotHandler; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.gui.inventory.GuiContainerCreative; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; - -public class GuiInfo { - public static LinkedList guiHandlers = new LinkedList(); - public static HashSet> customSlotGuis = new HashSet>(); - - public static void load() { - API.registerNEIGuiHandler(new NEICreativeGuiHandler()); - API.registerNEIGuiHandler(new NEIChestGuiHandler()); - API.registerNEIGuiHandler(new NEIDummySlotHandler()); - customSlotGuis.add(GuiContainerCreative.class); - } - - public static void clearGuiHandlers() { - for (Iterator iterator = guiHandlers.iterator(); iterator.hasNext(); ) { - if (iterator.next() instanceof GuiContainer) { - iterator.remove(); - } - } - } - - public static boolean hasCustomSlots(GuiContainer gui) { - return customSlotGuis.contains(gui.getClass()); - } -} diff --git a/dependencies/main/java/codechicken/nei/api/IConfigureNEI.java b/dependencies/main/java/codechicken/nei/api/IConfigureNEI.java deleted file mode 100644 index 604ba82eab..0000000000 --- a/dependencies/main/java/codechicken/nei/api/IConfigureNEI.java +++ /dev/null @@ -1,13 +0,0 @@ -package codechicken.nei.api; - -/** - * An nei configuration entry point should implement this class and have name "NEIConfig" - * loadConfig will only be called when NEI is installed. - */ -public interface IConfigureNEI { - void loadConfig(); - - String getName(); - - String getVersion(); -} diff --git a/dependencies/main/java/codechicken/nei/api/IGuiContainerOverlay.java b/dependencies/main/java/codechicken/nei/api/IGuiContainerOverlay.java deleted file mode 100644 index 6d5a5a6efc..0000000000 --- a/dependencies/main/java/codechicken/nei/api/IGuiContainerOverlay.java +++ /dev/null @@ -1,7 +0,0 @@ -package codechicken.nei.api; - -import net.minecraft.client.gui.inventory.GuiContainer; - -public interface IGuiContainerOverlay { - GuiContainer getFirstScreen(); -} diff --git a/dependencies/main/java/codechicken/nei/api/IHighlightHandler.java b/dependencies/main/java/codechicken/nei/api/IHighlightHandler.java deleted file mode 100644 index d47476e5b2..0000000000 --- a/dependencies/main/java/codechicken/nei/api/IHighlightHandler.java +++ /dev/null @@ -1,15 +0,0 @@ -package codechicken.nei.api; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.world.World; - -import java.util.List; - -@Deprecated -public interface IHighlightHandler { - ItemStack identifyHighlight(World world, EntityPlayer player, RayTraceResult rayTraceResult); - - List handleTextData(ItemStack itemStack, World world, EntityPlayer player, RayTraceResult rayTraceResult, List currentTip, ItemInfo.Layout layout); -} diff --git a/dependencies/main/java/codechicken/nei/api/IInfiniteItemHandler.java b/dependencies/main/java/codechicken/nei/api/IInfiniteItemHandler.java deleted file mode 100644 index a130a25afa..0000000000 --- a/dependencies/main/java/codechicken/nei/api/IInfiniteItemHandler.java +++ /dev/null @@ -1,18 +0,0 @@ -package codechicken.nei.api; - -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; - -public interface IInfiniteItemHandler { - void onPickup(ItemStack heldItem); - - void onPlaceInfinite(ItemStack heldItem); - - boolean canHandleItem(ItemStack stack); - - boolean isItemInfinite(ItemStack stack); - - void replenishInfiniteStack(InventoryPlayer inventory, int slotNo); - - ItemStack getInfiniteItem(ItemStack typeStack); -} diff --git a/dependencies/main/java/codechicken/nei/api/INEIGuiAdapter.java b/dependencies/main/java/codechicken/nei/api/INEIGuiAdapter.java deleted file mode 100644 index 2bf4aed79b..0000000000 --- a/dependencies/main/java/codechicken/nei/api/INEIGuiAdapter.java +++ /dev/null @@ -1,38 +0,0 @@ -package codechicken.nei.api; - -import codechicken.nei.VisibilityData; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; - -import java.util.Collections; -import java.util.List; - -/** - * Lets you just override those things you want to - */ -public class INEIGuiAdapter implements INEIGuiHandler { - @Override - public VisibilityData modifyVisiblity(GuiContainer gui, VisibilityData currentVisibility) { - return currentVisibility; - } - - @Override - public Iterable getItemSpawnSlots(GuiContainer gui, ItemStack item) { - return Collections.emptyList(); - } - - @Override - public List getInventoryAreas(GuiContainer gui) { - return null; - } - - @Override - public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button) { - return false; - } - - @Override - public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) { - return false; - } -} diff --git a/dependencies/main/java/codechicken/nei/api/INEIGuiHandler.java b/dependencies/main/java/codechicken/nei/api/INEIGuiHandler.java deleted file mode 100644 index ac8af74aa9..0000000000 --- a/dependencies/main/java/codechicken/nei/api/INEIGuiHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -package codechicken.nei.api; - -import codechicken.nei.VisibilityData; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; - -import java.util.List; - -/** - * If this is implemented on a gui, it will be automatically registered - */ -public interface INEIGuiHandler { - VisibilityData modifyVisiblity(GuiContainer gui, VisibilityData currentVisibility); - - /** - * NEI will give the specified item to the InventoryRange returned if the player's inventory is full. - * Should not return null, just an empty list - */ - Iterable getItemSpawnSlots(GuiContainer gui, ItemStack item); - - /** - * @return A list of TaggedInventoryAreas that will be used with the savestates. - */ - List getInventoryAreas(GuiContainer gui); - - /** - * Handles clicks while an itemstack has been dragged from the item panel. Use this to set configurable slots and the like. - * Changes made to the stackSize of the dragged stack will be kept - * - * @param gui The current gui instance - * @param mousex The x position of the mouse - * @param mousey The y position of the mouse - * @param draggedStack The stack being dragged from the item panel - * @param button The button presed - * @return True if the drag n drop was handled. False to resume processing through other routes. The held stack will be deleted if draggedStack.stackSize == 0 - */ - boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button); - - /** - * Used to prevent the item panel from drawing on top of other gui elements. - * This function will also be called with a 1x1 size rectangle on the mouse position for determining if the given coordinate should override item panel functions such as scrolling - * - * @param x The x coordinate of the rectangle bounding the slot - * @param y The y coordinate of the rectangle bounding the slot - * @param w The w coordinate of the rectangle bounding the slot - * @param h The h coordinate of the rectangle bounding the slot - * @return true if the item panel slot within the specified rectangle should not be rendered. - */ - boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h); -} diff --git a/dependencies/main/java/codechicken/nei/api/INEIModeHandler.java b/dependencies/main/java/codechicken/nei/api/INEIModeHandler.java deleted file mode 100644 index 80355dba14..0000000000 --- a/dependencies/main/java/codechicken/nei/api/INEIModeHandler.java +++ /dev/null @@ -1,5 +0,0 @@ -package codechicken.nei.api; - -public interface INEIModeHandler { - boolean isModeValid(int mode); -} diff --git a/dependencies/main/java/codechicken/nei/api/IOverlayHandler.java b/dependencies/main/java/codechicken/nei/api/IOverlayHandler.java deleted file mode 100644 index 6bceaef4d3..0000000000 --- a/dependencies/main/java/codechicken/nei/api/IOverlayHandler.java +++ /dev/null @@ -1,8 +0,0 @@ -package codechicken.nei.api; - -import codechicken.nei.recipe.IRecipeHandler; -import net.minecraft.client.gui.inventory.GuiContainer; - -public interface IOverlayHandler { - void overlayRecipe(GuiContainer firstGui, IRecipeHandler recipe, int recipeIndex, boolean shift); -} diff --git a/dependencies/main/java/codechicken/nei/api/IRecipeOverlayRenderer.java b/dependencies/main/java/codechicken/nei/api/IRecipeOverlayRenderer.java deleted file mode 100644 index 431942c02f..0000000000 --- a/dependencies/main/java/codechicken/nei/api/IRecipeOverlayRenderer.java +++ /dev/null @@ -1,8 +0,0 @@ -package codechicken.nei.api; - -import codechicken.nei.guihook.GuiContainerManager; -import net.minecraft.inventory.Slot; - -public interface IRecipeOverlayRenderer { - void renderOverlay(GuiContainerManager gui, Slot slot); -} diff --git a/dependencies/main/java/codechicken/nei/api/IStackPositioner.java b/dependencies/main/java/codechicken/nei/api/IStackPositioner.java deleted file mode 100644 index bb42cce39c..0000000000 --- a/dependencies/main/java/codechicken/nei/api/IStackPositioner.java +++ /dev/null @@ -1,12 +0,0 @@ -package codechicken.nei.api; - -import codechicken.nei.api.stack.PositionedStack; - -import java.util.ArrayList; - -/** - * For repositioning recipes in overlay renderers. - */ -public interface IStackPositioner { - ArrayList positionStacks(ArrayList ai); -} diff --git a/dependencies/main/java/codechicken/nei/api/ItemInfo.java b/dependencies/main/java/codechicken/nei/api/ItemInfo.java deleted file mode 100644 index 0c455af309..0000000000 --- a/dependencies/main/java/codechicken/nei/api/ItemInfo.java +++ /dev/null @@ -1,544 +0,0 @@ -package codechicken.nei.api; - -import codechicken.lib.item.filtering.IItemFilter; -import codechicken.lib.item.filtering.IItemFilterProvider; -import codechicken.nei.*; -import codechicken.nei.ItemList.ItemsLoadedCallback; -import codechicken.nei.config.ItemPanelDumper; -import codechicken.nei.config.dumps.FluidRegistryDumper; -import codechicken.nei.config.dumps.ForgeRegistryDumper; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.recipe.BrewingRecipeHandler; -import codechicken.nei.recipe.RecipeItemInputHandler; -import codechicken.nei.recipe.potion.PotionRecipeHelper; -import codechicken.nei.thirdparty.colossalchests.ColossalChestsConfig; -import codechicken.nei.util.LogHelper; -import com.google.common.collect.ArrayListMultimap; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.resources.I18n; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityList.EntityEggInfo; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.inventory.EntityEquipmentSlot; -import net.minecraft.inventory.Slot; -import net.minecraft.item.*; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.SoundEvent; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.text.TextFormatting; -import net.minecraft.world.World; -import net.minecraft.world.biome.Biome; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.IShearable; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.ModContainer; -import net.minecraftforge.fml.common.registry.ForgeRegistries; -import net.minecraftforge.fml.common.registry.IForgeRegistry; - -import java.util.*; -import java.util.Map.Entry; - -/** - * This is an internal class for storing information about items, to be accessed by the API - */ -public class ItemInfo { - public enum Layout { - HEADER, - BODY, - FOOTER - } - - @Deprecated - public static final ArrayListMultimap highlightHandlers = ArrayListMultimap.create(); - public static final ItemStackMap nameOverrides = new ItemStackMap(); - public static final ItemStackSet hiddenItems = new ItemStackSet(); - public static final ItemStackSet finiteItems = new ItemStackSet(); - public static final ArrayListMultimap itemOverrides = ArrayListMultimap.create(); - public static final ArrayListMultimap itemVariants = ArrayListMultimap.create(); - - public static final LinkedList infiniteHandlers = new LinkedList(); - @Deprecated - public static final ArrayListMultimap highlightIdentifiers = ArrayListMultimap.create(); - public static final HashSet> fastTransferExemptions = new HashSet>(); - public static final HashSet> fastTransferContainerExemptions = new HashSet>(); - - public static final HashMap itemOwners = new HashMap(); - - //lookup optimisation - public static final HashMap itemSearchNames = new HashMap(); - - public static boolean isHidden(ItemStack stack) { - return hiddenItems.contains(stack); - } - - public static boolean isHidden(Item item) { - return hiddenItems.containsAll(item); - } - - public static String getNameOverride(ItemStack stack) { - return nameOverrides.get(stack); - } - - public static boolean canBeInfinite(ItemStack stack) { - return !finiteItems.contains(stack); - } - - /** - * @deprecated Use field directly - */ - @Deprecated - public static List getItemOverrides(Item item) { - return itemOverrides.get(item); - } - - public static void preInit() { - ItemMobSpawner.register(); - } - - public static void init() { - ItemMobSpawner.initRender(); - } - - public static void load(World world) { - ColossalChestsConfig.init(); - PotionRecipeHelper.init(); - addVanillaBlockProperties(); - addDefaultDropDowns(); - searchItems(); - parseModItems(); - ItemMobSpawner.loadSpawners(world); - addSpawnEggs(); - addInfiniteHandlers(); - addInputHandlers(); - addIDDumps(); - addHiddenItemFilter(); - addSearchOptimisation(); - } - - private static void addVanillaBlockProperties() { - API.hideItem(new ItemStack(Blocks.FARMLAND)); - API.hideItem(new ItemStack(Blocks.LIT_FURNACE)); - } - - private static void addSearchOptimisation() { - ItemList.loadCallbacks.add(new ItemsLoadedCallback() { - @Override - public void itemsLoaded() { - itemSearchNames.clear(); - } - }); - } - - private static void addHiddenItemFilter() { - API.addItemFilter(new IItemFilterProvider() { - @Override - public IItemFilter getFilter() { - return new IItemFilter() { - @Override - public boolean matches(ItemStack item) { - return !hiddenItems.contains(item); - } - }; - } - }); - } - - private static void addIDDumps() { - API.addOption(new ForgeRegistryDumper("tools.dump.item") { - @Override - public IForgeRegistry registry() { - return ForgeRegistries.ITEMS; - } - - @Override - public String[] dump(Item obj, ResourceLocation registryName) { - int id = Item.getIdFromItem(obj); - boolean hasBlock = Block.getBlockFromItem(obj) != null && Block.getBlockFromItem(obj) != Blocks.AIR; - return new String[] { registryName.toString(), Integer.toString(id), Boolean.toString(hasBlock), obj.getClass().getCanonicalName() }; - } - - @Override - public String[] header() { - return new String[] { "Registry Name", "ID", "Has Block", "Class" }; - } - }); - API.addOption(new ForgeRegistryDumper("tools.dump.block") { - @Override - public IForgeRegistry registry() { - return ForgeRegistries.BLOCKS; - } - - @Override - public String[] dump(Block obj, ResourceLocation registryName) { - int id = Block.getIdFromBlock(obj); - boolean hasBlock = Item.getItemFromBlock(obj) != null; //&& Block.getBlockFromItem(obj) != Blocks.AIR; - return new String[] { registryName.toString(), Integer.toString(id), Boolean.toString(hasBlock), obj.getClass().getCanonicalName() }; - } - - @Override - public String[] header() { - return new String[] { "Registry Name", "ID", "Has Item", "Class" }; - } - }); - API.addOption(new FluidRegistryDumper()); - API.addOption(new ForgeRegistryDumper("tools.dump.potion") { - @Override - public IForgeRegistry registry() { - return ForgeRegistries.POTIONS; - } - - @Override - public String[] dump(Potion obj, ResourceLocation registryName) { - int id = Potion.getIdFromPotion(obj); - return new String[] { registryName.toString(), Integer.toString(id), Boolean.toString(obj.isBadEffect()), Boolean.toString(obj.isBeneficial()), obj.getClass().getCanonicalName() }; - } - - @Override - public String[] header() { - return new String[] { "Registry Name", "ID", "Is bad Effect", "Is beneficial", "Class" }; - } - }); - API.addOption(new ForgeRegistryDumper("tools.dump.biome") { - @Override - public IForgeRegistry registry() { - return ForgeRegistries.BIOMES; - } - - @Override - public String[] dump(Biome obj, ResourceLocation registryName) { - int id = Biome.getIdForBiome(obj); - - BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(obj); - StringBuilder s_types = new StringBuilder(); - for (BiomeDictionary.Type t : types) { - if (s_types.length() > 0) { - s_types.append(", "); - } - s_types.append(t.name()); - } - return new String[] { registryName.toString(), Integer.toString(id), obj.getBiomeName(), Float.toString(obj.getFloatTemperature(BlockPos.ORIGIN)), Float.toString(obj.getRainfall()), Float.toString(obj.getSpawningChance()), Float.toString(obj.getBaseHeight()), Float.toString(obj.getHeightVariation()), s_types.toString(), obj.getClass().getCanonicalName() }; - } - - @Override - public String[] header() { - return new String[] { "Registry Name", "ID", "Name", "Temperature", "Rainfall", "Spawn Chance", "Root Height", "Height Variation", "Types", "Class" }; - } - }); - API.addOption(new ForgeRegistryDumper("tools.dump.sound_event") { - @Override - public IForgeRegistry registry() { - return ForgeRegistries.SOUND_EVENTS; - } - - @Override - public String[] dump(SoundEvent obj, ResourceLocation registryName) { - int id = SoundEvent.REGISTRY.getIDForObject(obj); - return new String[] { registryName.toString(), Integer.toString(id), obj.getClass().getCanonicalName() }; - } - - @Override - public String[] header() { - return new String[] { "Registry Name", "ID", "Class" }; - } - }); - API.addOption(new ForgeRegistryDumper("tools.dump.enchantment") { - @Override - public IForgeRegistry registry() { - return null; - } - - @Override - public String[] dump(Enchantment obj, ResourceLocation registryName) { - int id = Enchantment.getEnchantmentID(obj); - StringBuilder s_slots = new StringBuilder(); - for (EntityEquipmentSlot slot : obj.applicableEquipmentTypes) { - if (s_slots.length() > 0) { - s_slots.append(", "); - } - s_slots.append(slot.getName()); - } - return new String[] { registryName.toString(), Integer.toString(id), obj.getName(), obj.type.toString(), Integer.toString(obj.getMinLevel()), Integer.toString(obj.getMinLevel()), obj.getRarity().name(), s_slots.toString(), obj.getClass().getCanonicalName() }; - } - - @Override - public String[] header() { - return new String[] { "Registry Name", "ID", "Name", "Type", "Min Level", "Max Level", "Rarity", "Slots", "Class" }; - } - }); - API.addOption(new ItemPanelDumper("tools.dump.itempanel")); - } - - private static void parseModItems() { - HashMap modSubsets = new HashMap(); - for (Item item : Item.REGISTRY) { - ResourceLocation ident = Item.REGISTRY.getNameForObject(item); - if (ident == null) { - LogHelper.error("Failed to find identifier for: " + item); - continue; - } - String modId = ident.getResourceDomain(); - itemOwners.put(item, modId); - ItemStackSet itemset = modSubsets.get(modId); - if (itemset == null) { - modSubsets.put(modId, itemset = new ItemStackSet()); - } - itemset.with(item); - } - - API.addSubset("Mod.Minecraft", modSubsets.remove("minecraft")); - for (Entry entry : modSubsets.entrySet()) { - ModContainer mc = FMLCommonHandler.instance().findContainerFor(entry.getKey()); - if (mc == null) { - LogHelper.error("Missing container for " + entry.getKey()); - } else { - API.addSubset("Mod." + mc.getName(), entry.getValue()); - } - } - } - - private static void addInputHandlers() { - GuiContainerManager.addInputHandler(new RecipeItemInputHandler()); - GuiContainerManager.addInputHandler(new PopupInputHandler()); - } - - private static void addInfiniteHandlers() { - API.addInfiniteItemHandler(new InfiniteStackSizeHandler()); - API.addInfiniteItemHandler(new InfiniteToolHandler()); - } - - private static void addDefaultDropDowns() { - API.addSubset("Items", new IItemFilter() { - @Override - public boolean matches(ItemStack item) { - return Block.getBlockFromItem(item.getItem()) == Blocks.AIR; - } - }); - API.addSubset("Blocks", new IItemFilter() { - @Override - public boolean matches(ItemStack item) { - return Block.getBlockFromItem(item.getItem()) != Blocks.AIR; - } - }); - API.addSubset("Blocks.MobSpawners", ItemStackSet.of(Blocks.MOB_SPAWNER)); - } - - private static void searchItems() { - ItemStackSet tools = new ItemStackSet(); - ItemStackSet picks = new ItemStackSet(); - ItemStackSet shovels = new ItemStackSet(); - ItemStackSet axes = new ItemStackSet(); - ItemStackSet hoes = new ItemStackSet(); - ItemStackSet swords = new ItemStackSet(); - ItemStackSet chest = new ItemStackSet(); - ItemStackSet helmets = new ItemStackSet(); - ItemStackSet legs = new ItemStackSet(); - ItemStackSet boots = new ItemStackSet(); - ItemStackSet other = new ItemStackSet(); - ItemStackSet ranged = new ItemStackSet(); - ItemStackSet food = new ItemStackSet(); - ItemStackSet potioningredients = new ItemStackSet(); - - ArrayList creativeTabRanges = new ArrayList(CreativeTabs.CREATIVE_TAB_ARRAY.length); - List stackList = new LinkedList(); - - for (Item item : Item.REGISTRY) { - if (item == null) { - continue; - } - - for (CreativeTabs itemTab : item.getCreativeTabs()) { - if (itemTab != null) { - while (itemTab.getTabIndex() >= creativeTabRanges.size()) { - creativeTabRanges.add(null); - } - ItemStackSet set = creativeTabRanges.get(itemTab.getTabIndex()); - if (set == null) { - creativeTabRanges.set(itemTab.getTabIndex(), set = new ItemStackSet()); - } - stackList.clear(); - item.getSubItems(item, itemTab, stackList); - for (ItemStack stack : stackList) { - set.add(stack); - } - } - } - - //TODO EntityEquipmentSlot - if (item.isDamageable()) { - tools.with(item); - if (item instanceof ItemPickaxe) { - picks.with(item); - } else if (item instanceof ItemSpade) { - shovels.with(item); - } else if (item instanceof ItemAxe) { - axes.with(item); - } else if (item instanceof ItemHoe) { - hoes.with(item); - } else if (item instanceof ItemSword) { - swords.with(item); - } else if (item instanceof ItemArmor) { - switch (((ItemArmor) item).armorType) { - case HEAD: - helmets.with(item); - break; - case CHEST: - chest.with(item); - break; - case LEGS: - legs.with(item); - break; - case FEET: - boots.with(item); - break; - } - } else if (item == Items.ARROW || item == Items.BOW) { - ranged.with(item); - } else if (item == Items.FISHING_ROD || item == Items.FLINT_AND_STEEL || item == Items.SHEARS) { - other.with(item); - } - } - - if (item instanceof ItemFood) { - food.with(item); - } - - try { - LinkedList subItems = new LinkedList(); - item.getSubItems(item, null, subItems); - for (ItemStack stack : subItems) { - if (PotionHelper.isReagent(stack)) { - BrewingRecipeHandler.ingredients.add(stack); - potioningredients.add(stack); - } - } - - } catch (Exception e) { - LogHelper.errorError("Error loading brewing ingredients for: " + item, e); - } - } - API.addSubset("Items.Tools.Pickaxes", picks); - API.addSubset("Items.Tools.Shovels", shovels); - API.addSubset("Items.Tools.Axes", axes); - API.addSubset("Items.Tools.Hoes", hoes); - API.addSubset("Items.Tools.Other", other); - API.addSubset("Items.Weapons.Swords", swords); - API.addSubset("Items.Weapons.Ranged", ranged); - API.addSubset("Items.Armor.ChestPlates", chest); - API.addSubset("Items.Armor.Leggings", legs); - API.addSubset("Items.Armor.Helmets", helmets); - API.addSubset("Items.Armor.Boots", boots); - API.addSubset("Items.Food", food); - API.addSubset("Items.Potions.Ingredients", potioningredients); - - for (CreativeTabs tab : CreativeTabs.CREATIVE_TAB_ARRAY) { - if (tab.getTabIndex() >= creativeTabRanges.size()) { - continue; - } - ItemStackSet set = creativeTabRanges.get(tab.getTabIndex()); - if (set != null && !set.isEmpty()) { - API.addSubset("CreativeTabs." + I18n.format(tab.getTranslatedTabLabel()), set); - } - } - - BrewingRecipeHandler.searchPotions(); - } - - //TODO - private static void addSpawnEggs() { - //addEntityEgg(EntitySnowman.class, 0xEEFFFF, 0xffa221); - //addEntityEgg(EntityIronGolem.class, 0xC5C2C1, 0xffe1cc); - } - - private static void addEntityEgg(Class entity, int i, int j) { - String id = EntityList.getEntityStringFromClass(entity); - EntityList.ENTITY_EGGS.put(id, new EntityEggInfo(id, i, j)); - } - - @Deprecated - public static ArrayList getIdentifierItems(World world, EntityPlayer player, RayTraceResult hit) { - BlockPos pos = hit.getBlockPos(); - IBlockState state = world.getBlockState(pos); - Block block = state.getBlock(); - - ArrayList items = new ArrayList(); - - ArrayList handlers = new ArrayList(); - if (highlightIdentifiers.containsKey(null)) { - handlers.addAll(highlightIdentifiers.get(null)); - } - if (highlightIdentifiers.containsKey(block)) { - handlers.addAll(highlightIdentifiers.get(block)); - } - for (IHighlightHandler ident : handlers) { - ItemStack item = ident.identifyHighlight(world, player, hit); - if (item != null) { - items.add(item); - } - } - - if (items.size() > 0) { - return items; - } - - ItemStack pick = block.getPickBlock(state, hit, world, pos, player); - if (pick != null) { - items.add(pick); - } - - try { - items.addAll(block.getDrops(world, pos, state, 0)); - } catch (Exception ignored) { - } - if (block instanceof IShearable) { - IShearable shearable = (IShearable) block; - if (shearable.isShearable(new ItemStack(Items.SHEARS), world, pos)) { - items.addAll(shearable.onSheared(new ItemStack(Items.SHEARS), world, pos, 0)); - } - } - - if (items.size() == 0) { - items.add(0, new ItemStack(block, 1, block.getMetaFromState(state))); - } - - return items; - } - - @Deprecated - public static void registerHighlightHandler(IHighlightHandler handler, ItemInfo.Layout... layouts) { - for (ItemInfo.Layout layout : layouts) { - ItemInfo.highlightHandlers.get(layout).add(handler); - } - } - - @Deprecated - public static List getText(ItemStack itemStack, World world, EntityPlayer player, RayTraceResult rayTraceResult) { - List retString = new ArrayList(); - - for (ItemInfo.Layout layout : ItemInfo.Layout.values()) { - for (IHighlightHandler handler : ItemInfo.highlightHandlers.get(layout)) { - retString = handler.handleTextData(itemStack, world, player, rayTraceResult, retString, layout); - } - } - - return retString; - } - - public static String getSearchName(ItemStack stack) { - String s = itemSearchNames.get(stack); - if (s == null) { - s = TextFormatting.getTextWithoutFormattingCodes(GuiContainerManager.concatenatedDisplayName(stack, true).toLowerCase()); - itemSearchNames.put(stack, s); - } - return s; - } -} diff --git a/dependencies/main/java/codechicken/nei/api/NEIInfo.java b/dependencies/main/java/codechicken/nei/api/NEIInfo.java deleted file mode 100644 index a1c3ee44de..0000000000 --- a/dependencies/main/java/codechicken/nei/api/NEIInfo.java +++ /dev/null @@ -1,30 +0,0 @@ -package codechicken.nei.api; - -import codechicken.nei.NEIClientConfig; -import codechicken.nei.config.OptionCycled; -import net.minecraft.world.World; - -import java.util.LinkedList; - -public class NEIInfo { - public static final LinkedList modeHandlers = new LinkedList(); - - public static void load(World world) { - OptionCycled modeOption = (OptionCycled) NEIClientConfig.getOptionList().getOption("inventory.cheatmode"); - modeOption.parent.synthesizeEnvironment(false); - if (!modeOption.optionValid(modeOption.value())) { - modeOption.copyGlobals(); - modeOption.cycle(); - } - } - - public static boolean isValidMode(int mode) { - for (INEIModeHandler handler : modeHandlers) { - if (!handler.isModeValid(mode)) { - return false; - } - } - - return true; - } -} diff --git a/dependencies/main/java/codechicken/nei/api/TaggedInventoryArea.java b/dependencies/main/java/codechicken/nei/api/TaggedInventoryArea.java deleted file mode 100644 index 326950c688..0000000000 --- a/dependencies/main/java/codechicken/nei/api/TaggedInventoryArea.java +++ /dev/null @@ -1,45 +0,0 @@ -package codechicken.nei.api; - -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -import java.util.HashSet; - -public class TaggedInventoryArea { - public HashSet slots = new HashSet(); - public String tagName; - /** - * Only for player inventories. - */ - private IInventory inventory; - /** - * Other inventories - */ - private Container container; - - public TaggedInventoryArea(InventoryPlayer invPlayer) { - this("InventoryPlayer", 0, 39, null); - inventory = invPlayer; - } - - public TaggedInventoryArea(String name, int first, int last, Container container) { - this.container = container; - tagName = name; - for (int i = first; i <= last; i++) { - slots.add(i); - } - } - - public ItemStack getStackInSlot(int i) { - if (inventory != null) { - return inventory.getStackInSlot(i); - } - return container.getSlot(i).getStack(); - } - - public boolean isContainer() { - return inventory == null; - } -} diff --git a/dependencies/main/java/codechicken/nei/api/layout/LayoutStyle.java b/dependencies/main/java/codechicken/nei/api/layout/LayoutStyle.java deleted file mode 100644 index 18581935da..0000000000 --- a/dependencies/main/java/codechicken/nei/api/layout/LayoutStyle.java +++ /dev/null @@ -1,23 +0,0 @@ -package codechicken.nei.api.layout; - -import codechicken.nei.VisibilityData; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.widget.Button; -import net.minecraft.client.gui.inventory.GuiContainer; - -public abstract class LayoutStyle { - public abstract void init(); - - public abstract void reset(); - - public abstract void layout(GuiContainer gui, VisibilityData visibility); - - public abstract String getName(); - - public void drawBackground(GuiContainerManager gui) { - } - - public abstract void drawButton(Button button, int mouseX, int mouseY); - - public abstract void drawSubsetTag(String text, int x, int y, int w, int h, int state, boolean mouseover); -} diff --git a/dependencies/main/java/codechicken/nei/api/stack/PositionedStack.java b/dependencies/main/java/codechicken/nei/api/stack/PositionedStack.java deleted file mode 100644 index 8680dc393b..0000000000 --- a/dependencies/main/java/codechicken/nei/api/stack/PositionedStack.java +++ /dev/null @@ -1,119 +0,0 @@ -package codechicken.nei.api.stack; - -import codechicken.nei.ItemList; -import codechicken.nei.util.NEIServerUtils; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -import java.util.ArrayList; -import java.util.List; - -/** - * Simply an {@link ItemStack} with position. - * Mainly used in the recipe handlers. - */ -public class PositionedStack { - public int relx; - public int rely; - public ItemStack items[]; - //compatibility dummy - public ItemStack item; - - private boolean permutated = false; - - public PositionedStack(Object object, int x, int y, boolean genPerms) { - items = NEIServerUtils.extractRecipeItems(object); - relx = x; - rely = y; - - if (genPerms) { - generatePermutations(); - } else { - setPermutationToRender(0); - } - } - - public PositionedStack(Object object, int x, int y) { - this(object, x, y, true); - } - - public void generatePermutations() { - if (permutated) { - return; - } - - ArrayList stacks = new ArrayList(); - for (ItemStack item : items) { - if (item == null || item.getItem() == null) { - continue; - } - - if (item.getItemDamage() == Short.MAX_VALUE) { - List permutations = ItemList.itemMap.get(item.getItem()); - if (!permutations.isEmpty()) { - for (ItemStack stack : permutations) { - stacks.add(stack.copy()); - } - } else { - ItemStack base = new ItemStack(item.getItem(), item.stackSize); - base.setTagCompound(item.getTagCompound()); - stacks.add(base); - } - continue; - } - - stacks.add(item.copy()); - } - items = stacks.toArray(new ItemStack[0]); - - if (items.length == 0) { - items = new ItemStack[] { new ItemStack(Blocks.FIRE) }; - } - - permutated = true; - setPermutationToRender(0); - } - - public void setMaxSize(int i) { - for (ItemStack item : items) { - if (item.stackSize > i) { - item.stackSize = i; - } - } - } - - public PositionedStack copy() { - return new PositionedStack(items, relx, rely); - } - - public void setPermutationToRender(int index) { - item = items[index].copy(); - if (item.getItem() == null) { - item = new ItemStack(Blocks.FIRE); - } else if (item.getItemDamage() == OreDictionary.WILDCARD_VALUE) { - item.setItemDamage(0); - } - } - - public boolean contains(ItemStack ingredient) { - for (ItemStack item : items) { - if (NEIServerUtils.areStacksSameTypeCrafting(item, ingredient)) { - return true; - } - } - - return false; - } - - public boolean contains(Item ingred) { - for (ItemStack item : items) { - if (item.getItem() == ingred) { - return true; - } - } - - return false; - } -} diff --git a/dependencies/main/java/codechicken/nei/asm/NEICorePlugin.java b/dependencies/main/java/codechicken/nei/asm/NEICorePlugin.java deleted file mode 100644 index 9836e07171..0000000000 --- a/dependencies/main/java/codechicken/nei/asm/NEICorePlugin.java +++ /dev/null @@ -1,66 +0,0 @@ -package codechicken.nei.asm; - -import net.minecraftforge.fml.common.FMLLog; -import net.minecraftforge.fml.relauncher.IFMLCallHook; -import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; -import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions; -import org.apache.logging.log4j.Level; - -import java.io.File; -import java.util.Map; - -@TransformerExclusions({ "codechicken.nei.asm" }) -public class NEICorePlugin implements IFMLLoadingPlugin, IFMLCallHook { - public static File location; - public static boolean missingCCL = false; - - public NEICorePlugin() { - cclCheck(); - } - - @Override - public String[] getASMTransformerClass() { - if (missingCCL) { - FMLLog.log("NotEnoughItems", Level.FATAL, "Missing CCL! not registering class transformer."); - return new String[0]; - } - return new String[] { "codechicken.nei.asm.NEITransformer" }; - } - - @Override - public String getModContainerClass() { - return "codechicken.nei.NEIModContainer"; - } - - @Override - public String getSetupClass() { - return "codechicken.nei.asm.NEICorePlugin"; - } - - @Override - public void injectData(Map data) { - location = (File) data.get("coremodLocation"); - if (location == null) { - location = new File(getClass().getProtectionDomain().getCodeSource().getLocation().getPath()); - } - } - - @Override - public String getAccessTransformerClass() { - return null; - } - - @Override - public Void call() { - return null; - } - private static void cclCheck() { - try { - Class.forName("codechicken.lib.asm.ASMHelper", false, NEICorePlugin.class.getClassLoader()); - missingCCL = false; - } catch (ClassNotFoundException cNFE) { - cNFE.printStackTrace(); - missingCCL = true; - } - } -} diff --git a/dependencies/main/java/codechicken/nei/asm/NEITransformer.java b/dependencies/main/java/codechicken/nei/asm/NEITransformer.java deleted file mode 100644 index de5e593c28..0000000000 --- a/dependencies/main/java/codechicken/nei/asm/NEITransformer.java +++ /dev/null @@ -1,226 +0,0 @@ -package codechicken.nei.asm; - -import codechicken.lib.asm.*; -import codechicken.lib.asm.ModularASMTransformer.*; -import net.minecraft.launchwrapper.IClassTransformer; -import net.minecraftforge.fml.relauncher.FMLLaunchHandler; -import org.objectweb.asm.Type; -import org.objectweb.asm.tree.*; - -import java.util.Map; - -import static codechicken.lib.asm.InsnComparator.*; -import static org.objectweb.asm.ClassWriter.COMPUTE_FRAMES; -import static org.objectweb.asm.ClassWriter.COMPUTE_MAXS; -import static org.objectweb.asm.Opcodes.*; - -public class NEITransformer implements IClassTransformer { - private ModularASMTransformer transformer = new ModularASMTransformer(); - private Map asmblocks = ASMReader.loadResource("/assets/nei/asm/blocks.asm"); - - public NEITransformer() { - if (FMLLaunchHandler.side().isClient()) { - //Generates method to set the placed position of a mob spawner for the item callback. More portable than copying vanilla placement code - //transformer.add(new MethodWriter(ACC_PUBLIC, new ObfMapping("net/minecraft/block/BlockMobSpawner", "func_180633_a", "(Lnet/minecraft/world/World;Lnet/minecraft/util/BlockPos;Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;)V"), asmblocks.get("spawnerPlaced"))); - transformer.add(new MethodInjector(new ObfMapping("net/minecraft/client/gui/inventory/GuiContainerCreative", "func_147053_i", "()V"), asmblocks.get("i_creativeTabSearch"), true)); - } - - //Removes trailing seperators from NBTTagList/Compound.toString because OCD - //TODO - //transformer.add(new MethodInjector(new ObfMapping("net/minecraft/nbt/NBTTagCompound", "toString", "()Ljava/lang/String;"), asmblocks.get("n_commaFix"), asmblocks.get("commaFix"), true)); - //transformer.add(new MethodInjector(new ObfMapping("net/minecraft/nbt/NBTTagList", "toString", "()Ljava/lang/String;"), asmblocks.get("n_commaFix"), asmblocks.get("commaFix"), true)); - - //fix workbench container losing items on shift click output without room for the full stack - transformer.add(new MethodTransformer(new ObfMapping("net/minecraft/inventory/ContainerWorkbench", "func_82846_b", "(Lnet/minecraft/entity/player/EntityPlayer;I)Lnet/minecraft/item/ItemStack;")) { - @Override - public void transform(MethodNode mv) { - ASMHelper.logger.debug("NEI: Applying workbench fix"); - InsnListSection key = findN(mv.instructions, asmblocks.get("n_workbenchFix").list).get(0); - key.insertBefore(asmblocks.get("workbenchFix").rawListCopy()); - } - }); - - String guiContainer = "net/minecraft/client/gui/inventory/GuiContainer"; - //add manager field - transformer.add(new FieldWriter(ACC_PUBLIC, new ObfMapping(guiContainer, "manager", "Lcodechicken/nei/guihook/GuiContainerManager;"))); - - //Fill out getManager in GuiContainerManager - transformer.add(new MethodWriter(ACC_PUBLIC | ACC_STATIC, new ObfMapping("codechicken/nei/guihook/GuiContainerManager", "getManager", "(Lnet/minecraft/client/gui/inventory/GuiContainer;)Lcodechicken/nei/guihook/GuiContainerManager;"), asmblocks.get("m_getManager"))); - - //Generate load method - transformer.add(new MethodWriter(ACC_PUBLIC, new ObfMapping(guiContainer, "func_146280_a", "(Lnet/minecraft/client/Minecraft;II)V"), asmblocks.get("m_setWorldAndResolution"))); - - //Generate handleKeyboardInput method - transformer.add(new MethodWriter(ACC_PUBLIC, new ObfMapping(guiContainer, "func_146282_l", "()V"), asmblocks.get("m_handleKeyboardInput"))); - - //Generate handleKeyboardInput method - transformer.add(new MethodWriter(ACC_PUBLIC, new ObfMapping(guiContainer, "func_146282_l", "()V"), asmblocks.get("m_handleKeyboardInput"))); - - //Generate handleKeyboardInput method - transformer.add(new MethodWriter(ACC_PUBLIC, new ObfMapping(guiContainer, "func_146282_l", "()V"), asmblocks.get("m_handleKeyboardInput"))); - - //Generate handleMouseInput method - transformer.add(new MethodWriter(ACC_PUBLIC, new ObfMapping(guiContainer, "func_146274_d", "()V"), asmblocks.get("m_handleMouseInput"))); - - addProtectedForwarder(new ObfMapping(guiContainer, "func_73869_a", "(CI)V"), new ObfMapping("codechicken/nei/guihook/GuiContainerManager", "callKeyTyped", "(Lnet/minecraft/client/gui/inventory/GuiContainer;CI)V")); - - addProtectedForwarder(new ObfMapping(guiContainer, "func_184098_a", "(Lnet/minecraft/inventory/Slot;IILnet/minecraft/inventory/ClickType;)V"), new ObfMapping("codechicken/nei/guihook/DefaultSlotClickHandler", "callHandleMouseClick", "(Lnet/minecraft/client/gui/inventory/GuiContainer;Lnet/minecraft/inventory/Slot;IILnet/minecraft/inventory/ClickType;)V")); - - //Inject preDraw at the start of drawScreen - transformer.add(new MethodInjector(new ObfMapping(guiContainer, "func_73863_a", "(IIF)V"), asmblocks.get("preDraw"), true)); - - //Inject objectUnderMouse check before drawing slot highlights - transformer.add(new MethodInjector(new ObfMapping(guiContainer, "func_73863_a", "(IIF)V"), asmblocks.get("n_objectUnderMouse"), asmblocks.get("objectUnderMouse"), false)); - - //Inject renderObjects after drawGuiContainerForegroundLayer - transformer.add(new MethodInjector(new ObfMapping(guiContainer, "func_73863_a", "(IIF)V"), asmblocks.get("n_renderObjects"), asmblocks.get("renderObjects"), false)); - - //Replace default renderToolTip with delegate - ASMBlock d_renderToolTip = Boolean.parseBoolean(System.getProperty("nei.altRenderToolTipNeedle", "false")) ? asmblocks.get("d_renderToolTipIntellijEclipseCompilerFix") : asmblocks.get("d_renderToolTip"); - transformer.add(new MethodReplacer(new ObfMapping(guiContainer, "func_73863_a", "(IIF)V"), d_renderToolTip, asmblocks.get("renderTooltips"))); - - //Replace zLevel = 200 with zLevel = 500 in drawItemStack - transformer.add(new MethodReplacer(new ObfMapping(guiContainer, "func_146982_a", "(Lnet/minecraft/item/ItemStack;IILjava/lang/String;)V"), asmblocks.get("d_zLevel"), asmblocks.get("zLevel"))); - - //Replace default renderItem with delegate and slot overlay/underlay - transformer.add(new MethodReplacer(new ObfMapping(guiContainer, "func_146977_a", "(Lnet/minecraft/inventory/Slot;)V"), asmblocks.get("d_drawSlot"), asmblocks.get("drawSlot"))); - - //Inject mouseClicked hook at the start of mouseClicked - transformer.add(new MethodInjector(new ObfMapping(guiContainer, "func_73864_a", "(III)V"), asmblocks.get("mouseClicked"), true)); - - //Replace general handleMouseClicked call with delegate - transformer.add(new MethodReplacer(new ObfMapping(guiContainer, "func_73864_a", "(III)V"), asmblocks.get("d_handleMouseClick"), asmblocks.get("handleMouseClick")));//mouseClicked - transformer.add(new MethodReplacer(new ObfMapping(guiContainer, "func_146273_a", "(IIIJ)V"), asmblocks.get("d_handleMouseClick"), asmblocks.get("handleMouseClick")));//mouseClickMove - transformer.add(new MethodReplacer(new ObfMapping(guiContainer, "func_146286_b", "(III)V"), asmblocks.get("d_handleMouseClick"), asmblocks.get("handleMouseClick")));//mouseReleased - transformer.add(new MethodReplacer(new ObfMapping(guiContainer, "func_73869_a", "(CI)V"), asmblocks.get("d_handleMouseClick"), asmblocks.get("handleMouseClick")));//keyTyped - transformer.add(new MethodReplacer(new ObfMapping(guiContainer, "func_146983_a", "(I)Z"), asmblocks.get("d_handleMouseClick"), asmblocks.get("handleMouseClick")));//checkHotbarKeys - - //Write delegate for handleMouseClicked - transformer.add(new MethodWriter(ACC_PUBLIC, new ObfMapping(guiContainer, "managerHandleMouseClick", "(Lnet/minecraft/inventory/Slot;IILnet/minecraft/inventory/ClickType;)V"), asmblocks.get("m_managerHandleMouseClick"))); - - //Inject mouseDragged hook after super call in mouseDragged - transformer.add(new MethodInjector(new ObfMapping(guiContainer, "func_146273_a", "(IIIJ)V"), asmblocks.get("n_mouseDragged"), asmblocks.get("mouseDragged"), false)); - - //Inject overrideMouseUp at the start of mouseReleased - transformer.add(new MethodInjector(new ObfMapping(guiContainer, "func_146286_b", "(III)V"), asmblocks.get("overrideMouseUp"), true)); - - //Inject mouseUp at the end of main elseif chain in mouseReleased - transformer.add(new MethodTransformer(new ObfMapping(guiContainer, "func_146286_b", "(III)V")) { - @Override - public void transform(MethodNode mv) { - ASMHelper.logger.debug("NEI: Injecting mouseUp call"); - ASMBlock gotoBlock = asmblocks.get("n_mouseUpGoto"); - ASMBlock needleBlock = asmblocks.get("n_mouseUp"); - ASMBlock injectionBlock = asmblocks.get("mouseUp"); - - gotoBlock.mergeLabels(injectionBlock); - findOnce(mv.instructions, gotoBlock.list).replace(gotoBlock.list.list); - - InsnListSection needle = findOnce(mv.instructions, needleBlock.list); - injectionBlock.mergeLabels(needleBlock.applyLabels(needle)); - needle.insertBefore(injectionBlock.list.list); - } - }); - - //Replace general handleMouseClick call with delegate - transformer.add(new MethodReplacer(new ObfMapping(guiContainer, "func_184098_a", "(Lnet/minecraft/inventory/Slot;IILnet/minecraft/inventory/ClickType;)V"), asmblocks.get("d_handleSlotClick"), asmblocks.get("handleSlotClick"))); - - //Inject lastKeyTyped at the start of keyTyped - transformer.add(new MethodInjector(new ObfMapping(guiContainer, "func_73869_a", "(CI)V"), asmblocks.get("lastKeyTyped"), true)); - - //Inject updateScreen hook after super call - transformer.add(new MethodInjector(new ObfMapping(guiContainer, "func_73876_c", "()V"), asmblocks.get("n_updateScreen"), asmblocks.get("updateScreen"), false)); - - //Cancel tab click calls when tabs are obscured - transformer.add(new MethodInjector(new ObfMapping("net/minecraft/client/gui/inventory/GuiContainerCreative", "func_147049_a", "(Lnet/minecraft/creativetab/CreativeTabs;II)Z"), asmblocks.get("handleTabClick"), true)); - - //Cancel tab tooltip rendering when tabs are obscured - transformer.add(new MethodInjector(new ObfMapping("net/minecraft/client/gui/inventory/GuiContainerCreative", "func_147052_b", "(Lnet/minecraft/creativetab/CreativeTabs;II)Z"), asmblocks.get("renderTabTooltip"), true)); - - String[] buttons = new String[] { "CancelButton", "ConfirmButton", "PowerButton" }; - String[] this_fields = new String[] { "field_146146_o", "field_146147_o", "field_146150_o" }; - for (int i = 0; i < 3; i++) { - ObfMapping m = new ObfMapping("net/minecraft/client/gui/inventory/GuiBeacon$" + buttons[i], "func_146111_b", "(II)V"); - InsnListSection l = asmblocks.get("beaconButtonObscured").list.copy(); - FieldInsnNode this_ref = ((FieldInsnNode) l.get(1)); - this_ref.owner = m.toClassloading().s_owner; - if (ObfMapping.obfuscated) //missing srg mappings for inner outer reference fields - { - this_ref.name = ObfMapping.obfMapper.mapFieldName(null, this_fields[i], null); - } - transformer.add(new MethodInjector(m, l.list, true)); - } - } - - private void addProtectedForwarder(ObfMapping called, ObfMapping caller) { - - InsnList forward1 = new InsnList(); - InsnList forward2 = new InsnList(); - - ObfMapping publicCall = new ObfMapping(called.s_owner, "public_" + called.s_name, called.s_desc); - Type[] args = Type.getArgumentTypes(caller.s_desc); - for (int i = 0; i < args.length; i++) { - forward1.add(new VarInsnNode(args[i].getOpcode(ILOAD), i)); - forward2.add(new VarInsnNode(args[i].getOpcode(ILOAD), i)); - } - - forward1.add(publicCall.toInsn(INVOKEVIRTUAL)); - forward2.add(called.toClassloading().toInsn(INVOKEVIRTUAL)); - forward1.add(new InsnNode(Type.getReturnType(called.s_desc).getOpcode(IRETURN))); - forward2.add(new InsnNode(Type.getReturnType(called.s_desc).getOpcode(IRETURN))); - - transformer.add(new MethodWriter(ACC_PUBLIC | ACC_STATIC, caller, forward1)); - transformer.add(new MethodWriter(ACC_PUBLIC, publicCall, forward2)); - } - - private ObfMapping c_GuiContainer = new ObfMapping("net/minecraft/client/gui/inventory/GuiContainer").toClassloading(); - - /** - * Adds super.updateScreen() to non implementing GuiContainer subclasses - */ - public byte[] transformSubclasses(String name, byte[] bytes) { - if (ClassHeirachyManager.classExtends(name, c_GuiContainer.javaClass())) { - ClassNode cnode = ASMHelper.createClassNode(bytes); - - ObfMapping methodmap = new ObfMapping(cnode.superName, "func_73876_c", "()V").toClassloading(); - - InsnListSection supercall = new InsnListSection(); - supercall.add(new VarInsnNode(ALOAD, 0)); - supercall.add(methodmap.toInsn(INVOKESPECIAL)); - - boolean changed = false; - for (MethodNode mv : cnode.methods) { - if (methodmap.matches(mv)) { - if (matches(new InsnListSection(mv.instructions), supercall, getControlFlowLabels(mv.instructions)) == null) { - mv.instructions.insert(supercall.list); - ASMHelper.logger.debug("Inserted super call into " + methodmap); - changed = true; - } - } - } - - if (changed) { - bytes = ASMHelper.createBytes(cnode, COMPUTE_MAXS | COMPUTE_FRAMES); - } - } - return bytes; - } - - @Override - public byte[] transform(String name, String tname, byte[] bytes) { - if (bytes == null) { - return null; - } - try { - if (FMLLaunchHandler.side().isClient()) { - bytes = transformSubclasses(name, bytes); - } - - bytes = transformer.transform(name, bytes); - } catch (Exception e) { - throw new RuntimeException(e); - } - - return bytes; - } -} diff --git a/dependencies/main/java/codechicken/nei/config/ArrayDumper.java b/dependencies/main/java/codechicken/nei/config/ArrayDumper.java deleted file mode 100644 index 0388d1da17..0000000000 --- a/dependencies/main/java/codechicken/nei/config/ArrayDumper.java +++ /dev/null @@ -1,32 +0,0 @@ -package codechicken.nei.config; - -import java.util.LinkedList; - -public abstract class ArrayDumper extends DataDumper { - public ArrayDumper(String name) { - super(name); - } - - @Override - public Iterable dump(int mode) { - LinkedList list = new LinkedList(); - T[] array = array(); - for (int i = 0; i < array.length; i++) { - T obj = array[i]; - if (obj == null) { - if (mode == 1 || mode == 2) { - list.add(new String[] { Integer.toString(i), null, null, null, null }); - } - } else { - if (mode == 0 || mode == 2) { - list.add(dump(obj, i)); - } - } - } - return list; - } - - public abstract T[] array(); - - public abstract String[] dump(T obj, int id); -} \ No newline at end of file diff --git a/dependencies/main/java/codechicken/nei/config/ConfigSet.java b/dependencies/main/java/codechicken/nei/config/ConfigSet.java deleted file mode 100644 index d30d0c9dd4..0000000000 --- a/dependencies/main/java/codechicken/nei/config/ConfigSet.java +++ /dev/null @@ -1,44 +0,0 @@ -package codechicken.nei.config; - -import codechicken.lib.config.ConfigTagParent; -import codechicken.nei.util.NEIServerUtils; -import net.minecraft.nbt.NBTTagCompound; - -import java.io.File; - -public class ConfigSet { - private File nbtFile; - public NBTTagCompound nbt; - public ConfigTagParent config; - - public ConfigSet(File nbtFile, ConfigTagParent config) { - this.nbtFile = nbtFile; - this.config = config; - loadNBT(); - } - - public void loadNBT() { - nbt = new NBTTagCompound(); - try { - if (!nbtFile.getParentFile().exists()) { - nbtFile.getParentFile().mkdirs(); - } - if (!nbtFile.exists()) { - nbtFile.createNewFile(); - } - if (nbtFile.length() > 0) { - nbt = NEIServerUtils.readNBT(nbtFile); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void saveNBT() { - try { - NEIServerUtils.writeNBT(nbt, nbtFile); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/dependencies/main/java/codechicken/nei/config/DataDumper.java b/dependencies/main/java/codechicken/nei/config/DataDumper.java deleted file mode 100644 index f31814f038..0000000000 --- a/dependencies/main/java/codechicken/nei/config/DataDumper.java +++ /dev/null @@ -1,153 +0,0 @@ -package codechicken.nei.config; - -import codechicken.lib.util.CommonUtils; -import codechicken.lib.vec.Rectangle4i; -import codechicken.nei.LayoutManager; -import codechicken.nei.util.LogHelper; -import codechicken.nei.util.NEIClientUtils; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.TextComponentTranslation; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; - -import static codechicken.lib.gui.GuiDraw.drawString; -import static codechicken.lib.gui.GuiDraw.drawStringC; - -public abstract class DataDumper extends Option { - public DataDumper(String name) { - super(name); - } - - public abstract String[] header(); - - public abstract Iterable dump(int mode); - - public String renderName() { - return translateN(name + "s"); - } - - public void dumpFile() { - try { - File file = new File(CommonUtils.getMinecraftDir(), "dumps/" + getFileName(name.replaceFirst(".+\\.", ""))); - if (!file.getParentFile().exists()) { - file.getParentFile().mkdirs(); - } - if (!file.exists()) { - file.createNewFile(); - } - - dumpTo(file); - - NEIClientUtils.printChatMessage(dumpMessage(file)); - } catch (Exception e) { - LogHelper.errorError("Error dumping " + renderName() + " mode: " + getMode(), e); - } - } - - public String getFileName(String prefix) { - return prefix + getFileExtension(); - } - - public String getFileExtension() { - return ".csv"; - } - - public ITextComponent dumpMessage(File file) { - return new TextComponentTranslation("nei.options.tools.dump.dumped", translateN(name), "dumps/" + file.getName()); - } - - public void dumpTo(File file) throws IOException { - int mode = getMode(); - PrintWriter w = new PrintWriter(file); - w.println(concat(header())); - for (String[] line : dump(mode)) { - w.println(concat(line)); - } - w.close(); - } - - public static String concat(String[] header) { - StringBuilder sb = new StringBuilder(); - for (String s : header) { - if (sb.length() > 0) { - sb.append(','); - } - if (s == null) { - s = "null"; - } - if (s.indexOf(',') > 0 || s.indexOf('\"') > 0) { - s = '\"' + s.replace("\"", "\"\"") + '\"'; - } - sb.append(s); - } - return sb.toString(); - } - - @Override - public void draw(int mousex, int mousey, float frame) { - drawPrefix(); - if (modeCount() > 1) { - drawButton(mousex, mousey, modeButtonSize(), modeButtonText()); - } - drawButton(mousex, mousey, dumpButtonSize(), dumpButtonText()); - } - - public void drawPrefix() { - drawString(renderName(), 10, 6, -1); - } - - public Rectangle4i dumpButtonSize() { - int width = 80; - return new Rectangle4i(slot.slotWidth() - width, 0, width, 20); - } - - public Rectangle4i modeButtonSize() { - int width = 60; - return new Rectangle4i(dumpButtonSize().x - width - 6, 0, width, 20); - } - - public String dumpButtonText() { - return NEIClientUtils.lang.translate("options.tools.dump.dump"); - } - - public String modeButtonText() { - return NEIClientUtils.lang.translate("options.tools.dump.mode." + getMode()); - } - - public int getMode() { - return renderTag().getIntValue(0); - } - - public void drawButton(int mousex, int mousey, Rectangle4i b, String text) { - GlStateManager.color(1, 1, 1, 1); - boolean hover = b.contains(mousex, mousey); - LayoutManager.drawButtonBackground(b.x, b.y, b.w, b.h, true, getButtonTex(hover)); - drawStringC(text, b.x, b.y, b.w, b.h, getTextColour(hover)); - } - - public int getButtonTex(boolean hover) { - return hover ? 2 : 1; - } - - public int getTextColour(boolean hover) { - return hover ? 0xFFFFFFA0 : 0xFFE0E0E0; - } - - @Override - public void mouseClicked(int mousex, int mousey, int button) { - if (modeCount() > 1 && modeButtonSize().contains(mousex, mousey)) { - NEIClientUtils.playClickSound(); - getTag().setIntValue((getMode() + 1) % modeCount()); - } else if (dumpButtonSize().contains(mousex, mousey)) { - NEIClientUtils.playClickSound(); - dumpFile(); - } - } - - public int modeCount() { - return 3; - } -} diff --git a/dependencies/main/java/codechicken/nei/config/GuiHighlightTips.java b/dependencies/main/java/codechicken/nei/config/GuiHighlightTips.java deleted file mode 100644 index 3f7e71563b..0000000000 --- a/dependencies/main/java/codechicken/nei/config/GuiHighlightTips.java +++ /dev/null @@ -1,152 +0,0 @@ -package codechicken.nei.config; - -import codechicken.core.gui.GuiCCButton; -import codechicken.core.gui.GuiScreenWidget; -import codechicken.lib.math.MathHelper; -import codechicken.lib.vec.Rectangle4i; -import codechicken.nei.HUDRenderer; -import codechicken.nei.util.NEIClientUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.text.TextFormatting; -import org.lwjgl.input.Keyboard; - -import java.awt.*; -import java.io.IOException; -import java.util.Arrays; - -import static codechicken.lib.gui.GuiDraw.displaySize; -import static codechicken.lib.gui.GuiDraw.getMousePosition; - -@Deprecated//Waila is a thing now. -public class GuiHighlightTips extends GuiScreenWidget { - private String name; - private GuiCCButton toggleButton; - private Option opt; - private Point dragDown; - - public GuiHighlightTips(Option opt) { - super(80, 20); - this.opt = opt; - name = opt.name; - } - - @Override - public boolean doesGuiPauseGame() { - return true; - } - - public void addWidgets() { - add(toggleButton = new GuiCCButton(0, 0, 80, 20, "").setActionCommand("show")); - updateNames(); - } - - @Override - public void actionPerformed(String ident, Object... params) { - if (ident.equals("show")) { - opt.getTag(name).setBooleanValue(!show()); - updateNames(); - } - } - - private void updateNames() { - toggleButton.text = NEIClientUtils.translate("options." + name + "." + (show() ? "show" : "hide")); - } - - private boolean show() { - return opt.renderTag(name).getBooleanValue(); - } - - @Override - public void keyTyped(char c, int keycode) throws IOException { - if (keycode == Keyboard.KEY_ESCAPE || keycode == Keyboard.KEY_BACK) { - Minecraft.getMinecraft().displayGuiScreen(opt.slot.getGui()); - return; - } - super.keyTyped(c, keycode); - } - - @Override - public void drawScreen(int mousex, int mousey, float f) { - super.drawScreen(mousex, mousey, f); - if (show()) { - //HUDRenderer.renderOverlay(new ItemStack(Blocks.REDSTONE_BLOCK), Arrays.asList("RedstoneBlock", TextFormatting.RED + "Sample"), renderPos()); - } - } - - public Point getPos() { - return new Point(opt.renderTag(name + ".x").getIntValue(), opt.renderTag(name + ".y").getIntValue()); - } - - public Dimension sampleSize()//copied from HUDManager when running with the sample for this gui - { - return new Dimension(101, 30); - } - - public Point getDrag() { - Point mouse = getMousePosition(); - Point drag = new Point(mouse.x - dragDown.x, mouse.y - dragDown.y); - Dimension size = displaySize(); - Dimension sample = sampleSize(); - drag.x *= 10000; - drag.y *= 10000; - drag.x /= (size.width - sample.width); - drag.y /= (size.height - sample.height); - Point pos = getPos(); - drag.x = (int) MathHelper.clip(drag.x, -pos.x, 10000 - pos.x); - drag.y = (int) MathHelper.clip(drag.y, -pos.y, 10000 - pos.y); - return drag; - } - - public Point renderPos() { - Point pos = getPos(); - if (dragDown != null) { - Point drag = getDrag(); - pos.x += drag.x; - pos.y += drag.y; - } - - for (int i = 25; i < 100; i += 25)//snapping - { - if (pos.x / 100 == i) { - pos.x = i * 100; - } - if (pos.y / 100 == i) { - pos.y = i * 100; - } - } - - return pos; - } - - @Override - protected void mouseReleased(int x, int y, int button) { - if (button == 0 && dragDown != null) { - setPos(renderPos()); - dragDown = null; - } - } - - public Rectangle4i selectionBox() { - Point pos = renderPos(); - Dimension size = displaySize(); - Dimension rect = sampleSize(); - return new Rectangle4i((size.width - rect.width) * pos.x / 10000, (size.height - rect.height) * pos.y / 10000, rect.width, rect.height); - } - - @Override - protected void mouseClicked(int x, int y, int button) throws IOException { - if (button == 0 && selectionBox().contains(x, y)) { - dragDown = getMousePosition(); - } else { - super.mouseClicked(x, y, button); - } - } - - private void setPos(Point p) { - opt.getTag(name).setBooleanValue(show());//duplicates global tag for the option gui if in world mode - opt.getTag(name + ".x").setIntValue(p.x); - opt.getTag(name + ".y").setIntValue(p.y); - } -} diff --git a/dependencies/main/java/codechicken/nei/config/GuiItemIconDumper.java b/dependencies/main/java/codechicken/nei/config/GuiItemIconDumper.java deleted file mode 100644 index 3e4225dd6c..0000000000 --- a/dependencies/main/java/codechicken/nei/config/GuiItemIconDumper.java +++ /dev/null @@ -1,202 +0,0 @@ -package codechicken.nei.config; - -import codechicken.lib.util.CommonUtils; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.util.LogHelper; -import codechicken.nei.util.NEIClientUtils; -import codechicken.nei.widget.ItemPanel; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.texture.TextureUtil; -import net.minecraft.client.shader.Framebuffer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.TextComponentTranslation; -import net.minecraft.util.text.TextFormatting; -import org.lwjgl.BufferUtils; -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import javax.imageio.ImageIO; -import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.nio.IntBuffer; -import java.util.Arrays; - -public class GuiItemIconDumper extends GuiScreen { - final static int[] illegalChars = { 34, 60, 62, 124, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 58, 42, 63, 92, 47 }; - - static { - Arrays.sort(illegalChars); - } - - private Option opt; - private int drawIndex; - private int parseIndex; - private File dir = new File(CommonUtils.getMinecraftDir(), "dumps/itempanel_icons"); - private int iconSize; - private int borderSize; - private int boxSize; - - public GuiItemIconDumper(Option opt, int iconSize) { - this.opt = opt; - this.iconSize = iconSize; - borderSize = iconSize / 16; - boxSize = iconSize + borderSize * 2; - - if (dir.exists()) { - for (File f : dir.listFiles()) { - if (f.isFile()) { - f.delete(); - } - } - } else { - dir.mkdirs(); - } - - } - - private void returnScreen(ITextComponent msg) { - Minecraft.getMinecraft().displayGuiScreen(opt.slot.getGui()); - NEIClientUtils.printChatMessage(msg); - } - - @Override - protected void keyTyped(char c, int keycode) throws IOException { - if (keycode == Keyboard.KEY_ESCAPE || keycode == Keyboard.KEY_BACK) { - returnScreen(new TextComponentTranslation(opt.fullName() + ".icon.cancelled")); - return; - } - super.keyTyped(c, keycode); - } - - @Override - public void drawScreen(int mousex, int mousey, float frame) { - try { - drawItems(); - exportItems(); - } catch (Exception e) { - LogHelper.errorError("Error dumping item icons", e); - } - } - - private void drawItems() { - Dimension d = GuiDraw.displayRes(); - - GlStateManager.matrixMode(GL11.GL_PROJECTION); - GlStateManager.loadIdentity(); - GlStateManager.ortho(0, d.width * 16D / iconSize, d.height * 16D / iconSize, 0, 1000, 3000); - GlStateManager.matrixMode(GL11.GL_MODELVIEW); - GlStateManager.clearColor(0, 0, 0, 0); - GlStateManager.clear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); - - int rows = d.height / boxSize; - int cols = d.width / boxSize; - int fit = rows * cols; - - RenderHelper.enableGUIStandardItemLighting(); - GlStateManager.enableRescaleNormal(); - GlStateManager.color(1, 1, 1, 1); - - for (int i = 0; drawIndex < ItemPanel.items.size() && i < fit; drawIndex++, i++) { - int x = i % cols * 18; - int y = i / cols * 18; - GuiContainerManager.drawItem(x + 1, y + 1, ItemPanel.items.get(drawIndex)); - } - - GL11.glFlush(); - } - - private void exportItems() throws IOException { - BufferedImage img = screenshot(); - int rows = img.getHeight() / boxSize; - int cols = img.getWidth() / boxSize; - int fit = rows * cols; - for (int i = 0; parseIndex < ItemPanel.items.size() && i < fit; parseIndex++, i++) { - int x = i % cols * boxSize; - int y = i / cols * boxSize; - exportImage(dir, img.getSubimage(x + borderSize, y + borderSize, iconSize, iconSize), ItemPanel.items.get(parseIndex)); - } - - if (parseIndex >= ItemPanel.items.size()) { - returnScreen(new TextComponentTranslation(opt.fullName() + ".icon.dumped", "dumps/itempanel_icons")); - } - } - - public static String cleanFileName(String name) { - StringBuilder cleanName = new StringBuilder(); - for (int i = 0; i < name.length(); i++) { - int c = (int) name.charAt(i); - if (Arrays.binarySearch(illegalChars, c) < 0) { - cleanName.append((char) c); - } else { - cleanName.append('_'); - } - } - return cleanName.toString(); - } - - private void exportImage(File dir, BufferedImage img, ItemStack stack) throws IOException { - String name = TextFormatting.getTextWithoutFormattingCodes(GuiContainerManager.itemDisplayNameShort(stack)); - name = cleanFileName(name); - File file = new File(dir, name + ".png"); - for (int i = 2; file.exists(); i++) { - file = new File(dir, name + '_' + i + ".png"); - } - ImageIO.write(img, "png", file); - } - - private IntBuffer pixelBuffer; - private int[] pixelValues; - - private BufferedImage screenshot() { - Framebuffer fb = Minecraft.getMinecraft().getFramebuffer(); - Dimension mcSize = GuiDraw.displayRes(); - Dimension texSize = mcSize; - - if (OpenGlHelper.isFramebufferEnabled()) { - texSize = new Dimension(fb.framebufferTextureWidth, fb.framebufferTextureHeight); - } - - int k = texSize.width * texSize.height; - if (pixelBuffer == null || pixelBuffer.capacity() < k) { - pixelBuffer = BufferUtils.createIntBuffer(k); - pixelValues = new int[k]; - } - - GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1); - GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1); - pixelBuffer.clear(); - - if (OpenGlHelper.isFramebufferEnabled()) { - GlStateManager.bindTexture(fb.framebufferTexture); - GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer); - } else { - GL11.glReadPixels(0, 0, texSize.width, texSize.height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer); - } - - pixelBuffer.get(pixelValues); - TextureUtil.processPixelValues(pixelValues, texSize.width, texSize.height); - - BufferedImage img = new BufferedImage(mcSize.width, mcSize.height, BufferedImage.TYPE_INT_ARGB); - if (OpenGlHelper.isFramebufferEnabled()) { - int yOff = texSize.height - mcSize.height; - for (int y = 0; y < mcSize.height; ++y) { - for (int x = 0; x < mcSize.width; ++x) { - img.setRGB(x, y, pixelValues[(y + yOff) * texSize.width + x]); - } - } - } else { - img.setRGB(0, 0, texSize.width, height, pixelValues, 0, texSize.width); - } - - return img; - } -} diff --git a/dependencies/main/java/codechicken/nei/config/GuiItemSorter.java b/dependencies/main/java/codechicken/nei/config/GuiItemSorter.java deleted file mode 100644 index 77f843ba5f..0000000000 --- a/dependencies/main/java/codechicken/nei/config/GuiItemSorter.java +++ /dev/null @@ -1,184 +0,0 @@ -package codechicken.nei.config; - -import codechicken.lib.math.MathHelper; -import codechicken.nei.ItemSorter; -import codechicken.nei.ItemSorter.SortEntry; -import codechicken.nei.LayoutManager; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.GlStateManager; - -import java.awt.*; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import static codechicken.lib.gui.GuiDraw.drawStringC; -import static codechicken.lib.gui.GuiDraw.getMousePosition; - -public class GuiItemSorter extends GuiOptionPane { - public class SortItem { - public double ya; - public double y; - public SortEntry e; - - public SortItem(SortEntry e) { - this.e = e; - y = slotY(); - } - - public int slotY() { - return GuiItemSorter.this.slotY(list.indexOf(e)); - } - - public void update(int my) { - ya = y; - if (dragging && this == dragged) { - y = dragstarty + my - mouseclickedy; - } else { - y = MathHelper.approachExp(y, slotY(), 0.4, 20); - } - } - - public boolean contains(int my) { - my -= drawBounds().y; - return my >= y && my < y + 20; - } - } - - public Option opt; - public List slots = new ArrayList(); - public List list; - - boolean dragging; - public SortItem dragged; - public int mouseclickedy; - public double dragstarty; - - public GuiItemSorter(Option opt) { - this.opt = opt; - list = ItemSorter.fromSaveString(opt.renderTag().getValue()); - for (SortEntry e : list) { - slots.add(new SortItem(e)); - } - } - - public int slotY(int slot) { - return 2 + slot * 24; - } - - @Override - public int contentHeight() { - return slots.size() * 24; - } - - @Override - public void drawContent(int mx, int my, float frame) { - Rectangle w = drawBounds(); - - for (SortItem item : slots) { - if (item != dragged) { - drawItem(w, item, mx, my, frame); - } - } - - if (dragged != null) { - drawItem(w, dragged, mx, my, frame); - } - } - - public void drawItem(Rectangle w, SortItem item, int mx, int my, float frame) { - double y = MathHelper.interpolate(item.ya, item.y, frame); - GlStateManager.translate(0, y, 0); - Rectangle b = new Rectangle(w.x, w.y, w.width, 20); - boolean mouseOver = itemAt(w.x + mx, w.y + my) == item; - - GlStateManager.color(1, 1, 1, 1); - LayoutManager.drawButtonBackground(b.x, b.y, b.width, b.height, true, mouseOver ? 2 : 1); - drawStringC(item.e.getLocalisedName(), b.x, b.y, b.width, b.height, mouseOver ? 0xFFFFFFA0 : 0xFFE0E0E0); - - GlStateManager.translate(0, -y, 0); - } - - @Override - public String getTitle() { - return opt.translateN(opt.name); - } - - @Override - public GuiScreen getParentScreen() { - return opt.slot.getGui(); - } - - @Override - public void updateScreen() { - super.updateScreen(); - - int my = getMousePosition().y; - for (SortItem item : slots) { - item.update(my); - } - - if (dragging) { - int nslot = (int) MathHelper.clip((dragged.y - (2 - 12)) / 24, 0, slots.size() - 1); - if (nslot != list.indexOf(dragged.e)) { - list.remove(dragged.e); - list.add(nslot, dragged.e); - opt.getTag().setValue(ItemSorter.getSaveString(list)); - if (opt.activeTag() == opt.getTag()) { - ItemSorter.list = new ArrayList(list); - } - } - } - } - - public SortItem itemAt(int mx, int my) { - if (!pane.windowBounds().contains(mx, my)) { - return null; - } - - if (dragged != null && dragged.contains(my)) { - return dragged; - } - - for (SortItem item : slots) { - if (item.contains(my)) { - return item; - } - } - - return null; - } - - @Override - protected void mouseClicked(int x, int y, int button) throws IOException { - super.mouseClicked(x, y, button); - - if (!dragging && button == 0) { - SortItem item = itemAt(x, y); - if (item != null) { - dragging = true; - dragged = item; - mouseclickedy = y; - dragstarty = item.y; - } - } - } - - @Override - protected void mouseReleased(int x, int y, int button) { - if (button == 0) { - dragging = false; - } - } - - @Override - public List handleTooltip(int mx, int my, List tooltip) { - if (!dragging) { - SortItem item = itemAt(mx, my); - if (item != null && item.e.getTooltip() != null) { - tooltip.add(item.e.getTooltip()); - } - } - return tooltip; - } -} diff --git a/dependencies/main/java/codechicken/nei/config/GuiNEIOptionList.java b/dependencies/main/java/codechicken/nei/config/GuiNEIOptionList.java deleted file mode 100644 index ca751a0012..0000000000 --- a/dependencies/main/java/codechicken/nei/config/GuiNEIOptionList.java +++ /dev/null @@ -1,54 +0,0 @@ -package codechicken.nei.config; - -import codechicken.core.gui.GuiCCButton; -import codechicken.nei.util.LogHelper; -import net.minecraft.client.gui.GuiConfirmOpenLink; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.GuiYesNoCallback; - -import java.awt.*; -import java.net.URI; - -public class GuiNEIOptionList extends GuiOptionList implements GuiYesNoCallback { - private GuiCCButton patreonButton; - - public GuiNEIOptionList(GuiScreen parent, OptionList optionList, boolean world) { - super(parent, optionList, world); - } - - @Override - public void resize() { - super.resize(); - patreonButton.x = width - 73; - patreonButton.y = height - 23; - } - - @Override - public void addWidgets() { - super.addWidgets(); - add(patreonButton = new PatreonButton(0, 0, 70, 20).setActionCommand("patreon")); - } - - @Override - public void actionPerformed(String ident, Object... params) { - if (ident.equals("patreon")) { - GuiConfirmOpenLink gui = new GuiConfirmOpenLink(this, "patreon.com/cb", 0, true); - gui.disableSecurityWarning(); - mc.displayGuiScreen(gui); - } else { - super.actionPerformed(ident, params); - } - } - - @Override - public void confirmClicked(boolean yes, int id) { - if (yes && id == 0) { - try { - Desktop.getDesktop().browse(new URI("http://patreon.com/cb")); - } catch (Exception e) { - LogHelper.errorError("Failed to open patreon page", e); - } - } - mc.displayGuiScreen(this); - } -} diff --git a/dependencies/main/java/codechicken/nei/config/GuiOptionList.java b/dependencies/main/java/codechicken/nei/config/GuiOptionList.java deleted file mode 100644 index dd9f25bd30..0000000000 --- a/dependencies/main/java/codechicken/nei/config/GuiOptionList.java +++ /dev/null @@ -1,284 +0,0 @@ -package codechicken.nei.config; - -import codechicken.core.gui.GuiCCButton; -import codechicken.core.gui.GuiScreenWidget; -import codechicken.core.gui.GuiScrollSlot; -import codechicken.lib.vec.Rectangle4i; -import codechicken.nei.LayoutManager; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.GlStateManager; - -import java.awt.*; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; - -import static codechicken.lib.gui.GuiDraw.*; -import static net.minecraft.util.text.translation.I18n.translateToLocal; - -public class GuiOptionList extends GuiScreenWidget { - public class OptionScrollSlot extends GuiScrollSlot { - public ArrayList