Skip to content

Commit

Permalink
I think this closes #44. Avoided destruction.
Browse files Browse the repository at this point in the history
- Just a derp in the ItemBlock class, carry on…
  • Loading branch information
TrainerGuy22 committed Jun 3, 2014
1 parent b41d204 commit c0693b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/main/java/xreliquary/blocks/BlockFertileLilypad.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import xreliquary.init.XRInit;
import xreliquary.items.block.ItemFertileLilypad;
import xreliquary.util.ObjectUtils;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFlower;
Expand All @@ -25,7 +26,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@XRInit(itemBlock = xreliquary.items.ItemFertileLilypad.class)
@XRInit(itemBlock = ItemFertileLilypad.class)
public class BlockFertileLilypad extends BlockFlower {

public BlockFertileLilypad() {
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/xreliquary/init/ContentHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ private static void checkAndRegister(Class objClass) throws Exception {
GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5));
} else if(obj instanceof Block) {
Block block = (Block) obj;
if(((XRInit) objClass.getAnnotation(XRInit.class)).itemBlock() != XRInit.class)
if(((XRInit) objClass.getAnnotation(XRInit.class)).itemBlock() != XRInit.class) {
GameRegistry.registerBlock(block, ((XRInit) objClass.getAnnotation(XRInit.class)).itemBlock(), block.getUnlocalizedName().substring(5));
else
System.out.println(block.getUnlocalizedName().substring(5));
} else
GameRegistry.registerBlock(block, block.getUnlocalizedName().substring(5));
} else {
LogHelper.log(Level.WARN, "Class '" + objClass.getName() + "' is not a Block or an Item! You shouldn't be calling @XRInit on this! Ignoring!");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xreliquary.items;
package xreliquary.items.block;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
Expand All @@ -10,6 +10,7 @@
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import xreliquary.Reliquary;
import xreliquary.init.ContentHandler;
import xreliquary.lib.Names;
import xreliquary.lib.Reference;
Expand All @@ -19,8 +20,8 @@
public class ItemFertileLilypad extends ItemBlock {

public ItemFertileLilypad(Block block) {
super(ContentHandler.getBlock(Names.lilypad));
}
super(block);
}

@Override
@SideOnly(Side.CLIENT)
Expand Down

0 comments on commit c0693b9

Please sign in to comment.