Add getter for parent content
This commit is contained in:
@@ -94,6 +94,6 @@ public class ContentButcherSettings extends ContentChild
|
|||||||
@Override
|
@Override
|
||||||
public String getTitle()
|
public String getTitle()
|
||||||
{
|
{
|
||||||
return this.parent.getTitle();
|
return this.getParentContent().getTitle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
|||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public abstract class ContentChild extends Content
|
public abstract class ContentChild extends Content
|
||||||
{
|
{
|
||||||
protected Content parent;
|
private Content parent;
|
||||||
|
|
||||||
public ContentChild withParent(Content parent)
|
public ContentChild withParent(Content parent)
|
||||||
{
|
{
|
||||||
@@ -55,4 +55,9 @@ public abstract class ContentChild extends Content
|
|||||||
{
|
{
|
||||||
return this.parent;
|
return this.parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Content getParentContent()
|
||||||
|
{
|
||||||
|
return this.parent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class ContentContinue extends ContentChild
|
|||||||
container.add(new GuiButtonBase(x + 116 / 2, y + 36, 116, 20, TextFormatting.RED + I18n.format("gui.worldhandler.generic.yes"), () ->
|
container.add(new GuiButtonBase(x + 116 / 2, y + 36, 116, 20, TextFormatting.RED + I18n.format("gui.worldhandler.generic.yes"), () ->
|
||||||
{
|
{
|
||||||
CommandHelper.sendCommand(this.builder, this.special);
|
CommandHelper.sendCommand(this.builder, this.special);
|
||||||
Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(this.parent));
|
Minecraft.getInstance().displayGuiScreen(new GuiWorldHandler(this.getParentContent()));
|
||||||
}));
|
}));
|
||||||
container.add(new GuiButtonBase(x + 116 / 2, y + 60, 116, 20, I18n.format("gui.worldhandler.generic.no"), () -> ActionHelper.back(this)));
|
container.add(new GuiButtonBase(x + 116 / 2, y + 60, 116, 20, I18n.format("gui.worldhandler.generic.no"), () -> ActionHelper.back(this)));
|
||||||
}
|
}
|
||||||
@@ -82,6 +82,6 @@ public class ContentContinue extends ContentChild
|
|||||||
@Override
|
@Override
|
||||||
public String getTitle()
|
public String getTitle()
|
||||||
{
|
{
|
||||||
return this.parent.getTitle();
|
return this.getParentContent().getTitle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user