Everything posted by hydroflame
-
[Solved][1.6.2]Gui texture oversized.
its a static method, you code that once, not every time you draw something
-
[Solved][1.6.2]Gui texture oversized.
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
-
[Solved][1.6.2]Gui texture oversized.
stop using this method drawTexturedModalRect(posx, posy, 0, 0, xSize, ySize); cmon its fucking retarded, i have no idea why notch did that
-
[SOLVED] Tessellator Troubles
the tessellator will work everywhere you use it
-
Updating Textures Gui
are you even sending the updates to your client ?
-
Recompile errors after fresh forge installation [SOLVED] [1.6.2]
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
-
Custom Block Model
1 your not registering your TE 2 your block doesnt override hasTileEntity 3 you're using techne
-
missing class when loading coremod :\ wtfbbq
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
-
missing class when loading coremod :\ wtfbbq
not in 1.6.2, in this verison everything goes in the mods folder
-
missing class when loading coremod :\ wtfbbq
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
-
missing class when loading coremod :\ wtfbbq
because im pretty sure that its not required as i havnt seen mention of that anywhere
-
missing class when loading coremod :\ wtfbbq
implying optifine is REQUIRED to use forge and coremods
-
missing class when loading coremod :\ wtfbbq
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
-
missing class when loading coremod :\ wtfbbq
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
-
[SOLVED] Tessellator Troubles
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 :
-
Can I load class and Package for my mod
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...
-
No packet on the multiplayer ?
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
-
No packet on the multiplayer ?
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
-
No packet on the multiplayer ?
and what method this is in?
-
No packet on the multiplayer ?
how do you register your packet handler ?
-
Should I use TileEntity to display texture?
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
-
java.lang.IndexOutOfBoundsException: Index: 55, Size: 0
lol, constructor need argument, doesnt use it
-
Rendering hand with custom redered item.
im not afraid of lines but i have a coremod anyway to do things that are not possible via reflection so might as well
-
NullPointerException on MinecraftServer crashing game
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
-
NullPointerException on MinecraftServer crashing game
if(ms != null){ System.out.println("the world isnt null"); } also, if that crashed i would be pretty certain that its the root cause
IPS spam blocked by CleanTalk.