本文整理汇总了Java中net.minecraft.block.BlockJukebox类的典型用法代码示例。如果您正苦于以下问题:Java BlockJukebox类的具体用法?Java BlockJukebox怎么用?Java BlockJukebox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlockJukebox类属于net.minecraft.block包,在下文中一共展示了BlockJukebox类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onItemUse
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
/**
* Called when a Block is right-clicked with this Item
*/
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
{
IBlockState iblockstate = worldIn.getBlockState(pos);
if (iblockstate.getBlock() == Blocks.jukebox && !((Boolean)iblockstate.getValue(BlockJukebox.HAS_RECORD)).booleanValue())
{
if (worldIn.isRemote)
{
return true;
}
else
{
((BlockJukebox)Blocks.jukebox).insertRecord(worldIn, pos, iblockstate, stack);
worldIn.playAuxSFXAtEntity((EntityPlayer)null, 1005, pos, Item.getIdFromItem(this));
--stack.stackSize;
playerIn.triggerAchievement(StatList.field_181740_X);
return true;
}
}
else
{
return false;
}
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:28,代码来源:ItemRecord.java
示例2: onItemUse
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
/**
* Called when a Block is right-clicked with this Item
*/
public EnumActionResult onItemUse(EntityPlayer stack, World playerIn, BlockPos worldIn, EnumHand pos, EnumFacing hand, float facing, float hitX, float hitY)
{
IBlockState iblockstate = playerIn.getBlockState(worldIn);
if (iblockstate.getBlock() == Blocks.JUKEBOX && !((Boolean)iblockstate.getValue(BlockJukebox.HAS_RECORD)).booleanValue())
{
if (!playerIn.isRemote)
{
ItemStack itemstack = stack.getHeldItem(pos);
((BlockJukebox)Blocks.JUKEBOX).insertRecord(playerIn, worldIn, iblockstate, itemstack);
playerIn.playEvent((EntityPlayer)null, 1010, worldIn, Item.getIdFromItem(this));
itemstack.func_190918_g(1);
stack.addStat(StatList.RECORD_PLAYED);
}
return EnumActionResult.SUCCESS;
}
else
{
return EnumActionResult.PASS;
}
}
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:ItemRecord.java
示例3: onItemUse
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
/**
* Called when a Block is right-clicked with this Item
*/
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
IBlockState iblockstate = worldIn.getBlockState(pos);
if (iblockstate.getBlock() == Blocks.JUKEBOX && !((Boolean)iblockstate.getValue(BlockJukebox.HAS_RECORD)).booleanValue())
{
if (!worldIn.isRemote)
{
((BlockJukebox)Blocks.JUKEBOX).insertRecord(worldIn, pos, iblockstate, stack);
worldIn.playEvent((EntityPlayer)null, 1010, pos, Item.getIdFromItem(this));
--stack.stackSize;
playerIn.addStat(StatList.RECORD_PLAYED);
}
return EnumActionResult.SUCCESS;
}
else
{
return EnumActionResult.PASS;
}
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:25,代码来源:ItemRecord.java
示例4: onItemUse
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
{
//TODO: world.getBlock()
if (world.getBlock(x, y, z) == Blocks.jukebox && world.getBlockMetadata(x, y, z) == 0)
{
if (world.isRemote)
return true;
else
{
//TODO: .insertRecord()
((BlockJukebox)Blocks.jukebox).func_149926_b(world, x, y, z, itemStack);
//TODO: Item.getIdFromItem()
world.playAuxSFXAtEntity((EntityPlayer)null, 1005, x, y, z, Item.getIdFromItem(this));
--itemStack.stackSize;
return true;
}
}
else
return false;
}
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:22,代码来源:ItemPatCD1.java
示例5: onItemUse
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
/**
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
*/
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (par3World.getBlock(par4, par5, par6) == Blocks.jukebox && par3World.getBlockMetadata(par4, par5, par6) == 0)
{
if (par3World.isClient)
{
return true;
}
else
{
((BlockJukebox)Blocks.jukebox).func_149926_b(par3World, par4, par5, par6, par1ItemStack);
par3World.playAuxSFXAtEntity((EntityPlayer)null, 1005, par4, par5, par6, Item.getIdFromItem(this));
--par1ItemStack.stackSize;
return true;
}
}
else
{
return false;
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:26,代码来源:ItemRecord.java
示例6: onItemUse
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
{
if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) == Blocks.jukebox && p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_) == 0)
{
if (p_77648_3_.isRemote)
{
return true;
}
else
{
((BlockJukebox)Blocks.jukebox).func_149926_b(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_1_);
p_77648_3_.playAuxSFXAtEntity((EntityPlayer)null, 1005, p_77648_4_, p_77648_5_, p_77648_6_, Item.getIdFromItem(this));
--p_77648_1_.stackSize;
return true;
}
}
else
{
return false;
}
}
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:22,代码来源:ItemRecord.java
示例7: onDrawBlockHighlight
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
@SubscribeEvent
public void onDrawBlockHighlight(DrawBlockHighlightEvent event) {
int x = event.target.blockX;
int y = event.target.blockY;
int z = event.target.blockZ;
World world = event.player.worldObj;
if (world != null) {
Block block = world.getBlock(x, y, z);
if (block == Blocks.jukebox) {
TileEntity te = world.getTileEntity(x, y, z);
if (te instanceof BlockJukebox.TileEntityJukebox) {
//BlockJukebox.TileEntityJukebox jb = (BlockJukebox.TileEntityJukebox) te;
Physis.logger.info("test");
}
}
}
}
开发者ID:TTFTCUTS,项目名称:ShadowsOfPhysis,代码行数:21,代码来源:BlockHighlightHandler.java
示例8: onItemUse
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
{
if (world.getBlock(x, y, z) == Blocks.jukebox && world.getBlockMetadata(x, y, z) == 0)
{
if (world.isRemote)
return true;
else
{
((BlockJukebox)Blocks.jukebox).func_149926_b(world, x, y, z, itemStack);
world.playAuxSFXAtEntity((EntityPlayer)null, 1005, x, y, z, Item.getIdFromItem(this));
--itemStack.stackSize;
return true;
}
}
else
return false;
}
开发者ID:izfaruqi,项目名称:NeatCraft,代码行数:19,代码来源:ItemRecordNC.java
示例9: onItemUse
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player,
World world, int x, int y, int z,
int par7, float par8, float par9, float par10) {
if (world.getBlock(x, y, z) == Blocks.jukebox && world.getBlockMetadata(x, y, z) == 0) {
if (world.isRemote) {
return true;
} else {
//TODO: .insertRecord()
((BlockJukebox) Blocks.jukebox).func_149926_b(world, x, y, z, stack);
world.playAuxSFXAtEntity(null, 1005, x, y, z, Item.getIdFromItem(this));
--stack.stackSize;
return true;
}
} else {
return false;
}
}
开发者ID:hanetzer,项目名称:CreepyPastaCraft,代码行数:19,代码来源:ItemCPCRecord.java
示例10: onItemUse
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
IBlockState iblockstate = worldIn.getBlockState(pos);
if (iblockstate.getBlock() == Blocks.JUKEBOX && !((Boolean)iblockstate.getValue(BlockJukebox.HAS_RECORD)).booleanValue())
{
if (!worldIn.isRemote)
{
ItemStack itemstack = player.getHeldItem(hand);
((BlockJukebox)Blocks.JUKEBOX).insertRecord(worldIn, pos, iblockstate, itemstack);
worldIn.playEvent((EntityPlayer)null, 1010, pos, Item.getIdFromItem(this));
itemstack.shrink(1);
player.addStat(StatList.RECORD_PLAYED);
}
return EnumActionResult.SUCCESS;
}
else
{
return EnumActionResult.PASS;
}
}
开发者ID:ProBossGamers,项目名称:TurtleMod,代码行数:23,代码来源:MusicDisc.java
示例11: onItemUse
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (par3World.getBlockId(par4, par5, par6) == Block.jukebox.blockID && par3World.getBlockMetadata(par4, par5, par6) == 0 && !mod_Rediscovered.Calm4MusicDisk)
{
if (par3World.isRemote)
{
return true;
}
else
{
((BlockJukeBox)Block.jukebox).insertRecord(par3World, par4, par5, par6, par1ItemStack);
// par3World.playAuxSFXAtEntity((EntityPlayer)null, 1005, par4, par5, par6, this.itemID);
// par3World.playSoundAtEntity(par2EntityPlayer, mod_Rediscovered.modid + ":calm", 2.0F, 1.0F);
--par1ItemStack.stackSize;
return true;
}
}
else
{
return false;
}
}
开发者ID:Stormister,项目名称:Rediscovered-Mod-1.6.4,代码行数:23,代码来源:ItemCalmRecord.java
示例12: onItemUse
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
/**
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
*/
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (par3World.getBlockId(par4, par5, par6) == Block.jukebox.blockID && par3World.getBlockMetadata(par4, par5, par6) == 0)
{
if (par3World.isRemote)
{
return true;
}
else
{
((BlockJukeBox)Block.jukebox).insertRecord(par3World, par4, par5, par6, par1ItemStack);
par3World.playAuxSFXAtEntity((EntityPlayer)null, 1005, par4, par5, par6, this.itemID);
--par1ItemStack.stackSize;
return true;
}
}
else
{
return false;
}
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:26,代码来源:ItemRecord.java
示例13: onItemUse
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
@Override
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
IBlockState iblockstate = world.getBlockState(pos);
if (iblockstate.getBlock() == Blocks.JUKEBOX && !((Boolean)iblockstate.getValue(BlockJukebox.HAS_RECORD)).booleanValue()) {
if (!world.isRemote) {
((BlockJukebox)Blocks.JUKEBOX).insertRecord(world, pos, iblockstate, player.getActiveItemStack());
world.playEvent((EntityPlayer)null, 1010, pos, Item.getIdFromItem(this));
player.getActiveItemStack().setCount(player.getActiveItemStack().getCount()-1);
player.addStat(StatList.RECORD_PLAYED);
}
return EnumActionResult.SUCCESS;
}
else
return EnumActionResult.PASS;
}
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:16,代码来源:ItemKKRecord.java
示例14: func_77648_a
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
public boolean func_77648_a(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) {
if(p_77648_3_.func_72798_a(p_77648_4_, p_77648_5_, p_77648_6_) == Block.field_72032_aY.field_71990_ca && p_77648_3_.func_72805_g(p_77648_4_, p_77648_5_, p_77648_6_) == 0) {
if(p_77648_3_.field_72995_K) {
return true;
} else {
((BlockJukeBox)Block.field_72032_aY).func_85106_a(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_1_);
p_77648_3_.func_72889_a((EntityPlayer)null, 1005, p_77648_4_, p_77648_5_, p_77648_6_, this.field_77779_bT);
--p_77648_1_.field_77994_a;
return true;
}
} else {
return false;
}
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:15,代码来源:ItemRecord.java
示例15: canHack
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
@Override
public boolean canHack(IBlockAccess world, BlockPos pos, EntityPlayer player) {
return world.getBlockState(pos).getValue(BlockJukebox.HAS_RECORD);
}
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:5,代码来源:HackableJukebox.java
示例16: eject
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
public boolean eject() {
boolean result = isPlaying();
((BlockJukebox) Blocks.jukebox).func_149925_e(world.getHandle(), getX(), getY(), getZ());
return result;
}
开发者ID:UraniumMC,项目名称:Uranium,代码行数:6,代码来源:CraftJukebox.java
示例17: createFixer
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
public static DataFixer createFixer()
{
DataFixer datafixer = new DataFixer(512);
WorldInfo.registerFixes(datafixer);
EntityPlayer.registerFixesPlayer(datafixer);
AnvilChunkLoader.registerFixes(datafixer);
ItemStack.registerFixes(datafixer);
EntityArmorStand.registerFixesArmorStand(datafixer);
EntityArrow.registerFixesArrow(datafixer);
EntityBat.registerFixesBat(datafixer);
EntityBlaze.registerFixesBlaze(datafixer);
EntityCaveSpider.registerFixesCaveSpider(datafixer);
EntityChicken.registerFixesChicken(datafixer);
EntityCow.registerFixesCow(datafixer);
EntityCreeper.registerFixesCreeper(datafixer);
EntityDragonFireball.registerFixesDragonFireball(datafixer);
EntityDragon.registerFixesDragon(datafixer);
EntityEnderman.registerFixesEnderman(datafixer);
EntityEndermite.registerFixesEndermite(datafixer);
EntityFallingBlock.registerFixesFallingBlock(datafixer);
EntityLargeFireball.registerFixesLargeFireball(datafixer);
EntityFireworkRocket.registerFixesFireworkRocket(datafixer);
EntityGhast.registerFixesGhast(datafixer);
EntityGiantZombie.registerFixesGiantZombie(datafixer);
EntityGuardian.registerFixesGuardian(datafixer);
EntityHorse.registerFixesHorse(datafixer);
EntityItem.registerFixesItem(datafixer);
EntityItemFrame.registerFixesItemFrame(datafixer);
EntityMagmaCube.registerFixesMagmaCube(datafixer);
EntityMinecartChest.registerFixesMinecartChest(datafixer);
EntityMinecartCommandBlock.registerFixesMinecartCommand(datafixer);
EntityMinecartFurnace.registerFixesMinecartFurnace(datafixer);
EntityMinecartHopper.registerFixesMinecartHopper(datafixer);
EntityMinecartEmpty.registerFixesMinecartEmpty(datafixer);
EntityMinecartMobSpawner.registerFixesMinecartMobSpawner(datafixer);
EntityMinecartTNT.registerFixesMinecartTNT(datafixer);
EntityLiving.registerFixesMob(datafixer);
EntityMob.registerFixesMonster(datafixer);
EntityMooshroom.registerFixesMooshroom(datafixer);
EntityOcelot.registerFixesOcelot(datafixer);
EntityPig.registerFixesPig(datafixer);
EntityPigZombie.registerFixesPigZombie(datafixer);
EntityRabbit.registerFixesRabbit(datafixer);
EntitySheep.registerFixesSheep(datafixer);
EntityShulker.registerFixesShulker(datafixer);
EntitySilverfish.registerFixesSilverfish(datafixer);
EntitySkeleton.registerFixesSkeleton(datafixer);
EntitySlime.registerFixesSlime(datafixer);
EntitySmallFireball.registerFixesSmallFireball(datafixer);
EntitySnowman.registerFixesSnowman(datafixer);
EntitySnowball.registerFixesSnowball(datafixer);
EntitySpectralArrow.registerFixesSpectralArrow(datafixer);
EntitySpider.registerFixesSpider(datafixer);
EntitySquid.registerFixesSquid(datafixer);
EntityEgg.registerFixesEgg(datafixer);
EntityEnderPearl.registerFixesEnderPearl(datafixer);
EntityExpBottle.registerFixesExpBottle(datafixer);
EntityPotion.registerFixesPotion(datafixer);
EntityTippedArrow.registerFixesTippedArrow(datafixer);
EntityVillager.registerFixesVillager(datafixer);
EntityIronGolem.registerFixesIronGolem(datafixer);
EntityWitch.registerFixesWitch(datafixer);
EntityWither.registerFixesWither(datafixer);
EntityWitherSkull.registerFixesWitherSkull(datafixer);
EntityWolf.registerFixesWolf(datafixer);
EntityZombie.registerFixesZombie(datafixer);
TileEntityPiston.registerFixesPiston(datafixer);
TileEntityFlowerPot.registerFixesFlowerPot(datafixer);
TileEntityFurnace.registerFixesFurnace(datafixer);
TileEntityChest.registerFixesChest(datafixer);
TileEntityDispenser.registerFixes(datafixer);
TileEntityDropper.registerFixesDropper(datafixer);
TileEntityBrewingStand.registerFixesBrewingStand(datafixer);
TileEntityHopper.registerFixesHopper(datafixer);
BlockJukebox.registerFixesJukebox(datafixer);
TileEntityMobSpawner.registerFixesMobSpawner(datafixer);
registerFixes(datafixer);
return datafixer;
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:80,代码来源:DataFixesManager.java
示例18: onMessage
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
@Override
public ResponseMessage onMessage(TileRequest message, MessageContext ctx)
{
World world = DimensionManager.getWorld(message.dim);
if (world == null) return null;
TileEntity te = world.getTileEntity(message.pos);
if (te == null) return null;
if (Helper.banned.contains(te.getClass().getCanonicalName())) return null;
if (te instanceof ILockableContainer && !ctx.getServerHandler().player.canOpen(((ILockableContainer) te).getLockCode())) return null;
if (te instanceof TileEntityEnderChest)
{
return new PlainInventory(message.pos, ctx.getServerHandler().player.getInventoryEnderChest());
}
else if (te instanceof BlockJukebox.TileEntityJukebox)
{
InventoryBasic ib = new InventoryBasic("minecraft:jukebox", false, 1);
ib.setInventorySlotContents(0, ((BlockJukebox.TileEntityJukebox) te).getRecord());
return new PlainInventory(message.pos, ib).setName(Blocks.JUKEBOX.getUnlocalizedName());
}
else if (te instanceof TileEntityChest)
{
Block b = world.getBlockState(message.pos).getBlock();
if (b instanceof BlockChest)
{
IInventory i = ((BlockChest) b).getLockableContainer(world, message.pos);
if (i != null) return new PlainInventory(message.pos, i);
return null;
}
return new PlainInventory(message.pos, ((TileEntityChest) te));
}
else if (te instanceof IInventory)
{
return new PlainInventory(message.pos, (IInventory) te);
}
else if (te.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null))
{
IItemHandler iih = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
if (iih == null)
{
HoloInventory.getLogger().warn("Error: Block at {} (Class: {} Te: {} Block: {}) returned null after indicating the capability is available.", message.pos, te.getClass().getName(), te, te.getBlockType());
return null;
}
return new PlainInventory(message.pos, te.getBlockType().getUnlocalizedName(), iih);
}
return null;
}
开发者ID:dries007,项目名称:HoloInventory,代码行数:50,代码来源:TileRequest.java
示例19: accept
import net.minecraft.block.BlockJukebox; //导入依赖的package包/类
public static boolean accept(TileEntity te)
{
return te != null && (te instanceof IInventory || te instanceof BlockJukebox.TileEntityJukebox || te instanceof TileEntityEnderChest || te.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null));
}
开发者ID:dries007,项目名称:HoloInventory,代码行数:5,代码来源:Helper.java
注:本文中的net.minecraft.block.BlockJukebox类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论