本文整理汇总了Java中org.bukkit.Material.INK_SACK属性的典型用法代码示例。如果您正苦于以下问题:Java Material.INK_SACK属性的具体用法?Java Material.INK_SACK怎么用?Java Material.INK_SACK使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.INK_SACK属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBlockRegister
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockRegister(BlockPlaceEvent e) {
if (BlockStorage.hasBlockInfo(e.getBlock())) {
e.setCancelled(true);
return;
}
ItemStack item = e.getItemInHand();
if (item != null && item.getType() == Material.INK_SACK) return;
SlimefunItem sfItem = SlimefunItem.getByItem(item);
if (sfItem != null && !(sfItem instanceof NotPlaceable)){
BlockStorage.addBlockInfo(e.getBlock(), "id", sfItem.getID(), true);
if (SlimefunItem.blockhandler.containsKey(sfItem.getID())) {
SlimefunItem.blockhandler.get(sfItem.getID()).onPlace(e.getPlayer(), e.getBlock(), sfItem);
}
}
else {
for (ItemHandler handler: SlimefunItem.getHandlers("BlockPlaceHandler")) {
if (((BlockPlaceHandler) handler).onBlockPlace(e, item)) break;
}
}
}
示例2: onGameStart
/**
* Give 128 bookshelves, thousands of xp levels, 64 tables and 64 anvils to all the players
*
* @param game Game
*/
@Override
public void onGameStart(SurvivalGame game)
{
ItemStack tables = new ItemStack(Material.ENCHANTMENT_TABLE, 64);
ItemStack anvils = new ItemStack(Material.ANVIL, 64);
ItemStack bookshelves = new ItemStack(Material.BOOKSHELF, 64);
ItemStack lapis = new ItemStack(Material.INK_SACK, 64, (short)4);
for (GamePlayer player : (Collection<GamePlayer>) game.getInGamePlayers().values())
{
Player p = player.getPlayerIfOnline();
if (p == null)
continue;
p.getInventory().addItem(tables);
p.getInventory().addItem(anvils);
p.getInventory().addItem(bookshelves);
p.getInventory().addItem(lapis);
p.setLevel(111111);
}
}
示例3: onInteract
@SuppressWarnings("deprecation")
@Override
public void onInteract(PlayerInteractEvent e, Entity en) {
ElevatorInstance ei = ((ElevatorInstance) CustomBlockInstance.getBlockInstance((ArmorStand) en));
if (e.getItem() != null && e.getItem().getType() == Material.INK_SACK) {
ei.setColor(ei.getColor().mixColors(DyeColor.getByDyeData(e.getItem().getData().getData()).getFireworkColor()));
}
}
示例4: explode
private void explode(Creeper creeper)
{
this.lovingTask.cancel();
Location flowerSpawnLocation = creeper.getLocation().clone().add(0.0D, 1.5D, 0.0D);
for (int i = 0; i < 64; i++)
{
ItemStack redDye = new ItemStack(Material.INK_SACK, 1, (short) 1);
Item item = this.player.getWorld().dropItemNaturally(flowerSpawnLocation, redDye);
item.setVelocity(new Vector(GadgetManager.RANDOM.nextInt(2) - 1, 1.5, GadgetManager.RANDOM.nextInt(2) - 1));
try
{
GadgetManager.AGE_FIELD.set((((CraftItem) item).getHandle()), 5500);
}
catch (IllegalAccessException e)
{
e.printStackTrace();
}
}
creeper.getWorld().strikeLightningEffect(creeper.getLocation());
creeper.getWorld().createExplosion(creeper.getLocation().getX(), (creeper.getLocation().getY() + 2.0D), creeper.getLocation().getZ(), 2.5F, false, false);
creeper.remove();
HeartEffect heartEffect = new HeartEffect(this.hub.getCosmeticManager().getParticleManager().getEffectManager());
heartEffect.particle = de.slikey.effectlib.util.ParticleEffect.HEART;
heartEffect.setLocation(flowerSpawnLocation.clone().add(0.0D, 1.5D, 0.0D));
heartEffect.start();
this.end();
}
示例5: PopeyeModule
/**
* Constructor
*
* @param plugin Parent plugin
* @param api API instance
* @param moduleConfiguration Module configuration
*/
public PopeyeModule(SurvivalPlugin plugin, SurvivalAPI api, Map<String, Object> moduleConfiguration)
{
super(plugin, api, moduleConfiguration);
Validate.notNull(moduleConfiguration, "Configuration cannot be null!");
this.bonusTime = (int) moduleConfiguration.get("bonus-time");
this.spinash = new ItemStack(Material.INK_SACK, 1, (short) 2);
ItemMeta meta = this.spinash.getItemMeta();
meta.setLore(Arrays.asList("Mangez les et gagnez de la force pour " + this.bonusTime + " secondes."));
meta.setDisplayName(ChatColor.DARK_GREEN + "Epinards");
this.spinash.setItemMeta(meta);
}
示例6: CocoaEffectsModule
/**
* Constructor
*
* @param plugin Parent plugin
* @param api API instance
* @param moduleConfiguration Module configuration
*/
public CocoaEffectsModule(SurvivalPlugin plugin, SurvivalAPI api, Map<String, Object> moduleConfiguration)
{
super(plugin, api, moduleConfiguration);
Validate.notNull(moduleConfiguration, "Configuration cannot be null!");
this.bonusTime = (int) moduleConfiguration.get("bonus-time");
this.penaltyTime = (int) moduleConfiguration.get("penalty-time");
this.cocoa = new ItemStack(Material.INK_SACK, 5, (short) 3);
ItemMeta meta = this.cocoa.getItemMeta();
meta.setLore(Arrays.asList(ChatColor.GRAY + "Chaque utilisation vous donne " + this.bonusTime + " secondes", ChatColor.GRAY + " de force et vitesse améliorées", ChatColor.GRAY + " mais les effets contraires par la suite", ChatColor.GRAY + " pendant " + this.penaltyTime + " secondes."));
meta.setDisplayName(ChatColor.AQUA + "Coco");
this.cocoa.setItemMeta(meta);
}
示例7: ItemToggle
public ItemToggle(String name, String desc, boolean enabled, DyeColor enabledColor) {
super(new ItemStack(Material.INK_SACK));
this.toggled = enabled;
this.trueColor = enabledColor;
this.toggleName = name;
this.description = desc;
anyClick(e -> {
toggle();
e.getGUI().reconstruct();
});
}
示例8: onUseBonemeal
@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onUseBonemeal(PlayerInteractEvent e) {
if (cm.isAntiBonemealDupe && e.getAction() == Action.RIGHT_CLICK_BLOCK && VersionUtils.isLowerThan(VersionUtils.V1_8)) {
if (e.getItem() == null || e.getItem().getType() != Material.INK_SACK) {
return;
}
if (cm.antiBonemealBlackList.contains(e.getClickedBlock().getTypeId())) {
e.setCancelled(true);
}
}
}