
Papa_Prime
Members-
Posts
23 -
Joined
-
Last visited
-
Days Won
1
Papa_Prime last won the day on November 15 2020
Papa_Prime had the most liked content!
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Papa_Prime's Achievements

Tree Puncher (2/8)
1
Reputation
-
[1.15.2][SOLVED] Rendering Lines in unBatched Environments
Papa_Prime replied to Papa_Prime's topic in Modder Support
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 -
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();
-
[1.15.2][Solved] Getting entity on Client Side
Papa_Prime replied to Papa_Prime's topic in Modder Support
I caught on to that when I went to test it. Going to update it here now, this is what I got to work. -
[1.15.2][Solved] Getting entity on Client Side
Papa_Prime replied to Papa_Prime's topic in Modder Support
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 -
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.
-
[1.15.2][Resolved] Embedded Jar not Extracted
Papa_Prime replied to Papa_Prime's topic in ForgeGradle
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 -
[1.15.2][Resolved] Embedded Jar not Extracted
Papa_Prime replied to Papa_Prime's topic in ForgeGradle
I'm guessing that in the correct order, a PR is made first? -
[1.15.2][Resolved] Embedded Jar not Extracted
Papa_Prime replied to Papa_Prime's topic in ForgeGradle
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. -
[1.15.2][Resolved] Embedded Jar not Extracted
Papa_Prime replied to Papa_Prime's topic in ForgeGradle
Thank you, can you recommend a work around for this or should I try to handle it myself? -
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
-
[1.15.2][Solved] Embedding library in mod
Papa_Prime replied to Papa_Prime's topic in Modder Support
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.- 1 reply
-
- 1
-
-
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
-
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; } } }
-
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.
-
[1.15.2] [SOLVED] 3 Dimensional Particle Rendering
Papa_Prime replied to Papa_Prime's topic in Modder Support
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