Commit Graph

3069 Commits

Author SHA1 Message Date
Aikar
ed61b2982e
Add SentientNPC Interface to Entities
Used to determine ACTUAL Living NPC's. Spigot mistakenly inversed the conditions for LivingEntity, and
used LivingEntity for Insentient Entities, and named the actual EntityLiving class EntityInsentient.

This should of all been inversed on the implementation side. To make matters worse, Spigot never
exposed the differentiator that there are entities with AI that are not sentient/alive such as
Armor stands and Players are the only things that do not implement the REAL EntityLiving class (named Insentient internally)

This interface lets you identify NPC entities capable of sentience, and able to move about and react to the world.
2018-06-16 14:01:01 -04:00
Aikar
4f29a0ce0a
Print Error details when failing to save player data 2018-06-15 20:40:39 -04:00
Aikar
50a23d5ea3
Configurable Alternative LootPool Luck Formula
Rewrites the Vanilla luck application formula so that luck can be
applied to items that do not have any quality defined.

See: https://luckformula.emc.gs for data and details
-----------

The rough summary is:
My goal was that in a pool, when luck was applied, the pool
rebalances so the percentages for bigger items is
lowered and smaller items is boosted.

Do this by boosting and then reducing the weight value,
so that larger numbers are penalized more than smaller numbers.
resulting in a larger reduction of entries for more common
items than the reduction on small weights,
giving smaller weights more of a chance

-----------

This work kind of obsoletes quality, but quality would be useful
for 2 items with same weight that you want luck to impact
in varying directions.

Fishing still falls into that as the weights are closer, so luck
will invalidate junk more.

This change will result in some major changes to fishing formulas.

-----------

I would love to see this change in Vanilla, so Mojang please pull :)
2018-06-15 00:32:35 -04:00
Aikar
1127a49ced
If we remove a corrupt TE, ensure we save the chunk 2018-06-15 00:11:39 -04:00
Black Hole
ea8801ce28 Actually call EntityTeleportEndGatewayEvent (#1147) 2018-06-13 16:29:49 -05:00
Brokkonaut
8b371226fb Avoid int overflow in lootable refill time calculations (#1146)
Fixes https://github.com/PaperMC/Paper/issues/1141
2018-06-13 14:15:31 -04:00
Shane Freeder
2c1d1ac456
Fix compat with PluginClassloader implementations 2018-06-12 16:10:01 +01:00
Shane Freeder
179439e48e
[CI-SKIP] Fix comment on unlit chunk sending patch 2018-06-12 15:46:08 +01:00
Aikar
84d350c24c
Fix CraftEntity hashCode
hashCodes are not allowed to change, however bukkit used a value
that does change, the entityId.

When an entity is teleported dimensions, the entity reference is
replaced with a new one with a new entity ID.

For hashCode, we can simply use the UUID's hashCode to keep
the hashCode from changing.

equals() is ok to use getEntityId() because equals() should only
be true if both the left and right are the same reference.

Since entity ids can not duplicate during runtime, this
check is essentially the same as this.getHandle() == other.getHandle()

However, replaced it too to make it clearer of intent.
2018-06-10 20:29:15 -04:00
Aikar
ca0ec24d64
Properly remove entities on dimension teleport
To teleport an entity between dimensions, the server makes a copy
and puts the copy in the new location, and marks the old one dead.

If this method got called for the same world in the same tick,
the entity would not have been removed from the UUID map, and the
world readd would fail.

This can be triggered even with a plugin if the entity is teleported
twice in the same tick, from world A to B, then back from B to A.

The re-add to A will fail to add the entity to the world. It will
actually be there, but it will not be visible on the client until
the server is restarted to re-try the add to world process again.

This bug was unlikely to be seen by many due to the double teleport
requirement, but plugins (such as my own) use this method to
trigger a "reload" of the entity on the client.
2018-06-10 20:09:56 -04:00
Shane Freeder
939ca17007
Fix missed change inside of CraftSkullMeta 2018-06-10 12:45:04 +01:00
Aikar
4fbed1adab
Unset Ignited flag on cancel of Explosion Event
Otherwise the creeper infinite explodes
2018-06-10 01:29:20 -04:00
Shane Freeder
586435d325
Cleanup last commit (Remember, always git diff!)
Because the one time you don't...
2018-06-09 20:03:42 +01:00
Shane Freeder
f022bc006f
Only close classloaders unless implict, reload or error on enabling (Closes #1120)
We also expose the control of this behavior to the API, while retaining
the old behavior unless implictly requested.
2018-06-09 18:58:04 +01:00
Shane Freeder
5913a2cc1a
Add EntityTeleportEndGatewayEvent for entities (closes #1124) 2018-06-09 14:21:40 +01:00
Shane Freeder
ecc9347238
Allow plugins to replace texture if already set on skulls 2018-06-09 12:09:21 +01:00
Aikar
72c26039eb
Fix potential for NPE if receivers is null and the world was empty 2018-06-06 21:45:30 -04:00
Aikar
d4dffd1d71
ParticleBuilder.hasReceivers shouldnt return true if no players are in the world 2018-06-06 21:35:44 -04:00
Aikar
fd4a65c566
Expand ParticleBuilder more with hasReceivers, fix empty receivers list 2018-06-06 21:27:50 -04:00
Aikar
11cb276a4a
Expand particle builder API with radius based radius methods 2018-06-06 20:59:04 -04:00
Aikar
2e423c8954
ItemStack#getMaxItemUseDuration
Allows you to determine how long it takes to use a usable/consumable item
2018-06-05 23:01:16 -04:00
Aikar
b97e5124e4
WitchReadyPotionEvent
Control what potion the witch readies to use
2018-06-05 22:48:48 -04:00
Aikar
1e3de9e936
Don't load chunks for villager door checks
This avoids villages spam loading chunks sync
2018-06-05 00:33:24 -04:00
Aikar
a082f773cb
Allow spawning Item entities with World.spawnEntity
This API has more capabilities than .dropItem with the Consumer function

Item can be set inside of the Consumer pre spawn function.
2018-06-04 20:48:14 -04:00
Kyle Wood
df8f9f0f30
Report issues to the issue tracker 2018-06-04 01:54:22 -05:00
Aikar
5c8bd61d24
PotionEffect clone methods
Help with modifying potion effects
2018-06-04 01:55:52 -04:00
Aikar
0570490d2a
Closes #1138 2018-06-04 01:54:38 -04:00
Aikar
727f932d05
add Escape Reason Drown for EndermanEscapeEvent
to detect rain specifically from every other armor ignoring hit
2018-05-31 18:16:26 -04:00
Zach Brown
7fea752ffc
Fix config key on last commit 2018-05-30 15:38:27 -05:00
Mark Vainomaa
e74e4584d6 Skip Entity and Tile Entity ticking in chunks scheduled for unload (#1132)
Fixes #1131
2018-05-30 15:31:55 -05:00
Zach Brown
51b88cabbc
Update upstream CB 2018-05-27 23:39:08 -05:00
Aikar
dab41b12ce
rename method for center to toCenterLocation() 2018-05-24 21:06:06 -04:00
Aikar
45308a08d7
Location.toBlockLocation
Convert location objects to their block coordinates, or the center of the block
2018-05-24 21:02:38 -04:00
Kyle Wood
d45565f83b Handle gpg signing better (#1123)
Instead of checking whether it was set previously, setting it to false,
then setting it back to true if it was true before, just use the
command-line argument in git to override the config for that command.
Using a variable makes it pretty painless to do.
2018-05-24 13:41:50 -05:00
Aikar
3eb1cdef72
Fix Witch Throw Potion error - Resolves #1129 2018-05-23 23:08:04 -04:00
Foorack
aedd155be1
Upgrade ASM to 6.1.1 to allow Java 9 and 10 plugins to load 2018-05-22 22:07:25 -05:00
Zach Brown
f913837a9d
[CI-SKIP] Add newlines in templates for readability
GitHub still just dumps people into an editor. It's not quite the forms
we hoped for. Better to add newlines and hope it makes things even a
tiny bit clearer for people reporting issues.
2018-05-22 16:37:23 -05:00
Zach
6a44787fc7
Update issue templates (#1128)
https://blog.github.com/2018-05-02-issue-template-improvements/
2018-05-22 16:32:27 -05:00
Zach Brown
de3bd3f635
Update URLs
Redirects are in place (or will be shortly). This is mostly
housekeeping.

Maven repo URLs already redirect however we can't deploy through them.
Jenkins URLs do not currently redirect but will within 24 hours.

Also adds a Discord link to the README, because apparently that's what
people want.

Documentation will be updated and announcements made once all redirects
are in place, until then, consider this advanced notice.
2018-05-19 01:29:05 -05:00
Zach Brown
264c9d0060
Update upstream B 2018-05-19 00:58:46 -05:00
Aikar
340908d328
Fix Reason = Player for Experience Orb drop 2018-05-18 19:40:33 -04:00
Zach
01c6454ead Apply workaround for patch application on Windows (#1122)
This is not a perfect workaround but it seems to be the best solution
for the moment.

On Windows, this means that when a patch fails to apply, you would now
need to fix that patch, finish the apply (AM), then rebuild all patches,
and then finally re-run the patch apply procedure in order to continue.

This adds a small amount of overhead compared to the traditional method
(which will still work on *nix environments, including WSL). However, it
seems preferable to the build not working on Windows at all.
2018-05-16 20:41:10 -05:00
Aikar
5e644e2637
WitchThrowPotionEvent
Fired when a witch throws a potion at a player
2018-05-16 20:49:47 -04:00
Aikar
dc7680211c
WitchConsumePotionEvent
Fires when a witch consumes the potion in their hand
2018-05-16 20:49:43 -04:00
Aikar
390f9bb913
Improve Profile API to directly extend Yggdrasil, Resolves #1117
This improves plugins like Citizens that rely on direct instance of Yggdrasil implementations.

Instead of wrapping, directly extend and override the methods.

Went ahead and wrapped all of the services in prep in the base patch, then features modify what they need
2018-05-10 23:01:52 -04:00
Shane Freeder
8595189ab6
Update B/CB 2018-05-08 23:09:45 +01:00
Zach
bd0335acaa
Merge pull request #1105 from stonar96/hotfix/anti-xray-cme
Fix Anti-Xray ConcurrentModificationException
2018-05-03 17:37:57 -04:00
Aikar
19dea1a6f7
Close Plugin Class Loaders on Disable
This should close more memory leaks from /reload and disabling plugins,
by closing the class loader and the jar file.
2018-05-01 21:36:55 -04:00
Aikar
ef8ad1941f
fix inverted logic on enderman attack 2018-05-01 20:37:52 -04:00
Aikar
bd603371bf
EndermanAttackPlayerEvent
Allow control over whether or not an enderman aggros a player.

This allows you to override/extend the pumpkin/stare logic.
2018-05-01 20:19:47 -04:00