Jump to content

Error with sounds when starting Server !


DealerJoe

Recommended Posts

Hi, its DealerJoe again!

 

Okay, my problem are sounds this time. So, if I want to register a sound, I have to put the register-Method into the @PreInit-Method :

 

@PreInit
public void loadConfiguration(FMLPreInitializationEvent evt) {

	/** LOAD SOUNDS **/

	MinecraftForge.EVENT_BUS.register(new SoundEvent());
}

 

just like this. But now my Question, I have to put a @SideOnly annotation somewhere, otherwise the server crashes :

 

2012-10-21 14:29:43 [iNFO] [ForgeModLoader] Forge Mod Loader version 3.1.35.394 for Minecraft client:1.3.2, server:1.3.2 loading
2012-10-21 14:29:44 [iNFO] [sTDOUT] 195 recipes
2012-10-21 14:29:44 [iNFO] [sTDOUT] 27 achievements
2012-10-21 14:29:45 [iNFO] [sTDERR] 2012-10-21 14:29:45 [iNFO] Starting minecraft server version 1.3.2
2012-10-21 14:29:45 [iNFO] [ForgeModLoader] Attempting early MinecraftForge initialization
2012-10-21 14:29:45 [iNFO] [sTDOUT] MinecraftForge v4.2.5.303 Initialized
2012-10-21 14:29:45 [iNFO] [ForgeModLoader] MinecraftForge v4.2.5.303 Initialized
2012-10-21 14:29:45 [iNFO] [ForgeModLoader] Completed early MinecraftForge initialization
2012-10-21 14:29:45 [iNFO] [ForgeModLoader] Searching C:\Users\Toshiba\Desktop\Forge Modding\FarmersFriends\jars\mods for mods
2012-10-21 14:29:46 [iNFO] [ForgeModLoader] Attempting to reparse the mod container bin
2012-10-21 14:29:47 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 3 mods to load
2012-10-21 14:29:47 [iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
2012-10-21 14:29:47 [iNFO] [sTDERR] 2012-10-21 14:29:47 [iNFO] Loading properties
2012-10-21 14:29:47 [iNFO] [sTDERR] 2012-10-21 14:29:47 [iNFO] Default game type: SURVIVAL
2012-10-21 14:29:47 [iNFO] [sTDERR] 2012-10-21 14:29:47 [iNFO] Generating keypair
2012-10-21 14:29:48 [iNFO] [sTDERR] 2012-10-21 14:29:48 [iNFO] Starting Minecraft server on *:25565
2012-10-21 14:29:48 [iNFO] [sTDERR] 2012-10-21 14:29:48 [WARNING] **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
2012-10-21 14:29:48 [iNFO] [sTDERR] 2012-10-21 14:29:48 [WARNING] The server will make no attempt to authenticate usernames. Beware.
2012-10-21 14:29:48 [iNFO] [sTDERR] 2012-10-21 14:29:48 [WARNING] While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
2012-10-21 14:29:48 [iNFO] [sTDERR] 2012-10-21 14:29:48 [WARNING] To change this, set "online-mode" to "true" in the server.properties file.
2012-10-21 14:29:48 [iNFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 3 mods
2012-10-21 14:29:48 [iNFO] [sTDERR] 2012-10-21 14:29:48 [iNFO] Preparing level "mcpworld"
2012-10-21 14:29:48 [iNFO] [ForgeModLoader] This world was saved with mod FarmersFriends version 1.0 and it is now at version 1.1, things may not work well
2012-10-21 14:29:48 [iNFO] [ForgeModLoader] Loading dimension 0 (mcpworld) (net.minecraft.src.DedicatedServer@4f2948c6)
2012-10-21 14:29:48 [iNFO] [ForgeModLoader] Loading dimension 1 (mcpworld) (net.minecraft.src.DedicatedServer@4f2948c6)
2012-10-21 14:29:48 [iNFO] [ForgeModLoader] Loading dimension -1 (mcpworld) (net.minecraft.src.DedicatedServer@4f2948c6)
2012-10-21 14:29:48 [iNFO] [sTDERR] 2012-10-21 14:29:48 [iNFO] Preparing start region for level 0
2012-10-21 14:29:49 [iNFO] [sTDERR] 2012-10-21 14:29:49 [iNFO] Preparing spawn area: 52%
2012-10-21 14:29:50 [iNFO] [sTDERR] 2012-10-21 14:29:50 [iNFO] Done (2,137s)! For help, type "help" or "?"
2012-10-21 14:30:28 [iNFO] [sTDERR] 2012-10-21 14:30:28 [iNFO] Stopping the server
2012-10-21 14:30:28 [iNFO] [sTDERR] 2012-10-21 14:30:28 [iNFO] Stopping server
2012-10-21 14:30:28 [iNFO] [sTDERR] 2012-10-21 14:30:28 [iNFO] Saving players
2012-10-21 14:30:28 [iNFO] [sTDERR] 	at java.net.DualStackPlainSocketImpl.accept0(Native Method)
2012-10-21 14:30:28 [iNFO] [sTDERR] 	at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
2012-10-21 14:30:28 [iNFO] [sTDERR] 	at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
2012-10-21 14:30:28 [iNFO] [sTDERR] 	at java.net.PlainSocketImpl.accept(Unknown Source)
2012-10-21 14:30:28 [iNFO] [sTDERR] 	at java.net.ServerSocket.implAccept(Unknown Source)
2012-10-21 14:30:28 [iNFO] [sTDERR] 	at java.net.ServerSocket.accept(Unknown Source)
2012-10-21 14:30:28 [iNFO] [sTDERR] 	at net.minecraft.src.ServerListenThread.run(ServerListenThread.java:75)
2012-10-21 14:30:28 [iNFO] [sTDOUT] Closing listening thread
2012-10-21 14:30:28 [iNFO] [sTDERR] 2012-10-21 14:30:28 [iNFO] Saving worlds
2012-10-21 14:30:28 [iNFO] [sTDERR] 2012-10-21 14:30:28 [iNFO] Saving chunks for level 'mcpworld'/Overworld
2012-10-21 14:30:28 [iNFO] [sTDERR] 2012-10-21 14:30:28 [iNFO] Saving chunks for level 'mcpworld'/Nether
2012-10-21 14:30:28 [iNFO] [sTDERR] 2012-10-21 14:30:28 [iNFO] Saving chunks for level 'mcpworld'/The End
2012-10-21 14:30:29 [iNFO] [ForgeModLoader] Unloading dimension 0
2012-10-21 14:30:29 [iNFO] [ForgeModLoader] Unloading dimension -1
2012-10-21 14:30:29 [iNFO] [ForgeModLoader] Unloading dimension 1

 

But where do I have to put it ?

 

 

Hope you can help me

 

DealerJoe

Link to comment
Share on other sites

Yeah, this was my first Idea too, but when I then try to play the sound, I hear nothing.

 

registering the sound :

 

event.manager.soundPoolSounds.addSound("sound/chopper.wav", mod_farmersfriends.class.getResource("/farmer/sound/chopper.wav"));            

 

Trying to play it :

 

par1World.playSoundEffect(par2, par3, par4, "sound.chopper", 1F, 1F);

 

Thank you anyway.

 

DealerJoe

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
    • It is an issue with quark - update it to this build: https://www.curseforge.com/minecraft/mc-mods/quark/files/3642325
    • Remove Instant Massive Structures Mod from your server     Add new crash-reports with sites like https://paste.ee/  
    • Update your drivers: https://www.amd.com/en/support/graphics/amd-radeon-r9-series/amd-radeon-r9-200-series/amd-radeon-r9-280x
  • Topics

×
×
  • Create New...

Important Information

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