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:
parent
63febfeb85
commit
4c79a4f2ff
8 changed files with 199 additions and 31 deletions
|
@ -5,7 +5,11 @@ import java.util.List;
|
|||
import java.util.Random;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
|
@ -14,13 +18,33 @@ import WayofTime.bloodmagic.util.Utils;
|
|||
public class MeteorHolder
|
||||
{
|
||||
public static Random rand = new Random();
|
||||
public ResourceLocation resourceKey;
|
||||
public int metaKey = 0;
|
||||
public List<MeteorComponent> components = new ArrayList<MeteorComponent>();
|
||||
|
||||
public float explosionStrength;
|
||||
public int radius;
|
||||
public float explosionStrength = 1;
|
||||
public int radius = 1;
|
||||
|
||||
public int maxWeight = 1000;
|
||||
|
||||
public ItemStack getKeyStack()
|
||||
{
|
||||
Item item = Utils.getItem(resourceKey);
|
||||
if (item != null)
|
||||
{
|
||||
return new ItemStack(item);
|
||||
} else
|
||||
{
|
||||
Block block = Utils.getBlock(resourceKey);
|
||||
if (block != null)
|
||||
{
|
||||
return new ItemStack(block);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void generateMeteor(World world, BlockPos pos, IBlockState fillerBlock)
|
||||
{
|
||||
world.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), explosionStrength, true, true);
|
||||
|
|
|
@ -6,9 +6,11 @@ import java.util.Map;
|
|||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
|
||||
public class MeteorRegistry
|
||||
{
|
||||
|
@ -25,7 +27,9 @@ public class MeteorRegistry
|
|||
|
||||
public static void registerMeteor(ItemStack stack, List<MeteorComponent> componentList, float explosionStrength, int radius, int maxWeight)
|
||||
{
|
||||
MeteorHolder holder = new MeteorHolder(componentList, explosionStrength, radius, maxWeight);
|
||||
ResourceLocation resource = Utils.getResourceForItem(stack);
|
||||
|
||||
MeteorHolder holder = new MeteorHolder(resource, stack.getItemDamage(), componentList, explosionStrength, radius, maxWeight);
|
||||
|
||||
registerMeteor(stack, holder);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue