From b155f08ac3748a8ff4db32d26843e2a501e453aa Mon Sep 17 00:00:00 2001 From: Adubbz Date: Wed, 29 Jan 2014 19:55:12 +1100 Subject: [PATCH] Fixed NPE on startup, fixed mob/record sounds once and for all --- .../java/biomesoplenty/BiomesOPlenty.java | 4 +- .../biomesoplenty/common/core/BOPItems.java | 4 +- .../common/items/ItemBOPRecord.java | 6 +- .../assets/biomesoplenty/lang/en_US.lang | 8 +- .../assets/biomesoplenty/sounds.json | 74 ++++++++++++++++++ .../{sound => sounds}/mob/bird/hurt.ogg | Bin .../{sound => sounds}/mob/bird/say.ogg | Bin .../{sound => sounds}/mob/phantom/death.ogg | Bin .../{sound => sounds}/mob/phantom/hurt.ogg | Bin .../{sound => sounds}/mob/phantom/say.ogg | Bin .../{sound => sounds}/mob/pixie/hurt.ogg | Bin .../{sound => sounds}/mob/pixie/say.ogg | Bin .../{sound => sounds}/mob/wasp/hurt.ogg | Bin .../{sound => sounds}/mob/wasp/say.ogg | Bin .../records/corruption.ogg} | Bin .../records/wanderer.ogg} | Bin .../{bopdiscmud.png => record_corruption.png} | Bin .../{bopdisc.png => record_wanderer.png} | Bin 18 files changed, 85 insertions(+), 11 deletions(-) create mode 100644 src/main/resources/assets/biomesoplenty/sounds.json rename src/main/resources/assets/biomesoplenty/{sound => sounds}/mob/bird/hurt.ogg (100%) rename src/main/resources/assets/biomesoplenty/{sound => sounds}/mob/bird/say.ogg (100%) rename src/main/resources/assets/biomesoplenty/{sound => sounds}/mob/phantom/death.ogg (100%) rename src/main/resources/assets/biomesoplenty/{sound => sounds}/mob/phantom/hurt.ogg (100%) rename src/main/resources/assets/biomesoplenty/{sound => sounds}/mob/phantom/say.ogg (100%) rename src/main/resources/assets/biomesoplenty/{sound => sounds}/mob/pixie/hurt.ogg (100%) rename src/main/resources/assets/biomesoplenty/{sound => sounds}/mob/pixie/say.ogg (100%) rename src/main/resources/assets/biomesoplenty/{sound => sounds}/mob/wasp/hurt.ogg (100%) rename src/main/resources/assets/biomesoplenty/{sound => sounds}/mob/wasp/say.ogg (100%) rename src/main/resources/assets/biomesoplenty/{records/bopdiscmud.ogg => sounds/records/corruption.ogg} (100%) rename src/main/resources/assets/biomesoplenty/{records/bopdisc.ogg => sounds/records/wanderer.ogg} (100%) rename src/main/resources/assets/biomesoplenty/textures/items/{bopdiscmud.png => record_corruption.png} (100%) rename src/main/resources/assets/biomesoplenty/textures/items/{bopdisc.png => record_wanderer.png} (100%) diff --git a/src/main/java/biomesoplenty/BiomesOPlenty.java b/src/main/java/biomesoplenty/BiomesOPlenty.java index 35efa1e17..54d6ec9e9 100644 --- a/src/main/java/biomesoplenty/BiomesOPlenty.java +++ b/src/main/java/biomesoplenty/BiomesOPlenty.java @@ -87,8 +87,8 @@ public class BiomesOPlenty packetPipeline.initalize(); TreecapitatorIntegration.init(); - DimensionManager.registerProviderType(BOPConfigurationIDs.promisedLandDimID, WorldProviderPromised.class, false); - DimensionManager.registerDimension(BOPConfigurationIDs.promisedLandDimID, BOPConfigurationIDs.promisedLandDimID); + //DimensionManager.registerProviderType(BOPConfigurationIDs.promisedLandDimID, WorldProviderPromised.class, false); + //DimensionManager.registerDimension(BOPConfigurationIDs.promisedLandDimID, BOPConfigurationIDs.promisedLandDimID); } @EventHandler diff --git a/src/main/java/biomesoplenty/common/core/BOPItems.java b/src/main/java/biomesoplenty/common/core/BOPItems.java index b3cd56f86..3483995ef 100644 --- a/src/main/java/biomesoplenty/common/core/BOPItems.java +++ b/src/main/java/biomesoplenty/common/core/BOPItems.java @@ -64,8 +64,8 @@ public class BOPItems registerItem(new ItemBOPAncientStaff().setUnlocalizedName("ancientStaff")); registerItem(new ItemEnderporter().setUnlocalizedName("enderporter")); - registerItem(new ItemBOPRecord("bopdisc").setUnlocalizedName("bopDisc")); - registerItem(new ItemBOPRecord("bopdiscmud").setUnlocalizedName("bopDiscMud")); + registerItem(new ItemBOPRecord("wanderer").setUnlocalizedName("record_wanderer")); + registerItem(new ItemBOPRecord("corruption").setUnlocalizedName("record_corruption")); //registerItem(new ItemBiomeBook().setUnlocalizedName("biomeBook")); registerItem(new ItemBiomeFinder().setUnlocalizedName("biomeFinder")); diff --git a/src/main/java/biomesoplenty/common/items/ItemBOPRecord.java b/src/main/java/biomesoplenty/common/items/ItemBOPRecord.java index 2029ae46c..65d867442 100644 --- a/src/main/java/biomesoplenty/common/items/ItemBOPRecord.java +++ b/src/main/java/biomesoplenty/common/items/ItemBOPRecord.java @@ -38,7 +38,7 @@ public class ItemBOPRecord extends ItemRecord @Override public void registerIcons(IIconRegister iconRegister) { - itemIcon = iconRegister.registerIcon("biomesoplenty:" + recordName); + itemIcon = iconRegister.registerIcon("biomesoplenty:" + "record_" + recordName); } @Override @@ -73,7 +73,7 @@ public class ItemBOPRecord extends ItemRecord //TODO: getRecordTitle() public String func_150927_i() { - return StatCollector.translateToLocal("item." + this.field_150929_a + ".desc"); + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".desc"); } @Override @@ -90,6 +90,6 @@ public class ItemBOPRecord extends ItemRecord @Override public ResourceLocation getRecordResource(String name) { - return new ResourceLocation("biomesoplenty:records/" + name.replace("records.", "") + ".ogg"); + return new ResourceLocation("biomesoplenty:" + name); } } diff --git a/src/main/resources/assets/biomesoplenty/lang/en_US.lang b/src/main/resources/assets/biomesoplenty/lang/en_US.lang index 00601acd8..dbb50a38d 100644 --- a/src/main/resources/assets/biomesoplenty/lang/en_US.lang +++ b/src/main/resources/assets/biomesoplenty/lang/en_US.lang @@ -373,11 +373,11 @@ item.ancientStaff.ancientstaffbroken.name=Depleted Ancient Staff item.enderporter.name=Enderporter -item.bopDisc.name=Music Disc -item.bopDiscMud.name=Music Disc +item.record_wanderer.name=Music Disc +item.record_corruption.name=Music Disc -item.bopdisc.desc=Tim Rurkowski - Wanderer -item.bopdiscmud.desc=??? +item.record_wanderer.desc=Tim Rurkowski - Wanderer +item.record_corruption.desc=??? item.flowerBand.dullflowerband.name=Dull Flower Band item.flowerBand.plainflowerband.name=Plain Flower Band diff --git a/src/main/resources/assets/biomesoplenty/sounds.json b/src/main/resources/assets/biomesoplenty/sounds.json new file mode 100644 index 000000000..9bf283f19 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/sounds.json @@ -0,0 +1,74 @@ +{ + "mob.bird.hurt": { + "category": "neutral", + "sounds": [ + "mob/bird/hurt" + ] + }, + "mob.bird.say": { + "category": "neutral", + "sounds": [ + "mob/bird/say" + ] + }, + "mob.phantom.death": { + "category": "hostile", + "sounds": [ + "mob/phantom/death" + ] + }, + "mob.phantom.hurt": { + "category": "hostile", + "sounds": [ + "mob/phantom/hurt" + ] + }, + "mob.phantom.say": { + "category": "hostile", + "sounds": [ + "mob/phantom/say" + ] + }, + "mob.pixie.hurt": { + "category": "neutral", + "sounds": [ + "mob/pixie/hurt" + ] + }, + "mob.pixie.say": { + "category": "neutral", + "sounds": [ + "mob/pixie/say" + ] + }, + "mob.wasp.hurt": { + "category": "hostile", + "sounds": [ + "mob/wasp/hurt" + ] + }, + "mob.wasp.say": { + "category": "hostile", + "sounds": [ + "mob/wasp/say" + ] + }, + "records.wanderer": { + "category": "record", + "sounds": [ + { + "name": "records/wanderer", + "stream": true + } + ] + }, + "records.corruption": { + "category": "record", + "sounds": [ + { + "name": "records/corruption", + "stream": true + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/biomesoplenty/sound/mob/bird/hurt.ogg b/src/main/resources/assets/biomesoplenty/sounds/mob/bird/hurt.ogg similarity index 100% rename from src/main/resources/assets/biomesoplenty/sound/mob/bird/hurt.ogg rename to src/main/resources/assets/biomesoplenty/sounds/mob/bird/hurt.ogg diff --git a/src/main/resources/assets/biomesoplenty/sound/mob/bird/say.ogg b/src/main/resources/assets/biomesoplenty/sounds/mob/bird/say.ogg similarity index 100% rename from src/main/resources/assets/biomesoplenty/sound/mob/bird/say.ogg rename to src/main/resources/assets/biomesoplenty/sounds/mob/bird/say.ogg diff --git a/src/main/resources/assets/biomesoplenty/sound/mob/phantom/death.ogg b/src/main/resources/assets/biomesoplenty/sounds/mob/phantom/death.ogg similarity index 100% rename from src/main/resources/assets/biomesoplenty/sound/mob/phantom/death.ogg rename to src/main/resources/assets/biomesoplenty/sounds/mob/phantom/death.ogg diff --git a/src/main/resources/assets/biomesoplenty/sound/mob/phantom/hurt.ogg b/src/main/resources/assets/biomesoplenty/sounds/mob/phantom/hurt.ogg similarity index 100% rename from src/main/resources/assets/biomesoplenty/sound/mob/phantom/hurt.ogg rename to src/main/resources/assets/biomesoplenty/sounds/mob/phantom/hurt.ogg diff --git a/src/main/resources/assets/biomesoplenty/sound/mob/phantom/say.ogg b/src/main/resources/assets/biomesoplenty/sounds/mob/phantom/say.ogg similarity index 100% rename from src/main/resources/assets/biomesoplenty/sound/mob/phantom/say.ogg rename to src/main/resources/assets/biomesoplenty/sounds/mob/phantom/say.ogg diff --git a/src/main/resources/assets/biomesoplenty/sound/mob/pixie/hurt.ogg b/src/main/resources/assets/biomesoplenty/sounds/mob/pixie/hurt.ogg similarity index 100% rename from src/main/resources/assets/biomesoplenty/sound/mob/pixie/hurt.ogg rename to src/main/resources/assets/biomesoplenty/sounds/mob/pixie/hurt.ogg diff --git a/src/main/resources/assets/biomesoplenty/sound/mob/pixie/say.ogg b/src/main/resources/assets/biomesoplenty/sounds/mob/pixie/say.ogg similarity index 100% rename from src/main/resources/assets/biomesoplenty/sound/mob/pixie/say.ogg rename to src/main/resources/assets/biomesoplenty/sounds/mob/pixie/say.ogg diff --git a/src/main/resources/assets/biomesoplenty/sound/mob/wasp/hurt.ogg b/src/main/resources/assets/biomesoplenty/sounds/mob/wasp/hurt.ogg similarity index 100% rename from src/main/resources/assets/biomesoplenty/sound/mob/wasp/hurt.ogg rename to src/main/resources/assets/biomesoplenty/sounds/mob/wasp/hurt.ogg diff --git a/src/main/resources/assets/biomesoplenty/sound/mob/wasp/say.ogg b/src/main/resources/assets/biomesoplenty/sounds/mob/wasp/say.ogg similarity index 100% rename from src/main/resources/assets/biomesoplenty/sound/mob/wasp/say.ogg rename to src/main/resources/assets/biomesoplenty/sounds/mob/wasp/say.ogg diff --git a/src/main/resources/assets/biomesoplenty/records/bopdiscmud.ogg b/src/main/resources/assets/biomesoplenty/sounds/records/corruption.ogg similarity index 100% rename from src/main/resources/assets/biomesoplenty/records/bopdiscmud.ogg rename to src/main/resources/assets/biomesoplenty/sounds/records/corruption.ogg diff --git a/src/main/resources/assets/biomesoplenty/records/bopdisc.ogg b/src/main/resources/assets/biomesoplenty/sounds/records/wanderer.ogg similarity index 100% rename from src/main/resources/assets/biomesoplenty/records/bopdisc.ogg rename to src/main/resources/assets/biomesoplenty/sounds/records/wanderer.ogg diff --git a/src/main/resources/assets/biomesoplenty/textures/items/bopdiscmud.png b/src/main/resources/assets/biomesoplenty/textures/items/record_corruption.png similarity index 100% rename from src/main/resources/assets/biomesoplenty/textures/items/bopdiscmud.png rename to src/main/resources/assets/biomesoplenty/textures/items/record_corruption.png diff --git a/src/main/resources/assets/biomesoplenty/textures/items/bopdisc.png b/src/main/resources/assets/biomesoplenty/textures/items/record_wanderer.png similarity index 100% rename from src/main/resources/assets/biomesoplenty/textures/items/bopdisc.png rename to src/main/resources/assets/biomesoplenty/textures/items/record_wanderer.png