From 1cc92700cd7dd10d83ae187b5dae8978398d25c5 Mon Sep 17 00:00:00 2001 From: ata4 Date: Wed, 8 Jun 2016 15:15:29 +0200 Subject: [PATCH] Fixed deprecated GameRegistry.registerBlock method --- .../info/ata4/minecraft/dragon/server/CommonProxy.java | 3 ++- .../minecraft/dragon/server/item/ItemDragonBreedEgg.java | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/info/ata4/minecraft/dragon/server/CommonProxy.java b/src/main/java/info/ata4/minecraft/dragon/server/CommonProxy.java index 81ec18ed..afa7cb91 100644 --- a/src/main/java/info/ata4/minecraft/dragon/server/CommonProxy.java +++ b/src/main/java/info/ata4/minecraft/dragon/server/CommonProxy.java @@ -38,7 +38,8 @@ public class CommonProxy { private final boolean ENTITY_SEND_VELO_UPDATES = true; public void onPreInit(FMLPreInitializationEvent event) { - GameRegistry.registerBlock(BlockDragonBreedEgg.INSTANCE, ItemDragonBreedEgg.class, "dragon_egg"); + GameRegistry.register(BlockDragonBreedEgg.INSTANCE.setRegistryName("dragon_egg")); + GameRegistry.register(ItemDragonBreedEgg.INSTANCE.setRegistryName("dragon_egg")); } public void onInit(FMLInitializationEvent evt) { diff --git a/src/main/java/info/ata4/minecraft/dragon/server/item/ItemDragonBreedEgg.java b/src/main/java/info/ata4/minecraft/dragon/server/item/ItemDragonBreedEgg.java index bff17ace..a67b3da3 100644 --- a/src/main/java/info/ata4/minecraft/dragon/server/item/ItemDragonBreedEgg.java +++ b/src/main/java/info/ata4/minecraft/dragon/server/item/ItemDragonBreedEgg.java @@ -9,8 +9,8 @@ */ package info.ata4.minecraft.dragon.server.item; +import info.ata4.minecraft.dragon.server.block.BlockDragonBreedEgg; import info.ata4.minecraft.dragon.server.entity.breeds.EnumDragonBreed; -import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.text.translation.I18n; @@ -21,8 +21,10 @@ */ public class ItemDragonBreedEgg extends ItemBlock { - public ItemDragonBreedEgg(Block block) { - super(block); + public static final ItemDragonBreedEgg INSTANCE = new ItemDragonBreedEgg(); + + public ItemDragonBreedEgg() { + super(BlockDragonBreedEgg.INSTANCE); setMaxDamage(0); setHasSubtypes(true); }