1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 11:45:51 +00:00

Commit 1 of 2 for ticket #643 -- eliminates Altar dupe bug by disallowing all interactions while altar is in use.

This commit is contained in:
Rick 2018-04-22 10:58:57 -04:00
parent 34150791bc
commit 2b9e24b45b

View File

@ -28,7 +28,7 @@ public class RitualAnimation implements Runnable {
List<Location> particles; List<Location> particles;
boolean running; boolean running;
int stage; int stage;
public RitualAnimation(List<Block> altars, Block altar, Location drop, ItemStack output, List<Block> pedestals, List<ItemStack> items) { public RitualAnimation(List<Block> altars, Block altar, Location drop, ItemStack output, List<Block> pedestals, List<ItemStack> items) {
this.l = drop; this.l = drop;
@ -48,6 +48,7 @@ public class RitualAnimation implements Runnable {
idle(); idle();
if(this.stage == 36) { if(this.stage == 36) {
finish(); finish();
AncientAltarListener.altarinuse = false;
return; return;
} }
if(this.stage > 0 && this.stage % 4 == 0) { if(this.stage > 0 && this.stage % 4 == 0) {
@ -72,7 +73,10 @@ public class RitualAnimation implements Runnable {
private void checkPedestal(Block pedestal) { private void checkPedestal(Block pedestal) {
Item item = AncientAltarListener.findItem(pedestal); Item item = AncientAltarListener.findItem(pedestal);
if (item == null) abort(); if (item == null) {
abort();
AncientAltarListener.altarinuse = false;
}
else { else {
particles.add(pedestal.getLocation().add(0.5, 1.5, 0.5)); particles.add(pedestal.getLocation().add(0.5, 1.5, 0.5));
items.add(AncientAltarListener.fixItemStack(item.getItemStack(), item.getCustomName())); items.add(AncientAltarListener.fixItemStack(item.getItemStack(), item.getCustomName()));
@ -95,7 +99,7 @@ public class RitualAnimation implements Runnable {
for (ItemStack stack: items) { for (ItemStack stack: items) {
l.getWorld().dropItemNaturally(l, stack); l.getWorld().dropItemNaturally(l, stack);
} }
l.getWorld().playSound(l, Sound.BLOCK_NOTE_SNARE, 5F, 1F); l.getWorld().playSound(l, Sound.BLOCK_NOTE_SNARE, 5F, 1F);
altars.remove(altar); altars.remove(altar);
} }