本文整理了Java中net.minecraft.client.Minecraft.getToastGui()
方法的一些代码示例,展示了Minecraft.getToastGui()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Minecraft.getToastGui()
方法的具体详情如下:
包路径:net.minecraft.client.Minecraft
类名称:Minecraft
方法名:getToastGui
暂无
代码示例来源:origin: MrCrayfish/MrCrayfishDeviceMod
public void push()
{
Minecraft.getMinecraft().getToastGui().add(this);
}
}
代码示例来源:origin: Vazkii/Patchouli
public static void setDoneAdvancements(String[] done, boolean showToast, boolean reset) {
showToast &= !PatchouliConfig.disableAdvancementLocking;
doneAdvancements = Arrays.asList(done);
updateLockStatus(reset);
if(showToast)
BookRegistry.INSTANCE.books.values().forEach(b -> {
if(b.popUpdated() && b.showToasts) {
Minecraft.getMinecraft().getToastGui().add(new LexiconToast(b));
}
});
}
代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition
@Override
public void matterToast(boolean b, long l) {
Minecraft.getMinecraft().getToastGui().add(new RegistryToast(b, l));
}
}
代码示例来源:origin: gegy1000/Terrarium
@Override
public void openWarnToast(int failCount) {
Minecraft.getMinecraft().getToastGui().add(new DataFailToast(failCount));
}
代码示例来源:origin: Vazkii/Quark
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void clientTick(ClientTickEvent event) {
Minecraft mc = Minecraft.getMinecraft();
if(mc.player != null && mc.player.ticksExisted < 20) {
GuiToast toasts = mc.getToastGui();
Queue<IToast> toastQueue = ReflectionHelper.getPrivateValue(GuiToast.class, toasts, LibObfuscation.TOASTS_QUEUE);
for(IToast toast : toastQueue)
if(toast instanceof RecipeToast) {
RecipeToast rtoast = (RecipeToast) toast;
List<ItemStack> stacks = ReflectionHelper.getPrivateValue(RecipeToast.class, rtoast, LibObfuscation.RECIPES_OUTPUTS);
if(stacks.size() > 100) {
toastQueue.remove(toast);
return;
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!