mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Added minecart classes, vehicle class, and the ability to spawn minecarts. StorageMinecart needs a getInventory(), but that is waiting on the addition of inventory code.
By: sk89q <the.sk89q@gmail.com>
This commit is contained in:
parent
b5fffb9a81
commit
339e57513a
5 changed files with 103 additions and 1 deletions
22
paper-api/src/main/java/org/bukkit/Minecart.java
Normal file
22
paper-api/src/main/java/org/bukkit/Minecart.java
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
package org.bukkit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a minecart entity.
|
||||||
|
*
|
||||||
|
* @author sk89q
|
||||||
|
*/
|
||||||
|
public interface Minecart extends Vehicle {
|
||||||
|
/**
|
||||||
|
* Sets a minecart's damage.
|
||||||
|
*
|
||||||
|
* @param damage over 40 to "kill" a minecart
|
||||||
|
*/
|
||||||
|
public void setDamage(int damage);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a minecart's damage.
|
||||||
|
*
|
||||||
|
* @param damage
|
||||||
|
*/
|
||||||
|
public int getDamage();
|
||||||
|
}
|
10
paper-api/src/main/java/org/bukkit/PoweredMinecart.java
Normal file
10
paper-api/src/main/java/org/bukkit/PoweredMinecart.java
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
package org.bukkit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a powered minecart.
|
||||||
|
*
|
||||||
|
* @author sk89q
|
||||||
|
*/
|
||||||
|
public interface PoweredMinecart extends Minecart {
|
||||||
|
|
||||||
|
}
|
9
paper-api/src/main/java/org/bukkit/StorageMinecart.java
Normal file
9
paper-api/src/main/java/org/bukkit/StorageMinecart.java
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
package org.bukkit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a storage minecart.
|
||||||
|
*
|
||||||
|
* @author sk89q
|
||||||
|
*/
|
||||||
|
public interface StorageMinecart extends Minecart {
|
||||||
|
}
|
37
paper-api/src/main/java/org/bukkit/Vehicle.java
Normal file
37
paper-api/src/main/java/org/bukkit/Vehicle.java
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
package org.bukkit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a vehicle entity.
|
||||||
|
*
|
||||||
|
* @author sk89q
|
||||||
|
*/
|
||||||
|
public interface Vehicle extends Entity {
|
||||||
|
/**
|
||||||
|
* Gets the vehicle's velocity.
|
||||||
|
*
|
||||||
|
* @return velocity vector
|
||||||
|
*/
|
||||||
|
public Vector getVelocity();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the vehicle's velocity.
|
||||||
|
*
|
||||||
|
* @param vel velocity vector
|
||||||
|
*/
|
||||||
|
public void setVelocity(Vector vel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the primary passenger of a vehicle. For vehicles that could have
|
||||||
|
* multiple passengers, this will only return the primary passenger.
|
||||||
|
*
|
||||||
|
* @return a living entity
|
||||||
|
*/
|
||||||
|
public LivingEntity getPassenger();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the vehicle has no passengers.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isEmpty();
|
||||||
|
}
|
|
@ -71,4 +71,28 @@ public interface World {
|
||||||
* @return whether the tree was created
|
* @return whether the tree was created
|
||||||
*/
|
*/
|
||||||
public boolean generateBigTree(Location loc);
|
public boolean generateBigTree(Location loc);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spawns a regular passenger minecart.
|
||||||
|
*
|
||||||
|
* @param loc
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Minecart spawnMinecart(Location loc);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spawns a storage minecart.
|
||||||
|
*
|
||||||
|
* @param loc
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public StorageMinecart spawnStorageMinecart(Location loc);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spawns a powered minecart.
|
||||||
|
*
|
||||||
|
* @param loc
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PoweredMinecart spawnPoweredMinecart(Location loc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue