Jump to content

How can I make my vertex CUBE particle rotate while falling?


Recommended Posts

this is what I edited in EntityDiggingFX.class(yes, I'm doing this in MCP):


public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_)
        float var8 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F;
        float var9 = var8 + 0.015609375F;
        float var10 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F;
        float var11 = var10 + 0.015609375F;
        float var12 = 0.1F * this.particleScale;

        if (this.particleIcon != null)
        	var8 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F));
            var9 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F));
            var10 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F));
            var11 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F));

        float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX);
        float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY) - var12 / 2;
        float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ);
        p_70539_1_.setColorOpaque_F(1F, 1F, 1F);
        //var8, var9 - X U
        //var 10, var 11 - Y V
        p_70539_1_.addVertexWithUV(var13,         var14,         var15, (double)var8, (double)var10);
        p_70539_1_.addVertexWithUV(var13,         var14 + var12, var15, (double)var8, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15, (double)var9, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14,         var15, (double)var9, (double)var10);
        p_70539_1_.addVertexWithUV(var13 + var12, var14,         var15 + var12, (double)var8, (double)var10);
        p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15 + var12, (double)var8, (double)var11);
        p_70539_1_.addVertexWithUV(var13,         var14 + var12, var15 + var12, (double)var9, (double)var11);
        p_70539_1_.addVertexWithUV(var13,         var14,         var15 + var12, (double)var9, (double)var10);
        p_70539_1_.addVertexWithUV(var13, var14,         var15 + var12, (double)var8, (double)var10);
        p_70539_1_.addVertexWithUV(var13, var14 + var12, var15 + var12, (double)var8, (double)var11);
        p_70539_1_.addVertexWithUV(var13, var14 + var12, var15,         (double)var9, (double)var11);
        p_70539_1_.addVertexWithUV(var13, var14,         var15,         (double)var9, (double)var10);
        p_70539_1_.addVertexWithUV(var13 + var12, var14,         var15,         (double)var8, (double)var10);
        p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15,         (double)var8, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15 + var12, (double)var9, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14,         var15 + var12, (double)var9, (double)var10);
        p_70539_1_.addVertexWithUV(var13,         var14 + var12, var15,         (double)var8, (double)var10);
        p_70539_1_.addVertexWithUV(var13,         var14 + var12, var15 + var12, (double)var8, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15 + var12, (double)var9, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14 + var12, var15,         (double)var9, (double)var10);
        p_70539_1_.addVertexWithUV(var13,         var14, var15 + var12, (double)var8, (double)var10);
        p_70539_1_.addVertexWithUV(var13,         var14, var15,         (double)var8, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14, var15,         (double)var9, (double)var11);
        p_70539_1_.addVertexWithUV(var13 + var12, var14, var15 + var12, (double)var9, (double)var10);



now how do I make the cube rotate randomly while falling? By adding some code to the onUpdate method in EntityFX perhabs?

Link to comment
Share on other sites

This topic is now closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello im trying to make a mod and the past few days GSON has almost killed me, when i export the mod and then launch it through minecraft launcher i get java.lang.NoSuchMethodError: com.google.gson.JsonParser.parseString(Ljava/lang/String;)Lcom/google/gson/JsonElement; i have literally tried everything here is my build config   dependencies { minecraft("com.mojang:minecraft:1.8.9") mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9") forge("net.minecraftforge:forge:1.8.9-") compileOnly("cc.polyfrost:oneconfig-1.8.9-forge:0.2.2-alpha+") shadowImpl("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta+") { isTransitive = false exclude(module = "gson") } shadowImpl("org.spongepowered:mixin:0.7.11-SNAPSHOT") { isTransitive = false exclude(module = "gson") } annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT") shadowImpl("org.javassist:javassist:3.15.0-GA") { isTransitive = false exclude(module = "gson") } shadowImpl("com.neovisionaries:nv-i18n:1.28") { isTransitive = false exclude(module = "gson") } shadowImpl("org.apache.commons:commons-lang3:3.4") { isTransitive = false exclude(module = "gson") } shadowImpl("org.apache.httpcomponents:httpcore:4.4.5") { isTransitive = false exclude(module = "gson") } compileOnly("com.google.code.gson:gson:2.8.6") { isTransitive = false } configurations.all { resolutionStrategy { force("com.google.code.gson:gson:2.8.6") } } shadowImpl(fileTree( mapOf( "dir" to "libs", "include" to listOf("*.jar"), "exclude" to listOf( "asm", "asm-commons", "asm-tree", "gson", "unspecified", "nv-i18n" ) ) )) }  
    • @chxr Looks like you're making some sort of a crafting table / furnace hybrid? Are the inputs needing arranging like a shaped recipe, or is it shapeless? I'll assume it's shapeless since that just adds a lot more complexity. In that case I'd probably do something like this { "type": "relativedimensions:particle_rebound", "inputs": [ { "ingredient": { "item": "relativedimensions:aberrant_shard" }, "count": 8 } ], "fuel": { "tag": "relativedimensions:block/aberrant_fuel" }, "output": { "Count": 1, "id": "relativedimensions:aberrant_ingot" } } inputs: A list of ingredients and how many are needed. The count among each input adds up to 8. Since there's only 1 ingredient, the count is set to 8. fuel: Same thing as before but remove the list and just make it an object with a tag. output: Kept the same.   In this case the Codec I would make is public record ParticleReboundIngredient(Ingredient ingredient, int count) { public static final Codec<ParticleReboundIngredient> CODEC = RecordCodecBuilder.create( builder -> builder.group( Ingredient.CODEC.fieldOf("ingredient").forGetter((i) -> i.ingredient), Codec.INT.fieldOf("count").forGetter(i -> i.count) ).apply(builder, ParticleReboundIngredient::new) ); } public record ParticleReboundFuel(String tag) { public static final Codec<ParticleReboundFuel> CODEC = RecordCodecBuilder.create( builder -> builder.group(Codec.STRING.fieldOf("tag").forGetter(f -> f.tag)).apply(builder, ParticleReboundFuel::new) ); public boolean isFuel(ItemStack stack) { // TODO: Check if fuel item matches the tag } } public record ParticleReboundRecipe(List<ParticleReboundIngredient> inputs, ParticleReboundFuel fuel, ItemStack output) { public static final Codec<ParticleReboundRecipe> CODEC = RecordCodecBuilder.create( builder -> builder.group( ParticleReboundIngredient.CODEC.listOf().fieldOf("inputs").forGetter(r -> r.inputs), ParticleReboundFuel.CODEC.fieldOf("fuel").forGetter(r -> r.fuel), ItemStack.CODEC.fieldOf("output").forGetter(r -> r.output) ).apply(builder, ParticleReboundRecipe::new) ); }   There might be a more proper Codec for the fuel and the tag that's built into minecraft / forge, but I didn't look
    • Tested with 5900X, 64GB 3200 MHz, 3070 Ti, driver 551.86 GPU clock range: 200 - 1950 MHz, usually 210 MHz with 10-30% utilisation on desktop idle use Render settings: Vsync ON, Framerate unlimited, Render distance 32, Fullscreen ON (60hz monitor, so 60 fps with vsync) Vanilla minecraft: Main menu: 210mhz idle clock always, ingame clock around 400 - 1000 mhz with ~30% utilisation and after alt+tab stays at same. Modded install with curseforge app, only said forge added: Main menu: 210 mhz idle clock always, ingame clock around 400 - 1000 mhz with ~30% utilisation, but after alt+tab gpu clock shoots up to 1950 mhz and utilisation is at 50-60% After disabling all render and chunk related stuff in config, after alt+tab it goes up to 1500 mhz. So game turns gpu into space heater when its not even seen. GPU usage returns to expected when game comes back on top. If instead of unlimited fps, fps is set to ~60, then during alt+tab gpu stays at same range as vanilla, but minecraft has horrible limit logic and framerate limit causes lot of tearing, so its not an option. So it seems that when alt+tabbing, for some reason logic no longer takes vsync toggle into account. So expected behaviour would be for it to work like vanilla does. keep rendering in same manner, no matter if its seen and use same amount of resources. Essentially noticed this behaviour while playing Supersymmetry and after elimination testing, result was that only Forge was enough to cause it. And also confirmed it by doing fresh pack with only Forge added, so no other mods even in disabled state. Also happened with both singleplayer and remote multiplayer. Other offender was "Universal Tweaks" which introduced same effect to main menu with its # Removes the hardcoded 30 FPS limit in screens like the main menu B:"Uncap FPS"=true setting, meaning when game was on top, it still worked in limits of vsync cap, but after alt+tabbing even in main menu gpu usage shot up to max.
    • Add crash-reports with sites like https://paste.ee/ and paste the link to it here Make a test without the mod auditory
    • Funny enough, Chatgpt is confusing me even more. My BE works like a furnace, you need 8 items and two fuel to make a third item. Here is an example recipe. In this case, 8 aberrant shards, each one in one slot, and two of aberrant fuel, each one on one slot for a total of 10 slots. Supposedly any block with the tag aberrant_fuel should be accepted but im not sure this is how the json should look:   { "type": "relativedimensions:particle_rebound", "inputItem": [ { "item": "relativedimensions:aberrant_shard" } ], "fuelItem": [ { "tag": "relativedimensions:block/aberrant_fuel" } ], "output": { "Count": 1, "id": "relativedimensions:aberrant_ingot" } }  
  • Topics

  • Create New...

Important Information

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