Commit Graph
24 Commits
Author SHA1 Message Date
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 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 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 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 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