-
Автор темы
- #1
Не судите строго я недавно в кодинге написан на туториал клиенте
Java:
public Watermark() {
super("Watermark", Keyboard.KEY_NONE, Category.DISPLAY);
ArrayList<String> options = new ArrayList<>();
ExampleMod.instance.settingsManager.rSetting(new Setting("Server", this, false));
ExampleMod.instance.settingsManager.rSetting(new Setting("Fps", this, false));
ExampleMod.instance.settingsManager.rSetting(new Setting("Time", this, false));
}
@SubscribeEvent
public void onRender(RenderGameOverlayEvent.Post e) {
switch (e.getType()) {
case TEXT:
if (!Panic.isPanic) {
int y = -5;
final int[] counter = {1};
String server;
Minecraft mc = Minecraft.getMinecraft();
FontRenderer fr = mc.fontRenderer;
ScaledResolution sr = new ScaledResolution(mc);
int posY = 9;
try {
if (mc.isSingleplayer()) {
server = "localhost";
} else {
server = mc.getCurrentServerData().serverIP.toLowerCase();
}
String username = System.getProperty("user.name");
boolean set2 = ExampleMod.instance.settingsManager.getSettingByName(this.name, "Fps").getValBoolean();
boolean set3 = ExampleMod.instance.settingsManager.getSettingByName(this.name, "Time").getValBoolean();
boolean set4 = ExampleMod.instance.settingsManager.getSettingByName(this.name, "Server").getValBoolean();
String time = (new SimpleDateFormat("HH:mm:ss")).format(Calendar.getInstance().getTime());
String text = Client.cName + (set4 ? "§8 | §f" + server : "") + (set2 ? " §8 | " + "§f fps: " + Minecraft.getDebugFPS() : "") + (set3 ?" §8 | §f " + time : "");
RenderUtils.drawRectWithGlow(6, 6, (int) FontUtils.normal.getStringWidth(text) + 15, 21, 6, 10, new Color(0xFF000000, true));
FontUtils.normal.drawString(text, 10, 11, -1);
} catch (Exception ex) {
}
}
}
}
@Override
public void onUpdate(RenderGameOverlayEvent e) {
}
}
Вложения
-
20 KB Просмотры: 897