Skip to content

Commit

Permalink
Ported to MC 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Deadrik committed Mar 8, 2017
1 parent 93e8960 commit 6095a30
Show file tree
Hide file tree
Showing 3,833 changed files with 12,971 additions and 4,891 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 3 additions & 3 deletions build.prop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
minecraft_version=1.10.2
forge_version=12.18.2.2124
minecraft_version=1.11.2
forge_version=13.20.0.2228
mod_version=0.1.0
mod_id=TFC2
group_name=com.bioxx.tfc2
mappings = snapshot_20160922
mappings = snapshot_20170308
Binary file added libs/AppleCore-mc1.10.2-2.1.0+218.cf713-deobf.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions src/API/com/bioxx/jmapgen/dungeon/RoomSchematic.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public class RoomJSON {
@Expose
private List<String> blockMap = new ArrayList<String>();

@SerializedName("floorY")
@SerializedName("floory")
@Expose
private Integer floorY = 0;

Expand All @@ -286,11 +286,11 @@ public class RoomJSON {
@Expose
private double weight = 1.0;

@SerializedName("roomType")
@SerializedName("roomtype")
@Expose
private String roomType = "normal";

@SerializedName("setPieceMap")
@SerializedName("setpiecemap")
@Expose
private List<String> setPieceMap = new ArrayList<String>();

Expand Down
21 changes: 0 additions & 21 deletions src/API/com/bioxx/tfc2/api/crafting/CraftingManagerTFC.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.world.World;

import com.bioxx.tfc2.api.interfaces.IRecipeTFC;
Expand Down Expand Up @@ -194,24 +193,4 @@ public enum RecipeType
NORMAL, KNAPPING, ANVIL;
}

public ItemStack[] getRemainingItems(InventoryCrafting craftMatrix, World worldIn)
{
for (IRecipe irecipe : this.recipes)
{
if (irecipe.matches(craftMatrix, worldIn))
{
return irecipe.getRemainingItems(craftMatrix);
}
}

ItemStack[] aitemstack = new ItemStack[craftMatrix.getSizeInventory()];

for (int i = 0; i < aitemstack.length; ++i)
{
aitemstack[i] = craftMatrix.getStackInSlot(i);
}

return aitemstack;
}

}
3 changes: 2 additions & 1 deletion src/API/com/bioxx/tfc2/api/crafting/ShapedOreRecipeTFC.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;

import net.minecraftforge.common.ForgeHooks;
Expand Down Expand Up @@ -292,7 +293,7 @@ public Object[] getInput()
}

@Override
public ItemStack[] getRemainingItems(InventoryCrafting inv) //getRecipeLeftovers
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) //getRecipeLeftovers
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;

import net.minecraftforge.common.ForgeHooks;
Expand Down Expand Up @@ -187,7 +188,7 @@ public ArrayList<Object> getInput()
}

@Override
public ItemStack[] getRemainingItems(InventoryCrafting inv) //getRecipeLeftovers
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) //getRecipeLeftovers
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
Expand Down
2 changes: 1 addition & 1 deletion src/API/com/bioxx/tfc2/api/render/ui/UICharComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void setupGL()

public float setupChar(char ch)
{
int i = Minecraft.getMinecraft().fontRendererObj.getCharWidth(ch) & 255;
int i = Minecraft.getMinecraft().fontRenderer.getCharWidth(ch) & 255;
renderChar = ch;
if (i == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/API/com/bioxx/tfc2/api/util/Helper.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static ItemStack[] readStackArrayFromNBTList(NBTTagList list, int size)
NBTTagCompound tag = list.getCompoundTagAt(i);
byte byte0 = tag.getByte("Slot");
if(byte0 >= 0 && byte0 < size)
out[byte0] = ItemStack.loadItemStackFromNBT(tag);
out[byte0] = new ItemStack(tag);
}
return out;
}
Expand Down
1 change: 1 addition & 0 deletions src/ASM/com/bioxx/tfc2/ASMConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class ASMConstants
public static final String ITEMSTACK = "net.minecraft.item.ItemStack";
public static final String CREATIVETABS = "net.minecraft.creativetab.CreativeTabs";
public static final String NBTTAGCOMPOUND = "net.minecraft.nbt.NBTTagCompound";
public static final String NONNULLLIST = "net.minecraft.util.NonNullList";

//TFC
public static final String ENUMFOODGROUP = "com.bioxx.tfc2.api.types.EnumFoodGroup";
Expand Down
2 changes: 1 addition & 1 deletion src/ASM/com/bioxx/tfc2/asm/transform/ModuleFood.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ else if (transformedName.equals("net.minecraft.item.ItemFood"))
}
else if (transformedName.equals("net.minecraft.item.ItemFishFood"))
{
MethodNode methodNode = ASMHelper.findMethodNodeOfClass(classNode, "a", "getSubItems", ASMHelper.toMethodDescriptor("V",ObfHelper.toObfClassName(ASMConstants.ITEM), ObfHelper.toObfClassName(ASMConstants.CREATIVETABS), ASMConstants.LIST));
MethodNode methodNode = ASMHelper.findMethodNodeOfClass(classNode, "a", "getSubItems", ASMHelper.toMethodDescriptor("V",ObfHelper.toObfClassName(ASMConstants.ITEM), ObfHelper.toObfClassName(ASMConstants.CREATIVETABS), ASMConstants.NONNULLLIST));

if (methodNode != null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Common/com/bioxx/tfc2/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,6 @@ public void sendToAllNear(World world, BlockPos pos, int range, Packet<?> packet
@Override
public EntityPlayer getPlayer()
{
return Minecraft.getMinecraft().thePlayer;
return Minecraft.getMinecraft().player;
}
}
34 changes: 17 additions & 17 deletions src/Common/com/bioxx/tfc2/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,23 @@ protected void registerWorldGen()
protected void registerEntities()
{
DataSerializersTFC.register();
EntityRegistry.registerModEntity(EntityCart.class, "Cart", 0, TFC.instance, 80, 3, true, 0x000000, 0x00ff00);
EntityRegistry.registerModEntity(EntityBear.class, "Bear", 1, TFC.instance, 80, 3, true, 0x000000, 0xff0000);
EntityRegistry.registerModEntity(EntityBearPanda.class, "BearPanda", 2, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntityLion.class, "Lion", 3, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntityTiger.class, "Tiger", 4, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntityRhino.class, "Rhino", 5, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntityElephant.class, "Elephant", 6, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntityMammoth.class, "Mammoth", 7, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntityBoar.class, "Boar", 8, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntityBison.class, "Bison", 9, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntityFoxRed.class, "FoxRed", 10, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntityFoxArctic.class, "FoxArctic", 11, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntityFoxDesert.class, "FoxDesert", 12, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntityHippo.class, "Hippo", 13, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntityBigCat.class, "BigCat", 14, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntitySabertooth.class, "Sabertooth", 15, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(EntityElk.class, "Elk", 16, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"Cart"), EntityCart.class, "Cart", 0, TFC.instance, 80, 3, true, 0x000000, 0x00ff00);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"Bear"), EntityBear.class, "Bear", 1, TFC.instance, 80, 3, true, 0x000000, 0xff0000);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"BearPanda"), EntityBearPanda.class, "BearPanda", 2, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"Lion"), EntityLion.class, "Lion", 3, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"Tiger"), EntityTiger.class, "Tiger", 4, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"Rhino"), EntityRhino.class, "Rhino", 5, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"Elephant"), EntityElephant.class, "Elephant", 6, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"Mammoth"), EntityMammoth.class, "Mammoth", 7, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"Boar"), EntityBoar.class, "Boar", 8, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"Bison"), EntityBison.class, "Bison", 9, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"FoxRed"), EntityFoxRed.class, "FoxRed", 10, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"FoxArctic"), EntityFoxArctic.class, "FoxArctic", 11, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"FoxDesert"), EntityFoxDesert.class, "FoxDesert", 12, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"Hippo"), EntityHippo.class, "Hippo", 13, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"BigCat"), EntityBigCat.class, "BigCat", 14, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"Sabertooth"), EntitySabertooth.class, "Sabertooth", 15, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
EntityRegistry.registerModEntity(Core.CreateRes(Reference.ModID+"Elk"), EntityElk.class, "Elk", 16, TFC.instance, 80, 3, true, 0x000000, 0xffffff);
}

public void postInit(FMLPostInitializationEvent event)
Expand Down
6 changes: 3 additions & 3 deletions src/Common/com/bioxx/tfc2/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public static boolean isNaturalLog(IBlockState state)
*/
public static float getMoistureFromChunk(ChunkCache w, BlockPos pos)
{
Chunk c = w.worldObj.getChunkFromBlockCoords(pos);
Chunk c = w.world.getChunkFromBlockCoords(pos);
byte[] moistureArray = c.getBiomeArray();
byte b = moistureArray[(pos.getZ() & 0xF) << 4 | (pos.getX() & 0xF)];
int s = (b & 0xFF);
Expand Down Expand Up @@ -261,12 +261,12 @@ public static void dropItem(World world, double posX, double posY, double posZ,
ei.motionX = -0.07+world.rand.nextFloat() * 0.14;
ei.motionY = 0.15;
ei.motionZ = -0.07+world.rand.nextFloat() * 0.14;
world.spawnEntityInWorld(ei);
world.spawnEntity(ei);
}

public static void playSoundAtEntity(Entity e, SoundEvent name, float volume, float pitch)
{
e.worldObj.playSound(e.posX, e.posY, e.posZ, name, SoundCategory.BLOCKS, volume, pitch, false);
e.world.playSound(e.posX, e.posY, e.posZ, name, SoundCategory.BLOCKS, volume, pitch, false);
}

public static boolean isCenterInRect(Center c, int x, int z, int xRange, int zRange)
Expand Down
10 changes: 5 additions & 5 deletions src/Common/com/bioxx/tfc2/blocks/BlockAnvil.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
Expand Down Expand Up @@ -60,7 +60,7 @@ public BlockAnvil()

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer playerIn,
net.minecraft.util.EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
net.minecraft.util.EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
{
EnumFacing facing = state.getValue(BlockAnvil.FACING);
TileAnvil te = (TileAnvil)world.getTileEntity(pos);
Expand Down Expand Up @@ -113,9 +113,9 @@ public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
}

@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand)
{
worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()));
return worldIn.getBlockState(pos).withProperty(FACING, placer.getHorizontalFacing());
}

/*******************************************************************************
Expand Down Expand Up @@ -194,7 +194,7 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc
}

@Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World worldIn, BlockPos pos)
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{
if(state.getValue(FACING) == EnumFacing.NORTH || state.getValue(FACING) == EnumFacing.SOUTH)
return AABB_NS;
Expand Down
4 changes: 3 additions & 1 deletion src/Common/com/bioxx/tfc2/blocks/BlockClimbingRocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.util.List;

import javax.annotation.Nullable;

import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
Expand Down Expand Up @@ -119,7 +121,7 @@ public boolean isPassable(IBlockAccess worldIn, BlockPos pos)
}

@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, Entity entityIn)
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_)
{

}
Expand Down
9 changes: 5 additions & 4 deletions src/Common/com/bioxx/tfc2/blocks/BlockCrop.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
Expand Down Expand Up @@ -58,7 +59,7 @@ public BlockCrop()
*******************************************************************************/

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, net.minecraft.util.EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
if(worldIn.isRemote)
return false;
Expand All @@ -70,7 +71,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state,
//If the event is canceled then skip all of our code.
if(!event.isCanceled())
{
worldIn.setBlockToAir(pos);
((World)worldIn).setBlockToAir(pos);

if(tile.getGrowthStage() >= tile.getCropType().getGrowthStages() - 1)
{
Expand All @@ -79,7 +80,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state,
while(iter.hasNext())
{
ItemStack is = ((ItemStack) iter.next()).copy();
is.stackSize = 1;
is.setCount(1);
if(is.getItem() instanceof IFood)
Food.setDecayTimer(is, worldIn.getWorldTime()+Food.getExpirationTimer(is));
Core.dropItem(worldIn, pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, is);
Expand Down Expand Up @@ -120,7 +121,7 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc
}

@Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos)
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
{
return NULL_AABB;
}
Expand Down
11 changes: 6 additions & 5 deletions src/Common/com/bioxx/tfc2/blocks/BlockGravity.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.init.Blocks;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

import com.bioxx.jmapgen.RandomCollection;
Expand All @@ -31,9 +32,9 @@ public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
}

@Override
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn)
public void onNeighborChange(IBlockAccess worldIn, BlockPos pos, BlockPos blockIn)
{
world.scheduleUpdate(pos, this, tickRate(world));
((World)worldIn).scheduleUpdate(pos, this, tickRate((World)worldIn));
}

@Override
Expand All @@ -54,7 +55,7 @@ protected void checkFallable(World worldIn, BlockPos pos, IBlockState state)
}
else if(slidePos != null && (slidePos.getY() >= 0))
{
worldIn.setBlockToAir(pos);
((World)worldIn).setBlockToAir(pos);
fall(worldIn, slidePos, state);
}
}
Expand All @@ -69,12 +70,12 @@ protected void fall(World worldIn, BlockPos pos, IBlockState state)
{
EntityFallingBlockTFC entityfallingblock = new EntityFallingBlockTFC(worldIn, pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D, state);
onStartFalling(entityfallingblock);
worldIn.spawnEntityInWorld(entityfallingblock);
worldIn.spawnEntity(entityfallingblock);
}
}
else
{
worldIn.setBlockToAir(pos);
((World)worldIn).setBlockToAir(pos);

BlockPos blockpos;
for (blockpos = pos.down(); (canFallInto(worldIn, blockpos)) && (blockpos.getY() > 0); blockpos = blockpos.down()) {}
Expand Down
Loading

0 comments on commit 6095a30

Please sign in to comment.