Jump to content

Zemelua

Members
  • Posts

    190
  • Joined

  • Last visited

Everything posted by Zemelua

  1. sorry, I'm not sure. I think it means that the registry of the item is done before the registry of magic, but where and what should I do?
  2. I created a Custom DeferredRegister Object and it worked fine. However, it crashes when I take that object as a constructor argument when creating an Item Registry Object. I think it's because the Custom Registry Object is generated later than the Item Registry Object is generated. Is there any way to solve this? Mod main class : @Mod("expansionmod") public class ExpansionMod { public ExpansionMod() { ExpansionModMagics.MAGICS.makeRegistry("magic_registry", () -> new RegistryBuilder<>()); ExpansionModMagics.MAGICS.register(FMLJavaModLoadingContext.get().getModEventBus()); ExpansionModItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); } } Mod items class : public class ExpansionModItems { public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, "expansionmod"); public static final RegistryObject<Item> SPELL = ITEMS.register("spel", () -> new SpellItem(new Item.Properties().group(ExpansionModItemGroups.EXPANSIONMOD_MAGIC), ExpansionModMagics.FIREBALL.get())); } Mod custom registry(Magic) class : public class ExpansionModMagics { public static final DeferredRegister<Magic> MAGICS = DeferredRegister.create(Magic.class, ExpansionMod.MODID); public static final RegistryObject<Magic> FIREBALL = MAGICS.register("fireball", () -> new FireBallMagic(54)); } Spell Item class : public class SpellItem extends MagicalItem { public SpellItem(Properties properties, Magic magic) { super(properties, magic); } } Error log : ~ Description: Mod loading error has occurred java.lang.Exception: Mod Loading has failed at net.minecraftforge.fml.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:85) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.client.ClientModLoader.completeModLoading(ClientModLoader.java:188) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.lambda$null$1(Minecraft.java:513) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.util.Util.acceptOrElse(Util.java:323) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraft.client.Minecraft.lambda$new$2(Minecraft.java:509) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.gui.ResourceLoadProgressGui.render(ResourceLoadProgressGui.java:113) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:492) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1002) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_282] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_282] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_282] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_282] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.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.Objects.requireNonNull(Objects.java:290) ~[?:1.8.0_282] {} -- MOD expansionmod -- Details: Mod File: main Failure message: Expansion Mod (expansionmod) encountered an error during the load_registries event phase java.lang.NullPointerException: Registry Object not present: expansionmod:fireball Mod Version: NONE Mod Issue URL: NOT PROVIDED Exception message: java.lang.NullPointerException: Registry Object not present: expansionmod:fireball Stacktrace: at java.util.Objects.requireNonNull(Objects.java:290) ~[?:1.8.0_282] {} at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:120) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at io.github.zemelua.expansionmod.item.ExpansionModItems.lambda$static$23(ExpansionModItems.java:61) ~[main/:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister.lambda$register$0(DeferredRegister.java:124) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister.addEntries(DeferredRegister.java:200) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister.access$000(DeferredRegister.java:61) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister$EventDispatcher.handleEvent(DeferredRegister.java:172) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraftforge.eventbus.ASMEventHandler_2_EventDispatcher_handleEvent_Register.invoke(.dynamic) ~[?:?] {} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:120) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:36.0] {re:classloading} at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:121) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) ~[?:1.8.0_282] {} at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:56) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:40) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:243) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:230) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:196) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$1(ClientModLoader.java:103) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:123) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:103) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.<init>(Minecraft.java:442) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:149) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_282] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_282] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_282] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_282] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {} ~
  3. I created a custom entity that doesn't need texture and registered it using DeferredRegister. I tried to summon it with the / summon command, but it crashed with an error. Looking at the error log, it looks like a Renderer error, but I'm not sure. What do you need to fix? SeatEntity class : package io.github.zemelua.expansionmod.entity.item; import io.github.zemelua.expansionmod.entity.ExpansionModEntityType; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.IPacket; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.network.NetworkHooks; public class SeatEntity extends Entity { /* private BlockPos pos; */ public SeatEntity(EntityType<? extends SeatEntity> entityType, World world) { super(entityType, world); } /* private SeatEntity(World worldIn, BlockPos pos, double yOffset) { this(ExpansionModEntityType.SEAT.get(), worldIn); this.pos = pos; this.setPosition(pos.getX() + 0.5, pos.getY() + yOffset, pos.getZ() + 0.5); } */ @Override protected void registerData() { } @Override protected void readAdditional(CompoundNBT compound) { } @Override protected void writeAdditional(CompoundNBT compound) { } @Override public IPacket<?> createSpawnPacket() { return NetworkHooks.getEntitySpawningPacket(this); } } ModEntityTypes class : package io.github.zemelua.expansionmod.entity; import io.github.zemelua.expansionmod.ExpansionMod; import io.github.zemelua.expansionmod.entity.item.SeatEntity; import net.minecraft.entity.EntityClassification; import net.minecraft.entity.EntityType; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class ExpansionModEntityType { public static final DeferredRegister<EntityType<?>> ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.ENTITIES, ExpansionMod.MODID); public static final RegistryObject<EntityType<SeatEntity>> SEAT = ENTITY_TYPES.register("seat", () -> EntityType.Builder.create(SeatEntity::new, EntityClassification.MISC).size(0.0F, 0.0F).build(new ResourceLocation(ExpansionMod.MODID, "seat").toString())); } Error log : ~ [19:07:55] [Server thread/INFO] [minecraft/MinecraftServer]: [Dev: Summoned new entity.expansionmod.seat] [19:07:55] [Render thread/INFO] [minecraft/NewChatGui]: [CHAT] Summoned new entity.expansionmod.seat [19:07:55] [Render thread/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 7701e95e-4402-4fb7-bbcd-265ee21e606e [19:07:55] [Render thread/FATAL] [minecraft/Minecraft]: Unreported exception thrown! java.lang.NullPointerException: null at net.minecraft.client.renderer.entity.EntityRendererManager.shouldRender(EntityRendererManager.java:239) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:1009) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:619) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:437) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1002) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_282] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_282] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_282] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_282] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {} [19:07:56] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping server [19:07:56] [Server thread/INFO] [minecraft/MinecraftServer]: Saving players [19:07:56] [Server thread/INFO] [minecraft/ServerPlayNetHandler]: Dev lost connection: Disconnected [19:07:56] [Server thread/INFO] [minecraft/MinecraftServer]: Dev left the game [19:07:56] [Server thread/INFO] [minecraft/ServerPlayNetHandler]: Stopping singleplayer server as player logged out [19:07:56] [Server thread/INFO] [minecraft/MinecraftServer]: Saving worlds [19:07:56] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[New World]'/minecraft:overworld [19:07:56] [Server thread/INFO] [minecraft/ChunkManager]: ThreadedAnvilChunkStorage (New World): All chunks are saved [19:07:56] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_nether [19:07:56] [Server thread/INFO] [minecraft/ChunkManager]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved [19:07:56] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_end [19:07:56] [Server thread/INFO] [minecraft/ChunkManager]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved [19:07:56] [Server thread/DEBUG] [ne.mi.fm.FMLWorldPersistenceHook/WP]: Gathering id map for writing to world save New World [19:07:56] [Server thread/DEBUG] [ne.mi.fm.FMLWorldPersistenceHook/WP]: ID Map collection complete New World [19:07:56] [Server thread/INFO] [minecraft/ChunkManager]: ThreadedAnvilChunkStorage (New World): All chunks are saved [19:07:56] [Server thread/INFO] [minecraft/ChunkManager]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved [19:07:56] [Server thread/INFO] [minecraft/ChunkManager]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved [19:07:56] [Server thread/DEBUG] [ne.mi.re.GameData/REGISTRIES]: Reverting to FROZEN data state. [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry Block Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry Fluid Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry Item Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry Effect Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry SoundEvent Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry Potion Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry Enchantment Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry EntityType Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry TileEntityType Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry ParticleType Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry ContainerType Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry PaintingType Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry IRecipeSerializer Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry Attribute Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry StatType Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry VillagerProfession Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry PointOfInterestType Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry MemoryModuleType Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry SensorType Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry Schedule Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry Activity Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry WorldCarver Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry SurfaceBuilder Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry Feature Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry Placement Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry ChunkStatus Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry Structure Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry BlockStateProviderType Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry BlockPlacerType Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry FoliagePlacerType Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry TreeDecoratorType Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry Biome Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry DataSerializerEntry Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry GlobalLootModifierSerializer Sync: ACTIVE -> FROZEN [19:07:56] [Server thread/DEBUG] [ne.mi.re.ForgeRegistry/REGISTRIES]: Registry ForgeWorldType Sync: ACTIVE -> FROZEN [19:07:57] [Server thread/DEBUG] [ne.mi.re.ObjectHolderRegistry/REGISTRIES]: Applying holder lookups [19:07:57] [Server thread/DEBUG] [ne.mi.re.ObjectHolderRegistry/REGISTRIES]: Holder lookups applied [19:07:57] [Server thread/DEBUG] [ne.mi.re.GameData/REGISTRIES]: FROZEN state restored. [19:07:57] [Server thread/DEBUG] [ne.mi.fm.lo.FileUtils/CORE]: Found existing serverconfig directory : .\saves\New World\serverconfig [19:07:57] [Server thread/DEBUG] [ne.mi.fm.co.ConfigTracker/CONFIG]: Unloading configs type SERVER [19:07:58] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:130]: ---- Minecraft Crash Report ---- // I bet Cylons wouldn't have this problem. Time: 21/02/10 19:07 Description: Unexpected error java.lang.NullPointerException: Unexpected error at net.minecraft.client.renderer.entity.EntityRendererManager.shouldRender(EntityRendererManager.java:239) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:1009) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:619) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:437) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1002) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_282] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_282] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_282] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_282] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace: at net.minecraft.client.renderer.entity.EntityRendererManager.shouldRender(EntityRendererManager.java:239) ~[forge:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:1009) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:619) ~[forge:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} -- Affected level -- Details: All players: 1 total; [ClientPlayerEntity['Dev'/219, l='ClientLevel', x=59.64, y=64.00, z=60.57]] Chunk stats: Client Chunk Cache: 841, 568 Level dimension: minecraft:overworld Level spawn location: World: (0,77,9), Chunk: (at 0,4,9 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 26793 game time, 14101 day time Server brand: forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.world.ClientWorld.fillCrashReport(ClientWorld.java:465) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2091) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:633) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_282] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_282] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_282] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_282] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.0.7_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {} ~
  4. public void setMagic(ItemStack itemstack, Magic magic, int slotNumber) { CompoundNBT compoundnbt = itemstack.getOrCreateChildTag("Spell_book"); if (!compoundnbt.contains("Magics", 0)) { compoundnbt.putIntArray("Magics", new ArrayList<>()); itemstack.write(compoundnbt); } ListNBT listnbt = compoundnbt.getList("Magics", Constants.NBT.TAG_COMPOUND); List<Integer> list = Lists.newArrayList(); if (!listnbt.isEmpty()) { CompoundNBT slot = new CompoundNBT(); slot.putInt("Magic", magic.id); itemstack.write(slot); listnbt.set(slotNumber, slot); compoundnbt.put("Magics", listnbt); } itemstack.write(compoundnbt); Minecraft.getInstance().player.sendMessage(new StringTextComponent(Integer.toString(compoundnbt.getList("Magics", 10).getInt(0))), null); } When I call the above method, I think that the value of magic id is displayed in the chat column, but no matter what I put in magic id, 0 is displayed in chat. What's wrong?
  5. Is it possible to get the ArrowEntity from LivingUpdateEvent?
  6. The core player gets a match with getDisplayName from WorldTickEvent.world.getPlayers.
  7. Changes the attributes of all other LivingEntity when the specified player is not moving. I'm sorry if my perception of Side is wrong, but when I run this in a server environment, WorldTickEvent will check the specified player and then give changes directly to other LivingEntity. However, if it detects that the specified player is stopped, assigns its state to a variable, checks that variable, and the LivingUpdateEvent of each client changes to its own player, it is necessary to send a packet. thinking about. I don't want to use LivingUpdateEvent because I don't really understand packet and I think it's a heavy load to send a packet every time the specified player stops.
  8. Is there a way to get all the Living entities in the world from the WorldTickEvent? I don't want to use LivingUpdateEvent because it slows down the game.
  9. I tried using MouseHelper#ungrabMouse () and KeyBinding#unPressAllKeys (), referring to the vanilla GUI code. Then, the mouse movement and the player movement became impossible. However, you can still switch items with the F5 key, mouse scroll, etc. (however, these may or may not work when pressed). This is to solve is to think of a thing that we need InputUpdateEvent, Can you tell me how to cancel how to input because they did not see any documents about it.
  10. I'm currently trying to create a mechanism on the Minecraft server that allows one player to use one item and stop the other players from moving. As a way of thinking ・ Modify the time tick of each Client game ・ By disabling the key input of all Clients, it becomes immobile. There are two. I tried the former with reference to Carpet Mod, but I gave up because it seems that I need to rewrite the Minecraft code of the part that is not supported by Forge. So, for the latter, I tried using KeyBinding # unPressAllKeys () etc., but I can still operate the viewpoint with the mouse, change the items I have, etc. Is there a way to solve these?
  11. I'd like to see something that isn't really an enchantment effect like any other enchantment tooltip, but I don't know where it's done in vanilla.
  12. I'm currently making a sword that restores the attacker's health according to the amount of damage done, but I don't know how to get the amount of damage done. I'm trying to override the hitEntity of an SwordItem.
  13. I know how to add a parameter to an entity using EntityDataManager # register, but I don't know how to add my own parameter to a vanilla entity.
  14. So, after that, read the vanilla code a little and protect protected static final DataParameter <ExpansionModPose> EXPANSIONMOD_POSE = EntityDataManager.createKey (ExpansionModEntity.class, ExpansionModDataSerializers.EXPANSIONMOD_POSE); protected static final DataParameter <ExpansionModPose> EXPANSIONMOD_POSE = EntityDataManager.create I rewrote it to .EXPANSIONMOD_POSE) ;, but found that I needed to add it with register in order to apply the dataManager to the player. Does this need to replace the vanilla player?
  15. I'm making a chair that I can sit on right now, and I wrote the following code with reference to the startSleeping of the bed, but I get an error. I don't know the cause. Probably a DataParameter. After this, I want to use EXPANSIONMOD_POSE and CHAIR_POTISION, so I want to use this. If it can't be used, is there any alternative? Note that the idea of using a mountable entity in the first place is not appropriate because you want to pose when sitting or make more complicated movements. public class ExpansionModEntity extends Entity{ public ExpansionModEntity(EntityType<?> entityTypeIn, World worldIn) { super(entityTypeIn, worldIn); } protected static final DataParameter<ExpansionModPose> EXPANSIONMOD_POSE = EntityDataManager.createKey(ExpansionModEntity.class, ExpansionModDataSerializers.EXPANSIONMOD_POSE); private static final DataParameter<Optional<BlockPos>> CHAIR_POSITION = EntityDataManager.createKey(ExpansionModEntity.class, DataSerializers.OPTIONAL_BLOCK_POS); public void setPose(ExpansionModPose poseIn) { this.dataManager.set(EXPANSIONMOD_POSE, poseIn); } private void setSittingPosition(BlockPos pos) { this.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5); } public Optional<BlockPos> getChairPosition() { return this.dataManager.get(CHAIR_POSITION); } public void setChairPosition(BlockPos pos) { this.dataManager.set(CHAIR_POSITION, Optional.of(pos)); } public void clearChairPosition() { this.dataManager.set(CHAIR_POSITION, Optional.empty()); } public void startSitting(BlockPos pos) { if (this.isPassenger()) { this.stopRiding(); } this.setPose(ExpansionModPose.SITTING); this.setSittingPosition(pos); this.setChairPosition(pos); } @Override protected void registerData() { } @Override protected void readAdditional(CompoundNBT compound) { } @Override protected void writeAdditional(CompoundNBT compound) { } @Override public IPacket<?> createSpawnPacket() { return null; } } public class ChairBlock extends Block implements IWaterLoggable{ public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final VoxelShape BASE = VoxelShapes.or( Block.makeCuboidShape(2, 8, 2, 14, 10, 14), Block.makeCuboidShape(2, 0, 2, 4, 8, 4), Block.makeCuboidShape(2, 0, 12, 4, 8, 14), Block.makeCuboidShape(12, 0, 12, 14, 8, 14), Block.makeCuboidShape(12, 0, 2, 14, 8, 4) ); public static final VoxelShape SHAPE_NORTH = VoxelShapes.or( BASE, Block.makeCuboidShape(2, 10, 12, 14, 18, 14) ); public static final VoxelShape SHAPE_EAST = VoxelShapes.or( BASE, Block.makeCuboidShape(2, 10, 2, 4, 18, 14) ); public static final VoxelShape SHAPE_SOUTH = VoxelShapes.or( BASE, Block.makeCuboidShape(2, 10, 2, 14, 18, 4) ); public static final VoxelShape SHAPE_WEST = VoxelShapes.or( BASE, Block.makeCuboidShape(12, 10, 2, 14, 18, 14) ); public ChairBlock(Properties properties) { super(properties); this.setDefaultState(this.stateContainer.getBaseState() .with(FACING, Direction.NORTH) .with(WATERLOGGED, false) ); } @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState() .with(FACING, context.getPlacementHorizontalFacing().getOpposite()); } @SuppressWarnings("deprecation") public FluidState getFluidState(BlockState state) { return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state); } @Override protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { builder.add( FACING, WATERLOGGED ); } @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { switch (state.get(FACING)) { case NORTH: return SHAPE_NORTH; case SOUTH: return SHAPE_SOUTH; case EAST: return SHAPE_EAST; case WEST: return SHAPE_WEST; default: return SHAPE_NORTH; } } @Override public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { ExpansionModEntity expansionModEntity = new ExpansionModEntity(EntityType.PLAYER, worldIn); expansionModEntity.startSitting(pos); return null; //return SeatEntity.create(worldIn, pos, 0.4, player); } }
  16. I know that some famous mod chair blocks use mountable entities for sitting, but after this I do the same (eg right click to dance on that block). I'm planning to make a block (such as), so I want to make the code versatile. Therefore, if possible, I would like to refer to bedtime rather than riding on an entity, but the bedtime code is complicated and confusing (due to skipping time, dimming the screen, etc.). It is now possible to teleport to the block position with setPotision by referring to the bed and riding code, ・ I can't stay there ・ I don't know how to get off when I press shift I have these problems. I'll take a look at Living Renderer from now on.
  17. Where is the behavior when the player gets on the entity? Probably done in different classes, but I can't find all. Can anyone tell me? (Specifically, I'm trying to perform the action of sitting on a chair with onBlockActivated, but for some reason the pose is STANDING in startRiding and there is no pose called RIDING. Also, when sitting, shift I don't know how to get off at.)
  18. I'm sorry, I made a mistake. Looking at it, I found that I was doing something about pose with recalculateSize. I'll think about it for a moment.
  19. Looking at #setPose, It was running dataManager.set, but I'm not sure what this is doing. #set doesn't seem to be doing anything about the player's pose.
  20. I'm sorry. I didn't have enough words. I know how to assign textures to models as usual, but depending on the block state, for example, if you want to switch 10 individual textures to each face, use blockstate / block.json to prepare 10 6th power models. I can't do it. Therefore, I want to switch the texture of each surface one by one according to the state of north_type, south_type, ....
  21. I'm looking for a way to texture each side of a block individually like CTM, but I don't know exactly how Minecraft does that. I thought about using blockstate normally, but I don't want to have to prepare a huge number of models that are too complicated.
  22. public class PlayerMentalCapabilityMessage { ClientPlayerEntity player = Minecraft.getInstance().player; //getInstance().playerをplayerにぶち込む LazyOptional<PlayerMentalInterface> cap = player.getCapability(PlayerMentalCapabilityRegistry.PLAYER_MENTAL_CAPABILITY); //playerからキャパビリティを取得してplayerMentalInterfaceにぶち込む int currentMental = cap.orElseThrow(IllegalArgumentException::new).getMental(); //int currentMental = ((PlayerMentalInterface) playerMentalInterface).getMental(); //playerMentalInterfaceからmentalの値を取得してcurrentMentalにぶち込む public PlayerMentalCapabilityMessage(int currentMental) { this.currentMental = currentMental; } public static void encode(PlayerMentalCapabilityMessage message, PacketBuffer buf) { buf.writeInt(message.currentMental); //currentMentalの値をバッファーにぶち込む } public static PlayerMentalCapabilityMessage decode(PacketBuffer buf) { int currentMental = buf.readInt(); //バッファーから値を取得する return new PlayerMentalCapabilityMessage(currentMental); //バッファーから取得した値でPlayerMentalCapabilityMessage(int)をインスタンス化 } public static void handle(PlayerMentalCapabilityMessage message, Supplier<NetworkEvent.Context> ctx) { ctx.get().enqueueWork(() -> { DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> Handle.handleClient(message.currentMental)); }); ctx.get().setPacketHandled(true); } //@SuppressWarnings("resource") public static class Handle { public static DistExecutor.SafeRunnable handleClient(int currentMental) { return new DistExecutor.SafeRunnable() { @Override public void run() { LazyOptional<PlayerMentalInterface> cap = Minecraft.getInstance().player.getCapability(PlayerMentalCapabilityRegistry.PLAYER_MENTAL_CAPABILITY); cap.orElseThrow(IllegalArgumentException::new).setMental(currentMental); } }; } } } Sorry. this is.
  23. So is it correct to recognize that when this code wants to serve to send data from the server to the client, the mistake is to pass the client's data to handle () first?
  24. I'm sorry. I'm still not familiar with network systems. I've read the documentation and some commentary over and over again to understand the rough mechanics (which allows the server / client to exchange data with each other via packets), but specifically which method does what. I'm not sure what it is (what the encode and decode are doing, which method is actually passing the data, etc.) ... if you like, I'll explain it in detail. Could you please?
  25. public class PlayerMentalCapabilityMessage { ClientPlayerEntity player = Minecraft.getInstance().player; //getInstance().playerをplayerにぶち込む LazyOptional<PlayerMentalInterface> cap = player.getCapability(PlayerMentalCapabilityRegistry.PLAYER_MENTAL_CAPABILITY); //playerからキャパビリティを取得してplayerMentalInterfaceにぶち込む int currentMental = cap.orElseThrow(IllegalArgumentException::new).getMental(); //int currentMental = ((PlayerMentalInterface) playerMentalInterface).getMental(); //playerMentalInterfaceからmentalの値を取得してcurrentMentalにぶち込む public PlayerMentalCapabilityMessage(int currentMental) { this.currentMental = currentMental; } public static void encode(PlayerMentalCapabilityMessage message, PacketBuffer buf) { buf.writeInt(message.currentMental); } public static PlayerMentalCapabilityMessage decode(PacketBuffer buf) { int currentMental = buf.readInt(); return new PlayerMentalCapabilityMessage(currentMental); } public static void handle(PlayerMentalCapabilityMessage message, Supplier<NetworkEvent.Context> ctx) { ctx.get().enqueueWork(() -> { DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> Handle.handleClient(message.currentMental)); }); ctx.get().setPacketHandled(true); } //@SuppressWarnings("resource") public static class Handle { public static DistExecutor.SafeRunnable handleClient(int currentMental) { return new DistExecutor.SafeRunnable() { @Override public void run() { LazyOptional<PlayerMentalInterface> cap = Minecraft.getInstance().player.getCapability(PlayerMentalCapabilityRegistry.PLAYER_MENTAL_CAPABILITY); cap.orElseThrow(IllegalArgumentException::new).setMental(currentMental); } }; } } I fixed the code in the network message and it seems that it crashed for another reason, but I don't know ... ---- Minecraft Crash Report ---- // Don't do that. Time: 20/10/26 13:32 Description: Ticking player java.lang.ExceptionInInitializerError: null at depression_mod.potion.ModEffect.lambda$0(ModEffect.java:30) ~[?:?] {re:classloading} at net.minecraftforge.common.util.LazyOptional.ifPresent(LazyOptional.java:161) ~[?:?] {re:classloading} at depression_mod.potion.ModEffect.performEffect(ModEffect.java:27) ~[?:?] {re:classloading} at depression_mod.potion.ModEffect.affectEntity(ModEffect.java:37) ~[?:?] {re:classloading} at net.minecraft.item.PotionItem.onItemUseFinish(PotionItem.java:47) ~[?:?] {re:classloading} at net.minecraft.item.ItemStack.onItemUseFinish(ItemStack.java:213) ~[?:?] {re:classloading} at net.minecraft.entity.LivingEntity.onItemUseFinish(LivingEntity.java:2876) ~[?:?] {re:classloading} at net.minecraft.entity.player.ServerPlayerEntity.onItemUseFinish(ServerPlayerEntity.java:1027) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.LivingEntity.updateActiveHand(LivingEntity.java:2754) ~[?:?] {re:classloading} at net.minecraft.entity.LivingEntity.tick(LivingEntity.java:2185) ~[?:?] {re:classloading} at net.minecraft.entity.player.PlayerEntity.tick(PlayerEntity.java:237) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.player.ServerPlayerEntity.playerTick(ServerPlayerEntity.java:379) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.network.play.ServerPlayNetHandler.tick(ServerPlayNetHandler.java:188) ~[?:?] {re:classloading} at net.minecraft.network.NetworkManager.tick(NetworkManager.java:250) ~[?:?] {re:classloading} at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:152) ~[?:?] {re:classloading} at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:903) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:821) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:662) [?:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:748) [?:1.8.0_261] {} Caused by: java.lang.IllegalArgumentException: Registration of network channels is locked at net.minecraftforge.fml.network.NetworkRegistry.createInstance(NetworkRegistry.java:130) ~[?:?] {re:classloading} at net.minecraftforge.fml.network.NetworkRegistry.newSimpleChannel(NetworkRegistry.java:97) ~[?:?] {re:classloading} at depression_mod.network.DepressionModPacketHandler.<clinit>(DepressionModPacketHandler.java:13) ~[?:?] {re:classloading} ... 20 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Server thread Stacktrace: at depression_mod.potion.ModEffect.lambda$0(ModEffect.java:30) at net.minecraftforge.common.util.LazyOptional.ifPresent(LazyOptional.java:161) at depression_mod.potion.ModEffect.performEffect(ModEffect.java:27) at depression_mod.potion.ModEffect.affectEntity(ModEffect.java:37) at net.minecraft.item.PotionItem.onItemUseFinish(PotionItem.java:47) at net.minecraft.item.ItemStack.onItemUseFinish(ItemStack.java:213) at net.minecraft.entity.LivingEntity.onItemUseFinish(LivingEntity.java:2876) at net.minecraft.entity.player.ServerPlayerEntity.onItemUseFinish(ServerPlayerEntity.java:1027) at net.minecraft.entity.LivingEntity.updateActiveHand(LivingEntity.java:2754) at net.minecraft.entity.LivingEntity.tick(LivingEntity.java:2185) at net.minecraft.entity.player.PlayerEntity.tick(PlayerEntity.java:237) -- Player being ticked -- Details: Entity Type: minecraft:player (net.minecraft.entity.player.ServerPlayerEntity) Entity ID: 134 Entity Name: Dev Entity's Exact location: -140.36, 70.20, -5.77 Entity's Block location: World: (-141,70,-6), Chunk: (at 3,4,10 in -9,-1; contains blocks -144,0,-16 to -129,255,-1), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1) Entity's Momentum: 0.00, 0.01, 0.00 Entity's Passengers: [] Entity's Vehicle: ~~ERROR~~ NullPointerException: null Stacktrace: at net.minecraft.entity.player.ServerPlayerEntity.playerTick(ServerPlayerEntity.java:379) at net.minecraft.network.play.ServerPlayNetHandler.tick(ServerPlayNetHandler.java:188) at net.minecraft.network.NetworkManager.tick(NetworkManager.java:250) -- Ticking connection -- Details: Connection: net.minecraft.network.NetworkManager@20737ec4 Stacktrace: at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:152) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:903) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:821) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:662) at java.lang.Thread.run(Thread.java:748) -- System Details -- Details: Minecraft Version: 1.15.2 Minecraft Version ID: 1.15.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_261, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 435238600 bytes (415 MB) / 1243086848 bytes (1185 MB) up to 1873805312 bytes (1787 MB) CPUs: 12 JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ModLauncher: 5.1.2+70+master.2845bb9 ModLauncher launch target: fmluserdevclient ModLauncher naming: mcp ModLauncher services: /eventbus-2.2.0-service.jar eventbus PLUGINSERVICE /forge-1.15.2-31.2.41_mapped_snapshot_20200514-1.15.1-launcher.jar object_holder_definalize PLUGINSERVICE /forge-1.15.2-31.2.41_mapped_snapshot_20200514-1.15.1-launcher.jar runtime_enum_extender PLUGINSERVICE /accesstransformers-2.1.3-shadowed.jar accesstransformer PLUGINSERVICE /forge-1.15.2-31.2.41_mapped_snapshot_20200514-1.15.1-launcher.jar capability_inject_definalize PLUGINSERVICE /forge-1.15.2-31.2.41_mapped_snapshot_20200514-1.15.1-launcher.jar runtimedistcleaner PLUGINSERVICE /forge-1.15.2-31.2.41_mapped_snapshot_20200514-1.15.1-launcher.jar fml TRANSFORMATIONSERVICE FML: 31.2 Forge: net.minecraftforge:31.2.41 FML Language Providers: javafml@31.2 minecraft@1 Mod List: client-extra.jar Minecraft {minecraft@1.15.2 DONE} forge-1.15.2-31.2.41_mapped_snapshot_20200514-1.15.1-recomp.jar Forge {forge@31.2.41 DONE} main Depression Mod {depression_mod@NONE DONE} Player Count: 1 / 8; [ServerPlayerEntity['Dev'/134, l='New World', x=-140.36, y=70.20, z=-5.77]] Data Packs: vanilla, mod:forge (incompatible), mod:depression_mod Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'forge'
×
×
  • Create New...

Important Information

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