Added a few more upgrades to the Living Armour

... Wait, was I supposed to put something in here?
This commit is contained in:
WayofTime 2020-12-05 11:26:01 -05:00
parent 507c541d5b
commit 953bac9298
23 changed files with 493 additions and 23 deletions

View file

@ -1,6 +1,10 @@
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.world.World;
import wayoftime.bloodmagic.tile.TileAlchemyArray;
public abstract class AlchemyArrayEffect
@ -12,4 +16,8 @@ public abstract class AlchemyArrayEffect
public abstract void writeToNBT(CompoundNBT compound);
public abstract boolean update(TileAlchemyArray array, int activeCounter);
public void onEntityCollidedWithBlock(TileAlchemyArray tileAlchemyArray, World world, BlockPos pos, BlockState state, Entity entity)
{
};
}

View file

@ -44,7 +44,6 @@ public class AlchemyArrayEffectBinding extends AlchemyArrayEffectCrafting
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;
}

View file

@ -0,0 +1,96 @@
package wayoftime.bloodmagic.common.alchemyarray;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.Direction;
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 AlchemyArrayEffectMovement extends AlchemyArrayEffect
{
public AlchemyArrayEffectMovement()
{
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 = 0.5;
double motionYGlowstoneMod = 0.05;
double speed = 1.5;
double speedRedstoneMod = 0.15;
Direction direction = array.getRotation();
TileAlchemyArray tileArray = (TileAlchemyArray) array;
motionY += motionYGlowstoneMod * (tileArray.getStackInSlot(0).getCount() - 1);
speed += speedRedstoneMod * (tileArray.getStackInSlot(1).getCount() - 1);
// entity.getMotion().y = motionY;
entity.fallDistance = 0;
switch (direction)
{
case NORTH:
// entity.motionX = 0;
// entity.motionY = motionY;
// entity.motionZ = -speed;
entity.setMotion(new Vector3d(0, motionY, -speed));
break;
case SOUTH:
// entity.motionX = 0;
// entity.motionY = motionY;
// entity.motionZ = speed;
entity.setMotion(new Vector3d(0, motionY, speed));
break;
case WEST:
// entity.motionX = -speed;
// entity.motionY = motionY;
// entity.motionZ = 0;
entity.setMotion(new Vector3d(-speed, motionY, 0));
break;
case EAST:
// entity.motionX = speed;
// entity.motionY = motionY;
// entity.motionZ = 0;
entity.setMotion(new Vector3d(speed, motionY, 0));
break;
default:
break;
}
}
@Override
public AlchemyArrayEffect getNewCopy()
{
return new AlchemyArrayEffectMovement();
}
@Override
public void readFromNBT(CompoundNBT compound)
{
// TODO Auto-generated method stub
}
@Override
public void writeToNBT(CompoundNBT compound)
{
// TODO Auto-generated method stub
}
}

View file

@ -4,6 +4,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@ -52,6 +53,16 @@ public class BlockAlchemyArray extends Block
return BlockRenderType.ENTITYBLOCK_ANIMATED;
}
@Override
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity)
{
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileAlchemyArray)
{
((TileAlchemyArray) tile).onEntityCollidedWithBlock(state, entity);
}
}
@Override
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult blockRayTraceResult)
{

View file

@ -6,6 +6,7 @@ import net.minecraft.data.IFinishedRecipe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.crafting.Ingredient;
import net.minecraftforge.common.Tags;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.common.data.recipe.builder.AlchemyArrayRecipeBuilder;
import wayoftime.bloodmagic.common.item.BloodMagicItems;
@ -35,6 +36,7 @@ public class AlchemyArrayRecipeProvider implements ISubRecipeProvider
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/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/fastminersigil.png"),
// Ingredient.fromItems(BloodMagicItems.REAGENT_FAST_MINER.get()),
// Ingredient.fromItems(BloodMagicItems.REINFORCED_SLATE.get()), new