Refactor everything to WayofTime.bloodmagic.*
This commit is contained in:
parent
46742a73d1
commit
096ba02450
771 changed files with 566 additions and 573 deletions
|
@ -0,0 +1,46 @@
|
|||
package WayofTime.bloodmagic.item.sigil;
|
||||
|
||||
import WayofTime.bloodmagic.api.altar.IBloodAltar;
|
||||
import WayofTime.bloodmagic.api.util.helper.BindableHelper;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.util.ChatUtil;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemSigilDivination extends ItemSigilBase {
|
||||
|
||||
public ItemSigilDivination() {
|
||||
super("divination");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
super.onItemRightClick(stack, world, player);
|
||||
|
||||
if (!world.isRemote && syphonBatteries(stack, player, getEnergyUsed())) {
|
||||
MovingObjectPosition position = getMovingObjectPositionFromPlayer(world, player, false);
|
||||
int currentEssence = NetworkHelper.getCurrentEssence(BindableHelper.getOwnerName(stack));
|
||||
|
||||
if (position == null) {
|
||||
ChatUtil.sendNoSpam(player, new ChatComponentText(TextHelper.localize(tooltipBase + "currentEssence", currentEssence)));
|
||||
return stack;
|
||||
} else {
|
||||
if (position.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
TileEntity tile = world.getTileEntity(position.getBlockPos());
|
||||
|
||||
if (!(tile instanceof IBloodAltar)) {
|
||||
ChatUtil.sendNoSpam(player, new ChatComponentText(TextHelper.localize(tooltipBase + "currentEssence", currentEssence)));
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue