mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-03-11 20:25:36 +00:00
Satellite linker, satellite save structure functionality, chip
This commit is contained in:
parent
f8ba182f25
commit
afcb143d7d
@ -20,6 +20,8 @@ achievement.c44=Kapitel 44
|
|||||||
achievement.c44.desc=Galvanisch verzinkt! ...das macht in der Übersetzung sowas von keinen Sinn.
|
achievement.c44.desc=Galvanisch verzinkt! ...das macht in der Übersetzung sowas von keinen Sinn.
|
||||||
achievement.c20_5=Kapitel [ZWANZIG KOMMA FÜNF]
|
achievement.c20_5=Kapitel [ZWANZIG KOMMA FÜNF]
|
||||||
achievement.c20_5.desc=???
|
achievement.c20_5.desc=???
|
||||||
|
achievement.space=Die finale Grenz-ach vergiss es
|
||||||
|
achievement.space.desc=Scheitere in jeder möglichen Weise und verschwende 90 Millionen Dollar an Forschungsgeldern.
|
||||||
|
|
||||||
potion.hbm_taint=Verdorben
|
potion.hbm_taint=Verdorben
|
||||||
potion.hbm_taint_boost=Verdorbenes Herz
|
potion.hbm_taint_boost=Verdorbenes Herz
|
||||||
@ -228,6 +230,8 @@ tile.turret_cwis.name=Phalanx Mk-15 CIWS
|
|||||||
tile.turret_cheapo.name=Billigsdorfer Gatling-Geschütz
|
tile.turret_cheapo.name=Billigsdorfer Gatling-Geschütz
|
||||||
tile.machine_radar.name=Radar
|
tile.machine_radar.name=Radar
|
||||||
container.radar=Radar
|
container.radar=Radar
|
||||||
|
tile.machine_satlinker.name=Satelliten-ID-Manager
|
||||||
|
container.satLinker=SatLink-Gerät
|
||||||
|
|
||||||
item.turret_control.name=Geschützsteuerung
|
item.turret_control.name=Geschützsteuerung
|
||||||
item.turret_chip.name=Geschütz-KI-Chip
|
item.turret_chip.name=Geschütz-KI-Chip
|
||||||
@ -796,6 +800,7 @@ item.cell_anti_schrabidium.name=Antischrabidiumzelle
|
|||||||
item.singularity.name=Singularität
|
item.singularity.name=Singularität
|
||||||
item.singularity_counter_resonant.name=Eingefasste nicht-resonante Singularität
|
item.singularity_counter_resonant.name=Eingefasste nicht-resonante Singularität
|
||||||
item.singularity_super_heated.name=Supererhitzte resonante Singularität
|
item.singularity_super_heated.name=Supererhitzte resonante Singularität
|
||||||
|
item.singularity_spark.name=Spark'sche Singularität
|
||||||
item.black_hole.name=Miniatur Schwarzes Loch
|
item.black_hole.name=Miniatur Schwarzes Loch
|
||||||
item.crystal_xen.name=Künstlicher Xen-Kristall
|
item.crystal_xen.name=Künstlicher Xen-Kristall
|
||||||
item.pellet_antimatter.name=Antimateriencluster
|
item.pellet_antimatter.name=Antimateriencluster
|
||||||
@ -1277,6 +1282,13 @@ item.missile_taint.name=Verdorbene Rakete
|
|||||||
item.missile_micro.name=Mikro-Atomrakete
|
item.missile_micro.name=Mikro-Atomrakete
|
||||||
|
|
||||||
item.missile_carrier.name=HTR-01 Trägerrakete
|
item.missile_carrier.name=HTR-01 Trägerrakete
|
||||||
|
item.sat_mapper.name=Oberflächen-Abtastungssatellit
|
||||||
|
item.sat_scanner.name=Satellit mit Tiefenscanning-Modul
|
||||||
|
item.sat_radar.name=Radar-Überwachungssatellit
|
||||||
|
item.sat_laser.name=Orbitaler Todesstrahl
|
||||||
|
item.sat_foeq.name=PEAF - Mk.I FOEQ Dunasonde mit experimenter nuklearer Schubdüse
|
||||||
|
item.sat_resonator.name=Xeniumresonator-Satellit
|
||||||
|
item.sat_chip.name=Satelliten-ID-Chip
|
||||||
|
|
||||||
item.hazmat_helmet.name=Strahlenschutzhelm
|
item.hazmat_helmet.name=Strahlenschutzhelm
|
||||||
item.hazmat_plate.name=Strahlenschutzbrustplatte
|
item.hazmat_plate.name=Strahlenschutzbrustplatte
|
||||||
|
|||||||
@ -20,6 +20,8 @@ achievement.c44=Chapter 44
|
|||||||
achievement.c44.desc=Galvanized! I mean, zinc!
|
achievement.c44.desc=Galvanized! I mean, zinc!
|
||||||
achievement.c20_5=Chapter [TWENTY POINT FIVE]
|
achievement.c20_5=Chapter [TWENTY POINT FIVE]
|
||||||
achievement.c20_5.desc=???
|
achievement.c20_5.desc=???
|
||||||
|
achievement.space=The Final Front-ah forget it
|
||||||
|
achievement.space.desc=Fail in every way possible and waste funds worth 90 million dollars.
|
||||||
|
|
||||||
potion.hbm_taint=Tainted
|
potion.hbm_taint=Tainted
|
||||||
potion.hbm_taint_boost=Tainted Heart
|
potion.hbm_taint_boost=Tainted Heart
|
||||||
@ -240,6 +242,8 @@ tile.turret_cwis.name=Phalanx Mk-15 CIWS
|
|||||||
tile.turret_cheapo.name=Cheapo Gatling Sentry
|
tile.turret_cheapo.name=Cheapo Gatling Sentry
|
||||||
tile.machine_radar.name=Radar
|
tile.machine_radar.name=Radar
|
||||||
container.radar=Radar
|
container.radar=Radar
|
||||||
|
tile.machine_satlinker.name=Satellite ID Manager
|
||||||
|
container.satLinker=SatLink Device
|
||||||
|
|
||||||
item.turret_control.name=Turret Controller
|
item.turret_control.name=Turret Controller
|
||||||
item.turret_chip.name=Turret AI-Chip
|
item.turret_chip.name=Turret AI-Chip
|
||||||
@ -795,6 +799,7 @@ item.cell_anti_schrabidium.name=Antischrabidium Cell
|
|||||||
item.singularity.name=Singularity
|
item.singularity.name=Singularity
|
||||||
item.singularity_counter_resonant.name=Contained Counter-Resonant Singularity
|
item.singularity_counter_resonant.name=Contained Counter-Resonant Singularity
|
||||||
item.singularity_super_heated.name=Superheated Resonating Singularity
|
item.singularity_super_heated.name=Superheated Resonating Singularity
|
||||||
|
item.singularity_spark.name=Spark Singularity
|
||||||
item.black_hole.name=Miniature Black Hole
|
item.black_hole.name=Miniature Black Hole
|
||||||
item.crystal_xen.name=Artificial Xen Crystal
|
item.crystal_xen.name=Artificial Xen Crystal
|
||||||
item.pellet_antimatter.name=Antimatter Cluster
|
item.pellet_antimatter.name=Antimatter Cluster
|
||||||
@ -1276,6 +1281,13 @@ item.missile_taint.name=Taint-Tipped Missile
|
|||||||
item.missile_micro.name=Micro-Nuclear Missile
|
item.missile_micro.name=Micro-Nuclear Missile
|
||||||
|
|
||||||
item.missile_carrier.name=HTR-01 Carrier Rocket
|
item.missile_carrier.name=HTR-01 Carrier Rocket
|
||||||
|
item.sat_mapper.name=Surface Mapping Satellite
|
||||||
|
item.sat_scanner.name=Satellite with Depth-Resource Scanning Module
|
||||||
|
item.sat_radar.name=Radar Survey Satellite
|
||||||
|
item.sat_laser.name=Orbital Death Ray
|
||||||
|
item.sat_foeq.name=PEAF - Mk.I FOEQ Duna Probe with experimental Nuclear Propulsion
|
||||||
|
item.sat_resonator.name=Xenium Resonator Satellite
|
||||||
|
item.sat_chip.name=Satellite ID-Chip
|
||||||
|
|
||||||
item.hazmat_helmet.name=Hazmat Helmet
|
item.hazmat_helmet.name=Hazmat Helmet
|
||||||
item.hazmat_plate.name=Hazmat Chestplate
|
item.hazmat_plate.name=Hazmat Chestplate
|
||||||
|
|||||||
BIN
assets/hbm/textures/blocks/machine_satlinker_side.png
Normal file
BIN
assets/hbm/textures/blocks/machine_satlinker_side.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 574 B |
BIN
assets/hbm/textures/blocks/machine_satlinker_top.png
Normal file
BIN
assets/hbm/textures/blocks/machine_satlinker_top.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 515 B |
BIN
assets/hbm/textures/gui/gui_linker.png
Normal file
BIN
assets/hbm/textures/gui/gui_linker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/hbm/textures/gui/gui_sat_interface.png
Normal file
BIN
assets/hbm/textures/gui/gui_sat_interface.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
assets/hbm/textures/models/missileAA.png
Normal file
BIN
assets/hbm/textures/models/missileAA.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
@ -425,6 +425,9 @@ public class ModBlocks {
|
|||||||
public static Block machine_radgen;
|
public static Block machine_radgen;
|
||||||
public static final int guiID_radgen = 58;
|
public static final int guiID_radgen = 58;
|
||||||
|
|
||||||
|
public static Block machine_satlinker;
|
||||||
|
public static final int guiID_satlinker = 64;
|
||||||
|
|
||||||
public static Block machine_spp_bottom;
|
public static Block machine_spp_bottom;
|
||||||
public static Block machine_spp_top;
|
public static Block machine_spp_top;
|
||||||
|
|
||||||
@ -723,6 +726,8 @@ public class ModBlocks {
|
|||||||
fluid_duct = new BlockFluidDuct(Material.iron).setBlockName("fluid_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":fluid_duct_icon");
|
fluid_duct = new BlockFluidDuct(Material.iron).setBlockName("fluid_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":fluid_duct_icon");
|
||||||
|
|
||||||
machine_transformer = new MachineTransformer(Material.iron).setBlockName("machine_transformer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":machine_transformer");
|
machine_transformer = new MachineTransformer(Material.iron).setBlockName("machine_transformer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":machine_transformer");
|
||||||
|
|
||||||
|
machine_satlinker = new MachineSatLinker(Material.iron).setBlockName("machine_satlinker").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":machine_satlinker_side");
|
||||||
|
|
||||||
factory_titanium_hull = new BlockGeneric(Material.iron).setBlockName("factory_titanium_hull").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_titanium_hull");
|
factory_titanium_hull = new BlockGeneric(Material.iron).setBlockName("factory_titanium_hull").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_titanium_hull");
|
||||||
factory_titanium_furnace = new FactoryHatch(Material.iron).setBlockName("factory_titanium_furnace").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_titanium_furnace");
|
factory_titanium_furnace = new FactoryHatch(Material.iron).setBlockName("factory_titanium_furnace").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_titanium_furnace");
|
||||||
@ -1138,6 +1143,7 @@ public class ModBlocks {
|
|||||||
GameRegistry.registerBlock(machine_schrabidium_transmutator, machine_schrabidium_transmutator.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_schrabidium_transmutator, machine_schrabidium_transmutator.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(machine_combine_factory, machine_combine_factory.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_combine_factory, machine_combine_factory.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(machine_teleporter, machine_teleporter.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_teleporter, machine_teleporter.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(machine_satlinker, machine_satlinker.getUnlocalizedName());
|
||||||
|
|
||||||
//ReiX Machines
|
//ReiX Machines
|
||||||
//GameRegistry.registerBlock(machine_reix_mainframe, machine_reix_mainframe.getUnlocalizedName());
|
//GameRegistry.registerBlock(machine_reix_mainframe, machine_reix_mainframe.getUnlocalizedName());
|
||||||
|
|||||||
@ -231,16 +231,6 @@ public class LaunchPad extends BlockContainer implements IBomb {
|
|||||||
p_149695_1_.spawnEntityInWorld(missile);
|
p_149695_1_.spawnEntityInWorld(missile);
|
||||||
entity.power -= 75000;
|
entity.power -= 75000;
|
||||||
|
|
||||||
entity.slots[0] = null;
|
|
||||||
p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F);
|
|
||||||
}
|
|
||||||
if(entity.slots[0] != null && entity.slots[0].getItem() == ModItems.missile_anti_ballistic && entity.power >= 75000)
|
|
||||||
{
|
|
||||||
EntityMissileAntiBallistic missile = new EntityMissileAntiBallistic(p_149695_1_, xCoord, zCoord, x + 0.5F, y + 2F, z + 0.5F);
|
|
||||||
if (!p_149695_1_.isRemote)
|
|
||||||
p_149695_1_.spawnEntityInWorld(missile);
|
|
||||||
entity.power -= 75000;
|
|
||||||
|
|
||||||
entity.slots[0] = null;
|
entity.slots[0] = null;
|
||||||
p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F);
|
p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F);
|
||||||
}
|
}
|
||||||
@ -391,16 +381,6 @@ public class LaunchPad extends BlockContainer implements IBomb {
|
|||||||
p_149695_1_.spawnEntityInWorld(missile);
|
p_149695_1_.spawnEntityInWorld(missile);
|
||||||
entity.power -= 75000;
|
entity.power -= 75000;
|
||||||
|
|
||||||
entity.slots[0] = null;
|
|
||||||
p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F);
|
|
||||||
}
|
|
||||||
if(entity.slots[0] != null && entity.slots[0].getItem() == ModItems.missile_anti_ballistic && entity.power >= 75000)
|
|
||||||
{
|
|
||||||
EntityMissileAntiBallistic missile = new EntityMissileAntiBallistic(p_149695_1_, xCoord, zCoord, x + 0.5F, y + 2F, z + 0.5F);
|
|
||||||
if (!p_149695_1_.isRemote)
|
|
||||||
p_149695_1_.spawnEntityInWorld(missile);
|
|
||||||
entity.power -= 75000;
|
|
||||||
|
|
||||||
entity.slots[0] = null;
|
entity.slots[0] = null;
|
||||||
p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F);
|
p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F);
|
||||||
}
|
}
|
||||||
@ -442,6 +422,12 @@ public class LaunchPad extends BlockContainer implements IBomb {
|
|||||||
missile.posX = x + 0.5F;
|
missile.posX = x + 0.5F;
|
||||||
missile.posY = y + 0.5F;
|
missile.posY = y + 0.5F;
|
||||||
missile.posZ = z + 0.5F;
|
missile.posZ = z + 0.5F;
|
||||||
|
|
||||||
|
if(entity.slots[1] != null)
|
||||||
|
missile.setPayload(entity.slots[1]);
|
||||||
|
|
||||||
|
entity.slots[1] = null;
|
||||||
|
|
||||||
if (!p_149695_1_.isRemote)
|
if (!p_149695_1_.isRemote)
|
||||||
p_149695_1_.spawnEntityInWorld(missile);
|
p_149695_1_.spawnEntityInWorld(missile);
|
||||||
entity.power -= 75000;
|
entity.power -= 75000;
|
||||||
@ -449,6 +435,22 @@ public class LaunchPad extends BlockContainer implements IBomb {
|
|||||||
entity.slots[0] = null;
|
entity.slots[0] = null;
|
||||||
p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F);
|
p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(entity.slots[0] != null && entity.slots[0].getItem() == ModItems.missile_anti_ballistic && entity.power >= 75000)
|
||||||
|
{
|
||||||
|
EntityMissileAntiBallistic missile = new EntityMissileAntiBallistic(p_149695_1_);
|
||||||
|
missile.posX = x + 0.5F;
|
||||||
|
missile.posY = y + 0.5F;
|
||||||
|
missile.posZ = z + 0.5F;
|
||||||
|
|
||||||
|
if (!p_149695_1_.isRemote)
|
||||||
|
p_149695_1_.spawnEntityInWorld(missile);
|
||||||
|
|
||||||
|
entity.power -= 75000;
|
||||||
|
|
||||||
|
entity.slots[0] = null;
|
||||||
|
p_149695_1_.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
129
com/hbm/blocks/machine/MachineSatLinker.java
Normal file
129
com/hbm/blocks/machine/MachineSatLinker.java
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
package com.hbm.blocks.machine;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineShredder;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSatLinker;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockContainer;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class MachineSatLinker extends BlockContainer {
|
||||||
|
|
||||||
|
private final Random field_149933_a = new Random();
|
||||||
|
private Random rand;
|
||||||
|
private static boolean keepInventory;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon iconTop;
|
||||||
|
|
||||||
|
public MachineSatLinker(Material p_i45386_1_) {
|
||||||
|
super(p_i45386_1_);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||||
|
return new TileEntityMachineSatLinker();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||||
|
|
||||||
|
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":machine_satlinker_top");
|
||||||
|
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_satlinker_side");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(int side, int metadata) {
|
||||||
|
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
@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)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
} else if(!player.isSneaking())
|
||||||
|
{
|
||||||
|
TileEntityMachineSatLinker entity = (TileEntityMachineSatLinker) world.getTileEntity(x, y, z);
|
||||||
|
if(entity != null)
|
||||||
|
{
|
||||||
|
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_satlinker, world, x, y, z);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
||||||
|
{
|
||||||
|
if (!keepInventory)
|
||||||
|
{
|
||||||
|
ISidedInventory tileentityfurnace = (ISidedInventory)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||||
|
|
||||||
|
if (tileentityfurnace != null)
|
||||||
|
{
|
||||||
|
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
|
||||||
|
{
|
||||||
|
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||||
|
|
||||||
|
if (itemstack != null)
|
||||||
|
{
|
||||||
|
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||||
|
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||||
|
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||||
|
|
||||||
|
while (itemstack.stackSize > 0)
|
||||||
|
{
|
||||||
|
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||||
|
|
||||||
|
if (j1 > itemstack.stackSize)
|
||||||
|
{
|
||||||
|
j1 = itemstack.stackSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
itemstack.stackSize -= j1;
|
||||||
|
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||||
|
|
||||||
|
if (itemstack.hasTagCompound())
|
||||||
|
{
|
||||||
|
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
||||||
|
}
|
||||||
|
|
||||||
|
float f3 = 0.05F;
|
||||||
|
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
|
||||||
|
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||||
|
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
|
||||||
|
p_149749_1_.spawnEntityInWorld(entityitem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -15,6 +15,7 @@ import com.hbm.entity.projectile.EntityMeteor;
|
|||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.main.ModEventHandler;
|
import com.hbm.main.ModEventHandler;
|
||||||
import com.hbm.potion.PotionEffectTaint;
|
import com.hbm.potion.PotionEffectTaint;
|
||||||
|
import com.hbm.saveddata.SatelliteSaveStructure;
|
||||||
import com.hbm.saveddata.SatelliteSavedData;
|
import com.hbm.saveddata.SatelliteSavedData;
|
||||||
import com.hbm.world.Meteorite;
|
import com.hbm.world.Meteorite;
|
||||||
|
|
||||||
@ -245,9 +246,10 @@ public class TestEventTester extends Block {
|
|||||||
worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData(worldObj));
|
worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData(worldObj));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
par5EntityPlayer.addChatComponentMessage(new ChatComponentText(String.valueOf(data.globalAccessThingy)));
|
|
||||||
data.globalAccessThingy = itemRand.nextInt(10000);
|
for(SatelliteSaveStructure sat : data.satellites) {
|
||||||
par5EntityPlayer.addChatComponentMessage(new ChatComponentText(String.valueOf(data.globalAccessThingy)));
|
par5EntityPlayer.addChatComponentMessage(new ChatComponentText(sat.satelliteID + ": " + sat.satelliteType.name()));
|
||||||
|
}
|
||||||
data.markDirty();
|
data.markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,12 +5,20 @@ import com.hbm.entity.particle.EntityGasFlameFX;
|
|||||||
import com.hbm.entity.particle.EntitySmokeFX;
|
import com.hbm.entity.particle.EntitySmokeFX;
|
||||||
import com.hbm.explosion.ExplosionChaos;
|
import com.hbm.explosion.ExplosionChaos;
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
import com.hbm.explosion.ExplosionLarge;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.items.tool.ItemSatChip;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.saveddata.SatelliteSaveStructure;
|
||||||
|
import com.hbm.saveddata.SatelliteSaveStructure.SatelliteType;
|
||||||
|
import com.hbm.saveddata.SatelliteSavedData;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.projectile.EntityThrowable;
|
import net.minecraft.entity.projectile.EntityThrowable;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.ChatComponentText;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
@ -21,6 +29,8 @@ import net.minecraftforge.common.ForgeChunkManager.Type;
|
|||||||
public class EntityCarrier extends EntityThrowable {
|
public class EntityCarrier extends EntityThrowable {
|
||||||
|
|
||||||
double acceleration = 0.00D;
|
double acceleration = 0.00D;
|
||||||
|
|
||||||
|
private ItemStack payload;
|
||||||
|
|
||||||
public EntityCarrier(World p_i1582_1_) {
|
public EntityCarrier(World p_i1582_1_) {
|
||||||
super(p_i1582_1_);
|
super(p_i1582_1_);
|
||||||
@ -97,15 +107,59 @@ public class EntityCarrier extends EntityThrowable {
|
|||||||
//this.setDead();
|
//this.setDead();
|
||||||
|
|
||||||
if(this.posY > 600) {
|
if(this.posY > 600) {
|
||||||
this.setDead();
|
deployPayload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void deployPayload() {
|
||||||
|
|
||||||
|
if(payload != null) {
|
||||||
|
|
||||||
|
if(payload.getItem() == ModItems.flame_pony) {
|
||||||
|
ExplosionLarge.spawnTracers(worldObj, posX, posY, posZ, 25);
|
||||||
|
for(Object p : worldObj.playerEntities)
|
||||||
|
((EntityPlayer)p).triggerAchievement(MainRegistry.achSpace);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(payload.getItem() instanceof ItemSatChip) {
|
||||||
|
SatelliteSavedData data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
|
||||||
|
if(data == null) {
|
||||||
|
worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData(worldObj));
|
||||||
|
}
|
||||||
|
|
||||||
|
int freq = ItemSatChip.getFreq(payload);
|
||||||
|
|
||||||
|
if(!data.isFreqTaken(freq)) {
|
||||||
|
if(payload.getItem() == ModItems.sat_mapper)
|
||||||
|
data.satellites.add(new SatelliteSaveStructure(freq, SatelliteType.MAPPER));
|
||||||
|
if(payload.getItem() == ModItems.sat_scanner)
|
||||||
|
data.satellites.add(new SatelliteSaveStructure(freq, SatelliteType.SCANNER));
|
||||||
|
if(payload.getItem() == ModItems.sat_radar)
|
||||||
|
data.satellites.add(new SatelliteSaveStructure(freq, SatelliteType.RADAR));
|
||||||
|
if(payload.getItem() == ModItems.sat_laser)
|
||||||
|
data.satellites.add(new SatelliteSaveStructure(freq, SatelliteType.LASER));
|
||||||
|
if(payload.getItem() == ModItems.sat_foeq)
|
||||||
|
data.satellites.add(new SatelliteSaveStructure(freq, SatelliteType.RELAY));
|
||||||
|
if(payload.getItem() == ModItems.sat_resonator)
|
||||||
|
data.satellites.add(new SatelliteSaveStructure(freq, SatelliteType.RESONATOR));
|
||||||
|
|
||||||
|
data.markDirty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void entityInit() {
|
protected void entityInit() {
|
||||||
this.dataWatcher.addObject(8, 1);
|
this.dataWatcher.addObject(8, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setPayload(ItemStack stack) {
|
||||||
|
this.payload = stack.copy();
|
||||||
|
}
|
||||||
|
|
||||||
private void disengageBoosters() {
|
private void disengageBoosters() {
|
||||||
this.dataWatcher.updateObject(8, 0);
|
this.dataWatcher.updateObject(8, 0);
|
||||||
|
|
||||||
|
|||||||
@ -1,191 +1,163 @@
|
|||||||
package com.hbm.entity.missile;
|
package com.hbm.entity.missile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.hbm.calc.EasyLocation;
|
import com.hbm.calc.EasyLocation;
|
||||||
import com.hbm.entity.particle.EntityDSmokeFX;
|
import com.hbm.entity.particle.EntityDSmokeFX;
|
||||||
|
import com.hbm.entity.particle.EntitySmokeFX;
|
||||||
import com.hbm.explosion.ExplosionChaos;
|
import com.hbm.explosion.ExplosionChaos;
|
||||||
|
import com.hbm.explosion.ExplosionLarge;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class EntityMissileAntiBallistic extends EntityMissileBase {
|
public class EntityMissileAntiBallistic extends Entity {
|
||||||
|
|
||||||
EasyLocation missile;
|
int activationTimer;
|
||||||
Entity missile0;
|
|
||||||
|
|
||||||
public EntityMissileAntiBallistic(World p_i1582_1_) {
|
public EntityMissileAntiBallistic(World p_i1582_1_) {
|
||||||
super(p_i1582_1_);
|
super(p_i1582_1_);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityMissileAntiBallistic(World p_i1582_1_, int x, int z, double a, double b, double c) {
|
|
||||||
super(p_i1582_1_, x, z, a, b, c);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate()
|
public void onUpdate() {
|
||||||
{
|
|
||||||
System.out.println(phase);
|
|
||||||
|
|
||||||
this.baseHeight = 35;
|
if(activationTimer < 40) {
|
||||||
|
activationTimer++;
|
||||||
|
|
||||||
|
motionY = 1.5D;
|
||||||
|
|
||||||
this.posX += this.motionX;
|
this.setLocationAndAngles(posX + this.motionX, posY + this.motionY, posZ + this.motionZ, 0, 0);
|
||||||
this.posY += this.motionY;
|
this.rotation();
|
||||||
this.posZ += this.motionZ;
|
|
||||||
|
if(!this.worldObj.isRemote)
|
||||||
if(missile0 == null)
|
this.worldObj.spawnEntityInWorld(new EntitySmokeFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if(activationTimer == 40) {
|
||||||
|
ExplosionLarge.spawnParticlesRadial(worldObj, posX, posY, posZ, 15);
|
||||||
|
activationTimer = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < 5; i++) {
|
||||||
|
|
||||||
|
targetMissile();
|
||||||
|
|
||||||
|
this.setLocationAndAngles(posX + this.motionX, posY + this.motionY, posZ + this.motionZ, 0, 0);
|
||||||
|
this.rotation();
|
||||||
|
|
||||||
|
if(!this.worldObj.isRemote)
|
||||||
|
this.worldObj.spawnEntityInWorld(new EntitySmokeFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0));
|
||||||
|
|
||||||
|
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(posX - 5, posY - 5, posZ - 5, posX + 5, posY + 5, posZ + 5));
|
||||||
|
|
||||||
|
for(Entity e : list) {
|
||||||
|
if(e instanceof EntityMissileBaseAdvanced) {
|
||||||
|
ExplosionLarge.explode(worldObj, posX, posY, posZ, 15F, true, false, true);
|
||||||
|
this.setDead();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.air &&
|
||||||
|
this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.water &&
|
||||||
|
this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.flowing_water) {
|
||||||
|
|
||||||
|
if(!this.worldObj.isRemote)
|
||||||
|
{
|
||||||
|
ExplosionLarge.explode(worldObj, posX, posY, posZ, 10F, true, true, true);
|
||||||
|
}
|
||||||
|
this.setDead();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void rotation() {
|
||||||
|
float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||||
|
|
||||||
|
for (this.rotationPitch = (float)(Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
|
||||||
{
|
{
|
||||||
missile0 = ExplosionChaos.getHomingTarget(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 25, this);
|
;
|
||||||
}
|
}
|
||||||
if(missile0 != null)
|
|
||||||
|
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
|
||||||
{
|
{
|
||||||
missile = new EasyLocation(missile0.posX, missile0.posY, missile0.posZ);
|
this.prevRotationPitch += 360.0F;
|
||||||
this.phase = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.rotation();
|
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
|
||||||
|
|
||||||
switch(phase)
|
|
||||||
{
|
{
|
||||||
case -1:
|
this.prevRotationYaw -= 360.0F;
|
||||||
if(missile0 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(missile);
|
|
||||||
this.missileSpeed = 3;
|
|
||||||
if(missile0.posX + 2 > this.posX && missile0.posX - 2 < this.posX &&
|
|
||||||
missile0.posY + 2 > this.posY && missile0.posY - 2 < this.posY &&
|
|
||||||
missile0.posZ + 2 > this.posZ && missile0.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
if(!this.worldObj.isRemote)
|
|
||||||
{
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 10.0F, true);
|
|
||||||
}
|
|
||||||
this.setDead();
|
|
||||||
missile0.setDead();
|
|
||||||
//ExplosionChaos.delMissiles(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 5, (Entity)this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0:
|
|
||||||
if(loc0 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc0);
|
|
||||||
if(loc0.posX + 2 > this.posX && loc0.posX - 2 < this.posX &&
|
|
||||||
loc0.posY + 2 > this.posY && loc0.posY - 2 < this.posY &&
|
|
||||||
loc0.posZ + 2 > this.posZ && loc0.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
if(loc1 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc1);
|
|
||||||
if(loc1.posX + 2 > this.posX && loc1.posX - 2 < this.posX &&
|
|
||||||
loc1.posY + 2 > this.posY && loc1.posY - 2 < this.posY &&
|
|
||||||
loc1.posZ + 2 > this.posZ && loc1.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
if(loc2 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc2);
|
|
||||||
if(loc2.posX + 2 > this.posX && loc2.posX - 2 < this.posX &&
|
|
||||||
loc2.posY + 2 > this.posY && loc2.posY - 2 < this.posY &&
|
|
||||||
loc2.posZ + 2 > this.posZ && loc2.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
if(loc3 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc3);
|
|
||||||
if(loc3.posX + 2 > this.posX && loc3.posX - 2 < this.posX &&
|
|
||||||
loc3.posY + 2 > this.posY && loc3.posY - 2 < this.posY &&
|
|
||||||
loc3.posZ + 2 > this.posZ && loc3.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
if(loc4 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc4);
|
|
||||||
if(loc4.posX + 2 > this.posX && loc4.posX - 2 < this.posX &&
|
|
||||||
loc4.posY + 2 > this.posY && loc4.posY - 2 < this.posY &&
|
|
||||||
loc4.posZ + 2 > this.posZ && loc4.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
if(loc5 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc5);
|
|
||||||
if(loc5.posX + 2 > this.posX && loc5.posX - 2 < this.posX &&
|
|
||||||
loc5.posY + 2 > this.posY && loc5.posY - 2 < this.posY &&
|
|
||||||
loc5.posZ + 2 > this.posZ && loc5.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
if(loc6 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc6);
|
|
||||||
if(loc6.posX + 2 > this.posX && loc6.posX - 2 < this.posX &&
|
|
||||||
loc6.posY + 2 > this.posY && loc6.posY - 2 < this.posY &&
|
|
||||||
loc6.posZ + 2 > this.posZ && loc6.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 7;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
if(loc7 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc7);
|
|
||||||
if(loc7.posX + 2 > this.posX && loc7.posX - 2 < this.posX &&
|
|
||||||
loc7.posY + 2 > this.posY && loc7.posY - 2 < this.posY &&
|
|
||||||
loc7.posZ + 2 > this.posZ && loc7.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
if(target != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(target);
|
|
||||||
if(target.posX + 2 > this.posX && target.posX - 2 < this.posX &&
|
|
||||||
target.posY + 2 > this.posY && target.posY - 2 < this.posY &&
|
|
||||||
target.posZ + 2 > this.posZ && target.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.worldObj.spawnEntityInWorld(new EntityDSmokeFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0));
|
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
|
||||||
|
|
||||||
if(this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.air && this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.water && this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.flowing_water)
|
|
||||||
{
|
{
|
||||||
if(!this.worldObj.isRemote)
|
this.prevRotationYaw += 360.0F;
|
||||||
{
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 10.0F, true);
|
|
||||||
}
|
|
||||||
this.setDead();
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void targetMissile() {
|
||||||
|
|
||||||
|
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(posX - 500, 0, posZ - 500, posX + 500, 5000, posZ + 500));
|
||||||
|
|
||||||
|
Entity target = null;
|
||||||
|
double closest = 1000D;
|
||||||
|
|
||||||
|
for(Entity e : list) {
|
||||||
|
if(e instanceof EntityMissileBaseAdvanced) {
|
||||||
|
double dis = Math.sqrt(Math.pow(e.posX - posX, 2) + Math.pow(e.posY - posY, 2) + Math.pow(e.posZ - posZ, 2));
|
||||||
|
|
||||||
|
if(dis < closest) {
|
||||||
|
closest = dis;
|
||||||
|
target = e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(target != null) {
|
||||||
|
|
||||||
|
Vec3 vec = Vec3.createVectorHelper(target.posX - posX, target.posY - posY, target.posZ - posZ);
|
||||||
|
|
||||||
|
vec.normalize();
|
||||||
|
|
||||||
|
this.motionX = vec.xCoord * 0.065D;
|
||||||
|
this.motionY = vec.yCoord * 0.065D;
|
||||||
|
this.motionZ = vec.zCoord * 0.065D;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void entityInit() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public boolean isInRangeToRenderDist(double distance)
|
||||||
|
{
|
||||||
|
return distance < 500000;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,6 +67,7 @@ import com.hbm.tileentity.machine.TileEntityNukeFurnace;
|
|||||||
import com.hbm.tileentity.machine.TileEntityReactorMultiblock;
|
import com.hbm.tileentity.machine.TileEntityReactorMultiblock;
|
||||||
import com.hbm.tileentity.machine.TileEntityReiXMainframe;
|
import com.hbm.tileentity.machine.TileEntityReiXMainframe;
|
||||||
import com.hbm.tileentity.machine.TileEntityRtgFurnace;
|
import com.hbm.tileentity.machine.TileEntityRtgFurnace;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSatLinker;
|
||||||
import com.hbm.tileentity.machine.TileEntityWatzCore;
|
import com.hbm.tileentity.machine.TileEntityWatzCore;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@ -638,6 +639,15 @@ public class GUIHandler implements IGuiHandler {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ModBlocks.guiID_satlinker:
|
||||||
|
{
|
||||||
|
if(entity instanceof TileEntityMachineSatLinker)
|
||||||
|
{
|
||||||
|
return new ContainerMachineSatLinker(player.inventory, (TileEntityMachineSatLinker) entity);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -1206,6 +1216,15 @@ public class GUIHandler implements IGuiHandler {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ModBlocks.guiID_satlinker:
|
||||||
|
{
|
||||||
|
if(entity instanceof TileEntityMachineSatLinker)
|
||||||
|
{
|
||||||
|
return new GUIMachineSatLinker(player.inventory, (TileEntityMachineSatLinker) entity);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//CLIENTONLY GUIS
|
//CLIENTONLY GUIS
|
||||||
|
|||||||
83
com/hbm/inventory/container/ContainerMachineSatLinker.java
Normal file
83
com/hbm/inventory/container/ContainerMachineSatLinker.java
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
package com.hbm.inventory.container;
|
||||||
|
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSiren;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSatLinker;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.inventory.ICrafting;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ContainerMachineSatLinker extends Container {
|
||||||
|
|
||||||
|
private TileEntityMachineSatLinker diFurnace;
|
||||||
|
|
||||||
|
public ContainerMachineSatLinker(InventoryPlayer invPlayer, TileEntityMachineSatLinker tedf) {
|
||||||
|
|
||||||
|
diFurnace = tedf;
|
||||||
|
|
||||||
|
this.addSlotToContainer(new Slot(tedf, 0, 44, 35));
|
||||||
|
this.addSlotToContainer(new Slot(tedf, 1, 80, 35));
|
||||||
|
this.addSlotToContainer(new Slot(tedf, 2, 116, 35));
|
||||||
|
|
||||||
|
for(int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
for(int j = 0; j < 9; j++)
|
||||||
|
{
|
||||||
|
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < 9; i++)
|
||||||
|
{
|
||||||
|
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCraftingToCrafters(ICrafting crafting) {
|
||||||
|
super.addCraftingToCrafters(crafting);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
|
||||||
|
{
|
||||||
|
ItemStack var3 = null;
|
||||||
|
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||||
|
|
||||||
|
if (var4 != null && var4.getHasStack())
|
||||||
|
{
|
||||||
|
ItemStack var5 = var4.getStack();
|
||||||
|
var3 = var5.copy();
|
||||||
|
|
||||||
|
if (par2 <= 0) {
|
||||||
|
if (!this.mergeItemStack(var5, 1, this.inventorySlots.size(), true))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!this.mergeItemStack(var5, 0, 1, false))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (var5.stackSize == 0)
|
||||||
|
{
|
||||||
|
var4.putStack((ItemStack) null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var4.onSlotChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return var3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player) {
|
||||||
|
return diFurnace.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
60
com/hbm/inventory/gui/GUIMachineSatLinker.java
Normal file
60
com/hbm/inventory/gui/GUIMachineSatLinker.java
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
package com.hbm.inventory.gui;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.hbm.inventory.container.ContainerMachineSatLinker;
|
||||||
|
import com.hbm.inventory.container.ContainerMachineSiren;
|
||||||
|
import com.hbm.items.tool.ItemCassette.TrackType;
|
||||||
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSiren;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSatLinker;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
|
import net.minecraft.client.resources.I18n;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
public class GUIMachineSatLinker extends GuiInfoContainer {
|
||||||
|
|
||||||
|
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_linker.png");
|
||||||
|
private TileEntityMachineSatLinker siren;
|
||||||
|
|
||||||
|
public GUIMachineSatLinker(InventoryPlayer invPlayer, TileEntityMachineSatLinker tedf) {
|
||||||
|
super(new ContainerMachineSatLinker(invPlayer, tedf));
|
||||||
|
siren = tedf;
|
||||||
|
|
||||||
|
this.xSize = 176;
|
||||||
|
this.ySize = 166;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||||
|
super.drawScreen(mouseX, mouseY, f);
|
||||||
|
|
||||||
|
String[] text = new String[] { "The first slot will copy the satellite/chip's",
|
||||||
|
"frequency and paste it to the second slot." };
|
||||||
|
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, text);
|
||||||
|
|
||||||
|
String[] text1 = new String[] { "The third slot will randomize the",
|
||||||
|
"satellite/chip's frequency."};
|
||||||
|
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36 + 16, 16, 16, guiLeft - 8, guiTop + 36 + 16, text1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||||
|
String name = this.siren.hasCustomInventoryName() ? this.siren.getInventoryName() : I18n.format(this.siren.getInventoryName());
|
||||||
|
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||||
|
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||||
|
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||||
|
|
||||||
|
this.drawInfoPanel(guiLeft - 16, guiTop + 36, 16, 16, 2);
|
||||||
|
this.drawInfoPanel(guiLeft - 16, guiTop + 36 + 16, 16, 16, 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -682,6 +682,8 @@ public class ModItems {
|
|||||||
public static Item sat_radar;
|
public static Item sat_radar;
|
||||||
public static Item sat_laser;
|
public static Item sat_laser;
|
||||||
public static Item sat_foeq;
|
public static Item sat_foeq;
|
||||||
|
public static Item sat_resonator;
|
||||||
|
public static Item sat_chip;
|
||||||
|
|
||||||
public static Item gun_rpg;
|
public static Item gun_rpg;
|
||||||
public static Item gun_rpg_ammo;
|
public static Item gun_rpg_ammo;
|
||||||
@ -1824,11 +1826,13 @@ public class ModItems {
|
|||||||
missile_taint = new Item().setUnlocalizedName("missile_taint").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_taint");
|
missile_taint = new Item().setUnlocalizedName("missile_taint").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_taint");
|
||||||
missile_micro = new Item().setUnlocalizedName("missile_micro").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_micro");
|
missile_micro = new Item().setUnlocalizedName("missile_micro").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_micro");
|
||||||
missile_carrier = new Item().setUnlocalizedName("missile_carrier").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_carrier");
|
missile_carrier = new Item().setUnlocalizedName("missile_carrier").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_carrier");
|
||||||
sat_mapper = new Item().setUnlocalizedName("sat_mapper").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_mapper");
|
sat_mapper = new ItemSatChip().setUnlocalizedName("sat_mapper").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_mapper");
|
||||||
sat_scanner = new Item().setUnlocalizedName("sat_scanner").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_scanner");
|
sat_scanner = new ItemSatChip().setUnlocalizedName("sat_scanner").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_scanner");
|
||||||
sat_radar = new Item().setUnlocalizedName("sat_radar").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_radar");
|
sat_radar = new ItemSatChip().setUnlocalizedName("sat_radar").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_radar");
|
||||||
sat_laser = new Item().setUnlocalizedName("sat_laser").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_laser");
|
sat_laser = new ItemSatChip().setUnlocalizedName("sat_laser").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_laser");
|
||||||
sat_foeq = new Item().setUnlocalizedName("sat_foeq").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_foeq");
|
sat_foeq = new ItemSatChip().setUnlocalizedName("sat_foeq").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_foeq");
|
||||||
|
sat_resonator = new ItemSatChip().setUnlocalizedName("sat_resonator").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_resonator");
|
||||||
|
sat_chip = new ItemSatChip().setUnlocalizedName("sat_chip").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":sat_chip");
|
||||||
|
|
||||||
gun_rpg = new GunRpg().setUnlocalizedName("gun_rpg").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_rpg_new");
|
gun_rpg = new GunRpg().setUnlocalizedName("gun_rpg").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_rpg_new");
|
||||||
gun_rpg_ammo = new Item().setUnlocalizedName("gun_rpg_ammo").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_rpg_ammo_new");
|
gun_rpg_ammo = new Item().setUnlocalizedName("gun_rpg_ammo").setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":gun_rpg_ammo_new");
|
||||||
@ -3125,7 +3129,7 @@ public class ModItems {
|
|||||||
|
|
||||||
//Missiles
|
//Missiles
|
||||||
GameRegistry.registerItem(missile_generic, missile_generic.getUnlocalizedName());
|
GameRegistry.registerItem(missile_generic, missile_generic.getUnlocalizedName());
|
||||||
//GameRegistry.registerItem(missile_anti_ballistic, missile_anti_ballistic.getUnlocalizedName());
|
GameRegistry.registerItem(missile_anti_ballistic, missile_anti_ballistic.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(missile_incendiary, missile_incendiary.getUnlocalizedName());
|
GameRegistry.registerItem(missile_incendiary, missile_incendiary.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(missile_cluster, missile_cluster.getUnlocalizedName());
|
GameRegistry.registerItem(missile_cluster, missile_cluster.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(missile_buster, missile_buster.getUnlocalizedName());
|
GameRegistry.registerItem(missile_buster, missile_buster.getUnlocalizedName());
|
||||||
@ -3152,6 +3156,8 @@ public class ModItems {
|
|||||||
GameRegistry.registerItem(sat_radar, sat_radar.getUnlocalizedName());
|
GameRegistry.registerItem(sat_radar, sat_radar.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(sat_laser, sat_laser.getUnlocalizedName());
|
GameRegistry.registerItem(sat_laser, sat_laser.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(sat_foeq, sat_foeq.getUnlocalizedName());
|
GameRegistry.registerItem(sat_foeq, sat_foeq.getUnlocalizedName());
|
||||||
|
GameRegistry.registerItem(sat_resonator, sat_resonator.getUnlocalizedName());
|
||||||
|
GameRegistry.registerItem(sat_chip, sat_chip.getUnlocalizedName());
|
||||||
|
|
||||||
//Guns
|
//Guns
|
||||||
GameRegistry.registerItem(gun_revolver_iron, gun_revolver_iron.getUnlocalizedName());
|
GameRegistry.registerItem(gun_revolver_iron, gun_revolver_iron.getUnlocalizedName());
|
||||||
|
|||||||
33
com/hbm/items/tool/ItemSatChip.java
Normal file
33
com/hbm/items/tool/ItemSatChip.java
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package com.hbm.items.tool;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
|
public class ItemSatChip extends Item {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
|
||||||
|
{
|
||||||
|
list.add("Satellite frequency: " + getFreq(itemstack));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getFreq(ItemStack stack) {
|
||||||
|
if(stack.stackTagCompound == null) {
|
||||||
|
stack.stackTagCompound = new NBTTagCompound();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return stack.stackTagCompound.getInteger("freq");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setFreq(ItemStack stack, int i) {
|
||||||
|
if(stack.stackTagCompound == null) {
|
||||||
|
stack.stackTagCompound = new NBTTagCompound();
|
||||||
|
}
|
||||||
|
stack.stackTagCompound.setInteger("freq", i);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -266,6 +266,7 @@ import com.hbm.tileentity.machine.TileEntityMachineUF6Tank;
|
|||||||
import com.hbm.tileentity.machine.TileEntityNukeFurnace;
|
import com.hbm.tileentity.machine.TileEntityNukeFurnace;
|
||||||
import com.hbm.tileentity.machine.TileEntityReactorMultiblock;
|
import com.hbm.tileentity.machine.TileEntityReactorMultiblock;
|
||||||
import com.hbm.tileentity.machine.TileEntityRtgFurnace;
|
import com.hbm.tileentity.machine.TileEntityRtgFurnace;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineSatLinker;
|
||||||
import com.hbm.tileentity.machine.TileEntityStructureMarker;
|
import com.hbm.tileentity.machine.TileEntityStructureMarker;
|
||||||
import com.hbm.tileentity.machine.TileEntityWatzCore;
|
import com.hbm.tileentity.machine.TileEntityWatzCore;
|
||||||
|
|
||||||
@ -390,6 +391,7 @@ public class MainRegistry
|
|||||||
public static Achievement achPotato;
|
public static Achievement achPotato;
|
||||||
public static Achievement achC44;
|
public static Achievement achC44;
|
||||||
public static Achievement achC20_5;
|
public static Achievement achC20_5;
|
||||||
|
public static Achievement achSpace;
|
||||||
|
|
||||||
public static boolean enableDebugMode = true;
|
public static boolean enableDebugMode = true;
|
||||||
public static boolean enableMycelium = false;
|
public static boolean enableMycelium = false;
|
||||||
@ -620,6 +622,7 @@ public class MainRegistry
|
|||||||
GameRegistry.registerTileEntity(TileEntityCelPrimePort.class, "tileentity_cel_prime_connector");
|
GameRegistry.registerTileEntity(TileEntityCelPrimePort.class, "tileentity_cel_prime_connector");
|
||||||
GameRegistry.registerTileEntity(TileEntityCelPrimeTanks.class, "tileentity_cel_prime_storage");
|
GameRegistry.registerTileEntity(TileEntityCelPrimeTanks.class, "tileentity_cel_prime_storage");
|
||||||
GameRegistry.registerTileEntity(TileEntityMachineSeleniumEngine.class, "tileentity_selenium_engine");
|
GameRegistry.registerTileEntity(TileEntityMachineSeleniumEngine.class, "tileentity_selenium_engine");
|
||||||
|
GameRegistry.registerTileEntity(TileEntityMachineSatLinker.class, "tileentity_satlinker");
|
||||||
|
|
||||||
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
|
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
|
||||||
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
|
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
|
||||||
@ -915,6 +918,7 @@ public class MainRegistry
|
|||||||
achPotato = new Achievement("achievement.potato", "potato", -2, 0, ModItems.battery_potatos, null).initIndependentStat().setSpecial().registerStat();
|
achPotato = new Achievement("achievement.potato", "potato", -2, 0, ModItems.battery_potatos, null).initIndependentStat().setSpecial().registerStat();
|
||||||
achC44 = new Achievement("achievement.c44", "c44", 2, -2, ModItems.gun_revolver_pip, null).initIndependentStat().setSpecial().registerStat();
|
achC44 = new Achievement("achievement.c44", "c44", 2, -2, ModItems.gun_revolver_pip, null).initIndependentStat().setSpecial().registerStat();
|
||||||
achC20_5 = new Achievement("achievement.c20_5", "c20_5", 4, -2, ModItems.gun_dampfmaschine, null).initIndependentStat().setSpecial().registerStat();
|
achC20_5 = new Achievement("achievement.c20_5", "c20_5", 4, -2, ModItems.gun_dampfmaschine, null).initIndependentStat().setSpecial().registerStat();
|
||||||
|
achSpace = new Achievement("achievement.space", "space", 4, 0, ModItems.missile_carrier, null).initIndependentStat().setSpecial().registerStat();
|
||||||
|
|
||||||
AchievementPage.registerAchievementPage(new AchievementPage("Nuclear Tech", new Achievement[]{
|
AchievementPage.registerAchievementPage(new AchievementPage("Nuclear Tech", new Achievement[]{
|
||||||
achSacrifice,
|
achSacrifice,
|
||||||
@ -924,7 +928,8 @@ public class MainRegistry
|
|||||||
achSelenium,
|
achSelenium,
|
||||||
achPotato,
|
achPotato,
|
||||||
achC44,
|
achC44,
|
||||||
achC20_5
|
achC20_5,
|
||||||
|
achSpace
|
||||||
}));
|
}));
|
||||||
|
|
||||||
OreDictionary.registerOre("ingotUranium", ModItems.ingot_uranium);
|
OreDictionary.registerOre("ingotUranium", ModItems.ingot_uranium);
|
||||||
|
|||||||
@ -182,6 +182,7 @@ public class ResourceManager {
|
|||||||
public static final ResourceLocation missileV2_IN_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileV2_IN.png");
|
public static final ResourceLocation missileV2_IN_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileV2_IN.png");
|
||||||
public static final ResourceLocation missileV2_CL_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileV2_CL.png");
|
public static final ResourceLocation missileV2_CL_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileV2_CL.png");
|
||||||
public static final ResourceLocation missileV2_BU_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileV2_BU.png");
|
public static final ResourceLocation missileV2_BU_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileV2_BU.png");
|
||||||
|
public static final ResourceLocation missileAA_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileAA.png");
|
||||||
public static final ResourceLocation missileStrong_HE_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileStrong_HE.png");
|
public static final ResourceLocation missileStrong_HE_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileStrong_HE.png");
|
||||||
public static final ResourceLocation missileStrong_IN_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileStrong_IN.png");
|
public static final ResourceLocation missileStrong_IN_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileStrong_IN.png");
|
||||||
public static final ResourceLocation missileStrong_CL_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileStrong_CL.png");
|
public static final ResourceLocation missileStrong_CL_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missileStrong_CL.png");
|
||||||
|
|||||||
@ -70,6 +70,8 @@ public class TEMissilePacket implements IMessage {
|
|||||||
type = 19;
|
type = 19;
|
||||||
if(stack.getItem() == ModItems.missile_carrier)
|
if(stack.getItem() == ModItems.missile_carrier)
|
||||||
type = 20;
|
type = 20;
|
||||||
|
if(stack.getItem() == ModItems.missile_anti_ballistic)
|
||||||
|
type = 21;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,8 +36,8 @@ public class RenderMissileGeneric extends Render {
|
|||||||
bindTexture(ResourceManager.missileV2_CL_tex);
|
bindTexture(ResourceManager.missileV2_CL_tex);
|
||||||
if(p_76986_1_ instanceof EntityMissileBunkerBuster)
|
if(p_76986_1_ instanceof EntityMissileBunkerBuster)
|
||||||
bindTexture(ResourceManager.missileV2_BU_tex);
|
bindTexture(ResourceManager.missileV2_BU_tex);
|
||||||
/*if(p_76986_1_ instanceof EntityMissileAntiBallistic)
|
if(p_76986_1_ instanceof EntityMissileAntiBallistic)
|
||||||
bindTexture(missileAATexture);*/
|
bindTexture(ResourceManager.missileAA_tex);
|
||||||
ResourceManager.missileV2.renderAll();
|
ResourceManager.missileV2.renderAll();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -187,6 +187,12 @@ public class RenderLaunchPadTier1 extends TileEntitySpecialRenderer {
|
|||||||
ResourceManager.missileBooster.renderAll();
|
ResourceManager.missileBooster.renderAll();
|
||||||
GL11.glTranslated(0.0D, 0.0D, 1.25D);
|
GL11.glTranslated(0.0D, 0.0D, 1.25D);
|
||||||
}
|
}
|
||||||
|
if(state == 21)
|
||||||
|
{
|
||||||
|
GL11.glScalef(1.0F, 1.0F, 1.0F);
|
||||||
|
bindTexture(ResourceManager.missileAA_tex);
|
||||||
|
ResourceManager.missileV2.renderAll();
|
||||||
|
}
|
||||||
|
|
||||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,14 @@ public class SatelliteSaveStructure {
|
|||||||
public int satelliteID;
|
public int satelliteID;
|
||||||
public SatelliteType satelliteType;
|
public SatelliteType satelliteType;
|
||||||
|
|
||||||
enum SatelliteType {
|
public SatelliteSaveStructure() { }
|
||||||
|
|
||||||
|
public SatelliteSaveStructure(int id, SatelliteType type) {
|
||||||
|
satelliteID = id;
|
||||||
|
satelliteType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SatelliteType {
|
||||||
|
|
||||||
//Prints map remotely
|
//Prints map remotely
|
||||||
MAPPER,
|
MAPPER,
|
||||||
|
|||||||
@ -1,12 +1,18 @@
|
|||||||
package com.hbm.saveddata;
|
package com.hbm.saveddata;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldSavedData;
|
import net.minecraft.world.WorldSavedData;
|
||||||
|
|
||||||
public class SatelliteSavedData extends WorldSavedData {
|
public class SatelliteSavedData extends WorldSavedData {
|
||||||
|
|
||||||
public int globalAccessThingy;
|
public int satCount;
|
||||||
|
|
||||||
|
public List<SatelliteSaveStructure> satellites = new ArrayList();
|
||||||
|
|
||||||
private World worldObj;
|
private World worldObj;
|
||||||
|
|
||||||
public SatelliteSavedData(String p_i2141_1_) {
|
public SatelliteSavedData(String p_i2141_1_) {
|
||||||
@ -19,15 +25,35 @@ public class SatelliteSavedData extends WorldSavedData {
|
|||||||
this.worldObj = p_i1678_1_;
|
this.worldObj = p_i1678_1_;
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFreqTaken(int freq) {
|
||||||
|
|
||||||
|
for(SatelliteSaveStructure sat : satellites)
|
||||||
|
if(sat.satelliteID == freq)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound nbt) {
|
public void readFromNBT(NBTTagCompound nbt) {
|
||||||
globalAccessThingy = nbt.getInteger("gat");
|
satCount = nbt.getInteger("satCount");
|
||||||
|
|
||||||
|
for(int i = 0; i < satCount; i++) {
|
||||||
|
SatelliteSaveStructure struct = new SatelliteSaveStructure();
|
||||||
|
struct.readFromNBT(nbt, i);
|
||||||
|
|
||||||
|
satellites.add(struct);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToNBT(NBTTagCompound nbt) {
|
public void writeToNBT(NBTTagCompound nbt) {
|
||||||
nbt.setInteger("gat", globalAccessThingy);
|
nbt.setInteger("satCount", satellites.size());
|
||||||
|
|
||||||
|
for(int i = 0; i < satellites.size(); i++) {
|
||||||
|
satellites.get(i).writeToNBT(nbt, i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.machine;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.entity.missile.EntityMissileAntiBallistic;
|
||||||
import com.hbm.entity.missile.EntityMissileBaseAdvanced;
|
import com.hbm.entity.missile.EntityMissileBaseAdvanced;
|
||||||
import com.hbm.entity.projectile.EntityRocketHoming;
|
import com.hbm.entity.projectile.EntityRocketHoming;
|
||||||
import com.hbm.interfaces.IConsumer;
|
import com.hbm.interfaces.IConsumer;
|
||||||
@ -103,10 +104,14 @@ public class TileEntityMachineRadar extends TileEntity implements IConsumer {
|
|||||||
|
|
||||||
continue;
|
continue;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if(e instanceof EntityPlayer && e.posY >= yCoord + MainRegistry.radarBuffer) {
|
if(e instanceof EntityPlayer && e.posY >= yCoord + MainRegistry.radarBuffer) {
|
||||||
nearbyMissiles.add(new int[] { (int)e.posX, (int)e.posZ, 5, (int)e.posY });
|
nearbyMissiles.add(new int[] { (int)e.posX, (int)e.posZ, 5, (int)e.posY });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(e instanceof EntityMissileAntiBallistic && e.posY >= yCoord + MainRegistry.radarBuffer) {
|
||||||
|
nearbyMissiles.add(new int[] { (int)e.posX, (int)e.posZ, 4, (int)e.posY });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Entity e : allMissiles) {
|
for(Entity e : allMissiles) {
|
||||||
|
|||||||
189
com/hbm/tileentity/machine/TileEntityMachineSatLinker.java
Normal file
189
com/hbm/tileentity/machine/TileEntityMachineSatLinker.java
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
package com.hbm.tileentity.machine;
|
||||||
|
|
||||||
|
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||||
|
import com.hbm.inventory.FluidTank;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.items.tool.ItemSatChip;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.nbt.NBTTagList;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
public class TileEntityMachineSatLinker extends TileEntity implements ISidedInventory {
|
||||||
|
|
||||||
|
private ItemStack slots[];
|
||||||
|
|
||||||
|
//public static final int maxFill = 64 * 3;
|
||||||
|
|
||||||
|
private static final int[] slots_top = new int[] {0};
|
||||||
|
private static final int[] slots_bottom = new int[] {1};
|
||||||
|
private static final int[] slots_side = new int[] {2};
|
||||||
|
|
||||||
|
private String customName;
|
||||||
|
|
||||||
|
public TileEntityMachineSatLinker() {
|
||||||
|
slots = new ItemStack[3];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getSizeInventory() {
|
||||||
|
return slots.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getStackInSlot(int i) {
|
||||||
|
return slots[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getStackInSlotOnClosing(int i) {
|
||||||
|
if(slots[i] != null)
|
||||||
|
{
|
||||||
|
ItemStack itemStack = slots[i];
|
||||||
|
slots[i] = null;
|
||||||
|
return itemStack;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setInventorySlotContents(int i, ItemStack itemStack) {
|
||||||
|
slots[i] = itemStack;
|
||||||
|
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit())
|
||||||
|
{
|
||||||
|
itemStack.stackSize = getInventoryStackLimit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getInventoryName() {
|
||||||
|
return this.hasCustomInventoryName() ? this.customName : "container.satLinker";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCustomInventoryName() {
|
||||||
|
return this.customName != null && this.customName.length() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomName(String name) {
|
||||||
|
this.customName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getInventoryStackLimit() {
|
||||||
|
return 64;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||||
|
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}else{
|
||||||
|
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void openInventory() {}
|
||||||
|
@Override
|
||||||
|
public void closeInventory() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack decrStackSize(int i, int j) {
|
||||||
|
if(slots[i] != null)
|
||||||
|
{
|
||||||
|
if(slots[i].stackSize <= j)
|
||||||
|
{
|
||||||
|
ItemStack itemStack = slots[i];
|
||||||
|
slots[i] = null;
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
ItemStack itemStack1 = slots[i].splitStack(j);
|
||||||
|
if (slots[i].stackSize == 0)
|
||||||
|
{
|
||||||
|
slots[i] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return itemStack1;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readFromNBT(NBTTagCompound nbt) {
|
||||||
|
super.readFromNBT(nbt);
|
||||||
|
NBTTagList list = nbt.getTagList("items", 10);
|
||||||
|
|
||||||
|
slots = new ItemStack[getSizeInventory()];
|
||||||
|
|
||||||
|
for(int i = 0; i < list.tagCount(); i++)
|
||||||
|
{
|
||||||
|
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
|
||||||
|
byte b0 = nbt1.getByte("slot");
|
||||||
|
if(b0 >= 0 && b0 < slots.length)
|
||||||
|
{
|
||||||
|
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToNBT(NBTTagCompound nbt) {
|
||||||
|
super.writeToNBT(nbt);
|
||||||
|
NBTTagList list = new NBTTagList();
|
||||||
|
|
||||||
|
for(int i = 0; i < slots.length; i++)
|
||||||
|
{
|
||||||
|
if(slots[i] != null)
|
||||||
|
{
|
||||||
|
NBTTagCompound nbt1 = new NBTTagCompound();
|
||||||
|
nbt1.setByte("slot", (byte)i);
|
||||||
|
slots[i].writeToNBT(nbt1);
|
||||||
|
list.appendTag(nbt1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nbt.setTag("items", list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] getAccessibleSlotsFromSide(int p_94128_1_)
|
||||||
|
{
|
||||||
|
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||||
|
return this.isItemValidForSlot(i, itemStack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateEntity() {
|
||||||
|
|
||||||
|
if(!worldObj.isRemote)
|
||||||
|
{
|
||||||
|
if(slots[0] != null && slots[1] != null && slots[0].getItem() instanceof ItemSatChip && slots[1].getItem() instanceof ItemSatChip) {
|
||||||
|
ItemSatChip.setFreq(slots[1], ItemSatChip.getFreq(slots[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slots[2] != null && slots[2].getItem() instanceof ItemSatChip) {
|
||||||
|
ItemSatChip.setFreq(slots[2], worldObj.rand.nextInt(100000));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user