本文整理了Java中net.minecraft.client.Minecraft.getMinecraft()
方法的一些代码示例,展示了Minecraft.getMinecraft()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Minecraft.getMinecraft()
方法的具体详情如下:
包路径:net.minecraft.client.Minecraft
类名称:Minecraft
方法名:getMinecraft
暂无
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
@Override
public RayTraceResult getRTR()
{
return Minecraft.getMinecraft().objectMouseOver;
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
public RenderFloatingItem( final RenderManager manager )
{
super( manager, Minecraft.getMinecraft().getRenderItem() );
this.shadowOpaque = 0.0F;
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
@Override
public void call( final AppEngPacket appEngPacket )
{
appEngPacket.clientPacketData( manager, appEngPacket, Minecraft.getMinecraft().player );
}
};
代码示例来源:origin: Vazkii/Botania
private static ItemStack getStackUnderMouse() {
GuiScreen screen = Minecraft.getMinecraft().currentScreen;
if(screen instanceof GuiContainer) {
Slot slotUnderMouse = ((GuiContainer) screen).getSlotUnderMouse();
if(slotUnderMouse != null)
return slotUnderMouse.getStack();
}
return jeiPanelSupplier.get();
}
}
代码示例来源:origin: Vazkii/Botania
public static String getKeyDisplayString(String keyName) {
String key = null;
KeyBinding[] keys = Minecraft.getMinecraft().gameSettings.keyBindings;
for(KeyBinding otherKey : keys)
if(otherKey.getKeyDescription().equals(keyName)) {
key = otherKey.getDisplayName();
break;
}
return key;
}
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
final GuiScreen gs = Minecraft.getMinecraft().currentScreen;
if( gs instanceof GuiInterfaceTerminal )
{
( (GuiInterfaceTerminal) gs ).postUpdate( this.in );
}
}
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
@Override
public void initialize( Side side )
{
Minecraft.getMinecraft().getItemColors().registerItemColorHandler( this.itemColor, this.item );
}
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
{
final GuiScreen gs = Minecraft.getMinecraft().currentScreen;
if( gs instanceof GuiFluidTerminal )
{
( (GuiFluidTerminal) gs ).postUpdate( this.list );
}
}
代码示例来源:origin: Vazkii/Botania
@Nonnull
@Override
public IBakedModel handleItemState(@Nonnull IBakedModel original, ItemStack stack, World world, EntityLivingBase living) {
IBakedModel model = bakedItemModels.get(ItemBlockSpecialFlower.getType(stack));
if(model == null)
model = bakedBlockModels.get(ItemBlockSpecialFlower.getType(stack));
if(model == null)
model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(roseFallback);
return model;
}
};
代码示例来源:origin: Vazkii/Botania
@SubscribeEvent
public static void onRender(RenderWorldLastEvent event) {
World world = Minecraft.getMinecraft().world;
if(ConfigHandler.enableFancySkybox && world.provider.getDimension() == 0 && (ConfigHandler.enableFancySkyboxInNormalWorlds || WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().world))) {
if(!(world.provider.getSkyRenderer() instanceof SkyblockSkyRenderer))
world.provider.setSkyRenderer(new SkyblockSkyRenderer());
}
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
@Override
public CableRenderMode getRenderMode()
{
if( Platform.isServer() )
{
return super.getRenderMode();
}
final Minecraft mc = Minecraft.getMinecraft();
final EntityPlayer player = mc.player;
return this.renderModeForPlayer( player );
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
@Override
public void modelRegistration( Side side, IModelRegistry registry )
{
registry.setCustomStateMapper( this.block, this.stateMapper );
if( this.stateMapper instanceof IResourceManagerReloadListener )
{
( (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager() )
.registerReloadListener( (IResourceManagerReloadListener) this.stateMapper );
}
}
}
代码示例来源:origin: Vazkii/Botania
@Override
@SideOnly(Side.CLIENT)
public BlockPos getBinding() {
return Minecraft.getMinecraft().player.isSneaking() && bindPos.getY() != -1 ? bindPos : super.getBinding();
}
代码示例来源:origin: Vazkii/Botania
@Override
public void preInit(FMLPreInitializationEvent event) {
PersistentVariableHelper.setCacheFile(new File(Minecraft.getMinecraft().gameDir, "BotaniaVars.dat"));
try {
PersistentVariableHelper.load();
PersistentVariableHelper.save();
} catch (IOException e) {
Botania.LOGGER.fatal("Persistent Variables couldn't load!!");
}
MinecraftForge.EVENT_BUS.register(MiscellaneousIcons.INSTANCE);
initRenderers();
}
代码示例来源:origin: Vazkii/Botania
@Override
@SideOnly(Side.CLIENT)
public boolean isVisible() {
EntityPlayerSP player = Minecraft.getMinecraft().player;
if(advancement == null || player.capabilities.isCreativeMode) {
return true;
} else {
Advancement adv = player.connection.getAdvancementManager().getAdvancementList().getAdvancement(advancement);
AdvancementProgress progress = player.connection.getAdvancementManager().advancementToProgress.get(adv);
return progress != null && progress.isDone();
}
}
代码示例来源:origin: Vazkii/Botania
public void render() {
float f5 = 1F / 16F;
if(Minecraft.getMinecraft().world.isRaining())
sadFace.render(f5);
else happyFace.render(f5);
thread.render(f5);
cloth.render(f5);
}
代码示例来源:origin: Vazkii/Botania
@Override
public void onRuntimeAvailable(IJeiRuntime jeiRuntime) {
CorporeaInputHandler.jeiPanelSupplier = () -> {
Object o = jeiRuntime.getIngredientListOverlay().getIngredientUnderMouse();
if(o == null && Minecraft.getMinecraft().currentScreen == jeiRuntime.getRecipesGui())
o = jeiRuntime.getRecipesGui().getIngredientUnderMouse();
if(o instanceof ItemStack)
return (ItemStack) o;
return ItemStack.EMPTY;
};
CorporeaInputHandler.supportedGuiFilter = gui -> gui instanceof GuiContainer || gui instanceof IRecipesGui;
}
代码示例来源:origin: Vazkii/Botania
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onRenderWorldLast(RenderWorldLastEvent event) {
EntityPlayer player = Minecraft.getMinecraft().player;
ItemStack stack = PlayerHelper.getFirstHeldItemClass(player, ItemCraftingHalo.class);
if(!stack.isEmpty())
render(stack, player, event.getPartialTicks());
}
代码示例来源:origin: Vazkii/Botania
private void initAuxiliaryRender() {
Map<String, RenderPlayer> skinMap = Minecraft.getMinecraft().getRenderManager().getSkinMap();
RenderPlayer render;
render = skinMap.get("default");
render.addLayer(new ContributorFancinessHandler());
render.addLayer(new BaubleRenderHandler());
render.addLayer(new LayerGaiaHead(render.getMainModel().bipedHead));
render = skinMap.get("slim");
render.addLayer(new ContributorFancinessHandler());
render.addLayer(new BaubleRenderHandler());
render.addLayer(new LayerGaiaHead(render.getMainModel().bipedHead));
}
代码示例来源:origin: Vazkii/Botania
@Override
public void renderScreen(IGuiLexiconEntry gui, int mx, int my) {
Minecraft.getMinecraft().renderEngine.bindTexture(paperOverlay);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.color(1F, 1F, 1F, 1F);
((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight());
GlStateManager.disableBlend();
super.renderScreen(gui, mx, my);
}
内容来源于网络,如有侵权,请联系作者删除!