Update to 1.15.2

This commit is contained in:
Marcel Konrad
2020-01-25 14:19:00 +01:00
parent 5511cdc96d
commit 1adb09cacd
24 changed files with 112 additions and 93 deletions

View File

@@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = '1.15.1-2.8'
version = '1.15.2-2.8.1'
group = 'exopandora.worldhandler' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'WorldHandler'
@@ -25,7 +25,7 @@ minecraft {
// stable_# Stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'snapshot', version: '20191225-1.14.3'
mappings channel: 'snapshot', version: '20200123-1.15.1'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
@@ -89,7 +89,7 @@ dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.15.1-30.0.16'
minecraft 'net.minecraftforge:forge:1.15.2-31.0.0'
// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"

View File

@@ -12,8 +12,8 @@ public class Main
{
public static final String NAME = "World Handler";
public static final String MODID = "worldhandler";
public static final String MC_VERSION = "1.15.1";
public static final String MOD_VERSION = "2.8";
public static final String MC_VERSION = "1.15.2";
public static final String MOD_VERSION = "2.8.1";
public static final String URL = "https://minecraft.curseforge.com/projects/world-handler-command-gui";
public static void main(String[] args)

View File

@@ -32,7 +32,7 @@ public class ComponentDisplay implements IBuilderComponent
{
if(this.lore[x] != null && !this.lore[x].isEmpty())
{
lore.add(StringNBT.func_229705_a_(this.lore[x]));
lore.add(StringNBT.valueOf(this.lore[x]));
}
}

View File

@@ -68,37 +68,37 @@ public class ComponentSummon implements IBuilderComponent
if(this.name.equalsIgnoreCase("Cat"))
{
this.tag = "CatType";
return IntNBT.func_229692_a_(this.random.nextInt(3) + 1);
return IntNBT.valueOf(this.random.nextInt(3) + 1);
}
else if(this.name.equalsIgnoreCase("Farmer") || this.name.equalsIgnoreCase("Fisherman") || this.name.equalsIgnoreCase("Shepherd") || this.name.equalsIgnoreCase("Fletcher"))
{
this.tag = "Profession";
return IntNBT.func_229692_a_(0);
return IntNBT.valueOf(0);
}
else if(this.name.equalsIgnoreCase("Librarian") || this.name.equalsIgnoreCase("Carthographer"))
{
this.tag = "Profession";
return IntNBT.func_229692_a_(1);
return IntNBT.valueOf(1);
}
else if(this.name.equalsIgnoreCase("Cleric") || this.name.equalsIgnoreCase("Priest"))
{
this.tag = "Profession";
return IntNBT.func_229692_a_(2);
return IntNBT.valueOf(2);
}
else if(this.name.equalsIgnoreCase("Armorer") || this.name.equalsIgnoreCase("Blacksmith") || this.name.equalsIgnoreCase("WeaponSmith") || this.name.equalsIgnoreCase("ToolSmith"))
{
this.tag = "Profession";
return IntNBT.func_229692_a_(3);
return IntNBT.valueOf(3);
}
else if(this.name.equalsIgnoreCase("Butcher") || this.name.equalsIgnoreCase("Leatherworker"))
{
this.tag = "Profession";
return IntNBT.func_229692_a_(4);
return IntNBT.valueOf(4);
}
else if(this.name.equalsIgnoreCase("Nitwit"))
{
this.tag = "Profession";
return IntNBT.func_229692_a_(5);
return IntNBT.valueOf(5);
}
if(this.entity != null)
@@ -108,7 +108,7 @@ public class ComponentSummon implements IBuilderComponent
if(StringUtils.containsIgnoreCase(this.name, "Baby"))
{
this.tag = "IsBaby";
return ByteNBT.func_229671_a_((byte) 1);
return ByteNBT.valueOf((byte) 1);
}
}
else if(this.entity.equals(EntityType.CHICKEN.getRegistryName()))

View File

@@ -80,7 +80,7 @@ public class ComponentTag<T> implements IBuilderComponent
return null;
}
return StringNBT.func_229705_a_(string);
return StringNBT.valueOf(string);
}
else if(this.value instanceof INBT)
{
@@ -98,27 +98,27 @@ public class ComponentTag<T> implements IBuilderComponent
}
else if(this.value instanceof Integer)
{
return IntNBT.func_229692_a_((Integer) this.value);
return IntNBT.valueOf((Integer) this.value);
}
else if(this.value instanceof Byte)
{
return ByteNBT.func_229671_a_((Byte) this.value);
return ByteNBT.valueOf((Byte) this.value);
}
else if(this.value instanceof Float)
{
return FloatNBT.func_229689_a_((Float) this.value);
return FloatNBT.valueOf((Float) this.value);
}
else if(this.value instanceof Double)
{
return DoubleNBT.func_229684_a_((Double) this.value);
return DoubleNBT.valueOf((Double) this.value);
}
else if(this.value instanceof Long)
{
return LongNBT.func_229698_a_((Long) this.value);
return LongNBT.valueOf((Long) this.value);
}
else if(this.value instanceof Short)
{
return ShortNBT.func_229701_a_((Short) this.value);
return ShortNBT.valueOf((Short) this.value);
}
else if(this.value instanceof Byte[])
{

View File

@@ -23,7 +23,7 @@ public class BuilderSignEditor extends BuilderData
for(int x = 0; x < 4; x++)
{
this.sign[x] = this.registerNBTComponent(new ComponentTag<SignText>("Text" + (x + 1), new SignText(x), text -> StringNBT.func_229705_a_(text.toString())));
this.sign[x] = this.registerNBTComponent(new ComponentTag<SignText>("Text" + (x + 1), new SignText(x), text -> StringNBT.valueOf(text.toString())));
}
}

View File

@@ -349,7 +349,7 @@ public class BuilderSummon extends CommandBuilderNBT
{
if(string.getUnformattedComponentText() != null && !string.getUnformattedComponentText().isEmpty())
{
return StringNBT.func_229705_a_(string.serialize());
return StringNBT.valueOf(string.serialize());
}
return null;

View File

@@ -15,6 +15,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.ForgeConfigSpec;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.config.ModConfig.Reloading;
import net.minecraftforge.fml.config.ModConfig.Type;
public class Config
@@ -108,7 +109,7 @@ public class Config
}
@SubscribeEvent
public static void configReload(ModConfig.ConfigReloading event)
public static void configReload(Reloading event)
{
if(event.getConfig().getType().equals(Type.CLIENT) && Config.CONFIG_DATA != null)
{

View File

@@ -13,31 +13,31 @@ import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class GuiButtonItem extends GuiButtonBase
{
private final ItemStack stack;
private final ItemStack stack;
public GuiButtonItem(int x, int y, int width, int height, Item item, ActionHandler actionHandler)
{
this(x, y, width, height, new ItemStack(item), actionHandler);
}
public GuiButtonItem(int x, int y, int width, int height, ItemStack stack, ActionHandler actionHandler)
{
super(x, y, width, height, stack.getTextComponent().getString(), actionHandler);
this.stack = stack;
}
@Override
public void renderButton(int mouseX, int mouseY, float partialTicks)
{
super.renderBg(Minecraft.getInstance(), mouseX, mouseY);
RenderSystem.enableRescaleNormal();
RenderHelper.func_227784_d_();
public GuiButtonItem(int x, int y, int width, int height, Item item, ActionHandler actionHandler)
{
this(x, y, width, height, new ItemStack(item), actionHandler);
}
public GuiButtonItem(int x, int y, int width, int height, ItemStack stack, ActionHandler actionHandler)
{
super(x, y, width, height, stack.getTextComponent().getString(), actionHandler);
this.stack = stack;
}
@Override
public void renderButton(int mouseX, int mouseY, float partialTicks)
{
super.renderBg(Minecraft.getInstance(), mouseX, mouseY);
RenderSystem.enableRescaleNormal();
RenderHelper.enableStandardItemLighting();
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(this.stack, this.x + this.width / 2 - 8, this.y + 2);
RenderHelper.disableStandardItemLighting();
RenderSystem.disableRescaleNormal();
RenderSystem.enableAlphaTest();
}
RenderSystem.disableRescaleNormal();
RenderSystem.enableAlphaTest();
}
}

View File

@@ -46,12 +46,12 @@ public class GuiButtonList<T> extends GuiButtonTooltip
String leftArrow = this.isHoveringLeft(mouseX, mouseY) ? TextFormatting.BOLD + "<" + TextFormatting.RESET : "<";
String rightArrow = this.isHoveringRight(mouseX, mouseY) ? TextFormatting.BOLD + ">" + TextFormatting.RESET : ">";
int maxWidth = Math.max(0, this.width - fontRenderer.getStringWidth("< >"));
int spaceWidth = fontRenderer.getStringWidth(" ");
String display = exopandora.worldhandler.util.TextFormatting.shortenString(this.getMessage(), maxWidth, fontRenderer);
int yPos = this.y + (this.height - 8) / 2;
int maxWidth = Math.max(0, this.width - fontRenderer.getStringWidth("< >"));
int spaceWidth = fontRenderer.getStringWidth(" ");
String display = exopandora.worldhandler.util.TextFormatting.shortenString(this.getMessage(), maxWidth, fontRenderer);
int yPos = this.y + (this.height - 8) / 2;
this.drawCenteredString(fontRenderer, display, this.x + this.width / 2, yPos, this.getFGColor());
this.drawCenteredString(fontRenderer, leftArrow, this.x + this.width / 2 - maxWidth / 2 - spaceWidth, yPos, this.getFGColor());
this.drawCenteredString(fontRenderer, rightArrow, this.x + this.width / 2 + maxWidth / 2 + spaceWidth, yPos, this.getFGColor());

View File

@@ -13,15 +13,15 @@ public abstract class GuiButtonTab extends AbstractButton
super(x, y, widthIn, heightIn, narration);
}
@Override
public void render(int mouseX, int mouseY, float partialTicks)
{
}
@Override
public void playDownSound(SoundHandler soundHandlerIn)
{
}
@Override
public void render(int mouseX, int mouseY, float partialTicks)
{
}
@Override
public void playDownSound(SoundHandler soundHandlerIn)
{
}
}

View File

@@ -7,7 +7,7 @@ import exopandora.worldhandler.util.ActionHandler;
import net.minecraft.client.Minecraft;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.client.config.GuiUtils;
import net.minecraftforge.fml.client.gui.GuiUtils;
@OnlyIn(Dist.CLIENT)
public class GuiButtonTooltip extends GuiButtonBase

View File

@@ -31,8 +31,8 @@ public class GuiTextFieldTooltip extends TextFieldWidget
if(this.getVisible() && !this.isFocused() && this.tooltip != null && TextFormatting.getTextWithoutFormattingCodes(this.getText()).isEmpty())
{
boolean enableBackgroundDrawing = this.getAdjustedWidth() != this.width;
int tx = enableBackgroundDrawing ? this.x + 4 : this.x;
int ty = enableBackgroundDrawing ? this.y + (this.height - 8) / 2 : this.y;
int tx = enableBackgroundDrawing ? this.x + 4 : this.x;
int ty = enableBackgroundDrawing ? this.y + (this.height - 8) / 2 : this.y;
Minecraft.getInstance().fontRenderer.drawStringWithShadow(this.tooltip, (float) tx, (float) ty, 0x7F7F7F);
}

View File

@@ -36,7 +36,7 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.client.config.GuiUtils;
import net.minecraftforge.fml.client.gui.GuiUtils;
@OnlyIn(Dist.CLIENT)
public class GuiWorldHandler extends Container
@@ -380,7 +380,7 @@ public class GuiWorldHandler extends Container
if(this.splash != null)
{
RenderSystem.pushMatrix();
RenderHelper.func_227784_d_();
RenderHelper.enableStandardItemLighting();
RenderSystem.disableLighting();
RenderSystem.translatef((float) (backgroundX + 212), backgroundY + 15, 0.0F);
RenderSystem.rotatef(17.0F, 0.0F, 0.0F, 1.0F);

View File

@@ -13,6 +13,7 @@ import net.minecraft.client.gui.screen.ConnectingScreen;
import net.minecraft.client.gui.screen.DirtMessageScreen;
import net.minecraft.client.gui.screen.MainMenuScreen;
import net.minecraft.client.gui.screen.MultiplayerScreen;
import net.minecraft.client.gui.screen.MultiplayerWarningScreen;
import net.minecraft.client.gui.screen.WorldSelectionScreen;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.resources.I18n;
@@ -39,7 +40,16 @@ public class ContentChangeWorld extends ContentChild
container.add(new GuiButtonBase(x + 116 / 2, y + 48, 232 / 2, 20, I18n.format("gui.worldhandler.change_world.multiplayer"), () ->
{
Connection connection = ContentChangeWorld.disconnect();
Minecraft.getInstance().displayGuiScreen(new MultiplayerScreen(new DummyScreen(() -> ContentChangeWorld.reconnect(connection))));
DummyScreen dummy = new DummyScreen(() -> ContentChangeWorld.reconnect(connection));
if(Minecraft.getInstance().gameSettings.field_230152_Z_)
{
Minecraft.getInstance().displayGuiScreen(new MultiplayerScreen(dummy));
}
else
{
Minecraft.getInstance().displayGuiScreen(new MultiplayerWarningScreen(dummy));
}
}));
}
@@ -55,13 +65,13 @@ public class ContentChangeWorld extends ContentChild
String folderName = Minecraft.getInstance().getIntegratedServer().getFolderName();
Minecraft.getInstance().world.sendQuittingDisconnectingPacket();
Minecraft.getInstance().func_213231_b(new DirtMessageScreen(new TranslationTextComponent("menu.savingLevel")));
Minecraft.getInstance().unloadWorld(new DirtMessageScreen(new TranslationTextComponent("menu.savingLevel")));
return new IntegratedConnection(Type.INTEGRATED, worldName, folderName);
}
Minecraft.getInstance().world.sendQuittingDisconnectingPacket();
Minecraft.getInstance().func_213254_o();
Minecraft.getInstance().unloadWorld();
if(isRealms)
{

View File

@@ -63,12 +63,12 @@ public class ContentGamerules extends Content
Map<String, ArgumentType<?>> map = new HashMap<String, ArgumentType<?>>();
GameRules.func_223590_a(new IRuleEntryVisitor()
GameRules.visitAll(new IRuleEntryVisitor()
{
@Override
public <T extends RuleValue<T>> void func_223481_a(RuleKey<T> rule, RuleType<T> type)
public <T extends RuleValue<T>> void visit(RuleKey<T> rule, RuleType<T> type)
{
map.put(rule.func_223576_a(), type.func_223581_a(null).getType());
map.put(rule.getName(), type.createArgument(null).getType());
}
});

View File

@@ -196,7 +196,7 @@ public class ContentNoteEditor extends Content
RenderSystem.color3f(1.0F, 1.0F, 1.0F);
RenderSystem.pushMatrix();
RenderHelper.func_227784_d_();
RenderHelper.enableStandardItemLighting();
RenderSystem.translatef(container.width / 2 - 8 * scale, container.height / 2 - 15 - 8 * scale, 0);
RenderSystem.scalef(scale, scale, scale);

View File

@@ -115,9 +115,9 @@ public class ContentPlayer extends Content
container.add(new GuiButtonBase(x + 118, y + 72, 114, 20, I18n.format("gui.worldhandler.entities.player.position.copy_position"), () ->
{
int posX = MathHelper.floor(Minecraft.getInstance().player.func_226277_ct_());
int posY = MathHelper.floor(Minecraft.getInstance().player.func_226278_cu_());
int posZ = MathHelper.floor(Minecraft.getInstance().player.func_226281_cx_());
int posX = MathHelper.floor(Minecraft.getInstance().player.getPosX());
int posY = MathHelper.floor(Minecraft.getInstance().player.getPosY());
int posZ = MathHelper.floor(Minecraft.getInstance().player.getPosZ());
Minecraft.getInstance().keyboardListener.setClipboardString(posX + " " + posY + " " + posZ);
}));
@@ -148,9 +148,9 @@ public class ContentPlayer extends Content
@Override
public void tick(Container container)
{
this.posXField.setText("X: " + MathHelper.floor(Minecraft.getInstance().player.func_226277_ct_()));
this.posYField.setText("Y: " + MathHelper.floor(Minecraft.getInstance().player.func_226278_cu_()));
this.posZField.setText("Z: " + MathHelper.floor(Minecraft.getInstance().player.func_226281_cx_()));
this.posXField.setText("X: " + MathHelper.floor(Minecraft.getInstance().player.getPosX()));
this.posYField.setText("Y: " + MathHelper.floor(Minecraft.getInstance().player.getPosY()));
this.posZField.setText("Z: " + MathHelper.floor(Minecraft.getInstance().player.getPosZ()));
this.scoreField.setText(I18n.format("gui.worldhandler.entities.player.score") + ": " + Minecraft.getInstance().player.getScore());
this.coinsField.setText(I18n.format("gui.worldhandler.entities.player.score.experience") + ": " + Minecraft.getInstance().player.experienceLevel + "L");
this.xpField.setText(I18n.format("gui.worldhandler.entities.player.score.experience_coins") + ": " + Minecraft.getInstance().player.experienceTotal);

View File

@@ -177,17 +177,17 @@ public class ContentSignEditor extends Content
}
else
{
float scale = 4;
float scale = 4;
RenderSystem.color3f(1.0F, 1.0F, 1.0F);
RenderSystem.pushMatrix();
RenderHelper.func_227784_d_();
RenderSystem.translatef(container.width / 2 - 8.5F * scale, container.height / 2 - 15 - 8.5F * scale, 0);
RenderSystem.scalef(scale, scale, scale);
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(new ItemStack(Items.OAK_SIGN), 0, 0);
RenderHelper.disableStandardItemLighting();
RenderHelper.enableStandardItemLighting();
RenderSystem.translatef(container.width / 2 - 8.5F * scale, container.height / 2 - 15 - 8.5F * scale, 0);
RenderSystem.scalef(scale, scale, scale);
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(new ItemStack(Items.OAK_SIGN), 0, 0);
RenderHelper.disableStandardItemLighting();
RenderSystem.popMatrix();
String displayString = I18n.format("gui.worldhandler.blocks.sign_editor.look_at_sign", KeyHandler.KEY_WORLD_HANDLER.getLocalizedName());

View File

@@ -1,5 +1,5 @@
modLoader="javafml"
loaderVersion="[29,)"
loaderVersion="[30,)"
updateJSONURL="https://raw.githubusercontent.com/Exopandora/worldhandler/master/version.json"
issueTrackerURL="https://github.com/Exopandora/WorldHandler/issues"
displayURL="https://minecraft.curseforge.com/projects/world-handler-command-gui"
@@ -10,7 +10,7 @@ logoBlur=false
[[mods]]
modId="worldhandler"
version="1.15.1-2.8"
version="1.15.2-2.8.1"
displayName="World Handler"
description='''
The World Handler provides a simple and easy to use graphical user interface for commands. It lets you create powerful and complex sub-commands alongside NBT-structures within seconds.

View File

@@ -228,6 +228,8 @@
"gui.worldhandler.gamerules.rule.drowningDamage": "Ertrinkungsschaden",
"gui.worldhandler.gamerules.rule.fallDamage": "Fallschaden",
"gui.worldhandler.gamerules.rule.fireDamage": "Feuerschaden",
"gui.worldhandler.gamerules.rule.doPatrolSpawning": "Patrouillen",
"gui.worldhandler.gamerules.rule.doTraderSpawning": "Wandernder Händler",
"gui.worldhandler.world_info.start": "Start",
"gui.worldhandler.world_info.world": "Welt",

View File

@@ -227,6 +227,8 @@
"gui.worldhandler.gamerules.rule.drowningDamage": "Drowning Damage",
"gui.worldhandler.gamerules.rule.fallDamage": "Fall Damage",
"gui.worldhandler.gamerules.rule.fireDamage": "Fire Damage",
"gui.worldhandler.gamerules.rule.doPatrolSpawning": "Patrol Spawning",
"gui.worldhandler.gamerules.rule.doTraderSpawning": "Trader Spawning",
"gui.worldhandler.world_info.start": "Start",
"gui.worldhandler.world_info.world": "World",

View File

@@ -227,6 +227,8 @@
"gui.worldhandler.gamerules.rule.drowningDamage": "Dégâts de noyade",
"gui.worldhandler.gamerules.rule.fallDamage": "Dégâts de chute",
"gui.worldhandler.gamerules.rule.fireDamage": "Dégâts de feu",
"gui.worldhandler.gamerules.rule.doPatrolSpawning": "Patrol Spawning",
"gui.worldhandler.gamerules.rule.doTraderSpawning": "Trader Spawning",
"gui.worldhandler.world_info.start": "Démarrer",
"gui.worldhandler.world_info.world": "Monde",

View File

@@ -228,6 +228,8 @@
"gui.worldhandler.gamerules.rule.drowningDamage": "Drowning Damage",
"gui.worldhandler.gamerules.rule.fallDamage": "Fall Damage",
"gui.worldhandler.gamerules.rule.fireDamage": "Fire Damage",
"gui.worldhandler.gamerules.rule.doPatrolSpawning": "Patrol Spawning",
"gui.worldhandler.gamerules.rule.doTraderSpawning": "Trader Spawning",
"gui.worldhandler.world_info.start": "首选项",
"gui.worldhandler.world_info.world": "世界",