本文整理汇总了Java中org.bukkit.support.Util类的典型用法代码示例。如果您正苦于以下问题:Java Util类的具体用法?Java Util怎么用?Java Util使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Util类属于org.bukkit.support包,在下文中一共展示了Util类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testEffectCompleteness
import org.bukkit.support.Util; //导入依赖的package包/类
@Test
public void testEffectCompleteness() throws Throwable {
Map<Integer, ?> effectDurations = Util.getInternalState(net.minecraft.server.PotionBrewer.class, null, "effectDurations");
Map<PotionType, String> effects = new EnumMap(PotionType.class);
for (int id : effectDurations.keySet()) {
PotionEffectType type = PotionEffectType.getById(id);
assertNotNull(String.valueOf(id), PotionEffectType.getById(id));
PotionType enumType = PotionType.getByEffect(type);
assertNotNull(type.getName(), enumType);
assertThat(enumType.name(), effects.put(enumType, enumType.name()), is(nullValue()));
}
assertThat(effects.entrySet(), hasSize(effectDurations.size()));
assertThat(effectDurations.entrySet(), hasSize(PotionType.values().length - /* WATER */ 1));
}
示例2: verifyMapping
import org.bukkit.support.Util; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void verifyMapping() throws Throwable {
List<Achievement> achievements = Lists.newArrayList(Achievement.values());
for (net.minecraft.server.Achievement statistic : (List<net.minecraft.server.Achievement>) AchievementList.e) {
int id = statistic.e;
String name = Util.getInternalState(Statistic.class, statistic, "a");
String message = String.format("org.bukkit.Achievement is missing id: %d named: '%s'", id - Achievement.STATISTIC_OFFSET, name);
Achievement subject = Achievement.getById(id);
assertNotNull(message, subject);
assertTrue(name, achievements.remove(subject));
}
assertThat("org.bukkit.Achievement has too many achievements", achievements, is(Collections.EMPTY_LIST));
}
示例3: getFireValues
import org.bukkit.support.Util; //导入依赖的package包/类
@BeforeClass
public static void getFireValues() {
fireValues = Util.getInternalState(BlockFire.class, Blocks.FIRE, "a");
}
示例4: getFireValues
import org.bukkit.support.Util; //导入依赖的package包/类
@BeforeClass
public static void getFireValues() {
fireValues = Util.getInternalState(BlockFire.class, Blocks.FIRE, "flameChances");
}
示例5: getFireValues
import org.bukkit.support.Util; //导入依赖的package包/类
@BeforeClass
public static void getFireValues() {
fireValues = Util.getInternalState(BlockFire.class, Block.FIRE, "a");
}