Commit message (Collapse) | Author | Age | Lines | |
---|---|---|---|---|
* | Improvements to BlockStates | Lukas Hennig | 2017-08-05 | -9/+12 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Actually capture all the data of TileEntities. This is done by creating a copy of the TileEntity. The methods of BlockState which currently directly access the TileEntity reference will modify the data of that TileEntity-snapshot instead. * With the call to BlockState.update, the captured TileEntity data gets applied to the current TileEntity in the world. * Methods which trigger block specific actions will use the current TileEntity from the world. * CraftBlockState does not hand out the wrapped or the snapshot TileEntity directly. Instead, it provides an applyTo method to copy the data to a given TileEntity and a method to directly get a copy of the TileEntity NBT data represented by the BlockState. CraftMetaBlockState was updated to make use of that. * Added #getSnapshotInventory() to bukkit which allows modifiying the captured inventory snapshots of containers. * Tried to clarify which methods only work if the BlockState is placed, which methods require the block in the world to still be of the same type (methods which trigger actions), and that .getInventory() directly modifies the inventory of the block in the world if the BlockState is placed and becomes invalid if the block type is changed. Backwards compatibility * If the BlockState acts as InventoryHolder, getInventory() will still return the inventory directly backed by the TileEntity in the world (like before), and not the snapshot inventory. This compromise should reduce the potential of these changes to break existing plugins, or craftbukkit's own use of BlockState. * The snapshot's inventory can be accessed by a new method getSnapshotInventory() * In case the BlockState is not placed (if it was retrieved from the MetaBlockState of an item), the getInventory() method will however return the snapshot inventory. So that when the BlockState gets applied back to the item, the inventory changes are properly included. * With the changes to CraftMetaBlockState it is no longer required to call the update method before passing a modified BlockState to the CraftMetaBlockState. For backwards compatibility the update method will simply return true for a non-placed BlockState, without actually doing anything. Impact on plugins * Restoring blocks now actually works as expected, properly restoring the TileEntity data, reglardless if the block changed its type in the meantime. * Plugins are now consistently required to call the update method in order to apply changes to blocks. Though, regarding the Javadoc they should have been required to do so anyways. * New feature: Plugins can take and modify inventory snapshots. * Breaking change: If a plugin gets the BlockState of a block in the world, modifies the inventory returned by .getInventory(), and then tries to use the same BlockState to apply the TileEntity data to an ItemStack block meta, the ItemStack will use the snapshot inventory, disregarding the changes made to the inventory returned by .getInventory(). This is the compromise of .getInventory() returning the inventory directly backed by the TileEntity in the world. Other fixes related to BlockState: * TileEntityContainer#getLocation() will run into a NPE if the TileEntity is non-placed (ex. when getting the BlockState from a CraftMetaBlockState). * Beacon.getEntitiesInRange() would previously throw a NPE if called for a non-placed BlockState. It was changed to now require to be placed and use the current TileEntity in the world. If the TileEntity in the world is no longer a beacon, it will return an empty list. * EndGateway now supports setting and getting the exit location even for non-placed EndGateways (inside BlockStateMeta) by using / returning a location with world being null. | |||
* | SPIGOT-3492: Ensure player functionality uses their specific scoreboard | md_5 | 2017-08-05 | -6/+12 |
| | ||||
* | Update to Minecraft 1.12.1 | md_5 | 2017-08-03 | -209/+167 |
| | ||||
* | SPIGOT-3486: Missing check in redstone placement | md_5 | 2017-08-03 | -0/+11 |
| | ||||
* | SPIGOT-3487: Llama doesn't drop chest | md_5 | 2017-08-03 | -0/+19 |
| | ||||
* | SPIGOT-3482: ProjectileHitEvent for shulker bullet and llama spit | md_5 | 2017-08-02 | -0/+16 |
| | ||||
* | SPIGOT-3456: Expand calling of ServerCommandEvent | md_5 | 2017-07-28 | -4/+13 |
| | | | | Existing usage preserved by checking sender. | |||
* | SPIGOT-3403: Add an EntityPickupItemEvent | md_5 | 2017-07-28 | -25/+56 |
| | ||||
* | SPIGOT-3463: Spurious item drops from event | md_5 | 2017-07-28 | -69/+104 |
| | ||||
* | SPIGOT-3461: Standardise plugin load timing | md_5 | 2017-07-26 | -8/+12 |
| | ||||
* | SPIGOT-3432: Add playNote support for new sounds | md_5 | 2017-07-24 | -17/+30 |
| | ||||
* | SPIGOT-3440: Non player entities should not make new portals | md_5 | 2017-07-22 | -7/+12 |
| | ||||
* | SPIGOT-3433: Improve AreaEffectCloud#getSource | md_5 | 2017-07-22 | -9/+9 |
| | ||||
* | Fix memory leak in PlayerList | md_5 | 2017-07-17 | -35/+139 |
| | ||||
* | SPIGOT-3417: Event for shearing snowman | md_5 | 2017-07-15 | -5/+20 |
| | ||||
* | SPIGOT-3407: Set damager for evoker fangs | md_5 | 2017-07-08 | -0/+12 |
| | ||||
* | SPIGOT-3382: Ensure players can pickup stuff | md_5 | 2017-06-26 | -1/+1 |
| | ||||
* | SPIGOT-3377: Fix subspace bubble advancement | md_5 | 2017-06-26 | -1/+1 |
| | ||||
* | SPIGOT-3379: Generalise canPickupItems to other entities. | md_5 | 2017-06-26 | -28/+38 |
| | ||||
* | SPIGOT-3376: Fix nested functions | md_5 | 2017-06-26 | -28/+42 |
| | ||||
* | SPIGOT-3373: Fix /execute in gameloop functions | md_5 | 2017-06-25 | -5/+23 |
| | ||||
* | SPIGOT-3324: Improve tameable damage handling | md_5 | 2017-06-24 | -28/+29 |
| | ||||
* | SPIGOT-3368: Allow anvil level cost to be overwritten by properties | md_5 | 2017-06-23 | -9/+14 |
| | ||||
* | SPIGOT-3364: Correct EntityResurrectEvent | md_5 | 2017-06-23 | -1/+10 |
| | ||||
* | Fix nether world border center not adjusting | md_5 | 2017-06-18 | -0/+31 |
| | ||||
* | SPIGOT-3329: Allow per world loot tables | md_5 | 2017-06-15 | -6/+5 |
| | ||||
* | SPIGOT-3337: Use special data value to indicate multiple recipe choices | md_5 | 2017-06-15 | -2/+2 |
| | ||||
* | Fix detection of missing or invalid tile entities for End portals and gateways | Jacob Martin | 2017-06-12 | -2/+2 |
| | ||||
* | SPIGOT-3328: EntityTameEvent for Parrots | md_5 | 2017-06-12 | -0/+93 |
| | ||||
* | SPIGOT-3324: Best effort fix for shoulder Parrots + cancelled damage event | md_5 | 2017-06-11 | -18/+28 |
| | ||||
* | SPIGOT-3320: Apply tile entity fixer to more types | md_5 | 2017-06-11 | -30/+78 |
| | ||||
* | SPIGOT-3304: Respect duration from Vanilla /weather | md_5 | 2017-06-09 | -8/+4 |
| | ||||
* | SPIGOT-3303: Warn when attempting to grant non existent recipe | md_5 | 2017-06-09 | -11/+20 |
| | ||||
* | SPIGOT-3302: Armor stands not dropping armor | md_5 | 2017-06-09 | -0/+8 |
| | ||||
* | Update to Minecraft 1.12 | md_5 | 2017-06-08 | -66/+57 |
| | ||||
* | Prevent NPE when setting tempt target to null | chickeneer | 2017-06-04 | -1/+1 |
| | ||||
* | Add proper TeleportCause for /teleport | md_5 | 2017-06-04 | -8/+24 |
| | ||||
* | SPIGOT-3290: /teleport command overrides player rotation | md_5 | 2017-06-04 | -1/+1 |
| | ||||
* | SPIGOT-3286: Call BlockFormEvent for Concrete Powder -> Concrete | md_5 | 2017-06-03 | -7/+29 |
| | ||||
* | Update to Minecraft 1.12-pre6 | md_5 | 2017-05-30 | -254/+291 |
| | ||||
* | Add support for preventing block drops in BreakEvent | Scetra | 2017-05-28 | -10/+17 |
| | ||||
* | Add color API for Teams | md_5 | 2017-05-28 | -0/+11 |
| | ||||
* | SPIGOT-3272: Fix duplicate creative inventory | Pokechu22 | 2017-05-28 | -16/+15 |
| | | | | This change properly identifies the creative inventory as one with 5 crafting slots (as that's the default set in ContainerPlayer, and handled properly in other containers), instead of having the same inventory twice (which breaks slot identification). | |||
* | SPIGOT-439: Add player locale related APIs. | MiniDigger | 2017-05-27 | -34/+44 |
| | ||||
* | Ensure gameLoop function gets selectors applied. | md_5 | 2017-05-26 | -0/+11 |
| | ||||
* | SPIGOT-3257: Issue with AdvancementRewards function | md_5 | 2017-05-21 | -0/+20 |
| | ||||
* | SPIGOT-3258: VehicleBlockCollisionEvent only fires in certain directions | md_5 | 2017-05-21 | -4/+4 |
| | ||||
* | SPIGOT-3254: Check chunks are loaded before ticking entities as per previous ↵ | md_5 | 2017-05-20 | -14/+28 |
| | | | | versions. | |||
* | Update to Minecraft 1.12-pre5 | md_5 | 2017-05-19 | -277/+216 |
| | ||||
* | Misc advancement / recipe reload fixes including SPIGOT-3240 | md_5 | 2017-05-16 | -36/+73 |
| |