Update to 1.16.4

This commit is contained in:
Marcel Konrad
2020-11-02 23:51:10 +01:00
parent 6408a67956
commit 4f732a8062
18 changed files with 25 additions and 26 deletions

View File

@@ -11,7 +11,7 @@ public class Main
{
public static final String NAME = "World Handler";
public static final String MODID = "worldhandler";
public static final String MC_VERSION = "1.16.3";
public static final String MC_VERSION = "1.16.4";
public static final String MOD_VERSION = "2.11.1";
public static final String URL = "https://minecraft.curseforge.com/projects/world-handler-command-gui";

View File

@@ -16,7 +16,7 @@ import net.minecraftforge.registries.ForgeRegistries;
@OnlyIn(Dist.CLIENT)
public abstract class ComponentAttribute implements IBuilderComponent
{
public static final List<Attribute> ATTRIBUTES = ForgeRegistries.ATTRIBUTES.getValues().stream().filter(attribute -> !attribute.func_233754_c_().equals(I18n.format(attribute.func_233754_c_()))).collect(Collectors.toList());
public static final List<Attribute> ATTRIBUTES = ForgeRegistries.ATTRIBUTES.getValues().stream().filter(attribute -> !attribute.getAttributeName().equals(I18n.format(attribute.getAttributeName()))).collect(Collectors.toList());
protected Map<Attribute, Double> attributes = new HashMap<Attribute, Double>();

View File

@@ -45,7 +45,7 @@ public class ContentChangeWorld extends ContentChild
IConnection connection = ContentChangeWorld.disconnect();
DummyScreen dummy = new DummyScreen(() -> ContentChangeWorld.reconnect(connection));
if(Minecraft.getInstance().gameSettings.field_230152_Z_)
if(Minecraft.getInstance().gameSettings.skipMultiplayerWarning)
{
Minecraft.getInstance().displayGuiScreen(new MultiplayerScreen(dummy));
}
@@ -65,9 +65,9 @@ public class ContentChangeWorld extends ContentChild
if(isIntegrated)
{
IntegratedServer integrated = Minecraft.getInstance().getIntegratedServer();
String folder = integrated.anvilConverterForAnvilFile.func_237282_a_();
DimensionGeneratorSettings dimensionGeneratorSettings = integrated.func_240793_aU_().getDimensionGeneratorSettings();
WorldSettings worldSettings = integrated.func_240793_aU_().func_230408_H_();
String folder = integrated.anvilConverterForAnvilFile.getSaveName();
DimensionGeneratorSettings dimensionGeneratorSettings = integrated.getServerConfiguration().getDimensionGeneratorSettings();
WorldSettings worldSettings = integrated.getServerConfiguration().getWorldSettings();
Minecraft.getInstance().world.sendQuittingDisconnectingPacket();
Minecraft.getInstance().unloadWorld(new DirtMessageScreen(new TranslationTextComponent("menu.savingLevel")));
@@ -99,7 +99,7 @@ public class ContentChangeWorld extends ContentChild
else if(connection instanceof IntegratedConnection)
{
IntegratedConnection integrated = (IntegratedConnection) connection;
Minecraft.getInstance().func_238192_a_(integrated.getFolder(), integrated.getWorldSettings(), DynamicRegistries.func_239770_b_(), integrated.getDimensionGeneratorSettings()); //launchIntegratedServer
Minecraft.getInstance().createWorld(integrated.getFolder(), integrated.getWorldSettings(), DynamicRegistries.func_239770_b_(), integrated.getDimensionGeneratorSettings());
Minecraft.getInstance().mouseHelper.grabMouse();
}
else if(connection instanceof DedicatedConnection)

View File

@@ -170,7 +170,7 @@ public class ContentCustomItem extends Content
@Override
public IFormattableTextComponent translate(Attribute item)
{
return new TranslationTextComponent(item.func_233754_c_());
return new TranslationTextComponent(item.getAttributeName());
}
@Override

View File

@@ -206,7 +206,7 @@ public class ContentNoteEditor extends Content
TranslationTextComponent text = new TranslationTextComponent("gui.worldhandler.blocks.note_block_editor.look_at_note_block", KeyHandler.KEY_WORLD_HANDLER.func_238171_j_());
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
fontRenderer.func_243248_b(matrix, text, x + 116 - fontRenderer.func_238414_a_(text) / 2, y + 70, Config.getSkin().getLabelColor());
fontRenderer.func_243248_b(matrix, text, x + 116 - fontRenderer.getStringPropertyWidth(text) / 2, y + 70, Config.getSkin().getLabelColor());
}
}

View File

@@ -177,7 +177,7 @@ public class ContentPlayer extends Content
{
int xPos = x + 175;
int yPos = y + 82;
int playerNameWidth = Minecraft.getInstance().fontRenderer.func_238414_a_(Minecraft.getInstance().player.getName()) / 2;
int playerNameWidth = Minecraft.getInstance().fontRenderer.getStringPropertyWidth(Minecraft.getInstance().player.getName()) / 2;
AbstractGui.fill(matrix, container.width / 2 - playerNameWidth - 1 + 59, yPos - 74, container.width / 2 + playerNameWidth + 1 + 59, yPos - 65, 0x3F000000);
Minecraft.getInstance().fontRenderer.func_243248_b(matrix, Minecraft.getInstance().player.getName(), container.width / 2 - playerNameWidth + 59, yPos - 73, 0xE0E0E0);

View File

@@ -189,7 +189,7 @@ public class ContentSignEditor extends Content
TranslationTextComponent text = new TranslationTextComponent("gui.worldhandler.blocks.sign_editor.look_at_sign", KeyHandler.KEY_WORLD_HANDLER.func_238171_j_());
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
fontRenderer.func_243248_b(matrix, text, x + 116 - fontRenderer.func_238414_a_(text) / 2, y + 70, Config.getSkin().getLabelColor());
fontRenderer.func_243248_b(matrix, text, x + 116 - fontRenderer.getStringPropertyWidth(text) / 2, y + 70, Config.getSkin().getLabelColor());
}
}

View File

@@ -194,7 +194,7 @@ public class ContentSummon extends Content
@Override
public IFormattableTextComponent translate(Attribute item)
{
return new TranslationTextComponent(item.func_233754_c_());
return new TranslationTextComponent(item.getAttributeName());
}
@Override

View File

@@ -53,7 +53,7 @@ public class ContentWorldInfo extends Content
this.posZField.setText(I18n.format("gui.worldhandler.world_info.start.spawn") + " Z: " + ContentWorldInfo.format(world, object -> object.getWorldInfo().getSpawnZ()));
this.worldField = new GuiTextFieldTooltip(x + 118, y + 12, 114, 20);
this.worldField.setText(I18n.format("gui.worldhandler.world_info.world.name") + ": " + ContentWorldInfo.format(server, object -> object.func_240793_aU_().getWorldName()));
this.worldField.setText(I18n.format("gui.worldhandler.world_info.world.name") + ": " + ContentWorldInfo.format(server, object -> object.getServerConfiguration().getWorldName()));
this.seedField = new GuiTextFieldTooltip(x + 118, y + 36, 114, 20);
this.seedField.setText(I18n.format("gui.worldhandler.world_info.world.seed") + ": " + ContentWorldInfo.format(server, object -> object.func_241755_D_().getSeed()));

View File

@@ -90,7 +90,7 @@ public class WidgetNameField implements IContainerWidget
{
int width = font.getStringWidth(I18n.format("gui.worldhandler.generic.edit_username")) + 2;
this.nameField.setWidth(width);
this.nameField.setPosition(x - (font.func_238414_a_(container.getContent().getTitle()) + 2), y);
this.nameField.setPosition(x - (font.getStringPropertyWidth(container.getContent().getTitle()) + 2), y);
}
else
{

View File

@@ -78,7 +78,7 @@ public class GuiButtonPiano extends GuiButtonBase
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
this.blit(matrix, this.x, this.y, 25 + hoverstate * 15 - 15, 0, 15, 92);
fontRenderer.func_243248_b(matrix, this.getMessage(), (float) (this.x + this.width / 2 - fontRenderer.func_238414_a_(this.getMessage()) / 2), (float) (this.y + (this.height - 8) / 2 + 36), textColor); //drawString
fontRenderer.func_243248_b(matrix, this.getMessage(), (float) (this.x + this.width / 2 - fontRenderer.getStringPropertyWidth(this.getMessage()) / 2), (float) (this.y + (this.height - 8) / 2 + 36), textColor); //drawString
}
protected void drawBlackKey(MatrixStack matrix, int hoverstate)

View File

@@ -94,7 +94,7 @@ public class GuiSlider extends GuiButtonBase
int value = this.persistence.getValueInt();
IFormattableTextComponent suffix = this.logic.formatValue(value).append(this.logic.formatSuffix(value));
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
IFormattableTextComponent text = TextUtils.stripText(this.logic.formatPrefix(value), this.width - fontRenderer.func_238414_a_(suffix), fontRenderer).append(suffix);
IFormattableTextComponent text = TextUtils.stripText(this.logic.formatPrefix(value), this.width - fontRenderer.getStringPropertyWidth(suffix), fontRenderer).append(suffix);
this.setMessage(text);
}

View File

@@ -1,6 +1,5 @@
package exopandora.worldhandler.util;
import exopandora.worldhandler.builder.INBTWritable;
import net.minecraft.nbt.INBT;
import net.minecraft.nbt.StringNBT;
@@ -75,7 +74,7 @@ public class MutableStringTextComponent extends StringTextComponent implements I
public IReorderingProcessor formatter(String string, Integer index)
{
return IReorderingProcessor.func_242239_a(string, this.getStyle());
return IReorderingProcessor.fromString(string, this.getStyle());
}
@Override

View File

@@ -37,7 +37,7 @@ public class RegistryHelper
registerRegistry(ForgeRegistries.POTIONS, Effect::getName);
registerRegistry(ForgeRegistries.BIOMES, biome ->
{
MutableRegistry<Biome> registry = DynamicRegistries.func_239770_b_().func_243612_b(Registry.BIOME_KEY);
MutableRegistry<Biome> registry = DynamicRegistries.func_239770_b_().getRegistry(Registry.BIOME_KEY);
ResourceLocation resource = registry.getKey(biome);
String key = "biome." + biome.getRegistryName().getNamespace() + "." + resource.getPath();

View File

@@ -88,7 +88,7 @@ public class RenderUtils
matrix.scale(16.0F, 16.0F, 16.0F);
IRenderTypeBuffer.Impl buffer = Minecraft.getInstance().getRenderTypeBuffers().getBufferSource();
boolean flag = !bakedmodel.func_230044_c_();
boolean flag = !bakedmodel.isSideLit();
if(flag)
{

View File

@@ -23,7 +23,7 @@ public class TextUtils
public static IFormattableTextComponent stripText(IFormattableTextComponent string, IFormattableTextComponent prefix, int maxWidth, FontRenderer fontRenderer)
{
if(fontRenderer.func_238414_a_(prefix) + fontRenderer.func_238414_a_(string) > (maxWidth - fontRenderer.func_238414_a_(prefix)))
if(fontRenderer.getStringPropertyWidth(prefix) + fontRenderer.getStringPropertyWidth(string) > (maxWidth - fontRenderer.getStringPropertyWidth(prefix)))
{
IFormattableTextComponent result = new StringTextComponent("").setStyle(string.getStyle());
@@ -31,7 +31,7 @@ public class TextUtils
{
IFormattableTextComponent extension = new StringTextComponent(result.getString() + c + "...").setStyle(string.getStyle());
if(fontRenderer.func_238414_a_(extension) < maxWidth)
if(fontRenderer.getStringPropertyWidth(extension) < maxWidth)
{
result = new StringTextComponent(result.getString() + c).setStyle(string.getStyle());
}