Added 'The Ender'

This commit is contained in:
cp committed 2014-03-25 02:01:59 +08:00
1 parent 57f7b52276
commit 9bd71bb4ee
10 files changed
+429 -108

No files matched your search

+24
View File
@@ -101,6 +101,30 @@ public class Util {
}
public static void dropItems(World world, ItemStack stack, double x, double y, double z, boolean doRandomSpread) {
if(stack.stackSize <= 0) {
return;
}
if(doRandomSpread) {
float f1 = 0.7F;
double d = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D;
double d1 = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D;
double d2 = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D;
EntityItem entityitem = new EntityItem(world, x + d, y + d1, z + d2, stack);
entityitem.delayBeforeCanPickup = 10;
world.spawnEntityInWorld(entityitem);
} else {
EntityItem entityitem = new EntityItem(world, x, y, z, stack);
entityitem.motionX = 0;
entityitem.motionY = 0;
entityitem.motionZ = 0;
entityitem.delayBeforeCanPickup = 0;
world.spawnEntityInWorld(entityitem);
}
}
public static void dropItems(World world, ItemStack stack, int x, int y, int z, boolean doRandomSpread) {
if(stack.stackSize <= 0) {
return;