Commit Graph
59 Commits
Author SHA1 Message Date
luisc d2d3cef681 When setMaxTicks() is called and the remaining ticks in a timer are greater than that value, the remaining ticks are updated to the new max tick value. 2022-02-27 23:11:52 -06:00
luisc 403738262c Added timer functions.
ticks(int id):
Gets the remaining ticks in the timer that matches this id.

setTicks(int id, int ticks):
Sets the remaining ticks in the timer that matches this id.

maxTicks(int id):
Gets the maximum ticks that must elapse for the timer that matches this id to finish.

setMaxTicks(int id, int ticks):
Sets the maximum ticks that must elapse for the timer that matches this id to finish.

repeats(int id):
Returns true if the timer with the given id is set to repeat, false otherwise.

setRepeats(int id, bool repeat):
Sets whether the timer with the given id should repeat. If true, the timer will repeat, and not repeat otherwise.
2022-02-27 23:08:24 -06:00
luisc ee02988d8c Removed client-side imports from EntityNPCFlying 2022-02-22 22:14:05 -06:00
luisc 450e065e27 Slightly improved flight pathing downwards. 2022-02-22 01:52:47 -06:00
luisc 732e97e0fe Override updateLeashedState() function in EntityNPCInterface.
NPCs can't be leashed anyway. This should avoid the "does not know how to add entity" crash with NPCs.
2022-02-20 00:56:57 -06:00
luisc 33e884c217 Flying is now smoother, NPCs can pathfind downwards easier while flying. 2022-02-18 03:34:20 -06:00
luisc 1af875aea9 Fixed concurrent modification bug with NPC tasks. 2022-01-31 23:01:52 -06: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
luisc 007660f16f Added collision options for CNPCs. 2022-01-14 19:07:41 -06:00
luisc 555ceb741f Added a modifiable and toggleable flying height limit to NPCs 2022-01-13 05:28:20 -06:00
luisc d50f51e208 Added handler support to NPC API. 2022-01-10 15:21:48 -06:00
luisc 32792e7d6f Added updateClient() function to ScriptNpc. 2022-01-03 21:30:38 -06:00
luisc 1a78b2dad7 Timers are only updated if a timer exists for a player. 2021-12-17 17:30:50 -06:00
luisc 00557df9a7 Fixed players being able to push NPCs around. 2021-12-13 00:16:06 -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 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 8c602c4d16 Adjusted floating: NPCs don't float when they're knocked back or hurt. 2021-12-08 17:43:27 -06:00
luisc d37e986006 Fixed NPCs bobbing in the air when flying. 2021-12-08 15:34:41 -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 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 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 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
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 3069488c54 Merge branch 'dev' 2021-11-26 04:35:09 -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 a29058d696 Fixed timers on the server-side. 2021-10-22 02:22:45 -05:00
luisc 4de969f6c9 Implemented scripted timers for players and NPCs. 2021-10-20 23:04:52 -05:00
luisc 5515f5ef83 Fixed executeCommand() function for scripting API on the server-side. 2021-10-19 19:49:43 -05:00
luisc 72f2c3c60a Implemented global Forge events. Reorganized NPC API files. 2021-10-18 06:33:39 -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 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 95d2814651 Backported GUI features and necessary classes from 1.12. 2021-09-30 21:44:30 -05:00
KAMKEEL 79339be79a Bow Change
Attempting to Fix Custom Bows
2021-09-24 16:50:28 -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 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 2262639182 Create Dev Branch
Add Scripting for ModelType
2021-05-08 03:51:29 -04:00
KAMKEEL 66270715ac Updating Texture Sizes
Attempting to implement a selective renderer to allow for 64x64 Skin Url type for mobs.
2021-05-04 03:52:44 -04:00
KAMKEEL 8a4be0bc1e Big Changes to ModelMPM for 1.8 Layers
> Added all 2D Layers to Models
> Moved Texture Location for PartData to remove texture syncing between MorePlayerModels and CustomNPC.
> Attempted first start at Bodywear 3D model similar to Headwear 3D model.
2021-05-02 22:53:03 -04:00
KAMKEEL 59263e1ad9 Fixed Entity Modeling! 2021-04-30 02:43:35 -04:00
KAMKEEL ea1672a242 Revert "Revert "WORKING MODEL CHANGER!""
This reverts commit d2b5ce2880.
2021-04-29 20:42:52 -04:00
KAMKEEL 2afbdbf94d Revert "Model Switcher Information + Cleanup"
This reverts commit 82f2323178.
2021-04-29 20:42:38 -04:00
KAMKEEL d2b5ce2880 Revert "WORKING MODEL CHANGER!"
This reverts commit 97dc3e9f13.
2021-04-29 20:41:55 -04:00