diff --git a/src/main/java/com/thebrokenrail/energonrelics/block/entity/forcefield/laser/IndustrialLaserBlockEntity.java b/src/main/java/com/thebrokenrail/energonrelics/block/entity/forcefield/laser/IndustrialLaserBlockEntity.java index 549a72c..e65f05c 100644 --- a/src/main/java/com/thebrokenrail/energonrelics/block/entity/forcefield/laser/IndustrialLaserBlockEntity.java +++ b/src/main/java/com/thebrokenrail/energonrelics/block/entity/forcefield/laser/IndustrialLaserBlockEntity.java @@ -4,11 +4,13 @@ import com.thebrokenrail.energonrelics.EnergonRelics; import com.thebrokenrail.energonrelics.block.entity.forcefield.FieldProjectorBlockEntity; import com.thebrokenrail.energonrelics.block.forcefield.laser.IndustrialLaserProjectorBlock; import com.thebrokenrail.energonrelics.config.HardcodedConfig; +import com.thebrokenrail.energonrelics.potion.CustomPotions; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.TntBlock; import net.minecraft.block.entity.BlockEntityType; +import net.minecraft.entity.AreaEffectCloudEntity; import net.minecraft.nbt.CompoundTag; import net.minecraft.particle.ParticleTypes; import net.minecraft.server.world.ServerWorld; @@ -62,6 +64,17 @@ public class IndustrialLaserBlockEntity extends FieldProjectorBlockEntity { Block.dropStack(getWorld(), targetPos, IndustrialLaserRegistry.get(targetState.getBlock(), getWorld().random)); getWorld().breakBlock(targetPos, false); + if (targetState.getBlock() == EnergonRelics.VERIDIUM_ORE_BLOCK) { + AreaEffectCloudEntity areaEffectCloudEntity = new AreaEffectCloudEntity(getWorld(), targetPos.getX() + 0.5d, targetPos.getY() + 0.5d, targetPos.getZ() + 0.5d); + areaEffectCloudEntity.setRadius(2.1f); + areaEffectCloudEntity.setRadiusOnUse(-0.5f); + areaEffectCloudEntity.setWaitTime(10); + areaEffectCloudEntity.setDuration(areaEffectCloudEntity.getDuration() / 2); + areaEffectCloudEntity.setRadiusGrowth(-areaEffectCloudEntity.getRadius() / (float) areaEffectCloudEntity.getDuration()); + areaEffectCloudEntity.addEffect(CustomPotions.VERIDIUM_POISON_EFFECT.statusEffectInstance); + getWorld().spawnEntity(areaEffectCloudEntity); + } + progress = 0; } else { Vec3d vec = Vec3d.ofCenter(targetPos); diff --git a/src/main/java/com/thebrokenrail/energonrelics/potion/CustomPotions.java b/src/main/java/com/thebrokenrail/energonrelics/potion/CustomPotions.java index a5d6ca5..a613d14 100644 --- a/src/main/java/com/thebrokenrail/energonrelics/potion/CustomPotions.java +++ b/src/main/java/com/thebrokenrail/energonrelics/potion/CustomPotions.java @@ -21,11 +21,13 @@ public class CustomPotions { } public final StatusEffect statusEffect; + public final StatusEffectInstance statusEffectInstance; private final Potion potion; private final Potion longPotion; - private CustomPotion(StatusEffect statusEffect, Potion potion, Potion longPotion) { + private CustomPotion(StatusEffect statusEffect, StatusEffectInstance statusEffectInstance, Potion potion, Potion longPotion) { this.statusEffect = statusEffect; + this.statusEffectInstance = statusEffectInstance; this.potion = potion; this.longPotion = longPotion; } @@ -41,9 +43,10 @@ public class CustomPotions { @SuppressWarnings("SameParameterValue") private static CustomPotion registerEffect(String name, int color) { StatusEffect effect = Registry.register(Registry.STATUS_EFFECT, new Identifier(EnergonRelics.NAMESPACE, name), new CustomPotion.CustomStatusEffect(StatusEffectType.HARMFUL, color)); - Potion potion = Registry.register(Registry.POTION, new Identifier(EnergonRelics.NAMESPACE, name), new Potion(EnergonRelics.NAMESPACE + '.' + name, new StatusEffectInstance(effect, 1800))); + StatusEffectInstance statusEffectInstance = new StatusEffectInstance(effect, 1800); + Potion potion = Registry.register(Registry.POTION, new Identifier(EnergonRelics.NAMESPACE, name), new Potion(EnergonRelics.NAMESPACE + '.' + name, statusEffectInstance)); Potion longPotion = Registry.register(Registry.POTION, new Identifier(EnergonRelics.NAMESPACE, "long_" + name), new Potion(EnergonRelics.NAMESPACE + '.' + name, new StatusEffectInstance(effect, 4800))); - return new CustomPotion(effect, potion, longPotion); + return new CustomPotion(effect, statusEffectInstance, potion, longPotion); } private static void registerBrewingRecipes() { diff --git a/src/main/resources/assets/energonrelics/textures/block/veridium_ore.png b/src/main/resources/assets/energonrelics/textures/block/veridium_ore.png index 6964cdb..04c9e79 100644 Binary files a/src/main/resources/assets/energonrelics/textures/block/veridium_ore.png and b/src/main/resources/assets/energonrelics/textures/block/veridium_ore.png differ