base mod created

This commit is contained in:
Mohammad-Ali Minaie
2018-10-08 09:07:47 -04:00
parent 0a7700c356
commit b86dedad2f
7848 changed files with 584664 additions and 1 deletions

View File

@@ -0,0 +1,67 @@
package net.minecraft.realms;
import java.util.List;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class DisconnectedRealmsScreen extends RealmsScreen
{
private final String title;
private final ITextComponent reason;
private List<String> lines;
private final RealmsScreen parent;
private int textHeight;
public DisconnectedRealmsScreen(RealmsScreen parentIn, String unlocalizedTitle, ITextComponent reasonIn)
{
this.parent = parentIn;
this.title = getLocalizedString(unlocalizedTitle);
this.reason = reasonIn;
}
public void init()
{
Realms.setConnectedToRealms(false);
Realms.clearResourcePack();
this.buttonsClear();
this.lines = this.fontSplit(this.reason.getFormattedText(), this.width() - 50);
this.textHeight = this.lines.size() * this.fontLineHeight();
this.buttonsAdd(newButton(0, this.width() / 2 - 100, this.height() / 2 + this.textHeight / 2 + this.fontLineHeight(), getLocalizedString("gui.back")));
}
public void keyPressed(char p_keyPressed_1_, int p_keyPressed_2_)
{
if (p_keyPressed_2_ == 1)
{
Realms.setScreen(this.parent);
}
}
public void buttonClicked(RealmsButton p_buttonClicked_1_)
{
if (p_buttonClicked_1_.id() == 0)
{
Realms.setScreen(this.parent);
}
}
public void render(int p_render_1_, int p_render_2_, float p_render_3_)
{
this.renderBackground();
this.drawCenteredString(this.title, this.width() / 2, this.height() / 2 - this.textHeight / 2 - this.fontLineHeight() * 2, 11184810);
int i = this.height() / 2 - this.textHeight / 2;
if (this.lines != null)
{
for (String s : this.lines)
{
this.drawCenteredString(s, this.width() / 2, i, 16777215);
i += this.fontLineHeight();
}
}
super.render(p_render_1_, p_render_2_, p_render_3_);
}
}

View File

@@ -0,0 +1,142 @@
package net.minecraft.realms;
import com.google.common.util.concurrent.ListenableFuture;
import com.mojang.authlib.GameProfile;
import com.mojang.util.UUIDTypeAdapter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.net.Proxy;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Session;
import net.minecraft.world.GameType;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class Realms
{
public static boolean isTouchScreen()
{
return Minecraft.getMinecraft().gameSettings.touchscreen;
}
public static Proxy getProxy()
{
return Minecraft.getMinecraft().getProxy();
}
public static String sessionId()
{
Session session = Minecraft.getMinecraft().getSession();
return session == null ? null : session.getSessionID();
}
public static String userName()
{
Session session = Minecraft.getMinecraft().getSession();
return session == null ? null : session.getUsername();
}
public static long currentTimeMillis()
{
return Minecraft.getSystemTime();
}
public static String getSessionId()
{
return Minecraft.getMinecraft().getSession().getSessionID();
}
public static String getUUID()
{
return Minecraft.getMinecraft().getSession().getPlayerID();
}
public static String getName()
{
return Minecraft.getMinecraft().getSession().getUsername();
}
public static String uuidToName(String p_uuidToName_0_)
{
return Minecraft.getMinecraft().getSessionService().fillProfileProperties(new GameProfile(UUIDTypeAdapter.fromString(p_uuidToName_0_), (String)null), false).getName();
}
public static void setScreen(RealmsScreen p_setScreen_0_)
{
Minecraft.getMinecraft().displayGuiScreen(p_setScreen_0_.getProxy());
}
public static String getGameDirectoryPath()
{
return Minecraft.getMinecraft().mcDataDir.getAbsolutePath();
}
public static int survivalId()
{
return GameType.SURVIVAL.getID();
}
public static int creativeId()
{
return GameType.CREATIVE.getID();
}
public static int adventureId()
{
return GameType.ADVENTURE.getID();
}
public static int spectatorId()
{
return GameType.SPECTATOR.getID();
}
public static void setConnectedToRealms(boolean p_setConnectedToRealms_0_)
{
Minecraft.getMinecraft().setConnectedToRealms(p_setConnectedToRealms_0_);
}
public static ListenableFuture<Object> downloadResourcePack(String p_downloadResourcePack_0_, String p_downloadResourcePack_1_)
{
return Minecraft.getMinecraft().getResourcePackRepository().downloadResourcePack(p_downloadResourcePack_0_, p_downloadResourcePack_1_);
}
public static void clearResourcePack()
{
Minecraft.getMinecraft().getResourcePackRepository().clearResourcePack();
}
public static boolean getRealmsNotificationsEnabled()
{
return Minecraft.getMinecraft().gameSettings.getOptionOrdinalValue(GameSettings.Options.REALMS_NOTIFICATIONS);
}
public static boolean inTitleScreen()
{
return Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiMainMenu;
}
public static void deletePlayerTag(File p_deletePlayerTag_0_)
{
if (p_deletePlayerTag_0_.exists())
{
try
{
NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(p_deletePlayerTag_0_));
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data");
nbttagcompound1.removeTag("Player");
CompressedStreamTools.writeCompressed(nbttagcompound, new FileOutputStream(p_deletePlayerTag_0_));
}
catch (Exception exception)
{
exception.printStackTrace();
}
}
}
}

View File

@@ -0,0 +1,78 @@
package net.minecraft.realms;
import com.google.common.collect.Lists;
import java.util.List;
import net.minecraft.client.AnvilConverterException;
import net.minecraft.util.IProgressUpdate;
import net.minecraft.world.storage.ISaveFormat;
import net.minecraft.world.storage.WorldSummary;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsAnvilLevelStorageSource
{
private final ISaveFormat levelStorageSource;
public RealmsAnvilLevelStorageSource(ISaveFormat levelStorageSourceIn)
{
this.levelStorageSource = levelStorageSourceIn;
}
public String getName()
{
return this.levelStorageSource.getName();
}
public boolean levelExists(String p_levelExists_1_)
{
return this.levelStorageSource.canLoadWorld(p_levelExists_1_);
}
public boolean convertLevel(String p_convertLevel_1_, IProgressUpdate p_convertLevel_2_)
{
return this.levelStorageSource.convertMapFormat(p_convertLevel_1_, p_convertLevel_2_);
}
public boolean requiresConversion(String p_requiresConversion_1_)
{
return this.levelStorageSource.isOldMapFormat(p_requiresConversion_1_);
}
public boolean isNewLevelIdAcceptable(String p_isNewLevelIdAcceptable_1_)
{
return this.levelStorageSource.isNewLevelIdAcceptable(p_isNewLevelIdAcceptable_1_);
}
public boolean deleteLevel(String p_deleteLevel_1_)
{
return this.levelStorageSource.deleteWorldDirectory(p_deleteLevel_1_);
}
public boolean isConvertible(String p_isConvertible_1_)
{
return this.levelStorageSource.isConvertible(p_isConvertible_1_);
}
public void renameLevel(String p_renameLevel_1_, String p_renameLevel_2_)
{
this.levelStorageSource.renameWorld(p_renameLevel_1_, p_renameLevel_2_);
}
public void clearAll()
{
this.levelStorageSource.flushCache();
}
public List<RealmsLevelSummary> getLevelList() throws AnvilConverterException
{
List<RealmsLevelSummary> list = Lists.<RealmsLevelSummary>newArrayList();
for (WorldSummary worldsummary : this.levelStorageSource.getSaveList())
{
list.add(new RealmsLevelSummary(worldsummary));
}
return list;
}
}

View File

@@ -0,0 +1,67 @@
package net.minecraft.realms;
import java.lang.reflect.Constructor;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiScreenRealmsProxy;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@SideOnly(Side.CLIENT)
public class RealmsBridge extends RealmsScreen
{
private static final Logger LOGGER = LogManager.getLogger();
private GuiScreen previousScreen;
public void switchToRealms(GuiScreen p_switchToRealms_1_)
{
this.previousScreen = p_switchToRealms_1_;
try
{
Class<?> oclass = Class.forName("com.mojang.realmsclient.RealmsMainScreen");
Constructor<?> constructor = oclass.getDeclaredConstructor(RealmsScreen.class);
constructor.setAccessible(true);
Object object = constructor.newInstance(this);
Minecraft.getMinecraft().displayGuiScreen(((RealmsScreen)object).getProxy());
}
catch (ClassNotFoundException var5)
{
LOGGER.error("Realms module missing");
}
catch (Exception exception)
{
LOGGER.error("Failed to load Realms module", (Throwable)exception);
}
}
public GuiScreenRealmsProxy getNotificationScreen(GuiScreen p_getNotificationScreen_1_)
{
try
{
this.previousScreen = p_getNotificationScreen_1_;
Class<?> oclass = Class.forName("com.mojang.realmsclient.gui.screens.RealmsNotificationsScreen");
Constructor<?> constructor = oclass.getDeclaredConstructor(RealmsScreen.class);
constructor.setAccessible(true);
Object object = constructor.newInstance(this);
return ((RealmsScreen)object).getProxy();
}
catch (ClassNotFoundException var5)
{
LOGGER.error("Realms module missing");
}
catch (Exception exception)
{
LOGGER.error("Failed to load Realms module", (Throwable)exception);
}
return null;
}
public void init()
{
Minecraft.getMinecraft().displayGuiScreen(this.previousScreen);
}
}

View File

@@ -0,0 +1,154 @@
package net.minecraft.realms;
import java.nio.ByteBuffer;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsBufferBuilder
{
private BufferBuilder b;
public RealmsBufferBuilder(BufferBuilder p_i46442_1_)
{
this.b = p_i46442_1_;
}
public RealmsBufferBuilder from(BufferBuilder p_from_1_)
{
this.b = p_from_1_;
return this;
}
public void sortQuads(float p_sortQuads_1_, float p_sortQuads_2_, float p_sortQuads_3_)
{
this.b.sortVertexData(p_sortQuads_1_, p_sortQuads_2_, p_sortQuads_3_);
}
public void fixupQuadColor(int p_fixupQuadColor_1_)
{
this.b.putColor4(p_fixupQuadColor_1_);
}
public ByteBuffer getBuffer()
{
return this.b.getByteBuffer();
}
public void postNormal(float p_postNormal_1_, float p_postNormal_2_, float p_postNormal_3_)
{
this.b.putNormal(p_postNormal_1_, p_postNormal_2_, p_postNormal_3_);
}
public int getDrawMode()
{
return this.b.getDrawMode();
}
public void offset(double p_offset_1_, double p_offset_3_, double p_offset_5_)
{
this.b.setTranslation(p_offset_1_, p_offset_3_, p_offset_5_);
}
public void restoreState(BufferBuilder.State p_restoreState_1_)
{
this.b.setVertexState(p_restoreState_1_);
}
public void endVertex()
{
this.b.endVertex();
}
public RealmsBufferBuilder normal(float p_normal_1_, float p_normal_2_, float p_normal_3_)
{
return this.from(this.b.normal(p_normal_1_, p_normal_2_, p_normal_3_));
}
public void end()
{
this.b.finishDrawing();
}
public void begin(int p_begin_1_, VertexFormat p_begin_2_)
{
this.b.begin(p_begin_1_, p_begin_2_);
}
public RealmsBufferBuilder color(int p_color_1_, int p_color_2_, int p_color_3_, int p_color_4_)
{
return this.from(this.b.color(p_color_1_, p_color_2_, p_color_3_, p_color_4_));
}
public void faceTex2(int p_faceTex2_1_, int p_faceTex2_2_, int p_faceTex2_3_, int p_faceTex2_4_)
{
this.b.putBrightness4(p_faceTex2_1_, p_faceTex2_2_, p_faceTex2_3_, p_faceTex2_4_);
}
public void postProcessFacePosition(double p_postProcessFacePosition_1_, double p_postProcessFacePosition_3_, double p_postProcessFacePosition_5_)
{
this.b.putPosition(p_postProcessFacePosition_1_, p_postProcessFacePosition_3_, p_postProcessFacePosition_5_);
}
public void fixupVertexColor(float p_fixupVertexColor_1_, float p_fixupVertexColor_2_, float p_fixupVertexColor_3_, int p_fixupVertexColor_4_)
{
this.b.putColorRGB_F(p_fixupVertexColor_1_, p_fixupVertexColor_2_, p_fixupVertexColor_3_, p_fixupVertexColor_4_);
}
public RealmsBufferBuilder color(float p_color_1_, float p_color_2_, float p_color_3_, float p_color_4_)
{
return this.from(this.b.color(p_color_1_, p_color_2_, p_color_3_, p_color_4_));
}
public RealmsVertexFormat getVertexFormat()
{
return new RealmsVertexFormat(this.b.getVertexFormat());
}
public void faceTint(float p_faceTint_1_, float p_faceTint_2_, float p_faceTint_3_, int p_faceTint_4_)
{
this.b.putColorMultiplier(p_faceTint_1_, p_faceTint_2_, p_faceTint_3_, p_faceTint_4_);
}
public RealmsBufferBuilder tex2(int p_tex2_1_, int p_tex2_2_)
{
return this.from(this.b.lightmap(p_tex2_1_, p_tex2_2_));
}
public void putBulkData(int[] p_putBulkData_1_)
{
this.b.addVertexData(p_putBulkData_1_);
}
public RealmsBufferBuilder tex(double p_tex_1_, double p_tex_3_)
{
return this.from(this.b.tex(p_tex_1_, p_tex_3_));
}
public int getVertexCount()
{
return this.b.getVertexCount();
}
public void clear()
{
this.b.reset();
}
public RealmsBufferBuilder vertex(double p_vertex_1_, double p_vertex_3_, double p_vertex_5_)
{
return this.from(this.b.pos(p_vertex_1_, p_vertex_3_, p_vertex_5_));
}
public void fixupQuadColor(float p_fixupQuadColor_1_, float p_fixupQuadColor_2_, float p_fixupQuadColor_3_)
{
this.b.putColorRGB_F4(p_fixupQuadColor_1_, p_fixupQuadColor_2_, p_fixupQuadColor_3_);
}
public void noColor()
{
this.b.noColor();
}
}

View File

@@ -0,0 +1,92 @@
package net.minecraft.realms;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiButtonRealmsProxy;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsButton
{
protected static final ResourceLocation WIDGETS_LOCATION = new ResourceLocation("textures/gui/widgets.png");
private final GuiButtonRealmsProxy proxy;
public RealmsButton(int buttonId, int x, int y, String text)
{
this.proxy = new GuiButtonRealmsProxy(this, buttonId, x, y, text);
}
public RealmsButton(int buttonId, int x, int y, int widthIn, int heightIn, String text)
{
this.proxy = new GuiButtonRealmsProxy(this, buttonId, x, y, text, widthIn, heightIn);
}
public GuiButton getProxy()
{
return this.proxy;
}
public int id()
{
return this.proxy.getId();
}
public boolean active()
{
return this.proxy.getEnabled();
}
public void active(boolean p_active_1_)
{
this.proxy.setEnabled(p_active_1_);
}
public void msg(String p_msg_1_)
{
this.proxy.setText(p_msg_1_);
}
public int getWidth()
{
return this.proxy.getButtonWidth();
}
public int getHeight()
{
return this.proxy.getHeight();
}
public int y()
{
return this.proxy.getPositionY();
}
public void render(int p_render_1_, int p_render_2_, float p_render_3_)
{
this.proxy.drawButton(Minecraft.getMinecraft(), p_render_1_, p_render_2_, p_render_3_);
}
public void clicked(int p_clicked_1_, int p_clicked_2_)
{
}
public void released(int p_released_1_, int p_released_2_)
{
}
public void blit(int p_blit_1_, int p_blit_2_, int p_blit_3_, int p_blit_4_, int p_blit_5_, int p_blit_6_)
{
this.proxy.drawTexturedModalRect(p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_);
}
public void renderBg(int p_renderBg_1_, int p_renderBg_2_)
{
}
public int getYImage(boolean p_getYImage_1_)
{
return this.proxy.getYImage(p_getYImage_1_);
}
}

View File

@@ -0,0 +1,109 @@
package net.minecraft.realms;
import net.minecraft.client.gui.GuiClickableScrolledSelectionListProxy;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsClickableScrolledSelectionList
{
private final GuiClickableScrolledSelectionListProxy proxy;
public RealmsClickableScrolledSelectionList(int p_i46052_1_, int p_i46052_2_, int p_i46052_3_, int p_i46052_4_, int p_i46052_5_)
{
this.proxy = new GuiClickableScrolledSelectionListProxy(this, p_i46052_1_, p_i46052_2_, p_i46052_3_, p_i46052_4_, p_i46052_5_);
}
public void render(int p_render_1_, int p_render_2_, float p_render_3_)
{
this.proxy.drawScreen(p_render_1_, p_render_2_, p_render_3_);
}
public int width()
{
return this.proxy.width();
}
public int ym()
{
return this.proxy.mouseY();
}
public int xm()
{
return this.proxy.mouseX();
}
protected void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, Tezzelator p_renderItem_5_, int p_renderItem_6_, int p_renderItem_7_)
{
}
public void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, int p_renderItem_5_, int p_renderItem_6_)
{
this.renderItem(p_renderItem_1_, p_renderItem_2_, p_renderItem_3_, p_renderItem_4_, Tezzelator.instance, p_renderItem_5_, p_renderItem_6_);
}
public int getItemCount()
{
return 0;
}
public void selectItem(int p_selectItem_1_, boolean p_selectItem_2_, int p_selectItem_3_, int p_selectItem_4_)
{
}
public boolean isSelectedItem(int p_isSelectedItem_1_)
{
return false;
}
public void renderBackground()
{
}
public int getMaxPosition()
{
return 0;
}
public int getScrollbarPosition()
{
return this.proxy.width() / 2 + 124;
}
public void mouseEvent()
{
this.proxy.handleMouseInput();
}
public void customMouseEvent(int p_customMouseEvent_1_, int p_customMouseEvent_2_, int p_customMouseEvent_3_, float p_customMouseEvent_4_, int p_customMouseEvent_5_)
{
}
public void scroll(int p_scroll_1_)
{
this.proxy.scrollBy(p_scroll_1_);
}
public int getScroll()
{
return this.proxy.getAmountScrolled();
}
protected void renderList(int p_renderList_1_, int p_renderList_2_, int p_renderList_3_, int p_renderList_4_)
{
}
public void itemClicked(int p_itemClicked_1_, int p_itemClicked_2_, int p_itemClicked_3_, int p_itemClicked_4_, int p_itemClicked_5_)
{
}
public void renderSelected(int p_renderSelected_1_, int p_renderSelected_2_, int p_renderSelected_3_, Tezzelator p_renderSelected_4_)
{
}
public void setLeftPos(int p_setLeftPos_1_)
{
this.proxy.setSlotXBoundsFromLeft(p_setLeftPos_1_);
}
}

View File

@@ -0,0 +1,133 @@
package net.minecraft.realms;
import java.net.InetAddress;
import java.net.UnknownHostException;
import net.minecraft.client.Minecraft;
import net.minecraft.client.network.NetHandlerLoginClient;
import net.minecraft.network.EnumConnectionState;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.handshake.client.C00Handshake;
import net.minecraft.network.login.client.CPacketLoginStart;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@SideOnly(Side.CLIENT)
public class RealmsConnect
{
private static final Logger LOGGER = LogManager.getLogger();
private final RealmsScreen onlineScreen;
private volatile boolean aborted;
private NetworkManager connection;
public RealmsConnect(RealmsScreen onlineScreenIn)
{
this.onlineScreen = onlineScreenIn;
}
public void connect(final String p_connect_1_, final int p_connect_2_)
{
Realms.setConnectedToRealms(true);
(new Thread("Realms-connect-task")
{
public void run()
{
InetAddress inetaddress = null;
try
{
net.minecraftforge.fml.client.FMLClientHandler.instance().connectToRealmsServer(p_connect_1_, p_connect_2_);
inetaddress = InetAddress.getByName(p_connect_1_);
if (RealmsConnect.this.aborted)
{
return;
}
RealmsConnect.this.connection = NetworkManager.createNetworkManagerAndConnect(inetaddress, p_connect_2_, Minecraft.getMinecraft().gameSettings.isUsingNativeTransport());
if (RealmsConnect.this.aborted)
{
return;
}
RealmsConnect.this.connection.setNetHandler(new NetHandlerLoginClient(RealmsConnect.this.connection, Minecraft.getMinecraft(), RealmsConnect.this.onlineScreen.getProxy()));
if (RealmsConnect.this.aborted)
{
return;
}
RealmsConnect.this.connection.sendPacket(new C00Handshake(p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN, true));
if (RealmsConnect.this.aborted)
{
return;
}
RealmsConnect.this.connection.sendPacket(new CPacketLoginStart(Minecraft.getMinecraft().getSession().getProfile()));
}
catch (UnknownHostException unknownhostexception)
{
Realms.clearResourcePack();
if (RealmsConnect.this.aborted)
{
return;
}
RealmsConnect.LOGGER.error("Couldn't connect to world", (Throwable)unknownhostexception);
Realms.setScreen(new DisconnectedRealmsScreen(RealmsConnect.this.onlineScreen, "connect.failed", new TextComponentTranslation("disconnect.genericReason", new Object[] {"Unknown host '" + p_connect_1_ + "'"})));
}
catch (Exception exception)
{
Realms.clearResourcePack();
if (RealmsConnect.this.aborted)
{
return;
}
RealmsConnect.LOGGER.error("Couldn't connect to world", (Throwable)exception);
String s = exception.toString();
if (inetaddress != null)
{
String s1 = inetaddress + ":" + p_connect_2_;
s = s.replaceAll(s1, "");
}
Realms.setScreen(new DisconnectedRealmsScreen(RealmsConnect.this.onlineScreen, "connect.failed", new TextComponentTranslation("disconnect.genericReason", new Object[] {s})));
}
}
}).start();
}
public void abort()
{
this.aborted = true;
if (this.connection != null && this.connection.isChannelOpen())
{
this.connection.closeChannel(new TextComponentTranslation("disconnect.genericReason", new Object[0]));
this.connection.checkDisconnected();
}
}
public void tick()
{
if (this.connection != null)
{
if (this.connection.isChannelOpen())
{
this.connection.processReceivedPackets();
}
else
{
this.connection.checkDisconnected();
}
}
}
}

View File

@@ -0,0 +1,74 @@
package net.minecraft.realms;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.renderer.vertex.VertexFormatElement;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsDefaultVertexFormat
{
public static final RealmsVertexFormat BLOCK = new RealmsVertexFormat(new VertexFormat());
public static final RealmsVertexFormat BLOCK_NORMALS = new RealmsVertexFormat(new VertexFormat());
public static final RealmsVertexFormat ENTITY = new RealmsVertexFormat(new VertexFormat());
public static final RealmsVertexFormat PARTICLE = new RealmsVertexFormat(new VertexFormat());
public static final RealmsVertexFormat POSITION = new RealmsVertexFormat(new VertexFormat());
public static final RealmsVertexFormat POSITION_COLOR = new RealmsVertexFormat(new VertexFormat());
public static final RealmsVertexFormat POSITION_TEX = new RealmsVertexFormat(new VertexFormat());
public static final RealmsVertexFormat POSITION_NORMAL = new RealmsVertexFormat(new VertexFormat());
public static final RealmsVertexFormat POSITION_TEX_COLOR = new RealmsVertexFormat(new VertexFormat());
public static final RealmsVertexFormat POSITION_TEX_NORMAL = new RealmsVertexFormat(new VertexFormat());
public static final RealmsVertexFormat POSITION_TEX2_COLOR = new RealmsVertexFormat(new VertexFormat());
public static final RealmsVertexFormat POSITION_TEX_COLOR_NORMAL = new RealmsVertexFormat(new VertexFormat());
public static final RealmsVertexFormatElement ELEMENT_POSITION = new RealmsVertexFormatElement(new VertexFormatElement(0, VertexFormatElement.EnumType.FLOAT, VertexFormatElement.EnumUsage.POSITION, 3));
public static final RealmsVertexFormatElement ELEMENT_COLOR = new RealmsVertexFormatElement(new VertexFormatElement(0, VertexFormatElement.EnumType.UBYTE, VertexFormatElement.EnumUsage.COLOR, 4));
public static final RealmsVertexFormatElement ELEMENT_UV0 = new RealmsVertexFormatElement(new VertexFormatElement(0, VertexFormatElement.EnumType.FLOAT, VertexFormatElement.EnumUsage.UV, 2));
public static final RealmsVertexFormatElement ELEMENT_UV1 = new RealmsVertexFormatElement(new VertexFormatElement(1, VertexFormatElement.EnumType.SHORT, VertexFormatElement.EnumUsage.UV, 2));
public static final RealmsVertexFormatElement ELEMENT_NORMAL = new RealmsVertexFormatElement(new VertexFormatElement(0, VertexFormatElement.EnumType.BYTE, VertexFormatElement.EnumUsage.NORMAL, 3));
public static final RealmsVertexFormatElement ELEMENT_PADDING = new RealmsVertexFormatElement(new VertexFormatElement(0, VertexFormatElement.EnumType.BYTE, VertexFormatElement.EnumUsage.PADDING, 1));
static
{
BLOCK.addElement(ELEMENT_POSITION);
BLOCK.addElement(ELEMENT_COLOR);
BLOCK.addElement(ELEMENT_UV0);
BLOCK.addElement(ELEMENT_UV1);
BLOCK_NORMALS.addElement(ELEMENT_POSITION);
BLOCK_NORMALS.addElement(ELEMENT_COLOR);
BLOCK_NORMALS.addElement(ELEMENT_UV0);
BLOCK_NORMALS.addElement(ELEMENT_NORMAL);
BLOCK_NORMALS.addElement(ELEMENT_PADDING);
ENTITY.addElement(ELEMENT_POSITION);
ENTITY.addElement(ELEMENT_UV0);
ENTITY.addElement(ELEMENT_NORMAL);
ENTITY.addElement(ELEMENT_PADDING);
PARTICLE.addElement(ELEMENT_POSITION);
PARTICLE.addElement(ELEMENT_UV0);
PARTICLE.addElement(ELEMENT_COLOR);
PARTICLE.addElement(ELEMENT_UV1);
POSITION.addElement(ELEMENT_POSITION);
POSITION_COLOR.addElement(ELEMENT_POSITION);
POSITION_COLOR.addElement(ELEMENT_COLOR);
POSITION_TEX.addElement(ELEMENT_POSITION);
POSITION_TEX.addElement(ELEMENT_UV0);
POSITION_NORMAL.addElement(ELEMENT_POSITION);
POSITION_NORMAL.addElement(ELEMENT_NORMAL);
POSITION_NORMAL.addElement(ELEMENT_PADDING);
POSITION_TEX_COLOR.addElement(ELEMENT_POSITION);
POSITION_TEX_COLOR.addElement(ELEMENT_UV0);
POSITION_TEX_COLOR.addElement(ELEMENT_COLOR);
POSITION_TEX_NORMAL.addElement(ELEMENT_POSITION);
POSITION_TEX_NORMAL.addElement(ELEMENT_UV0);
POSITION_TEX_NORMAL.addElement(ELEMENT_NORMAL);
POSITION_TEX_NORMAL.addElement(ELEMENT_PADDING);
POSITION_TEX2_COLOR.addElement(ELEMENT_POSITION);
POSITION_TEX2_COLOR.addElement(ELEMENT_UV0);
POSITION_TEX2_COLOR.addElement(ELEMENT_UV1);
POSITION_TEX2_COLOR.addElement(ELEMENT_COLOR);
POSITION_TEX_COLOR_NORMAL.addElement(ELEMENT_POSITION);
POSITION_TEX_COLOR_NORMAL.addElement(ELEMENT_UV0);
POSITION_TEX_COLOR_NORMAL.addElement(ELEMENT_COLOR);
POSITION_TEX_COLOR_NORMAL.addElement(ELEMENT_NORMAL);
POSITION_TEX_COLOR_NORMAL.addElement(ELEMENT_PADDING);
}
}

View File

@@ -0,0 +1,67 @@
package net.minecraft.realms;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiTextField;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsEditBox
{
private final GuiTextField editBox;
public RealmsEditBox(int id, int x, int y, int width, int height)
{
this.editBox = new GuiTextField(id, Minecraft.getMinecraft().fontRenderer, x, y, width, height);
}
public String getValue()
{
return this.editBox.getText();
}
public void tick()
{
this.editBox.updateCursorCounter();
}
public void setFocus(boolean p_setFocus_1_)
{
this.editBox.setFocused(p_setFocus_1_);
}
public void setValue(String p_setValue_1_)
{
this.editBox.setText(p_setValue_1_);
}
public void keyPressed(char p_keyPressed_1_, int p_keyPressed_2_)
{
this.editBox.textboxKeyTyped(p_keyPressed_1_, p_keyPressed_2_);
}
public boolean isFocused()
{
return this.editBox.isFocused();
}
public void mouseClicked(int p_mouseClicked_1_, int p_mouseClicked_2_, int p_mouseClicked_3_)
{
this.editBox.mouseClicked(p_mouseClicked_1_, p_mouseClicked_2_, p_mouseClicked_3_);
}
public void render()
{
this.editBox.drawTextBox();
}
public void setMaxLength(int p_setMaxLength_1_)
{
this.editBox.setMaxStringLength(p_setMaxLength_1_);
}
public void setIsEditable(boolean p_setIsEditable_1_)
{
this.editBox.setEnabled(p_setIsEditable_1_);
}
}

View File

@@ -0,0 +1,73 @@
package net.minecraft.realms;
import net.minecraft.world.storage.WorldSummary;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsLevelSummary implements Comparable<RealmsLevelSummary>
{
private final WorldSummary levelSummary;
public RealmsLevelSummary(WorldSummary levelSummaryIn)
{
this.levelSummary = levelSummaryIn;
}
public int getGameMode()
{
return this.levelSummary.getEnumGameType().getID();
}
public String getLevelId()
{
return this.levelSummary.getFileName();
}
public boolean hasCheats()
{
return this.levelSummary.getCheatsEnabled();
}
public boolean isHardcore()
{
return this.levelSummary.isHardcoreModeEnabled();
}
public boolean isRequiresConversion()
{
return this.levelSummary.requiresConversion();
}
public String getLevelName()
{
return this.levelSummary.getDisplayName();
}
public long getLastPlayed()
{
return this.levelSummary.getLastTimePlayed();
}
public int compareTo(WorldSummary p_compareTo_1_)
{
return this.levelSummary.compareTo(p_compareTo_1_);
}
public long getSizeOnDisk()
{
return this.levelSummary.getSizeOnDisk();
}
public int compareTo(RealmsLevelSummary p_compareTo_1_)
{
if (this.levelSummary.getLastTimePlayed() < p_compareTo_1_.getLastPlayed())
{
return 1;
}
else
{
return this.levelSummary.getLastTimePlayed() > p_compareTo_1_.getLastPlayed() ? -1 : this.levelSummary.getFileName().compareTo(p_compareTo_1_.getLevelId());
}
}
}

View File

@@ -0,0 +1,176 @@
package net.minecraft.realms;
import java.util.Random;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.StringUtils;
@SideOnly(Side.CLIENT)
public class RealmsMth
{
public static float sin(float p_sin_0_)
{
return MathHelper.sin(p_sin_0_);
}
public static double nextDouble(Random p_nextDouble_0_, double p_nextDouble_1_, double p_nextDouble_3_)
{
return MathHelper.nextDouble(p_nextDouble_0_, p_nextDouble_1_, p_nextDouble_3_);
}
public static int ceil(float p_ceil_0_)
{
return MathHelper.ceil(p_ceil_0_);
}
public static int floor(double p_floor_0_)
{
return MathHelper.floor(p_floor_0_);
}
public static int intFloorDiv(int p_intFloorDiv_0_, int p_intFloorDiv_1_)
{
return MathHelper.intFloorDiv(p_intFloorDiv_0_, p_intFloorDiv_1_);
}
public static float abs(float p_abs_0_)
{
return MathHelper.abs(p_abs_0_);
}
public static int clamp(int p_clamp_0_, int p_clamp_1_, int p_clamp_2_)
{
return MathHelper.clamp(p_clamp_0_, p_clamp_1_, p_clamp_2_);
}
public static double clampedLerp(double p_clampedLerp_0_, double p_clampedLerp_2_, double p_clampedLerp_4_)
{
return MathHelper.clampedLerp(p_clampedLerp_0_, p_clampedLerp_2_, p_clampedLerp_4_);
}
public static int ceil(double p_ceil_0_)
{
return MathHelper.ceil(p_ceil_0_);
}
public static boolean isEmpty(String p_isEmpty_0_)
{
return StringUtils.isEmpty(p_isEmpty_0_);
}
public static long lfloor(double p_lfloor_0_)
{
return MathHelper.lfloor(p_lfloor_0_);
}
public static float sqrt(double p_sqrt_0_)
{
return MathHelper.sqrt(p_sqrt_0_);
}
public static double clamp(double p_clamp_0_, double p_clamp_2_, double p_clamp_4_)
{
return MathHelper.clamp(p_clamp_0_, p_clamp_2_, p_clamp_4_);
}
public static int getInt(String p_getInt_0_, int p_getInt_1_)
{
return MathHelper.getInt(p_getInt_0_, p_getInt_1_);
}
public static double getDouble(String p_getDouble_0_, double p_getDouble_1_)
{
return MathHelper.getDouble(p_getDouble_0_, p_getDouble_1_);
}
public static int log2(int p_log2_0_)
{
return MathHelper.log2(p_log2_0_);
}
public static int absFloor(double p_absFloor_0_)
{
return MathHelper.absFloor(p_absFloor_0_);
}
public static int smallestEncompassingPowerOfTwo(int p_smallestEncompassingPowerOfTwo_0_)
{
return MathHelper.smallestEncompassingPowerOfTwo(p_smallestEncompassingPowerOfTwo_0_);
}
public static float sqrt(float p_sqrt_0_)
{
return MathHelper.sqrt(p_sqrt_0_);
}
public static float cos(float p_cos_0_)
{
return MathHelper.cos(p_cos_0_);
}
public static int getInt(String p_getInt_0_, int p_getInt_1_, int p_getInt_2_)
{
return MathHelper.getInt(p_getInt_0_, p_getInt_1_, p_getInt_2_);
}
public static int fastFloor(double p_fastFloor_0_)
{
return MathHelper.fastFloor(p_fastFloor_0_);
}
public static double absMax(double p_absMax_0_, double p_absMax_2_)
{
return MathHelper.absMax(p_absMax_0_, p_absMax_2_);
}
public static float nextFloat(Random p_nextFloat_0_, float p_nextFloat_1_, float p_nextFloat_2_)
{
return MathHelper.nextFloat(p_nextFloat_0_, p_nextFloat_1_, p_nextFloat_2_);
}
public static double wrapDegrees(double p_wrapDegrees_0_)
{
return MathHelper.wrapDegrees(p_wrapDegrees_0_);
}
public static float wrapDegrees(float p_wrapDegrees_0_)
{
return MathHelper.wrapDegrees(p_wrapDegrees_0_);
}
public static float clamp(float p_clamp_0_, float p_clamp_1_, float p_clamp_2_)
{
return MathHelper.clamp(p_clamp_0_, p_clamp_1_, p_clamp_2_);
}
public static double getDouble(String p_getDouble_0_, double p_getDouble_1_, double p_getDouble_3_)
{
return MathHelper.getDouble(p_getDouble_0_, p_getDouble_1_, p_getDouble_3_);
}
public static int roundUp(int p_roundUp_0_, int p_roundUp_1_)
{
return MathHelper.roundUp(p_roundUp_0_, p_roundUp_1_);
}
public static double average(long[] p_average_0_)
{
return MathHelper.average(p_average_0_);
}
public static int floor(float p_floor_0_)
{
return MathHelper.floor(p_floor_0_);
}
public static int abs(int p_abs_0_)
{
return MathHelper.abs(p_abs_0_);
}
public static int nextInt(Random p_nextInt_0_, int p_nextInt_1_, int p_nextInt_2_)
{
return MathHelper.getInt(p_nextInt_0_, p_nextInt_1_, p_nextInt_2_);
}
}

View File

@@ -0,0 +1,258 @@
package net.minecraft.realms;
import com.mojang.util.UUIDTypeAdapter;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiScreenRealmsProxy;
import net.minecraft.client.resources.DefaultPlayerSkin;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsScreen
{
public static final int SKIN_HEAD_U = 8;
public static final int SKIN_HEAD_V = 8;
public static final int SKIN_HEAD_WIDTH = 8;
public static final int SKIN_HEAD_HEIGHT = 8;
public static final int SKIN_HAT_U = 40;
public static final int SKIN_HAT_V = 8;
public static final int SKIN_HAT_WIDTH = 8;
public static final int SKIN_HAT_HEIGHT = 8;
public static final int SKIN_TEX_WIDTH = 64;
public static final int SKIN_TEX_HEIGHT = 64;
protected Minecraft minecraft;
public int width;
public int height;
private final GuiScreenRealmsProxy proxy = new GuiScreenRealmsProxy(this);
public GuiScreenRealmsProxy getProxy()
{
return this.proxy;
}
public void init()
{
}
public void init(Minecraft p_init_1_, int p_init_2_, int p_init_3_)
{
}
public void drawCenteredString(String p_drawCenteredString_1_, int p_drawCenteredString_2_, int p_drawCenteredString_3_, int p_drawCenteredString_4_)
{
this.proxy.drawCenteredString(p_drawCenteredString_1_, p_drawCenteredString_2_, p_drawCenteredString_3_, p_drawCenteredString_4_);
}
public void drawString(String p_drawString_1_, int p_drawString_2_, int p_drawString_3_, int p_drawString_4_)
{
this.drawString(p_drawString_1_, p_drawString_2_, p_drawString_3_, p_drawString_4_, true);
}
public void drawString(String p_drawString_1_, int p_drawString_2_, int p_drawString_3_, int p_drawString_4_, boolean p_drawString_5_)
{
this.proxy.drawString(p_drawString_1_, p_drawString_2_, p_drawString_3_, p_drawString_4_, false);
}
public void blit(int p_blit_1_, int p_blit_2_, int p_blit_3_, int p_blit_4_, int p_blit_5_, int p_blit_6_)
{
this.proxy.drawTexturedModalRect(p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_);
}
public static void blit(int p_blit_0_, int p_blit_1_, float p_blit_2_, float p_blit_3_, int p_blit_4_, int p_blit_5_, int p_blit_6_, int p_blit_7_, float p_blit_8_, float p_blit_9_)
{
Gui.drawScaledCustomSizeModalRect(p_blit_0_, p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_, p_blit_7_, p_blit_8_, p_blit_9_);
}
public static void blit(int p_blit_0_, int p_blit_1_, float p_blit_2_, float p_blit_3_, int p_blit_4_, int p_blit_5_, float p_blit_6_, float p_blit_7_)
{
Gui.drawModalRectWithCustomSizedTexture(p_blit_0_, p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_, p_blit_7_);
}
public void fillGradient(int p_fillGradient_1_, int p_fillGradient_2_, int p_fillGradient_3_, int p_fillGradient_4_, int p_fillGradient_5_, int p_fillGradient_6_)
{
this.proxy.drawGradientRect(p_fillGradient_1_, p_fillGradient_2_, p_fillGradient_3_, p_fillGradient_4_, p_fillGradient_5_, p_fillGradient_6_);
}
public void renderBackground()
{
this.proxy.drawDefaultBackground();
}
public boolean isPauseScreen()
{
return this.proxy.doesGuiPauseGame();
}
public void renderBackground(int p_renderBackground_1_)
{
this.proxy.drawWorldBackground(p_renderBackground_1_);
}
public void render(int p_render_1_, int p_render_2_, float p_render_3_)
{
for (int i = 0; i < this.proxy.buttons().size(); ++i)
{
((RealmsButton)this.proxy.buttons().get(i)).render(p_render_1_, p_render_2_, p_render_3_);
}
}
public void renderTooltip(ItemStack p_renderTooltip_1_, int p_renderTooltip_2_, int p_renderTooltip_3_)
{
this.proxy.renderToolTip(p_renderTooltip_1_, p_renderTooltip_2_, p_renderTooltip_3_);
}
public void renderTooltip(String p_renderTooltip_1_, int p_renderTooltip_2_, int p_renderTooltip_3_)
{
this.proxy.drawHoveringText(p_renderTooltip_1_, p_renderTooltip_2_, p_renderTooltip_3_);
}
public void renderTooltip(List<String> p_renderTooltip_1_, int p_renderTooltip_2_, int p_renderTooltip_3_)
{
this.proxy.drawHoveringText(p_renderTooltip_1_, p_renderTooltip_2_, p_renderTooltip_3_);
}
public static void bindFace(String p_bindFace_0_, String p_bindFace_1_)
{
ResourceLocation resourcelocation = AbstractClientPlayer.getLocationSkin(p_bindFace_1_);
if (resourcelocation == null)
{
resourcelocation = DefaultPlayerSkin.getDefaultSkin(UUIDTypeAdapter.fromString(p_bindFace_0_));
}
AbstractClientPlayer.getDownloadImageSkin(resourcelocation, p_bindFace_1_);
Minecraft.getMinecraft().getTextureManager().bindTexture(resourcelocation);
}
public static void bind(String p_bind_0_)
{
ResourceLocation resourcelocation = new ResourceLocation(p_bind_0_);
Minecraft.getMinecraft().getTextureManager().bindTexture(resourcelocation);
}
public void tick()
{
}
public int width()
{
return this.proxy.width;
}
public int height()
{
return this.proxy.height;
}
public int fontLineHeight()
{
return this.proxy.getFontHeight();
}
public int fontWidth(String p_fontWidth_1_)
{
return this.proxy.getStringWidth(p_fontWidth_1_);
}
public void fontDrawShadow(String p_fontDrawShadow_1_, int p_fontDrawShadow_2_, int p_fontDrawShadow_3_, int p_fontDrawShadow_4_)
{
this.proxy.fontDrawShadow(p_fontDrawShadow_1_, p_fontDrawShadow_2_, p_fontDrawShadow_3_, p_fontDrawShadow_4_);
}
public List<String> fontSplit(String p_fontSplit_1_, int p_fontSplit_2_)
{
return this.proxy.fontSplit(p_fontSplit_1_, p_fontSplit_2_);
}
public void buttonClicked(RealmsButton p_buttonClicked_1_)
{
}
public static RealmsButton newButton(int p_newButton_0_, int p_newButton_1_, int p_newButton_2_, String p_newButton_3_)
{
return new RealmsButton(p_newButton_0_, p_newButton_1_, p_newButton_2_, p_newButton_3_);
}
public static RealmsButton newButton(int p_newButton_0_, int p_newButton_1_, int p_newButton_2_, int p_newButton_3_, int p_newButton_4_, String p_newButton_5_)
{
return new RealmsButton(p_newButton_0_, p_newButton_1_, p_newButton_2_, p_newButton_3_, p_newButton_4_, p_newButton_5_);
}
public void buttonsClear()
{
this.proxy.buttonsClear();
}
public void buttonsAdd(RealmsButton p_buttonsAdd_1_)
{
this.proxy.buttonsAdd(p_buttonsAdd_1_);
}
public List<RealmsButton> buttons()
{
return this.proxy.buttons();
}
public void buttonsRemove(RealmsButton p_buttonsRemove_1_)
{
this.proxy.buttonsRemove(p_buttonsRemove_1_);
}
public RealmsEditBox newEditBox(int p_newEditBox_1_, int p_newEditBox_2_, int p_newEditBox_3_, int p_newEditBox_4_, int p_newEditBox_5_)
{
return new RealmsEditBox(p_newEditBox_1_, p_newEditBox_2_, p_newEditBox_3_, p_newEditBox_4_, p_newEditBox_5_);
}
public void mouseClicked(int p_mouseClicked_1_, int p_mouseClicked_2_, int p_mouseClicked_3_)
{
}
public void mouseEvent()
{
}
public void keyboardEvent()
{
}
public void mouseReleased(int p_mouseReleased_1_, int p_mouseReleased_2_, int p_mouseReleased_3_)
{
}
public void mouseDragged(int p_mouseDragged_1_, int p_mouseDragged_2_, int p_mouseDragged_3_, long p_mouseDragged_4_)
{
}
public void keyPressed(char p_keyPressed_1_, int p_keyPressed_2_)
{
}
public void confirmResult(boolean p_confirmResult_1_, int p_confirmResult_2_)
{
}
public static String getLocalizedString(String p_getLocalizedString_0_)
{
return I18n.format(p_getLocalizedString_0_);
}
public static String getLocalizedString(String p_getLocalizedString_0_, Object... p_getLocalizedString_1_)
{
return I18n.format(p_getLocalizedString_0_, p_getLocalizedString_1_);
}
public RealmsAnvilLevelStorageSource getLevelStorageSource()
{
return new RealmsAnvilLevelStorageSource(Minecraft.getMinecraft().getSaveLoader());
}
public void removed()
{
}
}

View File

@@ -0,0 +1,92 @@
package net.minecraft.realms;
import net.minecraft.client.gui.GuiSlotRealmsProxy;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsScrolledSelectionList
{
private final GuiSlotRealmsProxy proxy;
public RealmsScrolledSelectionList(int width, int height, int top, int bottom, int slotHeight)
{
this.proxy = new GuiSlotRealmsProxy(this, width, height, top, bottom, slotHeight);
}
public void render(int p_render_1_, int p_render_2_, float p_render_3_)
{
this.proxy.drawScreen(p_render_1_, p_render_2_, p_render_3_);
}
public int width()
{
return this.proxy.getWidth();
}
public int ym()
{
return this.proxy.getMouseY();
}
public int xm()
{
return this.proxy.getMouseX();
}
protected void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, Tezzelator p_renderItem_5_, int p_renderItem_6_, int p_renderItem_7_)
{
}
public void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, int p_renderItem_5_, int p_renderItem_6_)
{
this.renderItem(p_renderItem_1_, p_renderItem_2_, p_renderItem_3_, p_renderItem_4_, Tezzelator.instance, p_renderItem_5_, p_renderItem_6_);
}
public int getItemCount()
{
return 0;
}
public void selectItem(int p_selectItem_1_, boolean p_selectItem_2_, int p_selectItem_3_, int p_selectItem_4_)
{
}
public boolean isSelectedItem(int p_isSelectedItem_1_)
{
return false;
}
public void renderBackground()
{
}
public int getMaxPosition()
{
return 0;
}
public int getScrollbarPosition()
{
return this.proxy.getWidth() / 2 + 124;
}
public void mouseEvent()
{
this.proxy.handleMouseInput();
}
public void scroll(int p_scroll_1_)
{
this.proxy.scrollBy(p_scroll_1_);
}
public int getScroll()
{
return this.proxy.getAmountScrolled();
}
protected void renderList(int p_renderList_1_, int p_renderList_2_, int p_renderList_3_, int p_renderList_4_)
{
}
}

View File

@@ -0,0 +1,34 @@
package net.minecraft.realms;
import net.minecraft.client.multiplayer.ServerAddress;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsServerAddress
{
private final String host;
private final int port;
protected RealmsServerAddress(String hostIn, int portIn)
{
this.host = hostIn;
this.port = portIn;
}
public String getHost()
{
return this.host;
}
public int getPort()
{
return this.port;
}
public static RealmsServerAddress parseString(String p_parseString_0_)
{
ServerAddress serveraddress = ServerAddress.fromString(p_parseString_0_);
return new RealmsServerAddress(serveraddress.getIP(), serveraddress.getPort());
}
}

View File

@@ -0,0 +1,14 @@
package net.minecraft.realms;
import net.minecraft.util.ChatAllowedCharacters;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsSharedConstants
{
public static int NETWORK_PROTOCOL_VERSION = 340;
public static int TICKS_PER_SECOND = 20;
public static String VERSION_STRING = "1.12.2";
public static char[] ILLEGAL_FILE_CHARACTERS = ChatAllowedCharacters.ILLEGAL_FILE_CHARACTERS;
}

View File

@@ -0,0 +1,92 @@
package net.minecraft.realms;
import net.minecraft.client.gui.GuiSimpleScrolledSelectionListProxy;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsSimpleScrolledSelectionList
{
private final GuiSimpleScrolledSelectionListProxy proxy;
public RealmsSimpleScrolledSelectionList(int width, int height, int top, int bottom, int slotHeight)
{
this.proxy = new GuiSimpleScrolledSelectionListProxy(this, width, height, top, bottom, slotHeight);
}
public void render(int p_render_1_, int p_render_2_, float p_render_3_)
{
this.proxy.drawScreen(p_render_1_, p_render_2_, p_render_3_);
}
public int width()
{
return this.proxy.getWidth();
}
public int ym()
{
return this.proxy.getMouseY();
}
public int xm()
{
return this.proxy.getMouseX();
}
protected void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, Tezzelator p_renderItem_5_, int p_renderItem_6_, int p_renderItem_7_)
{
}
public void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, int p_renderItem_5_, int p_renderItem_6_)
{
this.renderItem(p_renderItem_1_, p_renderItem_2_, p_renderItem_3_, p_renderItem_4_, Tezzelator.instance, p_renderItem_5_, p_renderItem_6_);
}
public int getItemCount()
{
return 0;
}
public void selectItem(int p_selectItem_1_, boolean p_selectItem_2_, int p_selectItem_3_, int p_selectItem_4_)
{
}
public boolean isSelectedItem(int p_isSelectedItem_1_)
{
return false;
}
public void renderBackground()
{
}
public int getMaxPosition()
{
return 0;
}
public int getScrollbarPosition()
{
return this.proxy.getWidth() / 2 + 124;
}
public void mouseEvent()
{
this.proxy.handleMouseInput();
}
public void scroll(int p_scroll_1_)
{
this.proxy.scrollBy(p_scroll_1_);
}
public int getScroll()
{
return this.proxy.getAmountScrolled();
}
protected void renderList(int p_renderList_1_, int p_renderList_2_, int p_renderList_3_, int p_renderList_4_)
{
}
}

View File

@@ -0,0 +1,107 @@
package net.minecraft.realms;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsSliderButton extends RealmsButton
{
public float value;
public boolean sliding;
private final float minValue;
private final float maxValue;
private int steps;
public RealmsSliderButton(int buttonId, int x, int y, int width, int maxValueIn, int p_i1056_6_)
{
this(buttonId, x, y, width, p_i1056_6_, 0, 1.0F, (float)maxValueIn);
}
public RealmsSliderButton(int buttonId, int x, int y, int width, int p_i1057_5_, int valueIn, float minValueIn, float maxValueIn)
{
super(buttonId, x, y, width, 20, "");
this.value = 1.0F;
this.minValue = minValueIn;
this.maxValue = maxValueIn;
this.value = this.toPct((float)valueIn);
this.getProxy().displayString = this.getMessage();
}
public String getMessage()
{
return "";
}
public float toPct(float p_toPct_1_)
{
return MathHelper.clamp((this.clamp(p_toPct_1_) - this.minValue) / (this.maxValue - this.minValue), 0.0F, 1.0F);
}
public float toValue(float p_toValue_1_)
{
return this.clamp(this.minValue + (this.maxValue - this.minValue) * MathHelper.clamp(p_toValue_1_, 0.0F, 1.0F));
}
public float clamp(float p_clamp_1_)
{
p_clamp_1_ = this.clampSteps(p_clamp_1_);
return MathHelper.clamp(p_clamp_1_, this.minValue, this.maxValue);
}
protected float clampSteps(float p_clampSteps_1_)
{
if (this.steps > 0)
{
p_clampSteps_1_ = (float)(this.steps * Math.round(p_clampSteps_1_ / (float)this.steps));
}
return p_clampSteps_1_;
}
public int getYImage(boolean p_getYImage_1_)
{
return 0;
}
public void renderBg(int p_renderBg_1_, int p_renderBg_2_)
{
if (this.getProxy().visible)
{
if (this.sliding)
{
this.value = (float)(p_renderBg_1_ - (this.getProxy().x + 4)) / (float)(this.getProxy().getButtonWidth() - 8);
this.value = MathHelper.clamp(this.value, 0.0F, 1.0F);
float f = this.toValue(this.value);
this.clicked(f);
this.value = this.toPct(f);
this.getProxy().displayString = this.getMessage();
}
Minecraft.getMinecraft().getTextureManager().bindTexture(WIDGETS_LOCATION);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.blit(this.getProxy().x + (int)(this.value * (float)(this.getProxy().getButtonWidth() - 8)), this.getProxy().y, 0, 66, 4, 20);
this.blit(this.getProxy().x + (int)(this.value * (float)(this.getProxy().getButtonWidth() - 8)) + 4, this.getProxy().y, 196, 66, 4, 20);
}
}
public void clicked(int p_clicked_1_, int p_clicked_2_)
{
this.value = (float)(p_clicked_1_ - (this.getProxy().x + 4)) / (float)(this.getProxy().getButtonWidth() - 8);
this.value = MathHelper.clamp(this.value, 0.0F, 1.0F);
this.clicked(this.toValue(this.value));
this.getProxy().displayString = this.getMessage();
this.sliding = true;
}
public void clicked(float p_clicked_1_)
{
}
public void released(int p_released_1_, int p_released_2_)
{
this.sliding = false;
}
}

View File

@@ -0,0 +1,122 @@
package net.minecraft.realms;
import com.google.common.collect.Lists;
import java.util.List;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.renderer.vertex.VertexFormatElement;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsVertexFormat
{
private VertexFormat v;
public RealmsVertexFormat(VertexFormat vIn)
{
this.v = vIn;
}
public RealmsVertexFormat from(VertexFormat p_from_1_)
{
this.v = p_from_1_;
return this;
}
public VertexFormat getVertexFormat()
{
return this.v;
}
public void clear()
{
this.v.clear();
}
public int getUvOffset(int p_getUvOffset_1_)
{
return this.v.getUvOffsetById(p_getUvOffset_1_);
}
public int getElementCount()
{
return this.v.getElementCount();
}
public boolean hasColor()
{
return this.v.hasColor();
}
public boolean hasUv(int p_hasUv_1_)
{
return this.v.hasUvOffset(p_hasUv_1_);
}
public RealmsVertexFormatElement getElement(int p_getElement_1_)
{
return new RealmsVertexFormatElement(this.v.getElement(p_getElement_1_));
}
public RealmsVertexFormat addElement(RealmsVertexFormatElement p_addElement_1_)
{
return this.from(this.v.addElement(p_addElement_1_.getVertexFormatElement()));
}
public int getColorOffset()
{
return this.v.getColorOffset();
}
public List<RealmsVertexFormatElement> getElements()
{
List<RealmsVertexFormatElement> list = Lists.<RealmsVertexFormatElement>newArrayList();
for (VertexFormatElement vertexformatelement : this.v.getElements())
{
list.add(new RealmsVertexFormatElement(vertexformatelement));
}
return list;
}
public boolean hasNormal()
{
return this.v.hasNormal();
}
public int getVertexSize()
{
return this.v.getNextOffset();
}
public int getOffset(int p_getOffset_1_)
{
return this.v.getOffset(p_getOffset_1_);
}
public int getNormalOffset()
{
return this.v.getNormalOffset();
}
public int getIntegerSize()
{
return this.v.getIntegerSize();
}
public boolean equals(Object p_equals_1_)
{
return this.v.equals(p_equals_1_);
}
public int hashCode()
{
return this.v.hashCode();
}
public String toString()
{
return this.v.toString();
}
}

View File

@@ -0,0 +1,56 @@
package net.minecraft.realms;
import net.minecraft.client.renderer.vertex.VertexFormatElement;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RealmsVertexFormatElement
{
private final VertexFormatElement v;
public RealmsVertexFormatElement(VertexFormatElement vIn)
{
this.v = vIn;
}
public VertexFormatElement getVertexFormatElement()
{
return this.v;
}
public boolean isPosition()
{
return this.v.isPositionElement();
}
public int getIndex()
{
return this.v.getIndex();
}
public int getByteSize()
{
return this.v.getSize();
}
public int getCount()
{
return this.v.getElementCount();
}
public int hashCode()
{
return this.v.hashCode();
}
public boolean equals(Object p_equals_1_)
{
return this.v.equals(p_equals_1_);
}
public String toString()
{
return this.v.toString();
}
}

View File

@@ -0,0 +1,64 @@
package net.minecraft.realms;
import net.minecraft.client.renderer.Tessellator;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class Tezzelator
{
public static Tessellator t = Tessellator.getInstance();
public static final Tezzelator instance = new Tezzelator();
public void end()
{
t.draw();
}
public Tezzelator vertex(double p_vertex_1_, double p_vertex_3_, double p_vertex_5_)
{
t.getBuffer().pos(p_vertex_1_, p_vertex_3_, p_vertex_5_);
return this;
}
public void color(float p_color_1_, float p_color_2_, float p_color_3_, float p_color_4_)
{
t.getBuffer().color(p_color_1_, p_color_2_, p_color_3_, p_color_4_);
}
public void tex2(short p_tex2_1_, short p_tex2_2_)
{
t.getBuffer().lightmap(p_tex2_1_, p_tex2_2_);
}
public void normal(float p_normal_1_, float p_normal_2_, float p_normal_3_)
{
t.getBuffer().normal(p_normal_1_, p_normal_2_, p_normal_3_);
}
public void begin(int p_begin_1_, RealmsVertexFormat p_begin_2_)
{
t.getBuffer().begin(p_begin_1_, p_begin_2_.getVertexFormat());
}
public void endVertex()
{
t.getBuffer().endVertex();
}
public void offset(double p_offset_1_, double p_offset_3_, double p_offset_5_)
{
t.getBuffer().setTranslation(p_offset_1_, p_offset_3_, p_offset_5_);
}
public RealmsBufferBuilder color(int p_color_1_, int p_color_2_, int p_color_3_, int p_color_4_)
{
return new RealmsBufferBuilder(t.getBuffer().color(p_color_1_, p_color_2_, p_color_3_, p_color_4_));
}
public Tezzelator tex(double p_tex_1_, double p_tex_3_)
{
t.getBuffer().tex(p_tex_1_, p_tex_3_);
return this;
}
}

View File

@@ -0,0 +1,7 @@
// Auto generated package-info by MCP
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package net.minecraft.realms;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;