Search in sources :

Example 1 with TemperatureMeter

use of me.poma123.globalwarming.items.machines.TemperatureMeter in project GlobalWarming by poma123.

the class GlobalWarmingPlugin method registerItems.

private void registerItems() {
    ItemGroup itemGroup = new ItemGroup(new NamespacedKey(this, "global_warming"), new CustomItemStack(Items.THERMOMETER, "&2Global Warming"));
    new TemperatureMeter(itemGroup, Items.THERMOMETER, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] { SlimefunItems.NICKEL_INGOT, new ItemStack(Material.GLASS), SlimefunItems.NICKEL_INGOT, SlimefunItems.NICKEL_INGOT, Items.MERCURY, SlimefunItems.NICKEL_INGOT, SlimefunItems.NICKEL_INGOT, new ItemStack(Material.GLASS), SlimefunItems.NICKEL_INGOT }) {

        @Override
        public void tick(Block b) {
            Location loc = b.getLocation();
            updateHologram(b, GlobalWarmingPlugin.getTemperatureManager().getTemperatureString(loc, TemperatureType.valueOf(BlockStorage.getLocationInfo(loc, "type"))));
        }
    }.register(this);
    new TemperatureMeter(itemGroup, Items.AIR_QUALITY_METER, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] { SlimefunItems.BILLON_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.SOLDER_INGOT, Items.THERMOMETER, SlimefunItems.SOLDER_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.MAGNET, SlimefunItems.SOLDER_INGOT }) {

        @Override
        public void tick(Block b) {
            Location loc = b.getLocation();
            updateHologram(b, "&7Climate change: " + GlobalWarmingPlugin.getTemperatureManager().getAirQualityString(loc.getWorld(), TemperatureType.valueOf(BlockStorage.getLocationInfo(loc, "type"))));
        }
    }.register(this);
    new AirCompressor(itemGroup, Items.AIR_COMPRESSOR, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] { SlimefunItems.SOLDER_INGOT, Items.FILTER, SlimefunItems.SOLDER_INGOT, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.BATTERY, SlimefunItems.SOLDER_INGOT }) {

        @Override
        public int getEnergyConsumption() {
            return 16;
        }

        @Override
        public int getCapacity() {
            return 512;
        }

        @Override
        public int getSpeed() {
            return 1;
        }
    }.register(this);
    new SlimefunItem(itemGroup, Items.EMPTY_CANISTER, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] { null, SlimefunItems.SOLDER_INGOT, null, SlimefunItems.SOLDER_INGOT, new ItemStack(Material.GLASS_BOTTLE), SlimefunItems.SOLDER_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.SOLDER_INGOT }).register(this);
    new SimpleSlimefunItem<ItemConsumptionHandler>(itemGroup, Items.CO2_CANISTER, AirCompressor.RECIPE_TYPE, new ItemStack[] { null, null, null, null, Items.EMPTY_CANISTER, null, null, null, null }) {

        @Override
        public ItemConsumptionHandler getItemHandler() {
            return (e, p, item) -> e.setCancelled(true);
        }
    }.register(this);
    new SlimefunItem(itemGroup, Items.CINNABARITE, RecipeType.GEO_MINER, new ItemStack[] {}).register(this);
    new CinnabariteResource().register();
    new SlimefunItem(itemGroup, Items.MERCURY, RecipeType.SMELTERY, new ItemStack[] { Items.CINNABARITE, null, null, null, null, null, null, null, null }).register(this);
    new SlimefunItem(itemGroup, Items.FILTER, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] { null, new ItemStack(Material.GLASS), null, new ItemStack(Material.GLASS), SlimefunItems.GOLD_PAN, new ItemStack(Material.GLASS), null, new ItemStack(Material.GLASS), null }).register(this);
}
Also used : AirCompressor(me.poma123.globalwarming.items.machines.AirCompressor) SimpleSlimefunItem(io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem) SlimefunItem(io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem) CinnabariteResource(me.poma123.globalwarming.items.CinnabariteResource) ItemGroup(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup) NamespacedKey(org.bukkit.NamespacedKey) CustomItemStack(io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack) Block(org.bukkit.block.Block) ItemConsumptionHandler(io.github.thebusybiscuit.slimefun4.core.handlers.ItemConsumptionHandler) TemperatureMeter(me.poma123.globalwarming.items.machines.TemperatureMeter) CustomItemStack(io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack) ItemStack(org.bukkit.inventory.ItemStack) Location(org.bukkit.Location)

Aggregations

ItemGroup (io.github.thebusybiscuit.slimefun4.api.items.ItemGroup)1 SlimefunItem (io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem)1 ItemConsumptionHandler (io.github.thebusybiscuit.slimefun4.core.handlers.ItemConsumptionHandler)1 SimpleSlimefunItem (io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem)1 CustomItemStack (io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack)1 CinnabariteResource (me.poma123.globalwarming.items.CinnabariteResource)1 AirCompressor (me.poma123.globalwarming.items.machines.AirCompressor)1 TemperatureMeter (me.poma123.globalwarming.items.machines.TemperatureMeter)1 Location (org.bukkit.Location)1 NamespacedKey (org.bukkit.NamespacedKey)1 Block (org.bukkit.block.Block)1 ItemStack (org.bukkit.inventory.ItemStack)1