Commit graph

3130 commits

Author SHA1 Message Date
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
Foorack
bd9e73a2c6 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
0a3f646a94 [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 Brown
ce4b691d81 Update issue templates (#1128)
https://blog.github.com/2018-05-02-issue-template-improvements/
2018-05-22 16:32:27 -05:00
Zach Brown
4b7080388e 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
88b9c8af6b Update upstream B 2018-05-19 00:58:46 -05:00
Aikar
e8a70d7bd1 Fix Reason = Player for Experience Orb drop 2018-05-18 19:40:33 -04:00
Zach Brown
cf82968f35 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
375b54fcd1 WitchThrowPotionEvent
Fired when a witch throws a potion at a player
2018-05-16 20:49:47 -04:00
Aikar
9b4be61ac6 WitchConsumePotionEvent
Fires when a witch consumes the potion in their hand
2018-05-16 20:35:33 -04:00
Aikar
4cbc53e9e8 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