本文整理了Java中net.minecraft.entity.Entity.getDataManager()
方法的一些代码示例,展示了Entity.getDataManager()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.getDataManager()
方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:getDataManager
暂无
代码示例来源:origin: TeamWizardry/Wizardry
public boolean apply(@Nullable Entity entity) {
if (entity == null) return false;
if (entity.getDataManager().getAll() == null) return false;
boolean success = false;
for (EntityDataManager.DataEntry<?> entry : entity.getDataManager().getAll()) {
if (entry.getKey().equals(OWNER)) {
success = true;
break;
}
}
if (!success) return false;
UUID theirOwner = null;
Object ownerObj = entity.getDataManager().get(OWNER);
if (ownerObj != null && ownerObj instanceof Optional && ((Optional<?>) ownerObj).isPresent() && ((Optional<?>) ownerObj).get() instanceof UUID)
theirOwner = entity.getDataManager().get(OWNER).orNull();
return !(theirOwner != null && getDataManager().get(OWNER).isPresent() && theirOwner.equals(getDataManager().get(OWNER).get()));
}
}));
代码示例来源:origin: Vazkii/Quark
@SubscribeEvent
public void onEntityInit(EntityConstructing event) {
if(event.getEntity() instanceof EntityBoat) {
EntityDataManager manager = event.getEntity().getDataManager();
manager.register(bannerData, ItemStack.EMPTY);
}
}
代码示例来源:origin: TeamWizardry/Wizardry
@Override
public void render(@Nonnull Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
GlStateManager.disableBlend();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.color(1.0F, 1.0F, 1.0F, 0.9F);
RandUtilSeed seed = new RandUtilSeed(entityIn.getDataManager().get(DATA_SHIFT_SEED) + 1);
GlStateManager.translate(seed.nextDouble(-3, 3), seed.nextDouble(-3, 3), seed.nextDouble(-3, 3));
double multiplier = 0.05;
GlStateManager.translate(RandUtil.nextFloat() * multiplier, RandUtil.nextFloat() * multiplier, RandUtil.nextFloat() * multiplier);
super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
GlStateManager.disableBlend();
}
代码示例来源:origin: Vazkii/Quark
ItemStack copyStack = stack.copy();
player.swingArm(hand);
target.getDataManager().set(bannerData, copyStack);
内容来源于网络,如有侵权,请联系作者删除!