Commit graph

3040 commits

Author SHA1 Message Date
Aikar
6b198b5cfe Fix another case where villages load chunks 2018-06-21 22:58:09 -04:00
Aikar
34c2733939 Update Upstream 2018-06-20 23:29:33 -04:00
Aikar
899149d68d Expand Explosions API
Add Entity as a Source capability, and add more API choices, and on Location.
2018-06-20 23:19:46 -04:00
Brokkonaut
fbe69b61a9 Add EntityKnockbackByEntityEvent (#1162)
This event is called when an entity receives knockback by another entity. The knockback can be modified in the event. If the event is cancelled the entity is not knocked back.
2018-06-21 03:59:11 +02:00
BillyGalbreath
63bf2ee267 Add "getNearbyXXX" methods to Location (#1160) 2018-06-20 20:30:09 -05:00
Aikar
5bf1029d82 Fire EntityShootBowEvent for Illusioner 2018-06-18 22:19:59 -04:00
Zach Brown
8e0411a1d3 Tie PlayerList#moveToWorld safety to existing config
Also renames patch file to better express what it's doing.

It is presumed that those using this config option intend for
suffocation checks to be disabled in all instances. In doing so, they
inherently assume the advantages and issues associated with removing
said safety check.

If the community expresses a desire for more specific options regarding
the handling of this safety feature, we can investigate providing them.

Fixes GH-1149
2018-06-18 16:27:33 -05:00
theminecoder
680e0ad864 Fix PluginCommand to not wrap exceptions before ServerExceptionEvent can get to it (#1130) 2018-06-19 07:03:09 +10:00
BillyGalbreath
283a4b7d60 [CI-SKIP] Clarify Event#callEvent() JavaDoc (#1158) 2018-06-18 15:42:39 -05:00
Aikar
be0d8a5f74 PlayerReadyArrowEvent
Called when a player is firing a bow and the server is choosing an arrow to use.
Plugins can skip selection of certain arrows and control which is used.
2018-06-18 01:13:16 -04:00
Aikar
9fc9d3f486 EntityShootBowEvent consumeArrow and getArrowItem API
Adds ability to get what arrow was shot, and control if it should be consumed.
2018-06-18 00:39:04 -04:00
Aikar
23994d33e3 accidently set the wrong collection on last commit
copy pasting...
2018-06-16 16:32:17 -04:00
Aikar
43a2693ca0 Ignore Missing Recipes in RecipeBook to avoid data errors
This code was causing NPE's in saving player data, potentially related to reloads.
2018-06-16 16:30:29 -04:00
BillyGalbreath
4a55e34625 Make shield blocking delay configurable (#1154)
Resolves #1153
2018-06-16 14:54:35 -05:00
Aikar
488c39f0f4 Make SentientNPC extend LivingEntity 2018-06-16 14:28:13 -04:00
Aikar
3368739906 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
72ec993b61 Print Error details when failing to save player data 2018-06-15 20:40:39 -04:00
Aikar
133396a0c9 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
5c7524a769 If we remove a corrupt TE, ensure we save the chunk 2018-06-15 00:11:39 -04:00
Black Hole
c0a2597976 Actually call EntityTeleportEndGatewayEvent (#1147) 2018-06-13 23:29:49 +02:00
Brokkonaut
b77a601ae0 Avoid int overflow in lootable refill time calculations (#1146)
Fixes https://github.com/PaperMC/Paper/issues/1141
2018-06-13 20:15:31 +02:00
Shane Freeder
1470add5c4 Fix compat with PluginClassloader implementations 2018-06-12 16:10:01 +01:00
Shane Freeder
4d3ec19658 [CI-SKIP] Fix comment on unlit chunk sending patch 2018-06-12 15:46:08 +01:00
Aikar
158f100521 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
1e8a800b9a 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
d8e8748f70 Fix missed change inside of CraftSkullMeta 2018-06-10 12:45:04 +01:00
Aikar
d9dc31cb93 Unset Ignited flag on cancel of Explosion Event
Otherwise the creeper infinite explodes
2018-06-10 01:29:20 -04:00
Shane Freeder
50eaba9503 Cleanup last commit (Remember, always git diff!)
Because the one time you don't...
2018-06-09 20:03:42 +01:00
Shane Freeder
6812a948db 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
056199bd92 Add EntityTeleportEndGatewayEvent for entities (closes #1124) 2018-06-09 14:21:40 +01:00
Shane Freeder
463d2a2bc0 Allow plugins to replace texture if already set on skulls 2018-06-09 12:09:21 +01:00
Aikar
d72d79efee Fix potential for NPE if receivers is null and the world was empty 2018-06-06 21:45:30 -04:00
Aikar
d4e763c30e ParticleBuilder.hasReceivers shouldnt return true if no players are in the world 2018-06-06 21:35:44 -04:00
Aikar
3f4bd3e8f7 Expand ParticleBuilder more with hasReceivers, fix empty receivers list 2018-06-06 21:27:50 -04:00
Aikar
052479037b Expand particle builder API with radius based radius methods 2018-06-06 20:59:04 -04:00
Aikar
4e86ff1c24 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
0cd3d13ae9 WitchReadyPotionEvent
Control what potion the witch readies to use
2018-06-05 22:48:27 -04:00
Aikar
83cf44e60c Don't load chunks for villager door checks
This avoids villages spam loading chunks sync
2018-06-05 00:33:24 -04:00
Aikar
523d47c095 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
f8c2d3bd11 Report issues to the issue tracker 2018-06-04 01:54:22 -05:00
Aikar
de96024fe7 PotionEffect clone methods
Help with modifying potion effects
2018-06-04 01:55:52 -04:00
Aikar
b75c7d96df Closes #1138 2018-06-04 01:53:37 -04:00
Aikar
cb9b5bfa82 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
9c32d79355 Fix config key on last commit 2018-05-30 15:38:27 -05:00
Mark Vainomaa
df3df43dea Skip Entity and Tile Entity ticking in chunks scheduled for unload (#1132)
Fixes #1131
2018-05-30 23:31:55 +03:00
Zach Brown
0576336943 Update upstream CB 2018-05-27 23:39:08 -05:00
Aikar
b4d7828a4f rename method for center to toCenterLocation() 2018-05-24 21:06:06 -04:00
Aikar
b70c406245 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
fdc7459143 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
efe156b1f7 Fix Witch Throw Potion error - Resolves #1129 2018-05-23 23:08:04 -04:00