Skip to content

Commit

Permalink
Highly incomplete code. First work on porting to 1.12. Still need to …
Browse files Browse the repository at this point in the history
…rework a LOT of things.
  • Loading branch information
GuntherDW committed Jul 5, 2017
1 parent d67f97c commit fbcf8c4
Show file tree
Hide file tree
Showing 127 changed files with 849 additions and 424 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
Expand Down
15 changes: 7 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ aebasename=appliedenergistics2
#########################################################
# Versions #
#########################################################
minecraft_version=1.11.2
mcp_mappings=stable_32
forge_version=13.20.1.2388
minecraft_version=1.12
mcp_mappings=snapshot_20170704
forge_version=14.21.1.2395

#########################################################
# Installable #
Expand All @@ -19,8 +19,7 @@ waila_version=1.7.0-B3_1.9.4
#########################################################
# Provided APIs #
#########################################################
jei_version=4.3.6.282
tesla_version=1.11-1.3.0.51
ic2_version=2.7.57-ex111
top_version=1.11-1.3.3-46
compatlayer_version=1.11.2-0.2.9
jei_version=4.7.1.69
tesla_version=1.0.61
ic2_version=2.8.7-ex112
top_version=1.12-1.4.8-2
8 changes: 4 additions & 4 deletions gradle/scripts/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ dependencies {
// installable runtime dependencies
//mods "mcp.mobius.waila:Waila:${waila_version}"
//mods "net.industrial-craft:industrialcraft-2:${ic2_version}:dev"
mods "mcjty.theoneprobe:TheOneProbe:${top_version}"
mods "com.github.mcjty:compatlayer:${compatlayer_version}"
mods "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}"
// mods "com.github.mcjty:compatlayer:${compatlayer_version}"

// compile against provided APIs
compileOnly "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
//compileOnly "mcp.mobius.waila:Waila:${waila_version}"
compileOnly "net.darkhax.tesla:Tesla:${tesla_version}"
compileOnly "net.darkhax.tesla:Tesla-1.12:${tesla_version}"
//compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
compileOnly "mcjty.theoneprobe:TheOneProbe:${top_version}:api"
compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}:api"

// at runtime, use the full JEI jar
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"
Expand Down
13 changes: 1 addition & 12 deletions gradle/scripts/optional.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,8 @@ task deinstallIC2(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*industrialcraft-2*.jar")
}

// COMPATLAYER
task installCompatLayer(type: Copy, dependsOn: "deinstallCompatLayer") {
from { configurations.mods }
include "**/*compatlayer*.jar"
into file(minecraft.runDir + "/mods")
}

task deinstallCompatLayer(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*compatlayer*.jar")
}

// TOP
task installTop(type: Copy, dependsOn: ["deinstallTop", "installCompatLayer"]) {
task installTop(type: Copy, dependsOn: ["deinstallTop"]) {
from { configurations.mods }
include "**/*TheOneProbe*.jar"
into file(minecraft.runDir + "/mods")
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Fri Sep 16 14:56:32 CEST 2016
#Tue Jul 04 22:38:49 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/appeng/block/AEBaseBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
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;
Expand Down Expand Up @@ -99,18 +100,21 @@ protected BlockStateContainer createBlockState()
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_)
{
Expand All @@ -135,6 +139,7 @@ public void addCollisionBoxToList( final IBlockState state, final World w, final
}
}

@SuppressWarnings( "deprecation" )
@Override
@SideOnly( Side.CLIENT )
public AxisAlignedBB getSelectedBoundingBox( IBlockState state, final World w, final BlockPos pos )
Expand Down Expand Up @@ -221,12 +226,14 @@ public AxisAlignedBB getSelectedBoundingBox( IBlockState state, final World w, f
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 )
{
Expand Down Expand Up @@ -274,12 +281,14 @@ public RayTraceResult collisionRayTrace( final IBlockState state, final World w,
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 )
{
Expand Down Expand Up @@ -332,8 +341,9 @@ public EnumFacing[] getValidRotations( final World w, final BlockPos pos )
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 )
{

}
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/appeng/block/AEBaseItemBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

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;
Expand Down Expand Up @@ -67,15 +68,15 @@ public int getMetadata( final int dmg )
@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
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/appeng/block/AEBaseItemBlockChargeable.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
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;

Expand All @@ -48,9 +50,9 @@ public AEBaseItemBlockChargeable( final Block id )

@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();

Expand All @@ -61,7 +63,7 @@ public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer

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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public IExtendedBlockState getExtendedState( IBlockState state, IBlockAccess wor

@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 ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/appeng/block/networking/BlockCableBus.java
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public boolean recolorBlock( final World world, final BlockPos pos, final EnumFa

@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
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/appeng/block/networking/BlockController.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
import appeng.block.AEBaseTileBlock;
import appeng.tile.networking.TileController;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public class BlockController extends AEBaseTileBlock
{

Expand Down Expand Up @@ -96,6 +99,7 @@ protected BlockStateContainer createBlockState()
* 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 )
{
Expand Down Expand Up @@ -155,6 +159,7 @@ public int getMetaFromState( final IBlockState state )
return state.getValue( CONTROLLER_STATE ).ordinal();
}

@SuppressWarnings( "deprecation" )
@Override
public IBlockState getStateFromMeta( final int meta )
{
Expand All @@ -168,6 +173,7 @@ public BlockRenderLayer getBlockLayer()
return BlockRenderLayer.CUTOUT;
}

@SuppressWarnings( "deprecation" )
@Override
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/appeng/block/networking/BlockEnergyCell.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public BlockEnergyCell()

@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 );
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/appeng/block/paint/BlockPaint.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public BlockRenderLayer getBlockLayer()

@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
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/appeng/block/paint/PaintBakedModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
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;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/appeng/block/paint/PaintModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

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;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/appeng/block/qnb/QnbFormedBakedModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
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;
Expand All @@ -18,7 +18,6 @@
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;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/appeng/block/qnb/QnbFormedModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@


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;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/appeng/block/spatial/BlockMatrixFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public BlockMatrixFrame()

@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
}
Expand Down
Loading

0 comments on commit fbcf8c4

Please sign in to comment.