Altar works
This commit is contained in:
parent
352c6b9e5f
commit
a6d329cf98
12 changed files with 266 additions and 110 deletions
|
@ -1,6 +1,6 @@
|
|||
package WayofTime.bloodmagic.util;
|
||||
|
||||
import WayofTime.bloodmagic.network.AlchemicalWizardryPacketHandler;
|
||||
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -233,6 +233,6 @@ public class ChatUtil {
|
|||
*/
|
||||
public static void sendNoSpam(EntityPlayerMP player, IChatComponent... lines) {
|
||||
if (lines.length > 0)
|
||||
AlchemicalWizardryPacketHandler.INSTANCE.sendTo(new PacketNoSpamChat(lines), player);
|
||||
BloodMagicPacketHandler.INSTANCE.sendTo(new PacketNoSpamChat(lines), player);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,18 +27,22 @@ public class Utils {
|
|||
* @param tile - The {@link TileInventory} to input the item to
|
||||
* @param player - The player to take the item from.
|
||||
*/
|
||||
public static void insertItemToTile(TileInventory tile, EntityPlayer player) {
|
||||
public static boolean insertItemToTile(TileInventory tile, EntityPlayer player) {
|
||||
if (tile.getStackInSlot(0) == null && player.getHeldItem() != null) {
|
||||
ItemStack input = player.getHeldItem().copy();
|
||||
input.stackSize = 1;
|
||||
player.getHeldItem().stackSize--;
|
||||
tile.setInventorySlotContents(0, input);
|
||||
return true;
|
||||
} else if (tile.getStackInSlot(0) != null && player.getHeldItem() == null) {
|
||||
if (!tile.getWorld().isRemote) {
|
||||
EntityItem invItem = new EntityItem(tile.getWorld(), player.posX, player.posY + 0.25, player.posZ, tile.getStackInSlot(0));
|
||||
tile.getWorld().spawnEntityInWorld(invItem);
|
||||
}
|
||||
tile.clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue