File changes

This commit is contained in:
DarkGuardsman 2013-12-04 11:47:42 -05:00
parent 3fd7b8e229
commit 1e167cb2e6
13 changed files with 10 additions and 351 deletions

View file

@ -1,13 +0,0 @@
package dark.core;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface BlockConfigFile
{
}

View file

@ -1,20 +0,0 @@
package dark.core;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import net.minecraft.tileentity.TileEntity;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface BlockTileEntityInfo
{
/** Array of tile entities this tile uses. Is a parallel array in combo with tileEntitiesName */
Class<? extends TileEntity>[] tileEntities() default {};
/** Array of tile entities names that are used to register the tile entity. Is a parallel array
* in combo with tileEntities */
String[] tileEntitiesNames() default {};
}

View file

@ -24,6 +24,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import dark.core.interfaces.IExtraInfo;
import dark.core.interfaces.IExtraInfo.IExtraBlockInfo;
import dark.core.interfaces.IExtraInfo.IExtraItemInfo;
import dark.core.prefab.BlockFluid;
import dark.core.prefab.machine.BlockMachine;
import dark.machines.common.DarkMain;

View file

@ -1,4 +1,4 @@
package dark.core;
package dark.core.loader;
import java.util.Arrays;
import java.util.LinkedList;

View file

@ -1,4 +1,4 @@
package dark.core;
package dark.core.loader;
import java.io.File;
import java.util.Map;

View file

@ -1,4 +1,4 @@
package dark.core;
package dark.core.loader;
import java.awt.Desktop;
import java.awt.Dialog.ModalityType;

View file

@ -1,4 +1,4 @@
package dark.core;
package dark.core.prefab;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
@ -8,7 +8,6 @@ import net.minecraftforge.fluids.BlockFluidFinite;
import net.minecraftforge.fluids.Fluid;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.core.prefab.ModPrefab;
import dark.machines.common.DarkMain;
public class BlockFluid extends BlockFluidFinite

View file

@ -1,99 +0,0 @@
package dark.core.prefab;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityBlock extends Entity
{
@SideOnly(Side.CLIENT)
public Icon texture;
public float shadowSize = 0;
public float rotationX = 0;
public float rotationY = 0;
public float rotationZ = 0;
public double iSize, jSize, kSize;
private int brightness = -1;
public EntityBlock(World world)
{
super(world);
preventEntitySpawning = false;
noClip = true;
isImmuneToFire = true;
}
public EntityBlock(World world, double xPos, double yPos, double zPos)
{
super(world);
setPositionAndRotation(xPos, yPos, zPos, 0, 0);
}
public EntityBlock(World world, double i, double j, double k, double iSize, double jSize, double kSize)
{
this(world);
this.iSize = iSize;
this.jSize = jSize;
this.kSize = kSize;
setPositionAndRotation(i, j, k, 0, 0);
this.motionX = 0.0;
this.motionY = 0.0;
this.motionZ = 0.0;
}
@Override
public void setPosition(double d, double d1, double d2)
{
super.setPosition(d, d1, d2);
boundingBox.minX = posX;
boundingBox.minY = posY;
boundingBox.minZ = posZ;
boundingBox.maxX = posX + iSize;
boundingBox.maxY = posY + jSize;
boundingBox.maxZ = posZ + kSize;
}
@Override
public void moveEntity(double d, double d1, double d2)
{
setPosition(posX + d, posY + d1, posZ + d2);
}
public void setBrightness(int brightness)
{
this.brightness = brightness;
}
@Override
protected void entityInit()
{
// TODO Auto-generated method stub
}
@Override
protected void readEntityFromNBT(NBTTagCompound data)
{
iSize = data.getDouble("iSize");
jSize = data.getDouble("jSize");
kSize = data.getDouble("kSize");
}
@Override
protected void writeEntityToNBT(NBTTagCompound data)
{
data.setDouble("iSize", iSize);
data.setDouble("jSize", jSize);
data.setDouble("kSize", kSize);
}
@Override
public int getBrightnessForRender(float par1)
{
return brightness > 0 ? brightness : super.getBrightnessForRender(par1);
}
}

View file

@ -10,8 +10,6 @@ import dark.machines.common.DarkMain;
public class ItemBasic extends Item
{
public static final Icon[] ICONS = new Icon[256];
public ItemBasic(int itemID, String name, Configuration config)
{
super(config.getItem(name, itemID).getInt());

View file

@ -1,4 +1,4 @@
package dark.core.prefab;
package dark.core.prefab.entities;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;

View file

@ -1,207 +0,0 @@
package dark.core.prefab.invgui;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import universalelectricity.core.vector.Vector2;
import universalelectricity.prefab.vector.Region2;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.api.access.AccessUser;
import dark.core.interfaces.IScroll;
import dark.core.prefab.ModPrefab;
@SideOnly(Side.CLIENT)
public class GuiGlobalList extends GuiContainer implements IScroll
{
EntityPlayer player;
private GuiTextField stringInput;
private int scroll = 0;
private static final int SPACING = 10;
private final HashMap<Object, Vector2> outputMap = new HashMap<Object, Vector2>();
public GuiGlobalList(EntityPlayer player)
{
super(new ContainerFake(null));
this.player = player;
}
@Override
protected void keyTyped(char character, int keycode)
{
if (keycode == Keyboard.KEY_ESCAPE)
{
this.mc.thePlayer.closeScreen();
}
this.stringInput.textboxKeyTyped(character, keycode);
}
@Override
public void initGui()
{
super.initGui();
int width = (this.width - this.width) / 2;
int height = (this.height - this.height) / 2;
this.stringInput = new GuiTextField(this.fontRenderer, width + 12, height + 165, 135, 11);
this.stringInput.setMaxStringLength(30);
this.buttonList.add(new GuiButtonArrow(1, width + 151, height + 21, false));
this.buttonList.add(new GuiButtonArrow(2, width + 151, height + 152, true));
Keyboard.enableRepeatEvents(true);
}
@Override
public void onGuiClosed()
{
super.onGuiClosed();
Keyboard.enableRepeatEvents(false);
}
@Override
public void updateScreen()
{
super.updateScreen();
this.stringInput.setFocused(true);
}
@Override
public void handleMouseInput()
{
super.handleMouseInput();
}
@Override
protected void actionPerformed(GuiButton button)
{
super.actionPerformed(button);
}
@Override
protected void mouseClicked(int x, int y, int type)
{
super.mouseClicked(x, y, type);
if (type == 0)
{
Iterator<Entry<Object, Vector2>> it = this.outputMap.entrySet().iterator();
while (it.hasNext())
{
Entry<Object, Vector2> entry = it.next();
Vector2 minPos = entry.getValue();
minPos.x -= 2;
minPos.y -= 2;
Vector2 maxPos = minPos.clone();
maxPos.x += 132;
maxPos.y += SPACING + 2;
if (new Region2(minPos, maxPos).isIn(new Vector2(x - this.guiLeft, y - this.guiTop)))
{
this.clickedEntry(entry.getKey());
}
}
}
this.stringInput.mouseClicked(x, y, type);
}
public void clickedEntry(Object entry)
{
}
@Override
protected void drawGuiContainerForegroundLayer(int x, int y)
{
String title = "Global Access Interface";
this.fontRenderer.drawString("\u00a77" + title, this.width / 2 - title.length() * 3, 4, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
{
ResourceLocation name = new ResourceLocation(ModPrefab.GUI_DIRECTORY + ":gui_access_base.png");
this.mc.renderEngine.bindTexture(name);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int containerWidth = (this.width - this.width) / 2;
int containerHeight = (this.height - this.height) / 2;
this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.width, this.height);
}
public void drawConsole(int x, int y, int lines)
{
int color = 14737632;
outputMap.clear();
// Draws Each Line
for (int i = 0; i < lines; i++)
{
int currentLine = i + this.getScroll();
if (currentLine < this.getListLength() && currentLine >= 0)
{
Object object = getDisplayList().get(currentLine);
String line = "-----";
if (object instanceof AccessUser)
{
AccessUser accesInfo = (AccessUser) object;
line = accesInfo.getName() + " (" + accesInfo.getGroup().getName() + ")";
}
else if (object instanceof String)
{
String accesInfo = (String) object;
line = "List: " + accesInfo;
}
if (line != null && line != "")
{
Vector2 drawPosition = new Vector2(x, SPACING * i + y);
outputMap.put(object, drawPosition);
this.fontRenderer.drawString(line, drawPosition.intX(), drawPosition.intY(), color);
}
}
}
}
public int getListLength()
{
return 10;
}
public List getDisplayList()
{
return new ArrayList();
}
@Override
public void scroll(int amount)
{
this.setScroll(this.scroll + amount);
}
@Override
public void setScroll(int length)
{
this.scroll = Math.max(Math.min(length, this.getListLength()), 0);
}
@Override
public int getScroll()
{
return this.scroll;
}
}

View file

@ -19,7 +19,7 @@ import dark.api.ISentryGun;
import dark.core.helpers.MathHelper;
import dark.core.helpers.RayTraceHelper;
import dark.core.network.PacketHandler;
import dark.core.prefab.EntityTileDamage;
import dark.core.prefab.entities.EntityTileDamage;
import dark.core.prefab.machine.TileEntityMachine;
import dark.machines.common.DarkMain;

View file

@ -11,7 +11,7 @@ import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import universalelectricity.core.vector.Vector3;
import dark.core.prefab.EntityBlock;
import dark.core.prefab.entities.EntityFakeBlock;
public class RenderBlockEntity extends Render
{
@ -25,10 +25,10 @@ public class RenderBlockEntity extends Render
@Override
public void doRender(Entity entity, double i, double j, double k, float f, float f1)
{
doRenderBlock((EntityBlock) entity, i, j, k);
doRenderBlock((EntityFakeBlock) entity, i, j, k);
}
public void doRenderBlock(EntityBlock entity, double i, double j, double k)
public void doRenderBlock(EntityFakeBlock entity, double i, double j, double k)
{
if (entity.isDead)
return;