src upload

This commit is contained in:
Harrison Deng 2015-11-13 16:22:09 -05:00
commit 4474f3bb23
96 changed files with 3148 additions and 0 deletions

View File

@ -0,0 +1,61 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization;
import net.minecraft.client.Minecraft;
import net.minecraftforge.common.MinecraftForge;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.asuworldgen.WorldGen;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.asuworldgen.oregen.ASUWorldOreGen;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modGUIs.ASUGuiHandler;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modGUIs.GuiWrenchOverlay;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.ModBlocks;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.ModTileEntities;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.packets.ASUCoreTogglePacket;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.proxy.CommonProxy;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ASUCrafting;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.relauncher.Side;
@Mod(modid = ModInfo.MODID, name = ModInfo.NAME, version = ModInfo.VERSION)
public class AdvancedSatelliteUtilization {
@Mod.Instance(ModInfo.MODID)
public static AdvancedSatelliteUtilization instance;
public static SimpleNetworkWrapper packet;
@SidedProxy(clientSide = "org.bitbucket.alltra101ify.advancedsatelliteutilization.proxy.ClientProxy", serverSide = "org.bitbucket.alltra101ify.advancedsatelliteutilization.proxy.CommonProxy")
public static CommonProxy ASUproxy;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
packet = NetworkRegistry.INSTANCE.newSimpleChannel("ASU");
ModItems.itemInit();
ModBlocks.blockInit();
ModTileEntities.TileEntityInit();
ASUproxy.registerRender();
WorldGen.preInitGen();
packet.registerMessage(ASUCoreTogglePacket.handler.class, ASUCoreTogglePacket.class, 0, Side.SERVER); }
@EventHandler
public void init(FMLInitializationEvent event) {
ASUCrafting.recipes();
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new ASUGuiHandler());
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(new GuiWrenchOverlay(Minecraft.getMinecraft()));
}
}

View File

@ -0,0 +1,13 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.asuworldgen;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.asuworldgen.oregen.ASUWorldOreGen;
import cpw.mods.fml.common.registry.GameRegistry;
public class WorldGen {
public static void preInitGen() {
GameRegistry.registerWorldGenerator(new ASUWorldOreGen(), 1);
}
}

View File

@ -0,0 +1,69 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.asuworldgen.oregen;
import java.util.Random;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.ModBlocks;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class ASUWorldOreGen implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case -1: OreGenNether(random, chunkX * 16, chunkZ * 16, world); break;
case 0: OreGenOverworld(random, chunkX * 16, chunkZ * 16, world); break;
case 1: OreGenEnd(random, chunkX * 16, chunkZ * 16, world); break;
}
}
private void OreGenEnd(Random random, int x, int z, World world) {
// TODO Auto-generated method stub
}
private void OreGenOverworld(Random random, int x, int z, World world) {
addOreSpawn(ModBlocks.quaridiumOre, world, random, x, z, 1, 6, 3, 3, 10);
}
private void OreGenNether(Random random, int x, int z, World world) {
// TODO Auto-generated method stub
}
/**
* @param block The block you want to spawn
* @param world The world
* @param random The Random
* @param blockXPos the blockXpos of a chunk
* @param blockZPos the blockZpos of a chunk
* @param minVeinSize min vein
* @param maxVeinSize max vein
* @param chancesToSpawn the chance to spawn. Usually around 2
* @param minY lowest point to spawn
* @param maxY highest point to spawn
*/
public void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int minVeinSize, int maxVeinSize, int chancesToSpawn, int minY, int maxY )
{
WorldGenMinable minable = new WorldGenMinable(block, (minVeinSize + random.nextInt(maxVeinSize - minVeinSize)), Blocks.stone);
for(int i = 0; i < chancesToSpawn; i++)
{
int posX = blockXPos + random.nextInt(16);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(16);
minable.generate(world, random, posX, posY, posZ);
//System.out.println("chance of ore spawned: " + "x: " + posX + "y: " + posY + "z: " + posZ);
}
}
}

View File

@ -0,0 +1,46 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modGUIs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityNetherCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.ContainerEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.ContainerNetherCoreGenerator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
public class ASUGuiHandler implements IGuiHandler {
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity tileentity = world.getTileEntity(x, y, z);
Object returned = null;
switch(ID) {
case ModGUIs.ENDERCOREGENERATORID: if (tileentity instanceof TileEntityEnderCoreGenerator) returned = new ContainerEnderCoreGenerator(player.inventory, (TileEntityEnderCoreGenerator)tileentity);
break;
case ModGUIs.NETHERCOREGENERATORID: if (tileentity instanceof TileEntityNetherCoreGenerator) returned = new ContainerNetherCoreGenerator(player.inventory, (TileEntityNetherCoreGenerator)tileentity);
}
return returned;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
TileEntity tileentity = world.getTileEntity(x, y, z);
Object returned = null;
switch(ID) {
case ModGUIs.ENDERCOREGENERATORID: if (tileentity instanceof TileEntityEnderCoreGenerator) returned = new GuiEnderCoreGenerator(player.inventory, (TileEntityEnderCoreGenerator)tileentity);
break;
case ModGUIs.NETHERCOREGENERATORID: if (tileentity instanceof TileEntityNetherCoreGenerator) returned = new GuiNetherCoreGenerator(player.inventory, (TileEntityNetherCoreGenerator)tileentity);
break;
}
return returned;
}
}

View File

@ -0,0 +1,97 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modGUIs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.AdvancedSatelliteUtilization;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.ContainerEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.packets.ASUCoreTogglePacket;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import cpw.mods.fml.client.config.GuiCheckBox;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class GuiEnderCoreGenerator extends GuiContainer {
private ResourceLocation resource = new ResourceLocation(ModInfo.MODID + ":" + "textures/gui/GuiCoreGenerator.png");
private TileEntityEnderCoreGenerator tileentity;
public GuiEnderCoreGenerator(InventoryPlayer inventoryplayer, TileEntityEnderCoreGenerator tileentityendercoregenerator) {
super(new ContainerEnderCoreGenerator(inventoryplayer, tileentityendercoregenerator));
this.tileentity = tileentityendercoregenerator;
this.xSize = 176;
this.ySize = 149;
}
@Override
public boolean doesGuiPauseGame() {
return false;
}
@Override
public void initGui() {
super.initGui();
buttonList.add(new GuiCheckBox(0, guiLeft+112+10, guiTop+14, null, tileentity.toggle));
}
@Override
protected void actionPerformed(GuiButton guibutton) {
switch (guibutton.id) {
case 0:
if (!tileentity.toggle) {
tileentity.toggle = true;
AdvancedSatelliteUtilization.packet.sendToServer(new ASUCoreTogglePacket(1,tileentity.xCoord, tileentity.yCoord, tileentity.zCoord));
} else {
tileentity.toggle = false;
AdvancedSatelliteUtilization.packet.sendToServer(new ASUCoreTogglePacket(0, tileentity.xCoord, tileentity.yCoord, tileentity.zCoord));
}
break;
}
super.actionPerformed(guibutton);
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {
this.mc.getTextureManager().bindTexture(resource);
int scaledtobar = this.tileentity.powerScaled(100);
int scaledtopercentage = this.tileentity.powerScaled(100);
int scaledtofueltransfer = this.tileentity.genscaled(100);
int cooldown = this.tileentity.cooldownscaled(100);
int currentpower = this.tileentity.currentPower;
int percentagefontcolor;
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
drawTexturedModalRect(guiLeft+7, guiTop+8, 0, 149, scaledtobar, 16);
drawTexturedModalRect(guiLeft+7, guiTop+8 + 12, 100, 149, scaledtofueltransfer, 4);
drawTexturedModalRect(guiLeft+7, guiTop+8 + 12 + 3, 100, 149 + 4, cooldown, 3);
drawCenteredString(fontRendererObj, "Ender Core Generator", guiLeft+90, guiTop-10, 0xFFFFFF);
if (currentpower == 0) {
percentagefontcolor = 0xFF0000;
} else {
percentagefontcolor = 1111111;
}
drawString(fontRendererObj, scaledtopercentage + "% full", guiLeft+40, guiTop+30, percentagefontcolor);
drawString(fontRendererObj, scaledtofueltransfer + "% fuel", guiLeft+40, guiTop+38, percentagefontcolor);
if (mx >= guiLeft+7 && mx <= guiLeft +7+100 && my >= guiTop + 8 && my <= guiTop + 16 + 8) {
drawString(fontRendererObj, "Current MoE: " + currentpower, mx+10, my, 0xa8a8a8);
}
}
@Override
protected void drawGuiContainerForegroundLayer(int mx, int my) {
}
}

View File

@ -0,0 +1,90 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modGUIs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.AdvancedSatelliteUtilization;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityNetherCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.ContainerEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.ContainerNetherCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.packets.ASUCoreTogglePacket;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import cpw.mods.fml.client.config.GuiCheckBox;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
public class GuiNetherCoreGenerator extends GuiContainer {
private ResourceLocation resource = new ResourceLocation(ModInfo.MODID + ":" + "textures/gui/GUICoreGenerator.png");
private TileEntityNetherCoreGenerator tileentity;
public GuiNetherCoreGenerator(InventoryPlayer inventoryplayer, TileEntityNetherCoreGenerator tileentitynethercoregenerator) {
super(new ContainerNetherCoreGenerator(inventoryplayer, tileentitynethercoregenerator));
this.tileentity = tileentitynethercoregenerator;
this.xSize = 176;
this.ySize = 149;
}
@Override
public boolean doesGuiPauseGame() {
return false;
}
@Override
public void initGui() {
super.initGui();
buttonList.add(new GuiCheckBox(0, guiLeft+112+10, guiTop+14, null, tileentity.toggle));
}
@Override
protected void actionPerformed(GuiButton guibutton) {
switch (guibutton.id) {
case 0:
if (!tileentity.toggle) {
tileentity.toggle = true;
AdvancedSatelliteUtilization.packet.sendToServer(new ASUCoreTogglePacket(1,tileentity.xCoord, tileentity.yCoord, tileentity.zCoord));
} else {
tileentity.toggle = false;
AdvancedSatelliteUtilization.packet.sendToServer(new ASUCoreTogglePacket(0, tileentity.xCoord, tileentity.yCoord, tileentity.zCoord));
}
break;
}
super.actionPerformed(guibutton);
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {
this.mc.getTextureManager().bindTexture(resource);
int scaledtobar = this.tileentity.powerScaled(100);
int scaledtopercentage = this.tileentity.powerScaled(100);
int scaledtofueltransfer = this.tileentity.genscaled(100);
int cooldown = this.tileentity.cooldownscaled(100);
int currentpower = this.tileentity.currentPower;
int percentagefontcolor;
int White;
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
drawTexturedModalRect(guiLeft+7, guiTop+8, 0, 149, scaledtobar, 16);
drawTexturedModalRect(guiLeft+7, guiTop+8 + 12, 100, 149, scaledtofueltransfer, 4);
drawTexturedModalRect(guiLeft+7, guiTop+8 + 12 + 3, 100, 149 + 4, cooldown, 3);
drawCenteredString(fontRendererObj, "Nether Core Generator", guiLeft+90, guiTop-10, 0xFFFFFF);
if (currentpower ==0) {
percentagefontcolor = 0xFF0000;
} else {
percentagefontcolor = 1111111;
}
drawString(fontRendererObj, scaledtopercentage + "% full", guiLeft+40, guiTop+30, percentagefontcolor);
drawString(fontRendererObj, scaledtofueltransfer + "% fuel", guiLeft+40, guiTop+38, percentagefontcolor);
if (mx >= guiLeft+7 && mx <= guiLeft +7+100 && my >= guiTop +8 && my <= guiTop + 16 +8) {
drawString(fontRendererObj, "Current MoE: " + currentpower + "/" + tileentity.maxpower, mx+10, my, 0xa8a8a8);
}
}
}

View File

@ -0,0 +1,87 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modGUIs;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import java.util.Collection;
import java.util.Iterator;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import org.lwjgl.opengl.GL11;
//
// GuiBuffBar implements a simple status bar at the top of the screen which
// shows the current buffs/debuffs applied to the character.
//
public class GuiWrenchOverlay extends Gui
{
private Minecraft mc;
private ResourceLocation resource = new ResourceLocation(ModInfo.MODID + ":" + "textures/gui/WrenchGUI.png");
private static final byte XSIZE = 12, YSIZE = 11, XSTART = 12, YSTART = 0;
int xPos = 16;
int yPos = 8;
public GuiWrenchOverlay(Minecraft mc)
{
super();
// We need this to invoke the render engine.
this.mc = mc;
}
@SubscribeEvent(priority = EventPriority.NORMAL)
public void onRenderExperienceBar(RenderGameOverlayEvent event)
{
if(event.isCancelable() || event.type != ElementType.EXPERIENCE)
{
return;
}
if (mc.thePlayer.getCurrentEquippedItem()!= null && mc.thePlayer.getCurrentEquippedItem().getItem().equals(ModItems.wrench) && mc.thePlayer.getCurrentEquippedItem().stackTagCompound != null)
{
byte mode = mc.thePlayer.getCurrentEquippedItem().stackTagCompound.getByte("Mode");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
this.mc.getTextureManager().bindTexture(resource);
switch (mode) {
case -1: switchOnOff(false);
break;
case 0: this.drawTexturedModalRect(xPos, yPos, XSTART, YSTART, XSIZE, YSIZE); switchOnOff(true);
break;
case 1: this.drawTexturedModalRect(xPos, yPos, XSTART + mode*XSIZE, YSTART, XSIZE, YSIZE); switchOnOff(true);
break;
case 2: this.drawTexturedModalRect(xPos, yPos, XSTART + mode*XSIZE, YSTART, XSIZE, YSIZE); switchOnOff(true);
break;
case 3: this.drawTexturedModalRect(xPos, yPos, XSTART + mode*XSIZE, YSTART, XSIZE, YSIZE); switchOnOff(true);
break;
case 4: this.drawTexturedModalRect(xPos, yPos, XSTART + mode*XSIZE, YSTART, XSIZE, YSIZE); switchOnOff(true);
break;
case 5: this.drawTexturedModalRect(xPos, yPos, XSTART + mode*XSIZE, YSTART, XSIZE, YSIZE); switchOnOff(true);
}
}
}
void switchOnOff(boolean onOff) {
if (onOff) {
this.drawTexturedModalRect(xPos-12, yPos, XSTART - 12, YSTART+11, XSIZE, YSIZE);
} else {
this.drawTexturedModalRect(xPos-12, yPos, XSTART - 12, YSTART, XSIZE, YSIZE);
}
}
}

View File

@ -0,0 +1,8 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modGUIs;
public class ModGUIs {
public static final byte ENDERCOREGENERATORID = 0;
public static final byte NETHERCOREGENERATORID = 1;
}

View File

@ -0,0 +1,41 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityASUPedestal;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
public class ASUPedestal extends BlockContainer {
protected ASUPedestal() {
super(Material.rock);
setHardness(2);
setLightLevel(0.3f);
setBlockName("ASUPedestal");
setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setCreativeTab(ModCreativeTabs.TabASU);
setLightOpacity(1);
}
public int getRenderType() {
return -1;
}
public boolean isOpaqueCube() {
return false;
}
public boolean renderAsNormalBlock() {
return false;
}
@Override
public TileEntity createNewTileEntity(World world, int var) {
return new TileEntityASUPedestal();
}
}

View File

@ -0,0 +1,22 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
public class BlockOfASHAD extends Block {
protected BlockOfASHAD() {
super(Material.iron);
setBlockName("BlockOfASHAD");
setHardness(8);
setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setHarvestLevel("pickaxe", 2);
setResistance(2100F);
setCreativeTab(ModCreativeTabs.TabASU);
}
}

View File

@ -0,0 +1,41 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
public class Blocker extends Block {
protected Blocker() {
super(Material.cloth);
setBlockName("B-Lock-er");
setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setHardness(1F);
}
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if (!world.isRemote) {
player.addChatMessage(new ChatComponentText("YOU'VE BEEN B-LOCK-ER'ed (thomasvermette did some graphics for this mod so ya...)"));
}
return true;
}
public boolean isOpaque() {
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
}

View File

@ -0,0 +1,86 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityCoreStabilizer;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModMachineBlock;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class CoreStabilizer extends ModMachineBlock {
protected CoreStabilizer() {
super(Material.rock);
setBlockName("CoreStabilizer");
setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setCreativeTab(ModCreativeTabs.TabASU);
setResistance(8);
setHardness(8);
setHarvestLevel("pickaxe", 2);
}
@Override
public TileEntity createNewTileEntity(World world, int var) {
return new TileEntityCoreStabilizer(world);
}
public int getRenderType() {
return -1;
}
public boolean isOpaqueCube() {
return false;
}
public boolean renderAsNormalBlock() {
return false;
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if (!world.isRemote) {
isMultBlock(world, x, y, z);
}
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ModItems.wrench) {
int[] info = this.wrenched(player, world, x, y, z, false, 0, (byte) 0, new ItemStack(ModBlocks.CoreStabilizer, 1));
}
return true;
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block b) {
isMultBlock(world, x, y, z);
super.onNeighborBlockChange(world, x, y, z, b);
}
public void isMultBlock(World world, int x, int y, int z) {
if (world.getTileEntity(x, y+1, z) instanceof TileEntityCoreGenerator) {
world.scheduleBlockUpdate(x, y+1, z, world.getBlock(x, y+1, z), 0);
((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).version = 2;
if (((TileEntityCoreGenerator)world.getTileEntity(x, y+1, z)).multiblock == true) {
((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).multiblock = true;
} else {
((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).multiblock = false;
}
} else if (world.getTileEntity(x, y-1, z) instanceof TileEntityCoreGenerator) {
world.scheduleBlockUpdate(x, y-1, z, world.getBlock(x, y-1, z), 0);
((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).version = 1;
if (((TileEntityCoreGenerator)world.getTileEntity(x, y-1, z)).multiblock == true) {
((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).multiblock = true;
} else {
((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).multiblock = false;
}
} else {
((TileEntityCoreStabilizer)world.getTileEntity(x, y, z)).version = 0;
}
world.markBlockForUpdate(x, y, z);
}
}

View File

@ -0,0 +1,90 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks;
import java.util.Random;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.AdvancedSatelliteUtilization;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modGUIs.ModGUIs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModMachineBlock;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator;
import org.lwjgl.input.Keyboard;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class EnderCoreGenerator extends ModMachineBlock {
protected EnderCoreGenerator() {
super(Material.rock);
setCreativeTab(ModCreativeTabs.TabASU);
setBlockName("EnderCoreGenerator");
setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setResistance(8);
setHardness(8);
setHarvestLevel("pickaxe", 2);
setLightLevel(0.4f);
this.isBlockContainer = true;
}
@Override
public TileEntity createNewTileEntity(World world, int var) {
return new TileEntityEnderCoreGenerator();
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block b) {
world.scheduleBlockUpdate(x, y, z, ModBlocks.EnderCoreGenerator, 1);
super.onNeighborBlockChange(world, x, y, z, b);
}
@Override
public void updateTick(World world, int x, int y, int z, Random r) {
this.isMultiBlock(world, x, y, z);
super.updateTick(world, x, y, z, r);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ModItems.wrench) {
int[] info = this.wrenched(player, world, x, y, z, ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).multiblock, ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).currentPower, (byte) ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).powerScaled(100), new ItemStack(ModBlocks.EnderCoreGenerator, 1));
switch (info[1]) {
case 0: ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).currentPower = info[0];
break;
case 1: FMLNetworkHandler.openGui(player, AdvancedSatelliteUtilization.instance, ModGUIs.ENDERCOREGENERATORID, world, x, y, z);
break;
}
} else if (world.getTileEntity(x, y, z) != null && ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).humanInterface() && !world.isRemote && ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).multiblock) {
FMLNetworkHandler.openGui(player, AdvancedSatelliteUtilization.instance, ModGUIs.ENDERCOREGENERATORID, world, x, y, z);
}
return true;
}
public void isMultiBlock(World world, int x, int y, int z) {
if (world.getBlock(x, y+1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-2, z) == ModBlocks.blockofashadwithquaridium && world.getBlock(x, y+2, z) == ModBlocks.blockofashadwithquaridium) {
((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).multiblock = true;
} else {
((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).multiblock = false;
}
world.markBlockForUpdate(x, y, z);
}
}

View File

@ -0,0 +1,5 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks;
public class ModBlockMaterials {
}

View File

@ -0,0 +1,29 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ASURegistryHelper;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public class ModBlocks {
public static Block blockofashad = new BlockOfASHAD();
public static Block transparentblockofashad = new TransparentBlockOfASHAD();
public static Block creditsBlock = new Blocker();
public static Block ASUPedestal = new ASUPedestal();
public static Block EnderCoreGenerator = new EnderCoreGenerator();
public static Block CoreStabilizer = new CoreStabilizer();
public static Block quaridiumOre = new QuaridiumOre(Material.iron);
public static Block blockofashadwithquaridium = new blockOfASHADWithQuaridium(Material.iron);
public static Block netherCoreGenerator = new NetherCoreGenerator();
public static void blockInit() {
ASURegistryHelper.registerBlock(blockofashad);
ASURegistryHelper.registerBlock(transparentblockofashad);
ASURegistryHelper.registerBlock(creditsBlock);
ASURegistryHelper.registerBlock(ASUPedestal);
ASURegistryHelper.registerBlock(EnderCoreGenerator);
ASURegistryHelper.registerBlock(CoreStabilizer);
ASURegistryHelper.registerBlock(quaridiumOre);
ASURegistryHelper.registerBlock(blockofashadwithquaridium);
ASURegistryHelper.registerBlock(netherCoreGenerator);
}
}

View File

@ -0,0 +1,84 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.AdvancedSatelliteUtilization;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modGUIs.ModGUIs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityNetherCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModMachineBlock;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
public class NetherCoreGenerator extends ModMachineBlock {
protected NetherCoreGenerator() {
super(Material.rock);
setCreativeTab(ModCreativeTabs.TabASU);
setBlockName("NetherCoreGenerator");
setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setResistance(8);
setHardness(8);
setHarvestLevel("pickaxe", 2);
setLightLevel(0.6f);
this.isBlockContainer = true;
}
@Override
public TileEntity createNewTileEntity(World world, int var) {
// TODO Auto-generated method stub
return new TileEntityNetherCoreGenerator();
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block b) {
world.scheduleBlockUpdate(x, y, z, ModBlocks.netherCoreGenerator, 1);
super.onNeighborBlockChange(world, x, y, z, b);
}
@Override
public void updateTick(World world, int x, int y, int z, Random r) {
this.isMultiBlock(world, x, y, z);
super.updateTick(world, x, y, z, r);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ModItems.wrench) {
int[] info = this.wrenched(player, world, x, y, z, ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock, ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).currentPower, (byte) ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).powerScaled(100), new ItemStack(ModBlocks.netherCoreGenerator, 1));
switch (info[1]) {
case 0: ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).currentPower = info[0];
break;
case 1: FMLNetworkHandler.openGui(player, AdvancedSatelliteUtilization.instance, ModGUIs.NETHERCOREGENERATORID, world, x, y, z);
break;
}
} else if (world.getTileEntity(x, y, z) != null && ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).humanInterface() && !world.isRemote && ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock) {
FMLNetworkHandler.openGui(player, AdvancedSatelliteUtilization.instance, ModGUIs.NETHERCOREGENERATORID, world, x, y, z);
}
return true;
}
public void isMultiBlock(World world, int x, int y, int z) {
if (world.getBlock(x, y+1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-2, z) == ModBlocks.blockofashadwithquaridium && world.getBlock(x, y+2, z) == ModBlocks.blockofashadwithquaridium) {
((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock = true;
} else {
((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock = false;
}
world.markBlockForUpdate(x, y, z);
}
}

View File

@ -0,0 +1,21 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
public class QuaridiumOre extends Block {
protected QuaridiumOre(Material material) {
super(material);
setBlockName("QuaridiumOre");
setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setHardness(5);
setLightLevel(0.3f);
setHarvestLevel("pickaxe", 3);
setCreativeTab(ModCreativeTabs.TabASU);
}
}

View File

@ -0,0 +1,33 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBreakable;
import net.minecraft.block.BlockGlass;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
public class TransparentBlockOfASHAD extends Block {
public TransparentBlockOfASHAD() {
super(Material.glass);
this.setCreativeTab(ModCreativeTabs.TabASU);
setBlockName("TransparentBlockOfASHAD");
setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setHardness(1);
setResistance(3);
}
public boolean isOpaqueCube() {
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
}

View File

@ -0,0 +1,22 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public class blockOfASHADWithQuaridium extends Block {
public blockOfASHADWithQuaridium(Material material) {
super(material);
setBlockName("BlockOfASHADWithQuaridium");
setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setHardness(12);
setHarvestLevel("pickaxe", 2);
setResistance(2200F);
setCreativeTab(ModCreativeTabs.TabASU);
}
}

View File

@ -0,0 +1,14 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ASURegistryHelper;
public class ModTileEntities {
public static void TileEntityInit() {
ASURegistryHelper.registerTileEntity(TileEntityCoreStabilizer.class, "CoreStabilizer");
ASURegistryHelper.registerTileEntity(TileEntityASUPedestal.class, "ASUPedestal");
ASURegistryHelper.registerTileEntity(TileEntityEnderCoreGenerator.class, "EnderCore");
ASURegistryHelper.registerTileEntity(TileEntityNetherCoreGenerator.class, "NetherCore");
}
}

View File

@ -0,0 +1,9 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities;
import net.minecraft.tileentity.TileEntity;
public class TileEntityASUPedestal extends TileEntity {
}

View File

@ -0,0 +1,79 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class TileEntityCoreStabilizer extends TileEntity {
World world;
public TileEntityCoreStabilizer(World world) {
this.world = world;
}
public TileEntityCoreStabilizer() {
}
public float rotationY;
float speed;
public boolean onOff = false;
public boolean multiblock;
public byte version;
@Override
public void updateEntity() {
if (!multiblock && onOff) {
onOff = false;
}
rotationY += speed;
if (rotationY >= 6.3f) {
rotationY = 0f;
}
if (onOff && speed < 0.055f) {
speed += 0.001f;
} else if (onOff == false && speed > 0f) {
speed -= 0.001f;
}
}
@Override
public void readFromNBT(NBTTagCompound var1) {
this.rotationY = var1.getFloat("rotationY");
this.speed = var1.getFloat("speed");
this.onOff = var1.getBoolean("onOff");
super.readFromNBT(var1);
}
@Override
public void writeToNBT(NBTTagCompound var1) {
var1.setFloat("rotationY", this.rotationY);
var1.setFloat("speed", this.speed);
var1.setBoolean("onOff", this.onOff);
super.writeToNBT(var1);
}
public Packet getDescriptionPacket() {
NBTTagCompound tag = new NBTTagCompound();
writeToNBT(tag);
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, tag);
}
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
readFromNBT(pkt.func_148857_g());
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}

View File

@ -0,0 +1,85 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
public class TileEntityEnderCoreGenerator extends TileEntityCoreGenerator implements ISidedInventory {
int[] fuelqueue;
public TileEntityEnderCoreGenerator() {
fuelqueue = new int[1];
fuelqueue[0] = 100;
itemValidityByString("ender");
configureVars(fuelqueue);
configureVars(150);
setMaxPower(40000);
}
@Override
public void readFromNBT(NBTTagCompound var1) {
this.rotationY = var1.getFloat("rotationY");
this.rotationX = var1.getFloat("rotationX");
this.speed = var1.getFloat("speed");
this.toggle = var1.getBoolean("toggle");
this.speedSlower = var1.getFloat("speedSlower");
this.currentPower = var1.getInteger("currentPower");
this.multiblock = var1.getBoolean("multiblock");
this.currentPower = var1.getInteger("currentPower");
this.currentfuelqueue = var1.getInteger("Fuel");
this.currentcooldown = var1.getInteger("currentCooldown");
this.cooldown = var1.getInteger("cooldown");
NBTTagList slots = var1.getTagList("items", 10);
this.items = new ItemStack[getSizeInventory()];
for (int i = 0; i < slots.tagCount(); i++) {
NBTTagCompound item = slots.getCompoundTagAt(i);
byte itemPos = item.getByte("itemPos");
if (itemPos >= 0 && itemPos < this.items.length) {
this.items[itemPos] = ItemStack.loadItemStackFromNBT(item);
}
if (var1.hasKey("customName")) {
this.setCustomInventoryName(var1.getString("customName"));
}
}
super.readFromNBT(var1);
}
@Override
public void writeToNBT(NBTTagCompound var1) {
var1.setFloat("rotationY", this.rotationY);
var1.setFloat("rotationX", this.rotationX);
var1.setFloat("speed", this.speed);
var1.setBoolean("toggle", this.toggle);
var1.setFloat("speedSlower", this.speedSlower);
var1.setBoolean("multiblock", this.multiblock);
var1.setInteger("currentPower", this.currentPower);
var1.setInteger("Fuel", this.currentfuelqueue);
var1.setInteger("currentCooldown", this.currentcooldown);
var1.setInteger("cooldown", this.cooldown);
NBTTagList slots = new NBTTagList();
for (int i = 0; i < items.length; i++) {
if (this.items[i] != null) {
NBTTagCompound item = new NBTTagCompound();
item.setByte("itemPos", (byte) i);
this.items[i].writeToNBT(item);
slots.appendTag(item);
}
}
if (this.hasCustomInventoryName()) {
var1.setString("customName", this.customName);
}
var1.setTag("items", slots);
super.writeToNBT(var1);
}
}

View File

@ -0,0 +1,91 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator;
public class TileEntityNetherCoreGenerator extends TileEntityCoreGenerator implements ISidedInventory {
Item[] item;
int[] fuel;
public TileEntityNetherCoreGenerator() {
fuel = new int[1];
item = new Item[1];
fuel[0] = 110;
item[0] = Items.blaze_rod;
configureVars(fuel, 30000, 125);
ItemValidityByItem(item);
}
@Override
public void readFromNBT(NBTTagCompound var1) {
this.rotationY = var1.getFloat("rotationY");
this.rotationX = var1.getFloat("rotationX");
this.speed = var1.getFloat("speed");
this.toggle = var1.getBoolean("toggle");
this.speedSlower = var1.getFloat("speedSlower");
this.currentPower = var1.getInteger("currentPower");
this.multiblock = var1.getBoolean("multiblock");
this.currentPower = var1.getInteger("currentPower");
this.currentfuelqueue = var1.getInteger("Fuel");
this.currentcooldown = var1.getInteger("currentCooldown");
this.cooldown = var1.getInteger("cooldown");
NBTTagList slots = var1.getTagList("items", 10);
this.items = new ItemStack[getSizeInventory()];
for (int i = 0; i < slots.tagCount(); i++) {
NBTTagCompound item = slots.getCompoundTagAt(i);
byte itemPos = item.getByte("itemPos");
if (itemPos >= 0 && itemPos < this.items.length) {
this.items[itemPos] = ItemStack.loadItemStackFromNBT(item);
}
if (var1.hasKey("customName")) {
this.setCustomInventoryName(var1.getString("customName"));
}
}
super.readFromNBT(var1);
}
@Override
public void writeToNBT(NBTTagCompound var1) {
var1.setFloat("rotationY", this.rotationY);
var1.setFloat("rotationX", this.rotationX);
var1.setFloat("speed", this.speed);
var1.setBoolean("toggle", this.toggle);
var1.setFloat("speedSlower", this.speedSlower);
var1.setBoolean("multiblock", this.multiblock);
var1.setInteger("currentPower", this.currentPower);
var1.setInteger("Fuel", this.currentfuelqueue);
var1.setInteger("currentCooldown", this.currentcooldown);
var1.setInteger("cooldown", this.cooldown);
NBTTagList slots = new NBTTagList();
for (int i = 0; i < items.length; i++) {
if (this.items[i] != null) {
NBTTagCompound item = new NBTTagCompound();
item.setByte("itemPos", (byte) i);
this.items[i].writeToNBT(item);
slots.appendTag(item);
}
}
if (this.hasCustomInventoryName()) {
var1.setString("customName", this.customName);
}
var1.setTag("items", slots);
super.writeToNBT(var1);
}
}

View File

@ -0,0 +1,86 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.modslots.EnderCoreGeneratorSlot;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator;
public class ContainerEnderCoreGenerator extends Container {
public static final int INPUT_1 = 0;
public TileEntityEnderCoreGenerator endercoregenerator;
public ContainerEnderCoreGenerator(InventoryPlayer inventoryplayer,
TileEntityEnderCoreGenerator tileentity) {
this.endercoregenerator = tileentity;
this.addSlotToContainer(new EnderCoreGeneratorSlot(tileentity, INPUT_1, 7, 28, tileentity));
for (int i = 0; i < 3; i++) {
this.addSlotToContainer(new Slot(tileentity, 1 + i, 155, 5 + i * 19));
}
for (int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(inventoryplayer, i, 8 + i * 18,
125));
}
for (byte i = 0; i < 3; i++) {
for (byte j = 0; j < 9; j++) {
this.addSlotToContainer(new Slot(inventoryplayer,
9 + j + i * 9, 8 + j * 18, 67 + i * 18));
}
}
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
// TODO Auto-generated method stub
return true;
}
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2SlotId) {
ItemStack itemstack = null;
Slot slot = (Slot) this.inventorySlots.get(par2SlotId);
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (par2SlotId == INPUT_1) {
if (!this.mergeItemStack(itemstack1, INPUT_1+1, INPUT_1+36+1, true))
{
return null;
}
slot.onSlotChange(itemstack1, itemstack);
}
else if (par2SlotId != INPUT_1 && endercoregenerator.isItemValidForSlot(par2SlotId, itemstack1)) {
if (!this.mergeItemStack(itemstack1, INPUT_1, INPUT_1+1,
false)) {
return null;
}
}
if (itemstack1.stackSize == 0) {
slot.putStack((ItemStack) null);
} else {
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize) {
return null;
}
slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
}
return itemstack;
}
}

View File

@ -0,0 +1,87 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityNetherCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.modslots.EnderCoreGeneratorSlot;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.modslots.NetherCoreGeneratorSlot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerNetherCoreGenerator extends Container {
public static final int INPUT_1 = 0;
private TileEntityNetherCoreGenerator nethercoregenerator;
public ContainerNetherCoreGenerator(InventoryPlayer inventoryplayer,
TileEntityNetherCoreGenerator tileentity) {
this.nethercoregenerator = tileentity;
this.addSlotToContainer(new NetherCoreGeneratorSlot(tileentity, INPUT_1, 7, 28, tileentity));
for (int i = 0; i < 3; i++) {
this.addSlotToContainer(new Slot(tileentity, 1 + i, 155, 5 + i * 19));
}
for (int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(inventoryplayer, i, 8 + i * 18,
125));
}
for (byte i = 0; i < 3; i++) {
for (byte j = 0; j < 9; j++) {
this.addSlotToContainer(new Slot(inventoryplayer,
9 + j + i * 9, 8 + j * 18, 67 + i * 18));
}
}
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
// TODO Auto-generated method stub
return true;
}
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2SlotId) {
ItemStack itemstack = null;
Slot slot = (Slot) this.inventorySlots.get(par2SlotId);
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (par2SlotId == INPUT_1) {
if (!this.mergeItemStack(itemstack1, INPUT_1+1, INPUT_1+36+1, true))
{
return null;
}
slot.onSlotChange(itemstack1, itemstack);
}
else if (par2SlotId != INPUT_1 && nethercoregenerator.isItemValidForSlot(par2SlotId, itemstack1)) {
if (!this.mergeItemStack(itemstack1, INPUT_1, INPUT_1+1, false)) {
return null;
}
}
if (itemstack1.stackSize == 0) {
slot.putStack((ItemStack) null);
} else {
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize) {
return null;
}
slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
}
return itemstack;
}
}

View File

@ -0,0 +1,19 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.modslots;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class EnderCoreGeneratorSlot extends Slot {
public TileEntityEnderCoreGenerator tileentity;
public EnderCoreGeneratorSlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_, TileEntityEnderCoreGenerator tileentity) {
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
this.tileentity = tileentity;
}
@Override
public boolean isItemValid(ItemStack itemStack) {
return tileentity.isItemValidForFuelSlot(itemStack);
}
}

View File

@ -0,0 +1,21 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.modcontainers.modslots;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityNetherCoreGenerator;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class NetherCoreGeneratorSlot extends Slot {
public TileEntityNetherCoreGenerator tileentity;
public NetherCoreGeneratorSlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_, TileEntityNetherCoreGenerator tileentity) {
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
this.tileentity = tileentity;
}
@Override
public boolean isItemValid(ItemStack itemStack) {
return tileentity.isItemValidForFuelSlot(itemStack);
}
}

View File

@ -0,0 +1,77 @@
// Date: 4/25/2015 12:27:03 AM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package org.bitbucket.alltra101ify.advancedsatelliteutilization.models.blockmodel;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelASUPedestal extends ModelBase
{
//fields
ModelRenderer Top;
ModelRenderer Middle;
ModelRenderer Base;
public ModelASUPedestal()
{
textureWidth = 64;
textureHeight = 64;
Top = new ModelRenderer(this, 0, 0);
Top.addBox(0F, 0F, 0F, 16, 4, 16);
Top.setRotationPoint(-8F, 20F, -8F);
Top.setTextureSize(64, 64);
Top.mirror = true;
setRotation(Top, 0F, 0F, 0F);
Middle = new ModelRenderer(this, 0, 20);
Middle.addBox(0F, 0F, 0F, 8, 6, 8);
Middle.setRotationPoint(-4F, 11F, -4F);
Middle.setTextureSize(64, 64);
Middle.mirror = true;
setRotation(Middle, 0F, 0F, 0F);
Base = new ModelRenderer(this, 0, 48);
Base.addBox(0F, 0F, 0F, 14, 2, 14);
Base.setRotationPoint(-7F, 8F, -7F);
Base.setTextureSize(64, 64);
Base.mirror = true;
setRotation(Base, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
Top.render(f5);
Middle.render(f5);
Base.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void renderModel(float f) {
Top.render(f);
Middle.render(f);
Base.render(f);
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
}
}

View File

@ -0,0 +1,77 @@
// Date: 4/28/2015 9:53:19 PM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package org.bitbucket.alltra101ify.advancedsatelliteutilization.models.blockmodel;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelCoreGenerator extends ModelBase
{
//fields
ModelRenderer BaseB;
ModelRenderer BaseT;
public ModelRenderer MainCrystal;
public ModelCoreGenerator()
{
textureWidth = 128;
textureHeight = 128;
BaseB = new ModelRenderer(this, 0, 18);
BaseB.addBox(0F, 0F, 0F, 16, 2, 16);
BaseB.setRotationPoint(-8F, 8F, -8F);
BaseB.setTextureSize(128, 128);
BaseB.mirror = true;
setRotation(BaseB, 0F, 0F, 0F);
BaseT = new ModelRenderer(this, 0, 0);
BaseT.addBox(0F, 0F, 0F, 16, 2, 16);
BaseT.setRotationPoint(-8F, 22F, -8F);
BaseT.setTextureSize(128, 128);
BaseT.mirror = true;
setRotation(BaseT, 0F, 0F, 0F);
MainCrystal = new ModelRenderer(this, 64, 0);
MainCrystal.addBox(-4F, -4F, -4F, 8, 8, 8);
MainCrystal.setRotationPoint(0F, 16F, 0F);
MainCrystal.setTextureSize(128, 128);
MainCrystal.mirror = true;
setRotation(MainCrystal, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
BaseB.render(f5);
BaseT.render(f5);
MainCrystal.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void renderModel(float f) {
BaseB.render(f);
BaseT.render(f);
MainCrystal.render(f);
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
}
}

View File

@ -0,0 +1,113 @@
// Date: 4/29/2015 10:08:14 PM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package org.bitbucket.alltra101ify.advancedsatelliteutilization.models.blockmodel;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelCoreStabilizer extends ModelBase
{
//fields
ModelRenderer BaseB;
ModelRenderer BaseT;
ModelRenderer MiddleStabilizer;
public ModelRenderer Support1;
public ModelRenderer Support2;
public ModelRenderer Support4;
public ModelRenderer Support3;
public ModelCoreStabilizer()
{
textureWidth = 64;
textureHeight = 64;
BaseB = new ModelRenderer(this, 0, 0);
BaseB.addBox(0F, 0F, 0F, 16, 3, 16);
BaseB.setRotationPoint(-8F, 21F, -8F);
BaseB.setTextureSize(64, 64);
BaseB.mirror = true;
setRotation(BaseB, 0F, 0F, 0F);
BaseT = new ModelRenderer(this, 0, 19);
BaseT.addBox(0F, 0F, 0F, 16, 3, 16);
BaseT.setRotationPoint(-8F, 8F, -8F);
BaseT.setTextureSize(64, 64);
BaseT.mirror = true;
setRotation(BaseT, 0F, 0F, 0F);
MiddleStabilizer = new ModelRenderer(this, 16, 38);
MiddleStabilizer.addBox(0F, 0F, 0F, 2, 10, 2);
MiddleStabilizer.setRotationPoint(-1F, 11F, -1F);
MiddleStabilizer.setTextureSize(64, 64);
MiddleStabilizer.mirror = true;
setRotation(MiddleStabilizer, 0F, 0F, 0F);
Support1 = new ModelRenderer(this, 34, 38);
Support1.addBox(5F, 0F, -2F, 1, 10, 4);
Support1.setRotationPoint(0F, 11F, 0F);
Support1.setTextureSize(64, 64);
Support1.mirror = true;
setRotation(Support1, 0F, 0F, 0F);
Support2 = new ModelRenderer(this, 54, 38);
Support2.addBox(-6F, 0F, -2F, 1, 10, 4);
Support2.setRotationPoint(0F, 11F, 0F);
Support2.setTextureSize(64, 64);
Support2.mirror = true;
setRotation(Support2, 0F, 0F, 0F);
Support4 = new ModelRenderer(this, 44, 38);
Support4.addBox(-2F, 0F, 5F, 4, 10, 1);
Support4.setRotationPoint(0F, 11F, 0F);
Support4.setTextureSize(64, 64);
Support4.mirror = true;
setRotation(Support4, 0F, 0F, 0F);
Support3 = new ModelRenderer(this, 24, 38);
Support3.addBox(-2F, 0F, -6F, 4, 10, 1);
Support3.setRotationPoint(0F, 11F, 0F);
Support3.setTextureSize(64, 64);
Support3.mirror = true;
setRotation(Support3, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
BaseB.render(f5);
BaseT.render(f5);
MiddleStabilizer.render(f5);
Support1.render(f5);
Support2.render(f5);
Support4.render(f5);
Support3.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void renderModel(float f) {
BaseB.render(f);
BaseT.render(f);
MiddleStabilizer.render(f);
Support1.render(f);
Support2.render(f);
Support4.render(f);
Support3.render(f);
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
}
}

View File

@ -0,0 +1,11 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModBasicItemTemplate;
public class ASHADBrick extends ModBasicItemTemplate {
public ASHADBrick() {
setUnlocalizedName("ASHADBrick");
setTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
}
}

View File

@ -0,0 +1,14 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModBasicItemTemplate;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class AdvancedProcessingChip extends ModBasicItemTemplate {
public AdvancedProcessingChip() {
setUnlocalizedName("AdvancedProcessingUnit");
setTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
}
}

View File

@ -0,0 +1,13 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModBasicItemTemplate;
public class BasicChip extends ModBasicItemTemplate {
public BasicChip() {
setUnlocalizedName("BasicProcessingChip");
setTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
}
}

View File

@ -0,0 +1,14 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModBasicItemTemplate;
import net.minecraft.item.Item;
public class ConversionSpeedUpgrade extends ModBasicItemTemplate {
public ConversionSpeedUpgrade() {
setUnlocalizedName("ConversionSpeedUpgrade");
setTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setMaxStackSize(1);
}
}

View File

@ -0,0 +1,14 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModBasicItemTemplate;
import net.minecraft.item.Item;
public class FanModule extends ModBasicItemTemplate {
public FanModule() {
setUnlocalizedName("FanModule");
setTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setMaxStackSize(1);
}
}

View File

@ -0,0 +1,14 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModBasicItemTemplate;
import net.minecraft.creativetab.CreativeTabs;
public class FocusModule extends ModBasicItemTemplate {
public FocusModule() {
setUnlocalizedName("EarthTargetingFocus");
setTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setMaxStackSize(16);
}
}

View File

@ -0,0 +1,14 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModBasicItemTemplate;
import net.minecraft.item.Item;
public class HumanInterfaceGate extends ModBasicItemTemplate {
public HumanInterfaceGate() {
setUnlocalizedName("HumanInterfaceGate");
setTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setMaxStackSize(1);
}
}

View File

@ -0,0 +1,38 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ASURegistryHelper;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ItemBlockMaterial;
import net.minecraft.item.Item;
public class ModItems {
public static Item basicChip = new BasicChip();
public static Item processingChip = new ProcessingChip();
public static Item advancedProcessingChip = new AdvancedProcessingChip();
public static Item focusModule = new FocusModule();
public static Item spacialFocusingModule = new SpacialFocusingModule();
public static Item solderingIron = new SolderingIron(ItemBlockMaterial.WorkTool);
public static Item wrench = new Wrench(ItemBlockMaterial.WorkTool);
public static Item ashadbrick = new ASHADBrick();
public static Item quaridiumIngot = new QuaridiumIngot();
public static Item humanInterfaceGate = new HumanInterfaceGate();
public static Item conversionSpeedUpgrade = new ConversionSpeedUpgrade();
public static Item fanModule = new FanModule();
public static void itemInit() {
ASURegistryHelper.registerItem(basicChip);
ASURegistryHelper.registerItem(processingChip);
ASURegistryHelper.registerItem(advancedProcessingChip);
ASURegistryHelper.registerItem(focusModule);
ASURegistryHelper.registerItem(spacialFocusingModule);
ASURegistryHelper.registerItem(solderingIron);
ASURegistryHelper.registerItem(wrench);
ASURegistryHelper.registerItem(ashadbrick);
ASURegistryHelper.registerItem(quaridiumIngot);
ASURegistryHelper.registerItem(humanInterfaceGate);
ASURegistryHelper.registerItem(conversionSpeedUpgrade);
ASURegistryHelper.registerItem(fanModule);
}
}

View File

@ -0,0 +1,14 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModBasicItemTemplate;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class ProcessingChip extends ModBasicItemTemplate {
public ProcessingChip() {
setUnlocalizedName("IntermediateProcessingChip");
setTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
}
}

View File

@ -0,0 +1,13 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModBasicItemTemplate;
public class QuaridiumIngot extends ModBasicItemTemplate {
public QuaridiumIngot() {
setUnlocalizedName("QuaridiumIngot");
setTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
}
}

View File

@ -0,0 +1,25 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ItemBlockMaterial;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModBasicItemTemplate;
import com.google.common.collect.Sets;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemTool;
public class SolderingIron extends Item {
public SolderingIron(ToolMaterial material) {
super();
setCreativeTab(ModCreativeTabs.TabASU);
setUnlocalizedName("SolderingIron");
setTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setMaxStackSize(1);
}
}

View File

@ -0,0 +1,16 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.ModBasicItemTemplate;
import net.minecraft.creativetab.CreativeTabs;
public class SpacialFocusingModule extends ModBasicItemTemplate {
public SpacialFocusingModule() {
setUnlocalizedName("SpacialFocusingModule");
setTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
setMaxStackSize(16);
}
}

View File

@ -0,0 +1,146 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems;
import java.util.List;
import javax.swing.Icon;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class Wrench extends Item {
private IIcon[] iconArray;
public Wrench(ToolMaterial worktool) {
setCreativeTab(ModCreativeTabs.TabASU);
setUnlocalizedName("WrenchUtility");
setMaxStackSize(1);
}
@Override
public boolean isFull3D() {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register) {
iconArray = new IIcon[2];
for (int i = 0; i < iconArray.length; ++i) {
iconArray[i] = register.registerIcon(ModInfo.MODID + ":" + "WrenchUtility/" + getUnlocalizedName().substring(5) + i);
}
this.itemIcon = iconArray[0];
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(ItemStack stack, int renderPass) {
if (stack.stackTagCompound != null && stack.stackTagCompound.getByte("Mode") == -1) {
return iconArray[0];
} else if (stack.stackTagCompound != null && stack.stackTagCompound.getByte("Mode") != -1) {
return iconArray[1];
}
return iconArray[0];
};
@Override
public void onCreated(ItemStack itemstack, World world, EntityPlayer player) {
NBTSetup(itemstack, world, player);
}
public byte GetMode(byte current, EntityPlayer player, World world) {
byte updatedcurrent = current;
updatedcurrent++;
if (player.capabilities.isCreativeMode) {
if (current >= 5) {
updatedcurrent = -1;
}
} else {
if (current >= 1) {
updatedcurrent = -1;
}
}
return updatedcurrent;
}
public void NBTSetup(ItemStack itemstack, World world, EntityPlayer player) {
if (!(itemstack.stackTagCompound != null)) {
itemstack.stackTagCompound = new NBTTagCompound();
super.onCreated(itemstack, world, player);
itemstack.stackTagCompound.setByte("Mode", (byte) -1);
}
}
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world,
EntityPlayer player) {
if (itemstack.stackTagCompound != null && player.isSneaking()) {
itemstack.stackTagCompound.setByte("Mode", GetMode(itemstack.stackTagCompound.getByte("Mode"), player, world));
} else {
NBTSetup(itemstack, world, player);
}
return super.onItemRightClick(itemstack, world, player);
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player,
List list, boolean p_77624_4_) {
if (itemstack.stackTagCompound != null) {
byte Mode = itemstack.stackTagCompound.getByte("Mode");
String TextMode = "Mode not set";
switch (Mode) {
case -1:
TextMode = "";
case 0:
TextMode = "Configure";
break;
case 1:
TextMode = "Dismantle";
break;
case 2:
TextMode = "Debug 1 (+100 Power)";
break;
case 3:
TextMode = "Debug 2 (Read power)";
break;
case 4:
TextMode = "Debug 3 (Read bar)";
break;
case 5:
TextMode = "Debug 4 (-100 Power)";
}
if (Mode == -1) {
list.add(EnumChatFormatting.GRAY + "Wrench is turned off.");
} else {
list.add(EnumChatFormatting.GREEN + "Wrench is turned on");
list.add("Mode: " + TextMode);
}
if (Mode >= 2) {
list.add(EnumChatFormatting.RED
+ "Warning, debug mode is enabled.");
}
}
super.addInformation(itemstack, player, list, p_77624_4_);
}
}

View File

@ -0,0 +1,56 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.packets;
import net.minecraft.tileentity.TileEntity;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference.TileEntityCoreGenerator;
import io.netty.buffer.ByteBuf;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
public class ASUCoreTogglePacket implements IMessage {
private int toggle, x, y, z;
public ASUCoreTogglePacket() {
}
public ASUCoreTogglePacket(int toggle, int x, int y, int z) {
this.toggle = toggle;
this.x = x;
this.y = y;
this.z = z;
}
@Override
public void fromBytes(ByteBuf buf) {
toggle = ByteBufUtils.readVarInt(buf, 3);
x = ByteBufUtils.readVarInt(buf, 5);
y = ByteBufUtils.readVarInt(buf, 5);
z = ByteBufUtils.readVarInt(buf, 5);
}
@Override
public void toBytes(ByteBuf buf) {
ByteBufUtils.writeVarInt(buf, toggle, 3);
ByteBufUtils.writeVarInt(buf, x, 5);
ByteBufUtils.writeVarInt(buf, y, 5);
ByteBufUtils.writeVarInt(buf, z, 5);
}
public static class handler implements IMessageHandler<ASUCoreTogglePacket, IMessage> {
@Override
public IMessage onMessage(ASUCoreTogglePacket message, MessageContext ctx) {
TileEntity tileentity = ctx.getServerHandler().playerEntity.getEntityWorld().getTileEntity(message.x, message.y, message.z);
if (message.toggle == 1) {
((TileEntityCoreGenerator)tileentity).toggle = true;
} else {
((TileEntityCoreGenerator)tileentity).toggle = false;
}
return null;
}
}
}

View File

@ -0,0 +1,50 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.proxy;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.MinecraftForgeClient;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.ModBlocks;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityASUPedestal;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityCoreStabilizer;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityNetherCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer.RenderASUPedestal;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer.RenderCoreStabilizer;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer.RenderEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer.RenderNetherCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer.inventoryrender.ItemRenderASUPedestal;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer.inventoryrender.ItemRenderCoreStabilizer;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer.inventoryrender.ItemRenderEnderCoreGenerator;
import cpw.mods.fml.client.registry.ClientRegistry;
public class ClientProxy extends CommonProxy {
public void registerRender() {
TileEntitySpecialRenderer renderASUPedestal = new RenderASUPedestal();
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityASUPedestal.class, renderASUPedestal);
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.ASUPedestal), new ItemRenderASUPedestal(renderASUPedestal, new TileEntityASUPedestal()));
TileEntitySpecialRenderer renderEnderCore = new RenderEnderCoreGenerator();
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEnderCoreGenerator.class, renderEnderCore);
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.EnderCoreGenerator), new ItemRenderEnderCoreGenerator(renderEnderCore, new TileEntityEnderCoreGenerator()));
TileEntitySpecialRenderer renderCoreStabilizer = new RenderCoreStabilizer();
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoreStabilizer.class, renderCoreStabilizer);
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.CoreStabilizer), new ItemRenderCoreStabilizer(renderCoreStabilizer, new TileEntityCoreStabilizer()));
TileEntitySpecialRenderer renderNetherCore = new RenderNetherCoreGenerator();
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNetherCoreGenerator.class, renderNetherCore);
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.netherCoreGenerator), new ItemRenderEnderCoreGenerator(renderNetherCore, new TileEntityNetherCoreGenerator()));
}
public void registerTileEntitySpecialRenderer() {
}
}

View File

@ -0,0 +1,17 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.proxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
public class CommonProxy {
public void registerRender() {
}
public void registerTileEntitySpecialRenderer() {
}
}

View File

@ -0,0 +1,48 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.reference;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.ModBlocks;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems;
import net.minecraft.block.Block;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;
public class ASUCrafting {
private static ItemStack ashadbrick = new ItemStack(ModItems.ashadbrick);
private static ItemStack quaridiumingot = new ItemStack(ModItems.quaridiumIngot);
public static void recipes() {
GameRegistry.addRecipe(new ItemStack(ModBlocks.blockofashad),
"xxx",
"xxx",
"xxx",
'x', ashadbrick);
GameRegistry.addRecipe(new ItemStack(ModItems.wrench),
"I I",
" H ",
" I ",
'I', new ItemStack(Items.iron_ingot), 'H', ashadbrick);
GameRegistry.addRecipe(new ItemStack(ModItems.solderingIron),
"#",
"R",
"A",'#', Items.iron_ingot, 'A', Items.brick, 'R', Items.redstone);
GameRegistry.addSmelting(ModBlocks.quaridiumOre, new ItemStack(ModItems.quaridiumIngot ), 0.5f);
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.blockofashadwithquaridium), ashadbrick, ashadbrick, ashadbrick, ashadbrick, ashadbrick, quaridiumingot, quaridiumingot, quaridiumingot, quaridiumingot);
}
}

View File

@ -0,0 +1,21 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.reference;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.common.registry.GameRegistry;
public class ASURegistryHelper {
public static void registerItem(Item item) {
GameRegistry.registerItem(item, ModInfo.MODID + item.getUnlocalizedName().substring(5));
}
public static void registerBlock(Block block) {
GameRegistry.registerBlock(block, ModInfo.MODID + block.getUnlocalizedName().substring(5));
}
public static void registerTileEntity(Class<? extends TileEntity> tileentity, String unlocalizedname) {
GameRegistry.registerTileEntity(tileentity, unlocalizedname);
}
}

View File

@ -0,0 +1,17 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.reference;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class ModCreativeTabs {
public static final CreativeTabs TabASU = new CreativeTabs(CreativeTabs.getNextID(), "asu") {
@SideOnly(Side.CLIENT)
public Item getTabIconItem() {
return ModItems.basicChip;
}
};
}

View File

@ -0,0 +1,7 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.reference;
public class ModInfo {
public static final String MODID = "asu";
public static final String NAME = "Advanced Satellite Utilization";
public static final String VERSION = "1.0.0";
}

View File

@ -0,0 +1,9 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.common.util.EnumHelper;
public class ItemBlockMaterial {
public static final ToolMaterial WorkTool = EnumHelper.addToolMaterial("WorkTool", 0, 256, 2, 2, 0);
}

View File

@ -0,0 +1,15 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModCreativeTabs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class ModBasicItemTemplate extends Item {
public ModBasicItemTemplate() {
super();
setCreativeTab(ModCreativeTabs.TabASU);
}
}

View File

@ -0,0 +1,73 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.AdvancedSatelliteUtilization;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modGUIs.ModGUIs;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.ModBlocks;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
public abstract class ModMachineBlock extends BlockContainer {
protected ModMachineBlock(Material material) {
super(material);
}
public int[] wrenched(EntityPlayer player, World world, int x, int y, int z, boolean multiblock, int currentPower, byte scale, ItemStack itemtogive) {
int[] info = new int[2];
info[0] = currentPower;
info[1] = 0;
if (player.getCurrentEquippedItem().stackTagCompound != null) {
byte mode = player.getCurrentEquippedItem().stackTagCompound.getByte("Mode");
switch (mode) {
case 0:
if (!world.isRemote && multiblock == true && world.getTileEntity(x, y, z) != null) {
info[1] = 1;
}
break;
case 1: info[1] = 2; world.setBlockToAir(x, y, z); world.removeTileEntity(x, y, z); player.inventory.addItemStackToInventory(itemtogive);
break;
case 2: info[0] += 100; if(world.isRemote) {player.addChatMessage(new ChatComponentText("added 100 power. " + "Current power: " + info[0]));};
break;
case 3: if(world.isRemote) {player.addChatMessage(new ChatComponentText("Current power: " + currentPower));}
break;
case 4: if(world.isRemote) {player.addChatMessage(new ChatComponentText("Current percentage calculation: " + scale));}
break;
case 5: info[0] -= 100; if(world.isRemote) {player.addChatMessage(new ChatComponentText("removed 100 power. " + "Current power: " + info[0]));};
break;
}
}
return info;
}
@Override
public int getRenderType() {
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
}

View File

@ -0,0 +1,356 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.moditemblockreference;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.moditems.ModItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
public class TileEntityCoreGenerator extends TileEntity implements ISidedInventory {
protected ItemStack[] items = new ItemStack[4];
public boolean inputItems;
public boolean outputPower;
public boolean toggle;
public boolean multiblock;
protected String customName;
protected int currentfuelqueue;
private int fuelqueue[];
public float rotationY;
public float rotationX;
public int maxpower;
public int currentPower;
protected float speed;
protected float speedSlower;
protected int cooldown;
public int currentcooldown;
Item[] validItemByItem;
String validItemByString;
@Override
public void updateEntity() {
if (currentcooldown != 0) {
currentcooldown--;
}
for (int i = 1; i < items.length; i++) {
if (items[i] != null) {
if (currentcooldown >= 1 && items[i].getItem() == ModItems.fanModule) {
currentcooldown--;
} else if (toggle && items[i].getItem() == ModItems.conversionSpeedUpgrade && currentfuelqueue >= 2) {
currentfuelqueue = currentfuelqueue - 2;
currentPower = currentPower + 2;
}
}
}
if (!multiblock && toggle) {
toggle = false;
}
if (currentfuelqueue > maxpower) {
currentfuelqueue = maxpower;
}
if (currentPower >= maxpower) {
inputItems = false;
currentPower = maxpower;
}
if (currentPower <= 0) {
outputPower = false;
currentPower = 0;
}
if (toggle) {
//Register fuel and such using item and fuel index system
if (items[0] != null && this.validItemByItem != null) {
for (int i = 0; i < validItemByItem.length; i++) {
if (currentfuelqueue <= maxpower - fuelqueue[i] && currentcooldown == 0 && items[0].getItem() == validItemByItem[i]) {
if (items[0].stackSize == 1) {
this.items[0] = null;
} else {
items[0].splitStack(1);
if (this.items[0].stackSize == 0) {
this.items[0] = null;
}
}
this.currentfuelqueue += fuelqueue[i];
this.currentcooldown = cooldown;
}
}
}
//Register fuel and such by default or customized index fuel
if (items[0] != null && this.validItemByString !=null) {
if (currentfuelqueue <= maxpower - fuelqueue[0] && currentcooldown == 0) {
if (items[0].stackSize == 1) {
this.items[0] = null;
} else {
items[0].splitStack(1);
if (this.items[0].stackSize == 0) {
this.items[0] = null;
}
}
this.currentfuelqueue += fuelqueue[0];
this.currentcooldown = cooldown;
}
}
if (currentfuelqueue > 0 && currentPower != maxpower) {
if (currentfuelqueue >= 10) {
currentfuelqueue -= 10;
currentPower += 10;
} else if (currentfuelqueue == 1) {
currentfuelqueue --;
currentfuelqueue ++;
}
}
}
rotationY += speed;
if (rotationY > 6.3f) {
rotationY = 0f;
}
rotationX += speedSlower;
if (rotationX >= 6.3f) {
rotationX = 0f;
}
if (toggle && speed < 0.055f) {
speed += 0.0005f;
speedSlower += 0.00007f;
} else if (toggle == false && speed > 0f) {
speed -= 0.0005f;
speedSlower -= 0.00007f;
}
}
public int powerScaled(int scale) {
return (this.currentPower * scale / maxpower);
}
public int genscaled(int scale) {
return (this.currentfuelqueue * scale / maxpower);
}
public int cooldownscaled(int scale) {
return (this.currentcooldown * scale / cooldown);
}
public boolean humanInterface() {
for (int i = 1; i < items.length; i++) {
if (items[i] != null && items[i].getItem() == ModItems.humanInterfaceGate) {
return true;
}
}
return false;
}
public Packet getDescriptionPacket() {
NBTTagCompound tag = new NBTTagCompound();
writeToNBT(tag);
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, tag);
}
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
readFromNBT(pkt.func_148857_g());
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
@Override
public int getSizeInventory() {
return this.items.length;
}
@Override
public ItemStack getStackInSlot(int slotNumber) {
return this.items[slotNumber];
}
@Override
public ItemStack decrStackSize(int slotNumber, int amountDecr) {
if (this.items[slotNumber] != null) {
//how much is returned to the hand
ItemStack itemstack;
if (this.items[slotNumber].stackSize <= amountDecr) {
itemstack = this.items[slotNumber];
this.items[slotNumber] = null;
} else {
itemstack = items[slotNumber].splitStack(amountDecr);
if (this.items[slotNumber].stackSize == 0) {
this.items[slotNumber] = null;
}
}
return itemstack;
}
return null;
}
@Override
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
return null;
}
@Override
public void setInventorySlotContents(int slotNumber, ItemStack itemstack) {
this.items[slotNumber] = itemstack;
if (itemstack != null
&& itemstack.stackSize > this.getInventoryStackLimit()) {
itemstack.stackSize = this.getInventoryStackLimit();
}
}
protected void setCustomInventoryName(String customName) {
this.customName = customName;
}
@Override
public boolean hasCustomInventoryName() {
boolean customname = false;
if (customName != null) {
customname = true;
}
return customname;
}
@Override
public int getInventoryStackLimit() {
return 64;
}
@Override
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
return true;
}
@Override
public void openInventory() {
}
@Override
public void closeInventory() {
}
@Override
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
return null;
}
@Override
public boolean canInsertItem(int p_1020071_, ItemStack p_102007_2_,
int p_102007_3_) {
return false;
}
@Override
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_,
int p_102008_3_) {
return false;
}
@Override
public String getInventoryName() {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
return isItemValidForFuelSlot(itemstack);
}
public boolean isItemValidForFuelSlot(ItemStack itemstack) {
boolean itemvalid = false;
if (this.validItemByString != null && itemstack.getItem().getUnlocalizedName().toLowerCase().contains(this.validItemByString)) {
itemvalid = true;
} else if (this.validItemByItem != null) {
for (int i1 = 0; i1 < this.validItemByItem.length; i1++) {
if (itemstack.getItem().equals(this.validItemByItem[i1])) {
itemvalid = true;
break;
}
}
}
return itemvalid;
}
/**
* @param fuelqueue how much more fuel do we give?
* @param maxpower self-explanatory
* @param cooldown cool down time to transfer next item to fuel (in ticks)
*/
public void configureVars(int[] fuelqueue, int maxpower, int cooldown) {
this.fuelqueue = fuelqueue;
this.maxpower = maxpower;
this.cooldown = cooldown;
}
public void configureVars (int[] fuelqueue) {
this.fuelqueue = fuelqueue;
}
public void configureVars (int cooldown) {
this.cooldown = cooldown;
}
public void setMaxPower (int maxpower) {
this.maxpower = maxpower;
}
public void ItemValidityByItem(Item[] item) {
this.validItemByItem = item;
}
/**
*
* @param string (should only be used for testing as there is very little control) Sets what is valid by name of item.
*/
public void itemValidityByString(String string) {
this.validItemByString = string;
}
}

View File

@ -0,0 +1,33 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.models.blockmodel.ModelASUPedestal;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
public class RenderASUPedestal extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tileentity, double x,
double y, double z, float f) {
GL11.glPushMatrix();
GL11.glTranslatef((float)x + 0.5f, (float)y + 1.5f, (float)z + 0.5f);
GL11.glRotatef(180, 0f, 0f, 1f);
this.bindTexture(texture);
this.model.renderModel(0.0625f);
GL11.glPopMatrix();
}
public RenderASUPedestal() {
this.model = new ModelASUPedestal();
}
private static final ResourceLocation texture = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/ModelASUPedestal.png");
private static ModelASUPedestal model;
}

View File

@ -0,0 +1,52 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityCoreStabilizer;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.models.blockmodel.ModelCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.models.blockmodel.ModelCoreStabilizer;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
public class RenderCoreStabilizer extends TileEntitySpecialRenderer {
private ModelCoreStabilizer modelASU = new ModelCoreStabilizer();
public static ResourceLocation[] texture = new ResourceLocation[3];
public void renderTileEntityAt(TileEntityCoreStabilizer tileentity, double x,
double y, double z, float f) {
float f1 = tileentity.rotationY;
GL11.glPushMatrix();
modelASU.Support1.rotateAngleY = f1;
modelASU.Support2.rotateAngleY = f1;
modelASU.Support3.rotateAngleY = f1;
modelASU.Support4.rotateAngleY = f1;
GL11.glTranslatef((float) x + 0.5f, (float) y + 1.5f, (float) z + 0.5f);
GL11.glRotatef(180, 0f, 0f, 1f);
this.bindTexture(texture[tileentity.version]);
modelASU.renderModel(0.0625f);
GL11.glPopMatrix();
}
public RenderCoreStabilizer() {
texture[0] = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/CoreStabilizer/ModelCoreStabilizer0.png");
texture[1] = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/CoreStabilizer/ModelCoreStabilizer1.png");
texture[2] = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/CoreStabilizer/ModelCoreStabilizer2.png");
}
@Override
public void renderTileEntityAt(TileEntity tileentity, double x,
double y, double z, float f) {
this.renderTileEntityAt((TileEntityCoreStabilizer)tileentity, x, y, z, f);
}
}

View File

@ -0,0 +1,50 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.models.blockmodel.ModelCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.lwjgl.opengl.GL11;
public class RenderEnderCoreGenerator extends TileEntitySpecialRenderer {
private ModelCoreGenerator modelASU = new ModelCoreGenerator();
public void renderTileEntityAt(TileEntityEnderCoreGenerator tileentity, double x, double y,
double z, float f) {
float f1 = tileentity.rotationY;
float f2 = tileentity.rotationX;
GL11.glPushMatrix();
modelASU.MainCrystal.rotateAngleY = f1;
modelASU.MainCrystal.rotateAngleX = f2;
GL11.glTranslatef((float) x + 0.5f, (float) y + 1.5f, (float) z + 0.5f);
GL11.glRotatef(180, 0f, 0f, 1f);
this.bindTexture(texture);
modelASU.renderModel(0.0625f);
GL11.glPopMatrix();
}
public RenderEnderCoreGenerator() {
}
private static final ResourceLocation texture = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/ModelEnderCore.png");
@Override
public void renderTileEntityAt(TileEntity tileentity, double x,
double y, double z, float f) {
this.renderTileEntityAt((TileEntityEnderCoreGenerator)tileentity, x, y, z, f);
}
}

View File

@ -0,0 +1,42 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityEnderCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.modblocks.tileentities.TileEntityNetherCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.models.blockmodel.ModelCoreGenerator;
import org.bitbucket.alltra101ify.advancedsatelliteutilization.reference.ModInfo;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
public class RenderNetherCoreGenerator extends TileEntitySpecialRenderer {
private ModelCoreGenerator modelASU = new ModelCoreGenerator();
private static final ResourceLocation texture = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/ModelNetherCore.png");
public void renderTileEntityAt(TileEntityNetherCoreGenerator tileentity, double x, double y,
double z, float f) {
float f1 = tileentity.rotationY;
float f2 = tileentity.rotationX;
GL11.glPushMatrix();
modelASU.MainCrystal.rotateAngleY = f1;
modelASU.MainCrystal.rotateAngleX = f2;
GL11.glTranslatef((float) x + 0.5f, (float) y + 1.5f, (float) z + 0.5f);
GL11.glRotatef(180, 0f, 0f, 1f);
this.bindTexture(texture);
modelASU.renderModel(0.0625f);
GL11.glPopMatrix();
}
@Override
public void renderTileEntityAt(TileEntity tileentity, double x,
double y, double z, float f) {
this.renderTileEntityAt((TileEntityNetherCoreGenerator)tileentity, x, y, z, f);
}
}

View File

@ -0,0 +1,46 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer.inventoryrender;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
import org.lwjgl.opengl.GL11;
public class ItemRenderASUPedestal implements IItemRenderer {
TileEntitySpecialRenderer render;
private TileEntity entity;
public ItemRenderASUPedestal(TileEntitySpecialRenderer render, TileEntity entity) {
this.render = render;
this.entity = entity;
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
ItemRendererHelper helper) {
// TODO Auto-generated method stub
return true;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
if(type == IItemRenderer.ItemRenderType.ENTITY)
{
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
}
this.render.renderTileEntityAt(this.entity, 0.0d, 0.0d, 0.0d, 0.0f);
}
}

View File

@ -0,0 +1,43 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer.inventoryrender;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
public class ItemRenderCoreStabilizer implements IItemRenderer {
TileEntitySpecialRenderer render;
private TileEntity entity;
public ItemRenderCoreStabilizer(TileEntitySpecialRenderer render, TileEntity entity) {
this.render = render;
this.entity = entity;
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return true;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
ItemRendererHelper helper) {
return true;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
if(type == IItemRenderer.ItemRenderType.ENTITY)
{
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
}
this.render.renderTileEntityAt(this.entity, 0.0d, 0.0d, 0.0d, 0.0f);
}
}

View File

@ -0,0 +1,43 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer.inventoryrender;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
public class ItemRenderEnderCoreGenerator implements IItemRenderer {
TileEntitySpecialRenderer render;
private TileEntity entity;
public ItemRenderEnderCoreGenerator(TileEntitySpecialRenderer render, TileEntity entity) {
this.render = render;
this.entity = entity;
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return true;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
ItemRendererHelper helper) {
return true;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
if(type == IItemRenderer.ItemRenderType.ENTITY)
{
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
}
this.render.renderTileEntityAt(this.entity, 0.0d, 0.0d, 0.0d, 0.0f);
}
}

View File

@ -0,0 +1,43 @@
package org.bitbucket.alltra101ify.advancedsatelliteutilization.renderer.inventoryrender;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
public class ItemRenderNetherCoreGenerator implements IItemRenderer {
TileEntitySpecialRenderer render;
private TileEntity entity;
public ItemRenderNetherCoreGenerator(TileEntitySpecialRenderer render, TileEntity entity) {
this.render = render;
this.entity = entity;
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return true;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
ItemRendererHelper helper) {
return true;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
if(type == IItemRenderer.ItemRenderType.ENTITY)
{
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
}
this.render.renderTileEntityAt(this.entity, 0.0d, 0.0d, 0.0d, 0.0f);
}
}

View File

@ -0,0 +1,24 @@
item.BasicProcessingChip.name=Basic Processing Chip
item.IntermediateProcessingChip.name=Advanced Processing Chip
item.EarthTargetingFocus.name=Earth Targeting Focus
item.AdvancedProcessingUnit.name=Super Processing Chip
item.SpacialFocusingModule.name=Space Targeting Focus
item.SolderingIron.name=Soldering Iron
item.WrenchUtility.name=Wrench Utility
item.ASHADBrick.name=ASHAD Brick
item.QuaridiumIngot.name=Quaridium Ingot
item.HumanInterfaceGate.name=Human Interface Gate
item.ConversionSpeedUpgrade.name=Conversion Accelerator
item.FanModule.name=Fan Module
tile.BlockOfASHAD.name=Block of ASHAD
tile.TransparentBlockOfASHAD.name=Transparent Block of ASHAD
tile.B-Lock-er.name=B-lock-er
tile.HolographicEmitter.name=holographic Light emitter
tile.ASUPedestal.name=Virtual Pedestal
tile.EnderCoreGenerator.name=Ender Core Generator
tile.CoreStabilizer.name=Core Stabilizer
tile.HolographicLight.name=Holographic Light
tile.QuaridiumOre.name=Quaridium Ore
tile.BlockOfASHADWithQuaridium.name=Block of ASHAD with Quaridium
tile.NetherCoreGenerator.name=Nether Core Generator
itemGroup.asu=Advanced Satellite Utilization

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,38 @@
{
"animation": {
"frames": [
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 900 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,16 @@
[
{
"modid": "examplemod",
"name": "Example Mod",
"description": "Example placeholder mod.",
"version": "${version}",
"mcversion": "${mcversion}",
"url": "",
"updateUrl": "",
"authorList": ["ExampleDude"],
"credits": "The Forge and FML guys, for making this example",
"logoFile": "",
"screenshots": [],
"dependencies": []
}
]