mirror of
https://github.com/GTNewHorizons/Avaritia.git
synced 2026-11-20 12:19:39 +00:00
Burning skulls! Burning swords!
This commit is contained in:
1 parent
b52cf82049
commit
db7791ec54
5 files changed
+51
-2
No files matched your search
@@ -115,7 +115,30 @@ public class LudicrousEvents {
|
||||
if(event.recentlyHit && event.entityLiving instanceof EntitySkeleton && event.source.getEntity() instanceof EntityPlayer){
|
||||
EntityPlayer player = (EntityPlayer)event.source.getEntity();
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() == LudicrousItems.skull_sword){
|
||||
addDrop(event, new ItemStack(Items.skull, 1, 1));
|
||||
// ok, we need to drop a skull then.
|
||||
if (event.drops.isEmpty()) {
|
||||
addDrop(event, new ItemStack(Items.skull, 1, 1));
|
||||
} else {
|
||||
int skulls = 0;
|
||||
|
||||
for (int i=0; i<event.drops.size(); i++) {
|
||||
EntityItem drop = event.drops.get(i);
|
||||
ItemStack stack = drop.getEntityItem();
|
||||
if (stack.getItem() == Items.skull) {
|
||||
if (stack.getItemDamage() == 1) {
|
||||
skulls++;
|
||||
} else if (stack.getItemDamage() == 0) {
|
||||
skulls++;
|
||||
stack.setItemDamage(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (skulls == 0) {
|
||||
addDrop(event, new ItemStack(Items.skull, 1, 1));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
package fox.spiteful.avaritia.items.tools;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import fox.spiteful.avaritia.Avaritia;
|
||||
import fox.spiteful.avaritia.items.LudicrousItems;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class ItemSwordSkulls extends ItemSword {
|
||||
|
||||
@@ -21,4 +26,10 @@ public class ItemSwordSkulls extends ItemSword {
|
||||
{
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void addInformation(ItemStack item, EntityPlayer player, List tooltip, boolean wut) {
|
||||
tooltip.add(EnumChatFormatting.DARK_GRAY +""+ EnumChatFormatting.ITALIC + StatCollector.translateToLocal("tooltip.skullfire_sword.desc"));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user