Commit Graph
55 Commits
Author SHA1 Message Date
Luis C.M f33260cf2d ScriptEntity:
-Fixed setDimension() not properly teleporting entities, sometimes causing duplicates.
2023-07-27 22:53:37 -05:00
Luis C.M b592bb5d5e IPos objects now use double values in calculations for distance, addition, cross product, etc. 2023-07-07 17:51:51 -05:00
Luis C.M 29fb8d1dcf ScriptItemStack, ScriptEntity, ScriptBlock, & ScriptBlockPos:
-Implemented equals() functions for comparing objects of these types
2023-06-03 00:34:07 -05:00
Luis C.M daada3cb8a IEntity:
-Added setDimension function for all entities (not just players now).
2023-03-15 19:17:39 -05:00
Luis C.M cacb4ebf85 Added X & Y scale functions for particles, replaces overall scale. 2023-02-16 18:43:22 -06:00
KAMKEEL bda76bafe6 Optimize Imports 2023-01-12 21:33:06 -05:00
Luis C.M 28a1650c05 Added setRotation(float rotationYaw, float rotationPitch) function for IEntity & ICustomNpc 2023-01-03 23:36:53 -06:00
Luis C.M 1df7819931 Added a few more functions having to do with capturing picked up drops to IEntity. 2022-12-27 20:27:36 -06:00
Luis C.M 828d03a0cb ScriptEntity:
-Fix to getStoredDataKeys()
2022-12-27 17:29:22 -06:00
Luis C.M 7d4a59d45a IEntity & IWorld:
-Added getStoredDataKeys() & getTempDataKeys() functions.
2022-12-27 16:46:59 -06:00
KAMKEEL be9ae94163 Start API Branch 2022-11-15 15:25:53 -05:00
Luis C.M 8d3cd3fd82 Revert "Merge remote-tracking branch 'origin/dev' into dev"
This reverts commit 66edbcea80, reversing
changes made to 3fd962289c.
2022-11-06 01:25:28 -06:00
KAMKEEL 6ae465c5d0 Revert "Added several more functions to pre-existing classes:"
This reverts commit e9a8f8cebc.
2022-11-06 00:10:04 -04: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 e048496e4d IParticle:
-Replaced spawnOnEntity and spawnInWorld with a single function name "spawn". Deprecated the others.
2022-07-08 12:03:15 -05:00
Luis C.M c8a3b7825d Particle packets are only sent to players in the particle's world now. 2022-07-02 13:07:23 -05:00
Luis C.M 79a703429c ISkinOverlay:
-Removed set/getLocation, only supposed to be used during rendering.
2022-07-02 06:22:43 -05:00
Luis C.M f3f209820c IParticle:
-Added glow option.
2022-07-02 03:10:11 -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 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 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 c2546c3f82 Updated interfaces to have the proper functions. Documentation will focus around them, so they'll be better organized from now on. 2022-05-11 16:31:14 -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 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 df2e742cbb Added overloaded spawnParticle functions for ScriptEntity 2022-03-16 23:15:30 -05: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 7f8246e04e PARTICLE ROTATION 2022-03-02 18:18:03 -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 d74a1f2bee Added ScriptBlockPos functionality with get/setPos to ScriptEntity 2022-01-04 03:50:50 -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 03395ad750 Added getWorld() function to ScriptEntity. 2021-12-13 16:47:15 -06:00
luisc 34f6f670eb Y velocity when calling entity.knockback() is no longer decreased drastically. 2021-12-08 17:48:35 -06:00
luisc c2564de470 NPCs properly stay floating when not navigating and in the air. 2021-12-08 04:41:41 -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 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