Commit Graph
46 Commits
Author SHA1 Message Date
Luis C.M 7d4a59d45a IEntity & IWorld:
-Added getStoredDataKeys() & getTempDataKeys() functions.
2022-12-27 16:46:59 -06:00
Luis C.M aa02e5dcc3 Fixed API interface errors, added casts for custom item script handlers in EventHooks, and added some event interfaces. 2022-11-23 23:59:01 -06:00
KAMKEEL be9ae94163 Start API Branch 2022-11-15 15:25:53 -05:00
Luis C.M c8a8e866cb IPos:
-Added crossProduct(IPos), divide(scalar), and to/FromLong functions.

NpcAPI:
-Added getAllInBox(from,to)

IBlock:
-Added setPosition functions

IBlock, IPos, IEntity, IWorld: -Added a readable toString() function
2022-11-06 15:08:58 -06:00
Luis C.M 3fd962289c NpcAPI:
-Added getPlayer() function
-Added getChunkLoadingNPCs function
-Added getCurrentPlayerCount, getMaxPlayers, and kickAllPlayers, isHardcore, getFile(path), and getServerOwner functions
2022-11-06 01:59:34 -05:00
Luis C.M e9a8f8cebc Added several more functions to pre-existing classes:
-Spawner, Transport, Healer, Guard, Bard jobs received more functions.
-Added more functions to the transporter role.
-IRole: Added getNpc() function.
-IAnimal, IEntityLiving, and IEntityLivingBase received more functions from their MC counterparts.
-Nearly every function with that takes position/vector parameters now has an equivalent with IPos as a parameter instead.
2022-11-05 20:19:14 -05:00
c0508383 05b84b467c IWorld & IPos: Removed getMCBlockPos() to better organize NpcAPI. Removed unnecessary imports.
ITileEntity: Removed unnecessary imports.
2022-08-16 11:43:46 -05:00
c0508383 d1762654ba ISound:
-Allows for the changing of several sound attributes, including volume, pitch, repeating, etc.

NpcAPI, IPlayer, IWorld:
-Added more sound functions, with sounds that can be stopped and started based on an ID.
2022-07-13 19:27:27 -05:00
c0508383 b4f112ee89 IWorld:
-Fixed offset not working right on rayCastEntities()
2022-07-11 21:16:32 -05:00
c0508383 80916de553 IWorld:
-Added rayTraceEntities() functions, and added an offset parameter.

IEntityLivingBase:
-Made getLookingAtEntities() function use IWorld's rayTraceEntities() function, and added an offset parameter.
2022-07-10 23:17:17 -05:00
c0508383 1110748504 IBlock:
-Fixed canCollide function, added maxVolume parameter.
2022-07-07 21:17:44 -05:00
c0508383 d54035687c IEntityLivingBase:
-Added stopOnBlock, stopOnLiquid, and stopOnCollision options for getLookingAtEntities()

IWorld:
-Added stopOnBlock, stopOnLiquid, and stopOnCollision options for rayCastBlock & rayCastPos
2022-07-07 20:49:03 -05:00
c0508383 1c10f2ebf1 IWorld:
-getEntitiesNear sorts by which one is nearest to the position.
2022-07-06 18:12:32 -05:00
c0508383 6a852d9578 IPlayer:
-Added getLookPos, which uses the rayCastPos function in IWorld.

IWorld:
-Added getEntitiesNear function with 3 double or one IPos parameter, and a range parameter for checking what entities are near a position.
-Added rayCastPos, for cases where rayCastBlock returns null.
2022-07-06 17:51:26 -05:00
c0508383 a3b5f5993e IWorld:
-Implemented spawnClone() with a boolean parameter to check entity protection from mods & plugins correctly (for real this time).

ICloneHandler:
-Implemented ignoreProtection boolean value for the spawn() function.
2022-07-06 01:29:43 -07:00
c0508383 a4585fdf4d IWorld:
-Undid previous commit, not implemented correctly.
2022-07-06 00:24:14 -07:00
c0508383 43e41a0e95 IWorld:
-Added new spawnClone function with an extra boolean parameter to check for spawn protection or not.
2022-07-05 22:55:38 -07:00
Luis C.M 63a1525ee2 API Changes:
-Implemented interfaces for all jobs & roles.

ScriptPlayer:
-Added getData() function, which returns player data objects.

IPlayerData: New class that holds all player data for modification.
-Holds dialog, bank, quest, transport, faction, item giver, and mail data.
-Also holds companion data, with functions has/set/getCompanion, and a getCompanionID function to differentiate companions.
2022-06-12 01:26:23 -05:00
Luis C.M 8f16e6b20f Added IDialogImage, a scripted object which is used by IDialog. Used to add dialog images.
IDialog:
-Added several new functions for dialogs' new visual attributes, as well as a way to add, get, create, remove, and clear dialog images.

Global NPC events:
-Added fields and variables from the old ScriptEvent events, in preparation to replace the old events with NpcEvent instances on local NPC scripts.
-Fixed issue where some event hooks would run on remote worlds.

Global NPC killed event:
-Added droppedItems and expDropped fields.

IWorld and NpcAPI:
-Now always uses a non-remove WorldServer object to create ScriptWorld objects and add them to the world cache.
2022-06-10 17:25:58 -05:00
Luis C.M 8d4a7ea0b6 More merge fixes 2022-05-27 15:54:12 -05:00
Luis C.M ec5fc71413 Merge branch 'master' into dev
# Conflicts:
#	src/main/java/noppes/npcs/scripted/ScriptFaction.java
#	src/main/java/noppes/npcs/scripted/ScriptWorld.java
#	src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java
#	src/main/java/noppes/npcs/scripted/entity/ScriptPlayer.java
#	src/main/java/noppes/npcs/scripted/interfaces/IEntity.java
#	src/main/java/noppes/npcs/scripted/interfaces/IWorld.java
#	src/main/java/noppes/npcs/scripted/interfaces/entity/ICustomNpc.java
#	src/main/java/noppes/npcs/scripted/interfaces/entity/IPlayer.java
2022-05-27 15:31:02 -05:00
1whohears f83487f67b removed setblock with the Minecraft block class as a parameter 2022-05-27 11:28:01 -05:00
1whohears 0d2011b2ba added some doc comments 2022-05-26 20:55:11 -05:00
1whohears a49dfff86a added world.rayCastBlock(IPos, IPos, int) 2022-05-26 20:44:44 -05:00
1whohears 3d02ce3ce0 world.rayCastBlock uses double[] for parameters 2022-05-26 03:04:13 -05:00
1whohears 6698e8619c world.getNearestAir returns IPos and takes IPos as parameter 2022-05-26 02:10:25 -05:00
1whohears bc85756476 player.getLookingAtBlock returns IBlock 2022-05-26 01:51:05 -05:00
1whohears aba637be14 removed redundant faction functions
Luis C.M. will add API.getFactions() which returns the FactionController. All these functions use the faction controller anyway.
Also Luis PR already has entity.getDimension and world.spawnEntity
2022-05-25 23:56:36 -05:00
1whohears a4361b8420 Added various things to the API and other small changes
This adds some useful functions to the api and a few other changes.
I had been creating a custom build of this mod while working on stuff because I couldn't figure out how to do certain things without changing the mod. So this is a collection api features that I think everyone would find useful.

Api additions:
-purchase counting, and disabling trades for the trader role. (if a trade is disabled the gui still says insufficient funds, maybe allow a custom message to appear) added get the traders currency items and sell items.
-if an npc's projectile does explosive damage, you can disable it destroying blocks even if mob griefing is on
-int arrays as stored data for entities
-entity.playSound(...)
-get set if npcs can drown
-player read and unread dialog
-player set faction points
-extra player.sendMessage functions to add custom colors/bold/underline
-player clear inventory
-get set if a follower npc is following a player or waiting
-a bunch of stuff to script faction
-is an item food and how many food points?
-get scoreboard team by it's name
-get and create factions from the script world
-world.rayCastBlockPos is used for getting what block a player is looking at.
-world.getNearestAir is meant to get the block of air above or around the result of world.rayCastBlockPos, or at least that's how I've been using it.

Changes:
-in NoppesUtilServer I feel like if an npc is cloned it's ticksExisted or age should bee zero
-follower npcs should have the canDespawn field automatically set to false...? maybe make it an option
2022-05-24 03:06:16 -05:00
Luis C.M b9266c3cc5 Added plenty more documentation for the javadoc. 2022-05-17 18:02:09 -05:00
Luis C.M cf33b90b26 Used interfaces in implementations instead of the real classes for most scripted classes. 2022-05-11 22:08:31 -05:00
Luis C.M 6896cec417 Every function in API classes that calls the main API class now calls the loaded API wrapper, renamed to NpcAPI, instead of the abstract class, renamed to AbstractNpcAPI. 2022-05-11 17:12:48 -05:00
Luis C.M 6dea5a1cbc Interfaces have a file strucutre resembling the file structure of their implementing classes. 2022-05-11 16:43:14 -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 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 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
luisc 77c2897109 Added getAllServerPlayers, createItem & createEntityParticle to NPC API. Added getDimensionID() to ScriptWorld. 2021-11-22 01:10:27 -06:00
luisc 8b710ed520 Fixed executeCommand() function for scripting API. 2021-10-19 16:59:09 -05:00
luisc 72f2c3c60a Implemented global Forge events. Reorganized NPC API files. 2021-10-18 06:33:39 -05:00
luisc 699182f4c0 Added ScriptBlock and ScriptNbt support to scripting API 2021-10-12 03:23:56 -05:00
luisc 95d2814651 Backported GUI features and necessary classes from 1.12. 2021-09-30 21:44:30 -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
KAMKEEL a31efb2dc3 1.7.10 Files
Files added
2018-09-13 12:03:28 -04:00