Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

ZigTheHedge

Members
  • Posts

    52
  • Joined

  • Last visited

Everything posted by ZigTheHedge

  1. Okay. Solved. If anyone is interested: First of all, I had to use "relocate" in shadowJar to shadow both packages like this: shadowJar { configurations = [project.configurations.embed] relocate 'org.glassfish', 'shaded.glassfish' relocate 'javax.websocket', 'shaded.websocket' classifier = '' } After that, pay close attention at your META-INF. In my case there was a direct reference to unshadowed package service called "javax.websocket.ContainerProvider", containing unshadowed path to class... So, just find a way to replace this file with one, that is referencing your shadowed configuration. In my case, file is called "shaded.websocket.ContainerProvider".
  2. Hey, guys! I'm trying to add javax.websocket in my mod. In dev environment everything is smooth, but when I build my mod and add it to modpack, I'm getting java.lang.NoClassDefFoundError. Here's my build.gradle: buildscript { repositories { maven { url = 'https://maven.minecraftforge.net' } mavenCentral() repositories { maven { url "https://plugins.gradle.org/m2/" } } } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true classpath "com.github.jengelman.gradle.plugins:shadow:4.0.4" } } apply plugin: 'net.minecraftforge.gradle' // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. apply plugin: 'eclipse' apply plugin: 'maven-publish' apply plugin: 'com.github.johnrengelman.shadow' version = '1.16.5-1.0.0' group = 'com.cwelth.omd' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'omd' java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8. println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) minecraft { mappings channel: 'official', version: '1.16.5' runs { client { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' mods { examplemod { source sourceSets.main } } } server { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' mods { examplemod { source sourceSets.main } } } data { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') mods { examplemod { source sourceSets.main } } } } } // Include resources generated by data generators. sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { mavenLocal() mavenCentral() maven { url = 'https://mvnrepository.com/artifact/javax' } maven { url = 'https://mvnrepository.com/artifact/org.glassfish.tyrus.bundles' } flatDir { dirs 'libs\\' } } configurations { embed compileOnly.extendsFrom(embed) } shadowJar { configurations = [project.configurations.embed] } reobf { shadowJar { dependsOn tasks.createMcpToSrg mappings = tasks.createMcpToSrg.outputs.files.singleFile } } artifacts { archives tasks.shadowJar } dependencies { minecraft 'net.minecraftforge:forge:1.16.5-36.1.30' /* compile 'javax.websocket:javax.websocket-client-api:1.1' compile 'org.glassfish.tyrus.bundles:tyrus-standalone-client:1.9' */ embed 'javax.websocket:javax.websocket-client-api:1.1' embed 'org.glassfish.tyrus.bundles:tyrus-standalone-client:1.9' } // Example for how to get properties into the manifest for reading by the runtime.. jar { manifest { attributes([ "Specification-Title": "examplemod", "Specification-Vendor": "examplemodsareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"examplemodsareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } jar.finalizedBy('reobfJar') publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file:///${project.projectDir}/mcmodsrepo" } } } And I can see that needed packages are in my compiled jar:
  3. The same question. The only thing I could find is CommentedFileConfig.preserveInsertionOrder(), but either it doesn't work, or I'm doing something wrong...
  4. 125 isn't the limit. And I cannot figure out how to use datagenerators in 1.16.2: BlockStateProvider has only one meaningful method to override (act), but it is doing something already.
  5. I'm making a block which contains three different parts. Each of the parts can use one of five possible textures, leading to 125 blocks in total (due to flattening). I could make three states in block (one state per part) and just 15 models and use multipart blockstate to combine the final block, but parts can use different geometry themselves, increasing the number of possible states combination drastically. In 1.12.2 there was a way to specify texture in blockstate, and now, when forge blockstate format is gone, I cannot find a way to efficiently solve this task.
  6. Hey, guys and gals! In times of 1.12.2 there was a possibility to put normal obfuscated mod jar file in ./libs directory to make its classes accessible within dev environment. In recent versions however, that doesn't work. Yes, I know that I can (and probably should) use maven dependencies to load deobf versions of needed mods, but what to do if I want to use mod, whose maven repository doesn't exist? I've tried to use "compile fileTree(include: ['*.jar'], dir: 'libs')" which allows IDEA to see the internals of jars inside "libs" directory, but I cannot run the mod due to obfuscated names in jars, the same with local "flatDir" repo. Is it possible now at all?
  7. Well, actually, I did It seems, updatePostPlacement is my solution. But the method name is kinda misleading... I thought it is called after the block is placed, and has nothing to do with block breaking, Thanks
  8. Well, I'm struggling with getActualState absence... I have a block, which should act pretty much like fences do. It changes it's model (via BlockState) according to neighbors. I overrode updateNeighbors to set BlockStates to correct values when block is placed nearby, but this method doesn't get called when something destroys the block. What mechanic should I use to change the BlockState when nearby block is destroyed? Forge: 28.1.104
  9. Ah, nevermind. I've just changed IBlockState(s) for models to match FACING as well and removed rotation part from code. That fixed the lighting issue, so I'm happy
  10. Well, it seems that normals doesn't get rotated with the model itself when I use GlStateManager.rotate. I have a JSON model. One part of it is static, and two parts are dynamic. Dynamic parts are rendered using TESR. If the facing of model placed in world is NORTH (default) - everything is rendering as it should, but when model gets rotated, static part is rendered fine and TESR part looks like normals of dynamic parts are still pointing to the NORTH direction. Here are the screenshots: Model facing SOUTH Model facing NORTH TESR rendering part: @Override public void render(CounterTE te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) { GlStateManager.pushAttrib(); GlStateManager.pushMatrix(); GlStateManager.translate(x, y, z); GlStateManager.disableRescaleNormal(); renderDoor(te, partialTicks); GlStateManager.popMatrix(); GlStateManager.popAttrib(); } public void renderDoor(CounterTE te, float partialTicks) { GlStateManager.pushMatrix(); RenderHelper.disableStandardItemLighting(); this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); if (Minecraft.isAmbientOcclusionEnabled()) { GlStateManager.shadeModel(GL11.GL_SMOOTH); } else { GlStateManager.shadeModel(GL11.GL_FLAT); } World world = te.getWorld(); //Rotate renderer to match FACING GlStateManager.translate(.5F, 0, .5F); if(world.getBlockState(te.getPos()).getValue(CommonBlock.FACING) == EnumFacing.NORTH)GlStateManager.rotate(0, 0, 1, 0); if(world.getBlockState(te.getPos()).getValue(CommonBlock.FACING) == EnumFacing.EAST)GlStateManager.rotate(270, 0, 1, 0); if(world.getBlockState(te.getPos()).getValue(CommonBlock.FACING) == EnumFacing.SOUTH)GlStateManager.rotate(180, 0, 1, 0); if(world.getBlockState(te.getPos()).getValue(CommonBlock.FACING) == EnumFacing.WEST)GlStateManager.rotate(90, 0, 1, 0); GlStateManager.translate(-.5F, 0, -.5F); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferBuilder = tessellator.getBuffer(); bufferBuilder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); IBlockState stateLeft = NMFBlocks.counter.getDefaultState().withProperty(Counter.ASKFOR_LEFTDOOR, true); IBlockState stateRight = NMFBlocks.counter.getDefaultState().withProperty(Counter.ASKFOR_RIGHTDOOR, true); BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); IBakedModel modelLeft = dispatcher.getModelForState(stateLeft); IBakedModel modelRight = dispatcher.getModelForState(stateRight); GlStateManager.pushMatrix(); //Render LEFT door GlStateManager.translate(0.96875F, 0, 0.15625F); if(te.getMovingDelta() != 0) GlStateManager.rotate(-(te.getOpenProgress() + partialTicks * ((te.getMovingDelta() > 0) ? 1 : -1)), 0, 1, 0); else GlStateManager.rotate(-te.getOpenProgress(), 0, 1, 0); GlStateManager.translate(-0.96875F, 0, -0.15625F); GlStateManager.translate(-te.getPos().getX(), -te.getPos().getY(), -te.getPos().getZ()); dispatcher.getBlockModelRenderer().renderModel(world, modelLeft, stateLeft, te.getPos(), bufferBuilder, true); tessellator.draw(); GlStateManager.translate(te.getPos().getX(), te.getPos().getY(), te.getPos().getZ()); GlStateManager.popMatrix(); GlStateManager.pushMatrix(); //Render RIGHT door bufferBuilder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); GlStateManager.translate(0.03125F, 0, 0.15625F); if(te.getMovingDelta() != 0) GlStateManager.rotate(te.getOpenProgress() + partialTicks * ((te.getMovingDelta() > 0) ? 1 : -1), 0, 1, 0); else GlStateManager.rotate(te.getOpenProgress(), 0, 1, 0); GlStateManager.translate(-0.03125F, 0, -0.15625F); GlStateManager.translate(-te.getPos().getX(), -te.getPos().getY(), -te.getPos().getZ()); dispatcher.getBlockModelRenderer().renderModel(world, modelRight, stateRight, te.getPos(), bufferBuilder, true); bufferBuilder.putNormal(0F, 1F, 0F); tessellator.draw(); GlStateManager.translate(te.getPos().getX(), te.getPos().getY(), te.getPos().getZ()); GlStateManager.popMatrix(); RenderHelper.enableStandardItemLighting(); GlStateManager.popMatrix(); } TESR is necessary because of block inventory rendering. That's actually the only reason why I don't use ASM animation...
  11. There are no flags in scheduleBlockUpdate, it's only delay and priority. Try to start block update with world.notifyBlockUpdate instead.
  12. It won't be translated, right? If so, what's the problem? Just return your translated name from Block::getUnlocalizedName override.
  13. And now, when you know your files paths and names are ok, you can just recreate IDEA project by copy-pasting your gradle and src folders and build.gradle to new location, and re-importing build.gradle into the new workspace. I know that's kinda last resort thing, but - works for me
  14. It doesn't matter what class method is responsible for reacting on FMLPreInitializationEvent with this call, but it has to be on CLIENT side only.
  15. That's definitely the problem with IDEA and gradle 4.8.1 because I have the very same issue every damned time I'm cloning my old project from github into new dev environment. But usually I'm able to fix it by rerunning setupDecompWorkspace and genIntelliJRuns with IDEA closed. That issue has nothing to do with file names and locations because they ARE correct. You can try to run runClient task from gradle directly to see that everything is loading properly. I'm not experienced in gradle or IDEA internals, so I cannot point to exact problematic place...
  16. If your model is a JSON model, just open it in plain text editor and take a look at boxes coordinates. They should not be less then zero and should not exceed 16. I think the program that you used to create this model should perform better though.
  17. Try to rerun setupDecompWorkspace if you're developing in IDEA with updated gradle.
  18. @Mod.EventBusSubscriber(Side.CLIENT) public class ClientProxy extends CommonProxy { ... @Override public void preInit(FMLPreInitializationEvent e) { OBJLoader.INSTANCE.addDomain(MODID); super.preInit(e); } ... } Something like this. And don't forget to create blockstate json for your item (it should point to .obj file in "defaults" section): { "forge_marker": 1, "defaults": { "model": "modid:knight_helmet.obj" }, "variants": { "inventory":[{ "transform": "forge:default-item" }] } } Something like that.
  19. I can't see the part of code which should call registerItemModel from item class. I think, you've missed ModelRegistryEvent. @Mod.EventBusSubscriber public static class RegistrationHandler { // ... @SubscribeEvent public static void registerItems(ModelRegistryEvent event) { ModItems.registerModels(); } }
  20. I hope you haven't forgot to call OBJLoader.INSTANCE.addDomain in your clientProxy? UPD: And your model is HUGE btw!
  21. Try flipping "V" in your blockstate "custom": { "flip-v": true }
  22. Just point the "model" parameter in your blockstate to .obj file (extension is needed!) instead of json-model and include OBJLoader.INSTANCE.addDomain(YOUR_MOD_ID); in your ClientProxy (in static).
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.