本文整理汇总了Java中me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull类的典型用法代码示例。如果您正苦于以下问题:Java CustomSkull类的具体用法?Java CustomSkull怎么用?Java CustomSkull使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CustomSkull类属于me.mrCookieSlime.CSCoreLibPlugin.general.World包,在下文中一共展示了CustomSkull类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: move
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
private void move(Block b, BlockFace face, Block block)
throws Exception
{
if(block.getY() < 0 || block.getY() > block.getWorld().getMaxHeight())
return;
if(block.getType() == Material.AIR)
{
block.setType(Material.SKULL);
block.setData((byte)1);
Skull skull = (Skull)block.getState();
skull.setRotation(face);
skull.update(true, false);
CustomSkull.setSkull(block, CustomSkull.getTexture(getItem()));
b.setType(Material.AIR);
BlockStorage.moveBlockInfo(b, block);
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:18,代码来源:ProgrammableAndroid.java
示例2: getItem
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
/**
* Returns the ItemStack at the specified Path
*
* @param path The path in the Config File
* @return The ItemStack at that Path
*/
public ItemStack getItem(String path) {
ItemStack item = config.getItemStack(path);
if (item == null) return null;
try {
if (item.hasItemMeta() && item.getItemMeta() instanceof SkullMeta) {
if (config.contains(path + "_extra.custom-skull")) item = CustomSkull.getItem((ItemStack) item, config.getString(path + "_extra.custom-skull"));
if (config.contains(path + "_extra.custom-skullOwner") && !((ItemStack) item).getItemMeta().hasDisplayName()) {
ItemMeta im = ((ItemStack) item).getItemMeta();
im.setDisplayName("�r" + config.getString(path + "_extra.custom-skullOwner") + "'s Head");
((ItemStack) item).setItemMeta(im);
}
}
else {
config.set(path + "_extra.custom-skull", null);
config.set(path + "_extra.custom-skullOwner", null);
}
} catch (Exception e) {
e.printStackTrace();
}
return item;
}
开发者ID:TheBusyBiscuit,项目名称:CS-CoreLib,代码行数:28,代码来源:Config.java
示例3: updateTexture
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
private static void updateTexture(final Location l) throws Exception {
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
@Override
public void run() {
try {
Block b = l.getBlock();
int charge = getCharge(b), capacity = getMaxCharge(b);
if (b.getState() instanceof Skull) {
if (charge < (int) (capacity * 0.25D)) CustomSkull.setSkull(b, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTEzNjFlNTc2YjQ5M2NiZmRmYWUzMjg2NjFjZWRkMWFkZDU1ZmFiNGU1ZWI0MThiOTJjZWJmNjI3NWY4YmI0In19fQ==");
else if (charge < (int) (capacity * 0.5D)) CustomSkull.setSkull(b, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzA1MzIzMzk0YTdkOTFiZmIzM2RmMDZkOTJiNjNjYjQxNGVmODBmMDU0ZDA0NzM0ZWEwMTVhMjNjNTM5In19fQ==");
else if (charge < (int) (capacity * 0.75D)) CustomSkull.setSkull(b, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTU4NDQzMmFmNmYzODIxNjcxMjAyNThkMWVlZThjODdjNmU3NWQ5ZTQ3OWU3YjBkNGM3YjZhZDQ4Y2ZlZWYifX19");
else CustomSkull.setSkull(b, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2EyNTY5NDE1YzE0ZTMxYzk4ZWM5OTNhMmY5OWU2ZDY0ODQ2ZGIzNjdhMTNiMTk5OTY1YWQ5OWM0MzhjODZjIn19fQ==");
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
开发者ID:TheBusyBiscuit,项目名称:Slimefun4,代码行数:21,代码来源:ChargableBlock.java
示例4: move
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private void move(Block b, BlockFace face, Block block) throws Exception {
if (block.getY() < 0 || block.getY() > block.getWorld().getMaxHeight()) return;
if (block.getType() == Material.AIR) {
block.setType(Material.SKULL);
block.setData((byte) 1);
Skull skull = (Skull) block.getState();
skull.setRotation(face);
skull.update(true, false);
CustomSkull.setSkull(block, CustomSkull.getTexture(getItem()));
b.setType(Material.AIR);
BlockStorage.moveBlockInfo(b, block);
}
}
开发者ID:TheBusyBiscuit,项目名称:Slimefun4,代码行数:17,代码来源:ProgrammableAndroid.java
示例5: getPlanet
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
public static ItemStack getPlanet(java.util.Map.Entry entry)
throws Exception
{
Location l = (Location)entry.getValue();
if(((String)entry.getKey()).startsWith("&4死亡记录点"))
return CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWFlMzg1NWY5NTJjZDRhMDNjMTQ4YTk0NmUzZjgxMmE1OTU1YWQzNWNiY2I1MjYyN2VhNGFjZDQ3ZDMwODEifX19");
if(l.getWorld().getEnvironment().equals(org.bukkit.World.Environment.NETHER))
return CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDgzNTcxZmY1ODlmMWE1OWJiMDJiODA4MDBmYzczNjExNmUyN2MzZGNmOWVmZWJlZGU4Y2YxZmRkZSJ9fX0=");
if(l.getWorld().getEnvironment().equals(org.bukkit.World.Environment.THE_END))
return CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzZjYWM1OWIyYWFlNDg5YWEwNjg3YjVkODAyYjI1NTVlYjE0YTQwYmQ2MmIyMWViMTE2ZmE1NjljZGI3NTYifX19");
else
return CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzljODg4MWU0MjkxNWE5ZDI5YmI2MWExNmZiMjZkMDU5OTEzMjA0ZDI2NWRmNWI0MzliM2Q3OTJhY2Q1NiJ9fX0=");
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:14,代码来源:GPSNetwork.java
示例6: updateTexture
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
private static void updateTexture(final Location l)
throws Exception
{
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
private final Location val$l;
public void run()
{
try
{
Block b = l.getBlock();
int charge = ChargableBlock.getCharge(b);
int capacity = ChargableBlock.getMaxCharge(b);
if(b.getState() instanceof Skull)
if(charge < (int)((double)capacity * 0.25D))
CustomSkull.setSkull(b, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTEzNjFlNTc2YjQ5M2NiZmRmYWUzMjg2NjFjZWRkMWFkZDU1ZmFiNGU1ZWI0MThiOTJjZWJmNjI3NWY4YmI0In19fQ==");
else
if(charge < (int)((double)capacity * 0.5D))
CustomSkull.setSkull(b, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzA1MzIzMzk0YTdkOTFiZmIzM2RmMDZkOTJiNjNjYjQxNGVmODBmMDU0ZDA0NzM0ZWEwMTVhMjNjNTM5In19fQ==");
else
if(charge < (int)((double)capacity * 0.75D))
CustomSkull.setSkull(b, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTU4NDQzMmFmNmYzODIxNjcxMjAyNThkMWVlZThjODdjNmU3NWQ5ZTQ3OWU3YjBkNGM3YjZhZDQ4Y2ZlZWYifX19");
else
CustomSkull.setSkull(b, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2EyNTY5NDE1YzE0ZTMxYzk4ZWM5OTNhMmY5OWU2ZDY0ODQ2ZGIzNjdhMTNiMTk5OTY1YWQ5OWM0MzhjODZjIn19fQ==");
}
catch(Exception e)
{
e.printStackTrace();
}
}
{
l = location;
super();
}
}
);
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:41,代码来源:ChargableBlock.java
示例7: ScriptPart
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
private ScriptPart(String s, int i, AndroidType type, String name, String texture)
{
super(s, i);
try
{
this.type = type;
item = new CustomItem(CustomSkull.getItem(texture), name);
}
catch(Exception x)
{
x.printStackTrace();
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:14,代码来源:ScriptPart.java
示例8: movedig
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
private void movedig(Block b, BlockFace face, Block block)
{
Collection drops = block.getDrops();
if(!blockblacklist.contains(block.getType()) && !drops.isEmpty() && CSCoreLib.getLib().getProtectionManager().canBuild(UUID.fromString(BlockStorage.getBlockInfo(b, "owner")), block))
try
{
ItemStack items[] = (ItemStack[])drops.toArray(new ItemStack[drops.size()]);
if(fits(b, items))
{
pushItems(b, items);
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType());
block.setType(Material.SKULL);
block.setData((byte)1);
Skull skull = (Skull)block.getState();
skull.setRotation(face);
skull.update(true, false);
CustomSkull.setSkull(block, CustomSkull.getTexture(getItem()));
b.setType(Material.AIR);
BlockStorage.moveBlockInfo(b, block);
}
}
catch(Exception x)
{
x.printStackTrace();
}
else
try
{
move(b, face, block);
}
catch(Exception e)
{
e.printStackTrace();
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:36,代码来源:ProgrammableAndroid.java
示例9: getSkull
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
public static ItemStack getSkull(MaterialData material, String texture) {
try {
if (texture.equals("NO_SKULL_SPECIFIED")) return material.toItemStack(1);
return skullitems ? CustomSkull.getItem(texture): material.toItemStack(1);
} catch (Exception e) {
e.printStackTrace();
return material.toItemStack(1);
}
}
开发者ID:TheBusyBiscuit,项目名称:ExoticGarden,代码行数:10,代码来源:ExoticGarden.java
示例10: getPlanet
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
public static ItemStack getPlanet(Map.Entry<String, Location> entry) throws Exception {
Location l = entry.getValue();
if (entry.getKey().startsWith("&4Deathpoint")) {
return CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWFlMzg1NWY5NTJjZDRhMDNjMTQ4YTk0NmUzZjgxMmE1OTU1YWQzNWNiY2I1MjYyN2VhNGFjZDQ3ZDMwODEifX19");
}
else if (l.getWorld().getEnvironment().equals(Environment.NETHER)) {
return CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDgzNTcxZmY1ODlmMWE1OWJiMDJiODA4MDBmYzczNjExNmUyN2MzZGNmOWVmZWJlZGU4Y2YxZmRkZSJ9fX0=");
}
else if (l.getWorld().getEnvironment().equals(Environment.THE_END)) {
return CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzZjYWM1OWIyYWFlNDg5YWEwNjg3YjVkODAyYjI1NTVlYjE0YTQwYmQ2MmIyMWViMTE2ZmE1NjljZGI3NTYifX19");
}
else {
return CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzljODg4MWU0MjkxNWE5ZDI5YmI2MWExNmZiMjZkMDU5OTEzMjA0ZDI2NWRmNWI0MzliM2Q3OTJhY2Q1NiJ9fX0=");
}
}
开发者ID:TheBusyBiscuit,项目名称:Slimefun4,代码行数:16,代码来源:GPSNetwork.java
示例11: debug
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler
public void debug(PlayerInteractEvent e) {
if (e.getAction().equals(Action.PHYSICAL) || !e.getHand().equals(EquipmentSlot.HAND)) return;
Player p = e.getPlayer();
if (SlimefunManager.isItemSimiliar(e.getPlayer().getInventory().getItemInMainHand(), SlimefunItems.DEBUG_FISH, true) || SlimefunManager.isItemSimiliar(e.getPlayer().getInventory().getItemInOffHand(), SlimefunItems.DEBUG_FISH, true)) {
e.setCancelled(true);
if (p.isOp()) {
switch (e.getAction()) {
case LEFT_CLICK_BLOCK: {
if (p.isSneaking()) {
if (BlockStorage.hasBlockInfo(e.getClickedBlock())) {
BlockStorage.clearBlockInfo(e.getClickedBlock());
}
}
else e.setCancelled(false);
break;
}
case RIGHT_CLICK_BLOCK: {
if (p.isSneaking()) {
Block b = e.getClickedBlock().getRelative(e.getBlockFace());
b.setType(Material.SKULL);
try {
CustomSkull.setSkull(b, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTllYjlkYTI2Y2YyZDMzNDEzOTdhN2Y0OTEzYmEzZDM3ZDFhZDEwZWFlMzBhYjI1ZmEzOWNlYjg0YmMifX19");
} catch (Exception e1) {
e1.printStackTrace();
}
}
else if (BlockStorage.hasBlockInfo(e.getClickedBlock())) {
p.sendMessage(" ");
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&d" + e.getClickedBlock().getType() + ":" + e.getClickedBlock().getData() + " &[email protected] X: " + e.getClickedBlock().getX() + " Y: " + e.getClickedBlock().getY() + " Z: " + e.getClickedBlock().getZ()));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dID: " + "&e" + BlockStorage.checkID(e.getClickedBlock())));
if (e.getClickedBlock().getState() instanceof Skull) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dSkull: " + "&2\u2714"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dRotation: &e" + ((Skull) e.getClickedBlock().getState()).getRotation().toString()));
}
if (BlockStorage.getStorage(e.getClickedBlock().getWorld()).hasInventory(e.getClickedBlock().getLocation())) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dInventory: " + "&2\u2714"));
}
else {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dInventory: " + "&4\u2718"));
}
if (BlockStorage.check(e.getClickedBlock()).isTicking()) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + "&2\u2714"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dAsync: &e" + (BlockStorage.check(e.getClickedBlock()).getTicker().isSynchronized() ? "&4\u2718": "&2\u2714")));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dTimings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock()) + "ms"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dTotal Timings: &e" + SlimefunStartup.ticker.getTimings(BlockStorage.checkID(e.getClickedBlock())) + "ms"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dChunk Timings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock().getChunk()) + "ms"));
}
else if (BlockStorage.check(e.getClickedBlock()).getEnergyTicker() != null) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + "&b~ &3(Indirect)"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dTimings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock()) + "ms"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dChunk Timings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock().getChunk()) + "ms"));
}
else {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + "&4\u2718"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&',"&dTicking: " + "&4\u2718"));
}
if (ChargableBlock.isChargable(e.getClickedBlock())) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dChargable: " + "&2\u2714"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dEnergy: &e" + ChargableBlock.getCharge(e.getClickedBlock()) + " / " + ChargableBlock.getMaxCharge(e.getClickedBlock())));
}
else {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dChargable: " + "&4\u2718"));
}
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&6" + BlockStorage.getBlockInfoAsJson(e.getClickedBlock())));
p.sendMessage(" ");
}
break;
}
default:
break;
}
}
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:78,代码来源:ItemListener.java
示例12: setValue
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
/**
* Sets the Value for the specified Path
*
* @param path The path in the Config File
* @param value The Value for that Path
*/
public void setValue(String path, Object value) {
if (value == null) {
config.set(path, value);
config.set(path + "_extra", null);
}
else if (value instanceof Inventory) {
for (int i = 0; i < ((Inventory) value).getSize(); i++) {
setValue(path + "." + i, ((Inventory) value).getItem(i));
}
}
else if (value instanceof Date) {
config.set(path, String.valueOf(((Date) value).getTime()));
}
else if (value instanceof Long) {
config.set(path, String.valueOf(value));
}
else if (value instanceof UUID) {
config.set(path, value.toString());
}
else if (value instanceof Sound) {
config.set(path, String.valueOf(value));
}
else if (value instanceof ItemStack) {
config.set(path, new ItemStack((ItemStack) value));
try {
if (((ItemStack) value).hasItemMeta() && ((ItemStack) value).getItemMeta() instanceof SkullMeta) {
config.set(path + "_extra.custom-skull", CustomSkull.getTexture((ItemStack) value));
config.set(path + "_extra.custom-skullOwner", CustomSkull.getName((ItemStack) value));
}
} catch (Exception e) {
e.printStackTrace();
}
}
else if (value instanceof Location) {
setValue(path + ".x", ((Location) value).getX());
setValue(path + ".y", ((Location) value).getY());
setValue(path + ".z", ((Location) value).getZ());
setValue(path + ".pitch", ((Location) value).getPitch());
setValue(path + ".yaw", ((Location) value).getYaw());
setValue(path + ".world", ((Location) value).getWorld().getName());
}
else if (value instanceof Chunk) {
setValue(path + ".x", ((Chunk) value).getX());
setValue(path + ".z", ((Chunk) value).getZ());
setValue(path + ".world", ((Chunk) value).getWorld().getName());
}
else if (value instanceof World) {
config.set(path, ((World) value).getName());
}
else config.set(path, value);
}
开发者ID:TheBusyBiscuit,项目名称:CS-CoreLib,代码行数:58,代码来源:Config.java
示例13: equipEntity
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
public static void equipEntity(Entity n) {
if (!(n instanceof LivingEntity)) return;
LivingEntity entity = (LivingEntity) n;
entity.getEquipment().setHelmet(null);
entity.getEquipment().setChestplate(null);
entity.getEquipment().setLeggings(null);
entity.getEquipment().setBoots(null);
Calendar calendar = Calendar.getInstance();
if (CSCoreLib.randomizer().nextInt(100) < 30 && calendar.get(Calendar.MONTH) == 11 && calendar.get(Calendar.DAY_OF_MONTH) < 26 && calendar.get(Calendar.DAY_OF_MONTH) > 21) {
entity.getEquipment().setHelmetDropChance(0.2F);
entity.getEquipment().setChestplateDropChance(0F);
entity.getEquipment().setLeggingsDropChance(0F);
entity.getEquipment().setBootsDropChance(0F);
entity.getEquipment().setItemInHandDropChance(0.7F);
try {
entity.getEquipment().setHelmet(new CustomItem(CustomSkull.getItem("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2JjYmIzZTRhMzhhYzJhMDVmNjk1NWNkMmM5ODk1YWQ5ZjI4NGM2ZTgyZTc1NWM5NGM1NDljNWJkYzg1MyJ9fX0="), "�4Santa's Head", "", "�rDid you just kill Santa?"));
} catch (Exception e) {
e.printStackTrace();
}
entity.getEquipment().setItemInHand(applyTier(createItem(LootType.TOOL), LootTier.LEGENDARY));
}
else {
entity.getEquipment().setHelmetDropChance(0.7F);
entity.getEquipment().setChestplateDropChance(0.7F);
entity.getEquipment().setLeggingsDropChance(0.7F);
entity.getEquipment().setBootsDropChance(0.7F);
entity.getEquipment().setItemInHandDropChance(0.7F);
for (int i = 0; i < CSCoreLib.randomizer().nextInt(3); i++) {
ItemStack item = createItem(LootType.TOOL);
if (item.getType().toString().endsWith("_HELMET")) entity.getEquipment().setHelmet(item);
else if (item.getType().toString().endsWith("_CHESTPLATE")) entity.getEquipment().setChestplate(item);
else if (item.getType().toString().endsWith("_LEGGINGS")) entity.getEquipment().setLeggings(item);
else if (item.getType().toString().endsWith("_BOOTS")) entity.getEquipment().setBoots(item);
else entity.getEquipment().setItemInHand(item);
}
}
}
开发者ID:TheBusyBiscuit,项目名称:MagicLoot3,代码行数:42,代码来源:ItemManager.java
示例14: debug
import me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler
public void debug(PlayerInteractEvent e) {
if (e.getAction().equals(Action.PHYSICAL) || !e.getHand().equals(EquipmentSlot.HAND)) return;
Player p = e.getPlayer();
if (SlimefunManager.isItemSimiliar(e.getPlayer().getInventory().getItemInMainHand(), SlimefunItems.DEBUG_FISH, true) || SlimefunManager.isItemSimiliar(e.getPlayer().getInventory().getItemInOffHand(), SlimefunItems.DEBUG_FISH, true)) {
e.setCancelled(true);
if (p.isOp()) {
switch (e.getAction()) {
case LEFT_CLICK_BLOCK: {
if (p.isSneaking()) {
if (BlockStorage.hasBlockInfo(e.getClickedBlock())) {
BlockStorage.clearBlockInfo(e.getClickedBlock());
}
}
else e.setCancelled(false);
break;
}
case RIGHT_CLICK_BLOCK: {
if (p.isSneaking()) {
Block b = e.getClickedBlock().getRelative(e.getBlockFace());
b.setType(Material.SKULL);
try {
CustomSkull.setSkull(b, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTllYjlkYTI2Y2YyZDMzNDEzOTdhN2Y0OTEzYmEzZDM3ZDFhZDEwZWFlMzBhYjI1ZmEzOWNlYjg0YmMifX19");
} catch (Exception e1) {
e1.printStackTrace();
}
}
else if (BlockStorage.hasBlockInfo(e.getClickedBlock())) {
p.sendMessage(" ");
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&d" + e.getClickedBlock().getType() + ":" + e.getClickedBlock().getData() + " &[email protected] X: " + e.getClickedBlock().getX() + " Y: " + e.getClickedBlock().getY() + " Z: " + e.getClickedBlock().getZ()));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dID: " + "&e" + BlockStorage.checkID(e.getClickedBlock())));
if (e.getClickedBlock().getState() instanceof Skull) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dSkull: " + "&2\u2714"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dRotation: &e" + ((Skull) e.getClickedBlock().getState()).getRotation().toString()));
}
if (BlockStorage.getStorage(e.getClickedBlock().getWorld()).hasInventory(e.getClickedBlock().getLocation())) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dInventory: " + "&2\u2714"));
}
else {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dInventory: " + "&4\u2718"));
}
if (BlockStorage.check(e.getClickedBlock()).isTicking()) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + "&2\u2714"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dAsync: &e" + (BlockStorage.check(e.getClickedBlock()).getTicker().isSynchronized() ? "&4\u2718": "&2\u2714")));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dTimings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock()) + "ms"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dTotal Timings: &e" + SlimefunStartup.ticker.getTimings(BlockStorage.checkID(e.getClickedBlock())) + "ms"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dChunk Timings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock().getChunk()) + "ms"));
}
else if (BlockStorage.check(e.getClickedBlock()).getEnergyTicker() != null) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + "&b~ &3(Indirect)"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dTimings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock()) + "ms"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dChunk Timings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock().getChunk()) + "ms"));
}
else {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + "&4\u2718"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&',"&dTicking: " + "&4\u2718"));
}
if (ChargableBlock.isChargable(e.getClickedBlock())) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dChargable: " + "&2\u2714"));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', " &dEnergy: &e" + ChargableBlock.getCharge(e.getClickedBlock()) + " / " + ChargableBlock.getMaxCharge(e.getClickedBlock())));
}
else {
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dChargable: " + "&4\u2718"));
}
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&6" + BlockStorage.getBlockInfoAsJson(e.getClickedBlock())));
p.sendMessage(" ");
}
break;
}
default:
break;
}
}
}
}
开发者ID:TheBusyBiscuit,项目名称:Slimefun4,代码行数:78,代码来源:ItemListener.java
注:本文中的me.mrCookieSlime.CSCoreLibPlugin.general.World.CustomSkull类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论