Reformat also this

This commit is contained in:
Shevchik 2014-03-05 23:41:01 +04:00
parent 9d231ca8b8
commit ca3fecdef4
3 changed files with 10 additions and 22 deletions

View File

@ -6,21 +6,15 @@ public class GetVehicleArrowClass {
private String pkgname = this.getClass().getPackage().getName(); private String pkgname = this.getClass().getPackage().getName();
private String vehiclearrowclassname = "VehicleArrow"; private String vehiclearrowclassname = "VehicleArrow";
public Class<?> getVehicleArrowClass(String arrowclass, Class<?> entityarrow, Class<?> craftserver) throws Exception public Class<?> getVehicleArrowClass(String arrowclass, Class<?> entityarrow, Class<?> craftserver) throws Exception {
{
String packageName = Bukkit.getServer().getClass().getPackage().getName(); String packageName = Bukkit.getServer().getClass().getPackage().getName();
String nmspackageversion = packageName.substring(packageName.lastIndexOf('.') + 1); String nmspackageversion = packageName.substring(packageName.lastIndexOf('.') + 1);
if (nmspackageversion.equals("v1_7_R1")) if (nmspackageversion.equals("v1_7_R1")) {
{
return Class.forName(pkgname+"."+"nms172"+"."+vehiclearrowclassname); return Class.forName(pkgname+"."+"nms172"+"."+vehiclearrowclassname);
} else } else if (nmspackageversion.equals("v1_6_R3")) {
if (nmspackageversion.equals("v1_6_R3"))
{
return Class.forName(pkgname+"."+"nms164"+"."+vehiclearrowclassname); return Class.forName(pkgname+"."+"nms164"+"."+vehiclearrowclassname);
} }
throw new Exception("ChiarsReloaded is not compatible with your server version"); throw new Exception("ChairsReloaded is not compatible with your server version");
} }
} }

View File

@ -8,16 +8,13 @@ import org.bukkit.entity.Vehicle;
public class VehicleArrow extends CraftArrow implements Vehicle { public class VehicleArrow extends CraftArrow implements Vehicle {
public VehicleArrow(CraftServer server, EntityArrow entity) public VehicleArrow(CraftServer server, EntityArrow entity) {
{
super(server, entity); super(server, entity);
} }
@Override @Override
public void remove() public void remove() {
{ if (this.getPassenger() == null) {
if (this.getPassenger() == null)
{
super.remove(); super.remove();
} }
} }

View File

@ -8,16 +8,13 @@ import org.bukkit.entity.Vehicle;
public class VehicleArrow extends CraftArrow implements Vehicle { public class VehicleArrow extends CraftArrow implements Vehicle {
public VehicleArrow(CraftServer server, EntityArrow entity) public VehicleArrow(CraftServer server, EntityArrow entity) {
{
super(server, entity); super(server, entity);
} }
@Override @Override
public void remove() public void remove() {
{ if (this.getPassenger() == null) {
if (this.getPassenger() == null)
{
super.remove(); super.remove();
} }
} }