mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 13:07:06 +01:00
Add ItemStackMapTest
This test was missing from c056293b38cb9a1296937d91746b175252be044a
This commit is contained in:
parent
8bc9e712e1
commit
647b82032b
1 changed files with 121 additions and 0 deletions
|
@ -0,0 +1,121 @@
|
|||
package org.bukkit.craftbukkit.inventory;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.MapMeta;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
public class ItemStackMapTest extends ItemStackTest {
|
||||
|
||||
@Parameters(name="[{index}]:{" + NAME_PARAMETER + "}")
|
||||
public static List<Object[]> data() {
|
||||
return StackProvider.compound(operators(), "%s %s", NAME_PARAMETER, Material.MAP);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
static List<Object[]> operators() {
|
||||
return CompoundOperator.compound(
|
||||
Joiner.on('+'),
|
||||
NAME_PARAMETER,
|
||||
Long.parseLong("10", 2),
|
||||
ItemStackLoreEnchantmentTest.operators(),
|
||||
Arrays.asList(
|
||||
new Object[] {
|
||||
new Operator() {
|
||||
public ItemStack operate(ItemStack cleanStack) {
|
||||
MapMeta meta = (MapMeta) cleanStack.getItemMeta();
|
||||
meta.setScaling(true);
|
||||
cleanStack.setItemMeta(meta);
|
||||
return cleanStack;
|
||||
}
|
||||
},
|
||||
new Operator() {
|
||||
public ItemStack operate(ItemStack cleanStack) {
|
||||
MapMeta meta = (MapMeta) cleanStack.getItemMeta();
|
||||
meta.setScaling(false);
|
||||
cleanStack.setItemMeta(meta);
|
||||
return cleanStack;
|
||||
}
|
||||
},
|
||||
"Scale vs. Unscale"
|
||||
},
|
||||
new Object[] {
|
||||
new Operator() {
|
||||
public ItemStack operate(ItemStack cleanStack) {
|
||||
MapMeta meta = (MapMeta) cleanStack.getItemMeta();
|
||||
meta.setScaling(true);
|
||||
cleanStack.setItemMeta(meta);
|
||||
return cleanStack;
|
||||
}
|
||||
},
|
||||
new Operator() {
|
||||
public ItemStack operate(ItemStack cleanStack) {
|
||||
MapMeta meta = (MapMeta) cleanStack.getItemMeta();
|
||||
cleanStack.setItemMeta(meta);
|
||||
return cleanStack;
|
||||
}
|
||||
},
|
||||
"Scale vs. Blank"
|
||||
},
|
||||
new Object[] {
|
||||
new Operator() {
|
||||
public ItemStack operate(ItemStack cleanStack) {
|
||||
MapMeta meta = (MapMeta) cleanStack.getItemMeta();
|
||||
meta.setScaling(false);
|
||||
cleanStack.setItemMeta(meta);
|
||||
return cleanStack;
|
||||
}
|
||||
},
|
||||
new Operator() {
|
||||
public ItemStack operate(ItemStack cleanStack) {
|
||||
MapMeta meta = (MapMeta) cleanStack.getItemMeta();
|
||||
cleanStack.setItemMeta(meta);
|
||||
return cleanStack;
|
||||
}
|
||||
},
|
||||
"Unscale vs. Blank"
|
||||
},
|
||||
new Object[] {
|
||||
new Operator() {
|
||||
public ItemStack operate(ItemStack cleanStack) {
|
||||
MapMeta meta = (MapMeta) cleanStack.getItemMeta();
|
||||
meta.setScaling(true);
|
||||
cleanStack.setItemMeta(meta);
|
||||
return cleanStack;
|
||||
}
|
||||
},
|
||||
new Operator() {
|
||||
public ItemStack operate(ItemStack cleanStack) {
|
||||
return cleanStack;
|
||||
}
|
||||
},
|
||||
"Scale vs. None"
|
||||
},
|
||||
new Object[] {
|
||||
new Operator() {
|
||||
public ItemStack operate(ItemStack cleanStack) {
|
||||
MapMeta meta = (MapMeta) cleanStack.getItemMeta();
|
||||
meta.setScaling(false);
|
||||
cleanStack.setItemMeta(meta);
|
||||
return cleanStack;
|
||||
}
|
||||
},
|
||||
new Operator() {
|
||||
public ItemStack operate(ItemStack cleanStack) {
|
||||
return cleanStack;
|
||||
}
|
||||
},
|
||||
"Unscale vs. None"
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue