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,25 +74,29 @@ public class SoundHandler implements IResourceManagerReloadListener, ITickable {
this.sndManager.reloadSoundSystem();
this.sndRegistry.clearMap();
for (String s : iresourcemanager.getResourceDomains()) {
try {
for (IResource iresource : iresourcemanager.getAllResources(new ResourceLocation(s, "sounds.json"))) {
try {
Map map = this.getSoundMap(iresource.getInputStream());
// Load sounds from two files: sounds.json and sounds2.json
String[] soundFiles = { "sounds.json", "sounds2.json" };
for (Entry entry : (Set<Entry>) map.entrySet()) {
this.loadSoundResource(new ResourceLocation(s, (String) entry.getKey()),
(SoundList) entry.getValue());
for (String s : iresourcemanager.getResourceDomains()) {
for (String soundFile : soundFiles) {
try {
for (IResource iresource : iresourcemanager.getAllResources(new ResourceLocation(s, soundFile))) {
try {
Map map = this.getSoundMap(iresource.getInputStream());
for (Entry entry : (Set<Entry>) map.entrySet()) {
this.loadSoundResource(new ResourceLocation(s, (String) entry.getKey()),
(SoundList) entry.getValue());
}
} catch (RuntimeException runtimeexception) {
logger.warn("Invalid " + soundFile, runtimeexception);
}
} catch (RuntimeException runtimeexception) {
logger.warn("Invalid sounds.json", runtimeexception);
}
} catch (IOException var11) {
;
}
} 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()