• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Hello, i'm trying to create a new crafting table but i always get the same error while trying to open the container: [m[33m[20:11:54] [Render thread/WARN] [minecraft/ClientPlayNetHandler]: Unknown custom packet identifier: professionsmod:main My Crafting Table Block Code: public class SmithCraftingTableBlock extends Block{ public SmithCraftingTableBlock(Properties properties) { super(properties); } @Override public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { ActionResultType type[] = { ActionResultType.PASS }; if (worldIn.isRemote) { player.getCapability(CapabilityProfession.PROFESSION, null).ifPresent(iProfession -> { if(iProfession.getProfession() == profession.SMITH) { type[0] = ActionResultType.SUCCESS; } }); return type[0]; } else { player.getCapability(CapabilityProfession.PROFESSION, null).ifPresent(iProfession -> { if(iProfession.getProfession() == profession.SMITH) { type[0] = ActionResultType.SUCCESS; NetworkHooks.openGui((ServerPlayerEntity) player, new SmithContainerProvider(pos)); } }); return type[0]; } } }   ContainerProvider: public class SmithContainerProvider implements INamedContainerProvider{ //private BlockPos pos; private static final ITextComponent name = new TranslationTextComponent("container.smithcrafting"); //public SmithContainerProvider(BlockPos pos) { // this.pos = pos; //} @Override public Container createMenu(int windowId, PlayerInventory playerInventory, PlayerEntity p_createMenu_3_) { return new SmithCraftingContainer(windowId, playerInventory/*, new PacketBuffer(Unpooled.buffer(8, 8)).writeBlockPos(pos)*/); } @Override public ITextComponent getDisplayName() { return name; } }   I believe the problem is caused by NetworkHooks.openGui because i'm probably not sending the PacketBuffer the right way. I tried it in many different ways and i suspect that the error was sent from handleCustomPayload in ClientPlayNetHandler, however, i can't figure out a possible solution. If i do this with TileEntity, then there is no such problem. Everything else works fine. Your help would be greatly appreciated.   PS: This is my first time ever using a forum. Some parts of the code are really ugly in my opinion but i'm only a beginner. Atleast i understand most Java and OOP concepts.  
    • 1.14 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • I guess you have to. Someone should make a pull request to mitigate this situation.
    • ---- Minecraft Crash Report ---- // Hey, that tickles! Hehehe! Time: 21/10/20 18:50 Description: Initializing game java.lang.OutOfMemoryError: Java heap space     at java.util.Arrays.copyOf(Arrays.java:3332) ~[?:1.8.0_51] {}     at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:137) ~[?:1.8.0_51] {}     at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:121) ~[?:1.8.0_51] {}     at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:569) ~[?:1.8.0_51] {}     at java.lang.StringBuilder.append(StringBuilder.java:190) ~[?:1.8.0_51] {}     at com.google.gson.stream.JsonReader.nextQuotedValue(JsonReader.java:1014) ~[gson-2.8.0.jar:?] {}     at com.google.gson.stream.JsonReader.nextString(JsonReader.java:815) ~[gson-2.8.0.jar:?] {}     at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:418) ~[gson-2.8.0.jar:?] {}     at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:406) ~[gson-2.8.0.jar:?] {}     at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41) ~[gson-2.8.0.jar:?] {}     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82) ~[gson-2.8.0.jar:?] {}     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61) ~[gson-2.8.0.jar:?] {}     at net.minecraft.util.JSONUtils.func_193838_a(SourceFile:505) ~[?:?] {re:classloading}     at net.minecraft.util.JSONUtils.func_193837_a(SourceFile:513) ~[?:?] {re:classloading}     at net.minecraft.util.JSONUtils.func_193840_a(SourceFile:528) ~[?:?] {re:classloading}     at net.minecraft.client.GameSettings.func_74300_a(GameSettings.java:363) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.GameSettings.<init>(GameSettings.java:175) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:417) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:365) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(SourceFile:155) [?:?] {re:classloading}     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:56) [forge-1.14.4-28.2.0.jar:28.2] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$382/1972326147.call(Unknown Source) [forge-1.14.4-28.2.0.jar:28.2] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-4.1.0.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-4.1.0.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-4.1.0.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-4.1.0.jar:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-4.1.0.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace:     at java.util.Arrays.copyOf(Arrays.java:3332)     at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:137)     at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:121)     at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:569)     at java.lang.StringBuilder.append(StringBuilder.java:190)     at com.google.gson.stream.JsonReader.nextQuotedValue(JsonReader.java:1014)     at com.google.gson.stream.JsonReader.nextString(JsonReader.java:815)     at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:418)     at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:406)     at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)     at net.minecraft.util.JSONUtils.func_193838_a(SourceFile:505)     at net.minecraft.util.JSONUtils.func_193837_a(SourceFile:513)     at net.minecraft.util.JSONUtils.func_193840_a(SourceFile:528)     at net.minecraft.client.GameSettings.func_74300_a(GameSettings.java:363)     at net.minecraft.client.GameSettings.<init>(GameSettings.java:175)     at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:417) -- Initialization -- Details: Stacktrace:     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:365)     at net.minecraft.client.main.Main.main(SourceFile:155)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:56)     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$382/1972326147.call(Unknown Source)     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)     at cpw.mods.modlauncher.Launcher.run(Launcher.java:81)     at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) -- System Details -- Details:     Minecraft Version: 1.14.4     Minecraft Version ID: 1.14.4     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: 953530264 bytes (909 MB) / 2147483648 bytes (2048 MB) up to 2147483648 bytes (2048 MB)     CPUs: 4     JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     Launched Version: 1.14.4-forge-28.2.0     LWJGL: 3.2.2 build 10     OpenGL: NO CONTEXT     GL Caps:      Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'forge'     Type: Client (map_client.txt)     Resource Packs: ~~ERROR~~ NullPointerException: null     Current Language: ~~ERROR~~ NullPointerException: null     CPU: <unknown>
    • HAHAHAHA! Well... I learned a lot on the way!   So, I should stick to the "old" method, right? public class onLootTableLoadListener { @SubscribeEvent public void LootTablesLoad(final LootTableLoadEvent event) { String prefix = "minecraft:chests/"; String name = event.getName().toString(); // Test: /loot give @p loot minecraft:chests/pillager_outpost if (name.startsWith(prefix)) { event.getTable().addPool(LootPool.builder() .addEntry(TableLootEntry.builder(new ResourceLocation(Refs.MODID, "chests/lazy_builder")) .weight(1)) .bonusRolls(0, 1) .name(Refs.MODID) .build() ); } } }   Thank you anyway!
  • Topics

  • Who's Online (See full list)