mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-12-26 17:18:43 +01:00
Change Sponge method behavior
This commit is contained in:
parent
33ec80c2cb
commit
34c2da55ca
@ -1,6 +1,7 @@
|
|||||||
package com.plotsquared.sponge.object;
|
package com.plotsquared.sponge.object;
|
||||||
|
|
||||||
import com.flowpowered.math.vector.Vector3d;
|
import com.flowpowered.math.vector.Vector3d;
|
||||||
|
import com.intellectualcrafters.plot.PS;
|
||||||
import com.intellectualcrafters.plot.commands.RequiredType;
|
import com.intellectualcrafters.plot.commands.RequiredType;
|
||||||
import com.intellectualcrafters.plot.object.Location;
|
import com.intellectualcrafters.plot.object.Location;
|
||||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||||
@ -111,8 +112,12 @@ public class SpongePlayer extends PlotPlayer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCompassTarget(Location location) {
|
public void setCompassTarget(Location location) {
|
||||||
TargetedLocationData target = this.player.getOrCreate(TargetedLocationData.class).get();
|
Optional<TargetedLocationData> target = this.player.getOrCreate(TargetedLocationData.class);
|
||||||
target.set(Keys.TARGETED_LOCATION, SpongeUtil.getLocation(location).getPosition());
|
if (target.isPresent()) {
|
||||||
|
target.get().set(Keys.TARGETED_LOCATION, SpongeUtil.getLocation(location).getPosition());
|
||||||
|
} else {
|
||||||
|
PS.debug("Failed to set compass target.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user