Update to 1.15.1
This commit is contained in:
@@ -7,7 +7,6 @@ import net.minecraft.nbt.INBT;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.nbt.StringNBT;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
@@ -24,7 +23,7 @@ public class ComponentDisplay implements IBuilderComponent
|
||||
|
||||
if(this.name.getText() != null && !this.name.getText().isEmpty())
|
||||
{
|
||||
display.putString("Name", ITextComponent.Serializer.toJson(new StringTextComponent(this.name.toString())));
|
||||
display.putString("Name", ITextComponent.Serializer.toJson(this.name));
|
||||
}
|
||||
|
||||
ListNBT lore = new ListNBT();
|
||||
@@ -33,7 +32,7 @@ public class ComponentDisplay implements IBuilderComponent
|
||||
{
|
||||
if(this.lore[x] != null && !this.lore[x].isEmpty())
|
||||
{
|
||||
lore.add(new StringNBT(this.lore[x]));
|
||||
lore.add(StringNBT.func_229705_a_(this.lore[x]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,37 +68,37 @@ public class ComponentSummon implements IBuilderComponent
|
||||
if(this.name.equalsIgnoreCase("Cat"))
|
||||
{
|
||||
this.tag = "CatType";
|
||||
return new IntNBT(this.random.nextInt(3) + 1);
|
||||
return IntNBT.func_229692_a_(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 new IntNBT(0);
|
||||
return IntNBT.func_229692_a_(0);
|
||||
}
|
||||
else if(this.name.equalsIgnoreCase("Librarian") || this.name.equalsIgnoreCase("Carthographer"))
|
||||
{
|
||||
this.tag = "Profession";
|
||||
return new IntNBT(1);
|
||||
return IntNBT.func_229692_a_(1);
|
||||
}
|
||||
else if(this.name.equalsIgnoreCase("Cleric") || this.name.equalsIgnoreCase("Priest"))
|
||||
{
|
||||
this.tag = "Profession";
|
||||
return new IntNBT(2);
|
||||
return IntNBT.func_229692_a_(2);
|
||||
}
|
||||
else if(this.name.equalsIgnoreCase("Armorer") || this.name.equalsIgnoreCase("Blacksmith") || this.name.equalsIgnoreCase("WeaponSmith") || this.name.equalsIgnoreCase("ToolSmith"))
|
||||
{
|
||||
this.tag = "Profession";
|
||||
return new IntNBT(3);
|
||||
return IntNBT.func_229692_a_(3);
|
||||
}
|
||||
else if(this.name.equalsIgnoreCase("Butcher") || this.name.equalsIgnoreCase("Leatherworker"))
|
||||
{
|
||||
this.tag = "Profession";
|
||||
return new IntNBT(4);
|
||||
return IntNBT.func_229692_a_(4);
|
||||
}
|
||||
else if(this.name.equalsIgnoreCase("Nitwit"))
|
||||
{
|
||||
this.tag = "Profession";
|
||||
return new IntNBT(5);
|
||||
return IntNBT.func_229692_a_(5);
|
||||
}
|
||||
|
||||
if(this.entity != null)
|
||||
@@ -108,7 +108,7 @@ public class ComponentSummon implements IBuilderComponent
|
||||
if(StringUtils.containsIgnoreCase(this.name, "Baby"))
|
||||
{
|
||||
this.tag = "IsBaby";
|
||||
return new ByteNBT((byte) 1);
|
||||
return ByteNBT.func_229671_a_((byte) 1);
|
||||
}
|
||||
}
|
||||
else if(this.entity.equals(EntityType.CHICKEN.getRegistryName()))
|
||||
|
||||
@@ -80,7 +80,7 @@ public class ComponentTag<T> implements IBuilderComponent
|
||||
return null;
|
||||
}
|
||||
|
||||
return new StringNBT(string);
|
||||
return StringNBT.func_229705_a_(string);
|
||||
}
|
||||
else if(this.value instanceof INBT)
|
||||
{
|
||||
@@ -98,27 +98,27 @@ public class ComponentTag<T> implements IBuilderComponent
|
||||
}
|
||||
else if(this.value instanceof Integer)
|
||||
{
|
||||
return new IntNBT((Integer) this.value);
|
||||
return IntNBT.func_229692_a_((Integer) this.value);
|
||||
}
|
||||
else if(this.value instanceof Byte)
|
||||
{
|
||||
return new ByteNBT((Byte) this.value);
|
||||
return ByteNBT.func_229671_a_((Byte) this.value);
|
||||
}
|
||||
else if(this.value instanceof Float)
|
||||
{
|
||||
return new FloatNBT((Float) this.value);
|
||||
return FloatNBT.func_229689_a_((Float) this.value);
|
||||
}
|
||||
else if(this.value instanceof Double)
|
||||
{
|
||||
return new DoubleNBT((Double) this.value);
|
||||
return DoubleNBT.func_229684_a_((Double) this.value);
|
||||
}
|
||||
else if(this.value instanceof Long)
|
||||
{
|
||||
return new LongNBT((Long) this.value);
|
||||
return LongNBT.func_229698_a_((Long) this.value);
|
||||
}
|
||||
else if(this.value instanceof Short)
|
||||
{
|
||||
return new ShortNBT((Short) this.value);
|
||||
return ShortNBT.func_229701_a_((Short) this.value);
|
||||
}
|
||||
else if(this.value instanceof Byte[])
|
||||
{
|
||||
|
||||
@@ -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 -> new StringNBT(text.toString())));
|
||||
this.sign[x] = this.registerNBTComponent(new ComponentTag<SignText>("Text" + (x + 1), new SignText(x), text -> StringNBT.func_229705_a_(text.toString())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -349,7 +349,7 @@ public class BuilderSummon extends CommandBuilderNBT
|
||||
{
|
||||
if(string.getUnformattedComponentText() != null && !string.getUnformattedComponentText().isEmpty())
|
||||
{
|
||||
return new StringNBT(string.serialize());
|
||||
return StringNBT.func_229705_a_(string.serialize());
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class ConfigCategorySettings
|
||||
private final BooleanValue pause;
|
||||
private final BooleanValue customTimes;
|
||||
private final BooleanValue permissionQuery;
|
||||
private final BooleanValue highlightBlocks;
|
||||
// private final BooleanValue highlightBlocks;
|
||||
private final IntValue dawn;
|
||||
private final IntValue noon;
|
||||
private final IntValue sunset;
|
||||
@@ -68,10 +68,10 @@ public class ConfigCategorySettings
|
||||
.translation("gui.worldhandler.config.settings.permission_query")
|
||||
.comment("Whether or not the permission query is enabled")
|
||||
.define("permission_query", true);
|
||||
this.highlightBlocks = builder
|
||||
.translation("gui.worldhandler.config.settings.highlight_blocks")
|
||||
.comment("Whether or not selected blocks will be highlighted")
|
||||
.define("highlight_blocks", true);
|
||||
// this.highlightBlocks = builder
|
||||
// .translation("gui.worldhandler.config.settings.highlight_blocks")
|
||||
// .comment("Whether or not selected blocks will be highlighted")
|
||||
// .define("highlight_blocks", true);
|
||||
|
||||
this.dawn = builder
|
||||
.translation("gui.worldhandler.config.settings.custom_time_dawn")
|
||||
@@ -188,15 +188,15 @@ public class ConfigCategorySettings
|
||||
Config.set(this.permissionQuery, enabled);
|
||||
}
|
||||
|
||||
public boolean highlightBlocks()
|
||||
{
|
||||
return this.highlightBlocks.get();
|
||||
}
|
||||
|
||||
public void setHighlightBlocks(boolean enabled)
|
||||
{
|
||||
Config.set(this.highlightBlocks, enabled);
|
||||
}
|
||||
// public boolean highlightBlocks()
|
||||
// {
|
||||
// return this.highlightBlocks.get();
|
||||
// }
|
||||
//
|
||||
// public void setHighlightBlocks(boolean enabled)
|
||||
// {
|
||||
// Config.set(this.highlightBlocks, enabled);
|
||||
// }
|
||||
|
||||
public int getDawn()
|
||||
{
|
||||
|
||||
@@ -1,20 +1,13 @@
|
||||
package exopandora.worldhandler.event;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.ParseResults;
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
|
||||
import exopandora.worldhandler.config.Config;
|
||||
import exopandora.worldhandler.util.BlockHelper;
|
||||
import exopandora.worldhandler.util.CommandHelper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.event.ClientChatEvent;
|
||||
@@ -27,63 +20,66 @@ public class ClientEventHandler
|
||||
@SubscribeEvent
|
||||
public static void renderWorldLastEvent(RenderWorldLastEvent event)
|
||||
{
|
||||
if(Config.getSettings().highlightBlocks() && Minecraft.getInstance().world != null && Minecraft.getInstance().getRenderManager().info != null)
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.disableAlphaTest();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||
GlStateManager.lineWidth(2.0F);
|
||||
GlStateManager.disableTexture();
|
||||
GlStateManager.depthMask(false);
|
||||
|
||||
final double constant = 0.0020000000949949026D;
|
||||
Vec3d projected = Minecraft.getInstance().getRenderManager().info.getProjectedView();
|
||||
|
||||
double minX = Math.min(BlockHelper.getPos1().getX(), BlockHelper.getPos2().getX()) - constant - projected.x;
|
||||
double minY = Math.min(BlockHelper.getPos1().getY(), BlockHelper.getPos2().getY()) - constant - projected.y;
|
||||
double minZ = Math.min(BlockHelper.getPos1().getZ(), BlockHelper.getPos2().getZ()) - constant - projected.z;
|
||||
|
||||
double maxX = Math.max(BlockHelper.getPos1().getX(), BlockHelper.getPos2().getX()) + constant - projected.x + 1;
|
||||
double maxY = Math.max(BlockHelper.getPos1().getY(), BlockHelper.getPos2().getY()) + constant - projected.y + 1;
|
||||
double maxZ = Math.max(BlockHelper.getPos1().getZ(), BlockHelper.getPos2().getZ()) + constant - projected.z + 1;
|
||||
|
||||
Tessellator tesselator = Tessellator.getInstance();
|
||||
BufferBuilder buffer = tesselator.getBuffer();
|
||||
|
||||
final int alpha = 255;
|
||||
final int color1 = 223;
|
||||
final int color2 = 127;
|
||||
|
||||
GlStateManager.lineWidth(2.0F);
|
||||
buffer.begin(3, DefaultVertexFormats.POSITION_COLOR);
|
||||
buffer.pos(minX, minY, minZ).color((float) color1, (float) color1, (float) color1, 0.0F).endVertex();
|
||||
buffer.pos(minX, minY, minZ).color(color1, color1, color1, alpha).endVertex();
|
||||
buffer.pos(maxX, minY, minZ).color(color1, color2, color2, alpha).endVertex();
|
||||
buffer.pos(maxX, minY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
buffer.pos(minX, minY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
buffer.pos(minX, minY, minZ).color(color2, color2, color1, alpha).endVertex();
|
||||
buffer.pos(minX, maxY, minZ).color(color2, color1, color2, alpha).endVertex();
|
||||
buffer.pos(maxX, maxY, minZ).color(color1, color1, color1, alpha).endVertex();
|
||||
buffer.pos(maxX, maxY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
buffer.pos(minX, maxY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
buffer.pos(minX, maxY, minZ).color(color1, color1, color1, alpha).endVertex();
|
||||
buffer.pos(minX, maxY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
buffer.pos(minX, minY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
buffer.pos(maxX, minY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
buffer.pos(maxX, maxY, maxZ).color(color1, color1, color1, alpha).endVertex();
|
||||
buffer.pos(maxX, maxY, minZ).color(color1, color1, color1, alpha).endVertex();
|
||||
buffer.pos(maxX, minY, minZ).color(color1, color1, color1, alpha).endVertex();
|
||||
buffer.pos(maxX, minY, minZ).color((float) color1, (float) color1, (float) color1, 0.0F).endVertex();
|
||||
tesselator.draw();
|
||||
|
||||
GlStateManager.lineWidth(1.0F);
|
||||
GlStateManager.depthMask(true);
|
||||
GlStateManager.enableTexture();
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.enableAlphaTest();
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
// if(Config.getSettings().highlightBlocks() && Minecraft.getInstance().world != null && Minecraft.getInstance().getRenderManager().info != null)
|
||||
// {
|
||||
// final double constant = 0.0020000000949949026D;
|
||||
// Vec3d projected = Minecraft.getInstance().getRenderManager().info.getProjectedView();
|
||||
//
|
||||
// double minX = Math.min(BlockHelper.getPos1().getX(), BlockHelper.getPos2().getX()) - constant - projected.getX();
|
||||
// double minY = Math.min(BlockHelper.getPos1().getY(), BlockHelper.getPos2().getY()) - constant - projected.getY();
|
||||
// double minZ = Math.min(BlockHelper.getPos1().getZ(), BlockHelper.getPos2().getZ()) - constant - projected.getZ();
|
||||
//
|
||||
// double maxX = Math.max(BlockHelper.getPos1().getX(), BlockHelper.getPos2().getX()) + constant - projected.getX() + 1;
|
||||
// double maxY = Math.max(BlockHelper.getPos1().getY(), BlockHelper.getPos2().getY()) + constant - projected.getY() + 1;
|
||||
// double maxZ = Math.max(BlockHelper.getPos1().getZ(), BlockHelper.getPos2().getZ()) + constant - projected.getZ() + 1;
|
||||
//
|
||||
// IVertexBuilder builder = Minecraft.getInstance().func_228019_au_().func_228487_b_().getBuffer(RenderType.func_228659_m_());
|
||||
// WorldRenderer.func_228427_a_(event.getMatrixStack(), builder, minX, minY, minZ, maxX, maxY, maxZ, 1.0F, 0.5F, 0.5F, 1.0F);
|
||||
//
|
||||
// RenderSystem.pushMatrix();
|
||||
// RenderSystem.disableAlphaTest();
|
||||
// RenderSystem.enableBlend();
|
||||
// RenderSystem.defaultBlendFunc();
|
||||
// RenderSystem.lineWidth(2.0F);
|
||||
// RenderSystem.disableTexture();
|
||||
// RenderSystem.depthMask(false);
|
||||
//
|
||||
// Tessellator tesselator = Tessellator.getInstance();
|
||||
// BufferBuilder buffer = tesselator.getBuffer();
|
||||
//
|
||||
// final int alpha = 255;
|
||||
// final int color1 = 223;
|
||||
// final int color2 = 127;
|
||||
//
|
||||
// RenderSystem.lineWidth(2.0F);
|
||||
// buffer.begin(3, DefaultVertexFormats.POSITION_COLOR);
|
||||
// buffer.func_225582_a_(minX, minY, minZ).func_225586_a_(color1, color1, color1, 0).endVertex();
|
||||
// buffer.func_225582_a_(minX, minY, minZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, minY, minZ).func_225586_a_(color1, color2, color2, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, minY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, minY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, minY, minZ).func_225586_a_(color2, color2, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, maxY, minZ).func_225586_a_(color2, color1, color2, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, maxY, minZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, maxY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, maxY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, maxY, minZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, maxY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(minX, minY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, minY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, maxY, maxZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, maxY, minZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, minY, minZ).func_225586_a_(color1, color1, color1, alpha).endVertex();
|
||||
// buffer.func_225582_a_(maxX, minY, minZ).func_225586_a_(color1, color1, color1, 0).endVertex();
|
||||
// tesselator.draw();
|
||||
//
|
||||
// RenderSystem.lineWidth(1.0F);
|
||||
// RenderSystem.depthMask(true);
|
||||
// RenderSystem.enableTexture();
|
||||
// RenderSystem.disableBlend();
|
||||
// RenderSystem.enableAlphaTest();
|
||||
// RenderSystem.popMatrix();
|
||||
// }
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
24
src/main/java/exopandora/worldhandler/gui/DummyScreen.java
Normal file
24
src/main/java/exopandora/worldhandler/gui/DummyScreen.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package exopandora.worldhandler.gui;
|
||||
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class DummyScreen extends Screen
|
||||
{
|
||||
private final Runnable runnable;
|
||||
|
||||
public DummyScreen(Runnable runnable)
|
||||
{
|
||||
super(new StringTextComponent(""));
|
||||
this.runnable = runnable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init()
|
||||
{
|
||||
this.runnable.run();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package exopandora.worldhandler.gui.button;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import exopandora.worldhandler.config.Config;
|
||||
import exopandora.worldhandler.util.ActionHandler;
|
||||
@@ -29,11 +29,10 @@ public class GuiButtonBase extends Button
|
||||
@Override
|
||||
protected void renderBg(Minecraft minecraft, int mouseX, int mouseY)
|
||||
{
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.color4f(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF(), Config.getSkin().getButtonAlphaF());
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.color4f(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF(), Config.getSkin().getButtonAlphaF());
|
||||
|
||||
int hovered = this.getYImage(this.isHovered());
|
||||
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(ResourceHelper.getButtonTexture());
|
||||
|
||||
if(Config.getSkin().getTextureType().equals("resourcepack"))
|
||||
@@ -47,7 +46,7 @@ public class GuiButtonBase extends Button
|
||||
this.blit(this.x + this.width / 2, this.y, 200 - this.width / 2, hovered * 20, this.width / 2, this.height);
|
||||
}
|
||||
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package exopandora.worldhandler.gui.button;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import exopandora.worldhandler.util.ActionHandler;
|
||||
import exopandora.worldhandler.util.ResourceHelper;
|
||||
@@ -38,16 +38,16 @@ public class GuiButtonIcon extends GuiButtonTooltip
|
||||
{
|
||||
if(this.isHovered())
|
||||
{
|
||||
GlStateManager.color4f(1.0F, 1.0F, 0.6F, 1.0F);
|
||||
RenderSystem.color4f(1.0F, 1.0F, 0.6F, 1.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GlStateManager.color4f(0.95F, 0.95F, 0.95F, 1.0F);
|
||||
RenderSystem.color4f(0.95F, 0.95F, 0.95F, 1.0F);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GlStateManager.color4f(0.8F, 0.8F, 0.8F, 1.0F);
|
||||
RenderSystem.color4f(0.8F, 0.8F, 0.8F, 1.0F);
|
||||
}
|
||||
|
||||
this.blit(this.x + this.width / 2 - 4, this.y + 6, this.icon.getX() * 8, this.icon.getY() * 8, 8, 8);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package exopandora.worldhandler.gui.button;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import exopandora.worldhandler.util.ActionHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -31,13 +31,13 @@ public class GuiButtonItem extends GuiButtonBase
|
||||
{
|
||||
super.renderBg(Minecraft.getInstance(), mouseX, mouseY);
|
||||
|
||||
GlStateManager.enableRescaleNormal();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
RenderSystem.enableRescaleNormal();
|
||||
RenderHelper.func_227784_d_();
|
||||
|
||||
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(this.stack, this.x + this.width / 2 - 8, this.y + 2);
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.disableRescaleNormal();
|
||||
GlStateManager.enableAlphaTest();
|
||||
RenderSystem.disableRescaleNormal();
|
||||
RenderSystem.enableAlphaTest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package exopandora.worldhandler.gui.button;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import exopandora.worldhandler.Main;
|
||||
import exopandora.worldhandler.config.Config;
|
||||
@@ -52,7 +52,7 @@ public class GuiButtonPiano extends GuiButtonBase
|
||||
}
|
||||
|
||||
int hoverstate = this.getYImage(this.isHovered);
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, Config.getSkin().getButtonAlphaF());
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, Config.getSkin().getButtonAlphaF());
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(NOTE);
|
||||
|
||||
switch(this.type)
|
||||
|
||||
@@ -2,7 +2,7 @@ package exopandora.worldhandler.gui.button;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import exopandora.worldhandler.config.Config;
|
||||
import exopandora.worldhandler.gui.container.Container;
|
||||
@@ -38,15 +38,15 @@ public class GuiSlider extends GuiButtonBase
|
||||
|
||||
int xOffset = Config.getSkin().getTextureType().equals("resourcepack") ? 0 : -46;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.color4f(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF(), Config.getSkin().getButtonAlphaF());
|
||||
RenderSystem.pushMatrix();
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.color4f(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF(), Config.getSkin().getButtonAlphaF());
|
||||
|
||||
this.blit(this.x + (int) (this.persistence.getValue() * (float) (this.width - 8)), this.y, 0, 66 + xOffset, 4, 20);
|
||||
this.blit(this.x + (int) (this.persistence.getValue() * (float) (this.width - 8)) + 4, this.y, 196, 66 + xOffset, 4, 20);
|
||||
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.popMatrix();
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.popMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.function.BiConsumer;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import exopandora.worldhandler.Main;
|
||||
import exopandora.worldhandler.builder.impl.BuilderWorldHandler;
|
||||
@@ -190,26 +190,6 @@ public class GuiWorldHandler extends Container
|
||||
}
|
||||
}
|
||||
|
||||
private int getContentX()
|
||||
{
|
||||
return this.getBackgroundX() + 8;
|
||||
}
|
||||
|
||||
private int getContentY()
|
||||
{
|
||||
return this.getBackgroundY() + 33;
|
||||
}
|
||||
|
||||
private int getXOffset()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
private int getYOffset()
|
||||
{
|
||||
return Config.getSettings().shortcuts() ? 11 : 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick()
|
||||
{
|
||||
@@ -300,55 +280,6 @@ public class GuiWorldHandler extends Container
|
||||
this.content.onPlayerNameChanged(GuiWorldHandler.player);
|
||||
}
|
||||
|
||||
private void defaultColor()
|
||||
{
|
||||
this.defaultColor(1.0F);
|
||||
}
|
||||
|
||||
private void defaultColor(float alpha)
|
||||
{
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.color4f(Config.getSkin().getBackgroundRedF(), Config.getSkin().getBackgroundGreenF(), Config.getSkin().getBackgroundBlueF(), alpha * Config.getSkin().getBackgroundAlphaF());
|
||||
}
|
||||
|
||||
private void darkColor()
|
||||
{
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.color4f(Config.getSkin().getBackgroundRedF() - 0.3F, Config.getSkin().getBackgroundGreenF() - 0.3F, Config.getSkin().getBackgroundBlueF() - 0.3F, Config.getSkin().getBackgroundAlphaF());
|
||||
}
|
||||
|
||||
private void bindBackground()
|
||||
{
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(ResourceHelper.getBackgroundTexture());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected String getSplash()
|
||||
{
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int day = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
int month = calendar.get(Calendar.MONTH) + 1;
|
||||
|
||||
if(day == 12 && month == 24)
|
||||
{
|
||||
return "Merry X-mas!";
|
||||
}
|
||||
else if(day == 1 && month == 1)
|
||||
{
|
||||
return "Happy new year!";
|
||||
}
|
||||
else if(day == 10 && month == 31)
|
||||
{
|
||||
return "OOoooOOOoooo! Spooky!";
|
||||
}
|
||||
else if(day == 3 && month == 28)
|
||||
{
|
||||
return (calendar.get(Calendar.YEAR) - 2013) + " Years of World Handler!";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
@@ -361,6 +292,7 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
if(Config.getSkin().drawBackground())
|
||||
{
|
||||
this.setBlitOffset(-1);
|
||||
super.renderBackground();
|
||||
}
|
||||
|
||||
@@ -375,6 +307,7 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
//TABS
|
||||
|
||||
this.setBlitOffset(0);
|
||||
this.forEachTab(this::drawTab);
|
||||
this.defaultColor();
|
||||
|
||||
@@ -412,7 +345,7 @@ public class GuiWorldHandler extends Container
|
||||
if(mouseX >= watchX && mouseX <= watchX + 9 && mouseY >= watchY && mouseY <= watchY + 9)
|
||||
{
|
||||
GuiUtils.drawHoveringText(Arrays.asList(TextFormatting.formatWorldTime(Minecraft.getInstance().world.getDayTime())), mouseX, mouseY + 9, this.width, this.height, this.width, this.font);
|
||||
GlStateManager.disableLighting();
|
||||
RenderSystem.disableLighting();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -446,19 +379,19 @@ public class GuiWorldHandler extends Container
|
||||
|
||||
if(this.splash != null)
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.translatef((float) (backgroundX + 212), backgroundY + 15, 0.0F);
|
||||
GlStateManager.rotatef(17.0F, 0.0F, 0.0F, 1.0F);
|
||||
RenderSystem.pushMatrix();
|
||||
RenderHelper.func_227784_d_();
|
||||
RenderSystem.disableLighting();
|
||||
RenderSystem.translatef((float) (backgroundX + 212), backgroundY + 15, 0.0F);
|
||||
RenderSystem.rotatef(17.0F, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
float scale = 1.1F - MathHelper.abs(MathHelper.sin((float) (System.currentTimeMillis() % 1000L) / 1000.0F * (float) Math.PI * 2.0F) * 0.1F);
|
||||
scale = scale * 100.0F / this.font.getStringWidth(this.splash);
|
||||
GlStateManager.scalef(scale, scale, scale);
|
||||
RenderSystem.scalef(scale, scale, scale);
|
||||
|
||||
this.drawCenteredString(this.font, this.splash, 0, (int) scale, 0xFFFF00);
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
RenderSystem.popMatrix();
|
||||
}
|
||||
|
||||
//TOOLTIPS
|
||||
@@ -510,6 +443,7 @@ public class GuiWorldHandler extends Container
|
||||
}
|
||||
|
||||
this.bindBackground();
|
||||
this.setBlitOffset(-1);
|
||||
this.blit((int) (backgroundX + xOffset), (int) (backgroundY + yOffset), 0, 0, (int) Math.ceil(this.tabHalf), fHeight);
|
||||
this.blit((int) (backgroundX + this.tabHalf + xOffset), (int) (backgroundY + yOffset), this.bgTextureWidth - (int) Math.floor(this.tabHalf + 1), 0, (int) Math.floor(this.tabHalf + 1), fHeight);
|
||||
|
||||
@@ -596,6 +530,7 @@ public class GuiWorldHandler extends Container
|
||||
}
|
||||
}
|
||||
|
||||
this.setBlitOffset(0);
|
||||
this.drawCenteredString(this.font, TextFormatting.shortenString(net.minecraft.util.text.TextFormatting.UNDERLINE + tab.getTabTitle(), (int) this.tabWidth, this.font), (int) (backgroundX + this.tabHalf + xOffset), (int) (backgroundY - 13), color);
|
||||
}
|
||||
|
||||
@@ -640,6 +575,75 @@ public class GuiWorldHandler extends Container
|
||||
return super.keyPressed(keyCode, scanCode, modifiers);
|
||||
}
|
||||
|
||||
private void defaultColor()
|
||||
{
|
||||
this.defaultColor(1.0F);
|
||||
}
|
||||
|
||||
private void defaultColor(float alpha)
|
||||
{
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.color4f(Config.getSkin().getBackgroundRedF(), Config.getSkin().getBackgroundGreenF(), Config.getSkin().getBackgroundBlueF(), alpha * Config.getSkin().getBackgroundAlphaF());
|
||||
}
|
||||
|
||||
private void darkColor()
|
||||
{
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.color4f(Config.getSkin().getBackgroundRedF() - 0.3F, Config.getSkin().getBackgroundGreenF() - 0.3F, Config.getSkin().getBackgroundBlueF() - 0.3F, Config.getSkin().getBackgroundAlphaF());
|
||||
}
|
||||
|
||||
private void bindBackground()
|
||||
{
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(ResourceHelper.getBackgroundTexture());
|
||||
}
|
||||
|
||||
private int getContentX()
|
||||
{
|
||||
return this.getBackgroundX() + 8;
|
||||
}
|
||||
|
||||
private int getContentY()
|
||||
{
|
||||
return this.getBackgroundY() + 33;
|
||||
}
|
||||
|
||||
private int getXOffset()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
private int getYOffset()
|
||||
{
|
||||
return Config.getSettings().shortcuts() ? 11 : 8;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected String getSplash()
|
||||
{
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int day = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
int month = calendar.get(Calendar.MONTH) + 1;
|
||||
|
||||
if(day == 12 && month == 24)
|
||||
{
|
||||
return "Merry X-mas!";
|
||||
}
|
||||
else if(day == 1 && month == 1)
|
||||
{
|
||||
return "Happy new year!";
|
||||
}
|
||||
else if(day == 10 && month == 31)
|
||||
{
|
||||
return "OOoooOOOoooo! Spooky!";
|
||||
}
|
||||
else if(day == 3 && month == 28)
|
||||
{
|
||||
return (calendar.get(Calendar.YEAR) - 2013) + " Years of World Handler!";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose()
|
||||
{
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
package exopandora.worldhandler.gui.content.impl;
|
||||
|
||||
import exopandora.worldhandler.gui.DummyScreen;
|
||||
import exopandora.worldhandler.gui.button.GuiButtonBase;
|
||||
import exopandora.worldhandler.gui.container.Container;
|
||||
import exopandora.worldhandler.util.ActionHelper;
|
||||
import exopandora.worldhandler.util.Connection;
|
||||
import exopandora.worldhandler.util.Connection.DedicatedConnection;
|
||||
import exopandora.worldhandler.util.Connection.IntegratedConnection;
|
||||
import exopandora.worldhandler.util.Connection.Type;
|
||||
import net.minecraft.client.Minecraft;
|
||||
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.Screen;
|
||||
import net.minecraft.client.gui.screen.WorldSelectionScreen;
|
||||
import net.minecraft.client.multiplayer.ServerData;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.realms.RealmsBridge;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
@@ -26,49 +32,66 @@ public class ContentChangeWorld extends ContentChild
|
||||
|
||||
container.add(new GuiButtonBase(x + 116 / 2, y + 24, 232 / 2, 20, I18n.format("gui.worldhandler.change_world.singleplayer"), () ->
|
||||
{
|
||||
Minecraft.getInstance().displayGuiScreen(new WorldSelectionScreen(container));
|
||||
Connection connection = ContentChangeWorld.disconnect();
|
||||
Minecraft.getInstance().displayGuiScreen(new WorldSelectionScreen(new DummyScreen(() -> ContentChangeWorld.reconnect(connection))));
|
||||
}));
|
||||
|
||||
container.add(new GuiButtonBase(x + 116 / 2, y + 48, 232 / 2, 20, I18n.format("gui.worldhandler.change_world.multiplayer"), () ->
|
||||
{
|
||||
ServerData server = Minecraft.getInstance().getCurrentServerData();
|
||||
|
||||
if(server != null)
|
||||
{
|
||||
Minecraft.getInstance().world.sendQuittingDisconnectingPacket();
|
||||
Minecraft.getInstance().loadWorld(null);
|
||||
|
||||
Minecraft.getInstance().displayGuiScreen(new MultiplayerScreen(new Screen(new StringTextComponent(""))
|
||||
{
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
Minecraft.getInstance().displayGuiScreen(new ConnectingScreen(new MainMenuScreen(), Minecraft.getInstance(), server));
|
||||
Minecraft.getInstance().mouseHelper.grabMouse();
|
||||
}
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
String worldName = Minecraft.getInstance().getIntegratedServer().getWorldName();
|
||||
String folderName = Minecraft.getInstance().getIntegratedServer().getFolderName();
|
||||
|
||||
Minecraft.getInstance().world.sendQuittingDisconnectingPacket();
|
||||
Minecraft.getInstance().loadWorld(null);
|
||||
|
||||
Minecraft.getInstance().displayGuiScreen(new MultiplayerScreen(new Screen(new StringTextComponent(""))
|
||||
{
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
Minecraft.getInstance().launchIntegratedServer(folderName, worldName, null);
|
||||
Minecraft.getInstance().displayGuiScreen(null);
|
||||
Minecraft.getInstance().mouseHelper.grabMouse();
|
||||
}
|
||||
}));
|
||||
}
|
||||
Connection connection = ContentChangeWorld.disconnect();
|
||||
Minecraft.getInstance().displayGuiScreen(new MultiplayerScreen(new DummyScreen(() -> ContentChangeWorld.reconnect(connection))));
|
||||
}));
|
||||
}
|
||||
|
||||
private static Connection disconnect()
|
||||
{
|
||||
boolean isIntegrated = Minecraft.getInstance().isIntegratedServerRunning();
|
||||
boolean isRealms = Minecraft.getInstance().isConnectedToRealms();
|
||||
ServerData data = Minecraft.getInstance().getCurrentServerData();
|
||||
|
||||
if(isIntegrated)
|
||||
{
|
||||
String worldName = Minecraft.getInstance().getIntegratedServer().getWorldName();
|
||||
String folderName = Minecraft.getInstance().getIntegratedServer().getFolderName();
|
||||
|
||||
Minecraft.getInstance().world.sendQuittingDisconnectingPacket();
|
||||
Minecraft.getInstance().func_213231_b(new DirtMessageScreen(new TranslationTextComponent("menu.savingLevel")));
|
||||
|
||||
return new IntegratedConnection(Type.INTEGRATED, worldName, folderName);
|
||||
}
|
||||
|
||||
Minecraft.getInstance().world.sendQuittingDisconnectingPacket();
|
||||
Minecraft.getInstance().func_213254_o();
|
||||
|
||||
if(isRealms)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new DedicatedConnection(Type.DEDICATED, data);
|
||||
}
|
||||
|
||||
private static void reconnect(Connection connection)
|
||||
{
|
||||
if(connection == null)
|
||||
{
|
||||
RealmsBridge realmsbridge = new RealmsBridge();
|
||||
realmsbridge.switchToRealms(new MainMenuScreen());
|
||||
}
|
||||
else if(connection instanceof IntegratedConnection)
|
||||
{
|
||||
IntegratedConnection integrated = (IntegratedConnection) connection;
|
||||
Minecraft.getInstance().launchIntegratedServer(integrated.getFolderName(), integrated.getWorldName(), null);
|
||||
Minecraft.getInstance().mouseHelper.grabMouse();
|
||||
}
|
||||
else if(connection instanceof DedicatedConnection)
|
||||
{
|
||||
DedicatedConnection dedicated = (DedicatedConnection) connection;
|
||||
Minecraft.getInstance().displayGuiScreen(new ConnectingScreen(new MainMenuScreen(), Minecraft.getInstance(), dedicated.getData()));
|
||||
Minecraft.getInstance().mouseHelper.grabMouse();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ public class ContentMain extends Content
|
||||
container.add(new GuiButtonBase(x + 78, y + 96, 76, 20, I18n.format("gui.worldhandler.resourcepack"), () ->
|
||||
{
|
||||
Minecraft.getInstance().gameSettings.saveOptions();
|
||||
Minecraft.getInstance().displayGuiScreen(new ResourcePacksScreen(container));
|
||||
Minecraft.getInstance().displayGuiScreen(new ResourcePacksScreen(container, Minecraft.getInstance().gameSettings));
|
||||
}));
|
||||
container.add(new GuiButtonBase(x + 158, y + 96, 74, 20, I18n.format("gui.worldhandler.generic.backToGame"), ActionHelper::backToGame));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package exopandora.worldhandler.gui.content.impl;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import exopandora.worldhandler.Main;
|
||||
import exopandora.worldhandler.builder.ICommandBuilder;
|
||||
@@ -178,7 +178,7 @@ public class ContentNoteEditor extends Content
|
||||
{
|
||||
if(this.isActive)
|
||||
{
|
||||
GlStateManager.color3f(1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.color3f(1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(NOTE);
|
||||
|
||||
container.blit(x - 1, y - 1, 0, 0, 8, 59);
|
||||
@@ -194,16 +194,16 @@ public class ContentNoteEditor extends Content
|
||||
{
|
||||
float scale = 4;
|
||||
|
||||
GlStateManager.color3f(1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
RenderSystem.color3f(1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.pushMatrix();
|
||||
RenderHelper.func_227784_d_();
|
||||
|
||||
GlStateManager.translatef(container.width / 2 - 8 * scale, container.height / 2 - 15 - 8 * scale, 0);
|
||||
GlStateManager.scalef(scale, scale, scale);
|
||||
RenderSystem.translatef(container.width / 2 - 8 * scale, container.height / 2 - 15 - 8 * scale, 0);
|
||||
RenderSystem.scalef(scale, scale, scale);
|
||||
Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(new ItemStack(Blocks.NOTE_BLOCK), 0, 0);
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
RenderSystem.popMatrix();
|
||||
|
||||
String displayString = I18n.format("gui.worldhandler.blocks.note_block_editor.look_at_note_block", KeyHandler.KEY_WORLD_HANDLER.getLocalizedName());
|
||||
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package exopandora.worldhandler.gui.content.impl;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import exopandora.worldhandler.builder.ICommandBuilder;
|
||||
import exopandora.worldhandler.builder.impl.BuilderGeneric;
|
||||
@@ -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.posX);
|
||||
int posY = MathHelper.floor(Minecraft.getInstance().player.posY);
|
||||
int posZ = MathHelper.floor(Minecraft.getInstance().player.posZ);
|
||||
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_());
|
||||
|
||||
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.posX));
|
||||
this.posYField.setText("Y: " + MathHelper.floor(Minecraft.getInstance().player.posY));
|
||||
this.posZField.setText("Z: " + MathHelper.floor(Minecraft.getInstance().player.posZ));
|
||||
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.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);
|
||||
@@ -168,9 +168,9 @@ public class ContentPlayer extends Content
|
||||
Screen.fill(container.width / 2 - playerNameWidth - 1 + 59, yPos - 74, container.width / 2 + playerNameWidth + 1 + 59, yPos - 65, 0x3F000000);
|
||||
Minecraft.getInstance().fontRenderer.drawString(Minecraft.getInstance().player.getName().getFormattedText(), container.width / 2 - playerNameWidth + 59, yPos - 73, 0xE0E0E0);
|
||||
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
InventoryScreen.drawEntityOnScreen(xPos, yPos, 30, xPos - mouseX, yPos - mouseY - 44, Minecraft.getInstance().player);
|
||||
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
InventoryScreen.func_228187_a_(xPos, yPos, 30, xPos - mouseX, yPos - mouseY - 44, Minecraft.getInstance().player);
|
||||
RenderSystem.defaultBlendFunc();
|
||||
}
|
||||
else if(Page.SCORE.equals(this.page))
|
||||
{
|
||||
|
||||
@@ -200,7 +200,7 @@ public class ContentPotions extends ContentChild
|
||||
container.init();
|
||||
}));
|
||||
|
||||
boolean enabled = this.builderPotion.getAmplifier() >= 0;
|
||||
boolean enabled = this.builderPotion.getAmplifier() >= 0 && this.builderPotion.getDuration() > 0;
|
||||
|
||||
button1.active = enabled;
|
||||
button2.active = enabled;
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ContentSettings extends ContentChild
|
||||
SETTINGS.add(new BooleanSetting("pause_game", Config.CLIENT.getSettings()::pause, Config.CLIENT.getSettings()::setPause));
|
||||
SETTINGS.add(new BooleanSetting("custom_times", Config.CLIENT.getSettings()::customTimes, Config.CLIENT.getSettings()::setCustomTimes));
|
||||
SETTINGS.add(new BooleanSetting("permission_query", Config.CLIENT.getSettings()::permissionQuery, Config.CLIENT.getSettings()::setPermissionQuery));
|
||||
SETTINGS.add(new BooleanSetting("highlight_blocks", Config.CLIENT.getSettings()::highlightBlocks, Config.CLIENT.getSettings()::setHighlightBlocks));
|
||||
// SETTINGS.add(new BooleanSetting("highlight_blocks", Config.CLIENT.getSettings()::highlightBlocks, Config.CLIENT.getSettings()::setHighlightBlocks));
|
||||
SETTINGS.add(new IntegerSetting("custom_time_dawn", Config.CLIENT.getSettings()::getDawn, Config.CLIENT.getSettings()::setDawn));
|
||||
SETTINGS.add(new IntegerSetting("custom_time_noon", Config.CLIENT.getSettings()::getNoon, Config.CLIENT.getSettings()::setNoon));
|
||||
SETTINGS.add(new IntegerSetting("custom_time_sunset", Config.CLIENT.getSettings()::getSunset, Config.CLIENT.getSettings()::setSunset));
|
||||
|
||||
@@ -2,7 +2,7 @@ package exopandora.worldhandler.gui.content.impl;
|
||||
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import exopandora.worldhandler.builder.ICommandBuilder;
|
||||
import exopandora.worldhandler.builder.impl.BuilderSignEditor;
|
||||
@@ -179,16 +179,16 @@ public class ContentSignEditor extends Content
|
||||
{
|
||||
float scale = 4;
|
||||
|
||||
GlStateManager.color3f(1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
RenderSystem.color3f(1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.pushMatrix();
|
||||
RenderHelper.func_227784_d_();
|
||||
|
||||
GlStateManager.translatef(container.width / 2 - 8.5F * scale, container.height / 2 - 15 - 8.5F * scale, 0);
|
||||
GlStateManager.scalef(scale, scale, scale);
|
||||
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();
|
||||
GlStateManager.popMatrix();
|
||||
RenderSystem.popMatrix();
|
||||
|
||||
String displayString = I18n.format("gui.worldhandler.blocks.sign_editor.look_at_sign", KeyHandler.KEY_WORLD_HANDLER.getLocalizedName());
|
||||
FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
|
||||
|
||||
@@ -4,9 +4,8 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import exopandora.worldhandler.builder.ICommandBuilder;
|
||||
import exopandora.worldhandler.builder.impl.BuilderSummon;
|
||||
@@ -594,8 +593,9 @@ public class ContentSummon extends Content
|
||||
}
|
||||
else if(Page.EQUIPMENT.equals(this.page))
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/beacon.png"));
|
||||
container.setBlitOffset(0);
|
||||
|
||||
for(int row = 0; row < 3; row++)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package exopandora.worldhandler.util;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.advancements.Advancement;
|
||||
import net.minecraft.advancements.AdvancementManager;
|
||||
@@ -10,6 +12,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.profiler.IProfiler;
|
||||
import net.minecraft.resources.IFutureReloadListener;
|
||||
import net.minecraft.resources.IResourceManager;
|
||||
import net.minecraft.resources.IResourcePack;
|
||||
import net.minecraft.resources.ResourcePackInfo;
|
||||
import net.minecraft.resources.ResourcePackType;
|
||||
import net.minecraft.resources.SimpleReloadableResourceManager;
|
||||
@@ -30,13 +33,13 @@ public class AdvancementHelper implements IFutureReloadListener
|
||||
return CompletableFuture.supplyAsync(() ->
|
||||
{
|
||||
SimpleReloadableResourceManager serverResourceManager = new SimpleReloadableResourceManager(ResourcePackType.SERVER_DATA, Thread.currentThread());
|
||||
Minecraft.getInstance().getResourcePackList().getEnabledPacks().stream().map(ResourcePackInfo::getResourcePack).forEach(serverResourceManager::addResourcePack);
|
||||
serverResourceManager.addReloadListener(new NetworkTagManager());
|
||||
serverResourceManager.addReloadListener(this.manager);
|
||||
return serverResourceManager;
|
||||
}).thenCompose(stage::markCompleteAwaitingOthers).thenAcceptAsync(serverResourceManager ->
|
||||
{
|
||||
serverResourceManager.initialReload(backgroundExecutor, gameExecutor, CompletableFuture.completedFuture(Unit.INSTANCE));
|
||||
List<IResourcePack> list = Minecraft.getInstance().getResourcePackList().getEnabledPacks().stream().map(ResourcePackInfo::getResourcePack).collect(Collectors.toList());
|
||||
serverResourceManager.reloadResources(backgroundExecutor, gameExecutor, CompletableFuture.completedFuture(Unit.INSTANCE), list);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
68
src/main/java/exopandora/worldhandler/util/Connection.java
Normal file
68
src/main/java/exopandora/worldhandler/util/Connection.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package exopandora.worldhandler.util;
|
||||
|
||||
import net.minecraft.client.multiplayer.ServerData;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public abstract class Connection
|
||||
{
|
||||
private final Type type;
|
||||
|
||||
public Connection(Type type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Type getType()
|
||||
{
|
||||
return this.type;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static enum Type
|
||||
{
|
||||
INTEGRATED,
|
||||
DEDICATED;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static class IntegratedConnection extends Connection
|
||||
{
|
||||
private final String worldName;
|
||||
private final String folderName;
|
||||
|
||||
public IntegratedConnection(Type type, String worldName, String folderName)
|
||||
{
|
||||
super(type);
|
||||
this.worldName = worldName;
|
||||
this.folderName = folderName;
|
||||
}
|
||||
|
||||
public String getWorldName()
|
||||
{
|
||||
return this.worldName;
|
||||
}
|
||||
|
||||
public String getFolderName()
|
||||
{
|
||||
return this.folderName;
|
||||
}
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static class DedicatedConnection extends Connection
|
||||
{
|
||||
private final ServerData data;
|
||||
|
||||
public DedicatedConnection(Type type, ServerData data)
|
||||
{
|
||||
super(type);
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public ServerData getData()
|
||||
{
|
||||
return this.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package exopandora.worldhandler.util;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import exopandora.worldhandler.config.Config;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -25,29 +25,29 @@ public class UtilRender
|
||||
float rotationHour = (360 / 12) * (hour >= 12 ? (hour - 12) : hour) - 180F;
|
||||
float rotationMinute = (360 / 60) * minute - 180F;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translatef(width + 5, height + 5, 0F);
|
||||
GlStateManager.scalef(0.25F, 0.25F, 0.25F);
|
||||
RenderSystem.pushMatrix();
|
||||
RenderSystem.translatef(width + 5, height + 5, 0F);
|
||||
RenderSystem.scalef(0.25F, 0.25F, 0.25F);
|
||||
|
||||
GlStateManager.rotatef(rotationHour, 0F, 0F, 1F);
|
||||
RenderSystem.rotatef(rotationHour, 0F, 0F, 1F);
|
||||
Screen.fill(-1, -1, 1, 11, 0xFF383838);
|
||||
GlStateManager.rotatef(-rotationHour, 0F, 0F, 1F);
|
||||
RenderSystem.rotatef(-rotationHour, 0F, 0F, 1F);
|
||||
|
||||
GlStateManager.rotatef(rotationMinute, 0F, 0F, 1F);
|
||||
RenderSystem.rotatef(rotationMinute, 0F, 0F, 1F);
|
||||
Screen.fill(-1, -1, 1, 15, 0xFF6F6F6F);
|
||||
GlStateManager.rotatef(-rotationMinute, 0F, 0F, 1F);
|
||||
RenderSystem.rotatef(-rotationMinute, 0F, 0F, 1F);
|
||||
|
||||
GlStateManager.color3f(1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.popMatrix();
|
||||
RenderSystem.color3f(1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.popMatrix();
|
||||
|
||||
GlStateManager.color3f(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF());
|
||||
RenderSystem.color3f(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF());
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(ResourceHelper.getIconTexture());
|
||||
|
||||
gui.blit(width + 0, height, 48, 0, 10, 10);
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scalef(0.5F, 0.5F, 0.5F);
|
||||
RenderSystem.pushMatrix();
|
||||
RenderSystem.scalef(0.5F, 0.5F, 0.5F);
|
||||
Screen.fill((width + 5) * 2 - 1, (height + 4) * 2 + 1, (width + 6) * 2 - 1, (height + 5) * 2 + 1, 0xFF000000);
|
||||
GlStateManager.popMatrix();
|
||||
RenderSystem.popMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user