Commit Graph

215 Commits

Author SHA1 Message Date
CraftBukkit/Spigot 1d3a5b9292 SPIGOT-4543: Jukebox playing calls should not use legacy data
By: md_5 <git@md-5.net>
2018-12-22 10:24:13 +11:00
CraftBukkit/Spigot 20287f3b40 Tweak Block.getTemperature to return actual block temperature
By: md_5 <git@md-5.net>
2018-12-19 10:53:08 +11:00
CraftBukkit/Spigot 0cbe91dd0f SPIGOT-2151: Add support for getting simple bounding box of a block
By: Evoluseis <contact@evoluseis.me>
2018-12-17 19:11:04 -05:00
CraftBukkit/Spigot 42831b84cd Add BlockData#getAsString(boolean) to hide unspecified states
By: Parker Hawke <hawkeboyz2@hotmail.com>
2018-12-16 18:21:29 -05:00
CraftBukkit/Spigot 102dee7d4f Mappings Update
By: md_5 <git@md-5.net>
2018-12-06 10:00:00 +11:00
CraftBukkit/Spigot 6f6c96bd33 SPIGOT-4469: Age API for EndGateway
By: md_5 <git@md-5.net>
2018-11-06 18:12:31 +11:00
CraftBukkit/Spigot b092fdb392 SPIGOT-4447: Clear error for people trying to set an item as a block
By: md_5 <git@md-5.net>
2018-10-27 08:21:49 +11:00
CraftBukkit/Spigot 77d92cd515 SPIGOT-4446: Legacy rotation methods don't work for wall mounted skulls
By: md_5 <git@md-5.net>
2018-10-27 08:15:41 +11:00
CraftBukkit/Spigot 369edcded9 Add ray tracing and bounding box API
By: blablubbabc <lukas@wirsindwir.de>
2018-10-26 19:59:42 +11:00
CraftBukkit/Spigot a194267323 Update to Minecraft 1.13.2
By: md_5 <git@md-5.net>
2018-10-23 06:00:00 +11:00
CraftBukkit/Spigot 6f0acecee5 Add Block#isPassable
By: blablubbabc <lukas@wirsindwir.de>
2018-10-12 00:54:10 +02:00
CraftBukkit/Spigot be0cc7cf03 Catch plugins setting null Material or BlockData to blocks
By: md_5 <git@md-5.net>
2018-10-13 09:43:05 +11:00
CraftBukkit/Spigot 4aeb1a6fcd SPIGOT-4391: Sign editable API
By: md_5 <git@md-5.net>
2018-09-24 15:01:10 +10:00
CraftBukkit/Spigot eeb96c0247 SPIGOT-4348: Use online player for setting skull owner if possible
By: md_5 <git@md-5.net>
2018-09-06 20:47:37 +10:00
CraftBukkit/Spigot 6e786d4111 Fix some formatting in CraftLootable
By: md_5 <git@md-5.net>
2018-08-27 18:32:35 +10:00
CraftBukkit/Spigot 844b70144f SPIGOT-4316: Do even less processing when block placement without physics requested
By: md_5 <git@md-5.net>
2018-08-27 18:27:59 +10:00
CraftBukkit/Spigot 0a468a6738 SPIGOT-4307: Fix hacky API for banners on shields
By: md_5 <git@md-5.net>
2018-08-26 19:18:56 +10:00
CraftBukkit/Spigot 9fb6b929e8 Add additional tests for CraftBlockData
By: Senmori <thesenmori@gmail.com>
2018-08-25 01:35:40 -04:00
CraftBukkit/Spigot f578d94680 Update to Minecraft 1.13.1
By: md_5 <git@md-5.net>
2018-08-26 12:00:00 +10:00
CraftBukkit/Spigot 0be99ea5b2 Remove reflection from CraftBlockData
By: md_5 <git@md-5.net>
2018-08-25 08:39:04 +10:00
CraftBukkit/Spigot 39c4334d76 SPIGOT-1936: LootTable API
By: Senmori <thesenmori@gmail.com>
2018-08-12 18:39:51 +10:00
CraftBukkit/Spigot a24a2c26ae Add merging and matching of parsed BlockData
By: md_5 <git@md-5.net>
2018-08-06 14:40:06 +10:00
CraftBukkit/Spigot 2c8962edfa SPIGOT-4230: Improve legacy block types
By: md_5 <git@md-5.net>
2018-08-05 10:04:19 +10:00
CraftBukkit/Spigot 33f46cbebf SPIGOT-4221: Update surrounding blocks for cancelled break/place
By: md_5 <git@md-5.net>
2018-08-03 11:34:26 +10:00
CraftBukkit/Spigot e9fc2452ed SPIGOT-4214: Catch attempts to create BlockData for items
By: md_5 <git@md-5.net>
2018-08-02 20:24:56 +10:00
CraftBukkit/Spigot a0dd99dc78 SPIGOT-4197: Account for double trapped chests
By: md_5 <git@md-5.net>
2018-07-31 09:14:44 +10:00
CraftBukkit/Spigot f97fd5873f SPIGOT-4164: Treat new _AIR blocks as air
By: md_5 <git@md-5.net>
2018-07-28 08:28:56 +10:00
CraftBukkit/Spigot 7c7ba573a9 SPIGOT-4132: Fix missing break in RedstoneWire.setFace
By: md_5 <git@md-5.net>
2018-07-24 12:46:21 +10:00
CraftBukkit/Spigot 969eecd95e SPIGOT-4131: Fix typo affecting setting BlockData
By: md_5 <git@md-5.net>
2018-07-24 12:04:34 +10:00
CraftBukkit/Spigot dd007977eb SPIGOT-4120: Store BlockData enum mappings per class
By: md_5 <git@md-5.net>
2018-07-24 10:08:34 +10:00
CraftBukkit/Spigot fb4c827ec7 SPIGOT-4124: Fix misplaced PISTON_HEAD
By: md_5 <git@md-5.net>
2018-07-24 08:25:13 +10:00
CraftBukkit/Spigot 1e014acb80 Update to Minecraft 1.13
By: md_5 <git@md-5.net>
2018-07-22 12:00:00 +10:00
CraftBukkit/Spigot 8eca53392b CraftBlock.toString shouldn't make legacy call
By: md_5 <git@md-5.net>
2018-07-20 16:10:48 +10:00
CraftBukkit/Spigot 8ca7918c56 Fix bad old API call in CraftBlockState
By: md_5 <git@md-5.net>
2018-07-20 10:32:17 +10:00
CraftBukkit/Spigot 6826aaee8f SPIGOT-4074: Fix createBlockData succeeding on garbage
By: md_5 <git@md-5.net>
2018-07-20 10:20:15 +10:00
CraftBukkit/Spigot 88909dc795 Fix Block.setType alone being treated as legacy
By: md_5 <git@md-5.net>
2018-07-18 16:59:41 +10:00
CraftBukkit/Spigot 01e8982b04 SPIGOT-4037: Improve legacy BlockState.setData
By: md_5 <git@md-5.net>
2018-07-18 09:53:50 +10:00
CraftBukkit/Spigot 07fa7316e0 SPIGOT-4036: Handle regular/uncoloured shulker boxes
By: md_5 <git@md-5.net>
2018-07-18 09:45:27 +10:00
CraftBukkit/Spigot c712031a0d CraftBanner also needs to use wool data
By: md_5 <git@md-5.net>
2018-07-16 10:37:56 +10:00
CraftBukkit/Spigot 4a0fd18b27 Add javadocs to new CraftBlockData utility methods.
By: Senmori <thesenmori@gmail.com>
2018-07-15 02:25:03 -04:00
CraftBukkit/Spigot 7e0a66fdd5 Update to Minecraft 1.13-pre7
By: md_5 <git@md-5.net>
2018-07-15 10:00:00 +10:00
CraftBukkit/Spigot 5de19851fb Fix bad usage of setter in previous commit
By: md_5 <git@md-5.net>
2018-02-12 10:38:09 +11:00
CraftBukkit/Spigot 9355bb0ed9 Expand Structure Block API
By: Senmori <thesenmori@gmail.com>
2018-02-12 10:29:51 +11:00
CraftBukkit/Spigot 6f9c0bf3cb Expand CreatureSpawner API
By: Senmori <thesenmori@gmail.com>
2018-01-24 17:18:25 +11:00
CraftBukkit/Spigot 7e3f873771 Fix Block PistonMoveReaction
By: md_5 <git@md-5.net>
2018-01-10 10:47:26 +11:00
CraftBukkit/Spigot 02b4af5356 SPIGOT-3696: Clearing custom name of some blocks does not work
By: blablubbabc <lukas@wirsindwir.de>
2017-12-16 03:43:04 +01:00
CraftBukkit/Spigot 1ca95d2193 Fix CraftBanner initialisation.
By: Lukas Hennig <lukas@wirsindwir.de>
2017-08-07 03:30:41 +02:00
CraftBukkit/Spigot 8844b9ade9 Improvements to BlockStates
* 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.

By: Lukas Hennig <lukas@wirsindwir.de>
2017-08-05 14:37:19 +10:00
CraftBukkit/Spigot 40c8954e17 Update to Minecraft 1.12-pre2
By: md_5 <git@md-5.net>
2017-05-14 12:00:00 +10:00
CraftBukkit/Spigot ace33e4d68 Make CraftJukebox.isPlaying locally consistent
By: md_5 <git@md-5.net>
2017-04-16 08:26:51 +10:00