Some additional fixes from other branch.
This commit is contained in:
@@ -2,12 +2,11 @@
|
||||
package appeng.client;
|
||||
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
public enum ActionKey
|
||||
{
|
||||
TOGGLE_FOCUS( Keyboard.KEY_TAB );
|
||||
TOGGLE_FOCUS( GLFW.GLFW_KEY_TAB );
|
||||
|
||||
private final int defaultKey;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.client.me;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
|
||||
@@ -45,10 +45,10 @@ public class ClientDCInternalInv implements Comparable<ClientDCInternalInv>
|
||||
|
||||
public String getName()
|
||||
{
|
||||
final String s = I18n.translateToLocal( this.unlocalizedName + ".name" );
|
||||
final String s = I18n.format( this.unlocalizedName + ".name" );
|
||||
if( s.equals( this.unlocalizedName + ".name" ) )
|
||||
{
|
||||
return I18n.translateToLocal( this.unlocalizedName );
|
||||
return I18n.format( this.unlocalizedName );
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ import appeng.core.AEConfig;
|
||||
import appeng.fluids.util.FluidSorters;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.prioritylist.IPartitionList;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
|
||||
/**
|
||||
@@ -132,11 +133,11 @@ public class FluidRepo
|
||||
|
||||
if( terminalSearchToolTips && notDone && !searchMod )
|
||||
{
|
||||
final List<String> tooltip = Platform.getTooltip( fs );
|
||||
final List<ITextComponent> tooltip = Platform.getTooltip( fs );
|
||||
|
||||
for( final String line : tooltip )
|
||||
for( final ITextComponent line : tooltip )
|
||||
{
|
||||
if( m.matcher( line ).find() )
|
||||
if( m.matcher( line.getString() ).find() )
|
||||
{
|
||||
foundMatchingFluidStack = true;
|
||||
break;
|
||||
|
||||
@@ -45,6 +45,7 @@ import appeng.items.storage.ItemViewCell;
|
||||
import appeng.util.ItemSorters;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.prioritylist.IPartitionList;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
|
||||
public class ItemRepo
|
||||
@@ -180,11 +181,11 @@ public class ItemRepo
|
||||
|
||||
if( terminalSearchToolTips && notDone && !searchMod )
|
||||
{
|
||||
final List<String> tooltip = Platform.getTooltip( is );
|
||||
final List<ITextComponent> tooltip = Platform.getTooltip( is );
|
||||
|
||||
for( final String line : tooltip )
|
||||
for( final ITextComponent line : tooltip )
|
||||
{
|
||||
if( m.matcher( line ).find() )
|
||||
if( m.matcher( line.getString() ).find() )
|
||||
{
|
||||
foundMatchingItemStack = true;
|
||||
notDone = false;
|
||||
|
||||
@@ -40,7 +40,7 @@ import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ItemLayerModel;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.Random;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
@@ -55,7 +55,7 @@ public class SpatialSkyRender extends IRenderHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render( final float partialTicks, final WorldClient world, final Minecraft mc )
|
||||
public void render(final float partialTicks, final ClientWorld world, final Minecraft mc )
|
||||
{
|
||||
|
||||
final long now = System.currentTimeMillis();
|
||||
|
||||
@@ -46,7 +46,7 @@ public class TesrRenderHelper
|
||||
*/
|
||||
public static void moveToFace( Direction face )
|
||||
{
|
||||
GlStateManager.translate( face.getFrontOffsetX() * 0.50, face.getFrontOffsetY() * 0.50, face.getFrontOffsetZ() * 0.50 );
|
||||
GlStateManager.translate( face.getXOffset() * 0.50, face.getYOffset() * 0.50, face.getZOffset() * 0.50 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -434,7 +434,7 @@ public class CubeBuilder
|
||||
builder.put( i, x, y, z );
|
||||
break;
|
||||
case NORMAL:
|
||||
builder.put( i, face.getFrontOffsetX(), face.getFrontOffsetY(), face.getFrontOffsetZ() );
|
||||
builder.put( i, face.getXOffset(), face.getYOffset(), face.getZOffset() );
|
||||
break;
|
||||
case COLOR:
|
||||
// Color format is RGBA
|
||||
|
||||
@@ -222,7 +222,7 @@ class ItemEncodedPatternBakedModel implements IBakedModel
|
||||
@Override
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, LivingEntity entity )
|
||||
{
|
||||
boolean shiftHeld = Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) || Keyboard.isKeyDown( Keyboard.KEY_RSHIFT );
|
||||
boolean shiftHeld = Keyboard.isKeyDown( GLFW.GLFW_KEY_LSHIFT ) || Keyboard.isKeyDown( GLFW.GLFW_KEY_RSHIFT );
|
||||
if( shiftHeld )
|
||||
{
|
||||
ItemEncodedPattern iep = (ItemEncodedPattern) stack.getItem();
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -48,8 +51,8 @@ public class AssemblerFX extends Particle implements ICanDie
|
||||
this.speed = speed;
|
||||
final ItemStack displayItem = is.asItemStackRepresentation();
|
||||
this.fi = new EntityFloatingItem( this, w, x, y, z, displayItem );
|
||||
w.spawnEntity( this.fi );
|
||||
this.particleMaxAge = (int) Math.ceil( Math.max( 1, 100.0f / speed ) ) + 2;
|
||||
w.addEntity( this.fi );
|
||||
this.maxAge = (int) Math.ceil( Math.max( 1, 100.0f / speed ) ) + 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,13 +69,13 @@ public class AssemblerFX extends Particle implements ICanDie
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
public void tick()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if( this.particleAge++ >= this.particleMaxAge )
|
||||
if( this.age++ >= this.maxAge )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
@@ -85,19 +88,25 @@ public class AssemblerFX extends Particle implements ICanDie
|
||||
|
||||
if( this.isExpired )
|
||||
{
|
||||
this.fi.setDead();
|
||||
this.fi.remove();
|
||||
}
|
||||
else
|
||||
{
|
||||
final float lifeSpan = (float) this.particleAge / (float) this.particleMaxAge;
|
||||
final float lifeSpan = (float) this.age / (float) this.maxAge;
|
||||
this.fi.setProgress( lifeSpan );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( final BufferBuilder par1Tessellator, final Entity p_180434_2_, final float l, final float rX, final float rY, final float rZ, final float rYZ, final float rXY )
|
||||
public IParticleRenderType getRenderType() {
|
||||
// TODO: FIXME
|
||||
return IParticleRenderType.NO_RENDER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( IVertexBuilder buffer, ActiveRenderInfo renderInfo, float partialTicks )
|
||||
{
|
||||
this.time += l;
|
||||
this.time += partialTicks;
|
||||
if( this.time > 4.0 )
|
||||
{
|
||||
this.time -= 4.0;
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
|
||||
import net.minecraft.client.particle.ParticleRedstone;
|
||||
import net.minecraft.client.particle.RedstoneParticle;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
public class ChargedOreFX extends ParticleRedstone
|
||||
public class ChargedOreFX extends RedstoneParticle
|
||||
{
|
||||
|
||||
public ChargedOreFX( final World w, final double x, final double y, final double z, final float r, final float g, final float b )
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
|
||||
import net.minecraft.client.particle.ParticleBreaking;
|
||||
import net.minecraft.client.particle.BreakingParticle;
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -34,7 +35,7 @@ import appeng.client.render.textures.ParticleTextures;
|
||||
|
||||
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public class CraftingFx extends ParticleBreaking
|
||||
public class CraftingFx extends BreakingParticle
|
||||
{
|
||||
|
||||
private final TextureAtlasSprite particleTextureIndex;
|
||||
@@ -53,11 +54,11 @@ public class CraftingFx extends ParticleBreaking
|
||||
this.particleAlpha = 1.3f;
|
||||
this.particleScale = 1.5f;
|
||||
this.particleTextureIndex = ParticleTextures.BlockEnergyParticle;
|
||||
this.particleMaxAge /= 1.2;
|
||||
this.maxAge /= 1.2;
|
||||
|
||||
this.startBlkX = MathHelper.floor( this.posX );
|
||||
this.startBlkY = MathHelper.floor( this.posY );
|
||||
this.startBlkZ = MathHelper.floor( this.posZ );
|
||||
this.startBlkX = MathHelper.floor( this.getPosX() );
|
||||
this.startBlkY = MathHelper.floor( this.getPosY() );
|
||||
this.startBlkZ = MathHelper.floor( this.getPosZ() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,6 +67,12 @@ public class CraftingFx extends ParticleBreaking
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IParticleRenderType getRenderType() {
|
||||
// TODO: FIXME
|
||||
return IParticleRenderType.NO_RENDER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( final BufferBuilder par1Tessellator, final Entity p_180434_2_, final float partialTick, final float x, final float y, final float z, final float rx, final float rz )
|
||||
{
|
||||
@@ -80,9 +87,9 @@ public class CraftingFx extends ParticleBreaking
|
||||
final float f9 = this.particleTextureIndex.getMaxV();
|
||||
final float scale = 0.1F * this.particleScale;
|
||||
|
||||
float offX = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * partialTick );
|
||||
float offY = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * partialTick );
|
||||
float offZ = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * partialTick );
|
||||
float offX = (float) ( this.prevPosX + ( this.getPosX() - this.prevPosX ) * partialTick );
|
||||
float offY = (float) ( this.prevPosY + ( this.getPosY() - this.prevPosY ) * partialTick );
|
||||
float offZ = (float) ( this.prevPosZ + ( this.getPosZ() - this.prevPosZ ) * partialTick );
|
||||
|
||||
final int blkX = MathHelper.floor( offX );
|
||||
final int blkY = MathHelper.floor( offY );
|
||||
@@ -124,20 +131,20 @@ public class CraftingFx extends ParticleBreaking
|
||||
|
||||
public void fromItem( final AEPartLocation d )
|
||||
{
|
||||
this.posX += 0.2 * d.xOffset;
|
||||
this.posY += 0.2 * d.yOffset;
|
||||
this.posZ += 0.2 * d.zOffset;
|
||||
this.getPosX() += 0.2 * d.xOffset;
|
||||
this.getPosY() += 0.2 * d.yOffset;
|
||||
this.getPosZ() += 0.2 * d.zOffset;
|
||||
this.particleScale *= 0.8f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
public void tick()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.prevPosX = this.getPosX();
|
||||
this.prevPosY = this.getPosY();
|
||||
this.prevPosZ = this.getPosZ();
|
||||
|
||||
if( this.particleAge++ >= this.particleMaxAge )
|
||||
if( this.age++ >= this.maxAge )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
|
||||
import net.minecraft.client.particle.ParticleBreaking;
|
||||
import net.minecraft.client.particle.BreakingParticle;
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -34,7 +35,7 @@ import appeng.client.render.textures.ParticleTextures;
|
||||
|
||||
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public class EnergyFx extends ParticleBreaking
|
||||
public class EnergyFx extends BreakingParticle
|
||||
{
|
||||
|
||||
private final TextureAtlasSprite particleTextureIndex;
|
||||
@@ -54,9 +55,9 @@ public class EnergyFx extends ParticleBreaking
|
||||
this.particleScale = 3.5f;
|
||||
this.particleTextureIndex = ParticleTextures.BlockEnergyParticle;
|
||||
|
||||
this.startBlkX = MathHelper.floor( this.posX );
|
||||
this.startBlkY = MathHelper.floor( this.posY );
|
||||
this.startBlkZ = MathHelper.floor( this.posZ );
|
||||
this.startBlkX = MathHelper.floor( this.getPosX() );
|
||||
this.startBlkY = MathHelper.floor( this.getPosY() );
|
||||
this.startBlkZ = MathHelper.floor( this.getPosZ() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,6 +66,12 @@ public class EnergyFx extends ParticleBreaking
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IParticleRenderType getRenderType() {
|
||||
// TODO: FIXME
|
||||
return IParticleRenderType.NO_RENDER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( final BufferBuilder par1Tessellator, final Entity p_180434_2_, final float partialTicks, final float par3, final float par4, final float par5, final float par6, final float par7 )
|
||||
{
|
||||
@@ -74,13 +81,13 @@ public class EnergyFx extends ParticleBreaking
|
||||
final float f9 = this.particleTextureIndex.getMaxV();
|
||||
final float f10 = 0.1F * this.particleScale;
|
||||
|
||||
final float f11 = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * partialTicks - interpPosX );
|
||||
final float f12 = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * partialTicks - interpPosY );
|
||||
final float f13 = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * partialTicks - interpPosZ );
|
||||
final float f11 = (float) ( this.prevPosX + ( this.getPosX() - this.prevPosX ) * partialTicks - interpPosX );
|
||||
final float f12 = (float) ( this.prevPosY + ( this.getPosY() - this.prevPosY ) * partialTicks - interpPosY );
|
||||
final float f13 = (float) ( this.prevPosZ + ( this.getPosZ() - this.prevPosZ ) * partialTicks - interpPosZ );
|
||||
|
||||
final int blkX = MathHelper.floor( this.posX );
|
||||
final int blkY = MathHelper.floor( this.posY );
|
||||
final int blkZ = MathHelper.floor( this.posZ );
|
||||
final int blkX = MathHelper.floor( this.getPosX() );
|
||||
final int blkY = MathHelper.floor( this.getPosY() );
|
||||
final int blkZ = MathHelper.floor( this.getPosZ() );
|
||||
|
||||
if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ )
|
||||
{
|
||||
@@ -114,20 +121,20 @@ public class EnergyFx extends ParticleBreaking
|
||||
|
||||
public void fromItem( final AEPartLocation d )
|
||||
{
|
||||
this.posX += 0.2 * d.xOffset;
|
||||
this.posY += 0.2 * d.yOffset;
|
||||
this.posZ += 0.2 * d.zOffset;
|
||||
this.getPosX() += 0.2 * d.xOffset;
|
||||
this.getPosY() += 0.2 * d.yOffset;
|
||||
this.getPosZ() += 0.2 * d.zOffset;
|
||||
this.particleScale *= 0.8f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
public void tick()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.prevPosX = this.getPosX();
|
||||
this.prevPosY = this.getPosY();
|
||||
this.prevPosZ = this.getPosZ();
|
||||
|
||||
if( this.particleAge++ >= this.particleMaxAge )
|
||||
if( this.age++ >= this.maxAge )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.client.render.effects;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -55,7 +56,7 @@ public class LightningFX extends Particle
|
||||
this.motionX = 0;
|
||||
this.motionY = 0;
|
||||
this.motionZ = 0;
|
||||
this.particleMaxAge = maxAge;
|
||||
this.maxAge = maxAge;
|
||||
}
|
||||
|
||||
protected void regen()
|
||||
@@ -77,13 +78,19 @@ public class LightningFX extends Particle
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
public IParticleRenderType getRenderType() {
|
||||
// TODO: FIXME
|
||||
return IParticleRenderType.NO_RENDER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if( this.particleAge++ >= this.particleMaxAge )
|
||||
if( this.age++ >= this.maxAge )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
@@ -104,7 +111,7 @@ public class LightningFX extends Particle
|
||||
float blue = this.particleBlue * j;
|
||||
final float alpha = this.particleAlpha;
|
||||
|
||||
if( this.particleAge == 3 )
|
||||
if( this.age == 3 )
|
||||
{
|
||||
this.regen();
|
||||
}
|
||||
@@ -157,9 +164,9 @@ public class LightningFX extends Particle
|
||||
{
|
||||
this.clear();
|
||||
|
||||
double x = ( this.prevPosX + ( this.posX - this.prevPosX ) * l - interpPosX ) - offX;
|
||||
double y = ( this.prevPosY + ( this.posY - this.prevPosY ) * l - interpPosY ) - offY;
|
||||
double z = ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * l - interpPosZ ) - offZ;
|
||||
double x = ( this.prevPosX + ( this.getPosX() - this.prevPosX ) * l - interpPosX ) - offX;
|
||||
double y = ( this.prevPosY + ( this.getPosY() - this.prevPosY ) * l - interpPosY ) - offY;
|
||||
double z = ( this.prevPosZ + ( this.getPosZ() - this.prevPosZ ) * l - interpPosZ ) - offZ;
|
||||
|
||||
for( int s = 0; s < LightningFX.STEPS; s++ )
|
||||
{
|
||||
|
||||
@@ -19,23 +19,24 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
|
||||
import net.minecraft.client.particle.ParticleBreaking;
|
||||
import net.minecraft.client.particle.BreakingParticle;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.render.textures.ParticleTextures;
|
||||
|
||||
|
||||
public class MatterCannonFX extends ParticleBreaking
|
||||
public class MatterCannonFX extends BreakingParticle
|
||||
{
|
||||
|
||||
private final TextureAtlasSprite particleTextureIndex;
|
||||
|
||||
public MatterCannonFX( final World par1World, final double par2, final double par4, final double par6, final Item par8Item )
|
||||
public MatterCannonFX( final World par1World, final double par2, final double par4, final double par6, final ItemStack par8Item )
|
||||
{
|
||||
super( par1World, par2, par4, par6, par8Item );
|
||||
this.particleGravity = 0;
|
||||
@@ -56,13 +57,13 @@ public class MatterCannonFX extends ParticleBreaking
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
public void tick()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if( this.particleAge++ >= this.particleMaxAge )
|
||||
if( this.age++ >= this.maxAge )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
@@ -42,10 +42,10 @@ public class VibrantFX extends Particle
|
||||
this.motionX = 0.0D;
|
||||
this.motionY = 0.0D;
|
||||
this.motionZ = 0.0D;
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.particleMaxAge = (int) ( 20.0D / ( Math.random() * 0.8D + 0.1D ) );
|
||||
this.prevPosX = this.getPosX();
|
||||
this.prevPosY = this.getPosY();
|
||||
this.prevPosZ = this.getPosZ();
|
||||
this.maxAge = (int) ( 20.0D / ( Math.random() * 0.8D + 0.1D ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,18 +59,18 @@ public class VibrantFX extends Particle
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
@Override
|
||||
public void onUpdate()
|
||||
public void tick()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.prevPosX = this.getPosX();
|
||||
this.prevPosY = this.getPosY();
|
||||
this.prevPosZ = this.getPosZ();
|
||||
// this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.particleScale *= 0.95;
|
||||
|
||||
if( this.particleMaxAge <= 0 || this.particleScale < 0.1 )
|
||||
if( this.maxAge <= 0 || this.particleScale < 0.1 )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
this.particleMaxAge--;
|
||||
this.maxAge--;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user