Update to 1.14.3
This commit is contained in:
@@ -146,7 +146,7 @@ public class ActionHelper
|
||||
TranslationTextComponent message = new TranslationTextComponent("worldhandler.error.gui", name);
|
||||
message.setStyle(new Style().setColor(net.minecraft.util.text.TextFormatting.RED));
|
||||
|
||||
Minecraft.getInstance().field_71456_v.addChatMessage(ChatType.SYSTEM, message);
|
||||
Minecraft.getInstance().ingameGUI.addChatMessage(ChatType.SYSTEM, message);
|
||||
WorldHandler.LOGGER.throwing(e);
|
||||
}
|
||||
}
|
||||
@@ -155,8 +155,8 @@ public class ActionHelper
|
||||
{
|
||||
if(!CommandHelper.canPlayerIssueCommand() && Config.getSettings().permissionQuery())
|
||||
{
|
||||
Minecraft.getInstance().field_71456_v.addChatMessage(ChatType.SYSTEM, new StringTextComponent(TextFormatting.RED + I18n.format("worldhandler.permission.refused")));
|
||||
Minecraft.getInstance().field_71456_v.addChatMessage(ChatType.SYSTEM, new StringTextComponent(TextFormatting.RED + I18n.format("worldhandler.permission.refused.change", I18n.format("gui.worldhandler.config.key.settings.permission_query"))));
|
||||
Minecraft.getInstance().ingameGUI.addChatMessage(ChatType.SYSTEM, new StringTextComponent(TextFormatting.RED + I18n.format("worldhandler.permission.refused")));
|
||||
Minecraft.getInstance().ingameGUI.addChatMessage(ChatType.SYSTEM, new StringTextComponent(TextFormatting.RED + I18n.format("worldhandler.permission.refused.change", I18n.format("gui.worldhandler.config.key.settings.permission_query"))));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -13,7 +13,6 @@ import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.potion.Effect;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -26,7 +25,6 @@ import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
public class RegistryHelper
|
||||
{
|
||||
private static final Map<IForgeRegistry<?>, Function<?, String>> FORGE = new HashMap<IForgeRegistry<?>, Function<?, String>>();
|
||||
private static final Map<Registry<?>, Function<?, String>> VANILLA = new HashMap<Registry<?>, Function<?, String>>();
|
||||
|
||||
static
|
||||
{
|
||||
@@ -36,7 +34,7 @@ public class RegistryHelper
|
||||
registerRegistry(ForgeRegistries.BIOMES, Biome::getTranslationKey);
|
||||
registerRegistry(ForgeRegistries.ENCHANTMENTS, Enchantment::getName);
|
||||
registerRegistry(ForgeRegistries.ENTITIES, EntityType::getTranslationKey);
|
||||
registerRegistry(Registry.field_212623_l, stat -> "stat." + stat.toString().replace(':', '.'));
|
||||
registerRegistry(ForgeRegistries.STAT_TYPES, stat -> "stat." + stat.toString().replace(':', '.'));
|
||||
}
|
||||
|
||||
private static <T extends ForgeRegistryEntry<T>> void registerRegistry(IForgeRegistry<T> registry, Function<T, String> mapper)
|
||||
@@ -44,11 +42,6 @@ public class RegistryHelper
|
||||
FORGE.put(registry, mapper);
|
||||
}
|
||||
|
||||
private static <T> void registerRegistry(Registry<T> registry, Function<T, String> mapper)
|
||||
{
|
||||
VANILLA.put(registry, mapper);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> String translate(ResourceLocation resource)
|
||||
@@ -61,14 +54,6 @@ public class RegistryHelper
|
||||
}
|
||||
}
|
||||
|
||||
for(Registry<?> registry : VANILLA.keySet())
|
||||
{
|
||||
if(registry.containsKey(resource))
|
||||
{
|
||||
return ((Function<T, String>) VANILLA.get(registry)).apply((T) registry.getOrDefault(resource));
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user