solar towers yeah

This commit is contained in:
Bob 2020-12-11 23:35:13 +01:00
parent 03841c4043
commit c8aaef9873
25 changed files with 2781 additions and 4 deletions

View File

@ -1246,6 +1246,7 @@ item.mike_cooling_unit.name=Deuteriumkühleinheit
item.mike_core.name=Mit Uran ummantelter Deuteriumtank
item.mike_deut.name=Deuteriumtank
item.mike_kit.name=Ivy Mike Kit
item.mirror_tool.name=Spiegeleinstellungswerkzeug
item.missile_anti_ballistic.name=Flugabwehrrakete
item.missile_assembly.name=Kleines Raketen-Bauset
item.missile_bhole.name=Schwarzes-Loch-Rakete

View File

@ -1246,6 +1246,7 @@ item.mike_cooling_unit.name=Deuterium Cooling Unit
item.mike_core.name=Uranium Coated Deuterium Tank
item.mike_deut.name=Deuterium Tank
item.mike_kit.name=Ivy Mike Kit
item.mirror_tool.name=Mirror Adjustment Tool
item.missile_anti_ballistic.name=Anti Ballistic Missile
item.missile_assembly.name=Small Missile Assembly
item.missile_bhole.name=Black Hole Missile

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,220 @@
# Blender v2.79 (sub 0) OBJ File: 'solar_mirror.blend'
# www.blender.org
o Mirror
v -0.500000 0.937500 0.500000
v -0.500000 1.062500 0.500000
v -0.500000 0.937500 -0.500000
v -0.500000 1.062500 -0.500000
v 0.500000 0.937500 0.500000
v 0.500000 1.062500 0.500000
v 0.500000 0.937500 -0.500000
v 0.500000 1.062500 -0.500000
vt 0.555556 0.444444
vt 1.000000 0.500000
vt 0.555556 0.500000
vt 0.555556 0.444444
vt 1.000000 0.500000
vt 0.555556 0.500000
vt 1.000000 0.500000
vt 0.555556 0.444444
vt 1.000000 0.444444
vt 1.000000 0.500000
vt 0.555556 0.444444
vt 1.000000 0.444444
vt 1.000000 0.000000
vt 0.555556 0.000000
vt 0.555556 0.944444
vt 1.000000 0.944444
vt 1.000000 0.444444
vt 1.000000 0.444444
vt 0.555556 0.500000
vt 0.555556 0.500000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
s off
f 2/1/1 3/2/1 1/3/1
f 4/4/2 7/5/2 3/6/2
f 8/7/3 5/8/3 7/9/3
f 6/10/4 1/11/4 5/12/4
f 7/13/5 1/11/5 3/14/5
f 4/15/6 6/10/6 8/16/6
f 2/1/1 4/17/1 3/2/1
f 4/4/2 8/18/2 7/5/2
f 8/7/3 6/19/3 5/8/3
f 6/10/4 2/20/4 1/11/4
f 7/13/5 5/12/5 1/11/5
f 4/15/6 2/20/6 6/10/6
o Base
v -0.500000 0.000000 0.375000
v -0.500000 0.125000 0.375000
v -0.500000 0.000000 -0.375000
v -0.500000 0.125000 -0.375000
v 0.500000 0.000000 0.375000
v 0.500000 0.125000 0.375000
v 0.500000 0.000000 -0.375000
v 0.500000 0.125000 -0.375000
v -0.062500 0.187500 0.062500
v -0.062500 0.187500 -0.062500
v 0.062500 0.187500 0.062500
v 0.062500 0.187500 -0.062500
v -0.062500 0.937500 0.062500
v -0.062500 0.937500 -0.062500
v 0.062500 0.937500 -0.062500
v 0.062500 0.937500 0.062500
v 0.000000 1.062500 0.000000
v -0.125000 0.125000 0.125000
v -0.125000 0.125000 -0.125000
v 0.125000 0.125000 0.125000
v 0.125000 0.125000 -0.125000
v -0.125000 0.187500 0.125000
v -0.125000 0.187500 -0.125000
v 0.125000 0.187500 -0.125000
v 0.125000 0.187500 0.125000
v 0.375000 0.000000 0.500000
v 0.375000 0.125000 0.500000
v -0.375000 0.000000 0.500000
v -0.375000 0.125000 0.500000
v 0.375000 0.000000 -0.500000
v 0.375000 0.125000 -0.500000
v -0.375000 0.000000 -0.500000
v -0.375000 0.125000 -0.500000
vt 0.388889 0.500000
vt 0.055556 0.444444
vt 0.388889 0.444444
vt 0.444444 0.500000
vt 0.388889 0.444444
vt 0.444444 0.444444
vt 0.388889 0.500000
vt 0.055556 0.444444
vt 0.388889 0.444444
vt 0.444444 0.444444
vt 0.388889 0.500000
vt 0.055556 0.444444
vt 0.388889 0.500000
vt 0.055556 0.444444
vt 0.388889 0.444444
vt 0.555556 0.000000
vt 0.444444 0.027778
vt 0.444444 0.000000
vt 0.500000 0.472222
vt 0.472222 0.527778
vt 0.444444 0.472222
vt 0.500000 0.138889
vt 0.444444 0.472222
vt 0.444444 0.138889
vt 0.500000 0.138889
vt 0.444444 0.472222
vt 0.444444 0.138889
vt 0.500000 0.138889
vt 0.444444 0.472222
vt 0.444444 0.138889
vt 0.500000 0.138889
vt 0.444444 0.138889
vt 0.500000 0.472222
vt 0.500000 0.472222
vt 0.500000 0.472222
vt 0.555556 0.027778
vt 0.444444 0.138889
vt 0.444444 0.027778
vt 0.444444 0.027778
vt 0.555556 0.000000
vt 0.555556 0.027778
vt 0.555556 0.000000
vt 0.444444 0.000000
vt 0.444444 0.027778
vt 0.555556 0.000000
vt 0.555556 0.027778
vt 0.444444 0.444444
vt 0.444444 0.500000
vt 0.444444 0.444444
vt 0.055556 -0.000000
vt 0.444444 0.055556
vt 0.444444 0.888889
vt 0.388889 0.944444
vt 0.055556 0.500000
vt 0.055556 0.500000
vt 0.444444 0.500000
vt 0.055556 0.500000
vt 0.055556 0.500000
vt 0.555556 0.027778
vt 0.555556 0.138889
vt 0.444444 0.000000
vt 0.444444 0.000000
vt 0.444444 0.500000
vt 0.000000 0.388889
vt 0.000000 0.055556
vt 0.388889 -0.000000
vt 0.444444 0.388889
vt 0.055556 0.944444
vt 0.000000 0.888889
vt 0.000000 0.555556
vt 0.444444 0.555556
vn -1.0000 0.0000 0.0000
vn -0.7071 0.0000 -0.7071
vn 1.0000 0.0000 0.0000
vn -0.7071 0.0000 0.7071
vn -0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn -0.8944 0.4472 0.0000
vn 0.0000 0.4472 0.8944
vn 0.0000 0.4472 -0.8944
vn 0.8944 0.4472 0.0000
vn 0.0000 1.0000 0.0000
vn 0.7071 0.0000 0.7071
vn 0.7071 0.0000 -0.7071
vn 0.0000 -1.0000 0.0000
s off
f 10/21/7 11/22/7 9/23/7
f 12/24/8 40/25/8 11/26/8
f 16/27/9 13/28/9 15/29/9
f 36/30/10 10/21/10 9/23/10
f 41/31/11 38/32/11 40/25/11
f 35/33/12 36/34/12 34/35/12
f 29/36/9 33/37/9 28/38/9
f 21/39/13 25/40/13 22/41/13
f 19/42/12 21/43/12 17/44/12
f 18/45/11 23/46/11 20/47/11
f 20/48/9 24/49/9 19/50/9
f 17/51/7 22/41/7 18/52/7
f 21/43/14 24/53/14 25/40/14
f 22/54/15 25/40/15 23/46/15
f 24/49/16 23/55/16 25/40/16
f 33/56/17 31/57/17 30/58/17
f 26/59/7 31/60/7 27/61/7
f 28/62/12 30/58/12 26/63/12
f 27/64/11 32/65/11 29/66/11
f 35/33/18 13/67/18 14/68/18
f 38/69/19 16/27/19 15/29/19
f 15/70/20 34/71/20 9/23/20
f 41/72/17 12/73/17 14/74/17
f 10/21/7 12/75/7 11/22/7
f 12/24/8 41/31/8 40/25/8
f 16/27/9 14/74/9 13/28/9
f 36/30/10 37/76/10 10/21/10
f 41/31/11 39/77/11 38/32/11
f 35/33/12 37/78/12 36/34/12
f 29/36/9 32/79/9 33/37/9
f 19/42/12 24/53/12 21/43/12
f 18/45/11 22/54/11 23/46/11
f 20/48/9 23/55/9 24/49/9
f 17/51/7 21/39/7 22/41/7
f 33/56/17 32/80/17 31/57/17
f 26/59/7 30/81/7 31/60/7
f 28/62/12 33/56/12 30/58/12
f 27/64/11 31/82/11 32/65/11
f 35/33/18 34/35/18 13/67/18
f 38/69/19 39/83/19 16/27/19
f 9/23/20 11/22/20 40/84/20
f 40/84/20 38/85/20 15/70/20
f 15/70/20 13/86/20 34/71/20
f 34/71/20 36/87/20 9/23/20
f 9/23/20 40/84/20 15/70/20
f 12/73/17 10/88/17 37/89/17
f 37/89/17 35/90/17 12/73/17
f 35/90/17 14/74/17 12/73/17
f 14/74/17 16/27/17 39/91/17
f 39/91/17 41/72/17 14/74/17

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

View File

@ -521,6 +521,10 @@ public class ModBlocks {
public static Block bomb_multi_large;
public static final int guiID_bomb_multi_large = 18;
public static Block machine_solar_boiler;
public static final int guiID_solar_boiler = 18;
public static Block solar_mirror;
public static Block struct_launcher;
public static Block struct_scaffold;
public static Block struct_launcher_core;
@ -1284,6 +1288,9 @@ public class ModBlocks {
machine_telelinker = new MachineTeleLinker(Material.iron).setBlockName("machine_telelinker").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.nukeTab).setBlockTextureName(RefStrings.MODID + ":machine_telelinker_side");
machine_keyforge = new MachineKeyForge(Material.iron).setBlockName("machine_keyforge").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.consumableTab).setBlockTextureName(RefStrings.MODID + ":machine_keyforge_side");
machine_solar_boiler = new MachineSolarBoiler(Material.iron).setBlockName("machine_solar_boiler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_solar_boiler");
solar_mirror = new SolarMirror(Material.iron).setBlockName("solar_mirror").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":solar_mirror");
struct_launcher = new BlockGeneric(Material.iron).setBlockName("struct_launcher").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":struct_launcher");
struct_scaffold = new BlockGeneric(Material.iron).setBlockName("struct_scaffold").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":struct_scaffold");
struct_launcher_core = new BlockStruct(Material.iron).setBlockName("struct_launcher_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":struct_launcher_core");
@ -2102,6 +2109,10 @@ public class ModBlocks {
GameRegistry.registerBlock(absorber_pink, absorber_pink.getUnlocalizedName());
GameRegistry.registerBlock(decon, decon.getUnlocalizedName());
//Solar Tower Blocks
GameRegistry.registerBlock(machine_solar_boiler, machine_solar_boiler.getUnlocalizedName());
GameRegistry.registerBlock(solar_mirror, solar_mirror.getUnlocalizedName());
//Industrial Factories
GameRegistry.registerBlock(factory_titanium_hull, factory_titanium_hull.getUnlocalizedName());
GameRegistry.registerBlock(factory_titanium_furnace, factory_titanium_furnace.getUnlocalizedName());

View File

@ -0,0 +1,48 @@
package com.hbm.blocks.machine;
import com.hbm.blocks.BlockDummyable;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.TileEntitySolarBoiler;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class MachineSolarBoiler extends BlockDummyable {
public MachineSolarBoiler(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12)
return new TileEntitySolarBoiler();
if(meta >= extra)
return new TileEntityProxyCombo(false, false, true);
return null;
}
@Override
public int[] getDimensions() {
return new int[] {2, 0, 1, 1, 1, 1};
}
@Override
public int getOffset() {
return 1;
}
@Override
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);
x = x + dir.offsetX * o;
z = z + dir.offsetZ * o;
this.makeExtra(world, x, y + 2, z);
}
}

View File

@ -0,0 +1,35 @@
package com.hbm.blocks.machine;
import com.hbm.tileentity.machine.TileEntitySolarMirror;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class SolarMirror extends BlockContainer {
public SolarMirror(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntitySolarMirror();
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
}

View File

@ -910,6 +910,7 @@ public class ModItems {
public static Item oil_detector;
public static Item geiger_counter;
public static Item survey_scanner;
public static Item mirror_tool;
public static Item template_folder;
public static Item assembly_template;
@ -3553,6 +3554,7 @@ public class ModItems {
turret_biometry = new ItemTurretBiometry().setUnlocalizedName("turret_biometry").setFull3D().setMaxStackSize(1).setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":rei_scanner");
geiger_counter = new ItemGeigerCounter().setUnlocalizedName("geiger_counter").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":geiger_counter");
survey_scanner = new ItemSurveyScanner().setUnlocalizedName("survey_scanner").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":survey_scanner");
mirror_tool = new ItemMirrorTool().setUnlocalizedName("mirror_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":mirror_tool");
key = new ItemKey().setUnlocalizedName("key").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":key");
key_red = new ItemCustomLore().setUnlocalizedName("key_red").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":key_red");
@ -5103,6 +5105,7 @@ public class ModItems {
GameRegistry.registerItem(reactor_sensor, reactor_sensor.getUnlocalizedName());
GameRegistry.registerItem(oil_detector, oil_detector.getUnlocalizedName());
GameRegistry.registerItem(survey_scanner, survey_scanner.getUnlocalizedName());
GameRegistry.registerItem(mirror_tool, mirror_tool.getUnlocalizedName());
GameRegistry.registerItem(geiger_counter, geiger_counter.getUnlocalizedName());
GameRegistry.registerItem(containment_box, containment_box.getUnlocalizedName());

View File

@ -0,0 +1,55 @@
package com.hbm.items.tool;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.tileentity.machine.TileEntitySolarMirror;
import net.minecraft.block.Block;
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.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
public class ItemMirrorTool extends Item {
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float fX, float fY, float fZ) {
Block b = world.getBlock(x, y, z);
if(b == ModBlocks.machine_solar_boiler) {
int[] pos = ((BlockDummyable)b).findCore(world, x, y, z);
if(pos != null && !world.isRemote) {
if(!stack.hasTagCompound())
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setInteger("posX", pos[0]);
stack.stackTagCompound.setInteger("posY", pos[1] + 1);
stack.stackTagCompound.setInteger("posZ", pos[2]);
player.addChatComponentMessage(new ChatComponentTranslation("solar.linked").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
}
return true;
}
if(b == ModBlocks.solar_mirror && stack.hasTagCompound()) {
if(!world.isRemote) {
TileEntitySolarMirror mirror = (TileEntitySolarMirror)world.getTileEntity(x, y, z);
mirror.setTarget(stack.stackTagCompound.getInteger("posX"), stack.stackTagCompound.getInteger("posY"), stack.stackTagCompound.getInteger("posZ"));
}
return true;
}
return false;
}
}

View File

@ -709,6 +709,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
}
@Override
@SideOnly(Side.CLIENT)
public void renderHUD(Pre event, ElementType type, EntityPlayer player, ItemStack stack) {
ItemGunBase gun = ((ItemGunBase)stack.getItem());

View File

@ -151,6 +151,8 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineFENSU.class, new RenderFENSU());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLargeTurbine.class, new RenderBigTurbine());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineReactor.class, new RenderBreeder());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySolarBoiler.class, new RenderSolarBoiler());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySolarMirror.class, new RenderSolarMirror());
//AMS
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSBase.class, new RenderAMSBase());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSEmitter.class, new RenderAMSEmitter());

View File

@ -35,6 +35,7 @@ import com.hbm.blocks.ModBlocks;
import com.hbm.config.BombConfig;
import com.hbm.config.GeneralConfig;
import com.hbm.config.MachineConfig;
import com.hbm.config.MobConfig;
import com.hbm.config.PotionConfig;
import com.hbm.config.RadiationConfig;
import com.hbm.config.ToolConfig;
@ -425,6 +426,8 @@ public class MainRegistry {
GameRegistry.registerTileEntity(TileEntityHadronDiode.class, "tileentity_hadron_diode");
GameRegistry.registerTileEntity(TileEntityHadronPower.class, "tileentity_hadron_power");
GameRegistry.registerTileEntity(TileEntityHadron.class, "tileentity_hadron");
GameRegistry.registerTileEntity(TileEntitySolarBoiler.class, "tileentity_solarboiler");
GameRegistry.registerTileEntity(TileEntitySolarMirror.class, "tileentity_solarmirror");
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
@ -1174,6 +1177,7 @@ public class MainRegistry {
PotionConfig.loadFromConfig(config);
ToolConfig.loadFromConfig(config);
WeaponConfig.loadFromConfig(config);
MobConfig.loadFromConfig(config);
config.save();
}

View File

@ -208,6 +208,10 @@ public class ResourceManager {
//SatDock
public static final IModelCustom satDock = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sat_dock.obj"));
//Solar Tower
public static final IModelCustom solar_boiler = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/solar_boiler.obj"));
public static final IModelCustom solar_mirror = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/solar_mirror.obj"));
//Vault Door
public static final IModelCustom vault_cog = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/vault_cog.obj"));
public static final IModelCustom vault_frame = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/vault_frame.obj"));
@ -449,6 +453,10 @@ public class ResourceManager {
public static final ResourceLocation vault4_label_111_tex = new ResourceLocation(RefStrings.MODID, "textures/models/vault4_label_111.png");
public static final ResourceLocation vault4_label_81_tex = new ResourceLocation(RefStrings.MODID, "textures/models/vault4_label_81.png");
//Solar Tower
public static final ResourceLocation solar_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/solar_boiler.png");
public static final ResourceLocation solar_mirror_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/solar_mirror.png");
//Blast Door
public static final ResourceLocation blast_door_base_tex = new ResourceLocation(RefStrings.MODID, "textures/models/blast_door_base.png");
public static final ResourceLocation blast_door_tooth_tex = new ResourceLocation(RefStrings.MODID, "textures/models/blast_door_tooth.png");

View File

@ -789,6 +789,32 @@ public class ItemRenderLibrary {
ResourceManager.microwave.renderPart("mainbody_Cube.001");
ResourceManager.microwave.renderPart("window_Cube.002");
}});
renderers.put(Item.getItemFromBlock(ModBlocks.machine_solar_boiler), new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(0, -2.5, 0);
GL11.glScaled(3.25, 3.25, 3.25);
}
public void renderCommon() {
GL11.glScaled(1, 1, 1);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.solar_tex); ResourceManager.solar_boiler.renderPart("Base");
GL11.glShadeModel(GL11.GL_FLAT);
}});
renderers.put(Item.getItemFromBlock(ModBlocks.solar_mirror), new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(0, -3, 0);
GL11.glScaled(8, 8, 8);
}
public void renderCommon() {
bindTexture(ResourceManager.solar_mirror_tex);
ResourceManager.solar_mirror.renderPart("Base");
GL11.glTranslated(0, 1, 0);
GL11.glRotated(45, 0, 0, -1);
GL11.glTranslated(0, -1, 0);
ResourceManager.solar_mirror.renderPart("Mirror");
}});
}
private static void bindTexture(ResourceLocation res) {

View File

@ -0,0 +1,39 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.BlockDummyable;
import com.hbm.main.ResourceManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderSolarBoiler extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glRotatef(90, 0F, 1F, 0F);
switch(te.getBlockMetadata() - BlockDummyable.offset)
{
case 2: GL11.glRotatef(0, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(270, 0F, 1F, 0F); break;
}
bindTexture(ResourceManager.solar_tex);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.solar_boiler.renderPart("Base");
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
}

View File

@ -0,0 +1,103 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.machine.TileEntitySolarMirror;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderSolarMirror extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
TileEntitySolarMirror mirror = (TileEntitySolarMirror)te;
bindTexture(ResourceManager.solar_mirror_tex);
ResourceManager.solar_mirror.renderPart("Base");
GL11.glTranslated(0, 1, 0);
int dx = mirror.tX - mirror.xCoord;
int dy = mirror.tY - mirror.yCoord;
int dz = mirror.tZ - mirror.zCoord;
double dist = Math.sqrt(dx * dx + dy * dy + dz * dz);
if(mirror.tY >= mirror.yCoord) {
double pitch = Math.toDegrees(-Math.asin((dy + 0.5) / dist)) + 90;
double yaw = Math.toDegrees(-Math.atan2(dz, dx)) + 180;
GL11.glRotated(yaw, 0, 1, 0);
GL11.glRotated(pitch, 0, 0, 1);
}
GL11.glTranslated(0, -1, 0);
ResourceManager.solar_mirror.renderPart("Mirror");
if(mirror.tY >= mirror.yCoord && te.getWorldObj().canBlockSeeTheSky(te.xCoord, te.yCoord + 1, te.zCoord)) {
Tessellator tess = Tessellator.instance;
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_BLEND);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glAlphaFunc(GL11.GL_GREATER, 0);
GL11.glDepthMask(false);
float min = 0.005F;
float max = 0.02F;
tess.startDrawingQuads();
tess.setColorRGBA_F(1F, 1F, 1F, max);
tess.addVertex(0.5, 1.0625, 0.5);
tess.addVertex(0.5, 1.0625, -0.5);
tess.setColorRGBA_F(1F, 1F, 1F, min);
tess.addVertex(0.5, dist, -0.5);
tess.addVertex(0.5, dist, 0.5);
tess.setColorRGBA_F(1F, 1F, 1F, max);
tess.addVertex(-0.5, 1.0625, 0.5);
tess.addVertex(-0.5, 1.0625, -0.5);
tess.setColorRGBA_F(1F, 1F, 1F, min);
tess.addVertex(-0.5, dist, -0.5);
tess.addVertex(-0.5, dist, 0.5);
tess.setColorRGBA_F(1F, 1F, 1F, max);
tess.addVertex(0.5, 1.0625, 0.5);
tess.addVertex(-0.5, 1.0625, 0.5);
tess.setColorRGBA_F(1F, 1F, 1F, min);
tess.addVertex(-0.5, dist, 0.5);
tess.addVertex(0.5, dist, 0.5);
tess.setColorRGBA_F(1F, 1F, 1F, max);
tess.addVertex(0.5, 1.0625, -0.5);
tess.addVertex(-0.5, 1.0625, -0.5);
tess.setColorRGBA_F(1F, 1F, 1F, min);
tess.addVertex(-0.5, dist, -0.5);
tess.addVertex(0.5, dist, -0.5);
tess.draw();
GL11.glDepthMask(true);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
GL11.glPopMatrix();
}
}

View File

@ -16,6 +16,8 @@ import com.hbm.packet.AuxGaugePacket;
import com.hbm.packet.PacketDispatcher;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
@ -23,6 +25,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.AxisAlignedBB;
public class TileEntityMachineBoiler extends TileEntity implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource {

View File

@ -0,0 +1,155 @@
package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidSource;
import com.hbm.inventory.FluidTank;
import com.hbm.lib.Library;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
public class TileEntitySolarBoiler extends TileEntity implements IFluidAcceptor, IFluidSource {
private FluidTank water;
private FluidTank steam;
public List<IFluidAcceptor> list = new ArrayList();
public int heat;
public TileEntitySolarBoiler() {
water = new FluidTank(FluidType.WATER, 16000, 0);
steam = new FluidTank(FluidType.STEAM, 1600000, 1);
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
if(worldObj.getTotalWorldTime() % 10 == 0) {
fillFluidInit(FluidType.STEAM);
}
int process = heat / 10;
process = Math.min(process, water.getFill());
process = Math.min(process, (steam.getMaxFill() - steam.getFill()) / 100);
if(process < 0)
process = 0;
water.setFill(water.getFill() - process);
steam.setFill(steam.getFill() + process * 100);
if(steam.getFill() > steam.getMaxFill() * 0.9)
System.out.println("*" + steam.getFill());
heat = 0;
}
}
@Override
public void setFillstate(int fill, int index) {
if(index == 0)
water.setFill(fill);
if(index == 1)
steam.setFill(fill);
}
@Override
public void setFluidFill(int fill, FluidType type) {
if(type == FluidType.WATER)
water.setFill(fill);
if(type == FluidType.STEAM)
steam.setFill(fill);
}
@Override
public void setType(FluidType type, int index) {
if(index == 0)
water.setTankType(type);
if(index == 1)
steam.setTankType(type);
}
@Override
public List<FluidTank> getTanks() {
return Arrays.asList(new FluidTank[] {water, steam});
}
@Override
public int getFluidFill(FluidType type) {
if(type == FluidType.WATER)
return water.getFill();
if(type == FluidType.STEAM)
return steam.getFill();
return 0;
}
@Override
public void fillFluidInit(FluidType type) {
fillFluid(this.xCoord, this.yCoord + 3, this.zCoord, getTact(), type);
fillFluid(this.xCoord, this.yCoord - 1, this.zCoord, getTact(), type);
}
@Override
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
}
@Override
public boolean getTact() {
return worldObj.getTotalWorldTime() % 20 < 10;
}
@Override
public int getMaxFluidFill(FluidType type) {
if(type == FluidType.WATER)
return water.getMaxFill();
if(type == FluidType.STEAM)
return steam.getMaxFill();
return 0;
}
@Override
public List<IFluidAcceptor> getFluidList(FluidType type) {
return list;
}
@Override
public void clearFluidList(FluidType type) {
list.clear();
}
AxisAlignedBB bb = null;
@Override
public AxisAlignedBB getRenderBoundingBox() {
if(bb == null) {
bb = AxisAlignedBB.getBoundingBox(
xCoord - 1,
yCoord,
zCoord - 1,
xCoord + 2,
yCoord + 3,
zCoord + 2
);
}
return bb;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
}

View File

@ -0,0 +1,82 @@
package com.hbm.tileentity.machine;
import com.hbm.tileentity.TileEntityTickingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.EnumSkyBlock;
public class TileEntitySolarMirror extends TileEntityTickingBase {
public int tX;
public int tY;
public int tZ;
@Override
public String getInventoryName() {
return null;
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
if(worldObj.getTotalWorldTime() % 20 == 0)
sendUpdate();
if(tY < yCoord)
return;
int sun = worldObj.getSavedLightValue(EnumSkyBlock.Sky, xCoord, yCoord, zCoord) - worldObj.skylightSubtracted - 11;
if(sun <= 0 || !worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord))
return;
TileEntity te = worldObj.getTileEntity(tX, tY - 1, tZ);
if(te instanceof TileEntitySolarBoiler) {
TileEntitySolarBoiler boiler = (TileEntitySolarBoiler)te;
boiler.heat += sun;
}
}
}
public void sendUpdate() {
NBTTagCompound data = new NBTTagCompound();
data.setInteger("posX", tX);
data.setInteger("posY", tY);
data.setInteger("posZ", tZ);
this.networkPack(data, 200);
}
@Override
public void networkUnpack(NBTTagCompound nbt) {
tX = nbt.getInteger("posX");
tY = nbt.getInteger("posY");
tZ = nbt.getInteger("posZ");
}
public void setTarget(int x, int y, int z) {
tX = x;
tY = y;
tZ = z;
this.markDirty();
this.sendUpdate();
}
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
tX = nbt.getInteger("targetX");
tY = nbt.getInteger("targetY");
tZ = nbt.getInteger("targetZ");
}
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setInteger("targetX", tX);
nbt.setInteger("targetY", tY);
nbt.setInteger("targetZ", tZ);
}
}

View File

@ -42,10 +42,6 @@ public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements IS
public MissileStruct load;
private static final int[] access = new int[] { 0 };
private String customName;
public TileEntitySoyuzLauncher() {
super(27);
tanks = new FluidTank[2];