diff --git a/src/main/java/appeng/block/AEBaseBlock.java b/src/main/java/appeng/block/AEBaseBlock.java index 09b18073..f0ecb825 100644 --- a/src/main/java/appeng/block/AEBaseBlock.java +++ b/src/main/java/appeng/block/AEBaseBlock.java @@ -67,11 +67,6 @@ import appeng.util.Platform; public abstract class AEBaseBlock extends Block implements IAEFeature { -<<<<<<< HEAD - public static final PropertyEnum AXIS_ORIENTATION = PropertyEnum.create( "axis", EnumFacing.Axis.class ); - -======= ->>>>>>> refs/heads/pr/38 private final String featureFullName; private final Optional featureSubName; private boolean isOpaque = true; diff --git a/src/main/java/appeng/client/render/model/UVLModelLoader.java b/src/main/java/appeng/client/render/model/UVLModelLoader.java index 64efb974..e1b63a04 100644 --- a/src/main/java/appeng/client/render/model/UVLModelLoader.java +++ b/src/main/java/appeng/client/render/model/UVLModelLoader.java @@ -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 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; + } + } \ No newline at end of file diff --git a/src/main/java/appeng/container/implementations/ContainerSkyChest.java b/src/main/java/appeng/container/implementations/ContainerSkyChest.java index 5c9bc131..1417fe21 100644 --- a/src/main/java/appeng/container/implementations/ContainerSkyChest.java +++ b/src/main/java/appeng/container/implementations/ContainerSkyChest.java @@ -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 { diff --git a/src/main/java/appeng/decorative/solid/QuartzPillarBlock.java b/src/main/java/appeng/decorative/solid/QuartzPillarBlock.java index 94828f91..fe1f491f 100644 --- a/src/main/java/appeng/decorative/solid/QuartzPillarBlock.java +++ b/src/main/java/appeng/decorative/solid/QuartzPillarBlock.java @@ -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 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 diff --git a/src/main/java/appeng/helpers/MetaRotation.java b/src/main/java/appeng/helpers/MetaRotation.java index 9f730fd3..17a700d8 100644 --- a/src/main/java/appeng/helpers/MetaRotation.java +++ b/src/main/java/appeng/helpers/MetaRotation.java @@ -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 diff --git a/src/test/java/appeng/client/render/UVLightmapJsonTest.java b/src/test/java/appeng/client/render/UVLightmapJsonTest.java index b7aeee35..fffe8f3c 100644 --- a/src/test/java/appeng/client/render/UVLightmapJsonTest.java +++ b/src/test/java/appeng/client/render/UVLightmapJsonTest.java @@ -1,5 +1,7 @@ + package appeng.client.render; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; @@ -14,21 +16,18 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; -import net.minecraftforge.client.model.ModelLoaderRegistry; -import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; -import appeng.client.render.model.UVLModelLoader; -@Mod(modid = "UVLightmapJsonTest", name = "UVLightmapJsonTest", version ="0.0.0") +@Mod( modid = "UVLightmapJsonTest", name = "UVLightmapJsonTest", version = "0.0.0" ) public class UVLightmapJsonTest { - private static final ModelResourceLocation uvlblockModel = new ModelResourceLocation( new ResourceLocation( "UVLightmapJsonTest", "uvlblock" ), "normal" ); + private static final ResourceLocation uvlblockR = new ResourceLocation( "UVLightmapJsonTest", "uvlblock" ); public static Block uvlblock; public static Item uvlblockItem; @@ -40,17 +39,17 @@ public class UVLightmapJsonTest final AxisAlignedBB box = new AxisAlignedBB( 0.25, 0, 7 / 16d, 0.75, 1, 9 / 16d ); - public boolean isFullBlock(IBlockState state) + public boolean isFullBlock( IBlockState state ) { return false; } - public boolean isOpaqueCube(IBlockState state) + public boolean isOpaqueCube( IBlockState state ) { return false; } - public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) + public AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess source, BlockPos pos ) { return box; } @@ -60,17 +59,17 @@ public class UVLightmapJsonTest return BlockRenderLayer.CUTOUT; } - }.setLightLevel( 0.2f ).setCreativeTab( CreativeTabs.DECORATIONS ).setRegistryName( new ResourceLocation( "UVLightmapJsonTest", "uvlblock" ) ) ); - GameRegistry.register( uvlblockItem = new ItemBlock( uvlblock ).setRegistryName( new ResourceLocation( "UVLightmapJsonTest", "uvlblock" ) ) ); + }.setLightLevel( 0.2f ).setCreativeTab( CreativeTabs.DECORATIONS ).setRegistryName( uvlblockR ) ); + GameRegistry.register( uvlblockItem = new ItemBlock( uvlblock ).setRegistryName( uvlblockR ) ); - ModelBakery.registerItemVariants( uvlblockItem, uvlblockModel ); + ModelBakery.registerItemVariants( uvlblockItem, uvlblockR ); } @EventHandler public void init( FMLInitializationEvent event ) { - Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(uvlblockItem, 0, uvlblockModel); + Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( uvlblockItem, 0, new ModelResourceLocation( uvlblockR, "inventory" ) ); } } diff --git a/src/test/resources/assets/uvlightmapjsontest/blockstates/uvlblock.json b/src/test/resources/assets/uvlightmapjsontest/blockstates/uvlblock.json index dd70b64e..0e07367b 100644 --- a/src/test/resources/assets/uvlightmapjsontest/blockstates/uvlblock.json +++ b/src/test/resources/assets/uvlightmapjsontest/blockstates/uvlblock.json @@ -1,5 +1,5 @@ { "variants": { - "normal": { "model": "UVLightmapJsonTest:uvlblock.uvl" } + "normal": { "model": "uvlightmapjsontest:uvlblock_vanilla" } } } diff --git a/src/test/resources/assets/uvlightmapjsontest/models/block/uvlblock.uvl.json b/src/test/resources/assets/uvlightmapjsontest/models/block/uvlblock.json similarity index 99% rename from src/test/resources/assets/uvlightmapjsontest/models/block/uvlblock.uvl.json rename to src/test/resources/assets/uvlightmapjsontest/models/block/uvlblock.json index 126a76b6..76ad2b7f 100644 --- a/src/test/resources/assets/uvlightmapjsontest/models/block/uvlblock.uvl.json +++ b/src/test/resources/assets/uvlightmapjsontest/models/block/uvlblock.json @@ -1,4 +1,5 @@ { + "uvlMarker": true, "textures": { "0": "blocks/obsidian", "1": "uvlightmapjsontest:blocks/BlockControllerLights" diff --git a/src/test/resources/assets/uvlightmapjsontest/models/block/uvlblock_vanilla.json b/src/test/resources/assets/uvlightmapjsontest/models/block/uvlblock_vanilla.json new file mode 100644 index 00000000..5f299ed8 --- /dev/null +++ b/src/test/resources/assets/uvlightmapjsontest/models/block/uvlblock_vanilla.json @@ -0,0 +1,6 @@ +{ + "parent": "uvlightmapjsontest:block/uvlblock", + "textures": { + "0": "blocks/diamond_block" + } +} \ No newline at end of file diff --git a/src/test/resources/assets/uvlightmapjsontest/models/item/uvlblock.json b/src/test/resources/assets/uvlightmapjsontest/models/item/uvlblock.json index 75c422f8..c435bbbb 100644 --- a/src/test/resources/assets/uvlightmapjsontest/models/item/uvlblock.json +++ b/src/test/resources/assets/uvlightmapjsontest/models/item/uvlblock.json @@ -1,3 +1,3 @@ { - "parent": "uvlightmapjsontest:block/uvlblock.uvl" + "parent": "uvlightmapjsontest:block/uvlblock" }