Calling this event allows plugins to react to the situation by simply
handling a normal damage event, possibly using existing code to
handle other entity damage.
Pulled from PR #1279
A vanilla server does a series of checks for the client black-listing
certain chat types (commands or chat). This change changes a CB
whitelist to the vanilla blacklist behavior.
This implements the detonate method from bukkit by setting the fuse
timer to 0. This makes a firework explode using the normal codepath,
but without waiting for the fuse.
The validation check in CraftMapView.render(CraftPlayer) filters out any
values less than 0. As of Minecraft 1.7, -128 through -113 are valid colors,
so filtering them out prevents some of the new colors from being sent.
This commit fixes the issue by adjusting the validation check to include
any values less than or equal to -113. As the minimum value for a byte is
-128, no invalid colors are included.
WorldGenerator setType and setTypeAndData have their arguments changed to
add in support for CraftBlockChangeDelegate, which changes the method
signature. This change in the method signature breaks any WorldGenerators
that aren't modified to use CraftBlockChangeDelegate.
This commit fixes the issue by readding the old method and maintaining the
CraftBlockChangeDelegate method. This makes it so that there is a
compatible method for both CraftBlockChangeDelegate WorldGenerators and
unmodified WorldGenerators.
Additionally, this commit reduces and corrects the diffs in
WorldGenerator, moving the fix for layering violations to
CraftBlockChangeDelegate.
A Block object is now passed in place of the previous id value, so the
obfuscated name for all subsequent arguments was shifted. As such,
BlockCanBuildEvent was using the incorrect values for both the material
and the location of the event.
This is corrected by swapping the values into the correct order and
providing an id based upon the Block passed into the method.
CraftBukkit modifies the IRecipe interface, adding new methods, so all
classes that implement IRecipe need to be imported and modified to add the
new methods.
Extending ShapelessRecipes implements the added methods and allows
RecipeBookClone to work with the Recipes API in a way that is consistent
with similar recipes, even if the recipe information present in the API
isn't technically correct.
Adding or removing operators was mistakenly using a loose player lookup
method, which would cause a permission refreshes on an online player whos
name starts with the name of the (offline) opped player.
Add/Remove op operations are exact name match only and the permission
refresh will behave the same way.
Both log4j and our own jline/jansi initialization attempt to catch
errors caused by jansi's use of native libraries. However both of them use
the Exception type which does not catch all errors. On Windows Server 2008
R2 Enterprise without installing extra software the required C++ libraries
are not available which causes an error that does not extend Exception. To
ensure we catch all errors I've changed both of these to catch Throwable
instead which gets us a working console minus jansi functionality.
l previously was the block id, however Minecraft's refactoring means that
the method is now passed a Block reference rather than the id. l is now
the data value of the block, so the block retrieved with that value is not
the correct block to be testing.
Something the log4j ConsoleAppender does makes the console work correctly
on Windows. After trying to pull pieces of it out and run them manually
I decided to just put the appender back. We now once again start with the
ConsoleAppender then remove it immediately after starting.
WorldMapCollection stores scoreboard, map (item), structure, and
village information. Scoreboards are explicitly handled globally,
while villages and structures are erroneously shared.
This commit separates the WorldMapCollections to not be shared among
custom worlds. Maps are special-cased to maintain the previous shared
behavior.
This change will print a warning when a plugin induces a forced save. A
player or console forcing a save (via a command) is ignored for purposes
of printing a warning.
When Minecraft first introduced an auto-save feature, we
were taken by surprise by how much of an impact it actually had on the performance
of the server. After investigating the potential causes of the significant
slow-downs we saw at the time, we came to the conclusion that it was a
combination of the auto-save interval being incredibly frequent and
servers already having an auto-save solution that was conflicting with the
newly added built-in one.
Since we noticed that most servers already had their own auto-save
solution, we decided to completely disable the built in auto-save by
default. In hindsight, however, we were so happy that we discovered and
squashed the cause of the performance issues that we forgot to consider
the future and, as a result, some servers have unfortunately been caught
by surprise when they ran their servers without any auto-save plugins.
Without the auto-save plugin conflict, however, Minecraft's default save
interval of 45 seconds is not suitable for the types of servers that run
Bukkit, to the point where it was negatively impacting performance. As
such, we've decided to re-enable the built in auto-save at an interval of
5 minutes for newly created servers.
The WorldMapCollection object for SecondaryWorldServers(Nether, End) is
shared with the main world, so saving it again for each SecondaryWorldServer
is redundant.
This commit removes the redundant call by checking if the WorldServer is an
instanceof SecondaryWorldServer before invoking worldMaps.a().
The recent Minecraft update rendered the
e20e50f85083dc53cb5456254bcf5781ef750daa fix incorrect by adding a
compound name to the base tag in some code. This fix changes all uses
of tag changes to explicitly use a name.
When a "uid.dat" file is corrupt (empty or <16 bytes), WorldNBTStorage
will silently fail to read and return null. Non-null behavior is
expected everywhere that this value is used.
This change will force a random UUID when the previous UUID cannot be
read, and getUUID to no longer silently ignore read/write exceptions.
This change adds the location and a more specific message to the
IllegalArgumentException that gets thrown when a hanging entity is being
spawned in a location that it cannot survive.
Opening a hopper inventory created by Server.createInventory will
currently have no effect as proper handling code is missing in
CraftEntityHuman for hopper inventories that aren't associated with a tile
entity or minecart. Initialization logic for hoppers is also missing from
CraftContainer, which is necessary for the opening of custom hopper
inventories.
This commit fixes the two aforementioned by adding proper handling to
CraftHumanEntity for opening inventories not associated with a tile
entity, and by adding initialization logic for hoppers to CraftContainer.
Previously fires spawned by lightning strikes were in the wrong locations.
This introduced the possibility of having blocks replaced when they should
not be.
EntityLightning now uses the correct locations as defined to spawn the
fires when needed.
When an entity is being moved as the passenger of an entity from one
entity to another, a VehicleExitEvent is fired, but it is assumed that the
current entity is a Vehicle. However, entities can be passengers of more than
just Vehicles, which causes a ClassCastException to be thrown.
This commit fixes the issue by checking that the current entity's vehicle's
bukkitEntity is an instance of Vehicle before casting it to Vehicle.
Prior to this change when a plugin called Player.hasLineOfSite() the
method would always return false because EntityHuman does not extend
EntityInsentient. This commit changes that by explicitly checking for
line of sight between two entities and returning that value.
This commit removes chat wrapping. It is no longer needed, as clients
properly render lines with line breaks.
This commit also changes an outgoing chat message to use the vanilla
behavior for indicating a client cannot chat with commands-only setting.
If a plugin generates an exception when returning a world generator, the
server will crash. This change adds a try-catch block to keep the server
from crashing on plugin defined world generators.
Custom inventories currently do not validate the titles provided. Null values
cause NPEs when writing packets. Values longer than 32 characters
disconnect clients.
This change throws and IllegalArgumentException for null titles or titles
longer than 32 characters.
The unleash event is only called for animals that are sitting - ones that
receive no movement vector. This adds the missing event call for
non-sitting animals.
When only considering trackers from player perspective, attach entity
packet could be sent before a packet for a respective vehicle is in view
and will, in turn, be ignored.
This adds another notification when the vehicle comes into view to cover
all cases.
A method has been added to Player which allows the server to send a sound string to the client. Assuming the client has the specified sound, it will be played. This is needed by the implementation of the /playsound command.
Items that cause entities to change state, including tags, chest, and
leashes, do not update the client properly following the firing of
PlayerInteractEntityEvent. This change makes the item checks occur
before the event fires, to concur with the client's assumptions.
This commit implements the ability to set the scale of hearts that the
client renders. When the Packet44UpdateAttributes packet is sent, the
max health attribute is replaced with a scaled version, to preserve the
scaled health illusion clientside.
In order to accurately display the scaled health for players, a true
health is stored within CraftPlayer, and the datawatcher now stores the
scaled health. The getHealth() method for players still returns their
true health.
Changed setHealth() within EntityLiving to appropriately handle health
for instances of EntityPlayer. Inlined a call to
setHealth(getMaxHealth()) within the EntityLiving constructor to work
around CraftEntity instantiation.
Additionally fixes the health values sent when eating food within
FoodMetaData and ItemFood, which previously sent the unscaled health;
this commit alters them to send the properly scaled health.
Additionally fixes BUKKIT-4535, BUKKIT-4536, and BUKKIT-4127
This changes livingEntity.addPotionEffect(PotionEffect, boolean) to
construct the MobEffect using the constructor that includes the ambient
setting as supplied by the PotionEffect
This also changes livingEntity.getActivePotionEffects() to construct the
PotionEffects using the ambient setting supplied by the MobEffects.
This change makes it so that EntityHuman#setPassengerOf(Entity) invokes
its parent method when leaving vehicles so that VehicleExitEvent is fired
for players leaving vehicles.
This change also fixes BUKKIT-2110, making it so VehicleExitEvent
correctly handles cancellation. The implementation of VehicleExitEvent
completely ignored the cancellation state of the event, making it so that
cancelling the event had no effect. Cancelling a VehicleExitEvent now
causes the entity to remain inside of the vehicle, with no visual stutter.
API has been added to interface with Horses and to modify their inventories. Horse entities will now be recognized with the type EntityType.HORSE, and will no longer be UNKNOWN.
HorseJumpEvent, EntityDamageEvent, and EntityTameEvent are all correctly fired for horses.
This commit fixes BUKKIT-4393.