This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
RelicCraft/src/main/java/com/thebrokenrail/reliccraft/mixin/MixinBlockItem.java

24 lines
784 B
Java
Raw Normal View History

2020-04-04 20:45:56 +00:00
package com.thebrokenrail.reliccraft.mixin;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
@SuppressWarnings("unused")
@Mixin(BlockItem.class)
public class MixinBlockItem {
@ModifyVariable(at = @At("HEAD"), method = "<init>", argsOnly = true)
private static Item.Settings init(Item.Settings value, Block block, Item.Settings settings) {
if (block == Blocks.DRAGON_EGG) {
return settings.group(ItemGroup.MISC);
} else {
return settings;
}
}
}