Compare commits

..
1268 Commits
Author SHA1 Message Date
cpw 79a0c5e559 Merge branch 'mc179' 2014-06-26 14:54:41 -04:00
cpw 1c5db211af Update for release 1.7.10 2014-06-26 14:48:46 -04:00
LexManos 1e0134a1ca Merge pull request #455 from rumickon/feature
Fix Eclipse launching attribute
2014-06-26 10:21:19 -07:00
cpw 8f7adced47 Fix library issue. mojang auth requests newer libs, so we get them at dev time. But the
mojang json doesn't refer them at runtime. So there's a lib mismatch. Fortunately all are
available at mojang, so we can update the json.
2014-06-25 18:28:50 -04:00
cpw f45f18b1d7 Fix accessing guava from transformers 2014-06-25 17:49:00 -04:00
cpw 96a7e14a45 Merge branch 'master' into mc179 2014-06-25 17:03:05 -04:00
cpw 7eb36a1481 Merge branch 'bspkrsgui' 2014-06-25 17:02:40 -04:00
rumickon bc420dcb0b Fix Eclipse launching attribute 2014-06-25 23:49:17 +04:00
cpw 50164db5c1 Merge branch 'master' of github.com:bspkrs/FML into bspkrsgui 2014-06-25 13:09:10 -04:00
cpw 0cd5ef6bb7 Fix NPE when no FMLAT is defined 2014-06-25 09:11:07 -04:00
cpw 8a240ec3c7 Merge branch 'master' into mc179
Conflicts:
	src/main/java/cpw/mods/fml/relauncher/FMLSecurityManager.java
2014-06-24 22:18:03 -04:00
cpw 5d6dc5dce3 Fix up other exit points. Should stop process hangs for clean exits. 2014-06-24 22:15:11 -04:00
cpw e152984538 Add support for mod access transformers without a coremod requirement.
Use the "FMLAT" manifest attribute, with a space separate list of files
that live in the 'META-INF' directory. They should conform to standard AT
formatting.
2014-06-24 21:34:07 -04:00
cpw 06ab104c9a Force the descriptors to the right type for the field they're referencing. Fixes
the sand issue
2014-06-24 18:34:34 -04:00
Christian e06d7e47e0 Harden the security manager and make it less spammy. Clean up a bunch of deprecation warnings from guava. 2014-06-21 23:03:41 -04:00
Christian 17f537bf88 remove the deprecation patches. The methods are gone now 2014-06-21 22:48:15 -04:00
Christian d95aff3774 Merge branch 'master' into mc179 2014-06-21 22:44:38 -04:00
Christian 2b1438dbf1 Fix server side to write properly 2014-06-21 22:44:25 -04:00
Christian 547e56bd7b Pre4 update 2014-06-21 21:13:22 -04:00
Christian f65f57d5d5 Fix up some patching bugs. Fully functional @ pre3 2014-06-21 15:55:32 -04:00
Christian dff2204558 FML now sets a security manager (FINALLY!). It's primary purpose at this point is to catch
rogue calls to System.exit so that they can cause a proper crash report, rather than
silently abandoning the game.
2014-06-15 16:37:42 -04:00
Christian 7219061b05 Also patch in warnings for Vec3Pool - similarly removed. 2014-06-13 08:51:07 -04:00
Christian 6f66d06743 Checking in pre3 work 2014-06-12 21:13:26 -04:00
Christian 1a99ec7db6 Deprecate getAABBPool so people can stop using it in mods. Failure to do so will result in 1.7.10 upgrade incompatibility. Use getBoundingBox instead. 2014-06-08 21:30:47 -04:00
Christian d4f44d6b2a Tweak bad packet warning some. Makes it a bit more log friendly. 2014-06-08 14:35:16 -04:00
Christian 480bf2c1d0 Fix REPLY handling in SimpleNetworkWrapper. Closes #440 2014-06-05 14:31:44 -04:00
bspkrs 701d98eafa Added config GUI system 2014-06-04 17:36:47 -04:00
Christian 953f083978 Merge branch 'master' into mc179 2014-06-03 13:04:49 -04:00
Christian e3ce211cc7 Nullcheck the dispatchers on players. Should stop some crashes when spamming connectivity. 2014-06-02 22:12:13 -04:00
Christian cd715efca1 Log the queue as well 2014-05-27 18:56:02 -04:00
Christian 585d3a91e1 If a packet is not handled by the channel, log it, and clear it.
Could be spammy, but this is a serious bug and could cause a memory leak
otherwise.
2014-05-27 17:59:53 -04:00
Christian 1d41aa978d Fix the side for the compatibility check. Should result in green ticks finally! 2014-05-26 14:57:14 -04:00
Christian 4512f8e5e3 Warn when the objectholder finds nothing in the registry. Helps debug mismatched names.
Also, actually make the scoping thing work with objectholder

Also handle Blocks.air as a special case. It should never be a valid block in the block registry.

Nothing can ever replace the default block registry block. It is disabled for replacement.

Air is properly skipped
2014-05-26 11:25:25 -04:00
Lex Manos 3aba56440a lastIndexOf, Note Don't code while sick. 2014-05-24 21:48:55 -07:00
Lex Manos 3a687f48b9 -.- Save File First. My Bad. 2014-05-24 21:11:08 -07:00
Lex Manos f07bf5cb30 Fixed deobfusication of nested inner classes. And removed legacy ModLoader remaps. 2014-05-24 20:44:25 -07:00
Christian 725d988e36 Add in the objectholder, autopopulated by FML based on simple rules. Allows
for reference driven substitution of mod blocks and items based on their
server running state.
2014-05-24 22:32:24 -04:00
Christian 31d726abad Fix the null networkHandler in the MessageContext 2014-05-24 16:54:48 -04:00
LexManos a9aa468457 Merge pull request #431 from diesieben07/at-invokevirtual
Make ATs replace INVOKESPECIAL when needed
2014-05-22 10:13:09 -07:00
diesieben07 c828bb63c5 Make AccessTransformer change INVOKESPECIAL to INVOKEVIRTUAL when making methods visible 2014-05-22 14:25:23 +02:00
Christian d5af053edb First draft 1.7.9 support.
This is not modding minecraft. It's performing an update. Go away!
2014-05-17 16:30:13 -04:00
Christian 43e3ee1af1 Swap Listenerlist constructor around. Should fix parent resizing issue? 2014-05-14 14:22:51 -04:00
Christian 70570a863f Fix up possible CME 2014-05-13 15:11:50 -04:00
Christian 503da3a257 Don't consider null NetworkDispatchers. This should fix a bunch of fakeplayer issues.
Nothing to see here. No modding being done.
2014-05-13 08:14:21 -04:00
cpw 42713c66e5 Merge pull request #426 from sfPlayer1/master
Fix ObjectIntIdentityMap sporadically matching non-identical objects.
2014-05-12 10:50:20 -04:00
Player 8dbd1ae0a1 Fix ObjectIntIdentityMap sporadically matching non-identical objects. 2014-05-12 16:29:37 +02:00
Christian a8cbef2321 Finally hopefully fully kills the race condition causing a classcast
on slow machines.

This is me bugfixing. NOT MODDING! No! Stop it! I'm not!
2014-05-11 22:15:29 -04:00
Christian 5275cea844 Try and see if there is anything to the identityHashCode collision hypothesis. If you see this in your error messages, kindly let us know! 2014-05-10 14:53:08 -04:00
Christian d8b6adb259 Add a helper for casting some common collection types into generic form 2014-05-10 13:36:24 -04:00
Lex Manos 0c36868f92 Fix network disconnect with message on the client side in NetworkDispatcher. 2014-05-09 13:23:24 -07:00
Lex Manos f2fe80dc36 Fixed default network mod checking to allow client side mods without the server side. Mods wishing to REQUIRE server side components must specify a custom check handler using @NetworkCheckHandler 2014-05-09 13:22:54 -07:00
Christian cd43eacbb2 Ensure that the loadcontroller is ready to preinit. 2014-05-08 10:40:52 -04:00
Christian de546bdf6c Clean up some missing generic info
PS: NOPE: still not modding.
2014-05-08 10:36:01 -04:00
Christian b0eb1ef7c6 Split loadmods into loadmods and preinitmods, to allow resource loading to occur *always* between the two phases. This should fix
mods not being able to access resources during preinit.

PS: I'm still not modding.
2014-05-08 10:23:05 -04:00
Christian 738ce1d7cd Re-add removed genericiterable to clean a warning 2014-05-08 09:58:03 -04:00
Christian b9de9ebc96 Revert "Fix refreshResources not happening if an error occurs."
This reverts commit fff86ee9d3.
2014-05-08 09:56:43 -04:00
LexManos 362ec8dee7 Merge pull request #419 from Thog92/master
updated wrapper to gradle 1.12
2014-05-07 15:41:05 -07:00
LexManos ddc2cfbe86 Merge pull request #402 from AbrarSyed/patch-1
Added dependency examples to the shipped example mod's build.gradle.
2014-05-07 15:40:50 -07:00
AbrarSyed 542e9acec1 documented dependencies 2014-05-07 17:34:44 -05:00
Lex Manos 1436ac2f14 Fine use FMLCommonHandler. 2014-05-07 14:36:00 -07:00
Lex Manos c73a2076e3 Fix potential rance condition in connecting to vanilla servers as well. And move latch into client side only. 2014-05-07 13:54:22 -07:00
Lex Manos 3612ad0c25 Attempt to fix another race condition related to reading NetClientHandler. 2014-05-07 13:31:16 -07:00
LexManos 1d5fc60f82 Merge pull request #411 from matthewprenger/master
Update ExampleMod mcmod.info
2014-05-07 12:39:12 -07:00
Thog92 8555344eb3 updated wrapper to gradle 1.12 2014-05-06 22:03:44 +02:00
Lex Manos 251af1d09d Fixed memory leak on the client caused by Netty holding references to the World. Closes #415 #417 2014-05-05 22:14:13 -07:00
Christian b84d0760ae Fix display of mod status at the server 2014-04-30 22:47:10 -04:00
Christian 76d8d0e870 Fix mod version checking 2014-04-30 22:26:16 -04:00
Christian fff86ee9d3 Fix refreshResources not happening if an error occurs. 2014-04-30 21:55:55 -04:00
Christian 810b1f3075 Clean some generic warnings up. Make a generic list handler. Helpful for others I think too. 2014-04-30 21:55:55 -04:00
LexManos d0f8073fa5 Merge pull request #413 from sfPlayer1/master
backup+default block use fix
2014-04-30 10:12:21 -07:00
Player 2c56c32c5a Fix saving backups with the raw name.
Fix air block not being assigned as the default.
2014-04-30 09:44:09 +02:00
Matthew Prenger a70308ef41 Update mcmod.info 2014-04-28 22:27:52 -05:00
Player 78248da399 Registry: Treat all 1.6 entries as items. 2014-04-26 21:56:25 +02:00
Player 7ba167c500 Registry: Misc tweaks 2014-04-26 21:56:25 +02:00
Player 9b1cbab03b Registry: Crash earlier with conflicting name/object registrations. 2014-04-26 21:56:25 +02:00
Player d88b2aa0c5 prevent the world from getting saved twice at shutdown 2014-04-26 21:56:25 +02:00
Player 59a5adfdb3 Registry: Fix Block-before-ItemBlock allocation when loading 1.6 world saves, more validation 2014-04-26 21:56:25 +02:00
Player ddee7eb117 Fix vanilla bug causing integrated server saving from 2 threads concurrently after a crash 2014-04-26 21:56:25 +02:00
Christian 2b8d0f6680 Fix SimpleNetworkWrapper - this is not me modding,
I didn't realize it was broken until Pahimar told me.

Put an example in the docs.
2014-04-26 09:33:09 -04:00
Christian 7f01cf549b I'm still not modding. Player has contributed greatly to the 1.7 release of FML. He needs authorship credit. 2014-04-19 11:38:46 -04:00
Christian 77c254a6d9 I am not modding, I am fixing an annoyance. The MCP version has long since been 9.03. Also, the JSON from MC updated.. 2014-04-19 10:46:04 -04:00
LexManos 3b42b33b6e Merge pull request #400 from sfPlayer1/master
Fix various registry issues
2014-04-07 09:57:13 -07:00
Player 294c93212c Registry: Add support for registering ItemBlocks before their Blocks 2014-04-07 17:30:38 +02:00
Player 8e44006f43 Registry: Protect against putObject misuse, handle duplicate registrations better 2014-04-06 17:11:23 +02:00
Player c8a0b72eba Registry: Complain about missing mods when repairing broken worlds
Registry: Reduce console spam
2014-04-06 14:49:59 +02:00
Player c8a245a985 Registry: Fix debug info 2014-04-05 01:54:07 +02:00
Player c7adb42199 Registry: Repair mismatched ItemBlocks as well
Fix a few misc issues
2014-04-05 01:47:19 +02:00
Player f77632df35 Remove unneeded entity spawn debug logging. 2014-04-03 21:00:42 +02:00
Player c47fc3b382 Enable custom gui rendering only as required 2014-04-03 17:58:53 +02:00
Player fd6d55afcc Registry: Allow ignoring missing mods from the GUI, with confirm+backup
Registry: Add confirm+backup for automated corrupted id table fixup
Require the user to confirm loading from a backup level.dat
2014-04-01 21:56:53 +02:00
Player 9be92dcfcb Registry: Complain about bogus registrations 2014-04-01 14:40:24 +02:00
Player 49c623f59c initial attempt at a better way to ask the user in case of startup issues 2014-04-01 14:30:47 +02:00
Player 038fa17ad3 Merge branch 'master' of https://github.com/MinecraftForge/FML
Conflicts:
	src/main/java/cpw/mods/fml/client/FMLClientHandler.java
	src/main/java/cpw/mods/fml/client/GuiModItemsMissing.java
	src/main/java/cpw/mods/fml/common/FMLContainer.java
	src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java
	src/main/java/cpw/mods/fml/common/registry/GameData.java
2014-04-01 07:00:20 +02:00
Lex Manos 58a4095f56 Update patches for Fixed FF in FG 1.2. 2014-03-31 16:02:54 -07:00
Player 6fd3c12a4a Registry: allow handling missing blocks/items regardless of the mod id 2014-03-31 04:09:59 +02:00
Player eb29d651eb Fix old 1.7 worlds with broken ID mappings 2014-03-30 17:17:54 +02:00
Player 7325aa5033 Registry: cleanup, fix missing id error GUI formatting 2014-03-27 08:30:55 +01:00
LexManos 89cda92561 Merge pull request #392 from AbrarSyed/master
Updated to ForgeGradle 1.2
2014-03-26 16:04:30 -07:00
AbrarSyed 385beb504d updated wrapper to gradle 1.11 2014-03-26 13:34:25 -05:00
AbrarSyed 2b46906ac5 updated example a little 2014-03-26 13:34:01 -05:00
Player 5eebd4df71 Registry: Implement support for remapping blocks/items to a new name. 2014-03-25 00:36:37 +01:00
Player fd9389015f Fix FMLMissingMappingsEvent.get 2014-03-24 21:47:25 +01:00
Player a82195772e Registry: Block IDs after failing to find a mapping for them 2014-03-24 21:16:36 +01:00
Player e58562d3ed Fix remaining issue with autoassigned Block and Item IDs overlapping. 2014-03-20 23:41:01 +01:00
AbrarSyed c3912836dc updated for ForgeGradle 1.2 2014-03-19 02:15:53 -05:00
LexManos 40270c881a Update README.txt 2014-03-18 01:54:32 -05:00
Lex Manos c2143dbeb1 Fix network close events never getting called. Closes #381 #382 2014-03-15 18:16:27 -07:00
Lex Manos f08b485852 Fix long standing deobf issue that caused announce-player-achievements property to have no effect on dedicated servers. 2014-03-11 01:57:44 -07:00
Lex Manos ef07de4f65 Fix hard link to DedicatedSerever when opening a LAN connection causing stalls on connecting. 2014-03-11 00:50:55 -07:00
Lex Manos b7ad532ab5 Re-enable post initalize texture pack reloading to allow Icons to be registerd through any init phase. 2014-03-03 23:23:55 -08:00
Lex Manos 399770e572 Kill the modEventTypes list, register anything that extends FMLEvent, Fixes MissingMappingEvent handler, and any future events added. 2014-02-25 12:30:29 -08:00
Lex Manos e8b60441cc Reload game settings after mod loading is finished to capture mod keybindings. Closes #378 2014-02-22 20:59:25 -08:00
Christian d0dd05a15c FML expands S3F to support payloads up to 2 megs in size. Should be transparent 2014-02-16 18:30:27 -05:00
cpw 572d32358a Merge pull request #373 from bloodmc/master
Prevent player data getting reset during disconnects.
2014-02-14 10:57:50 -07:00
cpw 33100d6bab Merge pull request #371 from bl4ckscor3/patch-1
Fix ExampleMod.java for build #1024+
2014-02-14 10:57:32 -07:00
bloodshot 45409bfa0c Prevent player dat files getting reset during disconnects.
Since FML nulls out the player's playerNetServerHandler during login, we need to
make sure that writePlayerData does not attempt to overwrite the player's dat file
if the player disconnects during the "Logging In" process.
2014-02-13 02:44:18 -05:00
Christian fa5f4c8842 Some argumentation 2014-02-08 22:41:02 -05:00
Christian 995c204338 Fix failing to load a world with missing mod blocks and items. There will be a way to force worlds to load
when stuff is missing, but for right now, it will fail as this is "world safe".
2014-02-08 22:37:40 -05:00
Christian c890206268 Try and handle removal of mods a bit better. Currently no way to allow a world which has missing
blocks to load - but i have the code in place to allow it i think.
2014-02-08 12:18:34 -05:00
bl4ckscor3 2aa73afa15 Fix ExampleMod.java for build #1024+ 2014-02-08 12:34:01 +01:00
Dan Roque 064b66af3d Prevent players from logging in until server has finished starting.
This improves server security as it guarantees no players will be
allowed to connect until the server has fully initialized.
2014-02-05 20:49:10 -05:00
Lex Manos 8c9e8b5270 Fix isRemote, this is integral to so many parts of the code, everyone knows it by this name, People should not change it. 2014-02-04 23:40:50 -08:00
Lex Manos b7b3450dcd Update MCP mapping snapshot to latest crowdsourced names. 2014-02-04 22:56:27 -08:00
Christian 6bb9b8b953 Clean up FMLEventChannel. Closes #367. 2014-02-04 20:01:44 -05:00
Lex Manos 03fb1879d7 Fix obf error when right clicking a Empty Map. 2014-02-04 12:49:18 -08:00
Christian cee0f0b811 Tweak so that writing to the context will automatically send a message back to
the originator in handshakeestablished.
2014-02-02 12:11:57 -05:00
Christian 359ac3ca2a Ensure we check both item and block registries when finding valid IDs. Should fix #365 2014-02-01 11:05:33 +00:00
Lex Manos d87822ad85 Bump gradle wrapper to 1.10 2014-01-29 21:04:55 -08:00
Christian 8633d780c9 And make a loud message if there isn't a modcontainer found, substitute Minecraft. In general, this can only happen
for coremods not properly registering their code. Closes #363
2014-01-25 06:20:09 -05:00
Christian ab199c5811 Try harder to find a mod container. 2014-01-25 06:17:14 -05:00
Christian 544320b8d2 Beginning of a saveinspectionhandler. 2014-01-20 22:27:03 -05:00
Christian 741e172ffe Log4j2 doesn't need debug level logging for itself anymore 2014-01-20 22:01:20 -05:00
Christian a7ca131a33 And don't spam NONE everywhere 2014-01-20 22:00:24 -05:00
Christian 8692ca17d1 Log4j2 logging context for things. This should help add context when things go wrong in mods. 2014-01-20 21:58:39 -05:00
Christian b6d95d704b Name the log files properly. fml-junk is an early startup annoyance I can't kill because log4j2. 2014-01-20 21:31:20 -05:00
Christian 458b0620b4 Log the bad packet in a prettier way. Also, don't show the authlib debug data in the log file. 2014-01-20 17:29:17 -05:00
Christian 675b5a0778 And turn down some more logging, now we have useful logging back again.. 2014-01-20 16:09:34 -05:00
Christian 1c793abe0e Fix derp with networkcheck 2014-01-20 16:06:50 -05:00
Christian a355eecb2c Add in error logging for outbound messages. Fix bug with indexedcodec NPE 2014-01-20 16:02:26 -05:00
Christian 9a8d16b66e Fix log4j2 config. Fix server gui to *show* logging. Fix log spamminess in the console. Fix bug in servergui that can cause deadlock. 2014-01-20 15:09:24 -05:00
Christian 5719b9ec53 Fix reply handling. Make the proxy message available for subclasses of indexedcodec. Fire user events into the network
event firing.
2014-01-20 11:58:14 -05:00
Christian 16d33d2989 Clean up and document outbound handler a bit better. Add in dispatcher target. Closes #361 2014-01-20 11:26:54 -05:00
Christian 32bb7315cc Add in example assets dir. Closes #308 2014-01-20 08:15:55 -05:00
Christian 3dfb54e066 Merge branch 'trait-optional' of github.com:RainWarrior/FML 2014-01-20 08:14:27 -05:00
Christian 79b04898d4 And restore suppressions. ABRAR, DON'T TIDY CODE!!!! 2014-01-20 08:09:02 -05:00
Christian 9d2e089df6 Merge branch 'logging' of github.com:AbrarSyed/FML into abrar-borked 2014-01-20 08:06:45 -05:00
Christian 35a38d7840 Make sidedproxy support non-public fields. Closes #344 2014-01-20 07:55:26 -05:00
Christian 6a695c4348 Try and stop the epic channel closed spam at close time. Closes #353 2014-01-20 07:53:09 -05:00
Christian a62374d4ac findBlock should now return null, not the default block, if the thing being looked for is not found. Closes #352 2014-01-20 07:49:44 -05:00
Christian 3d26f28bcf Allow connection when server is apparently offline. Might allow :NOFML circumvention though. Hmmm. Closes #359 2014-01-20 07:46:17 -05:00
Christian 5adacc3b33 Check the mod, not it's container, in the check handler. Closes #358 2014-01-20 07:42:35 -05:00
Christian 7ac5bddbc3 Allow indexed messages to validate themselves. Also, catch exceptions from
an embedded channel, and cause them to close the connection. It's ugly, but
it means that the client doesn't crash if it connects to a screwy bungycord that's trying a 1.6 handshake for some reason.
2014-01-19 22:08:19 -05:00
Christian 7907e16e96 Add a type adapter for artifact version. Should fix #354 2014-01-19 10:49:28 -05:00
cpw 79d42fca8d Merge pull request #355 from jk-5/errorhandling
Throw an exception when discriminator is not found
2014-01-19 07:38:41 -08:00
cpw dfc0899ec6 Merge pull request #357 from jk-5/sharable
Make NetworkEventFiringHandler sharable
2014-01-19 07:37:52 -08:00
jk-5 2524045728 Make NetworkEventFiringHandler sharable
Fixes #356
2014-01-19 12:27:31 +01:00
jk-5 3557fe31c9 Throw an exception when discriminator is not found 2014-01-19 11:21:24 +01:00
Christian 449ac98b77 SSP Worlds updating from 1.6 will now pop a warning message before loading, and will capture a timestamped
zip file in the minecraft dir before starting to load. Allows for people to test updates.
2014-01-18 22:25:35 -05:00
Abrar Syed f23eba4352 put max number of FML log files to 3 2014-01-19 00:53:58 +00:00
Abrar Syed f0132a6f3b changed fml log level to all 2014-01-19 00:49:47 +00:00
Lex Manos 444a7d7fa1 Move placement of single player world load hook to fix NPEs. 2014-01-18 13:05:18 -08:00
Christian 2a5a8d0cd0 Fix memory leak?! 2014-01-17 23:36:03 -05:00
Christian 275ccac6f1 Fix NPE at startup 2014-01-17 23:35:53 -05:00
Christian ff7b5845e7 Clean up some warnings about @Override 2014-01-17 23:19:22 -05:00
Christian 7c5d62704a Make UniqueIdentifier final and add a hashCode. Closes #348
Clean up language registry. It can be used to access all translations of mods on client or server.
Auto loads from assets files.
2014-01-17 17:47:30 -05:00
Christian 53557dcd05 Put logging exception handlers on all channel inbounds. Fix problem with failure to login. Closes #350 2014-01-17 17:00:55 -05:00
Christian 9c96ca4402 Fire a custom packet channel registration/deregistration event, for any mods that care about that
kind of thing
2014-01-16 19:45:42 -05:00
Christian a429e106dd Fix bug with SSP, and hook so we can do confirmation of world loading, as well as other things 2014-01-16 18:15:45 -05:00
Christian 9cab2ab36e Add in some tests and examples for the "simple" network stuff 2014-01-16 18:07:25 -05:00
Christian 30882b0c1d Clean up some warnings. Add in simple network impl 2014-01-16 18:06:36 -05:00
Christian c013870b1d Merge branch 'simplenet' 2014-01-16 14:59:13 -05:00
Christian dd17979a2f Fix bukkit connectivity issue. 2014-01-16 14:58:28 -05:00
Christian e14efe786f Some fixes and tweaks 2014-01-16 09:14:39 -05:00
Lex Manos a4686b1261 Added basic Mojang account authentication support for development time login. 2014-01-14 16:49:03 -08:00
LexManos e344303ec7 Merge pull request #346 from Jezzadabomb338/master
At the request of AbrarSyed.
2014-01-13 23:11:42 -08:00
Jezzadabomb b362e8a273 At the request of AbrarSyed. 2014-01-14 15:39:24 +11:00
Christian 5da6dcc7e3 Divert connection through FML, so we can deny connections to servers that don't want us 2014-01-13 13:47:18 -05:00
Christian 10d056a494 Fix possible NPE derp 2014-01-13 13:46:22 -05:00
Christian fc69bcf280 Fix up privacy derp in TickEvent. Closes #343 2014-01-13 08:43:33 -05:00
Christian 80b00dc796 Fix openGui. Closes #342 2014-01-13 08:40:56 -05:00
Christian 28293b29ea Add in a simple(ish) event driven network handling system. Register using newEventDrivenChannel
and you'll get a simple network handler that will fire events at the subscriber(s) of your
choice, whenever a packet is received. You'll also get some convenience methods for sending
to things.
2014-01-12 13:20:41 -05:00
Christian 584c0f368b Fix potential ordering issue, clean up some imports 2014-01-11 22:01:01 -05:00
AbrarSyed fc025a7b73 Logging Changes 2014-01-11 16:43:14 +00:00
RainWarrior 4aa2416ce5 Propagate Optional method removal to trait implementation classes 2014-01-10 00:56:00 +04:00
Christian 717a8d6945 Fix csv string vs list of strings. Thanks immibis. Closes #334 2014-01-09 14:55:52 -05:00
cpw a89939e57e Merge pull request #336 from jadar/master
added override toString method for getting full name.
2014-01-09 11:54:54 -08:00
Christian 43068eb986 Fix TargetPoint to be static 2014-01-09 08:41:52 -05:00
Christian dd098854b0 Fix the keybinding array to the right one 2014-01-09 08:40:42 -05:00
Christian d5bfd69e35 Fix problem with connecting to vanilla.
SHOW what's modded and what's vanilla in the list. Hooks that make the blocking work to come
2014-01-06 23:48:53 -05:00
Jadar 96c19b3580 undid readme change 2014-01-06 15:58:42 -06:00
Jadar acf74a3403 changed the readme to reflect new setup task. 2014-01-06 11:09:34 -06:00
Jadar 1db3daa0e8 added override toString method for getting full name. 2014-01-06 10:25:13 -06:00
Lex Manos 0d810c01fa Mark jopt needed on the server, herp derp, blame Abrar! 2014-01-05 19:02:47 -08:00
Christian 9de9a15530 Fix stupid hardcoding derp 2014-01-03 23:04:24 -05:00
Christian 5317672631 Add a utility method for finding the channel handler name based on type. Should fix naming weirdnesses. 2014-01-03 22:57:36 -05:00
Christian 6f1da6550e Fix up mcpname derp in GuiScrollingList. 2014-01-02 22:44:26 -05:00
Christian b51fb91355 Merge branch 'patch-1' of github.com:airbreather/FML 2014-01-02 22:21:25 -05:00
Christian 779cd05aa1 Tweaks 2014-01-02 22:18:02 -05:00
Christian 7bf119e1e5 Fix up readmes and credits. We no longer support modloader. 2014-01-02 22:18:02 -05:00
iChun fa4f3015a0 Added transparent background for GuiIngameModOptions as per cpw's request. May not compile due to manual de-mcp-fication. 2014-01-02 22:18:02 -05:00
Christian fbc1f8f6f9 Config GUIs in the modlist now work. 2014-01-02 11:51:16 -05:00
airbreather c5e29b574a Avoiding redundant calls to LogManager 2014-01-01 11:40:32 -05:00
Christian 3113138bd1 Tweak button positions. 2014-01-01 02:09:40 -05:00
iChun ab5eb3ccff Fix button size for GuiModList 2014-01-01 14:16:23 +08:00
Christian cdd9d92a4f Starting work on the actual GUI. Still work to do. Needs an API. 2014-01-01 00:57:24 -05:00
Christian b3f98d1ee0 Fix derpiness with Mods button when Realms is available 2013-12-31 20:21:28 -05:00
Christian 21b13d6351 Lots of network cleanup. Gui packets now work too! 2013-12-31 19:55:41 -05:00
Christian 22ba6fda5e Expose the nethandler in a few places, and pull out FMLEmbeddedChannel, exposing a utility method on it.
More to come.
2013-12-31 09:45:26 -05:00
Christian f36152398d Add in the tweakclass, fix the json for lzma @ the server. 2013-12-30 13:06:59 -05:00
Christian 5d069629cf Allow itemstacks for furnace recipe inputs. Allow passing extra arguments through registerblock into the itemblock constructor. 2013-12-28 18:04:30 -05:00
Christian 061288909d Fire simple network connect/disconnect gameevents. 2013-12-28 17:51:40 -05:00
Christian 6a5f9e135f Fix example mod code for 1.7 2013-12-28 13:44:37 -05:00
Christian 53a1f98414 Attempt to load old pre-1.7 worlds. ENSURE YOU HAVE A BACKUP! 2013-12-27 11:48:55 -05:00
Christian 34819c9303 Make gradlew executable on linux 2013-12-27 11:26:46 -05:00
Christian ec316f113f AT for renderblocks 2013-12-27 00:08:49 -05:00
Christian f8d6213829 Update render registry 2013-12-27 00:07:48 -05:00
Christian 268bbabee6 Fix handling world reloads when new stuffs are added 2013-12-26 12:42:40 -05:00
Lex Manos c180d9b157 Add 1.7.2 base json, Gradle will automatically download updated versions of this. Keeping it in the repo allows us to see what base json we have built our jsons off of. And if it changes update accordingly. 2013-12-23 22:36:47 -08:00
Christian 7d3b1250e8 Fix handshaking properly. Also, fix ID syncup. It now will completely freeze the idmap after preinit.
This frozen map is used to inject "new" stuff into existing serverside worlds. Interesting sideeffect: remote
servers lacking things will change the client, to also LACK ids for those things. watch for -1 ids in your remap
events. Note: idmaps should be considered temporary per server instance. SERVERSTOPPED will restore "startup" state,
as will client logout.
2013-12-24 00:47:10 -05:00
Christian 156a9ae03a Fix build script 2013-12-23 20:24:54 -05:00
Lex Manos 58132ccda3 Add new required --accessToken to launch specs. 2013-12-22 18:35:50 -08:00
Christian f860c8ad3b bump to legacy launcher 1.9 with logging unification stuffs. 2013-12-18 11:15:53 -05:00
Christian 3e76dfba34 More tweaking on id stuffs at worldload 2013-12-18 11:15:03 -05:00
Christian 31ea100b29 Working on id missing handling 2013-12-18 08:34:44 -05:00
Lex Manos ef3856f9a3 Update patches for Gradle's rename rewrite: MinecraftForge/ForgeGradle@19e7acf2a2 2013-12-18 04:01:37 -08:00
Christian e4b63a1801 IWorldGenerator now has an ordering at registration time. This means the order of worldgen should be much more stable. 2013-12-17 11:42:54 -05:00
Christian 85516d9588 ICraftingHandler, IPickupHandler are now both events. 2013-12-17 11:24:57 -05:00
Christian a17489172c Code to disable mods at runtime, or other times. 2013-12-17 10:51:00 -05:00
Christian 32561265fc Ticks, Player events, keybindings, all migrated to the new event driven system. 2013-12-16 23:18:00 -05:00
Christian 0b419ac79c Fire a user event down the channels when a handshake has occured. 2013-12-16 20:00:01 -05:00
Christian 4071ff38af Patch some GUIs. We're gonna add some basic mod gui config support. 2013-12-16 11:48:39 -05:00
Christian a2b324beb2 Copy eventhandler from Forge into FML. It is going to replace a lot of the runtime event systems. 2013-12-16 11:48:09 -05:00
Christian 557357fe17 Update for log4j2 2013-12-16 11:47:48 -05:00
Christian 3b2994a3de Some patching touchups 2013-12-13 00:18:05 -05:00
LexManos 0098c57f94 Merge pull request #316 from AbrarSyed/patch-4
Update shiped ForgeGradle for 1.7
2013-12-12 17:23:04 -08:00
Lex Manos 55aa337f95 Rename synthetic bridge methods, these methods are not decompiled, but need to reobf correctly cross the recompile boundary. 2013-12-12 17:18:04 -08:00
Abrar Syed df870c1a33 Update shiped ForgeGradle for 1.7 2013-12-12 17:11:37 -06:00
Christian b852e30285 First functional release under reobfuscation. 2013-12-12 18:01:09 -05:00
Christian 7ea571f593 Fix AT, Fix exc. Almost works now! 2013-12-12 01:39:30 -05:00
Lex Manos 7a4ceebf5e Kill old patches and add rejects to ignore file. 2013-12-11 20:39:15 -08:00
Christian 31efcfc3b2 Clean up patches for latest exc. 2013-12-11 23:03:30 -05:00
Christian 49cb893d12 Fix exc this time *sigh* 2013-12-11 22:58:46 -05:00
Christian 009d4dee23 Fix the exc file. Fix the deobfremapper for handling inner classes. 2013-12-11 22:54:51 -05:00
Christian 3e278acb71 Fix stupid possible compiler error. 2013-12-11 20:17:08 -05:00
Christian d0d31d9575 SpawnAdjustment packet. Clean up stuffs. No more compile errors. 2013-12-11 19:29:52 -05:00
Christian ef492407ef Entity spawning works. 2013-12-11 18:46:25 -05:00
Christian cd417c6786 Fixed remote and local connections work with mods now. 2013-12-11 12:35:08 -05:00
Christian 89e4e483c2 Add in a remapping event for mods to consume. 2013-12-10 19:25:49 -05:00
Christian fd36f50d82 Cleanups 2013-12-10 17:29:26 -05:00
Christian 1d71c017f4 ID syncing. 2013-12-10 14:32:06 -05:00
Lex Manos 99c681ad87 Did it manually, forgot it needed the end comma 2013-12-09 20:49:37 -08:00
Lex Manos 57f7f1d7ab Update for fixed Enum cleaning and names. 2013-12-09 20:44:17 -08:00
Lex Manos b2550b8a69 Add mappings for Items/Blocks fields. 2013-12-09 20:43:57 -08:00
Lex Manos a30f173627 Add sonatype snapshots repo for SpecialSource snapshots. 2013-12-09 20:43:27 -08:00
Christian 2aaaeba15e ID loading from the server save now works. 2013-12-09 21:36:49 -05:00
Christian 9c96a0a10a More network stuff, partially done id syncing. 2013-12-09 01:22:24 -05:00
Christian f5c38e2359 OK, network channels appear to be working well for both dedi and integrated servers.
The beginnings of the new mod structure too.
2013-12-06 14:52:33 -05:00
Christian e544adba5c More cleanup. Bidirectional server <-> client network works for mods as well as FML|HS now. 2013-12-06 11:17:40 -05:00
Christian 58f7487cfa Check in patches. Add in some network timeout tweaking values so you can debug the network. 2013-12-06 08:07:09 -05:00
Christian 9f928963f2 A network design I like. It uses the netty embedded channel to allow mods to build channel pipelines on top of
custom payload packets.
2013-12-06 03:11:03 -05:00
Christian 38cec7a11f The basic network handshaking for FML is done. All scenarios seem to work. 2013-12-04 00:11:08 -05:00
Christian 7ab3c3a37c Update gitignore 2013-12-02 23:54:15 -05:00
Christian 53127eec30 Merge branch 'master' of github.com:MinecraftForge/FML
Conflicts:
	install/build.gradle
	patches/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java.patch
	patches/minecraft/net/minecraft/network/NetServerHandler.java.patch
2013-12-02 23:52:27 -05:00
Christian 30d532f4fc Pass 1: Most patches are restored.
NOTES: 1. Network is completely broken. 2. GameRegistry is partially broken. 3. ID sync is not in.
2013-12-02 23:48:26 -05:00
cpw 01fb451b69 Merge pull request #311 from AbrarSyed/patch-3
fix derp in example builscript
2013-11-27 02:13:42 -08:00
Abrar Syed 3714426e19 fix derp in example builscript 2013-11-26 14:23:31 -06:00
Lex Manos c2b919d339 Don't validate signatures in dev env. 2013-11-20 13:18:26 -08:00
Lex Manos c4b8a393f9 Make the working directory the root of the eclipse workspace. 2013-11-17 19:26:21 -08:00
LexManos 30894f7afa Merge pull request #307 from AbrarSyed/master
updated samples
2013-11-17 17:58:01 -08:00
AbrarSyed e9a7660cb8 updated samples 2013-11-17 18:21:24 -06:00
LexManos 4d46abf761 Merge pull request #306 from MinecraftForge/1.6.4
Actually do it correctly. Should be more forge friendly now.
2013-11-17 10:04:27 -08:00
Christian 23baf3a8ce Actually do it correctly. Should be more forge friendly now. 2013-11-13 19:10:11 -05:00
Christian c6a21d0d62 Merge branch '1.6.4' 2013-11-13 07:55:12 -05:00
Christian da72640c7e Way to go, missing import. *sigh* 2013-11-13 07:45:37 -05:00
Christian b7f34629c3 Don't try and open GUIs on the server. 2013-11-12 18:04:25 -05:00
Christian 5500d69b77 Merge branch '1.6.4' 2013-11-12 17:02:08 -05:00
pahimar 6af42bc656 Add in null protection for client/server sides of handleChat 2013-11-11 14:12:02 -05:00
Christian e19fcb8844 Kill more references to modloader. 2013-11-10 13:15:26 -05:00
Christian 0a62333890 Remove all public all the time from Minecraft. It is unnecessary with ModLoader gone. DEAL WITH IT. File AT public requests, make a coremod, whatever. This needed to die. 2013-11-10 12:01:26 -05:00
Christian e7512f13e4 Deprecation cleanup. Bye bye more modloader stuffs 2013-11-10 11:58:34 -05:00
Christian 4708d77c98 First pass : kill modloader, clean up warnings 2013-11-10 11:49:06 -05:00
Lex Manos 9b1d2bdd13 Join the developers list in the pom and fix the client run configs in the workspace. 2013-11-09 19:22:17 -08:00
LexManos a6dc03aa7e Merge pull request #302 from AbrarSyed/patch-1
Update 1.6.4-rel.json
2013-11-09 19:15:34 -08:00
Abrar Syed 6cd8349542 Update 1.6.4-rel.json 2013-11-09 21:14:58 -06:00
Christian 976c589c78 Change the build to capture an MCP version, also, tweak the sources so mavenLocal can be used for ForgeGradle 2013-11-09 20:00:05 -05:00
Christian 24ec338a51 Fix license and naming 2013-11-09 14:28:54 -05:00
AbrarSyed 4f634855ac added src distribution gradle file 2013-11-09 14:28:54 -05:00
Lex Manos 9f01e3407e Move to install to not clutter root directory with the .bat and .sh files I know are coming. 2013-11-09 14:28:54 -05:00
Lex Manos adeaeb74aa Include eclipse template workspace, for packaging in src distro. 2013-11-09 14:28:54 -05:00
Lex Manos e13c3966e0 Add gradle wrapper 2013-11-09 14:28:53 -05:00
Lex Manos 02c3b4e74b Publish to repo folder for local testing. 2013-11-09 14:28:53 -05:00
AbrarSyed 89a07d3668 Step 3: The Rebirth 2013-11-09 14:28:53 -05:00
Lex Manos b52eb6d699 Step 2: The Reformation 2013-11-09 14:28:53 -05:00
AbrarSyed 3281faf2be Step 1: The Purge 2013-11-09 14:28:53 -05:00
Christian 3d25b4e793 Add in the ability to strip interface references for specific interfaces - this is probably mostly useful for
scala scenarios where sythetic methods are generated and is not a substitute for using Optional.Method where appropriate.
Closes #300
2013-11-09 14:27:15 -05:00
Christian f4532410ec Change a couple of warnings, as a prelude to 1.7- preinit is now required for all GameRegistry activity, and every item and block REQUIRES registration. 2013-11-06 16:18:41 -05:00
Christian 8f87021b0f Fix derp with custom properties. They work now! 2013-11-05 22:23:24 -05:00
Christian bc57ff9e83 Fix recursive API dependency resolution. Allows nested APIs, such as BuildCraft's 2013-10-31 09:39:34 -04:00
Christian de8ab934d8 Fix up duplicate entries 2013-10-30 22:46:19 -04:00
Christian 81fe1c9682 Add in an API marker for API type packages.
This does several things:
1. Packages marked as API will generate a new "modid" (the provides) that can be depended on.
2. Packages marked as API will be searched systemwide, and anything declaring that package (even without the API marker)
will get an implicit dependency on the API package.
3. The API package itself will get a soft dependency on the "owner" package.

@Optional elements can refer to the API packages instead of a concrete mod as well.
2013-10-30 22:20:28 -04:00
Christian 58a299aabc Attempt to inject coremods as tweakers, so both can share a dependency ordering 2013-10-27 13:28:50 -04:00
Christian 243a21a353 Wrapping coremods as tweakers. Part 1. 2013-10-20 11:53:07 +02:00
Christian f0dc530b28 Fix up documentation of VersionCheckHandler - it only ever accepted a String and only works on the NetworkMod annotated class 2013-10-20 11:45:00 +02:00
Christian dac7f590ea Modify ordering of networkmod registration and mod instantiation. This fixes VersionCheckHandler logging an incorrect failure message due
to NPE.
2013-10-20 11:41:28 +02:00
Lex Manos bf54d4d667 Make each mod's EventBus log a child of it's main logger. 2013-10-19 18:24:24 -07:00
Christian da4337efbf Fix up handling the new method signature data for NetworkCheckHandlers 2013-10-14 21:28:15 -04:00
Christian f92962bbbb Use null to empty, so missing values work. *sigh* 2013-10-13 22:36:47 -04:00
Christian 2714da1022 Primitive capability for tweakers to order. Add a "TweakOrder" integer
property to your manifest, or accept the default of zero.
2013-10-12 10:28:11 -04:00
LexManos 96be82343c Merge pull request #280 from mc10/patch-1
Very minor style fixes
2013-10-09 20:56:05 -07:00
Kevin Ji 58577775d2 Very minor style fixes
Replacing tabs with spaces consistently, making brace styles consistent, etc.
2013-10-09 19:53:50 -07:00
Christian fc3e7647d2 Support, and fix up, interface lists for Optional 2013-10-09 13:58:14 -04:00
Lex Manos a381874bb9 Delay sound system backend initalization to speed up startup and prevent race condition on some computers. 2013-10-06 11:13:07 -07:00
Christian 55525f6d2e ModLoader is officially deprecated. It will all cease to be with 1.7. 2013-10-06 11:06:31 -04:00
Christian bc64ceabef Optional shouldn't be constructable itself. It's purely a wrapper thing. 2013-10-06 10:56:47 -04:00
Christian 63ba3aa009 Add in support for Optional interfaces and methods. Be gone coremods! 2013-10-04 17:20:05 -04:00
Christian 5265e34a35 Fix null killing the server 2013-09-29 15:51:38 -04:00
Lex Manos 35ab9f52b0 Fix md5s for new checksums.sha1 in scala libraries. 2013-09-28 19:47:32 -07:00
Christian 9b55f1f48f Attempt at a shared modlist implementation - should allow visibility between liteloader and fml for "mod list display" 2013-09-27 10:45:20 -04:00
Christian e356f4d713 Cross-modsystem compatibility fix with thanks to Mumfrey @ liteloader 2013-09-27 10:01:39 -04:00
Christian bfc25bc5da Add to both the classloader and the parent 2013-09-26 13:01:00 -04:00
Christian 9f0f9e7288 Fix deobf tweaker 2013-09-26 10:11:29 -04:00
Christian ce6404fd5b TYPOS!!! 2013-09-26 09:33:48 -04:00
Christian 8f18a3de9a Separate deobf tweaker so it runs last. Should fix problems with cascaded tweakers
expecting an obf environment.
2013-09-26 09:23:25 -04:00
Christian 9815d8c379 Update for launchwrapper 1.8 2013-09-25 16:40:59 -04:00
Christian 1d902df581 Use the negative cache in latest legacylauncher. 2013-09-25 11:46:11 -04:00
Christian 8e26c99de3 Add debugging for deobfuscation
Add negative caching for field and method maps. Should shortcut some work

Fix handling the case where a class doesn't exist, but still needs deobf

Ask the patch manager for the bytes for the class, not the classLoader

Fix up some more places where we should look for a patched class

Fix problem with empty source classes and runtime deobfuscation
2013-09-25 07:37:25 -04:00
Lex Manos fc8c3bef03 Update to new installer that uses xz compression and better support for non-standard jvms 2013-09-24 23:21:17 -07:00
Christian a4de22c1ad And use the parent that's actually going to be valid. *sigh* 2013-09-24 08:42:13 -04:00
Christian 70cffe6982 Herpaderp. Make addURL accessible. *sigh* 2013-09-24 07:33:11 -04:00
Christian 39620f1e41 Fix injection of tweaker into system 2013-09-23 13:33:16 -04:00
cpw 0e80fcb8f7 Merge pull request #284 from smcv/uninit
Fix NPE when loading second single-player world
2013-09-22 18:24:56 -07:00
Simon McVittie 4a94c2c71b Fix NPE when loading second single-player world
After leaving a single-player world, getServer() can return null, resulting
in the stack trace below, "Fatal errors were detected during the
transition from SERVER_STOPPING to SERVER_ABOUT_TO_START",
"The ForgeModLoader state engine has become corrupted" and the client
getting stuck forever.

Exception in thread "Server thread" java.lang.NullPointerException
at cpw.mods.fml.client.FMLClientHandler.serverStopped(FMLClientHandler.java:620)
at cpw.mods.fml.common.FMLCommonHandler.handleServerStopped(FMLCommonHandler.java:468)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:471)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:583)
2013-09-22 16:56:24 +01:00
Christian 79c39f8b7c Fix classpath for launchwrapper 1.7 2013-09-21 16:15:05 -04:00
Christian f6190e8752 Update workspaces for 1.6.4 2013-09-20 17:23:18 -04:00
Christian 0950b9fc84 Fix up a deep crash in the early server init hanging the client 2013-09-20 17:12:01 -04:00
Christian 25981706ef Update for MC 1.6.4 2013-09-20 16:25:12 -04:00
Lex Manos 82d896a35e Make final transformers actually work on methods as well. 2013-09-19 12:59:12 -07:00
Christian e7dd728f95 Format the log messages through MessageFormat. Thanks CovertJaguar for the pointer. Closes #282 2013-09-19 08:23:56 -04:00
Lex Manos 8f2e675581 Update the src distro's eclipse workspace. 2013-09-18 15:21:56 -07:00
Christian ff75416a32 Update mc_versions data and commands patch and eclipse workspace 2013-09-18 18:01:04 -04:00
Christian 95afc95b24 Update mcp mod info 2013-09-18 17:02:41 -04:00
Christian 34493b0d99 Update for real 1.6.3 update 2013-09-18 16:59:28 -04:00
Christian e77d2547ad Update for pre-ninja 1.6.3 update 2013-09-18 16:33:11 -04:00
Christian 40a34af431 Merge branch 'master' into newtweak 2013-09-18 14:49:53 -04:00
Christian 352117fd78 Update for new installer and thank you. 2013-09-17 21:56:25 -04:00
Christian 81328b6684 Add in support for using a mirror list and provide checksums for packed download of libs 2013-09-15 22:58:39 -04:00
Christian b5af446d71 Fix sidedness derp in LanguageRegistry. 2013-09-13 19:04:25 -05:00
Christian d0c6e92900 Update MCP data 2013-09-03 17:56:09 -04:00
Christian 2a9c485edc Remove @SideOnly from 70318 (getDistance) it makes no sense that it's not on the server. 2013-09-02 12:24:17 -04:00
Christian a13598b17e Use java 1.6 compatible method of closing the zip file. Stops stupid compile error. 2013-09-02 00:12:36 -04:00
Christian 40b54013b4 Allow server side lang file injection, hopefully 2013-08-27 22:45:10 -04:00
Christian 1c9a853868 Allow coremods to properly inject asset readers. 2013-08-27 12:31:37 -04:00
Christian da70cdd35a Update tweaker for new Launcher API 2013-08-23 10:42:26 -04:00
Christian b993cf4a98 More exception handling for less derpiness. 2013-08-20 20:46:18 -04:00
Christian ac065ff5f7 Reset the IWorldGenerator seed for each mod, before calling. That should mean worldgen is consistent
and not dependent on mod ordering, or mod sideeffects.
2013-08-19 14:56:01 -04:00
Christian 913f6f6d36 Try and use the relaunch log, which should be classloaded.. 2013-08-19 14:55:37 -04:00
Christian 9468e41bbf Fix up scala refs, for better results 2013-08-18 18:58:36 -04:00
Christian ffdd056a18 Check keys, not values *sigh* 2013-08-17 13:27:43 -04:00
Christian f157e7a6ec And more coremod logging 2013-08-17 13:14:55 -04:00
Christian 4a9d0f9bd5 Add in some log information 2013-08-17 13:10:28 -04:00
Christian 0398916666 And actually instantiate the collection *sigh* 2013-08-17 12:57:15 -04:00
Christian dec9a3924d Add in "FMLCorePluginContainsMod" in the manifest. If this value is
present, FML will attempt to parse your mod jar file as a normal mod
file as well, instantiating mod containers there.
2013-08-17 12:48:38 -04:00
Christian 2470120680 Clean up a couple of resources. Also, don't parse jars just because
they're in the mods dir
2013-08-17 11:40:15 -04:00
Christian ba90b61607 Make sure we only add args to the argument list if a tweaker hasn't already.
Should fix LiteLoader compatibility issue.
2013-08-16 16:28:55 -04:00
Christian 9a5e24e338 Fix stupid derp is stupid. Closes #275 and means sp614x can do his thing 2013-08-16 16:18:50 -04:00
LexManos 29ef3d5ab4 Update installer. 2013-08-06 11:42:38 -07:00
LexManos f46a538b41 Merge pull request #268 from Bo98/sh-args-fix
Fixed install.sh not passing arguments to install.py
2013-08-04 15:32:06 -07:00
Bo 182aa9c0cb Fixed install.sh not passing arguments to install.py 2013-08-03 17:43:57 +01:00
cpw 1857064afa Merge pull request #266 from grompe/patch-1
Add missing SideOnly in BaseMod
2013-08-01 04:21:22 -07:00
Grom PE cb05c8c4aa Add missing SideOnly in BaseMod
NetClientHandler exists only on client side and thus method using it should be annotated with SideOnly.
2013-08-01 14:19:30 +07:00
cpw f275a24b43 Add in some reverse lookup methods for game registry data 2013-07-29 22:05:22 +02:00
cpw 1d84e8063e Temporarily add a version of 'reobfuscate.py' that will resolve complex
reobfuscation graph issues with specialsource. Copy it over 'reobfuscate.py'
in the mcp runtime dir. Hopefully will have an MCP/specialsource fix in
the coming days.
2013-07-28 22:38:26 +02:00
cpw 57befa89bb Fix keybindings being derped 2013-07-28 20:52:12 +02:00
LexManos 10b16d32da Use json 2.9.1 nightly for OSX in release json like vanilla does. 2013-07-17 12:21:26 -07:00
LexManos 3f21a2c1b4 Stupid spaces and windows escaping -.- 2013-07-16 14:34:43 -07:00
LexManos b2958c9066 Add quotes for paths with spaces -.- 2013-07-16 13:35:14 -07:00
LexManos 9520978b81 Use a temporary file for recompile's command line to combat command length to long issues. 2013-07-16 13:08:26 -07:00
LexManos 4981aa3421 Fix potential NPE in villager skin registry. 2013-07-16 10:32:29 -07:00
LexManos c48b48ee15 Fix server launching. 2013-07-15 10:57:44 -07:00
Christian 9947ba8503 Fix logo handling. no more NPE if the logo can't be found. Also, fix location of mcp logo now. 2013-07-14 13:40:55 -04:00
Christian a3f48734ff Fix up jar sanity check code. FML validation of the jar works now and doesn't derp classloading. 2013-07-14 13:11:32 -04:00
Christian 0378355c37 The server.classpath generates the runtime manifest, so it needs the
non-debug asm jars.
2013-07-14 11:12:42 -04:00
LexManos c625ef3009 Update Forge signature for new private key 2013-07-12 03:05:20 -07:00
LexManos d4b30422b6 Update build and eclipse workspaces for debug asm. 2013-07-12 00:22:11 -07:00
Christian 6de36d78f5 Coremods now have a primitive dependency capability. Also, we search mods dir for special
"TweakClass" manifests. These are using the vanilla tweak mechanism to inject into
Minecraft. Helpful for other "platform" systems, when you don't want to have to deal
with json changes!
2013-07-11 23:23:33 -04:00
LexManos 7348929819 Kill release time scala libraries, to be re-evaluated after all movement is done and shit is fixed. May require manual instalation for mods that use scala. 2013-07-11 15:24:54 -07:00
LexManos b9f4b02cb0 Kill mcp's truncate method, for more useful logs. 2013-07-10 15:23:21 -07:00
Christian 20e93a412e Fix up logos in the mod screen. Clean up some unnecessary casts and suppressions, use the -debug asm
library at dev time, since it contains full symbols and code in compiled form.
2013-07-10 15:47:13 -04:00
Christian e44e8b3112 Force a global asset scan prior to mod construction : you should be able to
reference assets anywhere in your mod now.
2013-07-10 00:42:40 -04:00
Christian bab4d87ce7 Update FML for new stealth update for 1.6.2 2013-07-09 15:00:28 -04:00
cpw bc9d1fe657 Merge pull request #254 from CaptainShadows/patch-1
@InstanceFactory was set to look for Fields instead of methods
2013-07-09 07:19:24 -07:00
Christian d4d522c597 And don't forget to remove the test code 2013-07-09 08:31:40 -04:00
Christian 97269a5e3d Decode the file URL. Hopefully will make things work more.. 2013-07-09 08:30:47 -04:00
LexManos c913258ca3 Disable signature check of client for now, it's broken. 2013-07-09 05:04:11 -07:00
LexManos c7ab872c85 Temporarily disable GuiModList's Mod logos. 2013-07-09 03:27:49 -07:00
LexManos e91431fb70 Don't validate signatures on servers, they are not signed. 2013-07-09 03:27:29 -07:00
LexManos dfa3a2665d Add MC Version to installed version name. 2013-07-09 03:27:01 -07:00
LexManos 4fa375683f Fix NPE in new debug line when patch targets don't exist. 2013-07-09 01:21:50 -07:00
Christian 0db4624b27 Don't initialize the server. 2013-07-08 22:31:15 -04:00
Christian c997f2adbc FML now verifies that the minecraft jar is correct and intact. This is intended to discourage those who think that
modifying the minecraft jar is still acceptable.
2013-07-08 22:10:06 -04:00
Christian 26e5f4b4ff Test server-siding ResourceLocation 2013-07-08 19:31:00 -04:00
Christian 2336002f20 The game is going to exit in face of patch mismatch, unless you force it to run with fml.ignorePatchDiscrepancies in the system properties. 2013-07-08 14:34:03 -04:00
Christian e88a0cd13f Update for stealth update. Thanks mojang! 2013-07-08 13:19:55 -04:00
Christian dbf5fe38ce We now generate an adler32 checksum for each patched file and verify at load time that they match.
Mismatch won't crash, but will emit a big warning..
2013-07-08 13:19:14 -04:00
Christian c47d08c89d Tweak debug data on patched classes 2013-07-08 12:28:32 -04:00
Captain Shadows 7af5c21d74 @InstanceFactory was set to look for Fields instead of methods
"fix it" to now match the javadoc :P

if it was set like that so modders wouldn't use it, it might be better to just say so in the documentation
2013-07-08 00:07:54 -04:00
LexManos 6f96d89e2b Update eclipse workspaces for 1.6.2 2013-07-07 13:11:22 -07:00
Christian 111b0216fd Add the jsons for 1.6.2 2013-07-07 16:05:53 -04:00
Christian 1d0384f8f6 Update for 1.6.2 and MCP 8.04 2013-07-07 15:49:11 -04:00
Christian adc8972277 Add cascadedTweaks. This will allow simple coexistence for any other mod framework using
the tweaker system as well. Hi Voxel and LiteLoader!
2013-07-06 22:26:03 -04:00
cpw 5990e29af7 Merge pull request #247 from jk-5/patch-1
Pull request for #232
2013-07-06 18:54:54 -07:00
Christian 2676c8999c Update mcp data. fixes #248 2013-07-06 21:25:36 -04:00
Christian 3a200e901e Fix coremod injection into main system. Should stop double-dipping coremods. 2013-07-06 20:51:00 -04:00
Jeffrey Kog c97ac284a5 Update ModLoaderFuelHelper.java 2013-07-04 08:33:03 +02:00
LexManos 54e06e841d Move Resource refreshing until affter postInit. 2013-07-03 22:29:10 -07:00
LexManos 7ce84491d1 Fix missing argument and startclient/startserver support. 2013-07-03 19:30:30 -07:00
LexManos 532bee7ce1 Update to new MCP bugfix version, Fixes: Missing Armor/Item rendering, and Boss health mapping issues. 2013-07-03 18:23:38 -07:00
LexManos e24f949517 Fix eclipse workspaces and launch configurations. 2013-07-03 18:22:57 -07:00
LexManos 4545beb49d Add deobf-data to setup env. 2013-07-03 18:22:06 -07:00
Christian 3f4bf61ae6 Update key 2013-07-03 08:28:59 -04:00
Christian 155e846818 Add in support for mods/<mcversion> as a mod location. Also drop coremods as a location. They go in mods too now. 2013-07-02 23:03:01 -04:00
Christian ba3707af22 More javadoc cleanup 2013-07-02 19:39:02 -04:00
Christian ad79b9ed86 Fix up some deprecation warnings, and clean up coremod code that's going
away.
2013-07-02 19:27:50 -04:00
Christian 5f7df5e742 Revert "Keep these on our servers until the launcher is actually fixed -.-"
This reverts commit f1b533ad87.
2013-07-02 19:03:06 -04:00
Christian 7aa7221756 Fix transformer search 2013-07-02 18:40:23 -04:00
cpw 8844554da6 Merge pull request #243 from jrtc27/modclassloader
Fixed ClassCastException when loading ModLoader mods
2013-07-02 15:32:35 -07:00
James Clarke 6f0eedc9a6 Fixed ClassCastException when loading ModLoader mods 2013-07-02 20:48:00 +01:00
Christian f21cd286ca Resource packs, part two. FML mods are now resource packs. Vanilla will scan anything under 'assets'
and turn it into a resource prefix. Use resourcelocations to look stuff up.
2013-07-02 11:11:50 -04:00
LexManos f1b533ad87 Keep these on our servers until the launcher is actually fixed -.- 2013-07-01 23:26:40 -07:00
Christian 5a97d183df Remember to update your patches!!!! 2013-07-02 02:14:31 -04:00
Christian fbd57b3264 Mods are now loaded as resource packs. Vanilla will scan for valid prefixes based on subdirs of 'assets' which
can then be referenced as ResourceLocations with the "<prefix>:path" notation.
2013-07-02 01:39:40 -04:00
Christian efc369ee83 Fix EventHandler annotation. 2013-07-02 01:08:51 -04:00
Christian 91ecf71109 Fix -rel json 2013-07-02 01:02:02 -04:00
LexManos 9b6525e805 Point scala downloads to our servers, Launcher doesn't like standard maven repos. 2013-07-01 21:53:13 -07:00
LexManos dc7d02ebf6 Fix json syntax error. 2013-07-01 20:33:26 -07:00
Christian 7037184a4e Fix up release JSON 2013-07-01 23:14:31 -04:00
Christian bf38d94756 Update json samples 2013-07-01 22:58:08 -04:00
LexManos 3d17434510 Build installer package for the new client launcher. 2013-07-01 19:40:19 -07:00
LexManos 29d6c875d0 Add FML Installer logo crated by @ZaverSLO https://twitter.com/ZaverSLO/status/349947190300508162 2013-07-01 19:38:44 -07:00
LexManos 902772ed0c Revert common folder fix, Common folder does nothing, feel free to delete it after first load. 2013-07-01 16:25:11 -07:00
LexManos 1229c4c4ea Fix src distrabution, and got rid of pesky common folder in eclipse workspace. src is now installable. 2013-07-01 15:50:49 -07:00
Christian 7fecf2ad6b Update mcp URL. 2013-07-01 11:06:20 -04:00
Christian c418da353f Cleanup coremod code, server side working now. 2013-06-30 22:51:56 -04:00
LexManos 110cf372eb Add deobf data to merge-common, worspace is now actually runnable! 2013-06-30 19:41:51 -07:00
LexManos 7a004087f7 Add deobf data to src dist.
Dont create deobf jar as we ship the lzma
Added *.lzma to .gitignore
2013-06-30 19:15:53 -07:00
LexManos 70cfe24e67 Fix wrong project name in distro eclipse launch. 2013-06-30 18:33:26 -07:00
LexManos 8960f6869f Add windows lzma executable
http://tukaani.org/xz/
He states that most things are under public domain, But I couldn't find an exact reference to this executable.
I'm going to assume it under public domain and distribuiting it here is fine. If not someone please direct me to the apropriate license and I will act accordingly.
2013-06-30 18:31:24 -07:00
Christian 71a92de5d9 Client launch for eclipse 2013-06-30 21:06:33 -04:00
Christian 3f15cd54c2 Functional client @ 1.6.1 2013-06-30 21:02:23 -04:00
Christian 12c928c538 Tweak commands patch 2013-06-30 19:33:47 -04:00
Christian 7406b38d8a 1.6.1 2013-06-30 16:50:30 -04:00
Christian ef646d3146 Merge branch '16launch' 2013-06-30 13:20:46 -04:00
Christian 18371bd8c9 Some fixes for updated mcp code 2013-06-30 13:17:20 -04:00
Christian e35e4b16ff More fixups 2013-06-30 09:04:50 -04:00
LexManos 3711da9c45 Another typo 2013-06-30 03:55:26 -07:00
LexManos 6a318ddb78 Fix typo in new packages. 2013-06-30 01:01:55 -07:00
LexManos 2766f9a293 Push conf folder for 1.6, Relied heavily on a yet-unreleased version of MCP. 2013-06-29 22:48:24 -07:00
Christian 2e3f2461fa More fixes, binpatching works 2013-06-29 15:16:18 -04:00
Christian 95f7345ff7 First draft of 1.6 update 2013-06-29 13:33:14 -04:00
Christian bc02f3e67b New mappings for marker 2013-06-29 09:20:59 -04:00
Christian 8db42c44bf Tweak missing mapping 2013-06-29 09:20:59 -04:00
LexManos 404e6f1cc0 Add support for alternative maven servers in libraries.
Also download sources for public libraries, and atach them in eclipse. DOCUMENTATION!! YAYA!
2013-06-29 02:54:29 -07:00
LexManos 5741f669d5 Base GenDiff off deobf data's class list instead of the merged jar. Add option to delete target files that generate patches. 2013-06-29 01:40:01 -07:00
LexManos 6a67149b16 Add Clean Server/Client launcher. Update Start.java to new Main class and login system. 2013-06-28 22:12:07 -07:00
LexManos c8d934bafd Update eclipse projects for new libraries dependancies, and update packages for new 1.6 classes. 2013-06-28 20:31:02 -07:00
LexManos 075e240303 Add suggestions output if it can. 2013-06-27 22:58:00 -07:00
LexManos d00665ee65 Fixed update_packages.py for new folder strcture. 2013-06-27 22:30:40 -07:00
LexManos ebb74a5f30 Add missing argument 2013-06-27 22:29:10 -07:00
LexManos 5b0117ec76 Re-wrote/orginized a lot of fml.py. Almost everything is re-written/moved.
This is done in preperation for MCP to roll out SpecialSource support and the new 1.6 structure.
Also done for my sanity while reading through the code.

Intruduced a new function. If there is a 'mcp_data' folder in the FML folder, it will be copied to the MCP work directory after MCP is extracted.
It DOES overwrite anything that already exists.
This is intended for places like BuildServer to place libraries/assets to prevent them from needing to be downloaded every version.

Introduced a dev-env json. Need to write the eclipse workspace references to the new libraries.
Out custom json includes asm and legacylauncher.

Added proper OptionParsing to decompile.py
2013-06-27 20:48:52 -07:00
Christian e06d9d0fbc Add a simple property annotation system for mods. 2013-06-27 08:40:31 -04:00
Christian ab91647546 Changed to the EventHandler annotation universally, documentation and stuff. 2013-06-26 14:52:56 -04:00
Christian b236a4a4db Fixes, so it builds again.. 2013-06-24 16:30:18 -04:00
Christian a480a83a98 Ignore binpatch 2013-06-24 16:03:54 -04:00
LexManos 3a9f123a16 Add filter support for MCPMerger, and filter out libraries from the server's 'fat jar'. 2013-06-23 23:06:25 -07:00
LexManos 8d27fb0692 Upgraded minecraft downloader to work with new launcher's asset/library system
New parameter:
  --no-assets: Disables the downloading of minecraft's asset tree, recomended that build servers supply this flag to prevent downloading of useless data.
2013-06-20 16:23:15 -07:00
Christian d369fe1c25 No more debug please 2013-06-15 01:11:29 -04:00
Christian 98b71f2dd4 Fix build script. Add a sample JSON file. You'll need the newest Launcher code to run this. 2013-06-14 21:00:15 -04:00
Christian fef0f6422d More fixups for new launcher model 2013-06-14 20:45:52 -04:00
Christian 2eb81ac88b Merge in binpatch and use launcher 2013-06-14 17:21:49 -04:00
Christian e02a91f008 More tweaks 2013-06-14 09:32:51 -04:00
Christian ced1b95155 Server side tested and working. Setup is complex atm. That will change. 2013-06-13 09:57:55 -04:00
Christian 8f910dfa5d First cut of runtime binary patching. Needs some work to actually test it in a real scenario.. 2013-06-12 08:53:10 -04:00
Christian 05a854cd2a Small tweaks to the mcp data. Nothing major.. 2013-06-11 14:47:23 -04:00
Christian 22738de028 Attempt to properly fix deadlock if the internal server derps. It should never hang now. Damn you fast computer.. 2013-06-11 14:41:19 -04:00
Christian cd0466395a Fix sysout with trailing messages after a newline 2013-06-06 11:52:15 -04:00
Christian 24c4056651 Add in an optional modid identifier for @SidedProxy. It's main use is when both scala and java @Mods reside in the
same package, and you want the @SidedProxy behaviour for a specific @Mod language type. In general it should not be needed otherwise.
2013-06-06 10:05:34 -04:00
Christian 59fe905695 Don't continue trying to send events to mods that depend on errored mods. 2013-06-04 13:59:04 -04:00
Christian 6f3da97365 Don't throw an exception if the scala adapter find a java proxy. I may add some distinguishers to @SidedProxy so you know which mod it's for. 2013-06-04 12:51:46 -04:00
Christian edc1fb24e2 Send the "suspect list", and print the suspect versions 2013-05-27 11:03:23 -04:00
Christian f1d68ed4c8 Throw the sorting exception 2013-05-27 10:46:22 -04:00
Christian ac97370f94 Add in a pretty sorting error screen 2013-05-27 10:28:00 -04:00
Christian 82e9de8641 More tweaks to the mod sorting code 2013-05-27 10:09:51 -04:00
Christian 843a13c1ab Try and clean up cycle detection output a bit 2013-05-27 09:25:50 -04:00
Christian 3bf50c4bbe Fix server side derp with Forge network packet handler 2013-05-21 11:01:50 -04:00
Christian 4922e90d81 Separate network mod config from setup. Allows for Forge Packet Handler nicety 2013-05-20 21:40:42 -04:00
cpw a3a920437f Merge pull request #230 from fnuecke/master
Alternative setter logic for @SidedProxy in Scala classes/mods.
2013-05-11 15:34:37 -07:00
LexManos 787c0c4a6a Don't spit error on LWJGL not supporting 4.3 just warning. 2013-05-11 10:55:39 -07:00
Florian Nücke 8517a824e5 Merge declaration and initialization of a variable. 2013-05-08 20:16:15 +02:00
Florian Nücke 2cca7aa759 Some more Scala @SidedProxy adjustments. Now properly supporting pure singletons, i.e.
object C {
  @SidedProxy(...)
  var proxy: P = null
}
Removed fallback, as all such singletons are properly handled by the new code now, and class implementations fall back to the code also used for plain Java mods.
2013-05-08 19:04:35 +02:00
Florian Nücke 23b070c7d0 Alternative @SidedProxy setter for Scala. 2013-05-08 05:36:28 +02:00
LexManos 49111e9c5c Add version detection to astyle and print error if it doesnt detect version 2.0+
Also fixed astyle's config for max-instatement-indent that sometimes caused crashes with certian versions of astyle.
2013-05-03 14:26:27 -07:00
cpw c0cca7f41d Merge pull request #227 from CovertJaguar/patch-1
Improved Entity Spawn Error
2013-04-29 22:10:53 -07:00
CovertJaguar 99bb50d8f8 Improved Entity Spawn Error 2013-04-29 20:41:20 -07:00
LexManos 00f00b17bf Fix scalac detection to actually use the located command instead of defaulting to 'scalac' 2013-04-28 16:35:23 -07:00
LexManos 62fdbad74c Update MCP's md5 for the fixed srg files. 2013-04-28 12:33:42 -07:00
Christian f0bba74a47 Update for minecraft 1.5.2 2013-04-27 01:24:06 -04:00
Christian cf9b5b445b Don't leave scala running in interactive mode. 2013-04-23 22:56:18 -04:00
LexManos aa200923f0 Fix patch derp. 2013-04-23 19:47:43 -07:00
Christian ddadf93ca1 Fix when an old scalac is present on the system to not fail the build 2013-04-23 22:43:51 -04:00
Christian 781c681216 Some fixups for scala compilation in MCP. Scala should now be compilable and reobfuscatable with srgnames in MCP. 2013-04-23 07:40:49 -04:00
Christian cfda7fc738 Fix URL for MCP 2013-04-23 07:22:25 -04:00
Christian 58ba24add2 Fix possible NPEs in GameData 2013-04-22 21:14:34 -04:00
Christian dcf069ca52 Attempt to reduce lines on the screen for id mismatch. Hopefully prevents game crashes. 2013-04-22 21:14:34 -04:00
cpw c3fda11d10 Merge pull request #225 from MarcinSc/master
Suggested fix for issue 221
2013-04-21 11:32:51 -07:00
Marcin Sciesinski 11ac46daeb Fixing the GameRegistry. Now it is possible to register a Block with a BlockItem using following code:
MyBlock myBlock = new MyBlock();
GameRegistry.registerBlock(myBlock, MyBlockItem.class, "myBlock");
where MyBlockItem class has one constructor with signature:
public MyBlockItem(int id, Block block)
2013-04-21 19:01:18 +01:00
Christian 2dcabe0123 Add a to string to fmlmodcontainer: should mean less derpy cyclic dependency data 2013-04-21 13:58:18 -04:00
cpw 42f1d87955 Merge pull request #224 from Glought/master
Fix for  Issue #223
2013-04-21 08:13:54 -07:00
Glought 334a76de75 Update FMLDeobfuscatingRemapper.java
Fixes a "Type mismath:cannot convert from element type Object to FieldNode" error at line 176.
2013-04-21 05:09:19 -07:00
Christian 677a6e578e Fix scala supporting SidedProxy. It should work now. 2013-04-20 23:31:22 -04:00
Christian a3b5eaacfd Fix a small modloader compatibility derp: closes #222 2013-04-20 22:55:56 -04:00
Christian b3d4ea05ec Fix possible NPE in findItemStack, closes #218 2013-04-17 07:55:33 -04:00
Christian 8f35adca7a Use more expressive language when a version specifier is a simple unbounded above condition 2013-04-16 13:46:55 -04:00
Christian 394f424185 Fix to output versions in crash logs 2013-04-16 13:46:55 -04:00
cpw ada52078c7 Merge pull request #216 from agaricusb/add-srgname
Add srgname to registerTileEntityWithAlternatives
2013-04-15 15:50:47 -07:00
Christian 0daf1a6df4 Merge branch 'agaricusb-fix-deobf-field' 2013-04-15 17:31:09 -04:00
Christian edffd04ed2 Add in some caching of the read field descriptions for efficiency 2013-04-15 17:30:35 -04:00
Agaricus 7aea09f4ca Add type info to properly deobfuscate overloaded fields. Fixes #210. 2013-04-14 16:54:11 -07:00
Agaricus 5673c1dd29 Add srgname to registerTileEntityWithAlternatives 2013-04-14 14:11:37 -07:00
Christian 1774e2bf30 MCP names update 2013-04-10 12:28:20 -04:00
LexManos 4836b3272a Re-worked the Texture patches, optifine helper function, and re-added support for dynamically rotating the texture for mod authors who do things horribly wrong. 2013-04-09 20:06:41 -07:00
Christian a31607ae7d Fix compilation derp, and clean up rotation helper. 2013-04-09 21:20:31 -04:00
Christian 57ad221cc6 And add the patches *sigh* 2013-04-09 20:26:10 -04:00
Christian 00c7883088 Very significant improvement in performance by using glSubImage to upload data. Inspired by frequent complaints about performance of hires
texture packs. They probably still need a beefy system but should work. Hopefully I can figure out why the subImage GL side copy isn't working
properly for an even more significant speed boost. But this gets things started.
2013-04-09 20:15:14 -04:00
LexManos 1de89525cc Fixed issue with instalation when java/javac commands had quotes. 2013-04-05 10:26:33 -07:00
LexManos 704a70902f Sanitize input to isRemappedClass to use '/' as a package seperator like the srg files. 2013-04-04 23:30:10 -07:00
LexManos 570faeb790 Added the ability to save transformed classes to disc for debugging. 2013-04-04 10:32:48 -07:00
Christian 8b8837c9ff Fix NPE when branding isn't present 2013-03-31 10:01:46 -04:00
Christian eff464cf0e And the core patches for that 2013-03-30 12:13:53 -04:00
Christian 26ccb9106e Change snooper/crash report brand handling. fmlbranding now loads another string! 2013-03-30 12:12:54 -04:00
Christian 0d84487412 Fix up derp in access transformer 2013-03-27 19:23:10 -04:00
Christian 2bc6a0666f Attempt to make any "default package" class public. This might fix problems with certain modloader mods that ship changes to vanilla classes. 2013-03-27 16:54:26 -04:00
Christian 82bc9f1b35 Add some information, and a log message letting you know it worked 2013-03-23 16:01:20 -04:00
Christian d73ac867df Add a mechanism to dump the registry- useful for mod developers. 2013-03-23 15:39:34 -04:00
Christian ede93d438f Validate supplied stack size 2013-03-23 15:10:13 -04:00
Christian 5e1949eb0e Clone the itemstack, and allow for passing in a stacksize 2013-03-23 14:58:25 -04:00
Christian 2d368c4c2e Itemstacks in the GameRegistry (manual registration by mods) 2013-03-23 14:48:57 -04:00
Christian d9db27275e Fix mismatch screen a bit. Should render more correctly now and
at least not be blank in a lot of circumstances..
2013-03-22 10:20:53 -04:00
cpw 591a25722b Merge pull request #208 from jrtc27/patch-1
Fixed FMLRelaunchLog's Newline Handling
2013-03-22 05:44:38 -07:00
James Clarke d1ff1967b5 Fixed FMLRelaunchLog's Newline Handling
System.out.println("\n") causes currentMessage to start with a newline character, which means idx will always be 0 from then on. Therefore if idx is 0 messages must still be logged, otherwise no more messages sent to stdout will be logged and they will just accumulate in currentMessage.
2013-03-22 09:19:39 +00:00
Christian 012a755bb9 Fix up patch properly. Also, fix md5s for the jars. 2013-03-22 01:48:21 -04:00
cpw 748eece456 Merge pull request #206 from mDiyo/patch-1
Fix missing block world rendering
2013-03-21 07:41:35 -07:00
mDiyo f709ce7579 Fix missing block world rendering 2013-03-21 07:10:55 -07:00
LexManos 33efc35b60 Merge MC 1.5.1 branch to master. 2013-03-21 04:10:30 -07:00
LexManos 687d3c059d Merge pull request #204 from agaricusb/fix-mcpdir
Fix install.py --mcp-dir option
2013-03-20 10:24:27 -07:00
LexManos aaf02ea2ac Updated for new PR client jar. 2013-03-20 08:59:25 -07:00
Agaricus 625da6492d Fix install.py --mcp-dir option. Fixes #204. 2013-03-19 21:42:04 -07:00
LexManos a573faf92d Someone derped up this function bad, revert name. 2013-03-19 17:54:06 -07:00
LexManos 9565529baf Updated to latest MCP and Minecraft 1.5.1 Pre-release. 2013-03-19 15:48:42 -07:00
LexManos 3c346247e1 Fix NPE with CoreMods who do not have the new MCVersion annotation. 2013-03-19 13:48:18 -07:00
Christian ce949e6099 Support simple mc version test in coremods, only effective through
jar loading.
Also, log some more data about the environment.
2013-03-17 23:40:12 -04:00
Christian 5e3af8ac0e Use the relaunch log, for class circularity safety. 2013-03-17 23:19:39 -04:00
Christian 5cc90f060c Fix the logger to treat newlines better, hopefully. Closes #199 2013-03-17 23:15:18 -04:00
LexManos 577b19c1cf Fix potential NPE in class loading and add extra debug information. 2013-03-17 11:54:26 -07:00
cpw 8905237306 Merge pull request #200 from bspkrs/patch-2
Added comments to note FML-only methods
2013-03-14 18:37:08 -07:00
Christian c5d5f4e516 Fix AllPublic access transformer not affecting methods. Should fix modloader
compatibility
2013-03-14 15:53:19 -04:00
bspkrs 24022ab6ba Added comments to note FML-only methods 2013-03-14 01:29:36 -03:00
LexManos 6370c242f0 OS X's python 2.6.1 has a bug in zipfile.extractall that makes it unzip directories as regular files. So switch to extract 2013-03-13 13:11:43 -07:00
LexManos 4762d4d8ef Allocate more ram {typically 256 is defailt} to fermflower, should fix decomplication issues on OSX 2013-03-13 13:11:10 -07:00
Christian 8f2dbf7046 Fix up stupid derp in IMC code: actually reset the IMC list after
each delivery. Fixes a bunch of mods. Sorry everyone.
2013-03-13 15:09:50 -04:00
Christian 23ea835fa7 Pass obfuscation status to coremods 2013-03-12 21:06:37 -04:00
Christian d88db6c0cf Fix up deep tree deobfuscation 2013-03-12 20:33:19 -04:00
LexManos c6dab815f4 Missed joined.exc, must fix scripts. 2013-03-12 15:12:49 -07:00
LexManos 7b722bfcd6 Update MCP for latest PR silent update. 2013-03-12 15:02:58 -07:00
LexManos a90504315e Readjust size of mods button when Minecraft Realms button is enabled. 2013-03-11 16:20:56 -07:00
Christian 3765ceb02d Update MCP, fixes the "broken texture packs" problem. 2013-03-11 16:31:26 -04:00
Christian dab22f5b74 Fix "0 mods" display when installed in forge. 2013-03-10 12:12:22 -04:00
Christian b301e8e4c1 Change type of connection queue to a concurrent linked queue. Much more efficient, hopefully. Closes #189 2013-03-10 01:25:36 -05:00
Christian f647929993 Merge branch 'master' of github.com:Uristqwerty/FML 2013-03-10 01:22:24 -05:00
Christian 984291cee9 Fix supertype parsing to handle null superclass (Hi Object!). Closes #160 2013-03-10 01:20:08 -05:00
Christian ac16845fc4 Fix demo mode crash. Closes #187 2013-03-10 01:15:16 -05:00
Christian 29edd242cd Fix coremods without a manifest crashing the game. Closes #181 2013-03-10 01:05:31 -05:00
Christian ca2d8bd834 Fix reflection helper: it needs to unmap the classname to find the field maps. 2013-03-09 17:58:18 -05:00
Christian 2a779ec328 Try a different way of remapping the fields. Should work because it's userspace, not relauncher space 2013-03-09 17:36:31 -05:00
Christian 591e65fa1a Revert "Use the reobfuscation maps in the reflection helper for field lookups: should help some reflection cases with the deobf."
This reverts commit 485db6be2e.
2013-03-09 17:32:11 -05:00
Christian 485db6be2e Use the reobfuscation maps in the reflection helper for field lookups: should help some reflection cases with the deobf. 2013-03-09 17:19:48 -05:00
Christian 25f3fcad46 Fix up some relauncher stuff: the vanilla applet works now, as do other applets. Deobf data is resolveable for them too. 2013-03-09 15:25:58 -05:00
LexManos 6bf7c9878c Fixed srg name of minecraftDir for runtime deobf. 2013-03-09 11:52:40 -08:00
Christian 95d0ff18cd Fix runtime deobfuscation for remapped inner classes 2013-03-09 14:06:39 -05:00
LexManos 1642bad402 Fix Multi-part entity children ID issue, mobs with custom spawning must deal with child ids themselves. 2013-03-09 10:07:41 -08:00
Christian 450dd8313c Fix up some small things, merging into mainline 2013-03-09 12:39:36 -05:00
Christian ebdb166ec8 Merge branch 'snapshot15' 2013-03-09 12:26:14 -05:00
Christian 1eba1dfdc0 Fix accidental commands.patch overwrite 2013-03-09 12:25:24 -05:00
Christian 368a2245ef Merge branch 'snapshot15' 2013-03-09 12:19:37 -05:00
Christian 58ee06ea8e Some fixes for the snapshot 2013-03-09 12:10:13 -05:00
Christian 62f5adf8e2 Revert "Fix modlist to use the new texture binding functions, i think"
This reverts commit 48544db690.

Conflicts:
	client/cpw/mods/fml/client/GuiModList.java
2013-03-09 11:12:12 -05:00
cpw fe1623a36a Merge pull request #195 from RainWarrior/snapshot15
Fixes GameRegistry.registerBlock
2013-03-09 07:07:48 -08:00
RainWarrior 889efc1c0a Fixes GameRegistry.registerBlock 2013-03-09 14:06:12 +04:00
Christian 0419b9d975 Update MCP info for latest 2013-03-08 23:14:30 -05:00
Christian f1c6bdd57d Support the MCP format of partial reobfuscation for portability. Ensure modloader-like compatibility 2013-03-08 23:13:39 -05:00
LexManos b3e854a15d Update for new MCP with srg reobf. 2013-03-08 18:11:44 -08:00
Christian 80a40c03e6 Update to MCP 1.5 and minecraft 1.5. 2013-03-08 20:36:05 -05:00
Christian 5bfaf7c170 Global object registry, also, support the new itemblockwithmetadata constructor 2013-03-08 13:17:12 -05:00
Christian 2d98835db8 Scala support!
It's still primitive, I hope that people will like it. I do :)
2013-03-07 20:22:24 -05:00
Christian 81c6421f84 Tweak license text- any osi licensed project can use the asm transformer code 2013-03-07 19:41:52 -05:00
Christian 6eeae8c49f Fix up state transition derp when the server crashes with an error- it shouldn't double-derp 2013-03-07 19:37:52 -05:00
Christian c42a210140 Strip deprecated code 2013-03-07 19:33:34 -05:00
Christian a723aa6860 Refresh copyright notices on everything 2013-03-07 19:25:48 -05:00
Christian e9ff699c2d Refresh the renderengine after modloading is complete. Should fix issues with out-of-place texture registration by mods. 2013-03-07 19:02:26 -05:00
Christian abe4f73a9a FIX massive performance issue with FML. Thanks to @sfPlayer1 for finding
this epic derp on my part!
2013-03-06 14:00:28 -05:00
Christian 74fffc6fdc Update next render to 40 2013-03-04 22:52:24 -05:00
Christian debbdc00be Capture Minecraft logs into FML logging 2013-03-04 22:45:58 -05:00
LexManos aed2cc446a Force file name encoding to UTF-8, caused different zips on different systems. 2013-03-04 18:19:06 -08:00
LexManos e74087ee43 Ignore again, testing submodule. 2013-03-03 11:54:53 -08:00
LexManos f329084f1f Ignore this commit. 2013-03-03 11:52:47 -08:00
Christian 33cd9ad0fe Ignore deobf data 2013-03-03 14:04:41 -05:00
Christian ce819ac143 Force the joined.srg timestamp to zero- avoids annoying sha1 differences 2013-03-02 15:06:13 -05:00
Christian f0495a8abc Don't enforce signatures on minecraft classes 2013-03-02 14:48:08 -05:00
Christian a696db5a21 Update MCP URL for snapshot 2013-03-02 10:56:25 -05:00
Christian fcdbb4f5b3 Fix up runtime deobfuscation. Working well now. 2013-03-02 10:46:32 -05:00
Christian e105337ff4 Build, and use, MC versioned deobfuscation data 2013-03-02 10:30:45 -05:00
Christian f52e2112dd Merge branch 'runtimedeobf' into snapshot15 2013-03-02 10:04:06 -05:00
Christian 945d927fa0 Add in build for deobf data zip file, update for official mcp 7.39 2013-03-02 10:02:02 -05:00
LexManos 2ee6946824 Fix exc for renamed Behavior classes. 2013-03-02 00:48:44 -08:00
LexManos e08c43366a Actually remove classes from the csv when removed, and moved All EntityMinecart entities to net.minecraft.entity.item 2013-03-02 00:12:31 -08:00
LexManos c508004429 Delete unneeded patch 2013-03-02 00:11:48 -08:00
LexManos 21af85323a Readd ignore for argo and bouncycastle, needed for our replacement to work properly. 2013-03-02 00:11:33 -08:00
Christian 3410242f03 Update FML to 1.5 snapshot 13w09c 2013-03-02 02:06:32 -05:00
Christian 9b9c46d93b Tweaks to runtime deobf 2013-03-02 01:49:45 -05:00
LexManos de8e76c7fd Update distribuited eclipse's classpath for updated libraries. 2013-02-28 04:22:34 -08:00
LexManos 47b5e99b6f Fix crash in GuiModList for mod logo files, logo is not rendering for unknow reason. 2013-02-27 22:41:00 -08:00
LexManos 1a465b33f5 Fix bug in rename_vars where certian items would fail to be renamed. 2013-02-27 22:40:15 -08:00
LexManos 8e7956397d Just enable server side compile, and warn not to cmplain to us. 2013-02-26 14:54:18 -08:00
LexManos 86a9c7d359 Fixup reobfusication of server code if present. 2013-02-26 14:34:51 -08:00
Christian 6a581803a9 Tweak IASM hook api. You can return multiple classes now. 2013-02-26 15:04:45 -05:00
Christian b4e0c709c5 Merge branch 'runtimedeobf' into snapshot15 2013-02-26 10:24:03 -05:00
Christian f3458456a2 Change readFully to actually read a bunch of bytes at once now. Thanks to nallar and aartbluestoke for the suggestion to
revisit this..
2013-02-26 01:07:14 -05:00
Christian dcb15a587c Clean up more junk 2013-02-26 00:28:12 -05:00
Christian 937e9a0169 Update libs for 1.5. Lots of new libs. 2013-02-26 00:16:57 -05:00
Christian decd230ac1 Fix renderengine patch *sigh* 2013-02-25 22:06:20 -05:00
Christian 5347caa1c4 Merge branch 'master' into snapshot15
Conflicts:
	patches/minecraft/net/minecraft/client/renderer/RenderEngine.java.patch
2013-02-25 21:53:56 -05:00
Christian 52f6a674ea Merge branch 'master' into snapshot15
Conflicts:
	client/cpw/mods/fml/client/TextureFXManager.java
2013-02-25 21:18:08 -05:00
cpw a16c61f7ba Merge pull request #188 from immibis/master
Console log thread should be a daemon thread.
2013-02-22 22:35:14 -08:00
immibis 67f12d6dec Console log thread should be a daemon thread. 2013-02-23 19:27:16 +13:00
LexManos bad55cacfa Fix sprite map issue. 2013-02-22 14:45:25 -08:00
Christian a6e979b311 Merge branch 'master' into runtimedeobf 2013-02-17 16:29:13 -05:00
Christian ce68456f97 Fix Language Registry, closes #163 2013-02-17 16:28:54 -05:00
Christian 29e59438c5 Fix Language Registry, closes #163 2013-02-17 16:22:58 -05:00
Christian 10d4acfad2 Merge branch 'master' into runtimedeobf 2013-02-16 14:28:29 -05:00
LexManos 1c3dc132cb Option to disable renaming for srgnames. 2013-02-08 14:50:17 -08:00
Christian cd96718339 Fix HD mob skins, FINALLY!!!
Stupid eyes are stupid.
2013-02-06 01:25:46 -05:00
Christian 22dbe411d9 Fix up mistake that broke all modloading. Nice. 2013-02-04 10:58:48 -05:00
Christian a99d110fff Fix some class naming and packaging issues, pending an MCP update
for the same
2013-02-02 10:54:48 -05:00
Christian f21929b7d1 Update for MCP 7.34 and MC 13w05b 2013-02-01 23:05:23 -05:00
Christian 5d78b310da MCP compilation works 2013-02-01 22:42:28 -05:00
Christian 549b6fd535 IMC tweaks: runtimeMessages now work (thanks for all that testing for this much requested feature!)
and IMCEvent will no longer remove messages if no one gets them, so you can do
just manual runtime polling, if you wish.
2013-01-31 13:39:53 -05:00
Christian 9fafdc1695 More logging tweaks. You can probably configure individual mod log files if you wish now 2013-01-30 20:55:12 -05:00
Christian f169f7c92f A log of logging cleanup. FML will now read logging.properties to configure logging channels a couple of times during startup.
You should be able to filter a lot of messages based on things like modid and certain FML related features that can be noisy
like item tracking.
Should close #175
2013-01-30 18:57:21 -05:00
Christian b9ccadb2f1 Final part of the deobfuscation data setup- fields are now deobfuscated as well.
All that remains, is to figure out what and how to distribute the deobfuscation data itself.
2013-01-28 17:48:44 -05:00
Christian f00650481b Read the joined.srg file directly from lib/deobfuscation_data.zip now. Still debating distribution method. 2013-01-28 17:39:22 -05:00
Christian 5d4c2fed88 Now actually works for mods, somewhat. It currently generates access violations for
ModLoader mods that presume access to fields that are not actually accessible from
a different package.
2013-01-27 22:42:36 -05:00
Christian 66a81e7dbe Method deobfuscation now works 2013-01-27 21:50:08 -05:00
Christian 6b5a433f65 Working to read class names and remap them at runtime. 2013-01-27 17:09:00 -05:00
Christian b5d5c95b33 First draft runtime deobf 2013-01-27 15:55:37 -05:00
Christian 3ac891fa5a Try and handle "death on startup" a bit cleaner 2013-01-27 15:54:36 -05:00
Christian 2dc0189179 Deprecate the old GUI ticktype. They're dead and have been for some time. 2013-01-24 17:29:46 -05:00
Christian dd98784262 Tweak a method signature 2013-01-24 10:23:36 -05:00
LexManos 1c9a51098b Add parameters to FML install to enable/disable certian aspects. Applying patches, running transformer/merger, and decompiling server. 2013-01-24 03:08:19 -08:00
Christian d075daf00e Merge branch 'master' into snapshot15
Fix up compilation and patching errors

Conflicts:
	common/cpw/mods/fml/common/registry/GameRegistry.java
	conf/joined.srg
	conf/params.csv
	conf/version.cfg
	patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch
2013-01-22 15:21:22 -05:00
Christian 1bd6847bc8 Fix up packages.csv ordering for easier diffing 2013-01-22 14:43:27 -05:00
Christian dd832f2a88 Update for MCP7.30c - fixes redstone rendering issues 2013-01-22 14:40:09 -05:00
Christian aebf6eb168 Add in a registry method to allow for alternative TileEntity names- they will be used to support
loading maps containing the older definitions.
2013-01-22 13:11:32 -05:00
Christian 8921cfe061 Remember to add the new patches! 2013-01-22 09:32:53 -05:00
Christian cd67596d57 The "ServerStarting" event should now properly crash the server if it fails,
so the client will properly exit. Also, added in a "pre-server-start" event
that fires before the worlds are loaded for a save, just for you immibis.
2013-01-22 09:17:04 -05:00
Christian e1c6630569 Javadoc cleanup 2013-01-21 21:37:29 -05:00
Christian 5ce4e31855 Fix breaking change 2013-01-20 17:54:56 -05:00
Christian a99c488d49 Merge branch 'patch-1' of https://github.com/bspkrs/FML into gh-updates 2013-01-20 11:31:47 -05:00
Christian 94282c5575 Merge branch 'FMLLogFormatter' of https://github.com/donington/FML into gh-updates 2013-01-20 11:31:24 -05:00
Christian 7ad8529390 Update MCP to MCP7.26a and refresh MCP names 2013-01-20 10:30:36 -05:00
Christian 15534edce4 Update address of the FML repository to the new location in all the files 2013-01-18 21:26:43 -05:00
bspkrs aa822e32af Fix logical error in comment text 2013-01-16 23:49:09 -05:00
Christian a14ab913a9 Update license text to make clear that FML is not a way to sidestep
MCP licensing.
2013-01-15 16:54:26 -05:00
Christian 0165742a30 Fix mcp conf md5 signatures for the snapshot 2013-01-12 14:25:03 -05:00
donington 26a5b316de FMLLogFormatter: dynamic log level name
FMLLogFormatter now uses getLocalizedName or getName for log level name

Changes to be committed:
	modified:   common/cpw/mods/fml/relauncher/FMLLogFormatter.java
2013-01-12 00:42:36 -05:00
Christian 2140cd8cb6 Temporary hosting 2013-01-12 00:38:42 -05:00
Christian 4a6245a215 Another packaging update. I think we're done now. 2013-01-12 00:33:32 -05:00
Christian 48544db690 Fix modlist to use the new texture binding functions, i think 2013-01-12 00:27:11 -05:00
Christian 2c89b3def3 A couple of packaging tweaks, clean up more junk. It may come back but for now it's gone 2013-01-12 00:17:35 -05:00
Christian 5689182088 Delete old patches not needed anymore 2013-01-11 23:53:14 -05:00
Christian 4a1f4b90fd Initial patch update for snapshot 2013-01-11 23:47:05 -05:00
Christian f2d42d1134 Initial setup for snapshot- the client compiles, but patches fail to apply. 2013-01-11 22:49:09 -05:00
LexManos 51e7606e74 Updated patches for new JAD style names. 2013-01-11 13:16:40 -08:00
LexManos 723c2d98eb FML will now rename local variables to have JAD-style names instead of FernFlower var## names. New script to do this, to allow for modders to run it over there own code: python rename_vars.py -mcp [folders to rename]... 2013-01-11 13:16:23 -08:00
Christian 7dee072e1a Fix incorrect end length calculation. Closes #161 Thanks BStramke! 2013-01-11 09:41:47 -05:00
Christian 3e18c4160f Fix LanguageRegistry loading files in UTF-8 format. loadLocalization should work for non-xml in
all languages now (assumes UTF-8)
2013-01-08 08:46:50 -05:00
cpw 513ad19187 Merge pull request #158 from CovertJaguar/patch-2
Added an accessor for villagers
2013-01-08 05:36:45 -08:00
CovertJaguar eabede2203 Added an accessor for villagers 2013-01-07 14:55:17 -08:00
LexManos b22dbc12a2 New python script to update java files for new package names. Usage: paython update_packages.py --mcp-dir <mcp folder> [Folders To Repackage] 2013-01-06 22:10:19 -08:00
LexManos 708e86adfb New python script for signing partial jar files. See comments inside for details. 2013-01-06 22:09:12 -08:00
Christian 6f1b762c9d Move server stopped *after* the server has actually stopped. *sigh* 2012-12-31 01:20:35 -05:00
Christian d9bfb29d6c Add in a "server stopped" event 2012-12-30 23:52:38 -05:00
Christian 6fc7bc4941 Add in some classloader debugging information: use fml.debugClassLoading=true as a system property
to track down problems with classes not being found or loading erratically.
2012-12-30 21:32:37 -05:00
Christian fb701cdc5e Revert MCP name change for canConnectRedstone - it conflicts with a forge method of the same name and breaks 1.4.6 to 1.4.7 compatibility 2012-12-29 00:00:24 -05:00
Christian f7cc50b521 Update for MC 1.4.7 2012-12-28 10:07:53 -05:00
Christian 1a232cf766 Fix multiple GUI containers for ML containers. Sorry ultimatechest that
this fix took so long, a bug report at github.com/cpw/FML would help,
next time ;)
2012-12-27 23:00:52 -05:00
Christian 853f54bcc2 Log if there's a problem reading the class bytes 2012-12-27 23:00:37 -05:00
LexManos 127be2237d Fix NPE in fingerprint loading, and pass expectged fingerprint to FMLFingerprintViolationEvent 2012-12-25 15:59:30 -08:00
Christian 7e6456d7cd Fix a message delivery issue in IMC 2012-12-24 09:41:22 -05:00
Christian 664ebda599 Some tweaks for signing and ID matching 2012-12-23 22:27:26 -05:00
LexManos 9b4a225ad2 Remove unneeded file 2012-12-20 14:30:59 -08:00
LexManos 6c59fa2d2c Fixed placement of onConnectionClosed callback. 2012-12-20 14:30:41 -08:00
LexManos 5736d850f0 MCP will reobf classes with reserved names in windows to a legal file name. And FML will try to read these classes over the default ones. 2012-12-19 19:10:00 -08:00
LexManos 127d6ee8ac Output obfed files with reserved windows names to _NAME.class 2012-12-19 18:12:11 -08:00
LexManos 2055543042 Add quotes around javac command. 2012-12-19 02:58:09 -08:00
Christian 40e57a26a9 Update MCP to newer version
Fix fingerprint fire
2012-12-18 16:43:48 -05:00
Christian d604e44195 InterModComms now supports a runtime polling based model for inter-mod comms at
runtime.
Deprecate method that shouldn't be used. COPY it's content to your mod. Don't CALL it.
2012-12-18 13:58:57 -05:00
Christian 8b7778ccb6 Don't be as alarming about item overwrites. 2012-12-18 08:33:46 -05:00
Christian 7e30814ecb Added configuration file which allows modids to ignore ID validation checking. IT WILL CRASH YOUR GAME in 99.999% of cases.
Immibis is a whingy ass. And TinyTimRob too. Now STFU and GTFO. closes #510 for ever.
2012-12-18 08:15:46 -05:00
LexManos e5b1dfb74c Dixed ev eclipse worksapce, now references BC. 2012-12-18 05:10:32 -08:00
LexManos 27bc77363e Added client src folder to classpath for startclient/startserver. 2012-12-18 05:06:20 -08:00
LexManos 506b73d0a0 Removed hardcoded additions 2012-12-18 05:05:25 -08:00
Christian 20337b6e8a Update to MC 1.4.6 2012-12-17 21:48:29 -05:00
Christian 33ff87d8d9 Fix build script 2012-12-17 17:56:00 -05:00
Christian af06bbd373 more 1.4.6 tweaks 2012-12-17 17:00:54 -05:00
Christian 92a47ace8b More work 2012-12-17 14:30:51 -05:00
Christian f285ac369a Merge branch 'securityupdate' 2012-12-17 11:46:47 -05:00
Christian 68e76c273a Merge branch 'master' into securityupdate 2012-12-17 11:46:27 -05:00
Christian e98c311a2c Fix up handling null names. *sigh* 2012-12-17 10:29:54 -05:00
Christian 293edb316e Some tweaks to item identification. The GameRegistry methods are deprecated
to encourage you to use the new named ones instead. These will force a
name on the item/block, allowing for stronger matching than "sequential guessing"
2012-12-16 22:57:11 -05:00
Christian 2d4465eaf7 More fixes 2012-12-16 21:22:55 -05:00
LexManos 9266ff394a Updated MCP download mirriors upon Searge's request. 2012-12-16 05:35:46 -08:00
Christian bbfd85ed1e Move Side and SideOnly to relauncher package 2012-12-15 23:21:26 -05:00
Christian 6ecc2303f4 Fix newline fun 2012-12-15 22:37:32 -05:00
Christian d35cfda798 More stuff for the thingy 2012-12-15 22:30:16 -05:00
Christian cffa2a92a6 Remove old NEI/CCC compatibility code and other classloading tweaks 2012-12-15 20:40:08 -05:00
Uristqwerty 179c504746 Simplify logic in tick start/end
Change the EnumSet equivalent of "A &= ~ new(~B)" to "A &= B".
This eliminates the need for one temporary object in a frequently called loop, and reduces the number of methods that need to be invoked.
2012-12-14 04:14:17 -05:00
LexManos 31695d5ec1 Fix var name messup 2012-12-13 00:22:30 -08:00
LexManos bfb3020505 Update released eclipse project to link BouncyCastle 2012-12-12 23:44:28 -08:00
Christian 22a88ea2e4 Change ID management slightly. IDs are tracked by block type for itemblock items now. This means servers will need to update.
Also, ordinal rearrangements within a mod will no longer trigger server disconnection, though a warning will still be logged.
2012-12-12 19:31:05 -05:00
Christian 0423fa5885 Fix possible escape leakage.. 2012-12-12 19:31:05 -05:00
LexManos d17fbb527f More robust eclipse workspace replacement 2012-12-12 14:31:07 -08:00
LexManos d40bb0fe32 Kill decompile if astyle is not found and set execution bits on mcp .sh files and astyle-osx 2012-12-11 21:47:45 -08:00
Christian a513060a81 Change to download bouncy castle as well. We also finally properly use the downloaded libs
even in vanilla code!
2012-12-11 22:37:07 -05:00
Christian 8e594a347c Remove extraneous patch file 2012-12-11 20:37:12 -05:00
Christian 9af365edcc Merge branch 'repackage'
Conflicts:
	build.xml
	client/cpw/mods/fml/client/FMLClientHandler.java
	client/cpw/mods/fml/client/GuiIdMismatchScreen.java
	common/cpw/mods/fml/common/FMLCommonHandler.java
	common/cpw/mods/fml/common/IFMLSidedHandler.java
	common/cpw/mods/fml/common/network/ModIdMapPacket.java
	common/cpw/mods/fml/common/network/ModListResponsePacket.java
	common/cpw/mods/fml/common/registry/GameData.java
	common/cpw/mods/fml/common/registry/GameRegistry.java
	common/cpw/mods/fml/common/registry/ItemData.java
	common/cpw/mods/fml/common/registry/LanguageRegistry.java
	common/cpw/mods/fml/server/FMLServerHandler.java
	install/fml.py
	patches/minecraft/net/minecraft/client/Minecraft.java.patch
	patches/minecraft/net/minecraft/server/MinecraftServer.java.patch
	patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch
2012-12-11 14:58:38 -05:00
Christian 70554d6a2b Merge branch 'repackage' of github.com:cpw/FML into repackage
Conflicts:
	common/cpw/mods/fml/common/registry/GameData.java
2012-12-11 14:49:23 -05:00
cpw eb84f52493 Merge pull request #145 from pahimar/master
More logging of loading files in LanguageRegistry
2012-12-11 08:28:39 -08:00
pahimar d074830d95 Update common/cpw/mods/fml/common/registry/LanguageRegistry.java
Add in logging of what file failed to be loaded
2012-12-11 11:27:05 -05:00
LexManos f7fe9ebeb2 Fix patches, rebased with HEAD 2012-12-10 15:37:48 -08:00
LexManos b2c8f37aec Remade python dist as 32-bit. 2012-12-10 15:26:15 -08:00
Christian a5bcccab59 Fixing id map generation - should validate correctly now 2012-12-10 15:26:13 -08:00
LexManos a11f368b62 Reenabled replacement of the eclipse folder. 2012-12-10 14:56:23 -08:00
LexManos 59656b004b Remade python dist as 32-bit. 2012-12-10 14:56:05 -08:00
Christian ff8cb67a99 Fixing id map generation - should validate correctly now 2012-12-09 22:24:16 -05:00
Christian fa5256c8a7 Fix up idmap code 2012-12-09 22:01:13 -05:00
LexManos 4b19987ee6 Some derp protection in the workspace copy. 2012-12-09 02:20:21 -08:00
LexManos 9f43303073 Removed remaining references to src/common
Fixed eclipse workspace replacemnt on source dist
Cleanup some outputs
2012-12-09 02:10:28 -08:00
LexManos a20958fb56 Updated build script to not use the mcp common directory as it doesn't exist anymore. 2012-12-08 21:41:51 -08:00
LexManos 8c71098081 Fished moving out the rest of the default packaged classes to aproperiate packages. Updated patches and code to reflect. 2012-12-08 21:41:16 -08:00
LexManos a3a5b44acb Updated the update_packages script to support different mcp locations 2012-12-08 21:40:39 -08:00
LexManos 0473273709 Update fml_marker.cfg, Minecraft is now runnable! 2012-12-08 20:25:29 -08:00
LexManos bf492f32f9 Update all imports for repackaging. Branch is compileable. 2012-12-08 20:21:03 -08:00
LexManos 4744677646 Some stragler patches 2012-12-08 19:34:35 -08:00
LexManos f0af2e4ef5 Updated patches to new packages. 2012-12-08 19:33:29 -08:00
LexManos c7f763d6f0 Give new classes a distinct package to be moved from. 2012-12-08 17:50:14 -08:00
LexManos 563b8d1215 Fixed 0.tree to actually refresh the workspace. 2012-12-08 17:35:11 -08:00
LexManos 221493453f Remerged branch, and updated dev eclipse workspace. 2012-12-08 17:08:51 -08:00
Christian 86c928430a Add in storage, detection and validation of the ItemID array between client and server
and also for world saves. May help with item configuration issues.
2012-12-08 17:05:18 -08:00
Christian cd0a0e51d5 Add a modid on the mods list, should make it easier to do things like forge chunkloading config 2012-12-08 16:46:47 -08:00
Christian 66ff95f9d7 Fix build eclipse extractor task 2012-12-08 16:46:46 -08:00
Christian 8ad172295f Add in storage, detection and validation of the ItemID array between client and server
and also for world saves. May help with item configuration issues.
2012-12-07 01:52:16 -05:00
Christian 26a2ef5995 Add a modid on the mods list, should make it easier to do things like forge chunkloading config 2012-12-04 18:08:27 -05:00
Christian b4e3490fa1 Fix build eclipse extractor task 2012-12-04 18:04:45 -05:00
Christian 828341f987 Fix typo 2012-12-04 01:30:38 -05:00
Christian bc03fbb3be Merge branch 'master' into repackage
Conflicts:
	eclipse/Clean/.classpath
	eclipse/Clean/.project
	eclipse/FML/.classpath
	eclipse/FML/.project
	install/fml.py
2012-12-04 01:24:50 -05:00
Christian 7a8dae5e35 Try and make branch non-derpy 2012-12-03 23:47:23 -05:00
Christian d3c0e1f589 Try defaulting branch differently 2012-12-03 22:26:12 -05:00
Christian 9c77d3f25b Remove old eclipse workspace and ship/extract as a zip file (use ant setupenvironment)
Fix up install.py for forge multibranch changes
2012-12-03 19:55:37 -05:00
LexManos 6371e9b71e Assume Forge is the parent directory when checking for AT configs. 2012-12-03 16:53:03 -08:00
Christian 578ef5cfeb Merge branch 'master' into repackage
Conflicts:
	patches/minecraft/net/minecraft/client/EntityFX.java.patch
2012-12-03 17:31:29 -05:00
Christian 516954e6f9 Name both zips the same format 2012-12-03 08:38:20 -05:00
Christian 1151d5c3e3 Last part of branch name only please 2012-12-03 08:30:44 -05:00
Christian 25f1ddac30 Try and get a valid branch name on jenkins 2012-12-03 08:23:21 -05:00
Christian 39a146f8e6 Clean up build.xml script- support outputting a branched jar file 2012-12-03 08:13:20 -05:00
LexManos 037dcaefea Small derp in install.py 2012-12-02 20:26:36 -08:00
LexManos 01d6da3a90 Try marking python as binary. 2012-12-02 20:19:55 -08:00
LexManos 8b2665980d FML will now attempt to download MCP as part of the install process
Now shipping a py2exe version of python for windows.
Linux/Macs should come with python pre-installed so they do not have a distrabution here.
2012-12-02 19:59:22 -08:00
LexManos 42b3e6ad56 Windows Python distrabution created using py2exe, thanks Fesh0r for the script. 2012-12-02 19:56:17 -08:00
LexManos e709ab8a70 Marked more spots in gui/items bitmask as being free. 2012-11-21 15:58:04 -08:00
LexManos 501409d1fb Delete duplicate file 2012-11-20 18:07:39 -08:00
LexManos 0fb3a34235 Finished repackaging net.minecraft.* net.minecraft.client is left 2012-11-20 17:58:22 -08:00
LexManos e4ba1f863e More re-packaging, got most classes out of the default package. 2012-11-20 17:22:55 -08:00
Christian 1f5c58b723 Fix up MCP version 2012-11-20 08:47:14 -05:00
Christian 61e4db2c3b Merge joined.exc add update howto 2012-11-20 08:38:33 -05:00
Christian 5efc1eb34c Revert "Fix MC-2497 - derpy torch flames. Moved from forge. Everyone should benefit."
This reverts commit fa567014a5.
2012-11-20 08:27:13 -05:00
LexManos 96c6f91201 Remove common folder from projects 2012-11-20 03:15:45 -08:00
LexManos 62e69a2804 Move IBossDisplayData to shared 2012-11-20 03:15:16 -08:00
LexManos e9352d2675 First half of new patches 2012-11-20 03:15:01 -08:00
LexManos ee6abdf28d Update FML imports 2012-11-20 03:14:36 -08:00
LexManos 968ee7ab09 Inital script side commit for MC source repackaging done. 2012-11-20 01:55:41 -08:00
LexManos 3b3600d44f Modified merger to just consider all server classes as common. And moved the defnition of CodecMus to the config. 2012-11-19 17:45:53 -08:00
LexManos edcc5ca554 Forgot mcp.cfg 2012-11-19 15:47:18 -08:00
LexManos ca79dfe298 Updated to 1.4.5b 2012-11-19 15:35:08 -08:00
LexManos 5945279b8b Fix python error 2012-11-19 15:03:13 -08:00
LexManos 57bf64318b Modified decompile so that we do not have to decompile the server, saves time. 2012-11-19 15:01:04 -08:00
LexManos d9d0a46809 Cleaned up some tabs 2012-11-19 15:00:11 -08:00
LexManos 2fac644914 Change usage of ZipFile, fixes issues with Mac's default instation of python. Also cleaned the python a little bit. 2012-11-19 13:33:22 -08:00
Christian 570592b24b Attempt to fix a possible comodification risk 2012-11-18 20:40:48 -05:00
Christian fde94144ec Change texturebinding to use the textureId directly rather than iconIndex
to determine if it needs to rebind the texture sheet
2012-11-18 08:45:25 -05:00
Christian f348496c10 Fix mod display list. Shouldn't be derpy anymore. 2012-11-17 23:51:14 -05:00
Christian a5c31b5365 Fix World patch- workaround no longer required and leftovers are bad. 2012-11-17 23:44:53 -05:00
LexManos 2dc3f0ddef Cleaned up the AT config updater, should work for any setup of the MCP workspace now. 2012-11-17 19:08:47 -08:00
Christian fa567014a5 Fix MC-2497 - derpy torch flames. Moved from forge. Everyone should benefit. 2012-11-16 22:50:21 -05:00
Christian 96935bb122 Fix an NPE in TileEntity trying to generate a crash report. Make suspicious classes just return the obvious.
Fix NPE for FML crash report on server. Clean up dead patches.
2012-11-16 22:50:00 -05:00
Christian 43d3042dff Clean up a patch 2012-11-16 16:49:44 -05:00
Christian fec221f8a6 Update FML for MC 1.4.5 2012-11-16 16:31:06 -05:00
LexManos b0f0635eb3 Fix for ModLoader static overrides not displaying. 2012-11-15 14:08:41 -08:00
Christian 23a25131b0 Fix up derpy file name handling: closes #127
Fix up duping childmods: closes #126
FMLPreinitializationEvent now offers a getLogger() that'll return your mod a personalized logger instance
2012-11-12 17:54:21 -05:00
LexManos a6eaa2bebc Fix spelling issue. 2012-11-08 21:01:31 -08:00
LexManos c6a0741379 FML setup should now download and verify all the minecraft files needed to run MCP. 2012-11-08 17:54:05 -08:00
Christian 5a1930e2d6 Small fix to some MCP metadata for pre2 2012-11-08 20:34:45 -05:00
Christian 418deba5bf Update to MC 1.4.4 2012-11-08 17:55:20 -05:00
Christian 4ff2cff3c0 Fix bug when a modloader mod is run on a dedicated server and has a
connection handler assigned to it. Hi SmartMoving! Perhaps you should try
@Mod instead of BaseMod?
2012-11-04 10:57:49 -05:00
Christian bd2123cf9d Clean up some patch fuzz 2012-11-02 17:32:39 -04:00
Christian c2a603c910 Update joined.exc file from latest conf 2012-11-02 17:23:54 -04:00
Christian db12af48fa Update to 1.4.3 2012-11-01 23:53:13 -04:00
Christian a0f574a0ac A useful tool for performing updates 2012-11-01 23:11:21 -04:00
Christian 8356fe9a7b FUUUUUU! Stupid ticking. STOP REGISTERING TICK HANDLERS IN YOUR CONSTRUCTORS.
I'm looking at you Rei's!
2012-11-01 10:51:17 -04:00
Christian 6edce8b5f4 Patch a file handle leak in RegionFileCache handling when under memory pressure. 2012-10-31 22:58:01 -04:00
LexManos ca2bbe0b5f Update MCP mapings again, yay bad syncs. 2012-10-31 09:23:17 -07:00
LexManos c8941a7faa Updated MCP mapings. 2012-10-31 07:40:53 -07:00
LexManos 5e20c03736 StartServer is now useable in merged code base. 2012-10-31 07:40:40 -07:00
Christian b19e882aab Remove some debug, closes #123 2012-10-30 21:53:08 -04:00
Christian 9d7d32a1b5 Fix up tick management outside of mod loading phases for ModLoader mods. 2012-10-30 21:47:06 -04:00
Christian d512539554 Negatively cache failed class lookups, should help with @SideOnly performance issues. 2012-10-30 21:17:17 -04:00
Christian a3a93f3387 Fix some whitespace issues, handle possibly bugged entities as well 2012-10-30 09:13:18 -04:00
Christian a7eb5dc773 Vanilla/mod bug fixes: CME on entity processing, TileEntity resetting chunk on save/load. 2012-10-29 17:41:08 -04:00
Christian b23081df78 Support for ModLoader 1.4.2. Good job Risu! 2012-10-28 23:55:58 -04:00
Christian 66db4ec46e Add in an exclusion list tag for @Mod. The backend code isn't yet implemented, but shows the basic idea. 2012-10-27 15:13:28 -04:00
Christian 8bd98c3a2d Fix a small problem with the new MCP container- it can cause NPEs. Nice. 2012-10-26 07:55:23 -04:00
Christian 34cc42d3cb Fix up some javadoc complaints 2012-10-25 16:18:42 -04:00
Christian 09eade4623 Update build - include MCP information in the source pack 2012-10-25 10:00:34 -04:00
Christian 9bfe7df373 MCP deserves lots of credit. So here it is. 2012-10-25 09:02:49 -04:00
Christian 8006b774bf Fix instantiation bug 2012-10-24 21:58:36 -04:00
Christian 7cc91cfb0c Simple InterMod comms. Send a message using FMLInterModComms.sendMessage(). Receive messages through an @IMCCallback 2012-10-24 16:39:55 -04:00
Christian 24d72852e7 Update for MC 1.4.2 2012-10-24 15:12:06 -04:00
Christian cedf3d55d5 Duplicate Mod display screen. 2012-10-24 09:41:46 -04:00
Christian d915f39996 Fix typo in access transformer 2012-10-23 21:21:28 -04:00
Christian 346691c298 Fix the merge for forge 2012-10-23 18:36:05 -04:00
Christian 6dadc1d889 Fix up references to minecraftDir in obf code 2012-10-23 18:10:06 -04:00
Christian 8a55f68a18 Update FML for Minecraft 1.4.1 2012-10-23 18:00:33 -04:00
LexManos 5645fa5847 First update to 1.4.1, patches need updating. 2012-10-23 14:44:04 -07:00
LexManos ff0f00f64f Add some null checks, and throw descriptive exception when SideTransformer prevents a class from loading. 2012-10-23 13:32:02 -07:00
Christian 7a34246dc9 Ship a client only class so the merge works both sides. 2012-10-21 22:50:20 -04:00
Christian 62a6b52487 Fix RenderRegistry render ID - now at 36
Fix SpriteMaps - they're running out fast! Switch to forge if you can!
RenderBiped now has an armorlist- so armortypes add to it as well
2012-10-21 12:41:53 -04:00
Christian b845cde73d Fix up FML python script for forge 2012-10-21 08:19:36 -04:00
Christian 2c36dfbb34 Update to MCP pre 3. Fixes some weirdnesses with explosions. 2012-10-21 07:11:09 -04:00
Christian acd880dd2a Merge branch '1.4' 2012-10-20 18:07:22 -04:00
Christian e6f57e5d94 Update for MCP release 2012-10-20 18:02:26 -04:00
Christian b1de0fc17c Remove fuzz from patches for INetworkManager change 2012-10-20 17:16:50 -04:00
Christian ad4461932f Fix for new names INetworkManager and ITexturePack. I also provide refactoring scripts for both, for your use... 2012-10-20 17:07:59 -04:00
Christian 3a94211377 Add a script to ignore git complaining about the eclipse workspace changing - run when you first open the eclipse workspace 2012-10-20 15:24:05 -04:00
Christian 9386e23b1f Update gitignore - ignore the files that will change or be deleted 2012-10-20 15:14:06 -04:00
Christian 10b318c71d Add in "starter" image for eclipse workspace 2012-10-20 15:02:37 -04:00
Christian 995d5b7b3a Eclipse workspace fixup 2? 2012-10-20 14:42:25 -04:00
Christian bbb12c84fd Clean up eclipse workspace- part 1 2012-10-20 14:09:44 -04:00
Christian b50058ee47 Clean up a bit of patch fuzz 2012-10-20 12:39:40 -04:00
Christian 4a0bfa937a Fix CommonHandler for rename of the server thread class 2012-10-20 12:31:35 -04:00
Christian 4d1ec666dd Update with RC2 MCP. Use the joined.exc file directly since MCP now provides it. 2012-10-20 12:27:30 -04:00
Christian b52e3d0e7d Fix exception for CodecMus 2012-10-20 12:12:43 -04:00
Christian a1011c99a9 Fix some compilation issues. Requires resolving the worldclient abstract method 2012-10-20 11:30:01 -04:00
LexManos 0ebd4f3d94 Inital patch update to 1.4 2012-10-20 02:43:03 -07:00
LexManos 89c68c46a2 Moved into EntityVillager 2012-10-20 02:42:34 -07:00
LexManos e4702cb09d Fix line ending detection during checkout. 2012-10-20 02:32:29 -07:00
LexManos 6e64fd7a11 We don't need logging here... 2012-10-20 02:27:26 -07:00
LexManos 014b3f4ad5 remove useless -Server projects 2012-10-20 00:43:02 -07:00
LexManos 7628c67883 Updated the AT config and Marker config for 1.4 obf 2012-10-20 00:36:33 -07:00
LexManos 54a322c09f Updae build to copy files that may decompile differently but are actually the same, and updated for 1.4 values. 2012-10-20 00:06:55 -07:00
LexManos aadf396244 Update MCP Merge config. 2012-10-19 23:57:49 -07:00
LexManos 81e18552e3 Pull in MCP's 1.4 conf files. 2012-10-19 23:57:05 -07:00
LexManos 5686fd40a4 Fix error in merging of exec's 2012-10-19 21:14:03 -07:00
Christian 989ab3e96b Update build.xml - add a classpath to the manifest. This means the universal jar is now a server side launcher. 2012-10-18 21:07:33 -04:00
Christian 88f1dc97b6 Typos! 2012-10-18 21:00:58 -04:00
Christian 470a18522c Try and avoid an NPE in crash reports 2012-10-18 14:41:32 -04:00
Christian 002951804a Fix logging problems- log death messages and re-route the server through FML logs properly. 2012-10-17 18:05:23 -04:00
Christian fe7a832fad Fix the test mod 2012-10-16 13:24:29 -04:00
Christian a2bc30b356 Coremods can be specified via the command line: fml.coreMod.load=<listofcommaseparatedclasses> This will help with developing coremods 2012-10-16 13:21:10 -04:00
Christian bae1f74681 Fix classpath for server 2012-10-16 12:40:01 -04:00
Christian 887aa277a4 Add in the ability for a client to throw a custom exception that displays a custom gui instead of the default error message. 2012-10-16 12:39:04 -04:00
Christian e17f2677c7 Update FML internal classpath. Helpful for coremod devs 2012-10-16 09:47:06 -04:00
Christian 3b9972af39 Don't use File to separate the last element of the path. It's a URL, they're always separated by '/' 2012-10-16 09:46:08 -04:00
keepcalm 5c96afec70 Changed RelauchLibraryManager so that files with different paths on the
same baseURL can be implemented in one ILibrarySet.
2012-10-16 09:46:08 -04:00
Christian 1bca393ecb FML as a whole is now subject to transformers. 2012-10-16 09:20:30 -04:00
Christian 27cf731552 Bonus extra character. thanks randomitter! 2012-10-16 09:06:13 -04:00
cpw 94c84cd994 Merge pull request #116 from Vazkii/patch-1
Add Null check to FMLClientHandler.sendPacket
2012-10-07 10:45:22 -07:00
Vazkii c2d3195e76 Add Null check to FMLClientHandler.sendPacket 2012-10-05 17:36:52 +02:00
Christian d0e7c9e2ea Update patches *sigh* 2012-10-02 22:04:25 -04:00
Christian f3e1cac5a1 Add in a savehandler strategy for reading and writing data to the
world save. This service is only available to coremods via the
WorldAccessContainer interface on the mod wrapper. This is deliberate
and will not change.
2012-10-02 21:54:47 -04:00
Christian 51fb513213 Add in some bukkit supporting code. Most of this is unimplemented
until the bukkit coremod is complete.
2012-10-02 20:26:47 -04:00
Christian 65c9fdd8d7 New stuff on the ModLoader! Risu has been busy. Closes #114 2012-10-02 08:29:12 -04:00
Christian c1d4458acc Mods can now declare a range of minecraft versions they will run against 2012-10-02 01:29:46 -04:00
Christian ca1ca4f944 Fix maps supporting greater than byte() dimension sizing 2012-09-29 00:21:42 -04:00
Christian 15ee8bf5a1 Fix language registry additions, closes #113 2012-09-28 22:12:23 -04:00
cpw a08b5b19d5 Merge pull request #112 from pahimar/master
Additonal Language Registry functionality
2012-09-26 21:57:53 -07:00
pahimar 8dac58ffc1 Added ability to query the Language Registry by key and language for specific localized text, as well as loading in localization text from a specific file/URL 2012-09-26 15:41:58 -04:00
Christian f0837070d6 Extreme headless mode is back! 2012-09-25 22:46:47 -04:00
Christian dd7502a051 Fix parent child counts showing properly. Closes #107 thanks scott! 2012-09-25 19:00:36 -04:00
Christian b36d4471e6 It's useMetadata, not usesMetadata. thanks myrathi and psx. closes #110 2012-09-25 18:57:42 -04:00
Christian efb1066a88 Fix random shuffling when manipulating biomes by using a LinkedHashSet to preserve iteration order. Closes #111 2012-09-25 18:54:46 -04:00
Christian dd39ae540b Try and fix the newline capture so consoles show on the server on windows again 2012-09-24 17:22:39 -04:00
Christian b39f808618 Readd ancient searge name so dan200 and computercraft can run again. REMOVE THAT CODE DAN. 2012-09-24 17:22:16 -04:00
Christian a2c059e562 Fix missing import. Thanks ichun :( 2012-09-21 18:17:56 -04:00
Christian 19316a0d38 Version file searching should work for directories too 2012-09-21 17:39:52 -04:00
Christian fbc7a5c063 Fix bug causing NPE if non-whitelisted player joins an FML server without FML installed 2012-09-21 10:12:39 -04:00
cpw e9cfd10e39 Merge pull request #103 from iChun/patch-2
Fixed ModTextureAnimation not updating and not binding to correct image.
2012-09-19 05:12:04 -07:00
iChun 1424883773 Fixed ModTextureAnimation not updating and not binding to correct image. 2012-09-17 23:46:09 +08:00
Christian 6c746ec6d9 Tidy code 2012-09-16 21:44:11 -04:00
Christian aacbfeb66e Change version.properties search slightly, allow access to found file from the preinit event 2012-09-16 21:42:59 -04:00
Christian 1513b369d3 Add in the capability to read an internal version as <modid>.version from a file
in the zip call version.properties. Handy for autobuilding scripts.
2012-09-16 21:05:56 -04:00
Christian 35852a69fb Fix up reversed assignment for version fallback 2012-09-16 21:05:56 -04:00
LexManos 96537dc091 Fixup Item in hand rendering of textures > 16x 2012-09-15 18:24:27 -07:00
LexManos e88ddc56ca Make the exception print for headless servers if the Downloader cant initalize. 2012-09-15 18:06:59 -07:00
LexManos f24ff07b30 Remove a bunch of warning about javadoc, not a real fix, but no more warning. 2012-09-15 18:04:56 -07:00
LexManos 3420ea7a2d Update MCP Mapings 2012-09-15 17:09:45 -07:00
LexManos 87104f0e2d Makes GetModSrc check the common folder when attempting to extract source files 2012-09-15 17:09:34 -07:00
Christian 640446b868 Tie parent/child containers together again. Should close #96 2012-09-15 15:58:20 -04:00
Christian 2cf4917ded Village mating produces added villagers, and the egg should place
added villagers too. Closes #97.
2012-09-15 15:49:08 -04:00
Christian 6394ee8714 Clean up stale references to the Player stored in the NetworkRegistry,
closes #100
2012-09-15 15:36:26 -04:00
cpw 7299e05fe1 Merge pull request #99 from CovertJaguar/patch-1
More readable state event logs
2012-09-15 12:20:26 -07:00
CovertJaguar c4bd0405fd More readable init logs 2012-09-14 00:47:48 -07:00
Christian 89b8236a9c Fix onConnectionClosed not being called on the client side of a connection 2012-09-09 11:29:08 -04:00
Christian 70f55c59c0 Add in exclusion list for IFMLLoadingPlugin. 2012-09-08 12:19:03 -04:00
Christian 1c1716d833 Remove debug cruft 2012-09-07 23:14:54 -04:00
Christian d567f79652 To properly align with packet9respawn, make packet1login's dimension an int as well 2012-09-07 22:57:01 -04:00
Christian ecd4e46a45 Attempt to build some protocol negotiation, and fix packet1login so that the dimension is a short, matching packet9respawn 2012-09-07 22:46:31 -04:00
Christian 16fe495d18 Compatibility level is now passed from server to client - and
the client tracks it. This means certain packet changes can be made
without breaking comms, hopefully
2012-09-07 19:32:36 -04:00
Christian 4f70d23d0e Fix dependency checking: you can depend on specific versions of FML 2012-09-07 19:08:28 -04:00
cpw 290a3c94b7 Merge pull request #94 from iChun/patch-1
Fix handleTinyPacket using short instead of int.
2012-09-07 05:43:39 -07:00
iChun 9485dc5a96 Fix handleTinyPacket using short instead of int.
Silly cpw :P
2012-09-07 18:35:26 +08:00
Christian e6abb69b0e Fix up tiny packet handler to actually work 2012-09-06 22:59:38 -04:00
Christian e862052bb4 Allow javax to be shipped by mods. Should allow some more modloader mods to work
unaltered
2012-09-06 22:03:02 -04:00
Christian 4071ad1278 Add in a little bit of protocol cleanup. Start work on allowing multiple
protocol versions
2012-09-06 21:54:43 -04:00
Christian 60619643e6 Give a way to build the packet131mapdata packet correctly populated 2012-09-06 10:12:37 -04:00
Christian b818769c1f Capture and leverage Packet131MapData 2012-09-06 10:03:30 -04:00
Christian 12bc4bab0c Make console logging pass through a single logging thread to avoid concurrency problems with launchers and stuff 2012-09-04 19:11:45 -04:00
Christian 8fccfa21df Overlooked chat message support *sigh*. Fixes wierd mods that communicate through custom
chat messages rather than anything else. Hi Superior enchanting!
2012-09-04 12:37:59 -04:00
Christian a697d043fc Rescan mod packages where there was a possible mod identified to try and make sure we load it. Fixes Matmos r16 2012-09-04 11:39:51 -04:00
Christian 9d812f12cc And handle the other way to globally register an entity 2012-09-03 21:37:20 -04:00
Christian 869cf78e98 Fix up mods trying to register entities outside of modloading. Now you'll get a big fat warning for doing such a derpy thing. 2012-09-03 21:32:21 -04:00
Christian 186680cd8c Fix CJB mod compatibilty for real. Gui container registration can now happen in the constructor. YUK! 2012-09-03 21:14:11 -04:00
Christian 5aed6d995d Fix compatibility with ModLoader dispenser hook. Fixes a bug with
IDispenseHandler too - though it means that interface is now
deprecated
2012-09-03 11:37:17 -04:00
Christian 3d7a665987 Fix headless operation, hopefully 2012-09-02 13:29:46 -04:00
Christian 10a716969b Fix up trying to re-add stuff to the classpath when it's already there 2012-09-02 12:56:08 -04:00
Christian 0eb7180fc1 Fix out of range entity id handling for ModLoader mods a bit more. Thanks Herobrine mod! 2012-09-02 12:39:06 -04:00
Christian b1b4c61b80 Expose GuiMerchantButton 2012-09-02 12:15:13 -04:00
Christian 359cfb5c98 Log a big fat warning for the developer in the case the network version
is not acceptable to the mod itself. (This can happen because of a bad range
specifier for example)
2012-08-31 23:41:29 -04:00
Christian 8656fd50ce Also, make missing entity not blow things up 2012-08-31 16:49:35 -04:00
Christian 25a4dcb653 Fix entity tracker "update" packet not computing correctly. Should work now.. 2012-08-31 16:41:05 -04:00
Christian c90a853377 Fix up addRenderer to catch exceptions from the basemod, also, addrenderer now supplies a list of the
default renderers from MC for editing and will note the changes made.
2012-08-31 11:18:17 -04:00
Christian 18069d8fd2 Change download location for FML libraries to files.minecraftforge.net, add an encoding param to the javac command line to force utf 8 2012-08-31 11:18:17 -04:00
Christian a40f4a75a9 Add in random jar/zip files to the classpath. UGH this is so fucking ugly it's not funny. 2012-08-30 20:10:53 -04:00
Christian 5b6460b68c Use a null socket and try to prefer the result of getLocalHost in the broadcast data. 2012-08-29 16:12:40 -04:00
Christian c0d1348e65 Add in an ItemRenderer null check so FML can run render adding mods 2012-08-29 13:58:56 -04:00
Christian 482c163344 Inverted boolean logic. Grrr. 2012-08-29 13:44:40 -04:00
Christian 221d1131b4 ModLoader mob spawns use packet 24- build a bypass system so that
they can still use it
2012-08-29 12:58:16 -04:00
Christian f19f426449 Remove debug statements 2012-08-28 23:07:37 -04:00
Christian 9dd9b6eb71 Fix keybindings not loading properly from gamesettings file after restart 2012-08-28 22:15:18 -04:00
Christian acb0b21d6d Fix so we always send received packets to handlers.
Renders 250 filtering useless unless i can figure a way to intercept *outbound* packets that isn't as messy as I'm
contemplating
2012-08-27 17:46:08 -04:00
Christian b17dd3c695 Some tests 2012-08-26 22:23:05 -04:00
Christian fa66ffaf3f Fix trying to load the client side packet handler, when on the server, hopefully? 2012-08-26 22:18:57 -04:00
Christian b106420774 Fix up network negotiation - now it will disconnect with a nice
error screen if there are missing mods on the client vs server
2012-08-26 22:13:43 -04:00
Christian c971adb59b Fix missing addCommand call: thanks "spawnwolf test command" 2012-08-26 13:07:35 -04:00
Christian d6326deeb0 Fix a couple of modloader mods. Thanks! 2012-08-26 12:52:50 -04:00
Christian 483667c919 Some functionality fixes for @Instance injection. 2012-08-26 10:55:55 -04:00
Christian 8bef512803 Versions now have two flavours: the @Mod(version) which is the "programmatic version" and
is used for all version relationship calculation. The "display version" as sourced from
mcmod.info is used for display purposes only and can be literally anything. Note: they fall back
to one another when they're missing, and to "1.0" if both are absent.

Also, changed @Instance. Now, you can inject *other* mods using @Instance as long as you depend
on them as a "before" or "dependency" relationship. Classes containing @Instance will only be
loaded if the Mod the @Instance refers is present. So you don't have to worry about runtime class
resolution.
2012-08-26 10:45:00 -04:00
Christian 501009c11f Always for ML mods into "public" class accessibility - we don't call from the default package like ML does. 2012-08-25 21:57:25 -04:00
Christian d3d430827f Add in a convenience method for getting a class instance based on
existence of another Mod. Useful for soft dependencies.
2012-08-25 21:26:41 -04:00
Christian 2d9b88bd52 And more mod sorting fixes. 2012-08-24 12:10:43 -04:00
Christian 93d5934ea7 Actually *use* the sorted mod list 2012-08-24 11:58:18 -04:00
cpw 180a279558 Merge pull request #82 from Chicken-Bones/master
The access transformer will now handle classes in packages.
2012-08-23 16:47:13 -07:00
Chicken Bones cf38461911 The access transformer will now handle classes in packages.
Eg.

public net/minecraft/client/Minecraft.T #timer
2012-08-24 08:09:10 +10:00
Christian 2c85539517 Reverse the meaning of state in fml.modStates system property and fmlModState.properties - it was very
derpy before. Now: true is enabled, false is disabled, as you would expect
2012-08-23 17:37:44 -04:00
Christian d651189581 Actually fix the corrupt JSON problem 2012-08-23 17:27:53 -04:00
Christian f6a8cd556e Fix isModLoaded for "disabled" mods, and the toposort as well 2012-08-23 17:08:18 -04:00
Christian 3bde961dc7 A bit more information for dependency handling 2012-08-23 16:46:23 -04:00
Christian 6396beaef7 Fix up handing corrupt mcmod.info 2012-08-23 16:43:28 -04:00
Christian 6bc6defb07 Fix a problem with network ids 2012-08-23 16:38:34 -04:00
Christian 732861092f Fix up version handling properly. Hopefully, and the error screen. 2012-08-23 15:29:17 -04:00
Christian 9fcc452ed3 Only active mods should have dependencies checked, and be sorted 2012-08-23 14:33:54 -04:00
Christian 26302a6ff2 Fix oddity with Screen, print a version out in the sorted list! 2012-08-23 14:28:49 -04:00
Christian 62dbfb3837 Fix metadata 2012-08-23 14:05:17 -04:00
Christian b91cbe9794 Fix up versioned dependencies so they work a lot better, also add in a missing mods screen 2012-08-23 13:43:25 -04:00
Christian 93b8ba9576 Fix missing serverSendPacket 2012-08-23 09:02:12 -04:00
Christian 23fdbbd03d Trading support for ModLoader - thanks Herblore! 2012-08-23 01:40:03 -04:00
Christian d7a74d84ea Close the jar, for cleanliness sake 2012-08-23 01:39:35 -04:00
Christian 58e6dd9794 Fix authors - it'll read both "authors" and "authorList" from the json now 2012-08-23 01:17:47 -04:00
Christian 907cf2d925 More ML compatibility - fix up dragon mounts, thanks! 2012-08-23 00:37:45 -04:00
Christian ee48a3673d Fix up loading mods that are grandchildren of BaseMod 2012-08-23 00:04:34 -04:00
Christian c6f362b77f Fix entity handling for ModLoader mods, thanks parachute mod! 2012-08-22 23:46:16 -04:00
Christian 6e01c59635 Merge ChickenBones pull into FML - adds player trackers 2012-08-22 18:00:55 -04:00
Christian d411f66903 Fix formatting 2012-08-22 18:00:38 -04:00
Christian 0768dc1610 Tweak patches and hooks slightly 2012-08-22 17:58:46 -04:00
Christian 4c3db16842 More precise error handling when an invalid class is present 2012-08-22 17:50:07 -04:00
Christian 805fd1dd90 Fix textures not applying properly 2012-08-22 17:50:07 -04:00
Christian c59996b24b Fix up entity spawning - hopefully they won't warp anymore. 2012-08-22 17:50:07 -04:00
Christian e0a1e8293b Add in a helper on the server start event for adding commands to
the server.
2012-08-22 17:50:07 -04:00
Christian e8af9c0233 Move villager trading hook up a bit. thanks sengir. 2012-08-22 17:50:07 -04:00
Christian a955d30d64 Fix LAN to try hard to find a real network interface, not just localhost
most of the time
2012-08-22 17:50:07 -04:00
Christian dbab3bb259 Update build to not bother building client jar. Universal is everything
now.
2012-08-22 17:50:07 -04:00
Christian bd9c4ee99a Null protection for ticks() -- probably should uses EnumSet.noneOf() but
you can also use null now to stop ticking. closes #77
2012-08-22 17:50:07 -04:00
Christian a0cbd3755d More precise error handling when an invalid class is present 2012-08-22 17:36:26 -04:00
Christian 12323e233f Fix textures not applying properly 2012-08-22 17:27:06 -04:00
Chicken Bones 8a308db3d4 FML will now search '<mcpdir>/forge/accesstransformers' for user defined access transformer config files to be applied during forge setup 2012-08-23 06:31:00 +10:00
Chicken Bones 0583dc8b74 Added IPlayerTracker hooks 2012-08-23 06:28:53 +10:00
Christian 789a4a3659 Fix up entity spawning - hopefully they won't warp anymore. 2012-08-22 15:11:59 -04:00
Christian a87d0451c8 Add in a helper on the server start event for adding commands to
the server.
2012-08-22 15:11:43 -04:00
Christian 82e9309d27 Move villager trading hook up a bit. thanks sengir. 2012-08-22 11:50:03 -04:00
Christian 8deaa378c9 Fix LAN to try hard to find a real network interface, not just localhost
most of the time
2012-08-22 11:48:30 -04:00
Christian b5363e3552 Update build to not bother building client jar. Universal is everything
now.
2012-08-22 11:12:26 -04:00
Christian 28a10ac340 Null protection for ticks() -- probably should uses EnumSet.noneOf() but
you can also use null now to stop ticking. closes #77
2012-08-22 09:43:32 -04:00
Christian c349d51923 Automatic mod entity registration into the global entity list. This might break
entity code out there, sorry, but this way for most entities you no longer
need to manage the global mod entity stuff at all. just remove it. FML will
take care of the rest (note, worlds won't load the old entities)
2012-08-21 19:34:33 -04:00
Christian ef01745e09 Add in a utility function that *might* tell you the context
you're running in on either client or server: FMLCommonHandler.getEffectiveSide
2012-08-21 19:15:07 -04:00
Christian c97d6a65d0 Try and stop sendPacketToAllAround from being crashy 2012-08-21 18:50:26 -04:00
Christian 2062273504 Mods can add mod specific crash information to the crash report now
Forge needs to implement MinecraftForge.getCrashCallable
2012-08-21 18:48:12 -04:00
Christian 6e6436ee41 Fix up dispenser handling, add in new params for the dispenser: breaks IDispenseHandler, sorry 2012-08-20 21:44:54 -04:00
Christian 38f4a22bc4 Fix up MLProp handling for null info 2012-08-20 21:44:47 -04:00
Christian 3a8b047e3c GUIs working in FML for ML mods 2012-08-20 21:44:28 -04:00
Christian 52483ee6bd Support gui opening for Shelf mod 2012-08-20 21:43:59 -04:00
LexManos dce1cbc096 Updated MCPMerger to annotate unique classes with there sides, and SideTransformer to null out any class that is loaded on the wrong side. 2012-08-19 22:26:52 -07:00
Christian 46c563a9a8 Expose more of the village construction parts for building village
pieces
2012-08-19 11:23:29 -04:00
Christian 1380c2ecce Allow access to the type "ComponentVillage" 2012-08-19 10:35:06 -04:00
Christian 71a3818bdd Documentation and registration for villager stuff 2012-08-19 10:30:24 -04:00
Christian e3a343c797 Fix javadoc derp 2012-08-19 10:21:19 -04:00
Christian 195b1a043e Villager trading, manipulation and village enhancement. Still WIP but should be functional 2012-08-19 10:13:15 -04:00
Christian 69e66c327f Fix exception based logging to actually log the exception! 2012-08-19 09:31:26 -04:00
Christian 885637cc7d Fix up keyboard events for modloader 2012-08-19 01:44:33 -04:00
Christian 90a7c8f787 Pickup notification 2012-08-19 00:26:55 -04:00
Christian 2171c0caa4 Update fml_at with new transforms 2012-08-18 20:08:27 -04:00
Christian 924a6f9254 Fix derp where client sided packet handler would be created on a dedi server env 2012-08-18 19:50:46 -04:00
Christian ad4cffb0c6 Add in support for "dummy" keybindings- ones that are added to the list but never do anything
so the mod can handle it all themselves.
2012-08-18 10:24:29 -04:00
Christian cf77ffb89d Don't complain about minecraft source code being in "net.minecraft.src". Derp. 2012-08-18 10:09:53 -04:00
Christian b2fdcd7f1c Fix ModLoader add XP Smelting 2012-08-18 10:09:25 -04:00
Christian 094ce2ae18 Actually register client/server packetspecs as their correct sides! fixes #71 2012-08-18 09:28:36 -04:00
Christian e8cb2c1bfe Error if channel name is invalid - either too short, or too long 2012-08-17 16:59:48 -04:00
Christian 9c6c56c49d Add a connect and read timeout for downloading libraries. This should really stop the "waiting forever" at startup screen. 2012-08-17 16:21:18 -04:00
Christian 0d5affede3 GIANT FAT WARNINGS if you use any code in net.minecraft.src or any subpackage thereof. Get it out of there, now! 2012-08-17 16:13:05 -04:00
Christian 13f210f403 Fix up ML GUI ticking. Thanks sharose! 2012-08-17 16:09:46 -04:00
Christian c61ad51883 Organize ALL the imports 2012-08-17 09:25:04 -04:00
Christian c0842b0797 Expose the server in serverstart event 2012-08-17 09:25:04 -04:00
Christian 2851079ff0 Fix up directory injection of log file locations 2012-08-17 09:25:04 -04:00
Christian 5197524d1c Refer to FMLLog, not FMLRelaunchLog 2012-08-17 09:25:04 -04:00
Christian 78efd1acc6 Tidy up server launch - reflection not required anymore 2012-08-17 09:25:04 -04:00
Christian eee0a99b88 Also, log what the directory discoverer finds for mcmod.info 2012-08-17 09:25:04 -04:00
Christian 10c96c394d And log the exception if it has a problem reading the jar file 2012-08-17 09:25:04 -04:00
Christian 07cc3fb2d9 Fix jar loader failing to inject any metadata at all if mcmod.info is not found. 2012-08-17 09:25:04 -04:00
LexManos e31f1433bf Change install.cmd to install.bat, why, cuz people are .... Updated readme to mention needing server and client. 2012-08-16 22:57:11 -07:00
Christian af06c97efd Some compatibility fixes for Rei's minimap, and tidy up a couple of things 2012-08-16 13:55:42 -04:00
Christian 400de1d66e Fix Forge branding string call 2012-08-16 13:01:48 -04:00
Christian 2a9285eee8 Update FML for mcp 72 final, change download location for FML files, and make the stop button work.
Hello is NOT going to go away :)
2012-08-16 12:22:56 -04:00
Christian 785bdde6bd Fix critical bug in FML load controller that complains about injected mod containers 2012-08-16 08:34:12 -04:00
Christian 071e2dc524 Handle the case where a mod tries to do something stateful during constructor phase, and log a big
fat message about it. Don't do it!
2012-08-15 20:05:12 -04:00
Christian fc08d072a4 Small fixes, including showing the FULL name of Forge Mod Loader 2012-08-15 19:54:56 -04:00
Christian 0019485aba Fix up null array in keybinding handler 2012-08-15 19:17:21 -04:00
Christian e76f145b65 Actually add in the system property for the minecraft home, should fix multimc too 2012-08-15 19:16:36 -04:00
Christian 27d5937f4c Add in support for setting the home dir via the applet launch, also a system property for forcing the home dir 2012-08-15 17:18:11 -04:00
LexManos 868c4c5977 Cleanup fml.py a little, should fix double printing of 'patching file' 2012-08-15 03:10:45 -07:00
LexManos 5a37929ceb Wrap mod description rendering in BLEND calls https://github.com/MinecraftForge/MinecraftForge/issues/96 2012-08-15 02:52:29 -07:00
LexManos b1dc2dbf8a Made getmodifiedsrc noop for server. 2012-08-15 00:50:40 -07:00
LexManos ecfbef95c7 Fix new eclipse workspace to load the project properly from start. 2012-08-15 00:50:16 -07:00
Christian bfd8fbefee Merge branch 'minecraft132'
Yes, we are already on 1.3.2
2012-08-14 22:33:28 -04:00
Christian f8c36104ad KeyBinding handler change: a handler now takes an array of keys and calls back with the
activated key. Sorry for the inconvenience but this improves the usability of this
API a lot
2012-08-14 22:32:19 -04:00
Christian e26230fb2d Fix renderer's not getting the rendermanager set on them at registration time 2012-08-14 22:32:19 -04:00
LexManos 6417ad0a3c Finished update to MCP 7.2, MC 1.3.2 pre. 2012-08-14 19:24:49 -07:00
Christian 0f988d087c KeyBinding handler change: a handler now takes an array of keys and calls back with the
activated key. Sorry for the inconvenience but this improves the usability of this
API a lot
2012-08-14 22:06:49 -04:00
Christian 7c01b64aed Fix renderer's not getting the rendermanager set on them at registration time 2012-08-14 21:59:47 -04:00
LexManos 03130c78a7 Fixup included workspace to have single project with client/server launches. 2012-08-14 17:42:40 -07:00
Christian 30ab326d2b Start working on MC 1.3.2 2012-08-14 20:09:24 -04:00
Christian 8d1cba57f8 Add in a helper for code migrating from ML renderer stuff 2012-08-14 19:09:22 -04:00
Christian cbfd6c1a66 Merge pull request #62 from calclavia/patch-1
Shortcut function for addNameForObject()
2012-08-14 13:52:58 -07:00
calclavia 81cb3c82f4 Shortcut function for addNameForObject()
Having that long line of code makes the code a bit ugly... Please make this shortcut function like ModLoader.addName() so I don't need to use ModLoader.addName(). :)
2012-08-15 04:45:32 +08:00
Christian e64296e109 Handle mod duplicate detection much better. Default the name of a mod to it's id.
Fix up the block registry problem. Fix the packetsend from c->s actually being
"disconnect" :)
2012-08-14 13:36:29 -04:00
Christian 5872b31781 Fix entity spawn packets 2012-08-14 08:20:28 -04:00
LexManos 51b801b1c6 Force a Jenkins build 2012-08-14 01:21:56 -07:00
LexManos 9ef153c0b6 Merge pull request #60 from remuladgryta/master
fixed 'derp' error on @NetworkMod
2012-08-14 01:16:29 -07:00
remuladgryta 2e236faec7 fixed java.lang.NoSuchMethodException
getServerHandlerSpecDefaultValue() and
getClientHandlerSpecDefaultValue() should no longer give derp exeption
2012-08-14 09:50:22 +03:00
LexManos 129c356ecf FML will skip gathering MD5s for classes in the cpw package during the the inital recompile {Make Side/SideOnly reobf properly} 2012-08-13 21:53:52 -07:00
LexManos d8316b0bdc Merge remote-tracking branch 'origin/master' 2012-08-13 21:05:14 -07:00
LexManos 1d3a92f3f1 Updated FML install to provide better error output, Updated commands.py patch to disable recompile of server project. 2012-08-13 21:02:55 -07:00
Christian 81c858c719 Hopefully let build continue if server reobf fails, and fix derp in FMLNetworkHandler for entities 2012-08-13 23:25:08 -04:00
Christian 341041aedb Fix up concurrent modification exception - ticks for players now occur on both sides 2012-08-13 22:55:23 -04:00
Christian 25256b2295 Merge the last bits of the server code into the common directory, and annotate ModLoader/BaseMod for sided use
This means the FML-Server project is now defunct as all code is either common, client or bukkit.
2012-08-13 22:51:53 -04:00
Christian 13874ba547 Actually fix the applet launch - it now launches properly *and* closes the window 2012-08-13 22:12:36 -04:00
Christian bde58add62 Fix up relaunch of the applet 2012-08-13 21:44:43 -04:00
Christian 9112c63347 Change language loading a bit 2012-08-13 20:28:53 -04:00
Christian 78fa2b8d78 Update spritehelper bitmaps for items and terrain 2012-08-13 20:08:03 -04:00
Christian 6922c369f3 Tidy up some APIs, expose the addOverride mechanism. This should be pluggable by forge
but may need work to allow for each mod to have it's own override set
2012-08-13 19:57:40 -04:00
Christian b0fd438a1d Fix derp in LanguageRegistry 2012-08-13 16:45:47 -04:00
Christian 99f4f0c7d3 FMLModcontainer should not complain about annotations it has no idea about. so stfu fmlmodcontainer 2012-08-13 16:15:11 -04:00
Christian b09c1cd242 Fix derp with EntityRegistry- bimap is not the right type for the name->container list 2012-08-13 15:55:24 -04:00
Christian 5ca3bf9362 Add in a sided variant of the packethandlers in the annotation - also, a bit more
explicit warning on when to register blocks - if you do it after pre-init, you'll
reset the achievements
2012-08-13 15:26:29 -04:00
Christian c6a9884bde Generate channel registration for client, also, do it before the login events so you can send packets 2012-08-13 11:58:44 -04:00
Christian 43825ca78e Capture server packet handling errors into the FML log file for diagnostics 2012-08-13 11:52:30 -04:00
Christian 44eeadb211 one more change for the road :) 2012-08-13 01:24:02 -04:00
Christian 7011da5fa9 Don't spit debug all over the floor 2012-08-13 00:24:15 -04:00
Christian c61ddfa9d1 updated conf, commands patch (missing newline?) and capturing the actual running
MC version and validating it at relaunch time is the correct MC version.
2012-08-13 00:17:34 -04:00
Christian e64b6dcb13 Add in callableminecraftversion 2012-08-12 23:54:41 -04:00
Christian 183dc236e4 Entity AI accessibility, also AccessTransformer can make certain classes public now 2012-08-12 23:50:27 -04:00
Christian ef5349dec2 Add in a simple packet dispatcher for sending packets around 2012-08-12 22:45:18 -04:00
Christian b39afc0711 Add in a sided packet registry so that client vs server can vary 2012-08-12 22:23:03 -04:00
Christian a8579b43ac Fix double forge init on server 2012-08-12 20:34:23 -04:00
Christian fa92eca328 Merge pull request #50 from Krapht/master
Fix for getNextAvailableRenderId() returning ids in use by vanilla - thanks krapht!
2012-08-12 06:55:23 -07:00
Krapht 42165df29f Fixed getNextAvailableRenderId() returning ids in use by vanilla 2012-08-12 14:45:03 +02:00
LexManos 9860569536 Fix MCPMerger injecting Side/SideOnly when it already exists. 2012-08-12 04:27:36 -07:00
LexManos 7aa48a167f Added patch verification to commands.py patch, and made it so MCP will check the original jars for the server, to prevent it from saying modified when it started out clean. 2012-08-12 02:49:39 -07:00
LexManos 6e3764da48 Add DEBUG constant to Access/Side Transformers to remove spam when not needed. Also AccessTransformer and MCPMerger should return a error code when it can not process causing MCP to stop decompile. 2012-08-12 01:23:10 -07:00
Christian 4d503d6925 Fix EntityRegistry - mods can specify update frequency, range and velocity data, and also
patch EntityTracker to actually track FML entities
2012-08-12 00:18:04 -04:00
Christian 8e04d40034 Fix NPE with no channels - always register FML 2012-08-12 00:17:07 -04:00
LexManos cb57cd02e0 Added missing quotes around compile command. 2012-08-11 16:03:33 -07:00
Christian 22fe48e477 Fix up the network mod issue properly. Maintain a real cache of mod objects 2012-08-11 16:21:03 -04:00
Christian 204f73cb05 Remove profiler stuff - it's been deeply reorged. I'll look at re-adding it later 2012-08-11 14:12:39 -04:00
Christian 28096abea5 Fix up command patch to actually work 2012-08-11 14:12:23 -04:00
Christian 2d7eb5cb7f Fix commands.py to always include the two side classes so the fml jars are valid. 2012-08-11 14:01:27 -04:00
Christian e6d6932e21 Fix build script- put client in first 2012-08-11 13:05:37 -04:00
Christian 406e5d64c0 Put the marker on the server ML file too 2012-08-11 13:04:59 -04:00
Christian 13756aad9f Fix universal not to dupe entries in the jar, also add in the fml mod as "untransformable" 2012-08-11 12:34:25 -04:00
Christian c1a8b16f30 Fix up launch when obfuscated *sigh* 2012-08-11 12:24:43 -04:00
Christian e3671285c3 Update netclienthandler patch. 2012-08-11 12:10:22 -04:00
Christian b33cff3613 Fix NPE for server relaunch 2012-08-11 12:05:13 -04:00
Christian afc2a4a75c Fix up Package.getPackage(), also fix up loadcontroller construction 2012-08-11 11:44:55 -04:00
Christian 7c4583c87a Add in Package.getPackage() support for sengir 2012-08-11 11:12:16 -04:00
Christian f563815961 Lost of work to try and complete ML support - probably still bits missing, but mostly there 2012-08-11 11:02:09 -04:00
LexManos 0ce38f747c Newlines in diff file 2012-08-11 02:27:19 -07:00
LexManos efce8e916b Add special case to add Side/SideOnly to difflist 2012-08-11 02:25:40 -07:00
Christian 44728c9f93 Fix up some network related stuff and optimize mod lookup a bit 2012-08-11 02:43:04 -04:00
Christian d96a81e4f2 Fix up proxy injector to inject properly 2012-08-11 02:24:29 -04:00
LexManos f11844374e Fix decompile 2012-08-10 20:41:59 -07:00
Christian 8c63203bb4 Fix NPE on missing mods - still need to actually handle missing mods properly on client 2012-08-10 23:27:11 -04:00
Christian 751299d5f1 New downloader UI and new downloader backend - should be more robust now 2012-08-10 23:18:52 -04:00
LexManos 7d479bf854 Added -no_gen_conf to jenkins build 2012-08-10 20:09:47 -07:00
LexManos c812a4ede5 Added some extra error prints, hopeully get something useful when installed in the client. 2012-08-10 18:54:06 -07:00
LexManos a826283111 Updated conf merger script to just merge everything, and normalize the line endings so git doesn't complain. 2012-08-10 18:25:11 -07:00
Christian f61f30c1e6 SidedProxy should work again - anywhere. Make sure it's on a static field though 2012-08-10 17:42:43 -04:00
Christian 8f76e8ba8b More ticking hooks, and some other bits of clean up. Very close to "done" now. 2012-08-10 17:11:01 -04:00
Christian 537d89b9e0 Fix up modloader and clean up junk method 2012-08-10 16:42:21 -04:00
Christian 0927aaa0f1 A lot of missing patches to code re-added. Almost all functionality should now
be restored.

ModLoader compatibility is not yet assured, there are some wrapper classes that
need re-writing first
2012-08-10 16:39:03 -04:00
LexManos d17aad797d Readded common folder to startclient/server. 2012-08-10 12:38:59 -07:00
Christian 53e611a03a Add in a registration method for gui handlers 2012-08-10 11:12:57 -04:00
Christian 7ac1be8a9a Overwrote lex's command patch 2012-08-10 10:57:18 -04:00
Christian dd7d70d619 Fix up MCP merger - it definitely works now - the game runs and runs well.
Fix up a couple of small network related issues.
Fix up the server launching fml properly.
2012-08-10 10:03:33 -04:00
LexManos b9d1d1e2f4 Added common folder support to startclient/startserver 2012-08-09 20:34:16 -07:00
LexManos 2dc00adec8 Added some missing quotes that caused issues if your workspace had a space in it. 2012-08-09 20:01:51 -07:00
LexManos b97e937f28 Add lib folder to installed eclipse 2012-08-09 19:02:28 -07:00
Christian c54c4e73e6 Add in missing patch - also, launch FML properly from the server 2012-08-09 09:21:16 -04:00
Christian 93528597f4 Entity spawn adjustment - tracker 2012-08-09 08:40:32 -04:00
LexManos a85bb7bfdb Fix ModLoader compilation, and MCPmerger invocation for Forge. 2012-08-09 03:04:25 -07:00
LexManos 0f2d00abf3 Include conf folder and merge config in source zip 2012-08-08 23:44:32 -07:00
Christian 0e4c716177 Entity spawning - done 2012-08-09 01:58:14 -04:00
Christian 85b77c3d12 Generate a universal binary package since we can now :) 2012-08-09 01:57:42 -04:00
Christian 03884b1aaa Merge branch 'MergingClientServer' 2012-08-08 22:58:33 -04:00
Christian dbdc76e6ea Reorganized all the current patches 2012-08-08 22:57:37 -04:00
Christian b8aaed368b Fix up annotation parser to parse arrays and enums 2012-08-08 22:10:56 -04:00
LexManos 6ec3379153 Added SideTransformer to strip side only functions/fields out. 2012-08-08 18:53:41 -07:00
LexManos b177aad1ee Stage 1 of merging the client and server for MCP.
Results:
Client: 362
Server: 3 (Only due to issues of FF decompilation inconsistancies)
Common: 910

Stage 2: Write runtime transformer to remove annotated fields/methods with invalid side annotation.
2012-08-08 05:48:06 -07:00
Christian e050c7807d Gui Handler ported from MC forge 2012-08-08 00:31:24 -04:00
Christian f3f7398a8b Revert dumb stuff with commands patch - lots of gfx patching 2012-08-07 23:11:37 -04:00
Christian da4311dc74 Almost finished basic network stuff now 2012-08-07 20:41:37 -04:00
Christian 59471f6cac Update some patches- more network work 2012-08-07 20:10:36 -04:00
Christian d8b92064d7 Bunch of hooks re-added : network is more complete now, lot of basemod cleanup, moving stuff into
the registry area
2012-08-06 22:30:13 -04:00
Christian 8e96e60179 Fix location of forge in common handler - also some tweaks to modloader and other stuff 2012-08-06 17:27:21 -04:00
Christian 54877176a6 Network support - there's still some work to do and full id sync isn't done yet, but it has proper registration
semantics and hooks for 250 handling
2012-08-06 16:12:50 -04:00
Christian a3ad32a3e5 Add in a lot of network handler stuff - also, expose the asm harvested data 2012-08-06 09:52:42 -04:00
Christian 602a4f219c Remove some unneeded fields from the annotations 2012-08-05 02:24:02 -04:00
LexManos f24977dc3d Made empty constructor for ModMetadata public 2012-08-04 22:51:57 -07:00
LexManos 4607f9ebb0 Fix path trimming for copytree 2012-08-04 20:36:27 -07:00
Christian 672f4a03f2 Change property name to fml.modStates not fml.disabledMods- it makes more sense that way 2012-08-04 12:35:46 -04:00
Christian f0736ade3d Add in a bit of logging when events get sent to mod containers 2012-08-04 11:45:40 -04:00
Christian 4da48cea7a Allow coremods to inject a modcontainer and run code
this will mean that FML is deliberately and very obviously incompatible with a modloader installation.

Fix up worldtype so that the server can run.
2012-08-04 11:31:06 -04:00
LexManos 1b02ea0677 Patch commands.py to support side '2' as common, as well as fix a few small errors in the update_patches and fml scripts. 2012-08-04 03:34:34 -07:00
LexManos 0d1bd4c5d0 Merged transformers/ to /common and renamed the asm source download to align better with the asm bin file name. 2012-08-03 23:51:49 -07:00
LexManos 3f08f1a94c Change place commands.py backup is stored. 2012-08-03 23:24:58 -07:00
LexManos 1069366219 FML finish won't updatemcp automatically, easier integration with forge. 2012-08-03 17:36:16 -07:00
LexManos 0002bd2875 Fix packaging and install to not have the src/ folder, making it align better with the dev env. 2012-08-03 17:32:23 -07:00
LexManos 823077dd7d Moved setting up eclipse to setup_mcp 2012-08-03 16:56:00 -07:00
LexManos 34971ff3e0 Fixed ant script to support common folder building and add the new files to the dist archives. 2012-08-03 03:37:45 -07:00
LexManos 965069ba3a setup_fml's decompile will result in proper md5 files now {if there is no compiler issues} 2012-08-03 03:35:38 -07:00
LexManos 43766751a4 Removed FMLRegistry, and IMinecraftRegistry.
Updated server side to use the seperated registry classes like the client does.
Updated searge name references on server
Made StatBase.statName public using AccessTransformer
Server should compile now
2012-08-03 01:50:48 -07:00
LexManos a92da71c6b Fix MockBlock compile 2012-08-03 01:47:09 -07:00
LexManos da47985361 Download argo/guava source references in install, and updated eclipse workspaces to reference them. 2012-08-02 23:36:00 -07:00
LexManos 68ae32c48c Cleaned up commands.patch, removed debug print in fml.py 2012-08-02 21:14:06 -07:00
LexManos 3373e33d4b Remove clientdrop, old reference files. 2012-08-02 20:32:51 -07:00
LexManos 2839e79ab0 Delete some dead files 2012-08-02 19:42:12 -07:00
Christian 5bffbfbe0d Fix commands patch, WorldType patch and some ML compat stuff 2012-08-02 20:09:18 -02:30
Christian 4080338c1b More fixes 2012-08-02 16:50:30 -02:30
Christian e06e9393c1 More build fixes for jenkins 2012-08-02 10:33:29 -02:30
Christian 4bb9fd7226 Try and fix the jenkins build 2012-08-02 10:30:52 -02:30
Christian 7edc7d74d4 Change some event names, hook up the event code for server events for FML 2012-08-02 09:31:03 -02:30
Christian 9a5dac605c Merge branch 'newfmlmod' 2012-08-02 08:52:11 -02:30
LexManos c0a781c0bd Introduced patching of runtime/commands.py to allow for usage of the src/common folder. 2012-08-02 00:51:51 -07:00
Christian 719bea515e Change some stuff around - begin launching the server through the wrapper too.
A lot of patches went in - the client and server both launch and start up mods.
2012-08-02 02:08:30 -02:30
Christian 153eafdcb0 More stuff 2012-08-01 21:19:11 -02:30
Christian 2f588cf6ef Fix classpath for Client, maybe? 2012-08-01 21:19:11 -02:30
Christian 3ad3c474b5 Line endings for this branch 2012-08-01 21:18:55 -02:30
Christian 73ba4b68be A load of transformer accesses- also a few tweaks to the transformer, and linux support in the fml python 2012-08-01 18:59:45 -02:30
LexManos b786d8909a Rewrote patch generation and application to no longer need diff, and attempt to apply common patches on decompiles that don't have one side or the other. 2012-08-01 06:54:57 -07:00
LexManos ab45ec9fa4 Updated eclipse projects to have src-common linked resources 2012-08-01 03:52:03 -07:00
LexManos fcbe56b504 Modified the decompiler stage to:
Compile and run AccessTransformer during the pre-RG stage of decompilation.
Merge resulting sources that are identical to src/common

ToDo:
Finish the common intergration:
-update_patches - Add common folder support
-apply_patches:
--patch each side, also patch all common patches to each side incase they are not merged, only if file exists.
2012-08-01 03:25:45 -07:00
LexManos 693ec7ddf6 Add temp AccessTransformer config for FML 2012-08-01 03:18:31 -07:00
LexManos 61b83ab992 Discard old setup script 2012-08-01 03:18:02 -07:00
LexManos 6ce9b1ab05 Fixed AccessTransformer issue with trying to load files, instead of resources. 2012-08-01 03:17:36 -07:00
Christian a5d58d79fc Commit the start of some pluggable transformers 2012-07-31 09:46:45 -04:00
Christian dac3249dc4 XP for smelting 2012-07-30 23:07:53 -04:00
Christian 99eddbfa13 Beginning the 1.3.1 update 2012-07-30 22:31:07 -04:00
Christian ea1fc8f358 Add in the ability to create versioned dependencies for mod relationships
BaseMod versions are loaded too late so will never work as a versioned
dependency requirement, but can have versioned deps of others
2012-07-30 17:01:27 -04:00
Christian bbb5a0e891 Fix up coremods with relaunch, add in a sample "coremod" 2012-07-30 11:34:30 -04:00
Christian 3f491fa7cb Add in events for the method pre/init/post annotations so we can add in extra data during the event phase 2012-07-30 00:33:21 -04:00
Christian ae007fcebc Fix whitespace issue 2012-07-29 23:54:07 -04:00
Christian 8580a99728 Fix window sticking around - it doesn't anymore 2012-07-29 23:46:52 -04:00
Christian 3257d2595d Add in "transform excluded" classes that we still need to take loading responsibility for 2012-07-29 23:30:37 -04:00
Christian 5434b3ca24 Added in some dialogs when things don't go so well 2012-07-29 22:55:53 -04:00
Christian 1ea6ba273b New logging stuff, also the early plugin api for forge 2012-07-29 22:54:59 -04:00
Christian 039d9252c6 Merge branch 'minecraft1.3' into newfmlmod 2012-07-23 23:02:25 -02:30
Christian ca67d6eb6d Fix up mod classloading delegation 2012-07-23 22:54:36 -02:30
Christian 7179edfba7 Some patches to go along with the other changes 2012-07-23 22:51:16 -02:30
Christian baec9785a2 More stuff as I roll out the changes 2012-07-23 22:50:37 -02:30
Christian ae2039c65d A bunch more fixes for FML mods 2012-07-23 16:33:17 -02:30
Christian 3f803653c4 Merge remote-tracking branch 'mainlap/newkeys' into newfmlmod
Conflicts:
	client/cpw/mods/fml/client/FMLClientHandler.java
2012-07-22 20:30:42 -02:30
Christian 6ff67693b9 New key handling 2012-07-22 20:25:18 -02:30
Christian 5501d644b9 Check in a lot of recent work 2012-07-22 11:56:38 -02:30
Christian 276fccb170 Check in new fml mod work so far. Lots still to do. 2012-07-14 13:58:46 -04:00
LexManos e2fac06f64 Cleaned up the install script for the source distrabution to setup the workspace properly, delete argo, and download all required dependancies. 2012-07-12 18:07:58 -07:00
LexManos 25def1ceaf Added call to clean_source to build script to fix patch fuzz on windows. 2012-07-12 18:06:39 -07:00
LexManos c0f70309dd Fix Client-Clean project to use relative path to argo. 2012-07-12 18:06:01 -07:00
Christian 899c1f519c Another bloody ticking fix. This should fix mods that use ML.setInGameHook(true,false) on the
server side to recieve ticks.
2012-07-08 22:06:11 -04:00
Christian 5c1363150e Fix up mod classloading delegation 2012-07-06 15:59:16 -04:00
Christian 4153584392 Fixes 2012-07-06 10:42:49 -04:00
Christian 2858731063 Incorporate server patches into client 2012-07-06 10:29:17 -04:00
Christian 874a0c32e0 Remove two places that are unpatchable now 2012-07-06 09:52:21 -04:00
Christian 4f845befaa Server repatching 2012-07-06 09:44:00 -04:00
Christian 95194f1c5b Add a "checkpatches" target and check if your patches are up to date before running a repatch operation 2012-07-06 09:19:58 -04:00
Christian df6bbaa7c5 Launch through the applet launcher too 2012-07-06 01:04:33 -04:00
Christian b1ca21a161 Some patches for the server 2012-07-05 22:31:46 -04:00
Christian bc42a54a51 Lots of client patch fixup 2012-07-05 18:13:47 -04:00
Christian 1555bd8c53 Update git ignore to ignore a fernflowerzip that's lying around 2012-07-05 15:38:37 -04:00
Christian 649e3e7bc5 And we have a brand, "fml". We're definitely modded :) 2012-07-05 15:36:31 -04:00
Christian ead4e5255e UnexpectedThrowable is now the much more awesome CrashReport! 2012-07-05 15:35:38 -04:00
Christian 5eafb71083 Merge branch 'master' into minecraft1.3
Bring some of the ticking fixes in

Conflicts:
	client/cpw/mods/fml/client/FMLClientHandler.java
	patches/minecraft_server/net/minecraft/server/MinecraftServer.java.patch
2012-07-05 15:30:21 -04:00
Christian 8ed36f583d Got the relauncher downloading and injecting library files 2012-07-05 15:23:37 -04:00
Christian 3e311fd4c1 Tweak ticking YET AGAIN. Should fire a solitary GUILOAD tick right as the game screen loads.
Hopefully fixes worldload tick issue too
2012-07-04 00:16:30 -04:00
Christian a4ce90a918 FFS let this fix that bloody ticking mess that is ML compatibility. 2012-07-03 23:03:51 -04:00
Christian ba46389a87 Separate gui ticking completely. send it as if it's a world tick. ML gui ticks are epically dumb.
Fix Worldload being filtered from the trigger arming.
Also, improve errors going to an error screen. There should be more information now.
2012-07-03 22:39:35 -04:00
Christian f7e07ca7d8 Change gui ticking and world load tick. Should close issue #40 and kill it deader
than a very very dead thing. *$^*(#% Modloader ticking b#%$hit
2012-07-03 21:37:54 -04:00
Christian 3e80a9ee7d Merge branch 'master' into minecraft1.3 2012-07-03 08:15:58 -04:00
Christian dfc6f7b1c1 Tweak build xml for more cleanliness 2012-07-03 08:14:35 -04:00
Christian 753f5f7bc8 Merge branch 'antscriptupdates' 2012-07-02 23:50:49 -04:00
Christian 982271e8ec Update some stuff 2012-07-02 23:49:40 -04:00
Christian 802ec3d86a Merge branch 'antscriptupdates' into minecraft1.3 2012-07-02 23:49:06 -04:00
Christian f1b0e33694 Add in more options for ant script and clean up needing to clean every time. 2012-07-02 23:43:29 -04:00
Christian 1d64fb01bd Merge branch 'testrecover' 2012-07-02 20:19:23 -04:00
Christian 086f575a41 Merge branch 'antscriptupdates' into minecraft1.3 2012-07-02 15:56:33 -04:00
Christian 3cda115cd5 Merge branch 'antscriptupdates' 2012-07-02 15:55:24 -04:00
Christian d491502750 Some more fixes to the ant stuff: apply patches now happens at the right time, I grab fernflower as part of
setup and added an updatepatches call too
2012-07-02 15:54:25 -04:00
Christian 1d4c33d161 Merge branch 'antscriptupdates' into minecraft1.3
Conflicts:
	build.xml
2012-07-02 15:21:15 -04:00
Christian 47a879a961 Merge branch 'antscriptupdates' 2012-07-02 15:17:32 -04:00
Christian b59184424b Add in a setupenvironment ant target specifically for setting up an FML environment from scratch 2012-07-02 15:16:40 -04:00
Christian a7803d1785 Harvest MC version from MCP 2012-07-02 13:31:45 -04:00
Christian 5415bf87ce fix sided proxy bukkit test (not used so not a biggie) 2012-07-02 12:32:41 -04:00
Christian a33f2dde77 Harvest MC version from MCP 2012-07-02 12:24:37 -04:00
Christian bb7ef791de Initial checkin. Some patches are probably missing, but client compiles. 2012-06-29 20:18:04 -04:00
Christian d00e229198 ModSorting test case 2012-06-21 21:56:16 -04:00
560 changed files with 82569 additions and 17339 deletions

No files matched your search

-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="common"/>
<classpathentry kind="src" path="server"/>
<classpathentry kind="src" path="minecraft_server"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+14
View File
@@ -0,0 +1,14 @@
* text eol=lf
*.bat text eol=crlf
*.patch text eol=lf
*.java text eol=lf
*.gradle text eol=crlf
*.png binary
*.exe binary
*.dll binary
*.jar binary
*.lzma binary
*.zip binary
*.pyd binary
*.cfg text eol=lf
*.py text eol=lf
+21 -10
View File
@@ -1,10 +1,21 @@
/bin
/minecraft_server
/mods
/fmlbuild.properties
/fmlversion.properties
/difflist.txt
/.metadata/
/eclipse/.metadata/
/target
fmlbranding.properties
#eclipse
/bin
/.settings
/.classpath
#idea
/.idea
*.iml
#gradle
/build
/buildSrc
/.gradle
#occupational hazards
/eclipse/
/repo/
#Patch reject
*.rej
-24
View File
@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fml</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<linkedResources>
<link>
<name>minecraft_server</name>
<type>2</type>
<location>/home/cpw/projects/mcworkspace/vanilla125/src-work/minecraft_server</location>
</link>
</linkedResources>
</projectDescription>
-11
View File
@@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
-3
View File
@@ -1,3 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.ui.javadoc=true
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\n * The FML Forge Mod Loader suite.\n * Copyright (C) 2012 cpw\n * \n * This library 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\n * Software Foundation; either version 2.1 of the License, or any later version.\n * \n * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\n * \n * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51\n * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method sLine truncated
@@ -1,2 +0,0 @@
eclipse.preferences.version=1
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
-4
View File
@@ -1,4 +0,0 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
+28
View File
@@ -0,0 +1,28 @@
This is Forge Mod Loader.
You can find the source code at all times at https://github.com/MinecraftForge/FML
This minecraft mod is a clean open source implementation of a mod loader for minecraft servers
and minecraft clients.
The code is authored by cpw.
It began by partially implementing an API defined by the client side ModLoader, authored by Risugami.
http://www.minecraftforum.net/topic/75440-
This support has been dropped as of Minecraft release 1.7, as Risugami no longer maintains ModLoader.
It also contains suggestions and hints and generous helpings of code from LexManos, author of MinecraftForge.
http://www.minecraftforge.net/
Additionally, it contains an implementation of topological sort based on that
published at http://keithschwarz.com/interesting/code/?dir=topological-sort
It also contains code from the Maven project for performing versioned dependency
resolution. http://maven.apache.org/
It also contains a partial repackaging of the javaxdelta library from http://sourceforge.net/projects/javaxdelta/
with credit to it's authors.
Forge Mod Loader downloads components from the Minecraft Coder Pack
(http://mcp.ocean-labs.de/index.php/Main_Page) with kind permission from the MCP team.
+33 -3
View File
@@ -1,7 +1,37 @@
This minecraft mod, Forge Mod Loader, including all parts herein, is licensed
under the GNU LGPL v2.1 or later.
This minecraft mod, Forge Mod Loader, including all parts herein except as noted below,
is licensed under the GNU LGPL v2.1 or later.
Homepage: https://github.com/cpw/FML
Homepage: https://github.com/MinecraftForge/FML
This software includes portions from the Apache Maven project at
http://maven.apache.org/ specifically the ComparableVersion.java code. It is
included based on guidelines at
http://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html
with notices intact. The only change is a non-functional change of package name.
This software contains a partial repackaging of javaxdelta, a BSD licensed program for generating
binary differences and applying them, sourced from the subversion at http://sourceforge.net/projects/javaxdelta/
authored by genman, heikok, pivot.
The only changes are to replace some Trove collection types with standard Java collections, and repackaged.
=== MCP Data ===
This software includes data from the Minecraft Coder Pack (MCP), with kind permission
from them. The license to MCP data is not transitive - distribution of this data by
third parties requires independent licensing from the MCP team. This data is not
redistributable without permission from the MCP team.
=== Sharing ===
I grant permission for some parts of FML to be redistributed outside the terms of the LGPL, for the benefit of
the minecraft modding community. All contributions to these parts should be licensed under the same additional grant.
-- Runtime patcher --
License is granted to redistribute the runtime patcher code (common/cpw/mods/fml/patcher and subdirectories) under
any alternative open source license as classified by the OSI (http://opensource.org/licenses)
-- ASM transformers --
License is granted to redistribute the ASM transformer code (common/cpw/mods/fml/common/asm/ and subdirectories)
under any alternative open source license as classified by the OSI (http://opensource.org/licenses)
========
+94
View File
@@ -0,0 +1,94 @@
This is Forge Mod Loader, or FML for short, by cpw.
More information can be found at https://github.com/MinecraftForge/FML/wiki
It is a clean reimplementation of a mod loading system for client and server.
It can be installed on its own, or as part of Minecraft Forge.
----------------------
About Forge Mod Loader
----------------------
Environments and compatibility
==============================
FML covers two main environments: client and server. All environments share
the main mod loading code base, with additional varying hooks based on the
specific environment.
There are some very visible changes to the client when FML is installed.
There are some bukkit compatibility hooks available, consult MCPC+ for more
information.
Minecraft Forge in all cases bundles FML as it's modloading technology of choice
because FML is open source, freely distributable, and can be easily updated by
contributors through github.
Notable integrations
====================
Optifine has FML compatibility. It varies from Optifine release to release, however
in general it will work well alongside an FML or
Minecraft Forge installation. FML will detect and ensure the good operation of
Optifine (you can see it in your client as an additional data line on the
bottom left).
Mod information
===============
FML exposes the mod information through a mod list visible on the main screen as
well as some small branding enhancements. For full data mods need to provide an
information file. This file is a standard format so hopefully tools providing
launch capabilities can also leverage this content.
-------------------------------
Binary installation information
-------------------------------
If you have downloaded a binary zip file you can install it as follows (client
or server):
Installation
============
To install on a server, simply execute the FML or Forge jar file, with a copy of
minecraft_server-@[email protected] placed in the same directory. FML will launch
it's patched copy.
To install on a client, run the installer by executing java -jar <installer>.jar.
It will identify the location of you minecraft installation (this can be customized)
and create a new profile "FML" there.
Forge Installation
==================
This code also ships as a part of Minecraft Forge. You do not need to install it
separately from your Minecraft Forge installation. Minecraft Forge contains the
exact same code as this. You should not install FML if you are also installing
Minecraft Forge.
-------------------------------------------
Source installation information for modders
-------------------------------------------
This code follows the Minecraft Forge installation methodology. It will apply
some small patches to the vanilla MCP source code, giving you and it access
to some of the data and functions you need to build a successful mod.
Note also that the patches are built against "unrenamed" MCP source code (aka
srgnames) - this means that you will not be able to read them directly against
normal code.
Source pack installation information:
Standalone source installation
==============================
To install this source code for development purposes, extract this zip file.
It ships with a demonstration mod. Run "gradle setupDevWorkspace" to create
a gradle environment primed with FML. Run gradle eclipse or gradle idea to
create an IDE workspace of your choice.
Refer to ForgeGradle for more information about the gradle environment
Forge source installation
=========================
MinecraftForge ships with this code and installs it as part of the forge
installation process, no further action is required on your part.
For reference this is version @MAJOR@.@MINOR@.@REV@.@BUILD@ of FML
for Minecraft version @MCVERSION@.
-66
View File
@@ -1,66 +0,0 @@
import sys
import os, os.path, shutil
import commands
import fnmatch
import re
import subprocess, shlex
def cmdsplit(args):
if os.sep == '\\':
args = args.replace('\\', '\\\\')
return shlex.split(args)
def main():
print("Applying patches")
sys.stdout.flush()
patches = os.path.abspath(sys.argv[1])
work = os.path.normpath(sys.argv[2])
mcp = os.path.normpath(sys.argv[3])
temp = os.path.abspath('temp.patch')
cmd = cmdsplit('patch -p2 -i "%s" ' % temp)
display = True
if os.name == 'nt':
mcp = os.path.abspath(os.path.join(mcp, 'runtime', 'bin', 'applydiff.exe'))
cmd = cmdsplit('"%s" -uf -p2 -i "%s"' % (mcp, temp))
display = False
for path, _, filelist in os.walk(patches, followlinks=True):
for cur_file in fnmatch.filter(filelist, '*.patch'):
patch_file = os.path.normpath(os.path.join(patches, path[len(patches)+1:], cur_file))
if display:
print 'patching file %s' % os.path.join(path[len(patches)+1:], cur_file)
normaliselines(patch_file, temp)
process = subprocess.Popen(cmd, cwd=work, bufsize=-1)
process.communicate()
if os.path.isfile(temp):
os.remove(temp)
#Taken from MCP
def normaliselines(in_filename, out_filename=None):
in_filename = os.path.normpath(in_filename)
if out_filename is None:
tmp_filename = in_filename + '.tmp'
else:
out_filename = os.path.normpath(out_filename)
tmp_filename = out_filename
dir_name = os.path.dirname(out_filename)
if dir_name:
if not os.path.exists(dir_name):
os.makedirs(dir_name)
regex_ending = re.compile(r'\r?\n')
with open(in_filename, 'rb') as in_file:
with open(tmp_filename, 'wb') as out_file:
buf = in_file.read()
if os.linesep == '\r\n':
buf = regex_ending.sub(r'\r\n', buf)
else:
buf = buf.replace('\r\n', '\n')
out_file.write(buf)
if out_filename is None:
shutil.move(tmp_filename, in_filename)
if __name__ == '__main__':
main()
+111
View File
@@ -0,0 +1,111 @@
buildscript {
repositories {
mavenCentral()
mavenLocal()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
import static net.minecraftforge.gradle.dev.FmlDevPlugin.*
apply plugin: 'maven'
apply plugin: 'fmldev'
repositories {
flatDir {
name "fileRepo"
dirs "repo"
}
}
minecraft {
version = '1.7.10'
mcpVersion = '9.05'
fmlDir = projectDir.getAbsolutePath();
mainClass = 'cpw.mods.fml.relauncher.ServerLaunchWrapper'
tweakClass = 'cpw.mods.fml.common.launcher.FMLTweaker'
installerVersion = "1.4"
}
group = 'cpw.mods'
version = getVersionFromGit(getProject())
jenkins {
job = 'fml'
}
uploadArchives {
repositories {
if (project.hasProperty("filesmaven")) {
logger.info('Publishing to files server')
mavenDeployer {
configuration = configurations.deployJars
repository(url: project.filesmaven.url) {
authentication(userName: project.filesmaven.username, privateKey: project.filesmaven.key)
}
pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description 'ForgeModLoader'
url 'https://github.com/MinecraftForge/FML'
scm {
url 'https://github.com/MinecraftForge/FML'
connection 'scm:git:git://github.com/MinecraftForge/FML.git'
developerConnection 'scm:git:[email protected]:MinecraftForge/FML.git'
}
issueManagement {
system 'github'
url 'https://github.com/MinecraftForge/FML/issues'
}
licenses {
license {
name 'GNU Lesser Public License (LGPL), Version 2.1'
url 'http://www.gnu.org/licenses/lgpl-2.1.txt'
distribution 'repo'
}
}
developers {
developer {
id 'cpw'
name 'cpw'
roles { role 'developer' }
}
developer {
id 'LexManos'
name 'Lex Manos'
roles { role 'developer' }
}
}
}
}
}
} else {
logger.info('Publishing to repo folder')
mavenDeployer {
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
}
}
}
}
-216
View File
@@ -1,216 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================
30 Mar 2012 13:35:40
FML
The Forge Mod Loader
cpw
====================================================================== -->
<project name="FML" default="build">
<description>The Forge Mod Loader</description>
<macrodef name="side">
<attribute name="prop" />
<attribute name="src" />
<attribute name="side" />
<sequential>
<property name="@{prop}" value="${@{side}.@{src}}" />
<condition property="is.client">
<equals arg1="@{side}" arg2="client" />
</condition>
<condition property="is.server">
<equals arg1="@{side}" arg2="server" />
</condition>
</sequential>
</macrodef>
<target name="writeversion" depends="buildenvsetup">
<exec executable="${python.exe}" dir="${basedir}" failonerror="true">
<arg value="${basedir}/getversion.py" />
</exec>
<propertyfile file="fmlversion.properties">
<entry key="fmlbuild.build.number" type="int" value="${version.build}"/>
</propertyfile>
</target>
<target name="buildenvsetup">
<tstamp>
<format pattern="yyMMddHHmmss" property="timestamp" />
</tstamp>
<property environment="env" />
<property file="fmlbuild.properties" />
<property name="modname" value="fml" />
<condition property="dev.home" value="${env.WORKSPACE}" else="${default.dev.home}">
<isset property="env.WORKSPACE" />
</condition>
<condition property="mcp.home" value="${env.WORKSPACE}/mcpworkspace" else="${default.mcp.home}">
<isset property="env.WORKSPACE" />
</condition>
<condition property="python.exe" value="${mcp.home}/runtime/bin/python/python_mcp" else="python">
<os family="Windows" />
</condition>
<property name="mcp.obfoutput" location="${mcp.home}/reobf" />
<property name="client.mcp.obfoutput" location="${mcp.obfoutput}/minecraft" />
<property name="server.mcp.obfoutput" location="${mcp.obfoutput}/minecraft_server" />
<property name="mcp.srcdir" location="${mcp.home}/src" />
<property name="client.mcp.srcdir" location="${mcp.srcdir}/minecraft" />
<property name="server.mcp.srcdir" location="${mcp.srcdir}/minecraft_server" />
<property name="common.src.dir" location="${basedir}/common" />
<property name="client.src.dir" location="${basedir}/client" />
<property name="server.src.dir" location="${basedir}/server" />
<property name="patch.src.dir" location="${basedir}/patches" />
<condition property="version.build" value="${env.BUILD_NUMBER}" else="1">
<isset property="env.BUILD_NUMBER" />
</condition>
</target>
<target name="init" depends="buildenvsetup">
<antcall target="writeversion" />
<property file="fmlversion.properties" />
<property name="build.number" value="${fmlbuild.major.number}.${fmlbuild.minor.number}.${fmlbuild.revision.number}" />
<property name="version.minecraft" value="${fmlbuild.mcversion}" />
<property name="version.major" value="${fmlbuild.major.number}" />
<property name="version.minor" value="${fmlbuild.minor.number}" />
<property name="version.rev" value="${fmlbuild.revision.number}" />
<property name="version" value="${version.major}.${version.minor}.${version.rev}.${version.build}" />
</target>
<target name="clean">
<exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${mcp.home}/runtime/cleanup.py" />
<arg value="-f" />
</exec>
<exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${mcp.home}/runtime/decompile.py" />
<arg value="-d" />
<arg value="-n" />
</exec>
</target>
<target name="buildandreobfmcp" depends="init">
<exec executable="${python.exe}" dir="${mcp.home}" failonerror="true">
<arg value="${mcp.home}/runtime/recompile.py" />
</exec>
<fail message="Compilation failed">
<condition>
<not>
<and>
<available file="${mcp.home}/bin/minecraft/net/minecraft/client/Minecraft.class"/>
<available file="${mcp.home}/bin/minecraft_server/net/minecraft/server/MinecraftServer.class"/>
</and>
</not>
</condition>
</fail>
<exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${mcp.home}/runtime/reobfuscate.py" />
</exec>
<exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${basedir}/generatechangedfilelist.py"/>
<arg value="${mcp.home}"/>
<arg value="${basedir}/difflist.txt"/>
</exec>
</target>
<target name="merge-client" depends="init,clean">
<antcall target="merge-source">
<param name="side" value="client" />
</antcall>
</target>
<target name="merge-server" depends="init,clean">
<antcall target="merge-source">
<param name="side" value="server" />
</antcall>
</target>
<target name="merge-source">
<side prop="merge-to" src="mcp.srcdir" side="${side}" />
<side prop="side-from" src="src.dir" side="${side}" />
<copy todir="${merge-to}" overwrite="true" verbose="true">
<fileset dir="${side-from}" includes="**/*.java" />
<fileset dir="${common.src.dir}" includes="**/*.java" />
</copy>
</target>
<target name="build-client" depends="init,merge-client,buildandreobfmcp">
<antcall target="extract-built-jar">
<param name="side" value="client" />
</antcall>
</target>
<target name="build-server" depends="init,clean,merge-server,buildandreobfmcp">
<antcall target="extract-built-jar">
<param name="side" value="server" />
</antcall>
</target>
<target name="extract-built-jar">
<side prop="output" src="mcp.obfoutput" side="${side}" />
<property name="jarname" value="${modname}-${side}-${version}" />
<mkdir dir="${basedir}/target" />
<zip destfile="${basedir}/target/${jarname}.zip">
<fileset dir="${output}" includes="**/*.class" />
<zipfileset dir="${basedir}" includes="fmlversion.properties"/>
<zipfileset dir="${basedir}" includes="LICENSE-fml.txt" />
<zipfileset dir="${basedir}" includes="install/CREDITS-fml.txt" fullpath="CREDITS-fml.txt"/>
<mappedresources>
<concat>
<fileset dir="${basedir}/install" includes="README.txt" />
<filterchain>
<replacetokens>
<token key="MAJOR" value="${version.major}" />
<token key="MINOR" value="${version.minor}" />
<token key="REV" value="${version.rev}" />
<token key="BUILD" value="${version.build}" />
<token key="MCVERSION" value="${version.minecraft}" />
</replacetokens>
</filterchain>
</concat>
<mergemapper to="README-fml.txt" />
</mappedresources>
</zip>
</target>
<target name="build-source-pack">
<property name="jarname" value="${modname}-src-${version}" />
<zip destfile="${basedir}/target/${jarname}.zip">
<zipfileset dir="${basedir}" includes="LICENSE-fml.txt,difflist.txt" prefix="fml" />
<zipfileset dir="${common.src.dir}" includes="**/*.java" prefix="fml/src/minecraft_server" />
<zipfileset dir="${common.src.dir}" includes="**/*.java" prefix="fml/src/minecraft" />
<zipfileset dir="${client.src.dir}" includes="**/*.java" prefix="fml/src/minecraft" />
<zipfileset dir="${server.src.dir}" includes="**/*.java" prefix="fml/src/minecraft_server" />
<zipfileset dir="${basedir}" includes="fmlversion.properties" prefix="fml/src/minecraft" />
<zipfileset dir="${basedir}" includes="fmlversion.properties" prefix="fml/src/minecraft_server" />
<zipfileset dir="${patch.src.dir}" includes="**/*.patch" prefix="fml/patches" />
<mappedresources>
<concat>
<fileset dir="${basedir}/install" includes="README.txt" />
<filterchain>
<replacetokens>
<token key="MAJOR" value="${version.major}" />
<token key="MINOR" value="${version.minor}" />
<token key="REV" value="${version.rev}" />
<token key="BUILD" value="${version.build}" />
<token key="MCVERSION" value="${version.minecraft}" />
</replacetokens>
</filterchain>
</concat>
<mergemapper to="fml/README-fml.txt" />
</mappedresources>
<zipfileset dir="${basedir}/install" excludes="README.txt" prefix="fml" />
</zip>
</target>
<target name="build" depends="init,clean,merge-server,merge-client,patch,build-server,build-client,build-source-pack" />
<target name="patch" depends="init">
<exec executable="${python.exe}" dir="${basedir}">
<arg value="${basedir}/applypatches.py" />
<arg value="${patch.src.dir}" />
<arg value="${mcp.srcdir}" />
<arg value="${mcp.home}" />
</exec>
</target>
</project>
@@ -1,637 +0,0 @@
/*
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.server;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.Properties;
import java.util.Random;
import java.util.logging.Logger;
import org.bukkit.Material;
import net.minecraft.server.Block;
import net.minecraft.server.Item;
import net.minecraft.server.LocaleLanguage;
import net.minecraft.server.MLProp;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.BaseMod;
import net.minecraft.server.BiomeBase;
import net.minecraft.server.EntityItem;
import net.minecraft.server.EntityHuman;
import net.minecraft.server.IChunkProvider;
import net.minecraft.server.ICommandListener;
import net.minecraft.server.IInventory;
import net.minecraft.server.ItemStack;
import net.minecraft.server.NetworkManager;
import net.minecraft.server.Packet1Login;
import net.minecraft.server.Packet250CustomPayload;
import net.minecraft.server.Packet3Chat;
import net.minecraft.server.BukkitRegistry;
import net.minecraft.server.SidedProxy;
import net.minecraft.server.World;
import net.minecraft.server.WorldType;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.IFMLSidedHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.ProxyInjector;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.TickType;
import cpw.mods.fml.common.modloader.ModLoaderModContainer;
import cpw.mods.fml.common.modloader.ModProperty;
import cpw.mods.fml.common.registry.FMLRegistry;
/**
* Handles primary communication from hooked code into the system
*
* The FML entry point is {@link #onPreLoad(MinecraftServer)} called from {@link MinecraftServer}
*
* Obfuscated code should focus on this class and other members of the "server" (or "client") code
*
* The actual mod loading is handled at arms length by {@link Loader}
*
* It is expected that a similar class will exist for each target environment: Bukkit and Client side.
*
* It should not be directly modified.
*
* @author cpw
*
*/
public class FMLBukkitHandler implements IFMLSidedHandler
{
/**
* The singleton
*/
private static final FMLBukkitHandler INSTANCE = new FMLBukkitHandler();
/**
* A reference to the server itself
*/
private MinecraftServer server;
/**
* A handy list of the default overworld biomes
*/
private BiomeBase[] defaultOverworldBiomes;
FMLBukkitProfiler profiler;
/**
* Called to start the whole game off from {@link MinecraftServer#startServer}
* @param minecraftServer
*/
public void onPreLoad(MinecraftServer minecraftServer)
{
try
{
Class.forName("BaseModMp", false, getClass().getClassLoader());
MinecraftServer.log.severe(""
+ "Forge Mod Loader has detected that this server has an ModLoaderMP installed alongside Forge Mod Loader.\n"
+ "This will cause a serious problem with compatibility. To protect your worlds, this minecraft server will now shutdown.\n"
+ "You should follow the installation instructions of either Minecraft Forge of Forge Mod Loader and NOT install ModLoaderMP \n"
+ "into the minecraft_server.jar file "
+ "before this server will be allowed to start up.\n\nFailure to do so will simply result in more startup failures.\n\n"
+ "The authors of Minecraft Forge and Forge Mod Loader strongly suggest you talk to your mod's authors and get them to\nupdate their "
+ "requirements. ModLoaderMP is not compatible with Minecraft Forge on the server and they will need to update their mod\n"
+ "for Minecraft Forge and other server compatibility, unless they are Minecraft Forge mods, in which case they already\n"
+ "don't need ModLoaderMP and the mod author simply has failed to update his requirements and should be informed appropriately.\n\n"
+ "The authors of Forge Mod Loader would like to be compatible with ModLoaderMP but it is closed source and owned by SDK.\n"
+ "SDK, the author of ModLoaderMP, has a standing invitation to submit compatibility patches \n"
+ "to the open source community project that is Forge Mod Loader so that this incompatibility doesn't last. \n"
+ "Users who wish to enjoy mods of both types are "
+ "encouraged to request of SDK that he submit a\ncompatibility patch to the Forge Mod Loader project at \n"
+ "http://github.com/cpw/FML.\nPosting on the minecraft forums at\nhttp://www.minecraftforum.net/topic/86765- (the MLMP thread)\n"
+ "may encourage him in this effort. However, I ask that your requests be polite.\n"
+ "Now, the server has to shutdown so you can reinstall your minecraft_server.jar\nproperly, until such time as we can work together.");
throw new RuntimeException(
"This FML based server has detected an installation of ModLoaderMP alongside. This will cause serious compatibility issues, so the server will now shut down.");
}
catch (ClassNotFoundException e)
{
// We're safe. continue
}
server = minecraftServer;
FMLCommonHandler.instance().beginLoading(this);
FMLRegistry.registerRegistry(new BukkitRegistry());
Loader.instance().loadMods();
}
/**
* Called a bit later on during server initialization to finish loading mods
*/
public void onLoadComplete()
{
Loader.instance().initializeMods();
for (Item i : Item.byId) {
if (i!=null && Material.getMaterial(i.id).name().startsWith("X")) {
Material.setMaterialName(i.id, i.l());
}
}
}
public void onWorldLoadTick()
{
FMLCommonHandler.instance().tickStart(EnumSet.of(TickType.WORLDLOAD));
}
/**
* Every tick just before world and other ticks occur
*/
public void onPreWorldTick(World world)
{
FMLCommonHandler.instance().tickStart(EnumSet.of(TickType.WORLD),world);
}
/**
* Every tick just after world and other ticks occur
*/
public void onPostWorldTick(World world)
{
FMLCommonHandler.instance().tickEnd(EnumSet.of(TickType.WORLD), world);
}
/**
* Get the server instance
*
* @return
*/
public MinecraftServer getServer()
{
return server;
}
/**
* Get a handle to the server's logger instance
*/
public Logger getMinecraftLogger()
{
return MinecraftServer.log;
}
/**
* Called from ChunkProviderServer when a chunk needs to be populated
*
* To avoid polluting the worldgen seed, we generate a new random from the world seed and
* generate a seed from that
*
* @param chunkProvider
* @param chunkX
* @param chunkZ
* @param world
* @param generator
*/
public void onChunkPopulate(IChunkProvider chunkProvider, int chunkX, int chunkZ, World world, IChunkProvider generator)
{
FMLCommonHandler.instance().handleWorldGeneration(chunkX, chunkZ, world.getSeed(), world, generator, chunkProvider);
}
/**
* Called from the furnace to lookup fuel values
*
* @param itemId
* @param itemDamage
* @return
*/
public int fuelLookup(int itemId, int itemDamage)
{
int fv = 0;
for (ModContainer mod : Loader.getModList())
{
fv = Math.max(fv, mod.lookupFuelValue(itemId, itemDamage));
}
return fv;
}
/**
* Is the offered class and instance of BaseMod and therefore a ModLoader mod?
*/
public boolean isModLoaderMod(Class<?> clazz)
{
return BaseMod.class.isAssignableFrom(clazz);
}
/**
* Load the supplied mod class into a mod container
*/
public ModContainer loadBaseModMod(Class<?> clazz, File canonicalFile)
{
@SuppressWarnings("unchecked")
Class <? extends BaseMod > bmClazz = (Class <? extends BaseMod >) clazz;
return new ModLoaderModContainer(bmClazz, canonicalFile);
}
/**
* Called to notify that an item was picked up from the world
*
* @param entityItem
* @param entityPlayer
*/
public void notifyItemPickup(EntityItem entityItem, EntityHuman entityPlayer)
{
for (ModContainer mod : Loader.getModList())
{
if (mod.wantsPickupNotification())
{
mod.getPickupNotifier().notifyPickup(entityItem, entityPlayer);
}
}
}
/**
* Raise an exception
*
* @param exception
* @param message
* @param stopGame
*/
public void raiseException(Throwable exception, String message, boolean stopGame)
{
FMLCommonHandler.instance().getFMLLogger().throwing("FMLHandler", "raiseException", exception);
throw new RuntimeException(exception);
}
/**
* Attempt to dispense the item as an entity other than just as a the item itself
*
* @param world
* @param x
* @param y
* @param z
* @param xVelocity
* @param zVelocity
* @param item
* @return
*/
public boolean tryDispensingEntity(World world, double x, double y, double z, byte xVelocity, byte zVelocity, ItemStack item)
{
for (ModContainer mod : Loader.getModList())
{
if (mod.wantsToDispense() && mod.getDispenseHandler().dispense(x, y, z, xVelocity, zVelocity, world, item))
{
return true;
}
}
return false;
}
/**
* @return the instance
*/
public static FMLBukkitHandler instance()
{
return INSTANCE;
}
/**
* Build a list of default overworld biomes
*
* @return
*/
public BiomeBase[] getDefaultOverworldBiomes()
{
if (defaultOverworldBiomes == null)
{
ArrayList<BiomeBase> biomes = new ArrayList<BiomeBase>(20);
for (int i = 0; i < 23; i++)
{
if ("Sky".equals(BiomeBase.biomes[i].y) || "Hell".equals(BiomeBase.biomes[i].y))
{
continue;
}
biomes.add(BiomeBase.biomes[i]);
}
defaultOverworldBiomes = new BiomeBase[biomes.size()];
biomes.toArray(defaultOverworldBiomes);
}
return defaultOverworldBiomes;
}
/**
* Called when an item is crafted
*
* @param player
* @param craftedItem
* @param craftingGrid
*/
public void onItemCrafted(EntityHuman player, ItemStack craftedItem, IInventory craftingGrid)
{
for (ModContainer mod : Loader.getModList())
{
if (mod.wantsCraftingNotification())
{
mod.getCraftingHandler().onCrafting(player, craftedItem, craftingGrid);
}
}
}
/**
* Called when an item is smelted
*
* @param player
* @param smeltedItem
*/
public void onItemSmelted(EntityHuman player, ItemStack smeltedItem)
{
for (ModContainer mod : Loader.getModList())
{
if (mod.wantsCraftingNotification())
{
mod.getCraftingHandler().onSmelting(player, smeltedItem);
}
}
}
/**
* Called when a chat packet is received
*
* @param chat
* @param player
* @return true if you want the packet to stop processing and not echo to the rest of the world
*/
public boolean handleChatPacket(Packet3Chat chat, EntityHuman player)
{
for (ModContainer mod : Loader.getModList())
{
if (mod.wantsNetworkPackets() && mod.getNetworkHandler().onChat(chat, player))
{
return true;
}
}
return false;
}
/**
* Called when a packet 250 packet is received from the player
*
* @param packet
* @param player
*/
public void handlePacket250(Packet250CustomPayload packet, EntityHuman player)
{
if ("REGISTER".equals(packet.tag) || "UNREGISTER".equals(packet.tag))
{
handleClientRegistration(packet, player);
return;
}
ModContainer mod = FMLCommonHandler.instance().getModForChannel(packet.tag);
if (mod != null)
{
mod.getNetworkHandler().onPacket250Packet(packet, player);
}
}
/**
* Handle register requests for packet 250 channels
*
* @param packet
*/
private void handleClientRegistration(Packet250CustomPayload packet, EntityHuman player)
{
if (packet.data==null) {
return;
}
try
{
for (String channel : new String(packet.data, "UTF8").split("\0"))
{
// Skip it if we don't know it
if (FMLCommonHandler.instance().getModForChannel(channel) == null)
{
continue;
}
if ("REGISTER".equals(packet.tag))
{
FMLCommonHandler.instance().activateChannel(player, channel);
}
else
{
FMLCommonHandler.instance().deactivateChannel(player, channel);
}
}
}
catch (UnsupportedEncodingException e)
{
getMinecraftLogger().warning("Received invalid registration packet");
}
}
/**
* Handle a login
*
* @param loginPacket
* @param networkManager
*/
public void handleLogin(Packet1Login loginPacket, NetworkManager networkManager)
{
Packet250CustomPayload packet = new Packet250CustomPayload();
packet.tag = "REGISTER";
packet.data = FMLCommonHandler.instance().getPacketRegistry();
packet.length = packet.data.length;
if (packet.length>0) {
networkManager.queue(packet);
}
}
public void announceLogin(EntityHuman player) {
for (ModContainer mod : Loader.getModList())
{
if (mod.wantsPlayerTracking())
{
mod.getPlayerTracker().onPlayerLogin(player);
}
}
}
@Override
public File getMinecraftRootDirectory()
{
try {
return server.a(".").getCanonicalFile();
} catch (IOException ioe) {
return new File(".");
}
}
/**
* @param var2
* @return
*/
public boolean handleServerCommand(String command, String player, ICommandListener listener)
{
for (ModContainer mod : Loader.getModList()) {
if (mod.wantsConsoleCommands() && mod.getConsoleHandler().handleCommand(command, player, listener)) {
return true;
}
}
return false;
}
/**
* @param player
*/
public void announceLogout(EntityHuman player)
{
for (ModContainer mod : Loader.getModList())
{
if (mod.wantsPlayerTracking())
{
mod.getPlayerTracker().onPlayerLogout(player);
}
}
}
/**
* @param p_28168_1_
*/
public void announceDimensionChange(EntityHuman player)
{
for (ModContainer mod : Loader.getModList())
{
if (mod.wantsPlayerTracking())
{
mod.getPlayerTracker().onPlayerChangedDimension(player);
}
}
}
/**
* @param biome
*/
public void addBiomeToDefaultWorldGenerator(BiomeBase biome)
{
WorldType.NORMAL.addNewBiome(biome);
}
/**
* @param biome
*/
public void removeBiomeFromDefaultWorldGenerator(BiomeBase biome)
{
WorldType.NORMAL.removeBiome(biome);
}
@Override
public Object getMinecraftInstance() {
return server;
}
@Override
public String getCurrentLanguage()
{
return LocaleLanguage.a().getCurrentLanguage();
}
@Override
public Properties getCurrentLanguageTable()
{
return LocaleLanguage.a().getCurrentLanguageTable();
}
@Override
public String getObjectName(Object instance)
{
String objectName;
if (instance instanceof Item) {
objectName=((Item)instance).getName();
} else if (instance instanceof Block) {
objectName=((Block)instance).getName();
} else if (instance instanceof ItemStack) {
objectName=Item.byId[((ItemStack)instance).id].a((ItemStack)instance);
} else {
throw new IllegalArgumentException(String.format("Illegal object for naming %s",instance));
}
objectName+=".name";
return objectName;
}
@Override
public ModMetadata readMetadataFrom(InputStream input, ModContainer mod) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public void profileStart(String profileLabel) {
if (profiler!=null)
{
profiler.start(profileLabel);
}
}
@Override
public void profileEnd() {
if (profiler!=null)
{
profiler.end();
}
}
@Override
public ModProperty getModLoaderPropertyFor(Field f) {
if (f.isAnnotationPresent(MLProp.class)) {
MLProp prop = f.getAnnotation(MLProp.class);
return new ModProperty(prop.info(), prop.min(), prop.max(), prop.name());
}
return null;
}
@Override
public List<String> getAdditionalBrandingInformation() {
return null;
}
@Override
public Side getSide() {
return Side.BUKKIT;
}
@Override
public ProxyInjector findSidedProxyOn(cpw.mods.fml.common.modloader.BaseMod mod) {
for (Field f : mod.getClass().getDeclaredFields())
{
if (f.isAnnotationPresent(SidedProxy.class))
{
SidedProxy sp = f.getAnnotation(SidedProxy.class);
return new ProxyInjector(sp.clientSide(), sp.serverSide(), sp.bukkitSide(), f);
}
}
return null;
}
public void onServerPostTick() {
FMLCommonHandler.instance().tickEnd(EnumSet.of(TickType.GAME));
}
public void onServerPreTick() {
FMLCommonHandler.instance().tickStart(EnumSet.of(TickType.GAME));
}
}
@@ -1,131 +0,0 @@
package cpw.mods.fml.server;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableMultiset;
import com.google.common.collect.Lists;
import com.google.common.collect.Multiset;
import com.google.common.collect.Multiset.Entry;
import com.google.common.collect.Multisets;
import com.google.common.collect.TreeMultiset;
import com.google.common.primitives.Ints;
public class FMLBukkitProfiler {
private static FMLBukkitProfiler lastInstance;
private static long endTime;
private LinkedList<String> profiles = new LinkedList<String>();
private TreeMultiset<String> hitCounter = TreeMultiset.create();
private TreeMultiset<String> timings = TreeMultiset.create();
private long timestamp;
public static long beginProfiling(int seconds)
{
long now = System.currentTimeMillis();
if (lastInstance == null)
{
lastInstance = new FMLBukkitProfiler();
FMLBukkitHandler.instance().profiler = lastInstance;
endTime = now + seconds * 1000;
}
if (endTime > now)
{
return (endTime - now) / 1000;
}
else
{
return 0;
}
}
public static long endProfiling()
{
FMLBukkitHandler.instance().profiler = null;
return endTime - System.currentTimeMillis();
}
public static void resetProfiling()
{
endProfiling();
lastInstance = null;
}
public void start(String profileLabel)
{
profiles.push(profileLabel);
timestamp = System.nanoTime();
}
public void end()
{
int timing = (int)((System.nanoTime() - timestamp)/1000L);
String label = Joiner.on('.').join(profiles);
profiles.pop();
hitCounter.add(label);
timings.add(label,timing);
if (System.currentTimeMillis()>endTime)
{
endProfiling();
}
}
public static String[] dumpProfileData(int count)
{
if (lastInstance == null)
{
return new String[] { "No profile data available" };
}
if (endTime > System.currentTimeMillis())
{
return new String[] { String.format("Timing is being gathered for another %d seconds", endTime - System.currentTimeMillis()) };
}
return lastInstance.profileData(count);
}
private String[] profileData(int count) {
List<Entry<String>> sortedTiming = getEntriesSortedByFrequency(timings, false);
ArrayList<String> timeLine = new ArrayList<String>();
double totalTime = timings.size();
for (Entry<String> hit : sortedTiming)
{
if (--count == 0)
{
break;
}
timeLine.add(String.format("%s : %d microseconds, %d invocations. %.2f %% of overall time",hit.getElement(), hit.getCount(), hitCounter.count(hit.getElement()), 100.0 * hit.getCount()/totalTime));
}
return timeLine.toArray(new String[0]);
}
/*
* Code from http://stackoverflow.com/questions/4345633/simplest-way-to-iterate-through-a-multiset-in-the-order-of-element-frequency
*/
private enum EntryComp implements Comparator<Multiset.Entry<?>>{
DESCENDING{
@Override
public int compare(final Entry<?> a, final Entry<?> b){
return Ints.compare(b.getCount(), a.getCount());
}
},
ASCENDING{
@Override
public int compare(final Entry<?> a, final Entry<?> b){
return Ints.compare(a.getCount(), b.getCount());
}
},
}
private static <E> List<Entry<E>> getEntriesSortedByFrequency(final Multiset<E> ms, final boolean ascending) {
final List<Entry<E>> entryList = Lists.newArrayList(ms.entrySet());
Collections.sort(entryList, ascending ? EntryComp.ASCENDING : EntryComp.DESCENDING);
return entryList;
}
}
-409
View File
@@ -1,409 +0,0 @@
/*
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraft.server;
import java.util.Map;
import java.util.Random;
import org.bukkit.craftbukkit.generator.NetherChunkGenerator;
import org.bukkit.craftbukkit.generator.NormalChunkGenerator;
import cpw.mods.fml.common.TickType;
public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseMod
{
// CALLBACK MECHANISMS
/**
* @param minecraftInstance
* @return
*/
public final boolean doTickInGame(TickType tick, boolean tickEnd, Object minecraftInstance, Object... data)
{
if (tick==TickType.GAME && tickEnd) {
return onTickInGame((MinecraftServer)minecraftInstance);
} else {
return true;
}
}
@Override
public final void onCrafting(Object... craftingParameters)
{
takenFromCrafting((EntityHuman)craftingParameters[0], (ItemStack)craftingParameters[1], (IInventory)craftingParameters[2]);
}
@Override
public final void onSmelting(Object... smeltingParameters)
{
takenFromFurnace((EntityHuman)smeltingParameters[0], (ItemStack)smeltingParameters[1]);
}
@Override
public final boolean dispense(double x, double y, double z, byte xVelocity, byte zVelocity, Object... data)
{
return dispenseEntity((World)data[0], x, y, z, xVelocity, zVelocity, (ItemStack)data[1]);
}
@Override
public final boolean onChat(Object... data)
{
return onChatMessageReceived((EntityHuman)data[1], (Packet3Chat)data[0]);
}
@Override
public final void onServerLogin(Object handler) {
// NOOP
}
public final void onServerLogout() {
// NOOP
}
@Override
public final void onPlayerLogin(Object player)
{
onClientLogin((EntityHuman) player);
}
@Override
public final void onPlayerLogout(Object player)
{
onClientLogout((EntityHuman)player);
}
@Override
public final void onPlayerChangedDimension(Object player)
{
onClientDimensionChanged((EntityHuman)player);
}
@Override
public final void onPacket250Packet(Object... data)
{
onPacket250Received((EntityHuman)data[1], (Packet250CustomPayload)data[0]);
}
@Override
public final void notifyPickup(Object... pickupData)
{
EntityItem item = (EntityItem) pickupData[0];
EntityHuman player = (EntityHuman) pickupData[1];
onItemPickup(player, item.itemStack);
}
@Override
public final void generate(Random random, int chunkX, int chunkZ, Object... additionalData)
{
World w = (World) additionalData[0];
IChunkProvider cp = (IChunkProvider) additionalData[1];
if (cp instanceof ChunkProviderHell || cp instanceof NetherChunkGenerator)
{
generateNether(w, random, chunkX << 4, chunkZ << 4);
}
else if (cp instanceof ChunkProviderGenerate || cp instanceof NormalChunkGenerator)
{
generateSurface(w, random, chunkX << 4, chunkZ << 4);
}
}
/**
* NO-OP on client side
*/
@Override
public final boolean handleCommand(String command, Object... data)
{
return onServerCommand(command, (String)data[0], (ICommandListener)data[1]);
}
@Override
public void onRegisterAnimations() {
// NOOP on servers
}
@Override
public void onRenderHarvest(@SuppressWarnings("rawtypes") Map renderers) {
// NOOP on servers
}
// BASEMOD API
/**
* Override if you wish to provide a fuel item for the furnace and return the fuel value of the item
*
* @param id
* @param metadata
* @return
*/
public int addFuel(int id, int metadata)
{
return 0;
}
public void addRenderer(Map<Class<? extends Entity>, Object> renderers)
{
}
/**
* Override if you wish to perform some action other than just dispensing the item from the dispenser
*
* @param world
* @param x
* @param y
* @param z
* @param xVel
* @param zVel
* @param item
* @return
*/
public boolean dispenseEntity(World world, double x, double y, double z, int xVel, int zVel, ItemStack item)
{
return false;
}
/**
* Override if you wish to generate Nether (Hell biome) blocks
*
* @param world
* @param random
* @param chunkX
* @param chunkZ
*/
public void generateNether(World world, Random random, int chunkX, int chunkZ)
{
}
/**
* Override if you wish to generate Overworld (not hell or the end) blocks
*
* @param world
* @param random
* @param chunkX
* @param chunkZ
*/
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
}
/**
* Return the name of your mod. Defaults to the class name
*
* @return
*/
public String getName()
{
return getClass().getSimpleName();
}
/**
* Get your mod priorities
*
* @return
*/
public String getPriorities()
{
return "";
}
/**
* Return the version of your mod
*
* @return
*/
public abstract String getVersion();
public void keyboardEvent(Object event)
{
}
/**
* Load your mod
*/
public abstract void load();
/**
* Finish loading your mod
*/
public void modsLoaded()
{
}
/**
* Handle item pickup
*
* @param player
* @param item
*/
public void onItemPickup(EntityHuman player, ItemStack item)
{
}
/**
* Ticked every game tick if you have subscribed to tick events through {@link ModLoader#setInGameHook(BaseMod, boolean, boolean)}
*
* @param minecraftServer the server
* @return true to continue receiving ticks
*/
public boolean onTickInGame(MinecraftServer minecraftServer)
{
return false;
}
public boolean onTickInGUI(float tick, Object game, Object gui)
{
return false;
}
/**
* Only implemented on the client side
* {@link #onChatMessageReceived(EntityPlayer, Packet3Chat)}
*
* @param text
*/
public void receiveChatPacket(String text)
{
}
/**
* Only called on the client side
* {@link #onPacket250Received(EntityPlayer, Packet250CustomPayload)}
*
* @param packet
*/
public void receiveCustomPacket(Packet250CustomPayload packet)
{
}
public void registerAnimation(Object game)
{
}
public void renderInvBlock(Object renderer, Block block, int metadata, int modelID)
{
}
public boolean renderWorldBlock(Object renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID)
{
return false;
}
/**
* Called when someone crafts an item from a crafting table
*
* @param player
* @param item
* @param matrix
*/
public void takenFromCrafting(EntityHuman player, ItemStack item, IInventory matrix)
{
}
/**
* Called when someone takes a smelted item from a furnace
*
* @param player
* @param item
*/
public void takenFromFurnace(EntityHuman player, ItemStack item)
{
}
/**
* The identifier string for the mod- used in client<->server negotiation
*/
@Override
public String toString()
{
return getName() + " " + getVersion();
}
/**
* Called when a 250 packet is received on a channel registered to this mod
*
* @param source
* @param payload
*/
public void onPacket250Received(EntityHuman source, Packet250CustomPayload payload)
{
}
/**
* Called when a chat message is received. Return true to stop further processing
*
* @param source
* @param chat
* @return true if you want to consume the message so it is not available for further processing
*/
public boolean onChatMessageReceived(EntityHuman source, Packet3Chat chat)
{
return false;
}
/**
* Called when a server command is received
* @param command
* @return true if you want to consume the message so it is not available for further processing
*/
public boolean onServerCommand(String command, String sender, ICommandListener listener)
{
return false;
}
/**
* Called when a new client logs in.
*
* @param player
*/
public void onClientLogin(EntityHuman player)
{
}
/**
* Called when a client logs out of the server.
*
* @param player
*/
public void onClientLogout(EntityHuman player)
{
}
/**
*
* Called when a client changes dimensions on the server.
*
* @param player
*/
public void onClientDimensionChanged(EntityHuman player)
{
}
// Spare client junk
// -------
// void addRenderer(Map<Class<? extends Entity>, Render> renderers);
// void registerAnimation(Minecraft game);
// void renderInvBlock(RenderBlocks renderer, Block block, int metadata, int modelID);
// boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID);
// boolean onTickInGUI(float tick, Minecraft game, GuiScreen gui);
// void keyboardEvent(KeyBinding event);
@Override
public void keyBindingEvent(Object keybinding) {
// NOOP on server
}
}
@@ -1,164 +0,0 @@
package net.minecraft.server;
import java.util.Iterator;
import java.util.List;
import net.minecraft.src.BiomeGenBase;
import cpw.mods.fml.common.registry.IMinecraftRegistry;
import cpw.mods.fml.server.FMLBukkitHandler;
public class BukkitRegistry implements IMinecraftRegistry
{
@Override
public void addRecipe(net.minecraft.src.ItemStack output, Object... params)
{
CraftingManager.getInstance().registerShapedRecipe((ItemStack) output, params);
}
@Override
public void addShapelessRecipe(net.minecraft.src.ItemStack output, Object... params)
{
CraftingManager.getInstance().registerShapelessRecipe((ItemStack) output, params);
}
@SuppressWarnings("unchecked")
@Override
public void addRecipe(net.minecraft.src.IRecipe recipe)
{
CraftingManager.getInstance().getRecipies().add(recipe);
}
@Override
public void addSmelting(int input, net.minecraft.src.ItemStack output)
{
FurnaceRecipes.getInstance().registerRecipe(input, (ItemStack) output);
}
@Override
public void registerBlock(net.minecraft.src.Block block)
{
registerBlock(block, ItemBlock.class);
}
@Override
public void registerBlock(net.minecraft.src.Block block, Class <? extends net.minecraft.src.ItemBlock > itemclass)
{
try
{
assert block != null : "registerBlock: block cannot be null";
assert itemclass != null : "registerBlock: itemclass cannot be null";
int blockItemId = ((Block)block).id - 256;
itemclass.getConstructor(int.class).newInstance(blockItemId);
}
catch (Exception e)
{
//HMMM
}
}
@SuppressWarnings("unchecked")
@Override
public void registerEntityID(Class <? extends net.minecraft.src.Entity > entityClass, String entityName, int id)
{
EntityTypes.addNewEntityListMapping((Class<? extends Entity>) entityClass, entityName, id);
}
@SuppressWarnings("unchecked")
@Override
public void registerEntityID(Class <? extends net.minecraft.src.Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)
{
EntityTypes.addNewEntityListMapping((Class<? extends Entity>) entityClass, entityName, id, backgroundEggColour, foregroundEggColour);
}
@SuppressWarnings("unchecked")
@Override
public void registerTileEntity(Class <? extends net.minecraft.src.TileEntity > tileEntityClass, String id)
{
TileEntity.addNewTileEntityMapping((Class<? extends TileEntity>) tileEntityClass, id);
}
@Override
public void addBiome(BiomeGenBase biome)
{
FMLBukkitHandler.instance().addBiomeToDefaultWorldGenerator((BiomeBase) biome);
}
@Override
public void addSpawn(Class <? extends net.minecraft.src.EntityLiving > entityClass, int weightedProb, int min, int max, net.minecraft.src.EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
{
BiomeBase[] realBiomes=(BiomeBase[]) biomes;
for (BiomeBase biome : realBiomes)
{
@SuppressWarnings("unchecked")
List<BiomeMeta> spawns = ((BiomeBase)biome).getMobs((EnumCreatureType)typeOfCreature);
for (BiomeMeta entry : spawns)
{
//Adjusting an existing spawn entry
if (entry.a == entityClass)
{
entry.d = weightedProb;
entry.b = min;
entry.c = max;
break;
}
}
spawns.add(new BiomeMeta(entityClass, weightedProb, min, max));
}
}
@Override
@SuppressWarnings("unchecked")
public void addSpawn(String entityName, int weightedProb, int min, int max, net.minecraft.src.EnumCreatureType spawnList, BiomeGenBase... biomes)
{
Class <? extends Entity > entityClazz = EntityTypes.getEntityToClassMapping().get(entityName);
if (EntityLiving.class.isAssignableFrom(entityClazz))
{
addSpawn((Class <? extends net.minecraft.src.EntityLiving >) entityClazz, weightedProb, min, max, spawnList, biomes);
}
}
@Override
public void removeBiome(BiomeGenBase biome)
{
FMLBukkitHandler.instance().removeBiomeFromDefaultWorldGenerator((BiomeBase)biome);
}
@Override
public void removeSpawn(Class <? extends net.minecraft.src.EntityLiving > entityClass, net.minecraft.src.EnumCreatureType typeOfCreature, BiomeGenBase... biomesO)
{
BiomeBase[] biomes=(BiomeBase[]) biomesO;
for (BiomeBase biome : biomes)
{
@SuppressWarnings("unchecked")
List<BiomeMeta> spawns = ((BiomeBase)biome).getMobs((EnumCreatureType) typeOfCreature);
Iterator<BiomeMeta> entries = spawns.iterator();
while (entries.hasNext())
{
BiomeMeta entry = entries.next();
if (entry.a == entityClass)
{
entries.remove();
}
}
}
}
@Override
@SuppressWarnings("unchecked")
public void removeSpawn(String entityName, net.minecraft.src.EnumCreatureType spawnList, BiomeGenBase... biomes)
{
Class <? extends Entity > entityClazz = EntityTypes.getEntityToClassMapping().get(entityName);
if (EntityLiving.class.isAssignableFrom(entityClazz))
{
removeSpawn((Class <? extends net.minecraft.src.EntityLiving >) entityClazz, spawnList, biomes);
}
}
}
-48
View File
@@ -1,48 +0,0 @@
/*
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraft.server;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.RetentionPolicy.*;
import static java.lang.annotation.ElementType.*;
/**
* @author cpw
*
*/
@Retention(value = RUNTIME)
@Target(value = FIELD)
public @interface MLProp
{
/**
* Adds additional help to top of configuration file.
*/
String info() default "";
/**
* Maximum value allowed if field is a number.
*/
double max() default Double.MAX_VALUE;
/**
* Minimum value allowed if field is a number.
*/
double min() default Double.MIN_VALUE;
/**
* Overrides the field name for property key.
*/
String name() default "";
}
-780
View File
@@ -1,780 +0,0 @@
/*
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraft.server;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ReflectionHelper;
import cpw.mods.fml.common.modloader.ModLoaderHelper;
import cpw.mods.fml.common.modloader.ModLoaderModContainer;
import cpw.mods.fml.common.registry.FMLRegistry;
import cpw.mods.fml.server.FMLBukkitHandler;
public class ModLoader
{
/**
* Not used on the server.
*
* @param achievement
* @param name
* @param description
*/
public static void addAchievementDesc(Achievement achievement, String name, String description)
{
String achName=achievement.getName();
addLocalization(achName, name);
addLocalization(achName+".desc", description);
}
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
*
* {@link FMLCommonHandler#fuelLookup(int, int)}
*
* @param id
* @param metadata
* @return
*/
@Deprecated
public static int addAllFuel(int id, int metadata)
{
return 0;
}
public static void addAllRenderers(Map<Class<? extends Entity>, Object> renderers)
{
}
public static void addAnimation(Object anim)
{
}
/**
* This method is unimplemented in server versions to date.
*
* @param armor
* @return
*/
public static int addArmor(String armor)
{
return 0;
}
/**
* This method adds the supplied biome to the set of candidate biomes for the default world generator type.
*
* @param biome
*/
public static void addBiome(BiomeBase biome)
{
FMLRegistry.addBiome(biome);
}
/**
* Add localization for the specified string
*
* @param key
* @param value
*/
public static void addLocalization(String key, String value)
{
addLocalization(key, "en_US", value);
}
/**
* Add localization for the specified string
*
* @param key
* @param lang
* @param value
*/
public static void addLocalization(String key, String lang, String value)
{
FMLCommonHandler.instance().addStringLocalization(key, lang, value);
}
/**
* Name the specified minecraft object with the supplied name
*
* @param instance
* @param name
*/
public static void addName(Object instance, String name)
{
addName(instance,"en_US",name);
}
/**
* Unimplemented on the server as it does not generate names
*
* @param instance
* @param lang
* @param name
*/
public static void addName(Object instance, String lang, String name)
{
FMLCommonHandler.instance().addNameForObject(instance, lang, name);
}
/**
* Unimplemented on the server as it does not render textures
*
* @param fileToOverride
* @param fileToAdd
* @return
*/
public static int addOverride(String fileToOverride, String fileToAdd)
{
return 0;
}
/**
* Unimplemented on the server as it does not render textures
*
* @param path
* @param overlayPath
* @param index
*/
public static void addOverride(String path, String overlayPath, int index)
{
// NOOP
}
/**
* Add a Shaped Recipe
*
* @param output
* @param params
*/
public static void addRecipe(ItemStack output, Object... params)
{
FMLRegistry.addRecipe(output, params);
}
/**
* Add a shapeless recipe
*
* @param output
* @param params
*/
public static void addShapelessRecipe(ItemStack output, Object... params)
{
FMLRegistry.addShapelessRecipe(output, params);
}
/**
* Add a new product to be smelted
*
* @param input
* @param output
*/
public static void addSmelting(int input, ItemStack output)
{
FMLRegistry.addSmelting(input, output);
}
/**
* Add a mob to the spawn list
*
* @param entityClass
* @param weightedProb
* @param min
* @param max
* @param spawnList
*/
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList)
{
FMLRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes());
}
/**
* Add a mob to the spawn list
* @param entityClass
* @param weightedProb
* @param min
* @param max
* @param spawnList
* @param biomes
*/
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeBase... biomes)
{
FMLRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList, biomes);
}
/**
* Add a mob to the spawn list
*
* @param entityName
* @param weightedProb
* @param min
* @param max
* @param spawnList
*/
public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList)
{
FMLRegistry.addSpawn(entityName, weightedProb, min, max, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes());
}
/**
* Add a mob to the spawn list
* @param entityName
* @param weightedProb
* @param min
* @param max
* @param spawnList
* @param biomes
*/
public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeBase... biomes)
{
FMLRegistry.addSpawn(entityName, weightedProb, min, max, spawnList, biomes);
}
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
* {@link FMLBukkitHandler#tryDispensingEntity(World, double, double, double, byte, byte, ItemStack)}
*
* @param world
* @param x
* @param y
* @param z
* @param xVel
* @param zVel
* @param item
* @return
*/
@Deprecated
public static boolean dispenseEntity(World world, double x, double y, double z, int xVel, int zVel, ItemStack item)
{
return false;
}
/**
* Remove a container and drop all the items in it on the ground around
*
* @param world
* @param x
* @param y
* @param z
*/
public static void genericContainerRemoval(World world, int x, int y, int z)
{
TileEntity te = world.getTileEntity(x, y, z);
if (!(te instanceof IInventory))
{
return;
}
IInventory inv = (IInventory)te;
for (int l = 0; l < inv.getSize(); l++)
{
ItemStack itemstack = inv.getItem(l);
if (itemstack == null)
{
continue;
}
float f = world.random.nextFloat() * 0.8F + 0.1F;
float f1 = world.random.nextFloat() * 0.8F + 0.1F;
float f2 = world.random.nextFloat() * 0.8F + 0.1F;
while (itemstack.count > 0)
{
int i1 = world.random.nextInt(21) + 10;
if (i1 > itemstack.count)
{
i1 = itemstack.count ;
}
itemstack.count -= i1;
EntityItem entityitem = new EntityItem(world, (float)te.x + f, (float)te.y + f1, (float)te.z + f2, new ItemStack(itemstack.id, i1, itemstack.getData()));
float f3 = 0.05F;
entityitem.motX = (float)world.random.nextGaussian() * f3;
entityitem.motY = (float)world.random.nextGaussian() * f3 + 0.2F;
entityitem.motZ = (float)world.random.nextGaussian() * f3;
if (itemstack.hasTag())
{
entityitem.itemStack.setTag((NBTTagCompound)itemstack.getTag().clone());
}
world.addEntity(entityitem);
}
}
}
/**
* Get a list of all BaseMod loaded into the system
* {@link ModLoaderModContainer#findAll}
*
* @return
*/
public static List<BaseMod> getLoadedMods()
{
return ModLoaderModContainer.findAll(BaseMod.class);
}
/**
* Get a logger instance {@link FMLCommonHandler#getFMLLogger()}
*
* @return
*/
public static Logger getLogger()
{
return FMLCommonHandler.instance().getFMLLogger();
}
public static Object getMinecraftInstance()
{
return getMinecraftServerInstance();
}
/**
* Get the minecraft server instance
* {@link FMLServerHandler#getServer()}
* @return
*/
public static MinecraftServer getMinecraftServerInstance()
{
return FMLBukkitHandler.instance().getServer();
}
/**
* Get a value from a field using reflection
* {@link ReflectionHelper#getPrivateValue(Class, Object, int)}
*
* @param instanceclass
* @param instance
* @param fieldindex
* @return
*/
public static <T, E> T getPrivateValue(Class <? super E > instanceclass, E instance, int fieldindex)
{
return ReflectionHelper.getPrivateValue(instanceclass, instance, fieldindex);
}
/**
* Get a value from a field using reflection
* {@link ReflectionHelper#getPrivateValue(Class, Object, String)}
*
* @param instanceclass
* @param instance
* @param field
* @return
*/
public static <T, E> T getPrivateValue(Class <? super E > instanceclass, E instance, String field)
{
return ReflectionHelper.getPrivateValue(instanceclass, instance, field);
}
/**
* Stubbed method on the server to return a unique model id
*
*/
public static int getUniqueBlockModelID(BaseMod mod, boolean inventoryRenderer)
{
return -1;
}
/**
* Get a new unique entity id
* {@link Entity#getNextId()}
*
* @return
*/
public static int getUniqueEntityId()
{
return FMLCommonHandler.instance().nextUniqueEntityListId();
}
public static int getUniqueSpriteIndex(String path)
{
return -1;
}
/**
* To properly implement packet 250 protocol you should always check your
* channel is active prior to sending the packet
*
* @param player
* @param channel
* @return
*/
public static boolean isChannelActive(EntityPlayer player, String channel)
{
return FMLCommonHandler.instance().isChannelActive(channel, player);
}
public static boolean isGUIOpen(Class<?> gui)
{
return false;
}
/**
* Is the named mod loaded?
* {@link Loader#isModLoaded(String)}
*
* @param modname
* @return
*/
public static boolean isModLoaded(String modname)
{
return Loader.isModLoaded(modname);
}
/**
* Implemented elsewhere
*/
@Deprecated
public static void loadConfig()
{
}
public static Object loadImage(Object renderEngine, String path) throws Exception
{
return null;
}
/**
* Call in from elsewhere. Unimplemented here.
* @param player
* @param item
*/
@Deprecated
public static void onItemPickup(EntityPlayer player, ItemStack item)
{
}
/**
* Call in from elsewhere. Unimplemented here.
*/
@Deprecated
public static void onTick(float tick, Object game)
{
}
public static void openGUI(EntityPlayer player, Object gui)
{
// NOOP
}
@Deprecated
public static void populateChunk(IChunkProvider generator, int chunkX, int chunkZ, World world)
{
}
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
* {@link FMLBukkitHandler#handlePacket250(Packet250CustomPayload, EntityHuman)}
*
* @param packet
*/
@Deprecated
public static void receivePacket(Packet250CustomPayload packet)
{
}
@Deprecated
public static Object[] registerAllKeys(Object[] keys)
{
return keys;
}
@Deprecated
public static void registerAllTextureOverrides(Object cache)
{
}
/**
* Register a new block
*
* @param block
*/
public static void registerBlock(Block block)
{
FMLRegistry.registerBlock(block);
}
/**
* Register a new block
*
* @param block
* @param itemclass
*/
public static void registerBlock(Block block, Class <? extends ItemBlock > itemclass)
{
FMLRegistry.registerBlock(block, itemclass);
}
/**
* Register a new entity ID
*
* @param entityClass
* @param entityName
* @param id
*/
public static void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id)
{
FMLRegistry.registerEntityID(entityClass, entityName, id);
}
/**
* Register a new entity ID
*
* @param entityClass
* @param entityName
* @param id
* @param background
* @param foreground
*/
public static void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id, int background, int foreground)
{
FMLRegistry.registerEntityID(entityClass, entityName, id, background, foreground);
}
public static void registerKey(BaseMod mod, Object keyHandler, boolean allowRepeat)
{
// NOOP
}
/**
* Register the mod for packets on this channel. This only registers the
* channel with Forge Mod Loader, not with clients connecting- use
* BaseMod.onClientLogin to tell them about your custom channel
* {@link FMLCommonHandler#registerChannel(cpw.mods.fml.common.ModContainer, String)}
*
* @param mod
* @param channel
*/
public static void registerPacketChannel(BaseMod mod, String channel)
{
FMLCommonHandler.instance().registerChannel(ModLoaderModContainer.findContainerFor(mod), channel);
}
/**
* Register a new tile entity class
*
* @param tileEntityClass
* @param id
*/
public static void registerTileEntity(Class <? extends TileEntity > tileEntityClass, String id)
{
FMLRegistry.registerTileEntity(tileEntityClass, id);
}
public static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id, Object renderer)
{
FMLRegistry.instance().registerTileEntity(tileEntityClass, id);
}
/**
* Remove a biome from the list of generated biomes
*
* @param biome
*/
public static void removeBiome(BiomeBase biome)
{
FMLRegistry.removeBiome(biome);
}
/**
* Remove a spawn
*
* @param entityClass
* @param spawnList
*/
public static void removeSpawn(Class <? extends EntityLiving > entityClass, EnumCreatureType spawnList)
{
FMLRegistry.removeSpawn(entityClass, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes());
}
/**
* Remove a spawn
*
* @param entityClass
* @param spawnList
* @param biomes
*/
public static void removeSpawn(Class <? extends EntityLiving > entityClass, EnumCreatureType spawnList, BiomeBase... biomes)
{
FMLRegistry.removeSpawn(entityClass, spawnList, biomes);
}
/**
* Remove a spawn
*
* @param entityName
* @param spawnList
*/
public static void removeSpawn(String entityName, EnumCreatureType spawnList)
{
FMLRegistry.removeSpawn(entityName, spawnList, FMLBukkitHandler.instance().getDefaultOverworldBiomes());
}
/**
* Remove a spawn
*
* @param entityName
* @param spawnList
* @param biomes
*/
public static void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeBase... biomes)
{
FMLRegistry.removeSpawn(entityName, spawnList, biomes);
}
@Deprecated
public static boolean renderBlockIsItemFull3D(int modelID)
{
return false;
}
@Deprecated
public static void renderInvBlock(Object renderer, Block block, int metadata, int modelID)
{
// NOOP
}
@Deprecated
public static boolean renderWorldBlock(Object renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID)
{
return false;
}
/**
* Configuration is handled elsewhere
* {@link ModLoaderModContainer}
*/
@Deprecated
public static void saveConfig()
{
}
/**
* Send a chat message to the server
* {@link FMLServerHandler#handleChatPacket(Packet3Chat, EntityPlayer)}
*
* @param text
*/
@Deprecated
public static void serverChat(String text)
{
//TODO
}
@Deprecated
public static void serverLogin(Object handler, Packet1Login loginPacket)
{
//TODO
}
/**
* Indicate that you want to receive ticks
*
* @param mod receiving the events
* @param enable indicates whether you want to recieve them or not
* @param useClock Not used in server side: all ticks are sent on the server side (no render subticks)
*/
public static void setInGameHook(BaseMod mod, boolean enable, boolean useClock)
{
ModLoaderHelper.updateStandardTicks(mod, enable, useClock);
}
public static void setInGUIHook(BaseMod mod, boolean enable, boolean useClock)
{
ModLoaderHelper.updateGUITicks(mod, enable, useClock);
}
/**
* Set a private field to a value using reflection
* {@link ReflectionHelper#setPrivateValue(Class, Object, int, Object)}
*
* @param instanceclass
* @param instance
* @param fieldindex
* @param value
*/
public static <T, E> void setPrivateValue(Class <? super T > instanceclass, T instance, int fieldindex, E value)
{
ReflectionHelper.setPrivateValue(instanceclass, instance, fieldindex, value);
}
/**
* Set a private field to a value using reflection
* {@link ReflectionHelper#setPrivateValue(Class, Object, String, Object)}
*
* @param instanceclass
* @param instance
* @param field
* @param value
*/
public static <T, E> void setPrivateValue(Class <? super T > instanceclass, T instance, String field, E value)
{
ReflectionHelper.setPrivateValue(instanceclass, instance, field, value);
}
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
* {@link FMLBukkitHandler#onItemCrafted(EntityHuman, ItemStack, IInventory)}
*
* @param player
* @param item
* @param matrix
*/
@Deprecated
public static void takenFromCrafting(EntityHuman player, ItemStack item, IInventory matrix)
{
}
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
* {@link FMLBukkitHandler#onItemSmelted(EntityHuman, ItemStack)}
*
* @param player
* @param item
*/
@Deprecated
public static void takenFromFurnace(EntityHuman player, ItemStack item)
{
}
/**
* Throw the offered exception. Likely will stop the game.
* {@link FMLBukkitHandler#raiseException(Throwable, String, boolean)}
* @param message
* @param e
*/
public static void throwException(String message, Throwable e)
{
FMLBukkitHandler.instance().raiseException(e, message, true);
}
/**
* To properly implement packet 250 protocol you should always check your channel
* is active prior to sending the packet
*
* @param player
* @param channel
* @return
*/
public static boolean isChannelActive(EntityHuman player, String channel)
{
return FMLCommonHandler.instance().isChannelActive(channel, player);
}
}
@@ -1,46 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraft.server;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @author cpw
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface SidedProxy
{
/**
* The name of the client side class to load and populate
* @return
*/
String clientSide() default "";
/**
* The name of the server side class to load and populate
* @return
*/
String serverSide() default "";
/**
* The name of the a special bukkit plugin class to load and populate
*/
String bukkitSide() default "";
}
@@ -1,5 +0,0 @@
package net.minecraft.src;
public interface BiomeGenBase {
}
-5
View File
@@ -1,5 +0,0 @@
package net.minecraft.src;
public interface Block {
}
-5
View File
@@ -1,5 +0,0 @@
package net.minecraft.src;
public interface Entity {
}
@@ -1,5 +0,0 @@
package net.minecraft.src;
public interface EntityLiving {
}
@@ -1,5 +0,0 @@
package net.minecraft.src;
public interface EnumCreatureType {
}
-5
View File
@@ -1,5 +0,0 @@
package net.minecraft.src;
public interface IRecipe {
}
-5
View File
@@ -1,5 +0,0 @@
package net.minecraft.src;
public interface ItemBlock {
}
-5
View File
@@ -1,5 +0,0 @@
package net.minecraft.src;
public interface ItemStack {
}
-5
View File
@@ -1,5 +0,0 @@
package net.minecraft.src;
public interface TileEntity {
}
-43
View File
@@ -1,43 +0,0 @@
import sys
import os, os.path, shutil
import fnmatch
import re
def main():
sys.stdout.flush()
for x in range(1, len(sys.argv)):
cleanup_source(sys.argv[x])
count = 0
def cleanup_source(path):
path = os.path.normpath(path)
regex_cases_before = re.compile(r'((case|default).+\r?\n)\r?\n', re.MULTILINE) #Fixes newline after case before case body
regex_cases_after = re.compile(r'\r?\n(\r?\n[ \t]+(case|default))', re.MULTILINE) #Fixes newline after case body before new case
def updatefile(src_file):
global count
tmp_file = src_file + '.tmp'
count = 0
with open(src_file, 'r') as fh:
buf = fh.read()
def fix_cases(match):
global count
count += 1
return match.group(1)
buf = regex_cases_before.sub(fix_cases, buf)
buf = regex_cases_after.sub(fix_cases, buf)
if count > 0:
with open(tmp_file, 'w') as fh:
fh.write(buf)
shutil.move(tmp_file, src_file)
for path, _, filelist in os.walk(path, followlinks=True):
sub_dir = os.path.relpath(path, path)
for cur_file in fnmatch.filter(filelist, '*.java'):
src_file = os.path.normpath(os.path.join(path, cur_file))
updatefile(src_file)
if __name__ == '__main__':
main()
@@ -1,80 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.client;
import net.minecraft.src.BaseMod;
import net.minecraft.src.Block;
import net.minecraft.src.IBlockAccess;
import net.minecraft.src.RenderBlocks;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.modloader.ModLoaderModContainer;
/**
* @author cpw
*
*/
public class BlockRenderInfo
{
private int renderId;
private boolean render3dInInventory;
private ModContainer modContainer;
/**
* @param modContainer
*
*/
public BlockRenderInfo(int renderId, boolean render3dInInventory, ModContainer modContainer)
{
this.renderId=renderId;
this.render3dInInventory=render3dInInventory;
this.modContainer=modContainer;
}
public int getRenderId()
{
return renderId;
}
public boolean shouldRender3DInInventory()
{
return render3dInInventory;
}
/**
* @param world
* @param x
* @param y
* @param z
* @param block
* @param modelId
* @param renderer
*/
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{
return ((BaseMod)modContainer.getMod()).renderWorldBlock(renderer, world, x, y, z, block, modelId);
}
/**
* @param block
* @param metadata
* @param modelID
* @param renderer
*/
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
((BaseMod)modContainer.getMod()).renderInvBlock(renderer, block, metadata, modelID);
}
}
File diff suppressed because it is too large. Load diff
@@ -1,69 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.client;
import java.awt.Dimension;
import java.util.List;
import java.util.logging.Logger;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraft.src.RenderEngine;
import net.minecraft.src.TextureFX;
import net.minecraft.src.TexturePackBase;
public class FMLTextureFX extends TextureFX implements ITextureFX
{
public int tileSizeBase = 16;
public int tileSizeSquare = 256;
public int tileSizeMask = 15;
public int tileSizeSquareMask = 255;
public boolean errored = false;
protected Logger log = FMLCommonHandler.instance().getFMLLogger();
public FMLTextureFX(int icon)
{
super(icon);
}
@Override public void setErrored(boolean err){ errored = err; }
@Override public boolean getErrored(){ return errored; }
@Override
public void onTexturePackChanged(RenderEngine engine, TexturePackBase texturepack, Dimension dimensions)
{
onTextureDimensionsUpdate(dimensions.width, dimensions.height);
}
@Override
public void onTextureDimensionsUpdate(int width, int height)
{
tileSizeBase = width >> 4;
tileSizeSquare = tileSizeBase * tileSizeBase;
tileSizeMask = tileSizeBase - 1;
tileSizeSquareMask = tileSizeSquare - 1;
setErrored(false);
setup();
}
protected void setup()
{
field_1127_a = new byte[tileSizeSquare << 2];
}
public boolean unregister(RenderEngine engine, List<TextureFX> effects)
{
effects.remove(this);
return true;
}
}
-173
View File
@@ -1,173 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.client;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.common.FMLModContainer;
import cpw.mods.fml.common.FMLModLoaderContainer;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
import net.minecraft.client.Minecraft;
import net.minecraft.src.FontRenderer;
import net.minecraft.src.GuiButton;
import net.minecraft.src.GuiScreen;
import net.minecraft.src.GuiSmallButton;
import net.minecraft.src.StringTranslate;
import net.minecraft.src.Tessellator;
/**
* @author cpw
*
*/
public class GuiModList extends GuiScreen
{
private GuiScreen mainMenu;
private GuiSlotModList modList;
private int selected = -1;
private ModContainer selectedMod;
private int listWidth;
private ArrayList<ModContainer> mods;
/**
* @param guiMainMenu
*/
public GuiModList(GuiScreen mainMenu)
{
this.mainMenu=mainMenu;
this.mods=new ArrayList<ModContainer>();
FMLClientHandler.instance().addSpecialModEntries(mods);
for (ModContainer mod : Loader.getModList()) {
if (mod.getMetadata()!=null && mod.getMetadata().parentMod != null) {
continue;
}
mods.add(mod);
}
}
public void func_6448_a()
{
for (ModContainer mod : mods) {
listWidth=Math.max(listWidth,getFontRenderer().func_871_a(mod.getName()) + 10);
listWidth=Math.max(listWidth,getFontRenderer().func_871_a(mod.getVersion()) + 10);
}
listWidth=Math.min(listWidth, 150);
StringTranslate translations = StringTranslate.func_20162_a();
this.field_949_e.add(new GuiSmallButton(6, this.field_951_c / 2 - 75, this.field_950_d - 38, translations.func_20163_a("gui.done")));
this.modList=new GuiSlotModList(this, mods, listWidth);
this.modList.registerScrollButtons(this.field_949_e, 7, 8);
}
protected void func_572_a(GuiButton button) {
if (button.field_937_g)
{
switch (button.field_938_f)
{
case 6:
this.field_945_b.func_6272_a(this.mainMenu);
return;
}
}
super.func_572_a(button);
}
public int drawLine(String line, int offset, int shifty)
{
this.field_6451_g.func_873_b(line, offset, shifty, 0xd7edea);
return shifty + 10;
}
public void func_571_a(int p_571_1_, int p_571_2_, float p_571_3_)
{
this.modList.drawScreen(p_571_1_, p_571_2_, p_571_3_);
this.func_548_a(this.field_6451_g, "Mod List", this.field_951_c / 2, 16, 0xFFFFFF);
int offset = this.listWidth + 20;
if (selectedMod != null) {
if (selectedMod.getMetadata() != null) {
int shifty = 35;
if (!selectedMod.getMetadata().logoFile.isEmpty())
{
int texture = this.field_945_b.field_6315_n.func_1070_a(selectedMod.getMetadata().logoFile);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_945_b.field_6315_n.func_1076_b(texture);
Dimension dim = FMLClientHandler.instance().getTextureDimensions(texture);
int top = 32;
Tessellator tess = Tessellator.field_1512_a;
tess.func_977_b();
tess.func_983_a(offset, top + dim.height, field_923_k, 0, 1);
tess.func_983_a(offset + dim.width, top + dim.height, field_923_k, 1, 1);
tess.func_983_a(offset + dim.width, top, field_923_k, 1, 0);
tess.func_983_a(offset, top, field_923_k, 0, 0);
tess.func_982_a();
shifty += 65;
}
this.field_6451_g.func_50103_a(selectedMod.getMetadata().name, offset, shifty, 0xFFFFFF);
shifty += 12;
shifty = drawLine(String.format("Version: %s (%s)", selectedMod.getMetadata().version, selectedMod.getVersion()), offset, shifty);
if (!selectedMod.getMetadata().credits.isEmpty()) {
shifty = drawLine(String.format("Credits: %s", selectedMod.getMetadata().credits), offset, shifty);
}
shifty = drawLine(String.format("Authors: %s", selectedMod.getMetadata().getAuthorList()), offset, shifty);
shifty = drawLine(String.format("URL: %s", selectedMod.getMetadata().url), offset, shifty);
shifty = drawLine(selectedMod.getMetadata().childMods.isEmpty() ? "No child mods for this mod" : String.format("Child mods: %s", selectedMod.getMetadata().getChildModList()), offset, shifty);
this.getFontRenderer().func_27278_a(selectedMod.getMetadata().description, offset, shifty + 10, this.field_951_c - offset - 20, 0xDDDDDD);
} else {
offset = ( this.listWidth + this.field_951_c ) / 2;
this.func_548_a(this.field_6451_g, selectedMod.getName(), offset, 35, 0xFFFFFF);
this.func_548_a(this.field_6451_g, String.format("Version: %s",selectedMod.getVersion()), offset, 45, 0xFFFFFF);
this.func_548_a(this.field_6451_g, "No mod information found", offset, 55, 0xDDDDDD);
this.func_548_a(this.field_6451_g, "Ask your mod author to provide a mod .info file", offset, 65, 0xDDDDDD);
}
}
super.func_571_a(p_571_1_, p_571_2_, p_571_3_);
}
Minecraft getMinecraftInstance() {
return field_945_b;
}
FontRenderer getFontRenderer() {
return field_6451_g;
}
/**
* @param var1
*/
public void selectModIndex(int var1)
{
this.selected=var1;
if (var1>=0 && var1<=mods.size()) {
this.selectedMod=mods.get(selected);
} else {
this.selectedMod=null;
}
}
/**
* @param var1
* @return
*/
public boolean modIndexSelected(int var1)
{
return var1==selected;
}
}
@@ -1,83 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.client;
import java.util.ArrayList;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.ModMetadata;
import net.minecraft.client.Minecraft;
import net.minecraft.src.GuiLanguage;
import net.minecraft.src.GuiSlot;
import net.minecraft.src.StringTranslate;
import net.minecraft.src.Tessellator;
/**
* @author cpw
*
*/
public class GuiSlotModList extends GuiScrollingList
{
private GuiModList parent;
private ArrayList<ModContainer> mods;
public GuiSlotModList(GuiModList parent, ArrayList<ModContainer> mods, int listWidth)
{
super(parent.getMinecraftInstance(), listWidth, parent.field_950_d, 32, parent.field_950_d - 65 + 4, 10, 35);
this.parent=parent;
this.mods=mods;
}
@Override
protected int getSize()
{
return mods.size();
}
@Override
protected void elementClicked(int var1, boolean var2)
{
this.parent.selectModIndex(var1);
}
@Override
protected boolean isSelected(int var1)
{
return this.parent.modIndexSelected(var1);
}
@Override
protected void drawBackground()
{
this.parent.func_578_i();
}
@Override
protected int getContentHeight()
{
return (this.getSize()) * 35 + 1;
}
@Override
protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator var5)
{
ModContainer mc=mods.get(listIndex);
this.parent.getFontRenderer().func_873_b(this.parent.getFontRenderer().func_50107_a(mc.getName(), listWidth - 11), this.left + 3 , var3 + 2, 0xFFFFFF);
this.parent.getFontRenderer().func_873_b(this.parent.getFontRenderer().func_50107_a(mc.getVersion(), listWidth - 11), this.left + 3 , var3 + 12, 0xCCCCCC);
this.parent.getFontRenderer().func_873_b(this.parent.getFontRenderer().func_50107_a(mc.getMetadata() !=null ? mc.getMetadata().getChildModCountString() : "Metadata not found", listWidth - 9), this.left + 3 , var3 + 22, 0xCCCCCC);
}
}
@@ -1,30 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.client;
import java.awt.Dimension;
import net.minecraft.src.*;
public interface ITextureFX
{
public void onTexturePackChanged(RenderEngine engine, TexturePackBase texturepack, Dimension dimensions);
public void onTextureDimensionsUpdate(int width, int height);
public void setErrored(boolean errored);
public boolean getErrored();
}
@@ -1,74 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.client;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import net.minecraft.src.KeyBinding;
import cpw.mods.fml.common.IKeyHandler;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.modloader.ModLoaderModContainer;
/**
* @author cpw
*
*/
public class KeyBindingHandler implements IKeyHandler
{
private boolean shouldRepeat;
private KeyBinding keyBinding;
private ModContainer modContainer;
private boolean lastState = false;
/**
* @param keyHandler
* @param allowRepeat
* @param modContainer
*/
public KeyBindingHandler(KeyBinding keyHandler, boolean allowRepeat, ModContainer modContainer)
{
this.keyBinding=keyHandler;
this.shouldRepeat=allowRepeat;
this.modContainer=modContainer;
}
@Override
public Object getKeyBinding()
{
return this.keyBinding;
}
/**
* @return the modContainer
*/
public ModContainer getOwningContainer()
{
return modContainer;
}
@Override
public void onEndTick()
{
int keyCode = keyBinding.field_1370_b;
boolean state = (keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode));
if (state && (!lastState || (lastState && shouldRepeat)))
{
modContainer.keyBindEvent(keyBinding);
}
lastState = state;
}
}
@@ -1,69 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.client;
import java.io.File;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import cpw.mods.fml.common.FMLModContainer;
import cpw.mods.fml.common.IConsoleHandler;
import cpw.mods.fml.common.ICraftingHandler;
import cpw.mods.fml.common.IDispenseHandler;
import cpw.mods.fml.common.IKeyHandler;
import cpw.mods.fml.common.INetworkHandler;
import cpw.mods.fml.common.IPickupNotifier;
import cpw.mods.fml.common.IPlayerTracker;
import cpw.mods.fml.common.IWorldGenerator;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.ModMetadata;
/**
* @author cpw
*
*/
public class OptifineModContainer extends FMLModContainer
{
private String optifineVersion;
private ModMetadata metadata;
/**
* @param optifineConfig
*/
public OptifineModContainer(Class<?> optifineConfig)
{
super("Optifine");
try
{
optifineVersion = (String) optifineConfig.getField("VERSION").get(null);
}
catch (Exception e)
{
throw new RuntimeException(e);
}
}
@Override
public String getName()
{
return "Optifine";
}
@Override
public String getVersion()
{
return optifineVersion;
}
}
@@ -1,44 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.client;
import net.minecraft.src.TextureFX;
class OverrideInfo
{
public String texture;
public String override;
public int index;
public int imageIndex;
public TextureFX textureFX;
public boolean added;
@Override
public boolean equals(Object obj)
{
try {
OverrideInfo inf=(OverrideInfo) obj;
return index==inf.index && imageIndex==inf.imageIndex;
} catch (Exception e) {
return false;
}
}
@Override
public int hashCode()
{
return index+imageIndex;
}
}
@@ -1,143 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.client;
import java.util.BitSet;
import java.util.HashMap;
import net.minecraft.src.ModLoader;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.LoaderException;
/**
* @author cpw
*
*/
public class SpriteHelper
{
private static HashMap<String, BitSet> spriteInfo = new HashMap<String, BitSet>();
private static void initMCSpriteMaps() {
BitSet slots =
SpriteHelper.toBitSet(
"0000000000000000" +
"0000000000000000" +
"0000000000000000" +
"0000000000000000" +
"0000000000000000" +
"0000000000000000" +
"0000000000000000" +
"0000000000000000" +
"0000000000000000" +
"0000000000000000" +
"0000000011111100" +
"0000000011111111" +
"0000000011111000" +
"0000000111111100" +
"0000000111111000" +
"0000000000000000");
spriteInfo.put("/terrain.png", slots);
slots = SpriteHelper.toBitSet(
"0000000000000000" +
"0000000000000000" +
"0000000000000000" +
"0000000000000000" +
"0000000000000000" +
"0000000000000000" +
"0000001000000000" +
"0000001110000000" +
"0000001000000000" +
"1111111010000000" +
"1111111010100000" +
"1111111111111100" +
"1111111111111111" +
"1111111111111111" +
"1111111111111111" +
"0000000000000000");
spriteInfo.put("/gui/items.png", slots);
}
/**
* Register a sprite map for ModTextureStatic, to allow for other mods to override
* your sprite page.
*
*
*/
public static void registerSpriteMapForFile(String file, String spriteMap) {
if (spriteInfo.size() == 0) {
initMCSpriteMaps();
}
if (spriteInfo.containsKey(file)) {
FMLCommonHandler.instance().getFMLLogger().finer(String.format("Duplicate attempt to register a sprite file %s for overriding -- ignoring",file));
return;
}
spriteInfo.put(file, toBitSet(spriteMap));
}
public static int getUniqueSpriteIndex(String path)
{
if (!spriteInfo.containsKey("/terrain.png"))
{
initMCSpriteMaps();
}
BitSet slots = spriteInfo.get(path);
if (slots == null)
{
Exception ex = new Exception(String.format("Invalid getUniqueSpriteIndex call for texture: %s", path));
Loader.log.throwing("ModLoader", "getUniqueSpriteIndex", ex);
FMLCommonHandler.instance().raiseException(ex,"Invalid request to getUniqueSpriteIndex",true);
}
int ret = getFreeSlot(slots);
if (ret == -1)
{
Exception ex = new Exception(String.format("No more sprite indicies left for: %s", path));
Loader.log.throwing("ModLoader", "getUniqueSpriteIndex", ex);
FMLCommonHandler.instance().raiseException(ex,"No more sprite indicies left", true);
}
return ret;
}
public static BitSet toBitSet(String data)
{
BitSet ret = new BitSet(data.length());
for (int x = 0; x < data.length(); x++)
{
ret.set(x, data.charAt(x) == '1');
}
return ret;
}
public static int getFreeSlot(BitSet slots)
{
int next=slots.nextSetBit(0);
slots.clear(next);
return next;
}
/**
* @param textureToOverride
* @return
*/
public static int freeSlotCount(String textureToOverride)
{
return spriteInfo.get(textureToOverride).cardinality();
}
}
-429
View File
@@ -1,429 +0,0 @@
/*
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraft.src;
import java.util.Map;
import java.util.Random;
import net.minecraft.client.Minecraft;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.IConsoleHandler;
import cpw.mods.fml.common.ICraftingHandler;
import cpw.mods.fml.common.IDispenseHandler;
import cpw.mods.fml.common.INetworkHandler;
import cpw.mods.fml.common.IPickupNotifier;
import cpw.mods.fml.common.IPlayerTracker;
import cpw.mods.fml.common.IWorldGenerator;
import cpw.mods.fml.common.TickType;
public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseMod
{
// CALLBACK MECHANISMS
public void keyBindingEvent(Object keybinding)
{
this.keyboardEvent((KeyBinding)keybinding);
}
/**
* @param minecraftInstance
* @return
*/
public final boolean doTickInGame(TickType tick, boolean tickEnd, Object minecraftInstance, Object... data)
{
Minecraft mc = (Minecraft) minecraftInstance;
boolean hasWorld = mc.field_6324_e != null;
// World and render ticks
if (tickEnd && ( tick==TickType.RENDER || tick==TickType.GAME ) && hasWorld) {
return onTickInGame((Float) data[0], mc);
} else if (tickEnd && (tick==TickType.WORLDGUI || tick==TickType.GUI) && data[1]!=null) {
return onTickInGUI((Float) data[0], mc, (GuiScreen)data[1]);
}
return true;
}
/**
* @param renderers
*/
public final void onRenderHarvest(Map renderers)
{
addRenderer((Map<Class<? extends Entity>,Render>)renderers);
}
/**
*
*/
public final void onRegisterAnimations()
{
registerAnimation(FMLClientHandler.instance().getClient());
}
@Override
public final void onCrafting(Object... craftingParameters)
{
takenFromCrafting((EntityPlayer)craftingParameters[0], (ItemStack)craftingParameters[1], (IInventory)craftingParameters[2]);
}
@Override
public final void onSmelting(Object... smeltingParameters)
{
takenFromFurnace((EntityPlayer)smeltingParameters[0], (ItemStack)smeltingParameters[1]);
}
@Override
public final boolean dispense(double x, double y, double z, byte xVelocity, byte zVelocity, Object... data)
{
return dispenseEntity((World)data[0], x, y, z, xVelocity, zVelocity, (ItemStack)data[1]);
}
@Override
public final boolean onChat(Object... data)
{
receiveChatPacket(((Packet3Chat)data[0]).field_517_a);
return true;
}
@Override
public final void onServerLogin(Object handler) {
serverConnect((NetClientHandler) handler);
}
public final void onServerLogout() {
serverDisconnect();
}
@Override
public final void onPlayerLogin(Object player)
{
onClientLogin((EntityPlayer) player);
}
@Override
public final void onPlayerLogout(Object player)
{
onClientLogout((EntityPlayer)player);
}
@Override
public final void onPlayerChangedDimension(Object player)
{
onClientDimensionChanged((EntityPlayer)player);
}
@Override
public final void onPacket250Packet(Object... data)
{
receiveCustomPacket((Packet250CustomPayload)data[0]);
}
@Override
public final void notifyPickup(Object... pickupData)
{
EntityItem item = (EntityItem) pickupData[0];
EntityPlayer player = (EntityPlayer) pickupData[1];
onItemPickup(player, item.field_801_a);
}
@Override
public final void generate(Random random, int chunkX, int chunkZ, Object... additionalData)
{
World w = (World) additionalData[0];
IChunkProvider cp = (IChunkProvider) additionalData[1];
if (cp instanceof ChunkProviderGenerate)
{
generateSurface(w, random, chunkX << 4, chunkZ << 4);
}
else if (cp instanceof ChunkProviderHell)
{
generateNether(w, random, chunkX << 4, chunkZ << 4);
}
}
/**
* NO-OP on client side
*/
@Override
public final boolean handleCommand(String command, Object... data)
{
return false;
}
// BASEMOD API
/**
* Override if you wish to provide a fuel item for the furnace and return the fuel value of the item
*
* @param id
* @param metadata
* @return
*/
public int addFuel(int id, int metadata)
{
return 0;
}
public void addRenderer(Map<Class<? extends Entity>, Render> renderers)
{
}
/**
* Override if you wish to perform some action other than just dispensing the item from the dispenser
*
* @param world
* @param x
* @param y
* @param z
* @param xVel
* @param zVel
* @param item
* @return
*/
public boolean dispenseEntity(World world, double x, double y, double z, int xVel, int zVel, ItemStack item)
{
return false;
}
/**
* Override if you wish to generate Nether (Hell biome) blocks
*
* @param world
* @param random
* @param chunkX
* @param chunkZ
*/
public void generateNether(World world, Random random, int chunkX, int chunkZ)
{
}
/**
* Override if you wish to generate Overworld (not hell or the end) blocks
*
* @param world
* @param random
* @param chunkX
* @param chunkZ
*/
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
}
/**
* Return the name of your mod. Defaults to the class name
*
* @return
*/
public String getName()
{
return getClass().getSimpleName();
}
/**
* Get your mod priorities
*
* @return
*/
public String getPriorities()
{
return "";
}
/**
* Return the version of your mod
*
* @return
*/
public abstract String getVersion();
public void keyboardEvent(KeyBinding event)
{
}
/**
* Load your mod
*/
public abstract void load();
/**
* Finish loading your mod
*/
public void modsLoaded()
{
}
/**
* Handle item pickup
*
* @param player
* @param item
*/
public void onItemPickup(EntityPlayer player, ItemStack item)
{
}
/**
* Ticked every game tick if you have subscribed to tick events through {@link ModLoader#setInGameHook(BaseMod, boolean, boolean)}
*
* @param time the rendering subtick time (0.0-1.0)
* @param minecraftInstance the client
* @return true to continue receiving ticks
*/
public boolean onTickInGame(float time, Minecraft minecraftInstance)
{
return false;
}
public boolean onTickInGUI(float tick, Minecraft game, GuiScreen gui)
{
return false;
}
/**
* Only implemented on the client side
* {@link #onChatMessageReceived(EntityPlayer, Packet3Chat)}
*
* @param text
*/
public void receiveChatPacket(String text)
{
// TODO
}
/**
* Only called on the client side
* {@link #onPacket250Received(EntityPlayer, Packet250CustomPayload)}
*
* @param packet
*/
public void receiveCustomPacket(Packet250CustomPayload packet)
{
// TODO
}
public void registerAnimation(Minecraft game)
{
}
public void renderInvBlock(RenderBlocks renderer, Block block, int metadata, int modelID)
{
}
public boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID)
{
return false;
}
public void serverConnect(NetClientHandler handler) {
}
public void serverDisconnect() {
}
/**
* Called when someone crafts an item from a crafting table
*
* @param player
* @param item
* @param matrix
*/
public void takenFromCrafting(EntityPlayer player, ItemStack item, IInventory matrix)
{
}
/**
* Called when someone takes a smelted item from a furnace
*
* @param player
* @param item
*/
public void takenFromFurnace(EntityPlayer player, ItemStack item)
{
}
/**
* The identifier string for the mod- used in client<->server negotiation
*/
@Override
public String toString()
{
return getName() + " " + getVersion();
}
/**
* Called when a 250 packet is received on a channel registered to this mod
*
* @param source
* @param payload
*/
public void onPacket250Received(EntityPlayer source, Packet250CustomPayload payload)
{
}
/**
* Called when a chat message is received. Return true to stop further processing
*
* @param source
* @param chat
* @return true if you want to consume the message so it is not available for further processing
*/
public boolean onChatMessageReceived(EntityPlayer source, Packet3Chat chat)
{
return false;
}
/**
* Called when a server command is received
* @param command
* @return true if you want to consume the message so it is not available for further processing
*/
public boolean onServerCommand(String command, String sender, Object listener)
{
return false;
}
/**
* Called when a new client logs in.
*
* @param player
*/
public void onClientLogin(EntityPlayer player)
{
}
/**
* Called when a client logs out of the server.
*
* @param player
*/
public void onClientLogout(EntityPlayer player)
{
}
/**
*
* Called when a client changes dimensions on the server.
*
* @param player
*/
public void onClientDimensionChanged(EntityPlayer player)
{
}
}
@@ -1,166 +0,0 @@
package net.minecraft.src;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.registry.FMLRegistry;
import cpw.mods.fml.common.registry.IMinecraftRegistry;
public class ClientRegistry implements IMinecraftRegistry
{
public static ClientRegistry instance() {
return (ClientRegistry) FMLRegistry.instance();
}
@Override
public void addRecipe(ItemStack output, Object... params)
{
CraftingManager.func_1120_a().func_1121_a(output, params);
}
@Override
public void addShapelessRecipe(ItemStack output, Object... params)
{
CraftingManager.func_1120_a().func_21187_b(output, params);
}
@Override
public void addRecipe(IRecipe recipe)
{
CraftingManager.func_1120_a().func_25193_b().add(recipe);
}
@Override
public void addSmelting(int input, ItemStack output)
{
FurnaceRecipes.func_21200_a().func_21199_a(input, output);
}
@Override
public void registerBlock(Block block)
{
registerBlock(block, ItemBlock.class);
}
@Override
public void registerBlock(Block block, Class <? extends ItemBlock > itemclass)
{
try
{
assert block != null : "registerBlock: block cannot be null";
assert itemclass != null : "registerBlock: itemclass cannot be null";
int blockItemId = block.field_376_bc - 256;
itemclass.getConstructor(int.class).newInstance(blockItemId);
}
catch (Exception e)
{
//HMMM
}
}
@Override
public void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id)
{
EntityList.addNewEntityListMapping(entityClass, entityName, id);
}
@Override
public void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)
{
EntityList.addNewEntityListMapping(entityClass, entityName, id, backgroundEggColour, foregroundEggColour);
}
@Override
public void registerTileEntity(Class <? extends TileEntity > tileEntityClass, String id)
{
TileEntity.addNewTileEntityMapping(tileEntityClass, id);
}
public void registerTileEntity(Class <? extends TileEntity > tileEntityClass, String id, TileEntitySpecialRenderer specialRenderer)
{
registerTileEntity(tileEntityClass, id);
TileEntityRenderer.setTileEntityRenderer(tileEntityClass, specialRenderer);
}
@Override
public void addBiome(BiomeGenBase biome)
{
FMLClientHandler.instance().addBiomeToDefaultWorldGenerator(biome);
}
@Override
public void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
{
for (BiomeGenBase biome : biomes)
{
@SuppressWarnings("unchecked")
List<SpawnListEntry> spawns = biome.func_25063_a(typeOfCreature);
for (SpawnListEntry entry : spawns)
{
//Adjusting an existing spawn entry
if (entry.field_25212_a == entityClass)
{
entry.field_35590_d = weightedProb;
entry.field_35591_b = min;
entry.field_35592_c = max;
break;
}
}
spawns.add(new SpawnListEntry(entityClass, weightedProb, min, max));
}
}
@Override
@SuppressWarnings("unchecked")
public void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes)
{
Class <? extends Entity > entityClazz = EntityList.getEntityToClassMapping().get(entityName);
if (EntityLiving.class.isAssignableFrom(entityClazz))
{
addSpawn((Class <? extends EntityLiving >) entityClazz, weightedProb, min, max, spawnList, biomes);
}
}
@Override
public void removeBiome(BiomeGenBase biome)
{
FMLClientHandler.instance().removeBiomeFromDefaultWorldGenerator(biome);
}
@Override
public void removeSpawn(Class <? extends EntityLiving > entityClass, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
{
for (BiomeGenBase biome : biomes)
{
@SuppressWarnings("unchecked")
Iterator<SpawnListEntry> spawns = biome.func_25063_a(typeOfCreature).iterator();
while (spawns.hasNext())
{
SpawnListEntry entry = spawns.next();
if (entry.field_25212_a == entityClass)
{
spawns.remove();
}
}
}
}
@Override
@SuppressWarnings("unchecked")
public void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeGenBase... biomes)
{
Class <? extends Entity > entityClazz = EntityList.getEntityToClassMapping().get(entityName);
if (EntityLiving.class.isAssignableFrom(entityClazz))
{
removeSpawn((Class <? extends EntityLiving >) entityClazz, spawnList, biomes);
}
}
}
@@ -1,36 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraft.src;
import net.minecraft.client.Minecraft;
public class EntityRendererProxy extends EntityRenderer
{
private Minecraft game;
public EntityRendererProxy(Minecraft minecraft)
{
super(minecraft);
game = minecraft;
}
@Override
public void func_4136_b(float tick)
{
super.func_4136_b(tick);
//This is where ModLoader does all of it's ticking
}
}
@@ -1,88 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraft.src;
import java.awt.Dimension;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.FMLCommonHandler;
/**
*
* A static hook library for optifine and other basemod editing code to access FML functions
*
* @author cpw
*
*/
public class FMLRenderAccessLibrary
{
public static Logger getLogger()
{
return FMLCommonHandler.instance().getFMLLogger();
}
public static void log(Level level, String message)
{
getLogger().log(level, message);
}
public static void log(Level level, String message, Throwable throwable)
{
getLogger().log(level, message, throwable);
}
public static void setTextureDimensions(int textureId, int width, int height, List<TextureFX> textureFXList)
{
FMLClientHandler.instance().setTextureDimensions(textureId, width, height, textureFXList);
}
public static void preRegisterEffect(TextureFX textureFX)
{
FMLClientHandler.instance().onPreRegisterEffect(textureFX);
}
public static boolean onUpdateTextureEffect(TextureFX textureFX)
{
return FMLClientHandler.instance().onUpdateTextureEffect(textureFX);
}
public static Dimension getTextureDimensions(TextureFX textureFX)
{
return FMLClientHandler.instance().getTextureDimensions(textureFX);
}
public static void onTexturePackChange(RenderEngine engine, TexturePackBase texturePack, List<TextureFX> textureFXList)
{
FMLClientHandler.instance().onTexturePackChange(engine, texturePack, textureFXList);
}
public static boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelId)
{
return FMLClientHandler.instance().renderWorldBlock(renderer, world, x, y, z, block, modelId);
}
public static void renderInventoryBlock(RenderBlocks renderer, Block block, int metadata, int modelID)
{
FMLClientHandler.instance().renderInventoryBlock(renderer, block, metadata, modelID);
}
public static boolean renderItemAsFull3DBlock(int modelId)
{
return FMLClientHandler.instance().renderItemAsFull3DBlock(modelId);
}
}
-48
View File
@@ -1,48 +0,0 @@
/*
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraft.src;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.RetentionPolicy.*;
import static java.lang.annotation.ElementType.*;
/**
* @author cpw
*
*/
@Retention(value = RUNTIME)
@Target(value = FIELD)
public @interface MLProp
{
/**
* Adds additional help to top of configuration file.
*/
String info() default "";
/**
* Maximum value allowed if field is a number.
*/
double max() default Double.MAX_VALUE;
/**
* Minimum value allowed if field is a number.
*/
double min() default Double.MIN_VALUE;
/**
* Overrides the field name for property key.
*/
String name() default "";
}
-794
View File
@@ -1,794 +0,0 @@
/*
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraft.src;
import java.awt.image.BufferedImage;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import net.minecraft.client.Minecraft;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.SpriteHelper;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ReflectionHelper;
import cpw.mods.fml.common.modloader.ModLoaderHelper;
import cpw.mods.fml.common.modloader.ModLoaderModContainer;
import cpw.mods.fml.common.registry.FMLRegistry;
public class ModLoader
{
// TODO dirty workaround for millinaire
@Deprecated
public static final Map<String,Map<String,String>> localizedStrings=Collections.emptyMap();
/**
* Not used on the server.
*
* @param achievement
* @param name
* @param description
*/
public static void addAchievementDesc(Achievement achievement, String name, String description)
{
String achName=achievement.func_44020_i();
addLocalization(achName, name);
addLocalization(achName+".desc", description);
}
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
*
* {@link FMLCommonHandler#fuelLookup(int, int)}
*
* @param id
* @param metadata
* @return
*/
@Deprecated
public static int addAllFuel(int id, int metadata)
{
return 0;
}
@Deprecated
public static void addAllRenderers(Map<Class<? extends Entity>, Render> renderers)
{
}
public static void addAnimation(TextureFX anim)
{
FMLClientHandler.instance().addAnimation(anim);
}
/**
* This method is unimplemented in server versions to date.
*
* @param armor
* @return
*/
public static int addArmor(String armor)
{
return FMLClientHandler.instance().addNewArmourRendererPrefix(armor);
}
/**
* This method adds the supplied biome to the set of candidate biomes for the default world generator type.
*
* @param biome
*/
public static void addBiome(BiomeGenBase biome)
{
FMLClientHandler.instance().addBiomeToDefaultWorldGenerator(biome);
}
/**
* Add localization for the specified string
*
* @param key
* @param value
*/
public static void addLocalization(String key, String value)
{
addLocalization(key, "en_US", value);
}
/**
* Add localization for the specified string
*
* @param key
* @param lang
* @param value
*/
public static void addLocalization(String key, String lang, String value)
{
FMLCommonHandler.instance().addStringLocalization(key, lang, value);
}
/**
* Name the specified minecraft object with the supplied name
*
* @param instance
* @param name
*/
public static void addName(Object instance, String name)
{
addName(instance,"en_US",name);
}
/**
* Unimplemented on the server as it does not generate names
*
* @param instance
* @param lang
* @param name
*/
public static void addName(Object instance, String lang, String name)
{
FMLCommonHandler.instance().addNameForObject(instance, lang, name);
}
/**
* Unimplemented on the server as it does not render textures
*
* @param fileToOverride
* @param fileToAdd
* @return
*/
public static int addOverride(String fileToOverride, String fileToAdd)
{
int idx = SpriteHelper.getUniqueSpriteIndex(fileToOverride);
addOverride(fileToOverride, fileToAdd, idx);
return idx;
}
/**
* Unimplemented on the server as it does not render textures
*
* @param path
* @param overlayPath
* @param index
*/
public static void addOverride(String path, String overlayPath, int index)
{
FMLClientHandler.instance().addNewTextureOverride(path, overlayPath, index);
}
/**
* Add a Shaped Recipe
*
* @param output
* @param params
*/
public static void addRecipe(ItemStack output, Object... params)
{
FMLRegistry.addRecipe(output, params);
}
/**
* Add a shapeless recipe
*
* @param output
* @param params
*/
public static void addShapelessRecipe(ItemStack output, Object... params)
{
FMLRegistry.addShapelessRecipe(output, params);
}
/**
* Add a new product to be smelted
*
* @param input
* @param output
*/
public static void addSmelting(int input, ItemStack output)
{
FMLRegistry.addSmelting(input, output);
}
/**
* Add a mob to the spawn list
*
* @param entityClass
* @param weightedProb
* @param min
* @param max
* @param spawnList
*/
public static void addSpawn(Class<? extends EntityLiving> entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList)
{
FMLRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList, FMLClientHandler.instance().getDefaultOverworldBiomes());
}
/**
* Add a mob to the spawn list
*
* @param entityClass
* @param weightedProb
* @param min
* @param max
* @param spawnList
* @param biomes
*/
public static void addSpawn(Class<? extends EntityLiving> entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes)
{
FMLRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList, biomes);
}
/**
* Add a mob to the spawn list
*
* @param entityName
* @param weightedProb
* @param min
* @param max
* @param spawnList
*/
public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList)
{
FMLRegistry.addSpawn(entityName, weightedProb, min, max, spawnList, FMLClientHandler.instance().getDefaultOverworldBiomes());
}
/**
* Add a mob to the spawn list
*
* @param entityName
* @param weightedProb
* @param min
* @param max
* @param spawnList
* @param biomes
*/
public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes)
{
FMLRegistry.addSpawn(entityName, weightedProb, min, max, spawnList, biomes);
}
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
* {@link FMLClientHandler#tryDispensingEntity(World, double, double, double, byte, byte, ItemStack)}
*
* @param world
* @param x
* @param y
* @param z
* @param xVel
* @param zVel
* @param item
* @return
*/
@Deprecated
public static boolean dispenseEntity(World world, double x, double y, double z, int xVel, int zVel, ItemStack item)
{
return false;
}
/**
* Remove a container and drop all the items in it on the ground around
*
* @param world
* @param x
* @param y
* @param z
*/
public static void genericContainerRemoval(World world, int x, int y, int z)
{
TileEntity te = world.func_603_b(x, y, z);
if (!(te instanceof IInventory))
{
return;
}
IInventory inv = (IInventory)te;
for (int l = 0; l < inv.func_469_c(); l++)
{
ItemStack itemstack = inv.func_468_c(l);
if (itemstack == null)
{
continue;
}
float f = world.field_1037_n.nextFloat() * 0.8F + 0.1F;
float f1 = world.field_1037_n.nextFloat() * 0.8F + 0.1F;
float f2 = world.field_1037_n.nextFloat() * 0.8F + 0.1F;
while (itemstack.field_1615_a > 0)
{
int i1 = world.field_1037_n.nextInt(21) + 10;
if (i1 > itemstack.field_1615_a)
{
i1 = itemstack.field_1615_a;
}
itemstack.field_1615_a -= i1;
EntityItem entityitem = new EntityItem(world, (float)te.field_823_f + f, (float)te.field_822_g + f1, (float)te.field_821_h + f2, new ItemStack(itemstack.field_1617_c, i1, itemstack.func_21181_i()));
float f3 = 0.05F;
entityitem.field_608_an = (float) world.field_1037_n.nextGaussian() * f3;
entityitem.field_607_ao = (float) world.field_1037_n.nextGaussian() * f3 + 0.2F;
entityitem.field_606_ap = (float) world.field_1037_n.nextGaussian() * f3;
if (itemstack.func_40710_n())
{
entityitem.field_801_a.func_40706_d((NBTTagCompound) itemstack.func_40709_o().func_40195_b());
}
world.func_674_a(entityitem);
}
}
}
/**
* Get a list of all BaseMod loaded into the system
* {@link ModLoaderModContainer#findAll}
*
* @return
*/
public static List<BaseMod> getLoadedMods()
{
return ModLoaderModContainer.findAll(BaseMod.class);
}
/**
* Get a logger instance {@link FMLCommonHandler#getFMLLogger()}
*
* @return
*/
public static Logger getLogger()
{
return FMLCommonHandler.instance().getFMLLogger();
}
public static Minecraft getMinecraftInstance()
{
return FMLClientHandler.instance().getClient();
}
/**
* This is not the server
* {@link FMLClientHandler#getServer()}
*
* @return
*/
public static Object getMinecraftServerInstance()
{
return getMinecraftInstance();
}
/**
* Get a value from a field using reflection
* {@link ReflectionHelper#getPrivateValue(Class, Object, int)}
*
* @param instanceclass
* @param instance
* @param fieldindex
* @return
*/
public static <T, E> T getPrivateValue(Class<? super E> instanceclass, E instance, int fieldindex)
{
return ReflectionHelper.getPrivateValue(instanceclass, instance, fieldindex);
}
/**
* Get a value from a field using reflection
* {@link ReflectionHelper#getPrivateValue(Class, Object, String)}
*
* @param instanceclass
* @param instance
* @param field
* @return
*/
public static <T, E> T getPrivateValue(Class<? super E> instanceclass, E instance, String field)
{
return ReflectionHelper.getPrivateValue(instanceclass, instance, field);
}
/**
* Stubbed method on the server to return a unique model id
*
*/
public static int getUniqueBlockModelID(BaseMod mod, boolean inventoryRenderer)
{
return FMLClientHandler.instance().obtainBlockModelIdFor(mod, inventoryRenderer);
}
/**
* Get a new unique entity id
* {@link Entity#getNextId()}
*
* @return
*/
public static int getUniqueEntityId()
{
return FMLCommonHandler.instance().nextUniqueEntityListId();
}
public static int getUniqueSpriteIndex(String path)
{
return SpriteHelper.getUniqueSpriteIndex(path);
}
/**
* To properly implement packet 250 protocol you should always check your
* channel is active prior to sending the packet
*
* @param player
* @param channel
* @return
*/
public static boolean isChannelActive(EntityPlayer player, String channel)
{
return FMLCommonHandler.instance().isChannelActive(channel, player);
}
public static boolean isGUIOpen(Class<? extends GuiScreen> gui)
{
return FMLClientHandler.instance().getClient().field_6313_p!=null && FMLClientHandler.instance().getClient().field_6313_p.equals(gui);
}
/**
* Is the named mod loaded?
* {@link Loader#isModLoaded(String)}
*
* @param modname
* @return
*/
public static boolean isModLoaded(String modname)
{
return Loader.isModLoaded(modname);
}
/**
* Implemented elsewhere
*/
@Deprecated
public static void loadConfig()
{
}
public static BufferedImage loadImage(RenderEngine renderEngine, String path) throws Exception
{
return FMLClientHandler.instance().loadImageFromTexturePack(renderEngine, path);
}
/**
* Call in from elsewhere. Unimplemented here.
* @param player
* @param item
*/
@Deprecated
public static void onItemPickup(EntityPlayer player, ItemStack item)
{
}
/**
* Call in from elsewhere. Unimplemented here.
*/
@Deprecated
public static void onTick(float tick, Minecraft game)
{
}
public static void openGUI(EntityPlayer player, GuiScreen gui)
{
FMLClientHandler.instance().displayGuiScreen(player, gui);
}
@Deprecated
public static void populateChunk(IChunkProvider generator, int chunkX, int chunkZ, World world)
{
}
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
* {@link FMLServerHandler#handlePacket250(Packet250CustomPayload, EntityPlayer)}
*
* @param packet
*/
@Deprecated
public static void receivePacket(Packet250CustomPayload packet)
{
}
@Deprecated
public static KeyBinding[] registerAllKeys(KeyBinding[] keys)
{
return keys;
}
@Deprecated
public static void registerAllTextureOverrides(RenderEngine cache)
{
}
/**
* Register a new block
*
* @param block
*/
public static void registerBlock(Block block)
{
FMLRegistry.registerBlock(block);
}
/**
* Register a new block
*
* @param block
* @param itemclass
*/
public static void registerBlock(Block block, Class<? extends ItemBlock> itemclass)
{
FMLRegistry.registerBlock(block, itemclass);
}
/**
* Register a new entity ID
*
* @param entityClass
* @param entityName
* @param id
*/
public static void registerEntityID(Class<? extends Entity> entityClass, String entityName, int id)
{
FMLRegistry.registerEntityID(entityClass, entityName, id);
}
/**
* Register a new entity ID
*
* @param entityClass
* @param entityName
* @param id
* @param background
* @param foreground
*/
public static void registerEntityID(Class<? extends Entity> entityClass, String entityName, int id, int background, int foreground)
{
FMLRegistry.registerEntityID(entityClass, entityName, id, background, foreground);
}
public static void registerKey(BaseMod mod, KeyBinding keyHandler, boolean allowRepeat)
{
FMLClientHandler.instance().registerKeyHandler(mod, keyHandler, allowRepeat);
}
/**
* Register the mod for packets on this channel. This only registers the
* channel with Forge Mod Loader, not with clients connecting- use
* BaseMod.onClientLogin to tell them about your custom channel
* {@link FMLCommonHandler#registerChannel(cpw.mods.fml.common.ModContainer, String)}
*
* @param mod
* @param channel
*/
public static void registerPacketChannel(BaseMod mod, String channel)
{
FMLCommonHandler.instance().registerChannel(FMLCommonHandler.instance().findContainerFor(mod), channel);
}
/**
* Register a new tile entity class
*
* @param tileEntityClass
* @param id
*/
public static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id)
{
FMLRegistry.registerTileEntity(tileEntityClass, id);
}
public static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id, TileEntitySpecialRenderer renderer)
{
ClientRegistry.instance().registerTileEntity(tileEntityClass, id, renderer);
}
/**
* Remove a biome from the list of generated biomes
*
* @param biome
*/
public static void removeBiome(BiomeGenBase biome)
{
FMLRegistry.removeBiome(biome);
}
/**
* Remove a spawn
*
* @param entityClass
* @param spawnList
*/
public static void removeSpawn(Class<? extends EntityLiving> entityClass, EnumCreatureType spawnList)
{
FMLRegistry.removeSpawn(entityClass, spawnList, FMLClientHandler.instance().getDefaultOverworldBiomes());
}
/**
* Remove a spawn
*
* @param entityClass
* @param spawnList
* @param biomes
*/
public static void removeSpawn(Class<? extends EntityLiving> entityClass, EnumCreatureType spawnList, BiomeGenBase... biomes)
{
FMLRegistry.removeSpawn(entityClass, spawnList, biomes);
}
/**
* Remove a spawn
*
* @param entityName
* @param spawnList
*/
public static void removeSpawn(String entityName, EnumCreatureType spawnList)
{
FMLRegistry.removeSpawn(entityName, spawnList, FMLClientHandler.instance().getDefaultOverworldBiomes());
}
/**
* Remove a spawn
*
* @param entityName
* @param spawnList
* @param biomes
*/
public static void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeGenBase... biomes)
{
FMLRegistry.removeSpawn(entityName, spawnList, biomes);
}
@Deprecated
public static boolean renderBlockIsItemFull3D(int modelID)
{
return FMLClientHandler.instance().renderItemAsFull3DBlock(modelID);
}
@Deprecated
public static void renderInvBlock(RenderBlocks renderer, Block block, int metadata, int modelID)
{
FMLClientHandler.instance().renderInventoryBlock(renderer, block, metadata, modelID);
}
@Deprecated
public static boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID)
{
return FMLClientHandler.instance().renderWorldBlock(renderer, world, x, y, z, block, modelID);
}
/**
* Configuration is handled elsewhere
* {@link ModLoaderModContainer}
*/
@Deprecated
public static void saveConfig()
{
}
public static void sendPacket(Packet packet) {
FMLClientHandler.instance().sendPacket(packet);
}
/**
* Send a chat message to the server
* {@link FMLClientHandler#handleChatPacket(Packet3Chat, EntityPlayer)}
*
* @param text
*/
@Deprecated
public static void serverChat(String text)
{
//TODO
}
@Deprecated
public static void serverLogin(NetClientHandler handler, Packet1Login loginPacket)
{
//TODO
}
/**
* Indicate that you want to receive ticks
*
* @param mod receiving the events
* @param enable indicates whether you want to recieve them or not
* @param useClock don't receive render subticks, just world ticks
*/
public static void setInGameHook(BaseMod mod, boolean enable, boolean useClock)
{
ModLoaderHelper.updateStandardTicks(mod, enable, useClock);
}
public static void setInGUIHook(BaseMod mod, boolean enable, boolean useClock)
{
ModLoaderHelper.updateGUITicks(mod, enable, useClock);
}
/**
* Set a private field to a value using reflection
* {@link ReflectionHelper#setPrivateValue(Class, Object, int, Object)}
*
* @param instanceclass
* @param instance
* @param fieldindex
* @param value
*/
public static <T, E> void setPrivateValue(Class<? super T> instanceclass, T instance, int fieldindex, E value)
{
ReflectionHelper.setPrivateValue(instanceclass, instance, fieldindex, value);
}
/**
* Set a private field to a value using reflection
* {@link ReflectionHelper#setPrivateValue(Class, Object, String, Object)}
*
* @param instanceclass
* @param instance
* @param field
* @param value
*/
public static <T, E> void setPrivateValue(Class<? super T> instanceclass, T instance, String field, E value)
{
ReflectionHelper.setPrivateValue(instanceclass, instance, field, value);
}
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
* {@link FMLClientHandler#onItemCrafted(EntityPlayer, ItemStack, IInventory)}
*
* @param player
* @param item
* @param matrix
*/
@Deprecated
public static void takenFromCrafting(EntityPlayer player, ItemStack item, IInventory matrix)
{
}
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
* {@link FMLClientHandler#onItemSmelted(EntityPlayer, ItemStack)}
*
* @param player
* @param item
*/
@Deprecated
public static void takenFromFurnace(EntityPlayer player, ItemStack item)
{
}
/**
* Throw the offered exception. Likely will stop the game.
* {@link FMLClientHandler#raiseException(Throwable, String, boolean)}
*
* @param message
* @param e
*/
public static void throwException(String message, Throwable e)
{
FMLCommonHandler.instance().raiseException(e, message, true);
}
public static void throwException(Throwable e)
{
throwException("Exception in ModLoader", e);
}
}
@@ -1,128 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraft.src;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.FMLTextureFX;
import cpw.mods.fml.common.FMLCommonHandler;
import static org.lwjgl.opengl.GL11.*;
/**
* A texture override for animations, it takes a vertical image of
* texture frames and constantly rotates them in the texture.
*/
public class ModTextureAnimation extends FMLTextureFX
{
private final int tickRate;
private byte[][] images;
private int index = 0;
private int ticks = 0;
private String targetTex = null;
private BufferedImage imgData = null;
public ModTextureAnimation(int icon, int target, BufferedImage image, int tickCount)
{
this(icon, 1, target, image, tickCount);
}
public ModTextureAnimation(int icon, int size, int target, BufferedImage image, int tickCount)
{
this(icon, size, (target == 0 ? "/terrain.png" : "/gui/items.png"), image, tickCount);
}
public ModTextureAnimation(int icon, int size, String target, BufferedImage image, int tickCount)
{
super(icon);
RenderEngine re = FMLClientHandler.instance().getClient().field_6315_n;
targetTex = target;
field_1129_e = size;
field_1128_f = re.func_1070_a(target);
tickRate = tickCount;
ticks = tickCount;
imgData = image;
}
@Override
public void setup()
{
super.setup();
int sWidth = imgData.getWidth();
int sHeight = imgData.getHeight();
int tWidth = tileSizeBase;
int tHeight = tileSizeBase;
int frames = (int)Math.floor((double)(sHeight / sWidth));
if (frames < 1)
{
throw new IllegalArgumentException(String.format("Attempted to create a TextureAnimation with no complete frames: %dx%d", sWidth, sHeight));
}
else
{
images = new byte[frames][];
BufferedImage image = imgData;
if (sWidth != tWidth)
{
BufferedImage b = new BufferedImage(tWidth, tHeight * frames, 6);
Graphics2D g = b.createGraphics();
g.drawImage(imgData, 0, 0, tWidth, tHeight * frames, 0, 0, sWidth, sHeight, (ImageObserver)null);
g.dispose();
image = b;
}
for (int frame = 0; frame < frames; frame++)
{
int[] pixels = new int[tileSizeSquare];
image.getRGB(0, tHeight * frame, tWidth, tHeight, pixels, 0, tWidth);
images[frame] = new byte[tileSizeSquare << 2];
for (int i = 0; i < pixels.length; i++)
{
int i4 = i * 4;
images[frame][i4 + 0] = (byte)(pixels[i] >> 16 & 255);
images[frame][i4 + 1] = (byte)(pixels[i] >> 8 & 255);
images[frame][i4 + 2] = (byte)(pixels[i] >> 0 & 255);
images[frame][i4 + 3] = (byte)(pixels[i] >> 24 & 255);
}
}
}
}
public void func_783_a()
{
if (++ticks >= tickRate)
{
if (++index >= images.length)
{
index = 0;
}
field_1127_a = images[index];
ticks = 0;
}
}
}
@@ -1,179 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraft.src;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.FMLTextureFX;
import cpw.mods.fml.common.FMLCommonHandler;
import static org.lwjgl.opengl.GL11.*;
public class ModTextureStatic extends FMLTextureFX
{
private boolean oldanaglyph = false;
private int[] pixels = null;
private String targetTex = null;
private int storedSize;
private BufferedImage overrideData = null;
private int needApply = 2;
public ModTextureStatic(int icon, int target, BufferedImage image)
{
this(icon, 1, target, image);
}
public ModTextureStatic(int icon, int size, int target, BufferedImage image)
{
this(icon, size, (target == 0 ? "/terrain.png" : "/gui/items.png"), image);
}
public ModTextureStatic(int icon, int size, String target, BufferedImage image)
{
super(icon);
RenderEngine re = FMLClientHandler.instance().getClient().field_6315_n;
targetTex = target;
storedSize = size;
field_1129_e = size;
field_1128_f = re.func_1070_a(target);
overrideData = image;
}
@Override
public void setup()
{
super.setup();
int sWidth = overrideData.getWidth();
int sHeight = overrideData.getHeight();
pixels = new int[tileSizeSquare];
if (tileSizeBase == sWidth && tileSizeBase == sHeight)
{
overrideData.getRGB(0, 0, sWidth, sHeight, pixels, 0, sWidth);
}
else
{
BufferedImage tmp = new BufferedImage(tileSizeBase, tileSizeBase, 6);
Graphics2D gfx = tmp.createGraphics();
gfx.drawImage(overrideData, 0, 0, tileSizeBase, tileSizeBase, 0, 0, sWidth, sHeight, (ImageObserver)null);
tmp.getRGB(0, 0, tileSizeBase, tileSizeBase, pixels, 0, tileSizeBase);
gfx.dispose();
}
update();
}
public void func_783_a()
{
if (oldanaglyph != field_1131_c)
{
update();
}
// This makes it so we only apply the texture to the target texture when we need to,
//due to the fact that update is called when the Effect is first registered, we actually
//need to wait for the next one.
field_1129_e = (needApply == 0 ? 0 : storedSize);
if (needApply > 0)
{
needApply--;
}
}
public void func_782_a(RenderEngine p_782_1_)
{
GL11.glBindTexture(GL_TEXTURE_2D, p_782_1_.func_1070_a(targetTex));
}
public void update()
{
needApply = 2;
for (int idx = 0; idx < pixels.length; idx++)
{
int i = idx * 4;
int a = pixels[idx] >> 24 & 255;
int r = pixels[idx] >> 16 & 255;
int g = pixels[idx] >> 8 & 255;
int b = pixels[idx] >> 0 & 255;
if (field_1131_c)
{
r = g = b = (r + g + b) / 3;
}
field_1127_a[i + 0] = (byte)r;
field_1127_a[i + 1] = (byte)g;
field_1127_a[i + 2] = (byte)b;
field_1127_a[i + 3] = (byte)a;
}
oldanaglyph = field_1131_c;
}
//Implementation of http://scale2x.sourceforge.net/algorithm.html
public static BufferedImage scale2x(BufferedImage image)
{
int w = image.getWidth();
int h = image.getHeight();
BufferedImage tmp = new BufferedImage(w * 2, h * 2, 2);
for (int x = 0; x < h; ++x)
{
int x2 = x * 2;
for (int y = 0; y < w; ++y)
{
int y2 = y * 2;
int E = image.getRGB(y, x);
int D = (x == 0 ? E : image.getRGB(y, x - 1));
int B = (y == 0 ? E : image.getRGB(y - 1, x ));
int H = (y >= w - 1 ? E : image.getRGB(y + 1, x ));
int F = (x >= h - 1 ? E : image.getRGB(y, x + 1));
int e0, e1, e2, e3;
if (B != H && D != F)
{
e0 = D == B ? D : E;
e1 = B == F ? F : E;
e2 = D == H ? D : E;
e3 = H == F ? F : E;
}
else
{
e0 = e1 = e2 = e3 = E;
}
tmp.setRGB(y2, x2, e0);
tmp.setRGB(y2 + 1, x2, e1);
tmp.setRGB(y2, x2 + 1, e2);
tmp.setRGB(y2 + 1, x2 + 1, e3);
}
}
return tmp;
}
@Override
public String toString()
{
return String.format("ModTextureStatic %s @ %d", targetTex, field_1126_b);
}
}
-46
View File
@@ -1,46 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraft.src;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @author cpw
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface SidedProxy
{
/**
* The name of the client side class to load and populate
* @return
*/
String clientSide() default "";
/**
* The name of the server side class to load and populate
* @return
*/
String serverSide() default "";
/**
* The name of the a special bukkit plugin class to load and populate
*/
String bukkitSide() default "";
}
-64
View File
@@ -1,64 +0,0 @@
package fml.stubs.mcp;
import java.util.Map;
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.src.Block;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.GuiScreen;
import net.minecraft.src.IBlockAccess;
import net.minecraft.src.IInventory;
import net.minecraft.src.ItemStack;
import net.minecraft.src.KeyBinding;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.Render;
import net.minecraft.src.RenderBlocks;
import net.minecraft.src.World;
public interface BaseMod {
int addFuel(int id, int metadata);
void addRenderer(Map<Class<? extends Entity>, Render> renderers);
boolean dispenseEntity(World world, double x, double y, double z, int xVel, int zVel, ItemStack item);
void generateNether(World world, Random random, int chunkX, int chunkZ);
void generateSurface(World world, Random random, int chunkX, int chunkZ);
String getName();
String getPriorities();
abstract String getVersion();
void keyboardEvent(KeyBinding event);
abstract void load();
void modsLoaded();
void onItemPickup(EntityPlayer player, ItemStack item);
boolean onTickInGame(float tick, Minecraft game);
boolean onTickInGUI(float tick, Minecraft game, GuiScreen gui);
void receiveChatPacket(String text);
void receiveCustomPacket(Packet250CustomPayload packet);
void registerAnimation(Minecraft game);
void renderInvBlock(RenderBlocks renderer, Block block, int metadata, int modelID);
boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID);
void takenFromCrafting(EntityPlayer player, ItemStack item, IInventory matrix);
void takenFromFurnace(EntityPlayer player, ItemStack item);
String toString();
}
-250
View File
@@ -1,250 +0,0 @@
package fml.stubs.mcp;
import java.awt.image.BufferedImage;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import net.minecraft.client.Minecraft;
import net.minecraft.src.Achievement;
import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.Block;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.EnumCreatureType;
import net.minecraft.src.GuiScreen;
import net.minecraft.src.IBlockAccess;
import net.minecraft.src.IChunkProvider;
import net.minecraft.src.IInventory;
import net.minecraft.src.ItemBlock;
import net.minecraft.src.ItemStack;
import net.minecraft.src.KeyBinding;
import net.minecraft.src.NetClientHandler;
import net.minecraft.src.Packet1Login;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.Render;
import net.minecraft.src.RenderBlocks;
import net.minecraft.src.RenderEngine;
import net.minecraft.src.TextureFX;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySpecialRenderer;
import net.minecraft.src.World;
public class ModLoader {
static void addAchievementDesc(Achievement achievement, String name, String description) {
}
static int addAllFuel(int id, int metadata) {
return 0;
}
static void addAllRenderers(Map<Class<? extends Entity>, Render> renderers) {
}
static void addAnimation(TextureFX anim) {
}
static int addArmor(String armor) {
return 0;
}
static void addBiome(BiomeGenBase biome) {
}
static void addLocalization(String key, String value) {
}
static void addLocalization(String key, String lang, String value) {
}
static void addName(Object instance, String name) {
}
static void addName(Object instance, String lang, String name) {
}
static int addOverride(String fileToOverride, String fileToAdd) {
return 0;
}
static void addOverride(String path, String overlayPath, int index) {
}
static void addRecipe(ItemStack output, Object... params) {
}
static void addShapelessRecipe(ItemStack output, Object... params) {
}
static void addSmelting(int input, ItemStack output) {
}
static void addSpawn(Class<? extends EntityLiving> entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList) {
}
static void addSpawn(Class<? extends EntityLiving> entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes) {
}
static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList) {
}
static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes) {
}
static boolean dispenseEntity(World world, double x, double y, double z, int xVel, int zVel, ItemStack item) {
return false;
}
static void genericContainerRemoval(World world, int x, int y, int z) {
}
static List<BaseMod> getLoadedMods() {
return null;
}
static Logger getLogger() {
return null;
}
static Minecraft getMinecraftInstance() {
return null;
}
static <T, E> T getPrivateValue(Class<? super E> instanceclass, E instance, int fieldindex) {
return null;
}
static <T, E> T getPrivateValue(Class<? super E> instanceclass, E instance, String field) {
return null;
}
static int getUniqueBlockModelID(BaseMod mod, boolean full3DItem) {
return 0;
}
static int getUniqueEntityId() {
return 0;
}
static int getUniqueSpriteIndex(String path) {
return 0;
}
static boolean isGUIOpen(Class<? extends GuiScreen> gui) {
return false;
}
static boolean isModLoaded(String modname) {
return false;
}
static void loadConfig() {
}
static BufferedImage loadImage(RenderEngine texCache, String path) {
return null;
}
static void onItemPickup(EntityPlayer player, ItemStack item) {
}
static void onTick(float tick, net.minecraft.client.Minecraft game) {
}
static void openGUI(EntityPlayer player, GuiScreen gui) {
}
static void populateChunk(IChunkProvider generator, int chunkX, int chunkZ, World world) {
}
static void receivePacket(Packet250CustomPayload packet) {
}
static KeyBinding[] registerAllKeys(KeyBinding[] keys) {
return keys;
}
static void registerAllTextureOverrides(RenderEngine cache) {
}
static void registerBlock(Block block) {
}
static void registerBlock(Block block, Class<? extends ItemBlock> itemclass) {
}
static void registerEntityID(Class<? extends Entity> entityClass, String entityName, int id) {
}
static void registerEntityID(Class<? extends Entity> entityClass, String entityName, int id, int background, int foreground) {
}
static void registerKey(BaseMod mod, KeyBinding keyHandler, boolean allowRepeat) {
}
static void registerPacketChannel(BaseMod mod, String channel) {
}
static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id) {
}
static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id, TileEntitySpecialRenderer renderer) {
}
static void removeBiome(BiomeGenBase biome) {
}
static void removeSpawn(Class<? extends EntityLiving> entityClass, EnumCreatureType spawnList) {
}
static void removeSpawn(Class<? extends EntityLiving> entityClass, EnumCreatureType spawnList, BiomeGenBase... biomes) {
}
static void removeSpawn(String entityName, EnumCreatureType spawnList) {
}
static void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeGenBase... biomes) {
}
static boolean renderBlockIsItemFull3D(int modelID) {
return false;
}
static void renderInvBlock(RenderBlocks renderer, Block block, int metadata, int modelID) {
}
static boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID) {
return false;
}
static void saveConfig() {
}
static void serverChat(String text) {
}
static void serverLogin(NetClientHandler handler, Packet1Login loginPacket) {
}
static void setInGameHook(BaseMod mod, boolean enable, boolean useClock) {
}
static void setInGUIHook(BaseMod mod, boolean enable, boolean useClock) {
}
static <T, E> void setPrivateValue(Class<? super T> instanceclass, T instance, int fieldindex, E value) {
}
static <T, E> void setPrivateValue(Class<? super T> instanceclass, T instance, String field, E value) {
}
static void takenFromCrafting(EntityPlayer player, ItemStack item, IInventory matrix) {
}
static void takenFromFurnace(EntityPlayer player, ItemStack item) {
}
static void throwException(String message, Throwable e) {
}
}
-47
View File
@@ -1,47 +0,0 @@
package fml.stubs.obf;
public interface BaseMod {
int addFuel(int id, int metadata);
void addRenderer(java.util.Map<java.lang.Class<? extends nn>, um> renderers);
boolean dispenseEntity(xd world, double x, double y, double z, int xVel, int zVel, aan item);
void generateNether(xd world, java.util.Random random, int chunkX, int chunkZ);
void generateSurface(xd world, java.util.Random random, int chunkX, int chunkZ);
java.lang.String getName();
java.lang.String getPriorities();
abstract java.lang.String getVersion();
void keyboardEvent(afu event);
abstract void load();
void modsLoaded();
void onItemPickup(yw player, aan item);
boolean onTickInGame(float tick, net.minecraft.client.Minecraft game);
boolean onTickInGUI(float tick, net.minecraft.client.Minecraft game, vp gui);
void receiveChatPacket(java.lang.String text);
void receiveCustomPacket(ee packet);
void registerAnimation(net.minecraft.client.Minecraft game);
void renderInvBlock(vl renderer, pb block, int metadata, int modelID);
boolean renderWorldBlock(vl renderer, ali world, int x, int y, int z, pb block, int modelID);
void takenFromCrafting(yw player, aan item, io matrix);
void takenFromFurnace(yw player, aan item);
java.lang.String toString();
}
-135
View File
@@ -1,135 +0,0 @@
package fml.stubs.obf;
public interface ModLoader {
static void addAchievementDesc(aeb achievement, java.lang.String name, java.lang.String description);
static int addAllFuel(int id, int metadata);
static void addAllRenderers(java.util.Map<java.lang.Class<? extends nn>, um> renderers);
static void addAnimation(tt anim);
static int addArmor(java.lang.String armor);
static void addBiome(abn biome);
static void addLocalization(java.lang.String key, java.lang.String value);
static void addLocalization(java.lang.String key, java.lang.String lang, java.lang.String value);
static void addName(java.lang.Object instance, java.lang.String name);
static void addName(java.lang.Object instance, java.lang.String lang, java.lang.String name);
static int addOverride(java.lang.String fileToOverride, java.lang.String fileToAdd);
static void addOverride(java.lang.String path, java.lang.String overlayPath, int index);
static void addRecipe(aan output, java.lang.Object... params);
static void addShapelessRecipe(aan output, java.lang.Object... params);
static void addSmelting(int input, aan output);
static void addSpawn(java.lang.Class<? extends acq> entityClass, int weightedProb, int min, int max, acf spawnList);
static void addSpawn(java.lang.Class<? extends acq> entityClass, int weightedProb, int min, int max, acf spawnList, abn... biomes);
static void addSpawn(java.lang.String entityName, int weightedProb, int min, int max, acf spawnList);
static void addSpawn(java.lang.String entityName, int weightedProb, int min, int max, acf spawnList, abn... biomes);
static boolean dispenseEntity(xd world, double x, double y, double z, int xVel, int zVel, aan item);
static void genericContainerRemoval(xd world, int x, int y, int z);
static java.util.List<BaseMod> getLoadedMods();
static java.util.logging.Logger getLogger();
static net.minecraft.client.Minecraft getMinecraftInstance();
static <T, E> T getPrivateValue(java.lang.Class<? super E> instanceclass, E instance, int fieldindex);
static <T, E> T getPrivateValue(java.lang.Class<? super E> instanceclass, E instance, java.lang.String field);
static int getUniqueBlockModelID(BaseMod mod, boolean full3DItem);
static int getUniqueEntityId();
static int getUniqueSpriteIndex(java.lang.String path);
static boolean isGUIOpen(java.lang.Class<? extends vp> gui);
static boolean isModLoaded(java.lang.String modname);
static void loadConfig();
static java.awt.image.BufferedImage loadImage(aaw texCache, java.lang.String path);
static void onItemPickup(yw player, aan item);
static void onTick(float tick, net.minecraft.client.Minecraft game);
static void openGUI(yw player, vp gui);
static void populateChunk(ca generator, int chunkX, int chunkZ, xd world);
static void receivePacket(ee packet);
static afu[] registerAllKeys(afu[] keys);
static void registerAllTextureOverrides(aaw cache);
static void registerBlock(pb block);
static void registerBlock(pb block, java.lang.Class<? extends vd> itemclass);
static void registerEntityID(java.lang.Class<? extends nn> entityClass, java.lang.String entityName, int id);
static void registerEntityID(java.lang.Class<? extends nn> entityClass, java.lang.String entityName, int id, int background, int foreground);
static void registerKey(BaseMod mod, afu keyHandler, boolean allowRepeat);
static void registerPacketChannel(BaseMod mod, java.lang.String channel);
static void registerTileEntity(java.lang.Class<? extends kw> tileEntityClass, java.lang.String id);
static void registerTileEntity(java.lang.Class<? extends kw> tileEntityClass, java.lang.String id, aar renderer);
static void removeBiome(abn biome);
static void removeSpawn(java.lang.Class<? extends acq> entityClass, acf spawnList);
static void removeSpawn(java.lang.Class<? extends acq> entityClass, acf spawnList, abn... biomes);
static void removeSpawn(java.lang.String entityName, acf spawnList);
static void removeSpawn(java.lang.String entityName, acf spawnList, abn... biomes);
static boolean renderBlockIsItemFull3D(int modelID);
static void renderInvBlock(vl renderer, pb block, int metadata, int modelID);
static boolean renderWorldBlock(vl renderer, ali world, int x, int y, int z, pb block, int modelID);
static void saveConfig();
static void serverChat(java.lang.String text);
static void serverLogin(adl handler, aec loginPacket);
static void setInGameHook(BaseMod mod, boolean enable, boolean useClock);
static void setInGUIHook(BaseMod mod, boolean enable, boolean useClock);
static <T, E> void setPrivateValue(java.lang.Class<? super T> instanceclass, T instance, int fieldindex, E value);
static <T, E> void setPrivateValue(java.lang.Class<? super T> instanceclass, T instance, java.lang.String field, E value);
static void takenFromCrafting(yw player, aan item, io matrix);
static void takenFromFurnace(yw player, aan item);
static void throwException(java.lang.String message, java.lang.Throwable e);
}
@@ -1,657 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Properties;
import java.util.Random;
import java.util.Set;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
import cpw.mods.fml.common.ModContainer.SourceType;
/**
* The main class for non-obfuscated hook handling code
*
* Anything that doesn't require obfuscated or client/server specific code should
* go in this handler
*
* It also contains a reference to the sided handler instance that is valid
* allowing for common code to access specific properties from the obfuscated world
* without a direct dependency
*
* @author cpw
*
*/
public class FMLCommonHandler
{
/**
* The singleton
*/
private static final FMLCommonHandler INSTANCE = new FMLCommonHandler();
private static final Pattern metadataFile = Pattern.compile("$/modinfo.json$");;
/**
* A map of mods to their network channels
*/
private Map<ModContainer, Set<String>> channelList = new HashMap<ModContainer, Set<String>>();
/**
* A map of channels to mods
*/
private Map<String, ModContainer> modChannels = new HashMap<String, ModContainer>();
/**
* A map of active channels per player
*/
private Map<Object, Set<String>> activeChannels = new HashMap<Object, Set<String>>();
/**
* The delegate for side specific data and functions
*/
private IFMLSidedHandler sidedDelegate;
private int uniqueEntityListId = 220;
private List<ModContainer> auxilliaryContainers = new ArrayList<ModContainer>();
private Map<String,Properties> modLanguageData=new HashMap<String,Properties>();
private PriorityQueue<TickQueueElement> tickHandlers = new PriorityQueue<TickQueueElement>();
private List<IScheduledTickHandler> scheduledTicks = new ArrayList<IScheduledTickHandler>();
private Set<IWorldGenerator> worldGenerators = new HashSet<IWorldGenerator>();
/**
* We register our delegate here
* @param handler
*/
private static class TickQueueElement implements Comparable<TickQueueElement>
{
static long tickCounter = 0;
public TickQueueElement(IScheduledTickHandler ticker)
{
this.ticker = ticker;
update();
}
@Override
public int compareTo(TickQueueElement o)
{
return (int)(next - o.next);
}
public void update()
{
next = tickCounter + Math.max(ticker.nextTickSpacing(),1);
}
private long next;
private IScheduledTickHandler ticker;
public boolean scheduledNow()
{
return tickCounter >= next;
}
}
public void beginLoading(IFMLSidedHandler handler)
{
sidedDelegate = handler;
getFMLLogger().info("Attempting early MinecraftForge initialization");
callForgeMethod("initialize");
getFMLLogger().info("Completed early MinecraftForge initialization");
}
public void rescheduleTicks()
{
sidedDelegate.profileStart("modTickScheduling");
TickQueueElement.tickCounter++;
scheduledTicks.clear();
while (true)
{
if (tickHandlers.size()==0 || !tickHandlers.peek().scheduledNow())
{
break;
}
TickQueueElement tickQueueElement = tickHandlers.poll();
tickQueueElement.update();
tickHandlers.offer(tickQueueElement);
scheduledTicks.add(tickQueueElement.ticker);
}
sidedDelegate.profileEnd();
}
public void tickStart(EnumSet<TickType> ticks, Object ... data)
{
if (scheduledTicks.size()==0)
{
return;
}
sidedDelegate.profileStart("modTickStart$"+ticks);
for (IScheduledTickHandler ticker : scheduledTicks)
{
EnumSet<TickType> ticksToRun = EnumSet.copyOf(ticker.ticks());
ticksToRun.removeAll(EnumSet.complementOf(ticks));
if (!ticksToRun.isEmpty())
{
sidedDelegate.profileStart(ticker.getLabel());
ticker.tickStart(ticksToRun, data);
sidedDelegate.profileEnd();
}
}
sidedDelegate.profileEnd();
}
public void tickEnd(EnumSet<TickType> ticks, Object ... data)
{
if (scheduledTicks.size()==0)
{
return;
}
sidedDelegate.profileStart("modTickEnd$"+ticks);
for (IScheduledTickHandler ticker : scheduledTicks)
{
EnumSet<TickType> ticksToRun = EnumSet.copyOf(ticker.ticks());
ticksToRun.removeAll(EnumSet.complementOf(ticks));
if (!ticksToRun.isEmpty())
{
sidedDelegate.profileStart(ticker.getLabel());
ticker.tickEnd(ticksToRun, data);
sidedDelegate.profileEnd();
}
}
sidedDelegate.profileEnd();
}
public List<IKeyHandler> gatherKeyBindings() {
List<IKeyHandler> allKeys=new ArrayList<IKeyHandler>();
for (ModContainer mod : Loader.getModList())
{
allKeys.addAll(mod.getKeys());
}
for (ModContainer mod : auxilliaryContainers)
{
allKeys.addAll(mod.getKeys());
}
return allKeys;
}
/**
* @return the instance
*/
public static FMLCommonHandler instance()
{
return INSTANCE;
}
/**
* Find the container that associates with the supplied mod object
* @param mod
* @return
*/
public ModContainer findContainerFor(Object mod)
{
for (ModContainer mc : Loader.getModList())
{
if (mc.matches(mod))
{
return mc;
}
}
return null;
}
/**
* Lookup the mod for a channel
* @param channel
* @return
*/
public ModContainer getModForChannel(String channel)
{
return modChannels.get(channel);
}
/**
* Get the channel list for a mod
* @param modLoaderModContainer
* @return
*/
public Set<String> getChannelListFor(ModContainer container)
{
return channelList.get(container);
}
/**
* register a channel to a mod
* @param container
* @param channelName
*/
public void registerChannel(ModContainer container, String channelName)
{
if (modChannels.containsKey(channelName))
{
// NOOP
}
Set<String> list = channelList.get(container);
if (list == null)
{
list = new HashSet<String>();
channelList.put(container, list);
}
list.add(channelName);
modChannels.put(channelName, container);
}
/**
* Activate the channel for the player
* @param player
*/
public void activateChannel(Object player, String channel)
{
Set<String> active = activeChannels.get(player);
if (active == null)
{
active = new HashSet<String>();
activeChannels.put(player, active);
}
active.add(channel);
}
/**
* Deactivate the channel for the player
* @param player
* @param channel
*/
public void deactivateChannel(Object player, String channel)
{
Set<String> active = activeChannels.get(player);
if (active == null)
{
active = new HashSet<String>();
activeChannels.put(player, active);
}
active.remove(channel);
}
/**
* Get the packet 250 channel registration string
* @return
*/
public byte[] getPacketRegistry()
{
StringBuffer sb = new StringBuffer();
for (String chan : modChannels.keySet())
{
sb.append(chan).append("\0");
}
try
{
return sb.toString().getBytes("UTF8");
}
catch (UnsupportedEncodingException e)
{
Loader.log.warning("Error building registration list");
Loader.log.throwing("FMLHooks", "getPacketRegistry", e);
return new byte[0];
}
}
/**
* Is the specified channel active for the player?
* @param channel
* @param player
* @return
*/
public boolean isChannelActive(String channel, Object player)
{
return activeChannels.get(player).contains(channel);
}
/**
* Get the forge mod loader logging instance (goes to the forgemodloader log file)
* @return
*/
public Logger getFMLLogger()
{
return Loader.log;
}
/**
* Get the minecraft logger (goes to the server log file)
* @return
*/
public Logger getMinecraftLogger()
{
if (sidedDelegate == null)
{
throw new RuntimeException("sidedDelegate null when attempting to getMinecraftLogger, this is generally caused by you not installing FML properly, " +
"or installing some other mod that edits Minecraft.class on top of FML such as ModLoader, do not do this. Reinstall FML properly and try again.");
}
return sidedDelegate.getMinecraftLogger();
}
/**
* Is this a modloader mod?
* @param clazz
* @return
*/
public boolean isModLoaderMod(Class<?> clazz)
{
return sidedDelegate.isModLoaderMod(clazz);
}
/**
* Load the modloader mod
* @param clazz
* @param canonicalPath
* @return
*/
public ModContainer loadBaseModMod(Class<?> clazz, File canonicalFile)
{
return sidedDelegate.loadBaseModMod(clazz, canonicalFile);
}
public File getMinecraftRootDirectory() {
return sidedDelegate.getMinecraftRootDirectory();
}
/**
* @return
*/
public Object getMinecraftInstance()
{
return sidedDelegate.getMinecraftInstance();
}
/**
* @return
*/
public int nextUniqueEntityListId()
{
return uniqueEntityListId++;
}
/**
* @param key
* @param lang
* @param value
*/
public void addStringLocalization(String key, String lang, String value)
{
Properties langPack=modLanguageData.get(lang);
if (langPack==null) {
langPack=new Properties();
modLanguageData.put(lang, langPack);
}
langPack.put(key,value);
handleLanguageLoad(sidedDelegate.getCurrentLanguageTable(), lang);
}
/**
* @param languagePack
* @param lang
*/
public void handleLanguageLoad(Properties languagePack, String lang)
{
Properties usPack=modLanguageData.get("en_US");
if (usPack!=null) {
languagePack.putAll(usPack);
}
Properties langPack=modLanguageData.get(lang);
if (langPack==null) {
return;
}
languagePack.putAll(langPack);
}
public Side getSide()
{
return sidedDelegate.getSide();
}
public void addAuxilliaryModContainer(ModContainer ticker)
{
auxilliaryContainers.add(ticker);
}
/**
* Called from the furnace to lookup fuel values
*
* @param itemId
* @param itemDamage
* @return
*/
public int fuelLookup(int itemId, int itemDamage)
{
int fv = 0;
for (ModContainer mod : Loader.getModList())
{
fv = Math.max(fv, mod.lookupFuelValue(itemId, itemDamage));
}
return fv;
}
public void addNameForObject(Object minecraftObject, String lang, String name) {
String label=sidedDelegate.getObjectName(minecraftObject);
addStringLocalization(label, lang, name);
}
/**
* Raise an exception
*
* @param exception
* @param message
* @param stopGame
*/
public void raiseException(Throwable exception, String message, boolean stopGame)
{
FMLCommonHandler.instance().getFMLLogger().throwing("FMLHandler", "raiseException", exception);
throw new RuntimeException(exception);
}
private Class<?> forge;
private boolean noForge;
private Class<?> findMinecraftForge()
{
if (forge==null && !noForge)
{
try {
forge = Class.forName("forge.MinecraftForge");
} catch (Exception ex) {
try {
forge = Class.forName("net.minecraft.src.forge.MinecraftForge");
} catch (Exception ex2) {
// Ignore- forge isn't loaded
noForge = true;
}
}
}
return forge;
}
private Object callForgeMethod(String method)
{
if (noForge)
return null;
try
{
return findMinecraftForge().getMethod(method).invoke(null);
}
catch (Exception e)
{
// No Forge installation
return null;
}
}
/**
* @param string
* @return
*/
public String[] getBrandingStrings(String mcVersion)
{
ArrayList<String> brandings=new ArrayList<String>();
brandings.add(mcVersion);
brandings.add(Loader.instance().getFMLVersionString());
String forgeVersion = (String)callForgeMethod("getVersionString");
if (forgeVersion != null)
{
brandings.add(forgeVersion);
}
brandings.addAll(sidedDelegate.getAdditionalBrandingInformation());
try {
Properties props=new Properties();
props.load(FMLCommonHandler.class.getClassLoader().getResourceAsStream("fmlbranding.properties"));
brandings.add(props.getProperty("fmlbranding"));
} catch (Exception ex) {
// Ignore - no branding file found
}
brandings.add(String.format("%d mod%s loaded",Loader.getModList().size(), Loader.getModList().size()!=1?"s":""));
Collections.reverse(brandings);
return brandings.toArray(new String[brandings.size()]);
}
/**
* @param mod
*/
public void loadMetadataFor(ModContainer mod)
{
if (mod.getSourceType()==SourceType.JAR) {
ZipFile jar = null;
try
{
jar = new ZipFile(mod.getSource());
ZipEntry infoFile=jar.getEntry("mcmod.info");
if (infoFile!=null) {
InputStream input=jar.getInputStream(infoFile);
ModMetadata data=sidedDelegate.readMetadataFrom(input, mod);
mod.setMetadata(data);
} else {
getFMLLogger().fine(String.format("Failed to find mcmod.info file in %s for %s", mod.getSource().getName(), mod.getName()));
}
}
catch (Exception e)
{
// Something wrong but we don't care
getFMLLogger().fine(String.format("Failed to find mcmod.info file in %s for %s", mod.getSource().getName(), mod.getName()));
getFMLLogger().throwing("FMLCommonHandler", "loadMetadataFor", e);
}
finally
{
if (jar!=null)
{
try
{
jar.close();
}
catch (IOException e)
{
// GO AWAY
}
}
}
} else {
try
{
InputStream input=Loader.instance().getModClassLoader().getResourceAsStream(mod.getName()+".info");
if (input==null) {
input=Loader.instance().getModClassLoader().getResourceAsStream("net/minecraft/src/"+mod.getName()+".info");
}
if (input!=null) {
ModMetadata data=sidedDelegate.readMetadataFrom(input, mod);
mod.setMetadata(data);
}
}
catch (Exception e)
{
// Something wrong but we don't care
getFMLLogger().fine(String.format("Failed to find %s.info file in %s for %s", mod.getName(), mod.getSource().getName(), mod.getName()));
getFMLLogger().throwing("FMLCommonHandler", "loadMetadataFor", e);
}
}
}
/**
* @return
*/
public IFMLSidedHandler getSidedDelegate()
{
return sidedDelegate;
}
/**
* @param mod
*/
public void injectSidedProxyDelegate(ModContainer mod)
{
ProxyInjector injector = mod.findSidedProxy();
if (injector != null)
{
injector.inject(mod, sidedDelegate.getSide());
}
}
public void handleWorldGeneration(int chunkX, int chunkZ, long worldSeed, Object... data)
{
Random fmlRandom = new Random(worldSeed);
long xSeed = fmlRandom.nextLong() >> 2 + 1L;
long zSeed = fmlRandom.nextLong() >> 2 + 1L;
fmlRandom.setSeed((xSeed * chunkX + zSeed * chunkZ) ^ worldSeed);
for (IWorldGenerator generator : worldGenerators)
{
generator.generate(fmlRandom, chunkX, chunkZ, data);
}
}
public void registerTickHandler(ITickHandler handler)
{
registerScheduledTickHandler(new SingleIntervalHandler(handler));
}
public void registerScheduledTickHandler(IScheduledTickHandler handler)
{
tickHandlers.add(new TickQueueElement(handler));
}
public void registerWorldGenerator(IWorldGenerator generator)
{
worldGenerators.add(generator);
}
}
@@ -1,66 +0,0 @@
package cpw.mods.fml.common;
/**
* Copied from ConsoleLogFormatter for shared use on the client
*
*/
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import java.util.logging.Formatter;
import java.util.logging.Level;
import java.util.logging.LogRecord;
final class FMLLogFormatter extends Formatter
{
private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public String format(LogRecord record)
{
StringBuilder msg = new StringBuilder();
msg.append(this.dateFormat.format(Long.valueOf(record.getMillis())));
Level lvl = record.getLevel();
if (lvl == Level.FINEST)
{
msg.append(" [FINEST] ");
}
else if (lvl == Level.FINER)
{
msg.append(" [FINER] ");
}
else if (lvl == Level.FINE)
{
msg.append(" [FINE] ");
}
else if (lvl == Level.INFO)
{
msg.append(" [INFO] ");
}
else if (lvl == Level.WARNING)
{
msg.append(" [WARNING] ");
}
else if (lvl == Level.SEVERE)
{
msg.append(" [SEVERE] ");
}
else if (lvl == Level.SEVERE)
{
msg.append(" [" + lvl.getLocalizedName() + "] ");
}
msg.append(record.getMessage());
msg.append(System.getProperty("line.separator"));
Throwable thr = record.getThrown();
if (thr != null)
{
StringWriter thrDump = new StringWriter();
thr.printStackTrace(new PrintWriter(thrDump));
msg.append(thrDump.toString());
}
return msg.toString();
}
}
@@ -1,392 +0,0 @@
/*
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class FMLModContainer implements ModContainer
{
private Mod modDescriptor;
private Object modInstance;
private File source;
private ModMetadata modMetadata;
public FMLModContainer(String dummy)
{
this(new File(dummy));
}
public FMLModContainer(File source)
{
this.source = source;
}
public FMLModContainer(Class<?> clazz)
{
if (clazz == null)
{
return;
}
modDescriptor = clazz.getAnnotation(Mod.class);
try
{
modInstance = clazz.newInstance();
}
catch (Exception e)
{
throw new RuntimeException(e);
}
}
@Override
public boolean wantsPreInit()
{
return modDescriptor.wantsPreInit();
}
@Override
public boolean wantsPostInit()
{
return modDescriptor.wantsPostInit();
}
@Override
public void preInit()
{
}
@Override
public void init()
{
// TODO Auto-generated method stub
}
@Override
public void postInit()
{
// TODO Auto-generated method stub
}
public static ModContainer buildFor(Class<?> clazz)
{
return new FMLModContainer(clazz);
}
@Override
public String getName()
{
// TODO Auto-generated method stub
return null;
}
@Override
public ModState getModState()
{
// TODO Auto-generated method stub
return null;
}
@Override
public void nextState()
{
// TODO Auto-generated method stub
}
@Override
public String getSortingRules()
{
// TODO Auto-generated method stub
return null;
}
@Override
public boolean matches(Object mod)
{
// TODO Auto-generated method stub
return false;
}
@Override
public File getSource()
{
return source;
}
@Override
public Object getMod()
{
// TODO Auto-generated method stub
return null;
}
@Override
public int lookupFuelValue(int itemId, int itemDamage)
{
// TODO Auto-generated method stub
return 0;
}
@Override
public boolean wantsPickupNotification()
{
// TODO Auto-generated method stub
return false;
}
@Override
public IPickupNotifier getPickupNotifier()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#wantsToDispense()
*/
@Override
public boolean wantsToDispense()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getDispenseHandler()
*/
@Override
public IDispenseHandler getDispenseHandler()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#wantsCraftingNotification()
*/
@Override
public boolean wantsCraftingNotification()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getCraftingHandler()
*/
@Override
public ICraftingHandler getCraftingHandler()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getDependencies()
*/
@Override
public List<String> getDependencies()
{
// TODO Auto-generated method stub
return new ArrayList<String>(0);
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getPreDepends()
*/
@Override
public List<String> getPreDepends()
{
// TODO Auto-generated method stub
return new ArrayList<String>(0);
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getPostDepends()
*/
@Override
public List<String> getPostDepends()
{
// TODO Auto-generated method stub
return new ArrayList<String>(0);
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString()
{
return getSource().getName();
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#wantsNetworkPackets()
*/
@Override
public boolean wantsNetworkPackets()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getNetworkHandler()
*/
@Override
public INetworkHandler getNetworkHandler()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#ownsNetworkChannel(java.lang.String)
*/
@Override
public boolean ownsNetworkChannel(String channel)
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#wantsConsoleCommands()
*/
@Override
public boolean wantsConsoleCommands()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getConsoleHandler()
*/
@Override
public IConsoleHandler getConsoleHandler()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#wantsPlayerTracking()
*/
@Override
public boolean wantsPlayerTracking()
{
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getPlayerTracker()
*/
@Override
public IPlayerTracker getPlayerTracker()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getKeys()
*/
@Override
public List<IKeyHandler> getKeys()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getSourceType()
*/
@Override
public SourceType getSourceType()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#setSourceType(cpw.mods.fml.common.ModContainer.SourceType)
*/
@Override
public void setSourceType(SourceType type)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getMetadata()
*/
@Override
public ModMetadata getMetadata()
{
return modMetadata;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#setMetadata(cpw.mods.fml.common.ModMetadata)
*/
@Override
public void setMetadata(ModMetadata meta)
{
this.modMetadata=meta;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#gatherRenderers(java.util.Map)
*/
@Override
public void gatherRenderers(Map renderers)
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#requestAnimations()
*/
@Override
public void requestAnimations()
{
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getVersion()
*/
@Override
public String getVersion()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#findSidedProxy()
*/
@Override
public ProxyInjector findSidedProxy()
{
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#keyBindEvernt(java.lang.Object)
*/
@Override
public void keyBindEvent(Object keyBinding)
{
// TODO Auto-generated method stub
}
}
@@ -1,77 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
import java.util.Arrays;
/**
* @author cpw
*
*/
public class FMLModLoaderContainer extends FMLModContainer
{
/**
* @param dummy
*/
public FMLModLoaderContainer()
{
super("Forge Mod Loader");
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.FMLModContainer#getMetadata()
*/
@Override
public ModMetadata getMetadata()
{
if (super.getMetadata()==null) {
ModMetadata md=new ModMetadata(this);
setMetadata(md);
md.name="Forge Mod Loader";
md.version=Loader.instance().getFMLVersionString();
md.credits="Made possible with help from many people";
md.authorList=Arrays.asList("cpw, LexManos");
md.description="The Forge Mod Loader provides the ability for systems to load mods " +
"from the file system. It also provides key capabilities for mods to be able " +
"to cooperate and provide a good modding environment. " +
"The mod loading system is compatible with ModLoader, all your ModLoader " +
"mods should work.";
md.url="https://github.com/cpw/FML/wiki";
md.updateUrl="https://github.com/cpw/FML/wiki";
md.screenshots=new String[0];
md.logoFile="";
}
return super.getMetadata();
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.FMLModContainer#getName()
*/
@Override
public String getName()
{
return "Forge Mod Loader";
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.FMLModContainer#getVersion()
*/
@Override
public String getVersion()
{
return Loader.instance().getFMLVersionString();
}
}
@@ -1,24 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
/**
* @author cpw
*
*/
public interface IConsoleHandler
{
public boolean handleCommand(String command, Object... data);
}
@@ -1,40 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
/**
* Return a crafting handler for the mod container to call
*
* @author cpw
*
*/
public interface ICraftingHandler
{
/**
* The object array contains these three arguments
*
* @param player
* @param craftedItem
* @param craftingGrid
*/
void onCrafting(Object... craftingParameters);
/**
* The object array contains these two arguments
* @param player
* @param smeltedItem
*/
void onSmelting(Object... smeltingParameters);
}
@@ -1,20 +0,0 @@
/*
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
public interface IDispenseHandler
{
boolean dispense(double x, double y, double z, byte xVelocity, byte zVelocity, Object... data);
}
@@ -1,30 +0,0 @@
package cpw.mods.fml.common;
import java.io.File;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.util.List;
import java.util.Properties;
import java.util.logging.Logger;
import cpw.mods.fml.common.modloader.BaseMod;
import cpw.mods.fml.common.modloader.ModProperty;
public interface IFMLSidedHandler
{
Logger getMinecraftLogger();
File getMinecraftRootDirectory();
boolean isModLoaderMod(Class<?> clazz);
ModContainer loadBaseModMod(Class<?> clazz, File canonicalFile);
Object getMinecraftInstance();
String getCurrentLanguage();
Properties getCurrentLanguageTable();
String getObjectName(Object minecraftObject);
ModMetadata readMetadataFrom(InputStream input, ModContainer mod) throws Exception;
void profileStart(String profileLabel);
void profileEnd();
ModProperty getModLoaderPropertyFor(Field f);
List<String> getAdditionalBrandingInformation();
Side getSide();
ProxyInjector findSidedProxyOn(BaseMod mod);
}
@@ -1,33 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
/**
* @author cpw
*
*/
public interface IKeyHandler
{
Object getKeyBinding();
/**
* @return
*/
ModContainer getOwningContainer();
void onEndTick();
}
@@ -1,26 +0,0 @@
/*
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
/**
* @author cpw
*
*/
public interface INetworkHandler
{
boolean onChat(Object... data);
void onPacket250Packet(Object... data);
void onServerLogin(Object handler);
}
@@ -1,19 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
public interface IPickupNotifier
{
void notifyPickup(Object... pickupData);
}
@@ -1,26 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
/**
* @author cpw
*
*/
public interface IPlayerTracker
{
void onPlayerLogin(Object player);
void onPlayerLogout(Object player);
void onPlayerChangedDimension(Object player);
}
@@ -1,13 +0,0 @@
package cpw.mods.fml.common;
public interface IScheduledTickHandler extends ITickHandler
{
/**
* Return the number of actual ticks that will pass
* before your next tick will fire. This will be called
* just after your last tick fired to compute the next delay.
* @param tick
* @return
*/
public int nextTickSpacing();
}
@@ -1,64 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
import java.util.EnumSet;
/**
*
* Tick handler for mods to implement and register through the TickRegistry
*
* The data available to each tick is documented in the TickType
*
* @author cpw
*
*/
public interface ITickHandler
{
/**
* Called at the "start" phase of a tick
*
* Multiple ticks may fire simultaneously- you will only be called once with all the firing ticks
*
* @param type
* @param tickData
*/
public void tickStart(EnumSet<TickType> type, Object... tickData);
/**
* Called at the "end" phase of a tick
*
* Multiple ticks may fire simultaneously- you will only be called once with all the firing ticks
*
* @param type
* @param tickData
*/
public void tickEnd(EnumSet<TickType> type, Object... tickData);
/**
* Returns the list of ticks this tick handler is interested in receiving at the minute
*
* @return
*/
public EnumSet<TickType> ticks();
/**
* A profiling label for this tick handler
* @return
*/
public String getLabel();
}
@@ -1,39 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
import java.util.Random;
/**
* This is called back during world generation. The {@link #generate(Random, int, int, Object...)} method passes in some additional data that
* can be cast into minecraft objects.
*
* @author cpw
*
*/
public interface IWorldGenerator
{
/**
* Generate some world
*
* @param random the chunk specific {@link Random}.
* @param chunkX the block X coordinate of this chunk.
* @param chunkZ the block Z coordinate of this chunk.
* @param world : additionalData[0] The minecraft {@link World} we're generating for.
* @param generator : additionalData[1] The {@link IChunkProvider} that is generating.
* @param chunkProvider : additionalData[2] {@link IChunkProvider} that is requesting the world generation.
*
*/
public void generate(Random random, int chunkX, int chunkZ, Object...additionalData);
}
-674
View File
@@ -1,674 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import cpw.mods.fml.common.ModContainer.SourceType;
import cpw.mods.fml.common.toposort.ModSorter;
import cpw.mods.fml.common.toposort.TopologicalSort;
/**
* The loader class performs the actual loading of the mod code from disk.
*
* <p>There are several {@link State}s to mod loading, triggered in two different stages from the FML handler code's hooks into the
* minecraft code.</p>
*
* <ol>
* <li>LOADING. Scanning the filesystem for mod containers to load (zips, jars, directories), adding them to the {@link #modClassLoader}
* Scanning, the loaded containers for mod classes to load and registering them appropriately.</li>
* <li>PREINIT. The mod classes are configured, they are sorted into a load order, and instances of the mods are constructed.</li>
* <li>INIT. The mod instances are initialized. For BaseMod mods, this involves calling the load method.</li>
* <li>POSTINIT. The mod instances are post initialized. For BaseMod mods this involves calling the modsLoaded method.</li>
* <li>UP. The Loader is complete</li>
* <li>ERRORED. The loader encountered an error during the LOADING phase and dropped to this state instead. It will not complete
* loading from this state, but it attempts to continue loading before abandoning and giving a fatal error.</li>
* </ol>
*
* Phase 1 code triggers the LOADING and PREINIT states. Phase 2 code triggers the INIT and POSTINIT states.
*
* @author cpw
*
*/
public class Loader
{
private static Pattern zipJar = Pattern.compile("(.+).(zip|jar)$");
private static Pattern modClass = Pattern.compile("(.+/|)(mod\\_[^\\s$]+).class$");
/**
* The state enum used to help track state progression for the loader
* @author cpw
*
*/
private enum State
{
NOINIT, LOADING, PREINIT, INIT, POSTINIT, UP, ERRORED
};
/**
* The singleton instance
*/
private static Loader instance;
/**
* Our special logger for logging issues to. We copy various assets from the Minecraft logger to acheive a similar appearance.
*/
public static Logger log = Logger.getLogger("ForgeModLoader");
/**
* Build information for tracking purposes.
*/
private static String major;
private static String minor;
private static String rev;
private static String build;
private static String mcversion;
/**
* The {@link State} of the loader
*/
private State state;
/**
* The class loader we load the mods into.
*/
private ModClassLoader modClassLoader;
/**
* The sorted list of mods.
*/
private List<ModContainer> mods;
/**
* A named list of mods
*/
private Map<String, ModContainer> namedMods;
/**
* The canonical configuration directory
*/
private File canonicalConfigDir;
/**
* The canonical minecraft directory
*/
private File canonicalMinecraftDir;
private Exception capturedError;
public static Loader instance()
{
if (instance == null)
{
instance = new Loader();
}
return instance;
}
private Loader()
{
FMLLogFormatter formatter=new FMLLogFormatter();
if (FMLCommonHandler.instance().getMinecraftLogger()!=null) {
Loader.log.setParent(FMLCommonHandler.instance().getMinecraftLogger());
} else {
ConsoleHandler ch=new ConsoleHandler();
Loader.log.setUseParentHandlers(false);
Loader.log.addHandler(ch);
ch.setFormatter(formatter);
}
Loader.log.setLevel(Level.ALL);
try
{
File logPath=new File(FMLCommonHandler.instance().getMinecraftRootDirectory().getCanonicalPath(),"ForgeModLoader-%g.log");
FileHandler fileHandler = new FileHandler(logPath.getPath(), 0, 3);
// We're stealing minecraft's log formatter
fileHandler.setFormatter(new FMLLogFormatter());
fileHandler.setLevel(Level.ALL);
Loader.log.addHandler(fileHandler);
}
catch (Exception e)
{
// Whatever - give up
}
InputStream stream = Loader.class.getClassLoader().getResourceAsStream("fmlversion.properties");
Properties properties = new Properties();
if (stream != null) {
try {
properties.load(stream);
major = properties.getProperty("fmlbuild.major.number","none");
minor = properties.getProperty("fmlbuild.minor.number","none");
rev = properties.getProperty("fmlbuild.revision.number","none");
build = properties.getProperty("fmlbuild.build.number","none");
mcversion = properties.getProperty("fmlbuild.mcversion","none");
} catch (IOException ex) {
Loader.log.log(Level.SEVERE,"Could not get FML version information - corrupted installation detected!", ex);
throw new LoaderException(ex);
}
}
log.info(String.format("Forge Mod Loader version %s.%s.%s.%s for Minecraft %s loading", major, minor, rev, build, mcversion));
modClassLoader = new ModClassLoader();
}
/**
* Sort the mods into a sorted list, using dependency information from the containers. The sorting is performed
* using a {@link TopologicalSort} based on the pre- and post- dependency information provided by the mods.
*/
private void sortModList()
{
log.fine("Verifying mod dependencies are satisfied");
for (ModContainer mod : mods)
{
if (!namedMods.keySet().containsAll(mod.getDependencies()))
{
log.severe(String.format("The mod %s requires mods %s to be available, one or more are not", mod.getName(), mod.getDependencies()));
LoaderException le = new LoaderException();
log.throwing("Loader", "sortModList", le);
throw new LoaderException();
}
}
log.fine("All dependencies are satisfied");
ModSorter sorter = new ModSorter(mods, namedMods);
try
{
log.fine("Sorting mods into an ordered list");
mods = sorter.sort();
log.fine("Sorted mod list:");
for (ModContainer mod : mods)
{
log.fine(String.format("\t%s: %s (%s)", mod.getName(), mod.getSource().getName(), mod.getSortingRules()));
}
}
catch (IllegalArgumentException iae)
{
log.severe("A dependency cycle was detected in the input mod set so they cannot be loaded in order");
log.throwing("Loader", "sortModList", iae);
throw new LoaderException(iae);
}
}
/**
* The first mod initialization stage, performed immediately after the jar files and mod classes are loaded,
* {@link State#PREINIT}. The mods are configured from their configuration data and instantiated (for BaseMod mods).
*/
private void preModInit()
{
state = State.PREINIT;
log.fine("Beginning mod pre-initialization");
for (ModContainer mod : mods)
{
if (mod.wantsPreInit())
{
log.finer(String.format("Pre-initializing %s", mod.getSource()));
mod.preInit();
namedMods.put(mod.getName(), mod);
}
mod.nextState();
}
// Link up mod metadatas
for (ModContainer mod : mods) {
if (mod.getMetadata()!=null) {
mod.getMetadata().associate(namedMods);
}
FMLCommonHandler.instance().injectSidedProxyDelegate(mod);
}
log.fine("Mod pre-initialization complete");
}
/**
* The main mod initialization stage, performed on the sorted mod list.
*/
private void modInit()
{
state = State.INIT;
log.fine("Beginning mod initialization");
for (ModContainer mod : mods)
{
log.finer(String.format("Initializing %s", mod.getName()));
mod.init();
mod.nextState();
}
log.fine("Mod initialization complete");
}
private void postModInit()
{
state = State.POSTINIT;
log.fine("Beginning mod post-initialization");
for (ModContainer mod : mods)
{
if (mod.wantsPostInit())
{
log.finer(String.format("Post-initializing %s", mod.getName()));
mod.postInit();
mod.nextState();
}
}
log.fine("Mod post-initialization complete");
}
/**
* The primary loading code
*
* This is visited during first initialization by Minecraft to scan and load the mods
* from all sources
* 1. The minecraft jar itself (for loading of in jar mods- I would like to remove this if possible but forge depends on it at present)
* 2. The mods directory with expanded subdirs, searching for mods named mod_*.class
* 3. The mods directory for zip and jar files, searching for mod classes named mod_*.class again
*
* The found resources are first loaded into the {@link #modClassLoader} (always) then scanned for class resources matching the specification above.
*
* If they provide the {@link Mod} annotation, they will be loaded as "FML mods", which currently is effectively a NO-OP.
* If they are determined to be {@link BaseMod} subclasses they are loaded as such.
*
* Finally, if they are successfully loaded as classes, they are then added to the available mod list.
*/
private void load()
{
File minecraftDir = FMLCommonHandler.instance().getMinecraftRootDirectory();
File modsDir = new File(minecraftDir, "mods");
File configDir = new File(minecraftDir, "config");
String canonicalModsPath;
String canonicalConfigPath;
try
{
canonicalMinecraftDir = minecraftDir.getCanonicalFile();
canonicalModsPath = modsDir.getCanonicalPath();
canonicalConfigPath = configDir.getCanonicalPath();
canonicalConfigDir = configDir.getCanonicalFile();
}
catch (IOException ioe)
{
log.severe(String.format("Failed to resolve mods directory mods %s", modsDir.getAbsolutePath()));
log.throwing("fml.server.Loader", "initialize", ioe);
throw new LoaderException(ioe);
}
if (!modsDir.exists())
{
log.fine(String.format("No mod directory found, creating one: %s", canonicalModsPath));
try
{
modsDir.mkdir();
}
catch (Exception e)
{
log.throwing("fml.server.Loader", "initialize", e);
throw new LoaderException(e);
}
}
if (!configDir.exists())
{
log.fine(String.format("No config directory found, creating one: %s", canonicalConfigPath));
try
{
configDir.mkdir();
}
catch (Exception e)
{
log.throwing("fml.server.Loader", "initialize", e);
throw new LoaderException(e);
}
}
if (!modsDir.isDirectory())
{
log.severe(String.format("Attempting to load mods from %s, which is not a directory", canonicalModsPath));
LoaderException loaderException = new LoaderException();
log.throwing("fml.server.Loader", "initialize", loaderException);
throw loaderException;
}
if (!configDir.isDirectory())
{
log.severe(String.format("Attempting to load configuration from %s, which is not a directory", canonicalConfigPath));
LoaderException loaderException = new LoaderException();
log.throwing("fml.server.Loader", "initialize", loaderException);
throw loaderException;
}
state = State.LOADING;
log.fine("Attempting to load mods contained in the minecraft jar file and associated classes");
File[] minecraftSources=modClassLoader.getParentSources();
if (minecraftSources.length==1 && minecraftSources[0].isFile()) {
log.fine(String.format("Minecraft is a file at %s, loading",minecraftSources[0].getAbsolutePath()));
attemptFileLoad(minecraftSources[0], SourceType.CLASSPATH);
} else {
for (int i=0; i<minecraftSources.length; i++) {
if (minecraftSources[i].isFile()) {
log.fine(String.format("Found a minecraft related file at %s, loading",minecraftSources[i].getAbsolutePath()));
attemptFileLoad(minecraftSources[i], SourceType.CLASSPATH);
} else if (minecraftSources[i].isDirectory()) {
log.fine(String.format("Found a minecraft related directory at %s, loading",minecraftSources[i].getAbsolutePath()));
attemptDirLoad(minecraftSources[i],"",SourceType.CLASSPATH);
}
}
}
log.fine("Minecraft jar mods loaded successfully");
log.info(String.format("Loading mods from %s", canonicalModsPath));
File[] modList = modsDir.listFiles();
// Sort the files into alphabetical order first
Arrays.sort(modList);
for (File modFile : modList)
{
if (modFile.isDirectory())
{
log.fine(String.format("Found a directory %s, attempting to load it", modFile.getName()));
boolean modFound = attemptDirLoad(modFile,"", SourceType.DIR);
if (modFound)
{
log.fine(String.format("Directory %s loaded successfully", modFile.getName()));
}
else
{
log.info(String.format("Directory %s contained no mods", modFile.getName()));
}
}
else
{
Matcher matcher = zipJar.matcher(modFile.getName());
if (matcher.matches())
{
log.fine(String.format("Found a zip or jar file %s, attempting to load it", matcher.group(0)));
boolean modFound = attemptFileLoad(modFile, SourceType.JAR);
if (modFound)
{
log.fine(String.format("File %s loaded successfully", matcher.group(0)));
}
else
{
log.info(String.format("File %s contained no mods", matcher.group(0)));
}
}
}
}
if (state == State.ERRORED)
{
log.severe("A problem has occured during mod loading. Likely a corrupt jar is located in your mods directory");
throw new LoaderException(capturedError);
}
log.info(String.format("Forge Mod Loader has loaded %d mods", mods.size()));
}
private boolean attemptDirLoad(File modDir, String path, SourceType sourceType)
{
if (path.length()==0) {
extendClassLoader(modDir);
}
boolean foundAModClass = false;
File[] content = modDir.listFiles(new FileFilter()
{
@Override
public boolean accept(File file)
{
return (file.isFile() && modClass.matcher(file.getName()).find()) || file.isDirectory();
}
});
// Always sort our content
Arrays.sort(content);
for (File file : content)
{
if (file.isDirectory()) {
log.finest(String.format("Recursing into package %s", path+file.getName()));
foundAModClass|=attemptDirLoad(file,path+file.getName()+".", sourceType);
continue;
}
Matcher fname = modClass.matcher(file.getName());
if (!fname.find()) {
continue;
}
String clazzName=path+fname.group(2);
try
{
log.fine(String.format("Found a mod class %s in directory %s, attempting to load it", clazzName, modDir.getName()));
loadModClass(modDir, file.getName(), clazzName, sourceType);
log.fine(String.format("Successfully loaded mod class %s", file.getName()));
foundAModClass = true;
}
catch (Exception e)
{
log.severe(String.format("File %s failed to read properly", file.getName()));
log.throwing("fml.server.Loader", "attemptDirLoad", e);
state = State.ERRORED;
capturedError = e;
}
}
return foundAModClass;
}
private void loadModClass(File classSource, String classFileName, String clazzName, SourceType sourceType)
{
try
{
Class<?> clazz = Class.forName(clazzName, false, modClassLoader);
ModContainer mod=null;
if (clazz.isAnnotationPresent(Mod.class))
{
// an FML mod
log.severe("Currently, the FML mod type is disabled");
throw new LoaderException();
// log.fine(String.format("FML mod class %s found, loading", clazzName));
// mod = FMLModContainer.buildFor(clazz);
// log.fine(String.format("FML mod class %s loaded", clazzName));
}
else if (FMLCommonHandler.instance().isModLoaderMod(clazz))
{
log.fine(String.format("ModLoader BaseMod class %s found, loading", clazzName));
mod = FMLCommonHandler.instance().loadBaseModMod(clazz, classSource.getCanonicalFile());
log.fine(String.format("ModLoader BaseMod class %s loaded", clazzName));
}
else
{
// Unrecognized
}
if (mod!=null) {
mod.setSourceType(sourceType);
FMLCommonHandler.instance().loadMetadataFor(mod);
mods.add(mod);
mod.nextState();
}
}
catch (Throwable e)
{
log.warning(String.format("Failed to load mod class %s in %s", classFileName, classSource.getAbsoluteFile()));
log.throwing("fml.server.Loader", "attemptLoad", e);
throw new LoaderException(e);
}
}
private void extendClassLoader(File file)
{
try
{
modClassLoader.addFile(file);
}
catch (MalformedURLException e)
{
throw new LoaderException(e);
}
}
private boolean attemptFileLoad(File modFile, SourceType sourceType)
{
extendClassLoader(modFile);
boolean foundAModClass = false;
ZipFile jar = null;
try
{
jar = new ZipFile(modFile);
for (ZipEntry ze : Collections.list(jar.entries()))
{
Matcher match = modClass.matcher(ze.getName());
if (match.matches())
{
String pkg = match.group(1).replace('/', '.');
String clazzName = pkg + match.group(2);
log.fine(String.format("Found a mod class %s in file %s, attempting to load it", clazzName, modFile.getName()));
loadModClass(modFile, ze.getName(), clazzName, sourceType);
log.fine(String.format("Mod class %s loaded successfully", clazzName, modFile.getName()));
foundAModClass = true;
}
}
}
catch (Exception e)
{
log.severe(String.format("Zip file %s failed to read properly", modFile.getName()));
log.throwing("fml.server.Loader", "attemptFileLoad", e);
state = State.ERRORED;
capturedError = e;
}
finally
{
if (jar != null)
{
try
{
jar.close();
}
catch (Exception e)
{
}
}
}
return foundAModClass;
}
public static List<ModContainer> getModList()
{
return instance().mods;
}
/**
* Called from the hook to start mod loading. We trigger the {@link #load()} and {@link #preModInit()} phases here.
* Finally, the mod list is frozen completely and is consider immutable from then on.
*/
public void loadMods()
{
state = State.NOINIT;
mods = new ArrayList<ModContainer>();
namedMods = new HashMap<String, ModContainer>();
load();
preModInit();
sortModList();
// Make mod list immutable
mods = Collections.unmodifiableList(mods);
}
/**
* Complete the initialization of the mods {@link #initializeMods()} and {@link #postModInit()} and mark ourselves up and ready to run.
*/
public void initializeMods()
{
modInit();
postModInit();
for (ModContainer mod : getModList()) {
mod.nextState();
}
state = State.UP;
log.info(String.format("Forge Mod Loader load complete, %d mods loaded", mods.size()));
}
/**
* Query if we know of a mod named modname
*
* @param modname
* @return
*/
public static boolean isModLoaded(String modname)
{
return instance().namedMods.containsKey(modname);
}
/**
* @return
*/
public File getConfigDir()
{
return canonicalConfigDir;
}
public String getCrashInformation()
{
StringBuffer ret = new StringBuffer();
for (String brand : FMLCommonHandler.instance().getBrandingStrings(String.format("Forge Mod Loader version %s.%s.%s.%s for Minecraft %s", major, minor, rev, build, mcversion))) {
ret.append(brand).append("\n");
}
for (ModContainer mod : mods)
{
ret.append(String.format("\t%s : %s (%s)\n",mod.getName(), mod.getModState(), mod.getSource().getName()));
}
return ret.toString();
}
/**
* @return
*/
public String getFMLVersionString()
{
return String.format("FML v%s.%s.%s.%s", major, minor, rev, build);
}
/**
* @return
*/
public ClassLoader getModClassLoader()
{
return modClassLoader;
}
}
@@ -1,31 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
public class LoaderException extends RuntimeException
{
/**
*
*/
private static final long serialVersionUID = -5675297950958861378L;
public LoaderException(Throwable wrapped)
{
super(wrapped);
}
public LoaderException()
{
}
}
-35
View File
@@ -1,35 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* A possible future way to indicate mods to the system is to use an annotation style
*
* @author cpw
*
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface Mod
{
String name() default "";
String version() default "";
boolean wantsPreInit() default false;
boolean wantsPostInit() default false;
public @interface PreInit {}
public @interface Init {}
public @interface PostInit {}
}
@@ -1,79 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
import java.io.File;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
/**
* A simple delegating class loader used to load mods into the system
*
*
* @author cpw
*
*/
public class ModClassLoader extends URLClassLoader
{
public ModClassLoader()
{
super(new URL[0], ModClassLoader.class.getClassLoader());
}
public ModClassLoader(ClassLoader parent) {
super(new URL[0], null);
}
public void addFile(File modFile) throws MalformedURLException
{
ClassLoader cl=getParent();
if (cl instanceof URLClassLoader) {
URLClassLoader ucl=(URLClassLoader) cl;
URL url = modFile.toURI().toURL();
try {
Method addUrl=URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
addUrl.setAccessible(true);
addUrl.invoke(ucl, url);
} catch (Exception e) {
Loader.log.severe("A fatal error occured attempting to load a file into the classloader");
throw new LoaderException(e);
}
}
}
public File[] getParentSources() {
ClassLoader cl=getParent();
if (cl instanceof URLClassLoader) {
URLClassLoader ucl=(URLClassLoader) cl;
URL[] pUrl=ucl.getURLs();
File[] sources=new File[pUrl.length];
try
{
for (int i=0; i<pUrl.length; i++) {
sources[i]=new File(pUrl[i].toURI());
}
return sources;
}
catch (URISyntaxException e)
{
Loader.log.throwing("ModClassLoader", "getParentSources", e);
}
}
Loader.log.severe("Unable to process our input to locate the minecraft code");
throw new LoaderException();
}
}
@@ -1,213 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
import java.io.File;
import java.util.List;
import java.util.Map;
import cpw.mods.fml.common.ModContainer.SourceType;
/**
* The container that wraps around mods in the system.
* <p>The philosophy is that individual mod implementation technologies should not impact the actual loading and management
* of mod code. This interface provides a mechanism by which we can wrap actual mod code so that the loader and other
* facilities can treat mods at arms length.</p>
*
* @author cpw
*
*/
public interface ModContainer
{
public enum ModState {
UNLOADED("Unloaded"), LOADED("Loaded"), PREINITIALIZED("Pre-initialized"), INITIALIZED("Initialized"), POSTINITIALIZED("Post-initialized"), AVAILABLE("Available");
private String label;
private ModState(String label) {
this.label=label;
}
public String toString() {
return this.label;
}
}
public enum SourceType {
JAR, CLASSPATH, DIR;
}
/**
* The enclosed mod wants to be called during pre-initialization.
* @return
*/
boolean wantsPreInit();
/**
* The enclosed mod wants to be called during post-initialization.
* @return
*/
boolean wantsPostInit();
/**
* Called when pre-initialization occurs.
*/
void preInit();
/**
* Called when main initialization occurs.
*/
void init();
/**
* Called when post-initialization occurs.
*/
void postInit();
/**
* The name of the mod
* @return
*/
String getName();
/**
* The state of the mod
* @return
*/
ModState getModState();
/**
* Move to the next mod state
*/
void nextState();
/**
* Does this mod match the supplied mod?
* @param mod
* @return
*/
boolean matches(Object mod);
/**
* The source of this mod: the file on the file system
* @return
*/
File getSource();
/**
* Returns the sorting rules as a string for printing
* @return
*/
String getSortingRules();
/**
* The actual mod object itself
* @return
*/
Object getMod();
/**
* Lookup the fuel value for the supplied item/damage with this mod.
* @param itemId
* @param itemDamage
* @return
*/
int lookupFuelValue(int itemId, int itemDamage);
/**
* This mod wants to be notified when an object is picked up.
* @return
*/
boolean wantsPickupNotification();
/**
* The pickup notifier for this mod.
* @return
*/
IPickupNotifier getPickupNotifier();
/**
* This mod wants to have special dispenser handling.
* @return
*/
boolean wantsToDispense();
/**
* The dispensing handler.
* @return
*/
IDispenseHandler getDispenseHandler();
/**
* This mod wants notification of crafting and/or smelting events.
* @return
*/
boolean wantsCraftingNotification();
/**
* The crafting and smelting handler for this mod.
* @return
*/
ICraftingHandler getCraftingHandler();
/**
* The strong dependencies of this mod. If the named mods in this list are not present, the game will abort.
* @return
*/
List<String> getDependencies();
/**
* Get a list of mods to load before this one. The special value "*" indicates to load <i>after</i> all other mods (except other "*" mods).
* @return
*/
List<String> getPreDepends();
/**
* Get a list of mods to load after this one. The special value "*" indicates to load <i>before</i> all other mods (except other "*" mods).
* @return
*/
List<String> getPostDepends();
/**
* This mod wants packets from the client, and wants them handled by FML.
* @return
*/
boolean wantsNetworkPackets();
/**
* The network handler for this mod.
* @return
*/
INetworkHandler getNetworkHandler();
/**
* Does this mod own this channel?
* @param channel
* @return
*/
boolean ownsNetworkChannel(String channel);
/**
* Does this mod want commands from the console?
* @return
*/
boolean wantsConsoleCommands();
IConsoleHandler getConsoleHandler();
boolean wantsPlayerTracking();
IPlayerTracker getPlayerTracker();
List<IKeyHandler> getKeys();
SourceType getSourceType();
void setSourceType(SourceType type);
ModMetadata getMetadata();
void setMetadata(ModMetadata meta);
/**
*
*/
void gatherRenderers(Map renderers);
/**
*
*/
void requestAnimations();
/**
* @return
*/
String getVersion();
/**
* @return
*/
ProxyInjector findSidedProxy();
void keyBindEvent(Object keyBinding);
}
-104
View File
@@ -1,104 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipInputStream;
import cpw.mods.fml.common.modloader.ModLoaderModContainer;
/**
* @author cpw
*
*/
public class ModMetadata
{
public enum ModType { MODLOADER, FML };
public ModContainer mod;
public ModType type;
public String name;
public String description;
public String url="";
public String updateUrl="";
public String logoFile="";
public String version="";
public List<String> authorList=new ArrayList<String>(1);
public String credits="";
public String parent="";
public String[] screenshots;
public ModContainer parentMod;
public List<ModContainer> childMods = new ArrayList<ModContainer>(1);
/**
* @param mod2
* @param type2
*/
public ModMetadata(ModContainer mod)
{
this.mod=mod;
this.type=(mod instanceof FMLModContainer ? ModType.FML : ModType.MODLOADER);
}
public void associate(Map<String, ModContainer> mods) {
if (parent!=null && parent.length() > 0) {
ModContainer mc=mods.get(parent);
if (mc!=null && mc.getMetadata()!=null) {
mc.getMetadata().childMods.add(mod);
parentMod = mc;
}
}
}
/**
* @return
*/
public String getChildModCountString()
{
return String.format("%d child mod%s", childMods.size(), childMods.size()!=1 ? "s" : "");
}
public String getAuthorList() {
StringBuilder sb=new StringBuilder();
for (int i=0; i<authorList.size(); i++) {
sb.append(authorList.get(i));
if (i<authorList.size()-1) {
sb.append(", ");
}
}
return sb.toString();
}
/**
* @return
*/
public String getChildModList()
{
StringBuilder sb=new StringBuilder();
for (int i=0; i<childMods.size(); i++) {
sb.append(childMods.get(i).getMetadata().name);
if (i<childMods.size()-1) {
sb.append(", ");
}
}
return sb.toString();
}
}
@@ -1,76 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
import java.lang.reflect.Field;
/**
* @author cpw
*
*/
public class ProxyInjector
{
private String clientName;
private String serverName;
private String bukkitName;
private Field target;
public ProxyInjector(String clientName, String serverName, String bukkitName, Field target)
{
this.clientName = clientName;
this.serverName = serverName;
this.bukkitName = bukkitName;
this.target = target;
}
public boolean isValidFor(Side type)
{
if (type == Side.CLIENT)
{
return !this.clientName.isEmpty();
}
else if (type == Side.SERVER)
{
return !this.serverName.isEmpty();
}
else if (type == Side.BUKKIT)
{
return this.bukkitName.isEmpty();
}
return false;
}
public void inject(ModContainer mod, Side side)
{
String targetType = side == Side.CLIENT ? clientName : serverName;
try
{
Object proxy=Class.forName(targetType, false, Loader.instance().getModClassLoader()).newInstance();
if (target.getType().isAssignableFrom(proxy.getClass()))
{
target.set(mod.getMod(), proxy);
} else {
FMLCommonHandler.instance().getFMLLogger().severe(String.format("Attempted to load a proxy type %s into %s, but the types don't match", targetType, target.getName()));
throw new LoaderException();
}
}
catch (Exception e)
{
FMLCommonHandler.instance().getFMLLogger().severe(String.format("An error occured trying to load a proxy type %s into %s", targetType, target.getName()));
FMLCommonHandler.instance().getFMLLogger().throwing("ProxyInjector", "inject", e);
throw new LoaderException(e);
}
}
}
@@ -1,105 +0,0 @@
/*
* The FML Forge Mod Loader suite. Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
/**
* Some reflection helper code.
*
* @author cpw
*
*/
public class ReflectionHelper
{
public static boolean obfuscation;
@SuppressWarnings("unchecked")
public static <T, E> T getPrivateValue(Class <? super E > classToAccess, E instance, int fieldIndex)
{
try
{
Field f = classToAccess.getDeclaredFields()[fieldIndex];
f.setAccessible(true);
return (T) f.get(instance);
}
catch (Exception e)
{
FMLCommonHandler.instance().getFMLLogger().severe(String.format("There was a problem getting field %d from %s", fieldIndex, classToAccess.getName()));
FMLCommonHandler.instance().getFMLLogger().throwing("ReflectionHelper", "getPrivateValue", e);
throw new RuntimeException(e);
}
}
@SuppressWarnings("unchecked")
public static <T, E> T getPrivateValue(Class <? super E > classToAccess, E instance, String fieldName)
{
try
{
Field f = classToAccess.getDeclaredField(fieldName);
f.setAccessible(true);
return (T) f.get(instance);
}
catch (Exception e)
{
if ((fieldName.length() > 3 && !obfuscation) || (fieldName.length() <= 3 && obfuscation)) {
FMLCommonHandler.instance().getFMLLogger().severe(String.format("There was a problem getting field %s from %s", fieldName, classToAccess.getName()));
FMLCommonHandler.instance().getFMLLogger().throwing("ReflectionHelper", "getPrivateValue", e);
}
throw new RuntimeException(e);
}
}
public static <T, E> void setPrivateValue(Class <? super T > classToAccess, T instance, int fieldIndex, E value)
{
try
{
Field f = classToAccess.getDeclaredFields()[fieldIndex];
f.setAccessible(true);
f.set(instance, value);
}
catch (Exception e)
{
FMLCommonHandler.instance().getFMLLogger().severe(String.format("There was a problem setting field %d from %s", fieldIndex, classToAccess.getName()));
FMLCommonHandler.instance().getFMLLogger().throwing("ReflectionHelper", "getPrivateValue", e);
throw new RuntimeException(e);
}
}
public static <T, E> void setPrivateValue(Class <? super T > classToAccess, T instance, String fieldName, E value)
{
try
{
Field f = classToAccess.getDeclaredField(fieldName);
f.setAccessible(true);
f.set(instance, value);
}
catch (Exception e)
{
if ((fieldName.length() > 3 && !obfuscation) || (fieldName.length() <= 3 && obfuscation)) {
FMLCommonHandler.instance().getFMLLogger().severe(String.format("There was a problem setting field %s from %s", fieldName, classToAccess.getName()));
FMLCommonHandler.instance().getFMLLogger().throwing("ReflectionHelper", "getPrivateValue", e);
}
throw new RuntimeException(e);
}
}
/**
*
*/
public static void detectObfuscation(Class<?> clazz)
{
obfuscation=!clazz.getSimpleName().equals("World");
}
}
-35
View File
@@ -1,35 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
public enum Side {
CLIENT, SERVER, BUKKIT;
/**
* @return
*/
public boolean isServer()
{
return !isClient();
}
/**
* @return
*/
public boolean isClient()
{
return this == CLIENT;
}
}
@@ -1,43 +0,0 @@
package cpw.mods.fml.common;
import java.util.EnumSet;
public class SingleIntervalHandler implements IScheduledTickHandler
{
private ITickHandler wrapped;
public SingleIntervalHandler(ITickHandler handler)
{
this.wrapped=handler;
}
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData)
{
wrapped.tickStart(type, tickData);
}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData)
{
wrapped.tickEnd(type, tickData);
}
@Override
public EnumSet<TickType> ticks()
{
return wrapped.ticks();
}
@Override
public String getLabel()
{
return wrapped.getLabel();
}
@Override
public int nextTickSpacing()
{
return 1;
}
}
-90
View File
@@ -1,90 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common;
import java.util.EnumSet;
public enum TickType {
/**
* Fired during the world evaluation loop
* server and client side
*
* arg 0 : The world that is ticking
*/
WORLD,
/**
* client side
* Fired during the render processing phase
* arg 0 : float "partial render time"
*/
RENDER,
/**
* client side
* Fired during the render processing phase if a GUI is open
* arg 0 : float "partial render time"
* arg 1 : the open gui
*/
GUI,
/**
* client side
* Fired during the world evaluation loop if a gui is open
* arg 0 : The open gui
*/
WORLDGUI,
/**
* client side
* Fired once as the world loads from disk
*/
WORLDLOAD,
/**
* client side
* Fired once as the world loads from disk
* arg 0 : the open gui
*/
GUILOAD,
/**
* client and server side
* Fired once per "global tick loop"
*/
GAME,
/**
* client and server side.
* Fired whenever the players update loop runs.
* arg 0 : the player
* arg 1 : the world the player is in
*/
PLAYER,
/**
* This is a special internal tick type that is
* not sent to mods. It resets the scheduler for
* the next tick pass.
*/
RESETMARKER;
/**
* Partner ticks that are also cancelled by returning false from onTickInGame
*
* @return
*/
public EnumSet<TickType> partnerTicks()
{
if (this==GAME) return EnumSet.of(RENDER);
if (this==RENDER) return EnumSet.of(GAME);
if (this==GUI) return EnumSet.of(WORLDGUI, GUILOAD);
if (this==WORLDGUI) return EnumSet.of(GUI, GUILOAD);
if (this==GUILOAD) return EnumSet.of(GUI, WORLDGUI);
return EnumSet.noneOf(TickType.class);
}
}
@@ -1,90 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common.modloader;
import java.util.Map;
import cpw.mods.fml.common.IConsoleHandler;
import cpw.mods.fml.common.ICraftingHandler;
import cpw.mods.fml.common.IDispenseHandler;
import cpw.mods.fml.common.INetworkHandler;
import cpw.mods.fml.common.IPickupNotifier;
import cpw.mods.fml.common.IPlayerTracker;
import cpw.mods.fml.common.IWorldGenerator;
import cpw.mods.fml.common.TickType;
/**
*
* Marker interface for BaseMod
*
* @author cpw
*
*/
public interface BaseMod extends IWorldGenerator, IPickupNotifier, IDispenseHandler, ICraftingHandler, INetworkHandler, IConsoleHandler, IPlayerTracker
{
/**
*
*/
void modsLoaded();
/**
*
*/
void load();
/**
* @param tick
* @param b
* @param minecraftInstance
* @param data
* @return
*/
boolean doTickInGame(TickType tick, boolean b, Object minecraftInstance, Object... data);
/**
* @return
*/
String getName();
/**
* @return
*/
String getPriorities();
/**
* @param itemId
* @param itemDamage
* @return
*/
int addFuel(int itemId, int itemDamage);
/**
* @param renderers
*/
void onRenderHarvest(Map renderers);
/**
*
*/
void onRegisterAnimations();
/**
* @return
*/
String getVersion();
void keyBindingEvent(Object keybinding);
}
@@ -1,123 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common.modloader;
import java.util.EnumSet;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;
/**
* @author cpw
*
*/
public class BaseModTicker implements ITickHandler
{
private BaseMod mod;
private EnumSet<TickType> ticks;
private boolean clockTickTrigger;
BaseModTicker(BaseMod mod)
{
this.mod = mod;
this.ticks = EnumSet.of(TickType.WORLDLOAD);
}
BaseModTicker(EnumSet<TickType> ticks)
{
this.ticks = ticks;
}
@Override
public void tickStart(EnumSet<TickType> types, Object... tickData)
{
tickBaseMod(types, false, tickData);
}
@Override
public void tickEnd(EnumSet<TickType> types, Object... tickData)
{
tickBaseMod(types, true, tickData);
}
private void tickBaseMod(EnumSet<TickType> types, boolean end, Object... tickData)
{
if (FMLCommonHandler.instance().getSide().isClient() && ( ticks.contains(TickType.GAME) || ticks.contains(TickType.WORLDGUI)))
{
EnumSet cTypes=EnumSet.copyOf(types);
if (end && ( types.contains(TickType.GAME) || types.contains(TickType.WORLDLOAD) || types.contains(TickType.WORLDGUI)))
{
clockTickTrigger = true;
cTypes.remove(TickType.GAME);
cTypes.remove(TickType.WORLDLOAD);
cTypes.remove(TickType.WORLDGUI);
}
if (end && clockTickTrigger && types.contains(TickType.RENDER))
{
clockTickTrigger = false;
cTypes.remove(TickType.RENDER);
if (ticks.contains(TickType.GAME)) cTypes.add(TickType.GAME);
if (ticks.contains(TickType.WORLDGUI)) cTypes.add(TickType.WORLDGUI);
}
sendTick(cTypes, end, tickData);
}
else
{
sendTick(types, end, tickData);
}
}
private void sendTick(EnumSet<TickType> types, boolean end, Object... tickData)
{
for (TickType type : types)
{
if (!ticks.contains(type))
{
continue;
}
boolean keepTicking=mod.doTickInGame(type, end, FMLCommonHandler.instance().getMinecraftInstance(), tickData);
if (!keepTicking) {
ticks.remove(type);
ticks.removeAll(type.partnerTicks());
}
}
}
@Override
public EnumSet<TickType> ticks()
{
return (clockTickTrigger ? EnumSet.of(TickType.RENDER) : ticks);
}
@Override
public String getLabel()
{
return mod.getClass().getSimpleName();
}
/**
* @param mod2
*/
public void setMod(BaseMod mod)
{
this.mod = mod;
}
}
@@ -1,100 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common.modloader;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.TickType;
/**
* @author cpw
*
*/
public class ModLoaderHelper
{
private static Map<BaseMod, ModLoaderModContainer> notModCallbacks=new HashMap<BaseMod, ModLoaderModContainer>();
public static void updateStandardTicks(BaseMod mod, boolean enable, boolean useClock)
{
ModLoaderModContainer mlmc = findOrBuildModContainer(mod);
BaseModTicker ticker = mlmc.getTickHandler();
EnumSet<TickType> ticks = ticker.ticks();
// If we're enabled we get render ticks
if (enable && !useClock) {
ticks.add(TickType.RENDER);
} else {
ticks.remove(TickType.RENDER);
}
// If we're enabled but we want clock ticks, or we're server side we get game ticks
if (enable && (useClock || FMLCommonHandler.instance().getSide().isServer())) {
ticks.add(TickType.GAME);
} else {
ticks.remove(TickType.GAME);
}
}
public static void updateGUITicks(BaseMod mod, boolean enable, boolean useClock)
{
ModLoaderModContainer mlmc = findOrBuildModContainer(mod);
EnumSet<TickType> ticks = mlmc.getTickHandler().ticks();
// If we're enabled and we don't want clock ticks we get render ticks
if (enable && !useClock) {
ticks.add(TickType.GUI);
} else {
ticks.remove(TickType.GUI);
}
// If we're enabled but we want clock ticks, or we're server side we get world ticks
if (enable && (useClock || FMLCommonHandler.instance().getSide().isServer())) {
ticks.add(TickType.WORLDGUI);
} else {
ticks.remove(TickType.WORLDGUI);
}
}
/**
* @param mod
* @return
*/
private static ModLoaderModContainer findOrBuildModContainer(BaseMod mod)
{
ModLoaderModContainer mlmc=(ModLoaderModContainer) FMLCommonHandler.instance().findContainerFor(mod);
if (mlmc==null) {
mlmc=notModCallbacks.get(mod);
if (mlmc==null) {
mlmc=new ModLoaderModContainer(mod);
notModCallbacks.put(mod, mlmc);
}
}
return mlmc;
}
public static ModLoaderModContainer registerRenderHelper(BaseMod mod) {
ModLoaderModContainer mlmc=findOrBuildModContainer(mod);
return mlmc;
}
/**
* @param mod
* @return
*/
public static ModLoaderModContainer registerKeyHelper(BaseMod mod)
{
ModLoaderModContainer mlmc=findOrBuildModContainer(mod);
return mlmc;
}
}
@@ -1,714 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common.modloader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.IConsoleHandler;
import cpw.mods.fml.common.ICraftingHandler;
import cpw.mods.fml.common.IDispenseHandler;
import cpw.mods.fml.common.IFMLSidedHandler;
import cpw.mods.fml.common.IKeyHandler;
import cpw.mods.fml.common.INetworkHandler;
import cpw.mods.fml.common.IPickupNotifier;
import cpw.mods.fml.common.IPlayerTracker;
import cpw.mods.fml.common.IWorldGenerator;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.LoaderException;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.ModContainer.ModState;
import cpw.mods.fml.common.ModContainer.SourceType;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.ProxyInjector;
import cpw.mods.fml.common.TickType;
public class ModLoaderModContainer implements ModContainer
{
private static final ProxyInjector NULLPROXY = new ProxyInjector("","","",null);
private Class <? extends BaseMod > modClazz;
private BaseMod mod;
private File modSource;
private ArrayList<String> dependencies;
private ArrayList<String> preDependencies;
private ArrayList<String> postDependencies;
private ArrayList<IKeyHandler> keyHandlers;
private ModState state;
private SourceType sourceType;
private ModMetadata metadata;
private ProxyInjector sidedProxy;
private BaseModTicker tickHandler;
public ModLoaderModContainer(Class <? extends BaseMod > modClazz, File modSource)
{
this.modClazz = modClazz;
this.modSource = modSource;
// We are unloaded
nextState();
}
/**
* We only instantiate this for "not mod mods"
* @param instance
*/
ModLoaderModContainer(BaseMod instance) {
FMLCommonHandler.instance().addAuxilliaryModContainer(this);
this.mod=instance;
this.tickHandler = new BaseModTicker(instance);
}
@Override
public boolean wantsPreInit()
{
return true;
}
@Override
public boolean wantsPostInit()
{
return true;
}
@Override
public void preInit()
{
try
{
EnumSet<TickType> ticks = EnumSet.noneOf(TickType.class);
this.tickHandler = new BaseModTicker(ticks);
configureMod();
mod = modClazz.newInstance();
this.tickHandler.setMod(mod);
FMLCommonHandler.instance().registerTickHandler(this.tickHandler);
FMLCommonHandler.instance().registerWorldGenerator(this.mod);
}
catch (Exception e)
{
throw new LoaderException(e);
}
}
@Override
public ModState getModState()
{
return state;
}
@Override
public void nextState()
{
if (state==null) {
state=ModState.UNLOADED;
return;
}
if (state.ordinal()+1<ModState.values().length) {
state=ModState.values()[state.ordinal()+1];
}
}
/**
*
*/
private void configureMod()
{
IFMLSidedHandler sideHandler = FMLCommonHandler.instance().getSidedDelegate();
File configDir = Loader.instance().getConfigDir();
String modConfigName = modClazz.getSimpleName();
File modConfig = new File(configDir, String.format("%s.cfg", modConfigName));
Properties props = new Properties();
boolean existingConfigFound = false;
boolean mlPropFound = false;
if (modConfig.exists())
{
try
{
Loader.log.fine(String.format("Reading existing configuration file for %s : %s", modConfigName, modConfig.getName()));
FileReader configReader = new FileReader(modConfig);
props.load(configReader);
configReader.close();
}
catch (Exception e)
{
Loader.log.severe(String.format("Error occured reading mod configuration file %s", modConfig.getName()));
Loader.log.throwing("ModLoaderModContainer", "configureMod", e);
throw new LoaderException(e);
}
existingConfigFound = true;
}
StringBuffer comments = new StringBuffer();
comments.append("MLProperties: name (type:default) min:max -- information\n");
try
{
for (Field f : modClazz.getDeclaredFields())
{
if (!Modifier.isStatic(f.getModifiers()))
{
continue;
}
ModProperty property = sideHandler.getModLoaderPropertyFor(f);
if (property == null)
{
continue;
}
String propertyName = property.name().length() > 0 ? property.name() : f.getName();
String propertyValue = null;
Object defaultValue = null;
try
{
defaultValue = f.get(null);
propertyValue = props.getProperty(propertyName, extractValue(defaultValue));
Object currentValue = parseValue(propertyValue, property, f.getType(), propertyName, modConfigName);
Loader.log.finest(String.format("Configuration for %s.%s found values default: %s, configured: %s, interpreted: %s", modConfigName, propertyName, defaultValue, propertyValue, currentValue));
if (currentValue != null && !currentValue.equals(defaultValue))
{
Loader.log.finest(String.format("Configuration for %s.%s value set to: %s", modConfigName, propertyName, currentValue));
f.set(null, currentValue);
}
}
catch (Exception e)
{
Loader.log.severe(String.format("Invalid configuration found for %s in %s", propertyName, modConfig.getName()));
Loader.log.throwing("ModLoaderModContainer", "configureMod", e);
throw new LoaderException(e);
}
finally
{
comments.append(String.format("MLProp : %s (%s:%s", propertyName, f.getType().getName(), defaultValue));
if (property.min() != Double.MIN_VALUE)
{
comments.append(",>=").append(String.format("%.1f", property.min()));
}
if (property.max() != Double.MAX_VALUE)
{
comments.append(",<=").append(String.format("%.1f", property.max()));
}
comments.append(")");
if (property.info().length() > 0)
{
comments.append(" -- ").append(property.info());
}
if (propertyValue != null)
{
props.setProperty(propertyName, extractValue(propertyValue));
}
comments.append("\n");
}
mlPropFound = true;
}
}
finally
{
if (!mlPropFound && !existingConfigFound)
{
Loader.log.fine(String.format("No MLProp configuration for %s found or required. No file written", modConfigName));
return;
}
if (!mlPropFound && existingConfigFound)
{
File mlPropBackup = new File(modConfig.getParent(),modConfig.getName()+".bak");
Loader.log.fine(String.format("MLProp configuration file for %s found but not required. Attempting to rename file to %s", modConfigName, mlPropBackup.getName()));
boolean renamed = modConfig.renameTo(mlPropBackup);
if (renamed)
{
Loader.log.fine(String.format("Unused MLProp configuration file for %s renamed successfully to %s", modConfigName, mlPropBackup.getName()));
}
else
{
Loader.log.fine(String.format("Unused MLProp configuration file for %s renamed UNSUCCESSFULLY to %s", modConfigName, mlPropBackup.getName()));
}
return;
}
try
{
FileWriter configWriter = new FileWriter(modConfig);
props.store(configWriter, comments.toString());
configWriter.close();
Loader.log.fine(String.format("Configuration for %s written to %s", modConfigName, modConfig.getName()));
}
catch (IOException e)
{
Loader.log.warning(String.format("Error trying to write the config file %s", modConfig.getName()));
Loader.log.throwing("ModLoaderModContainer", "configureMod", e);
throw new LoaderException(e);
}
}
}
private Object parseValue(String val, ModProperty property, Class<?> type, String propertyName, String modConfigName)
{
if (type.isAssignableFrom(String.class))
{
return (String)val;
}
else if (type.isAssignableFrom(Boolean.TYPE) || type.isAssignableFrom(Boolean.class))
{
return Boolean.parseBoolean(val);
}
else if (Number.class.isAssignableFrom(type) || type.isPrimitive())
{
Number n = null;
if (type.isAssignableFrom(Double.TYPE) || Double.class.isAssignableFrom(type))
{
n = Double.parseDouble(val);
}
else if (type.isAssignableFrom(Float.TYPE) || Float.class.isAssignableFrom(type))
{
n = Float.parseFloat(val);
}
else if (type.isAssignableFrom(Long.TYPE) || Long.class.isAssignableFrom(type))
{
n = Long.parseLong(val);
}
else if (type.isAssignableFrom(Integer.TYPE) || Integer.class.isAssignableFrom(type))
{
n = Integer.parseInt(val);
}
else if (type.isAssignableFrom(Short.TYPE) || Short.class.isAssignableFrom(type))
{
n = Short.parseShort(val);
}
else if (type.isAssignableFrom(Byte.TYPE) || Byte.class.isAssignableFrom(type))
{
n = Byte.parseByte(val);
}
else
{
throw new IllegalArgumentException(String.format("MLProp declared on %s of type %s, an unsupported type",propertyName, type.getName()));
}
if (n.doubleValue() < property.min() || n.doubleValue() > property.max())
{
Loader.log.warning(String.format("Configuration for %s.%s found value %s outside acceptable range %s,%s", modConfigName,propertyName, n, property.min(), property.max()));
return null;
}
else
{
return n;
}
}
throw new IllegalArgumentException(String.format("MLProp declared on %s of type %s, an unsupported type",propertyName, type.getName()));
}
private String extractValue(Object value)
{
if (String.class.isInstance(value))
{
return (String)value;
}
else if (Number.class.isInstance(value) || Boolean.class.isInstance(value))
{
return String.valueOf(value);
}
else
{
throw new IllegalArgumentException("MLProp declared on non-standard type");
}
}
@Override
public void init()
{
mod.load();
}
@Override
public void postInit()
{
mod.modsLoaded();
}
@Override
public String getName()
{
return mod != null ? mod.getName() : modClazz.getSimpleName();
}
@Deprecated
public static ModContainer findContainerFor(BaseMod mod)
{
return FMLCommonHandler.instance().findContainerFor(mod);
}
@Override
public String getSortingRules()
{
if (mod!=null) {
return mod.getPriorities();
} else {
return "";
}
}
@Override
public boolean matches(Object mod)
{
return modClazz.isInstance(mod);
}
/**
* Find all the BaseMods in the system
* @param <A>
* @return
*/
public static <A extends BaseMod> List<A> findAll(Class<A> clazz)
{
ArrayList<A> modList = new ArrayList<A>();
for (ModContainer mc : Loader.getModList())
{
if (mc instanceof ModLoaderModContainer && mc.getMod()!=null)
{
modList.add((A)((ModLoaderModContainer)mc).mod);
}
}
return modList;
}
@Override
public File getSource()
{
return modSource;
}
@Override
public Object getMod()
{
return mod;
}
@Override
public int lookupFuelValue(int itemId, int itemDamage)
{
return mod.addFuel(itemId, itemDamage);
}
@Override
public boolean wantsPickupNotification()
{
return true;
}
@Override
public IPickupNotifier getPickupNotifier()
{
return mod;
}
@Override
public boolean wantsToDispense()
{
return true;
}
@Override
public IDispenseHandler getDispenseHandler()
{
return mod;
}
@Override
public boolean wantsCraftingNotification()
{
return true;
}
@Override
public ICraftingHandler getCraftingHandler()
{
return mod;
}
private void computeDependencies()
{
dependencies = new ArrayList<String>();
preDependencies = new ArrayList<String>();
postDependencies = new ArrayList<String>();
if (mod.getPriorities() == null || mod.getPriorities().length() == 0)
{
return;
}
boolean parseFailure=false;
StringTokenizer st = new StringTokenizer(mod.getPriorities(), ";");
for (; st.hasMoreTokens();)
{
String dep = st.nextToken();
String[] depparts = dep.split(":");
if (depparts.length < 2)
{
parseFailure=true;
continue;
}
else if ("required-before".equals(depparts[0]) || "required-after".equals(depparts[0]))
{
if (!depparts[1].trim().equals("*")) {
dependencies.add(depparts[1]);
} else {
parseFailure=true;
continue;
}
}
if ("required-before".equals(depparts[0]) || "before".equals(depparts[0]))
{
postDependencies.add(depparts[1]);
} else if ("required-after".equals(depparts[0]) || "after".equals(depparts[0]))
{
preDependencies.add(depparts[1]);
} else {
parseFailure=true;
}
}
if (parseFailure) {
FMLCommonHandler.instance().getFMLLogger().warning(String.format("The mod %s has an incorrect dependency string {%s}", mod.getName(), mod.getPriorities()));
}
}
@Override
public List<String> getDependencies()
{
if (dependencies == null)
{
computeDependencies();
}
return dependencies;
}
@Override
public List<String> getPostDepends()
{
if (dependencies == null)
{
computeDependencies();
}
return postDependencies;
}
@Override
public List<String> getPreDepends()
{
if (dependencies == null)
{
computeDependencies();
}
return preDependencies;
}
public String toString()
{
return modClazz.getSimpleName();
}
@Override
public boolean wantsNetworkPackets()
{
return true;
}
@Override
public INetworkHandler getNetworkHandler()
{
return mod;
}
@Override
public boolean ownsNetworkChannel(String channel)
{
return FMLCommonHandler.instance().getChannelListFor(this).contains(channel);
}
@Override
public boolean wantsConsoleCommands()
{
return true;
}
@Override
public IConsoleHandler getConsoleHandler()
{
return mod;
}
@Override
public boolean wantsPlayerTracking()
{
return true;
}
@Override
public IPlayerTracker getPlayerTracker()
{
return mod;
}
/**
* @param keyHandler
* @param allowRepeat
*/
public void addKeyHandler(IKeyHandler handler)
{
if (keyHandlers==null) {
keyHandlers=new ArrayList<IKeyHandler>();
}
Iterator<IKeyHandler> itr = keyHandlers.iterator();
while(itr.hasNext())
{
IKeyHandler old = itr.next();
if (old.getKeyBinding() == handler.getKeyBinding())
{
itr.remove();
}
}
keyHandlers.add(handler);
}
@Override
public List<IKeyHandler> getKeys()
{
if (keyHandlers==null) {
return Collections.emptyList();
}
return keyHandlers;
}
@Override
public void setSourceType(SourceType type) {
this.sourceType=type;
}
@Override
public SourceType getSourceType()
{
return sourceType;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getMetadata()
*/
@Override
public ModMetadata getMetadata()
{
return metadata;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#setMetadata(cpw.mods.fml.common.ModMetadata)
*/
@Override
public void setMetadata(ModMetadata meta)
{
this.metadata=meta;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#gatherRenderers(java.util.Map)
*/
@Override
public void gatherRenderers(Map renderers)
{
mod.onRenderHarvest(renderers);
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#requestAnimations()
*/
@Override
public void requestAnimations()
{
mod.onRegisterAnimations();
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#getVersion()
*/
@Override
public String getVersion()
{
if (mod == null || mod.getVersion() == null)
{
return "Not available";
}
return mod.getVersion();
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#findSidedProxy()
*/
@Override
public ProxyInjector findSidedProxy()
{
if (sidedProxy==null) {
sidedProxy = FMLCommonHandler.instance().getSidedDelegate().findSidedProxyOn(mod);
if (sidedProxy == null)
{
sidedProxy = NULLPROXY;
}
}
return sidedProxy == NULLPROXY ? null : sidedProxy;
}
/* (non-Javadoc)
* @see cpw.mods.fml.common.ModContainer#keyBindEvernt(java.lang.Object)
*/
@Override
public void keyBindEvent(Object keybinding)
{
mod.keyBindingEvent(keybinding);
}
/**
* @return
*/
public BaseModTicker getTickHandler()
{
return this.tickHandler;
}
}
@@ -1,69 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common.modloader;
import java.io.File;
/**
* @author cpw
*
*/
public class ModProperty
{
private String info;
private double min;
private double max;
private String name;
public ModProperty(String info, double min, double max, String name)
{
this.info = info;
this.min = min;
this.max = max;
this.name = name;
}
/**
* @return
*/
public String name()
{
// TODO Auto-generated method stub
return name;
}
/**
* @return
*/
public double min()
{
// TODO Auto-generated method stub
return min;
}
/**
* @return
*/
public double max()
{
// TODO Auto-generated method stub
return max;
}
/**
* @return
*/
public String info()
{
// TODO Auto-generated method stub
return info;
}
}
@@ -1,124 +0,0 @@
/*
* The FML Forge Mod Loader suite.
* Copyright (C) 2012 cpw
*
* This library 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 2.1 of the License, or any later version.
*
* This library 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 this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package cpw.mods.fml.common.registry;
import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.Block;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EnumCreatureType;
import net.minecraft.src.IRecipe;
import net.minecraft.src.ItemBlock;
import net.minecraft.src.ItemStack;
import net.minecraft.src.TileEntity;
public class FMLRegistry
{
private static IMinecraftRegistry instance;
public static void registerRegistry(IMinecraftRegistry registry)
{
if (instance != null)
{
throw new RuntimeException("Illegal attempt to replace FML registry");
}
instance = registry;
}
public static void addRecipe(ItemStack output, Object... params)
{
instance.addRecipe(output, params);
}
public static void addShapelessRecipe(ItemStack output, Object... params)
{
instance.addShapelessRecipe(output, params);
}
public static void addRecipe(IRecipe recipe)
{
instance.addRecipe(recipe);
}
public static void addSmelting(int input, ItemStack output)
{
instance.addSmelting(input, output);
}
public static void registerBlock(Block block)
{
instance.registerBlock(block);
}
public static void registerBlock(Block block, Class <? extends ItemBlock > itemclass)
{
instance.registerBlock(block, itemclass);
}
public static void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id)
{
instance.registerEntityID(entityClass, entityName, id);
}
public static void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)
{
instance.registerEntityID(entityClass, entityName, id, backgroundEggColour, foregroundEggColour);
}
public static void registerTileEntity(Class <? extends TileEntity > tileEntityClass, String id)
{
instance.registerTileEntity(tileEntityClass, id);
}
public static void addBiome(BiomeGenBase biome)
{
instance.addBiome(biome);
}
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
{
instance.addSpawn(entityClass, weightedProb, min, max, typeOfCreature, biomes);
}
@SuppressWarnings("unchecked")
public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes)
{
instance.addSpawn(entityName, weightedProb, min, max, spawnList, biomes);
}
public static void removeBiome(BiomeGenBase biome)
{
instance.removeBiome(biome);
}
public static void removeSpawn(Class <? extends EntityLiving > entityClass, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
{
instance.removeSpawn(entityClass, typeOfCreature, biomes);
}
@SuppressWarnings("unchecked")
public static void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeGenBase... biomes)
{
instance.removeSpawn(entityName, spawnList, biomes);
}
/**
* @return
*/
public static IMinecraftRegistry instance()
{
return instance;
}
}
@@ -1,46 +0,0 @@
package cpw.mods.fml.common.registry;
import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.Block;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EnumCreatureType;
import net.minecraft.src.IRecipe;
import net.minecraft.src.ItemBlock;
import net.minecraft.src.ItemStack;
import net.minecraft.src.TileEntity;
public interface IMinecraftRegistry
{
public abstract void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeGenBase... biomes);
public abstract void removeSpawn(Class <? extends EntityLiving > entityClass, EnumCreatureType typeOfCreature, BiomeGenBase... biomes);
public abstract void removeBiome(BiomeGenBase biome);
public abstract void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes);
public abstract void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes);
public abstract void addBiome(BiomeGenBase biome);
public abstract void registerTileEntity(Class <? extends TileEntity > tileEntityClass, String id);
public abstract void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour);
public abstract void registerEntityID(Class <? extends Entity > entityClass, String entityName, int id);
public abstract void registerBlock(Block block, Class <? extends ItemBlock > itemclass);
public abstract void registerBlock(Block block);
public abstract void addSmelting(int input, ItemStack output);
public abstract void addShapelessRecipe(ItemStack output, Object... params);
public abstract void addRecipe(ItemStack output, Object... params);
public abstract void addRecipe(IRecipe recipe);
}
+19
View File
@@ -0,0 +1,19 @@
# Artistic Style format configuration
# see http://astyle.sourceforge.net/astyle.html
style=allman
add-brackets
break-closing-brackets
indent-switches
max-instatement-indent=40
pad-oper
pad-header
unpad-paren
break-blocks
delete-empty-lines
+9034
View File
File diff suppressed because it is too large. Load diff
+4317
View File
File diff suppressed because it is too large. Load diff
+3543
View File
File diff suppressed because it is too large. Load diff
+22006
View File
File diff suppressed because it is too large. Load diff
+165
View File
@@ -0,0 +1,165 @@
[DEFAULT]
DirTemp = temp
DirSrc = src
DirLogs = logs
DirBin = bin
DirJars = jars
DirReobf = reobf
DirConf = conf
DirRuntime = runtime
DirLib = lib
DirTempSrc = temp/src
DirTempCls = temp/cls
DirTempBin = temp/bin
DirModSrc = modsrc
DirEclipse = eclipse
[CSV]
Classes = %(DirConf)s/classes.csv
Methods = %(DirConf)s/methods.csv
Fields = %(DirConf)s/fields.csv
Params = %(DirConf)s/params.csv
NewIds = %(DirConf)s/newids.csv
[SRGS]
ConfClient = %(DirConf)s/client.srg
ConfServer = %(DirConf)s/server.srg
Client = %(DirTemp)s/client_rg.srg
Server = %(DirTemp)s/server_rg.srg
DeobfClient = %(DirTemp)s/client_deobf.srg
DeobfServer = %(DirTemp)s/server_deobf.srg
ReobfClient = %(DirTemp)s/client_ro.srg
ReobfServer = %(DirTemp)s/server_ro.srg
ReobfClientSrg = %(DirTemp)s/client_ro_srg.srg
ReobfServerSrg = %(DirTemp)s/server_ro_srg.srg
[JAR]
DirNatives = %(DirJars)s/bin/natives
Client = %(DirJars)s/bin/minecraft.jar
Server = %(DirJars)s/minecraft_server.jar
LWJGL = %(DirJars)s/bin/jinput.jar,%(DirJars)s/bin/lwjgl.jar,%(DirJars)s/bin/lwjgl_util.jar
MD5Client = 595007b790548806f66762507203b896
MD5Server = a1de2db50b0d8bfac45be3e01e54bddf
[RETROGUARD]
Location = %(DirRuntime)s/bin/retroguard.jar
RetroConf = %(DirTemp)s/retroguard.cfg
RetroReobConf = %(DirTemp)s/retroguard_ro.cfg
ClientConf = %(DirTemp)s/client_rg.cfg
ServerConf = %(DirTemp)s/server_rg.cfg
ClientReobConf = %(DirTemp)s/client_ro.cfg
ServerReobConf = %(DirTemp)s/server_ro.cfg
ClientOut = %(DirTemp)s/minecraft_rg.jar
ServerOut = %(DirTemp)s/minecraft_server_rg.jar
ClientLog = %(DirLogs)s/client_rg.log
ServerLog = %(DirLogs)s/server_rg.log
ClientDeobLog = %(DirLogs)s/client_deob.log
ServerDeobLog = %(DirLogs)s/server_deob.log
NullPkg = net/minecraft/src
[EXCEPTOR]
XClientJson = %(DirConf)s/exceptor.json
XServerJson = %(DirConf)s/exceptor.json
XClientCfg = %(DirConf)s/joined.exc
XServerCfg = %(DirConf)s/joined.exc
XClientOut = %(DirTemp)s/minecraft_exc.jar
XServerOut = %(DirTemp)s/minecraft_server_exc.jar
XClientLog = %(DirLogs)s/client_exc.log
XServerLog = %(DirLogs)s/server_exc.log
[DECOMPILE]
ClsClientTemp = %(DirTempCls)s/minecraft
ClsServerTemp = %(DirTempCls)s/minecraft_server
SrcClientTemp = %(DirTempSrc)s/minecraft
SrcServerTemp = %(DirTempSrc)s/minecraft_server
FFSource = net
FFClientIn = %(DirTemp)s/minecraft_ff_in.jar
FFServerIn = %(DirTemp)s/minecraft_server_ff_in.jar
[OUTPUT]
BinClientTemp = %(DirTempBin)s/minecraft
BinServerTemp = %(DirTempBin)s/minecraft_server
SrcClient = %(DirSrc)s/minecraft
SrcServer = %(DirSrc)s/minecraft_server
TestClient = net/minecraft/client/main/Main
TestServer = net/minecraft/server/MinecraftServer
[PATCHES]
PatchClient = %(DirConf)s/patches/minecraft.patch
PatchServer = %(DirConf)s/patches/minecraft_server.patch
PatchTemp = %(DirTemp)s/temp.patch
FFPatchClient = %(DirConf)s/patches/minecraft_ff.patch
FFPatchServer = %(DirConf)s/patches/minecraft_server_ff.patch
PatchClient_osx = %(DirConf)s/patches/minecraft_osx.patch
PatchServer_osx = %(DirConf)s/patches/minecraft_server_osx.patch
[RECOMPILE]
BinClient = %(DirBin)s/minecraft
BinServer = %(DirBin)s/minecraft_server
LogClient = %(DirLogs)s/client_compile.log
LogServer = %(DirLogs)s/server_compile.log
ClassPathClient = %(DirLib)s/,%(DirLib)s/*,%(DirJars)s/bin/minecraft.jar,%(DirJars)s/bin/jinput.jar,%(DirJars)s/bin/lwjgl.jar,%(DirJars)s/bin/lwjgl_util.jar
ClassPathServer = %(DirLib)s/,%(DirLib)s/*,%(DirJars)s/minecraft_server.jar
ClientFixes = %(DirConf)s/patches
FixStart = Start
IgnorePkg = paulscode,com,isom,ibxm,de/matthiasmann/twl,org,javax,argo,gnu,io/netty
[REOBF]
MD5Client = %(DirTemp)s/client.md5
MD5Server = %(DirTemp)s/server.md5
MD5PreReobfClient = %(DirTemp)s/client_reobf.md5
MD5PreReobfServer = %(DirTemp)s/server_reobf.md5
RecompJarClient = %(DirTemp)s/client_recomp.jar
RecompJarServer = %(DirTemp)s/server_recomp.jar
ObfJarClient = %(DirTemp)s/client_reobf.jar
ObfJarServer = %(DirTemp)s/server_reobf.jar
ReobfDirClient = %(DirReobf)s/minecraft
ReobfDirServer = %(DirReobf)s/minecraft_server
ClientRoLog = %(DirLogs)s/client_ro.log
ServerRoLog = %(DirLogs)s/server_ro.log
ReobfClientLog = %(DirLogs)s/client_reob.log
ReobfServerLog = %(DirLogs)s/server_reob.log
[GETMODSOURCE]
OutSRCClient = %(DirModSrc)s/minecraft
OutSRCServer = %(DirModSrc)s/minecraft_server
[MCP]
LogFile = %(DirLogs)s/mcp.log
LogFileErr = %(DirLogs)s/mcperr.log
UpdateUrl = http://mcp.ocean-labs.de/files/mcprolling_{version}/
IgnoreUpdate = %(DirBin)s,%(DirLib)s,%(DirLogs)s,%(DirModSrc)s,%(DirReobf)s,%(DirSrc)s,%(DirTemp)s,%(DirEclipse)s/Client/bin,%(DirEclipse)s/Server/bin,%(DirJars)s/world,%(DirJars)s/saves,%(DirJars)s/resources
RGIndex = 154000
ParamIndex = 45000
[ASTYLE]
AstyleConfig = %(DirConf)s/astyle.cfg
[COMMANDS]
Wine = wine
Patcher_win = %(DirRuntime)s/bin/applydiff.exe
Patcher_linux = patch
Patcher_osx = patch
Jad_win = %(DirRuntime)s/bin/jad.exe
Jad_osx = %(DirRuntime)s/bin/jad-osx
AStyle_win = %(DirRuntime)s/bin/astyle.exe
AStyle_linux = astyle
AStyle_osx = %(DirRuntime)s/bin/astyle-osx
JadRetro = %(DirRuntime)s/bin/jadretro.jar
Fernflower = %(DirRuntime)s/bin/fernflower.jar
Exceptor = %(DirRuntime)s/bin/mcinjector.jar
SpecialSource = %(DirRuntime)s/bin/specialsource.jar
CmdPatch = %s -p1 -u -i {patchfile} -d {srcdir}
CmdJad = %s -b -d {outdir} -dead -o -r -s .java -stat -ff {classes}
CmdAStyle = %s --suffix=none --quiet --options={conffile} {classes}
CmdRG = %s -cp "{classpath}" RetroGuard -searge {conffile}
CmdRGReobf = %s -cp "{classpath}" RetroGuard -notch {conffile}
CmdSS = %s -cp "{classpath}" -jar %s -i {injar} -o {outjar} -m {mapfile} --kill-source
CmdSSReobf = %s -cp "{classpath}" -jar %s -i {injar} -o {outjar} -r -m {mapfile} -d {identifier} -e %s
CmdJadretro = %s -jar %s {targetdir}
CmdFernflower = %s -jar %s -din=1 -rbr=0 -dgs=1 -asc=1 -log=WARN {indir} {outdir}
CmdExceptor = %s -jar %s --jarIn {input} --jarOut {output} --mapIn {conf} --log {log} --jsonIn {json} --applyMarkers
CmdRecomp = %s -Xlint:-options -deprecation -g -source 1.6 -target 1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs}
CmdRecompScala = %s -encoding UTF-8 -deprecation -target:jvm-1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs}
CmdStartSrv = %s -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" net.minecraft.server.MinecraftServer
CmdStartClt = %s -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" -Djava.library.path={natives} Start
+4224
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
param,name,side
1 param name side
+114
View File
@@ -0,0 +1,114 @@
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.Arrays;
import joptsimple.ArgumentAcceptingOptionSpec;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
import net.minecraft.client.Minecraft;
import net.minecraft.client.main.Main;
public class Start
{
public static void main(String[] args) throws Exception
{
int userIndex = -1;
int passIndex = -1;
int sessIndex = -1;
int versIndex = -1;
for( int x = 0; x < args.length; x++)
{
if (args[x].equals("--username")) userIndex = x + 1;
else if (args[x].equals("--password")) passIndex = x + 1;
else if (args[x].equals("--session")) sessIndex = x + 1;
else if (args[x].equals("--version")) versIndex = x + 1;
}
if (userIndex != 0-1 && passIndex != -1 && sessIndex == -1)
{
String[] session = getSession(args[userIndex], args[passIndex]);
if (session != null)
{
args[userIndex] = session[0];
args = concat(args, new String[]{"--session", session[1]});
}
}
//Kill the password if its there so it isn't printed to the console.
if (passIndex != -1)
{
args[passIndex-1] = "no_password_for_joo";
args[passIndex] = "no_password_for_joo";
}
if (versIndex == -1)
{
args = concat(args, new String[]{ "--version", "fml_mcp" });
}
Main.main(args);
}
private static String[] getSession(String username, String password) throws UnsupportedEncodingException
{
String parameters = "http://login.minecraft.net/?user=" + URLEncoder.encode(username, "UTF-8") +
"&password=" + URLEncoder.encode(password, "UTF-8") +
"&version=" + 13;
String result = openUrl(parameters);
if (result == null)
{
System.out.println("Can't connect to minecraft.net");
return null;
}
if (!result.contains(":"))
{
System.out.println("Login Failed: " + result);
return null;
}
String[] values = result.split(":");
return new String[]{ values[2].trim(), values[3].trim() };
}
private static String openUrl(String addr)
{
try
{
URL url = new URL(addr);
java.io.InputStream is;
is = url.openConnection().getInputStream();
java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(is));
String buf = "";
String line = null;
while ((line = reader.readLine()) != null)
{
buf += "\n" + line;
}
reader.close();
return buf;
}
catch (IOException e)
{
e.printStackTrace();
}
return null;
}
private static <T> T[] concat(T[] first, T[] second)
{
T[] result = Arrays.copyOf(first, first.length + second.length);
System.arraycopy(second, 0, result, first.length, second.length);
return result;
}
}
@@ -0,0 +1,22 @@
diff -r -U 3 minecraft\net\minecraft\client\Minecraft.java minecraft_patched\net\minecraft\client\Minecraft.java
--- minecraft\net\minecraft\client\Minecraft.java
+++ minecraft_patched\net\minecraft\client\Minecraft.java
@@ -695,9 +695,7 @@
while(true) {
try {
- if(!this.field_71425_J) {
- break;
- }
+ while(this.field_71425_J) {
if(!this.field_71434_R || this.field_71433_S == null) {
try {
@@ -711,6 +709,7 @@
}
this.func_71377_b(this.field_71433_S);
+ }
} catch (MinecraftError var12) {
break;
} catch (ReportedException var13) {
@@ -0,0 +1,12 @@
diff -r -U 3 minecraft\net\minecraft\client\Minecraft.java minecraft_patched\net\minecraft\client\Minecraft.java
--- minecraft\net\minecraft\client\Minecraft.java
+++ minecraft_patched\net\minecraft\client\Minecraft.java
@@ -695,7 +695,7 @@
while(true) {
try {
- if(this.field_71425_J) {
+ while(this.field_71425_J) {
if(!this.field_71434_R || this.field_71433_S == null) {
try {
this.func_71411_J();
@@ -0,0 +1,21 @@
diff -r -U 3 minecraft\net\minecraft\client\gui\FontRenderer.java minecraft_patched\net\minecraft\client\gui\FontRenderer.java
--- minecraft\net\minecraft\client\gui\FontRenderer.java
+++ minecraft_patched\net\minecraft\client\gui\FontRenderer.java
@@ -581,8 +581,6 @@
case 10:
--var5;
break;
- case 32:
- var6 = var5;
case 167:
if(var5 < var3 - 1) {
++var5;
@@ -596,6 +594,8 @@
}
}
break;
+ case 32:
+ var6 = var5;
default:
var4 += this.func_78263_a(var8);
if(var7) {
@@ -0,0 +1,11 @@
diff -r -U 3 minecraft\net\minecraft\client\network\NetHandlerHandshakeMemory.java minecraft_patched\net\minecraft\client\network\NetHandlerHandshakeMemory.java
--- minecraft\net\minecraft\client\network\NetHandlerHandshakeMemory.java
+++ minecraft_patched\net\minecraft\client\network\NetHandlerHandshakeMemory.java
@@ -31,6 +31,7 @@
switch(NetHandlerHandshakeMemory.SwitchEnumConnectionState.field_151263_a[p_147232_2_.ordinal()]) {
case 1:
this.field_147384_b.func_150719_a(new NetHandlerLoginServer(this.field_147385_a, this.field_147384_b));
+ break;
case 2:
throw new UnsupportedOperationException("NYI");
default:
Loaded 100 of 560 files, more files were not shown because too many files have changed in this diff. Show more