Third update pass (3/?)
Last (?) update pass. AE2 can be launched and used (?) in game. Rendering system changed again and again - rendering is NOT working, to be rewritten and CAN be done a lot simpler.
This commit is contained in:
parent
05aa6972c4
commit
8acee98b8f
|
@ -35,7 +35,6 @@ import net.minecraft.block.properties.PropertyEnum;
|
|||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -62,7 +61,6 @@ import appeng.api.util.AEPartLocation;
|
|||
import appeng.api.util.IAESprite;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock.AEBaseBlockColor;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.BlockRenderInfo;
|
||||
import appeng.client.texture.BaseIcon;
|
||||
|
@ -94,7 +92,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
|
|||
private BlockRenderInfo renderInfo;
|
||||
private String textureName;
|
||||
|
||||
protected AxisAlignedBB boundingBox;
|
||||
protected AxisAlignedBB boundingBox = FULL_BLOCK_AABB;
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
|
@ -109,11 +107,6 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
|
|||
this.setLightLevel( 0 );
|
||||
this.setHardness( 2.2F );
|
||||
this.setHarvestLevel( "pickaxe", 0 );
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler( new AEBaseBlockColor(), this );
|
||||
}
|
||||
}
|
||||
|
||||
protected AEBaseBlock( final Material mat, final Optional<String> subName )
|
||||
|
@ -719,16 +712,4 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
|
|||
{
|
||||
this.hasSubtypes = hasSubtypes;
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public class AEBaseBlockColor implements IBlockColor
|
||||
{
|
||||
|
||||
@Override
|
||||
public int colorMultiplier( IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex )
|
||||
{
|
||||
return tintIndex;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ public class BlockController extends AEBaseTileBlock
|
|||
|
||||
public static enum ControllerBlockState implements IStringSerializable
|
||||
{
|
||||
OFFLINE, ONLINE, CONFLICTED;
|
||||
offline, online, conflicted;
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
|
@ -70,7 +70,7 @@ public class BlockController extends AEBaseTileBlock
|
|||
@Override
|
||||
public IBlockState getStateFromMeta( final int meta )
|
||||
{
|
||||
return this.getDefaultState().withProperty( CONTROLLER_STATE, ControllerBlockState.OFFLINE );
|
||||
return this.getDefaultState().withProperty( CONTROLLER_STATE, ControllerBlockState.offline );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,24 +30,28 @@ import java.util.Random;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.ItemModelMesher;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.DefaultStateMapper;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.client.event.MouseEvent;
|
||||
|
@ -76,8 +80,10 @@ import appeng.client.texture.ExtraBlockTextures;
|
|||
import appeng.client.texture.ExtraItemTextures;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.features.IAEFeature;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketAssemblerAnimation;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
|
@ -90,6 +96,7 @@ import appeng.helpers.IMouseWheelItem;
|
|||
import appeng.hooks.TickHandler;
|
||||
import appeng.hooks.TickHandler.PlayerColor;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.items.misc.ItemPaintBall;
|
||||
import appeng.server.ServerHelper;
|
||||
import appeng.transformer.MissingCoreMod;
|
||||
import appeng.util.Platform;
|
||||
|
@ -137,6 +144,15 @@ public class ClientHelper extends ServerHelper
|
|||
// AELog.info( "Registering with %s with unlocalized %s", item, item.getUnlocalizedName() );
|
||||
// mesher.register( item, DEFAULT_ITEM_SUBTYPE, fluixStairModel );
|
||||
// }
|
||||
for( IAEFeature feature : Api.INSTANCE.definitions().getFeatureRegistry().getRegisteredFeatures() )
|
||||
{
|
||||
if( feature instanceof AEBaseBlock )
|
||||
{
|
||||
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler( new AEBaseBlockColor(), ( Block ) feature );
|
||||
}
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().getItemColors().registerItemColorHandler( new ItemPaintBallColor(), Api.INSTANCE.definitions().items().paintBall().maybeItem().get() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -627,4 +643,42 @@ public class ClientHelper extends ServerHelper
|
|||
this.loc = res;
|
||||
}
|
||||
}
|
||||
|
||||
public static class AEBaseBlockColor implements IBlockColor
|
||||
{
|
||||
|
||||
@Override
|
||||
public int colorMultiplier( IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex )
|
||||
{
|
||||
return tintIndex;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ItemPaintBallColor implements IItemColor
|
||||
{
|
||||
|
||||
@Override
|
||||
public int getColorFromItemstack( ItemStack stack, int tintIndex )
|
||||
{
|
||||
final AEColor col = ( ( ItemPaintBall ) stack.getItem() ).getColor( stack );
|
||||
|
||||
final int colorValue = stack.getItemDamage() >= 20 ? col.mediumVariant : col.mediumVariant;
|
||||
final int r = ( colorValue >> 16 ) & 0xff;
|
||||
final int g = ( colorValue >> 8 ) & 0xff;
|
||||
final int b = ( colorValue ) & 0xff;
|
||||
|
||||
if( stack.getItemDamage() >= 20 )
|
||||
{
|
||||
final float fail = 0.7f;
|
||||
final int full = (int) ( 255 * 0.3 );
|
||||
return (int) ( full + r * fail ) << 16 | (int) ( full + g * fail ) << 8 | (int) ( full + b * fail ) | 0xff << 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
return r << 16 | g << 8 | b | 0xff << 24;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -95,7 +95,7 @@ public class SmartModel implements IBakedModel
|
|||
{
|
||||
final ModelGenerator helper = new BakingModelGenerator();
|
||||
final Block blk = Block.getBlockFromItem( stack.getItem() );
|
||||
helper.setRenderBoundsFromBlock( blk.getDefaultState(), null );
|
||||
helper.setRenderBoundsFromBlock( blk != null ? blk.getDefaultState() : null, null );
|
||||
aeRenderer.getRendererInstance().renderInventory( blk instanceof AEBaseBlock ? (AEBaseBlock) blk : null, stack, helper, ItemRenderType.INVENTORY, null );
|
||||
helper.finalizeModel( true );
|
||||
return helper.getOutput();
|
||||
|
|
|
@ -928,12 +928,6 @@ public abstract class AEBaseGui extends GuiContainer
|
|||
final ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/" + file );
|
||||
this.mc.getTextureManager().bindTexture( loc );
|
||||
}
|
||||
|
||||
public void func_146977_a( final Slot s )
|
||||
{
|
||||
this.drawSlot( s );
|
||||
}
|
||||
|
||||
protected GuiScrollbar getScrollBar()
|
||||
{
|
||||
return this.myScrollBar;
|
||||
|
|
|
@ -7,11 +7,13 @@ import java.util.List;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.util.vector.Vector3f;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.BlockFaceUV;
|
||||
import net.minecraft.client.renderer.block.model.BlockPartFace;
|
||||
|
@ -23,7 +25,6 @@ import net.minecraft.client.renderer.block.model.ModelRotation;
|
|||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
|
@ -45,10 +46,12 @@ public class BakingModelGenerator implements ModelGenerator
|
|||
{
|
||||
private static final class CachedModel implements IBakedModel
|
||||
{
|
||||
private final List<BakedQuad> general;
|
||||
private final List<BakedQuad>[] faces = new List[6];
|
||||
|
||||
public CachedModel()
|
||||
{
|
||||
this.general = new ArrayList<BakedQuad>();
|
||||
for( final EnumFacing f : EnumFacing.VALUES )
|
||||
{
|
||||
this.faces[f.ordinal()] = new ArrayList<BakedQuad>();
|
||||
|
@ -88,7 +91,7 @@ public class BakingModelGenerator implements ModelGenerator
|
|||
@Override
|
||||
public List<BakedQuad> getQuads( IBlockState state, EnumFacing side, long rand )
|
||||
{
|
||||
return this.faces[side.ordinal()];
|
||||
return side == null ? general : this.faces[side.ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,9 +135,10 @@ public class BakingModelGenerator implements ModelGenerator
|
|||
private boolean flipTexture = false;
|
||||
private final List<SMFace> faces = new ArrayList();
|
||||
|
||||
private int point = 0;
|
||||
// private int point = 0;
|
||||
private int brightness = -1;
|
||||
private final float[][] points = new float[4][];
|
||||
private VertexBuffer vertexBuffer;
|
||||
//private final float[][] points = new float[4][];
|
||||
private EnumFacing currentFace = EnumFacing.UP;
|
||||
private int color = -1;
|
||||
|
||||
|
@ -154,6 +158,7 @@ public class BakingModelGenerator implements ModelGenerator
|
|||
{
|
||||
boundingBox = Block.FULL_BLOCK_AABB;
|
||||
}
|
||||
|
||||
this.setRenderMinX( boundingBox.minX );
|
||||
this.setRenderMinY( boundingBox.minY );
|
||||
this.setRenderMinZ( boundingBox.minZ );
|
||||
|
@ -303,19 +308,25 @@ public class BakingModelGenerator implements ModelGenerator
|
|||
return this.getIcon( state );
|
||||
}
|
||||
|
||||
//TODO 1.9.4 aftermath - Check that this shit still works.
|
||||
//TODO 1.9.4 aftermath - Check that this shit still works. VertexBuffer
|
||||
public void addVertexWithUV( final EnumFacing face, final double x, final double y, final double z, final double u, final double v )
|
||||
{
|
||||
this.points[this.point++] = new float[] { (float) x + this.tx, (float) y + this.ty, (float) z + this.tz, (float) u, (float) v };
|
||||
|
||||
if( this.point == 4 )
|
||||
//this.points[this.point++] = new float[] { (float) x + this.tx, (float) y + this.ty, (float) z + this.tz, (float) u, (float) v };
|
||||
if( vertexBuffer == null )
|
||||
{
|
||||
this.brightness = -1;
|
||||
vertexBuffer = new VertexBuffer( 4 );
|
||||
vertexBuffer.begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||
}
|
||||
vertexBuffer.pos( x, y, z ).tex( u, v ).endVertex();
|
||||
// if( this.point == 4 )
|
||||
if( vertexBuffer.getVertexCount() == 4)
|
||||
{
|
||||
/*this.brightness = -1;
|
||||
final int[] vertData = {
|
||||
Float.floatToRawIntBits( this.points[0][0] ),
|
||||
Float.floatToRawIntBits( this.points[0][1] ),
|
||||
Float.floatToRawIntBits( this.points[0][2] ),
|
||||
// this.brightness,
|
||||
this.brightness,
|
||||
Float.floatToRawIntBits( this.points[0][3] ),
|
||||
Float.floatToRawIntBits( this.points[0][4] ),
|
||||
// 0,
|
||||
|
@ -323,7 +334,7 @@ public class BakingModelGenerator implements ModelGenerator
|
|||
Float.floatToRawIntBits( this.points[1][0] ),
|
||||
Float.floatToRawIntBits( this.points[1][1] ),
|
||||
Float.floatToRawIntBits( this.points[1][2] ),
|
||||
// this.brightness,
|
||||
this.brightness,
|
||||
Float.floatToRawIntBits( this.points[1][3] ),
|
||||
Float.floatToRawIntBits( this.points[1][4] ),
|
||||
// 0,
|
||||
|
@ -331,7 +342,7 @@ public class BakingModelGenerator implements ModelGenerator
|
|||
Float.floatToRawIntBits( this.points[2][0] ),
|
||||
Float.floatToRawIntBits( this.points[2][1] ),
|
||||
Float.floatToRawIntBits( this.points[2][2] ),
|
||||
// this.brightness,
|
||||
this.brightness,
|
||||
Float.floatToRawIntBits( this.points[2][3] ),
|
||||
Float.floatToRawIntBits( this.points[2][4] ),
|
||||
// 0,
|
||||
|
@ -339,18 +350,28 @@ public class BakingModelGenerator implements ModelGenerator
|
|||
Float.floatToRawIntBits( this.points[3][0] ),
|
||||
Float.floatToRawIntBits( this.points[3][1] ),
|
||||
Float.floatToRawIntBits( this.points[3][2] ),
|
||||
// this.brightness,
|
||||
this.brightness,
|
||||
Float.floatToRawIntBits( this.points[3][3] ),
|
||||
Float.floatToRawIntBits( this.points[3][4] ),
|
||||
// 0,
|
||||
};
|
||||
|
||||
this.generatedModel.general.add( new BakedQuad( vertData, this.color, face, Minecraft.getMinecraft().getTextureMapBlocks().getTextureExtry( TextureMap.LOCATION_BLOCKS_TEXTURE.toString() ), true, DefaultVertexFormats.POSITION_TEX ) );
|
||||
for( List<BakedQuad> list : this.generatedModel.faces )
|
||||
{
|
||||
list.add( new BakedQuad( vertData, this.color, face, Minecraft.getMinecraft().getTextureMapBlocks().getTextureExtry( TextureMap.LOCATION_BLOCKS_TEXTURE.toString() ), true, DefaultVertexFormats.POSITION_TEX ) );
|
||||
}
|
||||
|
||||
this.point = 0;
|
||||
this.point = 0;*/
|
||||
|
||||
vertexBuffer.finishDrawing();
|
||||
final VertexBuffer.State state = vertexBuffer.getVertexState();
|
||||
this.generatedModel.general.add( new BakedQuad( state.getRawBuffer(), this.color, face, Minecraft.getMinecraft().getTextureMapBlocks().getTextureExtry( TextureMap.LOCATION_BLOCKS_TEXTURE.toString() ), true, state.getVertexFormat() ) );
|
||||
for( List<BakedQuad> list : this.generatedModel.faces )
|
||||
{
|
||||
list.add( new BakedQuad( state.getRawBuffer(), this.color, face, Minecraft.getMinecraft().getTextureMapBlocks().getTextureExtry( TextureMap.LOCATION_BLOCKS_TEXTURE.toString() ), true, state.getVertexFormat() ) );
|
||||
}
|
||||
vertexBuffer = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -582,6 +603,7 @@ public class BakingModelGenerator implements ModelGenerator
|
|||
}
|
||||
else
|
||||
{
|
||||
this.generatedModel.general.add( bf );
|
||||
for( List<BakedQuad> list : this.generatedModel.faces )
|
||||
{
|
||||
list.add( bf );
|
||||
|
|
|
@ -49,8 +49,8 @@ public class RenderBlockController extends BaseBlockRender<BlockController, Tile
|
|||
final boolean zz = this.getTileEntity( world, pos.offset( EnumFacing.SOUTH ) ) instanceof TileController && this.getTileEntity( world, pos.offset( EnumFacing.NORTH ) ) instanceof TileController;
|
||||
|
||||
final BlockController.ControllerBlockState meta = (ControllerBlockState) world.getBlockState( pos ).getValue( BlockController.CONTROLLER_STATE );
|
||||
final boolean hasPower = meta != BlockController.ControllerBlockState.OFFLINE;
|
||||
final boolean isConflict = meta == BlockController.ControllerBlockState.CONFLICTED;
|
||||
final boolean hasPower = meta != BlockController.ControllerBlockState.offline;
|
||||
final boolean isConflict = meta == BlockController.ControllerBlockState.conflicted;
|
||||
|
||||
ExtraBlockTextures lights = null;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ public final class ApiDefinitions implements IDefinitions
|
|||
return this.handlers;
|
||||
}
|
||||
|
||||
FeatureRegistry getFeatureRegistry()
|
||||
public FeatureRegistry getFeatureRegistry()
|
||||
{
|
||||
return this.features;
|
||||
}
|
||||
|
|
|
@ -231,7 +231,7 @@ public final class AppEng
|
|||
@EventHandler
|
||||
private void serverAboutToStart( final FMLServerAboutToStartEvent evt )
|
||||
{
|
||||
WorldData.onServerAboutToStart();
|
||||
WorldData.onServerAboutToStart( evt.getServer() );
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
|
|
@ -34,7 +34,7 @@ public final class FeatureRegistry
|
|||
this.registry.add( feature );
|
||||
}
|
||||
|
||||
Set<IAEFeature> getRegisteredFeatures()
|
||||
public Set<IAEFeature> getRegisteredFeatures()
|
||||
{
|
||||
return this.registry;
|
||||
}
|
||||
|
|
|
@ -23,12 +23,13 @@ import java.util.EnumSet;
|
|||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.CreativeTab;
|
||||
|
||||
|
@ -69,18 +70,19 @@ public final class AEBlockFeatureHandler implements IFeatureHandler
|
|||
if( this.enabled )
|
||||
{
|
||||
final String name = this.extractor.get();
|
||||
this.featured.setRegistryName( AppEng.MOD_ID, name );
|
||||
this.featured.setCreativeTab( CreativeTab.instance );
|
||||
this.featured.setUnlocalizedName( "appliedenergistics2." + name );
|
||||
this.featured.setBlockTextureName( name );
|
||||
|
||||
// Bypass the forge magic with null to register our own itemblock later.
|
||||
GameRegistry.registerBlock( this.featured, null, name );
|
||||
GameRegistry.registerItem( this.definition.maybeItem().get(), name );
|
||||
GameRegistry.register( this.featured );
|
||||
|
||||
// register the block/item conversion...
|
||||
if( this.definition.maybeItem().isPresent() )
|
||||
{
|
||||
GameData.getBlockItemMap().put( this.featured, this.definition.maybeItem().get() );
|
||||
final Item featuredItem = this.definition.maybeItem().get();
|
||||
featuredItem.setRegistryName( AppEng.MOD_ID, name );
|
||||
GameRegistry.register( featuredItem );
|
||||
}
|
||||
|
||||
if( side == Side.CLIENT )
|
||||
|
|
|
@ -54,6 +54,7 @@ import appeng.api.parts.IPartHost;
|
|||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.GuiNull;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerNull;
|
||||
|
@ -220,6 +221,8 @@ public enum GuiBridge implements IGuiHandler
|
|||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
AEBaseGui.class.getName();
|
||||
|
||||
final String start = this.containerClass.getName();
|
||||
final String guiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" );
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ import javax.annotation.Nullable;
|
|||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
|
@ -121,10 +122,15 @@ public final class WorldData implements IWorldData
|
|||
* Requires to start up from external from here
|
||||
*
|
||||
* drawback of the singleton build style
|
||||
* @param server
|
||||
*/
|
||||
public static void onServerAboutToStart()
|
||||
public static void onServerAboutToStart( MinecraftServer server )
|
||||
{
|
||||
final File worldDirectory = DimensionManager.getCurrentSaveRootDirectory();
|
||||
File worldDirectory = DimensionManager.getCurrentSaveRootDirectory();
|
||||
if( worldDirectory == null )
|
||||
{
|
||||
worldDirectory = server.getActiveAnvilConverter().getSaveLoader( server.getFolderName(), false ).getWorldDirectory();
|
||||
}
|
||||
final WorldData newInstance = new WorldData( worldDirectory );
|
||||
|
||||
instance = newInstance;
|
||||
|
|
|
@ -53,11 +53,6 @@ public class ItemPaintBall extends AEBaseItem
|
|||
{
|
||||
this.setFeature( EnumSet.of( AEFeature.PaintBalls ) );
|
||||
this.setHasSubtypes( true );
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
Minecraft.getMinecraft().getItemColors().registerItemColorHandler( new ItemPaintBallColor(), this );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -134,32 +129,4 @@ public class ItemPaintBall extends AEBaseItem
|
|||
final int dmg = is.getItemDamage();
|
||||
return dmg >= DAMAGE_THRESHOLD;
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public class ItemPaintBallColor implements IItemColor
|
||||
{
|
||||
|
||||
@Override
|
||||
public int getColorFromItemstack( ItemStack stack, int tintIndex )
|
||||
{
|
||||
final AEColor col = getColor( stack );
|
||||
|
||||
final int colorValue = stack.getItemDamage() >= 20 ? col.mediumVariant : col.mediumVariant;
|
||||
final int r = ( colorValue >> 16 ) & 0xff;
|
||||
final int g = ( colorValue >> 8 ) & 0xff;
|
||||
final int b = ( colorValue ) & 0xff;
|
||||
|
||||
if( stack.getItemDamage() >= 20 )
|
||||
{
|
||||
final float fail = 0.7f;
|
||||
final int full = (int) ( 255 * 0.3 );
|
||||
return (int) ( full + r * fail ) << 16 | (int) ( full + g * fail ) << 8 | (int) ( full + b * fail ) | 0xff << 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
return r << 16 | g << 8 | b | 0xff << 24;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,8 +28,8 @@ public class ChestLoot
|
|||
{
|
||||
//TODO 1.9.4 aftermath - All these loot quality, pools and stuff. Figure it out and balance it.
|
||||
final IMaterials materials = AEApi.instance().definitions().materials();
|
||||
event.getTable().addPool( new LootPool( ( ( FluentIterable<LootEntryItem> ) Iterables.transform( materials.certusQuartzCrystal().maybeStack( 1 ).asSet(), ( ItemStack itemstack ) -> new LootEntryItem( itemstack.getItem(), 2, 3, new LootFunction[]{ new SetMetadata(null, new RandomValueRange( itemstack.getItemDamage() ))}, new LootCondition[]{ new RandomChance( 1 ) }, "AE2 Crystal_" + itemstack.getItemDamage() ) ) ).toArray( LootEntryItem.class ), null, new RandomValueRange( 1, 4 ), new RandomValueRange( 0, 2 ), "AE2 Crystals" ) );
|
||||
event.getTable().addPool( new LootPool( ( ( FluentIterable<LootEntryItem> ) Iterables.transform( materials.certusQuartzDust().maybeStack( 1 ).asSet(), ( ItemStack itemstack ) -> new LootEntryItem( itemstack.getItem(), 2, 3, new LootFunction[]{ new SetMetadata(null, new RandomValueRange( itemstack.getItemDamage() ))}, new LootCondition[]{ new RandomChance( 1 ) }, "AE2 Dust_" + itemstack.getItemDamage() ) ) ).toArray( LootEntryItem.class ), null, new RandomValueRange( 1, 4 ), new RandomValueRange( 0, 2 ), "AE2 Dusts" ) );
|
||||
event.getTable().addPool( new LootPool( ( ( FluentIterable<LootEntryItem> ) Iterables.transform( materials.certusQuartzCrystal().maybeStack( 1 ).asSet(), ( ItemStack itemstack ) -> new LootEntryItem( itemstack.getItem(), 2, 3, new LootFunction[]{ new SetMetadata(null, new RandomValueRange( itemstack.getItemDamage() ))}, new LootCondition[]{ new RandomChance( 1 ) }, "AE2 Crystal_" + itemstack.getItemDamage() ) ) ).toArray( LootEntryItem.class ), new LootCondition[0], new RandomValueRange( 1, 4 ), new RandomValueRange( 0, 2 ), "AE2 Crystals" ) );
|
||||
event.getTable().addPool( new LootPool( ( ( FluentIterable<LootEntryItem> ) Iterables.transform( materials.certusQuartzDust().maybeStack( 1 ).asSet(), ( ItemStack itemstack ) -> new LootEntryItem( itemstack.getItem(), 2, 3, new LootFunction[]{ new SetMetadata(null, new RandomValueRange( itemstack.getItemDamage() ))}, new LootCondition[]{ new RandomChance( 1 ) }, "AE2 Dust_" + itemstack.getItemDamage() ) ) ).toArray( LootEntryItem.class ), new LootCondition[0], new RandomValueRange( 1, 4 ), new RandomValueRange( 0, 2 ), "AE2 Dusts" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,4 +92,22 @@ public class StorageChunkProvider extends ChunkProviderOverworld
|
|||
{
|
||||
return new ArrayList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateStructures( Chunk chunkIn, int x, int z )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos getStrongholdGen( World worldIn, String structureName, BlockPos position )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recreateStructures( Chunk chunkIn, int x, int z )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,6 @@ public class StorageHelper
|
|||
return instance;
|
||||
}
|
||||
|
||||
//TODO 1.9.4 aftermath - Check that this still works.
|
||||
/**
|
||||
* Mostly from dimensional doors.. which mostly got it form X-Comp.
|
||||
*
|
||||
|
@ -125,7 +124,7 @@ public class StorageHelper
|
|||
}
|
||||
else
|
||||
{
|
||||
entity.changeDimension( newWorld.provider.getDimension() );
|
||||
entity.getServer().getPlayerList().transferEntityToWorld( entity, entity.dimension, entity.getServer().worldServerForDimension( entity.dimension ), (WorldServer) link.dim, new METeleporter( newWorld, link ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -176,8 +176,8 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
|
|||
|
||||
if( this.canBeRotated() )
|
||||
{
|
||||
data.setString( "forward", this.forward.name() );
|
||||
data.setString( "up", this.up.name() );
|
||||
data.setString( "forward", this.getForward().name() );
|
||||
data.setString( "up", this.getUp().name() );
|
||||
}
|
||||
|
||||
if( this.customName != null )
|
||||
|
|
|
@ -109,23 +109,23 @@ public class TileController extends AENetworkPowerTile
|
|||
return;
|
||||
}
|
||||
|
||||
ControllerBlockState metaState = ControllerBlockState.OFFLINE;
|
||||
ControllerBlockState metaState = ControllerBlockState.offline;
|
||||
|
||||
try
|
||||
{
|
||||
if( this.getProxy().getEnergy().isNetworkPowered() )
|
||||
{
|
||||
metaState = ControllerBlockState.ONLINE;
|
||||
metaState = ControllerBlockState.online;
|
||||
|
||||
if( this.getProxy().getPath().getControllerState() == ControllerState.CONTROLLER_CONFLICT )
|
||||
{
|
||||
metaState = ControllerBlockState.CONFLICTED;
|
||||
metaState = ControllerBlockState.conflicted;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
metaState = ControllerBlockState.OFFLINE;
|
||||
metaState = ControllerBlockState.offline;
|
||||
}
|
||||
|
||||
if( this.checkController( this.pos ) && this.worldObj.getBlockState( this.pos ).getValue( BlockController.CONTROLLER_STATE ) != metaState )
|
||||
|
|
|
@ -37,7 +37,7 @@ import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.MCVersion;
|
|||
import appeng.core.AEConfig;
|
||||
|
||||
|
||||
@MCVersion( "1.8.9" )
|
||||
@MCVersion( "1.9.4" )
|
||||
public final class AppEngCore extends DummyModContainer implements IFMLLoadingPlugin
|
||||
{
|
||||
private final ModMetadata metadata = new ModMetadata();
|
||||
|
|
Loading…
Reference in New Issue