Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

hydroflame

Members
  • Joined

  • Last visited

Everything posted by hydroflame

  1. its a static method, you code that once, not every time you draw something
  2. public static void drawTexturedQuadFit(double x, double y, double width, double height, double zLevel){ Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(x + 0, y + height, zLevel, 0,1); tessellator.addVertexWithUV(x + width, y + height, zLevel, 1, 1); tessellator.addVertexWithUV(x + width, y + 0, zLevel, 1,0); tessellator.addVertexWithUV(x + 0, y + 0, zLevel, 0, 0); tessellator.draw(); } sry for formatting, this will fit the image entirelly inside the quad no matter what its size is (so you dont have to worry about stupid power of 2 wtv ass thing notch did) just bind the texture and call this function Minecraft.getMinecraft().renderEngine.func_somenumber_a(ResourceLocation);//bind texture drawTexturedQuadFit(x, y, width, height, zLevel);//render nice image
  3. stop using this method drawTexturedModalRect(posx, posy, 0, 0, xSize, ySize); cmon its fucking retarded, i have no idea why notch did that
  4. the tessellator will work everywhere you use it
  5. are you even sending the updates to your client ?
  6. i could always make a clean install, check that it works on my computer and zip + send it to you, then if it still doesnt work you know its your java
  7. 1 your not registering your TE 2 your block doesnt override hasTileEntity 3 you're using techne
  8. all good ^^ to future reader, if you need to change "net.minecraft.client.Minecraft" via ASM, good luck ^^ i was never able to do it i foudn another way around doing what i wanted (version 1.6.2) at least its not feasable via replacing the whole class
  9. not in 1.6.2, in this verison everything goes in the mods folder
  10. ding ding ding, bonus point to GotoLink because im an idiot who cant search properly, i am returning null in my transform method meaning every class that gets through will be erased causing the class to simply not exists derp mode enabled
  11. because im pretty sure that its not required as i havnt seen mention of that anywhere
  12. implying optifine is REQUIRED to use forge and coremods
  13. i might be wrong but i kindof doubt that because it would mean that people would HAVE to add option to launch. Afaik mods/coremods are suppose to be a drag n drop thing and adding this kind of option inside the coremod wouldnt make sens as java is already launched when this file is read. maybe im wrong though
  14. hey guys, im trying to make a coremod for 1.6.2 but when i insert the coremod into the mods folders and launch the game i get a ClassNotFoundException on cpw.mods.fml.common.asm.FMLSanityChecker my log: my IFMLoadingPlugin: package com.hydroflame.asm2; import java.io.File; import java.util.Map; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; public class ForgeRevCore implements IFMLLoadingPlugin{ public static File location; @Override @Deprecated public String[] getLibraryRequestClass() { return null; } @Override public String[] getASMTransformerClass() { System.out.println("returning the transformer class"); return new String[]{ForgeRevTransformer.class.getName()}; } @Override public String getModContainerClass() { return null; } @Override public String getSetupClass() { return null; } @Override public void injectData(Map<String, Object> data) { System.out.println("setting the location file"); location = (File) data.get("coremodLocation"); } } transformer class: package com.hydroflame.asm2; import java.io.File; import java.io.InputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import net.minecraft.launchwrapper.IClassTransformer; public class ForgeRevTransformer implements IClassTransformer { @Override public byte[] transform(String name, String obfName, byte[] bytecode) { if (name.equals("net.minecraft.client.Minecraft")||name.equals("ats")) { bytecode = patchClassInJar(name, bytecode, obfName, ForgeRevCore.location); } return null; } private byte[] patchClassInJar(String name, byte[] bytes, String ObfName, File location) { try { // open the jar as zip ZipFile zip = new ZipFile(location); // find the file inside the zip that is called te.class or // net.minecraft.entity.monster.EntityCreeper.class // replacing the . to / so it would look for // net/minecraft/entity/monster/EntityCreeper.class ZipEntry entry = zip.getEntry(name.replace('.', '/') + ".class"); if (entry == null) { System.out.println(name + " not found in " + location.getName()); } else { // serialize the class file into the bytes array InputStream zin = zip.getInputStream(entry); bytes = new byte[(int) entry.getSize()]; zin.read(bytes); zin.close(); System.out.println("[" + "ForgeRevCore" + "]: " + "Class "+ name + " patched!"); } zip.close(); } catch (Exception e) { throw new RuntimeException("Error overriding " + name + " from "+ location.getName(), e); } // return the new bytes return bytes; } } coremod.jar structure: *META-INF **MANIFEST.MF *ats.class *net **minecraft ***client ****Minecraft.class i looked into versions/1.6.2-Forge9.10.0.804 and effectivelly the class is not there but i used the installer. not sure why/where i screwed up i based my method off this tutorial: http://www.minecraftforum.net/topic/1854988-tutorial-162-changing-vanilla-without-editing-base-classes-coremods-and-events-very-advanced/ the "replcaing a whole miencraft class" part
  15. why ? TE are awesome, as long as you dont have 20 000 of them per chunk yessir heres my teleporter (it include a wavefront model btw) public class RenderTeleporter extends TileEntitySpecialRenderer{ private IModelCustom teleporter; private ResourceLocation texture = new ResourceLocation(TheMod.modid, "/models/textures/teleporter.png"); private float[] pos; int displayList = -1;//unused for now public RenderTeleporter(){ teleporter = AdvancedModelLoader.loadModel("/teleporter.obj"); pos = new float[30]; for(int i = 0; i < pos.length; i++){ pos[i] = (float) Math.random()*2; } } @Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { //here for(int i =0; i < pos.length; i++){ } float size = 0.1f; Tessellator tess = Tessellator.instance; for(int i = 0; i < pos.length; i++){ pos[i]+=0.01f; if(pos[i] > 2){ pos[i] = 0; } } Minecraft.getMinecraft().renderEngine.func_110577_a(ForgeRevCommonProxy.portalParticle); GL11.glPushMatrix(); GL11.glTranslated(d0+0.5, d1+1, d2+0.5); for(int i = 0; i < pos.length; i++){ GL11.glRotated(360/pos.length, 0, 1, 0); GL11.glPushMatrix(); GL11.glTranslated(0, pos[i], 1); tess.startDrawingQuads(); tess.addVertexWithUV(-size, -size, 0, 0, 0); tess.addVertexWithUV(-size, size, 0, 0, 1); tess.addVertexWithUV(size, size, 0, 1, 1); tess.addVertexWithUV(size, -size, 0, 1, 0); tess.addVertexWithUV(-size, -size, 0, 0, 0); tess.addVertexWithUV(size, -size, 0, 1, 0); tess.addVertexWithUV(size, size, 0, 1, 1); tess.addVertexWithUV(-size, size, 0, 0, 1); tess.draw(); GL11.glPopMatrix(); } GL11.glPopMatrix(); GL11.glColor3f(1, 1, 1); Minecraft.getMinecraft().renderEngine.func_110577_a(texture); GL11.glPushMatrix(); GL11.glTranslated(d0+0.5, d1+1, d2+0.5); GL11.glScaled(1.3, 1.3, 1.3); Tessellator.instance.setColorOpaque_F(1, 1, 1); teleporter.renderAll(); Minecraft.getMinecraft().renderEngine.func_110577_a(ForgeRevCommonProxy.portalRune); GL11.glTranslated(0, 0.2, 0); GL11.glRotated(System.nanoTime()/100000000f, 0, 1, 0); tess.startDrawingQuads(); tess.addVertexWithUV(-0.5, 0, -0.5, 0, 0); tess.addVertexWithUV(-0.5, 0, 0.5, 0, 1); tess.addVertexWithUV(0.5, 0, 0.5, 1, 1); tess.addVertexWithUV(0.5, 0, -0.5, 1, 0); tess.draw(); GL11.glPopMatrix(); } } EDIT: a video of what this code does :
  16. holy shit we created a 14 message thread over how to create an object ?!?!? option 1: import package.classname classname c = new classname(args); option 2 simply package.classname c = new package.classname(args); and as mazetar said yes this is a HUGE lack of understanding basic java...
  17. ok well how are you sending and making this packet, if it fails it means you did not send the right thing edit: btw im the author of that tutorial and those class
  18. can you try println inside your server packet hanlder constructor to see if it actually goes through and another println at the begining of the onPacketData method ? (before any if ) and see it this one comes up
  19. and what method this is in?
  20. how do you register your packet handler ?
  21. considering bookshelves shouldn't be in massive quantity you should probably use a TE since it'll make rendering easier and will only use 1 block id
  22. lol, constructor need argument, doesnt use it
  23. im not afraid of lines but i have a coremod anyway to do things that are not possible via reflection so might as well
  24. does this happen in game or before ? like on startup, becuase if its on startup that might make sens as the server/world isnt generated yet also private void onServerTick(MinecraftServer server, Minecraft mc) { if(FMLServerHandler.instance().getServer() != null || mc.theWorld != null) { cant you send FMLServerHandler.instance().getServer() to the method instead ? cuz that you know isnt null
  25. if(ms != null){ System.out.println("the world isnt null"); } also, if that crashed i would be pretty certain that its the root cause

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.