Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add 1.11

  • Loading branch information...
ComputerBaer committed Jan 1, 2017
1 parent ccd1eb3 commit b8b7cc28a08825e9f1b40bb48f2f54c6928374c4
Showing with 1,692 additions and 1 deletion.
  1. +483 −0 RewiMod-Forge1.11/Licenses/LICENSE-new.txt
  2. +10 −0 RewiMod-Forge1.11/Licenses/Paulscode IBXM Library License.txt
  3. +40 −0 RewiMod-Forge1.11/Licenses/Paulscode SoundSystem CodecIBXM License.txt
  4. +13 −0 RewiMod-Forge1.11/build.gradle
  5. +116 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/RewiForgeMod.java
  6. +32 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/event/LanguageChangedEvent.java
  7. +106 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/gui/GuiRewiIngameMenu.java
  8. +65 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/gui/GuiRewiIngameOverlay.java
  9. +44 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/gui/GuiRewiLanguage.java
  10. +76 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/gui/GuiRewiMainMenu.java
  11. +46 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/gui/GuiRewiReportScreen.java
  12. +47 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/gui/objects/GuiRewiConnectButton.java
  13. +49 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/gui/objects/GuiRewiModButton.java
  14. +38 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/gui/objects/GuiRewiReportsButton.java
  15. +49 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/gui/objects/GuiTwitterButton.java
  16. +48 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/gui/objects/GuiYoutubeButton.java
  17. +36 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/handlers/FontRendererObjHandler.java
  18. +56 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/handlers/GlStateManagerHandler.java
  19. +38 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/handlers/GuiHandler.java
  20. +48 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/handlers/TextureHandler.java
  21. +40 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/listener/ChatListener.java
  22. +44 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/listener/ConnectListener.java
  23. +51 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/listener/GuiListener.java
  24. +33 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/listener/LanguageListener.java
  25. +37 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/listener/RenderListener.java
  26. +46 −0 RewiMod-Forge1.11/src/main/java/tv/rewinside/rewimod/forge/util/ServerDataUpdater.java
  27. +1 −1 settings.gradle

Large diffs are not rendered by default.

@@ -0,0 +1,10 @@
IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@@ -0,0 +1,40 @@
SoundSystem CodecIBXM Class License:

You are free to use this class for any purpose, commercial or otherwise.
You may modify this class or source code, and distribute it any way you
like, provided the following conditions are met:

1) You may not falsely claim to be the author of this class or any
unmodified portion of it.
2) You may not copyright this class or a modified version of it and then
sue me for copyright infringement.
3) If you modify the source code, you must clearly document the changes
made before redistributing the modified source code, so other users know
it is not the original code.
4) You are not required to give me credit for this class in any derived
work, but if you do, you must also mention my website:
http://www.paulscode.com
5) I the author will not be responsible for any damages (physical,
financial, or otherwise) caused by the use if this class or any
portion of it.
6) I the author do not guarantee, warrant, or make any representations,
either expressed or implied, regarding the use of this class or any
portion of it.

Author: Paul Lamb
http://www.paulscode.com


This software is based on or using the IBXM library available from
http://www.geocities.com/sunet2000/


IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,13 @@
ext.simpleVersion = "0.1.0"
version = "${ext.simpleVersion}-${rootProject.ext.gitCommitHash}"

minecraft {
version = "1.11-13.19.1.2189"
mappings = "snapshot_20161111"
runDir = "../run"

replaceIn "/tv/rewinside/rewimod/forge/RewiForgeMod.java"
replace "%MOD_ID%", rootProject.name.toLowerCase()
replace "%MOD_NAME%", rootProject.name
replace "%MOD_VERSION%", project.ext.simpleVersion
}
@@ -0,0 +1,116 @@
/*
* RewiMod, a Minecraft Client Enhancement
* Copyright (C) rewinside.tv <https://rewinside.tv/>
* Copyright (C) RewiMod team and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package tv.rewinside.rewimod.forge;

import java.awt.Point;
import java.net.UnknownHostException;
import lombok.Getter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.network.ServerPinger;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.FMLClientHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLFingerprintViolationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import org.lwjgl.opengl.Display;
import tv.rewinside.rewimod.core.RewiMod;
import tv.rewinside.rewimod.core.gui.ButtonFactory;
import tv.rewinside.rewimod.forge.handlers.FontRendererObjHandler;
import tv.rewinside.rewimod.forge.handlers.GlStateManagerHandler;
import tv.rewinside.rewimod.forge.handlers.GuiHandler;
import tv.rewinside.rewimod.forge.handlers.TextureHandler;
import tv.rewinside.rewimod.forge.listener.ChatListener;
import tv.rewinside.rewimod.forge.listener.ConnectListener;
import tv.rewinside.rewimod.forge.listener.GuiListener;
import tv.rewinside.rewimod.forge.listener.LanguageListener;
import tv.rewinside.rewimod.forge.listener.RenderListener;

@Mod(modid = "%MOD_ID%", name = "%MOD_NAME%", version = "%MOD_VERSION%", canBeDeactivated = RewiMod.DEACTIVATEABLE, certificateFingerprint = RewiMod.FINGERPRINT)
public class RewiForgeMod extends RewiMod {

@Getter private final FontRendererObjHandler fontRendererObjHandler = new FontRendererObjHandler();
@Getter private final TextureHandler textureHandler = new TextureHandler();
@Getter private final GuiHandler guiHandler = new GuiHandler();
@Getter private final GlStateManagerHandler glStateManagerHandler = new GlStateManagerHandler();
@Getter private final ButtonFactory defaultButtonFactory = new ButtonFactory("textures/gui/widgets.png", 200, 20, new Point(0, 46), new Point(0, 66), new Point(0, 86));

@Getter private final ServerPinger pinger = new ServerPinger();

@EventHandler
public void init(FMLInitializationEvent event) {
super.initialize(
Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode(),
Minecraft.getMinecraft().getVersion(),
Minecraft.getMinecraft().getSession().getPlayerID(),
Minecraft.getMinecraft().getSession().getUsername()
);
}

@Mod.EventHandler
public void onFingerprintViolation(FMLFingerprintViolationEvent event) {
super.onFingerprintViolation();
}

@Override
protected void registerEvents() {
MinecraftForge.EVENT_BUS.register(new GuiListener());
MinecraftForge.EVENT_BUS.register(new ChatListener());
MinecraftForge.EVENT_BUS.register(new ConnectListener());
MinecraftForge.EVENT_BUS.register(new RenderListener());
MinecraftForge.EVENT_BUS.register(new LanguageListener());
}

@Override
public void connectToServer(String name, String host, int port, boolean isLan) {
FMLClientHandler.instance().setupServerList();
ServerData data = new ServerData(name == null ? host : name, host + ":" + port, isLan);

try {
this.pinger.ping(data);
} catch (UnknownHostException ex) {
LOGGER.warn("Tried to connect to an unknown host!", ex);
return;
}

FMLClientHandler.instance().connectToServer(Minecraft.getMinecraft().currentScreen, data);
}

@Override
public String getModId() {
return "%MOD_ID%";
}

@Override
public String getName() {
return "%MOD_NAME%";
}

@Override
public String getVersion() {
return "%MOD_VERSION%";
}

@Override
public void setDisplayTitle(String displayTitle) {
Display.setTitle(displayTitle);
}

}
@@ -0,0 +1,32 @@
/*
* RewiMod, a Minecraft Client Enhancement
* Copyright (C) rewinside.tv <https://rewinside.tv/>
* Copyright (C) RewiMod team and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package tv.rewinside.rewimod.forge.event;

import lombok.Getter;
import net.minecraftforge.fml.common.eventhandler.Event;

public class LanguageChangedEvent extends Event {

@Getter private final String locale;

public LanguageChangedEvent(String locale) {
this.locale = locale;
}

}
@@ -0,0 +1,106 @@
/*
* RewiMod, a Minecraft Client Enhancement
* Copyright (C) rewinside.tv <https://rewinside.tv/>
* Copyright (C) RewiMod team and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package tv.rewinside.rewimod.forge.gui;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiIngameMenu;
import net.minecraft.util.text.TextFormatting;
import tv.rewinside.rewimod.core.RewiMod;
import tv.rewinside.rewimod.core.gui.CoreGuiDrawer;
import tv.rewinside.rewimod.core.gui.objects.IGuiButton;
import tv.rewinside.rewimod.core.util.CoordinateUtil;
import tv.rewinside.rewimod.forge.gui.objects.GuiRewiReportsButton;

public class GuiRewiIngameMenu extends GuiIngameMenu {

private final Map<Integer, IGuiButton> buttons = new HashMap<>();

@Override
public void initGui() {
this.buttons.clear();
super.initGui();

int lastId = super.buttonList.size();

lastId += 100; //Mojang Nailed it

int reportX, reportY, reportWidth;

GuiButton shareToLan = super.buttonList.get(4);
if (!shareToLan.enabled) {
shareToLan.visible = false;

reportX = shareToLan.xPosition;
reportY = shareToLan.yPosition;
reportWidth = shareToLan.width;
} else {
reportX = this.width / 2 + 2;
reportY = this.height / 4 + 56;
reportWidth = 98;

shareToLan.width = reportWidth;
}

super.buttonList.add(this.registerButton(new GuiRewiReportsButton(lastId + 2, reportX, reportY, reportWidth)));
}

@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);

CoreGuiDrawer.drawTransparentString("" + TextFormatting.GRAY + "RewiMod Alpha", this.width - this.mc.fontRendererObj.getStringWidth("RewiMod Alpha") - 4, this.height - 10, 60, false);
}

@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
super.mouseClicked(mouseX, mouseY, mouseButton);

for (Map.Entry entry : this.buttons.entrySet()) {
GuiButton guiButton = (GuiButton) entry.getValue();

if (CoordinateUtil.inbetween(guiButton.xPosition, guiButton.yPosition, mouseX, mouseY, guiButton.width, guiButton.height)) {
((IGuiButton) guiButton).onClick(mouseButton);
}
}
}

@Override
protected void actionPerformed(GuiButton button) throws IOException {
String confirmMessage = RewiMod.getInstance().getMessages().getMessage("gui.confirmDisconnect");

if (button.id == 1 && !button.displayString.equals(confirmMessage)) {
button.displayString = confirmMessage;
button.packedFGColour = RewiMod.getInstance().getConfirmDisconnectButtonColor();
return;
}

super.actionPerformed(button);
}

private GuiButton registerButton(IGuiButton button) {
GuiButton btn = (GuiButton) button;
this.buttons.put(btn.id, button);

return btn;
}

}
@@ -0,0 +1,65 @@
/*
* RewiMod, a Minecraft Client Enhancement
* Copyright (C) rewinside.tv <https://rewinside.tv/>
* Copyright (C) RewiMod team and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package tv.rewinside.rewimod.forge.gui;

import java.text.SimpleDateFormat;
import java.util.Date;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.util.text.TextFormatting;
import tv.rewinside.rewimod.core.RewiMod;

public class GuiRewiIngameOverlay extends Gui {

private final Minecraft mc;
private final int fontHeight;
private final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");

private final TextFormatting text = TextFormatting.DARK_PURPLE;
private final TextFormatting colon = TextFormatting.DARK_GRAY;
private final TextFormatting value = TextFormatting.GOLD;

private long oldPing = -1;

public GuiRewiIngameOverlay() {
this.mc = Minecraft.getMinecraft();
this.fontHeight = this.mc.fontRendererObj.FONT_HEIGHT;
}

public void drawOverlay() {
String timeText = RewiMod.getInstance().getMessages().getMessage("gui.overlay.time");
ServerData serverData = this.mc.getCurrentServerData();
long ping = serverData != null ? serverData.pingToServer : -1;

super.drawString(this.mc.fontRendererObj, this.text + "FPS" + this.colon + ": " + this.value + Minecraft.getDebugFPS(), 5, this.fontHeight / 2 + 1, 0xF);
super.drawString(this.mc.fontRendererObj, this.text + timeText + this.colon + ": " + this.value + this.dateFormat.format(new Date(System.currentTimeMillis())), 5, this.fontHeight + 5, 0xF);
super.drawString(this.mc.fontRendererObj, this.text + "X" + this.colon + ": " + this.value + Math.round(this.mc.thePlayer.posX * 100d) / 100d, 5, this.fontHeight * 2 + 5, 0xF);
super.drawString(this.mc.fontRendererObj, this.text + "Y" + this.colon + ": " + this.value + Math.round(this.mc.thePlayer.posY * 100d) / 100d, 5, this.fontHeight * 3 + 5, 0xF);
super.drawString(this.mc.fontRendererObj, this.text + "Z" + this.colon + ": " + this.value + Math.round(this.mc.thePlayer.posZ * 100d) / 100d, 5, this.fontHeight * 4 + 5, 0xF);
if (!Minecraft.getMinecraft().isSingleplayer()) {
super.drawString(this.mc.fontRendererObj, this.text + "Ping" + this.colon + ": " + this.value + (ping != -1 ? ping : this.oldPing != -1 ? this.oldPing : ".."), 5, this.fontHeight * 5 + 5, 0xF);
}

if (ping != -1) {
this.oldPing = ping;
}
}

}

0 comments on commit b8b7cc2

Please sign in to comment.
You can’t perform that action at this time.