1
0
Fork 0

Remove debug print statement and load additional sound files

This commit is contained in:
HoosierTransfer 2024-05-13 15:54:00 -04:00
parent ad4f260deb
commit 9616a43afd
6 changed files with 5419 additions and 3674 deletions

1034
LICENSE

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -74,9 +74,13 @@ public class SoundHandler implements IResourceManagerReloadListener, ITickable {
this.sndManager.reloadSoundSystem();
this.sndRegistry.clearMap();
// Load sounds from two files: sounds.json and sounds2.json
String[] soundFiles = { "sounds.json", "sounds2.json" };
for (String s : iresourcemanager.getResourceDomains()) {
for (String soundFile : soundFiles) {
try {
for (IResource iresource : iresourcemanager.getAllResources(new ResourceLocation(s, "sounds.json"))) {
for (IResource iresource : iresourcemanager.getAllResources(new ResourceLocation(s, soundFile))) {
try {
Map map = this.getSoundMap(iresource.getInputStream());
@ -85,14 +89,14 @@ public class SoundHandler implements IResourceManagerReloadListener, ITickable {
(SoundList) entry.getValue());
}
} catch (RuntimeException runtimeexception) {
logger.warn("Invalid sounds.json", runtimeexception);
logger.warn("Invalid " + soundFile, runtimeexception);
}
}
} catch (IOException var11) {
;
}
}
}
}
public static class SoundMap {

View File

@ -89,8 +89,6 @@ public class ItemBlock extends Item {
setTileEntityNBT(world, entityplayer, blockpos, itemstack);
this.block.onBlockPlacedBy(world, blockpos, iblockstate1, entityplayer, itemstack);
}
System.out.println(
"Placed block at " + blockpos.getX() + ", " + blockpos.getY() + ", " + blockpos.getZ());
// ! fix sounds
// world.playSoundEffect((double) ((float) blockpos.getX() + 0.5F),
// (double) ((float) blockpos.getY() + 0.5F), (double) ((float) blockpos.getZ()