260 Commits

Author SHA1 Message Date
71a706dfab Russian Language updates 2022-09-10 21:15:02 +00:00
Mohammad-Ali Minaie
3cb82b5e4c updating version 2019-07-15 22:19:28 -04:00
Mohammad-Ali Minaie
a341f1677a updating version to make sense 2019-07-15 22:17:35 -04:00
312bcb82bd Version Bump 2019-06-14 12:09:40 -05:00
295e556867 Sync'd maven repositories 2019-06-13 14:13:32 -05:00
Mohammad-Ali Minaie
d74f564d8e modify props 2019-06-10 15:22:22 -04:00
Mohammad-Ali Minaie
cbe15662e3 fixed bug with jei crashing when hovering over tool or weapon parts 2019-06-09 15:09:33 -04:00
Mohammad-Ali Minaie
bad57bdb6b update version 2019-06-08 15:53:27 -04:00
Mohammad-Ali Minaie
5ada5951bf fixing bug with moved crucibles and broken textures 2019-06-08 15:52:20 -04:00
Mohammad-Ali Minaie
a7f3b0b5ab adding russian lang file 2019-02-25 18:35:16 -05:00
Mohammad-Ali Minaie
ab42ba9f30 updating tooltip printout to print properly 2019-01-28 12:42:05 -05:00
Mohammad-Ali Minaie
6c467978fc version bump plus print out removal 2018-12-16 17:44:49 -05:00
Mohammad-Ali Minaie
88b60140d6 updating master with new script 2018-11-02 22:06:16 -04:00
Mohammad-Ali Minaie
f3cccdc613 fixed cauldron recipe and updated lang file 2018-10-31 17:29:43 -04:00
Mohammad-Ali Minaie
fdc65afa5d update 2018-10-29 16:26:26 -04:00
Mohammad-Ali Minaie
ce398ba90c fixed rendering and NBT crash with old weapons 2018-10-29 07:27:51 -04:00
Mohammad-Ali Minaie
69b0435cc3 sharpening and weapon upgrading 2018-10-28 14:57:33 -04:00
Mohammad-Ali Minaie
5d52195bda more Grinding bench stuff 2018-10-28 10:55:46 -04:00
Mohammad-Ali Minaie
25ba3af7c6 fixed merge conflict from master 2018-10-27 16:26:09 -04:00
Mohammad-Ali Minaie
94ed0367aa fixed some small render bugs 2018-10-27 16:25:03 -04:00
Mohammad-Ali Minaie
51561d063e update with merge conflict resolved 2018-10-27 15:28:36 -04:00
Mohammad-Ali Minaie
8fda4b25c4 update to crucible, should be fixed now 2018-10-26 23:26:33 -04:00
Mohammad-Ali Minaie
5ef2b3bd0d update before switch to master 2018-10-26 17:19:44 -04:00
Mohammad-Ali Minaie
7afe86e45e Merge branch 'master-1.12' into feature-1.12 2018-10-25 22:18:12 -04:00
Mohammad-Ali Minaie
69f25c4d0c fixed nbt crucible item adding bug 2018-10-25 22:17:49 -04:00
Mohammad-Ali Minaie
4260b1169c secret 2018-10-25 20:36:34 -04:00
Mohammad-Ali Minaie
b6cbeac459 updating toolbench weapon upgrade feature 2018-10-25 01:14:37 -04:00
Mohammad-Ali Minaie
d4881ea454 Merge branch 'master-1.12' into feature-1.12 2018-10-22 08:07:19 -04:00
Mohammad-Ali Minaie
d83adf0323 pushing fix to casting 2018-10-22 08:06:53 -04:00
Mohammad-Ali Minaie
324bba66c1 bugfixed in feature again 2018-10-22 06:43:36 -04:00
Mohammad-Ali Minaie
908c5150e5 update weapon crafting 2018-10-22 06:12:50 -04:00
Mohammad-Ali Minaie
eb429a5fc2 trying to fix merge conflixt 2018-10-20 19:49:32 -04:00
Mohammad-Ali Minaie
b7aba91158 somehow files got sent to master instead of feature 2018-10-20 19:47:27 -04:00
Mohammad-Ali Minaie
51d3bb7df3 trying to push new files 2018-10-20 18:17:53 -04:00
Mohammad-Ali Minaie
8a4f6f6dda made chisel placement better 2018-10-20 17:19:51 -04:00
Mohammad-Ali Minaie
fec851e5af fixed a bug but in the wrong branch 2018-10-20 11:06:35 -04:00
Mohammad-Ali Minaie
2b9f131984 created bone handle and bone guard items as well as workbench recipes to create the finised item, need to check if the NBT transfers correctly 2018-10-19 08:03:59 -04:00
Mohammad-Ali Minaie
b390ac48be Merge branch 'master-1.12' into feature-1.12 2018-10-18 20:01:05 -04:00
Mohammad-Ali Minaie
0e785eff57 bugfix for chisel 2018-10-18 20:00:00 -04:00
Mohammad-Ali Minaie
b7f3d04929 need saw and blade recipes to make weapon hilts and guards 2018-10-18 18:39:11 -04:00
Mohammad-Ali Minaie
dbc591fc59 created raw gladius for all material types and abstracted recipe creator, need wither dust in PC 2018-10-17 22:08:04 -04:00
Mohammad-Ali Minaie
0efd2b73fd weapon upgrades baby 2018-10-16 21:47:13 -04:00
Mohammad-Ali Minaie
3d8552ed1a trying to match inputs 2018-10-16 10:58:47 -04:00
Mohammad-Ali Minaie
eecd4536ce fixed the toolbench recipes and recipe to craft it 2018-10-15 16:53:12 -04:00
Mohammad-Ali Minaie
a822458bc2 upadting the longbow to work more like and render more like a vanilla bow 2018-10-15 16:11:16 -04:00
Mohammad-Ali Minaie
8b09d55bd0 updating workspace before new changes 2018-10-15 08:47:06 -04:00
Mohammad-Ali Minaie
25cf6c6704 something is wrong with my classpath for blocks 2018-10-14 13:40:02 -04:00
Mohammad-Ali Minaie
dbc09ae0b3 getting no class def error 2018-10-14 12:34:08 -04:00
Mohammad-Ali Minaie
1d45f17f21 changed the printout statements for the bloomery and fixed a dupe bug with damascus 2018-10-09 19:16:12 -04:00
Mohammad-Ali Minaie
f606675101 remove damascus config update to-dos released .22 2018-10-08 22:49:54 -04:00
Mohammad-Ali Minaie
03d0724cd2 finizhed chisel and sledgehammer feature plus fixed some bugs 2018-10-06 18:55:02 -04:00
Mohammad-Ali Minaie
14fc81e64b update code, missing my CrucibleRecipes class... 2018-10-06 14:21:45 -04:00
Mohammad-Ali Minaie
69ab05bc18 need to add bounding for chisel, chisel and sledgehammer crafting, chisel and sledgehammer asset updates 2018-10-06 02:38:22 -04:00
Mohammad-Ali Minaie
51eaa9eaeb more work on the chisel and hammer feature 2018-10-05 23:52:12 -04:00
Mohammad-Ali Minaie
ad02317dcd hammer and chisel working like i want, chisel needs directional, and hitting sounds, need rock crumbling sounds, 2018-10-04 17:01:20 -04:00
Mohammad-Ali Minaie
f5f00fd2e7 updated enchantment remove logic and created models for chisel and sledgehammer 2018-10-03 17:39:12 -04:00
Mohammad-Ali Minaie
3173246104 updated versions 2018-10-03 14:11:50 -04:00
Mohammad-Ali Minaie
e5ce106785 CT support for crucible recipes 2018-10-02 22:24:23 -04:00
Mohammad-Ali Minaie
0b16ea1138 updating with current code 2018-10-02 19:10:03 -04:00
Mohammad-Ali Minaie
bf125d564f update with new code 2018-10-02 17:31:53 -04:00
Mohammad-Ali Minaie
0b1fac7b05 pushing working CT code and recipe code for the crucible but its not updated JEI with new recipes 2018-10-02 17:02:51 -04:00
Mohammad-Ali Minaie
1b2ca345ce CT is working except add recipes 2018-10-02 03:27:30 -04:00
Mohammad-Ali Minaie
2ef0a38a8c Merge branch 'feature-1.12' of ssh://git.nmd.so:12000/nmd/ForgeCraft into master-1.12 2018-10-02 01:38:16 -04:00
Mohammad-Ali Minaie
eff6124c2a fking lang file 2018-10-02 01:04:11 -04:00
Mohammad-Ali Minaie
725186d1a6 renamed crap 2018-10-02 00:31:48 -04:00
Mohammad-Ali Minaie
1a9b83059a checking these damn recipes 2018-10-02 00:27:23 -04:00
Mohammad-Ali Minaie
3c9d80b139 version bump 2018-10-01 23:07:38 -04:00
Mohammad-Ali Minaie
93b7f9f82c working CT redoing all recipe handlers, woo.... 2018-10-01 23:00:30 -04:00
Mohammad-Ali Minaie
369e02712d push fixes and version updates 2018-10-01 18:19:27 -04:00
Mohammad-Ali Minaie
2f0c56c0eb update todos 2018-10-01 06:44:43 -04:00
Mohammad-Ali Minaie
2faa718deb tools range upgrades from 1-5 longbow fixed, reduced forge light level, forge really cools down now, chunks dont read upgrades, casting form works, anvil can cool down items stored in its inventory, 2018-09-30 14:30:47 -04:00
Mohammad-Ali Minaie
c765542d6a Forge Light level reduce, forge cools down, ingots dont need to read upgrades, casting form fixed, anvil now cools its inventory, longbow arrow velocity balanced, more bucket crafting, config, copper tools, config for lowering fortune multiplier need to finish copper tool and tool head assets 2018-09-28 02:04:01 -04:00
Mohammad-Ali Minaie
a77e2637ee working on fixing so many things 2018-09-27 15:57:37 -04:00
Mohammad-Ali Minaie
2c0c89f91b fixed forge lighting being to bright and updated to-do list 2018-09-26 09:38:34 -04:00
Mohammad-Ali Minaie
d7c4e390ea fixing forge 2018-09-25 12:44:29 -04:00
Mohammad-Ali Minaie
e5fe677771 update todos 2018-09-25 09:04:40 -04:00
Mohammad-Ali Minaie
8fc8dd32c2 fixed bugs 2018-09-25 07:52:42 -04:00
Mohammad-Ali Minaie
73a9bef667 updated and pulled back mcpMappings 2018-09-23 20:42:50 -04:00
Mohammad-Ali Minaie
432239c820 updated updating capability 2018-09-23 16:57:35 -04:00
Mohammad-Ali Minaie
91ea728d3b trying to fix capabilities 2018-09-23 16:24:58 -04:00
Mohammad-Ali Minaie
4818efe33c working on capabilities optimized imports 2018-09-23 12:21:57 -04:00
Mohammad-Ali Minaie
8dc5089de3 update tool parte 2018-09-23 00:02:03 -04:00
Mohammad-Ali Minaie
b6c42230fe tongs are functional but rendering is jacked 2018-09-22 22:08:37 -04:00
Mohammad-Ali Minaie
a06c4ce4ba workign through issues in the ForgeHandler 2018-09-22 20:52:36 -04:00
Mohammad-Ali Minaie
10e5e3d537 trying to get this damn handler to work 2018-09-22 20:10:45 -04:00
Mohammad-Ali Minaie
d5c64228ca adding capability to the tongs 2018-09-22 18:28:24 -04:00
Mohammad-Ali Minaie
0d1cbbaf95 trying to fix the forge 2018-09-22 15:41:06 -04:00
Mohammad-Ali Minaie
fed30aef92 Merge branch 'master-1.12' into feature-1.12 2018-09-21 23:42:59 -04:00
Mohammad-Ali Minaie
6f5dd58fc5 fixed slot tongs rendering 2018-09-21 23:25:16 -04:00
Mohammad-Ali Minaie
a45d502cc6 fixed render desnyc for tongs 2018-09-21 23:19:19 -04:00
Mohammad-Ali Minaie
456b51827c Merge branch 'master-1.12' into feature-1.12 2018-09-21 20:57:43 -04:00
Mohammad-Ali Minaie
ad4ba47527 fixed nbt breaking and rendering issues 2018-09-21 20:55:47 -04:00
Mohammad-Ali Minaie
bd6f01c244 working on copper tools and weapons / weapon upgrades 2018-09-21 11:03:10 -04:00
Mohammad-Ali Minaie
6656a2a3ab update version, start weapon upgrades 2018-09-21 00:04:40 -04:00
Mohammad-Ali Minaie
7151eef000 fixing the bugs 2018-09-20 18:36:13 -04:00
Mohammad-Ali Minaie
d17f020fc5 fixed a lot of things getting ready to push overwrite master-1.12 2018-09-20 12:59:34 -04:00
Mohammad-Ali Minaie
498847ad88 updating more casting and crucible shit 2018-09-18 17:10:52 -04:00
Mohammad-Ali Minaie
53df487ec2 updated recipe management 2018-09-18 10:00:42 -04:00
Mohammad-Ali Minaie
e083708a57 reworking the casting classes 2018-09-17 23:00:31 -04:00
Mohammad-Ali Minaie
8c6fbac6b0 switch out lacquerstick for OreDict treated stick 2018-09-17 04:53:48 -04:00
Mohammad-Ali Minaie
65e42b39c2 fixed Anvil JEI 2018-09-17 04:38:12 -04:00
Mohammad-Ali Minaie
ff8170b01e trying to add Anvil Recipe JEI 2018-09-17 00:40:34 -04:00
Mohammad-Ali Minaie
4e353b9f3c add JEI for Crucibles, adding JEI for anvil 2018-09-16 21:37:20 -04:00
Mohammad-Ali Minaie
ec1d66e3d7 updating recipe category, trying to render input slots 2018-09-15 20:01:33 -04:00
bfda82bc78 Merge branch 'ansar-jei' of nmd/ForgeCraft into nbtCrucible 2018-09-15 22:39:56 +00:00
srw
c12d708e48 jei test 2018-09-15 15:35:06 -07:00
e38ef6bdfa Merge branch 'ansar-hibachi' of nmd/ForgeCraft into nbtCrucible 2018-09-15 22:11:57 +00:00
srw
49c877afd3 add hibachi/drying recipe for the soft crucible 2018-09-15 15:07:04 -07:00
Mohammad-Ali Minaie
0714f9f0fa update gradle.properties 2018-09-15 17:46:13 -04:00
Mohammad-Ali Minaie
d25777955f jei crashing on load 2018-09-15 16:35:12 -04:00
Mohammad-Ali Minaie
9858d8b553 update checker 2018-09-15 16:13:09 -04:00
Mohammad-Ali Minaie
d0026da88a fuck JEI 2018-09-15 16:08:14 -04:00
Mohammad-Ali Minaie
83a3061a99 fixed Anvil unable to accept upgrades, fixed crucibles not returning cooked output, fixed molten layer model for hot crucibles in blockstate 2018-09-13 08:23:54 -04:00
Mohammad-Ali Minaie
4d889481c0 updating anvilDoWork 2018-09-13 07:23:38 -04:00
Mohammad-Ali Minaie
5d85dd7a8e fixing anvil inventory manager 2018-09-13 07:12:12 -04:00
Mohammad-Ali Minaie
5562a58f44 update todo 2018-09-12 17:19:46 -04:00
Mohammad-Ali Minaie
fd347fe3e3 SlottedTongs now can cool and drop its hot ingot in a barrel or water or rain_water also starting JEI fml 2018-09-11 11:43:09 -04:00
Mohammad-Ali Minaie
63697d731d add all Damascus recipes 2018-09-10 14:17:55 -04:00
Mohammad-Ali Minaie
74a83aaa37 renamed to-dos to avoid merge conflict 2018-09-10 06:07:14 -04:00
Mohammad-Ali Minaie
9f302566f6 updated rendering and models, still need hibachi recipe, JEI, and CT 2018-09-10 06:06:07 -04:00
Mohammad-Ali Minaie
bdf423d764 fixed renders, models, and casting logic 2018-09-07 10:47:37 -04:00
Mohammad-Ali Minaie
e7abf79946 updates to rendering and models, need more 2018-09-04 22:07:45 -04:00
Mohammad-Ali Minaie
7828c9b110 update breaker handler to match master-1.12 2018-09-01 17:06:45 -04:00
Mohammad-Ali Minaie
84992ccdc1 ready to start CT support. Need to make sure tongs models are still good 2018-08-31 08:13:55 -04:00
Mohammad-Ali Minaie
d8256951d4 item render is working, need to add all use cases 2018-08-30 08:19:31 -04:00
Mohammad-Ali Minaie
5f8d0c40c2 updated assets trying to get the itemnbtcrucible rendering to work 2018-08-30 08:05:24 -04:00
Mohammad-Ali Minaie
d0578ca56b need to updated nbtCrucible models to have textured filling instead of flat also need to updated dirt_sand texture 2018-08-21 23:13:48 -04:00
Mohammad-Ali Minaie
3e98f3998c updated models, addted to todo.md 2018-08-21 17:41:18 -04:00
Mohammad-Ali Minaie
132cb98443 updated assets 2018-08-21 08:05:32 -04:00
Mohammad-Ali Minaie
ba55b234b6 matched code in a class to avoid future merge conflict 2018-08-19 17:41:11 -04:00
Mohammad-Ali Minaie
04a1a50f08 updating resources to match new crucible rendering 2018-08-19 17:22:09 -04:00
Mohammad-Ali Minaie
71eaeb1d5d modified the updated logic for the crucible to write to nbt state changes 2018-08-19 02:21:29 -04:00
Mohammad-Ali Minaie
d77142c6e0 cant figure out issue with picking up and placing crucibles and not remembering state, probably has to do with placement code 2018-08-19 02:00:45 -04:00
Mohammad-Ali Minaie
4c967f7e87 updated crucible to have filling textures 2018-08-17 21:03:24 -04:00
Mohammad-Ali Minaie
935371ed6c updated tickets and todos 2018-08-15 11:41:29 -04:00
Mohammad-Ali Minaie
01e97eacff version updating complete 2018-08-14 16:15:20 -04:00
Mohammad-Ali Minaie
a633ace5e3 update Forge and dependency versions 2018-08-14 16:14:36 -04:00
Mohammad-Ali Minaie
9807be1f8d made updates with new Core version need to update gradle properties 2018-08-14 16:12:42 -04:00
Mohammad-Ali Minaie
fdc0d90144 fixed the bronze ingot crucible upgrades, need to modify the casting recipes and the nbtcrucible model to open top 2018-06-02 14:56:45 -04:00
Mohammad-Ali Minaie
2b4b432db1 fixed crafttweaker breaking launch but messed up rendering 2018-05-29 14:56:52 -04:00
Mohammad-Ali Minaie
6d8e0c2187 update wootz crafting 2018-05-06 01:45:44 -04:00
Mohammad-Ali Minaie
1889fd10a0 a lot of things to delete, need to add bronze crucible recipe, need to remove bloomery recipes and update crucible recipes, need wootz tools and weaponss 2018-05-06 00:39:45 -04:00
Mohammad-Ali Minaie
bb7c22aac2 more tongs and ingot assets 2018-04-30 22:01:06 -04:00
Mohammad-Ali Minaie
b7eb357f9d refactor all the anvil code and the slot tongs code, need to finish all the slotted tongs models now 2018-04-30 01:27:50 -04:00
Mohammad-Ali Minaie
b593173489 removed a lot of blocks removed block ingots and made them all items 2018-04-07 23:24:13 -04:00
Mohammad-Ali Minaie
024360389e much closer to stable state 2018-03-11 21:29:09 -04:00
Mohammad-Ali Minaie
117b3fd0f3 updated state doesn't seem to be working 2018-03-10 23:21:12 -05:00
Mohammad-Ali Minaie
cadbe7e204 more json updates 2018-03-10 23:09:51 -05:00
Mohammad-Ali Minaie
6b763a0337 updated the blockstate 2018-03-10 23:06:56 -05:00
Mohammad-Ali Minaie
adae8e3d82 need to use state with executing state 2018-03-10 22:09:34 -05:00
Mohammad-Ali Minaie
4bb3b25286 fixed rendering issue with placing crucible again aslo it wont change color 2018-02-25 16:20:26 -05:00
Mohammad-Ali Minaie
ebad0995ef Whiteshirt found blocks and itemBlocks being registered for everything 2018-02-25 15:17:33 -05:00
Mohammad-Ali Minaie
0d7b17305e trying to render the crucible 2018-02-25 14:51:23 -05:00
Mohammad-Ali Minaie
30dba0752e fixing merge conflict 2018-02-25 12:39:05 -05:00
Mohammad-Ali Minaie
7506534655 updated version 2018-02-25 11:59:02 -05:00
Mohammad-Ali Minaie
31a063532a merge conflict in peroperties 2018-02-24 19:45:34 -05:00
Mohammad-Ali Minaie
983d6b0418 commit current functioning code, needs assets 2018-02-24 19:43:22 -05:00
8932f51e90 Merge branch 'primal-update-20180223' of nmd/ForgeCraft into master-1.12 2018-02-24 02:37:53 +00:00
8b033972ac update primal FireSource method, convert old EntityMuck reference to EntityMud, update CT build.gradle references 2018-02-23 18:29:50 -08:00
Mohammad-Ali Minaie
01250d528c crucible happy path is working 2018-01-25 13:34:04 -05:00
Mohammad-Ali Minaie
72c4677c4b fixed the langFile name 2018-01-07 18:02:15 -05:00
Mohammad-Ali Minaie
81c9ff54a7 happy path achieved 2018-01-07 00:45:42 -05:00
Mohammad-Ali Minaie
390248afd3 fixed merge conflicts 2018-01-06 19:35:43 -05:00
Mohammad-Ali Minaie
64429816bd updated to primal 0.6.12 2018-01-06 19:29:50 -05:00
Mohammad-Ali Minaie
008332636b crazy nbt full retard need to make an itemslot 2018-01-06 17:33:33 -05:00
Mohammad-Ali Minaie
19730303c2 crucible add and pickup is working 2017-12-17 02:20:14 -05:00
Mohammad-Ali Minaie
a40b72eea6 push more 2017-12-17 00:56:21 -05:00
Mohammad-Ali Minaie
b3275e5f8e pusing current code 2017-12-17 00:50:14 -05:00
Mohammad-Ali Minaie
8a4d0cf70c trying to pass NBT around and crashing 2017-12-17 00:09:25 -05:00
Mohammad-Ali Minaie
392914ede3 fixed spewing broken tool heads 2017-12-02 18:05:18 -05:00
Mohammad-Ali Minaie
3a1c9676ab fixed bugs pushed .02 2017-11-29 22:13:57 -05:00
Mohammad-Ali Minaie
c7be7d569f crucible recipe manager is working 2017-11-29 06:59:36 -05:00
Mohammad-Ali Minaie
c32b0be9cc fixed the crucible crafting 2017-11-24 00:20:41 -05:00
Mohammad-Ali Minaie
4fd1da1215 got ingredient recipe 2017-11-16 22:04:44 -05:00
Mohammad-Ali Minaie
37ab61a195 trying nbt based crucible processing 2017-11-13 07:55:44 -05:00
Mohammad-Ali Minaie
a4512116cf Adding Helmet, command to show wiki, modify rendering, create recipe for shift click or lack of nonsense 2017-11-05 13:34:21 -05:00
An Sar
de70bb442c Merge branch 'ansar-0.6' of nmd/ForgeCraft into master-1.12 2017-10-28 23:18:51 +00:00
a7e3b222fe Merge branch 'master-1.12' into ansar-0.6 2017-10-28 16:10:42 -07:00
08ecdf8fa4 update mcp mappings, sync with changes in primal 0.6.x 2017-10-28 16:06:08 -07:00
Mohammad-Ali Minaie
b8e84dc824 update to client proxy registry 2017-10-28 18:50:20 -04:00
Mohammad-Ali Minaie
118ef3f90b Trying to add armor 2017-10-25 19:37:34 -04:00
a79a372729 Merge branch 'tile-factory' of nmd/ForgeCraft into master-1.12 2017-10-16 17:51:58 +00:00
4203c42cb4 update to primal 0.6.x, version bump, increase forge to 1.12.2 2017-10-05 20:42:12 -07:00
Mohammad-Ali Minaie
f5bd23682c updated lang file but lots of diff changes 2017-10-04 13:48:23 -04:00
Mohammad-Ali Minaie
6a0b872ebc not completing download of Primal 5.11 dependency 2017-09-16 13:28:16 -04:00
Mohammad-Ali Minaie
f708ac25f5 version bump 2017-09-16 10:47:08 -04:00
Mohammad-Ali Minaie
01834a6d77 fixed the API occorunces 2017-09-16 10:45:49 -04:00
Mohammad-Ali Minaie
b3d329c273 switch 12.1 to 12 2017-09-15 16:35:52 -04:00
Mohammad-Ali Minaie
9038bfc5ea fixed forge version 2017-09-15 16:31:45 -04:00
Mohammad-Ali Minaie
6d3533e588 big diff in the files 2017-09-15 16:15:23 -04:00
Mohammad-Ali Minaie
6f955f14f0 updating with new primal version 2017-09-15 16:12:49 -04:00
b374045de2 Merge branch 'primal-update' of nmd/ForgeCraft into master-1.12 2017-09-15 10:27:26 +00:00
b29071c6b4 Primal Blocks/Items refactor 2017-09-14 21:18:48 -07:00
b07102edd5 Update PrimalCore API changes 2017-09-14 18:15:47 -07:00
Mohammad-Ali Minaie
f0377332d8 fixed heating of damaged tools 2017-09-04 21:30:58 -04:00
Mohammad-Ali Minaie
622a3f4b17 fixing bugs 2017-09-04 13:24:17 -04:00
Mohammad-Ali Minaie
6fd05cffd5 updating lang file 2017-09-03 22:29:58 -04:00
srw
33c0582287 update to 1.12.1 2017-08-30 19:04:06 -07:00
Mohammad-Ali Minaie
6f084a9fa2 updating the .12 branch 2017-07-28 00:03:09 -04:00
Mohammad-Ali Minaie
24793d7606 update all branches with new build version 2017-07-16 15:14:40 -04:00
7f9e5ad294 Merge branch 'crashfix-20170716' of nmd/ForgeCraft into master-1.11 2017-07-16 19:13:32 +00:00
srw
eb07701181 replace tag methods with NBTHelpers, fixes null point exception crash 2017-07-16 15:08:28 -04:00
Mohammad-Ali Minaie
6476b0aee1 update to fix bug with toolhead drop missing NBT 2017-07-15 14:30:13 -04:00
Mohammad-Ali Minaie
4e270cccc1 update to newest primal version 2017-07-08 18:25:59 -04:00
Mohammad-Ali Minaie
f9e546d66b oops wrong branch 2017-07-08 13:57:37 -04:00
Mohammad-Ali Minaie
25d426ff31 fixed item drop for item tool breaking and breaker not breaking 2017-07-06 06:28:28 -04:00
Mohammad-Ali Minaie
210c023f2b fixed bug where tool could be repaired for free 2017-07-05 22:25:00 -04:00
Mohammad-Ali Minaie
6744c4b22d fixed epic dup bug and added broken item drops for tools, ur still better off not breaking ur tool 2017-07-05 22:15:32 -04:00
Mohammad-Ali Minaie
d0a9606931 version bump 2017-07-04 21:29:39 -04:00
Mohammad-Ali Minaie
93374f71d9 fix bunch of shit 2017-07-04 21:28:53 -04:00
Mohammad-Ali Minaie
d597e3d2c6 fixed longbow bug 2017-07-03 23:43:24 -04:00
Mohammad-Ali Minaie
226eb7a62f fixing stonetongs bug unable to replicate switching all state flags to 2 2017-07-03 20:26:37 -04:00
Mohammad-Ali Minaie
3040b4cc52 merge longbow and version bump 2017-07-03 18:51:29 -04:00
Mohammad-Ali Minaie
256ea2b4db update sound 2017-07-03 18:47:11 -04:00
Mohammad-Ali Minaie
f3e71409fd finished feature arrow 2017-07-03 18:44:21 -04:00
Mohammad-Ali Minaie
4440c4bd19 tweaked recipes 2017-07-03 08:47:13 -04:00
Mohammad-Ali Minaie
034ab4b8d0 gotta go wash my hair 2017-07-03 00:20:17 -04:00
Mohammad-Ali Minaie
92e96fd13f commiting b4 going out 2017-07-02 16:39:54 -04:00
Mohammad-Ali Minaie
a3eac08572 not adding that shit file 2017-07-02 11:16:14 -04:00
Mohammad-Ali Minaie
ee788d0b35 fixed missing recipe and breaker bug 2017-06-27 22:20:55 -04:00
Mohammad-Ali Minaie
16868d3a1c lang file bug switch getVanillaBurnItemtime 2017-06-26 10:17:40 -04:00
Mohammad-Ali Minaie
49007061d0 1.12 update 2017-06-26 00:19:38 -04:00
Mohammad-Ali Minaie
b8b80fb547 Merge branch 'master' into master-1.12 2017-06-25 22:50:14 -04:00
Mohammad-Ali Minaie
3928deeb7b moved 1.11 to kfc 2017-06-25 22:49:46 -04:00
Mohammad-Ali Minaie
3a40744de2 tryd to update gotta wait 2017-06-25 22:47:48 -04:00
Mohammad-Ali Minaie
3e1afd631b init to 1.12 2017-06-25 22:34:06 -04:00
Mohammad-Ali Minaie
e86fa3f518 master commit 2017-06-25 22:25:54 -04:00
Mohammad-Ali Minaie
0189c176df prepping for update 2017-06-25 16:29:51 -04:00
Mohammad-Ali Minaie
69b25b37ff i think ready for update 2017-06-25 14:58:57 -04:00
Mohammad-Ali Minaie
27e670e537 all the assets, casting recipes, bloomery recipes and tweaks, upgrades done 2017-06-25 03:42:41 -04:00
Mohammad-Ali Minaie
42f1621fea bronze assets finished, bronze casting finished 2017-06-24 16:04:20 -04:00
Mohammad-Ali Minaie
c2a22770f7 more casting stuff, need to make the actual tool parts and tools 2017-06-24 04:19:17 -04:00
Mohammad-Ali Minaie
c21ca30137 maded assets for pickcast added crafting handler and drying state 2017-06-22 22:45:28 -04:00
Mohammad-Ali Minaie
6fc8485f82 crafting twerk for diamond and emerald 2017-06-22 16:12:31 -04:00
Mohammad-Ali Minaie
e948ec99c9 casting crafting, say that 5 times fast 2017-06-22 16:09:57 -04:00
Mohammad-Ali Minaie
10b7e8d75b updated models and slot code, need to add recipe handler 2017-06-21 09:01:26 -04:00
Mohammad-Ali Minaie
431b93bf31 fixed bugs initial slot manager handler for casting added 2017-06-20 22:41:18 -04:00
Mohammad-Ali Minaie
53680a59c8 gettig ready to make tesr 2017-06-20 16:18:06 -04:00
Mohammad-Ali Minaie
4d33953135 model issues and refactoring 2017-06-19 07:55:57 -04:00
Mohammad-Ali Minaie
5305247683 getting ready for casting feature 2017-06-19 05:41:05 -04:00
Mohammad-Ali Minaie
b832af808f fixed merge conflicts 2017-06-18 15:55:01 -04:00
Mohammad-Ali Minaie
8aefcbbf09 finished adobe brick bloom and forge blocks, refactored forge, bloomery, and anvil 2017-06-18 15:51:01 -04:00
Mohammad-Ali Minaie
4e5ada44cf adobe forge, adobe bloomery, refactor forge bloomery stonetongs 2017-06-18 14:35:20 -04:00
Mohammad-Ali Minaie
9a607d5abd need to do adobe bloomery item model and update brick bloomery model 2017-06-18 05:10:47 -04:00
Mohammad-Ali Minaie
e72f91d3ac pushing changes i made in the wrong branch 2017-06-18 01:23:08 -04:00
Mohammad-Ali Minaie
f503570db7 pushing to ull new branch 2017-06-14 21:39:11 -04:00
Mohammad-Ali Minaie
d1b0d02131 fixed ingot dupe bug 2017-06-12 15:30:57 -04:00
Mohammad-Ali Minaie
8f30ff4e96 commiting b4 switch to bugfix branch 2017-06-12 15:08:31 -04:00
Mohammad-Ali Minaie
350461ee1c updating before system restart 2017-06-11 21:27:13 -04:00
Mohammad-Ali Minaie
f11bc16690 Merge branch 'master' of ssh://git.nmd.so:12000/nmd/ForgeCraft 2017-06-11 21:09:49 -04:00
37a8321d87 Merge branch 'configfile' of nmd/ForgeCraft into master 2017-06-12 01:09:04 +00:00
9f5a391539 Basic config file 2017-06-11 18:04:51 -07:00
Mohammad-Ali Minaie
407eceafa4 fixed anvil to not drop hot things 2017-06-11 18:46:11 -04:00
Mohammad-Ali Minaie
8ae050bddd all the bug fixes, refactoring, and feauture upgrades 2017-06-11 17:42:50 -04:00
Mohammad-Ali Minaie
b7d2b6580a working on block breaker 2017-06-11 02:13:27 -04:00
Mohammad-Ali Minaie
981d117f3d anvil rendering updates, anvil handler to reduce code localization, tong items now have IDs associated to the item registration to make matching them easier 2017-06-11 01:44:30 -04:00
Mohammad-Ali Minaie
7f6d9616ba fixing it so you can't crash urself like a dumb dumb 2017-06-10 17:33:36 -04:00
Mohammad Minaie
2f0dbfa973 Merge pull request #12 from kitsushadow/test
fixing makeSmoke missing dependencies
2017-06-10 02:02:26 -04:00
Zainkai
f9e8ba52ad deleting unnessary test file 2017-06-09 22:31:20 -07:00
Zainkai
7934f8ba65 testing 2017-06-09 22:25:33 -07:00
4745 changed files with 64840 additions and 44724 deletions

449
.idea/workspace.xml generated
View File

@@ -2,26 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="2374d888-04b5-4300-967c-f257dee6cdd6" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/CommonUtils.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/CommonUtils.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/ForgeCraft.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/ForgeCraft.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/ModInfo.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/ModInfo.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/blocks/Firebox.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/blocks/Firebox.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/blocks/PistonBellows.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/blocks/PistonBellows.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/compat/FuelHandler.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/compat/FuelHandler.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/init/ModRegistries.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/init/ModRegistries.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/init/ModTiles.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/init/ModTiles.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/items/BaseItem.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/items/BaseItem.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/items/ItemTest.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/items/ItemTest.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/proxy/ClientProxy.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/proxy/ClientProxy.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/renders/TileFireboxRender.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/renders/TileFireboxRender.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/renders/TilePistonBellowsRender.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/renders/TilePistonBellowsRender.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/tiles/BaseTile.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/tiles/BaseTile.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/tiles/TileBaseSlot.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/tiles/TileBaseSlot.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/tiles/TileFirebox.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/tiles/TileFirebox.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/tiles/TilePistonBellows.java" afterPath="$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/tiles/TilePistonBellows.java" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
@@ -33,33 +14,23 @@
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FUSProjectUsageTrigger">
<session id="1807367187">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.closed" value="2" />
<entry key="project.open.time.0" value="1" />
<entry key="project.open.time.4" value="1" />
<entry key="project.opened" value="2" />
</counts>
</usages-collector>
</session>
</component>
<component name="FavoritesManager">
<favorites_list name="ForgeCraft" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="PistonBellows.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/blocks/PistonBellows.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Firebox.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/blocks/Firebox.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-510">
<caret line="42" column="77" lean-forward="true" selection-start-line="42" selection-start-column="4" selection-end-line="42" selection-end-column="77" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
<leaf />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
@@ -72,251 +43,114 @@
<entry key="$PROJECT_DIR$/../PrimalCore" value="2962994312000" />
</map>
</option>
<option name="externalProjectsViewState">
<projects_view />
</option>
</component>
<component name="ProjectFrameBounds">
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="y" value="22" />
<option name="width" value="1680" />
<option name="height" value="1050" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ForgeCraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="ForgeCraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ForgeCraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="ForgeCraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="1.11" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ForgeCraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="ForgeCraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="1.11" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ForgeCraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="ForgeCraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="1.11" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="java" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="nmd" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="primal" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="forgecraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ForgeCraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="ForgeCraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="1.11" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="java" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="nmd" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="primal" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="forgecraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="blocks" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ForgeCraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="ForgeCraft" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="1.11" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<expand>
<path>
<item name="ForgeCraft" type="b2602c69:ProjectViewProjectNode" />
<item name="ForgeCraft" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="ForgeCraft" type="b2602c69:ProjectViewProjectNode" />
<item name="ForgeCraft" type="462c0819:PsiDirectoryNode" />
<item name="kfc" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="ForgeCraft" type="b2602c69:ProjectViewProjectNode" />
<item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
</path>
<path>
<item name="ForgeCraft" type="b2602c69:ProjectViewProjectNode" />
<item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
<item name="&lt; 1.8 &gt;" type="70bed36:NamedLibraryElementNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
<pane id="Scratches" />
<pane id="PackagesPane" />
<pane id="Scope" />
<pane id="AndroidView" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/kfc/build.gradle" />
<property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.0" />
<property name="FullScreen" value="true" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager">
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<predefined_log_file id="idea.log" enabled="true" />
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<module />
<method />
<method>
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
<method>
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="build" type="GroovyScriptRunConfiguration" factoryName="Groovy" temporary="true">
<module name="ForgeCraft" />
<setting name="path" value="file://$PROJECT_DIR$/kfc/build.gradle" />
<setting name="vmparams" value="" />
<setting name="params" value="" />
<setting name="workDir" value="file://$PROJECT_DIR$/kfc" />
<setting name="debug" value="false" />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
<method>
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
@@ -325,26 +159,39 @@
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
<method>
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<predefined_log_file id="idea.log" enabled="true" />
<method>
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Groovy.build" />
</list>
</recent_temporary>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
@@ -353,72 +200,58 @@
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1482033001334</updated>
<workItem from="1538459982472" duration="37000" />
<workItem from="1538460037447" duration="7000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="44000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="0" width="1680" height="1050" extended-state="6" />
<editor active="true" />
<frame x="-8" y="-8" width="2576" height="1416" extended-state="6" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Nl-Palette" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32958034" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info anchor="right" id="Palette" order="4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Messages" />
<window_info anchor="right" id="Palette&#9;" order="8" />
<window_info id="Image Layers" order="3" />
<window_info anchor="right" id="Capture Analysis" order="5" />
<window_info anchor="bottom" id="Event Log" order="8" side_tool="true" weight="0.32958034" />
<window_info anchor="right" id="Maven Projects" order="9" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="bottom" id="Version Control" order="9" />
<window_info active="true" anchor="bottom" id="Terminal" order="7" visible="true" weight="0.33386454" />
<window_info id="Capture Tool" order="6" />
<window_info id="Designer" order="4" />
<window_info anchor="right" content_ui="combo" id="Project" order="10" visible="true" weight="0.16613673" />
<window_info id="Structure" order="0" side_tool="true" weight="0.25" />
<window_info anchor="right" id="Ant Build" order="2" weight="0.25" />
<window_info id="UI Designer" order="5" />
<window_info anchor="right" id="Theme Preview" order="6" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="3" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info id="Nl-Palette" order="1" />
<window_info anchor="right" id="Commander" order="1" weight="0.4" />
<window_info anchor="right" id="Properties" order="7" />
<window_info anchor="right" id="Database" order="0" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Database Changes" order="10" show_stripe_button="false" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Find" order="1" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/CommonUtils.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/blocks/Firebox.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-510">
<caret line="42" column="77" lean-forward="true" selection-start-line="42" selection-start-column="4" selection-end-line="42" selection-end-column="77" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/blocks/PistonBellows.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/CommonUtils.java" />
<entry file="file://$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/blocks/Firebox.java" />
<entry file="file://$PROJECT_DIR$/1.11/src/main/java/nmd/primal/forgecraft/blocks/PistonBellows.java" />
</component>
</project>

View File

@@ -1,28 +0,0 @@
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.

View File

@@ -1,59 +0,0 @@
-------------------------------------------
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
==============================
Step 1: Open your command-line and browse to the folder where you extracted the zip file.
Step 2: Once you have a command window up in the folder that the downloaded material was placed, type:
Windows: "gradlew setupDecompWorkspace"
Linux/Mac OS: "./gradlew setupDecompWorkspace"
Step 3: After all that finished, you're left with a choice.
For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux)
If you preffer to use IntelliJ, steps are a little different.
1. Open IDEA, and import project.
2. Select your build.gradle file and have it import.
3. Once it's finished you must close IntelliJ and run the following command:
"gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)
Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project)
If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not effect your code} and then start the processs again.
Should it still not work,
Refer to #ForgeGradle on EsperNet for more information about the gradle environment.
Tip:
If you do not care about seeing Minecraft's source code you can replace "setupDecompWorkspace" with one of the following:
"setupDevWorkspace": Will patch, deobfusicated, and gather required assets to run minecraft, but will not generated human readable source code.
"setupCIWorkspace": Same as Dev but will not download any assets. This is useful in build servers as it is the fastest because it does the least work.
Tip:
When using Decomp workspace, the Minecraft source code is NOT added to your workspace in a editable way. Minecraft is treated like a normal Library. Sources are there for documentation and research purposes and usually can be accessed under the 'referenced libraries' section of your IDE.
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.
LexManos' Install Video
=======================
https://www.youtube.com/watch?v=8VEdtQLuLO0&feature=youtu.be
For more details update more often refer to the Forge Forums:
http://www.minecraftforge.net/forum/index.php/topic,14048.0.html

File diff suppressed because it is too large Load Diff

View File

@@ -1,28 +0,0 @@
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.

View File

@@ -1,483 +0,0 @@
Minecraft Forge is licensed under the terms of the LGPL 2.1 found
here http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt and copied
below.
A note on authorship:
All source artifacts are property of their original author, with
the exclusion of the contents of the patches directory and others
copied from it from time to time. Authorship of the contents of
the patches directory is retained by the Minecraft Forge project.
This is because the patches are partially machine generated
artifacts, and are changed heavily due to the way forge works.
Individual attribution within them is impossible.
Consent:
All contributions to Forge must consent to the release of any
patch content to the Forge project.
A note on infectivity:
The LGPL is chosen specifically so that projects may depend on Forge
features without being infected with its license. That is the
purpose of the LGPL. Mods and others using this code via ordinary
Java mechanics for referencing libraries are specifically not bound
by Forge's license for the Mod code.
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS

View File

@@ -1,26 +0,0 @@
* Eloraam *
* FlowerChild *
* Hawkye *
* MALfunction84 *
Submitted the sleep handler code for his mod (Somnia) and others to use.
* Scokeev9 *
Gave permission for ScotTools API to be integrated into MCF, and also supported the Forge by converting his mods to use it.
ScotTools Background: ScotTools was an API that enabled modders to add blocks to harvesting levels (and many other ease-of-use features to create new tools), and the first tool API that used block material for block breaking efficiency which allowed blocks from mods that didn't use ScotTools API to break with the correct speed.
* SpaceToad *
* LexManos *
* cpw *
* Minecraft Coder Pack (MCP) *
Forge Mod Loader and Minecraft Forge have permission to distribute and automatically download components of MCP and distribute MCP data files.
This permission is not transitive and others wishing to redistribute the Minecraft Forge source independently should seek permission of MCP or
remove the MCP data files and request their users to download MCP separately.

View File

@@ -1,10 +0,0 @@
IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -1,40 +0,0 @@
SoundSystem CodecIBXM Class License:
You are free to use this class for any purpose, commercial or otherwise.
You may modify this class or source code, and distribute it any way you
like, provided the following conditions are met:
1) You may not falsely claim to be the author of this class or any
unmodified portion of it.
2) You may not copyright this class or a modified version of it and then
sue me for copyright infringement.
3) If you modify the source code, you must clearly document the changes
made before redistributing the modified source code, so other users know
it is not the original code.
4) You are not required to give me credit for this class in any derived
work, but if you do, you must also mention my website:
http://www.paulscode.com
5) I the author will not be responsible for any damages (physical,
financial, or otherwise) caused by the use if this class or any
portion of it.
6) I the author do not guarantee, warrant, or make any representations,
either expressed or implied, regarding the use of this class or any
portion of it.
Author: Paul Lamb
http://www.paulscode.com
This software is based on or using the IBXM library available from
http://www.geocities.com/sunet2000/
IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -1,59 +0,0 @@
-------------------------------------------
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
==============================
Step 1: Open your command-line and browse to the folder where you extracted the zip file.
Step 2: Once you have a command window up in the folder that the downloaded material was placed, type:
Windows: "gradlew setupDecompWorkspace"
Linux/Mac OS: "./gradlew setupDecompWorkspace"
Step 3: After all that finished, you're left with a choice.
For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux)
If you preffer to use IntelliJ, steps are a little different.
1. Open IDEA, and import project.
2. Select your build.gradle file and have it import.
3. Once it's finished you must close IntelliJ and run the following command:
"gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)
Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project)
If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not effect your code} and then start the processs again.
Should it still not work,
Refer to #ForgeGradle on EsperNet for more information about the gradle environment.
Tip:
If you do not care about seeing Minecraft's source code you can replace "setupDecompWorkspace" with one of the following:
"setupDevWorkspace": Will patch, deobfusicated, and gather required assets to run minecraft, but will not generated human readable source code.
"setupCIWorkspace": Same as Dev but will not download any assets. This is useful in build servers as it is the fastest because it does the least work.
Tip:
When using Decomp workspace, the Minecraft source code is NOT added to your workspace in a editable way. Minecraft is treated like a normal Library. Sources are there for documentation and research purposes and usually can be accessed under the 'referenced libraries' section of your IDE.
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.
LexManos' Install Video
=======================
https://www.youtube.com/watch?v=8VEdtQLuLO0&feature=youtu.be
For more details update more often refer to the Forge Forums:
http://www.minecraftforge.net/forum/index.php/topic,14048.0.html

View File

@@ -1,179 +0,0 @@
To-Dos
*** Bugs ***
*** Priority ***
*** Feature Musket ***
- [ ] Create powder charge item (copper, charcoal, gunpowder)
- [ ] Create musket round item (lead or iron nugget)
- [ ] Create wadding item (paper)
- [ ] Create soaked slow match item (cordage, bucket of water, gunpowder)
- [ ] Create dried slow match (soaked wick on drying rack)
- [ ] Create lit slow match (dried slow match and firebow/torch/flint&steel)
- [ ] Create barrel item
- [ ] Create stock item
- [ ] Create lock assembly item
*** Backlog ***
- [ ] Move Ingot break into chunks logic out of the block and into the ForgeHammer
- [ ] Add Yew
- [ ] Add Iron Ring Recipe
- [ ] Add chainmail recipe
- [ ] Add Iron Shield
- [ ] Gold Smelting
- [ ] Create a method which adds the types of NBT upgrades and creates a unique float instead of using magic numbers
- [ ] Add forgehammer to oreDict
- [ ] WeaponHead recipes
- [ ] Casting Table
- [ ] Block
- [ ] Gui
- [ ] Crafting recipes
*** Tid-Bits ***
sed -i -- 's/iron/steel/g' *
rm *.json--
rename s/iron/steel/ iron*
*** Completed ***
- [x] StoneTongs for all tool heads
- [x] ItemNBT
- [x] ItemRender
- [x] JSON
- [x] Change how bloomery does recipe cookTime
- [x] Duplication Bug for Tool Repair
- [x] Fix Breaker Render to rotate correctly
- [x] Make All Accompanying Recipes
- [x] Update blockstates with:
- [x] cleanIron
- [x] steel
- [x] wootz
- [x] Make an Iron Anvil
- [x] Check Iron Anvil creation logic
- [x] Make New Ore Tool, Tool Part, Ingot, and Chunk Assets
- [x] Make Steel Recipes and Tools
- [x] Make Wootz Recipes and Tools
- [x] Update tool parts and tool textures
- [x] Light Forge and Firebox with Firebow or Torch
- [x] Any gallagher can be used to make a stone anvil
- [x] Update Crafting for tools to include leatherStrap
- [x] Forge Setting Player on fire but not taking damage
- [x] Forge and Bloomery make Smoke
- [x] Remove cool ingots from inventories with Hand
- [x] Remove cool tools heads from inventories with Hand
- [x] Add rendering in anvil renderer for Cool Ingots
- [x] Hot Ingots should cool down
- [x] Coal is not being removed from the forge or firebox
- [x] Tool Disassembly
- [x] Tool Repair
- [x] Custom Tool Material
- [x] Can't remove fuel from Bloomery
- [x] Crafting Recipe for Iron Ingot to Iron Ball
- [x] Block To Read Temperature
- [x] Bellows Moves Faster
- [x] Create the hoe Item
- [x] Finish Toolhead Recipes
- [x] Add randomInt to anvil
- [x] Create the axe Item
- [x] Create the shovel Item
- [x] Create the axe Model
- [x] Create the shovel model
- [x] Create the hoe model
- [x] Fix Flame creator from Forge and Bloomery
- [x] Copy Heat Handler for Forge to Bloomery
- [x] Create getter and setter for itemNBT
- [x] Create all the textures for all the NBT types
- [x] Check for if the pickaxe head is hot before removing from forge
- [x] fix rotation rendering for Anvil
- [x] Fix renderings in the Anvil
- [x] Fix Renderings in the Forge
- [x] Fix StoneTongs rendering for NBT 8
- [x] Allow redstone, lapis, and shards in the anvil
- [x] Create toolHead Item
- [x] Give toolHead item NBT
- [x] Create pickaxehead Item
- [x] Create pickaxehead SubNBTs
- [x] Create Forging Recipe for toolHeads
- [x] Create Anvil recipe for toolHeads
- [x] Create Slot for Forge to accept toolheads in slot 4
- [x] Stone Anvil
- [x] Stone Anvil Inventory
- [x] Stone Anvil Tile
- [x] Stone Anvil Crafting
- [x] TESR Inventory Rendering for Anvil
- [x] Iron Chunk Item Model
- [x] Anvil Item Model
- [x] StoneTongs Iron Chunks
- [x] Hammer Crafting
- [x] Iron Chunking
- [x] Forge Recipe Handler
- [x] Hot Iron Ingot Recipe
- [x] Block Drop for failed crucible
- [x] oreDictionary ingotBall to ingotIron
- [x] Tile Firebox Heat Manager
- [x] Fix Bloomery Lit Texture
- [x] Bellows break texture
- [x] Bellows Pump Speed
- [x] Break IronCrucible gives back Ore
- [x] Tile Bloomery Heat Manager
- [x] Tongs Model for hotIron
- [x] Tongs Model for hotIronCooked
- [x] Tongs Model for hotIronBurnt
- [x] Tongs Extract from bloomery for Hot Iron
- [x] Tongs Extract from bloomery for Hot Iron Finished
- [x] Crafting Recipes
0 | Default StoneTongs
1 | Empty Crucible Hot
2 | Empty Crucible Cracked Hot
================================
3 | Hot Iron Crucible
4 | Hot Cooked Iron Crucible
5 | Hot Failed Iron Crucible
6 | Hot Iron Ingot
7 | Hot Iron Chunk
--------------------------------
8 | Hot Iron Pickaxe Head
9 | Hot Iron Axe Head
10 | Hot Iron Shovel Head
11 | Hot Iron Hoe Head
================================
12 | Hot Clean Iron Crucible
13 | Hot Cooked Clean Iron Crucible
14 | Hot Failed Clean Iron Crucible
15 | Hot Clean Iron Ball
16 | Hot Clean Iron Chunk
--------------------------------
17 | Hot Clean Iron Pickaxe Head
18 | Hot Clean Iron Axe Head
19 | Hot Clean Iron Shovel Head
20 | Hot Clean Iron Hoe Head
================================
21 | Hot Steel Crucible
22 | Hot Cooked Steel Crucible
23 | Hot Failed Steel Crucible
24 | Hot Steel Ingot
25 | Hot Steel Chunk
--------------------------------
26 | Hot Steel Pickaxe Head
27 | Hot Steel Axe Head
28 | Hot Steel Shovel Head
29 | Hot Steel Hoe Head

View File

@@ -1 +0,0 @@
[]

View File

@@ -1 +0,0 @@
[]

View File

@@ -1,117 +0,0 @@
buildscript {
repositories {
jcenter()
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:2.2-SNAPSHOT'
}
}
repositories {
maven {
name = "jei"
url "http://dvs1.progwml6.com/files/maven"
}
maven {
name = "mobius"
url "http://mobiusstrip.eu/maven"
}
maven {
name = "primal"
url "https://maven.nmd.so"
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'java'
compileJava {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
}
group = "${mod_group}"
version = "${mod_version}"
archivesBaseName = "${mod_name}"
idea { module { inheritOutputDirs = true } }
minecraft {
version = "${mc_version}" + "-" + "${forge_version}"
runDir = "run"
mappings = "${mcp_mappings}"
// JEI
//useDepAts = true
// Replace
replace "@VERSION@", project.mod_version
}
dependencies {
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"
// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
//provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
// except that these dependencies get remapped to your current MCP mappings
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
//deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/ddependency_management.html
// JEI
// https://github.com/mezz/JustEnoughItems
// http://minecraft.curseforge.com/projects/just-enough-items-jei/files
// <MINECRAFT-VERSION> and <JEI-VERSION> can be found on CurseForge, check the file name of the version you want.
//
// compile against the JEI API
deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}:api"
//runtime "mezz.jei:jei_${mc_version}:${jei_version}"
deobfCompile "nmd.primal.core:PrimalCore:${primal_version}:dev"
//runtime "nmd.primal.core:PrimalCore:${primal_version}"
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", "${mod_version}"
inputs.property "mcversion", "${mc_version}"
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':"${mod_version}", 'mcversion':"${mc_version}"
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
// end //

View File

@@ -1,84 +0,0 @@
# Configuration file
client {
# Replace the vanilla bucket models with Forges own dynamic bucket model. Unifies bucket visuals if a mod uses the Forge bucket model.
B:replaceVanillaBucketModel=false
# Toggle off to make missing model text in the gui fit inside the slot.
B:zoomInMissingModelTextInGui=false
# The timestamp of the last reminder to update to Java 8 in number of milliseconds since January 1, 1970, 00:00:00 GMT. Nag will show only once every 24 hours. To disable it set this to some really high number.
D:java8Reminder=0
# Disable culling of hidden faces next to stairs and slabs. Causes extra rendering, but may fix some resource packs that exploit this vanilla mechanic.
B:disableStairSlabCulling=false
# Enable forge to queue all chunk updates to the Chunk Update thread. May increase FPS significantly, but may also cause weird rendering lag. Not recommended for computers without a significant number of cores available.
B:alwaysSetupTerrainOffThread=false
}
general {
# Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github.
B:disableVersionCheck=false
# Controls the number threshold at which Packet51 is preferred over Packet52, default and minimum 64, maximum 1024
I:clumpingThreshold=64
# Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipes. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI.
B:sortRecipies=true
# Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES.
B:removeErroringEntities=false
# Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES.
B:removeErroringTileEntities=false
# Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. Default: false
B:fullBoundingBoxLadders=false
# Control the range of sky blending for colored skies in biomes.
I:biomeSkyBlendRange <
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
>
# Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic.
D:zombieBaseSummonChance=0.1
# Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic.
D:zombieBabyChance=0.05
# Enable the forge block rendering pipeline - fixes the lighting of custom models.
B:forgeLightPipelineEnabled=true
# Log cascading chunk generation issues during terrain population.
B:logCascadingWorldGeneration=true
# The time in ticks the server will wait when a dimension was queued to unload. This can be useful when rapidly loading and unloading dimensions, like e.g. throwing items through a nether portal a few time per second.
I:dimensionUnloadQueueDelay=0
B:enableGlobalConfig=false
}
version_checking {
# Enable the entire mod update check system. This only applies to mods using the Forge system.
B:Global=true
}

View File

@@ -1,3 +0,0 @@
#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).
#Sat Apr 01 13:44:13 EDT 2017
eula=true

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +0,0 @@
# ~/.gradle/gradle.properties
#
#org.gradle.daemon=true
org.gradle.jvmargs=-Xmx3G
mod_group=nmd.primal.forgecraft
mod_name=ForgeCraft
mod_version=1.2.22
forge_version=13.20.0.2311
mcp_mappings=snapshot_20170121
mc_version=1.11.2
primal_version=0.4+
jei_version=4.3+
waila_version=1.7.0-B3
apple_version=2.1+

Binary file not shown.

View File

@@ -1 +0,0 @@
[]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 566 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 KiB

View File

@@ -1,39 +0,0 @@
#Minecraft server properties
#Fri Jun 09 22:53:20 PDT 2017
max-tick-time=60000
generator-settings=
force-gamemode=false
allow-nether=true
gamemode=1
enable-query=false
player-idle-timeout=0
difficulty=1
spawn-monsters=false
op-permission-level=4
announce-player-achievements=true
pvp=true
snooper-enabled=true
level-type=DEFAULT
hardcore=false
enable-command-block=false
max-players=20
network-compression-threshold=256
resource-pack-sha1=
max-world-size=29999984
server-port=25565
server-ip=
spawn-npcs=true
allow-flight=true
level-name=world
view-distance=10
resource-pack=
spawn-animals=true
white-list=false
generate-structures=true
online-mode=false
max-build-height=256
level-seed=
use-native-transport=true
prevent-proxy-connections=false
motd=A Minecraft Server
enable-rcon=false

Binary file not shown.

View File

@@ -1,133 +0,0 @@
package nmd.primal.forgecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.items.parts.ToolPart;
import nmd.primal.forgecraft.items.tools.CustomAxe;
import nmd.primal.forgecraft.items.tools.CustomHoe;
import nmd.primal.forgecraft.items.tools.CustomPickaxe;
import nmd.primal.forgecraft.items.tools.CustomShovel;
/**
* Created by mminaie on 3/15/17.
*/
public class CommonEvents implements ToolNBT{
@SubscribeEvent(priority= EventPriority.LOWEST, receiveCanceled=true)
public void onItemCrafted(PlayerEvent.ItemCraftedEvent event) {
if(!event.player.getEntityWorld().isRemote) {
if (event.crafting.getItem() instanceof CustomPickaxe) {
NBTTagCompound tempTag = new NBTTagCompound();
for (int i = 0; i < event.craftMatrix.getSizeInventory(); i++) { // Checks all the slots
if (event.craftMatrix.getStackInSlot(i) != null) { // If there is an item
ItemStack a = event.craftMatrix.getStackInSlot(i); // Gets the item
if (a.getItem() instanceof ToolPart) {
tempTag = a.getSubCompound("tags").copy();
event.crafting.getTagCompound().setTag("tags", tempTag);
event.crafting.getItem().updateItemStackNBT(event.crafting.getTagCompound());
event.crafting.setItemDamage(event.craftMatrix.getStackInSlot(i).getItemDamage());
}
}
}
}
if (event.crafting.getItem() instanceof CustomAxe) {
NBTTagCompound tempTag = new NBTTagCompound();
for (int i = 0; i < event.craftMatrix.getSizeInventory(); i++) { // Checks all the slots
if (event.craftMatrix.getStackInSlot(i) != null) { // If there is an item
ItemStack a = event.craftMatrix.getStackInSlot(i); // Gets the item
if (a.getItem() instanceof ToolPart) {
tempTag = a.getSubCompound("tags").copy();
event.crafting.getTagCompound().setTag("tags", tempTag);
event.crafting.getItem().updateItemStackNBT(event.crafting.getTagCompound());
event.crafting.setItemDamage(event.craftMatrix.getStackInSlot(i).getItemDamage());
}
}
}
}
if (event.crafting.getItem() instanceof CustomShovel) {
NBTTagCompound tempTag = new NBTTagCompound();
for (int i = 0; i < event.craftMatrix.getSizeInventory(); i++) { // Checks all the slots
if (event.craftMatrix.getStackInSlot(i) != null) { // If there is an item
ItemStack a = event.craftMatrix.getStackInSlot(i); // Gets the item
if (a.getItem() instanceof ToolPart) {
tempTag = a.getSubCompound("tags").copy();
event.crafting.getTagCompound().setTag("tags", tempTag);
event.crafting.getItem().updateItemStackNBT(event.crafting.getTagCompound());
event.crafting.setItemDamage(event.craftMatrix.getStackInSlot(i).getItemDamage());
//if( getDiamondLevel(event.crafting) > 0 ){
// event.crafting.getItem().setHarvestLevel("pickaxe", 3);
//}
}
}
}
}
if (event.crafting.getItem() instanceof CustomHoe) {
NBTTagCompound tempTag = new NBTTagCompound();
for (int i = 0; i < event.craftMatrix.getSizeInventory(); i++) { // Checks all the slots
if (event.craftMatrix.getStackInSlot(i) != null) { // If there is an item
ItemStack a = event.craftMatrix.getStackInSlot(i); // Gets the item
if (a.getItem() instanceof ToolPart) {
tempTag = a.getSubCompound("tags").copy();
event.crafting.getTagCompound().setTag("tags", tempTag);
event.crafting.getItem().updateItemStackNBT(event.crafting.getTagCompound());
event.crafting.setItemDamage(event.craftMatrix.getStackInSlot(i).getItemDamage());
//if( getDiamondLevel(event.crafting) > 0 ){
// event.crafting.getItem().setHarvestLevel("pickaxe", 3);
//}
}
}
}
}
if (event.crafting.getItem() instanceof ToolPart) {
NBTTagCompound tempTag = new NBTTagCompound();
for (int i = 0; i < event.craftMatrix.getSizeInventory(); i++) { // Checks all the slots
if (event.craftMatrix.getStackInSlot(i) != null) { // If there is an item
ItemStack a = event.craftMatrix.getStackInSlot(i); // Gets the item
if (a.getItem() instanceof CustomAxe) {
tempTag = a.getSubCompound("tags").copy();
event.crafting.getTagCompound().setTag("tags", tempTag);
event.crafting.getItem().updateItemStackNBT(event.crafting.getTagCompound());
Integer tempDamage = event.craftMatrix.getStackInSlot(i).getItemDamage();
event.crafting.setItemDamage(tempDamage);
}
if (a.getItem() instanceof CustomPickaxe) {
tempTag = a.getSubCompound("tags").copy();
event.crafting.getTagCompound().setTag("tags", tempTag);
event.crafting.getItem().updateItemStackNBT(event.crafting.getTagCompound());
Integer tempDamage = event.craftMatrix.getStackInSlot(i).getItemDamage();
event.crafting.setItemDamage(tempDamage);
}
if (a.getItem() instanceof CustomShovel) {
tempTag = a.getSubCompound("tags").copy();
event.crafting.getTagCompound().setTag("tags", tempTag);
event.crafting.getItem().updateItemStackNBT(event.crafting.getTagCompound());
Integer tempDamage = event.craftMatrix.getStackInSlot(i).getItemDamage();
event.crafting.setItemDamage(tempDamage);
}
if (a.getItem() instanceof CustomHoe) {
tempTag = a.getSubCompound("tags").copy();
event.crafting.getTagCompound().setTag("tags", tempTag);
event.crafting.getItem().updateItemStackNBT(event.crafting.getTagCompound());
Integer tempDamage = event.craftMatrix.getStackInSlot(i).getItemDamage();
event.crafting.setItemDamage(tempDamage);
}
}
}
}
}
}
}

View File

@@ -1,100 +0,0 @@
package nmd.primal.forgecraft;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.init.ModItems;
//import nmd.primal.forgecraft.Item.ModItems;
/**
* Created by kitsu on 11/24/2016.
*/
public class ModInfo {
/** Mod Details**/
public static final String MOD_ID = "forgecraft";
public static final String MOD_NAME = "Kitsu's ForgeCraft";
//public static final String MOD_PREFIX = MOD_ID + ":";
public static final String MOD_CHANNEL = MOD_ID;
public static final String MOD_VERSION = "1.2.22";
public static final String MC_VERSIONS = "[1.11.0, 1.12.0)";
public static final String DEPENDENCIES = "required-after:forge@[13.20.0.2226,);" + "required-after:primal@[0.4,);";
/** Mod Structures **/
public static final String SERVER_PROXY = "nmd.primal.forgecraft.proxy.ServerProxy";
public static final String CLIENT_PROXY = "nmd.primal.forgecraft.proxy.ClientProxy";
//public static final String GUI_FACTORY = "nmd.primal.forgecraft.gui.GuiFactory";
//public static final String UPDATE_JSON = "";
public enum ForgecraftItems {
TEST("test", "itemtest"),
BELLOWSHANDLE("bellowshandle", "bellowshandle"),
STONETONGS("stonetongs", "stonetongs"),
SOFTCRUCIBLE("softcrucible", "softcrucible"),
FORGINGMANUAL("forgingmanual","forgingmanual");
private String unlocalizedName;
private String registryName;
ForgecraftItems(String unlocalizedName, String registryName) {
this.unlocalizedName = unlocalizedName;
this.registryName = registryName;
}
public String getUnlocalizedName() {
return unlocalizedName;
}
public String getRegistryName() {
return registryName;
}
}
public enum ForgecraftBlocks {
FIREBOX("firebox", "firebox"),
PISTONBELLOWS("pistonbellows", "pistonbellows"),
BLOOMERY("bloomery", "bloomery"),
EMPTYCRUCIBLE("emptycrucible", "emptycrucible");
private String unlocalizedName;
private String registryName;
ForgecraftBlocks(String unlocalizedName, String registryName) {
this.unlocalizedName = unlocalizedName;
this.registryName = registryName;
}
public String getUnlocalizedName() {
return unlocalizedName;
}
public String getRegistryName() {
return registryName;
}
}
/** Creative Tabs **/
public static CreativeTabs TAB_FORGECRAFT = new CreativeTabs(MOD_ID)
{
@Override
@SideOnly(Side.CLIENT)
public ItemStack getTabIconItem() {
return new ItemStack(ModItems.forgehammer);
}
};
/*
public static CreativeTabs TAB_PRIMAL = new CreativeTabs(MOD_ID)
{
@Override
@SideOnly(Side.CLIENT)
public ItemStack getTabIconItem() {
return new ItemStack(PrimalItems.FLINT_HATCHET);
}
};
*/
}

View File

@@ -1,899 +0,0 @@
package nmd.primal.forgecraft.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.core.api.PrimalItems;
import nmd.primal.core.api.PrimalMaterials;
import nmd.primal.core.common.items.tools.WorkMallet;
import nmd.primal.forgecraft.CommonUtils;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.crafting.AnvilCrafting;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.items.BaseMultiItem;
import nmd.primal.forgecraft.items.ForgeHammer;
import nmd.primal.forgecraft.items.parts.ToolPart;
import nmd.primal.forgecraft.tiles.TileAnvil;
import java.util.concurrent.ThreadLocalRandom;
/**
* Created by mminaie on 3/4/17.
*/
public class Anvil extends CustomContainerFacing {
double[] normalMin = {0.0625, 0.25, 0.4375, 0.625, 0.8125};
public double getNormalMin(Integer x) {
return normalMin[x];
}
double[] normalMax = {0.1875, 0.375, 0.5625, 0.75, 0.9375};
public double getNormalMax(Integer x) {
return normalMax[x];
}
double[] reverseMin = {0.8125, 0.625, 0.4375, 0.25, 0.0625};
public double getReverseMin(Integer x) {
return reverseMin[x];
}
double[] reverseMax = {0.9375, 0.75, 0.5625, 0.375, 0.1875};
public double getReverseMax(Integer x) {
return reverseMax[x];
}
public Anvil(Material material, String registryName, Float hardness) {
super(material);
setUnlocalizedName(registryName);
setRegistryName(registryName);
setCreativeTab(ModInfo.TAB_FORGECRAFT);
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
setHardness(hardness);
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitx, float hity, float hitz) {
/*if (!player.isSwingInProgress) {
player.swingArm(hand);
}*/
/******************************************************************************
Crafting Anvil Recipes
*****************************************************************************/
if (!world.isRemote) {
ItemStack pItem = player.inventory.getCurrentItem();
TileAnvil tile = (TileAnvil) world.getTileEntity(pos);
if (tile != null) {
//System.out.println("Tile is not null");
//if ((player.inventory.getCurrentItem().getItem().equals(PrimalItems.STONE_GALLAGHER)) || (player.inventory.getCurrentItem().getItem() == ModItems.forgehammer)) {
if ((pItem.getItem() instanceof WorkMallet) || (pItem.getItem() == ModItems.forgehammer)) {
String[] tempArray = new String[25];
for (int i = 0; i < 25; i++) {
tempArray[i] = tile.getSlotStack(i).getItem().getRegistryName().toString();
//System.out.println(i + " || " + tempArray[i] + " || " + tile.getSlotStack(i).getItem());
}
if(this.getRegistryName().toString().equals("stoneanvil")){
for (int i = 0; i < 25; i++) {
if (tile.getSlotStack(i).getItem() instanceof BaseMultiItem) {
if(((BaseMultiItem) tile.getSlotStack(i).getItem()).getMaterial(tile.getSlotStack(i).getItem()) != PrimalMaterials.TOOL_WROUGHT_IRON ) {
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(PrimalItems.ROCK_STONE, 3));
CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.ironball, 1));
for (ItemStack stack : tile.getSlotList()) {
if (stack != null) {
float offset = 0.7F;
double offsetX = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetY = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetZ = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
EntityItem item = new EntityItem(world, pos.getX() + offsetX, pos.getY() + offsetY, pos.getZ() + offsetZ, stack);
item.setDefaultPickupDelay();
world.spawnEntity(item);
world.removeTileEntity(pos);
world.playEvent(1031, pos, 0);
}
}
}
}
}
}
AnvilCrafting recipe = AnvilCrafting.getRecipe(tempArray);
if (recipe != null) {
if (pItem.getItem() instanceof WorkMallet) {
pItem.damageItem(15, player);
}
if (pItem.getItem() instanceof ForgeHammer) {
pItem.damageItem(1, player);
}
world.playEvent(1031, pos, 0);
if (ThreadLocalRandom.current().nextInt(0, 2)==0) {
if (recipe.getOutput().getItem() instanceof ToolPart) {
if (!tile.getSlotStack(12).getItem().equals(recipe.getOutput().getItem())) {
ItemStack tempStack = recipe.getOutput();
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = new NBTTagCompound();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.getSubCompound("tags").setBoolean("hot", false);
tempStack.getSubCompound("tags").setBoolean("emerald", false);
tempStack.getSubCompound("tags").setInteger("diamond", 0);
tempStack.getSubCompound("tags").setInteger("redstone", 0);
tempStack.getSubCompound("tags").setInteger("lapis", 0);
tempStack.getSubCompound("tags").setInteger("modifiers", 0);
CommonUtils.spawnItemEntityFromWorld(world, pos, tempStack);
}
if (tile.getSlotStack(12).getItem().equals(recipe.getOutput().getItem())) {
NBTTagCompound tempNBT = tile.getSlotStack(12).getSubCompound("tags");
ItemStack outputStack = recipe.getOutput();
outputStack.setTagCompound(new NBTTagCompound());
outputStack.getTagCompound().setTag("tags", tempNBT);
outputStack.getSubCompound("tags").setBoolean("hot", false);
if (recipe.getUpgrade() == "repair") {
CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack);
}
if (outputStack.getSubCompound("tags").getInteger("modifiers") < 3) {
//Upgrade emerald
if (recipe.getUpgrade() == "emerald") {
if (outputStack.getSubCompound("tags").getInteger("lapis") == 0) {
if (outputStack.getSubCompound("tags").getBoolean("emerald") == false) {
outputStack.setItemDamage(tile.getSlotStack(12).getItemDamage());
outputStack.getSubCompound("tags").setInteger("emerald",
(outputStack.getSubCompound("tags").getInteger("emerald") + 1));
outputStack.getSubCompound("tags").setInteger("modifiers",
(outputStack.getSubCompound("tags").getInteger("modifiers") + 1));
CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack);
}
}
}
//Upgrade diamond
if (recipe.getUpgrade() == "diamond") {
outputStack.setItemDamage(tile.getSlotStack(12).getItemDamage());
outputStack.getSubCompound("tags").setInteger("diamond",
(outputStack.getSubCompound("tags").getInteger("diamond") + 1));
outputStack.getSubCompound("tags").setInteger("modifiers",
(outputStack.getSubCompound("tags").getInteger("modifiers") + 1));
CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack);
}
//Upgrade redstone
if (recipe.getUpgrade() == "redstone") {
outputStack.setItemDamage(tile.getSlotStack(12).getItemDamage());
outputStack.getSubCompound("tags").setInteger("redstone",
(outputStack.getSubCompound("tags").getInteger("redstone") + 1));
outputStack.getSubCompound("tags").setInteger("modifiers",
(outputStack.getSubCompound("tags").getInteger("modifiers") + 1));
CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack);
}
//Upgrade lapis
if (recipe.getUpgrade() == "lapis") {
outputStack.setItemDamage(tile.getSlotStack(12).getItemDamage());
if (outputStack.getSubCompound("tags").getBoolean("emerald") == false) {
outputStack.getSubCompound("tags").setInteger("lapis",
(outputStack.getSubCompound("tags").getInteger("lapis") + 1));
outputStack.getSubCompound("tags").setInteger("modifiers",
(outputStack.getSubCompound("tags").getInteger("modifiers") + 1));
CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack);
}
}
}
}
} else {
CommonUtils.spawnItemEntityFromWorld(world, pos, recipe.getOutput());
}
//world.playEvent(1031, pos, 0);
for (int i = 0; i < tile.getSlotListSize(); i++) {
if (!tile.getSlotStack(i).isEmpty()) {
tile.setSlotStack(i, ItemStack.EMPTY);
}
}
return true;
}
}
}
//}
/*****************************************************************************
Adding and Removing Inventory With Tongs
*****************************************************************************/
if ( (!(pItem.getItem() instanceof WorkMallet)) || (!(pItem.getItem() instanceof ForgeHammer)) ) {
if(Block.getBlockFromItem(pItem.getItem()) instanceof IngotBall) {
return false;
}
if (state.getValue(FACING) == EnumFacing.NORTH) {
int counter = 0;
for (int z = 0; z < 5; z++) {
for (int x = 0; x < 5; x++) {
if (hitx >= this.getNormalMin(x) && hitx <= this.getNormalMax(x)) {
if (hitz >= this.getNormalMin(z) && hitz <= this.getNormalMax(z)) {
doWork(pItem, counter, tile, world, pos, player);
return true;
}
}
counter++;
}
}
}
if (state.getValue(FACING) == EnumFacing.SOUTH) {
int counter = 0;
for (int z = 0; z < 5; z++) {
for (int x = 0; x < 5; x++) {
if (hitx >= this.getReverseMin(x) && hitx <= this.getReverseMax(x)) {
if (hitz >= this.getReverseMin(z) && hitz <= this.getReverseMax(z)) {
doWork(pItem, counter, tile, world, pos, player);
return true;
}
}
counter++;
}
}
}
if (state.getValue(FACING) == EnumFacing.WEST) {
int counter = 0;
for (int x = 0; x < 5; x++) {
for (int z = 0; z < 5; z++) {
if (hitx >= this.getNormalMin(x) && hitx <= this.getNormalMax(x)) {
if (hitz >= this.getReverseMin(z) && hitz <= this.getReverseMax(z)) {
doWork(pItem, counter, tile, world, pos, player);
return true;
}
}
counter++;
}
}
}
if (state.getValue(FACING) == EnumFacing.EAST) {
int counter = 0;
for (int x = 0; x < 5; x++) {
for (int z = 0; z < 5; z++) {
if (hitx >= this.getReverseMin(x) && hitx <= this.getReverseMax(x)) {
if (hitz >= this.getNormalMin(z) && hitz <= this.getNormalMax(z)) {
doWork(pItem, counter, tile, world, pos, player);
return true;
}
}
counter++;
}
}
}
}
}
return false;
}
return false;
}
private boolean doWork(ItemStack pItem, Integer counter, TileAnvil tile, World world, BlockPos pos, EntityPlayer player) {
if (pItem.getItem().equals(ModItems.stonetongs)) {
if ((pItem.getTagCompound().getInteger("type") == 6) ||
(pItem.getTagCompound().getInteger("type") == 7) ||
(pItem.getTagCompound().getInteger("type") == 8) ||
(pItem.getTagCompound().getInteger("type") == 9) ||
(pItem.getTagCompound().getInteger("type") == 10) ||
(pItem.getTagCompound().getInteger("type") == 11) ||
(pItem.getTagCompound().getInteger("type") == 15) ||
(pItem.getTagCompound().getInteger("type") == 16) ||
(pItem.getTagCompound().getInteger("type") == 17) ||
(pItem.getTagCompound().getInteger("type") == 18) ||
(pItem.getTagCompound().getInteger("type") == 19) ||
(pItem.getTagCompound().getInteger("type") == 20) ||
(pItem.getTagCompound().getInteger("type") == 24) ||
(pItem.getTagCompound().getInteger("type") == 25) ||
(pItem.getTagCompound().getInteger("type") == 26) ||
(pItem.getTagCompound().getInteger("type") == 27) ||
(pItem.getTagCompound().getInteger("type") == 28) ||
(pItem.getTagCompound().getInteger("type") == 29) ||
(pItem.getTagCompound().getInteger("type") == 0)) {
//System.out.println("Level 1");
if (!tile.getSlotStack(counter).isEmpty()) {
if (pItem.getTagCompound().getInteger("type") == 0) {
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironingotballhot)) {
pItem.getTagCompound().setInteger("type", 6);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironchunkhot)) {
pItem.getTagCompound().setInteger("type", 7);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironcleaningotballhot)) {
pItem.getTagCompound().setInteger("type", 15);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironcleanchunkhot)) {
pItem.getTagCompound().setInteger("type", 16);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.steelingotballhot)) {
pItem.getTagCompound().setInteger("type", 24);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.steelchunkhot)) {
pItem.getTagCompound().setInteger("type", 25);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
}
}
if (tile.getSlotStack(counter).isEmpty()) {
//System.out.println("Activating");
if (pItem.getTagCompound().getInteger("type") == 6) {
//System.out.println("Tongs meta = 6");
tile.setSlotStack((counter), new ItemStack(ModItems.ironingotballhot, 1));
pItem.getTagCompound().setInteger("type", 0);
//return true;
}
if (pItem.getTagCompound().getInteger("type") == 7) {
//System.out.println("Tongs meta = 7");
tile.setSlotStack((counter), new ItemStack(ModItems.ironchunkhot, 1));
pItem.getTagCompound().setInteger("type", 0);
///System.out.println(counter);
//System.out.println(tile.getSlotStack(counter));
//return true;
}
if (pItem.getTagCompound().getInteger("type") == 8) {
ItemStack tempStack = new ItemStack(ModItems.pickaxehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 9) {
ItemStack tempStack = new ItemStack(ModItems.ironaxehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 10) {
ItemStack tempStack = new ItemStack(ModItems.ironshovelhead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 11) {
ItemStack tempStack = new ItemStack(ModItems.ironhoehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
/*********************************
* Clean Iron *
*********************************/
if (pItem.getTagCompound().getInteger("type") == 15) {
//System.out.println("Tongs meta = 6");
tile.setSlotStack((counter), new ItemStack(ModItems.ironcleaningotballhot, 1));
pItem.getTagCompound().setInteger("type", 0);
//return true;
}
if (pItem.getTagCompound().getInteger("type") == 16) {
//System.out.println("Tongs meta = 7");
tile.setSlotStack((counter), new ItemStack(ModItems.ironcleanchunkhot, 1));
pItem.getTagCompound().setInteger("type", 0);
///System.out.println(counter);
//System.out.println(tile.getSlotStack(counter));
//return true;
}
if (pItem.getTagCompound().getInteger("type") == 17) {
ItemStack tempStack = new ItemStack(ModItems.cleanironpickaxehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 18) {
ItemStack tempStack = new ItemStack(ModItems.cleanironaxehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 19) {
ItemStack tempStack = new ItemStack(ModItems.cleanironshovelhead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 20) {
ItemStack tempStack = new ItemStack(ModItems.cleanironhoehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
/*********************************
* Steel *
*********************************/
if (pItem.getTagCompound().getInteger("type") == 24) {
//System.out.println("Tongs meta = 6");
tile.setSlotStack((counter), new ItemStack(ModItems.steelingotballhot, 1));
pItem.getTagCompound().setInteger("type", 0);
//return true;
}
if (pItem.getTagCompound().getInteger("type") == 25) {
//System.out.println("Tongs meta = 7");
tile.setSlotStack((counter), new ItemStack(ModItems.steelchunkhot, 1));
pItem.getTagCompound().setInteger("type", 0);
///System.out.println(counter);
//System.out.println(tile.getSlotStack(counter));
//return true;
}
if (pItem.getTagCompound().getInteger("type") == 26) {
ItemStack tempStack = new ItemStack(ModItems.steelpickaxehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 27) {
ItemStack tempStack = new ItemStack(ModItems.steelaxehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 28) {
ItemStack tempStack = new ItemStack(ModItems.steelshovelhead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 29) {
ItemStack tempStack = new ItemStack(ModItems.steelhoehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
}
}
}
//System.out.println("1" + pItem);
if (pItem.getItem().equals(Items.AIR) && player.isSneaking()) {
if (tile.getSlotStack(counter).getItem().equals(Items.DIAMOND)) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(PrimalItems.DIAMOND_KNAPP)) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(Items.EMERALD)) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(PrimalItems.EMERALD_KNAPP)) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(Items.REDSTONE)) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(Items.DYE) && tile.getSlotStack(counter).getItemDamage() == EnumDyeColor.BLUE.getDyeDamage()) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (Block.getBlockFromItem(tile.getSlotStack(counter).getItem()) instanceof IngotBall ) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.pickaxehead)) {
if (tile.getSlotStack(counter).getSubCompound("tags").getBoolean("hot") == false) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironaxehead)) {
if (tile.getSlotStack(counter).getSubCompound("tags").getBoolean("hot") == false) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironshovelhead)) {
if (tile.getSlotStack(counter).getSubCompound("tags").getBoolean("hot") == false) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironhoehead)) {
if (tile.getSlotStack(counter).getSubCompound("tags").getBoolean("hot") == false) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
}
}
if (pItem.getItem().equals(Items.DIAMOND)) {
//System.out.println("It Is Diamond");
if (tile.getSlotStack(counter).isEmpty()) {
//System.out.println("Slot is empty");
tile.setSlotStack(counter, new ItemStack(pItem.getItem(), 1));
pItem.shrink(1);
return true;
}
}
if (pItem.getItem().equals(Items.EMERALD)) {
if (tile.getSlotStack(counter).isEmpty()) {
tile.setSlotStack(counter, new ItemStack(pItem.getItem(), 1));
pItem.shrink(1);
return true;
}
}
if (pItem.getItem().equals(PrimalItems.EMERALD_KNAPP)) {
if (tile.getSlotStack(counter).isEmpty()) {
tile.setSlotStack(counter, new ItemStack(pItem.getItem(), 1));
pItem.shrink(1);
return true;
}
}
if (pItem.getItem().equals(PrimalItems.DIAMOND_KNAPP)) {
if (tile.getSlotStack(counter).isEmpty()) {
tile.setSlotStack(counter, new ItemStack(pItem.getItem(), 1));
pItem.shrink(1);
return true;
}
}
if (pItem.getItem().equals(Items.REDSTONE)) {
if (tile.getSlotStack(counter).isEmpty()) {
tile.setSlotStack(counter, new ItemStack(pItem.getItem(), 1));
pItem.shrink(1);
return true;
}
}
if (pItem.getItem().equals(Items.DYE) && pItem.getItemDamage() == EnumDyeColor.BLUE.getDyeDamage()) {
if (tile.getSlotStack(counter).isEmpty()) {
tile.setSlotStack(counter, new ItemStack(pItem.getItem(), 1, pItem.getItemDamage()));
pItem.shrink(1);
return true;
}
}
return false;
}
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state)
{
if (!world.isRemote && world.getGameRules().getBoolean("doTileDrops"))
{
TileAnvil tile = (TileAnvil) world.getTileEntity(pos);
if (tile !=null)
{
for (ItemStack stack : tile.getSlotList())
{
if (stack != null) {
float offset = 0.7F;
double offsetX = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetY = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetZ = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
EntityItem item = new EntityItem(world, pos.getX() + offsetX, pos.getY() + offsetY, pos.getZ() + offsetZ, stack);
item.setDefaultPickupDelay();
world.spawnEntity(item);
}
}
}
}
super.breakBlock(world, pos, state);
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta)
{
return new TileAnvil();
}
@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
//if(!worldIn.isRemote) {
worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()), 2);
//}
}
@Override
public int getMetaFromState(IBlockState state) {
int i = 0;
if( state.getValue(FACING) == EnumFacing.EAST) {
i = 0;
return i;
}
if( state.getValue(FACING) == EnumFacing.WEST) {
i = 1;
return i;
}
if( state.getValue(FACING) == EnumFacing.SOUTH){
i = 2;
return i;
}
if( state.getValue(FACING) == EnumFacing.NORTH){
i = 3;
return i;
}
return i;
}
@Override
public IBlockState getStateFromMeta(int meta)
{
IBlockState iblockstate = this.getDefaultState();
if (meta == 0){
iblockstate = iblockstate.withProperty(FACING, EnumFacing.EAST);
}
if (meta == 1) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.WEST);
}
if (meta == 2) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.SOUTH);
}
if (meta == 3) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.NORTH);
}
return iblockstate;
}
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[] {FACING});
}
@Override
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
public boolean isFullyOpaque(IBlockState state)
{
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return true;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}
}

View File

@@ -1,454 +0,0 @@
package nmd.primal.forgecraft.blocks;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.core.api.PrimalItems;
import nmd.primal.forgecraft.CommonUtils;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.crafting.BloomeryCrafting;
import nmd.primal.forgecraft.tiles.TileBloomery;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
import static nmd.primal.core.common.helper.FireHelper.makeSmoke;
/**
* Created by mminaie on 1/21/17.
*/
public class Bloomery extends CustomContainerFacing implements ITileEntityProvider {
public static final PropertyBool ACTIVE = PropertyBool.create("active");
public static final PropertyBool COVERED = PropertyBool.create("covered");
public Bloomery(Material material, String registryName) {
super(material);
setUnlocalizedName(ModInfo.ForgecraftBlocks.BLOOMERY.getUnlocalizedName());
setRegistryName(registryName);
//setRegistryName(ModInfo.ForgecraftBlocks.FIREBOX.getRegistryName());
setCreativeTab(ModInfo.TAB_FORGECRAFT);
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, Boolean.valueOf(false)));
setHardness(3.0f);
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta)
{
return new TileBloomery();
}
@Override
public void randomTick(World world, BlockPos pos, IBlockState state, Random random)
{
this.updateTick(world, pos, state, random);
if(!world.isRemote){
if(state.getValue(ACTIVE) == true) {
makeSmoke(world, pos);
}
}
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
if (!world.isRemote) {
TileBloomery tile = (TileBloomery) world.getTileEntity(pos);
if (tile != null) {
ItemStack pItem = player.inventory.getCurrentItem();
ItemStack tileItem = tile.getSlotStack(0);
ItemStack tileItem1 = tile.getSlotStack(1);
if(pItem.isEmpty()) {
if (player.isSneaking()) {
if (!tileItem.isEmpty()) {
CommonUtils.spawnItemEntity(world, player, tile.getSlotStack(0));
tile.setSlotStack(0, ItemStack.EMPTY);
tile.markDirty();
tile.updateBlock();
return true;
}
}
if(!player.isSneaking()){
if(world.getBlockState(pos).getValue(ACTIVE) == true){
Integer bloomeryHeat = tile.getHeat();
Integer idealTemp = null;
Integer cookCounter = tile.getCookCounter();
Integer idealCookTime = null;
Integer remainingTime = null;
String stringBloomeryHeat = bloomeryHeat.toString();
String stringIdealTemp = "";
String stringRemainingTime = "";
BloomeryCrafting recipe = BloomeryCrafting.getRecipe(tile.getSlotStack(1));
if(recipe != null) {
idealTemp = recipe.getHeatThreshold();
idealCookTime = recipe.getIdealTime();
stringIdealTemp = idealTemp.toString();
remainingTime = idealCookTime - cookCounter;
stringRemainingTime = remainingTime.toString();
}
ITextComponent itextcomponent = new TextComponentString("Current Temp: " + stringBloomeryHeat + " Ideal Temp: " + stringIdealTemp + " Ticks Remaining: " + stringRemainingTime);
player.sendStatusMessage(itextcomponent, true);
//System.out.println(pos);
return true;
}
}
}
if(tile.getSlotStack(0) != ItemStack.EMPTY) {
if((pItem.getItem() == Items.FLINT_AND_STEEL) ||
(pItem.getItem() == PrimalItems.FIRE_BOW) ||
pItem.getItem() == PrimalItems.TORCH_WOOD_LIT ||
pItem.getItem() == PrimalItems.TORCH_NETHER_LIT ) {
world.setBlockState(pos, state.withProperty(ACTIVE, true), 2);
tile.setHeat(100);
tile.markDirty();
tile.updateBlock();
return true;
}
}
if((!pItem.isEmpty()) && tile.isItemValidForSlot(0, pItem)) {
if (!tileItem.isEmpty()){
if(pItem.getItem() == tileItem.getItem()){
if(tileItem.getCount() < 64){
if(tileItem.getCount() + pItem.getCount() <= 64){
tileItem.grow(pItem.getCount());
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
tile.markDirty();
tile.updateBlock();
return true;
}
if(tileItem.getCount() + pItem.getCount() > 64){
pItem.setCount(64-pItem.getCount());
tileItem.setCount(64);
tile.markDirty();
tile.updateBlock();
return true;
}
}
}
}
if(tileItem.isEmpty()) {
tile.setSlotStack(0, pItem);
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
return true;
}
}
if((!pItem.isEmpty()) && tile.isItemValidForSlot(1, pItem)) {
if (!tileItem1.isEmpty()) {
return false;
}
if(tileItem1.isEmpty()){
ItemStack tempItem = new ItemStack(pItem.getItem(), 1);
tile.setSlotStack(1, tempItem);
pItem.shrink(1);
return true;
}
}
}
}
return false;
}
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
{
int lightState =0;
if(state.getValue(ACTIVE) == true){
lightState = 10;
}
return lightState;
}
public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face)
{
return 0;
}
public boolean isFlammable(IBlockAccess world, BlockPos pos, EnumFacing face)
{
return true;
}
@Override
public boolean isFireSource(World world, BlockPos pos, EnumFacing side)
{
if(!world.isRemote){
if(world.getBlockState(pos).getValue(ACTIVE)==true){
return true;
}
}
return false;
}
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity ent)
{
if(ent instanceof EntityPlayer){
if(state.getValue(ACTIVE) == true){
ent.setFire(1);
}
}
}
/**
* Called serverside after this block is replaced with another in Chunk, but before the Tile Entity is updated
*/
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state)
{
if (!world.isRemote && world.getGameRules().getBoolean("doTileDrops"))
{
TileBloomery tile = (TileBloomery) world.getTileEntity(pos);
if (tile !=null)
{
for (ItemStack stack : tile.getSlotList())
{
if (stack != null) {
float offset = 0.7F;
double offsetX = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetY = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetZ = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
EntityItem item = new EntityItem(world, pos.getX() + offsetX, pos.getY() + offsetY, pos.getZ() + offsetZ, stack);
item.setDefaultPickupDelay();
world.spawnEntity(item);
}
}
}
}
super.breakBlock(world, pos, state);
}
@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
if(!worldIn.isRemote){
worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(ACTIVE, Boolean.valueOf(false)).withProperty(COVERED, Boolean.valueOf(false)), 2);
}
}
@Override
public int getMetaFromState(IBlockState state) {
int i = 0;
if( state.getValue(FACING) == EnumFacing.EAST && state.getValue(ACTIVE) == false && state.getValue(COVERED) == false){
i = 0;
return i;
}
if( state.getValue(FACING) == EnumFacing.WEST && state.getValue(ACTIVE) == false && state.getValue(COVERED) == false){
i = 1;
return i;
}
if( state.getValue(FACING) == EnumFacing.SOUTH && state.getValue(ACTIVE) == false && state.getValue(COVERED) == false){
i = 2;
return i;
}
if( state.getValue(FACING) == EnumFacing.NORTH && state.getValue(ACTIVE) == false && state.getValue(COVERED) == false){
i = 3;
return i;
}
if( state.getValue(FACING) == EnumFacing.EAST && state.getValue(ACTIVE) == true && state.getValue(COVERED) == false){
i = 4;
return i;
}
if( state.getValue(FACING) == EnumFacing.WEST && state.getValue(ACTIVE) == true && state.getValue(COVERED) == false){
i = 5;
return i;
}
if( state.getValue(FACING) == EnumFacing.SOUTH && state.getValue(ACTIVE) == true && state.getValue(COVERED) == false){
i = 6;
return i;
}
if( state.getValue(FACING) == EnumFacing.NORTH && state.getValue(ACTIVE) == true && state.getValue(COVERED) == false){
i = 7;
return i;
}
if( state.getValue(FACING) == EnumFacing.EAST && state.getValue(ACTIVE) == true && state.getValue(COVERED) == true){
i = 8;
return i;
}
if( state.getValue(FACING) == EnumFacing.WEST && state.getValue(ACTIVE) == true && state.getValue(COVERED) == true){
i = 9;
return i;
}
if( state.getValue(FACING) == EnumFacing.SOUTH && state.getValue(ACTIVE) == true && state.getValue(COVERED) == true){
i = 10;
return i;
}
if( state.getValue(FACING) == EnumFacing.NORTH && state.getValue(ACTIVE) == true && state.getValue(COVERED) == true){
i = 11;
return i;
}
if( state.getValue(FACING) == EnumFacing.EAST && state.getValue(ACTIVE) == false && state.getValue(COVERED) == true){
i = 12;
return i;
}
if( state.getValue(FACING) == EnumFacing.WEST && state.getValue(ACTIVE) == false && state.getValue(COVERED) == true){
i = 13;
return i;
}
if( state.getValue(FACING) == EnumFacing.SOUTH && state.getValue(ACTIVE) == false && state.getValue(COVERED) == true){
i = 14;
return i;
}
if( state.getValue(FACING) == EnumFacing.NORTH && state.getValue(ACTIVE) == false && state.getValue(COVERED) == true){
i = 15;
return i;
}
return i;
}
@Override
public IBlockState getStateFromMeta(int meta)
{
IBlockState iblockstate = this.getDefaultState();
if (meta == 0){
iblockstate = iblockstate.withProperty(FACING, EnumFacing.EAST).withProperty(ACTIVE, Boolean.valueOf(false)).withProperty(COVERED, Boolean.valueOf(false));
}
if (meta == 1) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.WEST).withProperty(ACTIVE, Boolean.valueOf(false)).withProperty(COVERED, Boolean.valueOf(false));
}
if (meta == 2) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.SOUTH).withProperty(ACTIVE, Boolean.valueOf(false)).withProperty(COVERED, Boolean.valueOf(false));
}
if (meta == 3) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, Boolean.valueOf(false)).withProperty(COVERED, Boolean.valueOf(false));
}
if (meta == 4) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.EAST).withProperty(ACTIVE, Boolean.valueOf(true)).withProperty(COVERED, Boolean.valueOf(false));
}
if (meta == 5) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.WEST).withProperty(ACTIVE, Boolean.valueOf(true)).withProperty(COVERED, Boolean.valueOf(false));
}
if (meta == 6) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.SOUTH).withProperty(ACTIVE, Boolean.valueOf(true)).withProperty(COVERED, Boolean.valueOf(false));
}
if (meta == 7) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, Boolean.valueOf(true)).withProperty(COVERED, Boolean.valueOf(false));
}
if (meta == 8) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.EAST).withProperty(ACTIVE, Boolean.valueOf(true)).withProperty(COVERED, Boolean.valueOf(true));
}
if (meta == 9) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.WEST).withProperty(ACTIVE, Boolean.valueOf(true)).withProperty(COVERED, Boolean.valueOf(true));
}
if (meta == 10) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.SOUTH).withProperty(ACTIVE, Boolean.valueOf(true)).withProperty(COVERED, Boolean.valueOf(true));
}
if (meta == 11) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, Boolean.valueOf(true)).withProperty(COVERED, Boolean.valueOf(true));
}
if (meta == 12) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.EAST).withProperty(ACTIVE, Boolean.valueOf(false)).withProperty(COVERED, Boolean.valueOf(true));
}
if (meta == 13) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.WEST).withProperty(ACTIVE, Boolean.valueOf(false)).withProperty(COVERED, Boolean.valueOf(true));
}
if (meta == 14) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.SOUTH).withProperty(ACTIVE, Boolean.valueOf(false)).withProperty(COVERED, Boolean.valueOf(true));
}
if (meta == 15) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, Boolean.valueOf(false)).withProperty(COVERED, Boolean.valueOf(true));
}
return iblockstate;
}
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[] {FACING, ACTIVE, COVERED});
}
@Override
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
public boolean isFullyOpaque(IBlockState state)
{
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return true;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}
@SideOnly(Side.CLIENT)
@SuppressWarnings("incomplete-switch")
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand)
{
if(state.getValue(Forge.ACTIVE) == true)
{
double d0 = (double)pos.getX() + 0.5D;
double d1 = (double)pos.getY() + 0.2D;
double d2 = (double)pos.getZ() + 0.5D;
double d3 = 0.52D;
double d4 = ThreadLocalRandom.current().nextDouble(0.075, 0.35);
double ySpeed = ThreadLocalRandom.current().nextDouble(0.0, 0.075);
if (rand.nextDouble() < 0.1D)
{
world.playSound((double)pos.getX() + 0.5D, (double)pos.getY(), (double)pos.getZ() + 0.5D, SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
}
if(rand.nextInt(4) == 1){
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, ySpeed, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2-d4, 0.0D, ySpeed, 0.0D, new int[0]);
}
if(rand.nextInt(4) == 2){
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2-d4, 0.0D, ySpeed, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2+d4, 0.0D, ySpeed, 0.0D, new int[0]);
}
if(rand.nextInt(4) == 3){
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2+d4, 0.0D, ySpeed, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2-d4, 0.0D, ySpeed, 0.0D, new int[0]);
}
if(rand.nextInt(4) == 4){
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2-d4, 0.0D, ySpeed, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, ySpeed, 0.0D, new int[0]);
}
}
}
}

View File

@@ -1,280 +0,0 @@
package nmd.primal.forgecraft.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.core.api.PrimalItems;
import nmd.primal.core.common.items.tools.WorkMallet;
import nmd.primal.forgecraft.CommonUtils;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.tiles.TileBreaker;
import java.util.concurrent.ThreadLocalRandom;
/**
* Created by mminaie on 4/9/17.
*/
public class Breaker extends CustomContainerFacing {
public static final PropertyBool ACTIVE = PropertyBool.create("active");
public Breaker(Material material, String registryName, Float hardness) {
super(material);
setUnlocalizedName(registryName);
setRegistryName(registryName);
setCreativeTab(ModInfo.TAB_FORGECRAFT);
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, false));
setHardness(hardness);
}
private void doWork (World world, IBlockState state, BlockPos pos, TileBreaker tile){
if (state.getValue(FACING) == EnumFacing.EAST) {
if(tile.getCharge() > world.getBlockState(pos.east()).getBlockHardness(world, pos.east())) {
if (world.getBlockState(pos.east()).getBlock() == Blocks.IRON_ORE) {
world.setBlockToAir(pos.east());
CommonUtils.spawnItemEntityFromWorld(world, pos.east(), new ItemStack(PrimalItems.IRON_DUST, ThreadLocalRandom.current().nextInt(1, 2)));
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage()-1);
}
} else {
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage()-10);
}
}
if (state.getValue(FACING) == EnumFacing.WEST) {
if(tile.getCharge() > world.getBlockState(pos.west()).getBlockHardness(world, pos.west())) {
if (world.getBlockState(pos.west()).getBlock() == Blocks.IRON_ORE) {
world.setBlockToAir(pos.west());
CommonUtils.spawnItemEntityFromWorld(world, pos.east(), new ItemStack(PrimalItems.IRON_DUST, ThreadLocalRandom.current().nextInt(1, 2)));
}
} else {
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage()-10);
}
}
if (state.getValue(FACING) == EnumFacing.SOUTH) {
if(tile.getCharge() > world.getBlockState(pos.south()).getBlockHardness(world, pos.south())) {
if (world.getBlockState(pos.south()).getBlock() == Blocks.IRON_ORE) {
world.setBlockToAir(pos.south());
CommonUtils.spawnItemEntityFromWorld(world, pos.east(), new ItemStack(PrimalItems.IRON_DUST, ThreadLocalRandom.current().nextInt(1, 2)));
}
} else {
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage()-10);
}
}
if (state.getValue(FACING) == EnumFacing.NORTH) {
if(tile.getCharge() > world.getBlockState(pos.north()).getBlockHardness(world, pos.north())) {
if (world.getBlockState(pos.north()).getBlock() == Blocks.IRON_ORE) {
world.setBlockToAir(pos.north());
CommonUtils.spawnItemEntityFromWorld(world, pos.east(), new ItemStack(PrimalItems.IRON_DUST, ThreadLocalRandom.current().nextInt(1, 2)));
}
} else {
//tile.getSlotStack(0).damageItem(10, (EntityPlayer) null);
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage()-10);
}
}
tile.setCharge(0.0f);
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitx, float hity, float hitz) {
if(!world.isRemote){
TileBreaker tile = (TileBreaker) world.getTileEntity(pos);
ItemStack pItem = player.inventory.getCurrentItem();
if(state.getValue(ACTIVE) == true && player.isSneaking() && pItem.isEmpty()){
world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(ACTIVE, false));
doWork(world, state, pos, tile);
}
if(!player.isSneaking() && pItem.isEmpty()) {
if (!state.getValue(ACTIVE)) {
world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(ACTIVE, true), 2);
}
if(tile.getCharge() < 181) {
tile.setCharge(tile.getCharge() + 2.0f);
tile.updateBlock();
//System.out.println(tile.charge);
return true;
}
}
if(pItem.getItem() instanceof WorkMallet){
tile.setSlotStack(0, player.inventory.getCurrentItem());
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
return true;
}
}
return false;
}
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state)
{
if (!world.isRemote && world.getGameRules().getBoolean("doTileDrops"))
{
TileBreaker tile = (TileBreaker) world.getTileEntity(pos);
if (tile !=null)
{
for (ItemStack stack : tile.getSlotList())
{
if (stack != null) {
float offset = 0.7F;
double offsetX = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetY = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetZ = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
EntityItem item = new EntityItem(world, pos.getX() + offsetX, pos.getY() + offsetY, pos.getZ() + offsetZ, stack);
item.setDefaultPickupDelay();
world.spawnEntity(item);
}
}
}
}
super.breakBlock(world, pos, state);
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta)
{
return new TileBreaker();
}
@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
//if(!worldIn.isRemote) {
worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(ACTIVE, false), 2);
//}
}
@Override
public int getMetaFromState(IBlockState state) {
int i = 0;
if(state.getValue(ACTIVE ) == false) {
if (state.getValue(FACING) == EnumFacing.EAST) {
i = 0;
return i;
}
if (state.getValue(FACING) == EnumFacing.WEST) {
i = 1;
return i;
}
if (state.getValue(FACING) == EnumFacing.SOUTH) {
i = 2;
return i;
}
if (state.getValue(FACING) == EnumFacing.NORTH) {
i = 3;
return i;
}
}
if(state.getValue(ACTIVE)) {
if (state.getValue(FACING) == EnumFacing.EAST) {
i = 4;
return i;
}
if (state.getValue(FACING) == EnumFacing.WEST) {
i = 5;
return i;
}
if (state.getValue(FACING) == EnumFacing.SOUTH) {
i = 6;
return i;
}
if (state.getValue(FACING) == EnumFacing.NORTH) {
i = 7;
return i;
}
}
return i;
}
@Override
public IBlockState getStateFromMeta(int meta)
{
IBlockState iblockstate = this.getDefaultState();
if (meta == 0){
iblockstate = iblockstate.withProperty(FACING, EnumFacing.EAST).withProperty(ACTIVE, false);
}
if (meta == 1) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.WEST).withProperty(ACTIVE, false);
}
if (meta == 2) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.SOUTH).withProperty(ACTIVE, false);
}
if (meta == 3) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, false);
}
if (meta == 4){
iblockstate = iblockstate.withProperty(FACING, EnumFacing.EAST).withProperty(ACTIVE, true);
}
if (meta == 5) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.WEST).withProperty(ACTIVE, true);
}
if (meta == 6) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.SOUTH).withProperty(ACTIVE, true);
}
if (meta == 7) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, true);
}
return iblockstate;
}
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[] {ACTIVE, FACING});
}
@Override
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
public boolean isFullyOpaque(IBlockState state)
{
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return true;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}
}

View File

@@ -1,190 +0,0 @@
package nmd.primal.forgecraft.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.core.api.PrimalItems;
import nmd.primal.forgecraft.CommonUtils;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.init.ModBlocks;
import org.apache.commons.lang3.StringUtils;
import java.util.Random;
import static nmd.primal.forgecraft.CommonUtils.spawnItemEntityFromWorld;
/**
* Created by mminaie on 1/24/17.
*/
public class Crucible extends Block {
protected static final AxisAlignedBB boundBox = new AxisAlignedBB(4/16D, 0.0D, 4/16D, 12/16D, 7/16D, 12/16D);
//public static final PropertyInteger SIZE = PropertyInteger.create("size", 0, 3);
public Crucible(Material material, String registryName) {
super(material);
setUnlocalizedName(registryName);
setRegistryName(registryName);
setCreativeTab(ModInfo.TAB_FORGECRAFT);
setHardness(3.0f);
//this.blockState.getBaseState().withProperty(SIZE, Integer.valueOf(0));
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if (!world.isRemote) {
ItemStack pItem = player.inventory.getCurrentItem();
if(pItem.isEmpty()){
CommonUtils.spawnItemEntity(world, player, new ItemStack(this, 1));
world.setBlockToAir(pos);
return true;
}
if(Block.getBlockFromItem(pItem.getItem()) == this){
CommonUtils.spawnItemEntity(world, player, new ItemStack(this, 1));
world.setBlockToAir(pos);
return true;
}
}
return false;
}
/*@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){
List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
ret.add(0, new ItemStack(ModBlocks.emptycrucible, 1));
if(this.getUnlocalizedName()=="tile.coolironcrucible"){
ret.add(1, new ItemStack(Items.IRON_INGOT, 1));
}
return ret;
}*/
public void onBlockDestroyedByPlayer(World world, BlockPos pos, IBlockState state)
{
if(!world.isRemote){
spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.emptycrucible, 1));
if(StringUtils.isEmpty(this.getUnlocalizedName()) == false) {
if(checkDrops(this.getUnlocalizedName()) != null) {
if (checkDrops(this.getUnlocalizedName()).equals(this.getUnlocalizedName())) {
spawnItemEntityFromWorld(world, pos, new ItemStack(getItemFromName(this.getUnlocalizedName()), 1));
}
}
}
}
}
private String checkDrops(String name){
String string = null;
if(name.equals("tile.coolironcrucible")){
string = this.getUnlocalizedName();
}
if(name.equals("tile.rawironcrucible")){
string = this.getUnlocalizedName();
}
if(name.equals("tile.coolcleanironcrucible")){
string = this.getUnlocalizedName();
}
if(name.equals("tile.rawcleanironcrucible")){
string = this.getUnlocalizedName();
}
if(name.equals("tile.coolsteelcrucible")){
string = this.getUnlocalizedName();
}
if(name.equals("tile.rawsteelcrucible")){
string = this.getUnlocalizedName();
}
if(name.equals("tile.coolwootzcrucible")){
string = this.getUnlocalizedName();
}
if(name.equals("tile.rawwootzcrucible")){
string = this.getUnlocalizedName();
}
return string;
}
private Item getItemFromName(String name){
if(name.equals("tile.coolironcrucible")){
return Item.getItemFromBlock(ModBlocks.ironball);
} else if (name.equals("tile.rawironcrucible")){
return Item.getItemFromBlock(Blocks.IRON_ORE);
} else if (name.equals("tile.coolcleanironcrucible")){
return Item.getItemFromBlock(ModBlocks.ironcleanball);
} else if (name.equals("tile.rawcleanironcrucible")){
return PrimalItems.IRON_DUST;
} else if (name.equals("tile.coolsteelcrucible")){
return Item.getItemFromBlock(ModBlocks.steelball);
} else if (name.equals("tile.rawsteelcrucible")){
return Item.getItemFromBlock(ModBlocks.ironcleanball);
} else if (name.equals("tile.coolwootzcrucible")){
return Item.getItemFromBlock(ModBlocks.wootzball);
} else if (name.equals("tile.rawcleanironcrucible")){
return PrimalItems.GOLDEN_STICK;
}
else return Items.AIR;
}
@Override
public int quantityDropped(Random random)
{
return 0;
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
return boundBox;
}
@Override
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
public boolean isFullyOpaque(IBlockState state)
{
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return true;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}
}

View File

@@ -1,107 +0,0 @@
package nmd.primal.forgecraft.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDynamicLiquid;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.tiles.TileBaseCrucible;
import java.util.Random;
/**
* Created by mminaie on 2/4/17.
*/
public class CrucibleHot extends Block implements ITileEntityProvider {
protected static final AxisAlignedBB boundBox = new AxisAlignedBB(4/16D, 0.0D, 4/16D, 12/16D, 7/16D, 12/16D);
//public static final PropertyInteger SIZE = PropertyInteger.create("size", 0, 3);
public CrucibleHot(Material material, String registryName) {
super(material);
setUnlocalizedName(registryName);
setRegistryName(registryName);
setCreativeTab(ModInfo.TAB_FORGECRAFT);
setHardness(3.0f);
//this.blockState.getBaseState().withProperty(SIZE, Integer.valueOf(0));
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
return false;
}
public void onBlockDestroyedByPlayer(World world, BlockPos pos, IBlockState state)
{
if(!world.isRemote){
world.setBlockState(pos, Blocks.FLOWING_LAVA.getDefaultState().withProperty(BlockDynamicLiquid.LEVEL, 1), 3);
}
}
@Override
public int quantityDropped(Random random)
{
return 0;
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta)
{
return new TileBaseCrucible();
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
return boundBox;
}
@Override
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
public boolean isFullyOpaque(IBlockState state)
{
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return true;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}
}

View File

@@ -1,25 +0,0 @@
package nmd.primal.forgecraft.blocks;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.util.EnumFacing;
/**
* Created by kitsu on 12/3/2016.
*/
public abstract class CustomContainerFacing extends BlockContainer {
public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
protected CustomContainerFacing(Material material)
{
super(material);
}
protected CustomContainerFacing(Material material, MapColor color)
{
super(material, color);
}
}

View File

@@ -1,26 +0,0 @@
package nmd.primal.forgecraft.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.util.EnumFacing;
/**
* Created by mminaie on 1/1/17.
*/
public abstract class CustomFacing extends Block {
public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
protected CustomFacing(Material material)
{
super(material);
}
protected CustomFacing(Material material, MapColor color)
{
super(material, color);
}
}

View File

@@ -1,488 +0,0 @@
package nmd.primal.forgecraft.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.core.api.PrimalItems;
import nmd.primal.forgecraft.CommonUtils;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.items.parts.ToolPart;
import nmd.primal.forgecraft.tiles.TileForge;
import javax.annotation.Nullable;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
import static nmd.primal.core.common.helper.FireHelper.makeSmoke;
//import nmd.primal.core.api.PrimalBlocks;
/**
* Created by kitsu on 11/26/2016.
*/
public class Forge extends CustomContainerFacing implements ITileEntityProvider/*, ITextComponent*/ {
public static final PropertyBool ACTIVE = PropertyBool.create("active");
protected static final AxisAlignedBB collideBox = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.99D, 1.0D);
protected static final AxisAlignedBB boundBox = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
public Forge(Material material) {
super(material);
setUnlocalizedName(ModInfo.ForgecraftBlocks.FIREBOX.getUnlocalizedName());
setRegistryName(ModInfo.ForgecraftBlocks.FIREBOX.getRegistryName());
setCreativeTab(ModInfo.TAB_FORGECRAFT);
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, Boolean.valueOf(false)));
setHardness(3.0f);
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta)
{
return new TileForge();
}
@Nullable
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
{
return collideBox;
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
return boundBox;
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
if (!world.isRemote) {
TileForge tile = (TileForge) world.getTileEntity(pos);
if (tile != null) {
ItemStack pItem = player.inventory.getCurrentItem();
ItemStack fuelItem = tile.getSlotStack(0);
//System.out.println(pItem.getItem().getRegistryName().toString());
/***********************
FUEL SLOT CODE
***********************/
if(pItem.isEmpty()) {
if (player.isSneaking()) {
if (!fuelItem.isEmpty()) {
if(facing == EnumFacing.NORTH || facing == EnumFacing.SOUTH || facing == EnumFacing.EAST || facing == EnumFacing.WEST ) {
//System.out.println();
CommonUtils.spawnItemEntity(world, player, tile.getSlotStack(0));
tile.setSlotStack(0, ItemStack.EMPTY);
tile.markDirty();
tile.updateBlock();
return true;
}
}
}
if(!player.isSneaking()){
if(world.getBlockState(pos).getValue(ACTIVE) == true){
Integer tempInt = tile.getHeat();
String tempString = tempInt.toString();
ITextComponent itextcomponent = new TextComponentString(tempString);
player.sendStatusMessage(itextcomponent, true);
//System.out.println(pos);
return true;
}
}
}
if((pItem.getItem() == Items.FLINT_AND_STEEL) || (pItem.getItem() == PrimalItems.FIRE_BOW) || pItem.getItem() == PrimalItems.TORCH_WOOD_LIT || pItem.getItem() == PrimalItems.TORCH_NETHER_LIT ) {
world.setBlockState(pos, state.withProperty(ACTIVE, true), 2);
tile.setHeat(100);
tile.markDirty();
tile.updateBlock();
return true;
}
if((!pItem.isEmpty()) && tile.isItemValidForSlot(0, pItem)) {
if (!fuelItem.isEmpty()){
if(pItem.getItem() == fuelItem.getItem()){
if(fuelItem.getCount() < 64){
if(fuelItem.getCount() + pItem.getCount() <= 64){
fuelItem.grow(pItem.getCount());
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
tile.markDirty();
tile.updateBlock();
return true;
}
if(fuelItem.getCount() + pItem.getCount() > 64){
pItem.setCount(64-pItem.getCount());
fuelItem.setCount(64);
tile.markDirty();
tile.updateBlock();
return true;
}
}
}
}
if(fuelItem.isEmpty()) {
tile.setSlotStack(0, pItem);
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
return true;
}
}
/***********************
FORGING SLOTS CODE
***********************/
//REMOVE COOL INGOT
if(facing == EnumFacing.UP ) {
/*if (pItem.isEmpty()) {
for (int i = 2; i < tile.getSlotListSize(); i++) {
//System.out.println(i);
if (!tile.getSlotStack(i).isEmpty()) {
if (Block.getBlockFromItem(tile.getSlotStack(i).getItem()) instanceof IngotBall) {
CommonUtils.spawnItemEntity(world, player, tile.getSlotStack(i));
tile.setSlotStack(i, ItemStack.EMPTY);
return true;
}
if(tile.getSlotStack(i).hasTagCompound() == true){
if (tile.getSlotStack(i).getTagCompound().getBoolean("hot") == false) {
CommonUtils.spawnItemEntity(world, player, tile.getSlotStack(i));
tile.setSlotStack(i, ItemStack.EMPTY);
return true;
}
}
}
}
}*/
if (Block.getBlockFromItem(pItem.getItem()) instanceof IngotBall) {
//System.out.println("Activating");
for (int i = 2; i <= tile.getSlotListSize(); i++) {
if (tile.getSlotStack(i).isEmpty()) {
tile.setSlotStack(i, new ItemStack(pItem.getItem(), 1));
pItem.shrink(1);
return true;
}
}
}
//Needs Ore Dictionary Compat
if (pItem.getItem().equals(new ItemStack(Items.IRON_INGOT).getItem())) {
for (int i = 2; i < 7; i++) {
if (tile.getSlotStack(i).isEmpty()) {
tile.setSlotStack(i, new ItemStack(Items.IRON_INGOT, 1));
pItem.shrink(1);
return true;
}
}
}
if(pItem.getItem() instanceof ToolPart){
if(tile.getSlotStack(4).isEmpty()){
//System.out.println("Adding player Item to slot");
tile.setSlotStack(4, pItem);
//System.out.println(tile.getSlotStack(4));
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
return true;
}
}
}
}
//System.out.println(tile.getSlotStack(0));
//System.out.println(tile.getSlotStack(1));
//System.out.println(tile.getSlotStack(2));
//System.out.println(tile.getSlotStack(3));
//System.out.println(tile.getSlotStack(4));
//System.out.println(tile.getSlotStack(5));
//System.out.println(tile.getSlotStack(6));
}
return false;
}
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity ent)
{
//if (!world.isRemote){
if(ent instanceof EntityPlayer){
if(state.getValue(ACTIVE) == true){
ent.setFire(1);
}
}
//}
}
public void onBlockClicked(World world, BlockPos pos, EntityPlayer player) {
}
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
{
if(state.getValue(ACTIVE) == true){
return 15;
}
return 0;
}
public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face)
{
return 0;
}
public boolean isFlammable(IBlockAccess world, BlockPos pos, EnumFacing face)
{
return true;
}
@Override
public boolean isFireSource(World world, BlockPos pos, EnumFacing side)
{
if (side == EnumFacing.UP)
{
if(!world.isRemote){
TileForge tile = (TileForge) world.getTileEntity(pos);
if(tile.getSlotStack(0) != ItemStack.EMPTY){
if(world.getBlockState(pos).getValue(ACTIVE)==true){
return true;
}
}
}
}
return false;
}
/**
* Called serverside after this block is replaced with another in Chunk, but before the Tile Entity is updated
*/
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state)
{
if (!world.isRemote && world.getGameRules().getBoolean("doTileDrops"))
{
TileForge tile = (TileForge) world.getTileEntity(pos);
if (tile !=null)
{
for (ItemStack stack : tile.getSlotList())
{
if (stack != null) {
float offset = 0.7F;
double offsetX = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetY = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetZ = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
EntityItem item = new EntityItem(world, pos.getX() + offsetX, pos.getY() + offsetY, pos.getZ() + offsetZ, stack);
item.setDefaultPickupDelay();
world.spawnEntity(item);
}
}
}
}
super.breakBlock(world, pos, state);
}
/*@Override
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
IBlockState state = super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer);
return state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(ACTIVE, Boolean.valueOf(false));
}*/
@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
if(!worldIn.isRemote) {
worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(ACTIVE, Boolean.valueOf(false)), 2);
}
}
@Override
public int getMetaFromState(IBlockState state) {
int i = 0;
if( (state.getValue(FACING) == EnumFacing.EAST) && state.getValue(ACTIVE) == false){
i = 0;
return i;
}
if( (state.getValue(FACING) == EnumFacing.WEST) && state.getValue(ACTIVE) == false){
i = 1;
return i;
}
if( (state.getValue(FACING) == EnumFacing.SOUTH) && state.getValue(ACTIVE) == false){
i = 2;
return i;
}
if( (state.getValue(FACING) == EnumFacing.NORTH) && state.getValue(ACTIVE) == false){
i = 3;
return i;
}
if( (state.getValue(FACING) == EnumFacing.EAST) && state.getValue(ACTIVE) == true){
i = 4;
return i;
}
if( (state.getValue(FACING) == EnumFacing.WEST) && state.getValue(ACTIVE) == true){
i = 5;
return i;
}
if( (state.getValue(FACING) == EnumFacing.SOUTH) && state.getValue(ACTIVE) == true){
i = 6;
return i;
}
if( (state.getValue(FACING) == EnumFacing.NORTH) && state.getValue(ACTIVE) == true){
i = 7;
return i;
}
return i;
}
@Override
public IBlockState getStateFromMeta(int meta) {
EnumFacing enumfacing;
Boolean active;
switch (meta & 7)
{
case 0:
enumfacing = EnumFacing.EAST;
active = false;
break;
case 1:
enumfacing = EnumFacing.WEST;
active = false;
break;
case 2:
enumfacing = EnumFacing.SOUTH;
active = false;
break;
case 3:
enumfacing = EnumFacing.NORTH;
active = false;
break;
case 4:
enumfacing = EnumFacing.EAST;
active = true;
break;
case 5:
enumfacing = EnumFacing.WEST;
active = true;
break;
case 6:
enumfacing = EnumFacing.SOUTH;
active = true;
break;
case 7:
enumfacing = EnumFacing.NORTH;
active = true;
break;
default:
enumfacing = EnumFacing.NORTH;
active = false;
}
return this.getDefaultState().withProperty(FACING, enumfacing).withProperty(ACTIVE, Boolean.valueOf(active));
}
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[] {FACING, ACTIVE});
}
@Override
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
public boolean isFullyOpaque(IBlockState state)
{
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return true;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}
@Override
public void randomTick(World world, BlockPos pos, IBlockState state, Random random)
{
this.updateTick(world, pos, state, random);
if(!world.isRemote){
if(state.getValue(ACTIVE) == true) {
makeSmoke(world, pos);
}
}
}
@SideOnly(Side.CLIENT)
@SuppressWarnings("incomplete-switch")
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand)
{
if(state.getValue(Forge.ACTIVE) == true)
{
double d0 = (double)pos.getX() + 0.5D;
double d1 = (double)pos.getY() + 0.96D;
double d2 = (double)pos.getZ() + 0.5D;
double d3 = 0.52D;
double d4 = ThreadLocalRandom.current().nextDouble(0.075, 0.35);
double ySpeed = ThreadLocalRandom.current().nextDouble(0.0, 0.075);
if (rand.nextDouble() < 0.1D)
{
world.playSound((double)pos.getX() + 0.5D, (double)pos.getY(), (double)pos.getZ() + 0.5D, SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
}
if(rand.nextInt(4) == 1){
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, ySpeed, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2-d4, 0.0D, ySpeed, 0.0D, new int[0]);
}
if(rand.nextInt(4) == 2){
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2-d4, 0.0D, ySpeed, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2+d4, 0.0D, ySpeed, 0.0D, new int[0]);
}
if(rand.nextInt(4) == 3){
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2+d4, 0.0D, ySpeed, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2-d4, 0.0D, ySpeed, 0.0D, new int[0]);
}
if(rand.nextInt(4) == 4){
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2-d4, 0.0D, ySpeed, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, ySpeed, 0.0D, new int[0]);
}
}
}
}

View File

@@ -1,104 +0,0 @@
package nmd.primal.forgecraft.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
/**
* Created by mminaie on 2/6/17.
*/
public class IngotBall extends BlockCustomBase {
protected static AxisAlignedBB boundBoxLarge = new AxisAlignedBB(6/16D, 0.0D, 6/16D, 10/16D, 4/16D, 10/16D);
protected static AxisAlignedBB boundBoxSmall = new AxisAlignedBB(7/16D, 0.0D, 7/16D, 9/16D, 2/16D, 9/16D);
public static final PropertyBool ACTIVE = PropertyBool.create("active");
private String type;
public IngotBall(Material material, String registryName, Float hardness, String type){
super(material, registryName, hardness);
this.type = type;
this.setTickRandomly(true);
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
if(this.type.equals("chunk")){
return boundBoxSmall;
}else
return boundBoxLarge;
}
@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
//System.out.println(stack.getItemDamage());
worldIn.setBlockState(pos, state.withProperty(ACTIVE, Boolean.valueOf(false)), 2);
//System.out.println(state.getValue(ACTIVE));
}
@Override
public int getMetaFromState(IBlockState state) {
int i = 0;
if( state.getValue(ACTIVE) == false) {
i = 0;
return i;
}
if( state.getValue(ACTIVE) == true) {
i = 1;
return i;
}
return i;
}
@Override
public IBlockState getStateFromMeta(int meta)
{
IBlockState iblockstate = this.getDefaultState();
if (meta == 0){
iblockstate = iblockstate.withProperty(ACTIVE, Boolean.valueOf(false));
}
if (meta == 1) {
iblockstate = iblockstate.withProperty(ACTIVE, Boolean.valueOf(true));
}
return iblockstate;
}
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[] {ACTIVE});
}
@Override
public void randomTick(World world, BlockPos pos, IBlockState state, Random random)
{
this.updateTick(world, pos, state, random);
if(!world.isRemote){
if ( ThreadLocalRandom.current().nextInt(0,4) == 0) {
if(state.getValue(ACTIVE) == true) {
world.setBlockState(pos, state.withProperty(ACTIVE, Boolean.valueOf(false)), 2);
world.playSound((EntityPlayer) null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 1.0F, world.rand.nextFloat() * 0.4F + 0.8F);
}
}
}
}
}

View File

@@ -1,504 +0,0 @@
package nmd.primal.forgecraft.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModSounds;
import nmd.primal.forgecraft.tiles.TileBloomery;
import nmd.primal.forgecraft.tiles.TileForge;
import nmd.primal.forgecraft.tiles.TilePistonBellows;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
/**
* Created by mminaie on 1/1/17.
*/
public class PistonBellows extends CustomContainerFacing {
public static final PropertyBool ACTIVE = PropertyBool.create("active");
//protected static final AxisAlignedBB collideBox = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.99D, 1.0D);
protected static final AxisAlignedBB boundBoxNorth = new AxisAlignedBB(0.1875D, 0.0D, 0.0D, 1.0D, 12 / 16D, 1.0D);
protected static final AxisAlignedBB boundBoxSouth = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.8125D, 12 / 16D, 1.0D);
protected static final AxisAlignedBB boundBoxEast = new AxisAlignedBB(0.0D, 0.0D, 0.1875D, 1.0D, 12 / 16D, 1.0D);
protected static final AxisAlignedBB boundBoxWest = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 12 / 16D, 0.8125D);
public PistonBellows(Material material, String registryName) {
super(material);
setUnlocalizedName(ModInfo.ForgecraftBlocks.PISTONBELLOWS.getUnlocalizedName());
//setRegistryName(ModInfo.ForgecraftBlocks.PISTONBELLOWS.getRegistryName());
setRegistryName(registryName);
setCreativeTab(ModInfo.TAB_FORGECRAFT);
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, Boolean.valueOf(false)));
setHardness(3.0f);
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta)
{
return new TilePistonBellows();
}
@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
TilePistonBellows tile = (TilePistonBellows) worldIn.getTileEntity(pos);
if (tile != null) {
worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(ACTIVE, Boolean.valueOf(false)), 2);
}
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if(!world.isRemote){
//System.out.println(state.getValue(PistonBellows.FACING));
if(state.getValue(this.ACTIVE) == false) {
world.setBlockState(pos, state.withProperty(ACTIVE, true), 2);
//world.playSound(pos, ForgecraftSounds.PISTON_BELLOWS, SoundCategory.BLOCKS, 1.0f, 1.0f);
//world.playSound((double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), ModSounds.PISTON_BELLOWS, SoundCategory.BLOCKS, 1.0f, 1.0f, true);
world.playSound(null, pos, ModSounds.PISTON_BELLOWS, SoundCategory.BLOCKS, 0.25F, 0.8F);
//playSound(@Nullable EntityPlayer player, double x, double y, double z, SoundEvent soundIn, SoundCategory category, float volume, float pitch)
if (state.getValue(PistonBellows.FACING) == EnumFacing.NORTH) {
BlockPos tempPos = new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ());
if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) {
TileForge tile = (TileForge) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Forge.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Forge.FACING) == EnumFacing.EAST)) {
if (tile != null) {
//System.out.println(world.getBlockState(tempPos).getValue(Forge.FACING));
tile.setHeat(tile.getHeat() + 50);
tile.updateBlock();
tile.markDirty();
return true;
}
}
}
if (world.getBlockState(tempPos).getBlock() == ModBlocks.bloomery) {
TileBloomery tile = (TileBloomery) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Bloomery.ACTIVE) == true)
&& (world.getBlockState(tempPos).getValue(Bloomery.FACING) == EnumFacing.EAST)) {
if (tile != null) {
//System.out.println(world.getBlockState(tempPos).getValue(Forge.FACING));
tile.setHeat(tile.getHeat() + 50);
if(world.getBlockState(tempPos).getValue(Bloomery.COVERED) == true){
tile.setHeat(tile.getHeat() + 50);
}
tile.updateBlock();
tile.markDirty();
return true;
}
}
}
}
if (state.getValue(PistonBellows.FACING) == EnumFacing.SOUTH) {
BlockPos tempPos = new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ());
if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) {
TileForge tile = (TileForge) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Forge.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Forge.FACING) == EnumFacing.WEST)) {
if (tile != null) {
//System.out.println(world.getBlockState(tempPos).getValue(Forge.FACING));
tile.setHeat(tile.getHeat() + 50);
tile.updateBlock();
tile.markDirty();
return true;
}
}
}
if (world.getBlockState(tempPos).getBlock() == ModBlocks.bloomery) {
TileBloomery tile = (TileBloomery) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Bloomery.ACTIVE) == true)
&& (world.getBlockState(tempPos).getValue(Bloomery.FACING) == EnumFacing.WEST)) {
if (tile != null) {
//System.out.println(world.getBlockState(tempPos).getValue(Forge.FACING));
tile.setHeat(tile.getHeat() + 50);
if(world.getBlockState(tempPos).getValue(Bloomery.COVERED) == true){
tile.setHeat(tile.getHeat() + 50);
}
tile.updateBlock();
tile.markDirty();
return true;
}
}
}
}
if (state.getValue(PistonBellows.FACING) == EnumFacing.EAST) {
BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ() + 1);
if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) {
TileForge tile = (TileForge) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Forge.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Forge.FACING) == EnumFacing.SOUTH)) {
if (tile != null) {
//System.out.println(world.getBlockState(tempPos).getValue(Forge.FACING));
tile.setHeat(tile.getHeat() + 50);
tile.updateBlock();
tile.markDirty();
return true;
}
}
}
if (world.getBlockState(tempPos).getBlock() == ModBlocks.bloomery) {
TileBloomery tile = (TileBloomery) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Bloomery.ACTIVE) == true)
&& (world.getBlockState(tempPos).getValue(Bloomery.FACING) == EnumFacing.SOUTH)) {
if (tile != null) {
//System.out.println(world.getBlockState(tempPos).getValue(Forge.FACING));
tile.setHeat(tile.getHeat() + 50);
if(world.getBlockState(tempPos).getValue(Bloomery.COVERED) == true){
tile.setHeat(tile.getHeat() + 50);
}
tile.updateBlock();
tile.markDirty();
return true;
}
}
}
}
if (state.getValue(PistonBellows.FACING) == EnumFacing.WEST) {
BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ() - 1);
if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) {
TileForge tile = (TileForge) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Forge.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Forge.FACING) == EnumFacing.NORTH)) {
if (tile != null) {
//System.out.println(world.getBlockState(tempPos).getValue(Forge.FACING));
tile.setHeat(tile.getHeat() + 50);
tile.updateBlock();
tile.markDirty();
return true;
}
}
}
if (world.getBlockState(tempPos).getBlock() == ModBlocks.bloomery) {
TileBloomery tile = (TileBloomery) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Bloomery.ACTIVE) == true)
&& (world.getBlockState(tempPos).getValue(Bloomery.FACING) == EnumFacing.NORTH)) {
if (tile != null) {
//System.out.println(world.getBlockState(tempPos).getValue(Forge.FACING));
tile.setHeat(tile.getHeat() + 50);
if(world.getBlockState(tempPos).getValue(Bloomery.COVERED) == true){
tile.setHeat(tile.getHeat() + 50);
}
tile.updateBlock();
tile.markDirty();
return true;
}
}
}
}
}
}
return true;
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
state = state.getActualState(source, pos);
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
switch (enumfacing)
{
case EAST:
default:
return boundBoxEast;
case SOUTH:
return boundBoxSouth;
case WEST:
return boundBoxWest;
case NORTH:
return boundBoxNorth;
}
}
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state)
{
/*if (!world.isRemote && world.getGameRules().getBoolean("doTileDrops"))
{
TilePistonBellows tile = (TilePistonBellows) world.getTileEntity(pos);
if (tile !=null)
{
for (ItemStack stack : tile.getSlotList())
{
if (stack != null) {
float offset = 0.7F;
double offsetX = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetY = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetZ = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
EntityItem item = new EntityItem(world, pos.getX() + offsetX, pos.getY() + offsetY, pos.getZ() + offsetZ, stack);
item.setDefaultPickupDelay();
world.spawnEntity(item);
}
}
}
}*/
super.breakBlock(world, pos, state);
}
@Override
public int getMetaFromState(IBlockState state) {
int i = 0;
if( (state.getValue(FACING) == EnumFacing.EAST) && state.getValue(ACTIVE) == false){
i = 0;
return i;
}
if( (state.getValue(FACING) == EnumFacing.WEST) && state.getValue(ACTIVE) == false){
i = 1;
return i;
}
if( (state.getValue(FACING) == EnumFacing.SOUTH) && state.getValue(ACTIVE) == false){
i = 2;
return i;
}
if( (state.getValue(FACING) == EnumFacing.NORTH) && state.getValue(ACTIVE) == false){
i = 3;
return i;
}
if( (state.getValue(FACING) == EnumFacing.EAST) && state.getValue(ACTIVE) == true){
i = 4;
return i;
}
if( (state.getValue(FACING) == EnumFacing.WEST) && state.getValue(ACTIVE) == true){
i = 5;
return i;
}
if( (state.getValue(FACING) == EnumFacing.SOUTH) && state.getValue(ACTIVE) == true){
i = 6;
return i;
}
if( (state.getValue(FACING) == EnumFacing.NORTH) && state.getValue(ACTIVE) == true){
i = 7;
return i;
}
return i;
}
@Override
public IBlockState getStateFromMeta(int meta) {
EnumFacing enumfacing;
Boolean active;
switch (meta & 7)
{
case 0:
enumfacing = EnumFacing.EAST;
active = false;
break;
case 1:
enumfacing = EnumFacing.WEST;
active = false;
break;
case 2:
enumfacing = EnumFacing.SOUTH;
active = false;
break;
case 3:
enumfacing = EnumFacing.NORTH;
active = false;
break;
case 4:
enumfacing = EnumFacing.EAST;
active = true;
break;
case 5:
enumfacing = EnumFacing.WEST;
active = true;
break;
case 6:
enumfacing = EnumFacing.SOUTH;
active = true;
break;
case 7:
enumfacing = EnumFacing.NORTH;
active = true;
break;
default:
enumfacing = EnumFacing.NORTH;
active = false;
}
return this.getDefaultState().withProperty(FACING, enumfacing).withProperty(ACTIVE, Boolean.valueOf(active));
}
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[] {FACING, ACTIVE});
}
//return new ExtendedBlockState(this, new IProperty[] { BotaniaStateProps.CARDINALS, Properties.StaticProperty }, new IUnlistedProperty[] { Properties.AnimationProperty });
@Override
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
public boolean isFullyOpaque(IBlockState state)
{
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return true;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand)
{
if(state.getValue(PistonBellows.ACTIVE) == Boolean.TRUE) {
if (state.getValue(PistonBellows.FACING) == EnumFacing.NORTH) {
BlockPos tempPos = new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ());
if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) {
TileForge tile = (TileForge) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Forge.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Forge.FACING) == EnumFacing.EAST)) {
makeEmbers(world, tempPos, world.rand);
}
}
if (world.getBlockState(tempPos).getBlock() instanceof Bloomery) {
TileBloomery tile = (TileBloomery) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Bloomery.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Bloomery.FACING) == EnumFacing.EAST)) {
makeEmbers(world, tempPos, world.rand);
}
}
}
if (state.getValue(PistonBellows.FACING) == EnumFacing.SOUTH) {
BlockPos tempPos = new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ());
if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) {
TileForge tile = (TileForge) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Forge.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Forge.FACING) == EnumFacing.WEST)) {
makeEmbers(world, tempPos, world.rand);
}
}
if (world.getBlockState(tempPos).getBlock() instanceof Bloomery) {
TileBloomery tile = (TileBloomery) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Bloomery.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Bloomery.FACING) == EnumFacing.WEST)) {
makeEmbers(world, tempPos, world.rand);
}
}
}
if (state.getValue(PistonBellows.FACING) == EnumFacing.EAST) {
BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ() + 1);
if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) {
TileForge tile = (TileForge) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Forge.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Forge.FACING) == EnumFacing.SOUTH)) {
makeEmbers(world, tempPos, world.rand);
}
}
if (world.getBlockState(tempPos).getBlock() instanceof Bloomery) {
TileBloomery tile = (TileBloomery) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Bloomery.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Bloomery.FACING) == EnumFacing.SOUTH)) {
makeEmbers(world, tempPos, world.rand);
}
}
}
if (state.getValue(PistonBellows.FACING) == EnumFacing.WEST) {
BlockPos tempPos = new BlockPos(pos.getX(), pos.getY(), pos.getZ() - 1);
if (world.getBlockState(tempPos).getBlock() == ModBlocks.firebox) {
TileForge tile = (TileForge) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Forge.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Forge.FACING) == EnumFacing.NORTH)) {
makeEmbers(world, tempPos, world.rand);
}
}
if (world.getBlockState(tempPos).getBlock() instanceof Bloomery) {
TileBloomery tile = (TileBloomery) world.getTileEntity(tempPos);
if ((world.getBlockState(tempPos).getValue(Bloomery.ACTIVE) == true) && (world.getBlockState(tempPos).getValue(Bloomery.FACING) == EnumFacing.NORTH)) {
makeEmbers(world, tempPos, world.rand);
}
}
}
}
}
private void makeEmbers(World world, BlockPos pos, Random rand){
double d0 = (double)pos.getX() + 0.5D;
double d1 = (double)pos.getY() + 0.2D;
double d2 = (double)pos.getZ() + 0.5D;
double d3 = 0.52D;
double d4 = ThreadLocalRandom.current().nextDouble(0.075, 0.25);
double ySpeed = ThreadLocalRandom.current().nextDouble(0.05, 0.20);
if(rand.nextInt(3) == 0){
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, ySpeed, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2-d4, 0.0D, ySpeed, 0.0D, new int[0]);
}
if(rand.nextInt(3) == 1){
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2-d4, 0.0D, ySpeed, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2+d4, 0.0D, ySpeed, 0.0D, new int[0]);
}
if(rand.nextInt(3) == 2){
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2+d4, 0.0D, ySpeed, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2-d4, 0.0D, ySpeed, 0.0D, new int[0]);
}
if(rand.nextInt(3) == 3){
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2-d4, 0.0D, ySpeed, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, ySpeed, 0.0D, new int[0]);
}
}
}
/*
if(rand.nextInt(4) == 1){
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, (double) (rand.nextInt(2) + 1)/1000, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2-d4, 0.0D, (double) (rand.nextInt(2) + 1)/1000, 0.0D, new int[0]);
}
if(rand.nextInt(4) == 2){
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2-d4, 0.0D, (double) (rand.nextInt(2) + 1)/1000, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2+d4, 0.0D, (double) (rand.nextInt(2) + 1)/1000, 0.0D, new int[0]);
}
if(rand.nextInt(4) == 3){
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2+d4, 0.0D, (double) (rand.nextInt(2) + 1)/1000, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2-d4, 0.0D, (double) (rand.nextInt(2) + 1)/1000, 0.0D, new int[0]);
}
if(rand.nextInt(4) == 4){
world.spawnParticle(EnumParticleTypes.FLAME, d0-d4, d1, d2-d4, 0.0D, (double) (rand.nextInt(2) + 1)/1000, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, d0+d4, d1, d2+d4, 0.0D, (double) (rand.nextInt(2) + 1)/1000, 0.0D, new int[0]);
}
*/

View File

@@ -1,15 +0,0 @@
package nmd.primal.forgecraft.compat;
import mezz.jei.api.BlankModPlugin;
import mezz.jei.api.IModRegistry;
/**
* Created by mminaie on 6/1/17.
*/
public class JEI extends BlankModPlugin
{
@Override
public void register(IModRegistry registry) {
}
}

View File

@@ -1,28 +0,0 @@
package nmd.primal.forgecraft.compat;
import net.minecraftforge.oredict.OreDictionary;
import nmd.primal.forgecraft.init.ModBlocks;
/**
* Created by mminaie on 2/7/17.
*/
public class ModDictionary {/*******************************************************************************
* Register Only Vanilla OreDictionary Entries Here
* Mod Items/Blocks have their names added through the respective
* registration methods as a list of comma delineated strings.
*
* EXAMPLE:
* LEATHER_CORDAGE = registerItem(new PrimalItem("leather_cordage"), "cordageGeneral, cordageLeather");
*
*/
public static void registerDictionaryNames()
{
//if (ModConfig.COMPATIBILITY_DICTIONARY_MAGMACREAM_AS_SLIME)
//OreDictionary.registerOre("clayball", Items.CLAY_BALL);
OreDictionary.registerOre("ingotIron", ModBlocks.ironball);
OreDictionary.registerOre("nuggetIron", ModBlocks.ironchunk);
}
}

View File

@@ -1,67 +0,0 @@
package nmd.primal.forgecraft.crafting;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import java.util.Arrays;
/**
* Created by mminaie on 3/5/17.
*/
public class AnvilCrafting {
// ***************************************************************************** //
// Recipe Handler AnvilCrafting
// ***************************************************************************** //
private static ArrayList<AnvilCrafting> anvilRecipes = new ArrayList<>();
private String[] input = new String[25];
private String upgradeType;
private ItemStack output;
public AnvilCrafting(String[] input, ItemStack output, String upgrade){
this.input = input;
this.output = output;
this.upgradeType = upgrade;
}
// ***************************************************************************** //
// Recipe Methods
// ***************************************************************************** //
public static void addRecipe(String[] input, ItemStack output, String upgrade)
{
anvilRecipes.add(new AnvilCrafting(input, output, upgrade));
}
public static boolean isRecipe(String[] array)
{
for(AnvilCrafting recipe : anvilRecipes) {
if (Arrays.equals(array, recipe.input))
return true;
}
return false;
}
public static AnvilCrafting getRecipe(String[] array)
{
for(AnvilCrafting recipe : anvilRecipes) {
if (Arrays.equals(array, recipe.input))
return recipe;
}
return null;
}
public String[] getInput() {return this.input;}
public ItemStack getOutput() {return this.output;}
public String getUpgrade() {return this.upgradeType; }
}

View File

@@ -1,135 +0,0 @@
package nmd.primal.forgecraft.crafting;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
/**
* Created by mminaie on 1/24/17.
*/
public class BloomeryCrafting {
// ***************************************************************************** //
// Recipe Handler Bloomery
// ***************************************************************************** //
private static ArrayList<BloomeryCrafting> bloomeryRecipes = new ArrayList<>();
private ItemStack input;
private ItemStack output;
private ItemStack output_failed;
private ItemStack cool_output;
private int heat_threshold;
private int ideal_time;
private int cooldown;
private float heat_variance;
private float time_variance;
public BloomeryCrafting(ItemStack input, ItemStack output, ItemStack output_failed, ItemStack cool_output, int heat_threshold, int ideal_time, int cooldown,float heat_variance, float time_variance)
{
this.input = input;
this.output = output;
this.output_failed = output_failed;
this.cool_output = cool_output;
this.heat_threshold = heat_threshold;
this.ideal_time = ideal_time;
this.cooldown = cooldown;
this.heat_variance = heat_variance;
this.time_variance = time_variance;
}
// ***************************************************************************** //
// Recipe Methods
// ***************************************************************************** //
public static void addRecipe(ItemStack input, ItemStack output, ItemStack failed, ItemStack cool, int heat_threshold, int ideal_time, int cooldown, float heat_variance, float time_variance)
{
bloomeryRecipes.add(new BloomeryCrafting(input, output, failed, cool, heat_threshold, ideal_time, cooldown, heat_variance, time_variance));
}
public static boolean isRecipeItem(ItemStack stack)
{
for(BloomeryCrafting recipe : bloomeryRecipes) {
if (stack.isItemEqual(recipe.input))
return true;
}
return false;
}
public static boolean isOutputItem(ItemStack stack)
{
for(BloomeryCrafting recipe : bloomeryRecipes) {
if (stack.isItemEqual(recipe.output))
return true;
}
return false;
}
public static boolean isCoolItem(ItemStack stack)
{
for(BloomeryCrafting recipe : bloomeryRecipes) {
if (stack.isItemEqual(recipe.cool_output))
return true;
}
return false;
}
public static BloomeryCrafting getRecipe(ItemStack stack)
{
for(BloomeryCrafting recipe : bloomeryRecipes) {
if (stack.isItemEqual(recipe.input))
return recipe;
}
return null;
}
public static BloomeryCrafting getRecipeFromOutput(ItemStack stack)
{
for(BloomeryCrafting recipe : bloomeryRecipes) {
if (stack.isItemEqual(recipe.output))
return recipe;
}
return null;
}
public ItemStack getInput()
{
return this.input;
}
public ItemStack getOutput()
{
return this.output;
}
public ItemStack getOutputFailed()
{
return this.output_failed;
}
public ItemStack getCoolOutput()
{
return this.cool_output;
}
public int getHeatThreshold()
{
return this.heat_threshold;
}
public int getIdealTime()
{
return this.ideal_time;
}
public int getCooldown(){ return this.cooldown;}
public float getHeatVariance(){return this.heat_variance; }
public float getTimeVariance(){return this.time_variance; }
///
// end
///
}

View File

@@ -1,513 +0,0 @@
package nmd.primal.forgecraft.init;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.core.common.items.tools.WorkMallet;
import nmd.primal.forgecraft.blocks.*;
import nmd.primal.forgecraft.items.ForgeHammer;
import nmd.primal.forgecraft.tiles.TileAnvil;
/**
* Created by kitsu on 11/26/2016.
*/
public class ModBlocks {
public static Block firebox;
public static Block bloomery;
public static Block blockbreaker;
public static Block pistonbellowsoak;
public static Block pistonbellowsjungle;
public static Block pistonbellowsbirch;
public static Block pistonbellowsspruce;
public static Block pistonbellowsdarkoak;
public static Block pistonbellowsacacia;
public static Block emptycrucible;
public static Block emptycruciblehot;
public static Block emptycruciblecracked;
public static Block emptycruciblecrackedhot;
public static Block rawironcrucible;
public static Block hotironcrucible;
public static Block hotcookedironcrucible;
public static Block coolironcrucible;
public static Block failedironcrucible;
public static Block failedironcruciblehot;
public static Block rawcleanironcrucible;
public static Block hotcleanironcrucible;
public static Block hotcookedcleanironcrucible;
public static Block coolcleanironcrucible;
public static Block failedcleanironcrucible;
public static Block failedcleanironcruciblehot;
public static Block rawsteelcrucible;
public static Block hotsteelcrucible;
public static Block hotcookedsteelcrucible;
public static Block coolsteelcrucible;
public static Block failedsteelcrucible;
public static Block failedsteelcruciblehot;
public static Block rawwootzcrucible;
public static Block hotwootzcrucible;
public static Block hotcookedwootzcrucible;
public static Block coolwootzcrucible;
public static Block failedwootzcrucible;
public static Block failedwootzcruciblehot;
public static Block ironball;
public static Block ironchunk;
public static Block ironcleanball;
public static Block ironcleanchunk;
public static Block steelball;
public static Block steelchunk;
public static Block wootzball;
public static Block wootzchunk;
public static Block stoneanvil;
public static Block ironanvil;
public static void init() {
firebox = new Forge(Material.ROCK);
bloomery = new Bloomery(Material.ROCK, "bloomery");
blockbreaker = new Breaker(Material.WOOD, "blockbreaker", 4.0f);
pistonbellowsoak = new PistonBellows(Material.WOOD, "pistonbellowsoak");
pistonbellowsjungle = new PistonBellows(Material.WOOD, "pistonbellowsjungle");
pistonbellowsbirch = new PistonBellows(Material.WOOD, "pistonbellowsbirch");
pistonbellowsspruce = new PistonBellows(Material.WOOD, "pistonbellowsspruce");
pistonbellowsdarkoak = new PistonBellows(Material.WOOD, "pistonbellowsdarkoak");
pistonbellowsacacia = new PistonBellows(Material.WOOD, "pistonbellowsacacia");
emptycrucible = new Crucible(Material.ROCK, "emptycrucible");
emptycruciblehot = new CrucibleHot(Material.ROCK, "emptycruciblehot");
emptycruciblecracked = new Crucible(Material.ROCK, "emptycruciblecracked");
emptycruciblecrackedhot = new CrucibleHot(Material.ROCK, "emptycruciblecrackedhot");
rawironcrucible = new Crucible(Material.ROCK, "rawironcrucible");
hotironcrucible = new CrucibleHot(Material.ROCK, "hotironcrucible");
hotcookedironcrucible = new CrucibleHot(Material.ROCK, "hotcookedironcrucible");
coolironcrucible = new Crucible(Material.ROCK, "coolironcrucible");
failedironcrucible = new Crucible(Material.ROCK, "failedironcrucible");
failedironcruciblehot = new CrucibleHot(Material.ROCK, "failedironcruciblehot");
rawcleanironcrucible = new Crucible(Material.ROCK, "rawcleanironcrucible");
hotcleanironcrucible = new CrucibleHot(Material.ROCK, "hotcleanironcrucible");
hotcookedcleanironcrucible = new CrucibleHot(Material.ROCK, "hotcookedcleanironcrucible");
coolcleanironcrucible = new Crucible(Material.ROCK, "coolcleanironcrucible");
failedcleanironcrucible = new Crucible(Material.ROCK, "failedcleanironcrucible");
failedcleanironcruciblehot = new Crucible(Material.ROCK, "failedcleanironcruciblehot");
rawsteelcrucible = new Crucible(Material.ROCK, "rawsteelcrucible");
hotsteelcrucible = new CrucibleHot(Material.ROCK, "hotsteelcrucible");
hotcookedsteelcrucible = new CrucibleHot(Material.ROCK, "hotcookedsteelcrucible");
coolsteelcrucible = new Crucible(Material.ROCK, "coolsteelcrucible");
failedsteelcrucible = new Crucible(Material.ROCK, "failedsteelcrucible");
failedsteelcruciblehot = new Crucible(Material.ROCK, "failedsteelcruciblehot");
rawwootzcrucible = new Crucible(Material.ROCK, "rawwootzcrucible");
hotwootzcrucible = new CrucibleHot(Material.ROCK, "hotwootzcrucible");
hotcookedwootzcrucible = new CrucibleHot(Material.ROCK, "hotcookedwootzcrucible");
coolwootzcrucible = new Crucible(Material.ROCK, "coolwootzcrucible");
failedwootzcrucible = new Crucible(Material.ROCK, "failedwootzcrucible");
failedwootzcruciblehot = new Crucible(Material.ROCK, "failedwootzcruciblehot");
ironball = new IngotBall(Material.IRON, "ironball", 5.0F, "ingot") {
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitx, float hity, float hitz)
{
if(!world.isRemote){
Item pItem = player.getHeldItem(hand).getItem();
BlockPos belowPos = pos.down();
//System.out.println("Activating");
if (pItem instanceof WorkMallet && world.getBlockState(belowPos).getBlock().equals(Blocks.STONE)) {
player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
world.setBlockState(belowPos, ModBlocks.stoneanvil.getDefaultState().withProperty(Anvil.FACING, player.getHorizontalFacing()), 2);
world.playEvent(1031, pos, 0);
//CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1));
return true;
}
/*if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) {
player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
world.setBlockState(belowPos, ModBlocks.ironanvil.getDefaultState().withProperty(Anvil.FACING, player.getHorizontalFacing()), 2);
world.playEvent(1031, pos, 0);
//CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1));
return true;
}*/
if (pItem instanceof WorkMallet || pItem.equals(ModItems.forgehammer)) {
if(world.getBlockState(belowPos).getBlock().equals(ModBlocks.stoneanvil)) {
TileAnvil tile = (TileAnvil) world.getTileEntity(belowPos);
if (tile.getSlotStack(6).isEmpty() &&
tile.getSlotStack(7).isEmpty() &&
tile.getSlotStack(8).isEmpty() &&
tile.getSlotStack(11).isEmpty() &&
tile.getSlotStack(12).isEmpty() &&
tile.getSlotStack(13).isEmpty() &&
tile.getSlotStack(16).isEmpty() &&
tile.getSlotStack(17).isEmpty() &&
tile.getSlotStack(18).isEmpty()
) {
player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
tile.setSlotStack(6, new ItemStack(ModItems.ironchunkhot, 1));
tile.setSlotStack(7, new ItemStack(ModItems.ironchunkhot, 1));
tile.setSlotStack(8, new ItemStack(ModItems.ironchunkhot, 1));
tile.setSlotStack(11, new ItemStack(ModItems.ironchunkhot, 1));
tile.setSlotStack(12, new ItemStack(ModItems.ironchunkhot, 1));
tile.setSlotStack(13, new ItemStack(ModItems.ironchunkhot, 1));
tile.setSlotStack(16, new ItemStack(ModItems.ironchunkhot, 1));
tile.setSlotStack(17, new ItemStack(ModItems.ironchunkhot, 1));
tile.setSlotStack(18, new ItemStack(ModItems.ironchunkhot, 1));
world.playEvent(1031, pos, 0);
return true;
}
}
}
}
return false;
}
};
ironcleanball = new IngotBall(Material.IRON, "ironcleanball", 5.0f, "ingot") {
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitx, float hity, float hitz)
{
//System.out.println("Level 0");
if(!world.isRemote){
Item pItem = player.getHeldItem(hand).getItem();
BlockPos belowPos = pos.down();
//System.out.println("Activating1");
if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) {
player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
world.setBlockState(belowPos, ModBlocks.ironanvil.getDefaultState().withProperty(Anvil.FACING, player.getHorizontalFacing()), 2);
world.playEvent(1031, pos, 0);
//System.out.println("Activating");
return true;
}
if (pItem instanceof WorkMallet || pItem.equals(ModItems.forgehammer)) {
if(world.getBlockState(belowPos).getBlock() instanceof Anvil) {
TileAnvil tile = (TileAnvil) world.getTileEntity(belowPos);
if (tile.getSlotStack(6).isEmpty() &&
tile.getSlotStack(7).isEmpty() &&
tile.getSlotStack(8).isEmpty() &&
tile.getSlotStack(11).isEmpty() &&
tile.getSlotStack(12).isEmpty() &&
tile.getSlotStack(13).isEmpty() &&
tile.getSlotStack(16).isEmpty() &&
tile.getSlotStack(17).isEmpty() &&
tile.getSlotStack(18).isEmpty()
) {
player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
tile.setSlotStack(6, new ItemStack(ModItems.ironcleanchunkhot, 1));
tile.setSlotStack(7, new ItemStack(ModItems.ironcleanchunkhot, 1));
tile.setSlotStack(8, new ItemStack(ModItems.ironcleanchunkhot, 1));
tile.setSlotStack(11, new ItemStack(ModItems.ironcleanchunkhot, 1));
tile.setSlotStack(12, new ItemStack(ModItems.ironcleanchunkhot, 1));
tile.setSlotStack(13, new ItemStack(ModItems.ironcleanchunkhot, 1));
tile.setSlotStack(16, new ItemStack(ModItems.ironcleanchunkhot, 1));
tile.setSlotStack(17, new ItemStack(ModItems.ironcleanchunkhot, 1));
tile.setSlotStack(18, new ItemStack(ModItems.ironcleanchunkhot, 1));
world.playEvent(1031, pos, 0);
return true;
}
}
}
}
return false;
}
}; // clean_iron_ingot ironcleanball.json ironcleanballhot.json - done
steelball = new IngotBall(Material.IRON, "steelball", 6.0f, "ingot"){
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitx, float hity, float hitz)
{
if(!world.isRemote){
Item pItem = player.getHeldItem(hand).getItem();
BlockPos belowPos = pos.down();
//System.out.println("Activating");
if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) {
player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
world.setBlockState(belowPos, ModBlocks.ironanvil.getDefaultState().withProperty(Anvil.FACING, player.getHorizontalFacing()), 2);
world.playEvent(1031, pos, 0);
//CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1));
return true;
}
if (pItem instanceof WorkMallet || pItem.equals(ModItems.forgehammer)) {
if(world.getBlockState(belowPos).getBlock() instanceof Anvil) {
TileAnvil tile = (TileAnvil) world.getTileEntity(belowPos);
if (tile.getSlotStack(6).isEmpty() &&
tile.getSlotStack(7).isEmpty() &&
tile.getSlotStack(8).isEmpty() &&
tile.getSlotStack(11).isEmpty() &&
tile.getSlotStack(12).isEmpty() &&
tile.getSlotStack(13).isEmpty() &&
tile.getSlotStack(16).isEmpty() &&
tile.getSlotStack(17).isEmpty() &&
tile.getSlotStack(18).isEmpty()
) {
player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
tile.setSlotStack(6, new ItemStack(ModItems.steelchunkhot, 1));
tile.setSlotStack(7, new ItemStack(ModItems.steelchunkhot, 1));
tile.setSlotStack(8, new ItemStack(ModItems.steelchunkhot, 1));
tile.setSlotStack(11, new ItemStack(ModItems.steelchunkhot, 1));
tile.setSlotStack(12, new ItemStack(ModItems.steelchunkhot, 1));
tile.setSlotStack(13, new ItemStack(ModItems.steelchunkhot, 1));
tile.setSlotStack(16, new ItemStack(ModItems.steelchunkhot, 1));
tile.setSlotStack(17, new ItemStack(ModItems.steelchunkhot, 1));
tile.setSlotStack(18, new ItemStack(ModItems.steelchunkhot, 1));
world.playEvent(1031, pos, 0);
return true;
}
}
}
}
return false;
}
}; // steel_ingot steelball.json steelballhot.json
wootzball = new IngotBall(Material.IRON, "wootzball", 6.0f, "ingot") {
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitx, float hity, float hitz)
{
if(!world.isRemote){
Item pItem = player.getHeldItem(hand).getItem();
BlockPos belowPos = pos.down();
//System.out.println("Activating");
if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) {
player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
world.setBlockState(belowPos, ModBlocks.ironanvil.getDefaultState().withProperty(Anvil.FACING, player.getHorizontalFacing()), 2);
world.playEvent(1031, pos, 0);
//CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1));
return true;
}
if (pItem instanceof WorkMallet || pItem.equals(ModItems.forgehammer)) {
if(world.getBlockState(belowPos).getBlock() instanceof Anvil) {
TileAnvil tile = (TileAnvil) world.getTileEntity(belowPos);
if (tile.getSlotStack(6).isEmpty() &&
tile.getSlotStack(7).isEmpty() &&
tile.getSlotStack(8).isEmpty() &&
tile.getSlotStack(11).isEmpty() &&
tile.getSlotStack(12).isEmpty() &&
tile.getSlotStack(13).isEmpty() &&
tile.getSlotStack(16).isEmpty() &&
tile.getSlotStack(17).isEmpty() &&
tile.getSlotStack(18).isEmpty()
) {
player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
tile.setSlotStack(6, new ItemStack(ModItems.wootzchunkhot, 1));
tile.setSlotStack(7, new ItemStack(ModItems.wootzchunkhot, 1));
tile.setSlotStack(8, new ItemStack(ModItems.wootzchunkhot, 1));
tile.setSlotStack(11, new ItemStack(ModItems.wootzchunkhot, 1));
tile.setSlotStack(12, new ItemStack(ModItems.wootzchunkhot, 1));
tile.setSlotStack(13, new ItemStack(ModItems.wootzchunkhot, 1));
tile.setSlotStack(16, new ItemStack(ModItems.wootzchunkhot, 1));
tile.setSlotStack(17, new ItemStack(ModItems.wootzchunkhot, 1));
tile.setSlotStack(18, new ItemStack(ModItems.wootzchunkhot, 1));
world.playEvent(1031, pos, 0);
return true;
}
}
}
}
return false;
}
}; //wootz_ingot wootzball.json wootzballhot.json
ironchunk = new IngotBall(Material.IRON, "ironchunk", 5.0F, "chunk");
ironcleanchunk = new IngotBall(Material.IRON, "ironcleanchunk", 5.0F, "chunk"); //Lyle to make assets clean_iron_ingot, blockstate\ironcleanchunk.json, item\ironcleanchunk.json, item\ironcleanchunkhot.json - done
steelchunk = new IngotBall(Material.IRON, "steelchunk", 6.0f, "chunk"); //steel_ingot steelchunk.json steelchunkhot.json - done
wootzchunk = new IngotBall(Material.IRON, "wootzchunk", 6.0f, "chunk"); //wootz_ingot wootzchunk.json wootzchunkhot.json - done
stoneanvil = new Anvil(Material.ANVIL, "stoneanvil", 5.0f);
ironanvil = new Anvil(Material.ANVIL, "ironanvil", 6.0f);
//ironballitemcool = new ItemBlockIngotBall(ironball);
//ironballitemhot = new ItemBlockIngotBall(ironball);
}
public static void register() {
registerBlock(firebox);
registerBlock(bloomery);
registerBlock(blockbreaker);
registerBlock(pistonbellowsoak);
registerBlock(pistonbellowsjungle);
registerBlock(pistonbellowsbirch);
registerBlock(pistonbellowsspruce);
registerBlock(pistonbellowsdarkoak);
registerBlock(pistonbellowsacacia);
registerBlock(emptycrucible);
registerBlock(emptycruciblehot);
registerBlock(emptycruciblecracked);
registerBlock(emptycruciblecrackedhot);
registerBlock(rawironcrucible);
registerBlock(hotironcrucible);
registerBlock(hotcookedironcrucible);
registerBlock(coolironcrucible);
registerBlock(failedironcrucible);
registerBlock(failedironcruciblehot);
registerBlock(rawcleanironcrucible);
registerBlock(hotcleanironcrucible);
registerBlock(hotcookedcleanironcrucible);
registerBlock(coolcleanironcrucible);
registerBlock(failedcleanironcrucible);
registerBlock(failedcleanironcruciblehot);
registerBlock(rawsteelcrucible);
registerBlock(hotsteelcrucible);
registerBlock(hotcookedsteelcrucible);
registerBlock(coolsteelcrucible);
registerBlock(failedsteelcrucible);
registerBlock(failedsteelcruciblehot);
registerBlock(rawwootzcrucible);
registerBlock(hotwootzcrucible);
registerBlock(hotcookedwootzcrucible);
registerBlock(coolwootzcrucible);
registerBlock(failedwootzcrucible);
registerBlock(failedwootzcruciblehot);
registerBlock(ironball);
registerBlock(ironchunk);
registerBlock(ironcleanball);
registerBlock(ironcleanchunk);
registerBlock(steelball);
registerBlock(steelchunk);
registerBlock(wootzball);
registerBlock(wootzchunk);
//registerBlockSubType(ironball, ironballitemcool, "ironcool");
//registerBlockSubType(ironball, ironballitemhot, "ironhot");
registerBlock(stoneanvil);
registerBlock(ironanvil);
}
@SideOnly(Side.CLIENT)
public static void registerRenders() {
registerRender(firebox);
registerRender(blockbreaker);
registerRender(pistonbellowsoak);
registerRender(pistonbellowsjungle);
registerRender(pistonbellowsbirch);
registerRender(pistonbellowsspruce);
registerRender(pistonbellowsdarkoak);
registerRender(pistonbellowsacacia);
registerRender(bloomery);
registerRender(emptycrucible);
registerRender(emptycruciblehot);
registerRender(emptycruciblecracked);
registerRender(emptycruciblecrackedhot);
registerRender(rawironcrucible);
registerRender(hotironcrucible);
registerRender(hotcookedironcrucible);
registerRender(coolironcrucible);
registerRender(failedironcrucible);
registerRender(failedironcruciblehot);
registerRender(rawcleanironcrucible);
registerRender(hotcleanironcrucible);
registerRender(hotcookedcleanironcrucible);
registerRender(coolcleanironcrucible);
registerRender(failedcleanironcrucible);
registerRender(failedcleanironcruciblehot);
registerRender(rawsteelcrucible);
registerRender(hotsteelcrucible);
registerRender(hotcookedsteelcrucible);
registerRender(coolsteelcrucible);
registerRender(failedsteelcrucible);
registerRender(failedsteelcruciblehot);
registerRender(rawwootzcrucible);
registerRender(hotwootzcrucible);
registerRender(hotcookedwootzcrucible);
registerRender(coolwootzcrucible);
registerRender(failedwootzcrucible);
registerRender(failedwootzcruciblehot);
registerRender(ironball);
registerRender(ironchunk);
registerRender(ironcleanball);
registerRender(ironcleanchunk);
registerRender(steelball);
registerRender(steelchunk);
registerRender(wootzball);
registerRender(wootzchunk);
//registerRenderCustom(ironballitemcool, 0, new ModelResourceLocation(ironballitemcool.getUnlocalizedName()));
//registerRenderCustom(ironballitemhot, 1, new ModelResourceLocation(ironballitemhot.getUnlocalizedName()));
registerRender(stoneanvil);
registerRender(ironanvil);
}
private static void registerBlock(Block block) {
GameRegistry.register(block);
ItemBlock item = new ItemBlock(block);
item.setRegistryName(block.getRegistryName());
GameRegistry.register(item);
}
private static void registerBlockSubType(Block block, ItemBlock itemBlock, String registryName){
GameRegistry.register(block);
ItemBlock item = itemBlock;
item.setRegistryName(registryName);
GameRegistry.register(item);
}
private static void registerRender(Block block) {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
}
private static void registerRenderCustom(ItemBlock item, Integer meta, ModelResourceLocation model){
ModelLoader.setCustomModelResourceLocation(item, meta, model);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +0,0 @@
package nmd.primal.forgecraft.init;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.CommonEvents;
/**
* Created by mminaie on 3/15/17.
*/
public class ModEvents {
public static void registerCommonEvents()
{
MinecraftForge.EVENT_BUS.register(new CommonEvents());
}
@SideOnly(Side.CLIENT)
public static void registerClientEvents() {
//MinecraftForge.EVENT_BUS.register(new ClientEvents());
}
}

View File

@@ -1,481 +0,0 @@
package nmd.primal.forgecraft.init;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.core.api.PrimalMaterials;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.items.*;
import nmd.primal.forgecraft.items.parts.ToolPart;
import nmd.primal.forgecraft.items.tools.CustomAxe;
import nmd.primal.forgecraft.items.tools.CustomHoe;
import nmd.primal.forgecraft.items.tools.CustomPickaxe;
import nmd.primal.forgecraft.items.tools.CustomShovel;
import nmd.primal.forgecraft.items.weapons.CustomShield;
import nmd.primal.forgecraft.items.weapons.CustomSword;
/**
* Created by kitsu on 11/26/2016.
*/
public class ModItems {
//public static Item test;
public static Item pistonbellows;
public static Item forgehammer;
public static Item softcrucible;
public static Item stonetongs;
public static Item ironingotballhot;
public static Item ironchunkhot;
public static Item ironcleaningotballhot;
public static Item ironcleanchunkhot;
public static Item steelingotballhot;
public static Item steelchunkhot;
public static Item wootzingotballhot;
public static Item wootzchunkhot;
public static Item pickaxehead;
public static Item ironaxehead;
public static Item ironshovelhead;
public static Item ironhoehead;
public static Item cleanironpickaxehead;
public static Item cleanironaxehead;
public static Item cleanironshovelhead;
public static Item cleanironhoehead;
public static Item steelpickaxehead;
public static Item steelaxehead;
public static Item steelshovelhead;
public static Item steelhoehead;
public static Item wootzpickaxehead;
public static Item wootzaxehead;
public static Item wootzshovelhead;
public static Item wootzhoehead;
public static Item ironpickaxe;
public static Item ironaxe;
public static Item ironshovel;
public static Item ironhoe;
public static Item cleanironpickaxe;
public static Item cleanironaxe;
public static Item cleanironshovel;
public static Item cleanironhoe;
public static Item steelpickaxe;
public static Item steelaxe;
public static Item steelshovel;
public static Item steelhoe;
public static Item wootzpickaxe;
public static Item wootzaxe;
public static Item wootzshovel;
public static Item wootzhoe;
public static Item ironsword;
public static Item cleanironsword;
public static Item steelsword;
public static Item wootzsword;
public static Item wroughtironshield;
//public static Item cleanironshield;
//public static Item steelshield;
//public static Item wootzshield;
public static Item matchlockmusket;
//public static Item forgingmanual;
public static void init() {
//OBJLoader.INSTANCE.addDomain(ModInfo.MOD_ID);
pistonbellows = new ItemBellowsHandle();
softcrucible = new ItemSoftCrucible();
stonetongs = new ItemStoneTongs("stonetongs");
forgehammer = new ForgeHammer("forgehammer");
//matchlockmusket = new Musket("matchlock_musket");
/**********
TOOL PARTS
**********/
pickaxehead = new ToolPart("ironpickaxehead", PrimalMaterials.TOOL_WROUGHT_IRON);
ironaxehead = new ToolPart("ironaxehead", PrimalMaterials.TOOL_WROUGHT_IRON);
ironshovelhead = new ToolPart("ironshovelhead", PrimalMaterials.TOOL_WROUGHT_IRON);
ironhoehead = new ToolPart("ironhoehead", PrimalMaterials.TOOL_WROUGHT_IRON);
cleanironpickaxehead = new ToolPart("cleanironpickaxehead", PrimalMaterials.TOOL_CLEAN_IRON);
cleanironaxehead = new ToolPart("cleanironaxehead", PrimalMaterials.TOOL_CLEAN_IRON);
cleanironshovelhead = new ToolPart("cleanironshovelhead", PrimalMaterials.TOOL_CLEAN_IRON);
cleanironhoehead = new ToolPart("cleanironhoehead", PrimalMaterials.TOOL_CLEAN_IRON);
steelpickaxehead = new ToolPart("steelpickaxehead", PrimalMaterials.TOOL_BASIC_STEEL);
steelaxehead = new ToolPart("steelaxehead", PrimalMaterials.TOOL_BASIC_STEEL);
steelshovelhead = new ToolPart("steelshovelhead", PrimalMaterials.TOOL_BASIC_STEEL);
steelhoehead = new ToolPart("steelhoehead", PrimalMaterials.TOOL_BASIC_STEEL);
wootzpickaxehead = new ToolPart("wootzpickaxehead", PrimalMaterials.TOOL_WOOTZ_STEEL);
wootzaxehead = new ToolPart("wootzaxehead", PrimalMaterials.TOOL_WOOTZ_STEEL);
wootzshovelhead = new ToolPart("wootzshovelhead", PrimalMaterials.TOOL_WOOTZ_STEEL);
wootzhoehead = new ToolPart("wootzhoehead", PrimalMaterials.TOOL_WOOTZ_STEEL);
/**********
TOOLS
**********/
ironpickaxe = new CustomPickaxe("ironpickaxe", PrimalMaterials.TOOL_WROUGHT_IRON);
ironaxe = new CustomAxe("ironaxe", PrimalMaterials.TOOL_WROUGHT_IRON);
ironshovel = new CustomShovel("ironshovel", PrimalMaterials.TOOL_WROUGHT_IRON);
ironhoe = new CustomHoe("ironhoe", PrimalMaterials.TOOL_WROUGHT_IRON);
cleanironpickaxe = new CustomPickaxe("cleanironpickaxe", PrimalMaterials.TOOL_CLEAN_IRON);
cleanironaxe = new CustomAxe("cleanironaxe", PrimalMaterials.TOOL_CLEAN_IRON);
cleanironshovel = new CustomShovel("cleanironshovel", PrimalMaterials.TOOL_CLEAN_IRON);
cleanironhoe = new CustomHoe("cleanironhoe", PrimalMaterials.TOOL_CLEAN_IRON);
steelpickaxe = new CustomPickaxe("steelpickaxe", PrimalMaterials.TOOL_BASIC_STEEL);
steelaxe = new CustomAxe("steelaxe", PrimalMaterials.TOOL_BASIC_STEEL);
steelshovel = new CustomShovel("steelshovel", PrimalMaterials.TOOL_BASIC_STEEL);
steelhoe = new CustomHoe("steelhoe", PrimalMaterials.TOOL_BASIC_STEEL);
wootzpickaxe = new CustomPickaxe("wootzpickaxe", PrimalMaterials.TOOL_WOOTZ_STEEL);
wootzaxe = new CustomAxe("wootzaxe", PrimalMaterials.TOOL_WOOTZ_STEEL);
wootzshovel = new CustomShovel("wootzshovel", PrimalMaterials.TOOL_WOOTZ_STEEL);
wootzhoe = new CustomHoe("wootzhoe", PrimalMaterials.TOOL_WOOTZ_STEEL);
/**********
WEAPONS
**********/
ironsword = new CustomSword("ironsword", PrimalMaterials.TOOL_WROUGHT_IRON);
cleanironsword = new CustomSword("ironsword", PrimalMaterials.TOOL_CLEAN_IRON);
steelsword = new CustomSword("ironsword", PrimalMaterials.TOOL_BASIC_STEEL);
wootzsword = new CustomSword("ironsword", PrimalMaterials.TOOL_WOOTZ_STEEL);
wroughtironshield = new CustomShield("wroughtironshield", PrimalMaterials.TOOL_WROUGHT_IRON);
/**********
INGOTS AND CHUNKS
**********/
ironingotballhot = new BaseMultiItem("ironingothot", PrimalMaterials.TOOL_WROUGHT_IRON);
ironchunkhot = new BaseMultiItem("ironchunkhot", PrimalMaterials.TOOL_WROUGHT_IRON);
ironcleaningotballhot= new BaseMultiItem("ironcleaningotballhot", PrimalMaterials.TOOL_CLEAN_IRON);
ironcleanchunkhot= new BaseMultiItem("ironcleanchunkhot", PrimalMaterials.TOOL_CLEAN_IRON);
steelingotballhot= new BaseMultiItem("steelingotballhot", PrimalMaterials.TOOL_BASIC_STEEL);
steelchunkhot= new BaseMultiItem("steelchunkhot", PrimalMaterials.TOOL_BASIC_STEEL);
wootzingotballhot= new BaseMultiItem("wootzingotballhot", PrimalMaterials.TOOL_WOOTZ_STEEL);
wootzchunkhot= new BaseMultiItem("wootzchunkhot", PrimalMaterials.TOOL_WOOTZ_STEEL);
//forgingmanual = new ItemForgingManual();
//test = new ItemTest("ironsword");
}
public static void register() {
GameRegistry.register(pistonbellows);
GameRegistry.register(softcrucible);
GameRegistry.register(stonetongs);
GameRegistry.register(forgehammer);
GameRegistry.register(ironingotballhot);
GameRegistry.register(ironchunkhot);
GameRegistry.register(ironcleaningotballhot);
GameRegistry.register(ironcleanchunkhot);
GameRegistry.register(steelingotballhot);
GameRegistry.register(steelchunkhot);
GameRegistry.register(wootzingotballhot);
GameRegistry.register(wootzchunkhot);
//GameRegistry.register(test);
/**********
TOOL PARTS
**********/
GameRegistry.register(pickaxehead);
GameRegistry.register(ironaxehead);
GameRegistry.register(ironshovelhead);
GameRegistry.register(ironhoehead);
GameRegistry.register(cleanironpickaxehead);
GameRegistry.register(cleanironaxehead);
GameRegistry.register(cleanironshovelhead);
GameRegistry.register(cleanironhoehead);
GameRegistry.register(steelpickaxehead);
GameRegistry.register(steelaxehead);
GameRegistry.register(steelshovelhead);
GameRegistry.register(steelhoehead);
GameRegistry.register(wootzpickaxehead);
GameRegistry.register(wootzaxehead);
GameRegistry.register(wootzshovelhead);
GameRegistry.register(wootzhoehead);
/**********
TOOLS
**********/
GameRegistry.register(ironpickaxe);
GameRegistry.register(ironaxe);
GameRegistry.register(ironshovel);
GameRegistry.register(ironhoe);
GameRegistry.register(cleanironpickaxe);
GameRegistry.register(cleanironaxe);
GameRegistry.register(cleanironshovel);
GameRegistry.register(cleanironhoe);
GameRegistry.register(steelpickaxe);
GameRegistry.register(steelaxe);
GameRegistry.register(steelshovel);
GameRegistry.register(steelhoe);
GameRegistry.register(wootzpickaxe);
GameRegistry.register(wootzaxe);
GameRegistry.register(wootzshovel);
GameRegistry.register(wootzhoe);
/**********
WEAPONS
**********/
GameRegistry.register(ironsword);
GameRegistry.register(wroughtironshield);
//GameRegistry.register(matchlockmusket);
//GameRegistry.register(forgingmanual);
}
@SideOnly(Side.CLIENT)
public static void registerRenders() {
registerRender(pistonbellows);
registerRender(softcrucible);
registerRender(forgehammer);
registerRender(ironingotballhot);
registerRender(ironchunkhot);
registerRender(ironcleaningotballhot);
registerRender(ironcleanchunkhot);
registerRender(steelingotballhot);
registerRender(steelchunkhot);
//registerRender(test);
/**********
TOOL PARTS
**********/
registerRender(pickaxehead);
registerRender(ironaxehead);
registerRender(ironshovelhead);
registerRender(ironhoehead);
registerRender(cleanironpickaxehead);
registerRender(cleanironaxehead);
registerRender(cleanironshovelhead);
registerRender(cleanironhoehead);
registerRender(steelpickaxehead);
registerRender(steelaxehead);
registerRender(steelshovelhead);
registerRender(steelhoehead);
registerRender(wootzpickaxehead);
registerRender(wootzaxehead);
registerRender(wootzshovelhead);
registerRender(wootzhoehead);
/**********
TOOLS
**********/
registerRender(ironpickaxe);
registerRender(ironaxe);
registerRender(ironshovel);
registerRender(ironhoe);
registerRender(cleanironpickaxe);
registerRender(cleanironaxe);
registerRender(cleanironshovel);
registerRender(cleanironhoe);
registerRender(steelpickaxe);
registerRender(steelaxe);
registerRender(steelshovel);
registerRender(steelhoe);
registerRender(wootzpickaxe);
registerRender(wootzaxe);
registerRender(wootzshovel);
registerRender(wootzhoe);
/**********
WEAPONS
**********/
registerRender(ironsword);
registerRender(wroughtironshield);
//registerRender(forgingmanual);
//registerRender(matchlockmusket);
}
@SideOnly(Side.CLIENT)
public static void registerCustomRenders(){
ModelBakery.registerItemVariants(ModItems.stonetongs, ModItems.stonetongs.getRegistryName(),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_default"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_emptyhot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_emptyhotcracked"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotiron"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotironcooked"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotironfailed"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_ingot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_chunk"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_pickaxe_hot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_axe_hot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_shovel_hot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hoe_hot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotcleaniron"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotcleanironcooked"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotcleanironfailed"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_cleanironingot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_cleanironchunk"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_cleaniron_pickaxe_hot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_cleaniron_axe_hot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_cleaniron_shovel_hot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_cleaniron_hoe_hot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotsteel"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotsteelcooked"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotsteelfailed"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_steelingot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_steelchunk"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_steel_pickaxe_hot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_steel_axe_hot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_steel_shovel_hot"),
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_steel_hoe_hot")
);
ModelLoader.setCustomMeshDefinition(ModItems.stonetongs, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
if (stack.hasTagCompound()) {
if (stack.getTagCompound().getInteger("type") == 0 ){
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_default", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 1 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_emptyhot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 2 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_emptyhotcracked", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 3 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotiron", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 4 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotironcooked", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 5 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotironfailed", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 6 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_ingot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 7 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_chunk", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 8 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_pickaxe_hot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 9 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_axe_hot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 10 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_shovel_hot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 11 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hoe_hot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 12 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotcleaniron", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 13 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotcleanironcooked", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 14 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotcleanironfailed", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 15 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_cleanironingot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 16 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_cleanironchunk", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 17 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_cleaniron_pickaxe_hot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 18 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_cleaniron_axe_hot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 19 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_cleaniron_shovel_hot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 20 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_cleaniron_hoe_hot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 21 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotsteel", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 22 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotsteelcooked", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 23 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotsteelfailed", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 24 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_steelingot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 25 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_steelchunk", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 26 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_steel_pickaxe_hot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 27 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_steel_axe_hot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 28 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_steel_shovel_hot", "inventory");
}
else if (stack.getTagCompound().getInteger("type") == 29 ) {
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_steel_hoe_hot", "inventory");
}
else return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory");
}
return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory");
}
});
}
private static void registerRender(Item item) {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}
private static void registerRenderItemBlock(ItemBlock item){
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}
/*public static void registerRender(Item item, int meta, String fileName) {
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(new ResourceLocation(fileName), "inventory"));
}
public static void registerRender(Item item, int meta, String fileName) {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(fileName, "inventory"));
}*/
}

View File

@@ -1,14 +0,0 @@
package nmd.primal.forgecraft.init;
/**
* Created by kitsu on 12/3/2016.
*/
public class ModRegistries {
public static void registerFuels()
{
//if (ModConfig.FEATURE_ENABLE_FUELS)
//{
}
}

View File

@@ -1,31 +0,0 @@
package nmd.primal.forgecraft.init;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import nmd.primal.forgecraft.ModInfo;
/**
* Created by mminaie on 3/24/17.
*/
public class ModSounds {
public static SoundEvent PISTON_BELLOWS;
public static SoundEvent MUSKET_SHOT;
public static void registerSounds()
{
PISTON_BELLOWS = registerSound("piston_bellows");
MUSKET_SHOT = registerSound("musket_shot");
}
private static SoundEvent registerSound(String name)
{
ResourceLocation location = new ResourceLocation(ModInfo.MOD_ID, name);
SoundEvent sound = new SoundEvent(location);
sound.setRegistryName(location);
ForgeRegistries.SOUND_EVENTS.register(sound);
return sound;
}
}

View File

@@ -1,25 +0,0 @@
package nmd.primal.forgecraft.items;
import net.minecraft.item.Item;
import nmd.primal.forgecraft.ModInfo;
/**
* Created by kitsu on 11/26/2016.
*/
public class BaseItem extends Item
{
public BaseItem()
{
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
}
public String getName() {
return this.getRegistryName().toString();
}
public static boolean isHidden()
{
return false;
}
}

View File

@@ -1,22 +0,0 @@
package nmd.primal.forgecraft.items;
import net.minecraft.item.Item;
/**
* Created by mminaie on 2/19/17.
*/
public class BaseMultiItem extends BaseItem {
private Item.ToolMaterial mat;
public BaseMultiItem( String registryName, Item.ToolMaterial material) {
setUnlocalizedName(registryName);
setRegistryName(registryName);
mat = material;
}
public Item.ToolMaterial getMaterial(Item item){
return mat;
}
}

View File

@@ -1,15 +0,0 @@
package nmd.primal.forgecraft.items;
import nmd.primal.forgecraft.ModInfo;
/**
* Created by mminaie on 1/7/17.
*/
public class ItemBellowsHandle extends BaseItem {
public ItemBellowsHandle() {
setUnlocalizedName(ModInfo.ForgecraftItems.BELLOWSHANDLE.getUnlocalizedName());
setRegistryName(ModInfo.ForgecraftItems.BELLOWSHANDLE.getRegistryName());
}
}

View File

@@ -1,15 +0,0 @@
package nmd.primal.forgecraft.items;
import nmd.primal.forgecraft.ModInfo;
/**
* Created by mminaie on 1/22/17.
*/
public class ItemSoftCrucible extends BaseItem {
public ItemSoftCrucible() {
setUnlocalizedName(ModInfo.ForgecraftItems.SOFTCRUCIBLE.getUnlocalizedName());
setRegistryName(ModInfo.ForgecraftItems.SOFTCRUCIBLE.getRegistryName());
}
}

View File

@@ -1,643 +0,0 @@
package nmd.primal.forgecraft.items;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.blocks.Crucible;
import nmd.primal.forgecraft.blocks.CrucibleHot;
import nmd.primal.forgecraft.blocks.IngotBall;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.tiles.TileBaseCrucible;
import nmd.primal.forgecraft.tiles.TileBloomery;
import nmd.primal.forgecraft.tiles.TileForge;
import java.util.List;
/**
* Created by mminaie on 1/23/17.
*/
public class ItemStoneTongs extends Item {
public ItemStoneTongs(String unlocalizedName) {
setUnlocalizedName(unlocalizedName);
this.setRegistryName(unlocalizedName);
//this.setMaxDamage(0);
//this.setHasSubtypes(true); //This just says the item has metadata
this.setMaxStackSize(1);
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
}
@Override
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
if (!item.hasTagCompound()) {
item.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = new NBTTagCompound();
//this.setDamage(item, 1000);
item.getTagCompound().setInteger("type", 0);
item.getTagCompound().setInteger("cooldown", 0);
item.getTagCompound().setTag("tags", tags);
item.getSubCompound("tags").setBoolean("hot", false);
item.getSubCompound("tags").setBoolean("emerald", false);
item.getSubCompound("tags").setInteger("diamond", 0);
item.getSubCompound("tags").setInteger("redstone", 0);
item.getSubCompound("tags").setInteger("lapis", 0);
item.getSubCompound("tags").setInteger("modifiers", 0);
}
}
@Override
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
/*
0 | Default StoneTongs
1 | Empty Crucible Hot
2 | Empty Crucible Cracked Hot
================================
3 | Hot Iron Crucible
4 | Hot Cooked Iron Crucible
5 | Hot Failed Iron Crucible
6 | Hot Iron Ingot
7 | Hot Iron Chunk
--------------------------------
8 | Hot Iron Pickaxe Head
9 | Hot Iron Axe Head
10 | Hot Iron Shovel Head
11 | Hot Iron Hoe Head
================================
12 | Hot Clean Iron Crucible
13 | Hot Cooked Clean Iron Crucible
14 | Hot Failed Clean Iron Crucible
15 | Hot Clean Iron Ball
16 | Hot Clean Iron Chunk
--------------------------------
17 | Hot Clean Iron Pickaxe Head
18 | Hot Clean Iron Axe Head
19 | Hot Clean Iron Shovel Head
20 | Hot Clean Iron Hoe Head
================================
21 | Hot Steel Crucible
22 | Hot Cooked Steel Crucible
23 | Hot Failed Steel Crucible
24 | Hot Steel Ingot
25 | Hot Steel Chunk
--------------------------------
26 | Hot Steel Pickaxe Head
27 | Hot Steel Axe Head
28 | Hot Steel Shovel Head
29 | Hot Steel Hoe Head
*/
if(!world.isRemote) {
ItemStack itemstack = player.getHeldItem(hand);
//System.out.println(itemstack.getTagCompound().getInteger("type"));
//System.out.println(itemstack.getSubCompound("tags"));
/*****
Picks Up Hot Ingots from the Ground
*****/
if (world.getBlockState(pos).getBlock() != ModBlocks.bloomery) {
if (world.getBlockState(pos).getBlock() instanceof IngotBall) {
if(world.getBlockState(pos).getValue(IngotBall.ACTIVE) == true) {
if (world.getBlockState(pos).getBlock() == ModBlocks.ironball) {
itemstack.getTagCompound().setInteger("type", 6);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.ironchunk) {
itemstack.getTagCompound().setInteger("type", 7);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.ironcleanball) {
itemstack.getTagCompound().setInteger("type", 15);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.ironcleanchunk) {
itemstack.getTagCompound().setInteger("type", 16);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.steelball) {
itemstack.getTagCompound().setInteger("type", 24);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.steelchunk) {
itemstack.getTagCompound().setInteger("type", 25);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
/* TODO Wootz */
}
}
}
/*****
Picks Up Hot Crucibles from the Ground
*****/
if (world.getBlockState(pos).getBlock() != ModBlocks.bloomery) {
if(world.getBlockState(pos).getBlock() instanceof CrucibleHot) {
TileBaseCrucible tileCrucible = (TileBaseCrucible) world.getTileEntity(pos);
/***************************
* Crucibles *
***************************/
if (world.getBlockState(pos).getBlock() == ModBlocks.emptycruciblehot) {
itemstack.getTagCompound().setInteger("type", 1);
itemstack.getTagCompound().setInteger("cooldown", tileCrucible.countdown);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.emptycruciblecrackedhot) {
itemstack.getTagCompound().setInteger("type", 2);
itemstack.getTagCompound().setInteger("cooldown", tileCrucible.countdown);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
/***************************
* Iron *
***************************/
if (world.getBlockState(pos).getBlock() == ModBlocks.hotironcrucible) {
itemstack.getTagCompound().setInteger("type", 3);
itemstack.getTagCompound().setInteger("cooldown", tileCrucible.countdown);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.hotcookedironcrucible) {
itemstack.getTagCompound().setInteger("type", 4);
itemstack.getTagCompound().setInteger("cooldown", tileCrucible.countdown);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.failedironcruciblehot) {
itemstack.getTagCompound().setInteger("type", 5);
itemstack.getTagCompound().setInteger("cooldown", tileCrucible.countdown);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
/***************************
* Clean Iron *
***************************/
if (world.getBlockState(pos).getBlock() == ModBlocks.hotcleanironcrucible) {
itemstack.getTagCompound().setInteger("type", 12);
itemstack.getTagCompound().setInteger("cooldown", tileCrucible.countdown);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.hotcookedcleanironcrucible) {
itemstack.getTagCompound().setInteger("type", 13);
itemstack.getTagCompound().setInteger("cooldown", tileCrucible.countdown);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.failedcleanironcruciblehot) {
itemstack.getTagCompound().setInteger("type", 14);
itemstack.getTagCompound().setInteger("cooldown", tileCrucible.countdown);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
/***************************
* Steel *
***************************/
if (world.getBlockState(pos).getBlock() == ModBlocks.hotsteelcrucible) {
itemstack.getTagCompound().setInteger("type", 21);
itemstack.getTagCompound().setInteger("cooldown", tileCrucible.countdown);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.hotcookedsteelcrucible) {
itemstack.getTagCompound().setInteger("type", 22);
itemstack.getTagCompound().setInteger("cooldown", tileCrucible.countdown);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.failedsteelcruciblehot) {
itemstack.getTagCompound().setInteger("type", 23);
itemstack.getTagCompound().setInteger("cooldown", tileCrucible.countdown);
world.setBlockToAir(pos);
return EnumActionResult.SUCCESS;
}
/* TODO Wootz */
}
/*****
Places the content from the Tongs to the World
*****/
if ((world.getBlockState(pos).getBlock() instanceof Crucible) || (world.getBlockState(pos).getBlock() instanceof CrucibleHot)) {
return EnumActionResult.FAIL;
} else if (world.getBlockState(pos).getMaterial() == Material.ROCK ||
world.getBlockState(pos).getMaterial() == Material.SAND ||
world.getBlockState(pos).getMaterial() == Material.IRON ||
world.getBlockState(pos).getMaterial() == Material.ANVIL )
{
BlockPos tempPos = new BlockPos(pos.getX(), pos.getY() + 1, pos.getZ());
if (world.getBlockState(tempPos).getBlock() == Blocks.AIR) {
switch (itemstack.getTagCompound().getInteger("type")) {
case 0:
break;
case 1:
world.setBlockState(tempPos, ModBlocks.emptycruciblehot.getDefaultState(), 3);
TileBaseCrucible tileCrucible1 = (TileBaseCrucible) world.getTileEntity(tempPos);
tileCrucible1.countdown = itemstack.getTagCompound().getInteger("cooldown");
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 2:
world.setBlockState(tempPos, ModBlocks.emptycruciblecrackedhot.getDefaultState(), 3);
TileBaseCrucible tileCrucible2 = (TileBaseCrucible) world.getTileEntity(tempPos);
tileCrucible2.countdown = itemstack.getTagCompound().getInteger("cooldown");
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 3:
world.setBlockState(tempPos, ModBlocks.hotironcrucible.getDefaultState(), 3);
TileBaseCrucible tileCrucible3 = (TileBaseCrucible) world.getTileEntity(tempPos);
tileCrucible3.countdown = itemstack.getTagCompound().getInteger("cooldown");
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 4:
world.setBlockState(tempPos, ModBlocks.hotcookedironcrucible.getDefaultState(), 3);
TileBaseCrucible tileCrucible4 = (TileBaseCrucible) world.getTileEntity(tempPos);
tileCrucible4.countdown = itemstack.getTagCompound().getInteger("cooldown");
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 5:
world.setBlockState(tempPos, ModBlocks.failedironcruciblehot.getDefaultState(), 3);
TileBaseCrucible tileCrucible5 = (TileBaseCrucible) world.getTileEntity(tempPos);
tileCrucible5.countdown = itemstack.getTagCompound().getInteger("cooldown");
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 6:
world.setBlockState(tempPos, ModBlocks.ironball.getDefaultState().withProperty(IngotBall.ACTIVE, true), 3);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 7:
world.setBlockState(tempPos, ModBlocks.ironchunk.getDefaultState().withProperty(IngotBall.ACTIVE, true), 3);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 8:
return EnumActionResult.FAIL;
case 9:
return EnumActionResult.FAIL;
case 10:
return EnumActionResult.FAIL;
case 11:
return EnumActionResult.FAIL;
case 12:
world.setBlockState(tempPos, ModBlocks.hotcleanironcrucible.getDefaultState(), 3);
TileBaseCrucible tileCrucible12 = (TileBaseCrucible) world.getTileEntity(tempPos);
tileCrucible12.countdown = itemstack.getTagCompound().getInteger("cooldown");
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 13:
world.setBlockState(tempPos, ModBlocks.hotcookedcleanironcrucible.getDefaultState(), 2);
TileBaseCrucible tileCrucible13 = (TileBaseCrucible) world.getTileEntity(tempPos);
tileCrucible13.countdown = itemstack.getTagCompound().getInteger("cooldown");
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 14:
world.setBlockState(tempPos, ModBlocks.failedcleanironcruciblehot.getDefaultState(), 3);
TileBaseCrucible tileCrucible14 = (TileBaseCrucible) world.getTileEntity(tempPos);
tileCrucible14.countdown = itemstack.getTagCompound().getInteger("cooldown");
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 15:
world.setBlockState(tempPos, ModBlocks.ironcleanball.getDefaultState().withProperty(IngotBall.ACTIVE, true), 3);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 16:
world.setBlockState(tempPos, ModBlocks.ironcleanchunk.getDefaultState().withProperty(IngotBall.ACTIVE, true), 3);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 17:
return EnumActionResult.FAIL;
case 18:
return EnumActionResult.FAIL;
case 19:
return EnumActionResult.FAIL;
case 20:
return EnumActionResult.FAIL;
case 21:
world.setBlockState(tempPos, ModBlocks.hotsteelcrucible.getDefaultState(), 3);
TileBaseCrucible tileCrucible21 = (TileBaseCrucible) world.getTileEntity(tempPos);
tileCrucible21.countdown = itemstack.getTagCompound().getInteger("cooldown");
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 22:
world.setBlockState(tempPos, ModBlocks.hotcookedsteelcrucible.getDefaultState(), 3);
TileBaseCrucible tileCrucible22 = (TileBaseCrucible) world.getTileEntity(tempPos);
tileCrucible22.countdown = itemstack.getTagCompound().getInteger("cooldown");
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 23:
world.setBlockState(tempPos, ModBlocks.failedsteelcruciblehot.getDefaultState(), 3);
TileBaseCrucible tileCrucible23 = (TileBaseCrucible) world.getTileEntity(tempPos);
tileCrucible23.countdown = itemstack.getTagCompound().getInteger("cooldown");
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 24:
world.setBlockState(tempPos, ModBlocks.steelball.getDefaultState().withProperty(IngotBall.ACTIVE, true), 3);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
case 25:
world.setBlockState(tempPos, ModBlocks.steelchunk.getDefaultState().withProperty(IngotBall.ACTIVE, true), 3);
itemstack.getTagCompound().setInteger("type", 0);
return EnumActionResult.SUCCESS;
}
}
}
}
/*****
Pulls the crucible from the Bloomery
*****/
if(itemstack.getTagCompound().getInteger("type") == 0){
if (world.getBlockState(pos).getBlock() == ModBlocks.bloomery) {
TileBloomery tile = (TileBloomery) world.getTileEntity(pos);
if (tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.emptycruciblehot))) {
itemstack.getTagCompound().setInteger("type", 1);
itemstack.getTagCompound().setInteger("cooldown", 0);
tile.setSlotStack(1, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
} else if (tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.emptycruciblecrackedhot))) {
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 2);
tile.setSlotStack(1, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
} else if (tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.hotironcrucible))) {
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 3);
tile.setSlotStack(1, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
} else if (tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.hotcookedironcrucible))) {
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 4);
tile.setSlotStack(1, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
} else if (tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.failedironcruciblehot))) {
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 5);
tile.setSlotStack(1, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
} else if (tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.hotcleanironcrucible))) {
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 12);
tile.setSlotStack(1, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
} else if (tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.hotcookedcleanironcrucible))) {
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 13);
tile.setSlotStack(1, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
} else if (tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.failedcleanironcrucible))) {
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 14);
tile.setSlotStack(1, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
} else if (tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.hotsteelcrucible))) {
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 21);
tile.setSlotStack(1, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
} else if (tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.hotcookedsteelcrucible))) {
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 22);
tile.setSlotStack(1, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
} else if (tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.failedsteelcrucible))) {
itemstack.getTagCompound().setInteger("cooldown", 0);
itemstack.getTagCompound().setInteger("type", 23);
tile.setSlotStack(1, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
}
}
}
/*****
Pulls the Tool Parts from the Forge
*****/
if(itemstack.getTagCompound().getInteger("type") == 0){
if (world.getBlockState(pos).getBlock() == ModBlocks.firebox) {
TileForge tile = (TileForge) world.getTileEntity(pos);
for (int i = 2; i < tile.getSlotListSize(); i++) {
if (tile.getSlotStack(i).getItem().equals(ModItems.ironchunkhot)) {
tile.setSlotStack(i, ItemStack.EMPTY);
itemstack.getTagCompound().setInteger("type", 7);
return EnumActionResult.SUCCESS;
}
if (tile.getSlotStack(i).getItem().equals(ModItems.ironingotballhot)) {
tile.setSlotStack(i, ItemStack.EMPTY);
itemstack.getTagCompound().setInteger("type", 6);
return EnumActionResult.SUCCESS;
}
if (tile.getSlotStack(i).getItem().equals(ModItems.pickaxehead)) {
if(tile.getSlotStack(i).getSubCompound("tags").getBoolean("hot") == true) {
itemstack.getTagCompound().setInteger("type", 8);
NBTTagCompound tags = tile.getSlotStack(i).getSubCompound("tags").copy();
itemstack.getTagCompound().setTag("tags", tags);
itemstack.getTagCompound().setInteger("tempDamage", tile.getSlotStack(i).getItemDamage());
//itemstack.getSubCompound("tags").setBoolean("hot", true);
tile.setSlotStack(i, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
}
}
if (tile.getSlotStack(i).getItem().equals(ModItems.ironaxehead)) {
if(tile.getSlotStack(i).getSubCompound("tags").getBoolean("hot") == true) {
itemstack.getTagCompound().setInteger("type", 9);
NBTTagCompound tags = tile.getSlotStack(i).getSubCompound("tags").copy();
itemstack.getTagCompound().setTag("tags", tags);
itemstack.getTagCompound().setInteger("tempDamage", tile.getSlotStack(i).getItemDamage());
//itemstack.getSubCompound("tags").setBoolean("hot", true);
tile.setSlotStack(i, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
}
}
if (tile.getSlotStack(i).getItem().equals(ModItems.ironshovelhead)) {
if(tile.getSlotStack(i).getSubCompound("tags").getBoolean("hot") == true) {
itemstack.getTagCompound().setInteger("type", 10);
NBTTagCompound tags = tile.getSlotStack(i).getSubCompound("tags").copy();
itemstack.getTagCompound().setTag("tags", tags);
itemstack.getTagCompound().setInteger("tempDamage", tile.getSlotStack(i).getItemDamage());
//itemstack.getSubCompound("tags").setBoolean("hot", true);
tile.setSlotStack(i, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
}
}
if (tile.getSlotStack(i).getItem().equals(ModItems.ironhoehead)) {
if(tile.getSlotStack(i).getSubCompound("tags").getBoolean("hot") == true) {
itemstack.getTagCompound().setInteger("type", 11);
NBTTagCompound tags = tile.getSlotStack(i).getSubCompound("tags").copy();
itemstack.getTagCompound().setTag("tags", tags);
itemstack.getTagCompound().setInteger("tempDamage", tile.getSlotStack(i).getItemDamage());
//itemstack.getSubCompound("tags").setBoolean("hot", true);
tile.setSlotStack(i, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
}
}
if (tile.getSlotStack(i).getItem().equals(ModItems.ironcleanchunkhot)) {
tile.setSlotStack(i, ItemStack.EMPTY);
itemstack.getTagCompound().setInteger("type", 16);
return EnumActionResult.SUCCESS;
}
if (tile.getSlotStack(i).getItem().equals(ModItems.ironcleaningotballhot)) {
tile.setSlotStack(i, ItemStack.EMPTY);
itemstack.getTagCompound().setInteger("type", 15);
return EnumActionResult.SUCCESS;
}
if (tile.getSlotStack(i).getItem().equals(ModItems.cleanironpickaxehead)) {
if(tile.getSlotStack(i).getSubCompound("tags").getBoolean("hot") == true) {
itemstack.getTagCompound().setInteger("type", 17);
NBTTagCompound tags = tile.getSlotStack(i).getSubCompound("tags").copy();
itemstack.getTagCompound().setTag("tags", tags);
itemstack.getTagCompound().setInteger("tempDamage", tile.getSlotStack(i).getItemDamage());
//itemstack.getSubCompound("tags").setBoolean("hot", true);
tile.setSlotStack(i, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
}
}
if (tile.getSlotStack(i).getItem().equals(ModItems.cleanironaxehead)) {
if(tile.getSlotStack(i).getSubCompound("tags").getBoolean("hot") == true) {
itemstack.getTagCompound().setInteger("type", 18);
NBTTagCompound tags = tile.getSlotStack(i).getSubCompound("tags").copy();
itemstack.getTagCompound().setTag("tags", tags);
itemstack.getTagCompound().setInteger("tempDamage", tile.getSlotStack(i).getItemDamage());
//itemstack.getSubCompound("tags").setBoolean("hot", true);
tile.setSlotStack(i, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
}
}
if (tile.getSlotStack(i).getItem().equals(ModItems.cleanironshovelhead)) {
if(tile.getSlotStack(i).getSubCompound("tags").getBoolean("hot") == true) {
itemstack.getTagCompound().setInteger("type", 19);
NBTTagCompound tags = tile.getSlotStack(i).getSubCompound("tags").copy();
itemstack.getTagCompound().setTag("tags", tags);
itemstack.getTagCompound().setInteger("tempDamage", tile.getSlotStack(i).getItemDamage());
//itemstack.getSubCompound("tags").setBoolean("hot", true);
tile.setSlotStack(i, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
}
}
if (tile.getSlotStack(i).getItem().equals(ModItems.cleanironhoehead)) {
if(tile.getSlotStack(i).getSubCompound("tags").getBoolean("hot") == true) {
itemstack.getTagCompound().setInteger("type", 20);
NBTTagCompound tags = tile.getSlotStack(i).getSubCompound("tags").copy();
itemstack.getTagCompound().setTag("tags", tags);
itemstack.getTagCompound().setInteger("tempDamage", tile.getSlotStack(i).getItemDamage());
//itemstack.getSubCompound("tags").setBoolean("hot", true);
tile.setSlotStack(i, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
}
}
if (tile.getSlotStack(i).getItem().equals(ModItems.steelchunkhot)) {
tile.setSlotStack(i, ItemStack.EMPTY);
itemstack.getTagCompound().setInteger("type", 25);
return EnumActionResult.SUCCESS;
}
if (tile.getSlotStack(i).getItem().equals(ModItems.steelingotballhot)) {
tile.setSlotStack(i, ItemStack.EMPTY);
itemstack.getTagCompound().setInteger("type", 24);
return EnumActionResult.SUCCESS;
}
if (tile.getSlotStack(i).getItem().equals(ModItems.steelpickaxehead)) {
if(tile.getSlotStack(i).getSubCompound("tags").getBoolean("hot") == true) {
itemstack.getTagCompound().setInteger("type", 26);
NBTTagCompound tags = tile.getSlotStack(i).getSubCompound("tags").copy();
itemstack.getTagCompound().setTag("tags", tags);
itemstack.getTagCompound().setInteger("tempDamage", tile.getSlotStack(i).getItemDamage());
//itemstack.getSubCompound("tags").setBoolean("hot", true);
tile.setSlotStack(i, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
}
}
if (tile.getSlotStack(i).getItem().equals(ModItems.steelaxehead)) {
if(tile.getSlotStack(i).getSubCompound("tags").getBoolean("hot") == true) {
itemstack.getTagCompound().setInteger("type", 27);
NBTTagCompound tags = tile.getSlotStack(i).getSubCompound("tags").copy();
itemstack.getTagCompound().setTag("tags", tags);
itemstack.getTagCompound().setInteger("tempDamage", tile.getSlotStack(i).getItemDamage());
//itemstack.getSubCompound("tags").setBoolean("hot", true);
tile.setSlotStack(i, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
}
}
if (tile.getSlotStack(i).getItem().equals(ModItems.steelshovelhead)) {
if(tile.getSlotStack(i).getSubCompound("tags").getBoolean("hot") == true) {
itemstack.getTagCompound().setInteger("type", 28);
NBTTagCompound tags = tile.getSlotStack(i).getSubCompound("tags").copy();
itemstack.getTagCompound().setTag("tags", tags);
itemstack.getTagCompound().setInteger("tempDamage", tile.getSlotStack(i).getItemDamage());
//itemstack.getSubCompound("tags").setBoolean("hot", true);
tile.setSlotStack(i, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
}
}
if (tile.getSlotStack(i).getItem().equals(ModItems.steelhoehead)) {
if(tile.getSlotStack(i).getSubCompound("tags").getBoolean("hot") == true) {
itemstack.getTagCompound().setInteger("type", 29);
NBTTagCompound tags = tile.getSlotStack(i).getSubCompound("tags").copy();
itemstack.getTagCompound().setTag("tags", tags);
itemstack.getTagCompound().setInteger("tempDamage", tile.getSlotStack(i).getItemDamage());
//itemstack.getSubCompound("tags").setBoolean("hot", true);
tile.setSlotStack(i, ItemStack.EMPTY);
return EnumActionResult.SUCCESS;
}
}
}
}
}
else return EnumActionResult.FAIL;
//System.out.println(itemstack.getTagCompound().getInteger("type"));
}
//System.out.println(player.getHeldItem(hand).getTagCompound().getInteger("type"));
return EnumActionResult.SUCCESS;
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack item, EntityPlayer player, List<String> tooltip, boolean advanced)
{
//tooltip.add(ChatFormatting.BLUE + "NBT: " + item.getSubCompound("tags"));
//tooltip.add(ChatFormatting.RED + "NBT: " + item.getTagCompound().getInteger("type"));
}
}

View File

@@ -1,15 +0,0 @@
package nmd.primal.forgecraft.items;
/**
* Created by kitsu on 11/26/2016.
*/
public class ItemTest extends BaseItem {
public ItemTest(String string) {
setUnlocalizedName(string);
setRegistryName(string);
}
}

View File

@@ -1,292 +0,0 @@
package nmd.primal.forgecraft.items.parts;
import com.mojang.realmsclient.gui.ChatFormatting;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.ToolNBT;
import javax.annotation.Nullable;
import java.util.List;
/**
* Created by mminaie on 3/9/17.
*/
public class ToolPart extends Item implements ToolNBT{
public ToolPart(String name, Item.ToolMaterial material) {
this.setMaxDamage(material.getMaxUses());
this.setUnlocalizedName(name);
this.setRegistryName(name);
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
this.setMaxStackSize(1);
this.setNoRepair();
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter()
{
/***
hot . emerald . diamond . redstone . lapis
0 . 0 . 0 . 0 . 0
***/
@SideOnly(Side.CLIENT)
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn)
{
if (item.hasTagCompound()) {
if (getHot(item) == false) {
if (getModifiers(item) != 0) {
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.1F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.11F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.12F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.111F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.102F;
}
// ============
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.01F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.02F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 3) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.03F;
}
//=======
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.001F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.002F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 3) &&
(getLapisLevel(item) == 0)) {
return 0.003F;
}
//=========
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 1)) {
return 0.0001F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 2)) {
return 0.0002F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 3)) {
return 0.0003F;
}
//=======
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 1)) {
return 0.0111F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.021F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.012F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 2)) {
return 0.0012F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 1)) {
return 0.0021F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 2) ) {
return 0.0102F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 1) ) {
return 0.0011F;
}
}
}
if (getHot(item) == true) {
return 1.0F;
}
if (getHot(item) == false) {
if (getModifiers(item) == 0) {
return 0.0F;
}
}
}
return 0.0F;
}
});
}
public static boolean isHidden()
{
return false;
}
@Override
public void onCreated(ItemStack item, World worldIn, EntityPlayer playerIn) {
if (!item.hasTagCompound()) {
item.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = new NBTTagCompound();
item.getTagCompound().setTag("tags", tags);
setHot(item, false);
setEmerald(item, false);
setDiamondLevel(item, 0);
setRedstoneLevel(item, 0);
setLapisLevel(item, 0);
setModifiers(item, 0);
}
}
@Override
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
if (!item.hasTagCompound()) {
item.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = new NBTTagCompound();
item.getTagCompound().setTag("tags", tags);
setHot(item, false);
setEmerald(item, false);
setDiamondLevel(item, 0);
setRedstoneLevel(item, 0);
setLapisLevel(item, 0);
setModifiers(item, 0);
}
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack item, EntityPlayer player, List<String> tooltip, boolean advanced)
{
if(player.getEntityWorld().isRemote) {
if(item.hasTagCompound()) {
tooltip.add(ChatFormatting.GRAY + "Upgrades");
if (getEmerald(item) == true) {
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
}
if (getDiamondLevel(item) > 0) {
tooltip.add(ChatFormatting.AQUA + "Diamond Level: " + getDiamondLevel(item));
}
if (getRedstoneLevel(item) > 0) {
tooltip.add(ChatFormatting.RED + "Redstone Level: " + getRedstoneLevel(item));
}
if (getLapisLevel(item) > 0) {
tooltip.add(ChatFormatting.BLUE + "Lapis Level: " + getLapisLevel(item));
}
}
}
}
}

View File

@@ -1,86 +0,0 @@
package nmd.primal.forgecraft.items.tools;
import com.google.common.collect.Sets;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import java.util.Set;
/**
* Created by mminaie on 3/29/17.
*/
public abstract class BasePickaxe extends BaseTool
{
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.ACTIVATOR_RAIL, Blocks.COAL_ORE, Blocks.COBBLESTONE, Blocks.DETECTOR_RAIL, Blocks.DIAMOND_BLOCK, Blocks.DIAMOND_ORE, Blocks.DOUBLE_STONE_SLAB, Blocks.GOLDEN_RAIL, Blocks.GOLD_BLOCK, Blocks.GOLD_ORE, Blocks.ICE, Blocks.IRON_BLOCK, Blocks.IRON_ORE, Blocks.LAPIS_BLOCK, Blocks.LAPIS_ORE, Blocks.LIT_REDSTONE_ORE, Blocks.MOSSY_COBBLESTONE, Blocks.NETHERRACK, Blocks.PACKED_ICE, Blocks.RAIL, Blocks.REDSTONE_ORE, Blocks.SANDSTONE, Blocks.RED_SANDSTONE, Blocks.STONE, Blocks.STONE_SLAB, Blocks.STONE_BUTTON, Blocks.STONE_PRESSURE_PLATE});
protected BasePickaxe(ForgeToolMaterial material)
{
super(1.0F, -2.8F, material, EFFECTIVE_ON);
}
/**
* Check whether this Item can harvest the given Block
*/
public boolean canHarvestBlock(IBlockState blockIn)
{
Block block = blockIn.getBlock();
if (block == Blocks.OBSIDIAN)
{
return this.toolMaterial.getHarvestLevel() == 3;
}
else if (block != Blocks.DIAMOND_BLOCK && block != Blocks.DIAMOND_ORE)
{
if (block != Blocks.EMERALD_ORE && block != Blocks.EMERALD_BLOCK)
{
if (block != Blocks.GOLD_BLOCK && block != Blocks.GOLD_ORE)
{
if (block != Blocks.IRON_BLOCK && block != Blocks.IRON_ORE)
{
if (block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE)
{
if (block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE)
{
Material material = blockIn.getMaterial();
return material == Material.ROCK ? true : (material == Material.IRON ? true : material == Material.ANVIL);
}
else
{
return this.toolMaterial.getHarvestLevel() >= 2;
}
}
else
{
return this.toolMaterial.getHarvestLevel() >= 1;
}
}
else
{
return this.toolMaterial.getHarvestLevel() >= 1;
}
}
else
{
return this.toolMaterial.getHarvestLevel() >= 2;
}
}
else
{
return this.toolMaterial.getHarvestLevel() >= 2;
}
}
else
{
return this.toolMaterial.getHarvestLevel() >= 2;
}
}
public float getStrVsBlock(ItemStack stack, IBlockState state)
{
Material material = state.getMaterial();
return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
}
}

View File

@@ -1,262 +0,0 @@
package nmd.primal.forgecraft.items.tools;
import com.google.common.collect.Multimap;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.Set;
/**
* Created by mminaie on 3/29/17.
*/
public abstract class BaseTool extends Item {
private final Set<Block> effectiveBlocks;
protected float efficiencyOnProperMaterial;
/** Damage versus entities. */
protected float damageVsEntity;
protected float attackSpeed;
/** The material this tool is made from. */
protected ForgeToolMaterial toolMaterial;
protected BaseTool(float attackDamageIn, float attackSpeedIn, ForgeToolMaterial materialIn, Set<Block> effectiveBlocksIn)
{
this.efficiencyOnProperMaterial = 4.0F;
this.toolMaterial = materialIn;
this.effectiveBlocks = effectiveBlocksIn;
this.maxStackSize = 1;
this.setMaxDamage(materialIn.getMaxUses());
this.efficiencyOnProperMaterial = materialIn.getEfficiencyOnProperMaterial();
this.damageVsEntity = attackDamageIn + materialIn.getDamageVsEntity();
this.attackSpeed = attackSpeedIn;
this.setCreativeTab(CreativeTabs.TOOLS);
}
protected BaseTool(ForgeToolMaterial materialIn, Set<Block> effectiveBlocksIn)
{
this(0.0F, 0.0F, materialIn, effectiveBlocksIn);
}
public float getStrVsBlock(ItemStack stack, IBlockState state)
{
for (String type : getToolClasses(stack))
{
if (state.getBlock().isToolEffective(type, state))
return efficiencyOnProperMaterial;
}
return this.effectiveBlocks.contains(state.getBlock()) ? this.efficiencyOnProperMaterial : 1.0F;
}
public static enum ForgeToolMaterial {
IRON(2, 250, 6.0F, 2.0F, 14);
//DIAMOND(3, 1561, 8.0F, 3.0F, 10),
//GOLD(0, 32, 12.0F, 0.0F, 22);
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = WOOD/GOLD)
*/
private int harvestLevel;
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private int maxUses;
/**
* The strength of this tool material against blocks which it is effective against.
*/
private float efficiencyOnProperMaterial;
/**
* Damage versus entities.
*/
private float damageVsEntity;
/**
* Defines the natural enchantability factor of the material.
*/
private int enchantability;
//Added by forge for custom Tool materials.
ForgeToolMaterial(int harvestLevel, int maxUses, float efficiency, float damageVsEntity, int enchantability) {
this.harvestLevel = harvestLevel;
this.maxUses = maxUses;
this.efficiencyOnProperMaterial = efficiency;
this.damageVsEntity = damageVsEntity;
this.enchantability = enchantability;
}
/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses() {
return this.maxUses;
}
public void setMaxUses(int maxUses) {
this.maxUses = maxUses;
}
/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial() {
return this.efficiencyOnProperMaterial;
}
public void setEfficiencyOnProperMaterial(float efficiencyOnProperMaterial) {
this.efficiencyOnProperMaterial = efficiencyOnProperMaterial;
}
/**
* Returns the damage against a given entity.
*/
public float getDamageVsEntity() {
return this.damageVsEntity;
}
public void setDamageVsEntity(float damageVsEntity) {
this.damageVsEntity = damageVsEntity;
}
/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel() {
return this.harvestLevel;
}
public void setHarvestLevel(int harvestLevel) {
this.harvestLevel = harvestLevel;
}
/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability() {
return this.enchantability;
}
public void setEnchantability(int enchantability) {
this.enchantability = enchantability;
}
}
/**
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
{
stack.damageItem(2, attacker);
return true;
}
/**
* Called when a Block is destroyed using this Item. Return true to trigger the "Use Item" statistic.
*/
public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
{
if (!worldIn.isRemote && (double)state.getBlockHardness(worldIn, pos) != 0.0D)
{
stack.damageItem(1, entityLiving);
}
return true;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
return true;
}
public ForgeToolMaterial getToolMaterial()
{
return this.toolMaterial;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return this.toolMaterial.getEnchantability();
}
/**
* Return the name for this tool's material.
*/
public String getToolMaterialName()
{
return this.toolMaterial.toString();
}
/**
* Return whether this item is repairable in an anvil.
*/
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
{
return false;
}
public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot)
{
Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);
if (equipmentSlot == EntityEquipmentSlot.MAINHAND)
{
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", (double)this.damageVsEntity, 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", (double)this.attackSpeed, 0));
}
return multimap;
}
/*===================================== FORGE START =================================*/
@javax.annotation.Nullable
private String toolClass;
@Override
public int getHarvestLevel(ItemStack stack, String toolClass, @javax.annotation.Nullable net.minecraft.entity.player.EntityPlayer player, @javax.annotation.Nullable IBlockState blockState)
{
int level = super.getHarvestLevel(stack, toolClass, player, blockState);
if (level == -1 && toolClass.equals(this.toolClass))
{
return this.toolMaterial.getHarvestLevel();
}
else
{
return level;
}
}
@Override
public Set<String> getToolClasses(ItemStack stack)
{
return toolClass != null ? com.google.common.collect.ImmutableSet.of(toolClass) : super.getToolClasses(stack);
}
/*===================================== FORGE END =================================*/
}

View File

@@ -1,377 +0,0 @@
package nmd.primal.forgecraft.items.tools;
import com.mojang.realmsclient.gui.ChatFormatting;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.ToolNBT;
import javax.annotation.Nullable;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
/**
* Created by mminaie on 3/20/17.
*/
public class CustomAxe extends ItemAxe implements ToolNBT {
public CustomAxe(String name, Item.ToolMaterial material) {
super(material, 6, -3.1f);
this.setUnlocalizedName(name);
this.setRegistryName(name);
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
this.setMaxStackSize(1);
this.setNoRepair();
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
/***
hot . emerald . diamond . redstone . lapis
0 . 0 . 0 . 0 . 0
***/
@SideOnly(Side.CLIENT)
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
if (item.hasTagCompound()) {
if (getHot(item) != true) {
if (getModifiers(item) != 0) {
if ((getEmerald(item) == true) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.1F;
}
if ((getEmerald(item) == true) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.11F;
}
if ((getEmerald(item) == true) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.12F;
}
if ((getEmerald(item) == true) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.111F;
}
if ((getEmerald(item) == true) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.102F;
}
// ============
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.01F;
}
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.02F;
}
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 3) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.03F;
}
//=======
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.001F;
}
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.002F;
}
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 3) &&
(getLapisLevel(item) == 0)) {
return 0.003F;
}
//=========
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 1)) {
return 0.0001F;
}
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 2)) {
return 0.0002F;
}
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 3)) {
return 0.0003F;
}
//=======
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 1)) {
return 0.0111F;
}
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.021F;
}
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.012F;
}
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 2)) {
return 0.0012F;
}
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 1)) {
return 0.0021F;
}
if ((getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 2)) {
return 0.0102F;
}
}
}
if (getHot(item) == true) {
return 1.0F;
}
if (getHot(item) == false) {
if (getModifiers(item) == 0) {
return 0.0F;
}
}
}
return 0.0F;
}
});
}
public static boolean isHidden()
{
return false;
}
@Override
public void onCreated(ItemStack item, World world, EntityPlayer playerIn) {
if(!world.isRemote) {
if (!item.hasTagCompound()) {
item.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = new NBTTagCompound();
item.getTagCompound().setTag("tags", tags);
/*setHot(item, false);
setHot(item, false);
setEmerald(item, false);
setDiamondLevel(item, 0);
setRedstoneLevel(item, 0);
setLapisLevel(item, 0);
setModifiers(item, 0);*/
}
}
}
@Override
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
if(!world.isRemote) {
if (!item.hasTagCompound()) {
item.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = new NBTTagCompound();
item.getTagCompound().setTag("tags", tags);
setHot(item, false);
setEmerald(item, false);
setDiamondLevel(item, 0);
setRedstoneLevel(item, 0);
setLapisLevel(item, 0);
setModifiers(item, 0);
}
}
}
//public void onItemTooltip(ItemTooltipEvent event){
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack item, EntityPlayer player, List<String> tooltip, boolean advanced)
{
if(!item.isEmpty()) {
if (player.getEntityWorld().isRemote) {
if (item.hasTagCompound()) {
tooltip.add(ChatFormatting.GRAY + "Upgrades Left: " + (3 - getModifiers(item)) );
if (getEmerald(item) == true) {
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
}
if (getDiamondLevel(item) > 0) {
tooltip.add(ChatFormatting.AQUA + "Diamond Level: " + getDiamondLevel(item));
}
if (getRedstoneLevel(item) > 0) {
tooltip.add(ChatFormatting.RED + "Redstone Level: " + getRedstoneLevel(item) );
}
if (getLapisLevel(item) > 0) {
tooltip.add(ChatFormatting.BLUE + "Lapis Level: " + getLapisLevel(item) );
}
tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() );
}
}
}
}
@Override
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player)
{
if(!player.world.isRemote){
World world = player.getEntityWorld();
//System.out.println(world.getBlockState(pos).getBlock());
if(itemstack.getItem() instanceof CustomAxe){
if( getEmerald(itemstack)){
itemstack.addEnchantment(Enchantment.getEnchantmentByID(33), 1);
}
if( getDiamondLevel(itemstack) > 0 ){
//itemstack.addEnchantment(Enchantment.getEnchantmentByID(34), getDiamondLevel(itemstack));
itemstack.getItem().setHarvestLevel("pickaxe", 3);
}
/*if( getRedstoneLevel(itemstack) > 0 ){
itemstack.addEnchantment(Enchantment.getEnchantmentByID(32), getRedstoneLevel(itemstack));
//System.out.println(itemstack.getEnchantmentTagList());
}*/
if ( getLapisLevel(itemstack) > 0) {
itemstack.addEnchantment(Enchantment.getEnchantmentByID(35), getLapisLevel(itemstack));
}
}
}
return false;
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
{
if (!worldIn.isRemote && (double)state.getBlockHardness(worldIn, pos) != 0.0D)
{
stack.getTagCompound().removeTag("ench");
//System.out.println(stack.getTagCompound());
if(getDiamondLevel(stack) > 0) {
if(ThreadLocalRandom.current().nextInt(0, getDiamondLevel(stack)) == 0) {
stack.damageItem(1, entityLiving);
}
} else stack.damageItem(1, entityLiving);
}
return true;
}
@Override
public float getStrVsBlock(ItemStack stack, IBlockState state)
{
Material material = state.getMaterial();
//return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
if(material != Material.WOOD && material != Material.PLANTS && material != Material.VINE){
return super.getStrVsBlock(stack, state);
} else {
return this.efficiencyOnProperMaterial * ( (this.getRedstoneLevel(stack) * 2 ) + 1);
}
}
@SideOnly(Side.CLIENT)
@Override
public boolean hasEffect(ItemStack stack)
{
return false;
}
@Override
public boolean isRepairable()
{
return false;
}
public int getItemEnchantability(ItemStack stack)
{
return 0;
}
}

View File

@@ -1,359 +0,0 @@
package nmd.primal.forgecraft.items.tools;
import com.mojang.realmsclient.gui.ChatFormatting;
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.ToolNBT;
import javax.annotation.Nullable;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
/**
* Created by mminaie on 3/21/17.
*/
public class CustomHoe extends ItemHoe implements ToolNBT {
public CustomHoe(String name, Item.ToolMaterial material) {
super(material);
this.setUnlocalizedName(name);
this.setRegistryName(name);
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
this.setMaxStackSize(1);
this.setNoRepair();
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
/***
hot . emerald . diamond . redstone . lapis
0 . 0 . 0 . 0 . 0
***/
@SideOnly(Side.CLIENT)
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
if (item.hasTagCompound()) {
if (getHot(item) == false) {
if (getModifiers(item) != 0) {
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.1F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.11F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.12F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.111F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.102F;
}
// ============
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.01F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.02F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 3) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.03F;
}
//=======
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.001F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.002F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 3) &&
(getLapisLevel(item) == 0)) {
return 0.003F;
}
//=========
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 1)) {
return 0.0001F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 2)) {
return 0.0002F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 3)) {
return 0.0003F;
}
//=======
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 1)) {
return 0.0111F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.021F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.012F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 2)) {
return 0.0012F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 1)) {
return 0.0021F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 2) ) {
return 0.0102F;
}
}
}
if (getHot(item) == true) {
return 1.0F;
}
if (getHot(item) == false) {
if (getModifiers(item) == 0) {
return 0.0F;
}
}
}
return 0.0F;
}
});
}
public static boolean isHidden()
{
return false;
}
@Override
public void onCreated(ItemStack item, World world, EntityPlayer playerIn) {
if(!world.isRemote) {
if (!item.hasTagCompound()) {
item.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = new NBTTagCompound();
item.getTagCompound().setTag("tags", tags);
/*setHot(item, false);
setHot(item, false);
setEmerald(item, false);
setDiamondLevel(item, 0);
setRedstoneLevel(item, 0);
setLapisLevel(item, 0);
setModifiers(item, 0);*/
}
}
}
@Override
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
if(!world.isRemote) {
if (!item.hasTagCompound()) {
item.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = new NBTTagCompound();
item.getTagCompound().setTag("tags", tags);
setHot(item, false);
setEmerald(item, false);
setDiamondLevel(item, 0);
setRedstoneLevel(item, 0);
setLapisLevel(item, 0);
setModifiers(item, 0);
}
}
}
//public void onItemTooltip(ItemTooltipEvent event){
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack item, EntityPlayer player, List<String> tooltip, boolean advanced)
{
if(player.getEntityWorld().isRemote) {
if(item.hasTagCompound()) {
tooltip.add(ChatFormatting.GRAY + "Upgrades Left: " + (3 - getModifiers(item)) );
if (getEmerald(item) == true) {
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
}
if (getDiamondLevel(item) > 0) {
tooltip.add(ChatFormatting.AQUA + "Diamond Level: " + getDiamondLevel(item));
}
if (getRedstoneLevel(item) > 0) {
tooltip.add(ChatFormatting.RED + "Redstone Level: " + getRedstoneLevel(item) );
}
if (getLapisLevel(item) > 0) {
tooltip.add(ChatFormatting.BLUE + "Lapis Level: " + getLapisLevel(item) );
}
tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() );
}
}
}
@Override
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player)
{
if(!player.world.isRemote){
World world = player.getEntityWorld();
System.out.println(world.getBlockState(pos).getBlock());
if(itemstack.getItem() instanceof CustomHoe){
if( getEmerald(itemstack)){
itemstack.addEnchantment(Enchantment.getEnchantmentByID(33), 1);
}
/*if( getDiamondLevel(itemstack) > 0 ){
itemstack.addEnchantment(Enchantment.getEnchantmentByID(34), getDiamondLevel(itemstack));
itemstack.getItem().setHarvestLevel("pickaxe", 3);
}*/
/*if( getRedstoneLevel(itemstack) > 0 ){
itemstack.addEnchantment(Enchantment.getEnchantmentByID(32), getRedstoneLevel(itemstack));
//System.out.println(itemstack.getEnchantmentTagList());
}*/
if ( getLapisLevel(itemstack) > 0) {
itemstack.addEnchantment(Enchantment.getEnchantmentByID(35), getLapisLevel(itemstack));
}
}
}
return false;
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
{
if (!worldIn.isRemote && (double)state.getBlockHardness(worldIn, pos) != 0.0D)
{
stack.getTagCompound().removeTag("ench");
//System.out.println(stack.getTagCompound());
if(getDiamondLevel(stack) > 0) {
if(ThreadLocalRandom.current().nextInt(0, getDiamondLevel(stack)) == 0) {
stack.damageItem(1, entityLiving);
}
} else stack.damageItem(1, entityLiving);
}
return true;
}
@SideOnly(Side.CLIENT)
@Override
public boolean hasEffect(ItemStack stack)
{
return false;
}
@Override
public boolean isRepairable()
{
return false;
}
public int getItemEnchantability(ItemStack stack)
{
return 0;
}
}

View File

@@ -1,379 +0,0 @@
package nmd.primal.forgecraft.items.tools;
import com.mojang.realmsclient.gui.ChatFormatting;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.ToolNBT;
import javax.annotation.Nullable;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
/**
* Created by mminaie on 3/14/17.
*/
public class CustomPickaxe extends ItemPickaxe implements ToolNBT{
public CustomPickaxe(String name, Item.ToolMaterial material) {
super(material);
this.setUnlocalizedName(name);
this.setRegistryName(name);
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
this.setMaxStackSize(1);
this.setNoRepair();
//this.toolClass = "pickaxe";
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
/***
hot . emerald . diamond . redstone . lapis
0 . 0 . 0 . 0 . 0
***/
@SideOnly(Side.CLIENT)
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
if (item.hasTagCompound()) {
if (getHot(item) == false) {
if (getModifiers(item) != 0) {
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.1F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.11F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.12F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.111F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.102F;
}
// ============
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.01F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.02F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 3) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.03F;
}
//=======
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.001F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.002F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 3) &&
(getLapisLevel(item) == 0)) {
return 0.003F;
}
//=========
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 1)) {
return 0.0001F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 2)) {
return 0.0002F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 3)) {
return 0.0003F;
}
//=======
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 1)) {
return 0.0111F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.021F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.012F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 2)) {
return 0.0012F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 1)) {
return 0.0021F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 2) ) {
return 0.0102F;
}
}
}
if (getHot(item) == true) {
return 1.0F;
}
if (getHot(item) == false) {
if (getModifiers(item) == 0) {
return 0.0F;
}
}
}
return 0.0F;
}
});
}
public static boolean isHidden()
{
return false;
}
@Override
public void onCreated(ItemStack item, World world, EntityPlayer playerIn) {
if(!world.isRemote) {
if (!item.hasTagCompound()) {
item.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = new NBTTagCompound();
item.getTagCompound().setTag("tags", tags);
/*setHot(item, false);
setHot(item, false);
setEmerald(item, false);
setDiamondLevel(item, 0);
setRedstoneLevel(item, 0);
setLapisLevel(item, 0);
setModifiers(item, 0);*/
}
}
}
@Override
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
if(!world.isRemote) {
if (!item.hasTagCompound()) {
item.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = new NBTTagCompound();
item.getTagCompound().setTag("tags", tags);
setHot(item, false);
setEmerald(item, false);
setDiamondLevel(item, 0);
setRedstoneLevel(item, 0);
setLapisLevel(item, 0);
setModifiers(item, 0);
}
}
/*if(){
}*/
}
//public void onItemTooltip(ItemTooltipEvent event){
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack item, EntityPlayer player, List<String> tooltip, boolean advanced)
{
if(player.getEntityWorld().isRemote) {
//tooltip.add(ChatFormatting.GRAY + "Damage: " + item.getItemDamage() );
if(item.hasTagCompound()) {
tooltip.add(ChatFormatting.GRAY + "Upgrades Left: " + (3 - getModifiers(item)) );
if (getEmerald(item) == true) {
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
}
if (getDiamondLevel(item) > 0) {
tooltip.add(ChatFormatting.AQUA + "Diamond Level: " + getDiamondLevel(item));
}
if (getRedstoneLevel(item) > 0) {
tooltip.add(ChatFormatting.RED + "Redstone Level: " + getRedstoneLevel(item) );
}
if (getLapisLevel(item) > 0) {
tooltip.add(ChatFormatting.BLUE + "Lapis Level: " + getLapisLevel(item) );
}
tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() );
}
}
}
@Override
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player)
{
if(!player.world.isRemote){
World world = player.getEntityWorld();
//System.out.println(world.getBlockState(pos).getBlock());
if(itemstack.getItem() instanceof CustomPickaxe){
if( getEmerald(itemstack)){
itemstack.addEnchantment(Enchantment.getEnchantmentByID(33), 1);
}
if( getDiamondLevel(itemstack) > 0 ){
//itemstack.addEnchantment(Enchantment.getEnchantmentByID(34), getDiamondLevel(itemstack));
itemstack.getItem().setHarvestLevel("pickaxe", 3);
}
/*if( getRedstoneLevel(itemstack) > 0 ){
itemstack.addEnchantment(Enchantment.getEnchantmentByID(32), getRedstoneLevel(itemstack));
//System.out.println(itemstack.getEnchantmentTagList());
}*/
if ( getLapisLevel(itemstack) > 0) {
itemstack.addEnchantment(Enchantment.getEnchantmentByID(35), getLapisLevel(itemstack));
}
}
}
return false;
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
{
if (!worldIn.isRemote && (double)state.getBlockHardness(worldIn, pos) != 0.0D)
{
stack.getTagCompound().removeTag("ench");
//System.out.println(stack.getTagCompound());
if(getDiamondLevel(stack) > 0) {
if(ThreadLocalRandom.current().nextInt(0, getDiamondLevel(stack)) == 0) {
stack.damageItem(1, entityLiving);
}
} else stack.damageItem(1, entityLiving);
}
return true;
}
@SideOnly(Side.CLIENT)
@Override
public boolean hasEffect(ItemStack stack)
{
return false;
}
@Override
public boolean isRepairable()
{
return false;
}
public int getItemEnchantability(ItemStack stack)
{
return 0;
}
@Override
public float getStrVsBlock(ItemStack stack, IBlockState state)
{
Material material = state.getMaterial();
//return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
if(material != Material.IRON && material != Material.ANVIL && material != Material.ROCK){
return super.getStrVsBlock(stack, state);
} else {
return this.efficiencyOnProperMaterial * ( (this.getRedstoneLevel(stack) * 2 ) + 1);
}
}
}

View File

@@ -1,376 +0,0 @@
package nmd.primal.forgecraft.items.tools;
import com.google.common.collect.Sets;
import com.mojang.realmsclient.gui.ChatFormatting;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.ToolNBT;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ThreadLocalRandom;
/**
* Created by mminaie on 3/21/17.
*/
public class CustomShovel extends ItemSpade implements ToolNBT {
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_LAYER, Blocks.SOUL_SAND, Blocks.GRASS_PATH});
public CustomShovel(String name, Item.ToolMaterial material) {
super(material);
this.setUnlocalizedName(name);
this.setRegistryName(name);
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
this.setMaxStackSize(1);
this.setNoRepair();
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
/***
hot . emerald . diamond . redstone . lapis
0 . 0 . 0 . 0 . 0
***/
@SideOnly(Side.CLIENT)
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
if (item.hasTagCompound()) {
if (getHot(item) == false) {
if (getModifiers(item) != 0) {
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.1F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.11F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.12F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.111F;
}
if ( (getEmerald(item) == true) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.102F;
}
// ============
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.01F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.02F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 3) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 0)) {
return 0.03F;
}
//=======
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.001F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.002F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 3) &&
(getLapisLevel(item) == 0)) {
return 0.003F;
}
//=========
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 1)) {
return 0.0001F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 2)) {
return 0.0002F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 3)) {
return 0.0003F;
}
//=======
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 1)) {
return 0.0111F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 2) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 0)) {
return 0.021F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 0)) {
return 0.012F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 1) &&
(getLapisLevel(item) == 2)) {
return 0.0012F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 0) &&
(getRedstoneLevel(item) == 2) &&
(getLapisLevel(item) == 1)) {
return 0.0021F;
}
if ( (getEmerald(item) == false) &&
(getDiamondLevel(item) == 1) &&
(getRedstoneLevel(item) == 0) &&
(getLapisLevel(item) == 2) ) {
return 0.0102F;
}
}
}
if (getHot(item) == true) {
return 1.0F;
}
if (getHot(item) == false) {
if (getModifiers(item) == 0) {
return 0.0F;
}
}
}
return 0.0F;
}
});
}
public static boolean isHidden()
{
return false;
}
@Override
public void onCreated(ItemStack item, World world, EntityPlayer playerIn) {
if(!world.isRemote) {
if (!item.hasTagCompound()) {
item.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = new NBTTagCompound();
item.getTagCompound().setTag("tags", tags);
/*setHot(item, false);
setHot(item, false);
setEmerald(item, false);
setDiamondLevel(item, 0);
setRedstoneLevel(item, 0);
setLapisLevel(item, 0);
setModifiers(item, 0);*/
}
}
}
@Override
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
if(!world.isRemote) {
if (!item.hasTagCompound()) {
item.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = new NBTTagCompound();
item.getTagCompound().setTag("tags", tags);
setHot(item, false);
setEmerald(item, false);
setDiamondLevel(item, 0);
setRedstoneLevel(item, 0);
setLapisLevel(item, 0);
setModifiers(item, 0);
}
}
}
//public void onItemTooltip(ItemTooltipEvent event){
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack item, EntityPlayer player, List<String> tooltip, boolean advanced)
{
if(player.getEntityWorld().isRemote) {
if(item.hasTagCompound()) {
tooltip.add(ChatFormatting.GRAY + "Upgrades Left: " + (3 - getModifiers(item)) );
if (getEmerald(item) == true) {
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
}
if (getDiamondLevel(item) > 0) {
tooltip.add(ChatFormatting.AQUA + "Diamond Level: " + getDiamondLevel(item));
}
if (getRedstoneLevel(item) > 0) {
tooltip.add(ChatFormatting.RED + "Redstone Level: " + getRedstoneLevel(item) );
}
if (getLapisLevel(item) > 0) {
tooltip.add(ChatFormatting.BLUE + "Lapis Level: " + getLapisLevel(item) );
}
tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() );
}
}
}
@Override
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player)
{
if(!player.world.isRemote){
World world = player.getEntityWorld();
System.out.println(world.getBlockState(pos).getBlock());
if(itemstack.getItem() instanceof CustomShovel){
if( getEmerald(itemstack)){
itemstack.addEnchantment(Enchantment.getEnchantmentByID(33), 1);
}
if( getDiamondLevel(itemstack) > 0 ){
//itemstack.addEnchantment(Enchantment.getEnchantmentByID(34), getDiamondLevel(itemstack));
itemstack.getItem().setHarvestLevel("pickaxe", 3);
}
/*if( getRedstoneLevel(itemstack) > 0 ){
itemstack.addEnchantment(Enchantment.getEnchantmentByID(32), getRedstoneLevel(itemstack));
//System.out.println(itemstack.getEnchantmentTagList());
}*/
if ( getLapisLevel(itemstack) > 0) {
itemstack.addEnchantment(Enchantment.getEnchantmentByID(35), getLapisLevel(itemstack));
}
}
}
return false;
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
{
if (!worldIn.isRemote && (double)state.getBlockHardness(worldIn, pos) != 0.0D)
{
stack.getTagCompound().removeTag("ench");
//System.out.println(stack.getTagCompound());
if(getDiamondLevel(stack) > 0) {
if(ThreadLocalRandom.current().nextInt(0, getDiamondLevel(stack)) == 0) {
stack.damageItem(1, entityLiving);
}
} else stack.damageItem(1, entityLiving);
}
return true;
}
@Override
public float getStrVsBlock(ItemStack stack, IBlockState state)
{
for (String type : getToolClasses(stack))
{
if (state.getBlock().isToolEffective(type, state))
return efficiencyOnProperMaterial;
}
return this.EFFECTIVE_ON.contains(state.getBlock()) ? (this.efficiencyOnProperMaterial * ( (this.getRedstoneLevel(stack) * 2 ) + 1)) : 1.0F;
}
@SideOnly(Side.CLIENT)
@Override
public boolean hasEffect(ItemStack stack)
{
return false;
}
@Override
public boolean isRepairable()
{
return false;
}
public int getItemEnchantability(ItemStack stack)
{
return 0;
}
}

View File

@@ -1,43 +0,0 @@
package nmd.primal.forgecraft.items.weapons;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo;
/**
* Created by mminaie on 3/23/17.
*/
public class CustomSword extends ItemSword {
public CustomSword(String name, Item.ToolMaterial material) {
super(material);
this.setUnlocalizedName(name);
this.setRegistryName(name);
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
this.setMaxStackSize(1);
this.setNoRepair();
}
@SideOnly(Side.CLIENT)
@Override
public boolean hasEffect(ItemStack stack)
{
return false;
}
@Override
public boolean isRepairable()
{
return false;
}
public int getItemEnchantability(ItemStack stack)
{
return 0;
}
}

View File

@@ -1,45 +0,0 @@
package nmd.primal.forgecraft.proxy;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.renders.blocks.*;
import nmd.primal.forgecraft.tiles.*;
/**
* Created by kitsu on 11/26/2016.
*/
public class ClientProxy implements CommonProxy {
@Override
public void preInit(){
ModItems.registerCustomRenders();
}
@Override
public void init() {
//OBJLoader.INSTANCE.addDomain(ModInfo.MOD_ID);
//Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ModItems.stonetongs, 0, new ModelResourceLocation("stonetongs", "inventory"));
ModItems.registerRenders();
ModBlocks.registerRenders();
//this.registerModelBakeryStuff();
this.registerTileRendering();
}
//@Override
public void registerTileRendering()
{
ClientRegistry.bindTileEntitySpecialRenderer(TileForge.class, new TileForgeRender());
ClientRegistry.bindTileEntitySpecialRenderer(TilePistonBellows.class, new TilePistonBellowsRender());
ClientRegistry.bindTileEntitySpecialRenderer(TileBloomery.class, new TileBloomeryRender());
ClientRegistry.bindTileEntitySpecialRenderer(TileAnvil.class, new TileAnvilRender());
ClientRegistry.bindTileEntitySpecialRenderer(TileBreaker.class, new TileBreakerRender());
}
@Override
public void registerModelBakeryVariants(){
//ModelBakery.registerItemVariants(ModItems.stonetongs, new ResourceLocation(ModInfo.MOD_ID, "stonetongs_default"),
// new ResourceLocation(ModInfo.MOD_ID, "stonetongs_emptyhot"));
}
}

View File

@@ -1,134 +0,0 @@
package nmd.primal.forgecraft.renders.blocks;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import nmd.primal.forgecraft.blocks.Forge;
import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.tiles.TileForge;
import org.lwjgl.opengl.GL11;
/**
* Created by kitsu on 12/4/2016.
*/
public class TileForgeRender extends TileEntitySpecialRenderer<TileForge>
{
private RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
@Override
public void renderTileEntityAt(TileForge tile, double x, double y, double z, float partialTicks, int destroyStage) {
BlockPos pos = tile.getPos();
IBlockState state = this.getWorld().getBlockState(pos);
if (state.getBlock() instanceof Forge) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 0.95D, z + 0.5D);
//GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
float prevLGTX = OpenGlHelper.lastBrightnessX;
float prevLGTY = OpenGlHelper.lastBrightnessY;
int bright = tile.getWorld().getCombinedLight(pos.up(), 0);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, bright % 65536, bright / 65536);
ItemStack stack1 = tile.getSlotStack(0);
boolean is_block = stack1.getItem() instanceof ItemBlock;
float scale = is_block ? 0.1725F : 0.3F;
double xTrans = is_block ? -1.6D : -0.45D;
double yTrans = is_block ? -1.26D : 0.75D;
if (!stack1.isEmpty()) {
int stackRotation = stack1.getCount();
GL11.glPushMatrix();
GL11.glScalef(scale, scale, scale);
GL11.glRotated(90.0F, 1.0F, 0.0F, 0.0F);
renderItem.renderItem(stack1, renderItem.getItemModelMesher().getItemModel(stack1));
GL11.glPopMatrix();
for (int i = 0; i < Math.ceil(stackRotation / 8) + 1; i++) {
GL11.glPushMatrix();
GL11.glScalef(scale, scale, scale);
GL11.glRotated(45.0F * i, 0.0F, 1.0F, 0.0F);
GL11.glRotated(90.0F, 1.0F, 0.0F, 0.0F);
GL11.glTranslated(xTrans, yTrans, 0.0D);
renderItem.renderItem(stack1, renderItem.getItemModelMesher().getItemModel(stack1));
GL11.glPopMatrix();
}
}
for (int i = 2; i < tile.getSlotListSize(); i++) {
if (!tile.getSlotStack(i).isEmpty()) {
GL11.glPushMatrix();
float tempScale = 0.8F;
GL11.glScalef(tempScale, tempScale, tempScale);
GL11.glTranslated(0.0F, 0.1D, 0.0F);
if (i == 2) {
GL11.glTranslated(-0.3, -0.05D, -0.3D);
if (tile.getSlotStack(i).getItem() == Items.IRON_INGOT) {
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glRotated(90.0F, 1.0f, 0.0f, 0.0f);
}
}
if (i == 3) {
GL11.glTranslated(-0.3, -0.05D, 0.3D);
if (tile.getSlotStack(i).getItem() == Items.IRON_INGOT) {
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glRotated(90.0F, 1.0f, 0.0f, 0.0f);
}
}
if (i == 4) {
if (tile.getSlotStack(i).getItem() == Items.IRON_INGOT) {
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glRotated(90.0F, 1.0f, 0.0f, 0.0f);
}
//GL11.glScalef(0.6F, 0.6F, 0.6F);
if (tile.getSlotStack(i).getItem() == ModItems.pickaxehead) {
GL11.glRotated(180.0F, 0.0F, 1.0F, 0.0F);
}
if (tile.getSlotStack(i).getItem() == ModItems.ironaxehead) {
GL11.glRotated(90.0F, 1.0F, 0.0F, 0.0F);
}
if (tile.getSlotStack(i).getItem() == ModItems.ironshovelhead) {
GL11.glRotated(90.0F, 1.0F, 0.0F, 0.0F);
}
if (tile.getSlotStack(i).getItem() == ModItems.ironhoehead) {
GL11.glRotated(180.0F, 1.0F, 0.0F, 0.0F);
GL11.glTranslated(0.0, 0.025D, 0.0D);
}
}
if (i == 5) {
GL11.glTranslated(0.3, -0.05D, -0.3D);
if (tile.getSlotStack(i).getItem() == Items.IRON_INGOT) {
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glRotated(90.0F, 1.0f, 0.0f, 0.0f);
}
}
if (i == 6) {
GL11.glTranslated(0.3, -0.05D, 0.3D);
if (tile.getSlotStack(i).getItem() == Items.IRON_INGOT) {
GL11.glScalef(0.5f, 0.5f, 0.5f);
GL11.glRotated(90.0F, 1.0f, 0.0f, 0.0f);
}
}
renderItem.renderItem(tile.getSlotStack(i), ItemCameraTransforms.TransformType.FIXED);
//renderItem.renderItem(tile.getSlotStack(i), renderItem.getItemModelMesher().getItemModel(tile.getSlotStack(i)));
GL11.glPopMatrix();
}
}
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, prevLGTX, prevLGTY);
GL11.glPopMatrix();
}
}
}

View File

@@ -1,82 +0,0 @@
package nmd.primal.forgecraft.tiles;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ITickable;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.items.parts.ToolPart;
import java.util.concurrent.ThreadLocalRandom;
/**
* Created by mminaie on 3/4/17.
*/
public class TileAnvil extends TileBaseSlot implements ITickable {
double[] normalX = {0.125,0.3125,0.5,0.6875,0.875};
public double getNormalX(Integer x) {
return normalX[x];
}
double[] normalZ = {0.125,0.3125,0.5,0.6875,0.875};
public double getNormalZ(Integer z) {
return normalZ[z];
}
double[] reverseX = {0.875,0.6875,0.5,0.3125,0.125};
public double getReverseX(Integer x) {
return reverseX[x];
}
double[] reverseZ = {0.875,0.6875,0.5,0.3125,0.125};
public double getReverseZ(Integer z) {
return reverseZ[z];
}
public NonNullList<ItemStack> slotList = NonNullList.<ItemStack>withSize(100, ItemStack.EMPTY);
@Override
public void update () {
World world = this.getWorld();
if (!world.isRemote) {
IBlockState state = world.getBlockState(this.pos);
if ( ThreadLocalRandom.current().nextInt(0,10000) == 0 ) {
for(int i=0; i<this.getSlotListSize(); i++){
if(this.getSlotStack(i).getItem() == ModItems.ironchunkhot){
if(ThreadLocalRandom.current().nextInt(0,1000) == 1){
this.setSlotStack(i, new ItemStack(ModBlocks.ironchunk, 1));
this.updateBlock();
this.markDirty();
}
}
if(this.getSlotStack(i).getItem() == ModItems.ironingotballhot){
if(ThreadLocalRandom.current().nextInt(0,1000) == 2){
this.setSlotStack(i, new ItemStack(ModBlocks.ironball, 1));
this.updateBlock();
this.markDirty();
}
}
if(this.getSlotStack(i).getItem() instanceof ToolPart){
if(ThreadLocalRandom.current().nextInt(0,1000) == 3){
((ToolPart) this.getSlotStack(i).getItem()).setHot(this.getSlotStack(i), false);
this.updateBlock();
this.markDirty();
}
}
}
}
}
}
}

View File

@@ -1,39 +0,0 @@
package nmd.primal.forgecraft.tiles;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ITickable;
import net.minecraft.world.World;
import nmd.primal.forgecraft.crafting.BloomeryCrafting;
/**
* Created by mminaie on 2/4/17.
*/
public class TileBaseCrucible extends BaseTile implements ITickable {
private int iteration = 0;
public int countdown = 0;
@Override
public void update () {
if (!world.isRemote) {
World world = this.getWorld();
IBlockState state = world.getBlockState(this.pos);
iteration++;
//System.out.println(iteration);
if(iteration == 100 ){
iteration = 0;
countdown += 100;
//System.out.println(countdown);
BloomeryCrafting recipe = BloomeryCrafting.getRecipeFromOutput(new ItemStack(state.getBlock(), 1));
if(recipe != null){
if (countdown > recipe.getCooldown()){
world.setBlockState(this.pos, Block.getBlockFromItem(recipe.getCoolOutput().getItem()).getDefaultState(), 3);
countdown = 0;
}
}
}
}
}
}

View File

@@ -1,213 +0,0 @@
package nmd.primal.forgecraft.tiles;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ITickable;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import nmd.primal.core.common.helper.CommonUtils;
import nmd.primal.core.common.helper.ParticleHelper;
import nmd.primal.forgecraft.blocks.Bloomery;
import nmd.primal.forgecraft.blocks.Crucible;
import nmd.primal.forgecraft.blocks.Forge;
import nmd.primal.forgecraft.crafting.BloomeryCrafting;
import nmd.primal.forgecraft.init.ModItems;
import static nmd.primal.forgecraft.CommonUtils.getVanillaItemBurnTime;
import static nmd.primal.core.common.helper.FireHelper.makeSmoke;
/**
* Created by mminaie on 1/22/17.
*/
public class TileBloomery extends TileBaseSlot implements ITickable {
private NonNullList<ItemStack> slotList = NonNullList.<ItemStack>withSize(3, ItemStack.EMPTY);
private int iteration = 0;
private int heat;
private int cookCounter;
@Override
public void update () {
World world = this.getWorld();
if(!world.isRemote){
IBlockState state = world.getBlockState(this.pos);
if(state.getValue(Bloomery.ACTIVE) == true){
if(this.getHeat() < 100){
this.setHeat(100);
}
}
this.iteration ++;
if(this.iteration == 300 ) {
this.iteration = 0;
//IBlockState state = world.getBlockState(this.pos);
BlockPos abovePos = new BlockPos(this.getPos().getX(), this.getPos().getY()+1, this.getPos().getZ());
if (world.getBlockState(this.getPos()).getValue(Bloomery.ACTIVE)) {
if (this.getSlotStack(0) == ItemStack.EMPTY) {
world.setBlockState(this.getPos(), state.withProperty(Forge.ACTIVE, false), 2);
this.markDirty();
world.notifyBlockUpdate(pos, state, state, 2);
}
slotZeroManager(world);
}
this.heatManager(this.getHeat(), state, this.getSlotStack(0), world, pos);
}
slotOneManager();
}
}
private void slotOneManager(){
BloomeryCrafting recipe = BloomeryCrafting.getRecipe(this.getSlotStack(1));
if(recipe != null){
//System.out.println(recipe.getIdealTime() + " : " + recipe.getHeatThreshold());
//System.out.println(this.cookCounter + " : " + this.getHeat());
//System.out.println("====================");
if(this.getHeat() >= recipe.getHeatThreshold()){
cookCounter++;
}
if(cookCounter >= recipe.getIdealTime() ){
if(this.getSlotStack(1).getItem() == recipe.getInput().getItem()) {
this.setSlotStack(1, recipe.getOutput());
//this.cookCounter = 0;
//System.out.print(" :Success: " + this.getSlotStack(1));
this.updateBlock();
this.markDirty();
}
}
if(cookCounter > recipe.getIdealTime() + (recipe.getIdealTime() * recipe.getTimeVariance())){
if(this.getSlotStack(1).getItem() == recipe.getOutput().getItem()) {
this.setSlotStack(1, recipe.getOutputFailed());
this.cookCounter = 0;
//System.out.print(" :Failure Time: " + this.getSlotStack(1));
this.updateBlock();
this.markDirty();
}
}
if(this.getHeat() > recipe.getHeatThreshold() + (recipe.getHeatThreshold() * recipe.getHeatVariance())){
if(this.getSlotStack(1).getItem() == recipe.getInput().getItem()) {
this.setSlotStack(1, recipe.getOutputFailed());
this.cookCounter = 0;
//System.out.print(" :Failure Heat: " + this.getSlotStack(1));
this.updateBlock();
this.markDirty();
}
}
if (this.getSlotStack(1).isEmpty()){
this.cookCounter=0;
}
}
}
private void slotZeroManager(World world){
if(this.getSlotStack(0) != ItemStack.EMPTY) {
Integer decrInt = (int) Math.floor(getVanillaItemBurnTime(this.getSlotStack(0)) / 20);
if(decrInt == 0) {
decrInt = 1;
}
if (world.rand.nextInt(decrInt) == 0) {
this.decrStackSize(0, 1);
this.markDirty();
this.updateBlock();
}
if (this.getSlotStack(0).getCount() == 1){
this.decrStackSize(0, 1);
this.markDirty();
this.updateBlock();
}
makeSmoke(world, pos);
}
}
public int getHeat(){
return this.heat;
}
public void setHeat(int newHeat){
this.heat = newHeat;
}
public int getCookCounter() {return this.cookCounter; }
@Override
public int getSlotLimit() {
return 1;
}
private void heatManager(Integer h, IBlockState state, ItemStack stack, World world, BlockPos pos){
if(state.getValue(Bloomery.ACTIVE) == true){
if(!stack.isEmpty()) {
if(h > 0) {
this.setHeat(h - 25);
}
if(h < 10 ){
world.setBlockState(pos, state.withProperty(Forge.ACTIVE, false), 2);
}
}
if(stack.isEmpty()){
world.setBlockState(pos, state.withProperty(Forge.ACTIVE, false), 2);
}
}
if(state.getValue(Bloomery.ACTIVE) == false){
if(h > 50){
this.setHeat(h - 50);
}
if(h < 0){
this.setHeat(0);
}
}
this.updateBlock();
this.markDirty();
}
public ItemStack removeStackFromSlot(int index) {
ItemStack stack = this.getSlotStack(index);
this.setSlotStack(index, ItemStack.EMPTY);
return stack;
}
public boolean isItemValidForSlot(int index, ItemStack stack) {
if(index == 0){
if(stack.getItem() == Items.COAL){
if(stack.getMetadata() == 1) {
return true;
}
}
}
if(index == 1){
if (stack.getItem() == ModItems.softcrucible) {
return true;
}
if(Block.getBlockFromItem(stack.getItem()) instanceof Crucible ){
return true;
}
}
return false;
}
// ***************************************************************************** //
// NBT
// ***************************************************************************** //
@Override
public NBTTagCompound readNBT(NBTTagCompound nbt)
{
super.readNBT(nbt);
this.heat = nbt.getInteger("heat");
this.cookCounter = nbt.getInteger("cook");
return nbt;
}
@Override
public NBTTagCompound writeNBT(NBTTagCompound nbt)
{
nbt.setInteger("heat", this.heat);
nbt.setInteger("cook", this.cookCounter);
super.writeNBT(nbt);
return nbt;
}
}

View File

@@ -1,250 +0,0 @@
package nmd.primal.forgecraft.tiles;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ITickable;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import nmd.primal.core.common.helper.CommonUtils;
import nmd.primal.forgecraft.blocks.Forge;
import nmd.primal.forgecraft.crafting.ForgeCrafting;
import static nmd.primal.forgecraft.CommonUtils.getVanillaItemBurnTime;
import static nmd.primal.core.common.helper.FireHelper.makeSmoke;
/**
* Created by mminaie on 11/30/16.
*/
public class TileForge extends TileBaseSlot implements ITickable {
private NonNullList<ItemStack> slotList = NonNullList.<ItemStack>withSize(7, ItemStack.EMPTY);
//private ItemStack[] inventory = new ItemStack [0];
//private String customName;
private int iteration = 0;
private int heat;
private int cookCounter2, cookCounter3, cookCounter4, cookCounter5, cookCounter6;
@Override
public void update () {
if(!world.isRemote){
World world = this.getWorld();
this.iteration ++;
IBlockState state = world.getBlockState(this.pos);
BlockPos abovePos = new BlockPos(this.getPos().getX(), this.getPos().getY()+1, this.getPos().getZ());
IBlockState aboveState = world.getBlockState(abovePos);
Block block = world.getBlockState(abovePos).getBlock();
if(this.iteration == 300 ) {
this.iteration = 0;
if (world.getBlockState(this.getPos()).getValue(Forge.ACTIVE)) {
if (this.getSlotStack(0) == ItemStack.EMPTY) {
world.setBlockState(this.getPos(), state.withProperty(Forge.ACTIVE, false), 2);
this.markDirty();
world.notifyBlockUpdate(pos, state, state, 2);
}
slotZeroManager(world);
}
this.heatManager(this.getHeat(), state, this.getSlotStack(0), world, pos);
}
craftingManager();
}
}
private void slotZeroManager(World world){
if(this.getSlotStack(0) != ItemStack.EMPTY) {
Integer decrInt = (int) Math.floor(getVanillaItemBurnTime(this.getSlotStack(0)) / 20);
if(decrInt == 0) {
decrInt = 1;
}
if (world.rand.nextInt(decrInt) == 0) {
this.decrStackSize(0, 1);
this.markDirty();
this.updateBlock();
}
if (this.getSlotStack(0).getCount() == 1){
this.decrStackSize(0, 1);
this.markDirty();
this.updateBlock();
}
makeSmoke(world, pos);
}
}
private void heatManager(Integer h, IBlockState state, ItemStack stack, World world, BlockPos pos){
if(state.getValue(Forge.ACTIVE) == true){
if(!stack.isEmpty()) {
if(h > 0) {
this.setHeat(h - 25);
}
if(h < 10 ){
world.setBlockState(pos, state.withProperty(Forge.ACTIVE, false), 2);
}
}
if(stack.isEmpty()){
world.setBlockState(pos, state.withProperty(Forge.ACTIVE, false), 2);
}
}
if(state.getValue(Forge.ACTIVE) == false){
if(h > 50){
this.setHeat(h - 50);
}
if(h < 0){
this.setHeat(0);
}
}
this.updateBlock();
this.markDirty();
}
private void craftingManager() {
for (int i = 2; i < this.getSlotListSize(); i++) {
Item itemTest = this.getSlotStack(i).getItem();
ForgeCrafting recipe = ForgeCrafting.getRecipe(itemTest);
if (recipe != null) {
if(i == 2){
if (this.getHeat() >= recipe.getHeatThreshold()) {
cookCounter2++;
}
if (this.getHeat() < recipe.getHeatThreshold() && cookCounter2 > 0) {
cookCounter2--;
}
if (cookCounter2 >= recipe.getIdealTime()) {
if(this.getSlotStack(i).hasTagCompound()){
this.getSlotStack(i).getSubCompound("tags").setBoolean("hot", true);
} else this.setSlotStack(i, recipe.getOutput());
cookCounter2 = 0;
}
}
if(i == 3){
if (this.getHeat() >= recipe.getHeatThreshold()) {
cookCounter3++;
}
if (this.getHeat() < recipe.getHeatThreshold() && cookCounter3 > 0) {
cookCounter3--;
}
if (cookCounter3 >= recipe.getIdealTime()) {
if(this.getSlotStack(i).hasTagCompound()){
this.getSlotStack(i).getSubCompound("tags").setBoolean("hot", true);
} else this.setSlotStack(i, recipe.getOutput());
cookCounter3 = 0;
}
}
if(i == 4){
if (this.getHeat() >= recipe.getHeatThreshold()) {
cookCounter4++;
}
if (this.getHeat() < recipe.getHeatThreshold() && cookCounter4 > 0) {
cookCounter4--;
}
if (cookCounter4 >= recipe.getIdealTime()) {
if(this.getSlotStack(i).hasTagCompound()){
if( this.getSlotStack(i).getSubCompound("tags").getBoolean("hot") == false) {
this.getSlotStack(i).getSubCompound("tags").setBoolean("hot", true);
//System.out.println(this.getSlotStack(i).getSubCompound("tags"));
//System.out.println("its hot now");
cookCounter4 = 0;
}
} else this.setSlotStack(i, recipe.getOutput());
cookCounter4 = 0;
}
}
if(i == 5){
if (this.getHeat() >= recipe.getHeatThreshold()) {
cookCounter5++;
}
if (this.getHeat() < recipe.getHeatThreshold() && cookCounter5 > 0) {
cookCounter5--;
}
if (cookCounter5 >= recipe.getIdealTime()) {
if(this.getSlotStack(i).hasTagCompound()){
this.getSlotStack(i).getSubCompound("tags").setBoolean("hot", true);
} else this.setSlotStack(i, recipe.getOutput());
cookCounter5 = 0;
}
}
if(i == 6){
if (this.getHeat() >= recipe.getHeatThreshold()) {
cookCounter6++;
}
if (this.getHeat() < recipe.getHeatThreshold() && cookCounter6 > 0) {
cookCounter6--;
}
if (cookCounter6 >= recipe.getIdealTime()) {
if(this.getSlotStack(i).hasTagCompound()){
this.getSlotStack(i).getSubCompound("tags").setBoolean("hot", true);
} else this.setSlotStack(i, recipe.getOutput());
cookCounter6 = 0;
}
}
/*
System.out.println(state.getValue(IngotBall.ACTIVE) + " : " + recipe.getStartState());
System.out.println(cookCounter + " : " + recipe.getIdealTime());
System.out.println(this.heat + " : " + recipe.getHeatThreshold());
System.out.println("========");
*/
}
}
}
public int getHeat(){
return this.heat;
}
public void setHeat(int newHeat){
this.heat = newHeat;
}
@Override
public int getSlotLimit() {
return 1;
}
public ItemStack removeStackFromSlot(int index) {
ItemStack stack = this.getSlotStack(index);
this.setSlotStack(index, ItemStack.EMPTY);
return stack;
}
public boolean isItemValidForSlot(int index, ItemStack stack) {
if(index == 0){
if(stack.getItem() == Items.COAL){
if(stack.getMetadata() == 1) {
return true;
}
}
}
return false;
}
// ***************************************************************************** //
// NBT
// ***************************************************************************** //
@Override
public NBTTagCompound readNBT(NBTTagCompound nbt)
{
super.readNBT(nbt);
this.heat = nbt.getInteger("heat");
return nbt;
}
@Override
public NBTTagCompound writeNBT(NBTTagCompound nbt)
{
nbt.setInteger("heat", this.heat);
super.writeNBT(nbt);
return nbt;
}
}

View File

@@ -1,10 +0,0 @@
package nmd.primal.forgecraft.util;
/**
* Created by mminaie on 3/29/17.
*/
public interface ToolMaterials {
}

View File

@@ -1,20 +0,0 @@
{
"variants": {
"active=false,covered=false,facing=north": { "model": "forgecraft:bloomery" },
"active=false,covered=false,facing=east": { "model": "forgecraft:bloomery", "y": 90 },
"active=false,covered=false,facing=south": { "model": "forgecraft:bloomery", "y": 180 },
"active=false,covered=false,facing=west": { "model": "forgecraft:bloomery", "y": 270 },
"active=true,covered=false,facing=north": { "model": "forgecraft:bloomery_lit" },
"active=true,covered=false,facing=east": { "model": "forgecraft:bloomery_lit", "y": 90 },
"active=true,covered=false,facing=south": { "model": "forgecraft:bloomery_lit", "y": 180 },
"active=true,covered=false,facing=west": { "model": "forgecraft:bloomery_lit", "y": 270 },
"active=true,covered=true,facing=north": { "model": "forgecraft:bloomery_lit_covered" },
"active=true,covered=true,facing=east": { "model": "forgecraft:bloomery_lit_covered", "y": 90 },
"active=true,covered=true,facing=south": { "model": "forgecraft:bloomery_lit_covered", "y": 180 },
"active=true,covered=true,facing=west": { "model": "forgecraft:bloomery_lit_covered", "y": 270 },
"active=false,covered=true,facing=north": { "model": "forgecraft:bloomery_covered" },
"active=false,covered=true,facing=east": { "model": "forgecraft:bloomery_covered", "y": 90 },
"active=false,covered=true,facing=south": { "model": "forgecraft:bloomery_covered", "y": 180 },
"active=false,covered=true,facing=west": { "model": "forgecraft:bloomery_covered", "y": 270 }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab",
"texture": "forgecraft:blocks/stone_slab"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab",
"texture": "forgecraft:blocks/stone_slab"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab",
"texture": "forgecraft:blocks/stone_slab"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab",
"texture": "forgecraft:blocks/stone_slab"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_burnt",
"texture": "forgecraft:blocks/stone_slab_burnt"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_hot_burnt",
"texture": "forgecraft:blocks/stone_slab_hot_burnt"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_burnt",
"texture": "forgecraft:blocks/stone_slab_burnt"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_hot_burnt",
"texture": "forgecraft:blocks/stone_slab_hot_burnt"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_burnt",
"texture": "forgecraft:blocks/stone_slab_burnt"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_hot_burnt",
"texture": "forgecraft:blocks/stone_slab_hot_burnt"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_burnt",
"texture": "forgecraft:blocks/stone_slab_burnt"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_hot_burnt",
"texture": "forgecraft:blocks/stone_slab_hot_burnt"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"variants": {
"active=false,facing=north": { "model": "forgecraft:firebox" },
"active=false,facing=east": { "model": "forgecraft:firebox", "y": 90 },
"active=false,facing=south": { "model": "forgecraft:firebox", "y": 180 },
"active=false,facing=west": { "model": "forgecraft:firebox", "y": 270 },
"active=true,facing=north": { "model": "forgecraft:firebox_lit" },
"active=true,facing=east": { "model": "forgecraft:firebox_lit", "y": 90 },
"active=true,facing=south": { "model": "forgecraft:firebox_lit", "y": 180 },
"active=true,facing=west": { "model": "forgecraft:firebox_lit", "y": 270 }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_hot",
"texture": "forgecraft:blocks/stone_slab_hot"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_hot",
"texture": "forgecraft:blocks/stone_slab_hot"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_hot",
"texture": "forgecraft:blocks/stone_slab_hot"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_hot",
"texture": "forgecraft:blocks/stone_slab_hot"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_hot",
"texture": "forgecraft:blocks/stone_slab_hot"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_hot",
"texture": "forgecraft:blocks/stone_slab_hot"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_hot",
"texture": "forgecraft:blocks/stone_slab_hot"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab_hot",
"texture": "forgecraft:blocks/stone_slab_hot"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,26 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/iron_ingot",
"texture": "forgecraft:blocks/iron_ingot"
},
"parent": "forgecraft:ironball"
},
"variants": {
"active=false": {
"model": "forgecraft:ironball",
"textures": {
"particle": "forgecraft:blocks/iron_ingot",
"texture": "forgecraft:blocks/iron_ingot"
}
},
"active=true": {
"model": "forgecraft:ironball",
"textures": {
"particle": "forgecraft:blocks/iron_ingot_hot",
"texture": "forgecraft:blocks/iron_ingot_hot"
}
}
}
}

View File

@@ -1,26 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/iron_ingot",
"texture": "forgecraft:blocks/iron_ingot"
},
"parent": "forgecraft:ironchunk"
},
"variants": {
"active=false": {
"model": "forgecraft:ironchunk",
"textures": {
"particle": "forgecraft:blocks/iron_ingot",
"texture": "forgecraft:blocks/iron_ingot"
}
},
"active=true": {
"model": "forgecraft:ironchunk",
"textures": {
"particle": "forgecraft:blocks/iron_ingot_hot",
"texture": "forgecraft:blocks/iron_ingot_hot"
}
}
}
}

View File

@@ -1,26 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/clean_iron_ingot",
"texture": "forgecraft:blocks/clean_iron_ingot"
},
"parent": "forgecraft:ironball"
},
"variants": {
"active=false": {
"model": "forgecraft:ironball",
"textures": {
"particle": "forgecraft:blocks/clean_iron_ingot",
"texture": "forgecraft:blocks/clean_iron_ingot"
}
},
"active=true": {
"model": "forgecraft:ironball",
"textures": {
"particle": "forgecraft:blocks/clean_iron_ingot_hot",
"texture": "forgecraft:blocks/clean_iron_ingot_hot"
}
}
}
}

View File

@@ -1,26 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/clean_iron_ingot",
"texture": "forgecraft:blocks/clean_iron_ingot"
},
"parent": "forgecraft:ironchunk"
},
"variants": {
"active=false": {
"model": "forgecraft:ironchunk",
"textures": {
"particle": "forgecraft:blocks/clean_iron_ingot",
"texture": "forgecraft:blocks/clean_iron_ingot"
}
},
"active=true": {
"model": "forgecraft:ironchunk",
"textures": {
"particle": "forgecraft:blocks/clean_iron_ingot_hot",
"texture": "forgecraft:blocks/clean_iron_ingot_hot"
}
}
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab",
"texture": "forgecraft:blocks/stone_slab"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab",
"texture": "forgecraft:blocks/stone_slab"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab",
"texture": "forgecraft:blocks/stone_slab"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,12 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/stone_slab",
"texture": "forgecraft:blocks/stone_slab"
}
},
"variants": {
"normal": { "model": "forgecraft:crucibleshut" }
}
}

View File

@@ -1,26 +0,0 @@
{
"forge_marker":1,
"defaults": {
"textures": {
"particle": "forgecraft:blocks/steel_ingot",
"texture": "forgecraft:blocks/steel_ingot"
},
"parent": "forgecraft:ironball"
},
"variants": {
"active=false": {
"model": "forgecraft:ironball",
"textures": {
"particle": "forgecraft:blocks/steel_ingot",
"texture": "forgecraft:blocks/steel_ingot"
}
},
"active=true": {
"model": "forgecraft:ironball",
"textures": {
"particle": "forgecraft:blocks/steel_ingot_hot",
"texture": "forgecraft:blocks/steel_ingot_hot"
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More