本文整理汇总了Java中ch.njol.yggdrasil.Fields.getAndRemoveObject方法的典型用法代码示例。如果您正苦于以下问题:Java Fields.getAndRemoveObject方法的具体用法?Java Fields.getAndRemoveObject怎么用?Java Fields.getAndRemoveObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ch.njol.yggdrasil.Fields
的用法示例。
在下文中一共展示了Fields.getAndRemoveObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import ch.njol.yggdrasil.Fields; //导入方法依赖的package包/类
@Override
public void deserialize(final Fields fields) throws StreamCorruptedException, NotSerializableException {
final String codeName = fields.getAndRemoveObject("info.codeName", String.class);
for (final SimpleEntityDataInfo i : types) {
if (i.codeName.equals(codeName)) {
info = i;
super.deserialize(fields);
return;
}
}
throw new StreamCorruptedException("Invalid SimpleEntityDataInfo code name " + codeName);
}
示例2: deserialize
import ch.njol.yggdrasil.Fields; //导入方法依赖的package包/类
@Override
public void deserialize(final Fields fields) throws StreamCorruptedException, NotSerializableException {
final String r = fields.getAndRemoveObject("region", String.class);
fields.setFields(this);
final ProtectedRegion region = plugin.getRegionManager(world).getRegion(r);
if (region == null)
throw new StreamCorruptedException("Invalid region " + r + " in world " + world);
this.region = region;
}
示例3: deserialize
import ch.njol.yggdrasil.Fields; //导入方法依赖的package包/类
@Override
public void deserialize(final Fields fields) throws StreamCorruptedException, NotSerializableException {
enchantments = fields.getAndRemoveObject("enchantments", Map.class);
meta = fields.getAndRemoveObject("meta", Object.class);
if (meta != null && !(meta instanceof ItemMeta))
throw new StreamCorruptedException();
fields.setFields(this);
}