Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me._ug.main;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.entity.ArmorStand;
- import org.bukkit.entity.EntityType;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.util.EulerAngle;
- public class groundItem {
- /*
- *
- * CREATED BY: _Ug
- *
- * Anyone can use this code without any form of thanks. It is 100% free for the public. Enjoy!
- *
- */
- //TODO replace main.pl with your plug-in. You do not need to have a time. To remove set removeTime to 0.
- public static void removeStand(final ArmorStand as, int removeTime){
- if(removeTime!=0){
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(main.pl, new Runnable(){
- @Override
- public void run() {
- as.remove();
- }
- }, removeTime);
- }
- }
- public static void spawnGroundItem(Location location, ItemStack item, boolean isBlock, boolean isTiny, int removeTime){
- if(!isBlock){
- if(!isTiny){
- Location l = new Location(location.getWorld(), location.getX()+.7,location.getBlockY() - .8,location.getZ()-.1);
- ArmorStand stand = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
- stand.setVisible(false);
- stand.setArms(true);
- stand.setRightArmPose(new EulerAngle(0,1,0));
- stand.setItemInHand(item);
- stand.setGravity(false);
- stand.setCanPickupItems(false);
- stand.setSmall(false);
- removeStand(stand, removeTime);
- }else{
- Location l = new Location(location.getWorld(), location.getX()+.2,location.getBlockY() - .5,location.getZ()-.1);
- ArmorStand stand = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
- stand.setVisible(false);
- stand.setArms(true);
- stand.setRightArmPose(new EulerAngle(-.35, 0, 0));
- stand.setItemInHand(item);
- stand.setGravity(false);
- stand.setCanPickupItems(false);
- stand.setSmall(true);
- removeStand(stand, removeTime);
- }
- }else{
- if(!isTiny){
- Location l = new Location(location.getWorld(), location.getX()+.6,location.getBlockY() - .65,location.getZ()+.1);
- l.setYaw(45);
- ArmorStand stand = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
- stand.setVisible(false);
- stand.setArms(true);
- stand.setRightArmPose(new EulerAngle(-.25,0,0));
- stand.setItemInHand(item);
- stand.setGravity(false);
- stand.setCanPickupItems(false);
- stand.setSmall(false);
- removeStand(stand, removeTime);
- }else{
- Location l = new Location(location.getWorld(), location.getX()+.1,location.getBlockY() - .445,location.getZ());
- l.setYaw(45);
- ArmorStand stand = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
- stand.setVisible(false);
- stand.setArms(true);
- stand.setRightArmPose(new EulerAngle(-.6,0,0));
- stand.setItemInHand(item);
- stand.setGravity(false);
- stand.setCanPickupItems(false);
- stand.setSmall(true);
- removeStand(stand, removeTime);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement