Skip to content

Commit

Permalink
downgrade to 1.8.9
Browse files Browse the repository at this point in the history
  • Loading branch information
cvrunmin committed Jun 12, 2016
1 parent 53a1844 commit 705ac95
Show file tree
Hide file tree
Showing 71 changed files with 1,803 additions and 1,615 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ plugins {
*/
targetCompatibility = "1.7"
sourceCompatibility = "1.7"
version = "1.1-mc1.9"
version = "1.1-mc1.8.9"
group= "io.github.cvronmin.railwayp" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "railwayp"
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
minecraft {
version = "1.9-12.16.1.1887"
version = "1.8.9-11.15.1.1722"
runDir = "run"

// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not allways work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "stable_24"
mappings = "stable_20"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}

Expand Down
15 changes: 2 additions & 13 deletions src/main/java/io/github/cvronmin/railwayp/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import io.github.cvronmin.railwayp.tileentity.TileEntityWHPF;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.network.INetHandler;
Expand Down Expand Up @@ -56,18 +56,7 @@ private void registerEntity(){
GameRegistry.registerTileEntity(TileEntityColorful.class, "Colorful");
GameRegistry.registerTileEntity(TileEntityRailNoticer.class, "noticer");
}
protected void blockRend(Block block, String registerName){
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0,
new ModelResourceLocation("railwayp:" + registerName, "inventory"));
}
protected void itemRend(Item item, String registerName){
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0,
new ModelResourceLocation("railwayp:" + registerName, "inventory"));
}
protected void itemRend(Item item, int damage, String ideniter){
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, damage,
new ModelResourceLocation("railwayp:" + ideniter, "inventory"));
}

public EntityPlayer getPlayerFromNetHandler(INetHandler handler)
{
if (handler instanceof NetHandlerPlayServer)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/github/cvronmin/railwayp/Reference.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public class Reference {
public static final String MODID = "railwayp";
public static final String NAME = "StatCraft";
public static final String VERSION = "1.1-mc1.9";
public static final String VERSION = "1.1-mc1.8.9";
public static final String CPROXY = "io.github.cvronmin.railwayp.client" + ".ClientProxy";
public static final String SPROXY = "io.github.cvronmin.railwayp" + ".CommonProxy";
}
25 changes: 11 additions & 14 deletions src/main/java/io/github/cvronmin/railwayp/block/BlockColorful.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package io.github.cvronmin.railwayp.block;

import io.github.cvronmin.railwayp.init.RPItems;
import io.github.cvronmin.railwayp.tileentity.TileEntityColorful;
import io.github.cvronmin.railwayp.tileentity.TileEntityPlatformBanner;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
Expand All @@ -11,9 +9,8 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumWorldBlockLayer;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
Expand All @@ -22,28 +19,28 @@
public class BlockColorful extends BlockContainer{

public BlockColorful(){
this(Material.CLAY);
this(Material.clay);
}
public BlockColorful(Material material) {
super(material);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setCreativeTab(CreativeTabs.tabBlock);
}
@SideOnly(Side.CLIENT)
public BlockRenderLayer getBlockLayer()
public EnumWorldBlockLayer getBlockLayer()
{
return BlockRenderLayer.CUTOUT_MIPPED;
return EnumWorldBlockLayer.CUTOUT_MIPPED;
}
/**
* The type of render function called. 3 for standard block models, 2 for TESR's, 1 for liquids, -1 is no render
*/
public EnumBlockRenderType getRenderType(IBlockState state)
public int getRenderType()
{
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
return 2;
}
/**
* Used to determine ambient occlusion and culling when rebuilding chunks for render
*/
public boolean isOpaqueCube(IBlockState state)
public boolean isOpaqueCube()
{
return false;
}
Expand Down Expand Up @@ -78,7 +75,7 @@ public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
ItemStack itemstack = this.getTileDataItemStack(worldIn, pos, state);
return itemstack != null ? itemstack : new ItemStack(this);
}
public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te, ItemStack stack)
public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te)
{
if (te instanceof TileEntityColorful)
{
Expand All @@ -94,7 +91,7 @@ public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBloc
}
else
{
super.harvestBlock(worldIn, player, pos, state, (TileEntity)null, stack);
super.harvestBlock(worldIn, player, pos, state, (TileEntity)null);
}
}
@Override
Expand Down
136 changes: 89 additions & 47 deletions src/main/java/io/github/cvronmin/railwayp/block/BlockNameBanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
Expand All @@ -28,18 +27,26 @@
public class BlockNameBanner extends BlockContainer{
public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
public static final PropertyInteger ROTATION = PropertyInteger.create("rotation", 0, 15);
//protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D);

public BlockNameBanner() {
super(Material.WOOD);
super(Material.wood);
this.disableStats();
float f = 0.25F;
float f1 = 1.0F;
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
}
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos)
public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state)
{
return NULL_AABB;
return null;
}
public boolean isFullCube(IBlockState state)

@SideOnly(Side.CLIENT)
public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos)
{
this.setBlockBoundsBasedOnState(worldIn, pos);
return super.getSelectedBoundingBox(worldIn, pos);
}
public boolean isFullCube()
{
return false;
}
Expand All @@ -48,27 +55,11 @@ public boolean isPassable(IBlockAccess worldIn, BlockPos pos)
{
return true;
}
/**
* The type of render function called. 3 for standard block models, 2 for TESR's, 1 for liquids, -1 is no render
*/
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
}
/**
* Used to determine ambient occlusion and culling when rebuilding chunks for render
*/
public boolean isOpaqueCube(IBlockState state)

public boolean isOpaqueCube()
{
return false;
}
/**
* Return true if an entity can be spawned inside the block (used to get the player's bed spawn location)
*/
public boolean canSpawnInBlock()
{
return true;
}
public TileEntity createNewTileEntity(World worldIn, int meta)
{
return new TileEntityNameBanner();
Expand Down Expand Up @@ -111,7 +102,7 @@ public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState s
}
}

public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te, ItemStack stack)
public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te)
{
if (te instanceof TileEntityNameBanner)
{
Expand All @@ -127,32 +118,40 @@ public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBloc
}
else
{
super.harvestBlock(worldIn, player, pos, state, (TileEntity)null, stack);
super.harvestBlock(worldIn, player, pos, state, (TileEntity)null);
}
}
@SideOnly(Side.CLIENT)
public Item getItem(World worldIn, BlockPos pos)
{
return RPItems.name_banner;
}

protected static final AxisAlignedBB NORTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.875D, 1D, 0.78125, 1.0D);
protected static final AxisAlignedBB SOUTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1D, 0.78125D, 0.125);
protected static final AxisAlignedBB WEST_AABB = new AxisAlignedBB(0.875D, 0.0D, 0.0D, 1.0D, 0.78125D, 1.0D);
protected static final AxisAlignedBB EAST_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.125D, 0.78125D, 1.0D);
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos)
{
switch ((EnumFacing)state.getValue(FACING))
EnumFacing enumfacing = (EnumFacing)worldIn.getBlockState(pos).getValue(FACING);
float f = 0.0F;
f=0.109375f;
float f1 = 0.78125F;
f1=0.890625f;
float f2 = 0.0F;
float f3 = 1.0F;
float f4 = 0.125F;
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);

switch (BlockNameBanner.SwitchEnumFacing.FACING_LOOKUP[enumfacing.ordinal()])
{
case NORTH:
case 1:
default:
return NORTH_AABB;
case SOUTH:
return SOUTH_AABB;
case WEST:
return WEST_AABB;
case EAST:
return EAST_AABB;
this.setBlockBounds(f2, f, 1.0F - f4, f3, f1, 1.0F);
break;
case 2:
this.setBlockBounds(f2, f, 0.0F, f3, f1, f4);
break;
case 3:
this.setBlockBounds(1.0F - f4, f, f2, 1.0F, f1, f3);
break;
case 4:
this.setBlockBounds(0.0F, f, f2, f4, f1, f3);
}
}
/**
Expand All @@ -178,9 +177,52 @@ public int getMetaFromState(IBlockState state)
return ((EnumFacing)state.getValue(FACING)).getIndex();
}

protected BlockStateContainer createBlockState()
protected BlockState createBlockState()
{
return new BlockState(this, new IProperty[] {FACING});
}
static final class SwitchEnumFacing
{
return new BlockStateContainer(this, new IProperty[] {FACING});
static final int[] FACING_LOOKUP = new int[EnumFacing.values().length];

static
{
try
{
FACING_LOOKUP[EnumFacing.NORTH.ordinal()] = 1;
}
catch (NoSuchFieldError var4)
{
;
}

try
{
FACING_LOOKUP[EnumFacing.SOUTH.ordinal()] = 2;
}
catch (NoSuchFieldError var3)
{
;
}

try
{
FACING_LOOKUP[EnumFacing.WEST.ordinal()] = 3;
}
catch (NoSuchFieldError var2)
{
;
}

try
{
FACING_LOOKUP[EnumFacing.EAST.ordinal()] = 4;
}
catch (NoSuchFieldError var1)
{
;
}
}
}

}
Loading

0 comments on commit 705ac95

Please sign in to comment.