Permalink
Browse files

Merge branch 'master' of https://github.com/EngineHub/CommandHelper i…

…nto checkstyle3
  • Loading branch information...
Pieter12345 committed Jun 7, 2018
2 parents 62189af + ca72bc5 commit 60f75f85d89f8401d1d3e3741ca3284c9792c6a1
Showing with 475 additions and 45 deletions.
  1. +17 −0 src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCBoat.java
  2. +23 −0 src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCEvokerFangs.java
  3. +16 −0 src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCExplosiveMinecart.java
  4. +14 −0 src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCFallingBlock.java
  5. +22 −0 src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCHopperMinecart.java
  6. +15 −0 src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCPoweredMinecart.java
  7. +16 −0 src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCRideableMinecart.java
  8. +36 −0 src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCShulker.java
  9. +11 −2 src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCSnowman.java
  10. +16 −0 src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCSpawnerMinecart.java
  11. +22 −0 src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCStorageMinecart.java
  12. +3 −2 src/main/java/com/laytonsmith/abstraction/entities/MCBoat.java
  13. +3 −0 src/main/java/com/laytonsmith/abstraction/entities/MCEvokerFangs.java
  14. +5 −0 src/main/java/com/laytonsmith/abstraction/entities/MCExplosiveMinecart.java
  15. +2 −5 src/main/java/com/laytonsmith/abstraction/entities/MCFallingBlock.java
  16. +7 −0 src/main/java/com/laytonsmith/abstraction/entities/MCHopperMinecart.java
  17. +5 −0 src/main/java/com/laytonsmith/abstraction/entities/MCPoweredMinecart.java
  18. +5 −0 src/main/java/com/laytonsmith/abstraction/entities/MCRideableMinecart.java
  19. +11 −0 src/main/java/com/laytonsmith/abstraction/entities/MCShulker.java
  20. +5 −0 src/main/java/com/laytonsmith/abstraction/entities/MCSpawnerMinecart.java
  21. +7 −0 src/main/java/com/laytonsmith/abstraction/entities/MCStorageMinecart.java
  22. +1 −1 src/main/java/com/laytonsmith/abstraction/enums/MCEntityType.java
  23. +13 −0 src/main/java/com/laytonsmith/abstraction/enums/MCTreeSpecies.java
  24. +25 −13 src/main/java/com/laytonsmith/abstraction/enums/bukkit/BukkitMCEntityType.java
  25. +46 −0 src/main/java/com/laytonsmith/abstraction/enums/bukkit/BukkitMCTreeSpecies.java
  26. +6 −1 src/main/java/com/laytonsmith/core/ObjectGenerator.java
  27. +98 −12 src/main/java/com/laytonsmith/core/functions/EntityManagement.java
  28. +4 −0 src/main/java/com/laytonsmith/core/functions/ExecutionQueue.java
  29. +5 −7 src/main/java/com/laytonsmith/core/functions/PlayerManagement.java
  30. +3 −2 src/main/resources/data_names.txt
  31. +13 −0 src/main/resources/functionDocs/entity_spec
@@ -1,6 +1,8 @@
package com.laytonsmith.abstraction.bukkit.entities;
import com.laytonsmith.abstraction.entities.MCBoat;
import com.laytonsmith.abstraction.enums.MCTreeSpecies;
import com.laytonsmith.abstraction.enums.bukkit.BukkitMCTreeSpecies;
import org.bukkit.entity.Boat;
import org.bukkit.entity.Entity;
@@ -22,4 +24,19 @@ public double getMaxSpeed() {
public void setMaxSpeed(double speed) {
b.setMaxSpeed(speed);
}
@Override
public MCTreeSpecies getWoodType() {
return BukkitMCTreeSpecies.getConvertor().getAbstractedEnum(b.getWoodType());
}
@Override
public void setWoodType(MCTreeSpecies type) {
try {
b.setWoodType(BukkitMCTreeSpecies.getConvertor().getConcreteEnum(type));
} catch(NoSuchMethodError ex) {
// probably prior to 1.9
}
}
}
@@ -1,12 +1,35 @@
package com.laytonsmith.abstraction.bukkit.entities;
import com.laytonsmith.abstraction.MCLivingEntity;
import com.laytonsmith.abstraction.bukkit.BukkitConvertor;
import com.laytonsmith.abstraction.entities.MCEvokerFangs;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EvokerFangs;
import org.bukkit.entity.LivingEntity;
public class BukkitMCEvokerFangs extends BukkitMCEntity implements MCEvokerFangs {
private EvokerFangs ef;
public BukkitMCEvokerFangs(Entity ent) {
super(ent);
ef = (EvokerFangs) ent;
}
@Override
public MCLivingEntity getOwner() {
if(ef.getOwner() == null) {
return null;
}
return (MCLivingEntity) BukkitConvertor.BukkitGetCorrectEntity(ef.getOwner());
}
@Override
public void setOwner(MCLivingEntity owner) {
if(owner == null) {
ef.setOwner(null);
} else {
ef.setOwner((LivingEntity) owner.getHandle());
}
}
}
@@ -0,0 +1,16 @@
package com.laytonsmith.abstraction.bukkit.entities;
import com.laytonsmith.abstraction.entities.MCExplosiveMinecart;
import org.bukkit.entity.Entity;
import org.bukkit.entity.minecart.ExplosiveMinecart;
public class BukkitMCExplosiveMinecart extends BukkitMCMinecart implements MCExplosiveMinecart {
ExplosiveMinecart em;
public BukkitMCExplosiveMinecart(Entity e) {
super(e);
this.em = (ExplosiveMinecart) e;
}
}
@@ -40,6 +40,20 @@ public void setDropItem(boolean drop) {
f.setDropItem(drop);
}
@Override
public boolean canHurtEntities() {
return f.canHurtEntities();
}
@Override
public void setHurtEntities(boolean hurt) {
try {
f.setHurtEntities(hurt);
} catch(NoSuchMethodError ex) {
// probably prior to 1.8.8
}
}
@Override
public FallingBlock getHandle() {
return f;
@@ -0,0 +1,22 @@
package com.laytonsmith.abstraction.bukkit.entities;
import com.laytonsmith.abstraction.MCInventory;
import com.laytonsmith.abstraction.bukkit.BukkitMCInventory;
import com.laytonsmith.abstraction.entities.MCHopperMinecart;
import org.bukkit.entity.Entity;
import org.bukkit.entity.minecart.HopperMinecart;
public class BukkitMCHopperMinecart extends BukkitMCMinecart implements MCHopperMinecart {
HopperMinecart hm;
public BukkitMCHopperMinecart(Entity e) {
super(e);
this.hm = (HopperMinecart) e;
}
@Override
public MCInventory getInventory() {
return new BukkitMCInventory(hm.getInventory());
}
}
@@ -0,0 +1,15 @@
package com.laytonsmith.abstraction.bukkit.entities;
import com.laytonsmith.abstraction.entities.MCPoweredMinecart;
import org.bukkit.entity.Entity;
import org.bukkit.entity.minecart.PoweredMinecart;
public class BukkitMCPoweredMinecart extends BukkitMCMinecart implements MCPoweredMinecart {
PoweredMinecart pm;
public BukkitMCPoweredMinecart(Entity e) {
super(e);
this.pm = (PoweredMinecart) e;
}
}
@@ -0,0 +1,16 @@
package com.laytonsmith.abstraction.bukkit.entities;
import com.laytonsmith.abstraction.entities.MCRideableMinecart;
import org.bukkit.entity.Entity;
import org.bukkit.entity.minecart.RideableMinecart;
public class BukkitMCRideableMinecart extends BukkitMCMinecart implements MCRideableMinecart {
RideableMinecart rm;
public BukkitMCRideableMinecart(Entity e) {
super(e);
this.rm = (RideableMinecart) e;
}
}
@@ -0,0 +1,36 @@
package com.laytonsmith.abstraction.bukkit.entities;
import com.laytonsmith.abstraction.entities.MCShulker;
import com.laytonsmith.abstraction.enums.MCDyeColor;
import com.laytonsmith.abstraction.enums.bukkit.BukkitMCDyeColor;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Shulker;
public class BukkitMCShulker extends BukkitMCLivingEntity implements MCShulker {
private Shulker sh;
public BukkitMCShulker(Entity be) {
super(be);
this.sh = (Shulker) be;
}
@Override
public MCDyeColor getColor() {
try {
return BukkitMCDyeColor.getConvertor().getAbstractedEnum(sh.getColor());
} catch(NoSuchMethodError ex) {
// probably prior to 1.12
}
return MCDyeColor.PURPLE;
}
@Override
public void setColor(MCDyeColor color) {
try {
sh.setColor(BukkitMCDyeColor.getConvertor().getConcreteEnum(color));
} catch(NoSuchMethodError ex) {
// probably prior to 1.12
}
}
}
@@ -18,12 +18,21 @@ public BukkitMCSnowman(AbstractionObject ao) {
@Override
public void setDerp(boolean derp) {
((Snowman) getHandle()).setDerp(derp);
try {
((Snowman) getHandle()).setDerp(derp);
} catch(NoSuchMethodError ex) {
// probably prior to 1.9.4
}
}
@Override
public boolean isDerp() {
return ((Snowman) getHandle()).isDerp();
try {
return ((Snowman) getHandle()).isDerp();
} catch(NoSuchMethodError ex) {
// probably prior to 1.9.4
}
return false;
}
}
@@ -0,0 +1,16 @@
package com.laytonsmith.abstraction.bukkit.entities;
import com.laytonsmith.abstraction.entities.MCSpawnerMinecart;
import org.bukkit.entity.Entity;
import org.bukkit.entity.minecart.SpawnerMinecart;
public class BukkitMCSpawnerMinecart extends BukkitMCMinecart implements MCSpawnerMinecart {
SpawnerMinecart sm;
public BukkitMCSpawnerMinecart(Entity e) {
super(e);
this.sm = (SpawnerMinecart) e;
}
}
@@ -0,0 +1,22 @@
package com.laytonsmith.abstraction.bukkit.entities;
import com.laytonsmith.abstraction.MCInventory;
import com.laytonsmith.abstraction.bukkit.BukkitMCInventory;
import com.laytonsmith.abstraction.entities.MCHopperMinecart;
import org.bukkit.entity.Entity;
import org.bukkit.entity.minecart.StorageMinecart;
public class BukkitMCStorageMinecart extends BukkitMCMinecart implements MCHopperMinecart {
StorageMinecart sm;
public BukkitMCStorageMinecart(Entity e) {
super(e);
this.sm = (StorageMinecart) e;
}
@Override
public MCInventory getInventory() {
return new BukkitMCInventory(sm.getInventory());
}
}
@@ -1,10 +1,11 @@
package com.laytonsmith.abstraction.entities;
import com.laytonsmith.abstraction.MCVehicle;
import com.laytonsmith.abstraction.enums.MCTreeSpecies;
public interface MCBoat extends MCVehicle {
double getMaxSpeed();
void setMaxSpeed(double speed);
MCTreeSpecies getWoodType();
void setWoodType(MCTreeSpecies type);
}
@@ -1,6 +1,9 @@
package com.laytonsmith.abstraction.entities;
import com.laytonsmith.abstraction.MCEntity;
import com.laytonsmith.abstraction.MCLivingEntity;
public interface MCEvokerFangs extends MCEntity {
MCLivingEntity getOwner();
void setOwner(MCLivingEntity owner);
}
@@ -0,0 +1,5 @@
package com.laytonsmith.abstraction.entities;
public interface MCExplosiveMinecart extends MCMinecart {
}
@@ -4,14 +4,11 @@
import com.laytonsmith.abstraction.blocks.MCMaterial;
public interface MCFallingBlock extends MCEntity {
byte getBlockData();
int getBlockId();
boolean getDropItem();
MCMaterial getMaterial();
void setDropItem(boolean drop);
boolean canHurtEntities();
void setHurtEntities(boolean hurt);
}
@@ -0,0 +1,7 @@
package com.laytonsmith.abstraction.entities;
import com.laytonsmith.abstraction.MCInventoryHolder;
public interface MCHopperMinecart extends MCMinecart, MCInventoryHolder {
}
@@ -0,0 +1,5 @@
package com.laytonsmith.abstraction.entities;
public interface MCPoweredMinecart extends MCMinecart {
}
@@ -0,0 +1,5 @@
package com.laytonsmith.abstraction.entities;
public interface MCRideableMinecart extends MCMinecart {
}
@@ -0,0 +1,11 @@
package com.laytonsmith.abstraction.entities;
import com.laytonsmith.abstraction.MCLivingEntity;
import com.laytonsmith.abstraction.enums.MCDyeColor;
public interface MCShulker extends MCLivingEntity {
MCDyeColor getColor();
void setColor(MCDyeColor color);
}
@@ -0,0 +1,5 @@
package com.laytonsmith.abstraction.entities;
public interface MCSpawnerMinecart extends MCMinecart {
}
@@ -0,0 +1,7 @@
package com.laytonsmith.abstraction.entities;
import com.laytonsmith.abstraction.MCInventoryHolder;
public interface MCStorageMinecart extends MCMinecart, MCInventoryHolder {
}
@@ -132,7 +132,7 @@ public boolean isSpawnable() {
ENDER_EYE(true),
ENDER_PEARL(true),
EVOKER(true, MCVersion.MC1_11),
EVOKER_FANGS(false, MCVersion.MC1_11),
EVOKER_FANGS(true, MCVersion.MC1_11),
EXPERIENCE_ORB(true),
/**
* Spawn with world.spawnFallingBlock() I'm not sure what version we switched to FALLING_BLOCK from
@@ -0,0 +1,13 @@
package com.laytonsmith.abstraction.enums;
import com.laytonsmith.annotations.MEnum;
@MEnum("WoodType")
public enum MCTreeSpecies {
ACACIA,
BIRCH,
DARK_OAK,
JUNGLE,
OAK,
SPRUCE
}
Oops, something went wrong.

0 comments on commit 60f75f8

Please sign in to comment.