Fix brewery not playing particles when it finishes

This commit is contained in:
Vincent Lee committed 2017-01-05 15:41:31 -06:00
1 parent 7af2a3683e
commit 1bc6d5ade0
2 files changed
+17 -11

No files matched your search

@@ -36,6 +36,8 @@ import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.network.PacketBotaniaEffect;
import vazkii.botania.common.network.PacketHandler;
// This is mostly copypasta from TileRuneAltar
public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
@@ -164,15 +166,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
public void craftingFanciness() {
world.playSound(null, pos, BotaniaSoundEvents.potionCreate, SoundCategory.BLOCKS, 1F, 1.5F + (float) Math.random() * 0.25F);
for(int i = 0; i < 25; i++) {
Color color = new Color(recipe.getBrew().getColor(itemHandler.getStackInSlot(0)));
float r = color.getRed() / 255F;
float g = color.getGreen() / 255F;
float b = color.getBlue() / 255F;
Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, r, g, b, (float) Math.random() * 2F + 0.5F, 10);
for(int j = 0; j < 2; j++)
Botania.proxy.wispFX(pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, 0.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.05F - (float) Math.random() * 0.1F, 0.05F + (float) Math.random() * 0.03F, 0.05F - (float) Math.random() * 0.1F);
}
PacketHandler.sendToNearby(world, pos, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.BREWERY_FINISH, pos.getX(), pos.getY(), pos.getZ(), recipe.getBrew().getColor(itemHandler.getStackInSlot(0))));
}
@Override
@@ -240,6 +240,17 @@ public class PacketBotaniaEffect implements IMessage {
break;
}
case BREWERY_FINISH: {
for(int i = 0; i < 25; i++) {
Color c = new Color(message.args[0]);
float r = c.getRed() / 255F;
float g = c.getGreen() / 255F;
float b = c.getBlue() / 255F;
Botania.proxy.sparkleFX(message.x + 0.5 + Math.random() * 0.4 - 0.2, message.y + 1, message.z + 0.5 + Math.random() * 0.4 - 0.2, r, g, b, (float) Math.random() * 2F + 0.5F, 10);
for(int j = 0; j < 2; j++)
Botania.proxy.wispFX(message.x + 0.7 - Math.random() * 0.4, message.y + 0.9 - Math.random() * 0.2, message.z + 0.7 - Math.random() * 0.4, 0.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.05F - (float) Math.random() * 0.1F, 0.05F + (float) Math.random() * 0.03F, 0.05F - (float) Math.random() * 0.1F);
}
}
}
}
});
@@ -251,7 +262,7 @@ public class PacketBotaniaEffect implements IMessage {
public enum EffectType {
POOL_CRAFT(0),
POOL_CHARGE(1), // Arg: 1 if outputting, 0 if inputting
PAINT_LENS(1), // Arg: colour
PAINT_LENS(1), // Arg: EnumDyeColor
ARENA_INDICATOR(0),
ITEM_SMOKE(2), // Arg: Entity ID, number of particles
SPARK_NET_INDICATOR(2), // Arg: Entity ID from, Entity ID towards
@@ -259,7 +270,8 @@ public class PacketBotaniaEffect implements IMessage {
ENCHANTER_CRAFT(0),
ENCHANTER_DESTROY(0),
ENTROPINNYUM(0),
BLACK_LOTUS_DISSOLVE(0);
BLACK_LOTUS_DISSOLVE(0),
BREWERY_FINISH(1); // Arg: RGB
private final int argCount;