Testing the creation of hell
This commit is contained in:
parent
796e75b1f9
commit
a2b006105e
2587 changed files with 0 additions and 129617 deletions
|
@ -0,0 +1,19 @@
|
|||
package WayofTime.alchemicalWizardry.common.summoning;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningHelper;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SummoningFallenAngel extends SummoningHelper
|
||||
{
|
||||
public SummoningFallenAngel(String id)
|
||||
{
|
||||
super(id);
|
||||
}
|
||||
|
||||
public EntityLivingBase getEntity(World worldObj)
|
||||
{
|
||||
return new EntityFallenAngel(worldObj);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
package WayofTime.alchemicalWizardry.common.summoning;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningHelper;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAirElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.*;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntityPig;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SummoningHelperAW extends SummoningHelper
|
||||
{
|
||||
public SummoningHelperAW(String id)
|
||||
{
|
||||
super(id);
|
||||
}
|
||||
|
||||
public EntityLivingBase getEntity(World worldObj)
|
||||
{
|
||||
if (this.id.equals(AlchemicalWizardry.entityFallenAngelID))
|
||||
{
|
||||
return new EntityFallenAngel(worldObj);
|
||||
}
|
||||
|
||||
if (this.id.equals(AlchemicalWizardry.entityLowerGuardianID))
|
||||
{
|
||||
return new EntityLowerGuardian(worldObj);
|
||||
}
|
||||
|
||||
if (this.id.equals(AlchemicalWizardry.entityBileDemonID))
|
||||
{
|
||||
return new EntityBileDemon(worldObj);
|
||||
}
|
||||
|
||||
if (this.id.equals(AlchemicalWizardry.entityWingedFireDemonID))
|
||||
{
|
||||
return new EntityWingedFireDemon(worldObj);
|
||||
}
|
||||
|
||||
if (this.id.equals(AlchemicalWizardry.entitySmallEarthGolemID))
|
||||
{
|
||||
return new EntitySmallEarthGolem(worldObj);
|
||||
}
|
||||
|
||||
if (this.id.equals(AlchemicalWizardry.entityIceDemonID))
|
||||
{
|
||||
return new EntityIceDemon(worldObj);
|
||||
}
|
||||
|
||||
if (this.id.equals(AlchemicalWizardry.entityBoulderFistID))
|
||||
{
|
||||
return new EntityBoulderFist(worldObj);
|
||||
}
|
||||
|
||||
if (this.id.equals(AlchemicalWizardry.entityShadeID))
|
||||
{
|
||||
return new EntityShade(worldObj);
|
||||
}
|
||||
|
||||
if (this.id.equals(AlchemicalWizardry.entityAirElementalID))
|
||||
{
|
||||
return new EntityAirElemental(worldObj);
|
||||
}
|
||||
|
||||
if (this.id.equals(AlchemicalWizardry.entityWaterElementalID))
|
||||
{
|
||||
return new EntityWaterElemental(worldObj);
|
||||
}
|
||||
|
||||
if (this.id.equals(AlchemicalWizardry.entityEarthElementalID))
|
||||
{
|
||||
return new EntityEarthElemental(worldObj);
|
||||
}
|
||||
|
||||
if (this.id.equals(AlchemicalWizardry.entityFireElementalID))
|
||||
{
|
||||
return new EntityFireElemental(worldObj);
|
||||
}
|
||||
|
||||
if (this.id.equals(AlchemicalWizardry.entityShadeElementalID))
|
||||
{
|
||||
return new EntityShadeElemental(worldObj);
|
||||
}
|
||||
|
||||
if (this.id.equals(AlchemicalWizardry.entityHolyElementalID))
|
||||
{
|
||||
return new EntityHolyElemental(worldObj);
|
||||
}
|
||||
|
||||
return new EntityPig(worldObj);
|
||||
}
|
||||
|
||||
public String getSummoningHelperID()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,160 @@
|
|||
package WayofTime.alchemicalWizardry.common.summoning.meteor;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class MeteorParadigm
|
||||
{
|
||||
public List<MeteorParadigmComponent> componentList = new ArrayList();
|
||||
public ItemStack focusStack;
|
||||
public int radius;
|
||||
public static int maxChance = 1000;
|
||||
|
||||
public static Random rand = new Random();
|
||||
|
||||
public MeteorParadigm(ItemStack focusStack, int radius)
|
||||
{
|
||||
this.focusStack = focusStack;
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public void parseStringArray(String[] oreArray)
|
||||
{
|
||||
for (int i = 0; i + 1 < oreArray.length; i += 2)
|
||||
{
|
||||
String oreName = oreArray[i];
|
||||
int oreChance = Integer.parseInt(oreArray[i + 1]);
|
||||
MeteorParadigmComponent mpc = new MeteorParadigmComponent(oreName, oreChance);
|
||||
componentList.add(mpc);
|
||||
}
|
||||
}
|
||||
|
||||
public void createMeteorImpact(World world, int x, int y, int z, boolean[] flags)
|
||||
{
|
||||
boolean hasTerrae = false;
|
||||
boolean hasOrbisTerrae = false;
|
||||
boolean hasCrystallos = false;
|
||||
boolean hasIncendium = false;
|
||||
boolean hasTennebrae = false;
|
||||
|
||||
if (flags != null && flags.length >= 5)
|
||||
{
|
||||
hasTerrae = flags[0];
|
||||
hasOrbisTerrae = flags[1];
|
||||
hasCrystallos = flags[2];
|
||||
hasIncendium = flags[3];
|
||||
hasTennebrae = flags[4];
|
||||
}
|
||||
|
||||
int newRadius = radius;
|
||||
int chance = maxChance;
|
||||
|
||||
if (hasOrbisTerrae)
|
||||
{
|
||||
newRadius += 2;
|
||||
chance += 200;
|
||||
} else if (hasTerrae)
|
||||
{
|
||||
newRadius += 1;
|
||||
chance += 100;
|
||||
}
|
||||
|
||||
world.createExplosion(null, x, y, z, newRadius * 4, AlchemicalWizardry.doMeteorsDestroyBlocks);
|
||||
|
||||
float iceChance = hasCrystallos ? 1 : 0;
|
||||
float soulChance = hasIncendium ? 1 : 0;
|
||||
float obsidChance = hasTennebrae ? 1 : 0;
|
||||
|
||||
float totalChance = iceChance + soulChance + obsidChance;
|
||||
|
||||
for (int i = -newRadius; i <= newRadius; i++)
|
||||
{
|
||||
for (int j = -newRadius; j <= newRadius; j++)
|
||||
{
|
||||
for (int k = -newRadius; k <= newRadius; k++)
|
||||
{
|
||||
if (i * i + j * j + k * k >= (newRadius + 0.50f) * (newRadius + 0.50f))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!world.isAirBlock(x + i, y + j, z + k))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int randNum = world.rand.nextInt(chance);
|
||||
boolean hasPlacedBlock = false;
|
||||
|
||||
for (MeteorParadigmComponent mpc : componentList)
|
||||
{
|
||||
if (mpc == null || !mpc.isValidBlockParadigm())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
randNum -= mpc.getChance();
|
||||
|
||||
if (randNum < 0)
|
||||
{
|
||||
ItemStack blockStack = mpc.getValidBlockParadigm();
|
||||
world.setBlock(x + i, y + j, z + k, Block.getBlockById(Item.getIdFromItem(blockStack.getItem())), blockStack.getItemDamage(), 3);
|
||||
hasPlacedBlock = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasPlacedBlock)
|
||||
{
|
||||
float randChance = rand.nextFloat() * totalChance;
|
||||
|
||||
if (randChance < iceChance)
|
||||
{
|
||||
world.setBlock(x + i, y + j, z + k, Blocks.ice, 0, 3);
|
||||
} else
|
||||
{
|
||||
randChance -= iceChance;
|
||||
|
||||
if (randChance < soulChance)
|
||||
{
|
||||
switch (rand.nextInt(3))
|
||||
{
|
||||
case 0:
|
||||
world.setBlock(x + i, y + j, z + k, Blocks.soul_sand, 0, 3);
|
||||
break;
|
||||
case 1:
|
||||
world.setBlock(x + i, y + j, z + k, Blocks.glowstone, 0, 3);
|
||||
break;
|
||||
case 2:
|
||||
world.setBlock(x + i, y + j, z + k, Blocks.netherrack, 0, 3);
|
||||
break;
|
||||
}
|
||||
} else
|
||||
{
|
||||
randChance -= soulChance;
|
||||
|
||||
if (randChance < obsidChance)
|
||||
{
|
||||
world.setBlock(x + i, y + j, z + k, Blocks.obsidian, 0, 3);
|
||||
} else
|
||||
{
|
||||
randChance -= obsidChance;
|
||||
|
||||
world.setBlock(x + i, y + j, z + k, Blocks.stone, 0, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package WayofTime.alchemicalWizardry.common.summoning.meteor;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MeteorParadigmComponent
|
||||
{
|
||||
public String oreDictName;
|
||||
public int chance;
|
||||
|
||||
public MeteorParadigmComponent(String dictName, int chance)
|
||||
{
|
||||
this.oreDictName = dictName;
|
||||
this.chance = chance;
|
||||
}
|
||||
|
||||
public boolean isValidBlockParadigm()
|
||||
{
|
||||
if (this.getValidBlockParadigm() != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getOreDictName()
|
||||
{
|
||||
return this.oreDictName;
|
||||
}
|
||||
|
||||
public int getChance()
|
||||
{
|
||||
return this.chance;
|
||||
}
|
||||
|
||||
public ItemStack getValidBlockParadigm()
|
||||
{
|
||||
List<ItemStack> list = OreDictionary.getOres(getOreDictName());
|
||||
|
||||
for (ItemStack stack : list)
|
||||
{
|
||||
if (stack != null && stack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package WayofTime.alchemicalWizardry.common.summoning.meteor;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MeteorRegistry
|
||||
{
|
||||
public static List<MeteorParadigm> paradigmList = new ArrayList();
|
||||
|
||||
public static void registerMeteorParadigm(MeteorParadigm paradigm)
|
||||
{
|
||||
paradigmList.add(paradigm);
|
||||
}
|
||||
|
||||
public static void registerMeteorParadigm(ItemStack stack, String[] oreList, int radius)
|
||||
{
|
||||
if (stack != null && oreList != null)
|
||||
{
|
||||
MeteorParadigm meteor = new MeteorParadigm(stack, radius);
|
||||
meteor.parseStringArray(oreList);
|
||||
paradigmList.add(meteor);
|
||||
}
|
||||
}
|
||||
|
||||
public static void createMeteorImpact(World world, int x, int y, int z, int paradigmID, boolean[] flags)
|
||||
{
|
||||
if (paradigmID < paradigmList.size())
|
||||
{
|
||||
paradigmList.get(paradigmID).createMeteorImpact(world, x, y, z, flags);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getParadigmIDForItem(ItemStack stack)
|
||||
{
|
||||
if (stack == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < paradigmList.size(); i++)
|
||||
{
|
||||
ItemStack focusStack = paradigmList.get(i).focusStack;
|
||||
|
||||
if (focusStack != null && focusStack.getItem() == stack.getItem() && (focusStack.getItemDamage() == OreDictionary.WILDCARD_VALUE || focusStack.getItemDamage() == stack.getItemDamage()))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static boolean isValidParadigmItem(ItemStack stack)
|
||||
{
|
||||
return getParadigmIDForItem(stack) != -1;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue