-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ability for custom records to have finer control over there s…
…ound resource location. Closes #933
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
patches/minecraft/net/minecraft/item/ItemRecord.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- ../src-base/minecraft/net/minecraft/item/ItemRecord.java | ||
+++ ../src-work/minecraft/net/minecraft/item/ItemRecord.java | ||
@@ -10,6 +10,7 @@ | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.init.Blocks; | ||
import net.minecraft.util.IIcon; | ||
+import net.minecraft.util.ResourceLocation; | ||
import net.minecraft.util.StatCollector; | ||
import net.minecraft.world.World; | ||
|
||
@@ -24,7 +25,7 @@ | ||
this.field_150929_a = p_i45350_1_; | ||
this.maxStackSize = 1; | ||
this.setCreativeTab(CreativeTabs.tabMisc); | ||
- field_150928_b.put(p_i45350_1_, this); | ||
+ field_150928_b.put("records." + p_i45350_1_, this); //Forge Bug Fix: RenderGlobal adds a "records." when looking up below. | ||
} | ||
|
||
// JAVADOC METHOD $$ func_77617_a | ||
@@ -81,4 +82,15 @@ | ||
{ | ||
return (ItemRecord)field_150928_b.get(p_150926_0_); | ||
} | ||
+ | ||
+ /** | ||
+ * Retrieves the resource location of the sound to play for this record. | ||
+ * | ||
+ * @param name The name of the record to play | ||
+ * @return The resource location for the audio, null to use default. | ||
+ */ | ||
+ public ResourceLocation getRecordResource(String name) | ||
+ { | ||
+ return new ResourceLocation(name); | ||
+ } | ||
} |