Quick Fix

- Replaced reference to String#toLowerCase in AllSoundEvents
This commit is contained in:
simibubi 2020-02-15 19:02:35 +01:00
parent 6f06ebffa3
commit e7b09dc63f

View file

@ -4,6 +4,7 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.data.ICanGenerateJson;
import net.minecraft.data.DirectoryCache;
import net.minecraft.data.IDataProvider;
@ -16,7 +17,6 @@ import net.minecraftforge.registries.IForgeRegistry;
import java.io.IOException;
import java.nio.file.Path;
public enum AllSoundEvents implements ICanGenerateJson {
CUCKOO_PIG("creeperclock"),
@ -32,7 +32,6 @@ public enum AllSoundEvents implements ICanGenerateJson {
BLOCKZAPPER_DENY(SoundEvents.BLOCK_NOTE_BLOCK_BASS),
BLOCK_FUNNEL_EAT(SoundEvents.ENTITY_GENERIC_EAT),
;
String id;
@ -40,7 +39,7 @@ public enum AllSoundEvents implements ICanGenerateJson {
// For adding our own sounds at assets/create/sounds/name.ogg
AllSoundEvents() {
id = name().toLowerCase();
id = Lang.asId(name());
}
AllSoundEvents(String name) {
@ -49,7 +48,7 @@ public enum AllSoundEvents implements ICanGenerateJson {
// For wrapping a existing sound with new subtitle
AllSoundEvents(SoundEvent child) {
id = name().toLowerCase();
this();
this.child = child;
}
@ -66,8 +65,7 @@ public enum AllSoundEvents implements ICanGenerateJson {
public static void register(RegistryEvent.Register<SoundEvent> event) {
IForgeRegistry<SoundEvent> registry = event.getRegistry();
for (AllSoundEvents entry :
values()) {
for (AllSoundEvents entry : values()) {
ResourceLocation rec = new ResourceLocation(Create.ID, entry.getName());
SoundEvent sound = new SoundEvent(rec).setRegistryName(rec);
@ -82,8 +80,7 @@ public enum AllSoundEvents implements ICanGenerateJson {
try {
JsonObject json = new JsonObject();
for (AllSoundEvents soundEvent :
values()) {
for (AllSoundEvents soundEvent : values()) {
JsonObject entry = new JsonObject();
JsonArray arr = new JsonArray();
if (soundEvent.child != null) {