Major Refactoring of Bootstrap Code (#75)
- Refactored boostrap code: * Completely reworked item/block/tile registration. * Fixed server side startup. * Fixed server side startup. * More documentation. * More heavy cleanup * More cleanups. * Major refactoring of state mapping and fixes a lot of other issue related to item rendering. * Fixes sky chest item models (no item TESR). * Only use CachingRotatingBakedModel for tile entities automatically. Fix default rotation of quartz pillar for item model. * Used method reference instead of lambda for ItemMeshDefinition for multiparts. * Removed unnecessary IHasSpecialItemModel * Removed unused IconReg class. * Updated resource pack version.
This commit is contained in:
committed by
Sebastian Hartte
parent
66df324ef0
commit
6f2bbfab4c
@@ -27,6 +27,8 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.exceptions.MissingDefinition;
|
||||
@@ -67,6 +69,7 @@ public final class BlockChargedQuartzOre extends BlockQuartzOre
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT)
|
||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
|
||||
@@ -19,12 +19,9 @@
|
||||
package appeng.decorative.solid;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public final class BlockChiseledQuartz extends AEDecorativeBlock
|
||||
@@ -32,7 +29,5 @@ public final class BlockChiseledQuartz extends AEDecorativeBlock
|
||||
public BlockChiseledQuartz()
|
||||
{
|
||||
super( Material.ROCK );
|
||||
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,9 @@
|
||||
package appeng.decorative.solid;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public final class BlockFluix extends AEDecorativeBlock
|
||||
@@ -32,7 +29,5 @@ public final class BlockFluix extends AEDecorativeBlock
|
||||
public BlockFluix()
|
||||
{
|
||||
super( Material.ROCK );
|
||||
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,9 @@
|
||||
package appeng.decorative.solid;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public final class BlockQuartz extends AEDecorativeBlock
|
||||
@@ -32,7 +29,5 @@ public final class BlockQuartz extends AEDecorativeBlock
|
||||
public BlockQuartz()
|
||||
{
|
||||
super( Material.ROCK );
|
||||
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
package appeng.decorative.solid;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
@@ -31,7 +29,6 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public class BlockQuartzGlass extends AEBaseBlock
|
||||
@@ -49,7 +46,6 @@ public class BlockQuartzGlass extends AEBaseBlock
|
||||
super( Material.GLASS );
|
||||
this.setLightOpacity( 0 );
|
||||
this.setOpaque( false );
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,18 +19,18 @@
|
||||
package appeng.decorative.solid;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.client.render.effects.VibrantFX;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public class BlockQuartzLamp extends BlockQuartzGlass
|
||||
@@ -39,10 +39,10 @@ public class BlockQuartzLamp extends BlockQuartzGlass
|
||||
public BlockQuartzLamp()
|
||||
{
|
||||
this.setLightLevel( 1.0f );
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
package appeng.decorative.solid;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -31,12 +30,10 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.exceptions.MissingDefinition;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public class BlockQuartzOre extends AEBaseBlock
|
||||
@@ -53,7 +50,6 @@ public class BlockQuartzOre extends AEBaseBlock
|
||||
this.boostBrightnessLow = 0;
|
||||
this.boostBrightnessHigh = 1;
|
||||
this.enhanceBrightness = false;
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,12 +58,6 @@ public class BlockQuartzOre extends AEBaseBlock
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit()
|
||||
{
|
||||
OreDictionary.registerOre( "oreCertusQuartz", new ItemStack( this ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue( final IBlockState state, final IBlockAccess worldIn, final BlockPos pos )
|
||||
{
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
package appeng.decorative.solid;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
@@ -32,10 +30,8 @@ import net.minecraft.world.IBlockAccess;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.MetaRotation;
|
||||
|
||||
|
||||
public class BlockQuartzPillar extends AEBaseBlock implements IOrientableBlock
|
||||
{
|
||||
public static final PropertyEnum<EnumFacing.Axis> AXIS_ORIENTATION = PropertyEnum.create( "axis", EnumFacing.Axis.class );
|
||||
@@ -43,7 +39,8 @@ public class BlockQuartzPillar extends AEBaseBlock implements IOrientableBlock
|
||||
public BlockQuartzPillar()
|
||||
{
|
||||
super( Material.ROCK );
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
// The upwards facing pillar is the default (i.e. for the item model)
|
||||
setDefaultState( getDefaultState().withProperty( AXIS_ORIENTATION, EnumFacing.Axis.Y ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,10 +19,6 @@
|
||||
package appeng.decorative.solid;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
@@ -34,7 +30,6 @@ import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.worlddata.WorldData;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@@ -48,7 +43,7 @@ public class BlockSkyStone extends AEBaseBlock
|
||||
|
||||
public BlockSkyStone( final SkystoneType type )
|
||||
{
|
||||
super( Material.ROCK, Optional.of( type.name() ) );
|
||||
super( Material.ROCK );
|
||||
this.setHardness( 50 );
|
||||
this.setHasSubtypes( true );
|
||||
this.blockResistance = BLOCK_RESISTANCE;
|
||||
@@ -56,7 +51,6 @@ public class BlockSkyStone extends AEBaseBlock
|
||||
{
|
||||
this.setHarvestLevel( "pickaxe", 3 );
|
||||
}
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
|
||||
this.type = type;
|
||||
|
||||
|
||||
@@ -19,18 +19,15 @@
|
||||
package appeng.decorative.stair;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import appeng.block.AEBaseStairBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public class BlockStairCommon extends AEBaseStairBlock
|
||||
{
|
||||
public BlockStairCommon( final Block block, final String type )
|
||||
{
|
||||
super( block, EnumSet.of( AEFeature.DecorativeQuartzBlocks ), type );
|
||||
super( block, type );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user