Everything posted by Alesimula
-
Creating GUI: Accessing GUIAchievements.currentpage
i first used to edit currentpage from private to public because they where changing in the game client, but not anymore in version 1.7.2, and i don't want to edit vanilla files. here is my code: (i use it in a TickEvent event) Minecraft minecraft = Minecraft.getMinecraft(); GuiScreen var15 = minecraft.currentScreen; int var14; if (var15 != null) { if (var15 instanceof GuiAchievements) { var14 = ((GuiAchievements)var15).currentPage; if (AchievementPage.getTitle(var14).equals("Glacia")) { minecraft.thePlayer.openGui(mod_Glacia.instance, GlaciaCommonProxy.GUI_ID_ACHIEVEMENTS, minecraft.theWorld, var14, 0, 0); } } if (var15 instanceof GuiAchievementsGlacia) { var14 = ((GuiAchievementsGlacia)var15).currentPage; if (!AchievementPage.getTitle(var14).equals("Glacia")) { GuiAchievements var16 = new GuiAchievements(var15, minecraft.thePlayer.getStatFileWriter()); var16.currentPage = var14; FMLClientHandler.instance().displayGuiScreen(minecraft.thePlayer, var16); } } }
-
Gradle decompiled vanilla source instead of classes
that means i can't anymore access to GuiAchievements.currentPage ? so how am i supposed to add a custom GUI for achievements? I used this code Minecraft minecraft = Minecraft.getMinecraft(); GuiScreen var15 = minecraft.currentScreen; int var14; if (var15 != null) { if (var15 instanceof GuiAchievements) { var14 = ((GuiAchievements)var15).currentPage; if (AchievementPage.getTitle(var14).equals("Glacia")) { minecraft.thePlayer.openGui(mod_Glacia.instance, GlaciaCommonProxy.GUI_ID_ACHIEVEMENTS, minecraft.theWorld, var14, 0, 0); } } if (var15 instanceof GuiAchievementsGlacia) { var14 = ((GuiAchievementsGlacia)var15).currentPage; if (!AchievementPage.getTitle(var14).equals("Glacia")) { GuiAchievements var16 = new GuiAchievements(var15, minecraft.thePlayer.getStatFileWriter()); var16.currentPage = var14; FMLClientHandler.instance().displayGuiScreen(minecraft.thePlayer, var16); } } }
-
Gradle decompiled vanilla source instead of classes
I know i can do it by myself (and I already did) but it would be better if gradle creates an eclipse workspace with the decopiled vanilla source code instead of the classes, just to easilly edit the: "private" to "public" and access some codes may i be wrong, but aren't some (if not all) private changed to public in the game client?
-
Compiled Mod Causes Error [SOLVED -> never use func_...!]
you probably have a func_whatever in the class ModBlocks that corresponds to another code with a name, so when the mod get compiled they all get the same name and that causes a duplication. remove the func_whatever from your code (you can find it because it is not in the class that you extend)
-
[1.7.2] create dimensions midgame
i didn't understand if you want to do something particular or just create a dimension from zero (to hero)
-
1.7.2 ITickHandler replacement?
i can't still test it because it is part of my dimension mod and sill have a lot of codes to fix ps: what can replace Achievement.getName() //<<doesn't exist enymore
-
1.7.2 ITickHandler replacement?
like this? public static class TickHandlerClient { private GuiScreen lastGuiOpen; @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { //CLIENT TICK START if (event.phase == TickEvent.Phase.START) { final Minecraft minecraft = FMLClientHandler.instance().getClient(); final WorldClient world = minecraft.theWorld; if (world != null) { if (world.provider instanceof WorldProviderGlacia) { if (world.provider.getSkyRenderer() == null) { world.provider.setSkyRenderer(new GlacialSkyProvider()); } } } } //CLIENT TICK END else { Minecraft minecraft = Minecraft.getMinecraft(); GuiScreen var15 = minecraft.currentScreen; int var14; if (var15 != null) { if (var15 instanceof GuiAchievements) { var14 = ((GuiAchievements)var15).currentPage; if (AchievementPage.getTitle(var14).equals("Glacia")) { minecraft.thePlayer.openGui(mod_Glacia.instance, GlaciaCommonProxy.GUI_ID_ACHIEVEMENTS, minecraft.theWorld, var14, 0, 0); } } if (var15 instanceof GuiAchievementsGlacia) { var14 = ((GuiAchievementsGlacia)var15).currentPage; if (!AchievementPage.getTitle(var14).equals("Glacia")) { GuiAchievements var16 = new GuiAchievements(var15, minecraft.thePlayer.getStatFileWriter()); var16.currentPage = var14; FMLClientHandler.instance().displayGuiScreen(minecraft.thePlayer, var16); } } } } } }
-
1.7.2 ITickHandler replacement?
Is this code good? public static class TickHandlerClient { private GuiScreen lastGuiOpen; @SubscribeEvent public void onTick(TickEvent event) { //CLIENT TICK if (event.type == TickEvent.Type.CLIENT && event.side == Side.CLIENT) { //CLIENT TICK START if (event.phase == TickEvent.Phase.START) { final Minecraft minecraft = FMLClientHandler.instance().getClient(); final WorldClient world = minecraft.theWorld; if (world != null) { if (world.provider instanceof WorldProviderGlacia) { if (world.provider.getSkyRenderer() == null) { world.provider.setSkyRenderer(new GlacialSkyProvider()); } } } } //CLIENT TICK END else { Minecraft minecraft = Minecraft.getMinecraft(); GuiScreen var15 = minecraft.currentScreen; int var14; if (var15 != null) { if (var15 instanceof GuiAchievements) { var14 = ((GuiAchievements)var15).currentPage; if (AchievementPage.getTitle(var14).equals("Glacia")) { minecraft.thePlayer.openGui(mod_Glacia.instance, GlaciaCommonProxy.GUI_ID_ACHIEVEMENTS, minecraft.theWorld, var14, 0, 0); } } if (var15 instanceof GuiAchievementsGlacia) { var14 = ((GuiAchievementsGlacia)var15).currentPage; if (!AchievementPage.getTitle(var14).equals("Glacia")) { GuiAchievements var16 = new GuiAchievements(var15, minecraft.thePlayer.getStatFileWriter()); var16.currentPage = var14; FMLClientHandler.instance().displayGuiScreen(minecraft.thePlayer, var16); } } } } } } }
-
1.7.2 ITickHandler replacement?
but now i have two codes that i know are used to register event, have i to use both or have i to use one of them? what one? MinecraftForge.EVENT_BUS.register(new mod_Glacia.TickHandlerClient()); or FMLCommonHandler.instance().bus().register(new mod_Glacia.TickHandlerClient());
-
1.7.2 ITickHandler replacement?
Should i use TickEvent as tickhandler (if yes how) and is it possible to use FMLCommonHandler with onpreclienttick and onpostclienttick? how to register the tickhandler? What about the PickupHandler?
-
Achievement page with CUSTOM BACKGROUND AND BORDERS
I saw this mod (1.4.7) http://www.planetminecraft.com/mod/125-the-lion-king-mod-v151/ were there is an achievement page with different textures in the achievement page, also achievements have different textures... how can it be done?
-
ISimpleBlockRenderingHandler enable Ambient Occlusion and shadows
the other custom rendered block use for example this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 1.0D); this.renderStandardBlock(par1BlockWall, par2, par3, par4); instead of tessellating, so it will render a standard block shaped as the block bounds but in my code i use tessellator and different textures for each (almost each) faces, so it is more difficult... does anyone have an answer?
-
ISimpleBlockRenderingHandler enable Ambient Occlusion and shadows
Hi, i made a custom modeled translucent block (glacia column) and now i need to know how to enable ambient occlusion so that i can make it generate shadows and make it shadowed on the bottom. here is my rendering code RenderGlaciaColumn: here is a screen:
-
Don't understand why my code does not work
try changing LanguageRegistry.addName(hardWall, "Hard Wall"); to LanguageRegistry.addName(HardWall, "Hard Wall");
-
ISimpleBlockRenderingHandler block glows when destroying
When i'm destroying a block (made with the rendering handler) in survival mode, it glows CODES: RenderGlaciaColumn: BlockGlaciaColumn please i really need help, i can't figure it out
-
TESSELLATOR BLOCK bug: when destroying only glows
BUMP
-
RENDERING DISTANCE PROBLEM in Custom modeled block
A little forewarning. The tessellator is very difficult to work with. When I was working on rail bridges (can't find any pictures) I spent probably 4 hours individually drawing planes with the tessellator to get it to look right. I kept getting them backwards, or in the wrong place, even twisted on a few occasions. So you have experience with tessellator... could you help me i have another problem, the block, when destroyng, doesn't show the destroying animation and it only glows more details and codes in the other topic: http://www.minecraftforge.net/forum/index.php/topic,13032.0.html
-
TESSELLATOR BLOCK bug: when destroying only glows
when i destroy the block, while i'm destroyng it it doesn't show the destroying animation, it just glows until it get destoyed. here is the block renderer:
-
TESSELLATOR RENDERING translucent
it was simpler then i though
-
TESSELLATOR RENDERING translucent
is it possible to make a tessellator based block rendering handler render semi-transparent blocks? if yes, how?
-
RENDERING DISTANCE PROBLEM in Custom modeled block
A little forewarning. The tessellator is very difficult to work with. When I was working on rail bridges (can't find any pictures) I spent probably 4 hours individually drawing planes with the tessellator to get it to look right. I kept getting them backwards, or in the wrong place, even twisted on a few occasions. I tried it out, it doesn't seem too difficult, just a bit time expensive No... very time expensive, my block have 4 shapes based on its metadata
-
RENDERING DISTANCE PROBLEM in Custom modeled block
anyway i can't do this with modelWHATEVER and GL11, strangely, the block doesn't render. i'll do it with tessellator, but i dunno how to take only a part of texture to assign to a specific face es: in texturewhatever.png i want to assign the texture that goes from pixel(12,3) to pixel(23,5) and how to assign different texture parts to any tessellactor face
-
RENDERING DISTANCE PROBLEM in Custom modeled block
ok i really need an example.... let's suppose my texture is "assets/minecraft/textures/entity/MYTEXTURE.png" DON'T. Mod resources go into "assets/(modID, lower case)" and no-where else. In other words, this should be "assets/modid/textures/entity/MYTEXTURE.png" In your entity renderer (extends one of the sub-classes of net.minecraft.classes.renderer.entity.Render): private static final ResourceLocation texture = new ResourceLocation("modid", "textures/entity/MYTEXTURE.png"); @Override protected ResourceLocation getEntityTexture(Entity entity) { return texture; } That's it. It gets automatically called for entities which use that (for example by RenderLiving.renderModel() if you extend RenderLiving). If you want to implement your own doRender(Entity entity, double posX, double posY, double posZ, float yaw, float partialTickTime) method, that's how you bind it and then call the model to render: bindEntityTexture(entity); renderLivingAt(entity, posX, posY, posZ); // or use GL11.glTranslatef() yourself /* Remember to rotate the entity properly if needed, via GL11.glRotatef() or the helper function rotateCorpse() if you're rendering a living */ /* Calculate the other animation-related values for the next call */ mainModel.render(entity, limbSwingTime, limbSwingMaxDist, entity.ticksExisted + partialTickTime, headRotY, headRotX, scale); I'm trying to render a custom modeled block, not an'entity
-
RENDERING DISTANCE PROBLEM in Custom modeled block
ok i really need an example.... let's suppose my texture is "assets/minecraft/textures/entity/MYTEXTURE.png" how should the whole code wich assigns the texture to the model (created with techne) look like?
-
RENDERING DISTANCE PROBLEM in Custom modeled block
i'm a little confused now
IPS spam blocked by CleanTalk.