Commit Graph

2183 Commits

Author SHA1 Message Date
Eimref
cf7dfeda62 Add proper logging for custom channel exceptions. 2013-03-02 15:57:00 -06:00
Travis Watkins
f6c574dd04 Implement PlayerItemConsumeEvent. Adds BUKKIT-2349 2013-03-02 00:33:46 -06:00
Andrzej Pomirski
993e19b3fb Close inventory on teleport. FIXES BUKKIT-3021. 2013-02-10 17:22:34 -06:00
EdGruberman
d06e597ca5 Check TravelAgent.findOrCreate(Location) for null; Fixes BUKKIT-3590
If a custom TravelAgent is used and returns null for findOrCreate method
a NullPointerException will occur.
Conflicts:
	src/main/java/net/minecraft/server/PlayerList.java
2013-02-10 17:21:59 -06:00
James Clarke
5bb81b75c7 Set CraftTravelAgent.DEFAULT to a non-null value. Fixes BUKKIT-3578
Currently, CraftTravelAgent will call s() on the passed-in WorldServer in order to set DEFAULT. However, s() will always return null at this point, because WorldServer.P will still be null, as it is set after the constructor is called. Instead, we set CraftTravelAgent.DEFAULT to the instance that is being constructed.
2013-02-06 16:45:22 -06:00
feildmaster
2e99e02094 Use entity UUID instead of EntityID for metadata. Fixes BUKKIT-3582
The entity id is a non-unique, non-persistent value, and will cause
entities to lose their respective meta data on chunk unloading, and
teleportation.
2013-02-06 16:32:19 -06:00
EdGruberman
efe8e9a7f5 Always return a TravelAgent; Fixes BUKKIT-3541
Recent changes caused PlayerPortalEvent to suddenly return null
unexpectedly and could end up in NPEs resulting that did not before.
This commit addresses that situation by always ensuring a TravelAgent
instance is returned.

The TravelAgent for world 0 is returned arbitrarily in an effort to
compensate for plugins that are implementation dependent and expect some
form of a TravelAgent to be accessible in the event at all times.
2013-02-04 18:53:06 -06:00
James Clarke
4d3865a036 Fix players spawning above portals. Fixes BUKKIT-3542.
Vanilla does not check for blocks in which the player could
suffocate when changing dimension, so portals will happily spawn
players in blocks when using a portal under certain
circumstances. However, we currently check for these instances
and move the player up until they will not suffocate. This means
that players can sometimes be taken to above the target portal,
making it seem as if a portal was not created. Instead, we now
disable this suffocation check when moveToWorld is called from
changeDimension, mirroring vanilla behavior more accurately.
2013-02-04 18:53:05 -06:00
James Clarke
d661c67a70 Always use the set exit location for portal events. Fixes BUKKIT-3555. 2013-02-04 18:53:04 -06:00
James Clarke
94da64ee93 Use the result of EntityPortalExitEvent. Fixes BUKKIT-3559. 2013-02-04 18:53:03 -06:00
EvilSeph
1090e0cf46 Updated version to 1.4.7-R1.1-SNAPSHOT for development towards next release. 2013-01-30 23:44:50 -05:00
EvilSeph
416f1d6ccf Updated version to 1.4.7-R1.0 in pom.xml for RB. 2013-01-30 23:32:21 -05:00
feildmaster
b4b7cacf5e Fix NPE when getting bed spawn location. 2013-01-29 17:25:39 -06:00
feildmaster
37975946a2 Fix contract with Player.getBedSpawnLocation. Fixes BUKKIT-3525
Getting the bed spawn location is supposed to check if the bed is
valid, however, it currently did not do so.
2013-01-29 10:11:57 -06:00
feildmaster
0576395ddd When leaving the end, always target the main world. Fixes BUKKIT-3517 2013-01-29 09:48:52 -06:00
feildmaster
b0e43c8097 Make command blocks only select players on its world. Fixes BUKKIT-3515 2013-01-28 17:01:08 -06:00
EdGruberman
132fdbc4ac Target default world when returning from The End; Fixes BUKKIT-3494
Due to the having to generate new logic to avoid using the customized
PlayerConnection.moveToWorld, entities returning from The End were not
properly calculating their exit target.  This commit corrects that
logic.
2013-01-28 11:26:32 -06:00
Wesley Wolfe
50e74b3b49 Remove erroneous break statement in scheduler. Fixes BUKKIT-3395 2013-01-27 23:00:14 -06:00
feildmaster
1053a1e29d Update Fireballs to account for ExplosionPower. Fixes BUKKIT-3460
Adds BUKKIT-3516
2013-01-27 16:43:30 -06:00
feildmaster
f20d6e3595 Ignore block functions for skulls on BlockPlace. Fixes BUKKIT-3495
Skulls don't normally get block data applied to them, so we shouldn't
apply it either.
2013-01-27 11:31:27 -06:00
feildmaster
899b9c17cc Direct all BlockPlaceEvents to a singular location. Fixes BUKKIT-3438
By having a single function to process BlockPlacement logic, we make
it so that there is consistent behavior throughout all BlockPlace
events. This should allow for easier troubleshooting and less diffs
in source.

This also fixes BUKKIT-3463 by including the correct coordinates that
were clicked to the event.
2013-01-27 10:44:32 -06:00
feildmaster
528bbbdcd8 Fix TileEntities and Blocks getting out of sync. Fixes BUKKIT-3501
Also fixes: BUKKIT-3477 and BUKKIT-3488

Minecraft likes to double check that tile entities get set after they
are placed, however we didn't set tile entities until after our event
was called. This caused the world to have multiple tile entities in a
single block location; to fix this we now set tile entities before
the event.
2013-01-27 10:34:59 -06:00
QuarterAnimal
6e438ccb32 Call BlockGrowEvent for Cocoa plants. Fixes BUKKIT-2525 2013-01-24 19:57:52 -06:00
QuarterAnimal
d74cf36f1c Add BlockCocoa for diff visibility. 2013-01-24 19:57:15 -06:00
QuarterAnimal
b82375a596 Preserve source block in mushroom spread event. Fixes BUKKIT-3354 2013-01-24 19:50:21 -06:00
feildmaster
f10c986136 Properly calculate level cost for books. Fixes BUKKIT-3410 2013-01-24 18:10:03 -06:00
feildmaster
f1efe717bd Call BlockPlaceEvent for skulls the same as other blocks. BUKKIT-3406
When the skull BlockPlaceEvent was added it was made so the event
would be called after all the data has been set, however this is a
behavior change that is inconsistent with other BlockPlaceEvents.
Instead, if people wish to get the block data they should schedule
a task.

Relates to: BUKKIT-3438
2013-01-23 20:41:05 -06:00
EdGruberman
9df87d3399 Compensate for allow-nether/allow-end as false; Fixes BUKKIT-3466
When either of those settings are false, the worlds are not loaded and
therefore will not be targeted for portal exits.  Existing worlds are
iterated directly to avoid defaulting to the first world if a direct
dimension match is not found.

Plugins must also specify exit from custom Bukkit worlds to comply with
original commit: https://github.com/Bukkit/CraftBukkit/commit/2dc2af0

This commit introduces a constant to clarify the dependency on the
CraftBukkit implementation of custom worlds having a dimension offset.
2013-01-23 20:11:01 -06:00
feildmaster
488e45b4ff Reload ban files when reloading the server. Adds BUKKIT-3470 2013-01-23 06:24:40 -06:00
feildmaster
641ecc4f34 Return the valid max value for piston direction. Fixes BUKKIT-2191
By returning the following value (7) we remove the need to special
case pistons in any way (other than the original purpose of this
check, which is to ensure pistons have valid data)
2013-01-23 06:15:21 -06:00
feildmaster
9ba0ddc292 Refactor processBlockPlace logic. Fixes BUKKIT-3406 and BUKKIT-3454
The previous logic was faulty since it lost the logic of "placing" the
block. It was also taking into account data that could have been
changed outside of the processing of this event, which is irrelevant
to the processing of this event.
2013-01-19 08:14:17 -06:00
feildmaster
6a499c8589 Fix broken null contract with Jukebox.setPlaying, Fixes BUKKIT-3429
The javadocs state that a null may be used to remove the currently
playing sound, however this causes a NullPointerException.

It also doesn't process registering the record correctly, along with
processing non-valid items.
2013-01-19 08:14:17 -06:00
EdGruberman
d834ca4c6c [Bleeding] Add experimental support for entity portal traveling 2013-01-19 06:20:33 -06:00
EdGruberman
9cb320654d Add BlockEnderPortal for diff visibility 2013-01-19 06:20:32 -06:00
Wesley Wolfe
01fc296fef Improve the item meta deserialization code-style
Fixed the ItemMetaFireworkTest

Add set power unit tests for FireworkMeta
2013-01-18 02:58:07 -06:00
Zloteanu Nikita
5934a65729 Always call PotionSplashEvent. Fixes BUKKIT-3363
This change allows plugins to add recipients to a PotionSplashEvent
when it would have otherwise had none.
2013-01-17 22:55:09 -06:00
feildmaster
d577b840d4 Place beds with the correct data. Fixes BUKKIT-3447 2013-01-17 12:17:37 -06:00
EvilSeph
3d133d7abd Updated version to 1.4.7-R0.2-SNAPSHOT for development towards next release. 2013-01-17 05:30:48 -05:00
EvilSeph
ed817d199b Updated version to 1.4.7-R0.1 in pom.xml for Beta. 2013-01-17 05:15:55 -05:00
feildmaster
e59af9908b Update CraftBukkit to Minecraft 1.4.7 2013-01-17 03:50:24 -06:00
feildmaster
315127782a Initialize entity data before spawning them. Fixes BUKKIT-3209
Vanilla does the initialize before spawning everywhere except in the
SpawnerCreature, our spawn event depends on this behavior to be
consistent.
2013-01-16 23:05:18 -06:00
bloodmc
b581068464 Fix entities traveling sideways. Addresses BUKKIT-3443
Original: Update mappings to correct 1.4.6 version.
2013-01-16 23:05:18 -06:00
feildmaster
ccbd3d84e8 Get the BlockState before changing the block. Fixes BUKKIT-3441 2013-01-16 20:21:38 -06:00
feildmaster
98aea835b5 Handle beds and doors the same way as other blocks. Fixes BUKKIT-3437
Relates to: BUKKIT-3438
2013-01-16 08:06:00 -06:00
feildmaster
614ef2f8c5 Throw BlockPlaceEvent when placing double slabs. Fixes BUKKIT-2469 2013-01-16 08:05:59 -06:00
Wesley Wolfe
647b82032b Add ItemStackMapTest
This test was missing from c056293b38cb9a1296937d91746b175252be044a
2013-01-15 01:22:53 -06:00
cexikitin
8bc9e712e1 Spawn monsters without prematurely exiting. Fixes BUKKIT-3425
By using return 0, we exit the loop prematurely preventing other
creature types from being spawned if one type is set to 0. By using
continue we move on to the other types and allow them to spawn
properly.
2013-01-14 19:24:08 -06:00
Wesley Wolfe
dd7ba4a258 Various ItemMeta fixes.
Fixes BUKKIT-3408, BUKKIT-3190, BUKKIT-3191, BUKKIT-3407

These changes relate mostly to semantical changes for serialization
contract, exception of changing the map scaling value from byte to boolean,
what it should have been in the first place. Appropriate unit tests were
added for CraftMapMeta, as they were missing.
2013-01-09 05:04:08 -06:00
Wesley Wolfe
43865e8e67 Update unit test to reflect firework color fix. Fixes BUKKIT-3382
The ItemDye color-int array uses dye data values, not wool.
2013-01-05 17:16:19 -06:00
Wesley Wolfe
182681e384 Update calls to DyeColor getData and getByData. Addresses BUKKIT-2786
These two methods are now deprecated and replaced by the strictly
equivalent calls using wool data.
2013-01-05 17:15:49 -06:00