Highly incomplete code. First work on porting to 1.12. Still need to rework a LOT of things.
This commit is contained in:
@@ -31,6 +31,7 @@ import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -99,18 +100,21 @@ public abstract class AEBaseBlock extends Block
|
||||
return new BlockStateContainer( this, this.getAEStates() );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public final boolean isNormalCube( IBlockState state )
|
||||
{
|
||||
return this.isFullSize() && this.isOpaque();
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess source, BlockPos pos )
|
||||
{
|
||||
return boundingBox;
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public void addCollisionBoxToList( final IBlockState state, final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, @Nullable final Entity e, boolean p_185477_7_)
|
||||
{
|
||||
@@ -135,6 +139,7 @@ public abstract class AEBaseBlock extends Block
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public AxisAlignedBB getSelectedBoundingBox( IBlockState state, final World w, final BlockPos pos )
|
||||
@@ -221,12 +226,14 @@ public abstract class AEBaseBlock extends Block
|
||||
return super.getSelectedBoundingBox( state, w, pos );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public final boolean isOpaqueCube( IBlockState state )
|
||||
{
|
||||
return this.isOpaque();
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public RayTraceResult collisionRayTrace( final IBlockState state, final World w, final BlockPos pos, final Vec3d a, final Vec3d b )
|
||||
{
|
||||
@@ -274,12 +281,14 @@ public abstract class AEBaseBlock extends Block
|
||||
return super.collisionRayTrace( state, w, pos, a, b );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride( IBlockState state )
|
||||
{
|
||||
return this.isInventory();
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public int getComparatorInputOverride( IBlockState state, final World worldIn, final BlockPos pos )
|
||||
{
|
||||
@@ -332,8 +341,9 @@ public abstract class AEBaseBlock extends Block
|
||||
return new EnumFacing[0];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
|
||||
public void addInformation( final ItemStack is, final World world, final List<String> lines, final ITooltipFlag advancedItemTooltips )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -67,15 +68,15 @@ public class AEBaseItemBlock extends ItemBlock
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public final void addInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips )
|
||||
public final void addInformation( final ItemStack itemStack, final World world, final List<String> toolTip, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
this.addCheckedInformation( itemStack, player, toolTip, advancedTooltips );
|
||||
this.addCheckedInformation( itemStack, world, toolTip, advancedTooltips );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final boolean advancedToolTips )
|
||||
public void addCheckedInformation( final ItemStack itemStack, final World world, final List<String> toolTip, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
this.blockType.addInformation( itemStack, player, toolTip, advancedToolTips );
|
||||
this.blockType.addInformation( itemStack, world, toolTip, advancedTooltips );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,9 +23,11 @@ import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -48,9 +50,9 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final boolean advancedTooltips )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
final NBTTagCompound tag = itemStack.getTagCompound();
|
||||
final NBTTagCompound tag = stack.getTagCompound();
|
||||
double internalCurrentPower = 0;
|
||||
final double internalMaxPower = this.getMaxEnergyCapacity();
|
||||
|
||||
@@ -61,7 +63,7 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
|
||||
|
||||
final double percent = internalCurrentPower / internalMaxPower;
|
||||
|
||||
toolTip.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
|
||||
lines.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
|
||||
}
|
||||
|
||||
private double getMaxEnergyCapacity()
|
||||
|
||||
@@ -83,7 +83,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getSubBlocks( final Item item, final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
itemStacks.add( new ItemStack( this, 1, 0 ) );
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getSubBlocks( final Item item, final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.tile.networking.TileController;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class BlockController extends AEBaseTileBlock
|
||||
{
|
||||
|
||||
@@ -96,6 +99,7 @@ public class BlockController extends AEBaseTileBlock
|
||||
* controllers and the network state of this controller (offline, online, conflicted). This is used to
|
||||
* get a rudimentary connected texture feel for the controller based on how it is placed.
|
||||
*/
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
@@ -155,6 +159,7 @@ public class BlockController extends AEBaseTileBlock
|
||||
return state.getValue( CONTROLLER_STATE ).ordinal();
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public IBlockState getStateFromMeta( final int meta )
|
||||
{
|
||||
@@ -168,6 +173,7 @@ public class BlockController extends AEBaseTileBlock
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
|
||||
{
|
||||
|
||||
@@ -60,9 +60,9 @@ public class BlockEnergyCell extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getSubBlocks( final Item item, final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
super.getSubBlocks( item, tabs, itemStacks );
|
||||
super.getSubBlocks( tabs, itemStacks );
|
||||
|
||||
final ItemStack charged = new ItemStack( this, 1 );
|
||||
final NBTTagCompound tag = Platform.openNbtData( charged );
|
||||
|
||||
@@ -93,7 +93,7 @@ public class BlockPaint extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getSubBlocks( final Item item, final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ package appeng.block.paint;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
@@ -3,8 +3,7 @@ package appeng.block.paint;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
||||
@@ -4,10 +4,10 @@ package appeng.block.qnb;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -18,7 +18,6 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
|
||||
@@ -2,8 +2,8 @@ package appeng.block.qnb;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
|
||||
@@ -54,7 +54,7 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getSubBlocks( final Item item, final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -29,12 +29,15 @@ import java.util.function.Supplier;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.core.Registration;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.gui.ForgeGuiFactory;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -147,7 +150,8 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockBuilder tileEntity(Class<? extends AEBaseTile> tileEntityClass) {
|
||||
public IBlockBuilder tileEntity( Class<? extends AEBaseTile> tileEntityClass )
|
||||
{
|
||||
teClass = tileEntityClass;
|
||||
return this;
|
||||
}
|
||||
@@ -201,6 +205,7 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
// Create block and matching item, and set factory name of both
|
||||
Block block = blockSupplier.get();
|
||||
block.setRegistryName( AppEng.MOD_ID, registryName );
|
||||
block.setUnlocalizedName( "appliedenergistics2." + registryName );
|
||||
|
||||
ItemBlock item = constructItemFromBlock( block );
|
||||
if( item != null )
|
||||
@@ -210,15 +215,18 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
|
||||
// Register the item and block with the game
|
||||
factory.addPreInit( side -> {
|
||||
GameRegistry.register( block );
|
||||
// GameRegistry.register( block );
|
||||
Registration.addBlockToRegister( block );
|
||||
// ForgeRegistries.BLOCKS.register(block);
|
||||
if( item != null )
|
||||
{
|
||||
GameRegistry.register( item );
|
||||
Registration.addItemToRegister( item );
|
||||
// ForgeRegistries.ITEMS.register(item);
|
||||
}
|
||||
} );
|
||||
|
||||
block.setCreativeTab( creativeTab );
|
||||
block.setUnlocalizedName( "appliedenergistics2." + registryName );
|
||||
|
||||
|
||||
// Register all extra handlers
|
||||
preInitCallbacks.forEach( consumer -> factory.addPreInit( side -> consumer.accept( block, item ) ) );
|
||||
|
||||
@@ -119,7 +119,8 @@ class BlockRendering implements IBlockRendering
|
||||
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), ( l, m ) -> new AutoRotatingModel( m ) );
|
||||
}
|
||||
|
||||
builtInModels.forEach( factory::addBuiltInModel );
|
||||
// TODO : 1.12
|
||||
builtInModels.forEach( factory::addBuiltInModel );
|
||||
|
||||
if( blockColor != null )
|
||||
{
|
||||
|
||||
@@ -26,10 +26,12 @@ import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import appeng.core.Registration;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.dispenser.IBehaviorDispenseItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -174,7 +176,7 @@ class ItemDefinitionBuilder implements IItemBuilder
|
||||
} );
|
||||
}
|
||||
|
||||
factory.addPreInit( side -> GameRegistry.register( item ) );
|
||||
factory.addPreInit( side -> Registration.addItemToRegister( item ) );
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
|
||||
@@ -140,6 +140,7 @@ class ItemRendering implements IItemRendering
|
||||
factory.addBootstrapComponent( new ItemModelComponent( item, ImmutableMap.of( 0, model ) ) );
|
||||
}
|
||||
|
||||
// TODO : 1.12
|
||||
builtInModels.forEach( factory::addBuiltInModel );
|
||||
|
||||
if( !resources.isEmpty() )
|
||||
|
||||
@@ -36,6 +36,8 @@ import com.google.common.base.Stopwatch;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import mezz.jei.api.IRecipesGui;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.vertex.VertexBuffer;
|
||||
import net.minecraftforge.client.event.GuiOpenEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
@@ -48,7 +50,6 @@ import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
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.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ClickType;
|
||||
@@ -766,7 +767,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
final float par4 = uv_y * 16;
|
||||
|
||||
final Tessellator tessellator = Tessellator.getInstance();
|
||||
final VertexBuffer vb = tessellator.getBuffer();
|
||||
final BufferBuilder vb = tessellator.getBuffer();
|
||||
|
||||
vb.begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR );
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -116,10 +117,11 @@ public abstract class AEBaseMEGui extends AEBaseGui
|
||||
{
|
||||
}
|
||||
|
||||
ITooltipFlag.TooltipFlags tooltipFlag = this.mc.gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL;
|
||||
if( myStack != null )
|
||||
{
|
||||
@SuppressWarnings( "unchecked" )
|
||||
final List<String> currentToolTip = stack.getTooltip( this.mc.player, this.mc.gameSettings.advancedItemTooltips );
|
||||
final List<String> currentToolTip = stack.getTooltip( this.mc.player, tooltipFlag );
|
||||
|
||||
if( myStack.getStackSize() > BigNumber || ( myStack.getStackSize() > 1 && stack.isItemDamaged() ) )
|
||||
{
|
||||
@@ -136,7 +138,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
|
||||
}
|
||||
else if( stack.getCount() > BigNumber )
|
||||
{
|
||||
List<String> var4 = stack.getTooltip( this.mc.player, this.mc.gameSettings.advancedItemTooltips );
|
||||
List<String> var4 = stack.getTooltip( this.mc.player, tooltipFlag );
|
||||
var4.add( "Items Stored: " + NumberFormat.getNumberInstance( Locale.US ).format( stack.getCount() ) );
|
||||
this.drawTooltip( x, y, var4 );
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package appeng.client.gui;
|
||||
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
@@ -28,8 +29,8 @@ class Size1Slot extends Slot
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack getStack()
|
||||
{
|
||||
ItemStack orgStack = delegate.getStack();
|
||||
|
||||
@@ -67,13 +67,7 @@ public class AEConfigGuiFactory implements IModGuiFactory
|
||||
*/
|
||||
@Override
|
||||
public GuiScreen createConfigGui(GuiScreen parentScreen) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiScreen> mainConfigGuiClass()
|
||||
{
|
||||
return AEConfigGui.class;
|
||||
return new AEConfigGui(parentScreen);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -82,9 +76,4 @@ public class AEConfigGuiFactory implements IModGuiFactory
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RuntimeOptionGuiHandler getHandlerFor( final RuntimeOptionCategoryElement element )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ package appeng.client.gui.implementations;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -253,7 +255,8 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||
|
||||
if( myStack != null )
|
||||
{
|
||||
List<String> currentToolTip = stack.getTooltip( this.mc.player, this.mc.gameSettings.advancedItemTooltips );
|
||||
ITooltipFlag.TooltipFlags tooltipFlag = this.mc.gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL;
|
||||
List<String> currentToolTip = stack.getTooltip( this.mc.player, tooltipFlag );
|
||||
|
||||
while( currentToolTip.size() > 1 )
|
||||
{
|
||||
|
||||
@@ -181,7 +181,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 )
|
||||
public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3, float partial )
|
||||
{
|
||||
if( this.visible )
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ public class GuiProgressBar extends GuiButton implements ITooltip
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 )
|
||||
public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3, final float partial )
|
||||
{
|
||||
if( this.visible )
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ public class GuiTabButton extends GuiButton implements ITooltip
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton( final Minecraft minecraft, final int x, final int y )
|
||||
public void drawButton( final Minecraft minecraft, final int x, final int y, float partial )
|
||||
{
|
||||
if( this.visible )
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ public class GuiToggleButton extends GuiButton implements ITooltip
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3 )
|
||||
public void drawButton( final Minecraft par1Minecraft, final int par2, final int par3, final float partial )
|
||||
{
|
||||
if( this.visible )
|
||||
{
|
||||
|
||||
@@ -61,13 +61,14 @@ public class MEGuiTextField extends GuiTextField
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked( final int xPos, final int yPos, final int button )
|
||||
public boolean mouseClicked( final int xPos, final int yPos, final int button )
|
||||
{
|
||||
super.mouseClicked( xPos, yPos, button );
|
||||
|
||||
final boolean requiresFocus = this.isMouseIn( xPos, yPos );
|
||||
|
||||
this.setFocused( requiresFocus );
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,8 +21,7 @@ package appeng.client.render;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.client.render;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -30,7 +31,6 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraftforge.client.IRenderHandler;
|
||||
|
||||
@@ -77,7 +77,7 @@ public class SpatialSkyRender extends IRenderHandler
|
||||
GlStateManager.depthMask( false );
|
||||
GlStateManager.color( 0.0f, 0.0f, 0.0f, 1.0f );
|
||||
final Tessellator tessellator = Tessellator.getInstance();
|
||||
final VertexBuffer VertexBuffer = tessellator.getBuffer();
|
||||
final BufferBuilder VertexBuffer = tessellator.getBuffer();
|
||||
|
||||
// This renders a skybox around the player at a far, fixed distance from them.
|
||||
// The skybox is pitch black and untextured
|
||||
@@ -150,7 +150,7 @@ public class SpatialSkyRender extends IRenderHandler
|
||||
private void renderTwinkles()
|
||||
{
|
||||
final Tessellator tessellator = Tessellator.getInstance();
|
||||
final VertexBuffer VertexBuffer = tessellator.getBuffer();
|
||||
final BufferBuilder VertexBuffer = tessellator.getBuffer();
|
||||
VertexBuffer.begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION );
|
||||
|
||||
for( int i = 0; i < 50; ++i )
|
||||
|
||||
@@ -24,8 +24,7 @@ import java.util.Collections;
|
||||
import java.util.EnumMap;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
||||
@@ -21,8 +21,8 @@ package appeng.client.render.cablebus;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
|
||||
@@ -26,12 +26,11 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.vecmath.Vector3f;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
|
||||
@@ -20,8 +20,7 @@ package appeng.client.render.cablebus;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@@ -21,8 +21,8 @@ package appeng.client.render.crafting;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class CraftingMonitorTESR extends TileEntitySpecialRenderer<TileCraftingM
|
||||
{
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt( TileCraftingMonitorTile te, double x, double y, double z, float partialTicks, int destroyStage )
|
||||
public void render( TileCraftingMonitorTile te, double x, double y, double z, float partialTicks, int destroyStage, float p_render_10_ )
|
||||
{
|
||||
if( te == null )
|
||||
{
|
||||
|
||||
@@ -8,6 +8,8 @@ import javax.vecmath.Matrix4f;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.model.PerspectiveMapWrapper;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
@@ -23,7 +25,6 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.IPerspectiveAwareModel;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
import appeng.items.misc.ItemEncodedPattern;
|
||||
@@ -34,7 +35,7 @@ import appeng.items.misc.ItemEncodedPattern;
|
||||
* showing the encoded pattern itself. Matters are further complicated by only wanting to show the crafting output when the pattern is being
|
||||
* rendered in the GUI, and not anywhere else.
|
||||
*/
|
||||
class ItemEncodedPatternBakedModel implements IPerspectiveAwareModel
|
||||
class ItemEncodedPatternBakedModel implements IBakedModel
|
||||
{
|
||||
private final IBakedModel baseModel;
|
||||
|
||||
@@ -95,12 +96,12 @@ class ItemEncodedPatternBakedModel implements IPerspectiveAwareModel
|
||||
@Override
|
||||
public Pair<? extends IBakedModel, Matrix4f> handlePerspective( ItemCameraTransforms.TransformType cameraTransformType )
|
||||
{
|
||||
if( baseModel instanceof IPerspectiveAwareModel )
|
||||
if( baseModel instanceof IBakedModel )
|
||||
{
|
||||
return ( (IPerspectiveAwareModel) baseModel ).handlePerspective( cameraTransformType );
|
||||
return ( (IBakedModel) baseModel ).handlePerspective( cameraTransformType );
|
||||
}
|
||||
|
||||
return IPerspectiveAwareModel.MapWrapper.handlePerspective( this, transforms, cameraTransformType );
|
||||
return PerspectiveMapWrapper.handlePerspective( this, transforms, cameraTransformType );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -110,7 +111,7 @@ class ItemEncodedPatternBakedModel implements IPerspectiveAwareModel
|
||||
* Usually those methods only matter for rendering on the ground and other cases, where we wouldn't render the crafting output model anyway,
|
||||
* so in those cases we delegate to the model of the encoded pattern.
|
||||
*/
|
||||
private class ShiftHoldingModelWrapper implements IPerspectiveAwareModel
|
||||
private class ShiftHoldingModelWrapper implements IBakedModel
|
||||
{
|
||||
|
||||
private final IBakedModel outputModel;
|
||||
@@ -141,12 +142,12 @@ class ItemEncodedPatternBakedModel implements IPerspectiveAwareModel
|
||||
GlStateManager.enableLighting();
|
||||
}
|
||||
|
||||
if( selectedModel instanceof IPerspectiveAwareModel )
|
||||
if( selectedModel instanceof IBakedModel )
|
||||
{
|
||||
return ( (IPerspectiveAwareModel) selectedModel ).handlePerspective( cameraTransformType );
|
||||
return ( (IBakedModel) selectedModel ).handlePerspective( cameraTransformType );
|
||||
}
|
||||
|
||||
return IPerspectiveAwareModel.MapWrapper.handlePerspective( this, transforms, cameraTransformType );
|
||||
return PerspectiveMapWrapper.handlePerspective( this, transforms, cameraTransformType );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,8 +3,8 @@ package appeng.client.render.crafting;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
@@ -13,8 +13,8 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.model.IPerspectiveAwareModel;
|
||||
import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.client.model.PerspectiveMapWrapper;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
@@ -54,7 +54,7 @@ class ItemEncodedPatternModel implements IModel
|
||||
throw new RuntimeException( e );
|
||||
}
|
||||
|
||||
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms = IPerspectiveAwareModel.MapWrapper.getTransforms(state);
|
||||
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms = PerspectiveMapWrapper.getTransforms(state);
|
||||
|
||||
return new ItemEncodedPatternBakedModel( baseModel, transforms );
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.client.render.effects;
|
||||
|
||||
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -93,7 +93,7 @@ public class AssemblerFX extends Particle implements ICanDie
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( final VertexBuffer 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 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 )
|
||||
{
|
||||
this.time += l;
|
||||
if( this.time > 4.0 )
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.client.render.effects;
|
||||
|
||||
|
||||
import net.minecraft.client.particle.ParticleBreaking;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -67,7 +67,7 @@ public class CraftingFx extends ParticleBreaking
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( final VertexBuffer par1Tessellator, final Entity p_180434_2_, final float partialTick, final float x, final float y, final float z, final float rx, final float rz )
|
||||
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 )
|
||||
{
|
||||
if( partialTick < 0 || partialTick > 1 )
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.client.render.effects;
|
||||
|
||||
|
||||
import net.minecraft.client.particle.ParticleBreaking;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -66,7 +66,7 @@ public class EnergyFx extends ParticleBreaking
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( final VertexBuffer par1Tessellator, final Entity p_180434_2_, final float partialTicks, final float par3, final float par4, final float par5, final float par6, final float par7 )
|
||||
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 )
|
||||
{
|
||||
final float f6 = this.particleTextureIndex.getMinU();
|
||||
final float f7 = this.particleTextureIndex.getMaxU();
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
@@ -96,7 +96,7 @@ public class LightningFX extends Particle
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( final VertexBuffer tess, final Entity p_180434_2_, final float l, final float rX, final float rY, final float rZ, final float rYZ, final float rXY )
|
||||
public void renderParticle( final BufferBuilder tess, final Entity p_180434_2_, final float l, final float rX, final float rY, final float rZ, final float rYZ, final float rXY )
|
||||
{
|
||||
final float j = 1.0f;
|
||||
float red = this.particleRed * j * 0.9f;
|
||||
@@ -222,7 +222,7 @@ public class LightningFX extends Particle
|
||||
this.hasData = false;
|
||||
}
|
||||
|
||||
private void draw( float red, float green, float blue, final VertexBuffer tess, final double[] a, final double[] b, final double f6, final double f8 )
|
||||
private void draw( float red, float green, float blue, final BufferBuilder tess, final double[] a, final double[] b, final double f6, final double f8 )
|
||||
{
|
||||
if( this.hasData )
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.client.render.effects;
|
||||
|
||||
|
||||
import net.minecraft.client.particle.ParticleBreaking;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -84,7 +84,7 @@ public class MatterCannonFX extends ParticleBreaking
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( final VertexBuffer par1Tessellator, final Entity p_180434_2_, final float par2, final float par3, final float par4, final float par5, final float par6, final float par7 )
|
||||
public void renderParticle( final BufferBuilder par1Tessellator, final Entity p_180434_2_, final float par2, final float par3, final float par4, final float par5, final float par6, final float par7 )
|
||||
{
|
||||
final float f6 = this.particleTextureIndex.getMinU();
|
||||
final float f7 = this.particleTextureIndex.getMaxU();
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.google.common.cache.CacheBuilder;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -27,7 +28,6 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.IPerspectiveAwareModel;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
import appeng.api.implementations.items.IBiometricCard;
|
||||
@@ -36,7 +36,7 @@ import appeng.client.render.cablebus.CubeBuilder;
|
||||
import appeng.core.AELog;
|
||||
|
||||
|
||||
class BiometricCardBakedModel implements IPerspectiveAwareModel
|
||||
class BiometricCardBakedModel implements IBakedModel
|
||||
{
|
||||
|
||||
private final VertexFormat format;
|
||||
@@ -212,9 +212,9 @@ class BiometricCardBakedModel implements IPerspectiveAwareModel
|
||||
public Pair<? extends IBakedModel, Matrix4f> handlePerspective( ItemCameraTransforms.TransformType type )
|
||||
{
|
||||
// Delegate to the base model if possible
|
||||
if( baseModel instanceof IPerspectiveAwareModel )
|
||||
if( baseModel instanceof IModel )
|
||||
{
|
||||
IPerspectiveAwareModel pam = (IPerspectiveAwareModel) baseModel;
|
||||
IBakedModel pam = (IBakedModel) baseModel;
|
||||
Pair<? extends IBakedModel, Matrix4f> pair = pam.handlePerspective( type );
|
||||
return Pair.of( this, pair.getValue() );
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@ package appeng.client.render.model;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
||||
@@ -10,6 +10,7 @@ import javax.vecmath.Matrix4f;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraftforge.client.model.PerspectiveMapWrapper;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -19,11 +20,10 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.client.model.IPerspectiveAwareModel;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
|
||||
class ColorApplicatorBakedModel implements IPerspectiveAwareModel
|
||||
class ColorApplicatorBakedModel implements IBakedModel
|
||||
{
|
||||
|
||||
private final IBakedModel baseModel;
|
||||
@@ -138,6 +138,6 @@ class ColorApplicatorBakedModel implements IPerspectiveAwareModel
|
||||
@Override
|
||||
public Pair<? extends IBakedModel, Matrix4f> handlePerspective( ItemCameraTransforms.TransformType type )
|
||||
{
|
||||
return MapWrapper.handlePerspective( this, transforms, type );
|
||||
return PerspectiveMapWrapper.handlePerspective( this, transforms, type );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ package appeng.client.render.model;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
@@ -14,8 +14,8 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.model.IPerspectiveAwareModel;
|
||||
import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.client.model.PerspectiveMapWrapper;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ColorApplicatorModel implements IModel
|
||||
TextureAtlasSprite texMedium = bakedTextureGetter.apply( TEXTURE_MEDIUM );
|
||||
TextureAtlasSprite texBright = bakedTextureGetter.apply( TEXTURE_BRIGHT );
|
||||
|
||||
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> map = IPerspectiveAwareModel.MapWrapper.getTransforms( state );
|
||||
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> map = PerspectiveMapWrapper.getTransforms( state );
|
||||
|
||||
return new ColorApplicatorBakedModel( baseModel, map, texDark, texMedium, texBright );
|
||||
}
|
||||
|
||||
@@ -22,8 +22,9 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
@@ -37,6 +38,7 @@ import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
import appeng.block.storage.DriveSlotState;
|
||||
import net.minecraftforge.common.model.animation.IClip;
|
||||
|
||||
|
||||
public class DriveModel implements IModel
|
||||
@@ -94,4 +96,34 @@ public class DriveModel implements IModel
|
||||
{
|
||||
return TRSRTransformation.identity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<? extends IClip> getClip(String name) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModel process(ImmutableMap<String, String> customData) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModel smoothLighting(boolean value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModel gui3d(boolean value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModel uvlock(boolean value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModel retexture(ImmutableMap<String, String> textures) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,11 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Strings;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
@@ -21,8 +21,8 @@ package appeng.client.render.model;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
|
||||
@@ -22,8 +22,8 @@ package appeng.client.render.model;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
|
||||
@@ -32,11 +32,11 @@ import java.lang.reflect.Type;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
@@ -22,13 +22,13 @@ package appeng.client.render.renderable;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.util.vector.Matrix4f;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -64,7 +64,7 @@ public class ItemRenderable<T extends TileEntity> implements Renderable<T>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityFast( T te, double x, double y, double z, float partialTicks, int destroyStage, VertexBuffer buffer )
|
||||
public void renderTileEntityFast( T te, double x, double y, double z, float partialTicks, int destroyStage, BufferBuilder buffer )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
|
||||
package appeng.client.render.renderable;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
|
||||
@@ -28,6 +27,6 @@ public interface Renderable<T extends TileEntity>
|
||||
|
||||
public void renderTileEntityAt( T te, double x, double y, double z, float partialTicks, int destroyStage );
|
||||
|
||||
public void renderTileEntityFast( T te, double x, double y, double z, float partialTicks, int destroyStage, VertexBuffer buffer );
|
||||
public void renderTileEntityFast( T te, double x, double y, double z, float partialTicks, int destroyStage, BufferBuilder buffer );
|
||||
|
||||
}
|
||||
|
||||
@@ -24,10 +24,9 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package appeng.client.render.tesr;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -27,7 +28,6 @@ import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
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.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
@@ -47,7 +47,7 @@ public class CrankTESR extends TileEntitySpecialRenderer<TileCrank>
|
||||
{
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt( TileCrank te, double x, double y, double z, float partialTicks, int destroyStage )
|
||||
public void render( TileCrank te, double x, double y, double z, float partialTicks, int destroyStage, float p_render_10_ )
|
||||
{
|
||||
// Most of this is blatantly copied from FastTESR
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
@@ -71,7 +71,7 @@ public class CrankTESR extends TileEntitySpecialRenderer<TileCrank>
|
||||
BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||
IBakedModel model = dispatcher.getModelForState( blockState );
|
||||
|
||||
VertexBuffer buffer = tessellator.getBuffer();
|
||||
BufferBuilder buffer = tessellator.getBuffer();
|
||||
buffer.begin( GL11.GL_QUADS, DefaultVertexFormats.BLOCK );
|
||||
|
||||
// The translation ensures the vertex buffer positions are relative to 0,0,0 instead of the block pos
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package appeng.client.render.tesr;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -10,7 +10,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
@@ -41,7 +40,7 @@ public class InscriberTESR extends TileEntitySpecialRenderer<TileInscriber>
|
||||
private static TextureAtlasSprite textureInside;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt( TileInscriber tile, double x, double y, double z, float partialTicks, int destroyStage )
|
||||
public void render( TileInscriber tile, double x, double y, double z, float partialTicks, int destroyStage, float p_render_10_ )
|
||||
{
|
||||
// render inscriber
|
||||
|
||||
@@ -89,7 +88,7 @@ public class InscriberTESR extends TileEntitySpecialRenderer<TileInscriber>
|
||||
float press = 0.2f;
|
||||
press -= progress / 5.0f;
|
||||
|
||||
VertexBuffer buffer = Tessellator.getInstance().getBuffer();
|
||||
BufferBuilder buffer = Tessellator.getInstance().getBuffer();
|
||||
buffer.begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX );
|
||||
|
||||
float middle = 0.5f;
|
||||
@@ -177,7 +176,7 @@ public class InscriberTESR extends TileEntitySpecialRenderer<TileInscriber>
|
||||
GlStateManager.enableRescaleNormal();
|
||||
}
|
||||
|
||||
private void renderItem( ItemStack sis, final float o, final AEBaseTile tile, final VertexBuffer tess, final double x, final double y, final double z )
|
||||
private void renderItem( ItemStack sis, final float o, final AEBaseTile tile, final BufferBuilder tess, final double x, final double y, final double z )
|
||||
{
|
||||
if( !sis.isEmpty() )
|
||||
{
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
package appeng.client.render.tesr;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -42,7 +42,7 @@ public class ModularTESR<T extends AEBaseTile> extends TileEntitySpecialRenderer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt( T te, double x, double y, double z, float partialTicks, int destroyStage )
|
||||
public void render( T te, double x, double y, double z, float partialTicks, int destroyStage, float p_render_10_ )
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate( x, y, z );
|
||||
@@ -57,7 +57,7 @@ public class ModularTESR<T extends AEBaseTile> extends TileEntitySpecialRenderer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityFast( T te, double x, double y, double z, float partialTicks, int destroyStage, VertexBuffer buffer )
|
||||
public void renderTileEntityFast( T te, double x, double y, double z, float partialTicks, int destroyStage, float p_render_10_, BufferBuilder buffer )
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate( x, y, z );
|
||||
|
||||
@@ -50,7 +50,7 @@ public class SkyChestTESR extends TileEntitySpecialRenderer<TileSkyChest>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt( TileSkyChest te, double x, double y, double z, float partialTicks, int destroyStage )
|
||||
public void render( TileSkyChest te, double x, double y, double z, float partialTicks, int destroyStage, float p_render_10_ )
|
||||
{
|
||||
GlStateManager.enableDepth();
|
||||
GlStateManager.depthFunc( 515 );
|
||||
|
||||
@@ -22,7 +22,7 @@ package appeng.client.render.tesr;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -47,7 +47,7 @@ public class SkyCompassTESR extends FastTESR<TileSkyCompass>
|
||||
private static BlockRendererDispatcher blockRenderer;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityFast( TileSkyCompass te, double x, double y, double z, float partialTicks, int destroyStage, VertexBuffer buffer )
|
||||
public void renderTileEntityFast( TileSkyCompass te, double x, double y, double z, float partialTicks, int destroyStage, float var10, BufferBuilder buffer )
|
||||
{
|
||||
|
||||
if( !te.hasWorld() )
|
||||
|
||||
@@ -80,7 +80,7 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
|
||||
ic.setInventorySlotContents( x, this.craftingSlots[x].getStack() );
|
||||
}
|
||||
|
||||
this.outputSlot.putStack( CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.world ) );
|
||||
this.outputSlot.putStack( CraftingManager.findMatchingResult( ic, this.getPlayerInv().player.world ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -159,7 +159,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
ic.setInventorySlotContents( x, this.crafting.getStackInSlot( x ) );
|
||||
}
|
||||
|
||||
final ItemStack is = CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.world );
|
||||
final ItemStack is = CraftingManager.findMatchingResult( ic, this.getPlayerInv().player.world );
|
||||
this.cOut.setInventorySlotContents( 0, is );
|
||||
return is;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.stats.AchievementList;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
|
||||
@@ -89,55 +88,55 @@ public class AppEngCraftingSlot extends AppEngSlot
|
||||
par1ItemStack.onCrafting( this.thePlayer.world, this.thePlayer, this.amountCrafted );
|
||||
this.amountCrafted = 0;
|
||||
|
||||
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.CRAFTING_TABLE ) )
|
||||
{
|
||||
this.thePlayer.addStat( AchievementList.BUILD_WORK_BENCH, 1 );
|
||||
}
|
||||
|
||||
if( par1ItemStack.getItem() instanceof ItemPickaxe )
|
||||
{
|
||||
this.thePlayer.addStat( AchievementList.BUILD_PICKAXE, 1 );
|
||||
}
|
||||
|
||||
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.FURNACE ) )
|
||||
{
|
||||
this.thePlayer.addStat( AchievementList.BUILD_FURNACE, 1 );
|
||||
}
|
||||
|
||||
if( par1ItemStack.getItem() instanceof ItemHoe )
|
||||
{
|
||||
this.thePlayer.addStat( AchievementList.BUILD_HOE, 1 );
|
||||
}
|
||||
|
||||
if( par1ItemStack.getItem() == Items.BREAD )
|
||||
{
|
||||
this.thePlayer.addStat( AchievementList.MAKE_BREAD, 1 );
|
||||
}
|
||||
|
||||
if( par1ItemStack.getItem() == Items.CAKE )
|
||||
{
|
||||
this.thePlayer.addStat( AchievementList.BAKE_CAKE, 1 );
|
||||
}
|
||||
|
||||
if( par1ItemStack.getItem() instanceof ItemPickaxe && ( (ItemTool) par1ItemStack.getItem() ).getToolMaterial() != Item.ToolMaterial.WOOD )
|
||||
{
|
||||
this.thePlayer.addStat( AchievementList.BUILD_BETTER_PICKAXE, 1 );
|
||||
}
|
||||
|
||||
if( par1ItemStack.getItem() instanceof ItemSword )
|
||||
{
|
||||
this.thePlayer.addStat( AchievementList.BUILD_SWORD, 1 );
|
||||
}
|
||||
|
||||
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.ENCHANTING_TABLE ) )
|
||||
{
|
||||
this.thePlayer.addStat( AchievementList.ENCHANTMENTS, 1 );
|
||||
}
|
||||
|
||||
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.BOOKSHELF ) )
|
||||
{
|
||||
this.thePlayer.addStat( AchievementList.BOOKCASE, 1 );
|
||||
}
|
||||
// if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.CRAFTING_TABLE ) )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BUILD_WORK_BENCH, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() instanceof ItemPickaxe )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BUILD_PICKAXE, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.FURNACE ) )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BUILD_FURNACE, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() instanceof ItemHoe )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BUILD_HOE, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() == Items.BREAD )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.MAKE_BREAD, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() == Items.CAKE )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BAKE_CAKE, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() instanceof ItemPickaxe && ( (ItemTool) par1ItemStack.getItem() ).getToolMaterial() != Item.ToolMaterial.WOOD )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BUILD_BETTER_PICKAXE, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() instanceof ItemSword )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BUILD_SWORD, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.ENCHANTING_TABLE ) )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.ENCHANTMENTS, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.BOOKSHELF ) )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BOOKCASE, 1 );
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -153,7 +152,7 @@ public class AppEngCraftingSlot extends AppEngSlot
|
||||
ic.setInventorySlotContents( x, this.craftMatrix.getStackInSlot( x ) );
|
||||
}
|
||||
|
||||
final NonNullList<ItemStack> aitemstack = CraftingManager.getInstance().getRemainingItems( ic, playerIn.world );
|
||||
final NonNullList<ItemStack> aitemstack = CraftingManager.getRemainingItems( ic, playerIn.world );
|
||||
|
||||
for( int x = 0; x < this.craftMatrix.getSizeInventory(); x++ )
|
||||
{
|
||||
|
||||
@@ -27,6 +27,8 @@ import net.minecraft.item.ItemStack;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
public class AppEngSlot extends Slot
|
||||
{
|
||||
@@ -81,6 +83,7 @@ public class AppEngSlot extends Slot
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack getStack()
|
||||
{
|
||||
if( !this.isEnabled() )
|
||||
|
||||
@@ -24,6 +24,8 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
public class NullSlot extends Slot
|
||||
{
|
||||
@@ -52,6 +54,7 @@ public class NullSlot extends Slot
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack getStack()
|
||||
{
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
@@ -22,6 +22,8 @@ package appeng.container.slot;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
public class OptionalSlotFake extends SlotFake
|
||||
{
|
||||
@@ -42,6 +44,7 @@ public class OptionalSlotFake extends SlotFake
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack getStack()
|
||||
{
|
||||
if( !this.isEnabled() )
|
||||
|
||||
@@ -55,6 +55,11 @@ public final class Api implements IAppEngApi
|
||||
this.definitions = new ApiDefinitions( (PartModels) this.registryContainer.partModels() );
|
||||
}
|
||||
|
||||
public PartModels getPartModels()
|
||||
{
|
||||
return (PartModels) this.registryContainer.partModels();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRegistryContainer registries()
|
||||
{
|
||||
|
||||
@@ -26,6 +26,11 @@ import appeng.core.api.definitions.ApiItems;
|
||||
import appeng.core.api.definitions.ApiMaterials;
|
||||
import appeng.core.api.definitions.ApiParts;
|
||||
import appeng.core.features.registries.PartModels;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
|
||||
/**
|
||||
@@ -33,8 +38,9 @@ import appeng.core.features.registries.PartModels;
|
||||
*/
|
||||
public final class ApiDefinitions implements IDefinitions
|
||||
{
|
||||
private final ApiBlocks blocks;
|
||||
private final ApiItems items;
|
||||
// TODO : Check if this can be final again after the Register part.
|
||||
private ApiBlocks blocks;
|
||||
private ApiItems items;
|
||||
private final ApiMaterials materials;
|
||||
private final ApiParts parts;
|
||||
|
||||
@@ -47,6 +53,16 @@ public final class ApiDefinitions implements IDefinitions
|
||||
this.materials = new ApiMaterials( registry );
|
||||
this.parts = new ApiParts( registry, partModels );
|
||||
}
|
||||
//
|
||||
// public void addBlocks( final PartModels partModels )
|
||||
// {
|
||||
// this.blocks = new ApiBlocks( registry, partModels );
|
||||
// }
|
||||
//
|
||||
// public void addItems()
|
||||
// {
|
||||
// this.items = new ApiItems( registry );
|
||||
// }
|
||||
|
||||
public FeatureFactory getRegistry()
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@ import javax.annotation.Nonnull;
|
||||
import com.google.common.base.Stopwatch;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
@@ -64,8 +65,7 @@ import appeng.services.export.ForgeExportConfig;
|
||||
import appeng.services.version.VersionCheckerConfig;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
@Mod( modid = AppEng.MOD_ID, acceptedMinecraftVersions = "[1.11]", name = AppEng.MOD_NAME, version = AEConfig.VERSION, dependencies = AppEng.MOD_DEPENDENCIES, guiFactory = "appeng.client.gui.config.AEConfigGuiFactory" )
|
||||
@Mod( modid = AppEng.MOD_ID, acceptedMinecraftVersions = "[1.12]", name = AppEng.MOD_NAME, version = AEConfig.VERSION, dependencies = AppEng.MOD_DEPENDENCIES, guiFactory = "appeng.client.gui.config.AEConfigGuiFactory" )
|
||||
public final class AppEng
|
||||
{
|
||||
@SidedProxy( clientSide = "appeng.client.ClientHelper", serverSide = "appeng.server.ServerHelper", modId = AppEng.MOD_ID )
|
||||
@@ -135,6 +135,7 @@ public final class AppEng
|
||||
{
|
||||
AppEng.proxy.missingCoreMod();
|
||||
}
|
||||
MinecraftForge.EVENT_BUS.register( registration );
|
||||
|
||||
final Stopwatch watch = Stopwatch.createStarted();
|
||||
this.configDirectory = new File( event.getModConfigurationDirectory().getPath(), "AppliedEnergistics2" );
|
||||
|
||||
@@ -20,19 +20,36 @@ package appeng.core;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.api.definitions.ITileDefinition;
|
||||
import appeng.api.util.AEColoredItemDefinition;
|
||||
import appeng.core.api.definitions.ApiBlocks;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.DimensionType;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraftforge.common.BiomeManager;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
@@ -103,14 +120,22 @@ import appeng.tile.AEBaseTile;
|
||||
import appeng.util.Platform;
|
||||
import appeng.worldgen.MeteoriteWorldGen;
|
||||
import appeng.worldgen.QuartzWorldGen;
|
||||
import net.minecraftforge.registries.ForgeRegistry;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
|
||||
@Mod.EventBusSubscriber(modid = AppEng.MOD_ID)
|
||||
public final class Registration
|
||||
{
|
||||
private final RecipeHandler recipeHandler;
|
||||
private DimensionType storageDimensionType;
|
||||
private Biome storageBiome;
|
||||
|
||||
// TODO : 1.12 Improve
|
||||
private static List<Block> blocksToRegister = new ArrayList<Block>();
|
||||
private static List<Item> itemsToRegister = new ArrayList<Item>();
|
||||
private static List<IRecipe> recipesToRegister = new ArrayList<IRecipe>();
|
||||
|
||||
|
||||
Registration()
|
||||
{
|
||||
this.recipeHandler = new RecipeHandler();
|
||||
@@ -121,6 +146,30 @@ public final class Registration
|
||||
return this.storageBiome;
|
||||
}
|
||||
|
||||
public static void addBlockToRegister( Block b )
|
||||
{
|
||||
if( blocksToRegister == null )
|
||||
throw new IllegalStateException( "Past the registration phase already!" );
|
||||
System.out.println("Adding block : " + b +" -> " + b.getRegistryName());
|
||||
blocksToRegister.add( b );
|
||||
}
|
||||
|
||||
public static void addRecipeToRegister( IRecipe r )
|
||||
{
|
||||
if( recipesToRegister == null )
|
||||
throw new IllegalStateException( "Past the registration phase already!" );
|
||||
System.out.println("Adding " + r);
|
||||
recipesToRegister.add( r );
|
||||
}
|
||||
|
||||
public static void addItemToRegister( Item i )
|
||||
{
|
||||
if( itemsToRegister == null )
|
||||
throw new IllegalStateException( "Past the registration phase already!" );
|
||||
System.out.println("Adding item : " + i + " -> " + i.getRegistryName());
|
||||
itemsToRegister.add( i );
|
||||
}
|
||||
|
||||
public DimensionType getStorageDimensionType()
|
||||
{
|
||||
return storageDimensionType;
|
||||
@@ -128,7 +177,7 @@ public final class Registration
|
||||
|
||||
void preInitialize( final FMLPreInitializationEvent event )
|
||||
{
|
||||
this.registerSpatial( false );
|
||||
// this.registerSpatial( false );
|
||||
|
||||
Capabilities.register();
|
||||
|
||||
@@ -148,7 +197,7 @@ public final class Registration
|
||||
definitions.getRegistry().getBootstrapComponents().forEach( b -> b.preInitialize( event.getSide() ) );
|
||||
}
|
||||
|
||||
private void registerSpatial( final boolean force )
|
||||
private void registerSpatial( final boolean force, IForgeRegistry<Biome> registry )
|
||||
{
|
||||
if( !AEConfig.instance().isFeatureEnabled( AEFeature.SPATIAL_IO ) )
|
||||
{
|
||||
@@ -159,24 +208,28 @@ public final class Registration
|
||||
|
||||
if( this.storageBiome == null )
|
||||
{
|
||||
if( force && config.getStorageBiomeID() == -1 )
|
||||
{
|
||||
config.setStorageBiomeID( Platform.findEmpty( Biome.REGISTRY, 0, 256 ) );
|
||||
if( config.getStorageBiomeID() == -1 )
|
||||
{
|
||||
throw new IllegalStateException( "Biome Array is full, please free up some Biome ID's or disable spatial." );
|
||||
}
|
||||
// if( force && config.getStorageBiomeID() == -1 )
|
||||
// {
|
||||
// config.setStorageBiomeID( Platform.findEmpty( Biome.REGISTRY, 0, 256 ) );
|
||||
// if( config.getStorageBiomeID() == -1 )
|
||||
// {
|
||||
// throw new IllegalStateException( "Biome Array is full, please free up some Biome ID's or disable spatial." );
|
||||
// }
|
||||
//
|
||||
// this.storageBiome = new BiomeGenStorage();
|
||||
// Biome.registerBiome( config.getStorageBiomeID(), "appliedenergistics2:storage_biome", this.storageBiome );
|
||||
// config.save();
|
||||
// }
|
||||
//
|
||||
// if( !force && config.getStorageBiomeID() != -1 )
|
||||
// {
|
||||
// this.storageBiome = new BiomeGenStorage();
|
||||
// Biome.registerBiome( config.getStorageBiomeID(), "appliedenergistics2:storage_biome", this.storageBiome );
|
||||
// }
|
||||
|
||||
this.storageBiome = new BiomeGenStorage();
|
||||
Biome.registerBiome( config.getStorageBiomeID(), "appliedenergistics2:storage_biome", this.storageBiome );
|
||||
config.save();
|
||||
}
|
||||
|
||||
if( !force && config.getStorageBiomeID() != -1 )
|
||||
{
|
||||
this.storageBiome = new BiomeGenStorage();
|
||||
Biome.registerBiome( config.getStorageBiomeID(), "appliedenergistics2:storage_biome", this.storageBiome );
|
||||
}
|
||||
// TODO: 1.12, are modders allowed to even touch the ID's any more?
|
||||
this.storageBiome = new BiomeGenStorage();
|
||||
registry.register( this.storageBiome.setRegistryName("appliedenergistics2:storage_biome") );
|
||||
|
||||
}
|
||||
|
||||
@@ -297,24 +350,88 @@ public final class Registration
|
||||
registration.registerAchievementHandlers();
|
||||
registration.registerAchievements();
|
||||
|
||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING ) )
|
||||
{
|
||||
GameRegistry.addRecipe( new DisassembleRecipe() );
|
||||
RecipeSorter.register( "appliedenergistics2:disassemble", DisassembleRecipe.class, Category.SHAPELESS, "after:minecraft:shapeless" );
|
||||
}
|
||||
// if( AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING ) )
|
||||
// {
|
||||
// // TODO : 1.12 Improve
|
||||
// addRecipeToRegister( new DisassembleRecipe() );
|
||||
// RecipeSorter.register( "appliedenergistics2:disassemble", DisassembleRecipe.class, Category.SHAPELESS, "after:minecraft:shapeless" );
|
||||
// }
|
||||
//
|
||||
// if( AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_FACADE_CRAFTING ) )
|
||||
// {
|
||||
// definitions.items().facade().maybeItem().ifPresent( facadeItem -> {
|
||||
// // TODO : 1.12 Improve
|
||||
// addRecipeToRegister( new FacadeRecipe( (ItemFacade) facadeItem ) );
|
||||
// RecipeSorter.register( "appliedenergistics2:facade", FacadeRecipe.class, Category.SHAPED, "after:minecraft:shaped" );
|
||||
// } );
|
||||
// }
|
||||
}
|
||||
|
||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_FACADE_CRAFTING ) )
|
||||
@SubscribeEvent
|
||||
void registerBiomes ( RegistryEvent.Register<Biome> event )
|
||||
{
|
||||
IForgeRegistry<Biome> registry = event.getRegistry();
|
||||
this.registerSpatial( false, registry );
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
void registerBlocks(RegistryEvent.Register<Block> event)
|
||||
{
|
||||
IForgeRegistry<Block> registry = event.getRegistry();
|
||||
|
||||
// try {
|
||||
// for ( Field f : Api.INSTANCE.definitions().blocks().getClass().getDeclaredFields() )
|
||||
// {
|
||||
// f.setAccessible(true);
|
||||
// if( f.getType() == IBlockDefinition.class || f.getType() == ITileDefinition.class ) {
|
||||
// IBlockDefinition block = (IBlockDefinition) f.get(Api.INSTANCE.definitions().blocks());
|
||||
// Block b = block.maybeBlock().get();
|
||||
// System.out.println(b +" -> " + b.getRegistryName());
|
||||
// registry.register(b);
|
||||
// }
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
// TODO : 1.12 Improve
|
||||
for (Block b : blocksToRegister)
|
||||
{
|
||||
definitions.items().facade().maybeItem().ifPresent( facadeItem -> {
|
||||
GameRegistry.addRecipe( new FacadeRecipe( (ItemFacade) facadeItem ) );
|
||||
RecipeSorter.register( "appliedenergistics2:facade", FacadeRecipe.class, Category.SHAPED, "after:minecraft:shaped" );
|
||||
} );
|
||||
System.out.println("Registering block : " + b + " -> " + b.getRegistryName());
|
||||
registry.register( b );
|
||||
}
|
||||
blocksToRegister = null;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
void registerItems(RegistryEvent.Register<Item> event) {
|
||||
|
||||
IForgeRegistry<Item> registry = event.getRegistry();
|
||||
// TODO : 1.12 Improve
|
||||
for( Item i : itemsToRegister )
|
||||
{
|
||||
System.out.println("Registering item : " + i + " -> " + i.getRegistryName());
|
||||
registry.register( i );
|
||||
}
|
||||
itemsToRegister = null;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
void registerRecipes(RegistryEvent.Register<IRecipe> event)
|
||||
{
|
||||
IForgeRegistry<IRecipe> registry = event.getRegistry();
|
||||
// TODO : 1.12 Improve
|
||||
for( IRecipe r : recipesToRegister )
|
||||
{
|
||||
registry.register( r );
|
||||
}
|
||||
recipesToRegister = null;
|
||||
|
||||
}
|
||||
|
||||
void postInit( final FMLPostInitializationEvent event )
|
||||
{
|
||||
this.registerSpatial( true );
|
||||
// TODO : 1.12 Improve
|
||||
|
||||
final Api api = Api.INSTANCE;
|
||||
final IRegistryContainer registries = api.registries();
|
||||
|
||||
@@ -32,30 +32,30 @@ public class AchievementHierarchy
|
||||
*/
|
||||
void registerAchievementHierarchy()
|
||||
{
|
||||
Achievements.Presses.setParent( Achievements.Compass );
|
||||
|
||||
Achievements.Fluix.setParent( Achievements.ChargedQuartz );
|
||||
|
||||
Achievements.Charger.setParent( Achievements.Fluix );
|
||||
|
||||
Achievements.CrystalGrowthAccelerator.setParent( Achievements.Charger );
|
||||
|
||||
Achievements.GlassCable.setParent( Achievements.Charger );
|
||||
|
||||
Achievements.SpatialIOExplorer.setParent( Achievements.SpatialIO );
|
||||
|
||||
Achievements.IOPort.setParent( Achievements.StorageCell );
|
||||
|
||||
Achievements.PatternTerminal.setParent( Achievements.CraftingTerminal );
|
||||
|
||||
Achievements.Controller.setParent( Achievements.Networking1 );
|
||||
|
||||
Achievements.Networking2.setParent( Achievements.Controller );
|
||||
|
||||
Achievements.Networking3.setParent( Achievements.Networking2 );
|
||||
|
||||
Achievements.P2P.setParent( Achievements.Controller );
|
||||
|
||||
Achievements.Recursive.setParent( Achievements.Controller );
|
||||
// Achievements.Presses.setParent( Achievements.Compass );
|
||||
//
|
||||
// Achievements.Fluix.setParent( Achievements.ChargedQuartz );
|
||||
//
|
||||
// Achievements.Charger.setParent( Achievements.Fluix );
|
||||
//
|
||||
// Achievements.CrystalGrowthAccelerator.setParent( Achievements.Charger );
|
||||
//
|
||||
// Achievements.GlassCable.setParent( Achievements.Charger );
|
||||
//
|
||||
// Achievements.SpatialIOExplorer.setParent( Achievements.SpatialIO );
|
||||
//
|
||||
// Achievements.IOPort.setParent( Achievements.StorageCell );
|
||||
//
|
||||
// Achievements.PatternTerminal.setParent( Achievements.CraftingTerminal );
|
||||
//
|
||||
// Achievements.Controller.setParent( Achievements.Networking1 );
|
||||
//
|
||||
// Achievements.Networking2.setParent( Achievements.Controller );
|
||||
//
|
||||
// Achievements.Networking3.setParent( Achievements.Networking2 );
|
||||
//
|
||||
// Achievements.P2P.setParent( Achievements.Controller );
|
||||
//
|
||||
// Achievements.Recursive.setParent( Achievements.Controller );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
package appeng.core.stats;
|
||||
|
||||
|
||||
import net.minecraft.advancements.Advancement;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
@@ -111,8 +111,8 @@ public enum Achievements
|
||||
private final int x;
|
||||
private final int y;
|
||||
|
||||
private Achievement parent;
|
||||
private Achievement stat;
|
||||
private Advancement parent;
|
||||
private Advancement stat;
|
||||
|
||||
Achievements( final int x, final int y, final AEColoredItemDefinition which, final AchievementType type )
|
||||
{
|
||||
@@ -143,20 +143,20 @@ public enum Achievements
|
||||
this.parent = parent.getAchievement();
|
||||
}
|
||||
|
||||
public Achievement getAchievement()
|
||||
public Advancement getAchievement()
|
||||
{
|
||||
if( this.stat == null && !this.getStack().isEmpty() )
|
||||
{
|
||||
this.stat = new Achievement( "achievement.ae2." + this.name(), "ae2." + this.name(), this.x, this.y, this.getStack(), this.parent );
|
||||
this.stat.registerStat();
|
||||
}
|
||||
// if( this.stat == null && !this.getStack().isEmpty() )
|
||||
// {
|
||||
// this.stat = new Advancement( "achievement.ae2." + this.name(), "ae2." + this.name(), this.x, this.y, this.getStack(), this.parent );
|
||||
// this.stat.registerStat();
|
||||
// }
|
||||
|
||||
return this.stat;
|
||||
}
|
||||
|
||||
public void addToPlayer( final EntityPlayer player )
|
||||
{
|
||||
player.addStat( this.getAchievement(), 1 );
|
||||
// player.addStat( this.getAchievement(), 1 );
|
||||
}
|
||||
|
||||
AchievementType getType()
|
||||
|
||||
@@ -19,10 +19,7 @@
|
||||
package appeng.core.stats;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraftforge.common.AchievementPage;
|
||||
import net.minecraft.advancements.Advancement;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventBus;
|
||||
|
||||
import appeng.core.AEConfig;
|
||||
@@ -83,7 +80,7 @@ public class PlayerStatsRegistration
|
||||
|
||||
/**
|
||||
* Registers the {@link appeng.core.stats.AchievementHierarchy} and adds all {@link appeng.core.stats.Achievements}
|
||||
* to a new {@link net.minecraftforge.common.AchievementPage}.
|
||||
* to a new {@link net.minecraft.advancements.Advancement}.
|
||||
*/
|
||||
public void registerAchievements()
|
||||
{
|
||||
@@ -100,19 +97,19 @@ public class PlayerStatsRegistration
|
||||
/**
|
||||
* register
|
||||
*/
|
||||
final ArrayList<Achievement> list = new ArrayList<Achievement>();
|
||||
|
||||
for( final Achievements a : Achievements.values() )
|
||||
{
|
||||
final Achievement ach = a.getAchievement();
|
||||
if( ach != null )
|
||||
{
|
||||
list.add( ach );
|
||||
}
|
||||
}
|
||||
|
||||
final AchievementPage ae2AchievementPage = new AchievementPage( "Applied Energistics 2", list.toArray( new Achievement[list.size()] ) );
|
||||
AchievementPage.registerAchievementPage( ae2AchievementPage );
|
||||
// final ArrayList<Achievement> list = new ArrayList<Achievement>();
|
||||
//
|
||||
// for( final Achievements a : Achievements.values() )
|
||||
// {
|
||||
// final Achievement ach = a.getAchievement();
|
||||
// if( ach != null )
|
||||
// {
|
||||
// list.add( ach );
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// final AchievementPage ae2AchievementPage = new AchievementPage( "Applied Energistics 2", list.toArray( new Achievement[list.size()] ) );
|
||||
// AchievementPage.registerAchievementPage( ae2AchievementPage );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import appeng.core.AEConfig;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
|
||||
@MCVersion( "1.11.2" )
|
||||
@MCVersion( "1.12" )
|
||||
public final class AppEngCore extends DummyModContainer implements IFMLLoadingPlugin
|
||||
{
|
||||
private final ModMetadata metadata = new ModMetadata();
|
||||
|
||||
@@ -57,7 +57,7 @@ public class TileItemGen extends AEBaseTile implements IInventory
|
||||
else
|
||||
{
|
||||
final NonNullList<ItemStack> list = NonNullList.create();
|
||||
mi.getSubItems( mi, mi.getCreativeTab(), list );
|
||||
mi.getSubItems( mi.getCreativeTab(), list );
|
||||
POSSIBLE_ITEMS.addAll( list );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ package appeng.decorative.solid;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
@@ -82,7 +82,7 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
|
||||
final int k = MathHelper.floor( this.posZ );
|
||||
|
||||
IBlockState state = this.world.getBlockState( new BlockPos( j, i, k ) );
|
||||
final Material mat = state.getBlock().getMaterial( state );
|
||||
final Material mat = state.getMaterial();
|
||||
|
||||
if( Platform.isServer() && mat.isLiquid() )
|
||||
{
|
||||
|
||||
@@ -79,7 +79,7 @@ public class RenderTinyTNTPrimed extends Render
|
||||
f2 = ( 1.0F - ( tnt.getFuse() - life + 1.0F ) / 100.0F ) * 0.8F;
|
||||
this.bindEntityTexture( tnt );
|
||||
GlStateManager.translate( -0.5F, -0.5F, 0.5F );
|
||||
blockrendererdispatcher.renderBlockBrightness( Blocks.TNT.getDefaultState(), tnt.getBrightness( life ) );
|
||||
blockrendererdispatcher.renderBlockBrightness( Blocks.TNT.getDefaultState(), tnt.getBrightness() );
|
||||
GlStateManager.translate( 0.0F, 0.0F, 1.0F );
|
||||
|
||||
if( tnt.getFuse() / 5 % 2 == 0 )
|
||||
|
||||
@@ -254,7 +254,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
|
||||
}
|
||||
else
|
||||
{
|
||||
final ItemStack testOutput = CraftingManager.getInstance().findMatchingRecipe( this.testFrame, w );
|
||||
final ItemStack testOutput = CraftingManager.findMatchingResult( this.testFrame, w );
|
||||
|
||||
if( Platform.itemComparisons().isSameItem( this.correctOutput, testOutput ) )
|
||||
{
|
||||
|
||||
@@ -86,6 +86,17 @@ class CondenserCategory extends BlankRecipeCategory<CondenserOutputWrapper>
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the mod associated with this recipe category.
|
||||
* Used for the recipe category tab's tooltip.
|
||||
*
|
||||
* @since JEI 4.5.0
|
||||
*/
|
||||
@Override
|
||||
public String getModName() {
|
||||
return AppEng.MOD_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
|
||||
@@ -49,6 +49,9 @@ class GrinderRecipeCategory extends BlankRecipeCategory<GrinderRecipeWrapper>
|
||||
this.background = guiHelper.createDrawable( location, 11, 16, 154, 64 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() { return AppEng.MOD_NAME; }
|
||||
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
|
||||
@@ -73,6 +73,17 @@ class InscriberRecipeCategory extends BlankRecipeCategory<InscriberRecipeWrapper
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the mod associated with this recipe category.
|
||||
* Used for the recipe category tab's tooltip.
|
||||
*
|
||||
* @since JEI 4.5.0
|
||||
*/
|
||||
@Override
|
||||
public String getModName() {
|
||||
return AppEng.MOD_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ class ShapedRecipeWrapper extends BlankRecipeWrapper implements IShapedCraftingR
|
||||
{
|
||||
final boolean useSingleItems = AEConfig.instance().disableColoredCableRecipesInJEI();
|
||||
|
||||
Object[] items = recipe.getIngredients();
|
||||
Object[] items = recipe.getIIngredients();
|
||||
int width = recipe.getWidth();
|
||||
int height = recipe.getHeight();
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
package appeng.integration.modules.theoneprobe;
|
||||
|
||||
|
||||
import com.google.common.base.Function;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
|
||||
import mcjty.theoneprobe.api.ITheOneProbe;
|
||||
@@ -28,6 +26,8 @@ import mcjty.theoneprobe.api.ITheOneProbe;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.modules.theoneprobe.config.AEConfigProvider;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
|
||||
public class TheOneProbeModule implements IIntegrationModule, Function<ITheOneProbe, Void>
|
||||
{
|
||||
|
||||
@@ -21,11 +21,15 @@ package appeng.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
public abstract class AEBaseItem extends Item
|
||||
@@ -43,18 +47,19 @@ public abstract class AEBaseItem extends Item
|
||||
return getClass().getSimpleName() + "[" + regName + "]";
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public final void addInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo )
|
||||
public final void addInformation( final ItemStack stack, final World world, final List lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
this.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
this.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public final void getSubItems( final Item sameItem, final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
public final void getSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
this.getCheckedSubItems( sameItem, creativeTab, itemStacks );
|
||||
this.getCheckedSubItems( creativeTab, itemStacks );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,14 +68,15 @@ public abstract class AEBaseItem extends Item
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addInformation( stack, player, lines, displayMoreInfo );
|
||||
super.addInformation( stack, world, lines, advancedTooltips );
|
||||
}
|
||||
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
super.getSubItems( sameItem, creativeTab, itemStacks );
|
||||
super.getSubItems( creativeTab, itemStacks );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import java.util.regex.Pattern;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@@ -50,6 +51,8 @@ import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import appeng.api.config.Upgrades;
|
||||
@@ -83,10 +86,11 @@ public final class ItemMaterial extends AEBaseItem implements IStorageComponent,
|
||||
instance = this;
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
super.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
|
||||
final MaterialType mt = this.getTypeByStack( stack );
|
||||
if( mt == null )
|
||||
@@ -259,7 +263,7 @@ public final class ItemMaterial extends AEBaseItem implements IStorageComponent,
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
final List<MaterialType> types = Arrays.asList( MaterialType.values() );
|
||||
Collections.sort( types, new Comparator<MaterialType>()
|
||||
|
||||
@@ -26,10 +26,10 @@ import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.NonNullList;
|
||||
@@ -47,6 +47,8 @@ import appeng.entity.EntityGrowingCrystal;
|
||||
import appeng.entity.EntityIds;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
@@ -160,13 +162,14 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
lines.add( ButtonToolTips.DoesntDespawn.getLocal() );
|
||||
final int progress = getProgress( stack ) % SINGLE_OFFSET;
|
||||
lines.add( Math.floor( (float) progress / (float) ( SINGLE_OFFSET / 100 ) ) + "%" );
|
||||
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
super.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -239,7 +242,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
// lvl 0
|
||||
itemStacks.add( newStyle( new ItemStack( this, 1, CERTUS ) ) );
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -43,6 +44,8 @@ import appeng.core.localization.GuiText;
|
||||
import appeng.helpers.PatternHelper;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternItem
|
||||
@@ -98,9 +101,10 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
final ICraftingPatternDetails details = this.getPatternForItem( stack, player.world );
|
||||
final ICraftingPatternDetails details = this.getPatternForItem( stack, world );
|
||||
|
||||
if( details == null )
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ItemPaintBall extends AEBaseItem
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
for( final AEColor c : AEColor.values() )
|
||||
{
|
||||
|
||||
@@ -95,7 +95,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
this.calculateSubTypes();
|
||||
itemStacks.addAll( this.subTypes );
|
||||
@@ -118,7 +118,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
final NonNullList<ItemStack> tmpList = NonNullList.create();
|
||||
b.getSubBlocks( item, b.getCreativeTabToDisplayOn(), tmpList );
|
||||
b.getSubBlocks( b.getCreativeTabToDisplayOn(), tmpList );
|
||||
for( final ItemStack l : tmpList )
|
||||
{
|
||||
final ItemStack facade = this.createFacadeForItem( l, false );
|
||||
|
||||
@@ -196,7 +196,7 @@ public final class ItemPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
final List<Entry<Integer, PartTypeWithVariant>> types = new ArrayList<Entry<Integer, PartTypeWithVariant>>( this.registered.entrySet() );
|
||||
Collections.sort( types, REGISTERED_COMPARATOR );
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.items.storage;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -55,6 +56,8 @@ import appeng.items.contents.CellUpgrades;
|
||||
import appeng.items.materials.MaterialType;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, IItemGroup
|
||||
@@ -94,8 +97,9 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import appeng.api.AEApi;
|
||||
import appeng.api.storage.ICellInventoryHandler;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -31,6 +32,9 @@ import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.storage.ICellWorkbenchItem;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.items.contents.CellConfig;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -72,8 +76,9 @@ public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenc
|
||||
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@Override
|
||||
public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.items.storage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -36,6 +37,8 @@ import appeng.items.AEBaseItem;
|
||||
import appeng.spatial.StorageHelper;
|
||||
import appeng.spatial.StorageWorldProvider;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorageCell
|
||||
@@ -48,8 +51,9 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
this.maxRegion = spatialScale;
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
final WorldCoord wc = this.getStoredSize( stack );
|
||||
if( wc.x > 0 )
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.util.List;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -41,6 +42,8 @@ import appeng.api.networking.security.ISecurityRegistry;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
@@ -176,7 +179,8 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
final EnumSet<SecurityPermissions> perms = this.getPermissions( stack );
|
||||
if( perms.isEmpty() )
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.items.tools;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -38,6 +39,8 @@ import appeng.core.localization.GuiText;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
@@ -48,7 +51,8 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
lines.add( this.getLocalizedName( this.getSettingsName( stack ) + ".name", this.getSettingsName( stack ) ) );
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.block.BlockStainedGlass;
|
||||
import net.minecraft.block.BlockStainedGlassPane;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -45,6 +46,8 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -419,9 +422,10 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
super.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
|
||||
final IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@@ -77,6 +78,8 @@ import appeng.me.storage.CellInventoryHandler;
|
||||
import appeng.tile.misc.TilePaint;
|
||||
import appeng.util.LookDirection;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
@@ -87,10 +90,11 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
super( AEConfig.instance().getMatterCannonBattery() );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
super.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
|
||||
final IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
@@ -191,7 +195,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
private void shootPaintBalls( final ItemStack type, final World w, final EntityPlayer p, final Vec3d Vec3d, final Vec3d Vec3d1, final Vec3d direction, final double d0, final double d1, final double d2 )
|
||||
{
|
||||
final AxisAlignedBB bb = new AxisAlignedBB( Math.min( Vec3d.x, Vec3d1.x ), Math.min( Vec3d.y, Vec3d1.y ), Math.min( Vec3d.z, Vec3d1.z ), Math.max( Vec3d.x, Vec3d1.x ), Math.max( Vec3d.y, Vec3d1.y ), Math.max( Vec3d.z, Vec3d1.z ) ).expand( 16, 16, 16 );
|
||||
final AxisAlignedBB bb = new AxisAlignedBB( Math.min( Vec3d.x, Vec3d1.x ), Math.min( Vec3d.y, Vec3d1.y ), Math.min( Vec3d.z, Vec3d1.z ), Math.max( Vec3d.x, Vec3d1.x ), Math.max( Vec3d.y, Vec3d1.y ), Math.max( Vec3d.z, Vec3d1.z ) ).grow( 16, 16, 16 );
|
||||
|
||||
Entity entity = null;
|
||||
final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
|
||||
@@ -213,7 +217,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
final float f1 = 0.3F;
|
||||
|
||||
final AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().expand( f1, f1, f1 );
|
||||
final AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().grow( f1, f1, f1 );
|
||||
final RayTraceResult RayTraceResult = boundingBox.calculateIntercept( Vec3d, Vec3d1 );
|
||||
|
||||
if( RayTraceResult != null )
|
||||
@@ -309,7 +313,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
{
|
||||
hasDestroyed = false;
|
||||
|
||||
final AxisAlignedBB bb = new AxisAlignedBB( Math.min( Vec3d.x, Vec3d1.x ), Math.min( Vec3d.y, Vec3d1.y ), Math.min( Vec3d.z, Vec3d1.z ), Math.max( Vec3d.x, Vec3d1.x ), Math.max( Vec3d.y, Vec3d1.y ), Math.max( Vec3d.z, Vec3d1.z ) ).expand( 16, 16, 16 );
|
||||
final AxisAlignedBB bb = new AxisAlignedBB( Math.min( Vec3d.x, Vec3d1.x ), Math.min( Vec3d.y, Vec3d1.y ), Math.min( Vec3d.z, Vec3d1.z ), Math.max( Vec3d.x, Vec3d1.x ), Math.max( Vec3d.y, Vec3d1.y ), Math.max( Vec3d.z, Vec3d1.z ) ).grow( 16, 16, 16 );
|
||||
|
||||
Entity entity = null;
|
||||
final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
|
||||
@@ -331,7 +335,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
final float f1 = 0.3F;
|
||||
|
||||
final AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().expand( f1, f1, f1 );
|
||||
final AxisAlignedBB boundingBox = entity1.getEntityBoundingBox().grow( f1, f1, f1 );
|
||||
final RayTraceResult RayTraceResult = boundingBox.calculateIntercept( Vec3d, Vec3d1 );
|
||||
|
||||
if( RayTraceResult != null )
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.items.tools.powered;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -78,9 +79,10 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
super.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
|
||||
final IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.items.tools.powered;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -70,9 +71,10 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
super.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
|
||||
if( stack.hasTagCompound() )
|
||||
{
|
||||
|
||||
@@ -22,12 +22,12 @@ package appeng.items.tools.powered.powersink;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
@@ -36,6 +36,8 @@ import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
@@ -52,8 +54,9 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
|
||||
this.powerCapacity = powerCapacity;
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
final NBTTagCompound tag = stack.getTagCompound();
|
||||
double internalCurrentPower = 0;
|
||||
@@ -77,9 +80,9 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
super.getCheckedSubItems( sameItem, creativeTab, itemStacks );
|
||||
super.getCheckedSubItems( creativeTab, itemStacks );
|
||||
|
||||
final ItemStack charged = new ItemStack( this, 1 );
|
||||
final NBTTagCompound tag = Platform.openNbtData( charged );
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user