Readded Spike and Updraft Arrays. Also WIP Day Array

This commit is contained in:
WayofTime 2020-12-28 16:28:33 -05:00
parent 64b20227b2
commit f01a743a3e
22 changed files with 928 additions and 426 deletions

View file

@ -0,0 +1,53 @@
package wayoftime.bloodmagic.common.alchemyarray;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.world.server.ServerWorld;
import wayoftime.bloodmagic.tile.TileAlchemyArray;
public class AlchemyArrayEffectDay extends AlchemyArrayEffect
{
public AlchemyArrayEffectDay()
{
}
@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 (tile.getWorld() instanceof ServerWorld)
{
long time = (tile.getWorld().getGameTime() / 24000) * 24000;
for (ServerWorld serverworld : tile.getWorld().getServer().getWorlds())
{
serverworld.func_241114_a_((long) time);
}
return true;
}
return false;
}
@Override
public void writeToNBT(CompoundNBT tag)
{
}
@Override
public void readFromNBT(CompoundNBT tag)
{
}
@Override
public AlchemyArrayEffect getNewCopy()
{
return new AlchemyArrayEffectDay();
}
}

View file

@ -0,0 +1,53 @@
package wayoftime.bloodmagic.common.alchemyarray;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import wayoftime.bloodmagic.tile.TileAlchemyArray;
public class AlchemyArrayEffectSpike extends AlchemyArrayEffect
{
public AlchemyArrayEffectSpike()
{
super();
}
@Override
public boolean update(TileAlchemyArray tile, int ticksActive)
{
return false;
}
@Override
public void onEntityCollidedWithBlock(TileAlchemyArray array, World world, BlockPos pos, BlockState state, Entity entity)
{
if (entity instanceof LivingEntity)
{
entity.attackEntityFrom(DamageSource.CACTUS, 2);
}
}
@Override
public AlchemyArrayEffect getNewCopy()
{
return new AlchemyArrayEffectSpike();
}
@Override
public void readFromNBT(CompoundNBT compound)
{
// TODO Auto-generated method stub
}
@Override
public void writeToNBT(CompoundNBT compound)
{
// TODO Auto-generated method stub
}
}

View file

@ -0,0 +1,63 @@
package wayoftime.bloodmagic.common.alchemyarray;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.World;
import wayoftime.bloodmagic.tile.TileAlchemyArray;
public class AlchemyArrayEffectUpdraft extends AlchemyArrayEffect
{
public AlchemyArrayEffectUpdraft()
{
super();
}
@Override
public boolean update(TileAlchemyArray tile, int ticksActive)
{
return false;
}
@Override
public void onEntityCollidedWithBlock(TileAlchemyArray array, World world, BlockPos pos, BlockState state, Entity entity)
{
double motionY = 1;
double motionYGlowstoneMod = 0.1;
double motionYFeatherMod = 0.05;
TileAlchemyArray tileArray = (TileAlchemyArray) array;
motionY += motionYGlowstoneMod * (tileArray.getStackInSlot(0).getCount() - 1); // Glowstone Dust
motionY += motionYFeatherMod * (tileArray.getStackInSlot(1).getCount() - 1); // Feathers
// entity.getMotion().y = motionY;
entity.fallDistance = 0;
entity.setMotion(new Vector3d(0, motionY, 0));
}
@Override
public AlchemyArrayEffect getNewCopy()
{
return new AlchemyArrayEffectUpdraft();
}
@Override
public void readFromNBT(CompoundNBT compound)
{
// TODO Auto-generated method stub
}
@Override
public void writeToNBT(CompoundNBT compound)
{
// TODO Auto-generated method stub
}
}

View file

@ -37,6 +37,9 @@ public class AlchemyArrayRecipeProvider implements ISubRecipeProvider
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/movementarray.png"), Ingredient.fromItems(Items.FEATHER), Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE), ItemStack.EMPTY).build(consumer, BloodMagic.rl(basePath + "movement"));
AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/updraftarray.png"), Ingredient.fromItems(Items.FEATHER), Ingredient.fromTag(Tags.Items.DUSTS_GLOWSTONE), ItemStack.EMPTY).build(consumer, BloodMagic.rl(basePath + "updraft"));
AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/spikearray.png"), Ingredient.fromItems(Items.COBBLESTONE), Ingredient.fromTag(Tags.Items.INGOTS_IRON), ItemStack.EMPTY).build(consumer, BloodMagic.rl(basePath + "spike"));
AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/spikearray.png"), Ingredient.fromItems(Items.COAL), Ingredient.fromItems(Items.COAL), ItemStack.EMPTY).build(consumer, BloodMagic.rl(basePath + "day"));
// AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/fastminersigil.png"),
// Ingredient.fromItems(BloodMagicItems.REAGENT_FAST_MINER.get()),
// Ingredient.fromItems(BloodMagicItems.REINFORCED_SLATE.get()), new