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

Bug de démarage forge


Recommended Posts

-Xmx6G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M This is a parameter Version

 

Link to comment
Share on other sites

2 minutes ago, LESACOI said:

-Xmx6G

You need to make this bigger. If it doesn't work, then you don't have enough RAM in your computer to run what you are trying to run, and will probably have to remove some mods and try again. How much RAM is in your computer?

Link to comment
Share on other sites

8 minutes ago, LESACOI said:

The game has already worked with the same mod and only 4G Merory.

I'm not sure what to tell you then, the crash you posted clearly says there is not enough memory.

When does the crash happen? When loading a saved world, or before you even get to the main menu screen?

If it's when loading a save, does it still do that if you create a new world?

Link to comment
Share on other sites

3 minutes ago, LESACOI said:

The crash occurs during the launch of the game the single player and multiplayer screen ... it is not yet displaying.

Well, the error says you're running out of memory, and it would seem you're pretty much giving it all you got, so I would try removing some mods and trying again.

"It worked before" doesn't really matter, either the game is taking more memory than before (updates/more mods/etc), or your system has less ram available (more programs running, programs in the background, memory leaks, etc).

Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.
 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I am working in 1.17.1 and i am trying to read the contents of a chest from a client side mod. I have attempted to read the chest using  ((RandomizableContainerBlockEntity)Minecraft.getInstance().level.getBlockEntity(new BlockPos(1,1,1))).getItem(0); this returns null since it is reading from the client side. is there any way to get the inventory within a block without needing any server side code I was thinking of trying to catch the ClientboundContainerSetContentPacket but I have seen that is said not to be the best idea.   the overall project is to try to get the inventories within an area and then by sending packets to the server move the player in order to reequip with items from said chests.   here is my code so far I haven't implemented movement of the player yet i am just trying to move items between inventories.   ForgeEventHandeler.java @Mod.EventBusSubscriber public class ForgeEventHandler { private static ArrayList<BlockPos> homeBase = new ArrayList<BlockPos>(); private static Boolean pressed = false; public static final KeyMapping keyBinding = new KeyMapping("pam SETUP", 79, "PAM"); @SubscribeEvent public static void updatePlayer(TickEvent.PlayerTickEvent event) { if(event.player.canEat(false)){ for(ItemStack inventoryStack : event.player.getInventory().items){ if (inventoryStack.isEdible()) { ForgeEventFactory.onItemUseStart(event.player, inventoryStack, 0); ItemStack result = inventoryStack.getItem().finishUsingItem(inventoryStack, event.player.getCommandSenderWorld(), event.player); ForgeEventFactory.onItemUseFinish(event.player, inventoryStack, 0, result); if (!event.player.canEat(false)) { break; } } } } if (keyBinding.isDown() && !pressed) { pressed = true; openBlock(); if(homeBase.size()==2) { homeBase.clear(); } HitResult block = Minecraft.getInstance().player.pick(20.0D, 0.0F, false); if(block.getType() == BlockHitResult.Type.BLOCK){ BlockPos blockpos = ((BlockHitResult)block).getBlockPos(); homeBase.add(blockpos); Minecraft.getInstance().getConnection().send(new ServerboundChatPacket("position set")); } if(homeBase.size()==2) { int[] start ={(int)homeBase.get(0).get(Direction.Axis.X),(int)homeBase.get(0).get(Direction.Axis.Y),(int)homeBase.get(0).get(Direction.Axis.Z)}; int[] end ={ (int) homeBase.get(1).get(Direction.Axis.X),(int)homeBase.get(1).get(Direction.Axis.Y),(int)homeBase.get(1).get(Direction.Axis.Z)}; int[] diff = {end[0]-start[0],end[1]-start[1],end[2]-start[2]}; for (int i=start[0]; i!=(end[0]+Integer.signum(diff[0])); i+=Integer.signum(diff[0])){ for (int j=start[1]; j!=(end[1]+Integer.signum(diff[1])); j+=Integer.signum(diff[1])){ for (int k=start[2]; k!=(end[2]+Integer.signum(diff[2])); k+=Integer.signum(diff[2])){ System.out.println(i+","+j+","+k); BlockPos posTemp = new BlockPos(i,j,k); BlockEntity blockEntity = Minecraft.getInstance().level.getBlockEntity(posTemp); if (blockEntity != null && blockEntity instanceof RandomizableContainerBlockEntity) { /*add chest to a category of chests that best describes what is in it E.G tools, weapons, food*/ } } } } } } if (!keyBinding.isDown()) { pressed=false; } } @SubscribeEvent public static void setup(FMLClientSetupEvent event) { ClientRegistry.registerKeyBinding(keyBinding); } @SuppressWarnings("resource") private static void openBlock(){ BlockHitResult hit = (BlockHitResult) Minecraft.getInstance().player.pick(20.0D, 0.0F, false); Minecraft.getInstance().getConnection().send(new ServerboundUseItemOnPacket(InteractionHand.MAIN_HAND,hit)); } }   exampemod.java // The value here should match an entry in the META-INF/mods.toml file @Mod("examplemod") public class ExampleMod { // Directly reference a log4j logger. public ExampleMod() { } }  
    • Look at where the field is used. There is a function that lets you set it.
    • So I'm trying to make an addon for Mr. Crayfish's Gun mod, what I'm trying to achieve right now is to add a new gun, but I got this error while adding the max stack size property to the item and I don't know how to get around it: 'maxStackSize' has private access in 'net.minecraft.item.Item.Properties' The line of code is this one: public static final Item.Properties genericProperties = new Item.Properties().maxStackSize(1).group(MoGuns.GROUP); And the whole code is this: package ttv.alanormiga.moguns.core.registry; import ttv.alanormiga.moguns.core.MoGuns; import com.mrcrayfish.guns.item.GunItem; import net.minecraft.item.Item; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class ItemRegistry { public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MoGuns.ID); public static final Item.Properties genericProperties = new Item.Properties().maxStackSize(1).group(MoGuns.GROUP); public static final RegistryObject<Item> SCAR = ITEMS.register("scar", () -> new GunItem(genericProperties)); } Also here is my github repo: https://github.com/AlanorMiga/MoGuns   Any help is greatly appreciated! Thanks in advance!
    • Reimport the gradle project into your IDE then regenerate run configs.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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