Jump to content

Papa_Prime

Members
  • Posts

    23
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Papa_Prime

  1. Thanks, I will experiment with other GL modes. I resorted to using GL11 directly because I did not even manage to render it with the wrapper. Edit: And the line strip works. now to just get it working with the wrappers
  2. hello, I am attempting to render lines in a GUI. This will not be possible to achieve with textures. I have attempted to use the methods documented in this for unbatched environments but the methods do not seem to exist this is the documentation https://gist.github.com/williewillus/30d7e3f775fe93c503bddf054ef3f93e. I further tried to do this using GL11. I have successfully rendered a line but I was unable to change the colour of the line. This is what I tried in the render method: GL11.glPushMatrix(); GL11.glPushAttrib(GL11.GL_COLOR_MATERIAL); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glLineWidth(6.0f); GL11.glColor3ub((byte)255,(byte)0,(byte)0); GL11.glBegin(GL11.GL_LINES); GL11.glVertex3d(1, 1, 0); GL11.glVertex3d(100, 100, 0); GL11.glEnd(); GL11.glPopMatrix(); GL11.glPopAttrib();
  3. I caught on to that when I went to test it. Going to update it here now, this is what I got to work.
  4. Here is the update code, not fully functional yet but getting there: public class ActionControlCSPacket { static Map map; public ActionControlCSPacket(Map controlMap) { map = controlMap; } public static void encode(ActionControlCSPacket msg, PacketBuffer buf) { Integer[] players = (Integer[]) map.keySet().toArray(new Integer[0]); int[] id = new int[players.length]; for(int i = 0; i < players.length; i++) { id[i] = players[i].intValue(); } Integer[] preValues = (Integer[]) map.values().toArray(new Integer[0]); int[] values = new int[players.length]; for(int i = 0; i < players.length; i++) { values[i] = preValues[i].intValue(); } buf.writeVarIntArray(id); buf.writeVarIntArray(values); } public static ActionControlCSPacket decode(PacketBuffer buf) { Minecraft mc = Minecraft.getInstance(); World world = mc.player.world; int[] id = buf.readVarIntArray(); int[] values = buf.readVarIntArray(); Map hmap = new HashMap<Integer, Integer>(); for(int i = 0; i < id.length; i++) { hmap.put(id[i], values[i]); } return new ActionControlCSPacket(hmap); } public static void handle(ActionControlCSPacket message, Supplier<NetworkEvent.Context> ctx) { ActionControl.setControl(map); ctx.get().setPacketHandled(true); } } Just need to fix the array out of bounds exception which is easy. Leaving this here in case anyone finds more mistakes in my code. Going offline for now. Edit: Updated to a version which seems to work
  5. Hello, I am currently trying to sync the client with the server. I am currently unable to find a way in which I can encode entity identifiers from the server to the client. This is my current code: public class ActionControlCSPacket { static Map map; public ActionControlCSPacket(Map controlMap) { map = controlMap; } public static void encode(ActionControlCSPacket msg, PacketBuffer buf) { PlayerEntity[] players = (PlayerEntity[]) map.keySet().toArray(new PlayerEntity[0]); CompoundNBT tag = new CompoundNBT(); for(int t = 0; t < players.length; t++) { tag.put(String.valueOf(t), players[t].serializeNBT()); } Integer[] values1 = (Integer[]) map.values().toArray(new Integer[0]); int[] values = new int[0]; for(int i = 0; i < values1.length; i++) { values[i] = values1[i].intValue(); } buf.writeCompoundTag(tag); buf.writeVarIntArray(values); } public static ActionControlCSPacket decode(PacketBuffer buf) { CompoundNBT tag = buf.readCompoundTag(); int[] values = buf.readVarIntArray(); Map hmap = new HashMap<PlayerEntity, Integer>(); for(int i = 0; i < values.length; i++) { hmap.put(?????, values[i]); } return new ActionControlCSPacket(hmap); } public static void handle(ActionControlCSPacket message, Supplier<NetworkEvent.Context> ctx) { ActionControl.setControl(map); System.out.print("called"); ctx.get().setPacketHandled(true); } } I have tried using the decoded tag in a number of ways but was unable to use the INBT to identify an entity. An idea would be to encode player IDs and then find them on the client but I am not aware of a method which allows me to do this although I am certain that it exists. Any help would be appreciated. Edit: I have located such a method in the world class. Was obvious, still working on a solution.
  6. Fair, I will begin working on the addition to forge then. Edit: This will need far more changes to be convenient. I understand why nobody has added this as a feature of forge yet. Will try to find another way to mess with UseActions
  7. I'm guessing that in the correct order, a PR is made first?
  8. Thank you, the only alternative to avoiding coremodding in my case is making a PR. That was planned for after the system I have in mind is stable and using mixins makes porting easier.
  9. Thank you, can you recommend a work around for this or should I try to handle it myself?
  10. Hello, this is how I embed the jar using my buildscript buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } maven { url = "https://repo.spongepowered.org/maven" } jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT' } } import net.minecraftforge.gradle.common.task.SignJar import groovy.json.JsonSlurper import groovy.json.JsonOutput plugins { id 'org.spongepowered.plugin' version '0.6' id 'com.github.johnrengelman.shadow' version '1.2.4' } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' version = '1.0' group = 'net.papaprime.papacore' archivesBaseName = 'papacore' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' repositories { jcenter() maven { name = "spongepowered" url = "https://repo.spongepowered.org/maven" } } configurations { inJar } configurations.compile.extendsFrom(configurations.inJar) minecraft { mappings channel: 'snapshot', version: '20200514-1.15.1' runs { client { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { papacore { source sourceSets.main } } } server { workingDirectory project.file('run') property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' property 'forge.logging.console.level', 'debug' mods { papacore { source sourceSets.main } } } data { workingDirectory project.file('run') property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' property 'forge.logging.console.level', 'debug' args '--mod', 'papacore', '--all', '--output', file('src/generated/resources/') mods { papacore { source sourceSets.main } } } } } dependencies { minecraft 'net.minecraftforge:forge:1.15.2-31.2.8' // For more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html inJar("org.spongepowered:mixin:0.8") } jar { manifest { attributes([ "TweakClass": "org.spongepowered.asm.launch.MixinTweaker", "TweakOrder": 0, "MixinConfigs": "mixins.papacore.json", "Specification-Title": "papacore", "Specification-Vendor": "papacoresareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"papacoresareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "ContainedDeps": "mixin-0.8.jar" ]) } from(configurations.inJar) { into 'META-INF/libraries' } } task signJar(type: SignJar, dependsOn: jar) { // findProperty allows us to reference the property without it existing. // Using project.propName would cause the script to fail validation if // the property did not exist. keyStore = project.findProperty('keyStore') alias = project.findProperty('keyStoreAlias') storePass = project.findProperty('keyStorePass') keyPass = project.findProperty('keyStoreKeyPass') inputFile = jar.archivePath outputFile = jar.archivePath } build.dependsOn signJar jar.finalizedBy('reobfJar') publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file:///${project.projectDir}/mcmodsrepo" } } } The packaging seems fine, no errors are thrown and the files are successfully signed. But when I load it outside of the dev environment it crashes with this at the start suggesting that the library was not in fact extracted: java.lang.NoClassDefFoundError: org/spongepowered/asm/launch/MixinBootstrap [09Jun2020 19:22:42.125] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.papaprime.papacore.asm.TransformationService.initialize(TransformationService.java:31) [09Jun2020 19:22:42.126] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.TransformationServiceDecorator.onInitialize(TransformationServiceDecorator.java:68) [09Jun2020 19:22:42.126] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.TransformationServicesHandler.lambda$initialiseTransformationServices$7(TransformationServicesHandler.java:107) [09Jun2020 19:22:42.126] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.TransformationServicesHandler$$Lambda$85/182531396.accept(Unknown Source) [09Jun2020 19:22:42.126] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at java.util.HashMap$Values.forEach(HashMap.java:972) [09Jun2020 19:22:42.127] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.TransformationServicesHandler.initialiseTransformationServices(TransformationServicesHandler.java:107) [09Jun2020 19:22:42.127] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:59) [09Jun2020 19:22:42.128] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.Launcher.run(Launcher.java:75) [09Jun2020 19:22:42.128] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [09Jun2020 19:22:42.131] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: Caused by: java.lang.ClassNotFoundException: org.spongepowered.asm.launch.MixinBootstrap [09Jun2020 19:22:42.132] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: at java.net.URLClassLoader.findClass(URLClassLoader.java:381) [09Jun2020 19:22:42.132] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [09Jun2020 19:22:42.132] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [09Jun2020 19:22:42.132] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: ... 9 more I have searched for the issue with dependency extraction but I was not successful. Any help would be appreciated
  11. I have done a bit of digging and managed to find a solution. This is the build script as I have it now: buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } maven { url = "https://repo.spongepowered.org/maven" } jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT' } } plugins { id 'org.spongepowered.plugin' version '0.6' } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' version = '1.0' group = 'net.papaprime.animationcore' archivesBaseName = 'animationcore' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' repositories { jcenter() maven { name = "spongepowered" url = "https://repo.spongepowered.org/maven" } } configurations { inJar } configurations.compile.extendsFrom(configurations.inJar) minecraft { mappings channel: 'snapshot', version: '20200514-1.15.1' runs { client { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { animationcore { source sourceSets.main } } } server { workingDirectory project.file('run') property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' property 'forge.logging.console.level', 'debug' mods { animationcore { source sourceSets.main } } } data { workingDirectory project.file('run') property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' property 'forge.logging.console.level', 'debug' args '--mod', 'animationcore', '--all', '--output', file('src/generated/resources/') mods { animationcore { source sourceSets.main } } } } } dependencies { minecraft 'net.minecraftforge:forge:1.15.2-31.2.8' // For more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html inJar("org.spongepowered:mixin:0.8") } jar { manifest { attributes([ "TweakClass": "org.spongepowered.asm.launch.MixinTweaker", "TweakOrder": 0, "Specification-Title": "animationcore", "Specification-Vendor": "animationcoresareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"animationcoresareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "ContainedDeps": "mixin-0.8.jar" ]) } from(configurations.inJar) { into 'META-INF/libraries' } } jar.finalizedBy('reobfJar') publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file:///${project.projectDir}/mcmodsrepo" } } } This appears to be working.
  12. Hello, I am trying to embed a library into my mod. This is the documentation I am using which also seems out of date https://forgegradle.readthedocs.io/en/latest/user-guide/shading/. This is my build.gradle: buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } maven { url = "https://repo.spongepowered.org/maven" } jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT' } } plugins { id 'org.spongepowered.plugin' version '0.6' } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' version = '1.0' group = 'net.papaprime.animationcore' archivesBaseName = 'animationcore' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' repositories { jcenter() maven { name = "spongepowered" url = "https://repo.spongepowered.org/maven" } } configurations { shade compile.extendsFrom(shade) } minecraft { mappings channel: 'snapshot', version: '20200514-1.15.1' runs { client { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { animationcore { source sourceSets.main } } } server { workingDirectory project.file('run') property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' property 'forge.logging.console.level', 'debug' mods { animationcore { source sourceSets.main } } } data { workingDirectory project.file('run') property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' property 'forge.logging.console.level', 'debug' args '--mod', 'animationcore', '--all', '--output', file('src/generated/resources/') mods { animationcore { source sourceSets.main } } } } } dependencies { minecraft 'net.minecraftforge:forge:1.15.2-31.2.8' // For more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html shade("org.spongepowered:mixin:0.8") compile("org.spongepowered:mixin:0.8") } jar { manifest { attributes([ "TweakClass": "org.spongepowered.asm.launch.MixinTweaker", "TweakOrder": 0, "Specification-Title": "animationcore", "Specification-Vendor": "animationcoresareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"animationcoresareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } from configurations.shade.copyRecursive().setTransitive(false).each { artifact -> from (zipTree(artifact)) } } jar.finalizedBy('reobfJar') publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file:///${project.projectDir}/mcmodsrepo" } } } after running gradlew build it does produce a jar with the library embedded in it. This jar crashes instantly in a release version of minecraft. This is the crash report found in the log: [07Jun2020 18:00:44.388] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: org.spongepowered.asm.launch.MixinInitialisationError: Mixin Launch Plugin Service could not be located [07Jun2020 18:00:44.388] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at org.spongepowered.asm.launch.MixinTransformationService.initialize(MixinTransformationService.java:76) [07Jun2020 18:00:44.388] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.TransformationServiceDecorator.onInitialize(TransformationServiceDecorator.java:68) [07Jun2020 18:00:44.389] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.TransformationServicesHandler.lambda$initialiseTransformationServices$7(TransformationServicesHandler.java:107) [07Jun2020 18:00:44.389] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.TransformationServicesHandler$$Lambda$85/2109798150.accept(Unknown Source) [07Jun2020 18:00:44.389] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at java.util.HashMap$Values.forEach(HashMap.java:972) [07Jun2020 18:00:44.389] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.TransformationServicesHandler.initialiseTransformationServices(TransformationServicesHandler.java:107) [07Jun2020 18:00:44.390] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:59) [07Jun2020 18:00:44.390] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.Launcher.run(Launcher.java:75) [07Jun2020 18:00:44.390] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) Any help would be appreciated
  13. Hello, I would really like to avoid any form of core modding or vanilla file replacement. I have got this but entity models are not possible to modify in this way after registration. Either way here is my attempt: @SubscribeEvent public static void renderPlayer(RenderPlayerEvent.Pre event) { PlayerEntity player = event.getPlayer(); PlayerModel<AbstractClientPlayerEntity> model = event.getRenderer().getEntityModel(); if (player.getCapability(VoidProvider.VOID, null).isPresent()) { IVoid cap = player.getCapability(VoidProvider.VOID, null).orElse(null); if (player.getActiveItemStack().getItem() instanceof ItemCasting && cap.getMaxCharge() > 0) { ModelRenderer arm = model.bipedRightArm;; arm.rotateAngleY = -0.6F; } } }
  14. You have shown us very little information. Generally you could check if the model file name is the same as the registry name and if the model points to the correct texture in the format of modid:path_here . You should also check the log and search for the registry name of your item to check what is not loaded and why.
  15. Marking solved. silly mistake. I did not specify the positions of the particleand thus it spawned at the world origin 0,0,0 as expected from the vertex code
  16. I am experiencing an issue with rendering the custom particle. Everything is set up properly(I have tested it with the vanilla implementation) and issues only occur when I begin to use custom rendering. @Override public void renderParticle(IVertexBuilder buffer, ActiveRenderInfo renderInfo, float partialTicks) { RenderSystem.pushMatrix(); RenderSystem.enableDepthTest(); RenderSystem.disableTexture(); BufferBuilder buf = Tessellator.getInstance().getBuffer(); buf.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); IVertexBuilder buff = buf.getVertexBuilder(); int j = this.getBrightnessForRender(partialTicks); Vec3d projectedView = renderInfo.getProjectedView(); RenderSystem.translated(-projectedView.x, -projectedView.y, -projectedView.z); injectPreBuffer(buff); //TOP buff.pos(1, 1, 1).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(0, 1, 1).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(0, 1, 0).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(1, 1, 0).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); //BOTOM buff.pos(1, 0, 1).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(0, 0, 1).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(0, 0, 0).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(1, 0, 0).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); //Side1 buff.pos(1, 1, 0).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(0, 1, 0).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(0, 0, 0).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(1, 0, 0).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); //Side2 buff.pos(1, 1, 1).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(0, 1, 1).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(0, 0, 1).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(1, 0, 1).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); //Side3 buff.pos(0, 1, 1).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(0, 0, 1).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(0, 0, 0).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(0, 1, 0).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); //Side4 buff.pos(1, 1, 1).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(1, 0, 1).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(1, 0, 0).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); buff.pos(1, 1, 0).tex(minU, minV).color(r, g, b, a).lightmap(j).endVertex(); injectPostBuffer(buff); Tessellator.getInstance().draw(); RenderSystem.enableTexture(); RenderSystem.popAttributes(); RenderSystem.popMatrix(); } @Override public IParticleRenderType getRenderType() { return IParticleRenderType.CUSTOM; } This rendering code does not produce errors but it doesn't render anything either. If I remove this: Tesselator.getInstance().draw(); The game crashes with: Description: Rendering Particle java.lang.IllegalStateException: Already building! at net.minecraft.client.renderer.BufferBuilder.begin(BufferBuilder.java:176) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.papaprime.gaze.client.fx.CubicParticle.renderParticle(CubicParticle.java:50) ~[main/:?] {re:classloading} at net.minecraft.client.particle.ParticleManager.renderParticles(ParticleManager.java:330) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:1084) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:612) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:434) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:962) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:559) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:177) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_251] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_251] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_251] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.0.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.0.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.0.0.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.0.0.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.0.0.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace: at net.minecraft.client.renderer.BufferBuilder.begin(BufferBuilder.java:176) at net.papaprime.gaze.client.fx.CubicParticle.renderParticle(CubicParticle.java:50) -- Particle being rendered -- Details: Particle: VoidFX, Pos (148.37379868704417,140.37968291644503,154.80088228616063), RGBA (1.0,1.0,1.0,1.0), Age 5 Particle Type: CUSTOM Stacktrace: at net.minecraft.client.particle.ParticleManager.renderParticles(ParticleManager.java:330) at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:1084) at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:612) The debug loop does not have any other interesting details. If I use the vertex buffer provided in the method and slight adjustments to my code, which also means that I do not get the buffer builder instance, I get the following crash: Description: Rendering Particle java.lang.IllegalStateException: BufferBuilder not started at net.minecraft.client.renderer.BufferBuilder.getCurrentElement(BufferBuilder.java:322) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at com.mojang.blaze3d.vertex.IVertexConsumer.pos(IVertexConsumer.java:21) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.papaprime.gaze.client.fx.CubicParticle.renderParticle(CubicParticle.java:47) ~[main/:?] {re:classloading} at net.minecraft.client.particle.ParticleManager.renderParticles(ParticleManager.java:330) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:1084) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:612) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:434) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:962) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:559) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:177) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_251] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_251] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_251] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.0.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.0.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.0.0.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.0.0.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.0.0.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.15.2-31.1.44_mapped_snapshot_20200225-1.15.1-recomp.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace: at net.minecraft.client.renderer.BufferBuilder.getCurrentElement(BufferBuilder.java:322) at com.mojang.blaze3d.vertex.IVertexConsumer.pos(IVertexConsumer.java:21) at net.papaprime.gaze.client.fx.CubicParticle.renderParticle(CubicParticle.java:47) -- Particle being rendered -- Details: Particle: VoidFX, Pos (134.74721086926692,93.8254443294199,107.66141755800653), RGBA (1.0,1.0,1.0,1.0), Age 6 Particle Type: CUSTOM Stacktrace: at net.minecraft.client.particle.ParticleManager.renderParticles(ParticleManager.java:330) at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:1084) at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:612)
  17. Thank you, I will use that in the future. I have noticed that there are different versions of the method but couldn't determine what each one takes as the mappings are not named.
  18. The render engine seems to scale all blits to 256x256, as it is for GUIs, using a 256x256 resolution solved the problem. It was not noticeable with one of the elements as the image border was close to being a square.
  19. Yes, thank you for helping me to figure out at least the image resolutions easier to scale with. Issue is still open as the core issue is yet to identify
  20. Yes, that's what I intend on doing and to just call to get the correct scale as a temporary solution: RenderSystem.scalef(f1, f2, f3); I am not using a item/gui/block. I'm drawing directly to the screen using blit(posX, posY, offsetX, offsetY, texturesizeX, texturesizeY) which does not seem to be affected by forge in VoidBarElement, thus the confusion
  21. The texture is at a custom resolution but it did seem to work with the texture used in VoidBarElement which is 100 x 96. I have drawn a 64 x 64 texture testing to test that element for stretching. The image is no longer distorted but each side had to be increased by a factor of 4 to render the whole image as you can see below. https://postimg.cc/XZwLq9CZ
  22. The issues seems to be with the Instant Massive Structures Mod, or that's what is reported as having an error near the bottom of the log reporting on mod states. Check if you installed it correctly and if nothing else works, you may have to remove it.
  23. Hello, I am having a rendering issue which I could not seem to figure out. Here are the relevant files and code. I have changed the texture mappings for the texture that is having issues to show that it is loading but not in the intended way. The capability works as intended. Original Texture: https://postimg.cc/MnDNyRcN How it is rendered: https://postimg.cc/9zQdM9Vz Event @OnlyIn(value = Dist.CLIENT) public class HudRender extends AbstractGui { @SubscribeEvent public void renderOverlay(RenderGameOverlayEvent event) { float partial = event.getPartialTicks(); if (event.getType() == RenderGameOverlayEvent.ElementType.EXPERIENCE) { VoidBarElement.element(partial); BarCapsuleElement.element(); } } } VoidBarElement public class VoidBarElement { private static float cycle; private static ResourceLocation tex = new ResourceLocation(Main.modid, "textures/hud/void_bar.png");; public static void element(float sch) { RenderSystem.pushMatrix(); cycle += sch; if(cycle > 100000) { cycle = 0; } Minecraft mc = Minecraft.getInstance(); int posY = mc.getMainWindow().getScaledHeight() - 15; int posX = mc.getMainWindow().getScaledWidth() - 110; ClientPlayerEntity player = Minecraft.getInstance().player; IVoid cap = player.getCapability(VoidProvider.VOID, null).orElse(null); int width = (int) ((cap.getVoid() / 800) * 100); RenderSystem.pushTextureAttributes(); RenderSystem.enableAlphaTest(); RenderSystem.enableBlend(); RenderSystem.color4f(1F, 1F, 1F, 0.6F); mc.getTextureManager().bindTexture(tex); mc.ingameGUI.blit(posX, posY, 0, (int) cycle, width, 8); RenderSystem.popAttributes(); RenderSystem.popMatrix(); } } CapsuleBarElement public class BarCapsuleElement { private static ResourceLocation tex = new ResourceLocation(Main.modid, "textures/hud/capsule_bar.png"); public static void element() { RenderSystem.pushMatrix(); Minecraft mc = Minecraft.getInstance(); int posY = mc.getMainWindow().getScaledHeight() /2; int posX = mc.getMainWindow().getScaledWidth() /2; RenderSystem.pushTextureAttributes(); mc.getTextureManager().bindTexture(tex); mc.ingameGUI.blit(posX, posY, 0, 0, 200, 100); RenderSystem.popAttributes(); RenderSystem.popMatrix(); } } Thank you, I tried to keep the code clean.
×
×
  • Create New...

Important Information

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