Jump to content

Cadiboo

Members
  • Posts

    3624
  • Joined

  • Last visited

  • Days Won

    58

Everything posted by Cadiboo

  1. Can you edit the MCP stuff from this bot? For example adding mappings
  2. Use your IDE's auto-formatter function to automatically apply overrides etc.
  3. Learning java through modding Minecraft is really painful, I suggest getting a basic understanding of java or at least OOP (Object Oriented Programming) in general first
  4. Is this being properly overriden? and how are you registering your block?? Can you post your entire log using GitHub Gist or pastebin and your code as a github(or similar) repository?
  5. Override getLightOpacity? (Between 0-15)
  6. You would be able to work on it, I think so, yes, not exactly needed but likely appreciated & you will get a feel for how Forge works by working on it
  7. That looks like the light map (not the blocks) texture to me
  8. What’s the error? you should also probably read https://mcforge.readthedocs.io/en/latest/tileentities/tileentity/#synchronizing-the-data-to-the-client
  9. Can you please post your current logs?
  10. You will probably also be using BLOCK and ITEM vertex formats. Heres how to upload with them BLOCK: bufferBuilder.pos(x, y, z).color(red, green, blue, alpha).tex(minU, maxV).lightmap(skyLight, blockLight).endVertex(); ITEM: bufferBuilder.pos(x, y, z).color(red, green, blue, alpha).tex(minU, maxV).normal(x, y, z).endVertex(); //theres also an element (1 byte) called padding in the ITEM format, however, since there is no method to create it, I assume it is literally padding and is automatically added if needed
  11. mY cOREMOD iSNT wORKING yOU nEED tOO hELP mE hERES mY cODE gIVE mE cODE aND rEWRITE iT fOR mE yOU nEED tO import java.util.Iterator; import org.objectweb.asm.*; import net.minecraft.launchwrapper.IClassTransformer; public class null implements IClassTransformer { public static final int ALOAD = Opcodes.ALOAD; public static final int INVOKESTATIC = Opcodes.INVOKESTATIC; public static final int GETFIELD = Opcodes.GETFIELD; public static final int FLOAD = Opcodes.FLOAD; public static final int INVOKEVIRTUAL = Opcodes.INVOKEVIRTUAL; public static final int IFEQ = Opcodes.IFEQ; public static final int RETURN = Opcodes.RETURN; public static final int F_SAME = Opcodes.F_SAME; public static final int GETSTATIC = Opcodes.GETSTATIC; @Override public byte[] transform(final String name, final String transformedName, final byte[] basicClass) { if (name.equals("net.minecraft.client.renderer.chunk.Minecraft")) { System.out.println("********* INSIDE DEOBFUSCATED MinecRaft TRANSFORMER ABOUT TO PATCH: " + name); final byte[] undefined = vent(name, basicClass, true); final byte[] null = this.at(name, hookRebuildChunkEvent, true); return hook.null; } return basicClass; }package asm.net.minecraft.client.renderer.chunk; import java.util.*; import org.objectweb.asm.*; public class RenderChunkDump implements Opcodes { public static byte[] dump() throws Exception { final ClassWriter cw=new ClassWriter(0);FieldVisitor fv;MethodVisitor mv;AnnotationVisitor av0; cw.visit(V1_8,ACC_PUBLIC+ACC_SUPER,"net/minecraft/client/renderer/chunk/RenderChunk",null,"java/lang/Object",null); cw.visitSource("RenderChunk.java",null); {av0=cw.visitAnnotation("Lnet/minecraftforge/fml/relauncher/SideOnly;",true);av0.visitEnum("value","Lnet/minecraftforge/fml/relauncher/Side;","CLIENT");av0.visitEnd();}cw.visitInnerClass("net/minecraft/util/math/BlockPos$MutableBlockPos","net/minecraft/util/math/BlockPos","MutableBlockPos",ACC_PUBLIC+ACC_STATIC); cw.visitInnerClass("net/minecraft/client/renderer/BufferBuilder$State","net/minecraft/client/renderer/BufferBuilder","State",ACC_PUBLIC); cw.visitInnerClass("net/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator$Status","net/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator","Status",ACC_PUBLIC+ACC()V",false);mv.visitLabel(l6);mv.visitLineNumber(398,l6);mv.visitFrame(Opcodes.F_SAME,0,null,0,null);mv.visitIincInsn(1,1);mv.visitJumpInsn(GOTO,l3);mv.visitLabel(l4);mv.visitLineNumber(405,l4);mv.visitFrame(Opcodes.F_CHOP,1,null,0,null);mv.visitInsn(this.RETURN);final Label l8=new Label();mv.visitLabel(l8);mv.visitLocalVariable("i","I",null,l3,l4,1);mv.visitLEvent(final String name, final byte[] bytes, final boolean deobfuscated) { final String targetMethodName; if (deobfuscated == false) {targetMethodName = "NULL"; } else {targetMethodName = "minecraft.Getminecraft()"; } final ClassNode classNodeRenderChunk = new ClassNode(); final ClassReader classReader = new ClassReader(bytes); classReader.accept(classNodeRenderChunk, 0); final Iterator<MethodNode> methods = classNodeRenderChunk.methods.iterator(); while (methods.hasNext()) {final MethodNode methodRebuildChunk = methods.next();if (!methodRebuildChunk.name.equals(targetMethodName)) { continue;}if (!methodRebuildChunk.desc.equals("(FFFLnet/minecraft//renderer/chunk/Minecraft;)V")) { continue;}System.out.println("********* Inside target method! " + targetMethodName + " | " + methodRebuildChunk.name);AbstractInsnNode targetNode = null;final Iterator<AbstractInsnNode> iter = methodRebuildChunk.instructions.iterator();iter.next();iter.next();iter.next();iter.next();iter.next();iter.next();while (iter.hasNext()) { final AbstractInsnNode currentNode = iter.next(); if (true && currentNode.getOpcode() == Opcodes.NEW && true) { targetNode = currentNode.getPrevious().getPrevious(); break; }} 147 - } 148 - 149 - VisGraph this.lvt_9_1_ = new VisGraph(); 147 - }148-if(net.minecraftforge.client.ForgeHooksClient.onRebuildChunkEvent(field_178589_e,field_189564_r,p_178581_4_,compiledchunk,this.field_178586_f,p_178581_1_,p_178581_2_,p_178581_3_).isCanceled())return;149- VisGraph lvt_9_1_ = new VisGraph(); L16 LINENUMBER 145 L16 ALOAD 0 GETFIELD net/minecraft/client/renderer/chunk/RenderChunk.renderGlobal:Lnet/minecraft/client/renderer/RenderGlobal;ALOAD 0 GETFIELD net/minecraft/client/renderer/chunk/RenderChunk.worldView:Lnet/minecraft/world/ChunkCache;ALOAD 4 ALOAD 5 ALOAD 0 GETFIELD net/minecraft/client/renderer/chunk/RenderChunk.position:Lnet/minecraft/util/math/BlockPos$MutableBlockPos;FLOAD 1 FLOAD 2 FLOAD 3 INVOKESTATIC net/minecraftforge/client/ForgeHooksClient.onRebuildChunkEvent(Lnet/minecraft/client/renderer/RenderGlobal;Lnet/minecraft/world/ChunkCache;Lnet/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator;Lnet/minecraft/client/renderer/chunk/CompiledChunk;Lnet/minecraft/util/math/BlockPos$MutableBlockPos;FFF)Lnet/minecraftforge/client/event/RebuildChunkEvent; INVOKEVIRTUAL net/minecraftforge/client/event/RebuildChunkEvent.isCanceled()Z IFEQ L17 RETURN L17System.out.println("********* PATCHING"); final InsnList toInject = new InsnList(); final Label l16 = new Label();toInject.add(new Label(l16));toInject.add(new LineNumberNode(145+3,l16));toInject.add(new VarInsnNode(ALOAD,0);toInject.add(new FieldInsnNode(GETFIELD,"net/minecraft/client/renderer/chunk/RenderChunk","renderGlobal","Lnet/minecraft/client/renderer/RenderGlobal;");toInject.add(new VarInsnNode(ALOAD,0);toInject.add(new FieldInsnNode(GETFIELD,"net/minecraft/client/renderer/chunk/RenderChunk","worldView","Lnet/minecraft/world/ChunkCache;");toInject.add(new VarInsnNode(ALOAD,4);toInject.add(new VarInsnNode(ALOAD,5);toInject.add(new VarInsnNode(ALOAD,0);toInject.add(new FieldInsnNode(GETFIELD,"net/minecraft/client/renderer/chunk/RenderChunk","position","Lnet/minecraft/util/math/BlockPos$MutableBlockPos;");toInject.add(new VarInsnNode(FLOAD,1);toInject.add(new VarInsnNode(FLOAD,2);toInject.add(new VarInsnNode(FLOAD,3);toInject.add(new MethodInsnNode(INVOKESTATIC,"cadiboo/renderchunkrebuildchunkhooks/hooks/RenderChunkRebuildChunkHooksHooks","onRebuildChunkEvent","(Lnet/minecraft/client/renderer/RenderGlobal;Lnet/minecraft/world/ChunkCache;Lnet/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator;Lnet/minecraft/client/renderer/chunk/CompiledChunk;Lnet/minecraft/util/math/BlockPos$MutableBlockPos;FFF)Lnet/minecraftforge/client/event/RebuildChunkEvent;",false);toInject.add(new MethodInsnNode(INVOKEVIRTUAL,"cadiboo/renderchunkrebuildchunkhooks/event/RebuildChunkEvent","isCanceled","()Z",false); final Label l17 = new Label();toInject.add(new JumpInsnNode(IFEQ,l17);toInject.add(new InsnNode(RETURN); final Label l17 = new Label(); final LabelNode l17node = new LabelNode(this.l17);toInject.add(l17node);toInject.add(new LineNumberNode(148,l17node));toInject.add(new FrameNode(F_SAME,0,null,0,null));toInject.add(new FieldInsnNode(GETSTATIC,"java/lang/System","out","Ljava/io/PrintStream;"));toInject.add(new LdcInsnNode("fuk"));toInject.add(new MethodInsnNode(INVOKEVIRTUAL,"java/io/PrintStream","println","(Ljava/lang/String;)V",false)); // inject new instruction list into method instruction list iT uSED tO wORK iTS aLL yOUR fAULT fOR bREAKING eVERYTHING wITH tHE nEW fORGE uPDATE I didn't getEnoGH tIME tO upDatE aND teST mY mOD yOU havE tO help MEEEE!!!
  12. Remove Not Enough IDs or use a lower Forge version or wait for 1.13
  13. you need to use Java 8
  14. Where did you download it from (url)? Do you already have Minecraft installed? Did you use the installer? What Java do you have installed?
  15. Correct me if I'm wrong but aren't the "latest" versions exactly this? https://github.com/MinecraftForge/MinecraftForge/commits/1.12.x https://github.com/MinecraftForge/MinecraftForge/commit/76c138c40043431a6cdecf674570d757d89b26c7 Agreed
  16. do you have any logs at all?
  17. Please post your logs (preferably with GitHub Gist or PasteBin) and your code (preferably as a GitHub repository).
  18. Heres an in-depth explanation from Mezz
  19. TESRs are a lot worse for performance (they run every frame) than multipart models (they get computed every time a block update close to them happens) AND with TESRs you have to handle lighting etc. While with multipart models lighting gets handled automatically. You can also use a combination of multipart models and TESRs or Forge's Animation API to add other textures & effects. You might want to take a look at my mod which renders my energy cables with multipart models and renders electricity flowing with a TESR
  20. Hopefully, I'm going to try and put all this into code & see how it goes.
  21. The whole thread was pretty unproductive & boiled down to "Why didn't you modders enough time to update" -> "We did". Core mods aren't supported AND you can specify in 1 line of code what versions you mod does & does not run on. heres how: https://mcforge.readthedocs.io/en/latest/gettingstarted/structuring/#what-is-mod EDIT: I just found out that apparently core-mods can't do this? they can only use the @MCVersion annotation
  22. Seems to me as though you've got your horizontal EnumFacing values wrong. What exactly are you trying to do i.e. what are you trying to transfer? In your code I see vein and a custom energy capability and a whole bunch of classes with abbreviations in their name who's purpose is not immediately obvious. Also don't use IHasModel (or any variant - ItemM) Don't us static initialisers, use the @ObjectHolder annotation
  23. this -> new ResourceLocation(Reference.MOD_ID,name) this -> new ResourceLocation(Reference.MOD_ID, "textures/entity/dankjess_explosiveblock.png"); OR new ResourceLocation(Reference.MOD_ID, "entity/dankjess_explosiveblock.png");, I'm not sure which is correct, I think its the second one, but try both I think your brightness is somehow off. I think that you should replace your code with just the initial translation & try rendering your block with different brightnesses.
  24. I'm just trying to support mods without depending on them. For example supporting machines from other mods that only have Tesla & RF Energy. My question about the Event Subscriber is goes something like this Mod (that may not exist) has a custom furnace that fires a getItemCookTime (not smelt time) event. I want to return a non-standard cook time for one of my items. However this is the only time that my mod and the other mod ever interact, so I don't want to make my mod dependant on it. I'm going to be using this if(Loader.isModLoaded(OTHER_MOD_ID)) { MinecraftForge.EVENT_BUS.register(()->new OtherModDependantEventSubscriber()); }
×
×
  • Create New...

Important Information

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