mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-24 05:54:41 +00:00
Initial patch update to 1.12.
Some things to note: Netty is screwy so currently can't join single player. @cpw Crafting has been MAJORY reworked. The current GameRegistry functions are nooped, this is IN THE WORKS. Just need to move the recipe list to a full class registry, and then re implement the in-code recipe registration. Also, it IS advised that modders move to JSON, because ideally we'll see a S->C recipe syncing system in 1.13 which would allow servers to have custom recipes. OreDictionary currently 1/2 works, need to write a better algorithm for replacing ingredients. Please be patient Rendering: A lot of functions got a new float parameter, this is similar to partial ticks, needs more research
This commit is contained in:
1 parent
286777b824
commit
f1cca475ea
342 files changed
+3878
-2936
No files matched your search
@@ -119,7 +119,7 @@ import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.Display;
|
||||
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.common.collect.BiMap;
|
||||
@@ -332,7 +332,8 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
{
|
||||
SplashProgress.finish();
|
||||
client.displayCrashReport(new CrashReport(message, t));
|
||||
throw Throwables.propagate(t);
|
||||
Throwables.throwIfUnchecked(t);
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
|
||||
public boolean hasError()
|
||||
@@ -990,7 +991,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
if (badType == null)
|
||||
{
|
||||
badType = Sets.newHashSet();
|
||||
brokenTextures.put(resourceLocation.getResourceDomain(), Objects.firstNonNull(error, "Unknown error"), badType);
|
||||
brokenTextures.put(resourceLocation.getResourceDomain(), MoreObjects.firstNonNull(error, "Unknown error"), badType);
|
||||
}
|
||||
badType.add(resourceLocation);
|
||||
}
|
||||
|
||||
@@ -41,16 +41,16 @@ import net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElem
|
||||
import net.minecraftforge.fml.client.config.DummyConfigElement.DummyListElement;
|
||||
import net.minecraftforge.fml.client.config.GuiConfigEntries.NumberSliderEntry;
|
||||
|
||||
public class FMLConfigGuiFactory implements IModGuiFactory
|
||||
public class FMLConfigGuiFactory implements IModGuiFactory
|
||||
{
|
||||
public static class FMLConfigGuiScreen extends GuiConfig
|
||||
public static class FMLConfigGuiScreen extends GuiConfig
|
||||
{
|
||||
|
||||
public FMLConfigGuiScreen(GuiScreen parent)
|
||||
{
|
||||
super(parent, getConfigElements(), "FML", false, false, I18n.format("fml.config.sample.title"));
|
||||
}
|
||||
|
||||
|
||||
private static List<IConfigElement> getConfigElements()
|
||||
{
|
||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||
@@ -58,13 +58,13 @@ public class FMLConfigGuiFactory implements IModGuiFactory
|
||||
List<IConfigElement> stringsList = new ArrayList<IConfigElement>();
|
||||
List<IConfigElement> numbersList = new ArrayList<IConfigElement>();
|
||||
Pattern commaDelimitedPattern = Pattern.compile("([A-Za-z]+((,){1}( )*|$))+?");
|
||||
|
||||
|
||||
// Top Level Settings
|
||||
list.add(new DummyConfigElement("imABoolean", true, ConfigGuiType.BOOLEAN, "fml.config.sample.imABoolean").setRequiresMcRestart(true));
|
||||
list.add(new DummyConfigElement("imAnInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.imAnInteger", -1, 256).setRequiresMcRestart(true));
|
||||
list.add(new DummyConfigElement("imADouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.imADouble", -1.0D, 256.256D).setRequiresMcRestart(true));
|
||||
list.add(new DummyConfigElement("imAString", "http://www.montypython.net/scripts/string.php", ConfigGuiType.STRING, "fml.config.sample.imAString").setRequiresMcRestart(true));
|
||||
|
||||
|
||||
// Lists category
|
||||
listsList.add(new DummyListElement("booleanList", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanList"));
|
||||
listsList.add(new DummyListElement("booleanListFixed", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanListFixed", true));
|
||||
@@ -84,16 +84,16 @@ public class FMLConfigGuiFactory implements IModGuiFactory
|
||||
listsList.add(new DummyListElement("stringListCustom", new Object[0], ConfigGuiType.STRING, "fml.config.sample.stringListCustom").setArrayEntryClass(CustomArrayEntry.class));
|
||||
|
||||
list.add(new DummyCategoryElement("lists", "fml.config.sample.ctgy.lists", listsList));
|
||||
|
||||
|
||||
// Strings category
|
||||
stringsList.add(new DummyConfigElement("basicString", "Just a regular String value, anything goes.", ConfigGuiType.STRING, "fml.config.sample.basicString"));
|
||||
stringsList.add(new DummyConfigElement("cycleString", "this", ConfigGuiType.STRING, "fml.config.sample.cycleString", new String[] {"this", "property", "cycles", "through", "a", "list", "of", "valid", "choices"}));
|
||||
stringsList.add(new DummyConfigElement("patternString", "only, comma, separated, words, can, be, entered, in, this, box", ConfigGuiType.STRING, "fml.config.sample.patternString", commaDelimitedPattern));
|
||||
stringsList.add(new DummyConfigElement("chatColorPicker", "c", ConfigGuiType.COLOR, "fml.config.sample.chatColorPicker", new String[] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"}));
|
||||
stringsList.add(new DummyConfigElement("modIDSelector", "FML", ConfigGuiType.MOD_ID, "fml.config.sample.modIDSelector"));
|
||||
|
||||
|
||||
list.add(new DummyCategoryElement("strings", "fml.config.sample.ctgy.strings", stringsList));
|
||||
|
||||
|
||||
// Numbers category
|
||||
numbersList.add((new DummyConfigElement("basicInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.basicInteger")));
|
||||
numbersList.add((new DummyConfigElement("boundedInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.boundedInteger", -1, 256)));
|
||||
@@ -103,11 +103,11 @@ public class FMLConfigGuiFactory implements IModGuiFactory
|
||||
numbersList.add(new DummyConfigElement("sliderDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.sliderDouble", -1.0D, 256.256D).setCustomListEntryClass(NumberSliderEntry.class));
|
||||
|
||||
list.add(new DummyCategoryElement("numbers", "fml.config.sample.ctgy.numbers", numbersList));
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasConfigGui()
|
||||
@@ -123,10 +123,10 @@ public class FMLConfigGuiFactory implements IModGuiFactory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
|
||||
public void func_192634_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partial)
|
||||
{
|
||||
textFieldValue.setTextColor((int) (Math.random() * 0xFFFFFF));
|
||||
super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
|
||||
super.func_192634_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected, partial);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public class FMLConfigGuiFactory implements IModGuiFactory
|
||||
{
|
||||
return new FMLConfigGuiScreen(parentScreen);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiScreen> mainConfigGuiClass()
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ public class GuiErrorBase extends GuiErrorScreen
|
||||
{
|
||||
for(GuiButton button : buttonList)
|
||||
{
|
||||
button.drawButton(this.mc, mouseX, mouseY);
|
||||
button.func_191745_a(this.mc, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.gui.GuiUtilRenderComponents;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
@@ -283,7 +283,7 @@ public class GuiModList extends GuiScreen
|
||||
{
|
||||
IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(selectedMod);
|
||||
GuiScreen newScreen = null;
|
||||
try
|
||||
try
|
||||
{
|
||||
newScreen = guiFactory.createConfigGui(this);
|
||||
}
|
||||
@@ -564,7 +564,7 @@ public class GuiModList extends GuiScreen
|
||||
{
|
||||
GlStateManager.enableBlend();
|
||||
GuiModList.this.mc.renderEngine.bindTexture(logoPath);
|
||||
VertexBuffer wr = tess.getBuffer();
|
||||
BufferBuilder wr = tess.getBuffer();
|
||||
int offset = (this.left + this.listWidth/2) - (logoDims.width / 2);
|
||||
wr.begin(7, DefaultVertexFormats.POSITION_TEX);
|
||||
wr.pos(offset, top + logoDims.height, zLevel).tex(0, 1).endVertex();
|
||||
|
||||
@@ -61,7 +61,7 @@ public class GuiOldSaveLoadConfirm extends GuiYesNo implements GuiYesNoCallback
|
||||
|
||||
for (k = 0; k < this.buttonList.size(); ++k)
|
||||
{
|
||||
this.buttonList.get(k).drawButton(this.mc, mouseX, mouseY);
|
||||
this.buttonList.get(k).func_191745_a(this.mc, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
for (k = 0; k < this.labelList.size(); ++k)
|
||||
|
||||
@@ -23,9 +23,9 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -276,7 +276,7 @@ public abstract class GuiScrollingList
|
||||
this.applyScrollLimits();
|
||||
|
||||
Tessellator tess = Tessellator.getInstance();
|
||||
VertexBuffer worldr = tess.getBuffer();
|
||||
BufferBuilder worldr = tess.getBuffer();
|
||||
|
||||
ScaledResolution res = new ScaledResolution(client);
|
||||
double scaleW = client.displayWidth / res.getScaledWidth_double();
|
||||
@@ -403,12 +403,12 @@ public abstract class GuiScrollingList
|
||||
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
GlStateManager.shadeModel(GL11.GL_SMOOTH);
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
VertexBuffer VertexBuffer = tessellator.getBuffer();
|
||||
VertexBuffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||
VertexBuffer.pos(right, top, 0.0D).color(r1, g1, b1, a1).endVertex();
|
||||
VertexBuffer.pos(left, top, 0.0D).color(r1, g1, b1, a1).endVertex();
|
||||
VertexBuffer.pos(left, bottom, 0.0D).color(r2, g2, b2, a2).endVertex();
|
||||
VertexBuffer.pos(right, bottom, 0.0D).color(r2, g2, b2, a2).endVertex();
|
||||
BufferBuilder buffer = tessellator.getBuffer();
|
||||
buffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||
buffer.pos(right, top, 0.0D).color(r1, g1, b1, a1).endVertex();
|
||||
buffer.pos(left, top, 0.0D).color(r1, g1, b1, a1).endVertex();
|
||||
buffer.pos(left, bottom, 0.0D).color(r2, g2, b2, a2).endVertex();
|
||||
buffer.pos(right, bottom, 0.0D).color(r2, g2, b2, a2).endVertex();
|
||||
tessellator.draw();
|
||||
GlStateManager.shadeModel(GL11.GL_FLAT);
|
||||
GlStateManager.disableBlend();
|
||||
|
||||
@@ -48,7 +48,7 @@ public class GuiButtonExt extends GuiButton
|
||||
* Draws this button to the screen.
|
||||
*/
|
||||
@Override
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY)
|
||||
public void func_191745_a(Minecraft mc, int mouseX, int mouseY, float partial)
|
||||
{
|
||||
if (this.visible)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ public class GuiCheckBox extends GuiButton
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY)
|
||||
public void func_191745_a(Minecraft mc, int mouseX, int mouseY, float partial)
|
||||
{
|
||||
if (this.visible)
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
{
|
||||
super(mc, parent.width, parent.height, parent.titleLine2 != null ? 33 : 23, parent.height - 32, 20);
|
||||
this.owningScreen = parent;
|
||||
this.setShowSelectionBox(false);
|
||||
this.func_193651_b(false);
|
||||
this.mc = mc;
|
||||
this.listEntries = new ArrayList<IConfigEntry>();
|
||||
|
||||
@@ -562,10 +562,10 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
|
||||
public void func_192634_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partial)
|
||||
{
|
||||
this.btnValue.packedFGColour = GuiUtils.getColorCode(this.configElement.getValidValues()[currentIndex].charAt(0), true);
|
||||
super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
|
||||
super.func_192634_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected, partial);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -910,14 +910,14 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
public abstract void valueButtonPressed(int slotIndex);
|
||||
|
||||
@Override
|
||||
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
|
||||
public void func_192634_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partial)
|
||||
{
|
||||
super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
|
||||
super.func_192634_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected, partial);
|
||||
this.btnValue.width = this.owningEntryList.controlWidth;
|
||||
this.btnValue.xPosition = this.owningScreen.entryList.controlX;
|
||||
this.btnValue.yPosition = y;
|
||||
this.btnValue.enabled = enabled();
|
||||
this.btnValue.drawButton(this.mc, mouseX, mouseY);
|
||||
this.btnValue.func_191745_a(this.mc, mouseX, mouseY, partial);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1190,9 +1190,9 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
|
||||
public void func_192634_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partial)
|
||||
{
|
||||
super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
|
||||
super.func_192634_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected, partial);
|
||||
this.textFieldValue.xPosition = this.owningEntryList.controlX + 2;
|
||||
this.textFieldValue.yPosition = y + 1;
|
||||
this.textFieldValue.width = this.owningEntryList.controlWidth - 4;
|
||||
@@ -1326,14 +1326,14 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
|
||||
public void func_192634_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partial)
|
||||
{
|
||||
this.btnSelectCategory.xPosition = listWidth / 2 - 150;
|
||||
this.btnSelectCategory.yPosition = y;
|
||||
this.btnSelectCategory.enabled = enabled();
|
||||
this.btnSelectCategory.drawButton(this.mc, mouseX, mouseY);
|
||||
this.btnSelectCategory.func_191745_a(this.mc, mouseX, mouseY, partial);
|
||||
|
||||
super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
|
||||
super.func_192634_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected, partial);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1526,7 +1526,7 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
|
||||
public void func_192634_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partial)
|
||||
{
|
||||
boolean isChanged = isChanged();
|
||||
|
||||
@@ -1545,12 +1545,12 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
this.btnUndoChanges.xPosition = this.owningEntryList.scrollBarX - 44;
|
||||
this.btnUndoChanges.yPosition = y;
|
||||
this.btnUndoChanges.enabled = enabled() && isChanged;
|
||||
this.btnUndoChanges.drawButton(this.mc, mouseX, mouseY);
|
||||
this.btnUndoChanges.func_191745_a(this.mc, mouseX, mouseY, partial);
|
||||
|
||||
this.btnDefault.xPosition = this.owningEntryList.scrollBarX - 22;
|
||||
this.btnDefault.yPosition = y;
|
||||
this.btnDefault.enabled = enabled() && !isDefault();
|
||||
this.btnDefault.drawButton(this.mc, mouseX, mouseY);
|
||||
this.btnDefault.func_191745_a(this.mc, mouseX, mouseY, partial);
|
||||
|
||||
if (this.tooltipHoverChecker == null)
|
||||
this.tooltipHoverChecker = new HoverChecker(y, y + slotHeight, x, this.owningScreen.entryList.controlX - 8, 800);
|
||||
@@ -1624,7 +1624,7 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
public abstract boolean saveConfigElement();
|
||||
|
||||
@Override
|
||||
public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_){}
|
||||
public void func_192633_a(int p_178011_1_, int p_178011_2_, int p_178011_3_, float partial){}
|
||||
|
||||
@Override
|
||||
public boolean enabled()
|
||||
@@ -1674,7 +1674,7 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
int tagStartPosition = tagStartPosition = target.indexOf(tagStart);
|
||||
int tagEndPosition = tagEndPosition = target.indexOf(tagEnd, tagStartPosition + tagStart.length());
|
||||
|
||||
if (-1 == tagStartPosition || -1 == tagEndPosition)
|
||||
if (-1 == tagStartPosition || -1 == tagEndPosition)
|
||||
return target;
|
||||
|
||||
String taglessResult = target.substring(0, tagStartPosition);
|
||||
|
||||
@@ -60,7 +60,7 @@ public class GuiEditArrayEntries extends GuiListExtended
|
||||
this.configElement = configElement;
|
||||
this.beforeValues = beforeValues;
|
||||
this.currentValues = currentValues;
|
||||
this.setShowSelectionBox(false);
|
||||
this.func_193651_b(false);
|
||||
this.isChanged = !Arrays.deepEquals(beforeValues, currentValues);
|
||||
this.isDefault = Arrays.deepEquals(currentValues, configElement.getDefaults());
|
||||
this.canAddMoreEntries = !configElement.isListLengthFixed() && (configElement.getMaxListLength() == -1 || currentValues.length < configElement.getMaxListLength());
|
||||
@@ -450,9 +450,9 @@ public class GuiEditArrayEntries extends GuiListExtended
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
|
||||
public void func_192634_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partial)
|
||||
{
|
||||
super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
|
||||
super.func_192634_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected, partial);
|
||||
if (configElement.isListLengthFixed() || slotIndex != owningEntryList.listEntries.size() - 1)
|
||||
{
|
||||
this.textFieldValue.setVisible(true);
|
||||
@@ -516,9 +516,9 @@ public class GuiEditArrayEntries extends GuiListExtended
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
|
||||
public void func_192634_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partial)
|
||||
{
|
||||
super.drawEntry(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected);
|
||||
super.func_192634_a(slotIndex, x, y, listWidth, slotHeight, mouseX, mouseY, isSelected, partial);
|
||||
this.btnValue.xPosition = listWidth / 4;
|
||||
this.btnValue.yPosition = y;
|
||||
|
||||
@@ -529,7 +529,7 @@ public class GuiEditArrayEntries extends GuiListExtended
|
||||
this.btnValue.displayString = String.valueOf(value);
|
||||
btnValue.packedFGColour = value ? GuiUtils.getColorCode('2', true) : GuiUtils.getColorCode('4', true);
|
||||
|
||||
this.btnValue.drawButton(owningEntryList.getMC(), mouseX, mouseY);
|
||||
this.btnValue.func_191745_a(owningEntryList.getMC(), mouseX, mouseY, partial);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -593,7 +593,7 @@ public class GuiEditArrayEntries extends GuiListExtended
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
|
||||
public void func_192634_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partial)
|
||||
{
|
||||
if (this.getValue() != null && this.isValidated)
|
||||
owningEntryList.getMC().fontRendererObj.drawString(
|
||||
@@ -608,7 +608,7 @@ public class GuiEditArrayEntries extends GuiListExtended
|
||||
this.btnAddNewEntryAbove.visible = true;
|
||||
this.btnAddNewEntryAbove.xPosition = half + ((half / 2) - 44);
|
||||
this.btnAddNewEntryAbove.yPosition = y;
|
||||
this.btnAddNewEntryAbove.drawButton(owningEntryList.getMC(), mouseX, mouseY);
|
||||
this.btnAddNewEntryAbove.func_191745_a(owningEntryList.getMC(), mouseX, mouseY, partial);
|
||||
}
|
||||
else
|
||||
this.btnAddNewEntryAbove.visible = false;
|
||||
@@ -618,7 +618,7 @@ public class GuiEditArrayEntries extends GuiListExtended
|
||||
this.btnRemoveEntry.visible = true;
|
||||
this.btnRemoveEntry.xPosition = half + ((half / 2) - 22);
|
||||
this.btnRemoveEntry.yPosition = y;
|
||||
this.btnRemoveEntry.drawButton(owningEntryList.getMC(), mouseX, mouseY);
|
||||
this.btnRemoveEntry.func_191745_a(owningEntryList.getMC(), mouseX, mouseY, partial);
|
||||
}
|
||||
else
|
||||
this.btnRemoveEntry.visible = false;
|
||||
@@ -687,7 +687,7 @@ public class GuiEditArrayEntries extends GuiListExtended
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_){}
|
||||
public void func_192633_a(int p_178011_1_, int p_178011_2_, int p_178011_3_, float partial){}
|
||||
}
|
||||
|
||||
public static interface IArrayEntry extends GuiListExtended.IGuiListEntry
|
||||
|
||||
@@ -54,7 +54,7 @@ public class GuiSelectStringEntries extends GuiListExtended
|
||||
this.mc = mc;
|
||||
this.configElement = configElement;
|
||||
this.selectableValues = selectableValues;
|
||||
this.setShowSelectionBox(true);
|
||||
this.func_193651_b(true);
|
||||
|
||||
listEntries = new ArrayList<IGuiSelectStringListEntry>();
|
||||
|
||||
@@ -173,7 +173,7 @@ public class GuiSelectStringEntries extends GuiListExtended
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
|
||||
public void func_192634_a(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partial)
|
||||
{
|
||||
owningList.mc.fontRendererObj.drawString(value.getValue(), x + 1, y, slotIndex == owningList.selectedIndex ? 16777215 : 14737632);
|
||||
}
|
||||
@@ -195,7 +195,7 @@ public class GuiSelectStringEntries extends GuiListExtended
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_){}
|
||||
public void func_192633_a(int p_192633_1_, int p_192633_2_, int p_192633_3_, float p_192633_4_){}
|
||||
}
|
||||
|
||||
public static interface IGuiSelectStringListEntry extends GuiListExtended.IGuiListEntry
|
||||
|
||||
@@ -41,7 +41,7 @@ public class GuiUnicodeGlyphButton extends GuiButtonExt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY)
|
||||
public void func_191745_a(Minecraft mc, int mouseX, int mouseY, float partial)
|
||||
{
|
||||
if (this.visible)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -201,7 +201,7 @@ public class GuiUtils
|
||||
float uScale = 1f / 0x100;
|
||||
float vScale = 1f / 0x100;
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
VertexBuffer wr = tessellator.getBuffer();
|
||||
BufferBuilder wr = tessellator.getBuffer();
|
||||
wr.begin(7, DefaultVertexFormats.POSITION_TEX);
|
||||
wr.pos(x , y + height, zLevel).tex( u * uScale, ((v + height) * vScale)).endVertex();
|
||||
wr.pos(x + width, y + height, zLevel).tex((u + width) * uScale, ((v + height) * vScale)).endVertex();
|
||||
@@ -215,14 +215,14 @@ public class GuiUtils
|
||||
|
||||
/**
|
||||
* Must be called from {@code GuiScreen.renderToolTip} before {@code GuiScreen.drawHoveringText} is called.
|
||||
*
|
||||
*
|
||||
* @param stack The stack for which a tooltip is about to be drawn.
|
||||
*/
|
||||
public static void preItemToolTip(@Nonnull ItemStack stack)
|
||||
{
|
||||
cachedTooltipStack = stack;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Must be called from {@code GuiScreen.renderToolTip} after {@code GuiScreen.drawHoveringText} is called.
|
||||
*/
|
||||
@@ -250,10 +250,10 @@ public class GuiUtils
|
||||
{
|
||||
drawHoveringText(cachedTooltipStack, textLines, mouseX, mouseY, screenWidth, screenHeight, maxTextWidth, font);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Use this version if calling from somewhere where ItemStack context is available.
|
||||
*
|
||||
*
|
||||
* @see #drawHoveringText(List, int, int, int, int, int, FontRenderer)
|
||||
*/
|
||||
public static void drawHoveringText(@Nonnull final ItemStack stack, List<String> textLines, int mouseX, int mouseY, int screenWidth, int screenHeight, int maxTextWidth, FontRenderer font)
|
||||
@@ -270,7 +270,7 @@ public class GuiUtils
|
||||
screenHeight = event.getScreenHeight();
|
||||
maxTextWidth = event.getMaxWidth();
|
||||
font = event.getFontRenderer();
|
||||
|
||||
|
||||
GlStateManager.disableRescaleNormal();
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.disableLighting();
|
||||
@@ -382,7 +382,7 @@ public class GuiUtils
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new RenderTooltipEvent.PostBackground(stack, textLines, tooltipX, tooltipY, font, tooltipTextWidth, tooltipHeight));
|
||||
int tooltipTop = tooltipY;
|
||||
|
||||
|
||||
for (int lineNumber = 0; lineNumber < textLines.size(); ++lineNumber)
|
||||
{
|
||||
String line = textLines.get(lineNumber);
|
||||
@@ -423,12 +423,12 @@ public class GuiUtils
|
||||
GlStateManager.shadeModel(7425);
|
||||
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
VertexBuffer vertexbuffer = tessellator.getBuffer();
|
||||
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||
vertexbuffer.pos(right, top, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex();
|
||||
vertexbuffer.pos(left, top, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex();
|
||||
vertexbuffer.pos(left, bottom, zLevel).color(endRed, endGreen, endBlue, endAlpha).endVertex();
|
||||
vertexbuffer.pos(right, bottom, zLevel).color(endRed, endGreen, endBlue, endAlpha).endVertex();
|
||||
BufferBuilder buffer = tessellator.getBuffer();
|
||||
buffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||
buffer.pos(right, top, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex();
|
||||
buffer.pos(left, top, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex();
|
||||
buffer.pos(left, bottom, zLevel).color(endRed, endGreen, endBlue, endAlpha).endVertex();
|
||||
buffer.pos(right, bottom, zLevel).color(endRed, endGreen, endBlue, endAlpha).endVertex();
|
||||
tessellator.draw();
|
||||
|
||||
GlStateManager.shadeModel(7424);
|
||||
|
||||
@@ -22,8 +22,8 @@ package net.minecraftforge.fml.common;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkGenerator;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.IChunkGenerator;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.apache.logging.log4j.Level;
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.Type;
|
||||
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -98,7 +99,7 @@ public class ASMModParser
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return Objects.toStringHelper("ASMAnnotationDiscoverer")
|
||||
return MoreObjects.toStringHelper("ASMAnnotationDiscoverer")
|
||||
.add("className", asmType.getClassName())
|
||||
.add("classVersion", classVersion)
|
||||
.add("superName", asmSuperType.getClassName())
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraftforge.fml.common.discovery.asm.ASMModParser.AnnotationType;
|
||||
|
||||
import org.objectweb.asm.Type;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
@@ -74,7 +74,7 @@ public class ModAnnotation
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return Objects.toStringHelper("Annotation")
|
||||
return MoreObjects.toStringHelper("Annotation")
|
||||
.add("type",type)
|
||||
.add("name",asmType.getClassName())
|
||||
.add("member",member)
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ import org.apache.logging.log4j.Level;
|
||||
|
||||
// TODO build test suites to validate the behaviour of this stuff and make it less annoyingly magical
|
||||
public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet<?>> implements ChannelOutboundHandler {
|
||||
private static boolean DEBUG_HANDSHAKE = Boolean.parseBoolean(System.getProperty("fml.debugNetworkHandshake", "false"));
|
||||
private static boolean DEBUG_HANDSHAKE = Boolean.parseBoolean(System.getProperty("fml.debugNetworkHandshake", "true"));
|
||||
private static enum ConnectionState {
|
||||
OPENING, AWAITING_HANDSHAKE, HANDSHAKING, HANDSHAKECOMPLETE, FINALIZING, CONNECTED;
|
||||
}
|
||||
|
||||
@@ -54,8 +54,6 @@ import net.minecraftforge.fml.common.registry.EntityRegistry.EntityRegistration;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.apache.logging.log4j.core.helpers.Integers;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
@@ -64,8 +62,8 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class FMLNetworkHandler
|
||||
{
|
||||
public static final int READ_TIMEOUT = Integers.parseInt(System.getProperty("fml.readTimeout","30"),30);
|
||||
public static final int LOGIN_TIMEOUT = Integers.parseInt(System.getProperty("fml.loginTimeout","600"),600);
|
||||
public static final int READ_TIMEOUT = Integer.parseInt(System.getProperty("fml.readTimeout","30"));
|
||||
public static final int LOGIN_TIMEOUT = Integer.parseInt(System.getProperty("fml.loginTimeout","600"));
|
||||
private static EnumMap<Side, FMLEmbeddedChannel> channelPair;
|
||||
|
||||
public static void fmlServerHandshake(PlayerList scm, NetworkManager manager, EntityPlayerMP player)
|
||||
|
||||
@@ -41,7 +41,6 @@ import net.minecraftforge.fml.common.network.handshake.NetworkDispatcher;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.core.helpers.Integers;
|
||||
|
||||
import com.google.common.collect.ConcurrentHashMultiset;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -58,7 +57,7 @@ public class FMLProxyPacket implements Packet<INetHandler> {
|
||||
private INetHandler netHandler;
|
||||
private NetworkDispatcher dispatcher;
|
||||
private static Multiset<String> badPackets = ConcurrentHashMultiset.create();
|
||||
private static int packetCountWarning = Integers.parseInt(System.getProperty("fml.badPacketCounter", "100"), 100);
|
||||
private static int packetCountWarning = Integer.parseInt(System.getProperty("fml.badPacketCounter", "100"));
|
||||
|
||||
public FMLProxyPacket(SPacketCustomPayload original)
|
||||
{
|
||||
|
||||
@@ -43,6 +43,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.nbt.JsonToNBT;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTException;
|
||||
@@ -51,8 +52,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkGenerator;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.IChunkGenerator;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.IFuelHandler;
|
||||
import net.minecraftforge.fml.common.IWorldGenerator;
|
||||
@@ -272,24 +273,25 @@ public class GameRegistry
|
||||
GameData.getMain().registerSubstitutionAlias(nameToSubstitute, type, object);
|
||||
}
|
||||
|
||||
public static void addRecipe(@Nonnull ItemStack output, Object... params)
|
||||
@Deprecated //TODO Make IRecipe a registry
|
||||
public static IRecipe addShapedRecipe(ResourceLocation name, @Nonnull ItemStack output, Object... params)
|
||||
{
|
||||
addShapedRecipe(output, params);
|
||||
throw new RuntimeException("TODO: Forge implement IRecipe registry");
|
||||
//return CraftingManager.addRecipe(output, params);
|
||||
}
|
||||
|
||||
public static IRecipe addShapedRecipe(@Nonnull ItemStack output, Object... params)
|
||||
@Deprecated //TODO Make IRecipe a registry
|
||||
public static void addShapelessRecipe(ResourceLocation name, @Nonnull ItemStack output, Ingredient... params)
|
||||
{
|
||||
return CraftingManager.getInstance().addRecipe(output, params);
|
||||
throw new RuntimeException("TODO: Forge implement IRecipe registry");
|
||||
//CraftingManager.getInstance().addShapelessRecipe(output, params);
|
||||
}
|
||||
|
||||
public static void addShapelessRecipe(@Nonnull ItemStack output, Object... params)
|
||||
@Deprecated //TODO Make IRecipe a registry
|
||||
public static void addRecipe(ResourceLocation name, IRecipe recipe)
|
||||
{
|
||||
CraftingManager.getInstance().addShapelessRecipe(output, params);
|
||||
}
|
||||
|
||||
public static void addRecipe(IRecipe recipe)
|
||||
{
|
||||
CraftingManager.getInstance().getRecipeList().add(recipe);
|
||||
throw new RuntimeException("TODO: Forge implement IRecipe registry");
|
||||
//CraftingManager.getInstance().getRecipeList().add(recipe);
|
||||
}
|
||||
|
||||
public static void addSmelting(Block input, @Nonnull ItemStack output, float xp)
|
||||
|
||||
Reference in new issue
Block a user