Makes boats keep their boat type when teleported using the CraftBook fix
Some checks failed
EpicKnarvik97/Stargate/pipeline/head There was a failure building this commit
Some checks failed
EpicKnarvik97/Stargate/pipeline/head There was a failure building this commit
This commit is contained in:
parent
99bceb9165
commit
28d84450fb
@ -407,6 +407,7 @@ portalInfoServer=Server: %server%
|
|||||||
- Teleports boats/minecarts like other vehicles unless *enableCraftBookRemoveOnEjectFix* is enabled
|
- Teleports boats/minecarts like other vehicles unless *enableCraftBookRemoveOnEjectFix* is enabled
|
||||||
- Adds the *waitForPlayerAfterTeleportDelay* config option which allows changing the delay between vehicle teleportation
|
- Adds the *waitForPlayerAfterTeleportDelay* config option which allows changing the delay between vehicle teleportation
|
||||||
and the player being teleported to the vehicle
|
and the player being teleported to the vehicle
|
||||||
|
- Makes boats keep their wood type even when re-created
|
||||||
|
|
||||||
#### \[Version 0.9.3.3] EpicKnarvik97 fork
|
#### \[Version 0.9.3.3] EpicKnarvik97 fork
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import net.knarcraft.stargate.utility.DirectionHelper;
|
|||||||
import net.knarcraft.stargate.utility.TeleportHelper;
|
import net.knarcraft.stargate.utility.TeleportHelper;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.Boat;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Vehicle;
|
import org.bukkit.entity.Vehicle;
|
||||||
@ -156,6 +157,9 @@ public class VehicleTeleporter extends EntityTeleporter {
|
|||||||
}
|
}
|
||||||
//Spawn a new vehicle
|
//Spawn a new vehicle
|
||||||
Vehicle newVehicle = vehicleWorld.spawn(exit, teleportingVehicle.getClass());
|
Vehicle newVehicle = vehicleWorld.spawn(exit, teleportingVehicle.getClass());
|
||||||
|
if (teleportingVehicle instanceof Boat boat) {
|
||||||
|
((Boat) newVehicle).setWoodType(boat.getWoodType());
|
||||||
|
}
|
||||||
//Remove the old vehicle
|
//Remove the old vehicle
|
||||||
if (teleportingVehicle.eject()) {
|
if (teleportingVehicle.eject()) {
|
||||||
TeleportHelper.handleEntityPassengers(passengers, newVehicle, origin, portal, exit.getDirection());
|
TeleportHelper.handleEntityPassengers(passengers, newVehicle, origin, portal, exit.getDirection());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user