Search in sources :

Example 1 with ItemBulldozer

use of com.wuest.prefab.structures.items.ItemBulldozer in project MC-Prefab by Brian-Wuest.

the class ModEventHandler method AnvilUpdate.

@SubscribeEvent
public static void AnvilUpdate(AnvilUpdateEvent event) {
    ItemStack rightItem = event.getRight();
    ItemStack leftItem = event.getLeft();
    Item tripleCompressedStone = ModRegistry.TripleCompressedStoneItem.get();
    ItemBulldozer bulldozer = ModRegistry.Bulldozer.get();
    if (rightItem.getItem() == tripleCompressedStone || leftItem.getItem() == tripleCompressedStone) {
        if (rightItem.getItem() == bulldozer || leftItem.getItem() == bulldozer) {
            event.setCost(4);
            ItemStack outputStack = new ItemStack(bulldozer);
            bulldozer.setPoweredValue(outputStack, true);
            outputStack.setDamageValue(0);
            event.setOutput(outputStack);
        }
    }
}
Also used : Item(net.minecraft.world.item.Item) ItemStack(net.minecraft.world.item.ItemStack) ItemBulldozer(com.wuest.prefab.structures.items.ItemBulldozer) SubscribeEvent(net.minecraftforge.eventbus.api.SubscribeEvent)

Aggregations

ItemBulldozer (com.wuest.prefab.structures.items.ItemBulldozer)1 Item (net.minecraft.world.item.Item)1 ItemStack (net.minecraft.world.item.ItemStack)1 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)1