feat: add explosion particle on minium stone transmutation

This commit is contained in:
LordMZTE 2023-01-08 15:42:01 +01:00
parent e5a39ff8fd
commit f8b31d8a7c
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -1,8 +1,12 @@
package com.pahimar.ee3.handler; package com.pahimar.ee3.handler;
import com.pahimar.ee3.api.event.WorldTransmutationEvent; import com.pahimar.ee3.api.event.WorldTransmutationEvent;
import com.pahimar.ee3.network.PacketHandler;
import com.pahimar.ee3.network.message.MessageSingleParticleEvent;
import com.pahimar.ee3.reference.Particles;
import com.pahimar.ee3.util.TransmutationHelper; import com.pahimar.ee3.util.TransmutationHelper;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -167,6 +171,24 @@ public class WorldTransmutationHandler {
); );
} }
if (result) { if (result) {
PacketHandler.INSTANCE.sendToAllAround(
new MessageSingleParticleEvent(
Particles.LARGE_EXPLODE,
event.x + 0.5,
event.y + 0.5,
event.z + 0.5,
0.0,
0.0,
0.0
),
new TargetPoint(
event.player.worldObj.provider.dimensionId,
event.x,
event.y,
event.z,
32
)
);
//event.actionResult = ActionEvent.ActionResult.SUCCESS; //event.actionResult = ActionEvent.ActionResult.SUCCESS;
int currentSlot = event.player.inventory.currentItem; int currentSlot = event.player.inventory.currentItem;
handItem.damageItem(1, event.player); handItem.damageItem(1, event.player);