Attempt to fix 1.16.3 branch's issues on the repository
Added the original 'wayoftime' folder back, so see if that fixed the multiple folder issue.
This commit is contained in:
parent
6b4145a67c
commit
9fa68e86ae
224 changed files with 24047 additions and 0 deletions
|
@ -0,0 +1,30 @@
|
|||
package wayoftime.bloodmagic.entity;
|
||||
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import wayoftime.bloodmagic.BloodMagic;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = BloodMagic.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class BloodMagicEntities
|
||||
{
|
||||
private BloodMagicEntities()
|
||||
{
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerEntities(RegistryEvent.Register<EntityType<?>> event)
|
||||
{
|
||||
// System.out.println("Ow O");
|
||||
// event.getRegistry().register(EntityType.Builder.<EntitySoulSnare>create(EntitySoulSnare::new, EntityClassification.MISC).setTrackingRange(64).setUpdateInterval(1).setShouldReceiveVelocityUpdates(false).setCustomClientFactory(((spawnEntity, world) -> new EntitySoulSnare(EntitySoulSnare.TYPE, world))).build("").setRegistryName(BloodMagic.rl("entitysoulsnare")));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerModels(ModelRegistryEvent evt)
|
||||
{
|
||||
// System.out.println("O wO");
|
||||
// RenderingRegistry.registerEntityRenderingHandler(BloodMagicEntityTypes.SNARE.getEntityType(), SoulSnareRenderer::new);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package wayoftime.bloodmagic.entity.projectile;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.projectile.ProjectileHelper;
|
||||
import net.minecraft.entity.projectile.ProjectileItemEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraft.particles.IParticleData;
|
||||
import net.minecraft.particles.ItemParticleData;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.network.NetworkHooks;
|
||||
import wayoftime.bloodmagic.common.block.BloodMagicBlocks;
|
||||
import wayoftime.bloodmagic.common.item.BloodMagicItems;
|
||||
import wayoftime.bloodmagic.common.registries.BloodMagicEntityTypes;
|
||||
|
||||
public class EntityBloodLight extends ProjectileItemEntity
|
||||
{
|
||||
public EntityBloodLight(EntityType<EntityBloodLight> p_i50159_1_, World p_i50159_2_)
|
||||
{
|
||||
super(p_i50159_1_, p_i50159_2_);
|
||||
}
|
||||
|
||||
public EntityBloodLight(World worldIn, LivingEntity throwerIn)
|
||||
{
|
||||
super(BloodMagicEntityTypes.BLOOD_LIGHT.getEntityType(), throwerIn, worldIn);
|
||||
}
|
||||
|
||||
public EntityBloodLight(World worldIn, double x, double y, double z)
|
||||
{
|
||||
super(BloodMagicEntityTypes.BLOOD_LIGHT.getEntityType(), x, y, z, worldIn);
|
||||
}
|
||||
|
||||
protected Item getDefaultItem()
|
||||
{
|
||||
return BloodMagicItems.REAGENT_BLOOD_LIGHT.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPacket<?> createSpawnPacket()
|
||||
{
|
||||
return NetworkHooks.getEntitySpawningPacket(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick()
|
||||
{
|
||||
super.tick();
|
||||
RayTraceResult raytraceresult = ProjectileHelper.func_234618_a_(this, this::func_230298_a_);
|
||||
// boolean flag = false;
|
||||
if (raytraceresult.getType() == RayTraceResult.Type.BLOCK)
|
||||
{
|
||||
BlockPos blockpos = ((BlockRayTraceResult) raytraceresult).getPos().offset(((BlockRayTraceResult) raytraceresult).getFace());
|
||||
BlockState blockstate = this.world.getBlockState(blockpos);
|
||||
if (blockstate.isAir())
|
||||
{
|
||||
this.getEntityWorld().setBlockState(blockpos, BloodMagicBlocks.BLOOD_LIGHT.get().getDefaultState());
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected float getGravityVelocity()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
private IParticleData makeParticle()
|
||||
{
|
||||
ItemStack itemstack = this.func_213882_k();
|
||||
return (IParticleData) (itemstack.isEmpty() ? ParticleTypes.LAVA
|
||||
: new ItemParticleData(ParticleTypes.ITEM, itemstack));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for {@link World#setEntityState}
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void handleStatusUpdate(byte id)
|
||||
{
|
||||
if (id == 3)
|
||||
{
|
||||
IParticleData iparticledata = this.makeParticle();
|
||||
|
||||
for (int i = 0; i < 8; ++i)
|
||||
{
|
||||
this.world.addParticle(iparticledata, this.getPosX(), this.getPosY(), this.getPosZ(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
package wayoftime.bloodmagic.entity.projectile;
|
||||
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.projectile.ProjectileItemEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraft.particles.IParticleData;
|
||||
import net.minecraft.particles.ItemParticleData;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.math.EntityRayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.network.NetworkHooks;
|
||||
import wayoftime.bloodmagic.common.item.BloodMagicItems;
|
||||
import wayoftime.bloodmagic.common.registries.BloodMagicEntityTypes;
|
||||
import wayoftime.bloodmagic.potion.BloodMagicPotions;
|
||||
|
||||
public class EntitySoulSnare extends ProjectileItemEntity
|
||||
{
|
||||
public EntitySoulSnare(EntityType<EntitySoulSnare> p_i50159_1_, World p_i50159_2_)
|
||||
{
|
||||
super(p_i50159_1_, p_i50159_2_);
|
||||
}
|
||||
|
||||
public EntitySoulSnare(World worldIn, LivingEntity throwerIn)
|
||||
{
|
||||
super(BloodMagicEntityTypes.SNARE.getEntityType(), throwerIn, worldIn);
|
||||
}
|
||||
|
||||
public EntitySoulSnare(World worldIn, double x, double y, double z)
|
||||
{
|
||||
super(BloodMagicEntityTypes.SNARE.getEntityType(), x, y, z, worldIn);
|
||||
}
|
||||
|
||||
protected Item getDefaultItem()
|
||||
{
|
||||
return BloodMagicItems.SOUL_SNARE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPacket<?> createSpawnPacket()
|
||||
{
|
||||
return NetworkHooks.getEntitySpawningPacket(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the arrow hits an entity
|
||||
*/
|
||||
protected void onEntityHit(EntityRayTraceResult result)
|
||||
{
|
||||
if (result.getEntity() == this.func_234616_v_() || this.ticksExisted < 2 || getEntityWorld().isRemote)
|
||||
return;
|
||||
|
||||
if (result.getEntity() instanceof LivingEntity)
|
||||
{
|
||||
((LivingEntity) result.getEntity()).addPotionEffect(new EffectInstance(BloodMagicPotions.SOUL_SNARE, 300, 0));
|
||||
|
||||
result.getEntity().attackEntityFrom(DamageSource.causeThrownDamage(this, this.func_234616_v_()), (float) 0);
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
private IParticleData makeParticle()
|
||||
{
|
||||
ItemStack itemstack = this.func_213882_k();
|
||||
return (IParticleData) (itemstack.isEmpty() ? ParticleTypes.ITEM_SNOWBALL
|
||||
: new ItemParticleData(ParticleTypes.ITEM, itemstack));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for {@link World#setEntityState}
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void handleStatusUpdate(byte id)
|
||||
{
|
||||
if (id == 3)
|
||||
{
|
||||
IParticleData iparticledata = this.makeParticle();
|
||||
|
||||
for (int i = 0; i < 8; ++i)
|
||||
{
|
||||
this.world.addParticle(iparticledata, this.getPosX(), this.getPosY(), this.getPosZ(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue