[この前のやつ][1]使ってダメージ値から[PotionEffect][2]を返すものを作った。
ポーションは初期状態で細かいデータタグを何も持っていないため、
[PotionMeta][3]のgetCustomEffects()
から取得するが出来ません。
だからこんな面倒なもの書いてみました。
PotionEffectの三次元配列用意して色々。
第一位配列のサイズは2、ここで飲むポーション(0)か、スプラッシュ(1)か。
@EventHandler | |
public void onEntityExplode(EntityExplodeEvent e){ | |
Entity entity = e.getEntity(); | |
if(entity instanceof TNTPrimed){ | |
List<Block> lb = e.blockList(); | |
Location loc = entity.getLocation(); | |
TNTExprotion(loc, lb); | |
return; | |
} | |
} |
@EventHandler | |
public void onPlayerInteract(PlayerInteractEvent e) { | |
final Player p = e.getPlayer(); | |
ItemStack item = p.getItemInHand(); | |
if(e.getAction().equals(Action.RIGHT_CLICK_AIR)||e.getAction().equals(Action.RIGHT_CLICK_BLOCK)){ | |
if(item.getType().equals(Material.SUGAR)){ | |
Bukkit.getScheduler().runTaskLater(this, new Runnable(){ | |
public void run(){ | |
Bukkit.broadcastMessage("Delay:"+p.getName()); | |
} |
@EventHandler | |
public void onTNTPrimed(TNTPrimedEvent event){ | |
//着火済みTNTが火打石による着火なら | |
if(event.getReason().equals(TNTPrimedEvent.SpawnReson.IGNITE)){ | |
Player player = event.getPlayer(); | |
player.sendMessage("You ignition TNT !"); | |
} | |
} |
@EventHandler | |
public void onPlayerDeath(PlayerDeathEvent e){ | |
//死亡したプレイヤーの取得 | |
Player player = e.getEntity(); | |
//最後のダメージイベントがnullでなければ | |
if(player.getLastDamageCause() != null){ | |
//最後のダメージイベントを取得 | |
EntityDamageEvent damageE = player.getLastDamageCause(); |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.Properties; | |
import org.bukkit.Bukkit; | |
import org.bukkit.World; | |
import org.bukkit.plugin.java.JavaPlugin; |
package com.github.keepoff07.hiyaserver.blockparty.timer; | |
import org.bukkit.Bukkit; | |
import org.bukkit.Sound; | |
import org.bukkit.entity.Player; | |
public class ExpManager { | |
private JavaPlugin main; | |
public static void setMain(JavaPlugin plugin){ |
import org.bukkit.potion.PotionEffect; | |
import org.bukkit.potion.PotionEffectType; | |
public class DefaultPotion { | |
private static PotionEffect[][][] effect = { | |
{ | |
{ | |
null, | |
null, | |
null, |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.Method; | |
import org.bukkit.Bukkit; | |
import org.bukkit.block.Block; | |
public class ChestLockReflect { | |
private static String version; | |
private static boolean v1_8 = false; | |
static { |