类org.bukkit.craftbukkit.util.CraftMagicNumbers源码实例Demo

下面列出了怎么用org.bukkit.craftbukkit.util.CraftMagicNumbers的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Kettle   文件: CraftItemStack.java
@Override
public void setTypeId(int type) {
    if (getTypeId() == type) {
        return;
    } else if (type == 0) {
        handle = null;
    } else if (CraftMagicNumbers.getItem(type) == null) { // :(
        handle = null;
    } else if (handle == null) {
        handle = new net.minecraft.item.ItemStack(CraftMagicNumbers.getItem(type), 1, 0);
    } else {
        handle.setItem(CraftMagicNumbers.getItem(type));
        if (hasItemMeta()) {
            // This will create the appropriate item meta, which will contain all the data we intend to keep
            setItemMeta(handle, getItemMeta(handle));
        }
    }
    setData(null);
}
 
源代码2 项目: Kettle   文件: CraftMetaBookSigned.java
CraftMetaBookSigned(NBTTagCompound tag) {
    super(tag, false);

    boolean resolved = true;
    if (tag.hasKey(RESOLVED.NBT)) {
        resolved = tag.getBoolean(RESOLVED.NBT);
    }

    if (tag.hasKey(BOOK_PAGES.NBT)) {
        NBTTagList pages = tag.getTagList(BOOK_PAGES.NBT, CraftMagicNumbers.NBT.TAG_STRING);

        for (int i = 0; i < Math.min(pages.tagCount(), MAX_PAGES); i++) {
            String page = pages.getStringTagAt(i);
            if (resolved) {
                try {
                    this.pages.add(ITextComponent.Serializer.jsonToComponent(page));
                    continue;
                } catch (Exception e) {
                    // Ignore and treat as an old book
                }
            }
            addPage(page);
        }
    }
}
 
源代码3 项目: Kettle   文件: CraftMetaItem.java
static Map<Enchantment, Integer> buildEnchantments(NBTTagCompound tag, ItemMetaKey key) {
    if (!tag.hasKey(key.NBT)) {
        return null;
    }

    NBTTagList ench = tag.getTagList(key.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND);
    Map<Enchantment, Integer> enchantments = new HashMap<Enchantment, Integer>(ench.tagCount());

    for (int i = 0; i < ench.tagCount(); i++) {
        int id = 0xffff & ((NBTTagCompound) ench.get(i)).getShort(ENCHANTMENTS_ID.NBT);
        int level = 0xffff & ((NBTTagCompound) ench.get(i)).getShort(ENCHANTMENTS_LVL.NBT);

        Enchantment enchant = Enchantment.getById(id);
        if (enchant != null) {
            enchantments.put(enchant, level);
        }
    }

    return enchantments;
}
 
源代码4 项目: Kettle   文件: CraftMetaBanner.java
CraftMetaBanner(NBTTagCompound tag) {
    super(tag);

    if (!tag.hasKey("BlockEntityTag")) {
        return;
    }

    NBTTagCompound entityTag = tag.getCompoundTag("BlockEntityTag");

    base = entityTag.hasKey(BASE.NBT) ? DyeColor.getByDyeData((byte) entityTag.getInteger(BASE.NBT)) : null;

    if (entityTag.hasKey(PATTERNS.NBT)) {
        NBTTagList patterns = entityTag.getTagList(PATTERNS.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND);
        for (int i = 0; i < Math.min(patterns.tagCount(), 20); i++) {
            NBTTagCompound p = patterns.getCompoundTagAt(i);
            this.patterns.add(new Pattern(DyeColor.getByDyeData((byte) p.getInteger(COLOR.NBT)), PatternType.getByIdentifier(p.getString(PATTERN.NBT))));
        }
    }
}
 
源代码5 项目: Kettle   文件: CraftMetaFirework.java
CraftMetaFirework(NBTTagCompound tag) {
    super(tag);

    if (!tag.hasKey(FIREWORKS.NBT)) {
        return;
    }

    NBTTagCompound fireworks = tag.getCompoundTag(FIREWORKS.NBT);

    power = 0xff & fireworks.getByte(FLIGHT.NBT);

    if (!fireworks.hasKey(EXPLOSIONS.NBT)) {
        return;
    }

    NBTTagList fireworkEffects = fireworks.getTagList(EXPLOSIONS.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND);
    List<FireworkEffect> effects = this.effects = new ArrayList<FireworkEffect>(fireworkEffects.tagCount());

    for (int i = 0; i < fireworkEffects.tagCount(); i++) {
        effects.add(getEffect((NBTTagCompound) fireworkEffects.get(i)));
    }
}
 
源代码6 项目: Kettle   文件: CraftStatistic.java
public static StatBase getMaterialStatistic(Statistic stat, Material material) {
    try {
        if (stat == Statistic.MINE_BLOCK) {
            return StatList.getBlockStats(CraftMagicNumbers.getBlock(material)); // PAIL: getMineBlockStatistic
        }
        if (stat == Statistic.CRAFT_ITEM) {
            return StatList.getCraftStats(CraftMagicNumbers.getItem(material)); // PAIL: getCraftItemStatistic
        }
        if (stat == Statistic.USE_ITEM) {
            return StatList.getObjectUseStats(CraftMagicNumbers.getItem(material)); // PAIL: getUseItemStatistic
        }
        if (stat == Statistic.BREAK_ITEM) {
            return StatList.getObjectBreakStats(CraftMagicNumbers.getItem(material)); // PAIL: getBreakItemStatistic
        }
        if (stat == Statistic.PICKUP) {
            return StatList.getObjectsPickedUpStats(CraftMagicNumbers.getItem(material)); // PAIL: getPickupStatistic
        }
        if (stat == Statistic.DROP) {
            return StatList.getDroppedObjectStats(CraftMagicNumbers.getItem(material)); // PAIL: getDropItemStatistic
        }
    } catch (ArrayIndexOutOfBoundsException e) {
        return null;
    }
    return null;
}
 
源代码7 项目: Kettle   文件: CraftEventFactory.java
private static PlayerEvent getPlayerBucketEvent(boolean isFilling, EntityPlayer who, int clickedX, int clickedY, int clickedZ, EnumFacing clickedFace, ItemStack itemstack, net.minecraft.item.Item item) {
    Player player = (who == null) ? null : (Player) who.getBukkitEntity();
    CraftItemStack itemInHand = CraftItemStack.asNewCraftStack(item);
    Material bucket = CraftMagicNumbers.getMaterial(itemstack.getItem());

    CraftWorld craftWorld = (CraftWorld) player.getWorld();
    CraftServer craftServer = (CraftServer) player.getServer();

    Block blockClicked = craftWorld.getBlockAt(clickedX, clickedY, clickedZ);
    BlockFace blockFace = CraftBlock.notchToBlockFace(clickedFace);

    PlayerEvent event = null;
    if (isFilling) {
        event = new PlayerBucketFillEvent(player, blockClicked, blockFace, bucket, itemInHand);
        ((PlayerBucketFillEvent) event).setCancelled(!canBuild(craftWorld, player, clickedX, clickedZ));
    } else {
        event = new PlayerBucketEmptyEvent(player, blockClicked, blockFace, bucket, itemInHand);
        ((PlayerBucketEmptyEvent) event).setCancelled(!canBuild(craftWorld, player, clickedX, clickedZ));
    }

    craftServer.getPluginManager().callEvent(event);

    return event;
}
 
源代码8 项目: Thermos   文件: CraftJukebox.java
@Override
public void setPlaying(Material record) {
    if (record == null || CraftMagicNumbers.getItem(record) == null) {
        record = Material.AIR;
        jukebox.func_145857_a(null);
    } else {
        jukebox.func_145857_a(new ItemStack(CraftMagicNumbers.getItem(record), 1));
    }
    jukebox.markDirty();
    if (record == Material.AIR) {
        world.getHandle().setBlockMetadataWithNotify(getX(), getY(), getZ(), 0, 3);
    } else {
        world.getHandle().setBlockMetadataWithNotify(getX(), getY(), getZ(), 1, 3);
    }
    world.playEffect(getLocation(), Effect.RECORD_PLAY, record.getId());
}
 
源代码9 项目: Thermos   文件: CraftItemStack.java
@Override
public void setTypeId(int type) {
    if (getTypeId() == type) {
        return;
    } else if (type == 0) {
        handle = null;
    } else if (CraftMagicNumbers.getItem(type) == null) { // :(
        handle = null;
    } else if (handle == null) {
        handle = new net.minecraft.item.ItemStack(CraftMagicNumbers.getItem(type), 1, 0);
    } else {
        handle.func_150996_a(CraftMagicNumbers.getItem(type));
        if (hasItemMeta()) {
            // This will create the appropriate item meta, which will contain all the data we intend to keep
            setItemMeta(handle, getItemMeta(handle));
        }
    }
    setData(null);
}
 
源代码10 项目: Thermos   文件: CraftShapedRecipe.java
public void addToCraftingManager() {
    Object[] data;
    String[] shape = this.getShape();
    Map<Character, ItemStack> ingred = this.getIngredientMap();
    int datalen = shape.length;
    datalen += ingred.size() * 2;
    int i = 0;
    data = new Object[datalen];
    for (; i < shape.length; i++) {
        data[i] = shape[i];
    }
    for (char c : ingred.keySet()) {
        ItemStack mdata = ingred.get(c);
        if (mdata == null) continue;
        data[i] = c;
        i++;
        int id = mdata.getTypeId();
        short dmg = mdata.getDurability();
        data[i] = new net.minecraft.item.ItemStack(CraftMagicNumbers.getItem(id), 1, dmg);
        i++;
    }
    net.minecraft.item.crafting.CraftingManager.getInstance().addRecipe(CraftItemStack.asNMSCopy(this.getResult()), data);
}
 
源代码11 项目: Kettle   文件: CraftMinecart.java
public void setDisplayBlock(MaterialData material) {
    if (material != null) {
        IBlockState block = CraftMagicNumbers.getBlock(material.getItemTypeId()).getStateFromMeta(material.getData());
        this.getHandle().setDisplayTile(block);
    } else {
        // Set block to air (default) and set the flag to not have a display block.
        this.getHandle().setDisplayTile(Blocks.AIR.getDefaultState());
        this.getHandle().setHasDisplayTile(false);
    }
}
 
源代码12 项目: Kettle   文件: CraftHumanEntity.java
@Override
public int getCooldown(Material material) {
    Preconditions.checkArgument(material != null, "material");

    CooldownTracker.Cooldown cooldown = getHandle().getCooldownTracker().cooldowns.get(CraftMagicNumbers.getItem(material));
    return (cooldown == null) ? 0 : Math.max(0, cooldown.expireTicks - getHandle().getCooldownTracker().ticks);
}
 
源代码13 项目: Kettle   文件: CraftHumanEntity.java
@Override
public void setCooldown(Material material, int ticks) {
    Preconditions.checkArgument(material != null, "material");
    Preconditions.checkArgument(ticks >= 0, "Cannot have negative cooldown");

    getHandle().getCooldownTracker().setCooldown(CraftMagicNumbers.getItem(material), ticks);
}
 
源代码14 项目: Kettle   文件: CraftPlayer.java
@Override
public void sendBlockChange(Location loc, int material, byte data) {
    if (getHandle().connection == null) return;

    SPacketBlockChange packet = new SPacketBlockChange(((CraftWorld) loc.getWorld()).getHandle(), new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));

    packet.blockState = CraftMagicNumbers.getBlock(material).getStateFromMeta(data);
    getHandle().connection.sendPacket(packet);
}
 
源代码15 项目: Kettle   文件: CraftWorld.java
public FallingBlock spawnFallingBlock(Location location, org.bukkit.Material material, byte data) throws IllegalArgumentException {
    Validate.notNull(location, "Location cannot be null");
    Validate.notNull(material, "Material cannot be null");
    Validate.isTrue(material.isBlock(), "Material must be a block");

    EntityFallingBlock entity = new EntityFallingBlock(world, location.getX(), location.getY(), location.getZ(), CraftMagicNumbers.getBlock(material).getStateFromMeta(data));
    entity.ticksExisted = 1;

    world.spawnEntity(entity, SpawnReason.CUSTOM);
    return (FallingBlock) entity.getBukkitEntity();
}
 
源代码16 项目: Kettle   文件: CraftBlock.java
public Collection<ItemStack> getDrops() {
    List<ItemStack> drops = new ArrayList<ItemStack>();

    net.minecraft.block.Block block = this.getNMSBlock();
    if (block != Blocks.AIR) {
        IBlockState data = getData0();
        // based on nms.Block.dropNaturally
        int count = block.quantityDroppedWithBonus(0, chunk.getHandle().getWorld().rand);
        for (int i = 0; i < count; ++i) {
            Item item = block.getItemDropped(data, chunk.getHandle().getWorld().rand, 0);
            if (item != Items.AIR) {
                // Skulls are special, their data is based on the tile entity
                if (Blocks.SKULL == block) {
                    net.minecraft.item.ItemStack nmsStack = new net.minecraft.item.ItemStack(item, 1, block.damageDropped(data));
                    TileEntitySkull tileentityskull = (TileEntitySkull) chunk.getHandle().getWorld().getTileEntity(new BlockPos(x, y, z));

                    if (tileentityskull.getSkullType() == 3 && tileentityskull.getPlayerProfile() != null) {
                        nmsStack.setTagCompound(new NBTTagCompound());
                        NBTTagCompound nbttagcompound = new NBTTagCompound();

                        NBTUtil.writeGameProfile(nbttagcompound, tileentityskull.getPlayerProfile());
                        nmsStack.getTagCompound().setTag("SkullOwner", nbttagcompound);
                    }

                    drops.add(CraftItemStack.asBukkitCopy(nmsStack));
                    // We don't want to drop cocoa blocks, we want to drop cocoa beans.
                } else if (Blocks.COCOA == block) {
                    int age = (Integer) data.getValue(BlockCocoa.AGE);
                    int dropAmount = (age >= 2 ? 3 : 1);
                    for (int j = 0; j < dropAmount; ++j) {
                        drops.add(new ItemStack(Material.INK_SACK, 1, (short) 3));
                    }
                } else {
                    drops.add(new ItemStack(CraftMagicNumbers.getMaterial(item), 1, (short) block.damageDropped(data)));
                }
            }
        }
    }
    return drops;
}
 
源代码17 项目: Kettle   文件: CraftJukebox.java
@Override
public Material getPlaying() {
    ItemStack record = this.getSnapshot().getRecord();
    if (record.isEmpty()) {
        return Material.AIR;
    }
    return CraftMagicNumbers.getMaterial(record.getItem());
}
 
源代码18 项目: Kettle   文件: CraftJukebox.java
@Override
public void setPlaying(Material record) {
    if (record == null || CraftMagicNumbers.getItem(record) == null) {
        record = Material.AIR;
    }

    this.getSnapshot().setRecord(new ItemStack(CraftMagicNumbers.getItem(record), 1));
    if (record == Material.AIR) {
        setRawData((byte) 0);
    } else {
        setRawData((byte) 1);
    }
}
 
源代码19 项目: Kettle   文件: CraftBlockState.java
public boolean update(boolean force, boolean applyPhysics) {
    if (!isPlaced()) {
        return true;
    }
    Block block = getBlock();

    if (block.getType() != getType()) {
        if (!force) {
            return false;
        }
    }

    BlockPos pos = new BlockPos(x, y, z);
    IBlockState newBlock = CraftMagicNumbers.getBlock(getType()).getStateFromMeta(this.getRawData());
    block.setTypeIdAndData(getTypeId(), getRawData(), applyPhysics);
    world.getHandle().notifyBlockUpdate(
            pos,
            CraftMagicNumbers.getBlock(block).getStateFromMeta(block.getData()),
            newBlock,
            3
    );

    // Update levers etc
    if (applyPhysics && getData() instanceof Attachable) {
        world.getHandle().notifyNeighborsOfStateChange(pos.offset(CraftBlock.blockFaceToNotch(((Attachable) getData()).getAttachedFace())), newBlock.getBlock(), false);
    }

    if (nbt != null) {
        TileEntity te = world.getHandle().getTileEntity(new BlockPos(this.x, this.y, this.z));
        if (te != null) {
            te.readFromNBT(nbt);
        }
    }
    return true;
}
 
源代码20 项目: Kettle   文件: CraftNoteBlock.java
@Override
public boolean play(byte instrument, byte note) {
    Block block = getBlock();

    if (block.getType() == Material.NOTE_BLOCK) {
        CraftWorld world = (CraftWorld) this.getWorld();
        world.getHandle().addBlockEvent(new BlockPos(getX(), getY(), getZ()), CraftMagicNumbers.getBlock(block), instrument, note);
        return true;
    } else {
        return false;
    }
}
 
源代码21 项目: Kettle   文件: CraftNoteBlock.java
@Override
public boolean play(Instrument instrument, Note note) {
    Block block = getBlock();

    if (block.getType() == Material.NOTE_BLOCK) {
        CraftWorld world = (CraftWorld) this.getWorld();
        world.getHandle().addBlockEvent(new BlockPos(getX(), getY(), getZ()), CraftMagicNumbers.getBlock(block), instrument.getType(), note.getId());
        return true;
    } else {
        return false;
    }
}
 
源代码22 项目: Kettle   文件: CraftMetaBook.java
CraftMetaBook(NBTTagCompound tag, boolean handlePages) {
    super(tag);

    if (tag.hasKey(BOOK_TITLE.NBT)) {
        this.title = tag.getString(BOOK_TITLE.NBT);
    }

    if (tag.hasKey(BOOK_AUTHOR.NBT)) {
        this.author = tag.getString(BOOK_AUTHOR.NBT);
    }

    boolean resolved = false;
    if (tag.hasKey(RESOLVED.NBT)) {
        resolved = tag.getBoolean(RESOLVED.NBT);
    }

    if (tag.hasKey(GENERATION.NBT)) {
        generation = tag.getInteger(GENERATION.NBT);
    }

    if (tag.hasKey(BOOK_PAGES.NBT) && handlePages) {
        NBTTagList pages = tag.getTagList(BOOK_PAGES.NBT, CraftMagicNumbers.NBT.TAG_STRING);

        for (int i = 0; i < Math.min(pages.tagCount(), MAX_PAGES); i++) {
            String page = pages.getStringTagAt(i);
            if (resolved) {
                try {
                    this.pages.add(ITextComponent.Serializer.jsonToComponent(page));
                    continue;
                } catch (Exception e) {
                    // Ignore and treat as an old book
                }
            }
            addPage(page);
        }
    }
}
 
源代码23 项目: Kettle   文件: CraftMetaBlockState.java
CraftMetaBlockState(NBTTagCompound tag, Material material) {
    super(tag);
    this.material = material;

    if (tag.hasKey(BLOCK_ENTITY_TAG.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) {
        blockEntityTag = tag.getCompoundTag(BLOCK_ENTITY_TAG.NBT);
    } else {
        blockEntityTag = null;
    }
}
 
源代码24 项目: Kettle   文件: CraftEventFactory.java
public static boolean handleBlockFormEvent(World world, BlockPos pos, IBlockState block, @Nullable Entity entity) {
    BlockState blockState = world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()).getState();
    blockState.setType(CraftMagicNumbers.getMaterial(block.getBlock()));
    blockState.setRawData((byte) block.getBlock().getMetaFromState(block));

    BlockFormEvent event = (entity == null) ? new BlockFormEvent(blockState.getBlock(), blockState) : new EntityBlockFormEvent(entity.getBukkitEntity(), blockState.getBlock(), blockState);
    world.getServer().getPluginManager().callEvent(event);

    if (!event.isCancelled()) {
        blockState.update(true);
    }

    return !event.isCancelled();
}
 
源代码25 项目: ProjectAres   文件: NMSHacks.java
public static void playBlockPlaceSound(World bukkitWorld, Vector pos, Material material, float volume) {
    if (!material.isBlock()) {
        return;
    }
    playCustomSound(bukkitWorld,
                    pos.toLocation(bukkitWorld),
                    CraftMagicNumbers.getBlock(material).getStepSound().placeSound(),
                    SoundCategory.BLOCKS,
                    volume,
                    1f);
}
 
源代码26 项目: ProjectAres   文件: NMSHacks.java
/**
 * Test if the given tool is capable of "efficiently" mining the given block.
 *
 * Derived from CraftBlock.itemCausesDrops()
 */
public static boolean canMineBlock(MaterialData blockMaterial, org.bukkit.inventory.ItemStack tool) {
    if(!blockMaterial.getItemType().isBlock()) {
        throw new IllegalArgumentException("Material '" + blockMaterial + "' is not a block");
    }

    net.minecraft.server.Block nmsBlock = CraftMagicNumbers.getBlock(blockMaterial.getItemType());
    net.minecraft.server.Item nmsTool = tool == null ? null : CraftMagicNumbers.getItem(tool.getType());

    return nmsBlock != null && (nmsBlock.getBlockData().getMaterial().isAlwaysDestroyable() ||
                                (nmsTool != null && nmsTool.canDestroySpecialBlock(nmsBlock.getBlockData())));
}
 
源代码27 项目: ProjectAres   文件: NMSHacks.java
public static Set<MaterialData> getBlockStates(Material material) {
    ImmutableSet.Builder<MaterialData> materials = ImmutableSet.builder();
    Block nmsBlock = CraftMagicNumbers.getBlock(material);
    List<IBlockData> states = nmsBlock.s().a();
    if(states != null) {
        for(IBlockData state : states) {
            int data = nmsBlock.toLegacyData(state);
            materials.add(material.getNewData((byte) data));
        }
    }
    return materials.build();
}
 
源代码28 项目: Thermos   文件: CraftPlayer.java
@Override
public void sendBlockChange(Location loc, int material, byte data) {
    if (getHandle().playerNetServerHandler == null) return;

    S23PacketBlockChange packet = new S23PacketBlockChange(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), ((CraftWorld) loc.getWorld()).getHandle());

    packet.field_148883_d = CraftMagicNumbers.getBlock(material);
    packet.field_148884_e = data;
    getHandle().playerNetServerHandler.sendPacket(packet);
}
 
源代码29 项目: Thermos   文件: CraftBlock.java
public Collection<ItemStack> getDrops() {
    List<ItemStack> drops = new ArrayList<ItemStack>();

    net.minecraft.block.Block block = this.getNMSBlock();
    if (block != Blocks.air) {
        byte data = getData();
        // based on nms.Block.dropNaturally
        int count = block.quantityDroppedWithBonus(0, chunk.getHandle().worldObj.rand);
        for (int i = 0; i < count; ++i) {
            Item item = block.getItemDropped(data, chunk.getHandle().worldObj.rand, 0);
            if (item != null) {
                // Skulls are special, their data is based on the tile entity
                if (Blocks.skull == block) {
                    net.minecraft.item.ItemStack nmsStack = new net.minecraft.item.ItemStack(item, 1, block.getDamageValue(chunk.getHandle().worldObj, x, y, z));
                    TileEntitySkull tileentityskull = (TileEntitySkull) chunk.getHandle().worldObj.getTileEntity(x, y, z);

                    if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null) {
                        nmsStack.setTagCompound(new NBTTagCompound());
                        NBTTagCompound nbttagcompound = new NBTTagCompound();

                        NBTUtil.func_152460_a(nbttagcompound, tileentityskull.func_152108_a());
                        nmsStack.getTagCompound().setTag("SkullOwner", nbttagcompound);
                    }

                    drops.add(CraftItemStack.asBukkitCopy(nmsStack));
                    // We don't want to drop cocoa blocks, we want to drop cocoa beans.
                } else if (Blocks.cocoa == block) {
                    int dropAmount = (BlockCocoa.func_149987_c(data) >= 2 ? 3 : 1);
                    for (int j = 0; j < dropAmount; ++j) {
                        drops.add(new ItemStack(Material.INK_SACK, 1, (short) 3));
                    }
                } else {
                    drops.add(new ItemStack(org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(item), 1, (short) block.damageDropped(data)));
                }
            }
        }
    }
    return drops;
}
 
源代码30 项目: Thermos   文件: CraftJukebox.java
@Override
public Material getPlaying() {
    ItemStack record = jukebox.func_145856_a();
    if (record == null) {
        return Material.AIR;
    }
    return CraftMagicNumbers.getMaterial(record.getItem());
}
 
 类所在包
 同包方法