Archiviert
13
0

Update firework power when modifying meta. Fixes BUKKIT-3272

Dieser Commit ist enthalten in:
Travis Watkins 2012-12-22 13:05:55 -06:00
Ursprung f72a08c22e
Commit 717fbbeffa
2 geänderte Dateien mit 7 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -3,7 +3,7 @@ package net.minecraft.server;
public class EntityFireworks extends Entity { public class EntityFireworks extends Entity {
private int a; private int a;
private int b; public int b; // CraftBukkit - private -> public
public EntityFireworks(World world) { public EntityFireworks(World world) {
super(world); super(world);

Datei anzeigen

@ -11,6 +11,8 @@ import org.bukkit.entity.EntityType;
import org.bukkit.entity.Firework; import org.bukkit.entity.Firework;
import org.bukkit.inventory.meta.FireworkMeta; import org.bukkit.inventory.meta.FireworkMeta;
import java.util.Random;
public class CraftFirework extends CraftEntity implements Firework { public class CraftFirework extends CraftEntity implements Firework {
private static final int FIREWORK_ITEM_INDEX = 8; private static final int FIREWORK_ITEM_INDEX = 8;
@ -54,5 +56,9 @@ public class CraftFirework extends CraftEntity implements Firework {
public void setFireworkMeta(FireworkMeta meta) { public void setFireworkMeta(FireworkMeta meta) {
item.setItemMeta(meta); item.setItemMeta(meta);
// Copied from EntityFireworks constructor, update firework lifetime/power
Random random = new Random();
getHandle().b = 10 * meta.getPower() + random.nextInt(6) + random.nextInt(7);
} }
} }