summaryrefslogtreecommitdiffstats
path: root/src/test/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/bukkit/DyeColorsTest.java3
-rw-r--r--src/test/java/org/bukkit/SoundTest.java2
-rw-r--r--src/test/java/org/bukkit/StatisticsAndAchievementsTest.java23
-rw-r--r--src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java10
-rw-r--r--src/test/java/org/bukkit/map/MapTest.java4
5 files changed, 14 insertions, 28 deletions
diff --git a/src/test/java/org/bukkit/DyeColorsTest.java b/src/test/java/org/bukkit/DyeColorsTest.java
index f0b889b3..020714da 100644
--- a/src/test/java/org/bukkit/DyeColorsTest.java
+++ b/src/test/java/org/bukkit/DyeColorsTest.java
@@ -6,7 +6,6 @@ import static org.hamcrest.Matchers.*;
import java.util.ArrayList;
import java.util.List;
-import net.minecraft.server.EntitySheep;
import net.minecraft.server.EnumColor;
import net.minecraft.server.ItemDye;
@@ -34,7 +33,7 @@ public class DyeColorsTest extends AbstractTestingBase {
@Test
public void checkColor() {
Color color = dye.getColor();
- float[] nmsColorArray = EntitySheep.a(EnumColor.fromColorIndex(dye.getWoolData()));
+ float[] nmsColorArray = EnumColor.fromColorIndex(dye.getWoolData()).f();
Color nmsColor = Color.fromRGB((int) (nmsColorArray[0] * 255), (int) (nmsColorArray[1] * 255), (int) (nmsColorArray[2] * 255));
assertThat(color, is(nmsColor));
}
diff --git a/src/test/java/org/bukkit/SoundTest.java b/src/test/java/org/bukkit/SoundTest.java
index ea1d0c84..942cb4ea 100644
--- a/src/test/java/org/bukkit/SoundTest.java
+++ b/src/test/java/org/bukkit/SoundTest.java
@@ -21,7 +21,7 @@ public class SoundTest {
@Test
public void testReverse() {
for (MinecraftKey effect : SoundEffect.a.keySet()) {
- assertNotNull(effect + "", Sound.valueOf(effect.a().replace('.', '_').toUpperCase(java.util.Locale.ENGLISH)));
+ assertNotNull(effect + "", Sound.valueOf(effect.getKey().replace('.', '_').toUpperCase(java.util.Locale.ENGLISH)));
}
}
diff --git a/src/test/java/org/bukkit/StatisticsAndAchievementsTest.java b/src/test/java/org/bukkit/StatisticsAndAchievementsTest.java
index 0a6c277a..e05e7330 100644
--- a/src/test/java/org/bukkit/StatisticsAndAchievementsTest.java
+++ b/src/test/java/org/bukkit/StatisticsAndAchievementsTest.java
@@ -3,10 +3,8 @@ package org.bukkit;
import static org.junit.Assert.*;
import static org.hamcrest.Matchers.*;
-import java.util.Collections;
import java.util.List;
-import net.minecraft.server.AchievementList;
import net.minecraft.server.StatisticList;
import org.bukkit.craftbukkit.CraftStatistic;
@@ -14,35 +12,14 @@ import org.bukkit.support.AbstractTestingBase;
import org.junit.Test;
import com.google.common.collect.HashMultiset;
-import com.google.common.collect.Lists;
public class StatisticsAndAchievementsTest extends AbstractTestingBase {
- @Test
- @SuppressWarnings("unchecked")
- public void verifyAchievementMapping() throws Throwable {
- List<Achievement> achievements = Lists.newArrayList(Achievement.values());
- for (net.minecraft.server.Achievement achievement : (List<net.minecraft.server.Achievement>) AchievementList.e) {
- String name = achievement.name;
-
- String message = String.format("org.bukkit.Achievement is missing: '%s'", name);
-
- Achievement subject = CraftStatistic.getBukkitAchievement(achievement);
- assertThat(message, subject, is(not(nullValue())));
-
- assertThat(name, achievements.remove(subject), is(true));
- }
-
- assertThat("org.bukkit.Achievement has too many achievements", achievements, is(empty()));
- }
@Test
@SuppressWarnings("unchecked")
public void verifyStatisticMapping() throws Throwable {
HashMultiset<Statistic> statistics = HashMultiset.create();
for (net.minecraft.server.Statistic statistic : (List<net.minecraft.server.Statistic>) StatisticList.stats) {
- if (statistic instanceof net.minecraft.server.Achievement) {
- continue;
- }
String name = statistic.name;
String message = String.format("org.bukkit.Statistic is missing: '%s'", name);
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
index 69c21f28..1f537d58 100644
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
@@ -17,6 +17,7 @@ import org.bukkit.DyeColor;
import org.bukkit.FireworkEffect;
import org.bukkit.Material;
import org.bukkit.FireworkEffect.Type;
+import org.bukkit.NamespacedKey;
import org.bukkit.block.banner.Pattern;
import org.bukkit.block.banner.PatternType;
import org.bukkit.craftbukkit.inventory.ItemStackTest.StackProvider;
@@ -33,6 +34,7 @@ import org.bukkit.inventory.meta.EnchantmentStorageMeta;
import org.bukkit.inventory.meta.FireworkEffectMeta;
import org.bukkit.inventory.meta.FireworkMeta;
import org.bukkit.inventory.meta.ItemMeta;
+import org.bukkit.inventory.meta.KnowledgeBookMeta;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.inventory.meta.MapMeta;
import org.bukkit.inventory.meta.PotionMeta;
@@ -264,6 +266,14 @@ public class ItemMetaTest extends AbstractTestingBase {
meta.setSpawnedType(EntityType.ZOMBIE);
cleanStack.setItemMeta(meta);
return cleanStack;
+ }
+ },
+ new StackProvider(Material.KNOWLEDGE_BOOK) {
+ @Override ItemStack operate(ItemStack cleanStack) {
+ final KnowledgeBookMeta meta = (KnowledgeBookMeta) cleanStack.getItemMeta();
+ meta.addRecipe(new NamespacedKey("minecraft", "test"), new NamespacedKey("plugin", "test"));
+ cleanStack.setItemMeta(meta);
+ return cleanStack;
}
}
);
diff --git a/src/test/java/org/bukkit/map/MapTest.java b/src/test/java/org/bukkit/map/MapTest.java
index 4cb2cf94..f4788a18 100644
--- a/src/test/java/org/bukkit/map/MapTest.java
+++ b/src/test/java/org/bukkit/map/MapTest.java
@@ -24,13 +24,13 @@ public class MapTest {
if (nmsColors[i] == null) {
break;
}
- int rgb = nmsColors[i].L;
+ int rgb = nmsColors[i].ac;
int r = (rgb >> 16) & 0xFF;
int g = (rgb >> 8) & 0xFF;
int b = rgb & 0xFF;
- if (i > bukkitColors.length/4) {
+ if (i + 1 > bukkitColors.length / 4) {
for (int modi : modifiers) {
int mr = (r * modi) / 255;
int mg = (g * modi) / 255;