Jump to content

[1.18.1] Preferred way of programatically breaking blocks


NJSwede

Recommended Posts

Hi!

Java veteran, but new to modding. I'm working on ny very first mod experiments and I'm playing with increasing the reach of a pickaxe by following veins of ore and other fun things. 

Whenever I break a block and have a certain custom enchantment on my pickaxe, I want to break a few additional nearby blocks as well. Seems simple enough. I also want it to kind of "ripple" through the environment, so my thought was to put the blocks to be destroyed on a queue and let a tick event subscriber pick them up, one for each tick.

I have this:

@SubscribeEvent
  public static void onTick(final TickEvent e) {
    if (MegaMinerEvents.queue.isEmpty()) {
      return;
    }
    final BlockToBreak b = MegaMinerEvents.queue.removeFirst();
    final BlockState bs = b.world.getBlockState(b.pos);
    bs.getBlock()
        .playerDestroy(b.player.getLevel(), b.player, b.pos, bs, null, b.player.getMainHandItem());
    b.player.getLevel().removeBlock(b.pos, false);
  }

 

As you can see, I simply pop a block from the queue every tick and break it. It sort of works. 

However, I'm wondering if Block::playerDestroy is the right method to call. First of all, it doesn't actually remove the block. Second, it doesn't trigger any events from what I can see. The vanilla game itself is using ServerPlayerGameMode::destroyBlock(), but that method isn't accessible from any context I'm in.

So the question is: Is Block::playerDestroy the right method to use?
What other things, like sending events and checking things to I need to do if I use that method?
Also, is "onTick" the right place to do this?

 

Thanks!
NJSwede

Link to comment
Share on other sites

What is MegaMinerEvents? What is MegaMiner for that matter?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

31 minutes ago, Draco18s said:

What is MegaMinerEvents? What is MegaMiner for that matter?

MegaMiner is just my playground mod. Here's the entire MegaMinerEvents class. It's just a static event receiver.

 

package nu.rydin.explodingarrows.common.events;

import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.Tag;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import nu.rydin.explodingarrows.common.Main;
import nu.rydin.explodingarrows.common.enchantments.ModEnchantments;

import java.util.LinkedList;

@Mod.EventBusSubscriber(modid = Main.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE)
public class MegaMinerEvents {
  private static final class BlockToBreak {

    private final BlockPos pos;

    private final Player player;

    public BlockToBreak(final BlockPos pos, final Player player) {
      this.pos = pos;
      this.player = player;
    }
  }

  private static final LinkedList<BlockToBreak> queue = new LinkedList<>();

  @SubscribeEvent
  public static void onBreakBlock(final BlockEvent.BreakEvent e) {
    final LevelAccessor world = e.getWorld();
    if (world.isClientSide()) {
      return;
    }
    for (final Tag t : e.getPlayer().getMainHandItem().getEnchantmentTags()) {
      final CompoundTag ct = (CompoundTag) t;
      if (ct.getString("id")
          .equals(ModEnchantments.MEGA_MINER.get().getRegistryName().toString())) {
        MegaMinerEvents.mineNeighborhood(e.getPos(), e.getPlayer(), e.getState().getBlock());
      }
    }
  }

  @SubscribeEvent
  public static void onTick(final TickEvent.ServerTickEvent e) {
    if (MegaMinerEvents.queue.isEmpty()) {
      return;
    }
    final BlockToBreak b = MegaMinerEvents.queue.removeFirst();
    final Level world = b.player.level;
    final BlockState bs = world.getBlockState(b.pos);
    bs.getBlock().playerDestroy(world, b.player, b.pos, bs, null, b.player.getMainHandItem());
    world.removeBlock(b.pos, true);
    // MegaMinerEvents.mineNeighborhood(b.pos, b.player, bs.getBlock());
    System.out.println(MegaMinerEvents.queue.size());
  }

  private static void mineNeighborhood(
      final BlockPos pos, final Player player, final Block blockType) {
    final float x0 = pos.getX();
    final float y0 = pos.getY();
    final float z0 = pos.getZ();
    for (float z = z0 - 1.0F; z <= z0 + 1; z += 1.0) {
      for (float y = y0 - 1.0F; y <= y0 + 1; y += 1.0) {
        for (float x = x0 - 1.0F; x <= x0 + 1; x += 1.0) {
          final BlockState b = player.getLevel().getBlockState(pos);
          if (b.is(blockType)) {
            MegaMinerEvents.queue.addLast(new BlockToBreak(pos, player));
          }
        }
      }
    }
  }
}

 

Edited by NJSwede
Link to comment
Share on other sites

You should absolutely call ForgeHooks.canHarvestBlock(state, entityPlayer, world, pos) before attempting to do anything to a block. If the return is false, skip that block.

As for the proper way to dig it out, dig around in the vanilla blocks class and look for where ForgeHooks.modifyLoot is called. Once you find that spot you might have to go up the call stack a little bit before you find the exact thing to call, and if might be several things. Been a while since I looked at it.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

It turned out that ServerPlayerGameMode was accessible after all. All I had to do was to cast my player to a ServerPlayer and ask for the game mode. Calling destroyBlock on that class seems to do all the proper tests and fire the right events. It all works now! Now I can mine an entire vein of diamonds or fell an entire tree in one stroke. Whohooo! :)

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I was plating on a aternos server with my friend. My friend logged of and I was alone. I installed some mods. In one moment I used the basuca from the a.v.a gun mod and the game suddenly crashed. I used the basuca when my friend was online and everything was perfect. I readed a lot of posts and edited the java execution command parameters. But nothing worked. I tried chaning the memory ram using this parameter -Xmx<MemoryRam>G But nothing worked. I even setted -Xmx15G and more it didn' work Can someone help me? These are the crash logs (Some information is removed for security as usernames and more.):   ---- Minecraft Crash Report ---- // Don't be sad, have a hug! <3 Time: 6/2/23 5:02 PM Description: Unexpected error java.lang.IndexOutOfBoundsException: Index: 0, Size: 0     at java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[?:1.8.0_51] {}     at java.util.ArrayList.get(ArrayList.java:429) ~[?:1.8.0_51] {}     at pellucid.ava.misc.renderers.AVABakedModel.getPerspectiveInBetween(AVABakedModel.java:426) ~[?:1.9.8.77965] {re:classloading}     at pellucid.ava.misc.renderers.AVABakedModel.getPerspectiveInBetween(AVABakedModel.java:407) ~[?:1.9.8.77965] {re:classloading}     at pellucid.ava.misc.renderers.AVABakedModel.getPerspectiveInBetween(AVABakedModel.java:402) ~[?:1.9.8.77965] {re:classloading}     at pellucid.ava.misc.renderers.models.ModifiedGunModel.modifyPerspective(ModifiedGunModel.java:486) ~[?:1.9.8.77965] {re:classloading}     at pellucid.ava.misc.renderers.models.ModifiedGunModel.modifyPerspective(ModifiedGunModel.java:426) ~[?:1.9.8.77965] {re:classloading}     at pellucid.ava.misc.renderers.models.m202.M202Model.handlePerspective(M202Model.java:131) ~[?:1.9.8.77965] {re:classloading}     at net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ForgeHooksClient.java:416) ~[?:?] {re:classloading}     at net.minecraft.client.renderer.ItemRenderer.func_229111_a_(ItemRenderer.java:98) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.ItemRenderer.func_229109_a_(ItemRenderer.java:207) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.FirstPersonRenderer.func_228397_a_(FirstPersonRenderer.java:50) ~[?:?] {re:mixin,pl:accesstransformer:B,xf:fml:forge:bows.1,xf:fml:forge:crossbows.0,xf:fml:forge:crossbows.1,xf:fml:forge:filled_map.0,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:forge:bows.1,xf:fml:forge:crossbows.0,xf:fml:forge:crossbows.1,xf:fml:forge:filled_map.0,pl:mixin:APP:ava.mixins.json:client.FirstPersonRendererMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.FirstPersonRenderer.func_228405_a_(FirstPersonRenderer.java:390) ~[?:?] {re:mixin,pl:accesstransformer:B,xf:fml:forge:bows.1,xf:fml:forge:crossbows.0,xf:fml:forge:crossbows.1,xf:fml:forge:filled_map.0,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:forge:bows.1,xf:fml:forge:crossbows.0,xf:fml:forge:crossbows.1,xf:fml:forge:filled_map.0,pl:mixin:APP:ava.mixins.json:client.FirstPersonRendererMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.FirstPersonRenderer.func_228396_a_(FirstPersonRenderer.java:244) ~[?:?] {re:mixin,pl:accesstransformer:B,xf:fml:forge:bows.1,xf:fml:forge:crossbows.0,xf:fml:forge:crossbows.1,xf:fml:forge:filled_map.0,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:forge:bows.1,xf:fml:forge:crossbows.0,xf:fml:forge:crossbows.1,xf:fml:forge:filled_map.0,pl:mixin:APP:ava.mixins.json:client.FirstPersonRendererMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.func_228381_a_(GameRenderer.java:369) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.func_228378_a_(GameRenderer.java:614) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.func_195458_a(GameRenderer.java:425) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:977) [?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:flywheel.mixins.json:ShaderCloseMixin,pl:mixin:APP:create.mixins.json:WindowResizeMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607) [?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:flywheel.mixins.json:ShaderCloseMixin,pl:mixin:APP:create.mixins.json:WindowResizeMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:184) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) [forge-1.16.5-36.2.34.jar:36.2] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$457/646445398.call(Unknown Source) [forge-1.16.5-36.2.34.jar:36.2] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace:     at java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[?:1.8.0_51] {}     at java.util.ArrayList.get(ArrayList.java:429) ~[?:1.8.0_51] {}     at pellucid.ava.misc.renderers.AVABakedModel.getPerspectiveInBetween(AVABakedModel.java:426) ~[?:1.9.8.77965] {re:classloading}     at pellucid.ava.misc.renderers.AVABakedModel.getPerspectiveInBetween(AVABakedModel.java:407) ~[?:1.9.8.77965] {re:classloading}     at pellucid.ava.misc.renderers.AVABakedModel.getPerspectiveInBetween(AVABakedModel.java:402) ~[?:1.9.8.77965] {re:classloading}     at pellucid.ava.misc.renderers.models.ModifiedGunModel.modifyPerspective(ModifiedGunModel.java:486) ~[?:1.9.8.77965] {re:classloading}     at pellucid.ava.misc.renderers.models.ModifiedGunModel.modifyPerspective(ModifiedGunModel.java:426) ~[?:1.9.8.77965] {re:classloading}     at pellucid.ava.misc.renderers.models.m202.M202Model.handlePerspective(M202Model.java:131) ~[?:1.9.8.77965] {re:classloading}     at net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ForgeHooksClient.java:416) ~[?:?] {re:classloading}     at net.minecraft.client.renderer.ItemRenderer.func_229111_a_(ItemRenderer.java:98) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.ItemRenderer.func_229109_a_(ItemRenderer.java:207) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.FirstPersonRenderer.func_228397_a_(FirstPersonRenderer.java:50) ~[?:?] {re:mixin,pl:accesstransformer:B,xf:fml:forge:bows.1,xf:fml:forge:crossbows.0,xf:fml:forge:crossbows.1,xf:fml:forge:filled_map.0,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:forge:bows.1,xf:fml:forge:crossbows.0,xf:fml:forge:crossbows.1,xf:fml:forge:filled_map.0,pl:mixin:APP:ava.mixins.json:client.FirstPersonRendererMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.FirstPersonRenderer.func_228405_a_(FirstPersonRenderer.java:390) ~[?:?] {re:mixin,pl:accesstransformer:B,xf:fml:forge:bows.1,xf:fml:forge:crossbows.0,xf:fml:forge:crossbows.1,xf:fml:forge:filled_map.0,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:forge:bows.1,xf:fml:forge:crossbows.0,xf:fml:forge:crossbows.1,xf:fml:forge:filled_map.0,pl:mixin:APP:ava.mixins.json:client.FirstPersonRendererMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.FirstPersonRenderer.func_228396_a_(FirstPersonRenderer.java:244) ~[?:?] {re:mixin,pl:accesstransformer:B,xf:fml:forge:bows.1,xf:fml:forge:crossbows.0,xf:fml:forge:crossbows.1,xf:fml:forge:filled_map.0,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:forge:bows.1,xf:fml:forge:crossbows.0,xf:fml:forge:crossbows.1,xf:fml:forge:filled_map.0,pl:mixin:APP:ava.mixins.json:client.FirstPersonRendererMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.func_228381_a_(GameRenderer.java:369) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.func_228378_a_(GameRenderer.java:614) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:A,pl:runtimedistcleaner:A} -- Affected level -- Details:     All players: 1 total; [ClientPlayerEntity['***'/7634, l='ClientLevel', x=171.66, y=86.86, z=-217.27]]     Chunk stats: Client Chunk Cache: 289, 169     Level dimension: minecraft:overworld     Level spawn location: World: (128,64,-224), Chunk: (at 0,4,0 in 8,-14; contains blocks 128,0,-224 to 143,255,-209), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)     Level time: 111187 game time, 117018 day time     Server brand: forge     Server type: Non-integrated multiplayer server Stacktrace:     at net.minecraft.client.world.ClientWorld.func_72914_a(ClientWorld.java:447) ~[?:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:create.mixins.json:BreakProgressMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2031) [?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:flywheel.mixins.json:ShaderCloseMixin,pl:mixin:APP:create.mixins.json:WindowResizeMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:628) [?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:flywheel.mixins.json:ShaderCloseMixin,pl:mixin:APP:create.mixins.json:WindowResizeMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:184) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) [forge-1.16.5-36.2.34.jar:36.2] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$457/646445398.call(Unknown Source) [forge-1.16.5-36.2.34.jar:36.2] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {} -- System Details -- Details:     Minecraft Version: 1.16.5     Minecraft Version ID: 1.16.5     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 847399824 bytes (808 MB) / 2227699712 bytes (2124 MB) up to 3817865216 bytes (3641 MB)     CPUs: 24     JVM Flags: 5 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx15G -Xmx4096m -Xms256m     ModLauncher: 8.1.3+8.1.3+main-8.1.x.c94d18ec     ModLauncher launch target: fmlclient     ModLauncher naming: srg     ModLauncher services:          /mixin-0.8.4.jar mixin PLUGINSERVICE          /eventbus-4.0.0.jar eventbus PLUGINSERVICE          /forge-1.16.5-36.2.34.jar object_holder_definalize PLUGINSERVICE          /forge-1.16.5-36.2.34.jar runtime_enum_extender PLUGINSERVICE          /accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE          /forge-1.16.5-36.2.34.jar capability_inject_definalize PLUGINSERVICE          /forge-1.16.5-36.2.34.jar runtimedistcleaner PLUGINSERVICE          /mixin-0.8.4.jar mixin TRANSFORMATIONSERVICE          /forge-1.16.5-36.2.34.jar fml TRANSFORMATIONSERVICE      FML: 36.2     Forge: net.minecraftforge:36.2.34     FML Language Providers:          javafml@36.2         minecraft@1     Mod List:          forge-1.16.5-36.2.34-client.jar                   |Minecraft                     |minecraft                     |1.16.5              |DONE      |Manifest: NOSIGNATURE         forge-1.16.5-36.2.34-universal.jar                |Forge                         |forge                         |36.2.34             |DONE      |Manifest: 22:af:21:d8:19:82:7f:93:94:fe:2b:ac:b7:e4:41:57:68:39:87:b1:a7:5c:c6:44:f9:25:74:21:14:f5:0d:90         flywheel-1.16-0.2.5.jar                           |Flywheel                      |flywheel                      |1.16-0.2.5          |DONE      |Manifest: NOSIGNATURE         create-mc1.16.5_v0.3.2g.jar                       |Create                        |create                        |v0.3.2g             |DONE      |Manifest: NOSIGNATURE         ava-1.16.5-1.9.8.77965.jar                        |A.V.A - Alliance of Valiant Ar|ava                           |1.9.8.77965         |DONE      |Manifest: NOSIGNATURE         citadel-1.8.1-1.16.5.jar                          |Citadel                       |citadel                       |1.8.1               |DONE      |Manifest: NOSIGNATURE         iceandfire-2.1.12-1.16.5.jar                      |Ice and Fire                  |iceandfire                    |2.1.12-1.16.5       |DONE      |Manifest: NOSIGNATURE     Crash Report UUID: 6a363432-f2b6-40b6-b01c-3e44f1efd634     Launched Version: forge-36.2.34     Backend library: LWJGL version 3.2.2 build 10     Backend API: ***     GL Caps: Using framebuffer using OpenGL 3.0     Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'forge'     Type: Client (map_client.txt)     Graphics mode: fancy     Resource Packs:      Current Language: English (US)     CPU: ***
    • So what is the code for enchanting and where is the #accept?
    • Okay managed to track down which mod was causing the problem and works flawlessly without it. It was Environmental from Team Abnormals.
    • I have completed everything you mentioned, and here is an example from GitHub: https://github.com/Tutorials-By-Kaupenjoe/Forge-Tutorial-1.19.3/blob/7-treeGeneration I would like you to look at the two main classes as follows: ModConfiguredFeatures, located in the package net.kaupenjoe.tutorialmod.worldgen ModWorldGenProvider, located in the package net.kaupenjoe.tutorialmod.datagen If you're using version 1.19.4-45.0.39 without updating to 45.0.40, the mentioned code works fine. However, if you switch to version 45.0.40 and try to add the method ModConfiguredFeatures::bootstrap, there will be an immediate issue. It seems like it cannot accept a method with a parameter as an instance, but it can still work properly with an instance that doesn't have an instant parameter, such as BootstapContext<PlacedFeature>.
    • Ignoring the mismatched format, this doesn't really explain anything about what is needed. First, you have a bunch of random classes which you don't define: ExampleEntityModel, the layer location, model layers, etc. Even if they are not relevant, you should just hide them behind a `//...` so they don't detract from your main point. For example, what about registering the layer definitions? the entity renderer? Anything that is not explained should be mentioned to use the same method as usual. You should also explain why adding those two layers would do what you needed. Additionally, you need to explain when a different model layer should be used, since not all mobs will have the exact same dimensions as the player (e.g., piglin).  This will crash, it needs a semicolon. This is already added for HumanoidMobRenderer, so it is redundant. This will crash, you need to pass in a ModelManager from the context. Additionally, the type parameter for HumanoidModel should be inferred and not just removed.  
  • Topics

×
×
  • Create New...

Important Information

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