Search in sources :

Example 1 with TileInversionPillar

use of WayofTime.bloodmagic.tile.TileInversionPillar in project BloodMagic by WayofTime.

the class BlockInversionPillar method breakBlock.

@Override
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
    TileEntity tile = world.getTileEntity(blockPos);
    if (tile instanceof TileInversionPillar) {
        TileInversionPillar tilePillar = (TileInversionPillar) world.getTileEntity(blockPos);
        tilePillar.removePillarFromMap();
    }
    super.breakBlock(world, blockPos, blockState);
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileInversionPillar(WayofTime.bloodmagic.tile.TileInversionPillar)

Example 2 with TileInversionPillar

use of WayofTime.bloodmagic.tile.TileInversionPillar in project BloodMagic by WayofTime.

the class Elements method createHUDElements.

public static void createHUDElements() {
    new HUDElementHolding();
    new HUDElementDemonWillAura();
    // Blood Altar with Divination Sigil
    new HUDElementCornerTile.DivinedView<TileAltar>(TileAltar.class, true) {

        @Override
        protected void addInformation(List<Pair<Sprite, Function<TileAltar, String>>> information) {
            // Current tier
            information.add(Pair.of(new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 0, 46, 16, 16), altar -> NumeralHelper.toRoman(altar.getTier().toInt())));
            // Stored/Capacity
            information.add(Pair.of(new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 16, 46, 16, 16), altar -> String.format("%d/%d", altar.getCurrentBlood(), altar.getCapacity())));
        }
    };
    // Blood Altar with Seers Sigil
    new HUDElementCornerTile.DivinedView<TileAltar>(TileAltar.class, false) {

        @Override
        protected void addInformation(List<Pair<Sprite, Function<TileAltar, String>>> information) {
            // Current tier
            information.add(Pair.of(new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 0, 46, 16, 16), altar -> NumeralHelper.toRoman(altar.getTier().toInt())));
            // Stored/Capacity
            information.add(Pair.of(new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 16, 46, 16, 16), altar -> String.format("%d/%d", altar.getCurrentBlood(), altar.getCapacity())));
            // Crafting progress/Crafting requirement
            information.add(Pair.of(new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 32, 46, 16, 16), altar -> {
                if (!altar.isActive())
                    // FIXME localize
                    return "Inactive";
                int progress = altar.getProgress();
                int totalLiquidRequired = altar.getLiquidRequired() * altar.getStackInSlot(0).getCount();
                return String.format("%d/%d", progress, totalLiquidRequired);
            }));
            // Consumption rate
            information.add(Pair.of(new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 48, 46, 16, 16), altar -> String.valueOf((int) (altar.getConsumptionRate() * (altar.getConsumptionMultiplier() + 1)))));
            // Total charge
            information.add(Pair.of(new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 64, 46, 16, 16), altar -> String.valueOf(altar.getTotalCharge())));
        }
    };
    // Incense Altar
    new HUDElementCornerTile.DivinedView<TileIncenseAltar>(TileIncenseAltar.class, true) {

        @Override
        protected void addInformation(List<Pair<Sprite, Function<TileIncenseAltar, String>>> information) {
            // Current tranquility
            information.add(Pair.of(new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 80, 46, 16, 16), incense -> String.valueOf((int) ((100D * (int) (100 * incense.tranquility)) / 100D))));
            // Sacrifice bonus
            information.add(Pair.of(new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 96, 46, 16, 16), incense -> String.valueOf((int) (100 * incense.incenseAddition))));
        }
    };
    // Inversion Pillar
    new HUDElementCornerTile.DivinedView<TileInversionPillar>(TileInversionPillar.class, true) {

        @Override
        protected void addInformation(List<Pair<Sprite, Function<TileInversionPillar, String>>> information) {
            // Current inversion
            information.add(Pair.of(new Sprite(new ResourceLocation(BloodMagic.MODID, "textures/gui/widgets.png"), 112, 46, 16, 16), pillar -> String.valueOf(((int) (10 * pillar.getCurrentInversion())) / 10D)));
        }
    };
}
Also used : Sprite(WayofTime.bloodmagic.client.Sprite) List(java.util.List) Pair(org.apache.commons.lang3.tuple.Pair) BloodMagic(WayofTime.bloodmagic.BloodMagic) TileIncenseAltar(WayofTime.bloodmagic.tile.TileIncenseAltar) TileInversionPillar(WayofTime.bloodmagic.tile.TileInversionPillar) ResourceLocation(net.minecraft.util.ResourceLocation) TileAltar(WayofTime.bloodmagic.tile.TileAltar) NumeralHelper(WayofTime.bloodmagic.util.helper.NumeralHelper) Function(java.util.function.Function) Function(java.util.function.Function) Sprite(WayofTime.bloodmagic.client.Sprite) ResourceLocation(net.minecraft.util.ResourceLocation) List(java.util.List)

Aggregations

TileInversionPillar (WayofTime.bloodmagic.tile.TileInversionPillar)2 BloodMagic (WayofTime.bloodmagic.BloodMagic)1 Sprite (WayofTime.bloodmagic.client.Sprite)1 TileAltar (WayofTime.bloodmagic.tile.TileAltar)1 TileIncenseAltar (WayofTime.bloodmagic.tile.TileIncenseAltar)1 NumeralHelper (WayofTime.bloodmagic.util.helper.NumeralHelper)1 List (java.util.List)1 Function (java.util.function.Function)1 TileEntity (net.minecraft.tileentity.TileEntity)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 Pair (org.apache.commons.lang3.tuple.Pair)1