Fixes and cleanup
- Compile error fixes (blame @biggles2206). Fixes #53. - UVLModelLoader is now cross compatible with vanilla (vanilla can use uvl parents who have vanilla parents). - Due to it, now using uvlMarker instead of .uvl. - General code reformatting and cleanup.
This commit is contained in:
@@ -67,11 +67,6 @@ import appeng.util.Platform;
|
||||
public abstract class AEBaseBlock extends Block implements IAEFeature
|
||||
{
|
||||
|
||||
<<<<<<< HEAD
|
||||
public static final PropertyEnum<EnumFacing.Axis> AXIS_ORIENTATION = PropertyEnum.create( "axis", EnumFacing.Axis.class );
|
||||
|
||||
=======
|
||||
>>>>>>> refs/heads/pr/38
|
||||
private final String featureFullName;
|
||||
private final Optional<String> featureSubName;
|
||||
private boolean isOpaque = true;
|
||||
|
||||
@@ -57,7 +57,6 @@ import net.minecraftforge.client.model.ICustomModelLoader;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.client.model.animation.ModelBlockAnimation;
|
||||
import net.minecraftforge.client.model.pipeline.LightUtil;
|
||||
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
|
||||
import net.minecraftforge.client.model.pipeline.VertexLighterFlat;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
@@ -69,6 +68,8 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
{
|
||||
INSTANCE;
|
||||
|
||||
private static final Gson gson = new Gson();
|
||||
|
||||
private static final Constructor<? extends IModel> vanillaModelWrapper;
|
||||
private static final Field faceBakery;
|
||||
|
||||
@@ -153,7 +154,15 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
@Override
|
||||
public boolean accepts( ResourceLocation modelLocation )
|
||||
{
|
||||
return modelLocation.getResourcePath().endsWith( ".uvl" );
|
||||
try
|
||||
{
|
||||
return gson.fromJson( new InputStreamReader( Minecraft.getMinecraft().getResourceManager().getResource( modelLocation ).getInputStream() ), UVLMarker.class ).uvlMarker;
|
||||
}
|
||||
catch( IOException e )
|
||||
{
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -322,4 +331,9 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
|
||||
}
|
||||
|
||||
class UVLMarker
|
||||
{
|
||||
boolean uvlMarker = false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,14 +22,11 @@ package appeng.container.implementations;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import invtweaks.api.container.ChestContainer;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.SlotNormal;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
|
||||
|
||||
@ChestContainer
|
||||
public class ContainerSkyChest extends AEBaseContainer
|
||||
{
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import appeng.helpers.MetaRotation;
|
||||
|
||||
public class QuartzPillarBlock extends AEBaseBlock implements IOrientableBlock
|
||||
{
|
||||
public static final PropertyEnum AXIS_ORIENTATION = PropertyEnum.create( "axis", EnumFacing.Axis.class );
|
||||
public static final PropertyEnum<EnumFacing.Axis> AXIS_ORIENTATION = PropertyEnum.create( "axis", EnumFacing.Axis.class );
|
||||
|
||||
public QuartzPillarBlock()
|
||||
{
|
||||
@@ -49,15 +49,15 @@ public class QuartzPillarBlock extends AEBaseBlock implements IOrientableBlock
|
||||
@Override
|
||||
public int getMetaFromState( final IBlockState state )
|
||||
{
|
||||
return state.getValue(AXIS_ORIENTATION).ordinal();
|
||||
return state.getValue( AXIS_ORIENTATION ).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta( final int meta )
|
||||
{
|
||||
// Simply use the ordinal here
|
||||
EnumFacing.Axis axis = EnumFacing.Axis.values()[meta];
|
||||
return this.getDefaultState().withProperty(AXIS_ORIENTATION, axis);
|
||||
// Simply use the ordinal here
|
||||
EnumFacing.Axis axis = EnumFacing.Axis.values()[meta];
|
||||
return this.getDefaultState().withProperty( AXIS_ORIENTATION, axis );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.decorative.solid.QuartzPillarBlock;
|
||||
|
||||
|
||||
public class MetaRotation implements IOrientable
|
||||
@@ -71,7 +72,8 @@ public class MetaRotation implements IOrientable
|
||||
return state.getValue( facingProp );
|
||||
}
|
||||
|
||||
Axis a = state.getValue( AEBaseBlock.AXIS_ORIENTATION );
|
||||
//TODO 1.10.2-R - Temp
|
||||
Axis a = state.getValue( QuartzPillarBlock.AXIS_ORIENTATION );
|
||||
|
||||
if( a == null )
|
||||
{
|
||||
@@ -101,7 +103,8 @@ public class MetaRotation implements IOrientable
|
||||
}
|
||||
else
|
||||
{
|
||||
( (World) this.w ).setBlockState( this.pos, this.w.getBlockState( this.pos ).withProperty( AEBaseBlock.AXIS_ORIENTATION, up.getAxis() ) );
|
||||
//TODO 1.10.2-R - Temp
|
||||
( (World) this.w ).setBlockState( this.pos, this.w.getBlockState( this.pos ).withProperty( QuartzPillarBlock.AXIS_ORIENTATION, up.getAxis() ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user