/
Belyash5
/
Flu
Обзор
Документация
Войти
/
Belyash5
/
Flu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/com/hbm/items/special/ItemClayTablet.java
39 строк
1 KB
Bob
return the slab, or suffer my curse
23 дек 2024, 03:01
23 дек 2024, 03:01
6e44aee
Код
Авторство
О чём код?
package com.hbm.items.special; import com.hbm.inventory.gui.GUIScreenClayTablet; import com.hbm.main.MainRegistry; import com.hbm.tileentity.IGUIProvider; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; public class ItemClayTablet extends Item implements IGUIProvider { public ItemClayTablet() { this.setMaxDamage(0); this.setMaxStackSize(1); } @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { if(!world.isRemote && !stack.hasTagCompound()) { stack.stackTagCompound = new NBTTagCompound(); stack.stackTagCompound.setLong("tabletSeed", player.getRNG().nextLong()); } if(world.isRemote) player.openGui(MainRegistry.instance, 0, world, 0, 0, 0); return stack; } @Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return null; } @Override @SideOnly(Side.CLIENT) public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIScreenClayTablet(); } }