v1.6.0
This commit is contained in:
1 parent
af4cfa8f8b
commit
dbb6783d18
22 files changed
+270
-21
No files matched your search
@@ -83,6 +83,9 @@ public class LzxnoneTerrariaClient {
|
||||
modEventBus.addListener(RegisterParticleProvidersEvent.class, event -> {
|
||||
event.registerSpriteSet(ModParticles.SOLAR_EXPLOSION_PARTICLE.get(), SolarExplosionParticle.Provider::new);
|
||||
});
|
||||
modEventBus.addListener(RegisterParticleProvidersEvent.class, event -> {
|
||||
event.registerSpriteSet(ModParticles.CRYSTAL_FRAGMENT_PARTICLE.get(), CrystalFragmentParticle.Provider::new);
|
||||
});
|
||||
modEventBus.addListener(RegisterParticleProvidersEvent.class, event -> {
|
||||
event.registerSpriteSet(ModParticles.DEVILS_DEVASTATION_RUNE_PARTICLE.get(), DevilsDevastationRuneParticle.Provider::new);
|
||||
});
|
||||
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria.client.entity.projectile;
|
||||
|
||||
import com.lzxnone.terraria.client.item.ammo.ClientCrystalFragment;
|
||||
import com.lzxnone.terraria.client.item.melee.ClientBladeOfGrass;
|
||||
import com.lzxnone.terraria.client.item.melee.ClientDevilsDevastation;
|
||||
import com.lzxnone.terraria.client.item.melee.ClientMace;
|
||||
@@ -27,6 +28,7 @@ public class ClientStaticProjectileRenderBehaviors {
|
||||
BEHAVIORS.put(StaticProjectileBehaviors.DEVILS_DEVASTATION_PROJECTILE, ClientDevilsDevastation.PROJECTILE_BEHAVIOR);
|
||||
BEHAVIORS.put(StaticProjectileBehaviors.DEVILS_DEVASTATION_PROJECTILE2, ClientDevilsDevastation.PROJECTILE_BEHAVIOR2);
|
||||
BEHAVIORS.put(StaticProjectileBehaviors.DEVILS_DEVASTATION_PROJECTILE3, ClientDevilsDevastation.PROJECTILE_BEHAVIOR3);
|
||||
BEHAVIORS.put(StaticProjectileBehaviors.CRYSTAL_FRAGMENT, ClientCrystalFragment.PROJECTILE_BEHAVIOR);
|
||||
}
|
||||
|
||||
public static IStaticProjectileRenderBehavior getBehavior(String id) {
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
package com.lzxnone.terraria.client.entity.summon;
|
||||
|
||||
import com.lzxnone.terraria.client.item.ammo.ClientBulletAmmo;
|
||||
import com.lzxnone.terraria.client.item.ammo.ClientCrystalFragment;
|
||||
import com.lzxnone.terraria.client.item.magic.ClientLastPrism;
|
||||
import com.lzxnone.terraria.client.item.melee.ClientDevilsDevastation;
|
||||
import com.lzxnone.terraria.client.item.melee.ClientFirstFractal;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.lzxnone.terraria.client.item.ammo;
|
||||
|
||||
import com.lzxnone.terraria.client.entity.projectile.IStaticProjectileRenderBehavior;
|
||||
|
||||
public class ClientCrystalFragment {
|
||||
public static final IStaticProjectileRenderBehavior PROJECTILE_BEHAVIOR = new IStaticProjectileRenderBehavior() {};
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria.entity.projectile;
|
||||
|
||||
import com.lzxnone.terraria.item.ammo.CrystalBullet;
|
||||
import com.lzxnone.terraria.item.weapon.melee.*;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.EntityHitResult;
|
||||
@@ -22,6 +23,7 @@ public class StaticProjectileBehaviors {
|
||||
public static final String DEVILS_DEVASTATION_PROJECTILE = "devils_devastation_projectile";
|
||||
public static final String DEVILS_DEVASTATION_PROJECTILE2 = "devils_devastation_projectile2";
|
||||
public static final String DEVILS_DEVASTATION_PROJECTILE3 = "devils_devastation_projectile3";
|
||||
public static final String CRYSTAL_FRAGMENT = "crystal_fragment";
|
||||
|
||||
static {
|
||||
BEHAVIORS.put(DEFAULT, new IStaticProjectileBehavior() {
|
||||
@@ -49,6 +51,7 @@ public class StaticProjectileBehaviors {
|
||||
BEHAVIORS.put(DEVILS_DEVASTATION_PROJECTILE, DevilsDevastation.PROJECTILE_BEHAVIOR);
|
||||
BEHAVIORS.put(DEVILS_DEVASTATION_PROJECTILE2, DevilsDevastation.PROJECTILE_BEHAVIOR2);
|
||||
BEHAVIORS.put(DEVILS_DEVASTATION_PROJECTILE3, DevilsDevastation.PROJECTILE_BEHAVIOR3);
|
||||
BEHAVIORS.put(CRYSTAL_FRAGMENT, CrystalBullet.PROJECTILE_BEHAVIOR);
|
||||
}
|
||||
|
||||
public static IStaticProjectileBehavior getBehavior(String id) {
|
||||
|
||||
@@ -69,6 +69,7 @@ public class ModItems {
|
||||
public static final DeferredItem<Item> METEOR_SHOT_PROJECTILE = ITEMS.register("meteor_shot_projectile", () -> new Item(new Item.Properties()));
|
||||
public static final DeferredItem<Item> SILVER_BULLET_PROJECTILE = ITEMS.register("silver_bullet_projectile", () -> new Item(new Item.Properties()));
|
||||
public static final DeferredItem<Item> CRYSTAL_BULLET_PROJECTILE = ITEMS.register("crystal_bullet_projectile", () -> new Item(new Item.Properties()));
|
||||
public static final DeferredItem<Item> CRYSTAL_FRAGMENT = ITEMS.register("crystal_fragment", () -> new Item(new Item.Properties()));
|
||||
public static final DeferredItem<Item> CURSED_BULLET_PROJECTILE = ITEMS.register("cursed_bullet_projectile", () -> new Item(new Item.Properties()));
|
||||
public static final DeferredItem<Item> CHLOROPHYTE_BULLET_PROJECTILE = ITEMS.register("chlorophyte_bullet_projectile", () -> new Item(new Item.Properties()));
|
||||
public static final DeferredItem<Item> HIGH_VELOCITY_BULLET_PROJECTILE = ITEMS.register("high_velocity_bullet_projectile", () -> new Item(new Item.Properties()));
|
||||
|
||||
@@ -1,9 +1,144 @@
|
||||
package com.lzxnone.terraria.item.ammo;
|
||||
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.projectile.IStaticProjectileBehavior;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectile;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectileBehaviors;
|
||||
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummon;
|
||||
import com.lzxnone.terraria.item.ModItems;
|
||||
import com.lzxnone.terraria.particle.ModParticles;
|
||||
import com.lzxnone.terraria.utils.*;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.phys.*;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CrystalBullet extends BasicBulletAmmo {
|
||||
public static final float BASE_DAMAGE = 0.8f;
|
||||
public static final float BASE_DAMAGE = 1.2f;
|
||||
public static final double SPEED = 3.0D;
|
||||
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = createSummonBehavior(BASE_DAMAGE, SPEED);
|
||||
|
||||
public static final float FRAGMENT_DAMAGE_MUL = 0.5f;
|
||||
public static final double FRAGMENT_SPEED = 1.0;
|
||||
public static final int FRAGMENT_TIME = 60;
|
||||
public static final int FRAGMENT_COUNT = 3;
|
||||
|
||||
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
|
||||
@Override
|
||||
public void tick(StaticSummon summon) {
|
||||
this.checkBeforeTick(summon);
|
||||
Vec3 motion = summon.getLookAngle().normalize().scale(SPEED);
|
||||
summon.setDeltaMovement(motion);
|
||||
|
||||
if(summon.level().isClientSide()) return;
|
||||
|
||||
//碰撞检测
|
||||
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
|
||||
List<Entity> targets = summon.level().getEntitiesOfClass(
|
||||
Entity.class,
|
||||
hitBox,
|
||||
FilterUtil.createTargetFilter(summon, summon.getOwner())
|
||||
);
|
||||
if(!targets.isEmpty()) {
|
||||
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
||||
float damage = customData.contains("damage") ? customData.getFloat("damage") : 0;
|
||||
float knockbackScale = customData.contains("knockbackScale") ? customData.getFloat("knockbackScale") : 1.0f;
|
||||
int invulnerableTime = customData.contains("invulnerableTime") ? customData.getInt("invulnerableTime") : 20;
|
||||
|
||||
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
|
||||
Entity target = targets.getFirst();
|
||||
if(DamageUtil.rangedAttack(summon, target, sourceStack, BASE_DAMAGE + damage, knockbackScale)) {
|
||||
target.invulnerableTime = invulnerableTime;
|
||||
for(int i = 0;i < FRAGMENT_COUNT;i++) {
|
||||
summonProjectile(summon, (BASE_DAMAGE + damage) * FRAGMENT_DAMAGE_MUL);
|
||||
}
|
||||
ParticleUtil.addParticles(
|
||||
(ServerLevel) summon.level(), ModParticles.CRYSTAL_FRAGMENT_PARTICLE.get(),
|
||||
summon.position(), new Vec3(0.2, 0.2, 0.2),
|
||||
0.2, 5
|
||||
);
|
||||
this.onDied(summon);
|
||||
}
|
||||
}
|
||||
|
||||
//方块检测
|
||||
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, summon.position().add(motion));
|
||||
if(blockHitResult.getType() != HitResult.Type.MISS) {
|
||||
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
||||
float damage = customData.contains("damage") ? customData.getFloat("damage") : 0;
|
||||
for(int i = 0;i < FRAGMENT_COUNT;i++) {
|
||||
summonProjectile(summon, (BASE_DAMAGE + damage) * FRAGMENT_DAMAGE_MUL);
|
||||
}
|
||||
ParticleUtil.addParticles(
|
||||
(ServerLevel) summon.level(), ModParticles.CRYSTAL_FRAGMENT_PARTICLE.get(),
|
||||
summon.position(), new Vec3(0.2, 0.2, 0.2),
|
||||
0.2, 5
|
||||
);
|
||||
this.onDied(summon);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public static final IStaticProjectileBehavior PROJECTILE_BEHAVIOR = new IStaticProjectileBehavior() {
|
||||
@Override
|
||||
public void onHitEntity(StaticProjectile projectile, EntityHitResult result) {
|
||||
if(!projectile.level().isClientSide()) {
|
||||
Entity target = result.getEntity();
|
||||
Entity owner = projectile.getOwner();
|
||||
if(owner == null) return;
|
||||
if(!FilterUtil.createTargetFilter(owner).test(target) || !(owner instanceof Player player)) return;
|
||||
CompoundTag customData = projectile.getEntityData().get(StaticProjectile.CUSTOM_DATA);
|
||||
float damage = customData.contains("damage") ? customData.getFloat("damage") : 0;
|
||||
if(DamageUtil.rangedAttack(projectile, target, projectile.getEntityData().get(StaticProjectile.STACK_SOURCE), damage, 1.0f)) {
|
||||
target.invulnerableTime = 5;
|
||||
onDied(projectile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHitBlock(StaticProjectile projectile, BlockHitResult result) {
|
||||
if(projectile.level().isClientSide()) return;
|
||||
if(!projectile.level().getBlockState(result.getBlockPos()).getCollisionShape(projectile.level(), result.getBlockPos()).isEmpty()) {
|
||||
onDied(projectile);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public static void summonProjectile(StaticSummon summon, float damage) {
|
||||
if(summon.level().isClientSide()) return;
|
||||
if(summon.getOwner() == null) return;
|
||||
Vec3 targetPos = MathUtil.getRandomPosOnRadius(summon.position(), 1);
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(targetPos.subtract(summon.position()).toVector3f(), 0);
|
||||
|
||||
StaticProjectile projectile = new StaticProjectile(ModEntities.STATIC_PROJECTILE.get(), summon.level());
|
||||
projectile.setOwner(summon.getOwner());
|
||||
projectile.getEntityData().set(StaticProjectile.STACK_SOURCE, summon.getEntityData().get(StaticSummon.STACK_SOURCE).copy());
|
||||
projectile.setPos(summon.position());
|
||||
projectile.getEntityData().set(StaticProjectile.BEHAVIOR, StaticProjectileBehaviors.CRYSTAL_FRAGMENT);
|
||||
projectile.getEntityData().set(StaticProjectile.RENDER_MODE, "item");
|
||||
projectile.getEntityData().set(StaticProjectile.ORIGIN, summon.position().toVector3f());
|
||||
projectile.getEntityData().set(StaticProjectile.DIRECTION, dirs[0]);
|
||||
projectile.getEntityData().set(StaticProjectile.UP, dirs[1]);
|
||||
projectile.getEntityData().set(StaticProjectile.RIGHT, dirs[2]);
|
||||
projectile.getEntityData().set(StaticProjectile.ITEM, new ItemStack(ModItems.CRYSTAL_FRAGMENT.get()));
|
||||
projectile.getEntityData().set(StaticProjectile.SCALE_X, 0.5f);
|
||||
projectile.getEntityData().set(StaticProjectile.SCALE_Y, 0.5f);
|
||||
projectile.getEntityData().set(StaticProjectile.SCALE_Z, 0.5f);
|
||||
projectile.getEntityData().set(StaticProjectile.RXPS, 10);
|
||||
projectile.getEntityData().set(StaticProjectile.LIFETIME, FRAGMENT_TIME);
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, String.format("%.3f*t", FRAGMENT_SPEED));
|
||||
|
||||
CompoundTag customData = new CompoundTag();
|
||||
customData.putFloat("damage", damage);
|
||||
projectile.getEntityData().set(StaticProjectile.CUSTOM_DATA, customData);
|
||||
|
||||
projectile.setDeltaMovement(MathUtil.toVec3(dirs[0]));
|
||||
summon.level().addFreshEntity(projectile);
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,8 @@ public class CursedBullet extends BasicBulletAmmo {
|
||||
Vec3 motion = summon.getLookAngle().normalize().scale(SPEED);
|
||||
summon.setDeltaMovement(motion);
|
||||
|
||||
if(summon.level().isClientSide()) return;
|
||||
|
||||
//碰撞检测
|
||||
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
|
||||
List<Entity> targets = summon.level().getEntitiesOfClass(
|
||||
|
||||
@@ -86,6 +86,8 @@ public class GoldenBullet extends BasicBulletAmmo {
|
||||
Vec3 motion = summon.getLookAngle().normalize().scale(getSpeed());
|
||||
summon.setDeltaMovement(motion);
|
||||
|
||||
if(summon.level().isClientSide()) return;
|
||||
|
||||
//碰撞检测
|
||||
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
|
||||
List<Entity> targets = summon.level().getEntitiesOfClass(
|
||||
|
||||
@@ -26,6 +26,8 @@ public class HighVelocityBullet extends BasicBulletAmmo {
|
||||
Vec3 motion = summon.getLookAngle().normalize().scale(SPEED);
|
||||
summon.setDeltaMovement(motion);
|
||||
|
||||
if(summon.level().isClientSide()) return;
|
||||
|
||||
//碰撞检测
|
||||
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
|
||||
List<Entity> targets = summon.level().getEntitiesOfClass(
|
||||
|
||||
@@ -94,25 +94,27 @@ public class MeteorShot extends BulletAmmo {
|
||||
summon.setDeltaMovement(motion);
|
||||
|
||||
//碰撞检测
|
||||
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
|
||||
List<Entity> targets = summon.level().getEntitiesOfClass(
|
||||
Entity.class,
|
||||
hitBox,
|
||||
FilterUtil.createTargetFilter(summon, summon.getOwner())
|
||||
);
|
||||
if(!targets.isEmpty()) {
|
||||
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
||||
float damage = customData.contains("damage") ? customData.getFloat("damage") : 0;
|
||||
float knockbackScale = customData.contains("knockbackScale") ? customData.getFloat("knockbackScale") : 1.0f;
|
||||
int invulnerableTime = customData.contains("invulnerableTime") ? customData.getInt("invulnerableTime") : 20;
|
||||
if(!summon.level().isClientSide()) {
|
||||
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
|
||||
List<Entity> targets = summon.level().getEntitiesOfClass(
|
||||
Entity.class,
|
||||
hitBox,
|
||||
FilterUtil.createTargetFilter(summon, summon.getOwner())
|
||||
);
|
||||
if (!targets.isEmpty()) {
|
||||
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
||||
float damage = customData.contains("damage") ? customData.getFloat("damage") : 0;
|
||||
float knockbackScale = customData.contains("knockbackScale") ? customData.getFloat("knockbackScale") : 1.0f;
|
||||
int invulnerableTime = customData.contains("invulnerableTime") ? customData.getInt("invulnerableTime") : 20;
|
||||
|
||||
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
|
||||
Entity target = targets.getFirst();
|
||||
if(DamageUtil.rangedAttack(summon, target, sourceStack, getBaseDamage() + damage, knockbackScale)) {
|
||||
target.invulnerableTime = invulnerableTime;
|
||||
if(MeteorShot.incrementHit(summon) >= getMaxHit()) {
|
||||
this.onDied(summon);
|
||||
return;
|
||||
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
|
||||
Entity target = targets.getFirst();
|
||||
if (DamageUtil.rangedAttack(summon, target, sourceStack, getBaseDamage() + damage, knockbackScale)) {
|
||||
target.invulnerableTime = invulnerableTime;
|
||||
if (MeteorShot.incrementHit(summon) >= getMaxHit()) {
|
||||
this.onDied(summon);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,8 @@ public class MusketBall extends BulletAmmo {
|
||||
Vec3 motion = summon.getLookAngle().normalize().scale(getSpeed());
|
||||
summon.setDeltaMovement(motion);
|
||||
|
||||
if(summon.level().isClientSide()) return;
|
||||
|
||||
//碰撞检测
|
||||
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
|
||||
List<Entity> targets = summon.level().getEntitiesOfClass(
|
||||
|
||||
@@ -6,4 +6,5 @@ public class PartyBullet extends BasicBulletAmmo {
|
||||
public static final float BASE_DAMAGE = 0.8f;
|
||||
public static final double SPEED = 3.0D;
|
||||
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = createSummonBehavior(BASE_DAMAGE, SPEED);
|
||||
|
||||
}
|
||||
@@ -86,6 +86,8 @@ public class SilverBullet extends BasicBulletAmmo {
|
||||
Vec3 motion = summon.getLookAngle().normalize().scale(getSpeed());
|
||||
summon.setDeltaMovement(motion);
|
||||
|
||||
if(summon.level().isClientSide()) return;
|
||||
|
||||
//碰撞检测
|
||||
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
|
||||
List<Entity> targets = summon.level().getEntitiesOfClass(
|
||||
|
||||
@@ -73,6 +73,8 @@ public class TungstenBullet extends BasicBulletAmmo {
|
||||
Vec3 motion = summon.getLookAngle().normalize().scale(getSpeed());
|
||||
summon.setDeltaMovement(motion);
|
||||
|
||||
if(summon.level().isClientSide()) return;
|
||||
|
||||
//碰撞检测
|
||||
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
|
||||
List<Entity> targets = summon.level().getEntitiesOfClass(
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.lzxnone.terraria.particle;
|
||||
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.ParticleProvider;
|
||||
import net.minecraft.client.particle.ParticleRenderType;
|
||||
import net.minecraft.client.particle.SpriteSet;
|
||||
import net.minecraft.client.particle.TextureSheetParticle;
|
||||
import net.minecraft.core.particles.SimpleParticleType;
|
||||
|
||||
public class CrystalFragmentParticle extends TextureSheetParticle {
|
||||
private final float rotSpeed;
|
||||
private final float baseSize;
|
||||
|
||||
protected CrystalFragmentParticle(ClientLevel level, double x, double y, double z,
|
||||
double xSpeed, double ySpeed, double zSpeed, SpriteSet spriteSet) {
|
||||
super(level, x, y, z, xSpeed, ySpeed, zSpeed);
|
||||
this.hasPhysics = false;
|
||||
|
||||
this.friction = 0.9F;
|
||||
this.gravity = 0.0F;
|
||||
this.xd = xSpeed;
|
||||
this.yd = ySpeed;
|
||||
this.zd = zSpeed;
|
||||
|
||||
this.baseSize = 0.03F + this.random.nextFloat() * 0.03F;
|
||||
this.quadSize = this.baseSize;
|
||||
|
||||
this.roll = this.random.nextFloat() * ((float)Math.PI * 2F);
|
||||
this.oRoll = this.roll;
|
||||
this.rotSpeed = (this.random.nextFloat() - 0.5F) * 0.5F;
|
||||
|
||||
this.lifetime = 20 + this.random.nextInt(10);
|
||||
|
||||
this.pickSprite(spriteSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
|
||||
this.oRoll = this.roll;
|
||||
this.roll += this.rotSpeed;
|
||||
|
||||
float lifeRatio = (float)this.age / (float)this.lifetime;
|
||||
this.quadSize = this.baseSize * (1.0F - lifeRatio);
|
||||
this.alpha = 1.0F - lifeRatio;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleRenderType getRenderType() {
|
||||
return ParticleRenderType.PARTICLE_SHEET_OPAQUE;
|
||||
}
|
||||
|
||||
public static class Provider implements ParticleProvider<SimpleParticleType> {
|
||||
private final SpriteSet spriteSet;
|
||||
|
||||
public Provider(SpriteSet spriteSet) {
|
||||
this.spriteSet = spriteSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Particle createParticle(SimpleParticleType type, ClientLevel level,
|
||||
double x, double y, double z,
|
||||
double xSpeed, double ySpeed, double zSpeed) {
|
||||
return new CrystalFragmentParticle(level, x, y, z, xSpeed, ySpeed, zSpeed, this.spriteSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,10 +120,12 @@ public class ModParticles {
|
||||
PARTICLE_TYPES.register("leaf_particle", () -> new SimpleParticleType(true));
|
||||
public static final Supplier<SimpleParticleType> SOLAR_EXPLOSION_PARTICLE =
|
||||
PARTICLE_TYPES.register("solar_explosion_particle", () -> new SimpleParticleType(true));
|
||||
public static final Supplier<SimpleParticleType> CRYSTAL_FRAGMENT_PARTICLE =
|
||||
PARTICLE_TYPES.register("crystal_fragment_particle", () -> new SimpleParticleType(true));
|
||||
public static final Supplier<SimpleParticleType> DEVILS_DEVASTATION_RUNE_PARTICLE =
|
||||
PARTICLE_TYPES.register("devils_devastation_rune_particle", () -> new SimpleParticleType(true));
|
||||
public static final Supplier<SimpleParticleType> DEVILS_DEVASTATION_RUNE_PARTICLE2 =
|
||||
PARTICLE_TYPES.register("devils_devastation_rune_particle2", () -> new SimpleParticleType(true));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/crystal_fragment"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"textures": [
|
||||
"lzxnoneterraria:crystal_fragment_particle"
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 465 B |
Binary file not shown.
|
After Width: | Height: | Size: 122 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 122 B |
Reference in new issue
Block a user