Configurified the Meteor Ritual - Modpacks and users can edit all of the major properties of the meteor ritual, including what items need to be dropped onto the ritual as well as what you get in the ritual, radius, etc. The config will refresh if there is a version change unless you set "resyncOnVersionChange" to false.

This commit is contained in:
WayofTime 2016-09-09 12:28:23 -04:00
parent 63febfeb85
commit 4c79a4f2ff
8 changed files with 199 additions and 31 deletions

View file

@ -25,12 +25,14 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
@ -65,6 +67,32 @@ import com.google.common.collect.Iterables;
public class Utils
{
public static Item getItem(ResourceLocation resource)
{
return Item.REGISTRY.getObject(resource);
}
public static Block getBlock(ResourceLocation resource)
{
return Block.REGISTRY.getObject(resource);
}
public static ResourceLocation getResourceForItem(ItemStack stack)
{
if (stack != null)
{
if (stack.getItem() instanceof ItemBlock)
{
return Block.REGISTRY.getNameForObject(((ItemBlock) stack.getItem()).getBlock());
} else
{
return Item.REGISTRY.getNameForObject(stack.getItem());
}
}
return null;
}
public static boolean canPlayerSeeDemonWill(EntityPlayer player)
{
ItemStack[] mainInventory = player.inventory.mainInventory;