use of net.minecraft.server.v1_11_R1.Item in project ORCID-Source by ORCID.
the class ProfileFundingManagerImpl method createItemList.
private List<Item> createItemList(ProfileFundingEntity profileFundingEntity) {
Item item = new Item();
item.setItemName(profileFundingEntity.getTitle());
item.setItemType(ItemType.FUNDING);
item.setPutCode(String.valueOf(profileFundingEntity.getId()));
return Arrays.asList(item);
}
use of net.minecraft.server.v1_11_R1.Item in project ORCID-Source by ORCID.
the class WorkManagerImpl method createItemList.
private List<Item> createItemList(WorkEntity workEntity) {
Item item = new Item();
item.setItemName(workEntity.getTitle());
item.setItemType(ItemType.WORK);
item.setPutCode(String.valueOf(workEntity.getId()));
return Arrays.asList(item);
}
use of net.minecraft.server.v1_11_R1.Item in project ORCID-Source by ORCID.
the class ExternalIDValidatorTest method testValidateNotificationItems.
@Test
public void testValidateNotificationItems() {
Item i = new Item();
Item i2 = new Item();
Items items = new Items();
ExternalID id1 = new ExternalID();
id1.setRelationship(Relationship.SELF);
id1.setType("doi");
id1.setValue("value1");
id1.setUrl(new Url("http://value1.com"));
ExternalID id2 = new ExternalID();
id2.setRelationship(Relationship.SELF);
id2.setType("source-work-id");
id2.setValue("value2");
id2.setUrl(new Url("http://value1.com"));
i.setExternalIdentifier(id1);
i2.setExternalIdentifier(id2);
items.getItems().add(i);
items.getItems().add(i2);
// both valid
validator.validateNotificationItems(items);
// IDS one valid, one invalid
id2.setType("blah");
try {
validator.validateNotificationItems(items);
fail("no exception thrown for invalid type");
} catch (Exception e) {
if (!(e instanceof ActivityIdentifierValidationException))
throw e;
}
// IDS one valid, one VALID due to null (at least we have to do this if we want other tests to pass!)
id2.setType(null);
validator.validateNotificationItems(items);
}
use of net.minecraft.server.v1_11_R1.Item in project ORCID-Source by ORCID.
the class EmailMessageSenderTest method createActivity.
private Item createActivity(ItemType actType, String actName, String doi) {
Item act = new Item();
act.setItemType(actType);
act.setItemName(actName);
ExternalID extId = new ExternalID();
extId.setType("doi");
extId.setValue(doi);
act.setExternalIdentifier(extId);
return act;
}
use of net.minecraft.server.v1_11_R1.Item in project acidisland by tastybento.
the class NMSHandler method isPotion.
/* (non-Javadoc)
* @see com.wasteofplastic.askyblock.nms.NMSAbstraction#isPotion(org.bukkit.inventory.ItemStack)
*/
@Override
public boolean isPotion(ItemStack item) {
// Bukkit.getLogger().info("DEBUG:item = " + item);
if (item.getType().equals(Material.POTION)) {
net.minecraft.server.v1_11_R1.ItemStack stack = CraftItemStack.asNMSCopy(item);
NBTTagCompound tag = stack.getTag();
/*
for (String list : tag.c()) {
Bukkit.getLogger().info("DEBUG: list = " + list);
}*/
if (tag != null && (!tag.getString("Potion").equalsIgnoreCase("minecraft:water") || tag.getString("Potion").isEmpty())) {
return true;
}
}
return false;
}
Aggregations