Skip to content

Commit

Permalink
fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
huige233 committed Nov 1, 2022
1 parent ede9ab0 commit 29688b6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/huige233/transcend/items/tools/ToolWarp.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.Mod;
Expand Down Expand Up @@ -47,7 +49,11 @@ public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingB
if (Loader.isModLoaded("thaumcraft")) {
ThaumcraftSword.warpsword(stack,target,attacker);
stack.damageItem(1, attacker);
return true;
}
if(attacker.getEntityWorld() instanceof WorldServer){
if(!attacker.getEntityWorld().isRemote) {
((WorldServer) attacker.getEntityWorld()).spawnParticle(EnumParticleTypes.LAVA, attacker.posX, attacker.posY, attacker.posZ, 0, 0, 0.);
}
}
stack.damageItem(1,attacker);
return true;
Expand Down

0 comments on commit 29688b6

Please sign in to comment.