Commit Graph
138 Commits
Author SHA1 Message Date
Luis C.M aab550cdca Implemented custom item rotation rate, and start using, using, stop using, finished using events for custom items. 2022-05-11 14:24:12 -05:00
Luis C.M 11cc46b48f Fixed some scripted item events, and fixed positioning of scripted items. 2022-05-11 13:30:13 -05:00
Luis C.M 747730face Fixed a bug with item uses, custom items can now do block, bow, eat, and drink animations. 2022-05-11 02:33:56 -05:00
Luis C.M a18cf5625b Added some more functions for scripted items 2022-05-11 02:07:06 -05:00
Luis C.M 26f5f86dca Implemented Scripted Custom Items. 2022-05-11 01:10:31 -05:00
Luis C.M 5520fc5f2b ScriptParticle:
-Added HEXColor2, HEXColorRate, and HEXColorRateStart fields, and respective setters and getters, allowing for changes in HEX color over time.

Marked plenty of old ScriptEntityParticle functions as deprecated. This includes any functions referring to scripted particles as "Entity Particles" and functions outside the API or ScriptParticle class used to spawn or create particles.
2022-05-07 03:46:37 -05:00
Luis C.M d49a31a4fe ScriptParticle:
-The spawnInWorld() function now requires a ScriptWorld object to be passed in as the first parameter.
-New spawnInWorld() function with its only parameter being a ScriptWorld object. Spawns in the world with the particle's x,y,z variables.
2022-05-07 01:40:41 -05:00
Luis C.M c3b9096295 Scripted particles can now spawn anywhere in the world, not just attached to an entity.
ScriptEntityParticle renamed to ScriptParticle, and EntityCustomFX renamed to CustomFX.

Re-enabled OpenGL blending for custom particles.
2022-05-06 03:38:24 -05:00
Luis C.M 2d2933e873 ScriptEntityParticle:
-Particles can now start or end at a certain tick, and loop or not loop.
-Added setSize(), getWidth() and getHeight() functions.
-Added setOffset(), getOffsetX(), and getOffsetY() functions.
-Added setAnimRate() and getAnimRate() functions.
2022-05-06 01:22:48 -05:00
Luis C.M 728269ff87 ScriptEntityParticle:
-Added width, offset, and animation rate attributes to particles.
-Added setSize(), getWidth() and getHeight() functions.
-Added setOffset(), getOffsetX(), and getOffsetY() functions.
-Added setAnimRate() and getAnimRate() functions.
2022-05-06 00:22:28 -05:00
Luis C.M f16e2402a6 ScriptEntityParticle:
-Added scripted particles which can not face the player, having their angles be absolute in the world instead of relative to the camera.
-set/getFacePlayer() functions added.
2022-05-04 18:08:54 -05:00
Luis C.M bfd872a239 ScriptEntity:
-Added getEntityId() function
-Moved getUniqueId() function

ScriptWorld:
-Added getPlayerByUUID(uuidstring) function
-Added several functions from World and WorldServer: isBlockFreezable,isBlockFreezableNaturally,canBlockFreeze,canBlockFreezeBody,canSnowAt,canSnowAtBody,getTopBlock,getHeightValue,getChunkHeightMapMinimum,getBlockMetadata,setBlockMetadataWithNotify,canBlockSeeTheSky,getFullBlockLightValue,getBlockLightValue,playSoundAtEntity,playSoundToNearExcept,getEntityByID,spawnEntityInWorld,getClosestPlayerToEntity,getClosestPlayer,getClosestVulnerablePlayerToEntity,getClosestVulnerablePlayer,countEntities,setTileEntity,removeTileEntity,isBlockFullCube,getSeed,setSpawnLocation,canLightningStrikeAt,isBlockHighHumidity

ScriptTileEntity:
Added a ScriptTileEntity class for MC Tile Entities, with nearly all its functions.

ScriptBlock:
-Added getTileEntity() and setTileEntity() functions using the new ScriptTileEntity class as a return value and parameter respectively.

API:
-Added playSoundAtEntity and playSoundToNearExcept functions.
-Added set/getMOTD() functions.
2022-05-03 23:09:21 -05:00
Luis C.M 80e3c075c7 Added detectAndSendChanges, putStackInSlot(slot,itemStack), isPlayerNotUsingContainer(player) functions to ScriptContainer 2022-05-03 14:05:49 -05:00
Luis C.M 09f76d84c4 GuiContainerNPCInterface, GuiNPCInterface, GuiNpcMenu all disable repeat key events when closed like all other GUIs now.
The keyEvent scripted event no longer detects repeat held key presses.
2022-05-03 13:34:56 -05:00
Luis C.M 5c9424bac8 Added the repeatKey field to KeyEvent, distinguishing whether the event was triggered by the key being held down or the first press. 2022-05-03 13:20:41 -05:00
Luis C.M d41b3b7a7e ScriptEntity:
-Added setInvisible, setSneaking, setSprinting, and getUniqueID() functions.

ScriptLivingBase:
-Added getLookVec() function

ScriptPlayer:
-Added stopUsingItem(), clearItemInUse(), playSound(name,volume,pitch), mountEntity(entity), dropOneItem(shouldDropStack), canHarvestBlock(block), interactWith(entity) functions
2022-05-03 11:26:04 -05:00
Luis C.M b309738c0b Fixed swingHand() function for ScriptPlayer 2022-05-02 01:41:43 -05:00
Luis C.M 1e88a4458d Fixed bug with NPC dialog scripts. 2022-04-13 04:25:44 -05:00
Luis C.M 65bb3b5939 Important fix to some NPC hook scripts crashing, added option and dialog object fields to local NPC dialog and NPC dialog closed scripts 2022-04-09 00:17:16 -05:00
Luis C.M 50fe08ce2e Merge branch 'KAMKEEL:master' into master 2022-03-23 03:55:08 -05:00
Luis C.M 18ff2bff78 Implemented Global NPC Events!
All NPCs activate these scripts. If a player wants to create a script that's universally used by all NPCs, this allows for that to happen with a lot of ease!
2022-03-23 03:54:06 -05:00
Luis C.M 769a574210 Fixed setHunger/Saturation using client-side functions from FoodStats 2022-03-19 22:51:39 -05:00
Luis C.M df2e742cbb Added overloaded spawnParticle functions for ScriptEntity 2022-03-16 23:15:30 -05:00
KAMKEEL d867017871 Merge branch 'master' of https://github.com/KAMKEEL/CustomNPC-Plus 2022-03-15 00:21:00 -04:00
luisc 16321dd4ff Added hasLore() function to ScriptItemStack
Fixed getLore() null pointer error
2022-03-06 13:47:47 -06:00
luisc 1cb27a9e7a Implemented XYZ rotations correctly, now clearly rotate around an axis respective to the player's camera. 2022-03-04 18:08:05 -06:00
luisc 75b7c01f87 Removed some unnecessary fields in ScriptEntityParticle 2022-03-02 19:36:15 -06:00
luisc 7f8246e04e PARTICLE ROTATION 2022-03-02 18:18:03 -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 c2a669fbeb The setForm() function in ScriptDBCPlayer prevents crashes from form levels that are out of bounds now. 2022-02-21 20:16:42 -06:00
luisc 18e02461a6 Added misspelled cancel functions to player & forge events, and correctly spelled cancel functions to npc events 2022-02-06 12:39:07 -06:00
KAMKEEL e42c4cab7e Update ScriptLivingBase.java 2022-02-05 20:35:44 -05:00
luisc 7e0ff3c836 Removed println statement please forgive me oh god 2022-02-02 18:21:08 -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
luisc 83e13285f9 Added rotation to overlay components, and color codes to overlay labels 2022-01-31 14:51:06 -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 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
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