Permalink
Browse files

Merge pull request #419 from Glitchfinder/master

Patching two bugs.
  • Loading branch information...
2 parents b95ac44 + d444e08 commit d0c051a9c2789ba387c2bae99074bb59d7df00de @Glitchfinder Glitchfinder committed Jan 3, 2013
@@ -5,6 +5,7 @@
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
+import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageEvent;
@@ -253,7 +254,12 @@ public static void dropItem(Location location, ItemStack itemStack) {
return;
}
- location.getWorld().dropItemNaturally(location, itemStack).setItemStack(itemStack);
+ Item newItem = location.getWorld().dropItemNaturally(location, itemStack);
+
+ ItemStack cloned = itemStack.clone();
+ cloned.setAmount(newItem.getItemStack().getAmount());
+
+ newItem.setItemStack(cloned);
}
/**
@@ -253,14 +253,16 @@ public synchronized void saveChunk(int cx, int cz, World world) {
if(store.containsKey(world.getName() + "," + cx + "," + cz)) {
ChunkStore out = store.get(world.getName() + "," + cx + "," + cz);
- for(Entity entity : spawnedMobs) {
+ List<Entity> tempSpawnedMobs = new ArrayList<Entity>(spawnedMobs);
+ for(Entity entity : tempSpawnedMobs) {
if(!isEntityInChunk(entity, cx, cz, world))
continue;
out.addSpawnedMob(entity.getUniqueId());
}
- for(Entity entity : spawnedPets) {
+ List<Entity> tempSpawnedPets = new ArrayList<Entity>(spawnedPets);
+ for(Entity entity : tempSpawnedPets) {
if(!isEntityInChunk(entity, cx, cz, world))
continue;

0 comments on commit d0c051a

Please sign in to comment.