From efd5e713a854576ce013c07373c75f7d00d425cd Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Tue, 28 Jul 2020 18:18:54 -0400 Subject: [PATCH] Make Veridium Ore Create Area Effect Cloud When Melted With Laser --- .../laser/IndustrialLaserBlockEntity.java | 13 +++++++++++++ .../energonrelics/potion/CustomPotions.java | 9 ++++++--- .../textures/block/veridium_ore.png | Bin 859 -> 2278 bytes 3 files changed, 19 insertions(+), 3 deletions(-) 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 6964cdbc43aeda05865a92e55f29fa2c93d25391..04c9e79a93ad0ca7af61bd011f55ed6400120848 100644 GIT binary patch delta 2267 zcmV<12qgF02IdivBYy=TdQ@0+Qek%>aB^>EX>4U6ba`-PAZ2)IW&i+q+O1Y=((EV* z{qHJf2?8Rz9G_LQgIWGyG^RWGa_^n0>2#t&0?6U0rv3AGH-G65Az0&Bf{)%?{kiBO zChY_}fAM&Nb;onP*t7E`H+uk8MB37Pm9+Ge%K7@>^a1%>ZhyiW!LSU$HhlbOcpm-w z8KlZ_%E2u|vCWQ;K|Vvx%TQU0M=0xdJFMA^ck?9>%~EA`M2L-m?C}gU0-ATyTl9$( zR8L2>4hYdwr#Da9l0trSeG;ng`f{sFws-lKeuo)s141eUtQ?(Qj=nFSK5`10@e)~~B zTB?d5A88Ic!DRC^kr}Sqq624AJ=S(o2#nNaKvSf?S%U#m1gr;Q@L&Z|05p$50ZJM< zlEbVB05et%5*?98BdC;7-};Tfp^JqlJB8cIy;nAx*% zFdR8~@_){=_g?&1znxu}B+DfXQ zRFW}McA2x!l0%L;6)m6Q3Kw6bgc3`tSgGnVQGJyfYOJY&X}VH0*SPs6EwtED*IMh; zUFYt*^w48Z8?}Y%hQCA34Cww3e%PX zf!Ji>$f+e|U+#{<8QtT&R2Y4$1UXvG=V(8NfH5Tfj}36PS(XmFAuzfzVm!6wRoe&t zc7L{=#v>p$W3T+QJPg; zos#Z^1cN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