Some additional fixes from other branch.
This commit is contained in:
@@ -35,6 +35,10 @@ import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Stopwatch;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.inventory.container.ClickType;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -194,7 +198,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
final int right = left + slot.getWidth();
|
||||
final int bottom = top + slot.getHeight();
|
||||
|
||||
slot.drawContent( this.mc, mouseX, mouseY, partialTicks );
|
||||
slot.drawContent( this.minecraft, mouseX, mouseY, partialTicks );
|
||||
|
||||
if( this.isPointInRegion( left, top, slot.getWidth(), slot.getHeight(), mouseX, mouseY ) && slot.canClick( this.mc.player ) )
|
||||
{
|
||||
|
||||
@@ -23,8 +23,8 @@ import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.client.gui;
|
||||
|
||||
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
|
||||
|
||||
public class GuiNull extends AEBaseGui
|
||||
|
||||
@@ -8,7 +8,7 @@ import javax.annotation.Nullable;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
||||
@@ -22,7 +22,7 @@ package appeng.client.gui.config;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraftforge.common.config.ConfigCategory;
|
||||
import net.minecraftforge.common.config.ConfigElement;
|
||||
import net.minecraftforge.fml.client.config.GuiConfig;
|
||||
@@ -35,7 +35,7 @@ import appeng.core.AppEng;
|
||||
public class AEConfigGui extends GuiConfig
|
||||
{
|
||||
|
||||
public AEConfigGui( final GuiScreen parent )
|
||||
public AEConfigGui( final Screen parent )
|
||||
{
|
||||
super( parent, getConfigElements(), AppEng.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath( AEConfig.instance().getFilePath() ) );
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ package appeng.client.gui.config;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraftforge.fml.client.IModGuiFactory;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public class AEConfigGuiFactory implements IModGuiFactory
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an initialized {@link GuiScreen}. This screen will be displayed
|
||||
* Return an initialized {@link Screen}. This screen will be displayed
|
||||
* when the "config" button is pressed in the mod list. It will
|
||||
* have a single argument constructor - the "parent" screen, the same as all
|
||||
* Minecraft GUIs. The expected behaviour is that this screen will replace the
|
||||
@@ -67,7 +67,7 @@ public class AEConfigGuiFactory implements IModGuiFactory
|
||||
* or null if no GUI is desired.
|
||||
*/
|
||||
@Override
|
||||
public GuiScreen createConfigGui( GuiScreen parentScreen )
|
||||
public Screen createConfigGui(Screen parentScreen )
|
||||
{
|
||||
return new AEConfigGui( parentScreen );
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
this.amountToCraft.setMaxStringLength( 16 );
|
||||
this.amountToCraft.setTextColor( 0xFFFFFF );
|
||||
this.amountToCraft.setVisible( true );
|
||||
this.amountToCraft.setFocused( true );
|
||||
this.amountToCraft.setFocused2( true );
|
||||
this.amountToCraft.setText( "1" );
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
this.searchField.setMaxStringLength( 25 );
|
||||
this.searchField.setTextColor( 0xFFFFFF );
|
||||
this.searchField.setVisible( true );
|
||||
this.searchField.setFocused( true );
|
||||
this.searchField.setFocused2( true );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -231,7 +231,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
for( int x = 0; x < current.getInventory().getSlots(); x++ )
|
||||
{
|
||||
final String which = Integer.toString( x );
|
||||
if( invData.hasKey( which ) )
|
||||
if( invData.contains(which) )
|
||||
{
|
||||
current.getInventory().setStackInSlot( x, new ItemStack( invData.getCompoundTag( which ) ) );
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
||||
this.level.setMaxStringLength( 16 );
|
||||
this.level.setTextColor( 0xFFFFFF );
|
||||
this.level.setVisible( true );
|
||||
this.level.setFocused( true );
|
||||
this.level.setFocused2( true );
|
||||
( (ContainerLevelEmitter) this.inventorySlots ).setTextField( this.level );
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ public class GuiPriority extends AEBaseGui
|
||||
this.priority.setMaxStringLength( 16 );
|
||||
this.priority.setTextColor( 0xFFFFFF );
|
||||
this.priority.setVisible( true );
|
||||
this.priority.setFocused( true );
|
||||
this.priority.setFocused2( true );
|
||||
( (ContainerPriority) this.inventorySlots ).setTextField( this.priority );
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public class GuiQuartzKnife extends AEBaseGui
|
||||
this.name.setMaxStringLength( 32 );
|
||||
this.name.setTextColor( 0xFFFFFF );
|
||||
this.name.setVisible( true );
|
||||
this.name.setFocused( true );
|
||||
this.name.setFocused2( true );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,10 +24,10 @@ import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.ActionItems;
|
||||
@@ -52,7 +52,7 @@ import appeng.api.config.YesNo;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
|
||||
|
||||
public class GuiImgButton extends GuiButton implements ITooltip
|
||||
public class GuiImgButton extends Button implements ITooltip
|
||||
{
|
||||
private static final Pattern COMPILE = Pattern.compile( "%s" );
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile( "\\n", Pattern.LITERAL );
|
||||
@@ -298,8 +298,8 @@ public class GuiImgButton extends GuiButton implements ITooltip
|
||||
|
||||
if( displayName != null )
|
||||
{
|
||||
String name = I18n.translateToLocal( displayName );
|
||||
String value = I18n.translateToLocal( displayValue );
|
||||
String name = I18n.format( displayName );
|
||||
String value = I18n.format( displayValue );
|
||||
|
||||
if( name == null || name.isEmpty() )
|
||||
{
|
||||
|
||||
@@ -20,10 +20,10 @@ package appeng.client.gui.widgets;
|
||||
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
|
||||
|
||||
public class GuiNumberBox extends GuiTextField
|
||||
public class GuiNumberBox extends TextFieldWidget
|
||||
{
|
||||
|
||||
private final Class type;
|
||||
|
||||
@@ -20,14 +20,14 @@ package appeng.client.gui.widgets;
|
||||
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.container.interfaces.IProgressProvider;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
|
||||
public class GuiProgressBar extends GuiButton implements ITooltip
|
||||
public class GuiProgressBar extends Button implements ITooltip
|
||||
{
|
||||
|
||||
private final IProgressProvider source;
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.client.gui.widgets;
|
||||
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.RenderItem;
|
||||
@@ -28,7 +28,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
|
||||
public class GuiTabButton extends GuiButton implements ITooltip
|
||||
public class GuiTabButton extends Button implements ITooltip
|
||||
{
|
||||
private final RenderItem itemRenderer;
|
||||
private final String message;
|
||||
|
||||
@@ -22,13 +22,13 @@ package appeng.client.gui.widgets;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
||||
|
||||
public class GuiToggleButton extends GuiButton implements ITooltip
|
||||
public class GuiToggleButton extends Button implements ITooltip
|
||||
{
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile( "\\n", Pattern.LITERAL );
|
||||
private final int iconIdxOn;
|
||||
@@ -87,8 +87,8 @@ public class GuiToggleButton extends GuiButton implements ITooltip
|
||||
{
|
||||
if( this.displayName != null )
|
||||
{
|
||||
String name = I18n.translateToLocal( this.displayName );
|
||||
String value = I18n.translateToLocal( this.displayHint );
|
||||
String name = I18n.format( this.displayName );
|
||||
String value = I18n.format( this.displayHint );
|
||||
|
||||
if( name == null || name.isEmpty() )
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.client.gui.widgets;
|
||||
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -35,7 +35,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
*
|
||||
* The rendering does pay attention to the size of the '_' caret.
|
||||
*/
|
||||
public class MEGuiTextField extends GuiTextField
|
||||
public class MEGuiTextField extends TextFieldWidget
|
||||
{
|
||||
private static final int PADDING = 2;
|
||||
|
||||
@@ -75,7 +75,7 @@ public class MEGuiTextField extends GuiTextField
|
||||
final boolean requiresFocus = this.isMouseIn( xPos, yPos );
|
||||
if( !this.isFocused() )
|
||||
{
|
||||
this.setFocused( requiresFocus );
|
||||
this.setFocused2( requiresFocus );
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user