Compare commits

..
250 Commits
Author SHA1 Message Date
Kam 1b36c23d66 ok 2023-06-06 18:40:12 -04:00
KAMKEEL 39b7f805b3 Original CNPC Branch 2022-02-05 18:02:35 -05:00
KAMKEEL 6d6daeb345 Update build.gradle 2022-02-02 19:26:24 -05:00
KAMKEEL 3844a26e8b Merge branch 'dev' 2022-02-02 19:25:29 -05:00
KAMKEEL 2a4ace286e Quick Patch 2022-02-02 19:25:17 -05:00
Kamron Vaswani 79ef0e07a1 Merge pull request #33 from c0508383/master
Removed println statement please forgive me oh god
2022-02-02 19:22:35 -05:00
luisc 7e0ff3c836 Removed println statement please forgive me oh god 2022-02-02 18:21:08 -06:00
KAMKEEL e3e55e4256 Merge branch 'dev' 2022-02-02 17:44:46 -05:00
KAMKEEL 0c4ead5752 Merge branch 'dev' of https://github.com/KAMKEEL/CustomNPC-Plus into dev 2022-02-02 16:20:17 -05:00
KAMKEEL 5d39c5b356 Fixed Disable Block Error 2022-02-02 16:20:11 -05:00
Kamron Vaswani 19ccdd60d2 Merge pull request #32 from c0508383/master
Bug fixes & GUI rotations
2022-02-02 15:43:23 -05:00
luisc d3145f4868 Added config for how often a player's quests are checked for completion. 2022-02-02 07:53:42 -06:00
luisc 70536de655 Removed checkQuestCompleted from ScriptPlayer, now redundant with new quest checks that happen periodically. 2022-02-02 07:21:45 -06:00
luisc 1ebf747302 Optimized NBT access of player data when checking quest completion, player data variable is passed down to lower functions.
Player's quests are checked for completion every couple seconds now.
2022-02-02 07:18:33 -06:00
luisc 632e92f82e Added set/getPitch to ScriptEntity 2022-02-01 05:10:38 -06:00
luisc 90ca1a0200 Added isAirborne() function to ScriptEntity 2022-02-01 02:30:50 -06:00
luisc 9109c134c1 Added more general setMotion function with x y and z parameters. 2022-01-31 23:59:15 -06:00
luisc 1af875aea9 Fixed concurrent modification bug with NPC tasks. 2022-01-31 23:01:52 -06:00
luisc 7de585843d Added get/setHunger, and get/setSaturation functions for ScriptPlayer.
The player KeyPressed event now sends a list of keys that are currently pressed by the player.
2022-01-31 20:16:00 -06:00
luisc 67c83b1ce9 Added rotation for custom GUI lines, labels, and textured rectangles 2022-01-31 15:39:21 -06:00
Kamron Vaswani bc54e8cd7b Merge pull request #31 from c0508383/master
Increased NPC Inventory & Other Additions.
2022-01-31 16:27:15 -05:00
Kamron Vaswani 8675d22ebb Merge pull request #30 from PewDizinho/patch-1
Update README.md
2022-01-31 16:27:01 -05:00
luisc 83e13285f9 Added rotation to overlay components, and color codes to overlay labels 2022-01-31 14:51:06 -06:00
luisc 3be088c4cc Moved OpenGL lines to within the loop that renders each component, fixing some weird alpha errors. 2022-01-30 22:58:12 -06:00
luisc 54fadbe63f Implemented label, alpha, and formatting for Custom GUI labels. 2022-01-30 22:49:03 -06:00
luisc da3b04e78e Implemented MC chat formatting for color codes: &l, &m, &r, &o, and &k all affect overlay labels. 2022-01-30 22:41:55 -06:00
luisc e7a19264b2 Added alpha and style options for overlay labels. 2022-01-30 14:22:29 -06:00
luisc 966ab4bf72 Custom Overlays and GUIs now properly set alpha values for some components. 2022-01-30 13:29:00 -06:00
luisc e5e1aa1972 Made color and alpha components global among ScriptGui classes. 2022-01-30 05:20:45 -06:00
luisc be61bd4e17 Made color and alpha components global among ScriptOverlay classes. 2022-01-30 04:33:00 -06:00
luisc 534f716991 Implemented Scripted Overlays which stay on the player's screen. Overlays persist in the client, and can be removed from the screen as well. 2022-01-30 04:05:01 -06:00
luisc 8b24dad211 Added Custom GUI Lines, with configurable thickness & color. Draws a line between one point defined by (x1,y1), and another defined by (x2,y2) 2022-01-28 03:21:00 -06:00
PewDizinho 6974476d92 Update README.md 2022-01-27 14:36:20 -03:00
luisc fcaafe4b26 Fixed NBT issue with the new quest kill amounts. 2022-01-27 06:14:03 -06:00
luisc f876f13d77 Added 9 more slots for quest kill objectives, and an option for kill quests to progress only if a player kills an NPC with that name.
Added quest interface support to get and modify data from specific quest types.
2022-01-27 05:40:51 -06:00
luisc 989effb5c5 Added more a full inventory to NPCs, selectable on two tabs and double-point values for NPC droprates. 2022-01-27 03:50:36 -06:00
luisc f14337f1bb Added config for NPC sizes, default 100. 2022-01-25 14:54:15 -06:00
luisc eb45a6a959 Added several more dialog functions for the rest of the dialog options. 2022-01-25 14:44:24 -06:00
Kamron Vaswani a04f023d53 Merge pull request #28 from c0508383/master
Custom GUI fixes
2022-01-24 01:06:56 -05:00
luisc 092b3ce0c1 Fixed overloaded hurt(damage,entity) function not working when an entity is to be hurt by a player 2022-01-22 22:50:01 -06:00
KAMKEEL 971010bda8 Darken Screen Dialog Fix 2022-01-21 18:31:32 -05:00
luisc 06c730b166 Fixed scale & color issues for custom GUI textured rectangles. 2022-01-21 01:15:21 -06:00
luisc b9bc1e5ed7 Merge remote-tracking branch 'origin/master' 2022-01-20 20:27:39 -06:00
luisc 83756381e4 Added toggleable shadows and scaling to custom GUI labels. 2022-01-20 20:27:26 -06:00
Luis C.M 52f342302c Merge branch 'KAMKEEL:master' into master 2022-01-20 16:32:16 -06:00
luisc 0788b2750f Quick fix for custom GUI textured rectangles, now with working x and y offsets. 2022-01-20 00:15:21 -06:00
KAMKEEL 8a9defd3a1 Part Data Texture Fix for Upgrading from CNPC
Issue where already saved NPCs cannot locate texture if upgrading from CNPC to CNPC+
2022-01-19 18:21:12 -05:00
KAMKEEL dff71c5a98 Update 1.5-beta
💯
Starting new version
2022-01-18 00:20:50 -05:00
Kamron Vaswani cb72f6c50e Merge pull request #26 from c0508383/master
Compatibility fix pt.2
2022-01-15 23:54:55 -05:00
luisc dd22f604cc Compatibility fix for mods that initialize player or worldobj fields as null. 2022-01-15 22:52:27 -06:00
Kamron Vaswani 05e6a97721 Merge pull request #25 from c0508383/master
Compatibility fix for mods that initialize player or worldobj fields as null.
2022-01-15 23:50:33 -05:00
luisc f8a6fe3d75 Compatibility fix for mods that initialize player or worldobj fields as null. 2022-01-15 22:49:07 -06:00
KAMKEEL f9ab885ddd Update Version 1.4.2
Fixed Faction Dupe Glitch
Fixed Darken Screen not saving
2022-01-15 16:51:46 -05:00
Kamron Vaswani e0f77bdcff Merge pull request #24 from c0508383/master
Fixed a faction duplication glitch
2022-01-15 16:50:07 -05:00
luisc 6ff2678f26 Fixed a faction duplication glitch 2022-01-15 15:14:55 -06:00
KAMKEEL a1a0864692 Wrong Button ID Darken Screen 2022-01-15 15:24:37 -05:00
KAMKEEL b3098053ec Fixing Dark Screen not savning 2022-01-15 15:21:20 -05:00
KAMKEEL 2155566113 Hotfix 2022-01-15 04:45:51 -05:00
Kamron Vaswani 9d88da30cf Merge pull request #23 from c0508383/master
Hotfix to Custom GUI Labels for servers
2022-01-15 04:22:33 -05:00
luisc 24e8648a1d Merge remote-tracking branch 'origin/master' 2022-01-15 03:16:37 -06:00
luisc e1c283a19e Hotfix to Custom GUI labels for servers 2022-01-15 03:16:22 -06:00
Kamron Vaswani aba9dd250a Merge pull request #22 from c0508383/master
Added collision options for CNPCs.
2022-01-14 21:51:16 -05:00
KAMKEEL f508fbed1a 1.4
Fix Decimal Display
2022-01-14 21:48:15 -05:00
luisc 007660f16f Added collision options for CNPCs. 2022-01-14 19:07:41 -06:00
Kamron Vaswani e10aa09728 Merge pull request #21 from c0508383/master
Custom GUI slot fix & Custom Particle fix
2022-01-14 19:11:15 -05:00
luisc 4f38edc147 Limited config NpcNavRange to 96. Added darken screen option to dialogs. 2022-01-14 17:37:09 -06:00
luisc 6a6548845b Fixed textfield focus event running when textfield is unfocused 2022-01-14 16:50:13 -06:00
luisc 0aef0827ec Fixed scripted particles not spawning on some NPCs. Custom particle packets are now sent to all players. 2022-01-14 16:39:24 -06:00
luisc 791adfc1b4 Implemented textfield unfocused event 2022-01-14 16:09:27 -06:00
luisc 2874643c84 Fixed textured rectangles in custom GUIs not being placed relative to the GUIs' position. 2022-01-14 15:41:27 -06:00
luisc b0da137db5 Custom GUI slot fix 2022-01-14 15:06:25 -06:00
luisc c28a9156d5 Custom GUI slot fix 2022-01-14 15:06:04 -06:00
Kamron Vaswani 4ba6f3086f Merge pull request #20 from c0508383/master
Flight Fix and API update
2022-01-13 20:31:09 -05:00
luisc 555ceb741f Added a modifiable and toggleable flying height limit to NPCs 2022-01-13 05:28:20 -06:00
luisc 04def38b63 Added dialog events to scripted player events 2022-01-12 22:59:03 -06:00
luisc b024f800ae Added quest start, complete, and turnin events, and a faction points event to scripted player events. 2022-01-12 20:12:16 -06:00
luisc 8919a182c5 Added removeTags() function to ScriptItemStack and isCustomGUI function to ScriptContainer 2022-01-12 04:54:07 -06:00
luisc 6b9cfb9d25 Implemented custom GUIs. 2022-01-12 04:44:08 -06:00
luisc d50f51e208 Added handler support to NPC API. 2022-01-10 15:21:48 -06:00
luisc 69f96519dc Fixed forge events registering twice. 2022-01-10 12:37:26 -06:00
luisc 7808e4a433 getTag() and hasTag() functions from ScriptItemStack no longer write the item stack NBT tag on call. 2022-01-09 17:50:36 -06:00
luisc d74a1f2bee Added ScriptBlockPos functionality with get/setPos to ScriptEntity 2022-01-04 03:50:50 -06:00
luisc c3541df1dc Fix to getFormLevel() in ScriptDBCPlayer 2022-01-04 00:06:48 -06:00
luisc 32792e7d6f Added updateClient() function to ScriptNpc. 2022-01-03 21:30:38 -06:00
luisc 73db2da124 Fixed flying not working in small enclosed spaces. 2022-01-03 15:50:31 -06:00
luisc 6459e7fe2a Added solid render option for bodywear. 2022-01-02 18:13:01 -06:00
luisc a32db79a0b Added solid render option for bodywear 2021-12-30 08:27:04 -06:00
luisc de5f119fd7 Added setJob and setRole functions to ScriptNpc 2021-12-29 22:34:51 -06:00
luisc b330678104 Added several projectile functions to ScriptNpc. 2021-12-29 17:17:06 -06:00
luisc e6f97784ff Added get/setRotationType to ScriptNpc. Added get/setMotion for x, y, z components to ScriptEntity. Fixed an NPC wand crash. 2021-12-29 16:22:05 -06:00
luisc e676c808e3 Fixed getFormLevel not working when player form NBT is "pty". ScriptBlock now correctly sets its tile field, allowing players to access blocks as chests, crates, etc. 2021-12-26 21:08:35 -06:00
luisc e5edbe002e Registered forge events on both MinecraftForge.EVENT_BUS and FMLCommonHandler.instance().bus(). 2021-12-23 10:26:46 -06:00
luisc ce9b9fb59d Merge remote-tracking branch 'origin/master' 2021-12-22 03:34:06 -06:00
luisc c8f6a24baf Added command forge event 2021-12-22 03:33:50 -06:00
luisc 2743fa17d8 Added command forge event 2021-12-22 03:30:01 -06:00
KAMKEEL 5409e4e924 Beta 1.4 2021-12-21 23:57:35 -05:00
KAMKEEL 6573970840 Update build.gradle 2021-12-21 23:55:10 -05:00
KAMKEEL efdd1d6679 Merge branch 'dev' of https://github.com/KAMKEEL/CustomNPC-Plus into dev 2021-12-21 23:52:54 -05:00
KAMKEEL 4cca8e562c Update Build Gradle 2021-12-21 23:51:36 -05:00
Kamron Vaswani 4c31236590 Merge pull request #18 from c0508383/master
December Pull Request
2021-12-21 23:51:07 -05:00
Kamron Vaswani b62149d5f6 Merge branch 'dev' into master 2021-12-21 23:50:51 -05:00
luisc ff810cbc8d Full console output is now shown again for script errors. 2021-12-20 17:03:54 -06:00
luisc 69d4fb20ff Modified client and server packet sending a little bit for player and forge scripts. 2021-12-20 16:57:05 -06:00
luisc 953f6e0459 Fixed server-side lag caused by player events. THIS IS BIG. 2021-12-18 08:34:30 -06:00
luisc 1a78b2dad7 Timers are only updated if a timer exists for a player. 2021-12-17 17:30:50 -06:00
luisc d46d0aba7e Player events and Forge events run in their own separate buses without redundant registering. 2021-12-17 15:14:52 -06:00
luisc 03ee733620 Forge tick events only run if they are in the starting phase. 2021-12-17 14:26:52 -06:00
luisc 7d94e0e210 Removed forge chunk and terrain gen events. 2021-12-17 08:25:02 -06:00
luisc f03516b00f Fixed console and console spam with scripted player events. 2021-12-17 08:10:21 -06:00
luisc 23384d1d67 Fixed some server-side lag caused by player events. Player ticks now execute every 10 MC ticks. 2021-12-16 21:54:05 -06:00
luisc 6bdc68337c Revert "Made player script implementation closer to that of 1.12."
This reverts commit 3a9789b3fd.
2021-12-16 04:05:05 -06:00
luisc 3a9789b3fd Made player script implementation closer to that of 1.12. 2021-12-16 02:53:17 -06:00
luisc 69b7a9aab4 Fixed errors in remove and clear functions for bonusAttribute in ScriptDBCPlayer 2021-12-15 06:46:27 -06:00
luisc 9d9c481bdd Added alternative bonusAttribute function for just get remove and clear, as well as dedicated functions for all bonus attribute functions. 2021-12-15 06:19:16 -06:00
luisc 98d2d943ae Added bonusAttribute function, which works the same as the command. 2021-12-15 05:43:07 -06:00
luisc e9a4471cd2 Added getSkills and setSkills functions to ScriptDBCPlayer 2021-12-15 03:19:34 -06:00
luisc 934d5a69d6 Added getFormLevel and setFormLevel to ScriptDBCPlayer 2021-12-15 03:14:48 -06:00
luisc 12cb6a2937 Added blocking() function to ScriptPlayer to check whether the player is blocking. 2021-12-15 00:02:27 -06:00
luisc cad275e845 Added isBlocking, set/getHairCode, set/getExtraCode, and getInventory functions to ScriptDBCPlayer 2021-12-14 21:41:57 -06:00
luisc 816445bccd Script error output shortened to just the error description and line number. 2021-12-13 22:51:33 -06:00
luisc cf91d8638f Fixed getDBCPlayer not returning a DBC Player instance. 2021-12-13 18:33:20 -06:00
luisc 03395ad750 Added getWorld() function to ScriptEntity. 2021-12-13 16:47:15 -06:00
luisc f2da93451f Re-added hasEnchant, addEnchant, setAttribute, getAttribute, hasAttribute, getLore, and setLore to ScriptItemStack after they were lost in a commit A LONG TIME AGO 2021-12-13 03:11:24 -06:00
luisc 00557df9a7 Fixed players being able to push NPCs around. 2021-12-13 00:16:06 -06:00
luisc 541958b630 Fixed "world" keyword in for NPC scripting and API.getIWorld not returning the same instance. 2021-12-12 23:43:44 -06:00
luisc eac3d2c214 Added getSpeed() and setSpeed(speed) functions to ScriptNpc 2021-12-12 23:10:55 -06:00
luisc ba0f21dc26 Revert "Added npc.setPoweredTexture(directory) and npc.getPoweredTexture() functions, along with a new powered texture resource."
This reverts commit ba4bf107b5.
2021-12-11 08:41:54 -06:00
luisc 743cdb9db7 Revert "Fixed powered texture not showing up when changing NPC model attributes."
This reverts commit 9560228ba8.
2021-12-11 08:38:38 -06:00
luisc fc1c16032f Added RGB and alpha powered texture modifiers:
setPoweredRGBA(r,g,b,alpha)
getPoweredR(),getPoweredG(),getPoweredB(),getPoweredAlpha()
2021-12-10 00:08:47 -06:00
luisc b7d2dab905 Added parameters for texture translation when the NPC is powered, namely npc.display.poweredTranslateX, poweredTranslateY, and poweredTranslateZ, which can all be changed by setPoweredXYZ(x,y,z), and gotten with getPoweredX(), getPoweredY(), and getPoweredZ(). 2021-12-09 23:37:04 -06:00
luisc 9560228ba8 Fixed powered texture not showing up when changing NPC model attributes. 2021-12-09 23:24:36 -06:00
luisc ba4bf107b5 Added npc.setPoweredTexture(directory) and npc.getPoweredTexture() functions, along with a new powered texture resource.
Sample code:
npc.setPoweredTexture("customnpcs:textures/entity/npc_armor.png");
2021-12-08 23:29:08 -06:00
luisc 81881e6e19 Reset aggro range to Integer.MAX_VALUE. Sustainable aggro ranges seem to correlate to client/server RAM, and people should decide what max range is suitable for their client/server. 2021-12-08 20:52:39 -06:00
luisc 909f69575a Set max aggro range to 100. 2021-12-08 20:46:02 -06:00
luisc 34f6f670eb Y velocity when calling entity.knockback() is no longer decreased drastically. 2021-12-08 17:48:35 -06:00
luisc 8c602c4d16 Adjusted floating: NPCs don't float when they're knocked back or hurt. 2021-12-08 17:43:27 -06:00
luisc d66f532643 Made entity field in FlyingMoveHelper final 2021-12-08 15:50:58 -06:00
luisc d37e986006 Fixed NPCs bobbing in the air when flying. 2021-12-08 15:34:41 -06:00
luisc 29db4bfe33 Fixed flying aggro range now working for larger aggro ranges 2021-12-08 06:25:28 -06:00
luisc 90eec7a57b Added GUI fields for setting flying properties of NPCs. Updated en_lang file to add GUI texts. 2021-12-08 05:26:32 -06:00
luisc 94c7df410b Added fly gravity for NPCs, configurable with npc.setFlyGravity(gravity) and npc.getFlyGravity() 2021-12-08 04:50:23 -06:00
luisc c2564de470 NPCs properly stay floating when not navigating and in the air. 2021-12-08 04:41:41 -06:00
luisc 2147bd00d0 Pathing classes for NPC flying added. NPCs can now follow tactical variants while flying, and their pathing is a LOT better. 2021-12-08 04:00:28 -06:00
luisc 922708bf97 Changed npc field in ScriptNpc to EntityNPCInterface 2021-12-07 23:52:57 -06:00
luisc 43b3241801 Implemented path navigator and move helper for flying NPCs (npc.getNavigator() and npc.getMoveHelper() used to return the default navigator and move helper, added override function).
Improved Flying AI getting stuck when trying to get over a block towards the enemy.
2021-12-07 03:57:57 -06:00
luisc 12333de3a1 knockback() function for ScriptEntity now *only* knocks the entity back instead of hitting it.
Flying NPC's get knocked back properly, and their vertical speed has been increased.

Flying NPC's vertical flying speed can be changed by npc.setFlySpeed(double speed) from ScriptNpc.
2021-12-06 00:10:10 -06:00
luisc 3cd1410c19 Added new ScriptDBCPlayer class for manipulating Dragon Block C attributes.
Flying NPCs no longer chase you down if you're dead, or if they're dead.
2021-12-05 15:04:03 -06:00
luisc 3c1bc30e44 Floor values are set for max health, combat regen, health regen, melee damage, and projectile damage when changing them now. 2021-12-04 12:46:53 -06:00
luisc cd5b4c0633 Removed shadow when rendering an NPC that shouldn't be visible to a specific player after using setVisibleTo(). 2021-12-03 21:54:13 -06:00
luisc f14bc107d3 Double clicking events in the hook list will now paste them into your code. More scripting functions added for NPCs. 2021-12-03 21:13:56 -06:00
luisc 547f5ab82d Container event spam when no container is open fixed. Fixed scripted player and forge events not launching after merging ScriptContainer and EventScriptContainer. 2021-12-03 18:17:52 -06:00
luisc 23686dc3b8 Enabled fly button in movement, and extended max values for several NPC attributes, converting some to floats and doubles.
NPCs fly with speed based on their movement speed now.
2021-12-03 00:49:10 -06:00
luisc 44d4e74279 Enabled fly button in movement, and set max value for fields as Integer.MAX_VALUE for various fields. 2021-12-01 18:46:48 -06:00
luisc 17eb612fb8 Fixed NPC Script GUI error not saving/accessing scripts correctly. 2021-12-01 17:42:48 -06:00
luisc 72869e6a78 Consolidated EventScriptContainer and ScriptContainer into a single ScriptContainer class. NPCs are now able to fly when ai.movementType == 1. 2021-12-01 15:31:05 -06:00
KAMKEEL e8dd3e7ddc V 1.3.2
This is just a small change to the way the
pedestal works.
2021-11-29 23:15:42 -05:00
KAMKEEL 3dd8a60702 Version Update 2021-11-29 22:28:54 -05:00
KAMKEEL 71c81bce27 Merge branch 'dev' 2021-11-29 22:26:48 -05:00
Kamron Vaswani f39ed1fd37 Merge pull request #15 from c0508383/master
Critical fix to NBT loading when loading entities into chunks from a …
2021-11-29 22:26:22 -05:00
luisc f3ebf86b1e Critical fix to NBT loading when loading entities into chunks from a different version. 2021-11-29 21:21:49 -06:00
KAMKEEL f64399e40d Create Scripting_Documentation.pdf 2021-11-28 23:48:16 -05:00
KAMKEEL d79ec52994 Update Version 2021-11-26 04:37:33 -05:00
KAMKEEL 3069488c54 Merge branch 'dev' 2021-11-26 04:35:09 -05:00
KAMKEEL 24790b7952 Add Disabling All Damage
Cleaned Up some Lang Code
Added Disabling All Damage to Stats
Moved Disable Damage from Resistances to Stats
Added Disable Damage Message
2021-11-26 04:34:47 -05:00
Kamron Vaswani edabe3890f Merge pull request #13 from c0508383/master
Scripting Update Approved
2021-11-26 04:06:37 -05:00
luisc ecbfd7dab0 Fixed some console spam caused by a NullPointerException when checking scriptVisibleToPlayer(player) in ModelMPM 2021-11-23 15:08:35 -06:00
luisc d24422c3a1 Added setVisibleTo(player,visible) and isVisibleTo(player) to ScriptNpc 2021-11-22 23:34:02 -06:00
luisc 8a7f40189e Fixed redundant function calls for saving player data in NoppesUtilServer when using isGUIOpen(). Added getServerTime() to NpcAPI. 2021-11-22 02:33:28 -06:00
luisc 77c2897109 Added getAllServerPlayers, createItem & createEntityParticle to NPC API. Added getDimensionID() to ScriptWorld. 2021-11-22 01:10:27 -06:00
luisc d5c13ae65f Fixed scripted particle texture replacing in-world vanilla particle effects while alive. 2021-11-20 13:12:21 -06:00
luisc d2fe832508 Removed playerLevel parameter from PlayerData 2021-11-18 01:16:11 -06:00
luisc 03e4400b2e Small custom particle null pointer error fix 2021-11-18 01:13:42 -06:00
luisc 0d807b36d9 Added isGUIOpen() function, and setPosition function with a dimensionId parameter to ScriptPlayer. 2021-11-16 10:41:04 -06:00
luisc 27b88c1fce Player key events now detect key presses as well, not just releases. 2021-11-13 13:32:33 -06:00
luisc 40b39d3b20 Player key and mouse scripts now execute even when the player has a GUI open. 2021-11-13 12:52:21 -06:00
luisc 70f1ff2613 Added API to NPC script engine. 2021-11-10 02:21:03 -06:00
luisc 6b2a9d92b1 Added hasCollided() function to ScriptEntity. 2021-10-28 16:54:41 -05:00
luisc 2ffa9bfcfa Added setImmune() function to ScriptEntity. 2021-10-28 16:46:09 -05:00
luisc 27dce4a90a Small parameter adjustment to ScriptLivingBase.hurt() 2021-10-25 01:07:31 -05:00
luisc 1478841098 Added hurt functions to ScriptLivingBase 2021-10-25 00:58:03 -05:00
luisc 6fcf566ef7 Made setRotation work for players, with yaw and pitch parameters. 2021-10-24 23:33:22 -05:00
luisc 18aa2d099f Added updatePlayerInventory to ScriptPlayer 2021-10-24 01:53:20 -05:00
luisc b068c76fc8 Fixed some forge events not working from being registered on the wrong event bus. 2021-10-23 02:43:28 -05:00
luisc a29058d696 Fixed timers on the server-side. 2021-10-22 02:22:45 -05:00
luisc d1c4adf371 ScriptEntity instances are now properly retrieved in event scripts 2021-10-21 22:14:12 -05:00
luisc 4de969f6c9 Implemented scripted timers for players and NPCs. 2021-10-20 23:04:52 -05:00
luisc a993c8feff Fixed forge scripts on the server side. getIEntity() now correctly returns an IPlayer when given a player as a parameter. 2021-10-20 20:27:42 -05:00
luisc 5515f5ef83 Fixed executeCommand() function for scripting API on the server-side. 2021-10-19 19:49:43 -05:00
luisc 8b710ed520 Fixed executeCommand() function for scripting API. 2021-10-19 16:59:09 -05:00
luisc b15f5221fd Added getAllNbt function to ScriptEntity. 2021-10-19 14:48:59 -05:00
luisc 40e738384f Disabled invulnerability during knockback() for ScriptEntity. 2021-10-19 03:44:41 -05:00
luisc f88cbb8b51 Server-side compatibility changes 2021-10-19 02:49:46 -05:00
luisc c8f917d8fb Merge branch 'master' into ScriptingUpdate
Undoing a previous pull request that changed too many files for the pull
request from this branch to be read easily.
2021-10-19 02:46:37 -05:00
luisc bb1da8376d Implemented 1.12 event scripting API. 2021-10-18 22:01:15 -05:00
luisc feeef71b5a Added more player events. 2021-10-18 20:50:54 -05:00
luisc 15bfbcdbd1 Added storeAsClone function. Made some fields in Script Entity, NPC, and Player public because of the refactoring. 2021-10-18 07:02:19 -05:00
luisc 72f2c3c60a Implemented global Forge events. Reorganized NPC API files. 2021-10-18 06:33:39 -05:00
luisc c5ed7497c8 Added console output and correct script halting to scripted player events. Renamed PlayerScriptContainer to EventScriptContainer. 2021-10-17 16:11:29 -05:00
luisc a9bce4a3e3 Fixed player script enabled button not working right on servers. Added more player events and a getDimension() method to ScriptPlayer. Set player scripts to be off by default. 2021-10-15 09:17:31 -05:00
KAMKEEL 2d70b0091b Fix Custom Shields and Daggers 2021-10-14 00:08:05 -04:00
luisc 047552d9e5 Made constant BlockPos calculateLogBaseTwo calculation explicit, enabled player events by default. 2021-10-12 04:20:33 -05:00
luisc 699182f4c0 Added ScriptBlock and ScriptNbt support to scripting API 2021-10-12 03:23:56 -05:00
luisc 6752f8baec Implemented several more events for players, including a click event, key event, fall event, and the basic entity living hurt, killed, and kills events, among others. 2021-10-12 02:57:32 -05:00
luisc 6c8c7671b8 Implemented KeyPressed event. 2021-10-11 07:16:10 -05:00
luisc 1ee14920ff Scripted player tick events are functional, GUI for player events is complete. Global player events run as they should now, just need to start implementing more of them. 2021-10-11 06:49:30 -05:00
luisc 6aa98aecf3 Work on Player Event Script GUIs 2021-10-02 08:47:13 -05:00
luisc 44bd1692d1 GUI's properly implemented, script data still needs work. 2021-10-01 01:17:12 -05:00
luisc 95d2814651 Backported GUI features and necessary classes from 1.12. 2021-09-30 21:44:30 -05:00
luisc 8b6e84a8d4 Removed many unnecessary/redundant backported files. Focused only on classes that make events work. 2021-09-30 01:48:54 -05:00
luisc 5a1c4757cf Went down huge rabbit hole to attempt adding scripted events for players. Chock full of errors, trying to backport classes from the 1.12 version. 2021-09-30 00:56:49 -05:00
KAMKEEL 69877e8edf 1.2.2
Bow Fix
2021-09-24 17:00:41 -04:00
KAMKEEL 79339be79a Bow Change
Attempting to Fix Custom Bows
2021-09-24 16:50:28 -04:00
luisc 58a1ccc3e7 Added new knockback function with x y and z knockback power parameters. 2021-09-23 03:02:58 -05:00
luisc a5f9ec103f GiveItem and RemoveItem methods now update the player's server-side inventory to client changes 2021-09-15 14:06:20 -05:00
luisc 4ba0460a16 Added NBT tag support to ScriptEntity, ScriptItemStack, and ScriptWorld 2021-09-15 13:24:46 -05:00
luisc 71e13a177f Removed Entity field from ScriptEntityParticle 2021-09-08 13:45:50 -05:00
luisc c39ebc4909 Added ScriptEntityParticle class to store and modify scripted particle objects in code. Added support for this calss to ScriptWorld and ScriptEntity. 2021-09-08 13:41:57 -05:00
luisc f6d9149038 Undid removing screen darken from NPC dialogues. 2021-09-06 13:40:25 -05:00
luisc 50e3ae7f83 Removed screen darken from NPC dialogues. 2021-09-06 13:37:36 -05:00
luisc b43d89f91e Removed redundant/unused imports from EntityCustomFX 2021-09-06 13:36:28 -05:00
luisc 1c2534bfc4 Removed ModelPartData parameter from EntityCustomFX. Reverted ModelPartData to its original version, no longer storing particle attributes. 2021-09-06 13:33:09 -05:00
luisc 61ad3dc849 Removed ModelPartData parameter from EntityCustomFX. Reverted ModelPartData to its original version, no longer storing particle attributes. 2021-09-06 12:47:51 -05:00
luisc 6e9c693d49 Changed entity search method for custom particles to solely use entity IDs instead of entities near the closest player. 2021-09-06 12:28:14 -05:00
luisc fbc22fdef2 Added Custom Particles for scripted entities that work on server and client sides. 2021-09-06 01:24:38 -05:00
luisc 9f4ab7f01e Added getWidth() getHeight() and getYOffset() functions to ScriptEntity 2021-09-05 23:01:25 -05:00
luisc 2a378190ae Added EntityCustomFX class, used for spawning custom particles on entities. 2021-09-05 21:53:58 -05:00
luisc 459976c54d Modified giveItem() method to give the player item(s) with all attributes of the ScriptItemStack parameter. 2021-09-05 21:48:36 -05:00
KAMKEEL a2e869ddb3 Added Some Local Cape Designs 2021-07-10 00:51:17 -04:00
KAMKEEL 1b3f9dc019 Update Version 2021-07-10 00:48:54 -04:00
KAMKEEL 3727d1af7a Added Flying Code / Corrected Hidden Parts not Saving
Added a ton of code regarding Flying doesn't work correctly. Please Uncomment them by searching for

Comment: // Fly Change

Fixed Hidden Parts not Saving
2021-07-10 00:48:03 -04:00
KAMKEEL 7e7aaa805b Allowed for NBTData of hiding body parts 2021-06-13 20:17:12 -04:00
Kamron Vaswani c05c4fdb0d Update README.md 2021-06-13 19:36:05 -04:00
KAMKEEL acd666e073 Merge branch 'dev' 2021-06-13 19:28:22 -04:00
KAMKEEL a1d467f657 Update for New Version Merge 2021-06-13 19:28:12 -04:00
KAMKEEL 3a36be0ae4 Added MarkovNameGenerator, Added Disable Body Part Feature
Two New Features >>

+ Added Markov Name Generate
+ Corrected Hide Body Parts
2021-06-13 19:26:00 -04:00
KAMKEEL f155ef2481 Fixed Staff Bug
Corrected the Staff Crash issue
2021-06-13 16:35:53 -04:00
KAMKEEL 65eeca72cf Commenting out Fly Changes for Build 2021-06-13 16:24:15 -04:00
KAMKEEL f9bdc66956 Flying Tests 2021-06-13 16:22:06 -04:00
KAMKEEL 8028dde5ae Added Minecraft Source to be adapted later
This is only for experimental purposes
2021-05-11 18:14:31 -04:00
KAMKEEL 502d8faf73 Delete d.txt 2021-05-10 18:53:58 -04:00
KAMKEEL de8f8c9a45 Added Files
Issue Report
Banner
2021-05-10 18:53:38 -04:00
Kamron Vaswani 4c8045f4df Update README.md 2021-05-10 17:42:24 -04:00
KAMKEEL efa3f0f263 Merge branch 'master' of https://github.com/KAMKEEL/CustomNPC-Plus 2021-05-10 17:41:26 -04:00
KAMKEEL d31a4b3879 Create Url64Example.gif 2021-05-10 17:41:24 -04:00
Kamron Vaswani 44b6199062 Update README.md 2021-05-10 17:03:24 -04:00
KAMKEEL 7d4949b07a Merge branch 'master' of https://github.com/KAMKEEL/CustomNPC-Plus 2021-05-10 17:02:09 -04:00
KAMKEEL 24fea99f72 Create guiAnimation.gif 2021-05-10 17:02:04 -04:00
Kamron Vaswani 4921b3a010 Update README.md 2021-05-10 17:00:52 -04:00
KAMKEEL 46fd50a6ae Relocate Images 2021-05-10 17:00:17 -04:00
KAMKEEL 013a9f801e Added Images 2021-05-10 16:36:52 -04:00
939 changed files with 935 additions and 2380 deletions

No files matched your search

@@ -0,0 +1,19 @@
---
name: CustomNPC+ Issue Report
about: Report an issue with the current version of CustomNPC+
title: ''
labels: Bug, Unreviewed
assignees: ''
---
**Issue description:**
**If crashed, link to crash report (use a site such as pastebin):**
**Versions:**
* Minecraft: 1.7.10
* Forge:
* CustomNPC+:
**Can it be reproduced with *just* CustomNPC+? If not, list the other mods *required* to reproduce the issue.**
+45 -28
View File
@@ -1,43 +1,60 @@
![](logo.png)
Welcome to the CustomNPC+ Repository. ## 👋 Welcome to the CustomNPC+ Repository.
![](images/logo.png)
CustomNPC+ is a [Minecraft](https://minecraft.net/) mod that allows you to add custom NPCs to your world. It is developed for creative and storytelling players who want to make their Minecraft worlds more in-depth and unique. CustomNPC+ is only a branch version of the **1.7.10** Forge version of the original (down below) and has no plans to add or update any other version. This is not an official version of CustomNPC. > CustomNPC+ is a [Minecraft](https://minecraft.net/) mod that allows you to add custom NPCs to your world. It is developed for creative and storytelling players who want to make their Minecraft worlds more in-depth and unique. CustomNPC+ is only a branch version of the **1.7.10** Forge version of the original (down below) and has no plans to add or update any other version. This is not an official version of CustomNPC.
#### Notice Link to CurseForge: [HERE](https://www.curseforge.com/minecraft/mc-mods/customnpc-plus)
### ❗ Notice
I am not the original creator of CustomNPC. The original creator is @[Noppes](https://github.com/Noppes). I have been permitted to update the 1.7.10 and post my results on GitHub. The original mod that is updated to the latest versions of Minecraft can be found on these links: [CurseForge](https://www.curseforge.com/minecraft/mc-mods/custom-npcs), [kodevelopment](http://www.kodevelopment.nl/minecraft/customnpcs) I am not the original creator of CustomNPC. The original creator is @[Noppes](https://github.com/Noppes). I have been permitted to update the 1.7.10 and post my results on GitHub. The original mod that is updated to the latest versions of Minecraft can be found on these links: [CurseForge](https://www.curseforge.com/minecraft/mc-mods/custom-npcs), [kodevelopment](http://www.kodevelopment.nl/minecraft/customnpcs)
#### First Release! V1.0 (Installation) ### 🔹 First Release! V1.0 (Installation)
This mod is an ***update*** to CustomNPC and not an add-on. Do not install CustomNPC with CustomNPC-Plus. CustomNPC-Plus does not remove any functional features from the original mod. It expands upon CustomNPC with original features and backported features from newer versions. Simply drag CustomNPC-Plus into any client/server mods folder to utilize. Please **backup** before using as this could still have unforeseen errors. Report any bugs if found, thank you and enjoy. This mod is an ***update*** to CustomNPC and not an add-on. Do not install CustomNPC with CustomNPC-Plus. CustomNPC-Plus does not remove any functional features from the original mod. It expands upon CustomNPC with original features and backported features from newer versions. Simply drag CustomNPC-Plus into any client/server mods folder to utilize. Please **backup** before using as this could still have unforeseen errors. Report any bugs if found, thank you and enjoy.
### Features: ### ❓ Features:
- [x] More Wing Types - More Wing Types
- [x] More Fin Types - More Fin Types
- [x] More Capes* - More Capes*
- [x] More Overlays - More Overlays
- [x] Added Horns - Added Horns
- [x] Added Dolphin Tail - Added Dolphin Tail
- [x] Larger Clone GUI - Larger Clone GUI
- [x] More Clone Tabs - More Clone Tabs
- [x] Increased Resolution to Additional Body Parts - Increased Resolution to Additional Body Parts
- [x] ~~Update Local Skin Textures (64x64) [WIP]~~ - ~~Update Local Skin Textures (64x64) [WIP]~~
- [x] Added (New) Local 64x64 Skin Textures - Added (New) Local 64x64 Skin Textures
- [x] 1.8 Skins (64x64) - 1.8 Skins (64x64)
- [x] Alex Model (64x64) - Alex Model (64x64)
- [x] Fix Part Rendering - Fix Part Rendering
- [x] Backported GUI Features - Backported GUI Features
- [x] Backported New Part Models - Backported New Part Models
- [ ] Custom Part Disabling [WIP] - Custom Part Disabling
- [ ] Flying NPCS [WIP] - Markov Name Generator
- Flying NPCS
- Better Script Speeds
- Scripting Additions: [Documentation](https://github.com/PewDizinho/CustomNPCPlus-Script-Documentation)
--- Please Suggest New Features! --- Please Suggest New Features!
## 🔰 Skin Model Feature:
###### **Majority of these cape designs are taken from the internet with fair-usage.* ###### **Majority of these cape designs are taken from the internet with fair-usage.*
##### ❔ Please note all *local* skins in this version of CustomNPC, must match the model selected.
<img src="images/skinAnimation.gif" width="474" height="260"/>
### Skin Model Feature: #### Scale/Puppet Reset:
##### Please note all *local* skins in this version of CustomNPC, must match the model selected. <img src="images/guiAnimation.gif" width="474" height="260"/>
<img src="skinAnimation.gif" width="474" height="260"/>
#### Url64:
<img src="images/Url64Example.gif" width="474" height="260"/>
#### Want to check out my other mods? ## 🔗 Want to check out my other mods?
[Plugin Mod](https://github.com/KAMKEEL/Plugin-Mod) is a mod designed to add more aesthetic items for RPG and storytelling. It is compatible with CustomNPC+ and has many items intended to be used and wielded by created NPCs. [Plugin Mod](https://github.com/KAMKEEL/Plugin-Mod) is a mod designed to add more aesthetic items for RPG and storytelling. It is compatible with CustomNPC+ and has many items intended to be used and wielded by created NPCs.
[![Discord Badge](https://img.shields.io/badge/CustomNPC-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/rgeWsmQaKa)
[![Discord Badge](https://img.shields.io/badge/CustomNPC+-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/pQqRTvFeJ5)
[![Download CustomNPC+](https://img.shields.io/badge/Download⠀CustomNPC⠀Plus!-0081CB?style=for-the-badge&logo=material-ui&logoColor=white)](https://www.curseforge.com/minecraft/mc-mods/customnpc-plus)
[![Download CustomNPC+](https://img.shields.io/badge/Download⠀Plugin⠀Mod!-0081CB?style=for-the-badge&logo=material-ui&logoColor=white)](https://github.com/KAMKEEL/Plugin-Mod)
Binary file not shown.
+6 -1
View File
@@ -17,7 +17,7 @@ buildscript {
apply plugin: 'forge' apply plugin: 'forge'
version = "1.1" version = "1.5.1-beta"
group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "CustomNPC-Plus" archivesBaseName = "CustomNPC-Plus"
@@ -26,6 +26,9 @@ minecraft {
runDir = "eclipse" runDir = "eclipse"
} }
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies { dependencies {
// you may put jars on which you depend on in ./libs // you may put jars on which you depend on in ./libs
// or you may define them like so.. // or you may define them like so..
@@ -61,3 +64,5 @@ processResources
exclude 'mcmod.info' exclude 'mcmod.info'
} }
} }
sourceSets {main { output.resourcesDir = output.classesDir }}
+14
View File
@@ -0,0 +1,14 @@
[0514/203945.010:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
[0514/203945.039:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
[0514/203945.047:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
[0514/205447.662:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
[0514/205458.151:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
[0514/205458.162:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
[0514/205458.186:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
[0515/004913.901:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
[0515/004914.692:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
[0515/004914.711:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
[0515/004914.724:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
[0515/011427.812:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
[0515/011427.829:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
[0515/011427.838:WARNING:dns_config_service_win.cc(668)] Failed to read DnsConfig.
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

View File
File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 8.0 MiB

After

Width:  |  Height:  |  Size: 8.0 MiB

+1 -1
View File
@@ -34,7 +34,7 @@ import cpw.mods.fml.common.network.IGuiHandler;
public class CommonProxy implements IGuiHandler { public class CommonProxy implements IGuiHandler {
public boolean newVersionAvailable = false; public boolean newVersionAvailable = false;
public int revision = 1; public int revision = 4;
public void load() { public void load() {
CustomNpcs.Channel.register(new PacketHandlerServer()); CustomNpcs.Channel.register(new PacketHandlerServer());
+10 -4
View File
@@ -43,7 +43,15 @@ import noppes.npcs.controllers.ServerCloneController;
import noppes.npcs.controllers.SpawnController; import noppes.npcs.controllers.SpawnController;
import noppes.npcs.controllers.TransportController; import noppes.npcs.controllers.TransportController;
import noppes.npcs.enchants.EnchantInterface; import noppes.npcs.enchants.EnchantInterface;
import noppes.npcs.entity.*; import noppes.npcs.entity.EntityChairMount;
import noppes.npcs.entity.EntityCustomNpc;
import noppes.npcs.entity.EntityMagicProjectile;
import noppes.npcs.entity.EntityNPCGolem;
import noppes.npcs.entity.EntityNpcCrystal;
import noppes.npcs.entity.EntityNpcDragon;
import noppes.npcs.entity.EntityNpcPony;
import noppes.npcs.entity.EntityNpcSlime;
import noppes.npcs.entity.EntityProjectile;
import noppes.npcs.entity.old.EntityNPCDwarfFemale; import noppes.npcs.entity.old.EntityNPCDwarfFemale;
import noppes.npcs.entity.old.EntityNPCDwarfMale; import noppes.npcs.entity.old.EntityNPCDwarfMale;
import noppes.npcs.entity.old.EntityNPCElfFemale; import noppes.npcs.entity.old.EntityNPCElfFemale;
@@ -63,7 +71,7 @@ import noppes.npcs.entity.old.EntityNpcNagaFemale;
import noppes.npcs.entity.old.EntityNpcNagaMale; import noppes.npcs.entity.old.EntityNpcNagaMale;
import noppes.npcs.entity.old.EntityNpcSkeleton; import noppes.npcs.entity.old.EntityNpcSkeleton;
@Mod(modid = "customnpcs", name = "CustomNpcs", version = "1.1") @Mod(modid = "customnpcs", name = "CustomNpcs", version = "1.7.10d")
public class CustomNpcs { public class CustomNpcs {
@ConfigProp(info = "Disable Chat Bubbles") @ConfigProp(info = "Disable Chat Bubbles")
@@ -203,8 +211,6 @@ public class CustomNpcs {
registerNpc(EntityNPCGolem.class, "npcGolem"); registerNpc(EntityNPCGolem.class, "npcGolem");
registerNpc(EntityCustomNpc.class, "CustomNpc"); registerNpc(EntityCustomNpc.class, "CustomNpc");
registerNewEntity(EntityChairMount.class, "CustomNpcChairMount", 64, 10, false); registerNewEntity(EntityChairMount.class, "CustomNpcChairMount", 64, 10, false);
registerNewEntity(EntityProjectile.class, "throwableitem", 64, 3, true); registerNewEntity(EntityProjectile.class, "throwableitem", 64, 3, true);
registerNewEntity(EntityMagicProjectile.class, "magicprojectile", 64, 3, true); registerNewEntity(EntityMagicProjectile.class, "magicprojectile", 64, 3, true);
+5 -26
View File
@@ -19,23 +19,19 @@ public class DataDisplay {
public String name; public String name;
public String title = ""; public String title = "";
public byte skinType = 0; //0:normal, 1:player, 2:url, 3:url64 public byte skinType = 0; //0:normal, 1:player, 2:url
public String url = ""; public String url = "";
public GameProfile playerProfile; public GameProfile playerProfile;
public String texture = "customnpcs:textures/entity/humanmale/Steve.png"; public String texture = "customnpcs:textures/entity/humanmale/Steve.png";;
public String cloakTexture = ""; public String cloakTexture = "";
public String glowTexture = ""; public String glowTexture = "";
public int visible = 0; //0:visible 1:Invisible 2:semi-invisible public int visible = 0;//0:visible 1:Invisible 2:semi-invisible
public int modelSize = 5; public int modelSize = 5;
public int showName = 0; public int showName = 0;
public int modelType = 0;
public boolean disableLivingAnimation = false; public boolean disableLivingAnimation = false;
public byte showBossBar = 0; public byte showBossBar = 0;
@@ -62,7 +58,7 @@ public class DataDisplay {
"Embrera", "Eldamore", "Faolan", "Chim", "Nasu", "Kathrine", "Ariel", "Arei", "Demytrix", "Embrera", "Eldamore", "Faolan", "Chim", "Nasu", "Kathrine", "Ariel", "Arei", "Demytrix",
"Kora", "Ava", "Larson", "Leonardo", "Wyrl", "Sakiama", "Lambton", "Kederath", "Malus", "Riplette", "Kora", "Ava", "Larson", "Leonardo", "Wyrl", "Sakiama", "Lambton", "Kederath", "Malus", "Riplette",
"Andern", "Ezall", "Lucien", "Droco", "Cray", "Tymen", "Zenix", "Entranger", "Andern", "Ezall", "Lucien", "Droco", "Cray", "Tymen", "Zenix", "Entranger",
"Saenorath", "Chris", "Christine", "Marble", "Mable", "Ross", "Rose", "Xalgan ", "Kennet", "Kamkeel" "Saenorath", "Chris", "Christine", "Marble", "Mable", "Ross", "Rose", "Xalgan ", "Kennet"
}; };
name = names[new Random().nextInt(names.length)]; name = names[new Random().nextInt(names.length)];
} }
@@ -84,7 +80,6 @@ public class DataDisplay {
} }
nbttagcompound.setInteger("Size", modelSize); nbttagcompound.setInteger("Size", modelSize);
nbttagcompound.setInteger("modelType", modelType);
nbttagcompound.setInteger("ShowName", showName); nbttagcompound.setInteger("ShowName", showName);
nbttagcompound.setInteger("NpcVisible", visible); nbttagcompound.setInteger("NpcVisible", visible);
@@ -99,8 +94,7 @@ public class DataDisplay {
title = nbttagcompound.getString("Title"); title = nbttagcompound.getString("Title");
url = nbttagcompound.getString("SkinUrl"); url = nbttagcompound.getString("SkinUrl");
int prevSkinType = skinType;
int prevSkinType = skinType;
skinType = nbttagcompound.getByte("UsingSkinUrl"); skinType = nbttagcompound.getByte("UsingSkinUrl");
this.playerProfile = null; this.playerProfile = null;
@@ -121,7 +115,6 @@ public class DataDisplay {
glowTexture = nbttagcompound.getString("GlowTexture"); glowTexture = nbttagcompound.getString("GlowTexture");
modelSize = ValueUtil.CorrectInt(nbttagcompound.getInteger("Size"), 1, 30); modelSize = ValueUtil.CorrectInt(nbttagcompound.getInteger("Size"), 1, 30);
modelType = nbttagcompound.getInteger("modelType");
showName = nbttagcompound.getInteger("ShowName"); showName = nbttagcompound.getInteger("ShowName");
visible = nbttagcompound.getInteger("NpcVisible"); visible = nbttagcompound.getInteger("NpcVisible");
@@ -159,18 +152,4 @@ public class DataDisplay {
return false; return false;
return showName == 0 || (showName == 2 && npc.isAttacking()); return showName == 0 || (showName == 2 && npc.isAttacking());
} }
public String getSkinTexture(){
return texture;
}
public void setSkinTexture(String texture){
if(this.texture.equals(texture))
return;
this.texture = texture;
npc.textureLocation = null;
skinType = 0;
npc.updateClient = true;
}
} }
+8 -2
View File
@@ -110,8 +110,14 @@ public class DataScript {
ob = ScriptController.Instance.getScriptForEntity((Entity)ob); ob = ScriptController.Instance.getScriptForEntity((Entity)ob);
script.engine.put(obs[i].toString(), ob); script.engine.put(obs[i].toString(), ob);
} }
try {
return callScript(script); return callScript(script);
}
catch(Throwable e) {
script.errored = true;
script.appandConsole(e.getMessage());
return false;
}
} }
public boolean isEnabled(){ public boolean isEnabled(){
@@ -30,11 +30,6 @@ public class ModelDataShared{
public byte headwear = 2; public byte headwear = 2;
public byte bodywear = 0;
public byte armwear = 0;
public byte legwear = 0;
public NBTTagCompound writeToNBT(){ public NBTTagCompound writeToNBT(){
NBTTagCompound compound = new NBTTagCompound(); NBTTagCompound compound = new NBTTagCompound();
@@ -49,11 +44,6 @@ public class ModelDataShared{
compound.setTag("LegParts", legParts.writeToNBT()); compound.setTag("LegParts", legParts.writeToNBT());
compound.setByte("Headwear", headwear); compound.setByte("Headwear", headwear);
compound.setByte("Bodywear", bodywear);
compound.setByte("Armwear", armwear);
compound.setByte("Legwear", legwear);
compound.setByte("Breasts", breasts); compound.setByte("Breasts", breasts);
compound.setTag("ExtraData", extra); compound.setTag("ExtraData", extra);
@@ -79,11 +69,6 @@ public class ModelDataShared{
legParts.readFromNBT(compound.getCompoundTag("LegParts")); legParts.readFromNBT(compound.getCompoundTag("LegParts"));
headwear = compound.getByte("Headwear"); headwear = compound.getByte("Headwear");
bodywear = compound.getByte("Bodywear");
armwear = compound.getByte("Armwear");
legwear = compound.getByte("Legwear");
breasts = compound.getByte("Breasts"); breasts = compound.getByte("Breasts");
extra = compound.getCompoundTag("ExtraData"); extra = compound.getCompoundTag("ExtraData");
+1 -1
View File
@@ -55,7 +55,7 @@ public class ModelPartData {
this.texture = texture; this.texture = texture;
} }
else{ else{
this.texture = "customnpcs:textures/parts/"+ texture + ".png"; this.texture = "moreplayermodels:textures/"+ texture + ".png";
playerTexture = false; playerTexture = false;
} }
} }
@@ -324,8 +324,7 @@ public class NoppesUtilServer {
Map<String,Integer> map = new HashMap<String,Integer>(); Map<String,Integer> map = new HashMap<String,Integer>();
if(type == EnumPlayerData.Players){ if(type == EnumPlayerData.Players){
File loc = PlayerDataController.instance.getSaveDir(); for(String username : PlayerDataController.instance.nameUUIDs.keySet()){
for(String username : PlayerDataController.instance.getUsernameData().keySet()){
map.put(username, 0); map.put(username, 0);
} }
} }
@@ -17,8 +17,8 @@ public class EntityAIJob extends EntityAIBase {
return npc.jobInterface.aiShouldExecute(); return npc.jobInterface.aiShouldExecute();
} }
public void startExecuting() @Override
{ public void startExecuting(){
npc.jobInterface.aiStartExecuting(); npc.jobInterface.aiStartExecuting();
} }
@@ -30,11 +30,13 @@ public class EntityAIJob extends EntityAIBase {
return npc.jobInterface.aiContinueExecute(); return npc.jobInterface.aiContinueExecute();
} }
public void updateTask() @Override
{ public void updateTask(){
npc.jobInterface.aiUpdateTask(); if(npc.jobInterface != null)
npc.jobInterface.aiUpdateTask();
} }
@Override
public void resetTask() { public void resetTask() {
if(npc.jobInterface != null) if(npc.jobInterface != null)
npc.jobInterface.resetTask(); npc.jobInterface.resetTask();
@@ -105,8 +105,19 @@ import noppes.npcs.client.gui.roles.GuiNpcFollowerSetup;
import noppes.npcs.client.gui.roles.GuiNpcItemGiver; import noppes.npcs.client.gui.roles.GuiNpcItemGiver;
import noppes.npcs.client.gui.roles.GuiNpcTraderSetup; import noppes.npcs.client.gui.roles.GuiNpcTraderSetup;
import noppes.npcs.client.gui.roles.GuiNpcTransporter; import noppes.npcs.client.gui.roles.GuiNpcTransporter;
import noppes.npcs.client.model.*; import noppes.npcs.client.model.ModelNPCGolem;
import noppes.npcs.client.renderer.*; import noppes.npcs.client.model.ModelNpcCrystal;
import noppes.npcs.client.model.ModelNpcDragon;
import noppes.npcs.client.model.ModelNpcSlime;
import noppes.npcs.client.model.ModelSkirtArmor;
import noppes.npcs.client.renderer.NpcItemRenderer;
import noppes.npcs.client.renderer.RenderCustomNpc;
import noppes.npcs.client.renderer.RenderNPCHumanMale;
import noppes.npcs.client.renderer.RenderNPCPony;
import noppes.npcs.client.renderer.RenderNpcCrystal;
import noppes.npcs.client.renderer.RenderNpcDragon;
import noppes.npcs.client.renderer.RenderNpcSlime;
import noppes.npcs.client.renderer.RenderProjectile;
import noppes.npcs.client.renderer.blocks.BlockBannerRenderer; import noppes.npcs.client.renderer.blocks.BlockBannerRenderer;
import noppes.npcs.client.renderer.blocks.BlockBarrelRenderer; import noppes.npcs.client.renderer.blocks.BlockBarrelRenderer;
import noppes.npcs.client.renderer.blocks.BlockBeamRenderer; import noppes.npcs.client.renderer.blocks.BlockBeamRenderer;
@@ -150,7 +161,14 @@ import noppes.npcs.containers.ContainerNPCTraderSetup;
import noppes.npcs.containers.ContainerNpcItemGiver; import noppes.npcs.containers.ContainerNpcItemGiver;
import noppes.npcs.containers.ContainerNpcQuestReward; import noppes.npcs.containers.ContainerNpcQuestReward;
import noppes.npcs.containers.ContainerNpcQuestTypeItem; import noppes.npcs.containers.ContainerNpcQuestTypeItem;
import noppes.npcs.entity.*; import noppes.npcs.entity.EntityCustomNpc;
import noppes.npcs.entity.EntityNPCGolem;
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.entity.EntityNpcCrystal;
import noppes.npcs.entity.EntityNpcDragon;
import noppes.npcs.entity.EntityNpcPony;
import noppes.npcs.entity.EntityNpcSlime;
import noppes.npcs.entity.EntityProjectile;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
@@ -180,10 +198,7 @@ public class ClientProxy extends CommonProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityNpcDragon.class, new RenderNpcDragon(new ModelNpcDragon(0.0F), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityNpcDragon.class, new RenderNpcDragon(new ModelNpcDragon(0.0F), 0.5F));
RenderingRegistry.registerEntityRenderingHandler(EntityNpcSlime.class, new RenderNpcSlime(new ModelNpcSlime(16), new ModelNpcSlime(0), 0.25F)); RenderingRegistry.registerEntityRenderingHandler(EntityNpcSlime.class, new RenderNpcSlime(new ModelNpcSlime(16), new ModelNpcSlime(0), 0.25F));
RenderingRegistry.registerEntityRenderingHandler(EntityProjectile.class, new RenderProjectile()); RenderingRegistry.registerEntityRenderingHandler(EntityProjectile.class, new RenderProjectile());
RenderingRegistry.registerEntityRenderingHandler(EntityCustomNpc.class, new RenderCustomNpc()); RenderingRegistry.registerEntityRenderingHandler(EntityCustomNpc.class, new RenderCustomNpc());
RenderingRegistry.registerEntityRenderingHandler(EntityNPCGolem.class, new RenderNPCHumanMale( RenderingRegistry.registerEntityRenderingHandler(EntityNPCGolem.class, new RenderNPCHumanMale(
new ModelNPCGolem(0), new ModelNPCGolem(1F), new ModelNPCGolem(0.5F))); new ModelNPCGolem(0), new ModelNPCGolem(1F), new ModelNPCGolem(0.5F)));
FMLCommonHandler.instance().bus().register(new ClientTickHandler()); FMLCommonHandler.instance().bus().register(new ClientTickHandler());
@@ -1,22 +1,10 @@
package noppes.npcs.client.controllers; package noppes.npcs.client.controllers;
import java.util.Map;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import net.minecraft.block.BlockJukebox;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.audio.SoundHandler; import net.minecraft.client.audio.SoundHandler;
import net.minecraft.client.audio.SoundManager;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemRecord;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import noppes.npcs.client.AssetsBrowser;
public class MusicController { public class MusicController {
@@ -39,7 +39,7 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData{
public GuiNpcMobSpawner(int i, int j, int k) { public GuiNpcMobSpawner(int i, int j, int k) {
super(); super();
xSize = 384; xSize = 256;
posX = i; posX = i;
posY = j; posY = j;
@@ -56,7 +56,7 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData{
if(scroll == null){ if(scroll == null){
scroll = new GuiCustomScroll(this,0); scroll = new GuiCustomScroll(this,0);
scroll.setSize(293, 188); scroll.setSize(165, 188);
} }
else else
scroll.clear(); scroll.clear();
@@ -64,7 +64,7 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData{
scroll.guiTop = guiTop + 26; scroll.guiTop = guiTop + 26;
addScroll(scroll); addScroll(scroll);
addTextField(new GuiNpcTextField(1, this, fontRendererObj, guiLeft + 4, guiTop + 4, 293, 20, search)); addTextField(new GuiNpcTextField(1, this, fontRendererObj, guiLeft + 4, guiTop + 4, 165, 20, search));
GuiMenuTopButton button; GuiMenuTopButton button;
addTopButton(button = new GuiMenuTopButton(3,guiLeft + 4, guiTop - 17, "spawner.clones")); addTopButton(button = new GuiMenuTopButton(3,guiLeft + 4, guiTop - 17, "spawner.clones"));
@@ -74,38 +74,28 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData{
addTopButton(button = new GuiMenuTopButton(5, button, "gui.server")); addTopButton(button = new GuiMenuTopButton(5, button, "gui.server"));
button.active = showingClones == 2; button.active = showingClones == 2;
addButton(new GuiNpcButton(1, guiLeft + 298, guiTop + 6, 82, 20, "item.monsterPlacer.name")); addButton(new GuiNpcButton(1, guiLeft + 170, guiTop + 6, 82, 20, "item.monsterPlacer.name"));
addButton(new GuiNpcButton(2, guiLeft + 298, guiTop + 100, 82, 20, "spawner.mobspawner")); addButton(new GuiNpcButton(2, guiLeft + 170, guiTop + 100, 82, 20, "spawner.mobspawner"));
if(showingClones == 0 || showingClones == 2){ if(showingClones == 0 || showingClones == 2){
addSideButton(new GuiMenuSideButton(21,guiLeft - 69, this.guiTop + 2, 70,22, "Tab 1"));
addSideButton(new GuiMenuSideButton(22,guiLeft - 69, this.guiTop + 23, 70,22, "Tab 2"));
addSideButton(new GuiMenuSideButton(23,guiLeft - 69, this.guiTop + 44, 70,22, "Tab 3"));
addSideButton(new GuiMenuSideButton(24,guiLeft - 69, this.guiTop + 65, 70,22, "Tab 4"));
addSideButton(new GuiMenuSideButton(25,guiLeft - 69, this.guiTop + 86, 70,22, "Tab 5"));
addSideButton(new GuiMenuSideButton(26,guiLeft - 69, this.guiTop + 107, 70,22, "Tab 6"));
addSideButton(new GuiMenuSideButton(27,guiLeft - 69, this.guiTop + 128, 70,22, "Tab 7"));
addSideButton(new GuiMenuSideButton(28,guiLeft - 69, this.guiTop + 149, 70,22, "Tab 8"));
addSideButton(new GuiMenuSideButton(29,guiLeft - 69, this.guiTop + 170, 70,22, "Tab 9"));
addSideButton(new GuiMenuSideButton(21,guiLeft - 90, this.guiTop + 2, 90,22, "1")); addButton(new GuiNpcButton(6, guiLeft + 170, guiTop + 30, 82, 20, "gui.remove"));
addSideButton(new GuiMenuSideButton(22,guiLeft - 90, this.guiTop + 23, 90,22, "2"));
addSideButton(new GuiMenuSideButton(23,guiLeft - 90, this.guiTop + 44, 90,22, "3"));
addSideButton(new GuiMenuSideButton(24,guiLeft - 90, this.guiTop + 65, 90,22, "4"));
addSideButton(new GuiMenuSideButton(25,guiLeft - 90, this.guiTop + 86, 90,22, "5"));
addSideButton(new GuiMenuSideButton(26,guiLeft - 90, this.guiTop + 107, 45,22, "6"));
addSideButton(new GuiMenuSideButton(27,guiLeft - 45, this.guiTop + 107, 45,22, "7"));
addSideButton(new GuiMenuSideButton(28,guiLeft - 90, this.guiTop + 128, 45,22, "8"));
addSideButton(new GuiMenuSideButton(29,guiLeft - 45, this.guiTop + 128, 45,22, "9"));
addSideButton(new GuiMenuSideButton(30,guiLeft - 90, this.guiTop + 149, 45,22, "10"));
addSideButton(new GuiMenuSideButton(31,guiLeft - 45, this.guiTop + 149, 45,22, "11"));
addSideButton(new GuiMenuSideButton(32,guiLeft - 90, this.guiTop + 170, 45,22, "12"));
addSideButton(new GuiMenuSideButton(33,guiLeft - 45, this.guiTop + 170, 45,22, "13"));
addSideButton(new GuiMenuSideButton(34,guiLeft - 90, this.guiTop + 191, 45,22, "14"));
addSideButton(new GuiMenuSideButton(35,guiLeft - 45, this.guiTop + 191, 45,22, "15"));
addButton(new GuiNpcButton(6, guiLeft + 298, guiTop + 190, 82, 20, "gui.remove"));
getSideButton(20 + activeTab).active = true; getSideButton(20 + activeTab).active = true;
showClones(); showClones();
} }
else{ else
showEntities(); showEntities();
}
} }
private void showEntities() { private void showEntities() {
@@ -129,6 +119,7 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData{
Client.sendData(EnumPacketServer.CloneList, activeTab); Client.sendData(EnumPacketServer.CloneList, activeTab);
return; return;
} }
ArrayList<String> list = new ArrayList<String>(); ArrayList<String> list = new ArrayList<String>();
this.list = ClientCloneController.Instance.getClones(activeTab); this.list = ClientCloneController.Instance.getClones(activeTab);
scroll.setList(getSearchList()); scroll.setList(getSearchList());
@@ -44,7 +44,7 @@ public class GuiNpcMobSpawnerAdd extends GuiNPCInterface implements GuiYesNoCall
addLabel(new GuiNpcLabel(1, "Tab", guiLeft + 10, guiTop + 50)); addLabel(new GuiNpcLabel(1, "Tab", guiLeft + 10, guiTop + 50));
addButton(new GuiNpcButton(2, guiLeft + 40, guiTop + 45, 20, 20, new String[]{"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"}, tab - 1)); addButton(new GuiNpcButton(2, guiLeft + 40, guiTop + 45, 20, 20, new String[]{"1","2","3","4","5","6","7","8","9"}, tab - 1));
addButton(new GuiNpcButton(3, guiLeft + 4, guiTop + 95, new String[]{"Client side", "Server side"}, serverSide?1:0)); addButton(new GuiNpcButton(3, guiLeft + 4, guiTop + 95, new String[]{"Client side", "Server side"}, serverSide?1:0));
@@ -82,21 +82,15 @@ public class GuiNpcMobSpawnerMounter extends GuiNPCInterface implements IGuiData
addButton(new GuiNpcButton(2, guiLeft + 170, guiTop + 50, 82, 20, "spawner.mountplayer")); addButton(new GuiNpcButton(2, guiLeft + 170, guiTop + 50, 82, 20, "spawner.mountplayer"));
if(showingClones == 0 || showingClones == 2){ if(showingClones == 0 || showingClones == 2){
addSideButton(new GuiMenuSideButton(21,guiLeft - 90, this.guiTop + 2, 90,22, "1")); addSideButton(new GuiMenuSideButton(21,guiLeft - 69, this.guiTop + 2, 70,22, "Tab 1"));
addSideButton(new GuiMenuSideButton(22,guiLeft - 90, this.guiTop + 23, 90,22, "2")); addSideButton(new GuiMenuSideButton(22,guiLeft - 69, this.guiTop + 23, 70,22, "Tab 2"));
addSideButton(new GuiMenuSideButton(23,guiLeft - 90, this.guiTop + 44, 90,22, "3")); addSideButton(new GuiMenuSideButton(23,guiLeft - 69, this.guiTop + 44, 70,22, "Tab 3"));
addSideButton(new GuiMenuSideButton(24,guiLeft - 90, this.guiTop + 65, 90,22, "4")); addSideButton(new GuiMenuSideButton(24,guiLeft - 69, this.guiTop + 65, 70,22, "Tab 4"));
addSideButton(new GuiMenuSideButton(25,guiLeft - 90, this.guiTop + 86, 90,22, "5")); addSideButton(new GuiMenuSideButton(25,guiLeft - 69, this.guiTop + 86, 70,22, "Tab 5"));
addSideButton(new GuiMenuSideButton(26,guiLeft - 45, this.guiTop + 107, 45,22, "6")); addSideButton(new GuiMenuSideButton(26,guiLeft - 69, this.guiTop + 107, 70,22, "Tab 6"));
addSideButton(new GuiMenuSideButton(27,guiLeft - 90, this.guiTop + 107, 45,22, "7")); addSideButton(new GuiMenuSideButton(27,guiLeft - 69, this.guiTop + 128, 70,22, "Tab 7"));
addSideButton(new GuiMenuSideButton(28,guiLeft - 45, this.guiTop + 128, 45,22, "8")); addSideButton(new GuiMenuSideButton(28,guiLeft - 69, this.guiTop + 149, 70,22, "Tab 8"));
addSideButton(new GuiMenuSideButton(29,guiLeft - 90, this.guiTop + 128, 45,22, "9")); addSideButton(new GuiMenuSideButton(29,guiLeft - 69, this.guiTop + 170, 70,22, "Tab 9"));
addSideButton(new GuiMenuSideButton(30,guiLeft - 45, this.guiTop + 149, 45,22, "10"));
addSideButton(new GuiMenuSideButton(31,guiLeft - 90, this.guiTop + 149, 45,22, "11"));
addSideButton(new GuiMenuSideButton(32,guiLeft - 45, this.guiTop + 170, 45,22, "12"));
addSideButton(new GuiMenuSideButton(33,guiLeft - 90, this.guiTop + 170, 45,22, "13"));
addSideButton(new GuiMenuSideButton(34,guiLeft - 45, this.guiTop + 191, 45,22, "14"));
addSideButton(new GuiMenuSideButton(35,guiLeft - 90, this.guiTop + 191, 45,22, "15"));
getSideButton(20 + activeTab).active = true; getSideButton(20 + activeTab).active = true;
showClones(); showClones();
@@ -60,21 +60,15 @@ public class GuiNpcMobSpawnerSelector extends SubGuiInterface implements IGuiDat
addButton(new GuiNpcButton(0, guiLeft + 171, guiTop + 80, 80, 20, "gui.done")); addButton(new GuiNpcButton(0, guiLeft + 171, guiTop + 80, 80, 20, "gui.done"));
addButton(new GuiNpcButton(1, guiLeft + 171, guiTop + 103, 80, 20, "gui.cancel")); addButton(new GuiNpcButton(1, guiLeft + 171, guiTop + 103, 80, 20, "gui.cancel"));
addSideButton(new GuiMenuSideButton(21,guiLeft - 90, this.guiTop + 2, 90,22, "1")); addSideButton(new GuiMenuSideButton(21,guiLeft - 69, this.guiTop + 2, 70,22, "Tab 1"));
addSideButton(new GuiMenuSideButton(22,guiLeft - 90, this.guiTop + 23, 90,22, "2")); addSideButton(new GuiMenuSideButton(22,guiLeft - 69, this.guiTop + 23, 70,22, "Tab 2"));
addSideButton(new GuiMenuSideButton(23,guiLeft - 90, this.guiTop + 44, 90,22, "3")); addSideButton(new GuiMenuSideButton(23,guiLeft - 69, this.guiTop + 44, 70,22, "Tab 3"));
addSideButton(new GuiMenuSideButton(24,guiLeft - 90, this.guiTop + 65, 90,22, "4")); addSideButton(new GuiMenuSideButton(24,guiLeft - 69, this.guiTop + 65, 70,22, "Tab 4"));
addSideButton(new GuiMenuSideButton(25,guiLeft - 90, this.guiTop + 86, 90,22, "5")); addSideButton(new GuiMenuSideButton(25,guiLeft - 69, this.guiTop + 86, 70,22, "Tab 5"));
addSideButton(new GuiMenuSideButton(26,guiLeft - 45, this.guiTop + 107, 45,22, "6")); addSideButton(new GuiMenuSideButton(26,guiLeft - 69, this.guiTop + 107, 70,22, "Tab 6"));
addSideButton(new GuiMenuSideButton(27,guiLeft - 90, this.guiTop + 107, 45,22, "7")); addSideButton(new GuiMenuSideButton(27,guiLeft - 69, this.guiTop + 128, 70,22, "Tab 7"));
addSideButton(new GuiMenuSideButton(28,guiLeft - 45, this.guiTop + 128, 45,22, "8")); addSideButton(new GuiMenuSideButton(28,guiLeft - 69, this.guiTop + 149, 70,22, "Tab 8"));
addSideButton(new GuiMenuSideButton(29,guiLeft - 90, this.guiTop + 128, 45,22, "9")); addSideButton(new GuiMenuSideButton(29,guiLeft - 69, this.guiTop + 170, 70,22, "Tab 9"));
addSideButton(new GuiMenuSideButton(30,guiLeft - 45, this.guiTop + 149, 45,22, "10"));
addSideButton(new GuiMenuSideButton(31,guiLeft - 90, this.guiTop + 149, 45,22, "11"));
addSideButton(new GuiMenuSideButton(32,guiLeft - 45, this.guiTop + 170, 45,22, "12"));
addSideButton(new GuiMenuSideButton(33,guiLeft - 90, this.guiTop + 170, 45,22, "13"));
addSideButton(new GuiMenuSideButton(34,guiLeft - 45, this.guiTop + 191, 45,22, "14"));
addSideButton(new GuiMenuSideButton(35,guiLeft - 90, this.guiTop + 191, 45,22, "15"));
getSideButton(20 + activeTab).active = true; getSideButton(20 + activeTab).active = true;
showClones(); showClones();
@@ -56,7 +56,7 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
addLabel(new GuiNpcLabel(4,"display.texture", guiLeft + 5, y + 5)); addLabel(new GuiNpcLabel(4,"display.texture", guiLeft + 5, y + 5));
addTextField(new GuiNpcTextField(3,this, fontRendererObj, guiLeft + 80, y, 200, 20, display.skinType == 0?display.texture:display.url)); addTextField(new GuiNpcTextField(3,this, fontRendererObj, guiLeft + 80, y, 200, 20, display.skinType == 0?display.texture:display.url));
this.addButton(new GuiNpcButton(3, guiLeft + 325, y, 38, 20, "mco.template.button.select")); this.addButton(new GuiNpcButton(3, guiLeft + 325, y, 38, 20, "mco.template.button.select"));
this.addButton(new GuiNpcButton(2, guiLeft + 283, y, 40, 20, new String[]{"display.texture","display.player", "display.url", "display.urlSix"},display.skinType)); this.addButton(new GuiNpcButton(2, guiLeft + 283, y, 40, 20, new String[]{"display.texture","display.player", "display.url"},display.skinType));
getButton(3).setEnabled(display.skinType == 0); getButton(3).setEnabled(display.skinType == 0);
if(display.skinType == 1 && display.playerProfile != null) if(display.skinType == 1 && display.playerProfile != null)
getTextField(3).setText(display.playerProfile.getName()); getTextField(3).setText(display.playerProfile.getName());
@@ -73,9 +73,9 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
y+=23; y+=23;
addLabel(new GuiNpcLabel(5,"display.livingAnimation", guiLeft + 5, y + 5)); addLabel(new GuiNpcLabel(5,"display.livingAnimation", guiLeft + 5, y + 5));
this.addButton(new GuiNpcButton(5, guiLeft + 120, y, 50, 20, new String[]{"gui.yes","gui.no"}, display.disableLivingAnimation?1:0)); this.addButton(new GuiNpcButton(5, guiLeft + 120, y, 50, 20, new String[]{"gui.yes","gui.no"},display.disableLivingAnimation?1:0));
y+=23; y+=23;
addLabel(new GuiNpcLabel(7,"display.visible", guiLeft + 5, y + 5)); addLabel(new GuiNpcLabel(7,"display.visible", guiLeft + 5, y + 5));
this.addButton(new GuiNpcButton(7, guiLeft + 120, y, 50, 20, new String[]{"gui.yes","gui.no","gui.partly"}, display.visible)); this.addButton(new GuiNpcButton(7, guiLeft + 120, y, 50, 20, new String[]{"gui.yes","gui.no","gui.partly"}, display.visible));
@@ -83,7 +83,8 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
addLabel(new GuiNpcLabel(10,"display.bossbar", guiLeft + 5, y + 5)); addLabel(new GuiNpcLabel(10,"display.bossbar", guiLeft + 5, y + 5));
this.addButton(new GuiNpcButton(10, guiLeft + 120, y, 110, 20, new String[]{"display.hide","display.show","display.showAttacking"}, display.showBossBar)); this.addButton(new GuiNpcButton(10, guiLeft + 120, y, 110, 20, new String[]{"display.hide","display.show","display.showAttacking"}, display.showBossBar));
} //addExtra(new GuiHoverText(0, "testing", guiLeft, guiTop));
}
@Override @Override
public void unFocused(GuiNpcTextField textfield){ public void unFocused(GuiNpcTextField textfield){
@@ -97,10 +98,8 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
display.modelSize = textfield.getInteger(); display.modelSize = textfield.getInteger();
} }
else if(textfield.id == 3){ else if(textfield.id == 3){
// SKIN CHANGE if(display.skinType == 2)
if(display.skinType == 2 || display.skinType == 3){
display.url = textfield.getText(); display.url = textfield.getText();
}
else if(display.skinType == 1){ else if(display.skinType == 1){
if(!textfield.isEmpty()){ if(!textfield.isEmpty()){
display.playerProfile = new GameProfile(null, textfield.getText()); display.playerProfile = new GameProfile(null, textfield.getText());
@@ -134,11 +133,7 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
} }
if(button.id == 2){ if(button.id == 2){
display.skinType = (byte) button.getValue(); display.skinType = (byte) button.getValue();
// System.out.println("Skin Type set to:" + display.skinType); display.url = "";
// SKIN CHANGE
if (display.skinType != 3){
display.url = "";
}
display.playerProfile = null; display.playerProfile = null;
initGui(); initGui();
} }
@@ -151,9 +146,6 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
else if(button.id == 7){ else if(button.id == 7){
display.visible = button.getValue(); display.visible = button.getValue();
} }
// else if(button.id == 300){
// display.squareTexture = (byte)button.getValue();
// }
else if(button.id == 8){ else if(button.id == 8){
NoppesUtil.openGUI(player, new GuiNpcTextureCloaks(npc, this)); NoppesUtil.openGUI(player, new GuiNpcTextureCloaks(npc, this));
} }
@@ -33,7 +33,6 @@ import noppes.npcs.controllers.PixelmonHelper;
import noppes.npcs.entity.EntityCustomNpc; import noppes.npcs.entity.EntityCustomNpc;
import noppes.npcs.entity.EntityFakeLiving; import noppes.npcs.entity.EntityFakeLiving;
import noppes.npcs.entity.EntityNPCInterface; import noppes.npcs.entity.EntityNPCInterface;
import org.lwjgl.Sys;
public class GuiCreationScreen extends GuiModelInterface implements ICustomScrollListener{ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrollListener{
@@ -111,9 +110,6 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol
addButton(new GuiNpcButton(7, guiLeft + 50, y += 22, 50, 20, "selectServer.edit")); addButton(new GuiNpcButton(7, guiLeft + 50, y += 22, 50, 20, "selectServer.edit"));
addLabel(new GuiNpcLabel(4, "Legs", guiLeft, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(4, "Legs", guiLeft, y + 5, 0xFFFFFF));
addButton(new GuiNpcButton(250, guiLeft + 50, y += 22, 50, 20, new String[]{"Default","Steve64","Alex"}, this.npc.display.modelType));
addLabel(new GuiNpcLabel(250, "Model", guiLeft, y + 5, 0xFFFFFF));
addButton(new GuiNpcButton(44, guiLeft + 310, guiTop + 14, 80, 20, "Save Model")); addButton(new GuiNpcButton(44, guiLeft + 310, guiTop + 14, 80, 20, "Save Model"));
addButton(new GuiNpcButton(45, guiLeft + 310, guiTop + 36, 80, 20, "Load Model")); addButton(new GuiNpcButton(45, guiLeft + 310, guiTop + 36, 80, 20, "Load Model"));
@@ -252,7 +248,7 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol
} }
if(button.id == 1){ if(button.id == 1){
this.mc.displayGuiScreen(new GuiEntitySelection(this, playerdata, npc)); this.mc.displayGuiScreen(new GuiEntitySelection(this, playerdata,npc));
} }
if(button.id == 4){ if(button.id == 4){
@@ -267,27 +263,6 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol
if(button.id == 7){ if(button.id == 7){
this.mc.displayGuiScreen(new GuiModelLegs(this, npc)); this.mc.displayGuiScreen(new GuiModelLegs(this, npc));
} }
// New Button for Changing Models
// URL Swapper
if(button.id == 250){
if(npc.display.modelType == 0){
if (npc.display.skinType == 2){
npc.display.skinType = 3;
}
npc.display.modelType = 1;
}
else if(npc.display.modelType == 1){
npc.display.modelType = 2;
}
else {
if (npc.display.skinType == 3){
npc.display.skinType = 2;
}
npc.display.modelType = 0;
}
}
if(button.id == 8){ if(button.id == 8){
this.mc.displayGuiScreen(new GuiModelScale(this, playerdata, npc)); this.mc.displayGuiScreen(new GuiModelScale(this, playerdata, npc));
} }
@@ -46,9 +46,8 @@ public class GuiEntitySelection extends GuiNPCInterface
list.add("CustomNPC"); list.add("CustomNPC");
Collections.sort(list,String.CASE_INSENSITIVE_ORDER); Collections.sort(list,String.CASE_INSENSITIVE_ORDER);
slot = new GuiNPCStringSlot(list,this,false,18); slot = new GuiNPCStringSlot(list,this,false,18);
if(playerdata.getEntityClass() != null){ if(playerdata.getEntityClass() != null)
slot.selected = (String) EntityList.classToStringMapping.get(playerdata.getEntityClass()); slot.selected = (String) EntityList.classToStringMapping.get(playerdata.getEntityClass());
}
else{ else{
slot.selected = "CustomNPC"; slot.selected = "CustomNPC";
} }
@@ -120,7 +119,6 @@ public class GuiEntitySelection extends GuiNPCInterface
playerdata.setEntityClass(parent.data.get(slot.selected)); playerdata.setEntityClass(parent.data.get(slot.selected));
EntityLivingBase entity = playerdata.getEntity(npc); EntityLivingBase entity = playerdata.getEntity(npc);
if(entity != null){ if(entity != null){
npc.display.modelType = 0;
RendererLivingEntity render = (RendererLivingEntity) RenderManager.instance.getEntityRenderObject(entity); RendererLivingEntity render = (RendererLivingEntity) RenderManager.instance.getEntityRenderObject(entity);
npc.display.texture = NPCRendererHelper.getTexture(render,entity); npc.display.texture = NPCRendererHelper.getTexture(render,entity);
} }
@@ -10,7 +10,6 @@ import noppes.npcs.entity.EntityCustomNpc;
public class GuiModelArms extends GuiModelInterface{ public class GuiModelArms extends GuiModelInterface{
private final String[] arrArmwear = new String[]{"gui.no","Both","Left","Right"};
private final String[] arrParticles = new String[]{"gui.no","Both","Left","Right"}; private final String[] arrParticles = new String[]{"gui.no","Both","Left","Right"};
private GuiScreen parent; private GuiScreen parent;
@@ -25,11 +24,6 @@ public class GuiModelArms extends GuiModelInterface{
super.initGui(); super.initGui();
int y = guiTop + 20; int y = guiTop + 20;
if (npc.display.modelType == 1 || npc.display.modelType == 2) {
addButton(new GuiNpcButton(8, guiLeft + 50, y += 22, 70, 20, arrArmwear, playerdata.armwear));
addLabel(new GuiNpcLabel(8, "Armwear", guiLeft, y + 5, 0xFFFFFF));
}
ModelPartData claws = playerdata.getPartData("claws"); ModelPartData claws = playerdata.getPartData("claws");
addButton(new GuiNpcButton(0, guiLeft + 50, y += 22, 70, 20, arrParticles, claws == null?0:claws.type + 1)); addButton(new GuiNpcButton(0, guiLeft + 50, y += 22, 70, 20, arrParticles, claws == null?0:claws.type + 1));
addLabel(new GuiNpcLabel(0, "Claws", guiLeft, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(0, "Claws", guiLeft, y + 5, 0xFFFFFF));
@@ -43,9 +37,6 @@ public class GuiModelArms extends GuiModelInterface{
super.actionPerformed(btn); super.actionPerformed(btn);
GuiNpcButton button = (GuiNpcButton) btn; GuiNpcButton button = (GuiNpcButton) btn;
if(button.id == 8){
playerdata.armwear = (byte) button.getValue();
}
if(button.id == 0){ if(button.id == 0){
if(button.getValue() == 0) if(button.getValue() == 0)
playerdata.removePart("claws"); playerdata.removePart("claws");
@@ -11,13 +11,10 @@ import noppes.npcs.entity.EntityCustomNpc;
public class GuiModelBody extends GuiModelInterface{ public class GuiModelBody extends GuiModelInterface{
private GuiScreen parent; private GuiScreen parent;
private final String[] arrBodywear = new String[]{"gui.no","gui.yes"}; private final String[] arrWing = new String[]{"gui.no","Player","Type1","Type2","Type3"};
private final String[] arrWing = new String[]{"gui.no","Player","Type1","Type2","Type3","Type4","Type5","Type6","Type7","Type8","Type9",
"Type10","Type11","Type12","Type13"};
private final String[] arrBreasts = new String[]{"gui.no","Type1","Type2","Type3"}; private final String[] arrBreasts = new String[]{"gui.no","Type1","Type2","Type3"};
private final String[] arrParticles = new String[]{"gui.no","Player","Type1", "Type2", "Rainbow", "Type3", "Type4", "Type5", "Type6", "Type7"}; private final String[] arrParticles = new String[]{"gui.no","Player","Type1","Type2", "Rainbow"};
private final String[] arrfins = new String[]{"gui.no","Player","Type1","Type2","Type3","Type4","Type5","Type6"}; private final String[] arrfins = new String[]{"gui.no","Player","Type1"};
private final String[] arrskirt = new String[]{"gui.no","Player","Type1"};
public GuiModelBody(GuiScreen parent, EntityCustomNpc npc){ public GuiModelBody(GuiScreen parent, EntityCustomNpc npc){
super(npc); super(npc);
@@ -28,14 +25,7 @@ public class GuiModelBody extends GuiModelInterface{
@Override @Override
public void initGui() { public void initGui() {
super.initGui(); super.initGui();
int y = guiTop + 20; int y = guiTop + 20;
if (npc.display.modelType == 1 || npc.display.modelType == 2) {
addButton(new GuiNpcButton(8, guiLeft + 50, y += 22, 70, 20, arrBodywear, playerdata.bodywear));
addLabel(new GuiNpcLabel(8, "Bodywear", guiLeft, y + 5, 0xFFFFFF));
}
addButton(new GuiNpcButton(1, guiLeft + 50, y += 22, 70, 20, arrBreasts, playerdata.breasts)); addButton(new GuiNpcButton(1, guiLeft + 50, y += 22, 70, 20, arrBreasts, playerdata.breasts));
addLabel(new GuiNpcLabel(1, "Breasts", guiLeft, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(1, "Breasts", guiLeft, y + 5, 0xFFFFFF));
@@ -57,48 +47,15 @@ public class GuiModelBody extends GuiModelInterface{
if(fin != null) if(fin != null)
addButton(new GuiNpcButton(13, guiLeft + 122, y, 40, 20, fin.getColor())); addButton(new GuiNpcButton(13, guiLeft + 122, y, 40, 20, fin.getColor()));
ModelPartData skirt = playerdata.getPartData("skirt");
addButton(new GuiNpcButton(4, guiLeft + 50, y += 22, 70, 20, arrskirt, getSkirtindex(skirt)));
addLabel(new GuiNpcLabel(4, "Skirt", guiLeft, y + 5, 0xFFFFFF));
if(skirt != null)
addButton(new GuiNpcButton(14, guiLeft + 122, y, 40, 20, skirt.getColor()));
} }
private int getFinIndex(ModelPartData fin) { private int getFinIndex(ModelPartData fin) {
if(fin == null) if(fin == null)
return 0; return 0;
if(fin.type == 0){ return fin.playerTexture?1:2;
if(fin.playerTexture)
return 1;
if(fin.texture.contains("1"))
return 2;
if(fin.texture.contains("2"))
return 3;
if(fin.texture.contains("3"))
return 4;
if(fin.texture.contains("4"))
return 5;
if(fin.texture.contains("5"))
return 6;
if(fin.texture.contains("6"))
return 7;
}
return 0;
} }
private int getSkirtindex(ModelPartData skirt) {
if (skirt == null)
return 0;
if (skirt.type == 0) {
if (skirt.playerTexture)
return 1;
if (skirt.texture.contains("1"))
return 2;
}
return 0;
}
private int getParticleIndex(ModelPartData particles) { private int getParticleIndex(ModelPartData particles) {
if(particles == null) if(particles == null)
return 0; return 0;
@@ -109,16 +66,6 @@ public class GuiModelBody extends GuiModelInterface{
return 2; return 2;
if(particles.texture.contains("2")) if(particles.texture.contains("2"))
return 3; return 3;
if(particles.texture.contains("3"))
return 5;
if(particles.texture.contains("4"))
return 6;
if(particles.texture.contains("5"))
return 7;
if(particles.texture.contains("6"))
return 8;
if(particles.texture.contains("7"))
return 9;
} }
if(particles.type == 1){ if(particles.type == 1){
return 4; return 4;
@@ -159,62 +106,23 @@ public class GuiModelBody extends GuiModelInterface{
particles.setTexture("particle/type2", 0); particles.setTexture("particle/type2", 0);
if(value == 4) if(value == 4)
particles.setTexture("", 1); particles.setTexture("", 1);
if(value == 5)
particles.setTexture("particle/type3", 0);
if(value == 6)
particles.setTexture("particle/type4", 0);
if(value == 7)
particles.setTexture("particle/type5", 0);
if(value == 8)
particles.setTexture("particle/type6", 0);
if(value == 9)
particles.setTexture("particle/type7", 0);
} }
initGui(); initGui();
} }
if(button.id == 3){ if(button.id == 3){
int value = button.getValue(); int value = button.getValue();
if(value == 0) if(value == 0)
playerdata.removePart("fin"); playerdata.removePart("fin");
else{ else{
ModelPartData particles = playerdata.getOrCreatePart("fin"); ModelPartData particles = playerdata.getOrCreatePart("fin");
if(value == 1) if(value == 1)
particles.setTexture("", 0); particles.setTexture("", 0);
if(value == 2) if(value == 2)
particles.setTexture("fin/fin1", 0); particles.setTexture("fin/fin1", 0);
if(value == 3) }
particles.setTexture("fin/fin2", 0); initGui();
if(value == 4)
particles.setTexture("fin/fin3", 0);
if(value == 5)
particles.setTexture("fin/fin4", 0);
if(value == 6)
particles.setTexture("fin/fin5", 0);
if(value == 7)
particles.setTexture("fin/fin6", 0);
}
initGui();
} }
if(button.id == 4){
int value = button.getValue();
if(value == 0)
playerdata.removePart("skirt");
else{
ModelPartData particles = playerdata.getOrCreatePart("skirt");
if(value == 1)
particles.setTexture("", 0);
if(value == 2)
particles.setTexture("skirt/skirt1", 0);
}
initGui();
}
if(button.id == 8){
playerdata.bodywear = (byte) button.getValue();
}
if(button.id == 11){ if(button.id == 11){
this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("wings"), npc)); this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("wings"), npc));
} }
@@ -224,9 +132,6 @@ public class GuiModelBody extends GuiModelInterface{
if(button.id == 13){ if(button.id == 13){
this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("fin"), npc)); this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("fin"), npc));
} }
if(button.id == 14){
this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("skirt"), npc));
}
} }
@Override @Override
@@ -15,11 +15,10 @@ public class GuiModelHead extends GuiModelInterface{
private final String[] arrHeadwear = new String[]{"gui.no","gui.yes","Solid"}; private final String[] arrHeadwear = new String[]{"gui.no","gui.yes","Solid"};
private final String[] arrHair = new String[]{"gui.no","Player","Long","Thin","Stylish","Ponytail"}; private final String[] arrHair = new String[]{"gui.no","Player","Long","Thin","Stylish","Ponytail"};
private final String[] arrBeard = new String[]{"gui.no","Player","Standard","Viking","Long","Short"}; private final String[] arrBeard = new String[]{"gui.no","Player","Standard","Viking","Long","Short"};
private final String[] arrMohawk = new String[]{"gui.no","Type1","Type2","Type3"}; private final String[] arrMohawk = new String[]{"gui.no","Type1"};
private final String[] arrSnout = new String[]{"gui.no","Player Small","Player Medium", "Player Large", "Player Bunny", private final String[] arrSnout = new String[]{"gui.no","Player Small","Player Medium", "Player Large", "Player Bunny",
"Small1", "Medium1", "Large1", "Bunny1", "Beak1"}; "Small1", "Medium1", "Large1", "Bunny1"};
private final String[] arrEars = new String[]{"gui.no","Player","Player Bunny","Bunny","Type1"}; private final String[] arrEars = new String[]{"gui.no","Player","Player Bunny","Bunny","Type1"};
private final String[] arrHorns = new String[]{"gui.no", "Player Bull", "Player Antlers", "Player AntennasB", "Player AntennasF", "Bull", "Antlers", "AntennasB", "AntennasF" };
public GuiModelHead(GuiScreen parent, EntityCustomNpc npc){ public GuiModelHead(GuiScreen parent, EntityCustomNpc npc){
super(npc); super(npc);
@@ -29,49 +28,42 @@ public class GuiModelHead extends GuiModelInterface{
@Override @Override
public void initGui() { public void initGui() {
super.initGui(); super.initGui();
int y = guiTop + 20; int y = guiTop + 20;
addButton(new GuiNpcButton(0, guiLeft + 50, y += 22, 70, 20, arrHeadwear, playerdata.headwear)); addButton(new GuiNpcButton(0, guiLeft + 50, y += 22, 70, 20, arrHeadwear, playerdata.headwear));
addLabel(new GuiNpcLabel(0, "Headwear", guiLeft, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(0, "Headwear", guiLeft, y + 5, 0xFFFFFF));
ModelPartData hair = playerdata.getPartData("hair"); ModelPartData hair = playerdata.getPartData("hair");
addButton(new GuiNpcButton(1, guiLeft + 50, y += 22, 70, 20, arrHair, hair == null ? 0 : hair.type + 1)); addButton(new GuiNpcButton(1, guiLeft + 50, y += 22, 70, 20, arrHair, hair == null?0:hair.type + 1));
addLabel(new GuiNpcLabel(1, "Hair", guiLeft, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(1, "Hair", guiLeft, y + 5, 0xFFFFFF));
if (hair != null) if(hair != null)
addButton(new GuiNpcButton(11, guiLeft + 122, y, 40, 20, hair.getColor())); addButton(new GuiNpcButton(11, guiLeft + 122, y, 40, 20, hair.getColor()));
ModelPartData mohawk = playerdata.getPartData("mohawk"); ModelPartData mohawk = playerdata.getPartData("mohawk");
addButton(new GuiNpcButton(2, guiLeft + 50, y += 22, 70, 20, arrMohawk, mohawk == null ? 0 : mohawk.type)); addButton(new GuiNpcButton(2, guiLeft + 50, y += 22, 70, 20, arrMohawk, mohawk == null?0:mohawk.type));
addLabel(new GuiNpcLabel(2, "Mohawk", guiLeft, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(2, "Mohawk", guiLeft, y + 5, 0xFFFFFF));
if (mohawk != null) if(mohawk != null)
addButton(new GuiNpcButton(12, guiLeft + 122, y, 40, 20, mohawk.getColor())); addButton(new GuiNpcButton(12, guiLeft + 122, y, 40, 20, mohawk.getColor()));
ModelPartData beard = playerdata.getPartData("beard"); ModelPartData beard = playerdata.getPartData("beard");
addButton(new GuiNpcButton(3, guiLeft + 50, y += 22, 70, 20, arrBeard, beard == null ? 0 : beard.type + 1)); addButton(new GuiNpcButton(3, guiLeft + 50, y += 22, 70, 20, arrBeard, beard == null?0:beard.type + 1));
addLabel(new GuiNpcLabel(3, "Beard", guiLeft, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(3, "Beard", guiLeft, y + 5, 0xFFFFFF));
if (beard != null) if(beard != null)
addButton(new GuiNpcButton(13, guiLeft + 122, y, 40, 20, beard.getColor())); addButton(new GuiNpcButton(13, guiLeft + 122, y, 40, 20, beard.getColor()));
ModelPartData snout = playerdata.getPartData("snout"); ModelPartData snout = playerdata.getPartData("snout");
addButton(new GuiNpcButton(4, guiLeft + 50, y += 22, 70, 20, arrSnout, snout == null ? 0 : snout.type + (snout.playerTexture ? 1 : 5))); addButton(new GuiNpcButton(4, guiLeft + 50, y += 22, 70, 20, arrSnout, snout == null?0:snout.type + (snout.playerTexture?1:5)));
addLabel(new GuiNpcLabel(4, "Snout", guiLeft, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(4, "Snout", guiLeft, y + 5, 0xFFFFFF));
if (snout != null) if(snout != null)
addButton(new GuiNpcButton(14, guiLeft + 122, y, 40, 20, snout.getColor())); addButton(new GuiNpcButton(14, guiLeft + 122, y, 40, 20, snout.getColor()));
ModelPartData ears = playerdata.getPartData("ears"); ModelPartData ears = playerdata.getPartData("ears");
addButton(new GuiNpcButton(5, guiLeft + 50, y += 22, 70, 20, arrEars, getEars(ears))); addButton(new GuiNpcButton(5, guiLeft + 50, y += 22, 70, 20, arrEars, getEars(ears)));
addLabel(new GuiNpcLabel(5, "Ears", guiLeft, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(5, "Ears", guiLeft, y + 5, 0xFFFFFF));
if (ears != null) if(ears != null)
addButton(new GuiNpcButton(15, guiLeft + 122, y, 40, 20, ears.getColor())); addButton(new GuiNpcButton(15, guiLeft + 122, y, 40, 20, ears.getColor()));
ModelPartData horns = playerdata.getPartData("horns");
y += 22;addButton(new GuiNpcButton(6, guiLeft + 50, y, 70, 20, arrHorns, getHorns(horns)));
addLabel(new GuiNpcLabel(6, "Horns", guiLeft, y + 5, 16777215));
if (horns != null) {
addButton(new GuiNpcButton(16, guiLeft + 122, y, 40, 20, horns.getColor()));
}
} }
@@ -90,15 +82,6 @@ public class GuiModelHead extends GuiModelInterface{
return 0; return 0;
} }
private int getHorns(ModelPartData data) {
if (data == null)
return 0;
if (data.playerTexture) {
return data.type + 1;
}
return data.type + 5;
}
@Override @Override
protected void actionPerformed(GuiButton btn) { protected void actionPerformed(GuiButton btn) {
super.actionPerformed(btn); super.actionPerformed(btn);
@@ -141,28 +124,26 @@ public class GuiModelHead extends GuiModelInterface{
initGui(); initGui();
} }
if(button.id == 4){ if(button.id == 4){
if(button.getValue() == 0) if(button.getValue() == 0)
playerdata.removePart("snout"); playerdata.removePart("snout");
else if(button.getValue() < 5){ else if(button.getValue() < 5){
ModelPartData data = playerdata.getOrCreatePart("snout"); ModelPartData data = playerdata.getOrCreatePart("snout");
data.type = (byte) (button.getValue() - 1); data.type = (byte) (button.getValue() - 1);
} }
else{ else{
ModelPartData data = playerdata.getOrCreatePart("snout"); ModelPartData data = playerdata.getOrCreatePart("snout");
byte type = 0; byte type = 0;
if(button.displayString.startsWith("Medium")) if(button.displayString.startsWith("Medium"))
type = 1; type = 1;
if(button.displayString.startsWith("Large")) if(button.displayString.startsWith("Large"))
type = 2; type = 2;
if(button.displayString.startsWith("Bunny")) if(button.displayString.startsWith("Bunny"))
type = 3; type = 3;
if(button.displayString.startsWith("Beak")) data.setTexture("snout/" + button.displayString.toLowerCase(), type);
type = 4; }
data.setTexture("snout/" + button.displayString.toLowerCase(), type); initGui();
} }
initGui();
}
if(button.id == 5){ if(button.id == 5){
int value = button.getValue(); int value = button.getValue();
@@ -182,26 +163,6 @@ public class GuiModelHead extends GuiModelInterface{
initGui(); initGui();
} }
if(button.id == 6){
int value = button.getValue();
if(value == 0)
playerdata.removePart("horns");
else{
ModelPartData data = playerdata.getOrCreatePart("horns");
if(value <= 4)
data.setTexture("", value - 1);
if(value == 5)
data.setTexture("horns/bull", 0);
if(value == 6)
data.setTexture("horns/antlers", 1);
if(value == 7)
data.setTexture("horns/antennas", 2);
if(value == 8)
data.setTexture("horns/antennas", 3);
}
initGui();
}
if(button.id == 11){ if(button.id == 11){
this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("hair"), npc)); this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("hair"), npc));
} }
@@ -217,9 +178,6 @@ public class GuiModelHead extends GuiModelInterface{
if(button.id == 15){ if(button.id == 15){
this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("ears"), npc)); this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("ears"), npc));
} }
if(button.id == 16){
this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("horns"), npc));
}
} }
@Override @Override
@@ -11,9 +11,8 @@ import noppes.npcs.entity.EntityCustomNpc;
public class GuiModelLegs extends GuiModelInterface{ public class GuiModelLegs extends GuiModelInterface{
private GuiScreen parent; private GuiScreen parent;
private final String[] arrLegwear = new String[]{"gui.no","Both","Left","Right"}; private final String[] arrLegs = new String[]{"gui.no","Player","Player Naga","Spider","Horse","Naga", "Mermaid","Digitigrade"};
private final String[] arrLegs = new String[]{"gui.no","Player","Player Naga","Spider","Horse","Naga", "Mermaid", "Mermaid 2", "Digitigrade"}; private final String[] arrTail = new String[]{"gui.no","Player", "Player Dragon","Cat","Wolf","Horse","Dragon", "Squirrel"};
private final String[] arrTail = new String[]{"gui.no","Player", "Player Dragon","Cat","Wolf","Horse","Dragon", "Squirrel", "Fin", "Rodent", "Feather"};
public GuiModelLegs(GuiScreen parent, EntityCustomNpc npc){ public GuiModelLegs(GuiScreen parent, EntityCustomNpc npc){
super(npc); super(npc);
this.parent = parent; this.parent = parent;
@@ -25,12 +24,7 @@ public class GuiModelLegs extends GuiModelInterface{
super.initGui(); super.initGui();
int y = guiTop + 20; int y = guiTop + 20;
if (npc.display.modelType == 1 || npc.display.modelType == 2) { addButton(new GuiNpcButton(1, guiLeft + 50, y += 22, 70, 20, arrLegs, getNagaIndex(playerdata.legParts)));
addButton(new GuiNpcButton(8, guiLeft + 50, y += 22, 70, 20, arrLegwear, playerdata.legwear));
addLabel(new GuiNpcLabel(8, "Legwear", guiLeft, y + 5, 0xFFFFFF));
}
addButton(new GuiNpcButton(1, guiLeft + 50, y += 22, 70, 20, arrLegs, getLegIndex(playerdata.legParts)));
addLabel(new GuiNpcLabel(1, "Legs", guiLeft, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(1, "Legs", guiLeft, y + 5, 0xFFFFFF));
if(playerdata.legParts.type > 0) if(playerdata.legParts.type > 0)
addButton(new GuiNpcButton(11, guiLeft + 122, y, 40, 20, playerdata.legParts.getColor())); addButton(new GuiNpcButton(11, guiLeft + 122, y, 40, 20, playerdata.legParts.getColor()));
@@ -41,52 +35,33 @@ public class GuiModelLegs extends GuiModelInterface{
if(tail != null) if(tail != null)
addButton(new GuiNpcButton(12, guiLeft + 122, y, 40, 20, tail.getColor())); addButton(new GuiNpcButton(12, guiLeft + 122, y, 40, 20, tail.getColor()));
} }
private int getNagaIndex(ModelPartData data) {
private int getLegIndex(ModelPartData data) {
if(!data.playerTexture && data.type == 1) if(!data.playerTexture && data.type == 1)
return 5; return 5;
if(data.type == 4) if(data.type == 4)
return 6; return 6;
// if(data.type == 6)
// return 7;
if(data.type == 5) if(data.type == 5)
return 8; return 7;
return data.type + 1; return data.type + 1;
} }
// private int getLegIndex(ModelPartData data) {
// if(!data.playerTexture && data.type == 1)
// return 5;
// if(data.type == 4)
// return 6;
// if(data.type == 5)
// return 7;
// return data.type + 1;
// }
private int getTailIndex(ModelPartData data){ private int getTailIndex(ModelPartData data){
if(data == null) if(data == null)
return 0; return 0;
if(data.playerTexture && data.type == 0) if(data.playerTexture && data.type == 0)
return 1; return 1;
if(data.type == 0 && data.texture.contains("tail1")) if(data.type == 0 && data.texture.contains("tail1"))
return 3; return 3;
if(data.type == 0 && data.texture.contains("tail2")) if(data.type == 0 && data.texture.contains("tail2"))
return 4; return 4;
if(data.playerTexture && data.type == 1) if(data.playerTexture && data.type == 1)
return 2; return 2;
if(data.type == 1) if(data.type == 1)
return 6; return 6;
if(data.type == 2) if(data.type == 2)
return 5; return 5;
if(data.type == 3) if(data.type == 3)
return 7; return 7;
if(data.type == 4)
return 8;
if(data.type == 5)
return 9;
if(data.type == 6)
return 10;
return 0; return 0;
} }
@@ -96,9 +71,6 @@ public class GuiModelLegs extends GuiModelInterface{
super.actionPerformed(btn); super.actionPerformed(btn);
GuiNpcButton button = (GuiNpcButton) btn; GuiNpcButton button = (GuiNpcButton) btn;
if(button.id == 8){
playerdata.legwear = (byte) button.getValue();
}
if(button.id == 1){ if(button.id == 1){
ModelPartData data = playerdata.legParts; ModelPartData data = playerdata.legParts;
int value = button.getValue() - 1; int value = button.getValue() - 1;
@@ -112,53 +84,40 @@ public class GuiModelLegs extends GuiModelInterface{
if(value == 3) if(value == 3)
data.setTexture("legs/horse1", 3); data.setTexture("legs/horse1", 3);
if(value == 4) if(value == 4)
if (npc.display.modelType == 1 || npc.display.modelType == 2){ data.setTexture("legs/naga1", 1);
data.setTexture("legs/naga2", 1);
}
else{
data.setTexture("legs/naga1", 1);
}
if(value == 5) if(value == 5)
data.setTexture("legs/mermaid1", 4); data.setTexture("legs/mermaid1", 4);
if(value == 6) if(value == 6)
data.setTexture("legs/mermaid1", 6);
if(value == 7)
data.setTexture("", 5); data.setTexture("", 5);
initGui(); initGui();
} }
if(button.id == 2){ if(button.id == 2){
int value = button.getValue(); int value = button.getValue();
if(value == 0) if(value == 0)
playerdata.removePart("tail"); playerdata.removePart("tail");
else{ else{
ModelPartData data = playerdata.getOrCreatePart("tail"); ModelPartData data = playerdata.getOrCreatePart("tail");
if(value == 1) if(value == 1)
data.setTexture("", 0); data.setTexture("", 0);
if(value == 2) if(value == 2)
data.setTexture("", 1); data.setTexture("", 1);
if(value == 3) if(value == 3)
data.setTexture("tail/tail1", 0); data.setTexture("tail/tail1", 0);
if(value == 4) if(value == 4)
data.setTexture("tail/tail2", 0); data.setTexture("tail/tail2", 0);
if(value == 5) if(value == 5)
data.setTexture("tail/horse1", 2); data.setTexture("tail/horse1", 2);
if(value == 6) if(value == 6)
data.setTexture("tail/dragon1", 1); data.setTexture("tail/dragon1", 1);
if(value == 7) if(value == 7)
data.setTexture("tail/squirrel1", 3); data.setTexture("tail/squirrel1", 3);
if(value == 8)
data.setTexture("tail/fin1", 4);
if(value == 9)
data.setTexture("tail/rodent1", 5);
if(value == 10)
data.setTexture("tail/feather1", 6);
} }
initGui(); initGui();
} }
if(button.id == 11){ if(button.id == 11){
this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.legParts, npc)); this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.legParts, npc));
} }
@@ -15,11 +15,6 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
private GuiScreen parent; private GuiScreen parent;
private int type = 0; private int type = 0;
private GuiNpcSlider scaleWidth;
private GuiNpcSlider scaleHeight;
private GuiNpcSlider scaleDepth;
public GuiModelScale(GuiScreen parent, ModelData data, EntityCustomNpc npc){ public GuiModelScale(GuiScreen parent, ModelData data, EntityCustomNpc npc){
super(npc); super(npc);
this.parent = parent; this.parent = parent;
@@ -72,69 +67,29 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
addButton(new GuiNpcButton(3, guiLeft + 110, y , 60, 20, "Edit")); addButton(new GuiNpcButton(3, guiLeft + 110, y , 60, 20, "Edit"));
y += 24; y += 24;
} }
} }
private void drawSlider(int y, ModelPartConfig config){ private void drawSlider(int y, ModelPartConfig config){
y += 15; y += 15;
addLabel(new GuiNpcLabel(10, "Width", guiLeft - 25, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(10, "Width", guiLeft, y + 5, 0xFFFFFF));
scaleWidth = new GuiNpcSlider(this, 10, guiLeft + 50, y, config.scaleX - 0.5f); addSlider(new GuiNpcSlider(this, 10, guiLeft + 50, y, config.scaleX - 0.5f));
addSlider(scaleWidth);
addButton(new GuiNpcButton(170, guiLeft + 8, y, 40, 20, "Reset"));
y += 22; y += 22;
addLabel(new GuiNpcLabel(11, "Height", guiLeft - 25, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(11, "Height", guiLeft, y + 5, 0xFFFFFF));
scaleHeight = new GuiNpcSlider(this, 11, guiLeft + 50, y, config.scaleY - 0.5f); addSlider(new GuiNpcSlider(this, 11, guiLeft + 50, y, config.scaleY - 0.5f));
addSlider(scaleHeight);
addButton(new GuiNpcButton(171, guiLeft + 8, y, 40, 20, "Reset"));
y += 22; y += 22;
addLabel(new GuiNpcLabel(12, "Depth", guiLeft - 25, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(12, "Depth", guiLeft, y + 5, 0xFFFFFF));
scaleDepth = new GuiNpcSlider(this, 12, guiLeft + 50, y, config.scaleZ - 0.5f); addSlider(new GuiNpcSlider(this, 12, guiLeft + 50, y, config.scaleZ - 0.5f));
addSlider(scaleDepth);
addButton(new GuiNpcButton(172, guiLeft + 8, y, 40, 20, "Reset"));
} }
@Override @Override
protected void actionPerformed(GuiButton btn) { protected void actionPerformed(GuiButton btn) {
super.actionPerformed(btn); super.actionPerformed(btn);
if(btn.id < 4){ if(btn.id < 4){
type = btn.id; type = btn.id;
initGui(); initGui();
} }
else{
// Resetting Type
ModelPartConfig config = playerdata.head;
if(type == 1)
config = playerdata.body;
else if(type == 2)
config = playerdata.arms;
else if(type == 3)
config = playerdata.legs;
if(btn.id == 170){
config.scaleX = 1.0f;
scaleWidth.sliderValue = 0.5f;
int percent = (int) (50 + scaleWidth.sliderValue * 100);
scaleWidth.setString(percent + "%");
npc.updateHitbox();
}
else if(btn.id == 171){
config.scaleY = 1.0f;
scaleHeight.sliderValue = 0.5f;
int percent = (int) (50 + scaleHeight.sliderValue * 100);
scaleHeight.setString(percent + "%");
npc.updateHitbox();
}
else if(btn.id == 172){
config.scaleZ = 1.0f;
scaleDepth.sliderValue = 0.5f;
int percent = (int) (50 + scaleDepth.sliderValue * 100);
scaleDepth.setString(percent + "%");
npc.updateHitbox();
}
}
} }
@Override @Override
@@ -23,10 +23,6 @@ public class GuiNpcPuppet extends GuiModelInterface implements ISliderListener{
private JobPuppet job; private JobPuppet job;
private PartConfig part; private PartConfig part;
private GuiNpcSlider rotateX;
private GuiNpcSlider rotateY;
private GuiNpcSlider rotateZ;
public GuiNpcPuppet(GuiScreen parent, EntityCustomNpc npc){ public GuiNpcPuppet(GuiScreen parent, EntityCustomNpc npc){
super(npc); super(npc);
this.parent = parent; this.parent = parent;
@@ -122,20 +118,14 @@ public class GuiNpcPuppet extends GuiModelInterface implements ISliderListener{
addButton(new GuiNpcButton(29, guiLeft + 100, y , 80, 20, new String[]{"gui.enabled","gui.disabled"}, config.disabled?1:0)); addButton(new GuiNpcButton(29, guiLeft + 100, y , 80, 20, new String[]{"gui.enabled","gui.disabled"}, config.disabled?1:0));
y += 22; y += 22;
addLabel(new GuiNpcLabel(10, "X", guiLeft, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(10, "X", guiLeft, y + 5, 0xFFFFFF));
rotateX = new GuiNpcSlider(this, 10, guiLeft + 50, y, config.rotationX + 0.5f); addSlider(new GuiNpcSlider(this, 10, guiLeft + 50, y, config.rotationX + 0.5f));
addSlider(rotateX);
addButton(new GuiNpcButton(170, guiLeft + 8, y, 40, 20, "Reset"));
y += 22; y += 22;
addLabel(new GuiNpcLabel(11, "Y", guiLeft, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(11, "Y", guiLeft, y + 5, 0xFFFFFF));
rotateY = new GuiNpcSlider(this, 11, guiLeft + 50, y, config.rotationY + 0.5f); addSlider(new GuiNpcSlider(this, 11, guiLeft + 50, y, config.rotationY + 0.5f));
addSlider(rotateY);
addButton(new GuiNpcButton(171, guiLeft + 8, y, 40, 20, "Reset"));
y += 22; y += 22;
addLabel(new GuiNpcLabel(12, "Z", guiLeft, y + 5, 0xFFFFFF)); addLabel(new GuiNpcLabel(12, "Z", guiLeft, y + 5, 0xFFFFFF));
rotateZ = new GuiNpcSlider(this, 12, guiLeft + 50, y, config.rotationZ + 0.5f); addSlider(new GuiNpcSlider(this, 12, guiLeft + 50, y, config.rotationZ + 0.5f));
addSlider(rotateZ); }
addButton(new GuiNpcButton(172, guiLeft + 8, y, 40, 20, "Reset"));
}
@Override @Override
@@ -161,29 +151,6 @@ public class GuiNpcPuppet extends GuiModelInterface implements ISliderListener{
if(btn.id == 32){ if(btn.id == 32){
job.whileAttacking = button.getValue() == 0; job.whileAttacking = button.getValue() == 0;
} }
if(btn.id == 170 || btn.id == 171 || btn.id == 172){
if(btn.id == 170){
System.out.println(part.rotationX);
System.out.println(rotateX.sliderValue);
part.rotationX = 0.0f;
rotateX.sliderValue = 0.5f;
int percent = (int) ((rotateX.sliderValue) * 360);
rotateX.setString(percent + "%");
}
else if(btn.id == 171){
part.rotationY = 0.0f;
rotateY.sliderValue = 0.5f;
int percent = (int) ((rotateY.sliderValue) * 360);
rotateY.setString(percent + "%");
}
else{
part.rotationZ = 0.0f;
rotateZ.sliderValue = 0.5f;
int percent = (int) ((rotateZ.sliderValue) * 360);
rotateZ.setString(percent + "%");
}
npc.updateHitbox();
}
} }
@Override @Override
@@ -24,14 +24,6 @@ public class GuiNpcSlider extends GuiButton {
listener = (ISliderListener) parent; listener = (ISliderListener) parent;
} }
public GuiNpcSlider(GuiScreen parent, int id, int xPos, int yPos, int width, int height, String displayString, float sliderValue) {
super(id, xPos, yPos, width, height, NoppesStringUtils.translate(displayString));
this.id = id;
this.sliderValue = sliderValue;
if(parent instanceof ISliderListener)
listener = (ISliderListener) parent;
}
public GuiNpcSlider(GuiScreen parent, int id, int xPos, int yPos, float sliderValue) { public GuiNpcSlider(GuiScreen parent, int id, int xPos, int yPos, float sliderValue) {
this(parent, id, xPos, yPos, "", sliderValue); this(parent, id, xPos, yPos, "", sliderValue);
if(listener != null) if(listener != null)
@@ -14,7 +14,18 @@ import noppes.npcs.ModelPartData;
import noppes.npcs.client.ClientProxy; import noppes.npcs.client.ClientProxy;
import noppes.npcs.client.model.animation.AniCrawling; import noppes.npcs.client.model.animation.AniCrawling;
import noppes.npcs.client.model.animation.AniHug; import noppes.npcs.client.model.animation.AniHug;
import noppes.npcs.client.model.part.*; import noppes.npcs.client.model.part.ModelBeard;
import noppes.npcs.client.model.part.ModelBreasts;
import noppes.npcs.client.model.part.ModelClaws;
import noppes.npcs.client.model.part.ModelEars;
import noppes.npcs.client.model.part.ModelFin;
import noppes.npcs.client.model.part.ModelHair;
import noppes.npcs.client.model.part.ModelHeadwear;
import noppes.npcs.client.model.part.ModelLegs;
import noppes.npcs.client.model.part.ModelMohawk;
import noppes.npcs.client.model.part.ModelSnout;
import noppes.npcs.client.model.part.ModelTail;
import noppes.npcs.client.model.part.ModelWings;
import noppes.npcs.client.model.util.ModelPartInterface; import noppes.npcs.client.model.util.ModelPartInterface;
import noppes.npcs.client.model.util.ModelScaleRenderer; import noppes.npcs.client.model.util.ModelScaleRenderer;
import noppes.npcs.constants.EnumAnimation; import noppes.npcs.constants.EnumAnimation;
@@ -33,26 +44,12 @@ public class ModelMPM extends ModelNPCMale{
private ModelPartInterface snout; private ModelPartInterface snout;
private ModelPartInterface ears; private ModelPartInterface ears;
private ModelPartInterface fin; private ModelPartInterface fin;
private ModelPartInterface skirt;
private ModelPartInterface horns;
private ModelPartInterface clawsR; private ModelPartInterface clawsR;
private ModelPartInterface clawsL; private ModelPartInterface clawsL;
// New
public ModelRenderer bipedBodywear;
public ModelRenderer bipedRightArmwear;
public ModelRenderer bipedLeftArmwear;
public ModelRenderer bipedRightLegWear;
public ModelRenderer bipedLeftLegWear;
private ModelLegs legs; private ModelLegs legs;
private ModelScaleRenderer headwear; private ModelScaleRenderer headwear;
// private ModelScaleRenderer bodywear;
// private ModelScaleRenderer armwear;
// private ModelScaleRenderer legwear;
private ModelTail tail; private ModelTail tail;
public ModelBase entityModel; public ModelBase entityModel;
public EntityLivingBase entity; public EntityLivingBase entity;
@@ -60,214 +57,75 @@ public class ModelMPM extends ModelNPCMale{
public boolean currentlyPlayerTexture; public boolean currentlyPlayerTexture;
public boolean isArmor; public boolean isArmor;
public float alpha = 1; public float alpha = 1;
// Check Legacy Code for Old Version
// Updated False = 64x32 Skin
// Steve 64x64 and Alex 64x64
public ModelMPM(float par1, boolean arms) {
super(par1, arms);
isArmor = par1 > 0;
float par2 = 0;
this.bipedCloak = new ModelRenderer(this, 0, 0);
this.bipedCloak.setTextureSize(64,32);
this.bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, par1);
this.bipedEars = new ModelRenderer(this, 24, 0);
this.bipedEars.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, par1);
this.bipedHead = (new ModelScaleRenderer(this, 0, 0));
this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1);
this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
this.bipedHeadwear = (new ModelScaleRenderer(this, 32, 0));
this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1 + 0.5F);
this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
this.bipedBody = (new ModelScaleRenderer(this, 16, 16));
this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1);
this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
// New Extension
this.bipedBodywear = (new ModelScaleRenderer(this, 16, 32));
this.bipedBodywear.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1 + 0.5F);
this.bipedBody.addChild(this.bipedBodywear);
// this.bipedBodywear.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
// Steve 64x64 Model or Alex 64x64 Model
if (arms){
// Alex Version
this.bipedRightArm = (new ModelScaleRenderer(this, 40, 16));
this.bipedRightArm.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, par1);
// this.bipedRightArm.setRotationPoint(-5.0F, 2.5F + par2, 0.0F);
this.bipedLeftArm = new ModelScaleRenderer(this, 32, 48);
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, par1);
this.bipedLeftArm.setRotationPoint(5.0F, 2.5F + par2, 0.0F);
this.bipedRightArmwear = (new ModelScaleRenderer(this, 40, 32));
this.bipedRightArmwear.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, par1 + 0.25F);
this.bipedRightArm.addChild(this.bipedRightArmwear);
// this.bipedRightArmWear.setRotationPoint(-5.0F, 2.5F + par2, 0.0F);
this.bipedLeftArmwear = new ModelScaleRenderer(this, 48, 48);
this.bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, par1 + 0.25F);
this.bipedLeftArm.addChild(this.bipedLeftArmwear);
// this.bipedLeftArmWear.setRotationPoint(5.0F, 2.5F + par2, 0.0F);
}
else{
// Steve Version
this.bipedRightArm = (new ModelScaleRenderer(this, 40, 16));
this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1);
this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F);
this.bipedLeftArm = new ModelScaleRenderer(this, 32, 48);
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1);
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F);
this.bipedRightArmwear = (new ModelScaleRenderer(this, 40, 32));
this.bipedRightArmwear.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1 + 0.25F);
this.bipedRightArm.addChild(this.bipedRightArmwear);
//this.bipedRightArmWear.setRotationPoint(-5.0F, 2.0F + par2, 0.0F);
this.bipedLeftArmwear = new ModelScaleRenderer(this, 48, 48);
this.bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1 + 0.25F);
this.bipedLeftArm.addChild(this.bipedLeftArmwear);
//this.bipedLeftArmWear.setRotationPoint(5.0F, 2.0F + par2, 0.0F);
}
this.bipedRightLeg = (new ModelScaleRenderer(this, 0, 16));
this.bipedRightLeg.addBox(-2.08F, 0.0F, -2.0F, 4, 12, 4, par1);
this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F);
this.bipedLeftLeg = new ModelScaleRenderer(this, 16, 48);
this.bipedLeftLeg.addBox(-1.92F, 0.0F, -2.0F, 4, 12, 4, par1);
this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F);
this.bipedRightLegWear = (new ModelScaleRenderer(this, 0, 32));
this.bipedRightLegWear.addBox(-2.08F, 0.0F, -2.0F, 4, 12, 4, par1 + 0.25F);
this.bipedRightLeg.addChild(this.bipedRightLegWear);
// this.bipedRightLegWear.setRotationPoint(-1.9F, 12.0F + par2, 0.0F);
this.bipedLeftLegWear = new ModelScaleRenderer(this, 0, 48);
this.bipedLeftLegWear.addBox(-1.92F, 0.0F, -2.0F, 4, 12, 4, par1 + 0.25F);
this.bipedLeftLeg.addChild(this.bipedLeftLegWear);
headwear = new ModelHeadwear(this);
legs = new ModelLegs(this, (ModelScaleRenderer)bipedRightLeg, (ModelScaleRenderer)bipedLeftLeg, 64, 64);
// bodywear = new ModelBodywear(this);
this.bipedBody.addChild(breasts = new ModelBreasts(this, 64, 64));
if(!isArmor){
this.bipedHead.addChild(ears = new ModelEars(this));
this.bipedHead.addChild(mohawk = new ModelMohawk(this));
this.bipedHead.addChild(hair = new ModelHair(this));
this.bipedHead.addChild(beard = new ModelBeard(this));
// Completed
this.bipedHead.addChild(snout = new ModelSnout(this));
this.bipedHead.addChild(horns = new ModelHorns(this));
// Completed
tail = new ModelTail(this);
this.bipedBody.addChild(wings = new ModelWings(this));
this.bipedBody.addChild(fin = new ModelFin(this));
// Fix This
this.bipedBody.addChild(skirt = new ModelSkirt(this));
this.bipedLeftArm.addChild(clawsL = new ModelClaws(this, false));
this.bipedRightArm.addChild(clawsR = new ModelClaws(this, true));
}
}
// Steve 64x32
public ModelMPM(float par1) { public ModelMPM(float par1) {
super(par1); super(par1);
isArmor = par1 > 0; isArmor = par1 > 0;
float par2 = 0; float par2 = 0;
this.bipedCloak = new ModelRenderer(this, 0, 0);
this.bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, par1);
this.bipedEars = new ModelRenderer(this, 24, 0);
this.bipedEars.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, par1);
this.bipedHead = new ModelScaleRenderer(this, 0, 0);
this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1);
this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
this.bipedHeadwear = new ModelScaleRenderer(this, 32, 0);
this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1 + 0.5F);
this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
this.bipedBody = new ModelScaleRenderer(this, 16, 16);
this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1);
this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
this.bipedRightArm = new ModelScaleRenderer(this, 40, 16);
this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1);
this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F);
this.bipedLeftArm = new ModelScaleRenderer(this, 40, 16);
this.bipedLeftArm.mirror = true;
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1);
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F);
this.bipedRightLeg = new ModelScaleRenderer(this, 0, 16);
this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1);
this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F);
this.bipedLeftLeg = new ModelScaleRenderer(this, 0, 16);
this.bipedLeftLeg.mirror = true;
this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1);
this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F);
this.bipedCloak = new ModelRenderer(this, 0, 0); headwear = new ModelHeadwear(this);
this.bipedCloak.setTextureSize(64,32); legs = new ModelLegs(this, (ModelScaleRenderer)bipedRightLeg, (ModelScaleRenderer)bipedLeftLeg);
this.bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, par1);
this.bipedEars = new ModelRenderer(this, 24, 0); breasts = new ModelBreasts(this);
this.bipedEars.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, par1); this.bipedBody.addChild(breasts);
this.bipedHead = (new ModelScaleRenderer(this, 0, 0));
this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1);
this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
this.bipedHeadwear = (new ModelScaleRenderer(this, 32, 0));
this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1 + 0.5F);
this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
this.bipedBody = (new ModelScaleRenderer(this, 16, 16));
this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1);
this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
this.bipedRightArm = new ModelScaleRenderer(this, 40, 16);
this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1);
this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F);
this.bipedLeftArm = new ModelScaleRenderer(this, 40, 16);
this.bipedLeftArm.mirror = true;
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1);
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F);
this.bipedRightLeg = new ModelScaleRenderer(this, 0, 16);
this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1);
this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F);
this.bipedLeftLeg = new ModelScaleRenderer(this, 0, 16);
this.bipedLeftLeg.mirror = true;
this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1);
this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F);
// Body
this.bipedBodywear = (new ModelScaleRenderer(this, 0, 0));
this.bipedBody.addChild(this.bipedBodywear);
// Arms
this.bipedRightArmwear = (new ModelScaleRenderer(this, 0, 0));
this.bipedRightArm.addChild(this.bipedRightArmwear);
this.bipedLeftArmwear = new ModelScaleRenderer(this, 0, 0);
this.bipedLeftArm.addChild(this.bipedLeftArmwear);
// Legs
this.bipedRightLegWear = (new ModelScaleRenderer(this, 0, 0));
this.bipedRightLeg.addChild(this.bipedRightLegWear);
this.bipedLeftLegWear = new ModelScaleRenderer(this, 0, 0);
this.bipedLeftLeg.addChild(this.bipedLeftLegWear);
headwear = new ModelHeadwear(this, true);
legs = new ModelLegs(this, (ModelScaleRenderer)bipedRightLeg, (ModelScaleRenderer)bipedLeftLeg, 64, 32);
this.bipedBody.addChild(breasts = new ModelBreasts(this, 64, 32));
if(!isArmor){ if(!isArmor){
this.bipedHead.addChild(ears = new ModelEars(this)); ears = new ModelEars(this);
this.bipedHead.addChild(mohawk = new ModelMohawk(this)); this.bipedHead.addChild(ears);
this.bipedHead.addChild(hair = new ModelHair(this));
this.bipedHead.addChild(beard = new ModelBeard(this));
// Completed mohawk = new ModelMohawk(this);
this.bipedHead.addChild(snout = new ModelSnout(this)); this.bipedHead.addChild(mohawk);
this.bipedHead.addChild(horns = new ModelHorns(this));
hair = new ModelHair(this);
this.bipedHead.addChild(hair);
beard = new ModelBeard(this);
this.bipedHead.addChild(beard);
snout = new ModelSnout(this);
this.bipedHead.addChild(snout);
// Completed
tail = new ModelTail(this); tail = new ModelTail(this);
this.bipedBody.addChild(wings = new ModelWings(this)); wings = new ModelWings(this);
this.bipedBody.addChild(fin = new ModelFin(this)); this.bipedBody.addChild(wings);
// Fix This fin = new ModelFin(this);
this.bipedBody.addChild(skirt = new ModelSkirt(this)); this.bipedBody.addChild(fin);
this.bipedLeftArm.addChild(clawsL = new ModelClaws(this, false));
this.bipedRightArm.addChild(clawsR = new ModelClaws(this, true)); clawsL = new ModelClaws(this, false);
this.bipedLeftArm.addChild(clawsL);
clawsR = new ModelClaws(this, true);
this.bipedRightArm.addChild(clawsR);
} }
} }
@@ -283,17 +141,15 @@ public class ModelMPM extends ModelNPCMale{
ears.setData(entity.modelData, entity); ears.setData(entity.modelData, entity);
clawsL.setData(entity.modelData, entity); clawsL.setData(entity.modelData, entity);
clawsR.setData(entity.modelData, entity); clawsR.setData(entity.modelData, entity);
skirt.setData(entity.modelData, entity);
horns.setData(entity.modelData, entity);
} }
breasts.setData(entity.modelData, entity); breasts.setData(entity.modelData, entity);
legs.setData(entity); legs.setData(entity);
} }
@Override @Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7){ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7){
EntityCustomNpc npc = (EntityCustomNpc) par1Entity; EntityCustomNpc npc = (EntityCustomNpc) par1Entity;
if(entityModel != null){ if(entityModel != null){
if(!isArmor){ if(!isArmor){
@@ -312,170 +168,149 @@ public class ModelMPM extends ModelNPCMale{
} }
else{ else{
alpha = npc.isInvisible() && !npc.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer)?0.15f:1; alpha = npc.isInvisible() && !npc.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer)?0.15f:1;
setPlayerData(npc); setPlayerData(npc);
currentlyPlayerTexture = true; currentlyPlayerTexture = true;
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
if(npc.advanced.job == EnumJobType.Puppet){ if(npc.advanced.job == EnumJobType.Puppet){
JobPuppet job = (JobPuppet) npc.jobInterface; JobPuppet job = (JobPuppet) npc.jobInterface;
if(job.isActive()){ if(job.isActive()){
float pi = (float) Math.PI; float pi = (float) Math.PI;
if(!job.head.disabled){ if(!job.head.disabled){
bipedHeadwear.rotateAngleX = bipedHead.rotateAngleX = job.head.rotationX * pi; bipedHeadwear.rotateAngleX = bipedHead.rotateAngleX = job.head.rotationX * pi;
bipedHeadwear.rotateAngleY = bipedHead.rotateAngleY = job.head.rotationY * pi; bipedHeadwear.rotateAngleY = bipedHead.rotateAngleY = job.head.rotationY * pi;
bipedHeadwear.rotateAngleZ = bipedHead.rotateAngleZ = job.head.rotationZ * pi; bipedHeadwear.rotateAngleZ = bipedHead.rotateAngleZ = job.head.rotationZ * pi;
} }
if(!job.body.disabled){ if(!job.body.disabled){
bipedBody.rotateAngleX = job.body.rotationX * pi; bipedBody.rotateAngleX = job.body.rotationX * pi;
bipedBody.rotateAngleY = job.body.rotationY * pi; bipedBody.rotateAngleY = job.body.rotationY * pi;
bipedBody.rotateAngleZ = job.body.rotationZ * pi; bipedBody.rotateAngleZ = job.body.rotationZ * pi;
} }
if(!job.larm.disabled){ if(!job.larm.disabled){
bipedLeftArm.rotateAngleX = job.larm.rotationX * pi; bipedLeftArm.rotateAngleX = job.larm.rotationX * pi;
bipedLeftArm.rotateAngleY = job.larm.rotationY * pi; bipedLeftArm.rotateAngleY = job.larm.rotationY * pi;
bipedLeftArm.rotateAngleZ = job.larm.rotationZ * pi; bipedLeftArm.rotateAngleZ = job.larm.rotationZ * pi;
if(!npc.display.disableLivingAnimation){ if(!npc.display.disableLivingAnimation){
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F;
} }
} }
if(!job.rarm.disabled){ if(!job.rarm.disabled){
bipedRightArm.rotateAngleX = job.rarm.rotationX * pi; bipedRightArm.rotateAngleX = job.rarm.rotationX * pi;
bipedRightArm.rotateAngleY = job.rarm.rotationY * pi; bipedRightArm.rotateAngleY = job.rarm.rotationY * pi;
bipedRightArm.rotateAngleZ = job.rarm.rotationZ * pi; bipedRightArm.rotateAngleZ = job.rarm.rotationZ * pi;
if(!npc.display.disableLivingAnimation){ if(!npc.display.disableLivingAnimation){
this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F;
} }
} }
if(!job.rleg.disabled){ if(!job.rleg.disabled){
bipedRightLeg.rotateAngleX = job.rleg.rotationX * pi; bipedRightLeg.rotateAngleX = job.rleg.rotationX * pi;
bipedRightLeg.rotateAngleY = job.rleg.rotationY * pi; bipedRightLeg.rotateAngleY = job.rleg.rotationY * pi;
bipedRightLeg.rotateAngleZ = job.rleg.rotationZ * pi; bipedRightLeg.rotateAngleZ = job.rleg.rotationZ * pi;
} }
if(!job.lleg.disabled){ if(!job.lleg.disabled){
bipedLeftLeg.rotateAngleX = job.lleg.rotationX * pi; bipedLeftLeg.rotateAngleX = job.lleg.rotationX * pi;
bipedLeftLeg.rotateAngleY = job.lleg.rotationY * pi; bipedLeftLeg.rotateAngleY = job.lleg.rotationY * pi;
bipedLeftLeg.rotateAngleZ = job.lleg.rotationZ * pi; bipedLeftLeg.rotateAngleZ = job.lleg.rotationZ * pi;
} }
} }
} }
renderHead(npc, par7); renderHead(npc, par7);
renderArms(npc, par7,false); renderArms(npc, par7,false);
renderBody(npc, par7); renderBody(npc, par7);
renderLegs(npc, par7); renderLegs(npc, par7);
} }
} }
@Override @Override
public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity entity) public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity entity)
{ {
EntityCustomNpc npc = (EntityCustomNpc) entity; EntityCustomNpc npc = (EntityCustomNpc) entity;
isRiding = npc.isRiding(); isRiding = npc.isRiding();
if(isSneak && (npc.currentAnimation == EnumAnimation.CRAWLING || npc.currentAnimation == EnumAnimation.LYING)) if(isSneak && (npc.currentAnimation == EnumAnimation.CRAWLING || npc.currentAnimation == EnumAnimation.LYING))
isSneak = false; isSneak = false;
this.bipedBody.rotationPointX = 0;
// Body Rotations this.bipedBody.rotationPointY = 0;
this.bipedBody.rotationPointX = 0; this.bipedBody.rotationPointZ = 0;
this.bipedBody.rotationPointY = 0;
this.bipedBody.rotationPointZ = 0;
this.bipedBody.rotateAngleX = 0; this.bipedBody.rotateAngleX = 0;
this.bipedBody.rotateAngleY = 0; this.bipedBody.rotateAngleY = 0;
this.bipedBody.rotateAngleZ = 0; this.bipedBody.rotateAngleZ = 0;
this.bipedBodywear.rotationPointX = 0;
this.bipedBodywear.rotationPointY = 0;
this.bipedBodywear.rotationPointZ = 0;
this.bipedBodywear.rotateAngleX = 0;
this.bipedBodywear.rotateAngleY = 0;
this.bipedBodywear.rotateAngleZ = 0;
// Head Rotations
this.bipedHead.rotateAngleZ = 0; this.bipedHead.rotateAngleZ = 0;
this.bipedHeadwear.rotateAngleZ = 0; this.bipedHeadwear.rotateAngleZ = 0;
// Leg Rotations
this.bipedLeftLeg.rotateAngleX = 0; this.bipedLeftLeg.rotateAngleX = 0;
this.bipedLeftLeg.rotateAngleY = 0; this.bipedLeftLeg.rotateAngleY = 0;
this.bipedLeftLeg.rotateAngleZ = 0; this.bipedLeftLeg.rotateAngleZ = 0;
this.bipedRightLeg.rotateAngleX = 0; this.bipedRightLeg.rotateAngleX = 0;
this.bipedRightLeg.rotateAngleY = 0; this.bipedRightLeg.rotateAngleY = 0;
this.bipedRightLeg.rotateAngleZ = 0; this.bipedRightLeg.rotateAngleZ = 0;
// Arm Rotations
this.bipedLeftArm.rotationPointY = 2; this.bipedLeftArm.rotationPointY = 2;
this.bipedLeftArm.rotationPointZ = 0; this.bipedLeftArm.rotationPointZ = 0;
this.bipedRightArm.rotationPointY = 2; this.bipedRightArm.rotationPointY = 2;
this.bipedRightArm.rotationPointZ = 0; this.bipedRightArm.rotationPointZ = 0;
super.setRotationAngles(par1, par2, par3, par4, par5, par6, entity); super.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
if(!isArmor){ if(!isArmor){
hair.setRotationAngles(par1, par2, par3, par4, par5, par6, entity); hair.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
beard.setRotationAngles(par1, par2, par3, par4, par5, par6, entity); beard.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
wings.setRotationAngles(par1, par2, par3, par4, par5, par6, entity); wings.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
tail.setRotationAngles(par1, par2, par3, par4, par5, par6, entity); tail.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
skirt.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
} }
legs.setRotationAngles(par1, par2, par3, par4, par5, par6, entity); legs.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
if(isSleeping(entity)){ if(isSleeping(entity)){
if(bipedHead.rotateAngleX < 0){ if(bipedHead.rotateAngleX < 0){
bipedHead.rotateAngleX = 0; bipedHead.rotateAngleX = 0;
bipedHeadwear.rotateAngleX = 0; bipedHeadwear.rotateAngleX = 0;
} }
} }
else if(npc.currentAnimation == EnumAnimation.CRY) else if(npc.currentAnimation == EnumAnimation.CRY)
bipedHeadwear.rotateAngleX = bipedHead.rotateAngleX = 0.7f; bipedHeadwear.rotateAngleX = bipedHead.rotateAngleX = 0.7f;
else if(npc.currentAnimation == EnumAnimation.HUG){
AniHug.setRotationAngles(par1, par2, par3, par4, par5, par6, entity, this);
}
else if(npc.currentAnimation == EnumAnimation.CRAWLING)
AniCrawling.setRotationAngles(par1, par2, par3, par4, par5, par6, entity, this);
else if(npc.currentAnimation == EnumAnimation.WAVING){
bipedRightArm.rotateAngleX = -0.1f;
bipedRightArm.rotateAngleY = 0;
bipedRightArm.rotateAngleZ = (float) (Math.PI - 1f - Math.sin(entity.ticksExisted * 0.27f) * 0.5f );
}
else if(isSneak)
this.bipedBody.rotateAngleX = 0.5F / npc.modelData.body.scaleY;
else if(npc.currentAnimation == EnumAnimation.HUG){
AniHug.setRotationAngles(par1, par2, par3, par4, par5, par6, entity, this);
}
else if(npc.currentAnimation == EnumAnimation.CRAWLING) }
AniCrawling.setRotationAngles(par1, par2, par3, par4, par5, par6, entity, this);
else if(npc.currentAnimation == EnumAnimation.WAVING){ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4)
bipedRightArm.rotateAngleX = -0.1f; {
bipedRightArm.rotateAngleY = 0;
bipedRightArm.rotateAngleZ = (float) (Math.PI - 1f - Math.sin(entity.ticksExisted * 0.27f) * 0.5f );
}
else if(isSneak){
this.bipedBody.rotateAngleX = 0.5F / npc.modelData.body.scaleY;
}
}
public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4)
{
if(entityModel != null){ if(entityModel != null){
entityModel.setLivingAnimations(entity, par2, par3, par4); entityModel.setLivingAnimations(entity, par2, par3, par4);
} }
else{ else{
EntityCustomNpc npc = (EntityCustomNpc) par1EntityLivingBase; EntityCustomNpc npc = (EntityCustomNpc) par1EntityLivingBase;
if(!isArmor){ if(!isArmor){
ModelPartData partData = npc.modelData.getPartData("tail"); ModelPartData partData = npc.modelData.getPartData("tail");
if(partData != null) if(partData != null)
tail.setLivingAnimations(partData, par1EntityLivingBase, par2, par3, par4); tail.setLivingAnimations(partData, par1EntityLivingBase, par2, par3, par4);
} }
} }
} }
public void loadPlayerTexture(EntityCustomNpc npc){ public void loadPlayerTexture(EntityCustomNpc npc){
if(!isArmor && !currentlyPlayerTexture){ if(!isArmor && !currentlyPlayerTexture){
ClientProxy.bindTexture(npc.textureLocation); ClientProxy.bindTexture(npc.textureLocation);
currentlyPlayerTexture = true; currentlyPlayerTexture = true;
} }
} }
private void renderHead(EntityCustomNpc entity, float f) { private void renderHead(EntityCustomNpc entity, float f) {
loadPlayerTexture(entity); loadPlayerTexture(entity);
@@ -484,10 +319,10 @@ public class ModelMPM extends ModelNPCMale{
float z = 0; float z = 0;
GL11.glPushMatrix(); GL11.glPushMatrix();
if(entity.currentAnimation == EnumAnimation.DANCING){ if(entity.currentAnimation == EnumAnimation.DANCING){
float dancing = entity.ticksExisted / 4f; float dancing = entity.ticksExisted / 4f;
GL11.glTranslatef((float)Math.sin(dancing) * 0.075F, (float)Math.abs(Math.cos(dancing)) * 0.125F - 0.02F, (float)(-Math.abs(Math.cos(dancing))) * 0.075F); GL11.glTranslatef((float)Math.sin(dancing) * 0.075F, (float)Math.abs(Math.cos(dancing)) * 0.125F - 0.02F, (float)(-Math.abs(Math.cos(dancing))) * 0.075F);
} }
ModelPartConfig head = entity.modelData.head; ModelPartConfig head = entity.modelData.head;
if(bipedHeadwear.showModel && !bipedHeadwear.isHidden){ if(bipedHeadwear.showModel && !bipedHeadwear.isHidden){
if(entity.modelData.headwear == 1 || isArmor){ if(entity.modelData.headwear == 1 || isArmor){
@@ -518,34 +353,12 @@ public class ModelMPM extends ModelNPCMale{
float z = 0; float z = 0;
GL11.glPushMatrix(); GL11.glPushMatrix();
if(entity.currentAnimation == EnumAnimation.DANCING){ if(entity.currentAnimation == EnumAnimation.DANCING){
float dancing = entity.ticksExisted / 4f; float dancing = entity.ticksExisted / 4f;
GL11.glTranslatef((float)Math.sin(dancing) * 0.015F, 0.0F, 0.0F); GL11.glTranslatef((float)Math.sin(dancing) * 0.015F, 0.0F, 0.0F);
} }
ModelPartConfig body = entity.modelData.body; ModelPartConfig body = entity.modelData.body;
// if(bipedBodywear.showModel && !bipedBodywear.isHidden){
// if(entity.modelData.bodywear == 1 || isArmor){
// ((ModelScaleRenderer)this.bipedBodywear).setConfig(body,x,y,z);
// ((ModelScaleRenderer)this.bipedBodywear).render(f);
// }
//// else if(entity.modelData.bodywear == 2){
//// this.bodywear.rotateAngleX = bipedBodywear.rotateAngleX;
//// this.bodywear.rotateAngleY = bipedBodywear.rotateAngleY;
//// this.bodywear.rotateAngleZ = bipedBodywear.rotateAngleZ;
//// this.bodywear.rotationPointX = bipedBodywear.rotationPointX;
//// this.bodywear.rotationPointY = bipedBodywear.rotationPointY;
//// this.bodywear.rotationPointZ = bipedBodywear.rotationPointZ;
//// this.bodywear.setConfig(body,x,y,z);
//// this.bodywear.render(f);
//// }
// }
if(entity.modelData.bodywear == 1){
((ModelScaleRenderer)this.bipedBodywear).isHidden = false;
}
else{
((ModelScaleRenderer)this.bipedBodywear).isHidden = true;
}
((ModelScaleRenderer)this.bipedBody).setConfig(body,x,y,z); ((ModelScaleRenderer)this.bipedBody).setConfig(body,x,y,z);
((ModelScaleRenderer)this.bipedBody).render(f); ((ModelScaleRenderer)this.bipedBody).render(f);
GL11.glPopMatrix(); GL11.glPopMatrix();
@@ -561,27 +374,10 @@ public class ModelMPM extends ModelNPCMale{
GL11.glPushMatrix(); GL11.glPushMatrix();
if(entity.currentAnimation == EnumAnimation.DANCING){ if(entity.currentAnimation == EnumAnimation.DANCING){
float dancing = entity.ticksExisted / 4f; float dancing = entity.ticksExisted / 4f;
GL11.glTranslatef((float)Math.sin(dancing) * 0.025F, (float)Math.abs(Math.cos(dancing)) * 0.125F - 0.02F, 0.0F); GL11.glTranslatef((float)Math.sin(dancing) * 0.025F, (float)Math.abs(Math.cos(dancing)) * 0.125F - 0.02F, 0.0F);
} }
if(entity.modelData.armwear == 1){
this.bipedRightArmwear.isHidden = false;
this.bipedLeftArmwear.isHidden = false;
}
else if(entity.modelData.armwear == 2){
this.bipedRightArmwear.isHidden = true;
this.bipedLeftArmwear.isHidden = false;
}
else if(entity.modelData.armwear == 3){
this.bipedRightArmwear.isHidden = false;
this.bipedLeftArmwear.isHidden = true;
}
else{
this.bipedRightArmwear.isHidden = true;
this.bipedLeftArmwear.isHidden = true;
}
if(!bo){ if(!bo){
((ModelScaleRenderer)this.bipedLeftArm).setConfig(arms,-x,y,z); ((ModelScaleRenderer)this.bipedLeftArm).setConfig(arms,-x,y,z);
@@ -605,24 +401,6 @@ public class ModelMPM extends ModelNPCMale{
float z = 0; float z = 0;
GL11.glPushMatrix(); GL11.glPushMatrix();
if(entity.modelData.legwear == 1){
((ModelScaleRenderer)this.bipedRightLegWear).isHidden = false;
((ModelScaleRenderer)this.bipedLeftLegWear).isHidden = false;
}
else if(entity.modelData.legwear == 2){
((ModelScaleRenderer)this.bipedRightLegWear).isHidden = true;
((ModelScaleRenderer)this.bipedLeftLegWear).isHidden = false;
}
else if(entity.modelData.legwear == 3){
((ModelScaleRenderer)this.bipedRightLegWear).isHidden = false;
((ModelScaleRenderer)this.bipedLeftLegWear).isHidden = true;
}
else{
((ModelScaleRenderer)this.bipedRightLegWear).isHidden = true;
((ModelScaleRenderer)this.bipedLeftLegWear).isHidden = true;
}
this.legs.setConfig(legs,x,y,z); this.legs.setConfig(legs,x,y,z);
this.legs.render(f); this.legs.render(f);
if(!isArmor){ if(!isArmor){
@@ -632,22 +410,22 @@ public class ModelMPM extends ModelNPCMale{
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
@Override @Override
public ModelRenderer getRandomModelBox(Random par1Random) public ModelRenderer getRandomModelBox(Random par1Random)
{ {
int random = par1Random.nextInt(5); int random = par1Random.nextInt(5);
switch(random){ switch(random){
case 0: case 0:
return bipedRightLeg; return bipedRightLeg;
case 1: case 1:
return bipedHead; return bipedHead;
case 2: case 2:
return bipedLeftArm; return bipedLeftArm;
case 3: case 3:
return bipedRightArm; return bipedRightArm;
case 4: case 4:
return bipedLeftLeg; return bipedLeftLeg;
} }
return bipedBody; return bipedBody;
} }
} }
@@ -8,7 +8,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import noppes.npcs.CustomNpcs; import noppes.npcs.CustomNpcs;
import noppes.npcs.client.model.util.ModelScaleRenderer;
import noppes.npcs.constants.EnumAnimation; import noppes.npcs.constants.EnumAnimation;
import noppes.npcs.entity.EntityNPCInterface; import noppes.npcs.entity.EntityNPCInterface;
@@ -22,95 +21,21 @@ public class ModelNPCMale extends ModelBiped
public float animationTick; public float animationTick;
public float dancingTicks; public float dancingTicks;
public ModelNPCMale(float f) public ModelNPCMale(float f)
{ {
init(f, 0.0F); init(f, 0.0F);
} }
public ModelNPCMale(float f, boolean arms)
{
super(f, 0.0F, 64, 64);
init(f, 0.0F, arms);
}
@Override @Override
public void setLivingAnimations(EntityLivingBase par1EntityLiving, float f6, float f5, float par9){ public void setLivingAnimations(EntityLivingBase par1EntityLiving, float f6, float f5, float par9){
animationTick += par9; animationTick += par9;
dancingTicks = CustomNpcs.ticks / 3.978873F; dancingTicks = CustomNpcs.ticks / 3.978873F;
} }
// 64x64 Skin
public void init(float f, float f1, boolean arms)
{
heldItemLeft = 0;
heldItemRight = 0;
isSneak = false;
aimedBow = false;
// Changed
bipedCloak = new ModelRenderer(this, 0, 0);
bipedCloak.setTextureSize(64, 32);
bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, f);
// Same
bipedEars = new ModelRenderer(this, 24, 0);
bipedEars.setTextureSize(64, 32); // NEW LINE
bipedEars.addBox(-3F, -6F, -1F, 6, 6, 1, f);
bipedHead = new ModelRenderer(this, 0, 0);
bipedHead.addBox(-4F, -8F, -4F, 8, 8, 8, f);
bipedHead.setRotationPoint(0.0F, 0.0F + f1, 0.0F);
bipedHeadwear = new ModelRenderer(this, 32, 0);
bipedHeadwear.addBox(-4F, -8F, -4F, 8, 8, 8, f + 0.5F);
bipedHeadwear.setRotationPoint(0.0F, 0.0F + f1, 0.0F);
bipedBody = new ModelRenderer(this, 16, 16);
bipedBody.addBox(-4F, 0.0F, -2F, 8, 12, 4, f);
bipedBody.setRotationPoint(0.0F, 0.0F + f1, 0.0F);
if (arms){
// Alex Version
bipedRightArm = (new ModelScaleRenderer(this, 40, 16));
bipedRightArm.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, f);
bipedRightArm.setRotationPoint(-5.0F, 2.5F + f1, 0.0F);
bipedLeftArm = new ModelScaleRenderer(this, 32, 48);
bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, f);
bipedLeftArm.setRotationPoint(5.0F, 2.5F + f1, 0.0F);
}
else{
// Steve Version
bipedRightArm = new ModelRenderer(this, 40, 16);
bipedRightArm.addBox(-3F, -2F, -2F, 4, 12, 4, f);
bipedRightArm.setRotationPoint(-5F, 2.0F + f1, 0.0F);
bipedLeftArm = new ModelRenderer(this, 32, 48);
bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, f);
bipedLeftArm.setRotationPoint(5.0F, 2.0F + f1, 0.0F);
}
bipedRightLeg = new ModelRenderer(this, 0, 16);
bipedRightLeg.addBox(-2F, 0.0F, -2F, 4, 12, 4, f);
bipedRightLeg.setRotationPoint(-2F, 12F + f1, 0.0F);
bipedLeftLeg = new ModelRenderer(this, 16, 48);
bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, f);
bipedLeftLeg.setRotationPoint(1.9F, 12.0F + f1, 0.0F);
}
// 64x32
public void init(float f, float f1) public void init(float f, float f1)
{ {
heldItemLeft = 0; heldItemLeft = 0;
heldItemRight = 0; heldItemRight = 0;
isSneak = false; isSneak = false;
aimedBow = false; aimedBow = false;
bipedCloak = new ModelRenderer(this, 0, 0); bipedCloak = new ModelRenderer(this, 0, 0);
bipedCloak.textureHeight = 32; bipedCloak.textureHeight = 32;
bipedCloak.addBox(-5F, 0.0F, -1F, 10, 16, 1, f); bipedCloak.addBox(-5F, 0.0F, -1F, 10, 16, 1, f);
@@ -145,78 +70,75 @@ public class ModelNPCMale extends ModelBiped
} }
@Override @Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7){ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7){
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
if(!isDancing){ if(!isDancing){
bipedHead.render(par7); bipedHead.render(par7);
bipedBody.render(par7); bipedBody.render(par7);
bipedRightArm.render(par7); bipedRightArm.render(par7);
bipedLeftArm.render(par7); bipedLeftArm.render(par7);
bipedRightLeg.render(par7); bipedRightLeg.render(par7);
bipedLeftLeg.render(par7); bipedLeftLeg.render(par7);
bipedHeadwear.render(par7); bipedHeadwear.render(par7);
} }
else{ else{
renderHead(par1Entity, par7); renderHead(par1Entity, par7);
renderArms(par1Entity, par7); renderArms(par1Entity, par7);
renderBody(par1Entity, par7); renderBody(par1Entity, par7);
renderLegs(par1Entity, par7); renderLegs(par1Entity, par7);
} }
} }
public void renderHead(Entity entityliving,float par7){ public void renderHead(Entity entityliving,float par7){
if(isDancing){ if(isDancing){
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.075F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, (float)(-Math.abs(Math.cos(dancingTicks))) * 0.075F); GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.075F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, (float)(-Math.abs(Math.cos(dancingTicks))) * 0.075F);
bipedHead.render(par7); bipedHead.render(par7);
bipedHeadwear.render(par7); bipedHeadwear.render(par7);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
else{ else{
bipedHead.render(par7); bipedHead.render(par7);
bipedHeadwear.render(par7); bipedHeadwear.render(par7);
} }
} }
public void renderLeftArm(Entity entityliving,float par7){ public void renderLeftArm(Entity entityliving,float par7){
if(isDancing){ if(isDancing){
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.025F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, 0.0F); GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.025F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, 0.0F);
bipedLeftArm.render(par7); bipedLeftArm.render(par7);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
else{ else{
bipedLeftArm.render(par7); bipedLeftArm.render(par7);
} }
} }
public void renderArms(Entity entity,float par7){ public void renderArms(Entity entity,float par7){
renderLeftArm(entity,par7); renderLeftArm(entity,par7);
renderRightArm(entity,par7); renderRightArm(entity,par7);
} }
public void renderRightArm(Entity entityliving,float par7){ public void renderRightArm(Entity entityliving,float par7){
if(isDancing){ if(isDancing){
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.025F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, 0.0F); GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.025F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, 0.0F);
bipedRightArm.render(par7); bipedRightArm.render(par7);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
else{ else{
bipedRightArm.render(par7); bipedRightArm.render(par7);
} }
} }
public void renderBody(Entity entityliving,float par7){ public void renderBody(Entity entityliving,float par7){
if(isDancing){ if(isDancing){
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.015F, 0.0F, 0.0F); GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.015F, 0.0F, 0.0F);
bipedBody.render(par7); bipedBody.render(par7);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
else{ else{
bipedBody.render(par7); bipedBody.render(par7);
} }
} }
public void renderLegs(Entity entityliving,float par7){ public void renderLegs(Entity entityliving,float par7){
bipedRightLeg.render(par7); bipedRightLeg.render(par7);
@@ -225,12 +147,12 @@ public class ModelNPCMale extends ModelBiped
public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity entity) public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity entity)
{ {
EntityNPCInterface npc = (EntityNPCInterface) entity; EntityNPCInterface npc = (EntityNPCInterface) entity;
isRiding = npc.isRiding(); isRiding = npc.isRiding();
if(isSneak && (npc.currentAnimation == EnumAnimation.CRAWLING || npc.currentAnimation == EnumAnimation.LYING)) if(isSneak && (npc.currentAnimation == EnumAnimation.CRAWLING || npc.currentAnimation == EnumAnimation.LYING))
isSneak = false; isSneak = false;
bipedHead.rotateAngleY = par4 / (180F / (float)Math.PI); bipedHead.rotateAngleY = par4 / (180F / (float)Math.PI);
bipedHead.rotateAngleX = par5 / (180F / (float)Math.PI); bipedHead.rotateAngleX = par5 / (180F / (float)Math.PI);
bipedHeadwear.rotateAngleY = bipedHead.rotateAngleY; bipedHeadwear.rotateAngleY = bipedHead.rotateAngleY;
@@ -347,9 +269,9 @@ public class ModelNPCMale extends ModelBiped
public void setRotation(ModelRenderer model, float x, float y, float z) public void setRotation(ModelRenderer model, float x, float y, float z)
{ {
model.rotateAngleX = x; model.rotateAngleX = x;
model.rotateAngleY = y; model.rotateAngleY = y;
model.rotateAngleZ = z; model.rotateAngleZ = z;
} }
public void renderCloak(float f) public void renderCloak(float f)
@@ -357,9 +279,9 @@ public class ModelNPCMale extends ModelBiped
bipedCloak.render(f); bipedCloak.render(f);
} }
public boolean isSleeping(Entity entity) { public boolean isSleeping(Entity entity) {
if(entity instanceof EntityPlayer && ((EntityPlayer)entity).isPlayerSleeping()) if(entity instanceof EntityPlayer && ((EntityPlayer)entity).isPlayerSleeping())
return true; return true;
return ((EntityNPCInterface)entity).currentAnimation == EnumAnimation.LYING; return ((EntityNPCInterface)entity).currentAnimation == EnumAnimation.LYING;
} }
} }
@@ -1,72 +0,0 @@
package noppes.npcs.client.model.part;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import noppes.npcs.client.model.util.Model2DRenderer;
import noppes.npcs.client.model.util.ModelScaleRenderer;
public class ModelBodywear extends ModelScaleRenderer{
public ModelBodywear(ModelBase base) {
super(base);
float scaler = 0.81f;
float thick = 0.65f;
float x = -0.10f;
float y = 12.76f;
float z = -0.5f;
float z1 = 0.27f;
Model2DRenderer front = new Model2DRenderer(base, 20, 36, 8, 12, 64, 64);
front.setRotationPoint(-4.588f, 0 + y, -2.302f + z);
front.setScale(scaler);
front.setThickness(thick);
setRotation(front, 0, 0, 0);
this.addChild(front);
Model2DRenderer back = new Model2DRenderer(base, 32, 36, 8, 12, 64, 64);
back.setRotationPoint(4.588f, 0 + y, 2.302f);
back.setScale(scaler);
back.setThickness(thick);
setRotation(back, 0, (float)(Math.PI), 0);
this.addChild(back);
Model2DRenderer right = new Model2DRenderer(base, 28, 36, 4, 12, 64, 64);
right.setRotationPoint(3.9425f, 0 + y, 2.29695f);
right.setScale(scaler);
right.setThickness(thick);
setRotation(right, 0, (float)(Math.PI/2f), 0);
this.addChild(right);
Model2DRenderer left = new Model2DRenderer(base, 16, 36, 4, 12, 64, 64);
left.setRotationPoint(-3.9425f, 0 + y, -2.29695f + z);
left.setScale(scaler);
left.setThickness(thick);
setRotation(left, 0, (float)(Math.PI/-2f), 0);
this.addChild(left);
Model2DRenderer top = new Model2DRenderer(base, 20, 32, 8, 4, 64, 64);
top.setRotationPoint(-4.588f, -13.0f + y, -2.29695f);
top.setScale(scaler/3);
top.setThickness(thick);
setRotation(top, (float)(Math.PI / -2), 0, 0);
this.addChild(top);
Model2DRenderer bottom = new Model2DRenderer(base, 28, 32, 8, 4, 64, 64);
bottom.setRotationPoint(-4.588f, -0.65f + y, -2.29695f);
bottom.setScale(scaler/3);
bottom.setThickness(thick);
setRotation(bottom, (float)(Math.PI / -2), 0, 0);
this.addChild(bottom);
}
public void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
@@ -12,22 +12,19 @@ public class ModelBreasts extends ModelPartInterface {
private ModelRenderer breasts2; private ModelRenderer breasts2;
private ModelRenderer breasts3; private ModelRenderer breasts3;
public ModelBreasts(ModelMPM base, int width, int height) { public ModelBreasts(ModelMPM base) {
super(base); super(base);
breasts = new Model2DRenderer(base, 20f, 22, 8, 3, width, height); breasts = new Model2DRenderer(base, 20f, 22, 8, 3, 64, 32);
breasts.setTextureSize(width, height);
breasts.setRotationPoint(-3.6F, 5.2f, -3f); breasts.setRotationPoint(-3.6F, 5.2f, -3f);
breasts.setScale(0.17f, 0.19f); breasts.setScale(0.17f, 0.19f);
breasts.setThickness(1); breasts.setThickness(1);
this.addChild(breasts); this.addChild(breasts);
breasts2 = new ModelRenderer(base); breasts2 = new ModelRenderer(base);
breasts2.setTextureSize(width, height);
this.addChild(breasts2); this.addChild(breasts2);
Model2DRenderer bottom = new Model2DRenderer(base, 20f, 22, 8, 4, width, height); Model2DRenderer bottom = new Model2DRenderer(base, 20f, 22, 8, 4, 64, 32);
bottom.setTextureSize(width, height);
bottom.setRotationPoint(-3.6F, 5f, -3.1f); bottom.setRotationPoint(-3.6F, 5f, -3.1f);
bottom.setScale(0.225f, 0.20f); bottom.setScale(0.225f, 0.20f);
bottom.setThickness(2f); bottom.setThickness(2f);
@@ -35,65 +32,56 @@ public class ModelBreasts extends ModelPartInterface {
breasts2.addChild(bottom); breasts2.addChild(bottom);
breasts3 = new ModelRenderer(base); breasts3 = new ModelRenderer(base);
breasts3.setTextureSize(width, height);
this.addChild(breasts3); this.addChild(breasts3);
Model2DRenderer right = new Model2DRenderer(base, 20f, 22, 3, 2, width, height); Model2DRenderer right = new Model2DRenderer(base, 20f, 22, 3, 2, 64, 32);
right.setTextureSize(width, height);
right.setRotationPoint(-3.8F, 5.3f, -3.6f); right.setRotationPoint(-3.8F, 5.3f, -3.6f);
right.setScale(0.12f, 0.14f); right.setScale(0.12f, 0.14f);
right.setThickness(1.75f); right.setThickness(1.75f);
breasts3.addChild(right); breasts3.addChild(right);
Model2DRenderer right2 = new Model2DRenderer(base, 20f, 22, 3, 1, width, height); Model2DRenderer right2 = new Model2DRenderer(base, 20f, 22, 3, 1, 64, 32);
right2.setTextureSize(width, height);
right2.setRotationPoint(-3.8F, 4.1f, -3.14f); right2.setRotationPoint(-3.8F, 4.1f, -3.14f);
right2.setScale(0.06f, 0.07f); right2.setScale(0.06f, 0.07f);
right2.setThickness(1.75f); right2.setThickness(1.75f);
right2.rotateAngleX = (float) (Math.PI / 9); right2.rotateAngleX = (float) (Math.PI / 9);
breasts3.addChild(right2); breasts3.addChild(right2);
Model2DRenderer right3 = new Model2DRenderer(base, 20f, 24, 3, 1, width, height); Model2DRenderer right3 = new Model2DRenderer(base, 20f, 24, 3, 1, 64, 32);
right3.setTextureSize(width, height);
right3.setRotationPoint(-3.8F, 5.3f, -3.6f); right3.setRotationPoint(-3.8F, 5.3f, -3.6f);
right3.setScale(0.06f, 0.07f); right3.setScale(0.06f, 0.07f);
right3.setThickness(1.75f); right3.setThickness(1.75f);
right3.rotateAngleX = (float) (-Math.PI / 9); right3.rotateAngleX = (float) (-Math.PI / 9);
breasts3.addChild(right3); breasts3.addChild(right3);
Model2DRenderer right4 = new Model2DRenderer(base, 23f, 22, 1, 2, width, height); Model2DRenderer right4 = new Model2DRenderer(base, 23f, 22, 1, 2, 64, 32);
right4.setTextureSize(width, height);
right4.setRotationPoint(-1.8f, 5.3f, -3.14f); right4.setRotationPoint(-1.8f, 5.3f, -3.14f);
right4.setScale(0.12f, 0.14f); right4.setScale(0.12f, 0.14f);
right4.setThickness(1.75f); right4.setThickness(1.75f);
right4.rotateAngleY = (float) (Math.PI / 9); right4.rotateAngleY = (float) (Math.PI / 9);
breasts3.addChild(right4); breasts3.addChild(right4);
Model2DRenderer left = new Model2DRenderer(base, 25f, 22, 3, 2, width, height); Model2DRenderer left = new Model2DRenderer(base, 25f, 22, 3, 2, 64, 32);
left.setTextureSize(width, height);
left.setRotationPoint(0.8F, 5.3f, -3.6f); left.setRotationPoint(0.8F, 5.3f, -3.6f);
left.setScale(0.12f, 0.14f); left.setScale(0.12f, 0.14f);
left.setThickness(1.75f); left.setThickness(1.75f);
breasts3.addChild(left); breasts3.addChild(left);
Model2DRenderer left2 = new Model2DRenderer(base, 25f, 22, 3, 1, width, height); Model2DRenderer left2 = new Model2DRenderer(base, 25f, 22, 3, 1, 64, 32);
left2.setTextureSize(width, height);
left2.setRotationPoint(0.8F, 4.1f, -3.18f); left2.setRotationPoint(0.8F, 4.1f, -3.18f);
left2.setScale(0.06f, 0.07f); left2.setScale(0.06f, 0.07f);
left2.setThickness(1.75f); left2.setThickness(1.75f);
left2.rotateAngleX = (float) (Math.PI / 9); left2.rotateAngleX = (float) (Math.PI / 9);
breasts3.addChild(left2); breasts3.addChild(left2);
Model2DRenderer left3 = new Model2DRenderer(base, 25f, 24, 3, 1, width, height); Model2DRenderer left3 = new Model2DRenderer(base, 25f, 24, 3, 1, 64, 32);
left3.setTextureSize(width, height);
left3.setRotationPoint(0.8F, 5.3f, -3.6f); left3.setRotationPoint(0.8F, 5.3f, -3.6f);
left3.setScale(0.06f, 0.07f); left3.setScale(0.06f, 0.07f);
left3.setThickness(1.75f); left3.setThickness(1.75f);
left3.rotateAngleX = (float) (-Math.PI / 9); left3.rotateAngleX = (float) (-Math.PI / 9);
breasts3.addChild(left3); breasts3.addChild(left3);
Model2DRenderer left4 = new Model2DRenderer(base, 24f, 22, 1, 2, width, height); Model2DRenderer left4 = new Model2DRenderer(base, 24f, 22, 1, 2, 64, 32);
left4.setTextureSize(width, height);
left4.setRotationPoint(0.8f, 5.3f, -3.6f); left4.setRotationPoint(0.8f, 5.3f, -3.6f);
left4.setScale(0.12f, 0.14f); left4.setScale(0.12f, 0.14f);
left4.setThickness(1.75f); left4.setThickness(1.75f);
@@ -1,85 +0,0 @@
package noppes.npcs.client.model.part;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import noppes.npcs.client.model.ModelMPM;
import noppes.npcs.client.model.util.ModelPartInterface;
public class ModelDuckBeak extends ModelRenderer {
ModelRenderer Top3;
ModelRenderer Top2;
ModelRenderer Bottom;
ModelRenderer Left;
ModelRenderer Right;
ModelRenderer Middle;
ModelRenderer Top;
public ModelDuckBeak(ModelMPM base) {
super(base);
Top3 = new ModelRenderer(base, 14, 0);
Top3.setTextureSize(64,32);
Top3.addBox(0F, 0F, 0F, 2, 1, 3);
Top3.setRotationPoint(-1F, -2F, -5F);
setRotation(Top3, 0.3346075F, 0F, 0F);
addChild(Top3);
Top2 = new ModelRenderer(base, 0, 0);
Top2.setTextureSize(64,32);
Top2.addBox(0F, 0F, -0.4F, 4, 1, 3);
Top2.setRotationPoint(-2F, -3F, -2F);
setRotation(Top2, 0.3346075F, 0F, 0F);
addChild(Top2);
Bottom = new ModelRenderer(base, 24, 0);
Bottom.setTextureSize(64,32);
Bottom.addBox(0F, 0F, 0F, 2, 1, 5);
Bottom.setRotationPoint(-1F, -1F, -5F);
addChild(Bottom);
Left = new ModelRenderer(base, 0, 4);
Left.setTextureSize(64,32);
Left.mirror = true;
Left.addBox(0F, 0F, 0F, 1, 3, 2);
Left.setRotationPoint(0.98F, -3F, -2F);
addChild(Left);
Right = new ModelRenderer(base, 0, 4);
Right.setTextureSize(64,32);
Right.addBox(0F, 0F, 0F, 1, 3, 2);
Right.setRotationPoint(-1.98F, -3F, -2F);
addChild(Right);
Middle = new ModelRenderer(base, 3, 0);
Middle.setTextureSize(64,32);
Middle.addBox(0F, 0F, 0F, 2, 1, 3);
Middle.setRotationPoint(-1F, -2F, -5F);
addChild(Middle);
Top = new ModelRenderer(base, 6, 4);
Top.setTextureSize(64,32);
Top.addBox(0F, 0F, 0F, 2, 2, 1);
Top.setRotationPoint(-1F, -4.4F, -1F);
addChild(Top);
}
@Override
public void render(float f)
{
GL11.glPushMatrix();
GL11.glTranslatef(0, 0, -1f * f);
GL11.glScalef(0.82f, 0.82f, 0.70f);
super.render(f);
GL11.glPopMatrix();
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
@@ -13,7 +13,7 @@ public class ModelFin extends ModelPartInterface {
public ModelFin(ModelMPM base) { public ModelFin(ModelMPM base) {
super(base); super(base);
model = new Model2DRenderer(base, 48, 8, 16, 24, 64, 32); model = new Model2DRenderer(base, 56, 20, 8, 12, 64, 32);
model.setRotationPoint(-0.5F, 12, 10); model.setRotationPoint(-0.5F, 12, 10);
model.setScale(0.74f); model.setScale(0.74f);
model.rotateAngleY = (float)Math.PI / 2; model.rotateAngleY = (float)Math.PI / 2;
@@ -8,92 +8,47 @@ import noppes.npcs.client.model.util.ModelScaleRenderer;
public class ModelHeadwear extends ModelScaleRenderer{ public class ModelHeadwear extends ModelScaleRenderer{
public ModelHeadwear(ModelBase base) { public ModelHeadwear(ModelBase base) {
super(base);
Model2DRenderer right = new Model2DRenderer(base, 32, 8, 8, 8, 64, 64);
right.setRotationPoint(-4.641F, .8f, 4.64f);
right.setScale(0.58f);
right.setThickness(0.65f);
setRotation(right, 0, (float)(Math.PI/2f), 0);
this.addChild(right);
Model2DRenderer left = new Model2DRenderer(base, 48, 8, 8, 8, 64, 64);
left.setRotationPoint(4.639F, .8f, -4.64f);
left.setScale(0.58f);
left.setThickness(0.65f);
setRotation(left, 0, (float)(Math.PI/-2f), 0);
this.addChild(left);
Model2DRenderer front = new Model2DRenderer(base, 40, 8, 8, 8, 64, 64);
front.setRotationPoint(-4.64F, .801f, -4.641f);
front.setScale(0.58f);
front.setThickness(0.65f);
setRotation(front, 0, 0, 0);
this.addChild(front);
Model2DRenderer back = new Model2DRenderer(base, 56, 8, 8, 8, 64, 64);
back.setRotationPoint(4.64F, .801f, 4.639f);
back.setScale(0.58f);
back.setThickness(0.65f);
setRotation(back, 0, (float)(Math.PI), 0);
this.addChild(back);
Model2DRenderer top = new Model2DRenderer(base, 40, 0, 8, 8, 64, 64);
top.setRotationPoint(-4.64F, -8.5f, -4.64f);
top.setScale(0.5799f);
top.setThickness(0.65f);
setRotation(top, (float)(Math.PI / -2), 0, 0);
this.addChild(top);
Model2DRenderer bottom = new Model2DRenderer(base, 48, 0, 8, 8, 64, 64);
bottom.setRotationPoint(-4.64F, 0f, -4.64f);
bottom.setScale(0.5799f);
bottom.setThickness(0.65f);
setRotation(bottom, (float)(Math.PI / -2), 0, 0);
this.addChild(bottom);
}
public ModelHeadwear(ModelBase base, boolean steve32) {
super(base); super(base);
Model2DRenderer right = new Model2DRenderer(base, 32, 8, 8, 8, 64, 32); Model2DRenderer right = new Model2DRenderer(base, 32, 8, 8, 8, 64, 32);
right.setRotationPoint(-4.641F, .8f, 4.64f); right.setRotationPoint(-4.641F, .8f, 4.64f);
right.setScale(0.58f); right.setScale(0.58f);
right.setThickness(0.65f); right.setThickness(0.65f);
setRotation(right, 0, (float)(Math.PI/2f), 0); setRotation(right, 0, (float)(Math.PI/2f), 0);
this.addChild(right); this.addChild(right);
Model2DRenderer left = new Model2DRenderer(base, 48, 8, 8, 8, 64, 32); Model2DRenderer left = new Model2DRenderer(base, 48, 8, 8, 8, 64, 32);
left.setRotationPoint(4.639F, .8f, -4.64f); left.setRotationPoint(4.639F, .8f, -4.64f);
left.setScale(0.58f); left.setScale(0.58f);
left.setThickness(0.65f); left.setThickness(0.65f);
setRotation(left, 0, (float)(Math.PI/-2f), 0); setRotation(left, 0, (float)(Math.PI/-2f), 0);
this.addChild(left); this.addChild(left);
Model2DRenderer front = new Model2DRenderer(base, 40, 8, 8, 8, 64, 32); Model2DRenderer front = new Model2DRenderer(base, 40, 8, 8, 8, 64, 32);
front.setRotationPoint(-4.64F, .801f, -4.641f); front.setRotationPoint(-4.64F, .801f, -4.641f);
front.setScale(0.58f); front.setScale(0.58f);
front.setThickness(0.65f); front.setThickness(0.65f);
setRotation(front, 0, 0, 0); setRotation(front, 0, 0, 0);
this.addChild(front); this.addChild(front);
Model2DRenderer back = new Model2DRenderer(base, 56, 8, 8, 8, 64, 32); Model2DRenderer back = new Model2DRenderer(base, 56, 8, 8, 8, 64, 32);
back.setRotationPoint(4.64F, .801f, 4.639f); back.setRotationPoint(4.64F, .801f, 4.639f);
back.setScale(0.58f); back.setScale(0.58f);
back.setThickness(0.65f); back.setThickness(0.65f);
setRotation(back, 0, (float)(Math.PI), 0); setRotation(back, 0, (float)(Math.PI), 0);
this.addChild(back); this.addChild(back);
Model2DRenderer top = new Model2DRenderer(base, 40, 0, 8, 8, 64, 32); Model2DRenderer top = new Model2DRenderer(base, 40, 0, 8, 8, 64, 32);
top.setRotationPoint(-4.64F, -8.5f, -4.64f); top.setRotationPoint(-4.64F, -8.5f, -4.64f);
top.setScale(0.5799f); top.setScale(0.5799f);
top.setThickness(0.65f); top.setThickness(0.65f);
setRotation(top, (float)(Math.PI / -2), 0, 0); setRotation(top, (float)(Math.PI / -2), 0, 0);
this.addChild(top); this.addChild(top);
Model2DRenderer bottom = new Model2DRenderer(base, 48, 0, 8, 8, 64, 32); Model2DRenderer bottom = new Model2DRenderer(base, 48, 0, 8, 8, 64, 32);
bottom.setRotationPoint(-4.64F, 0f, -4.64f); bottom.setRotationPoint(-4.64F, 0f, -4.64f);
bottom.setScale(0.5799f); bottom.setScale(0.5799f);
bottom.setThickness(0.65f); bottom.setThickness(0.65f);
setRotation(bottom, (float)(Math.PI / -2), 0, 0); setRotation(bottom, (float)(Math.PI / -2), 0, 0);
this.addChild(bottom); this.addChild(bottom);
} }
@@ -1,58 +0,0 @@
package noppes.npcs.client.model.part;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import noppes.npcs.ModelPartData;
import noppes.npcs.ModelData;
import noppes.npcs.client.model.ModelMPM;
import noppes.npcs.client.model.util.ModelPartInterface;
import noppes.npcs.client.model.part.horns.ModelAntennasBack;
import noppes.npcs.client.model.part.horns.ModelAntennasFront;
import noppes.npcs.client.model.part.horns.ModelAntlerHorns;
import noppes.npcs.client.model.part.horns.ModelBullHorns;
public class ModelHorns extends ModelPartInterface {
private ModelRenderer bull;
private ModelRenderer antlers;
private ModelRenderer antennasBack;
private ModelRenderer antennasFront;
public ModelHorns(ModelMPM base) {
super(base);
this.addChild(bull = new ModelBullHorns(base));
this.addChild(antlers = new ModelAntlerHorns(base));
this.addChild(antennasBack = new ModelAntennasBack(base));
this.addChild(antennasFront = new ModelAntennasFront(base));
}
@Override
public void setRotationAngles(float par1, float par2, float par3,
float par4, float par5, float par6, Entity entity) {
}
@Override
public void initData(ModelData data) {
ModelPartData config = data.getPartData("horns");
if(config == null)
{
isHidden = true;
return;
}
color = config.color;
isHidden = false;
bull.isHidden = config.type != 0;
antlers.isHidden = config.type != 1;
antennasBack.isHidden = config.type != 2;
antennasFront.isHidden = config.type != 3;
if(!config.playerTexture){
location = config.getResource();
}
else
location = null;
}
}
@@ -12,7 +12,6 @@ import noppes.npcs.client.ClientProxy;
import noppes.npcs.client.model.ModelMPM; import noppes.npcs.client.model.ModelMPM;
import noppes.npcs.client.model.part.legs.ModelDigitigradeLegs; import noppes.npcs.client.model.part.legs.ModelDigitigradeLegs;
import noppes.npcs.client.model.part.legs.ModelMermaidLegs; import noppes.npcs.client.model.part.legs.ModelMermaidLegs;
import noppes.npcs.client.model.part.legs.ModelMermaidLegs2;
import noppes.npcs.client.model.part.legs.ModelNagaLegs; import noppes.npcs.client.model.part.legs.ModelNagaLegs;
import noppes.npcs.client.model.util.ModelScaleRenderer; import noppes.npcs.client.model.util.ModelScaleRenderer;
import noppes.npcs.constants.EnumAnimation; import noppes.npcs.constants.EnumAnimation;
@@ -28,7 +27,6 @@ public class ModelLegs extends ModelScaleRenderer{
private ModelNagaLegs naga; private ModelNagaLegs naga;
private ModelDigitigradeLegs digitigrade; private ModelDigitigradeLegs digitigrade;
private ModelMermaidLegs mermaid; private ModelMermaidLegs mermaid;
private ModelMermaidLegs2 mermaid2;
private ModelRenderer spiderLeg1; private ModelRenderer spiderLeg1;
private ModelRenderer spiderLeg2; private ModelRenderer spiderLeg2;
@@ -59,9 +57,8 @@ public class ModelLegs extends ModelScaleRenderer{
private ModelMPM base; private ModelMPM base;
public ModelLegs(ModelMPM base, ModelScaleRenderer leg1, ModelScaleRenderer leg2, int textWidth, int textHeight) { public ModelLegs(ModelMPM base, ModelScaleRenderer leg1, ModelScaleRenderer leg2) {
super(base); super(base);
this.base = base; this.base = base;
this.leg1 = leg1; this.leg1 = leg1;
this.leg2 = leg2; this.leg2 = leg2;
@@ -74,61 +71,51 @@ public class ModelLegs extends ModelScaleRenderer{
float var1 = 0.0F; float var1 = 0.0F;
byte var2 = 15; byte var2 = 15;
spiderNeck = new ModelRenderer(base, 0, 0); spiderNeck = new ModelRenderer(base, 0, 0);
spiderNeck.setTextureSize(64,32);
spiderNeck.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, var1); spiderNeck.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, var1);
spiderNeck.setRotationPoint(0.0F, (float)var2, 2.0F); spiderNeck.setRotationPoint(0.0F, (float)var2, 2.0F);
spider.addChild(spiderNeck); spider.addChild(spiderNeck);
spiderBody = new ModelRenderer(base, 0, 12); spiderBody = new ModelRenderer(base, 0, 12);
spiderBody.setTextureSize(64,32);
spiderBody.addBox(-5.0F, -4.0F, -6.0F, 10, 8, 12, var1); spiderBody.addBox(-5.0F, -4.0F, -6.0F, 10, 8, 12, var1);
spiderBody.setRotationPoint(0.0F, (float)var2, 11.0F); spiderBody.setRotationPoint(0.0F, (float)var2, 11.0F);
spider.addChild(spiderBody); spider.addChild(spiderBody);
this.spiderLeg1 = new ModelRenderer(base, 18, 0); this.spiderLeg1 = new ModelRenderer(base, 18, 0);
this.spiderLeg1.setTextureSize(64,32);
this.spiderLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1); this.spiderLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
this.spiderLeg1.setRotationPoint(-4.0F, (float)var2, 4.0F); this.spiderLeg1.setRotationPoint(-4.0F, (float)var2, 4.0F);
spider.addChild(spiderLeg1); spider.addChild(spiderLeg1);
this.spiderLeg2 = new ModelRenderer(base, 18, 0); this.spiderLeg2 = new ModelRenderer(base, 18, 0);
this.spiderLeg2.setTextureSize(64,32);
this.spiderLeg2.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1); this.spiderLeg2.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
this.spiderLeg2.setRotationPoint(4.0F, (float)var2, 4.0F); this.spiderLeg2.setRotationPoint(4.0F, (float)var2, 4.0F);
spider.addChild(spiderLeg2); spider.addChild(spiderLeg2);
this.spiderLeg3 = new ModelRenderer(base, 18, 0); this.spiderLeg3 = new ModelRenderer(base, 18, 0);
this.spiderLeg3.setTextureSize(64,32);
this.spiderLeg3.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1); this.spiderLeg3.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
this.spiderLeg3.setRotationPoint(-4.0F, (float)var2, 3.0F); this.spiderLeg3.setRotationPoint(-4.0F, (float)var2, 3.0F);
spider.addChild(spiderLeg3); spider.addChild(spiderLeg3);
this.spiderLeg4 = new ModelRenderer(base, 18, 0); this.spiderLeg4 = new ModelRenderer(base, 18, 0);
this.spiderLeg4.setTextureSize(64,32);
this.spiderLeg4.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1); this.spiderLeg4.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
this.spiderLeg4.setRotationPoint(4.0F, (float)var2, 3.0F); this.spiderLeg4.setRotationPoint(4.0F, (float)var2, 3.0F);
spider.addChild(spiderLeg4); spider.addChild(spiderLeg4);
this.spiderLeg5 = new ModelRenderer(base, 18, 0); this.spiderLeg5 = new ModelRenderer(base, 18, 0);
this.spiderLeg5.setTextureSize(64,32);
this.spiderLeg5.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1); this.spiderLeg5.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
this.spiderLeg5.setRotationPoint(-4.0F, (float)var2, 2.0F); this.spiderLeg5.setRotationPoint(-4.0F, (float)var2, 2.0F);
spider.addChild(spiderLeg5); spider.addChild(spiderLeg5);
this.spiderLeg6 = new ModelRenderer(base, 18, 0); this.spiderLeg6 = new ModelRenderer(base, 18, 0);
this.spiderLeg6.setTextureSize(64,32);
this.spiderLeg6.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1); this.spiderLeg6.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
this.spiderLeg6.setRotationPoint(4.0F, (float)var2, 2.0F); this.spiderLeg6.setRotationPoint(4.0F, (float)var2, 2.0F);
spider.addChild(spiderLeg6); spider.addChild(spiderLeg6);
this.spiderLeg7 = new ModelRenderer(base, 18, 0); this.spiderLeg7 = new ModelRenderer(base, 18, 0);
this.spiderLeg7.setTextureSize(64,32);
this.spiderLeg7.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1); this.spiderLeg7.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
this.spiderLeg7.setRotationPoint(-4.0F, (float)var2, 1.0F); this.spiderLeg7.setRotationPoint(-4.0F, (float)var2, 1.0F);
spider.addChild(spiderLeg7); spider.addChild(spiderLeg7);
this.spiderLeg8 = new ModelRenderer(base, 18, 0); this.spiderLeg8 = new ModelRenderer(base, 18, 0);
this.spiderLeg8.setTextureSize(64,32);
this.spiderLeg8.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1); this.spiderLeg8.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
this.spiderLeg8.setRotationPoint(4.0F, (float)var2, 1.0F); this.spiderLeg8.setRotationPoint(4.0F, (float)var2, 1.0F);
spider.addChild(spiderLeg8); spider.addChild(spiderLeg8);
@@ -212,19 +199,10 @@ public class ModelLegs extends ModelScaleRenderer{
naga = new ModelNagaLegs(base); naga = new ModelNagaLegs(base);
this.addChild(naga); this.addChild(naga);
// Add Mermaid Legs
mermaid = new ModelMermaidLegs(base); mermaid = new ModelMermaidLegs(base);
mermaid2 = new ModelMermaidLegs2(base);
this.addChild(mermaid); this.addChild(mermaid);
this.addChild(mermaid2);
boolean mirror = false;
if(textHeight != textWidth){
mirror = true;
}
digitigrade = new ModelDigitigradeLegs(base, mirror, textWidth, textHeight);
digitigrade = new ModelDigitigradeLegs(base);
this.addChild(digitigrade); this.addChild(digitigrade);
} }
public void setRotation(ModelRenderer model, float x, float y, float z) { public void setRotation(ModelRenderer model, float x, float y, float z) {
@@ -318,18 +296,9 @@ public class ModelLegs extends ModelScaleRenderer{
naga.isSneaking = base.isSneak; naga.isSneaking = base.isSneak;
naga.setRotationAngles(par1, par2, par3, par4, par5, par6, entity); naga.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
} }
else if(part.type == 4 || part.type == 6){ else if(part.type == 4){
mermaid.isRiding = base.isRiding; mermaid.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
mermaid.isSleeping = base.isSleeping(entity); }
mermaid.isCrawling = this.entity.currentAnimation == EnumAnimation.CRAWLING;
mermaid.isSneaking = base.isSneak;
mermaid2.isRiding = base.isRiding;
mermaid2.isSleeping = base.isSleeping(entity);
mermaid2.isCrawling = this.entity.currentAnimation == EnumAnimation.CRAWLING;
mermaid2.isSneaking = base.isSneak;
mermaid.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
mermaid2.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
}
else if(part.type == 5){ else if(part.type == 5){
digitigrade.setRotationAngles(par1, par2, par3, par4, par5, par6, entity); digitigrade.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
} }
@@ -345,7 +314,7 @@ public class ModelLegs extends ModelScaleRenderer{
return; return;
GL11.glPushMatrix(); GL11.glPushMatrix();
if(part.type == 4) if(part.type == 4)
part.playerTexture = false; part.playerTexture = !entity.isInWater();
if(!base.isArmor){ if(!base.isArmor){
if(!part.playerTexture){ if(!part.playerTexture){
ClientProxy.bindTexture(part.getResource()); ClientProxy.bindTexture(part.getResource());
@@ -356,19 +325,18 @@ public class ModelLegs extends ModelScaleRenderer{
base.currentlyPlayerTexture = true; base.currentlyPlayerTexture = true;
} }
} }
if(part.type == 0){ if(part.type == 0 || part.type == 4 && !entity.isInWater()){
leg1.setConfig(config, x, y, z); leg1.setConfig(config, x, y, z);
leg1.render(par1); leg1.render(par1);
leg2.setConfig(config, -x, y, z); leg2.setConfig(config, -x, y, z);
leg2.render(par1); leg2.render(par1);
} }
if(!base.isArmor){ if(!base.isArmor){
naga.isHidden = part.type != 1; naga.isHidden = part.type != 1;
spider.isHidden = part.type != 2; spider.isHidden = part.type != 2;
horse.isHidden = part.type != 3; horse.isHidden = part.type != 3;
mermaid.isHidden = part.type != 4; mermaid.isHidden = part.type != 4 || !entity.isInWater();
mermaid2.isHidden = part.type != 6;
digitigrade.isHidden = part.type != 5; digitigrade.isHidden = part.type != 5;
if(!horse.isHidden){ if(!horse.isHidden){
@@ -384,7 +352,7 @@ public class ModelLegs extends ModelScaleRenderer{
x = 0; x = 0;
y *= 2f; y *= 2f;
} }
else if(!mermaid.isHidden || !mermaid2.isHidden || !digitigrade.isHidden){ else if(!mermaid.isHidden || !digitigrade.isHidden){
x = 0; x = 0;
y *= 2f; y *= 2f;
} }
@@ -1,72 +0,0 @@
package noppes.npcs.client.model.part;
import java.util.List;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import noppes.npcs.ModelData;
import noppes.npcs.ModelPartData;
import noppes.npcs.client.model.ModelMPM;
import noppes.npcs.client.model.util.ModelPartInterface;
import noppes.npcs.client.model.util.ModelPlane;
import noppes.npcs.client.model.util.ModelPlaneRenderer;
public class ModelSkirt extends ModelPartInterface {
private ModelPlaneRenderer Shape1;
public ModelSkirt(ModelMPM base) {
super(base);
float pi = (float) (Math.PI / 5);
Shape1 = new ModelPlaneRenderer(base, 58, 18);
Shape1.addSidePlane(0, 0, 0, 9, 2);
ModelPlaneRenderer part1 = new ModelPlaneRenderer(base, 58, 18);
part1.addSidePlane(2, 0, 0, 9, 2);
part1.rotateAngleY = -(float) (Math.PI/2);
Shape1.addChild(part1);
Shape1.setRotationPoint(2.4F, 8.8F, 0F);
setRotation(Shape1, 0.3F, -0.2f, -0.2F);
}
public void render(float par1)
{
if (this.isHidden || !this.showModel)
return;
GL11.glPushMatrix();
GL11.glScalef(1.7f, 1.04f, 1.6f);
super.render(par1);
GL11.glPopMatrix();
}
public void renderParts(float par1) {
for(int i = 0; i < 10; i++){
GL11.glRotatef(36, 0, 1, 0);
Shape1.render(par1);
}
}
public void setRotationAngles(float par1, float par2, float par3,
float par4, float par5, float par6, Entity entity) {
setRotation(Shape1, 0.3F, -0.2f, -0.2F);
Shape1.rotateAngleX += base.bipedLeftArm.rotateAngleX * 0.04f;
Shape1.rotateAngleZ += base.bipedLeftArm.rotateAngleX * 0.06f;
//this.Shape1.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F;
this.Shape1.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.04F - 0.05F;
}
@Override
public void initData(ModelData data) {
ModelPartData config = data.getPartData("skirt");
if(config == null)
{
isHidden = true;
return;
}
color = config.color;
isHidden = false;
location = (ResourceLocation) config.getResource();
}
}
@@ -13,45 +13,34 @@ public class ModelSnout extends ModelPartInterface {
private ModelRenderer medium; private ModelRenderer medium;
private ModelRenderer large; private ModelRenderer large;
private ModelRenderer bunny; private ModelRenderer bunny;
private ModelRenderer beak;
public ModelSnout(ModelMPM base) { public ModelSnout(ModelMPM base) {
super(base); super(base);
small = new ModelRenderer(base, 24, 0); small = new ModelRenderer(base, 24, 0);
small.setTextureSize(64,32);
small.addBox(0F, 0F, 0F, 4, 3, 1); small.addBox(0F, 0F, 0F, 4, 3, 1);
small.setRotationPoint(-2F, -3F, -5F); small.setRotationPoint(-2F, -3F, -5F);
this.addChild(small); this.addChild(small);
medium = new ModelRenderer(base, 24, 0); medium = new ModelRenderer(base, 24, 0);
medium.setTextureSize(64,32);
medium.addBox(0F, 0F, 0F, 4, 3, 2); medium.addBox(0F, 0F, 0F, 4, 3, 2);
medium.setRotationPoint(-2F, -3F, -6F); medium.setRotationPoint(-2F, -3F, -6F);
this.addChild(medium); this.addChild(medium);
large = new ModelRenderer(base, 24, 0); large = new ModelRenderer(base, 24, 0);
large.setTextureSize(64,32);
large.addBox(0F, 0F, 0F, 4, 3, 3); large.addBox(0F, 0F, 0F, 4, 3, 3);
large.setRotationPoint(-2F, -3F, -7F); large.setRotationPoint(-2F, -3F, -7F);
this.addChild(large); this.addChild(large);
bunny = new ModelRenderer(base, 24, 0); bunny = new ModelRenderer(base, 24, 0);
bunny.setTextureSize(64,32);
bunny.addBox(1F, 1F, 0F, 4, 2, 1); bunny.addBox(1F, 1F, 0F, 4, 2, 1);
bunny.setRotationPoint(-3F, -4F, -5F); bunny.setRotationPoint(-3F, -4F, -5F);
this.addChild(bunny); this.addChild(bunny);
ModelRenderer tooth = new ModelRenderer(base, 24, 3); ModelRenderer tooth = new ModelRenderer(base, 24, 3);
tooth.setTextureSize(64,32);
tooth.addBox(2F, 3f, 0F, 2, 1, 1); tooth.addBox(2F, 3f, 0F, 2, 1, 1);
tooth.setRotationPoint(0F, 0F, 0F); tooth.setRotationPoint(0F, 0F, 0F);
bunny.addChild(tooth); bunny.addChild(tooth);
beak = new ModelDuckBeak(base);
beak.setTextureSize(64,32);
beak.setRotationPoint(0, 0, -4F);
this.addChild(beak);
} }
@Override @Override
@@ -75,7 +64,6 @@ public class ModelSnout extends ModelPartInterface {
medium.isHidden = config.type != 1; medium.isHidden = config.type != 1;
large.isHidden = config.type != 2; large.isHidden = config.type != 2;
bunny.isHidden = config.type != 3; bunny.isHidden = config.type != 3;
beak.isHidden = config.type != 4;
if(!config.playerTexture){ if(!config.playerTexture){
location = config.getResource(); location = config.getResource();
@@ -10,7 +10,8 @@ import net.minecraft.util.ResourceLocation;
import noppes.npcs.ModelPartData; import noppes.npcs.ModelPartData;
import noppes.npcs.client.ClientProxy; import noppes.npcs.client.ClientProxy;
import noppes.npcs.client.model.ModelMPM; import noppes.npcs.client.model.ModelMPM;
import noppes.npcs.client.model.part.tails.*; import noppes.npcs.client.model.part.tails.ModelDragonTail;
import noppes.npcs.client.model.part.tails.ModelSquirrelTail;
import noppes.npcs.client.model.util.ModelScaleRenderer; import noppes.npcs.client.model.util.ModelScaleRenderer;
import noppes.npcs.constants.EnumAnimation; import noppes.npcs.constants.EnumAnimation;
import noppes.npcs.entity.EntityCustomNpc; import noppes.npcs.entity.EntityCustomNpc;
@@ -25,9 +26,6 @@ public class ModelTail extends ModelScaleRenderer {
private ModelRenderer dragon; private ModelRenderer dragon;
private ModelRenderer squirrel; private ModelRenderer squirrel;
private ModelRenderer horse; private ModelRenderer horse;
private ModelRenderer fin;
private ModelRenderer rodent;
private ModelRenderer feather;
private int color = 0xFFFFFF; private int color = 0xFFFFFF;
@@ -39,7 +37,6 @@ public class ModelTail extends ModelScaleRenderer {
this.rotationPointY = 11; this.rotationPointY = 11;
tail = new ModelRenderer(base, 56, 21); tail = new ModelRenderer(base, 56, 21);
tail.setTextureSize(64, 32);
tail.addBox(-1F, 0F, 0F, 2, 9, 2); tail.addBox(-1F, 0F, 0F, 2, 9, 2);
tail.setRotationPoint(0F, 0, 1F); tail.setRotationPoint(0F, 0, 1F);
setRotation(tail, 0.8714253F, 0F, 0F); setRotation(tail, 0.8714253F, 0F, 0F);
@@ -71,11 +68,6 @@ public class ModelTail extends ModelScaleRenderer {
this.addChild(dragon = new ModelDragonTail(base)); this.addChild(dragon = new ModelDragonTail(base));
this.addChild(squirrel = new ModelSquirrelTail(base)); this.addChild(squirrel = new ModelSquirrelTail(base));
this.addChild(fin = new ModelTailFin(base));
this.addChild(rodent = new ModelRodentTail(base));
this.addChild(feather = new ModelFeatherTail(base));
} }
public void setData(EntityCustomNpc entity) { public void setData(EntityCustomNpc entity) {
@@ -126,9 +118,6 @@ public class ModelTail extends ModelScaleRenderer {
dragon.isHidden = config.type != 1; dragon.isHidden = config.type != 1;
horse.isHidden = config.type != 2; horse.isHidden = config.type != 2;
squirrel.isHidden = config.type != 3; squirrel.isHidden = config.type != 3;
fin.isHidden = config.type != 4;
rodent.isHidden = config.type != 5;
feather.isHidden = config.type != 6;
if(!config.playerTexture){ if(!config.playerTexture){
location = config.getResource(); location = config.getResource();
} }
@@ -17,14 +17,14 @@ public class ModelWings extends ModelPartInterface {
public ModelWings(ModelMPM base) { public ModelWings(ModelMPM base) {
super(base); super(base);
lWing = new Model2DRenderer(base, 48, 32, 16, 32, 64, 32); lWing = new Model2DRenderer(base, 56, 16, 8, 16, 64, 32);
lWing.mirror = true; lWing.mirror = true;
lWing.setRotationPoint(2F, 4, 2F); lWing.setRotationPoint(2F, 4, 2F);
lWing.setRotationOffset(-16, -12); lWing.setRotationOffset(-16, -12);
setRotation(lWing, 0.7141593F, -0.5235988F, -0.5090659F); setRotation(lWing, 0.7141593F, -0.5235988F, -0.5090659F);
this.addChild(lWing); this.addChild(lWing);
rWing = new Model2DRenderer(base, 48, 32, 16, 32, 64, 32); rWing = new Model2DRenderer(base, 56, 16, 8, 16, 64, 32);
rWing.setRotationPoint(-2F, 4F, 2F); rWing.setRotationPoint(-2F, 4F, 2F);
rWing.setRotationOffset(-16, -12); rWing.setRotationOffset(-16, -12);
setRotation(rWing, 0.7141593F, 0.5235988F, 0.5090659F); setRotation(rWing, 0.7141593F, 0.5235988F, 0.5090659F);
@@ -1,49 +0,0 @@
package noppes.npcs.client.model.part.horns;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import noppes.npcs.client.model.ModelMPM;
public class ModelAntennasBack extends ModelRenderer {
public ModelAntennasBack(ModelMPM base) {
super(base);
ModelRenderer rightantenna1 = new ModelRenderer(base, 36, 0);
rightantenna1.setTextureSize(64,32);
rightantenna1.addBox(-1F, 0F, 0F, 1, 4, 1);
rightantenna1.setRotationPoint(3F, -10.9F, 0F);
setRotation(rightantenna1, -0.7504916F, 0.0698132F, 0.0698132F);
addChild(rightantenna1);
ModelRenderer leftantenna1 = new ModelRenderer(base, 32, 0);
leftantenna1.setTextureSize(64,32);
leftantenna1.mirror = true;
leftantenna1.addBox(0F, 0F, 0F, 1, 4, 1);
leftantenna1.setRotationPoint(-3F, -10.9F, 0F);
setRotation(leftantenna1, -0.7504916F, -0.0698132F, -0.0698132F);
addChild(leftantenna1);
ModelRenderer rightantenna2 = new ModelRenderer(base, 36, 0);
rightantenna2.setTextureSize(64,32);
rightantenna2.addBox(-1F, 0F, 0F, 1, 4, 1);
rightantenna2.setRotationPoint(4.6F, -12.2F, 3.4F);
setRotation(rightantenna2, -1.22173F, 0.4363323F, 0.0698132F);
addChild(rightantenna2);
ModelRenderer leftantenna2 = new ModelRenderer(base, 32, 0);
leftantenna2.setTextureSize(64,32);
leftantenna2.mirror = true;
leftantenna2.addBox(0F, 0F, 0F, 1, 4, 1);
leftantenna2.setRotationPoint(-4.6F, -12.2F, 3.4F);
setRotation(leftantenna2, -1.22173F, -0.4363323F, -0.0698132F);
addChild(leftantenna2);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
@@ -1,49 +0,0 @@
package noppes.npcs.client.model.part.horns;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import noppes.npcs.client.model.ModelMPM;
public class ModelAntennasFront extends ModelRenderer {
public ModelAntennasFront(ModelMPM base) {
super(base);
ModelRenderer rightantenna1 = new ModelRenderer(base, 36, 0);
rightantenna1.setTextureSize(64,32);
rightantenna1.addBox(0F, 0F, 0F, 1, 4, 1);
rightantenna1.setRotationPoint(2F, -9.4F, -2F);
setRotation(rightantenna1, 0.4014257F, 0.0698132F, 0.0698132F);
addChild(rightantenna1);
ModelRenderer leftantenna1 = new ModelRenderer(base, 32, 0);
leftantenna1.setTextureSize(64,32);
leftantenna1.mirror = true;
leftantenna1.addBox(-1F, 0F, 0F, 1, 4, 1);
leftantenna1.setRotationPoint(-2F, -9.4F, -2F);
setRotation(leftantenna1, 0.4014257F, -0.0698132F, -0.0698132F);
addChild(leftantenna1);
ModelRenderer rightantenna2 = new ModelRenderer(base, 36, 0);
rightantenna2.setTextureSize(64,32);
rightantenna2.addBox(0F, 0F, 0F, 1, 4, 1);
rightantenna2.setRotationPoint(3F, -10.2F, -5.3F);
setRotation(rightantenna2, 1.22173F, -0.2094395F, 0.0698132F);
addChild(rightantenna2);
ModelRenderer leftantenna2 = new ModelRenderer(base, 32, 0);
leftantenna2.setTextureSize(64,32);
leftantenna2.mirror = true;
leftantenna2.addBox(-1F, 0F, 0F, 1, 4, 1);
leftantenna2.setRotationPoint(-3F, -10.2F, -5.3F);
setRotation(leftantenna2, 1.22173F, 0.2094395F, -0.0698132F);
addChild(leftantenna2);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
@@ -1,92 +0,0 @@
package noppes.npcs.client.model.part.horns;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import noppes.npcs.client.model.ModelMPM;
public class ModelAntlerHorns extends ModelRenderer {
public ModelAntlerHorns(ModelMPM base) {
super(base);
textureWidth = 64;
textureHeight = 32;
ModelRenderer right_base_horn = new ModelRenderer(base, 58, 20);
right_base_horn.setTextureSize(64,32);
right_base_horn.addBox(0F, -5F, 0F, 1, 6, 1);
right_base_horn.setRotationPoint(-2.5F, -6F, -1F);
setRotation(right_base_horn, 0F, 0F, -0.2F);
addChild(right_base_horn);
ModelRenderer right_horn1 = new ModelRenderer(base, 58, 20);
right_horn1.setTextureSize(64,32);
right_horn1.addBox(0F, -5F, 0F, 1, 5, 1);
right_horn1.setRotationPoint(0F, -4F, 0F);
setRotation(right_horn1, 1F, 0F, -1F);
right_base_horn.addChild(right_horn1);
ModelRenderer right_horn2 = new ModelRenderer(base, 58, 20);
right_horn2.setTextureSize(64,32);
right_horn2.addBox(0F, -4F, 0F, 1, 5, 1);
right_horn2.setRotationPoint(-0F, -6F, -0F);
setRotation(right_horn2, -0.5F, -0.5F, 0F);
right_base_horn.addChild(right_horn2);
ModelRenderer things1 = new ModelRenderer(base, 58, 20);
things1.setTextureSize(64,32);
things1.addBox(0F, -5F, 0F, 1, 5, 1);
things1.setRotationPoint(0F, -3F, 1F);
setRotation(things1, 2F, 0.5f, 0.5f);
right_horn2.addChild(things1);
ModelRenderer things2 = new ModelRenderer(base, 58, 20);
things2.setTextureSize(64,32);
things2.addBox(0F, -5F, 0F, 1, 5, 1);
things2.setRotationPoint(0F, -3F, 1F);
setRotation(things2, 2F, -0.5f, -0.5f);
right_horn2.addChild(things2);
ModelRenderer left_base_horn = new ModelRenderer(base, 58, 20);
left_base_horn.setTextureSize(64,32);
left_base_horn.addBox(0F, -5F, 0F, 1, 6, 1);
left_base_horn.setRotationPoint(1.5F, -6F, -1F);
setRotation(left_base_horn, 0F, 0F, 0.2F);
addChild(left_base_horn);
ModelRenderer left_horn1 = new ModelRenderer(base, 58, 20);
left_horn1.setTextureSize(64,32);
left_horn1.addBox(0F, -5F, 0F, 1, 5, 1);
left_horn1.setRotationPoint(0F, -5F, 0F);
setRotation(left_horn1, 1F, 0F, 1F);
left_base_horn.addChild(left_horn1);
ModelRenderer left_horn2 = new ModelRenderer(base, 58, 20);
left_horn2.setTextureSize(64,32);
left_horn2.addBox(0F, -4F, 0F, 1, 5, 1);
left_horn2.setRotationPoint(0F, -6F, 1F);
setRotation(left_horn2, -0.5F, 0.5F, 0F);
left_base_horn.addChild(left_horn2);
ModelRenderer things8 = new ModelRenderer(base, 58, 20);
things8.setTextureSize(64,32);
things8.addBox(0F, -5F, 0F, 1, 5, 1);
things8.setRotationPoint(0F, -3F, 1F);
setRotation(things8, 2F, -0.5f, -0.5f);
left_horn2.addChild(things8);
ModelRenderer things4 = new ModelRenderer(base, 58, 20);
things4.setTextureSize(64,32);
things4.addBox(0F, -5F, 0F, 1, 5, 1);
things4.setRotationPoint(0F, -3F, 1F);
setRotation(things4, 2F, 0.5f, 0.5f);
left_horn2.addChild(things4);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
@@ -1,63 +0,0 @@
package noppes.npcs.client.model.part.horns;
import net.minecraft.client.model.ModelRenderer;
import noppes.npcs.client.model.ModelMPM;
public class ModelBullHorns extends ModelRenderer {
public ModelBullHorns(ModelMPM base) {
super(base);
textureWidth = 64;
textureHeight = 32;
ModelRenderer Left1 = new ModelRenderer(base, 36, 16);
Left1.setTextureSize(64,32);
Left1.mirror = true;
Left1.addBox(0F, 0F, 0F, 2, 2, 2);
Left1.setRotationPoint(4F, -8F, -2F);
addChild(Left1);
ModelRenderer Right1 = new ModelRenderer(base, 36, 16);
Right1.setTextureSize(64,32);
Right1.addBox(-3F, 0F, 0F, 2, 2, 2);
Right1.setRotationPoint(-3F, -8F, -2F);
addChild(Right1);
ModelRenderer Left2 = new ModelRenderer(base, 12, 16);
Left2.setTextureSize(64,32);
Left2.mirror = true;
Left2.addBox(0F, 0F, 0F, 2, 2, 2);
Left2.setRotationPoint(5F, -8F, -2F);
setRotation(Left2, 0.0371786F, 0.3346075F, -0.2602503F);
addChild(Left2);
ModelRenderer Right2 = new ModelRenderer(base, 12, 16);
Right2.setTextureSize(64,32);
Right2.addBox(-2F, 0F, 0F, 2, 2, 2);
Right2.setRotationPoint(-5F, -8F, -2F);
setRotation(Right2, 0.0371786F, -0.3346075F, 0.2602503F);
addChild(Right2);
ModelRenderer Left3 = new ModelRenderer(base, 13, 17);
Left3.setTextureSize(64,32);
Left3.mirror = true;
Left3.addBox(-1F, 0F, 0F, 2, 1, 1);
Left3.setRotationPoint(7F, -8F, -2F);
setRotation(Left3, 0.2602503F, 0.8551081F, -0.4089647F);
addChild(Left3);
ModelRenderer Right3 = new ModelRenderer(base, 13, 17);
Right3.setTextureSize(64,32);
Right3.addBox(-1F, 0F, 0F, 2, 1, 1);
Right3.setRotationPoint(-7F, -8F, -2F);
setRotation(Right3, -0.2602503F, -0.8551081F, 0.4089647F);
addChild(Right3);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
@@ -22,40 +22,34 @@ public class ModelDigitigradeLegs extends ModelRenderer {
private ModelMPM base; private ModelMPM base;
public ModelDigitigradeLegs(ModelMPM base, boolean mirror, int textWidth, int textHeight) { public ModelDigitigradeLegs(ModelMPM base) {
super(base); super(base);
this.base = base; this.base = base;
rightleg = new ModelRenderer(base, 0, 16); rightleg = new ModelRenderer(base, 0, 16);
rightleg.setTextureSize(textWidth, textHeight);
rightleg.addBox(-2F, 0F, -2F, 4, 6, 4); rightleg.addBox(-2F, 0F, -2F, 4, 6, 4);
rightleg.setRotationPoint(-2.1F, 11F, 0F); rightleg.setRotationPoint(-2.1F, 11F, 0F);
setRotation(rightleg, -0.3F, 0F, 0F); setRotation(rightleg, -0.3F, 0F, 0F);
this.addChild(rightleg); this.addChild(rightleg);
rightleg2 = new ModelRenderer(base, 0, 20); rightleg2 = new ModelRenderer(base, 0, 20);
rightleg2.setTextureSize(textWidth, textHeight);
rightleg2.addBox(-1.5F, -1F, -2F, 3, 7, 3); rightleg2.addBox(-1.5F, -1F, -2F, 3, 7, 3);
rightleg2.setRotationPoint(0F, 4.1F, 0F); rightleg2.setRotationPoint(0F, 4.1F, 0F);
setRotation(rightleg2, 1.1f, 0F, 0F); setRotation(rightleg2, 1.1f, 0F, 0F);
rightleg.addChild(rightleg2); rightleg.addChild(rightleg2);
rightleglow = new ModelRenderer(base, 0, 24); rightleglow = new ModelRenderer(base, 0, 24);
rightleglow.setTextureSize(textWidth, textHeight);
rightleglow.addBox(-1.5F, 0F, -1F, 3, 5, 2); rightleglow.addBox(-1.5F, 0F, -1F, 3, 5, 2);
rightleglow.setRotationPoint(0F, 5F, 0F); rightleglow.setRotationPoint(0F, 5F, 0F);
setRotation(rightleglow, -1.35F, 0F, 0F); setRotation(rightleglow, -1.35F, 0F, 0F);
rightleg2.addChild(rightleglow); rightleg2.addChild(rightleglow);
rightfoot = new ModelRenderer(base, 1, 26); rightfoot = new ModelRenderer(base, 1, 26);
rightfoot.setTextureSize(textWidth, textHeight);
rightfoot.addBox(-1.5F, 0F, -5F, 3, 2, 4); rightfoot.addBox(-1.5F, 0F, -5F, 3, 2, 4);
rightfoot.setRotationPoint(0F, 3.7F, 1.2F); rightfoot.setRotationPoint(0F, 3.7F, 1.2F);
setRotation(rightfoot, 0.55F, 0F, 0F); setRotation(rightfoot, 0.55F, 0F, 0F);
rightleglow.addChild(rightfoot); rightleglow.addChild(rightfoot);
leftleg = new ModelRenderer(base, 0, 16); leftleg = new ModelRenderer(base, 0, 16);
leftleg.setTextureSize(textWidth, textHeight);
leftleg.mirror = true; leftleg.mirror = true;
leftleg.addBox(-2F, 0F, -2F, 4, 6, 4); leftleg.addBox(-2F, 0F, -2F, 4, 6, 4);
leftleg.setRotationPoint(2.1F, 11F, 0F); leftleg.setRotationPoint(2.1F, 11F, 0F);
@@ -63,7 +57,6 @@ public class ModelDigitigradeLegs extends ModelRenderer {
this.addChild(leftleg); this.addChild(leftleg);
leftleg2 = new ModelRenderer(base, 0, 20); leftleg2 = new ModelRenderer(base, 0, 20);
leftleg2.setTextureSize(textWidth, textHeight);
leftleg2.mirror = true; leftleg2.mirror = true;
leftleg2.addBox(-1.5F, -1F, -2F, 3, 7, 3); leftleg2.addBox(-1.5F, -1F, -2F, 3, 7, 3);
leftleg2.setRotationPoint(0F, 4.1F, 0F); leftleg2.setRotationPoint(0F, 4.1F, 0F);
@@ -71,7 +64,6 @@ public class ModelDigitigradeLegs extends ModelRenderer {
leftleg.addChild(leftleg2); leftleg.addChild(leftleg2);
leftleglow = new ModelRenderer(base, 0, 24); leftleglow = new ModelRenderer(base, 0, 24);
leftleglow.setTextureSize(textWidth, textHeight);
leftleglow.mirror = true; leftleglow.mirror = true;
leftleglow.addBox(-1.5F, 0F, -1F, 3, 5, 2); leftleglow.addBox(-1.5F, 0F, -1F, 3, 5, 2);
leftleglow.setRotationPoint(0F, 5F, 0F); leftleglow.setRotationPoint(0F, 5F, 0F);
@@ -79,7 +71,6 @@ public class ModelDigitigradeLegs extends ModelRenderer {
leftleg2.addChild(leftleglow); leftleg2.addChild(leftleglow);
leftfoot = new ModelRenderer(base, 1, 26); leftfoot = new ModelRenderer(base, 1, 26);
leftfoot.setTextureSize(textWidth, textHeight);
leftfoot.mirror = true; leftfoot.mirror = true;
leftfoot.addBox(-1.5F, 0F, -5F, 3, 2, 4); leftfoot.addBox(-1.5F, 0F, -5F, 3, 2, 4);
leftfoot.setRotationPoint(0F, 3.7F, 1.2F); leftfoot.setRotationPoint(0F, 3.7F, 1.2F);
@@ -4,11 +4,6 @@ import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import noppes.npcs.CustomNpcs;
import noppes.npcs.ModelData;
import noppes.npcs.constants.EnumAnimation;
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.entity.EntityCustomNpc;
public class ModelMermaidLegs extends ModelRenderer { public class ModelMermaidLegs extends ModelRenderer {
@@ -18,52 +13,42 @@ public class ModelMermaidLegs extends ModelRenderer {
ModelRenderer fin1; ModelRenderer fin1;
ModelRenderer fin2; ModelRenderer fin2;
public boolean isRiding = false;
public boolean isSneaking = false;
public boolean isSleeping = false;
public boolean isCrawling = false;
public ModelMermaidLegs(ModelBase base) { public ModelMermaidLegs(ModelBase base) {
super(base); super(base);
textureWidth = 64; textureWidth = 64;
textureHeight = 32; textureHeight = 32;
top = new ModelRenderer(base, 0, 16); top = new ModelRenderer(base, 0, 16);
top.setTextureSize(64,32); top.addBox(-2F, -2.5F, -2F, 8, 9, 4);
top.addBox(-2F, -2.5F, -2F, 8, 9, 4); top.setRotationPoint(-2F, 14F, 1F);
top.setRotationPoint(-2F, 14F, 1F); setRotation(top, 0.26F, 0F, 0F);
setRotation(top, 0.26F, 0F, 0F);
middle = new ModelRenderer(base, 28, 0); middle = new ModelRenderer(base, 28, 0);
middle.setTextureSize(64,32); middle.addBox(0F, 0F, 0F, 7, 6, 4);
middle.addBox(0F, 0F, 0F, 7, 6, 4); middle.setRotationPoint(-1.5F, 6.5F, -1F);
middle.setRotationPoint(-1.5F, 6.5F, -1F); setRotation(middle, 0.86f, 0F, 0F);
setRotation(middle, 0.86f, 0F, 0F); top.addChild(middle);
top.addChild(middle);
bottom = new ModelRenderer(base, 24, 16); bottom = new ModelRenderer(base, 24, 16);
bottom.setTextureSize(64,32); bottom.addBox(0F, 0F, 0F, 6, 7, 3);
bottom.addBox(0F, 0F, 0F, 6, 7, 3); bottom.setRotationPoint(0.5F, 6F, 0.5f);
bottom.setRotationPoint(0.5F, 6F, 0.5f); setRotation(bottom, 0.15f, 0F, 0F);
setRotation(bottom, 0.15f, 0F, 0F); middle.addChild(bottom);
middle.addChild(bottom);
fin1 = new ModelRenderer(base, 0, 0); fin1 = new ModelRenderer(base, 0, 0);
fin1.setTextureSize(64,32); fin1.addBox(0F, 0F, 0F, 5, 9, 1);
fin1.addBox(0F, 0F, 0F, 5, 9, 1); fin1.setRotationPoint(0F, 4.5F, 1F);
fin1.setRotationPoint(0F, 4.5F, 1F); setRotation(fin1, 0.05f, 0, 0.5911399F);
setRotation(fin1, 0.05f, 0, 0.5911399F); bottom.addChild(fin1);
bottom.addChild(fin1);
fin2 = new ModelRenderer(base, 0, 0); fin2 = new ModelRenderer(base, 0, 0);
fin2.setTextureSize(64,32); fin2.mirror = true;
fin2.mirror = true; fin2.addBox(-5F, 0F, 0F, 5, 9, 1);
fin2.addBox(-5F, 0F, 0F, 5, 9, 1); fin2.setRotationPoint(6F, 4.5F, 1F);
fin2.setRotationPoint(6F, 4.5F, 1F); setRotation(fin2, 0.05f, 0, -0.591143F);
setRotation(fin2, 0.05f, 0, -0.591143F); bottom.addChild(fin2);
bottom.addChild(fin2);
} }
@Override @Override
public void render(float f5) { public void render(float f5) {
@@ -81,21 +66,12 @@ public class ModelMermaidLegs extends ModelRenderer {
public void setRotationAngles(float par1, float par2, float par3, public void setRotationAngles(float par1, float par2, float par3,
float par4, float par5, float par6, Entity entity) { float par4, float par5, float par6, Entity entity) {
float ani = MathHelper.sin(par1 * 0.6662F); float ani = MathHelper.sin(par1 * 0.6662F);
top.setRotationPoint(-2F, 14F, 1F);
if(ani > 0.2) if(ani > 0.2)
ani /= 3f; ani /= 3f;
if(this.isSleeping || this.isCrawling){ top.rotateAngleX = 0.26F - ani * 0.2F * par2;
top.rotateAngleX = middle.rotateAngleX = bottom.rotateAngleX = fin2.rotateAngleX = 0; middle.rotateAngleX = 0.86f - ani * 0.24F * par2;
} bottom.rotateAngleX = 0.15f - ani * 0.28F * par2;
else{ fin2.rotateAngleX = fin1.rotateAngleX = 0.05f - ani * 0.35F * par2;
top.rotateAngleX = 0.26F - ani * 0.2F * par2;
middle.rotateAngleX = 0.86f - ani * 0.24F * par2;
bottom.rotateAngleX = 0.15f - ani * 0.28F * par2;
fin2.rotateAngleX = fin1.rotateAngleX = 0.05f - ani * 0.35F * par2;
if(entity.isSneaking()){
top.setRotationPoint(-2F, 12F, 6F);
}
}
} }
} }
@@ -1,122 +0,0 @@
package noppes.npcs.client.model.part.legs;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
import noppes.npcs.ModelData;
import noppes.npcs.constants.EnumAnimation;
public class ModelMermaidLegs2 extends ModelRenderer {
ModelRenderer Tail1;
ModelRenderer Tail2;
ModelRenderer Tail3;
ModelRenderer Tail4;
ModelRenderer Tail5;
ModelRenderer Tail6;
ModelRenderer Tail7;
ModelRenderer Tail8;
public boolean isRiding = false;
public boolean isSneaking = false;
public boolean isSleeping = false;
public boolean isCrawling = false;
public ModelMermaidLegs2(ModelBase base) {
super(base);
textureWidth = 64;
textureHeight = 32;
Tail1 = new ModelRenderer(base, 0, 18);
Tail1.setTextureSize(64,32);
Tail1.addBox(0F, 0F, 0F, 8, 6, 4);
Tail1.setRotationPoint(-4F, 12F, -2F);
setRotation(Tail1, 0.075F, 0F, 0F);
Tail2 = new ModelRenderer(base, 0, 18);
Tail2.setTextureSize(64,32);
Tail2.addBox(0F, 0F, 0F, 6, 5, 3);
Tail2.setRotationPoint(1F, 5.5F, 0.3F);
setRotation(Tail2, 0.56F, 0F, 0F);
Tail1.addChild(Tail2);
Tail3 = new ModelRenderer(base, 0, 18);
Tail3.setTextureSize(64,32);
Tail3.addBox(0F, 0F, 0F, 5, 5, 2);
Tail3.setRotationPoint(5.5F, 4F, 2.5F);
setRotation(Tail3, -0.37818F, 3.141593F, 0F);
Tail2.addChild(Tail3);
Tail4 = new ModelRenderer(base, 0, 20);
Tail4.setTextureSize(64,32);
Tail4.addBox(0F, 0F, 0F, 4, 3, 1);
Tail4.setRotationPoint(0.5F, 4.5F, 0.5F);
setRotation(Tail4, -0.1f, 0, 0F);
Tail3.addChild(Tail4);
Tail5 = new ModelRenderer(base, 0, 20);
Tail5.setTextureSize(64,32);
Tail5.addBox(0F, 0F, 0F, 1, 3, 1);
Tail5.setRotationPoint(-1F, 1.5F, 0F);
setRotation(Tail5, 0, 0, 0F);
Tail4.addChild(Tail5);
Tail6 = new ModelRenderer(base, 0, 20);
Tail6.setTextureSize(64,32);
Tail6.addBox(0F, 0F, 0F, 1, 3, 1);
Tail6.setRotationPoint(-2F, 3F, 0F);
setRotation(Tail6, 0, 0, 0F);
Tail4.addChild(Tail6);
Tail7 = new ModelRenderer(base, 0, 20);
Tail7.setTextureSize(64,32);
Tail7.addBox(0F, 0F, 0F, 1, 3, 1);
Tail7.setRotationPoint(4F, 1.5F, 0F);
setRotation(Tail7, 0, 0, 0F);
Tail4.addChild(Tail7);
Tail8 = new ModelRenderer(base, 0, 20);
Tail8.setTextureSize(64,32);
Tail8.addBox(0F, 0F, 0F, 1, 3, 1);
Tail8.setRotationPoint(5F, 3F, 0F);
setRotation(Tail8, 0, 0, 0F);
Tail4.addChild(Tail8);
}
@Override
public void render(float f5) {
if (isHidden || !showModel)
return;
Tail1.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6,
Entity entity) {
Tail1.setRotationPoint(-4F, 12F, -2F);
float ani = MathHelper.sin(par1 * 0.6662F);
if (ani > 0.2)
ani /= 3f;
if(this.isSleeping || this.isCrawling){
Tail1.rotateAngleX = Tail2.rotateAngleX = Tail3.rotateAngleX = Tail4.rotateAngleX = 0;
}
else{
Tail1.rotateAngleX = 0.2F - ani * 0.2F * par2;
Tail2.rotateAngleX = 0.56F - ani * 0.24F * par2;
Tail3.rotateAngleX = -0.4F + ani * 0.24F * par2;
Tail4.rotateAngleX = -0.1f + ani * 0.10F * par2;
if(entity.isSneaking()){
Tail1.setRotationPoint(-4F, 10F, 3F);
}
}
}
}
@@ -25,11 +25,8 @@ public class ModelNagaLegs extends ModelRenderer{
super(base); super(base);
nagaPart1 = new ModelRenderer(base,0,0); nagaPart1 = new ModelRenderer(base,0,0);
// nagaPart1.setTextureSize(64,32);
ModelRenderer legPart = new ModelRenderer(base,0,16); ModelRenderer legPart = new ModelRenderer(base,0,16);
// legPart.setTextureSize(64,32);
legPart.addBox(0, -2, -2, 4, 4, 4); legPart.addBox(0, -2, -2, 4, 4, 4);
legPart.setRotationPoint(-4, 0, 0); legPart.setRotationPoint(-4, 0, 0);
nagaPart1.addChild(legPart); nagaPart1.addChild(legPart);
@@ -39,11 +36,9 @@ public class ModelNagaLegs extends ModelRenderer{
nagaPart1.addChild(legPart); nagaPart1.addChild(legPart);
nagaPart2 = new ModelRenderer(base,0,0); nagaPart2 = new ModelRenderer(base,0,0);
// nagaPart2.setTextureSize(64,32);
nagaPart2.childModels = nagaPart1.childModels; nagaPart2.childModels = nagaPart1.childModels;
nagaPart3 = new ModelRenderer(base,0,0); nagaPart3 = new ModelRenderer(base,0,0);
// nagaPart3.setTextureSize(64,32);
ModelPlaneRenderer plane = new ModelPlaneRenderer(base, 4, 24); ModelPlaneRenderer plane = new ModelPlaneRenderer(base, 4, 24);
plane.addBackPlane(0,-2, 0, 4, 4); plane.addBackPlane(0,-2, 0, 4, 4);
@@ -94,11 +89,9 @@ public class ModelNagaLegs extends ModelRenderer{
nagaPart3.addChild(plane); nagaPart3.addChild(plane);
nagaPart4 = new ModelRenderer(base,0,0); nagaPart4 = new ModelRenderer(base,0,0);
// nagaPart4.setTextureSize(64,32);
nagaPart4.childModels = nagaPart3.childModels; nagaPart4.childModels = nagaPart3.childModels;
nagaPart5 = new ModelRenderer(base,0,0); nagaPart5 = new ModelRenderer(base,0,0);
// nagaPart5.setTextureSize(64,32);
legPart = new ModelRenderer(base,56,20); legPart = new ModelRenderer(base,56,20);
legPart.addBox(0, 0, -2, 2, 5, 2); legPart.addBox(0, 0, -2, 2, 5, 2);
@@ -14,49 +14,38 @@ public class ModelDragonTail extends ModelRenderer {
int y = 16; int y = 16;
ModelRenderer dragon = new ModelRenderer(base, x, y); ModelRenderer dragon = new ModelRenderer(base, x, y);
dragon.setTextureSize(64,32);
dragon.setRotationPoint(0F, 0F, 3F); dragon.setRotationPoint(0F, 0F, 3F);
this.addChild(dragon); this.addChild(dragon);
ModelRenderer DragonTail2 = new ModelRenderer(base, x, y); ModelRenderer DragonTail2 = new ModelRenderer(base, x, y);
DragonTail2.setTextureSize(64, 32);
DragonTail2.setRotationPoint(0F, 2F, 2F); DragonTail2.setRotationPoint(0F, 2F, 2F);
ModelRenderer DragonTail3 = new ModelRenderer(base, x, y); ModelRenderer DragonTail3 = new ModelRenderer(base, x, y);
DragonTail3.setTextureSize(64, 32);
DragonTail3.setRotationPoint(0F, 4.5F, 4F); DragonTail3.setRotationPoint(0F, 4.5F, 4F);
ModelRenderer DragonTail4 = new ModelRenderer(base, x, y); ModelRenderer DragonTail4 = new ModelRenderer(base, x, y);
DragonTail4.setTextureSize(64, 32);
DragonTail4.setRotationPoint(0F, 7F, 5.75F); DragonTail4.setRotationPoint(0F, 7F, 5.75F);
ModelRenderer DragonTail5 = new ModelRenderer(base, x, y); ModelRenderer DragonTail5 = new ModelRenderer(base, x, y);
DragonTail5.setTextureSize(64, 32);
DragonTail5.setRotationPoint(0F, 9F, 8F); DragonTail5.setRotationPoint(0F, 9F, 8F);
ModelPlaneRenderer planeLeft = new ModelPlaneRenderer(base, x, y); ModelPlaneRenderer planeLeft = new ModelPlaneRenderer(base, x, y);
planeLeft.setTextureSize(64, 32);
planeLeft.addSidePlane(-1.5F, -1.5F, -1.5F, 3, 3); planeLeft.addSidePlane(-1.5F, -1.5F, -1.5F, 3, 3);
ModelPlaneRenderer planeRight = new ModelPlaneRenderer(base, x, y); ModelPlaneRenderer planeRight = new ModelPlaneRenderer(base, x, y);
planeRight.setTextureSize(64, 32);
planeRight.addSidePlane(-1.5F, -1.5F, -1.5F, 3, 3); planeRight.addSidePlane(-1.5F, -1.5F, -1.5F, 3, 3);
setRotation(planeRight, (float)Math.PI, (float)Math.PI ,0); setRotation(planeRight, (float)Math.PI, (float)Math.PI ,0);
ModelPlaneRenderer planeTop = new ModelPlaneRenderer(base, x, y); ModelPlaneRenderer planeTop = new ModelPlaneRenderer(base, x, y);
planeTop.setTextureSize(64, 32);
planeTop.addTopPlane(-1.5F, -1.5F, -1.5F, 3, 3); planeTop.addTopPlane(-1.5F, -1.5F, -1.5F, 3, 3);
setRotation(planeTop, 0 ,-(float)Math.PI / 2,0); setRotation(planeTop, 0 ,-(float)Math.PI / 2,0);
ModelPlaneRenderer planeBottom = new ModelPlaneRenderer(base, x, y); ModelPlaneRenderer planeBottom = new ModelPlaneRenderer(base, x, y);
planeBottom.setTextureSize(64, 32);
planeBottom.addTopPlane(-1.5F, -1.5F, -1.5F, 3, 3); planeBottom.addTopPlane(-1.5F, -1.5F, -1.5F, 3, 3);
setRotation(planeBottom, 0 ,-(float)Math.PI / 2, (float)Math.PI); setRotation(planeBottom, 0 ,-(float)Math.PI / 2, (float)Math.PI);
ModelPlaneRenderer planeBack = new ModelPlaneRenderer(base, x, y); ModelPlaneRenderer planeBack = new ModelPlaneRenderer(base, x, y);
planeBack.setTextureSize(64, 32);
planeBack.addBackPlane(-1.5F, -1.5F, -1.5F, 3, 3); planeBack.addBackPlane(-1.5F, -1.5F, -1.5F, 3, 3);
setRotation(planeBack, 0, 0 ,(float)Math.PI / 2); setRotation(planeBack, 0, 0 ,(float)Math.PI / 2);
ModelPlaneRenderer planeFront = new ModelPlaneRenderer(base, x, y); ModelPlaneRenderer planeFront = new ModelPlaneRenderer(base, x, y);
planeFront.setTextureSize(64, 32);
planeFront.addBackPlane(-1.5F, -1.5F, -1.5F, 3, 3); planeFront.addBackPlane(-1.5F, -1.5F, -1.5F, 3, 3);
setRotation(planeFront, 0, (float)Math.PI ,-(float)Math.PI / 2); setRotation(planeFront, 0, (float)Math.PI ,-(float)Math.PI / 2);
@@ -1,66 +0,0 @@
package noppes.npcs.client.model.part.tails;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelFeatherTail extends ModelRenderer {
ModelRenderer feather1;
ModelRenderer feather2;
ModelRenderer feather3;
ModelRenderer feather4;
ModelRenderer feather5;
public ModelFeatherTail(ModelBiped base) {
super(base);
int x = 56;
int y = 16;
feather1 = new ModelRenderer(base, x, y);
feather1.setTextureSize(64,32);
feather1.addBox(-1.5F, 0F, 0F, 3, 8, 0);
feather1.setRotationPoint(1F, -0.5F, 2F);
setRotation(feather1, 1.482807F, 0.2602503F, 0.1487144F);
addChild(feather1);
feather2 = new ModelRenderer(base, x, y);
feather2.setTextureSize(64,32);
feather2.addBox(-1.5F, 0F, 0F, 3, 8, 0);
feather2.setRotationPoint(0F, -0.5F, 1F);
setRotation(feather2, 1.200559F, 0.3717861F, 0.1858931F);
addChild(feather2);
feather3 = new ModelRenderer(base, x, y);
feather3.setTextureSize(64,32);
feather3.mirror = true;
feather3.addBox(-1.5F, -0.5F, 0F, 3, 8, 0);
feather3.setRotationPoint(-1F, 0, 2F);
setRotation(feather3, 1.256389F, -0.4089647F, -0.4833219F);
addChild(feather3);
feather4 = new ModelRenderer(base, x, y);
feather4.setTextureSize(64,32);
feather4.addBox(-1.5F, 0F, 0F, 3, 8, 0);
feather4.setRotationPoint(0F, -0.5F, 2F);
setRotation(feather4, 1.786329F, 0F, 0F);
addChild(feather4);
feather5 = new ModelRenderer(base, x, y);
feather5.setTextureSize(64,32);
feather5.mirror = true;
feather5.addBox(-1.5F, 0F, 0F, 3, 8, 0);
feather5.setRotationPoint(-1F, -0.5F, 2F);
setRotation(feather5, 1.570073F, -0.2602503F, -0.2230717F);
addChild(feather5);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
@@ -1,35 +0,0 @@
package noppes.npcs.client.model.part.tails;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import noppes.npcs.client.model.ModelMPM;
public class ModelRodentTail extends ModelRenderer {
ModelRenderer Shape1;
ModelRenderer Shape2;
public ModelRodentTail(ModelMPM base) {
super(base);
Shape1 = new ModelRenderer(base, 0, 0);
Shape1.setTextureSize(64,32);
Shape1.addBox(-0.5333334F, -0.4666667F, -1F, 1, 1, 6);
Shape1.setRotationPoint(0F, 0F, 2F);
setRotation(Shape1, -0.9294653F, 0F, 0F);
addChild(Shape1);
Shape2 = new ModelRenderer(base, 1, 1);
Shape2.setTextureSize(64,32);
Shape2.addBox(-0.5F, -0.1666667F, 1F, 1, 1, 5);
Shape2.setRotationPoint(0F, 3F, 4F);
setRotation(Shape2, -0.4833219F, 0F, 0F);
addChild(Shape2);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
@@ -16,35 +16,30 @@ public class ModelSquirrelTail extends ModelRenderer {
textureHeight = 32; textureHeight = 32;
ModelRenderer Shape1 = new ModelRenderer(base, 0, 0); ModelRenderer Shape1 = new ModelRenderer(base, 0, 0);
Shape1.setTextureSize(64,32);
Shape1.addBox(-1F, -1F, -1F, 2, 2, 3); Shape1.addBox(-1F, -1F, -1F, 2, 2, 3);
Shape1.setRotationPoint(0F, -1F, 3F); Shape1.setRotationPoint(0F, -1F, 3F);
setRotation(Shape1, 0F, 0F, 0F); setRotation(Shape1, 0F, 0F, 0F);
this.addChild(Shape1); this.addChild(Shape1);
ModelRenderer Shape2 = new ModelRenderer(base, 0, 9); ModelRenderer Shape2 = new ModelRenderer(base, 0, 9);
Shape2.setTextureSize(64,32);
Shape2.addBox(-2F, -5F, -1F, 4, 5, 3); Shape2.addBox(-2F, -5F, -1F, 4, 5, 3);
Shape2.setRotationPoint(0F, 0F, 1F); Shape2.setRotationPoint(0F, 0F, 1F);
setRotation(Shape2, -0.37F, 0F, 0F); setRotation(Shape2, -0.37F, 0F, 0F);
Shape1.addChild(Shape2); Shape1.addChild(Shape2);
ModelRenderer Shape3 = new ModelRenderer(base, 0, 18); ModelRenderer Shape3 = new ModelRenderer(base, 0, 18);
Shape3.setTextureSize(64,32);
Shape3.addBox(-2.466667F, -6F, -1F, 5, 7, 3); Shape3.addBox(-2.466667F, -6F, -1F, 5, 7, 3);
Shape3.setRotationPoint(0F, -5F, 0F); Shape3.setRotationPoint(0F, -5F, 0F);
setRotation(Shape3, 0.3f, 0F, 0F); setRotation(Shape3, 0.3f, 0F, 0F);
Shape2.addChild(Shape3); Shape2.addChild(Shape3);
ModelRenderer Shape4 = new ModelRenderer(base, 25, 0); ModelRenderer Shape4 = new ModelRenderer(base, 25, 0);
Shape4.setTextureSize(64,32);
Shape4.addBox(-3F, -0.6F, -1F, 6, 5, 3); Shape4.addBox(-3F, -0.6F, -1F, 6, 5, 3);
Shape4.setRotationPoint(0F, -5F, 1F); Shape4.setRotationPoint(0F, -5F, 1F);
setRotation(Shape4, 2.5F, 0F, 0F); setRotation(Shape4, 2.5F, 0F, 0F);
Shape3.addChild(Shape4); Shape3.addChild(Shape4);
ModelRenderer Shape5 = new ModelRenderer(base, 25, 10); ModelRenderer Shape5 = new ModelRenderer(base, 25, 10);
Shape5.setTextureSize(64,32);
Shape5.addBox(-3F, -2F, -1F, 6, 3, 5); Shape5.addBox(-3F, -2F, -1F, 6, 3, 5);
Shape5.setRotationPoint(0F, 3.5F, 0F); Shape5.setRotationPoint(0F, 3.5F, 0F);
setRotation(Shape5, -2.5F, 0F, 0F); setRotation(Shape5, -2.5F, 0F, 0F);
@@ -1,52 +0,0 @@
package noppes.npcs.client.model.part.tails;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import noppes.npcs.client.model.ModelMPM;
public class ModelTailFin extends ModelRenderer {
public ModelTailFin(ModelMPM base) {
super(base);
textureWidth = 64;
textureHeight = 32;
ModelRenderer Shape1 = new ModelRenderer(base, 0, 0);
Shape1.setTextureSize(64,32);
Shape1.addBox(-2F, -2F, -2F, 3, 3, 8);
Shape1.setRotationPoint(0.5F, 0F, 1F);
setRotation(Shape1, -0.669215F, 0F, 0F);
addChild(Shape1);
ModelRenderer Shape2 = new ModelRenderer(base, 2, 2);
Shape2.setTextureSize(64,32);
Shape2.addBox(-1F, -1F, 1F, 3, 2, 6);
Shape2.setRotationPoint(-0.5F, 3F, 4.5F);
setRotation(Shape2, -0.2602503F, 0F, 0F);
addChild(Shape2);
ModelRenderer Shape3 = new ModelRenderer(base, 0, 11);
Shape3.setTextureSize(64,32);
Shape3.addBox(-1F, -1F, -1F, 3, 1, 6);
Shape3.setRotationPoint(0.5F, 5F, 12F);
setRotation(Shape3, 0F, 1.07818F, 0F);
addChild(Shape3);
ModelRenderer Shape4 = new ModelRenderer(base, 0, 11);
Shape4.setTextureSize(64,32);
Shape4.mirror = true;
Shape4.addBox(-2F, 0F, -1F, 3, 1, 6);
Shape4.setRotationPoint(-0.5F, 4F, 12F);
setRotation(Shape4, 0F, -1.003822F, 0F);
addChild(Shape4);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
@@ -3,62 +3,42 @@ package noppes.npcs.client.renderer;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.awt.image.DataBufferInt; import java.awt.image.DataBufferInt;
import java.awt.image.ImageObserver;
import net.minecraft.client.renderer.ImageBufferDownload; import net.minecraft.client.renderer.ImageBufferDownload;
public class ImageBufferDownloadAlt extends ImageBufferDownload { public class ImageBufferDownloadAlt extends ImageBufferDownload
{
private int imageData[]; private int imageData[];
private int imageWidth; private int imageWidth;
private int imageHeight; private int imageHeight;
private boolean version;
// If Version == true, use 64 Loader
public ImageBufferDownloadAlt(boolean ver){
this.version = ver;
}
@Override @Override
public BufferedImage parseUserSkin(BufferedImage bufferedimage) { public BufferedImage parseUserSkin(BufferedImage bufferedimage)
{
imageWidth = bufferedimage.getWidth(null);
imageHeight = imageWidth / 2;
if(this.version){ BufferedImage bufferedimage1 = new BufferedImage(imageWidth, imageHeight, 2);
imageWidth = bufferedimage.getWidth(null); Graphics g = bufferedimage1.getGraphics();
imageHeight = bufferedimage.getHeight(null); g.drawImage(bufferedimage, 0, 0, null);
g.dispose();
BufferedImage bufferedimage1 = new BufferedImage(imageWidth, imageHeight, 2); imageData = ((DataBufferInt)bufferedimage1.getRaster().getDataBuffer()).getData();
Graphics g = bufferedimage1.getGraphics(); setAreaTransparent(imageWidth / 2, 0, imageWidth, imageHeight / 2);
g.drawImage(bufferedimage, 0, 0, null); return bufferedimage1;
g.dispose();
imageData = ((DataBufferInt) bufferedimage1.getRaster().getDataBuffer()).getData();
setAreaTransparent(imageWidth / 2, 0, imageWidth, imageHeight / 4);
return bufferedimage1;
}
else{
imageWidth = bufferedimage.getWidth(null);
imageHeight = imageWidth / 2;
BufferedImage bufferedimage1 = new BufferedImage(imageWidth, imageHeight, 2);
Graphics g = bufferedimage1.getGraphics();
g.drawImage(bufferedimage, 0, 0, null);
g.dispose();
imageData = ((DataBufferInt)bufferedimage1.getRaster().getDataBuffer()).getData();
setAreaTransparent(imageWidth / 2, 0, imageWidth, imageHeight / 2);
return bufferedimage1;
}
} }
/** /**
* Makes the given area of the image transparent if it was previously completely opaque (used to remove the outer * Makes the given area of the image transparent if it was previously completely opaque (used to remove the outer
* layer of a skin around the head if it was saved all opaque; this would be redundant so it's assumed that the skin * layer of a skin around the head if it was saved all opaque; this would be redundant so it's assumed that the skin
* maker is just using an image editor without an alpha channel) * maker is just using an image editor without an alpha channel)
*/ */
private void setAreaTransparent(int par1, int par2, int par3, int par4) { private void setAreaTransparent(int par1, int par2, int par3, int par4)
if (!this.hasTransparency(par1, par2, par3, par4)) { {
for (int i1 = par1; i1 < par3; ++i1) { if (!this.hasTransparency(par1, par2, par3, par4))
for (int j1 = par2; j1 < par4; ++j1) { {
for (int i1 = par1; i1 < par3; ++i1)
{
for (int j1 = par2; j1 < par4; ++j1)
{
this.imageData[i1 + j1 * this.imageWidth] &= 16777215; this.imageData[i1 + j1 * this.imageWidth] &= 16777215;
} }
} }
@@ -68,12 +48,16 @@ public class ImageBufferDownloadAlt extends ImageBufferDownload {
/** /**
* Returns true if the given area of the image contains transparent pixels * Returns true if the given area of the image contains transparent pixels
*/ */
private boolean hasTransparency(int par1, int par2, int par3, int par4) { private boolean hasTransparency(int par1, int par2, int par3, int par4)
for (int i1 = par1; i1 < par3; ++i1) { {
for (int j1 = par2; j1 < par4; ++j1) { for (int i1 = par1; i1 < par3; ++i1)
{
for (int j1 = par2; j1 < par4; ++j1)
{
int k1 = this.imageData[i1 + j1 * this.imageWidth]; int k1 = this.imageData[i1 + j1 * this.imageWidth];
if ((k1 >> 24 & 255) < 128) { if ((k1 >> 24 & 255) < 128)
{
return true; return true;
} }
} }
@@ -81,4 +65,191 @@ public class ImageBufferDownloadAlt extends ImageBufferDownload {
return false; return false;
} }
//
// private boolean loadPlayerData(BufferedImage bufferedimage,EntityPlayer player) {
// if(player == null)
// return false;
// PlayerData data = RenderMorePlayer.getPlayerData(player);
// data.setPlayerModel(checkSkin(bufferedimage,player.username));
// data.isChanged = true;
// return data.model != null;
// }
// public static ModelData checkSkin(BufferedImage bufferedimage,String player){
// if(bufferedimage == null)
// return null;
//
// if (!new Color(bufferedimage.getRGB(0, 0), true).equals(new Color(128, 128, 128, 255))) {
// return null;
// }
// ModelData data = new ModelData();
// Color type = new Color(bufferedimage.getRGB(1, 0), true);
// if (type.equals(new Color(255, 0, 255, 255))) {
// data.type = EnumPlayerModelType.HUMANFEMALE;
// data.mainModel = new ModelHumanFemale(data,0);
// data.modelArmor = new ModelHumanFemale(data,0.3f);
// data.modelArmorChestplate = new ModelHumanFemale(data,0.8f);
// data.scaleX = 0.9075f;
// data.scaleY = 0.9075f;
// data.scaleZ = 0.9075f;
// } else if (type.equals(new Color(128, 0, 0, 255))) {
// data.type = EnumPlayerModelType.DWARFMALE;
// data.mainModel = new ModelDwarfMale(data,0);
// data.modelArmor = new ModelDwarfMale(data,0.3f);
// data.modelArmorChestplate = new ModelDwarfMale(data,0.8f);
// data.scaleX = 0.85f;
// data.scaleY = 0.6875f;
// data.scaleZ = 0.85f;
// } else if (type.equals(new Color(255, 0, 0, 255))) {
// data.type = EnumPlayerModelType.DWARFFEMALE;
// data.mainModel = new ModelDwarfFemale(data,0);
// data.modelArmor = new ModelDwarfFemale(data,0.3f);
// data.modelArmorChestplate = new ModelDwarfFemale(data,0.8f);
// data.scaleX = 0.75f;
// data.scaleY = 0.6275f;
// data.scaleZ = 0.75f;
// } else if (type.equals(new Color(0, 128, 0, 255))) {
// data.type = EnumPlayerModelType.ORCMALE;
// data.mainModel = new ModelOrcMale(data,0);
// data.modelArmor = new ModelOrcMale(data,0.3f);
// data.modelArmorChestplate = new ModelOrcMale(data,0.8f);
// data.scaleX = 1.2f;
// data.scaleY = 1f;
// data.scaleZ = 1.2f;
// } else if (type.equals(new Color(0, 255, 0, 255))) {
// data.type = EnumPlayerModelType.ORCFEMALE;
// data.mainModel = new ModelOrcFemale(data,0);
// data.modelArmor = new ModelOrcFemale(data,0.3f);
// data.modelArmorChestplate = new ModelOrcFemale(data,0.8f);
// } else if (type.equals(new Color(0, 0, 128, 255))) {
// data.type = EnumPlayerModelType.FURRYMALE;
// data.mainModel = new ModelFurryMale(data,0);
// data.modelArmor = new ModelFurryMale(data,0.3f);
// data.modelArmorChestplate = new ModelFurryMale(data,0.8f);
// } else if (type.equals(new Color(0, 0, 255, 255))) {
// data.type = EnumPlayerModelType.FURRYFEMALE;
// data.mainModel = new ModelFurryFemale(data,0);
// data.modelArmor = new ModelFurryFemale(data,0.3f);
// data.modelArmorChestplate = new ModelFurryFemale(data,0.8f);
// data.scaleX = 0.9075f;
// data.scaleY = 0.9075f;
// data.scaleZ = 0.9075f;
// }else if (type.equals(new Color(255, 128, 0, 255))) {
// data.type = EnumPlayerModelType.MONSTERMALE;
// data.mainModel = new ModelMonsterMale(data,0);
// data.modelArmor = new ModelMonsterMale(data,0.3f);
// data.modelArmorChestplate = new ModelMonsterMale(data,0.8f);
// } else if (type.equals(new Color(255, 255, 0, 255))) {
// data.type = EnumPlayerModelType.MONSTERFEMALE;
// data.mainModel = new ModelMonsterFemale(data,0);
// data.modelArmor = new ModelMonsterFemale(data,0.3f);
// data.modelArmorChestplate = new ModelMonsterFemale(data,0.8f);
// data.scaleX = 0.9075f;
// data.scaleY = 0.9075f;
// data.scaleZ = 0.9075f;
// }else if (type.equals(new Color(0,255, 128, 255))) {
// data.type = EnumPlayerModelType.ELFMALE;
// data.mainModel = new ModelElfMale(data,0);
// data.modelArmor = new ModelElfMale(data,0.3f);
// data.modelArmorChestplate = new ModelElfMale(data,0.8f);
// data.scaleX = 0.85f;
// data.scaleY = 1.07f;
// data.scaleZ = 0.85f;
// } else if (type.equals(new Color(0, 255, 255, 255))) {
// data.type = EnumPlayerModelType.ELFFEMALE;
// data.mainModel = new ModelElfFemale(data,0);
// data.modelArmor = new ModelElfFemale(data,0.3f);
// data.modelArmorChestplate = new ModelElfFemale(data,0.8f);
// data.scaleX = 0.8f;
// data.scaleY = 1f;
// data.scaleZ = 0.8f;
// } else if (type.equals(new Color(32, 32, 32, 255))) {
// data.type = EnumPlayerModelType.ENDER;
// data.mainModel = new ModelEnderChibi(data,0);
// data.modelArmor = new ModelEnderChibi(data,0.3f);
// data.modelArmorChestplate = new ModelEnderChibi(data,0.8f);
// }
// else if (type.equals(new Color(128, 255, 0, 255))) {
// data.type = EnumPlayerModelType.NAGAMALE;
// data.mainModel = new ModelNagaMale(data,0);
// data.modelArmor = new ModelNagaMale(data,0.3f);
// data.modelArmorChestplate = new ModelNagaMale(data,0.8f);
// }
// else if (type.equals(new Color(128, 128, 0, 255))) {
// data.type = EnumPlayerModelType.NAGAFEMALE;
// data.mainModel = new ModelNagaFemale(data,0);
// data.modelArmor = new ModelNagaFemale(data,0.3f);
// data.modelArmorChestplate = new ModelNagaFemale(data,0.8f);
// }
// else if(RenderMorePlayer.superUsers.contains(player)){
// if (type.equals(new Color(66, 66, 66, 255))){
// data.mainModel = new ModelCrystal(data,0);
// data.modelArmor = new ModelCrystal(data,0.3f);
// data.modelArmorChestplate = new ModelCrystal(data,0.8f);
// }
// else if (type.equals(new Color(13, 13, 13, 255))){
// data.mainModel = new ModelFail(data);
// }
// }
//
// Color sizeColor = new Color(bufferedimage.getRGB(2, 0), true);
// int size = 3;
// if (sizeColor.equals(new Color(255, 0, 0, 255)))
// size = 4;
// else if (sizeColor.equals(new Color(0, 255, 0, 255)))
// size = 2;
// else if (sizeColor.equals(new Color(0, 0, 255, 255)))
// size = 1;
// else if (sizeColor.equals(new Color(255, 0, 255, 255)))
// size = 0;
// data.size = size;
//
// Color headVissible = new Color(bufferedimage.getRGB(3, 0), true);
// if (headVissible.equals(new Color(255, 0, 0, 255)))
// data.showHelmet = false;
// else if (headVissible.equals(new Color(0, 255, 0, 255)))
// data.showHeadwear = false;
// else if (headVissible.equals(new Color(255, 255, 0, 255))){
// data.showHeadwear = false;
// data.showHelmet = false;
// }
//
//
// int extraOption1 = getValue(new Color(bufferedimage.getRGB(7, 0), true));
// data.mainModel.setExtraOption1(extraOption1);
// data.modelArmorChestplate.setExtraOption1(extraOption1);
// data.modelArmor.setExtraOption1(extraOption1);
//
// int extraOption2 = getValue(new Color(bufferedimage.getRGB(7, 1), true));
// data.mainModel.setExtraOption2(extraOption2);
// data.modelArmorChestplate.setExtraOption2(extraOption2);
// data.modelArmor.setExtraOption2(extraOption2);
//
// int extraOption3 = getValue(new Color(bufferedimage.getRGB(7, 2), true));
// data.mainModel.setExtraOption3(extraOption3);
// data.modelArmorChestplate.setExtraOption3(extraOption3);
// data.modelArmor.setExtraOption3(extraOption3);
//
// Color color = new Color(bufferedimage.getRGB(7, 3), true);
// data.mainModel.setExtraColor(color);
//
// Color claws = new Color(bufferedimage.getRGB(0, 1), true);
// if (claws.equals(new Color(255, 0, 0, 255)))
// ((ModelInterface)data.mainModel).addClaws();
//
// data.headSize = getValue(new Color(bufferedimage.getRGB(1, 1), true));
//
// data.bellySize = getValue(new Color(bufferedimage.getRGB(2, 1), true));
// return data;
// }
// private static int getValue(Color color){
// if (color.equals(new Color(255, 0, 0, 255)))
// return 1;
// else if (color.equals(new Color(0, 255, 0, 255)))
// return 2;
// else if (color.equals(new Color(0, 0, 255, 255)))
// return 3;
// else if (color.equals(new Color(255, 0, 255, 255)))
// return 4;
// return 0;
// }
} }
@@ -2,7 +2,6 @@ package noppes.npcs.client.renderer;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.NPCRendererHelper; import net.minecraft.client.renderer.entity.NPCRendererHelper;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
@@ -10,10 +9,8 @@ import net.minecraft.client.renderer.entity.RendererLivingEntity;
import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.boss.BossStatus;
import noppes.npcs.client.model.ModelMPM; import noppes.npcs.client.model.ModelMPM;
import noppes.npcs.client.model.util.ModelRenderPassHelper; import noppes.npcs.client.model.util.ModelRenderPassHelper;
import noppes.npcs.constants.EnumStandingType;
import noppes.npcs.controllers.PixelmonHelper; import noppes.npcs.controllers.PixelmonHelper;
import noppes.npcs.entity.EntityCustomNpc; import noppes.npcs.entity.EntityCustomNpc;
import noppes.npcs.entity.EntityNPCInterface; import noppes.npcs.entity.EntityNPCInterface;
@@ -27,7 +24,6 @@ public class RenderCustomNpc extends RenderNPCHumanMale{
private ModelRenderPassHelper renderpass = new ModelRenderPassHelper(); private ModelRenderPassHelper renderpass = new ModelRenderPassHelper();
// Default Renderer
public RenderCustomNpc() { public RenderCustomNpc() {
super(new ModelMPM(0), new ModelMPM(1), new ModelMPM(0.5f)); super(new ModelMPM(0), new ModelMPM(1), new ModelMPM(0.5f));
} }
@@ -110,13 +106,6 @@ public class RenderCustomNpc extends RenderNPCHumanMale{
super.preRenderCallback(entityliving, f); super.preRenderCallback(entityliving, f);
} }
@Override
public void doRender(EntityLiving entityliving, double d, double d1, double d2, float f, float f1){
EntityNPCInterface npc = (EntityNPCInterface) entityliving;
super.doRender(entityliving, d, d1, d2, f, f1);
}
@Override @Override
protected float handleRotationFloat(EntityLivingBase par1EntityLivingBase, float par2){ protected float handleRotationFloat(EntityLivingBase par1EntityLivingBase, float par2){
if(renderEntity != null){ if(renderEntity != null){
@@ -2,8 +2,8 @@ package noppes.npcs.client.renderer;
import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED; import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED;
import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D; import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
@@ -21,7 +21,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.ForgeHooksClient; import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.MinecraftForgeClient;
import noppes.npcs.client.model.ModelMPM;
import noppes.npcs.client.model.ModelNPCMale; import noppes.npcs.client.model.ModelNPCMale;
import noppes.npcs.constants.EnumAnimation; import noppes.npcs.constants.EnumAnimation;
import noppes.npcs.entity.EntityCustomNpc; import noppes.npcs.entity.EntityCustomNpc;
@@ -38,15 +37,10 @@ public class RenderNPCHumanMale extends RenderNPCInterface
protected ModelNPCMale modelArmorChestplate; protected ModelNPCMale modelArmorChestplate;
protected ModelNPCMale modelArmor; protected ModelNPCMale modelArmor;
protected final ModelNPCMale originalBipedMain;
protected final ModelMPM steve = new ModelMPM(0, false);
protected final ModelMPM alex = new ModelMPM(0, true);
public RenderNPCHumanMale(ModelNPCMale mainmodel, ModelNPCMale armorChest, ModelNPCMale armor) public RenderNPCHumanMale(ModelNPCMale mainmodel, ModelNPCMale armorChest, ModelNPCMale armor)
{ {
super(mainmodel, 0.5F); super(mainmodel, 0.5F);
modelBipedMain = mainmodel; modelBipedMain = mainmodel;
originalBipedMain = mainmodel;
modelArmorChestplate = armorChest; modelArmorChestplate = armorChest;
modelArmor = armor; modelArmor = armor;
} }
@@ -116,29 +110,6 @@ public class RenderNPCHumanMale extends RenderNPCInterface
public void renderPlayer(EntityNPCInterface npc, double d, double d1, double d2, public void renderPlayer(EntityNPCInterface npc, double d, double d1, double d2,
float f, float f1) float f, float f1)
{ {
// SEEMS TO WORK FOR NOW. Keeps NPC from outsyncing with Creature Models
if(npc instanceof EntityCustomNpc){
EntityCustomNpc test = (EntityCustomNpc) npc;
if(test.modelData.entityClass == null){
int modelVal = npc.display.modelType;
if(modelVal == 1){
this.mainModel = steve;
this.modelBipedMain = steve;
}
else if(modelVal == 2){
this.mainModel = alex;
this.modelBipedMain = alex;
}
else{
((EntityCustomNpc) npc).modelData.bodywear = 0;
((EntityCustomNpc) npc).modelData.armwear = 0;
((EntityCustomNpc) npc).modelData.legwear = 0;
this.mainModel = originalModel;
this.modelBipedMain = originalBipedMain;
}
}
}
ItemStack itemstack = npc.getHeldItem(); ItemStack itemstack = npc.getHeldItem();
modelArmorChestplate.heldItemRight = modelArmor.heldItemRight = modelBipedMain.heldItemRight = modelArmorChestplate.heldItemRight = modelArmor.heldItemRight = modelBipedMain.heldItemRight =
itemstack == null ? 0 : npc.hurtResistantTime > 0 ? 3 : 1; itemstack == null ? 0 : npc.hurtResistantTime > 0 ? 3 : 1;
@@ -34,12 +34,8 @@ import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
public class RenderNPCInterface extends RenderLiving{ public class RenderNPCInterface extends RenderLiving{
public static long LastTextureTick = 0; public static long LastTextureTick = 0;
public ModelBase originalModel;
public RenderNPCInterface(ModelBase model, float f){ public RenderNPCInterface(ModelBase model, float f){
super(model, f); super(model, f);
this.originalModel = model;
} }
protected void renderName(EntityNPCInterface npc, double d, double d1, double d2) { protected void renderName(EntityNPCInterface npc, double d, double d1, double d2) {
@@ -179,6 +175,29 @@ public class RenderNPCInterface extends RenderLiving{
} }
else { else {
super.rotateCorpse(npc, f, f1, f2); super.rotateCorpse(npc, f, f1, f2);
// if(npc.deathTime > 0)
// {
// float x = (float) -Math.cos(Math.toRadians(180 - f1));
// float y = (float) -Math.sin(Math.toRadians(f1));
// x = (x/ 5f) * npc.getModelSize();
// y = (y/ 5f) * npc.getModelSize();
// GL11.glTranslatef(x, 0, y);
//
//
// float f3 = ((((float)npc.deathTime+ f2) - 1.0F) / 20F) * 1.6F;
// f3 = MathHelper.sqrt_float(f3);
// if(f3 > 1.0F)
// {
// f3 = 1.0F;
// }
// GL11.glRotatef(f1, 0.0F, 1.0F, 0.0F);
// GL11.glRotatef(f3 * getDeathMaxRotation(npc), 0.0F, 0.0F, 1.0F);
// GL11.glRotatef(180F - f1, 0.0F, 1.0F, 0.0F);
// }
// else
// {
// GL11.glRotatef(180F - f1, 0.0F, 1.0F, 0.0F);
// }
} }
} }
@@ -195,7 +214,6 @@ public class RenderNPCInterface extends RenderLiving{
@Override @Override
public void doRender(EntityLiving entityliving, double d, double d1, double d2, float f, float f1){ public void doRender(EntityLiving entityliving, double d, double d1, double d2, float f, float f1){
EntityNPCInterface npc = (EntityNPCInterface) entityliving; EntityNPCInterface npc = (EntityNPCInterface) entityliving;
if(npc.isKilled() && npc.stats.hideKilledBody && npc.deathTime > 20){ if(npc.isKilled() && npc.stats.hideKilledBody && npc.deathTime > 20){
return; return;
} }
@@ -264,26 +282,22 @@ public class RenderNPCInterface extends RenderLiving{
@Override @Override
public ResourceLocation getEntityTexture(Entity entity) { public ResourceLocation getEntityTexture(Entity entity) {
EntityNPCInterface npc = (EntityNPCInterface) entity; EntityNPCInterface npc = (EntityNPCInterface) entity;
if(npc.textureLocation == null){ if(npc.textureLocation == null){
if(npc.display.skinType == 0) { if(npc.display.skinType == 0)
if (!(npc.display.texture).equals("")) { npc.textureLocation = new ResourceLocation(npc.display.texture);
npc.textureLocation = new ResourceLocation(npc.display.texture);
}
}
else if(LastTextureTick < 5){ //fixes request flood somewhat else if(LastTextureTick < 5){ //fixes request flood somewhat
return AbstractClientPlayer.locationStevePng; return AbstractClientPlayer.locationStevePng;
} }
else if(npc.display.skinType == 1 && npc.display.playerProfile != null){ else if(npc.display.skinType == 1 && npc.display.playerProfile != null){
Minecraft minecraft = Minecraft.getMinecraft(); Minecraft minecraft = Minecraft.getMinecraft();
Map map = minecraft.func_152342_ad().func_152788_a(npc.display.playerProfile); Map map = minecraft.func_152342_ad().func_152788_a(npc.display.playerProfile);
if (map.containsKey(Type.SKIN)){ if (map.containsKey(Type.SKIN)){
npc.textureLocation = minecraft.func_152342_ad().func_152792_a((MinecraftProfileTexture)map.get(Type.SKIN), Type.SKIN); npc.textureLocation = minecraft.func_152342_ad().func_152792_a((MinecraftProfileTexture)map.get(Type.SKIN), Type.SKIN);
} }
LastTextureTick = 0; LastTextureTick = 0;
} }
else if(npc.display.skinType == 2 || npc.display.skinType == 3){ else if(npc.display.skinType == 2){
try{ try{
MessageDigest digest = MessageDigest.getInstance("MD5"); MessageDigest digest = MessageDigest.getInstance("MD5");
byte[] hash = digest.digest(npc.display.url.getBytes("UTF-8")); byte[] hash = digest.digest(npc.display.url.getBytes("UTF-8"));
@@ -291,15 +305,8 @@ public class RenderNPCInterface extends RenderLiving{
for(byte b : hash){ for(byte b : hash){
sb.append(String.format("%02x", b&0xff)); sb.append(String.format("%02x", b&0xff));
} }
// SKIN CHANGE npc.textureLocation = new ResourceLocation("skins/" + sb.toString());
if(npc.display.skinType == 2){ func_110301_a(null, npc.textureLocation, npc.display.url);
npc.textureLocation = new ResourceLocation("skins/" + sb.toString());
loadSkin(null, npc.textureLocation, npc.display.url, false);
}
else{
npc.textureLocation = new ResourceLocation("skins64/" + sb.toString());
loadSkin(null, npc.textureLocation, npc.display.url, true);
}
LastTextureTick = 0; LastTextureTick = 0;
} }
catch(Exception ex){ catch(Exception ex){
@@ -312,11 +319,9 @@ public class RenderNPCInterface extends RenderLiving{
return npc.textureLocation; return npc.textureLocation;
} }
// 64x64 Skin is True private void func_110301_a(File file, ResourceLocation resource, String par1Str){
private void loadSkin(File file, ResourceLocation resource, String par1Str, boolean version){
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
ITextureObject object = new ImageDownloadAlt(file, par1Str, SkinManager.field_152793_a, new ImageBufferDownloadAlt(version)); ITextureObject object = new ImageDownloadAlt(file, par1Str, SkinManager.field_152793_a, new ImageBufferDownloadAlt());
texturemanager.loadTexture(resource, object); texturemanager.loadTexture(resource, object);
} }
} }
@@ -291,6 +291,12 @@ public class GlyphCache
} }
} }
Font fa = new Font("Arial Unicode MS", Font.PLAIN, fontSize);
if(fa.canDisplayUpTo(text, start, limit) != start){
usedFonts.add(fa);
return fa;
}
/* If still not found, try searching through all fonts installed on the system for the first that can layout this string */ /* If still not found, try searching through all fonts installed on the system for the first that can layout this string */
iterator = allFonts.iterator(); iterator = allFonts.iterator();
while(iterator.hasNext()) while(iterator.hasNext())
@@ -14,13 +14,16 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import noppes.npcs.CustomNpcs; import noppes.npcs.CustomNpcs;
import noppes.npcs.LogWriter; import noppes.npcs.LogWriter;
import noppes.npcs.util.CustomNPCsScheduler;
import noppes.npcs.util.NBTJsonUtil; import noppes.npcs.util.NBTJsonUtil;
public class PlayerDataController { public class PlayerDataController {
public static PlayerDataController instance; public static PlayerDataController instance;
public Map<String, String> nameUUIDs;
public PlayerDataController(){ public PlayerDataController(){
instance = this; instance = this;
nameUUIDs = getUsernameData();
} }
public File getSaveDir(){ public File getSaveDir(){
try{ try{
@@ -72,11 +75,10 @@ public class PlayerDataController {
String filename = player; String filename = player;
if(filename.isEmpty()) if(filename.isEmpty())
filename = "noplayername"; filename = "noplayername";
filename += ".json";
try { try {
File file = new File(saveDir, filename); File file = new File(saveDir, filename + ".json");
if(file.exists()){ if(file.exists()){
return NBTJsonUtil.LoadFile(file); return NBTJsonUtil.LoadFile(file);
} }
} catch (Exception e) { } catch (Exception e) {
LogWriter.error("Error loading: " + filename, e); LogWriter.error("Error loading: " + filename, e);
@@ -86,20 +88,26 @@ public class PlayerDataController {
} }
public void savePlayerData(PlayerData data){ public void savePlayerData(PlayerData data){
NBTTagCompound compound = data.getNBT(); final NBTTagCompound compound = data.getNBT();
String filename = data.uuid + ".json"; final String filename = data.uuid + ".json";
try { nameUUIDs.put(data.playername, data.uuid);
File saveDir = getSaveDir(); CustomNPCsScheduler.runTack(new Runnable(){
File file = new File(saveDir, filename+"_new"); @Override
File file1 = new File(saveDir, filename); public void run() {
NBTJsonUtil.SaveFile(file, compound); try {
if(file1.exists()){ File saveDir = getSaveDir();
file1.delete(); File file = new File(saveDir, filename+"_new");
} File file1 = new File(saveDir, filename);
file.renameTo(file1); NBTJsonUtil.SaveFile(file, compound);
} catch (Exception e) { if(file1.exists()){
LogWriter.except(e); file1.delete();
} }
file.renameTo(file1);
} catch (Exception e) {
LogWriter.except(e);
}
}
});
} }
public PlayerBankData getBankData(EntityPlayer player, int bankId) { public PlayerBankData getBankData(EntityPlayer player, int bankId) {
@@ -122,7 +130,7 @@ public class PlayerDataController {
return data; return data;
} }
public String hasPlayer(String username) { public String hasPlayer(String username) {
for(String name : getUsernameData().keySet()){ for(String name : nameUUIDs.keySet()){
if(name.equalsIgnoreCase(username)) if(name.equalsIgnoreCase(username))
return name; return name;
} }
@@ -134,11 +142,10 @@ public class PlayerDataController {
EntityPlayer player = MinecraftServer.getServer().getConfigurationManager().func_152612_a(username); EntityPlayer player = MinecraftServer.getServer().getConfigurationManager().func_152612_a(username);
PlayerData data = null; PlayerData data = null;
if(player == null){ if(player == null){
Map<String, NBTTagCompound> map = getUsernameData(); for(String name : nameUUIDs.keySet()){
for(String name : map.keySet()){
if(name.equalsIgnoreCase(username)){ if(name.equalsIgnoreCase(username)){
data = new PlayerData(); data = new PlayerData();
data.setNBT(map.get(name)); data.setNBT(loadPlayerData(nameUUIDs.get(name)));
break; break;
} }
} }
@@ -158,15 +165,15 @@ public class PlayerDataController {
savePlayerData(data); savePlayerData(data);
} }
public Map<String, NBTTagCompound> getUsernameData(){ private Map<String, String> getUsernameData(){
Map<String, NBTTagCompound> map = new HashMap<String, NBTTagCompound>(); Map<String, String> map = new HashMap<String, String>();
for(File file : getSaveDir().listFiles()){ for(File file : getSaveDir().listFiles()){
if(file.isDirectory() || !file.getName().endsWith(".json")) if(file.isDirectory() || !file.getName().endsWith(".json"))
continue; continue;
try { try {
NBTTagCompound compound = NBTJsonUtil.LoadFile(file); NBTTagCompound compound = NBTJsonUtil.LoadFile(file);
if(compound.hasKey("PlayerName")){ if(compound.hasKey("PlayerName")){
map.put(compound.getString("PlayerName"), compound); map.put(compound.getString("PlayerName"), file.getName().substring(0, file.getName().length() - 5));
} }
} catch (Exception e) { } catch (Exception e) {
LogWriter.error("Error loading: " + file.getAbsolutePath(), e); LogWriter.error("Error loading: " + file.getAbsolutePath(), e);
@@ -76,6 +76,5 @@ public class EntityCustomNpc extends EntityNPCInterface{
this.setPosition(posX, posY, posZ); this.setPosition(posX, posY, posZ);
} }
} }
} }
@@ -9,6 +9,11 @@ import net.minecraft.world.World;
public class EntityMagicProjectile extends EntityProjectile{ public class EntityMagicProjectile extends EntityProjectile{
private EntityPlayer player; private EntityPlayer player;
private ItemStack equiped; private ItemStack equiped;
public EntityMagicProjectile(World par1World){
super(par1World);
}
public EntityMagicProjectile(World par1World, public EntityMagicProjectile(World par1World,
EntityPlayer player, ItemStack item, boolean isNPC) { EntityPlayer player, ItemStack item, boolean isNPC) {
super(par1World, player, item, isNPC); super(par1World, player, item, isNPC);
@@ -19,7 +24,7 @@ public class EntityMagicProjectile extends EntityProjectile{
@Override @Override
public void onUpdate(){ public void onUpdate(){
if(player.inventory.getCurrentItem() != equiped) if(!worldObj.isRemote && (player == null || player.inventory.getCurrentItem() != equiped))
this.setDead(); this.setDead();
super.onUpdate(); super.onUpdate();
} }
@@ -166,7 +166,6 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
public long totalTicksAlive = 0; public long totalTicksAlive = 0;
private int taskCount = 1; private int taskCount = 1;
public int lastInteract = 0; public int lastInteract = 0;
public Faction faction; //should only be used server side public Faction faction; //should only be used server side
private EntityAIRangedAttack aiRange; private EntityAIRangedAttack aiRange;
@@ -1693,15 +1692,4 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
public boolean shouldDismountInWater(Entity rider){ public boolean shouldDismountInWater(Entity rider){
return false; return false;
} }
// Model Types: 0: Steve 64x32, 1: Steve 64x64, 2: Alex 64x64
public int getModelType()
{
return this.display.modelType;
}
public void setModelType(int val)
{
this.display.modelType = val;
}
} }
@@ -21,7 +21,6 @@ public class ItemNpcWeaponInterface extends ItemSword implements ItemRenderInter
CustomNpcs.proxy.registerItem(this); CustomNpcs.proxy.registerItem(this);
setCreativeTab(CustomItems.tabWeapon); setCreativeTab(CustomItems.tabWeapon);
} }
public void renderSpecial(){ public void renderSpecial(){
GL11.glScalef(0.66f, 0.66f,0.66f); GL11.glScalef(0.66f, 0.66f,0.66f);
GL11.glTranslatef(0.16f, 0.26f, 0.06f); GL11.glTranslatef(0.16f, 0.26f, 0.06f);
@@ -179,7 +179,7 @@ public class ScriptLivingBase extends ScriptEntity{
/** /**
* Note not all Living Entities support this * Note not all Living Entities support this
* @param slot Slot of what armor piece to get, 0:boots, 1:pants, 2:body, 3:head * @param slot Slot of what armor piece to get, 0:boots, 1:pants, 2:body, 3:head, for npcs its 0:head, 1:body, 2:pants, 3:boots, small mistake on my part
* @return The item in the given slot * @return The item in the given slot
*/ */
public ScriptItemStack getArmor(int slot){ public ScriptItemStack getArmor(int slot){
@@ -192,7 +192,7 @@ public class ScriptLivingBase extends ScriptEntity{
/** /**
* Note not all Living Entities support this * Note not all Living Entities support this
* @since 1.7.10c * @since 1.7.10c
* @param slot Slot of what armor piece to set, 0:boots, 1:pants, 2:body, 3:head * @param slot Slot of what armor piece to set, 0:boots, 1:pants, 2:body, 3:head, for npcs its 0:head, 1:body, 2:pants, 3:boots, small mistake on my part
* @param item Item to be set * @param item Item to be set
*/ */
public void setArmor(int slot, ScriptItemStack item){ public void setArmor(int slot, ScriptItemStack item){
@@ -58,25 +58,6 @@ public class ScriptNpc extends ScriptLiving{
npc.script.clientNeedsUpdate = true; npc.script.clientNeedsUpdate = true;
} }
/**
* @return Returns the current npcs modelType of the NPC
*/
public int getModelType(){
return npc.display.modelType;
}
/**
* @param modelType The modelType of the NPC. 0: Steve, 1: Steve64, 2: Alex
*/
public void setModelType(int modelType){
if(modelType > 2)
modelType = 2;
else if(modelType < 0)
modelType = 0;
npc.display.modelType = modelType;
npc.script.clientNeedsUpdate = true;
}
/** /**
* @return The npcs name * @return The npcs name
*/ */
@@ -585,7 +566,7 @@ public class ScriptNpc extends ScriptLiving{
* @since 1.7.10c * @since 1.7.10c
* @param resistance Explosion resistance (0-2) default is 1 * @param resistance Explosion resistance (0-2) default is 1
*/ */
public void setExplosionResistance(float resistance){ public void seExplosionResistance(float resistance){
npc.stats.resistances.explosion = ValueUtil.correctFloat(resistance, 0, 2); npc.stats.resistances.explosion = ValueUtil.correctFloat(resistance, 0, 2);
} }
@@ -0,0 +1,17 @@
package noppes.npcs.util;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class CustomNPCsScheduler {
private final static ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
public static void runTack(Runnable task, int delay){
executor.schedule(task, delay, TimeUnit.MILLISECONDS);
}
public static void runTack(Runnable task){
executor.schedule(task, 0, TimeUnit.MILLISECONDS);
}
}
@@ -166,7 +166,6 @@ display.livingAnimation=Lebende Animation
display.visible=Sichtbar display.visible=Sichtbar
display.bossbar=Boss-Lebensanzeige display.bossbar=Boss-Lebensanzeige
display.url=Url display.url=Url
display.urlSix=Url64
inv.minExp=Min. Xp inv.minExp=Min. Xp
inv.maxExp=Max. Xp inv.maxExp=Max. Xp
@@ -126,9 +126,6 @@ remote.freeze=Freeze NPCs
spawner.entities=Entities spawner.entities=Entities
spawner.clones=Clones spawner.clones=Clones
spawner.clones2=Clones 2
spawner.clones3=Clones 3
spawner.clones4=Clones 4
spawner.mobspawner=MobSpawner spawner.mobspawner=MobSpawner
spawner.mount=Mount by spawner.mount=Mount by
spawner.mountplayer=Player mounts spawner.mountplayer=Player mounts
@@ -173,9 +170,7 @@ display.selectTexture=Select Texture
display.livingAnimation=Has a living animation display.livingAnimation=Has a living animation
display.visible=Visible display.visible=Visible
display.bossbar=BossBar display.bossbar=BossBar
display.squareTexture=Square Texture
display.url=Url display.url=Url
display.urlSix=Url64
inv.minExp=Min Exp inv.minExp=Min Exp
inv.maxExp=Max Exp inv.maxExp=Max Exp
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 694 B

Loaded 100 of 939 files, more files were not shown because too many files have changed in this diff. Show more