Added the Binding array
Hehe lightning go brrrrrr
This commit is contained in:
parent
2075fa5be3
commit
507c541d5b
15 changed files with 407 additions and 6 deletions
|
@ -0,0 +1,79 @@
|
|||
package wayoftime.bloodmagic.common.alchemyarray;
|
||||
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.effect.LightningBoltEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import wayoftime.bloodmagic.client.render.alchemyarray.BindingAlchemyCircleRenderer;
|
||||
import wayoftime.bloodmagic.tile.TileAlchemyArray;
|
||||
|
||||
public class AlchemyArrayEffectBinding extends AlchemyArrayEffectCrafting
|
||||
{
|
||||
public AlchemyArrayEffectBinding(ItemStack outputStack, int tickLimit)
|
||||
{
|
||||
super(outputStack, tickLimit);
|
||||
}
|
||||
|
||||
public AlchemyArrayEffectBinding(ItemStack outputStack)
|
||||
{
|
||||
this(outputStack, 300);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(TileAlchemyArray tile, int ticksActive)
|
||||
{
|
||||
// TODO: Add recipe rechecking to verify nothing screwy is going on.
|
||||
if (tile.getWorld().isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ticksActive >= 50 && ticksActive <= 250)
|
||||
{
|
||||
this.spawnLightningOnCircle(tile.getWorld(), tile.getPos(), ticksActive);
|
||||
}
|
||||
|
||||
if (ticksActive >= tickLimit)
|
||||
{
|
||||
BlockPos pos = tile.getPos();
|
||||
|
||||
ItemStack output = outputStack.copy();
|
||||
|
||||
ItemEntity outputEntity = new ItemEntity(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
|
||||
|
||||
tile.getWorld().addEntity(outputEntity);
|
||||
// tile.getWorld().spawnEntity(outputEntity);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void spawnLightningOnCircle(World world, BlockPos pos, int ticksActive)
|
||||
{
|
||||
if (ticksActive % 50 == 0)
|
||||
{
|
||||
int circle = ticksActive / 50 - 1;
|
||||
float distance = BindingAlchemyCircleRenderer.getDistanceOfCircle(circle, ticksActive);
|
||||
float angle = BindingAlchemyCircleRenderer.getAngleOfCircle(circle, ticksActive);
|
||||
|
||||
double dispX = distance * Math.sin(angle);
|
||||
double dispZ = -distance * Math.cos(angle);
|
||||
|
||||
LightningBoltEntity lightningboltentity = EntityType.LIGHTNING_BOLT.create(world);
|
||||
// LightningBoltEntity lightning = new LightningBoltEntity(world, pos.getX() + dispX, pos.getY(), pos.getZ() + dispZ);
|
||||
lightningboltentity.setPosition(pos.getX() + dispX, pos.getY(), pos.getZ() + dispZ);
|
||||
lightningboltentity.setEffectOnly(true);
|
||||
world.addEntity(lightningboltentity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlchemyArrayEffect getNewCopy()
|
||||
{
|
||||
return new AlchemyArrayEffectBinding(outputStack, tickLimit);
|
||||
}
|
||||
}
|
|
@ -459,6 +459,7 @@ public class GeneratorLanguage extends LanguageProvider
|
|||
addItem(BloodMagicItems.REAGENT_AIR, "Air Reagent");
|
||||
addItem(BloodMagicItems.REAGENT_BLOOD_LIGHT, "Blood Lamp Reagent");
|
||||
addItem(BloodMagicItems.REAGENT_SIGHT, "Sight Reagent");
|
||||
addItem(BloodMagicItems.REAGENT_BINDING, "Binding Reagent");
|
||||
|
||||
addItem(BloodMagicItems.PETTY_GEM, "Petty Tartaric Gem");
|
||||
addItem(BloodMagicItems.LESSER_GEM, "Lesser Tartaric Gem");
|
||||
|
|
|
@ -163,6 +163,7 @@ public class BloodMagicItems
|
|||
public static final RegistryObject<Item> REAGENT_AIR = BASICITEMS.register("reagentair", () -> new ItemBase());
|
||||
public static final RegistryObject<Item> REAGENT_BLOOD_LIGHT = BASICITEMS.register("reagentbloodlight", () -> new ItemBase());
|
||||
public static final RegistryObject<Item> REAGENT_SIGHT = BASICITEMS.register("reagentsight", () -> new ItemBase());
|
||||
public static final RegistryObject<Item> REAGENT_BINDING = BASICITEMS.register("reagentbinding", () -> new ItemBase());
|
||||
|
||||
// Tartaric Gems
|
||||
public static final RegistryObject<Item> PETTY_GEM = ITEMS.register("soulgempetty", () -> new ItemSoulGem("petty", 64));
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.item.crafting.Ingredient;
|
|||
import wayoftime.bloodmagic.BloodMagic;
|
||||
import wayoftime.bloodmagic.common.data.recipe.builder.AlchemyArrayRecipeBuilder;
|
||||
import wayoftime.bloodmagic.common.item.BloodMagicItems;
|
||||
import wayoftime.bloodmagic.core.registry.AlchemyArrayRegistry;
|
||||
|
||||
public class AlchemyArrayRecipeProvider implements ISubRecipeProvider
|
||||
{
|
||||
|
@ -29,7 +30,16 @@ public class AlchemyArrayRecipeProvider implements ISubRecipeProvider
|
|||
AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/lightsigil.png"), Ingredient.fromItems(BloodMagicItems.REAGENT_BLOOD_LIGHT.get()), Ingredient.fromItems(BloodMagicItems.IMBUED_SLATE.get()), new ItemStack(BloodMagicItems.BLOOD_LIGHT_SIGIL.get())).build(consumer, BloodMagic.rl(basePath + "bloodlightsigil"));
|
||||
AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/airsigil.png"), Ingredient.fromItems(BloodMagicItems.REAGENT_AIR.get()), Ingredient.fromItems(BloodMagicItems.REINFORCED_SLATE.get()), new ItemStack(BloodMagicItems.AIR_SIGIL.get())).build(consumer, BloodMagic.rl(basePath + "airsigil"));
|
||||
AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/sightsigil.png"), Ingredient.fromItems(BloodMagicItems.REAGENT_SIGHT.get()), Ingredient.fromItems(BloodMagicItems.REINFORCED_SLATE.get()), new ItemStack(BloodMagicItems.SEER_SIGIL.get())).build(consumer, BloodMagic.rl(basePath + "seersigil"));
|
||||
// AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/fastminersigil.png"), Ingredient.fromItems(BloodMagicItems.REAGENT_FAST_MINER.get()), Ingredient.fromItems(BloodMagicItems.REINFORCED_SLATE.get()), new ItemStack(BloodMagicItems.FAST_MINER_SIGIL.get())).build(consumer, BloodMagic.rl(basePath + "frostsigil"));
|
||||
AlchemyArrayRecipeBuilder.array(AlchemyArrayRegistry.BINDING_ARRAY, Ingredient.fromItems(BloodMagicItems.REAGENT_BINDING.get()), Ingredient.fromItems(Items.IRON_HELMET), new ItemStack(BloodMagicItems.LIVING_HELMET.get())).build(consumer, BloodMagic.rl(basePath + "living_helmet"));
|
||||
AlchemyArrayRecipeBuilder.array(AlchemyArrayRegistry.BINDING_ARRAY, Ingredient.fromItems(BloodMagicItems.REAGENT_BINDING.get()), Ingredient.fromItems(Items.IRON_CHESTPLATE), new ItemStack(BloodMagicItems.LIVING_PLATE.get())).build(consumer, BloodMagic.rl(basePath + "living_plate"));
|
||||
AlchemyArrayRecipeBuilder.array(AlchemyArrayRegistry.BINDING_ARRAY, Ingredient.fromItems(BloodMagicItems.REAGENT_BINDING.get()), Ingredient.fromItems(Items.IRON_LEGGINGS), new ItemStack(BloodMagicItems.LIVING_LEGGINGS.get())).build(consumer, BloodMagic.rl(basePath + "living_leggings"));
|
||||
AlchemyArrayRecipeBuilder.array(AlchemyArrayRegistry.BINDING_ARRAY, Ingredient.fromItems(BloodMagicItems.REAGENT_BINDING.get()), Ingredient.fromItems(Items.IRON_BOOTS), new ItemStack(BloodMagicItems.LIVING_BOOTS.get())).build(consumer, BloodMagic.rl(basePath + "living_boots"));
|
||||
|
||||
// AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/fastminersigil.png"),
|
||||
// Ingredient.fromItems(BloodMagicItems.REAGENT_FAST_MINER.get()),
|
||||
// Ingredient.fromItems(BloodMagicItems.REINFORCED_SLATE.get()), new
|
||||
// ItemStack(BloodMagicItems.FAST_MINER_SIGIL.get())).build(consumer,
|
||||
// BloodMagic.rl(basePath + "frostsigil"));
|
||||
// BloodAltarRecipeBuilder.altar(Ingredient.fromTag(Tags.Items.GEMS_DIAMOND), new ItemStack(BloodMagicItems.WEAK_BLOOD_ORB.get()), AltarTier.ONE.ordinal(), 2000, 2, 1).build(consumer, new ResourceLocation(BloodMagic.MODID, basePath
|
||||
// + "weakbloodorb"));
|
||||
// BloodAltarRecipeBuilder.altar(Ingredient.fromTag(Tags.Items.STONE), new ItemStack(BloodMagicItems.SLATE.get()), AltarTier.ONE.ordinal(), 1000, 5, 5).build(consumer, new ResourceLocation(BloodMagic.MODID, basePath
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue