WAY UP HIGH, IN THE SKY, WITH THE SUN, IN YOUR EYE

This commit is contained in:
HbmMods 2026-07-26 16:49:53 +02:00
parent ddffe3074c
commit 2821c70e61
72 changed files with 1079 additions and 1252 deletions

View File

@ -29,6 +29,8 @@
* The small pylon now has a steel variant
* Items in the battery socket which previously didn't show up in the socket's model are now rendered
* Reduced the cost for the heavy stirling engine
* Removed the satellite interface item for being basically completely useless
* Updated the satellite ID manager texture and recipe
## Fixed
* Fixed held block being placed when not sneaking when opening the cable diode's GUI

View File

@ -34,6 +34,10 @@ public interface IRORInteractive extends IRORInfo {
return params;
}
public static int parseInt(String val) {
return parseInt(val, Integer.MIN_VALUE, Integer.MAX_VALUE);
}
public static int parseInt(String val, int min, int max) {
int result = 0;
try { result = Integer.parseInt(val); } catch(Exception x) {

View File

@ -19,6 +19,7 @@ import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
import net.minecraftforge.common.util.ForgeDirection;
public class MachineSatLink extends BlockDummyable implements ILookOverlay {
@ -36,6 +37,17 @@ public class MachineSatLink extends BlockDummyable implements ILookOverlay {
@Override public int[] getDimensions() { return new int[] {6, 0, 1, 0, 1, 0}; }
@Override public int getOffset() { return 0; }
@Override
protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
this.makeExtra(world, x - dir.offsetX, y, z - dir.offsetZ);
this.makeExtra(world, x + rot.offsetX, y, z + rot.offsetZ);
this.makeExtra(world, x - dir.offsetX + rot.offsetX, y, z - dir.offsetZ + rot.offsetZ);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {

View File

@ -3,7 +3,7 @@ package com.hbm.commands;
import com.hbm.items.ISatChip;
import com.hbm.items.ModItems;
import com.hbm.saveddata.SatelliteSavedData;
import com.hbm.saveddata.satellites.Satellite;
import com.hbm.saveddata.satellites.XSatelliteRegistry;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
@ -38,7 +38,7 @@ public class CommandSatellites extends CommandBase {
case "orbit":
EntityPlayer player = getCommandSenderAsPlayer(sender);
if(player.getHeldItem().getItem() instanceof ISatChip && player.getHeldItem().getItem() != ModItems.sat_chip) {
Satellite.orbit(player.worldObj, Satellite.getIDFromItem(player.getHeldItem().getItem()), ISatChip.getFreqS(player.getHeldItem()), player.posX, player.posY, player.posZ);
XSatelliteRegistry.orbit(player.worldObj, player.getHeldItem(), ISatChip.getFreqS(player.getHeldItem()), player.posX, player.posY, player.posZ);
player.getHeldItem().stackSize -= 1;
sender.addChatMessage(new ChatComponentTranslation("commands.satellite.satellite_orbited").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
} else {

View File

@ -3,7 +3,6 @@ package com.hbm.crafting;
import static com.hbm.inventory.OreDictManager.*;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemBreedingRod.*;
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
import com.hbm.items.machine.ItemPWRFuel.EnumPWRFuel;
import com.hbm.items.machine.ItemWatzPellet.EnumWatzType;
import com.hbm.items.machine.ItemZirnoxRod.EnumZirnoxType;
@ -87,14 +86,6 @@ public class RodRecipes {
CraftingManager.addShapelessAuto(new ItemStack(ModItems.nugget_lead, 24), new Object[] { new ItemStack(ModItems.rod_quad, 1, BreedingRodType.LEAD.ordinal()) });
addBreedingRod(U, ModItems.billet_uranium, BreedingRodType.URANIUM);
//Pile fuel
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pile_rod_uranium, 1), new Object[] { " U ", "PUP", " U ", 'P', IRON.plate(), 'U', U.billet() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pile_rod_source, 1), new Object[] { " U ", "PUP", " U ", 'P', IRON.plate(), 'U', ModItems.billet_ra226be });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pile_rod_boron, 1), new Object[] { " B ", " W ", " B ", 'B', B.ingot(), 'W', KEY_PLANKS });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.pile_rod_lithium, 1), new Object[] { ModItems.cell_empty, LI.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pile_rod_detector, 1), new Object[] { " B ", "CM ", " B ", 'B', B.ingot(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.VACUUM_TUBE), 'M', ModItems.motor });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.rbmk_fuel_empty, 1), new Object[] { "ZRZ", "Z Z", "ZRZ", 'Z', ZR.ingot(), 'R', ModItems.rod_quad_empty });
addRBMKRod(U, ModItems.rbmk_fuel_ueu);
addRBMKRod(ModItems.billet_uranium_fuel, ModItems.rbmk_fuel_meu);

View File

@ -92,6 +92,7 @@ public class EntityMappings {
addEntity(EntityBombletZeta.class, "entity_zeta", 1000);
addEntity(EntityOrangeFX.class, "entity_agent_orange", 1000);
addEntity(EntityDeathBlast.class, "entity_laser_blast", 1000);
addEntity(EntityOrbitalLaser.class, "entity_orbital_laser", 1000);
addEntity(EntityBurningFOEQ.class, "entity_burning_foeq", 1000);
addEntity(EntityFallingNuke.class, "entity_falling_bomb", 1000);
addEntity(EntityBulletBaseNT.class, "entity_bullet_mk3", 250, false);

View File

@ -1,7 +1,5 @@
package com.hbm.entity.logic;
import com.hbm.entity.projectile.EntityBulletBaseNT;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.threading.PacketThreading;
import com.hbm.packet.toclient.AuxParticlePacketNT;
@ -10,15 +8,14 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class EntityDeathBlast extends Entity {
public static final int maxAge = 60;
public EntityDeathBlast(World p_i1582_1_) {
super(p_i1582_1_);
public EntityDeathBlast(World world) {
super(world);
this.ignoreFrustumCheck = true;
}
@ -39,20 +36,6 @@ public class EntityDeathBlast extends Entity {
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(worldObj, 40, posX, posY, posZ));
int count = 100;
for(int i = 0; i < count; i++) {
Vec3 vec = Vec3.createVectorHelper(0.2, 0, 0);
vec.rotateAroundY((float)(2 * Math.PI * i / (float)count));
EntityBulletBaseNT laser = new EntityBulletBaseNT(worldObj, BulletConfigSyncingUtil.MASKMAN_BOLT);
laser.setPosition(posX, posY + 2, posZ);
laser.motionX = vec.xCoord;
laser.motionZ = vec.zCoord;
laser.motionY = -0.01;
worldObj.spawnEntityInWorld(laser);
}
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "muke");
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(data, posX, posY + 0.5, posZ), new TargetPoint(worldObj.provider.dimensionId, posX, posY, posZ, 250));

View File

@ -0,0 +1,68 @@
package com.hbm.entity.logic;
import com.hbm.explosion.vanillant.ExplosionVNT;
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
import com.hbm.explosion.vanillant.standard.EntityProcessorCrossSmooth;
import com.hbm.explosion.vanillant.standard.ExplosionEffectWeapon;
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
import com.hbm.util.DamageResistanceHandler.DamageClass;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class EntityOrbitalLaser extends Entity {
public static final int maxAge = 5;
public EntityOrbitalLaser(World world) {
super(world);
this.ignoreFrustumCheck = true;
}
@Override
protected void entityInit() { }
@Override
protected void readEntityFromNBT(NBTTagCompound nbt) { }
@Override
protected void writeEntityToNBT(NBTTagCompound nbt) { }
@Override
public void onUpdate() {
if(this.ticksExisted >= maxAge && !worldObj.isRemote) this.setDead();
}
public void explode() {
ExplosionVNT vnt = new ExplosionVNT(worldObj, posX, posY, posZ, 5F);
vnt.setBlockAllocator(new BlockAllocatorStandard());
vnt.setBlockProcessor(new BlockProcessorStandard());
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, 1_000F).setupPiercing(50F, 0.5F).setDamageClass(DamageClass.LASER));
vnt.setPlayerProcessor(new PlayerProcessorStandard());
vnt.setSFX(new ExplosionEffectWeapon(15, 3.5F, 1.25F));
vnt.explode();
}
@Override
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float p_70070_1_) {
return 15728880;
}
@Override
public float getBrightness(float p_70013_1_) {
return 1.0F;
}
@Override
@SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double distance) {
return distance < 25000;
}
}

View File

@ -7,7 +7,7 @@ import com.hbm.items.ISatChip;
import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.saveddata.satellites.Satellite;
import com.hbm.saveddata.satellites.XSatelliteRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -113,10 +113,8 @@ public class EntitySoyuz extends Entity {
}
if(load.getItem() instanceof ISatChip) {
int freq = ISatChip.getFreqS(load);
Satellite.orbit(worldObj, Satellite.getIDFromItem(load.getItem()), freq, posX, posY, posZ);
int freq = ISatChip.getFreqS(load);
XSatelliteRegistry.orbit(worldObj, load, freq, posX, posY, posZ);
}
}
}

View File

@ -30,10 +30,10 @@ public class GUIMachineSatLinker extends GuiInfoContainer {
super.drawScreen(mouseX, mouseY, f);
String[] chipText = I18nUtil.resolveKeyArray("desc.gui.satlinker.chip");
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 12, guiTop + 28, 16, 16, guiLeft - 8, guiTop + 36 + 16, chipText);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 12, guiTop + 28, 16, 16, guiLeft + 20, guiTop + 28 + 16, chipText);
String[] randomText = I18nUtil.resolveKeyArray("desc.gui.satlinker.random");
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 12, guiTop + 28 + 16, 16, 16, guiLeft - 8, guiTop + 36 + 16, randomText);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 12, guiTop + 28 + 16, 16, 16, guiLeft + 20, guiTop + 28 + 32, randomText);
}
@Override

View File

@ -4,19 +4,18 @@ import org.apache.commons.lang3.math.NumberUtils;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import com.hbm.items.ISatChip;
import com.hbm.items.tool.ItemSatInterface;
import com.hbm.lib.RefStrings;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toserver.SatCoordPacket;
import com.hbm.saveddata.satellites.Satellite.CoordActions;
import com.hbm.saveddata.satellites.Satellite.Interfaces;
import com.hbm.packet.toserver.NBTItemControlPacket;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
public class GUIScreenSatCoord extends GuiScreen {
@ -27,14 +26,15 @@ public class GUIScreenSatCoord extends GuiScreen {
protected int guiLeft;
protected int guiTop;
private final EntityPlayer player;
protected ItemStack device;
private GuiTextField xField;
private GuiTextField yField;
private GuiTextField zField;
public GUIScreenSatCoord(EntityPlayer player) {
this.player = player;
this.device = player.getHeldItem();
}
public void initGui() {
@ -63,37 +63,24 @@ public class GUIScreenSatCoord extends GuiScreen {
protected void mouseClicked(int i, int j, int k) {
super.mouseClicked(i, j, k);
if(ItemSatInterface.currentSat == null)
return;
if(!device.hasTagCompound() || !device.stackTagCompound.getBoolean(ItemSatInterface.KEY_NBT_CONNECTED)) return;
this.xField.mouseClicked(i, j, k);
if(ItemSatInterface.currentSat.coordAcs.contains(CoordActions.HAS_Y))
this.yField.mouseClicked(i, j, k);
this.yField.mouseClicked(i, j, k);
this.zField.mouseClicked(i, j, k);
if(i >= this.guiLeft + 133 && i < this.guiLeft + 133 + 18 && j >= this.guiTop + 52 && j < this.guiTop + 52 + 18 && player != null) {
if(NumberUtils.isNumber(xField.getText()) && NumberUtils.isNumber(zField.getText())) {
if(ItemSatInterface.currentSat.coordAcs.contains(CoordActions.HAS_Y)) {
if(NumberUtils.isNumber(yField.getText())) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:item.techBleep"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new SatCoordPacket((int) Double.parseDouble(xField.getText()), (int) Double.parseDouble(yField.getText()),
(int) Double.parseDouble(zField.getText()), ISatChip.getFreqS(player.getHeldItem())));
this.mc.thePlayer.closeScreen();
}
} else {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:item.techBleep"), 1.0F));
PacketDispatcher.wrapper
.sendToServer(new SatCoordPacket((int) Double.parseDouble(xField.getText()), 0, (int) Double.parseDouble(zField.getText()), ISatChip.getFreqS(player.getHeldItem())));
this.mc.thePlayer.closeScreen();
}
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
NBTTagCompound data = new NBTTagCompound();
data.setInteger("x", (int) Double.parseDouble(xField.getText()));
data.setInteger("z", (int) Double.parseDouble(zField.getText()));
if(NumberUtils.isNumber(yField.getText())) data.setInteger("y", (int) Double.parseDouble(yField.getText()));
PacketDispatcher.wrapper.sendToServer(new NBTItemControlPacket(data));
this.mc.thePlayer.closeScreen();
}
}
}
@ -108,16 +95,10 @@ public class GUIScreenSatCoord extends GuiScreen {
GL11.glEnable(GL11.GL_LIGHTING);
}
@Override
public boolean doesGuiPauseGame() {
return false;
}
protected void drawGuiContainerForegroundLayer(int i, int j) {
this.xField.drawTextBox();
if(ItemSatInterface.currentSat != null && ItemSatInterface.currentSat.coordAcs.contains(CoordActions.HAS_Y))
this.yField.drawTextBox();
this.yField.drawTextBox();
this.zField.drawTextBox();
}
@ -126,48 +107,34 @@ public class GUIScreenSatCoord extends GuiScreen {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(xField.isFocused())
drawTexturedModalRect(guiLeft + 61, guiTop + 16, 0, 126, 54, 18);
if(xField.isFocused()) drawTexturedModalRect(guiLeft + 61, guiTop + 16, 0, 126, 54, 18);
if(yField.isFocused()) drawTexturedModalRect(guiLeft + 61, guiTop + 52, 0, 126, 54, 18);
if(zField.isFocused()) drawTexturedModalRect(guiLeft + 61, guiTop + 88, 0, 126, 54, 18);
if(yField.isFocused())
drawTexturedModalRect(guiLeft + 61, guiTop + 52, 0, 126, 54, 18);
if(zField.isFocused())
drawTexturedModalRect(guiLeft + 61, guiTop + 88, 0, 126, 54, 18);
if(ItemSatInterface.currentSat != null) {
if(!ItemSatInterface.currentSat.coordAcs.contains(CoordActions.HAS_Y))
drawTexturedModalRect(guiLeft + 61, guiTop + 52, 0, 144, 54, 18);
if(device.hasTagCompound() && device.stackTagCompound.getBoolean(ItemSatInterface.KEY_NBT_CONNECTED)) {
drawTexturedModalRect(guiLeft + 120, guiTop + 17, 194, 0, 7, 7);
if(ItemSatInterface.currentSat.satIface == Interfaces.SAT_COORD) {
drawTexturedModalRect(guiLeft + 120, guiTop + 25, 194, 0, 7, 7);
}
drawTexturedModalRect(guiLeft + 120, guiTop + 25, 194, 0, 7, 7);
}
}
protected void keyTyped(char p_73869_1_, int p_73869_2_) {
@Override
protected void keyTyped(char c, int k) {
if(this.xField.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
} else if(ItemSatInterface.currentSat != null && ItemSatInterface.currentSat.coordAcs.contains(CoordActions.HAS_Y) && this.yField.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
} else if(this.zField.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
} else {
super.keyTyped(p_73869_1_, p_73869_2_);
}
if(p_73869_2_ == 1 || p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
this.mc.thePlayer.closeScreen();
}
if(this.xField.textboxKeyTyped(c, k)) return;
if(this.yField.textboxKeyTyped(c, k)) return;
if(this.zField.textboxKeyTyped(c, k)) return;
super.keyTyped(c, k);
}
@Override
public boolean doesGuiPauseGame() {
return false;
}
@Override
public void onGuiClosed() {
Keyboard.enableRepeatEvents(false);
}
}

View File

@ -1,330 +0,0 @@
package com.hbm.inventory.gui;
import java.util.Arrays;
import java.util.List;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.recipes.MachineRecipes;
import com.hbm.items.ISatChip;
import com.hbm.items.tool.ItemSatInterface;
import com.hbm.lib.RefStrings;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toserver.SatLaserPacket;
import com.hbm.saveddata.satellites.Satellite.InterfaceActions;
import com.hbm.saveddata.satellites.Satellite.Interfaces;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
public class GUIScreenSatInterface extends GuiScreen {
protected static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/satellites/gui_sat_interface.png");
protected int xSize = 216;
protected int ySize = 216;
protected int guiLeft;
protected int guiTop;
private final EntityPlayer player;
int x;
int z;
public GUIScreenSatInterface(EntityPlayer player) {
this.player = player;
}
public void updateScreen() {
}
protected void mouseClicked(int i, int j, int k) {
if(ItemSatInterface.currentSat != null && ItemSatInterface.currentSat.ifaceAcs.contains(InterfaceActions.CAN_CLICK)) {
if(i >= this.guiLeft + 8 && i < this.guiLeft + 208 && j >= this.guiTop + 8 && j < this.guiTop + 208 && player != null) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:item.techBleep"), 1.0F));
int x = this.x - guiLeft + i - 8 - 100;
int z = this.z - guiTop + j - 8 - 100;
PacketDispatcher.wrapper.sendToServer(new SatLaserPacket(x, z, ISatChip.getFreqS(player.getHeldItem())));
}
}
}
public void drawScreen(int mouseX, int mouseY, float f)
{
this.drawDefaultBackground();
this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
GL11.glDisable(GL11.GL_LIGHTING);
this.drawGuiContainerForegroundLayer(mouseX, mouseY);
GL11.glEnable(GL11.GL_LIGHTING);
}
public void initGui()
{
super.initGui();
this.guiLeft = (this.width - this.xSize) / 2;
this.guiTop = (this.height - this.ySize) / 2;
x = (int) player.posX;
z = (int) player.posZ;
}
@Override
public boolean doesGuiPauseGame() {
return false;
}
protected void drawGuiContainerForegroundLayer(int i, int j) {
if(ItemSatInterface.currentSat != null && ItemSatInterface.currentSat.ifaceAcs.contains(InterfaceActions.SHOW_COORDS)) {
if(i >= this.guiLeft + 8 && i < this.guiLeft + 208 && j >= this.guiTop + 8 && j < this.guiTop + 208 && player != null) {
int x = this.x - guiLeft + i - 8 - 100;
int z = this.z - guiTop + j - 8 - 100;
func_146283_a(Arrays.asList(new String[] { x + " / " + z }), i, j);
}
}
}
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(ItemSatInterface.currentSat == null) {
drawNotConnected();
} else {
if(ItemSatInterface.currentSat.satIface != Interfaces.SAT_PANEL) {
drawNoService();
return;
}
if(ItemSatInterface.currentSat.ifaceAcs.contains(InterfaceActions.HAS_MAP)) {
drawMap();
}
if(ItemSatInterface.currentSat.ifaceAcs.contains(InterfaceActions.HAS_ORES)) {
drawScan();
}
if(ItemSatInterface.currentSat.ifaceAcs.contains(InterfaceActions.HAS_RADAR)) {
drawRadar();
}
}
}
private int scanPos = 0;
private long lastMilli = 0;
private void progresScan() {
if(lastMilli + 25 < System.currentTimeMillis()) {
lastMilli = System.currentTimeMillis();
scanPos++;
}
if(scanPos >= 200)
scanPos -= 200;
}
private int[][] map = new int[200][200];
private void drawMap() {
World world = player.worldObj;
for(int i = -100; i < 100; i++) {
int x = this.x + i;
int z = this.z + scanPos - 100;
int y = world.getHeightValue(x, z) - 1;
map[i + 100][scanPos] = world.getBlock(x, y, z).getMaterial().getMaterialMapColor().colorValue;
}
prontMap();
progresScan();
}
private void drawScan() {
World world = player.worldObj;
for(int i = -100; i < 100; i++) {
int x = this.x + i;
int z = this.z + scanPos - 100;
for(int j = 255; j >= 0; j--) {
int c = getColorFromBlock(new ItemStack(world.getBlock(x, j, z), 1, world.getBlockMetadata(x, j, z)));
if(c != 0) {
map[i + 100][scanPos] = c;
break;
}
}
}
prontMap();
progresScan();
}
private int getColorFromBlock(ItemStack stack) {
if(stack == null || stack.getItem() == null/* || stack.getItemDamage() < 0*/)
return 0;
if(MachineRecipes.mODE(stack, "oreCoal"))
return 0x333333;
if(MachineRecipes.mODE(stack, "oreIron"))
return 0xb2aa92;
if(MachineRecipes.mODE(stack, "oreGold"))
return 0xffe460;
if(MachineRecipes.mODE(stack, "oreSilver"))
return 0xe5e5e5;
if(MachineRecipes.mODE(stack, "oreDiamond"))
return 0x6ed5ef;
if(MachineRecipes.mODE(stack, "oreEmerald"))
return 0x6cf756;
if(MachineRecipes.mODE(stack, "oreLapis"))
return 0x092f7a;
if(MachineRecipes.mODE(stack, "oreRedstone"))
return 0xe50000;
if(MachineRecipes.mODE(stack, "oreTin"))
return 0xa09797;
if(MachineRecipes.mODE(stack, "oreCopper"))
return 0xd16208;
if(MachineRecipes.mODE(stack, "oreLead"))
return 0x384b68;
if(MachineRecipes.mODE(stack, "oreAluminum"))
return 0xdbdbdb;
if(MachineRecipes.mODE(stack, "oreTungsten"))
return 0x333333;
if(MachineRecipes.mODE(stack, "oreTitanium"))
return 0xDDDDDD;
if(MachineRecipes.mODE(stack, "oreUranium"))
return 0x3e4f3c;
if(MachineRecipes.mODE(stack, "oreBeryllium"))
return 0x8e8d7d;
if(MachineRecipes.mODE(stack, "oreSulfur"))
return 0x9b9309;
if(MachineRecipes.mODE(stack, "oreSalpeter") || MachineRecipes.mODE(stack, "oreNiter"))
return 0xa5a09d;
if(MachineRecipes.mODE(stack, "oreFluorite"))
return 0xffffff;
if(MachineRecipes.mODE(stack, "oreSchrabidium"))
return 0x1cffff;
if(MachineRecipes.mODE(stack, "oreRareEarth"))
return 0xffcc99;
return isOre(stack) ? 0xBA00AF : 0x000000;
}
private static boolean isOre(ItemStack stack) {
int[] ids = OreDictionary.getOreIDs(new ItemStack(stack.getItem(), 1, stack.getItemDamage()));
for(int i = 0; i < ids.length; i++) {
String s = OreDictionary.getOreName(ids[i]);
if(s.length() > 3 && s.substring(0, 3).equals("ore"))
return true;
}
return false;
}
private void drawRadar() {
List<Entity> entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, AxisAlignedBB.getBoundingBox(player.posX - 100, 0, player.posZ - 100, player.posX + 100, 5000, player.posZ + 100));
if(!entities.isEmpty()) {
for(Entity e : entities) {
if(e.width * e.width * e.height >= 0.5D) {
int x = (int)((e.posX - this.x) / ((double)100 * 2 + 1) * (200D - 8D)) - 4;
int z = (int)((e.posZ - this.z) / ((double)100 * 2 + 1) * (200D - 8D)) - 4 - 9;
int t = 5;
//TODO: fix radar screen implementation
/*if(e instanceof EntityMissileBaseAdvanced) {
t = ((EntityMissileBaseAdvanced)e).getTargetType().ordinal();
}*/
if(e instanceof EntityMob) {
t = 6;
}
if(e instanceof EntityPlayer) {
t = 7;
}
drawTexturedModalRect(guiLeft + 108 + x, guiTop + 117 + z, 216, 8 * t, 8, 8);
}
}
}
}
private void prontMap() {
for(int x = 0; x < 200; x++) {
for(int z = 0; z < 200; z++) {
if(map[x][z] != 0) {
GL11.glColor3ub((byte)((map[x][z] & 0xFF0000) >> 16), (byte)((map[x][z] & 0x00FF00) >> 8), (byte)(map[x][z] & 0x0000FF));
drawTexturedModalRect(guiLeft + 8 + x, guiTop + 8 + z, 216, 216, 1, 1);
}
}
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
private void drawNoService() {
drawTexturedModalRect((this.width - 77) / 2, (this.height - 12) / 2, 0, 228, 77, 12);
}
private void drawNotConnected() {
drawTexturedModalRect((this.width - 121) / 2, (this.height - 12) / 2, 0, 216, 121, 12);
}
protected void keyTyped(char p_73869_1_, int p_73869_2_)
{
if (p_73869_2_ == 1 || p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode())
{
this.mc.thePlayer.closeScreen();
}
if (p_73869_2_ == this.mc.gameSettings.keyBindForward.getKeyCode())
{
this.z -= 50;
map = new int[200][200];
}
if (p_73869_2_ == this.mc.gameSettings.keyBindBack.getKeyCode())
{
this.z += 50;
map = new int[200][200];
}
if (p_73869_2_ == this.mc.gameSettings.keyBindLeft.getKeyCode())
{
this.x -= 50;
map = new int[200][200];
}
if (p_73869_2_ == this.mc.gameSettings.keyBindRight.getKeyCode())
{
this.x += 50;
map = new int[200][200];
}
}
}

View File

@ -111,12 +111,6 @@ public class ArcWelderRecipes extends SerializableRecipe {
recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.missile_nuclear), 600, 50_000L, new ComparableStack(ModItems.warhead_nuclear), new ComparableStack(ModItems.fuel_tank_large), new ComparableStack(ModItems.thruster_large, 3)));
recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.missile_nuclear_cluster), 600, 50_000L, new ComparableStack(ModItems.warhead_mirv), new ComparableStack(ModItems.fuel_tank_large), new ComparableStack(ModItems.thruster_large, 3)));
recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.missile_volcano), 600, 50_000L, new ComparableStack(ModItems.warhead_volcano), new ComparableStack(ModItems.fuel_tank_large), new ComparableStack(ModItems.thruster_large, 3)));
recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.sat_mapper), 600, 10_000L, new ComparableStack(ModItems.sat_base), new ComparableStack(ModItems.sat_head_mapper)));
recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.sat_scanner), 600, 10_000L, new ComparableStack(ModItems.sat_base), new ComparableStack(ModItems.sat_head_scanner)));
recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.sat_radar), 600, 10_000L, new ComparableStack(ModItems.sat_base), new ComparableStack(ModItems.sat_head_radar)));
recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.sat_laser), 600, 50_000L, new ComparableStack(ModItems.sat_base), new ComparableStack(ModItems.sat_head_laser)));
recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.sat_resonator), 600, 50_000L, new ComparableStack(ModItems.sat_base), new ComparableStack(ModItems.sat_head_resonator)));
}
public static HashMap getRecipes() {

View File

@ -171,10 +171,6 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
.inputItems(new OreDictStack(ZR.billet(), 1)).setGroup(autoPileRod, INSTANCE));
this.register(new GenericRecipe("ass.pilenu").setup(40, 200).outputItems(new ItemStack(ModItems.pile_rod, 1, EnumPileRod.NU.ordinal()))
.inputItems(new OreDictStack(U.billet(), 3)).setGroup(autoPileRod, INSTANCE));
this.register(new GenericRecipe("ass.pilepu239").setup(40, 200).outputItems(new ItemStack(ModItems.pile_rod, 1, EnumPileRod.PU239.ordinal()))
.inputItems(new OreDictStack(PU239.billet(), 3)).setGroup(autoPileRod, INSTANCE));
this.register(new GenericRecipe("ass.pilergp").setup(40, 200).outputItems(new ItemStack(ModItems.pile_rod, 1, EnumPileRod.RGP.ordinal()))
.inputItems(new OreDictStack(PURG.billet(), 3)).setGroup(autoPileRod, INSTANCE));
// powders
String autoCyclotron = "autoswitch.cyclotron";
@ -967,77 +963,6 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
new ComparableStack(ModItems.thruster_small, 3),
new ComparableStack(ModItems.circuit, 3, EnumCircuitType.CONTROLLER_ADVANCED),
new ComparableStack(ModItems.part_generic, 12, EnumPartType.LDE)).setPools(GenericRecipes.POOL_PREFIX_DISCOVER + "soyuz"));
this.register(new GenericRecipe("ass.satellitebase").setup(600, 100).outputItems(new ItemStack(ModItems.sat_base, 1))
.inputItems(new OreDictStack(RUBBER.ingot(), 12),
new OreDictStack(TI.shell(), 3),
new ComparableStack(ModItems.thruster_medium, 1),
new ComparableStack(ModItems.part_generic, 8, EnumPartType.LDE),
new ComparableStack(ModItems.plate_desh, 4),
new ComparableStack(ModItems.fluid_barrel_full, 1, Fluids.KEROSENE.getID()),
new ComparableStack(ModItems.photo_panel, 24),
new ComparableStack(ModItems.circuit, 12, EnumCircuitType.BASIC),
new ComparableStack(ModItems.battery_pack, 1, EnumBatteryPack.BATTERY_LITHIUM)));
this.register(new GenericRecipe("ass.satellitemapper").setup(600, 100).outputItems(new ItemStack(ModItems.sat_head_mapper, 1))
.inputItems(new OreDictStack(STEEL.shell(), 3),
new ComparableStack(ModItems.plate_desh, 4),
new ComparableStack(ModItems.circuit, 4, EnumCircuitType.ADVANCED),
new ComparableStack(ModBlocks.glass_quartz, 8)));
this.register(new GenericRecipe("ass.satellitescanner").setup(600, 100).outputItems(new ItemStack(ModItems.sat_head_scanner, 1))
.inputItems(new OreDictStack(STEEL.shell(), 3),
new OreDictStack(TI.plateCast(), 8),
new ComparableStack(ModItems.plate_desh, 4),
new ComparableStack(ModItems.magnetron, 8),
new ComparableStack(ModItems.circuit, 8, EnumCircuitType.ADVANCED.ordinal())));
this.register(new GenericRecipe("ass.satelliteradar").setup(600, 100).outputItems(new ItemStack(ModItems.sat_head_radar, 1))
.inputItems(new OreDictStack(STEEL.shell(), 3),
new OreDictStack(TI.plateCast(), 12),
new ComparableStack(ModItems.magnetron, 12),
new ComparableStack(ModItems.coil_gold, 16),
new ComparableStack(ModItems.circuit, 4, EnumCircuitType.ADVANCED.ordinal())));
this.register(new GenericRecipe("ass.satellitelaser").setup(600, 100).outputItems(new ItemStack(ModItems.sat_head_laser, 1))
.inputItems(new OreDictStack(STEEL.shell(), 6),
new OreDictStack(CU.plateCast(), 24),
new OreDictStack(ANY_HARDPLASTIC.ingot(), 16),
new ComparableStack(ModItems.circuit, 8, EnumCircuitType.CONTROLLER_ADVANCED),
new ComparableStack(ModItems.circuit, 16, EnumCircuitType.CAPACITOR_BOARD),
new ComparableStack(ModItems.crystal_diamond, 8),
new ComparableStack(ModBlocks.glass_quartz, 8)));
this.register(new GenericRecipe("ass.satelliteresonator").setup(600, 100).outputItems(new ItemStack(ModItems.sat_head_resonator, 1))
.inputItems(new OreDictStack(STEEL.plateCast(), 6),
new OreDictStack(STAR.ingot(), 12),
new OreDictStack(ANY_PLASTIC.ingot(), 48),
new ComparableStack(ModItems.crystal_xen, 1),
new ComparableStack(ModItems.circuit, 16, EnumCircuitType.ADVANCED)));
this.register(new GenericRecipe("ass.satelliterelay").setup(600, 100).outputItems(new ItemStack(ModItems.sat_foeq, 1))
.inputItems(new OreDictStack(TI.shell(), 3),
new ComparableStack(ModItems.plate_desh, 8),
new ComparableStack(ModItems.fluid_barrel_full, 1, Fluids.HYDROGEN.getID()),
new ComparableStack(ModItems.photo_panel, 16),
new ComparableStack(ModItems.thruster_nuclear, 1),
new ComparableStack(ModItems.ingot_uranium_fuel, 6),
new ComparableStack(ModItems.circuit, 24, EnumCircuitType.BASIC),
new ComparableStack(ModItems.magnetron, 3),
new ComparableStack(ModItems.battery_pack, 1, EnumBatteryPack.BATTERY_LITHIUM)));
this.register(new GenericRecipe("ass.satelliteasteroidminer").setup(600, 100).outputItems(new ItemStack(ModItems.sat_miner, 1))
.inputItems(new OreDictStack(BIGMT.plate(), 24),
new ComparableStack(ModItems.motor_desh, 2),
new ComparableStack(ModItems.drill_titanium, 2),
new ComparableStack(ModItems.circuit, 12, EnumCircuitType.ADVANCED),
new ComparableStack(ModItems.fluid_barrel_full, 1, Fluids.KEROSENE.getID()),
new ComparableStack(ModItems.thruster_small, 1),
new ComparableStack(ModItems.photo_panel, 12),
new ComparableStack(ModItems.centrifuge_element, 4),
new ComparableStack(ModItems.battery_pack, 1, EnumBatteryPack.BATTERY_LITHIUM)));
this.register(new GenericRecipe("ass.satellitelunarminer").setup(600, 100).outputItems(new ItemStack(ModItems.sat_lunar_miner, 1))
.inputItems(new ComparableStack(ModItems.ingot_meteorite, 4),
new ComparableStack(ModItems.plate_desh, 4),
new ComparableStack(ModItems.motor, 2),
new ComparableStack(ModItems.drill_titanium, 2),
new ComparableStack(ModItems.circuit, 8, EnumCircuitType.ADVANCED),
new ComparableStack(ModItems.fluid_barrel_full, 1, Fluids.KEROSENE.getID()),
new ComparableStack(ModItems.thruster_small, 1),
new ComparableStack(ModItems.photo_panel, 12),
new ComparableStack(ModItems.battery_pack, 1, EnumBatteryPack.BATTERY_LITHIUM)));
this.register(new GenericRecipe("ass.nitra").setupNamed(200, 500)
.inputItems(new ComparableStack(ModItems.nitra))

View File

@ -71,7 +71,7 @@ public class PUREXRecipes extends GenericRecipes<PUREXRecipe> {
.inputItems(new ComparableStack(ModItems.pile_rod, 1, EnumPileRod.RGP))
.inputFluids(new FluidStack(Fluids.SULFURIC_ACID, 100))
.outputItems(new ItemStack(ModItems.billet_pu_mix, 2),
new ItemStack(ModItems.billet_uranium, 1))
new ItemStack(ModItems.billet_nuclear_waste, 1))
.setIconToFirstIngredient());
this.register((PUREXRecipe) new PUREXRecipe("purex.pilewaste").setup(40, pilePower).setNameWrapper("purex.recycle").setGroup(autoPile, this)
.inputItems(new ComparableStack(ModItems.pile_rod, 1, EnumPileRod.WASTE))

View File

@ -147,6 +147,16 @@ public class SolderingRecipes extends SerializableRecipe {
new OreDictStack(PB.wireFine(), 32)}
));
}
recipes.add(new SolderingRecipe(new ItemStack(ModItems.sat_chip), 100, 100,
new AStack[] {
new ComparableStack(ModItems.circuit, 8, EnumCircuitType.CHIP),
new ComparableStack(ModItems.circuit, 2, EnumCircuitType.CAPACITOR)},
new AStack[] {
new ComparableStack(ModItems.circuit, 2, EnumCircuitType.PCB)},
new AStack[] {
new OreDictStack(PB.wireFine(), 4)}
));
/*
* UPGRADES

View File

@ -862,14 +862,6 @@ public class AnvilRecipes extends SerializableRecipe {
new OreDictStack(U.billet(), 3), new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModItems.pile_rod, 1, EnumPileRod.NU.ordinal())),
}).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new OreDictStack(PU239.billet(), 3), new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModItems.pile_rod, 1, EnumPileRod.PU239.ordinal())),
}).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new OreDictStack(PURG.billet(), 3), new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModItems.pile_rod, 1, EnumPileRod.RGP.ordinal())),
}).setTier(2));
//RBMK
constructionRecipes.add(new AnvilConstructionRecipe(

View File

@ -335,7 +335,6 @@ public class ModItems {
public static Item plate_desh;
public static Item plate_bismuth;
public static Item photo_panel;
public static Item sat_base;
public static Item thruster_nuclear;
public static Item safety_fuse;
public static Item part_generic;
@ -631,12 +630,6 @@ public class ModItems {
public static Item thruster_medium;
public static Item thruster_large;
public static Item sat_head_mapper;
public static Item sat_head_scanner;
public static Item sat_head_radar;
public static Item sat_head_laser;
public static Item sat_head_resonator;
public static Item seg_10;
public static Item seg_15;
public static Item seg_20;
@ -1334,17 +1327,17 @@ public class ModItems {
public static Item missile_soyuz;
public static Item missile_soyuz_lander;
public static Item sat_mapper;
public static Item sat_scanner;
public static Item sat_radar;
public static Item sat_laser;
public static Item sat_foeq;
public static Item sat_resonator;
public static Item sat_miner;
public static Item sat_lunar_miner;
public static Item satellite;
@Deprecated public static Item sat_mapper;
@Deprecated public static Item sat_scanner;
@Deprecated public static Item sat_radar;
@Deprecated public static Item sat_laser;
@Deprecated public static Item sat_foeq;
@Deprecated public static Item sat_resonator;
@Deprecated public static Item sat_miner;
@Deprecated public static Item sat_lunar_miner;
public static Item sat_gerald;
public static Item sat_chip;
public static Item sat_interface;
public static Item sat_coord;
public static Item sat_designator;
public static Item sat_relay;
@ -2191,7 +2184,6 @@ public class ModItems {
ingot_solinium = new Item().setUnlocalizedName("ingot_solinium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_solinium");
nugget_solinium = new Item().setUnlocalizedName("nugget_solinium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_solinium");
photo_panel = new Item().setUnlocalizedName("photo_panel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":photo_panel");
sat_base = new Item().setUnlocalizedName("sat_base").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":sat_base");
thruster_nuclear = new Item().setUnlocalizedName("thruster_nuclear").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":thruster_nuclear");
safety_fuse = new Item().setUnlocalizedName("safety_fuse").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":safety_fuse");
part_generic = new ItemGenericPart().setUnlocalizedName("part_generic").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":part_generic");
@ -2623,12 +2615,6 @@ public class ModItems {
thruster_medium = new Item().setUnlocalizedName("thruster_medium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":thruster_medium");
thruster_large = new Item().setUnlocalizedName("thruster_large").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":thruster_large");
sat_head_mapper = new Item().setUnlocalizedName("sat_head_mapper").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":sat_head_mapper");
sat_head_scanner = new Item().setUnlocalizedName("sat_head_scanner").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":sat_head_scanner");
sat_head_radar = new Item().setUnlocalizedName("sat_head_radar").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":sat_head_radar");
sat_head_laser = new Item().setUnlocalizedName("sat_head_laser").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":sat_head_laser");
sat_head_resonator = new Item().setUnlocalizedName("sat_head_resonator").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":sat_head_resonator");
seg_10 = new Item().setUnlocalizedName("seg_10").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":seg_10");
seg_15 = new Item().setUnlocalizedName("seg_15").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":seg_15");
seg_20 = new Item().setUnlocalizedName("seg_20").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":seg_20");
@ -3428,23 +3414,23 @@ public class ModItems {
missile_soyuz = new ItemSoyuz().setUnlocalizedName("missile_soyuz").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":soyuz");
missile_soyuz_lander = new ItemCustomLore().setUnlocalizedName("missile_soyuz_lander").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":soyuz_lander");
missile_custom = new ItemCustomMissile().setUnlocalizedName("missile_custom").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":missile_custom");
sat_mapper = new ItemSatChip().setUnlocalizedName("sat_mapper").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_mapper");
sat_scanner = new ItemSatChip().setUnlocalizedName("sat_scanner").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_scanner");
sat_radar = new ItemSatChip().setUnlocalizedName("sat_radar").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_radar");
sat_laser = new ItemSatChip().setUnlocalizedName("sat_laser").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_laser");
sat_foeq = new ItemSatChip().setUnlocalizedName("sat_foeq").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_foeq");
sat_resonator = new ItemSatChip().setUnlocalizedName("sat_resonator").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_resonator");
sat_miner = new ItemSatChip().setUnlocalizedName("sat_miner").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_miner");
sat_lunar_miner = new ItemSatChip().setUnlocalizedName("sat_lunar_miner").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_lunar_miner");
satellite = new ItemSatellite().setUnlocalizedName("satellite").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":satellite");
sat_mapper = new ItemSatChip().setUnlocalizedName("sat_mapper").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":sat_mapper");
sat_scanner = new ItemSatChip().setUnlocalizedName("sat_scanner").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":sat_scanner");
sat_radar = new ItemSatChip().setUnlocalizedName("sat_radar").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":sat_radar");
sat_laser = new ItemSatChip().setUnlocalizedName("sat_laser").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":sat_laser");
sat_foeq = new ItemSatChip().setUnlocalizedName("sat_foeq").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":sat_foeq");
sat_resonator = new ItemSatChip().setUnlocalizedName("sat_resonator").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":sat_resonator");
sat_miner = new ItemSatChip().setUnlocalizedName("sat_miner").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":sat_miner");
sat_lunar_miner = new ItemSatChip().setUnlocalizedName("sat_lunar_miner").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":sat_lunar_miner");
sat_gerald = new ItemSatChip().setUnlocalizedName("sat_gerald").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_gerald");
sat_chip = new ItemSatChip().setUnlocalizedName("sat_chip").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_chip");
sat_interface = new ItemSatInterface().setUnlocalizedName("sat_interface").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_interface");
sat_coord = new ItemSatInterface().setUnlocalizedName("sat_coord").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_coord");
sat_designator = new ItemSatDesignator().setUnlocalizedName("sat_designator").setFull3D().setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_designator");
sat_relay = new ItemSatChip().setUnlocalizedName("sat_relay").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":sat_relay");
mp_thruster_10_kerosene = new ItemCustomMissilePart().makeThruster(FuelType.KEROSENE, 1F, 1.5F, PartSize.SIZE_10).setHealth(10F) .setUnlocalizedName("mp_thruster_10_kerosene");
mp_thruster_10_solid = new ItemCustomMissilePart().makeThruster(FuelType.SOLID, 1F, 1.5F, PartSize.SIZE_10).setHealth(15F) .setUnlocalizedName("mp_thruster_10_solid");
mp_thruster_10_solid = new ItemCustomMissilePart().makeThruster(FuelType.SOLID, 1F, 1.5F, PartSize.SIZE_10).setHealth(15F) .setUnlocalizedName("mp_thruster_10_solid");
mp_thruster_10_xenon = new ItemCustomMissilePart().makeThruster(FuelType.XENON, 1F, 1.5F, PartSize.SIZE_10).setHealth(5F) .setUnlocalizedName("mp_thruster_10_xenon");
mp_thruster_15_kerosene = new ItemCustomMissilePart().makeThruster(FuelType.KEROSENE, 1F, 7.5F, PartSize.SIZE_15).setHealth(15F) .setUnlocalizedName("mp_thruster_15_kerosene");
mp_thruster_15_kerosene_dual = new ItemCustomMissilePart().makeThruster(FuelType.KEROSENE, 1F, 2.5F, PartSize.SIZE_15).setHealth(15F) .setUnlocalizedName("mp_thruster_15_kerosene_dual");
@ -3454,21 +3440,21 @@ public class ModItems {
mp_thruster_15_hydrogen = new ItemCustomMissilePart().makeThruster(FuelType.HYDROGEN, 1F, 7.5F, PartSize.SIZE_15).setHealth(20F) .setUnlocalizedName("mp_thruster_15_hydrogen");
mp_thruster_15_hydrogen_dual = new ItemCustomMissilePart().makeThruster(FuelType.HYDROGEN, 1F, 2.5F, PartSize.SIZE_15).setHealth(15F) .setUnlocalizedName("mp_thruster_15_hydrogen_dual");
mp_thruster_15_balefire_short = new ItemCustomMissilePart().makeThruster(FuelType.BALEFIRE, 1F, 5F, PartSize.SIZE_15).setHealth(25F) .setUnlocalizedName("mp_thruster_15_balefire_short");
mp_thruster_15_balefire = new ItemCustomMissilePart().makeThruster(FuelType.BALEFIRE, 1F, 5F, PartSize.SIZE_15).setHealth(25F) .setUnlocalizedName("mp_thruster_15_balefire");
mp_thruster_15_balefire_large = new ItemCustomMissilePart().makeThruster(FuelType.BALEFIRE, 1F, 7.5F, PartSize.SIZE_15).setHealth(35F) .setUnlocalizedName("mp_thruster_15_balefire_large");
mp_thruster_15_balefire = new ItemCustomMissilePart().makeThruster(FuelType.BALEFIRE, 1F, 5F, PartSize.SIZE_15).setHealth(25F) .setUnlocalizedName("mp_thruster_15_balefire");
mp_thruster_15_balefire_large = new ItemCustomMissilePart().makeThruster(FuelType.BALEFIRE, 1F, 7.5F, PartSize.SIZE_15).setHealth(35F) .setUnlocalizedName("mp_thruster_15_balefire_large");
mp_thruster_15_balefire_large_rad = new ItemCustomMissilePart().makeThruster(FuelType.BALEFIRE, 1F, 7.5F, PartSize.SIZE_15).setAuthor("The Master").setHealth(35F).setRarity(Rarity.UNCOMMON).setUnlocalizedName("mp_thruster_15_balefire_large_rad");
mp_thruster_20_kerosene = new ItemCustomMissilePart().makeThruster(FuelType.KEROSENE, 1F, 100F, PartSize.SIZE_20).setHealth(30F) .setUnlocalizedName("mp_thruster_20_kerosene");
mp_thruster_20_kerosene_dual = new ItemCustomMissilePart().makeThruster(FuelType.KEROSENE, 1F, 100F, PartSize.SIZE_20).setHealth(30F) .setUnlocalizedName("mp_thruster_20_kerosene_dual");
mp_thruster_20_kerosene_triple = new ItemCustomMissilePart().makeThruster(FuelType.KEROSENE, 1F, 100F, PartSize.SIZE_20).setHealth(30F) .setUnlocalizedName("mp_thruster_20_kerosene_triple");
mp_thruster_20_kerosene_triple = new ItemCustomMissilePart().makeThruster(FuelType.KEROSENE, 1F, 100F, PartSize.SIZE_20).setHealth(30F) .setUnlocalizedName("mp_thruster_20_kerosene_triple");
mp_thruster_20_solid = new ItemCustomMissilePart().makeThruster(FuelType.SOLID, 1F, 100F, PartSize.SIZE_20).setHealth(35F).setWittyText("It's basically just a big hole at the end of the fuel tank.").setUnlocalizedName("mp_thruster_20_solid");
mp_thruster_20_solid_multi = new ItemCustomMissilePart().makeThruster(FuelType.SOLID, 1F, 100F, PartSize.SIZE_20).setHealth(35F) .setUnlocalizedName("mp_thruster_20_solid_multi");
mp_thruster_20_solid_multier = new ItemCustomMissilePart().makeThruster(FuelType.SOLID, 1F, 100F, PartSize.SIZE_20).setHealth(35F).setWittyText("Did I miscount? Hope not.").setUnlocalizedName("mp_thruster_20_solid_multier");
mp_stability_10_flat = new ItemCustomMissilePart().makeStability(0.5F, PartSize.SIZE_10).setHealth(10F) .setUnlocalizedName("mp_stability_10_flat");
mp_stability_10_flat = new ItemCustomMissilePart().makeStability(0.5F, PartSize.SIZE_10).setHealth(10F) .setUnlocalizedName("mp_stability_10_flat");
mp_stability_10_cruise = new ItemCustomMissilePart().makeStability(0.25F, PartSize.SIZE_10).setHealth(5F) .setUnlocalizedName("mp_stability_10_cruise");
mp_stability_10_space = new ItemCustomMissilePart().makeStability(0.35F, PartSize.SIZE_10).setHealth(5F).setRarity(Rarity.COMMON).setWittyText("Standing there alone, the ship is waiting / All systems are go, are you sure?") .setUnlocalizedName("mp_stability_10_space");
mp_stability_15_flat = new ItemCustomMissilePart().makeStability(0.5F, PartSize.SIZE_15).setHealth(10F) .setUnlocalizedName("mp_stability_15_flat");
mp_stability_15_thin = new ItemCustomMissilePart().makeStability(0.35F, PartSize.SIZE_15).setHealth(5F) .setUnlocalizedName("mp_stability_15_thin");
mp_stability_15_flat = new ItemCustomMissilePart().makeStability(0.5F, PartSize.SIZE_15).setHealth(10F) .setUnlocalizedName("mp_stability_15_flat");
mp_stability_15_thin = new ItemCustomMissilePart().makeStability(0.35F, PartSize.SIZE_15).setHealth(5F) .setUnlocalizedName("mp_stability_15_thin");
mp_stability_15_soyuz = new ItemCustomMissilePart().makeStability(0.25F, PartSize.SIZE_15).setHealth(15F).setRarity(Rarity.COMMON).setWittyText("Союз!").setUnlocalizedName("mp_stability_15_soyuz");
mp_stability_20_flat = new ItemCustomMissilePart().makeStability(0.5F, PartSize.SIZE_20) .setUnlocalizedName("mp_s_20");
@ -4998,12 +4984,6 @@ public class ModItems {
GameRegistry.registerItem(thruster_medium, thruster_medium.getUnlocalizedName());
GameRegistry.registerItem(thruster_large, thruster_large.getUnlocalizedName());
GameRegistry.registerItem(thruster_nuclear, thruster_nuclear.getUnlocalizedName());
GameRegistry.registerItem(sat_base, sat_base.getUnlocalizedName());
GameRegistry.registerItem(sat_head_mapper, sat_head_mapper.getUnlocalizedName());
GameRegistry.registerItem(sat_head_scanner, sat_head_scanner.getUnlocalizedName());
GameRegistry.registerItem(sat_head_radar, sat_head_radar.getUnlocalizedName());
GameRegistry.registerItem(sat_head_laser, sat_head_laser.getUnlocalizedName());
GameRegistry.registerItem(sat_head_resonator, sat_head_resonator.getUnlocalizedName());
GameRegistry.registerItem(seg_10, seg_10.getUnlocalizedName());
GameRegistry.registerItem(seg_15, seg_15.getUnlocalizedName());
GameRegistry.registerItem(seg_20, seg_20.getUnlocalizedName());
@ -5708,6 +5688,7 @@ public class ModItems {
GameRegistry.registerItem(mp_chip_5, mp_chip_5.getUnlocalizedName());
//Satellites
GameRegistry.registerItem(satellite, satellite.getUnlocalizedName());
GameRegistry.registerItem(sat_mapper, sat_mapper.getUnlocalizedName());
GameRegistry.registerItem(sat_scanner, sat_scanner.getUnlocalizedName());
GameRegistry.registerItem(sat_radar, sat_radar.getUnlocalizedName());
@ -5718,7 +5699,6 @@ public class ModItems {
GameRegistry.registerItem(sat_lunar_miner, sat_lunar_miner.getUnlocalizedName());
GameRegistry.registerItem(sat_gerald, sat_gerald.getUnlocalizedName());
GameRegistry.registerItem(sat_chip, sat_chip.getUnlocalizedName());
GameRegistry.registerItem(sat_interface, sat_interface.getUnlocalizedName());
GameRegistry.registerItem(sat_coord, sat_coord.getUnlocalizedName());
GameRegistry.registerItem(sat_designator, sat_designator.getUnlocalizedName());
GameRegistry.registerItem(sat_relay, sat_relay.getUnlocalizedName());

View File

@ -8,7 +8,7 @@ import com.hbm.handler.threading.PacketThreading;
import com.hbm.items.ISatChip;
import com.hbm.packet.toclient.AuxParticlePacketNT;
import com.hbm.saveddata.SatelliteSavedData;
import com.hbm.saveddata.satellites.Satellite;
import com.hbm.saveddata.satellites.SatelliteBase;
import com.hbm.saveddata.satellites.SatelliteScanner;
import net.minecraft.block.Block;
@ -53,7 +53,7 @@ public class ItemModLens extends ItemArmorMod implements ISatChip {
if(lens == null) return;
int freq = this.getFreq(lens);
Satellite sat = SatelliteSavedData.getData(world).getSatFromFreq(freq);
SatelliteBase sat = SatelliteSavedData.getData(world).getSatFromFreq(freq);
if(!(sat instanceof SatelliteScanner)) return;
int x = (int) Math.floor(player.posX);

View File

@ -0,0 +1,34 @@
package com.hbm.items.special;
import java.util.List;
import com.hbm.items.ISatChip;
import com.hbm.items.ItemEnumMulti;
import com.hbm.util.i18n.I18nUtil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
public class ItemSatellite extends ItemEnumMulti implements ISatChip {
public ItemSatellite() {
super(EnumSatType.class, true, true);
}
public static enum EnumSatType {
SPY,
SCANNER,
RADAR,
MINER_ASTRO,
MINER_LUNAR,
PRECISION_LASER,
DEATH_RAY,
XENIUM_RESONATOR,
RELAY
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
list.add(I18nUtil.resolveKey("satchip.frequency") + ": " + getFreq(stack));
}
}

View File

@ -3,8 +3,7 @@ package com.hbm.items.tool;
import com.hbm.items.machine.ItemSatChip;
import com.hbm.lib.Library;
import com.hbm.saveddata.SatelliteSavedData;
import com.hbm.saveddata.satellites.Satellite;
import com.hbm.saveddata.satellites.Satellite.Interfaces;
import com.hbm.saveddata.satellites.SatelliteBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@ -19,7 +18,7 @@ public class ItemSatDesignator extends ItemSatChip {
if(!world.isRemote) {
Satellite sat = SatelliteSavedData.getData(world).getSatFromFreq(this.getFreq(stack));
SatelliteBase sat = SatelliteSavedData.getData(world).getSatFromFreq(this.getFreq(stack));
if(sat != null) {
MovingObjectPosition pos = Library.rayTrace(player, 300, 1);
@ -29,11 +28,7 @@ public class ItemSatDesignator extends ItemSatChip {
int y = pos.blockY + dir.offsetY;
int z = pos.blockZ + dir.offsetZ;
if(sat.satIface == Interfaces.SAT_COORD) {
sat.onCoordAction(world, player, x, y, z);
} else if(sat.satIface == Interfaces.SAT_PANEL) {
sat.onClick(world, x, z);
}
sat.onCoordAction(world, player, x, y, z);
}
}

View File

@ -1,14 +1,12 @@
package com.hbm.items.tool;
import com.hbm.inventory.gui.GUIScreenSatCoord;
import com.hbm.inventory.gui.GUIScreenSatInterface;
import com.hbm.items.IItemControlReceiver;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemSatChip;
import com.hbm.main.MainRegistry;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toclient.SatPanelPacket;
import com.hbm.saveddata.SatelliteSavedData;
import com.hbm.saveddata.satellites.Satellite;
import com.hbm.saveddata.satellites.SatelliteBase;
import com.hbm.tileentity.IGUIProvider;
import cpw.mods.fml.relauncher.Side;
@ -18,53 +16,44 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class ItemSatInterface extends ItemSatChip implements IGUIProvider {
public class ItemSatInterface extends ItemSatChip implements IGUIProvider, IItemControlReceiver {
@SideOnly(Side.CLIENT)
public static Satellite currentSat;
public static final String KEY_NBT_CONNECTED = "connected";
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if(world.isRemote) {
player.openGui(MainRegistry.instance, 0, world, 0, 0, 0);
}
if(world.isRemote) player.openGui(MainRegistry.instance, 0, world, 0, 0, 0);
return stack;
}
public void onUpdate(ItemStack stack, World world, Entity entity, int i, boolean b) {
if(world.isRemote || !(entity instanceof EntityPlayerMP))
return;
if(((EntityPlayerMP)entity).getHeldItem() != stack)
return;
Satellite sat = SatelliteSavedData.getData(world).getSatFromFreq(this.getFreq(stack));
if(sat != null && entity.ticksExisted % 2 == 0) {
PacketDispatcher.wrapper.sendTo(new SatPanelPacket(sat), (EntityPlayerMP) entity); //making this one sat that is static might not have been a good idea
}
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return null;
public void onUpdate(ItemStack stack, World world, Entity entity, int i, boolean b) {
if(world.isRemote || !(entity instanceof EntityPlayerMP))
return;
if(((EntityPlayerMP) entity).getHeldItem() != stack)
return;
SatelliteBase sat = SatelliteSavedData.getData(world).getSatFromFreq(this.getFreq(stack));
if(!stack.hasTagCompound()) stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setBoolean(KEY_NBT_CONNECTED, sat != null);
}
@Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return null; }
@Override
@SideOnly(Side.CLIENT)
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
if(this == ModItems.sat_interface)
return new GUIScreenSatInterface(player);
else if(this == ModItems.sat_coord)
return new GUIScreenSatCoord(player);
if(this == ModItems.sat_coord) return new GUIScreenSatCoord(player);
return null;
}
@Override
public void receiveControl(ItemStack stack, NBTTagCompound data) {
}
}

View File

@ -692,6 +692,7 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityRagingVortex.class, new RenderBlackHole());
RenderingRegistry.registerEntityRenderingHandler(EntityQuasar.class, new RenderQuasar());
RenderingRegistry.registerEntityRenderingHandler(EntityDeathBlast.class, new RenderDeathBlast());
RenderingRegistry.registerEntityRenderingHandler(EntityOrbitalLaser.class, new RenderOrbitalLaser());
RenderingRegistry.registerEntityRenderingHandler(EntitySpear.class, new RenderSpear());
RenderingRegistry.registerEntityRenderingHandler(EntityNukeTorex.class, new RenderTorex());
//minecarts

View File

@ -593,12 +593,10 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModItems.ams_core_wormhole, 1), new Object[] { "DPD", "PSP", "DPD", 'D', ModItems.plate_dineutronium, 'P', ModItems.powder_spark_mix, 'S', ModItems.singularity });
addRecipeAuto(new ItemStack(ModItems.ams_core_eyeofharmony, 1), new Object[] { "ALA", "LSL", "ALA", 'A', ModItems.plate_dalekanium, 'L', new ItemStack(ModItems.fluid_barrel_full, 1, Fluids.LAVA.getID()), 'S', ModItems.black_hole });
addRecipeAuto(new ItemStack(ModItems.ams_core_thingy), new Object[] { "NSN", "NGN", "G G", 'N', GOLD.nugget(), 'G', GOLD.ingot(), 'S', new ItemStack(ModItems.battery_pack, 1, EnumBatteryPack.BATTERY_QUANTUM.ordinal()) });
addRecipeAuto(new ItemStack(ModItems.photo_panel), new Object[] { " G ", "IPI", " C ", 'G', KEY_ANYPANE, 'I', ModItems.plate_polymer, 'P', NETHERQUARTZ.dust(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.PCB) });
addRecipeAuto(new ItemStack(ModBlocks.machine_satlinker), new Object[] { "PSP", "SCS", "PSP", 'P', STEEL.plate(), 'S', STAR.ingot(), 'C', ModItems.sat_chip });
addRecipeAuto(new ItemStack(ModItems.photo_panel), new Object[] { " G ", "IPI", " C ", 'G', KEY_ANYPANE, 'I', ModItems.plate_polymer, 'P', SI.billet(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.PCB) });
addRecipeAuto(new ItemStack(ModBlocks.machine_satlinker), new Object[] { "PSP", "SCS", "PSP", 'P', ANY_RESISTANTALLOY.ingot(), 'S', ANY_PLASTIC.ingot(), 'C', ModItems.sat_chip });
addRecipeAuto(new ItemStack(ModBlocks.machine_keyforge), new Object[] { "PCP", "WSW", "WSW", 'P', STEEL.plate(), 'S', W.ingot(), 'C', ModItems.padlock, 'W', KEY_PLANKS });
addRecipeAuto(new ItemStack(ModItems.sat_chip), new Object[] { "WWW", "CIC", "WWW", 'W', MINGRADE.wireFine(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'I', ANY_PLASTIC.ingot() });
addShapelessAuto(new ItemStack(ModItems.geiger_counter), new Object[] { ModBlocks.geiger });
addRecipeAuto(new ItemStack(ModItems.sat_interface), new Object[] { "ISI", "PCP", "PAP", 'I', STEEL.ingot(), 'S', STAR.ingot(), 'P', ModItems.plate_polymer, 'C', ModItems.sat_chip, 'A', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED) });
addRecipeAuto(new ItemStack(ModItems.sat_coord), new Object[] { "SII", "SCA", "SPP", 'I', STEEL.ingot(), 'S', STAR.ingot(), 'P', ModItems.plate_polymer, 'C', ModItems.sat_chip, 'A', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED) });
addRecipeAuto(new ItemStack(ModBlocks.machine_transformer), new Object[] { "SCS", "MDM", "SCS", 'S', IRON.ingot(), 'D', MINGRADE.ingot(), 'M',ModItems.coil_copper, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CAPACITOR) });
addRecipeAuto(new ItemStack(ModBlocks.radiobox), new Object[] { "PLP", "PSP", "PLP", 'P', STEEL.plate(), 'S', ModItems.ring_starmetal, 'C', ModItems.fusion_core, 'L', DURA.plate() });

View File

@ -34,7 +34,7 @@ import com.hbm.lib.HbmWorld;
import com.hbm.lib.RefStrings;
import com.hbm.packet.PacketDispatcher;
import com.hbm.potion.HbmPotion;
import com.hbm.saveddata.satellites.Satellite;
import com.hbm.saveddata.satellites.XSatelliteRegistry;
import com.hbm.tileentity.TileMappings;
import com.hbm.tileentity.bomb.TileEntityLaunchPadBase;
import com.hbm.tileentity.bomb.TileEntityNukeCustom;
@ -271,7 +271,7 @@ public class MainRegistry {
GameRegistry.registerFuelHandler(new FuelHandler());
BulletConfigSyncingUtil.loadConfigsForSync();
CellularDungeonFactory.init();
Satellite.register();
XSatelliteRegistry.register();
HTTPHandler.loadStats();
CraftingManager.mainRegistry();
SiegeTier.registerTiers();
@ -1637,6 +1637,13 @@ public class MainRegistry {
ignoreMappings.add("hbm:item.drax");
ignoreMappings.add("hbm:item.drax_mk2");
ignoreMappings.add("hbm:item.drax_mk3");
ignoreMappings.add("hbm:item.sat_base");
ignoreMappings.add("hbm:item.sat_head_mapper");
ignoreMappings.add("hbm:item.sat_head_scanner");
ignoreMappings.add("hbm:item.sat_head_radar");
ignoreMappings.add("hbm:item.sat_head_laser");
ignoreMappings.add("hbm:item.sat_head_resonator");
ignoreMappings.add("hbm:item.sat_interface");
/// REMAP ///
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);

View File

@ -19,14 +19,10 @@ public class PacketDispatcher {
wrapper.registerMessage(TESirenPacket.Handler.class, TESirenPacket.class, i++, Side.CLIENT);
//Signals server to change ItemStacks
wrapper.registerMessage(ItemDesignatorPacket.Handler.class, ItemDesignatorPacket.class, i++, Side.SERVER);
//Signals server to perform orbital strike, among other things
wrapper.registerMessage(SatLaserPacket.Handler.class, SatLaserPacket.class, i++, Side.SERVER);
//Universal package for sending small info packs back to server
wrapper.registerMessage(AuxButtonPacket.Handler.class, AuxButtonPacket.class, i++, Side.SERVER);
//Siren packet for looped sounds
wrapper.registerMessage(TEVaultPacket.Handler.class, TEVaultPacket.class, i++, Side.CLIENT);
//Packet to send sat info to players
wrapper.registerMessage(SatPanelPacket.Handler.class, SatPanelPacket.class, i++, Side.CLIENT);
//Packet to send block break particles
wrapper.registerMessage(ParticleBurstPacket.Handler.class, ParticleBurstPacket.class, i++, Side.CLIENT);
//Packet to send chunk radiation info to individual players
@ -39,8 +35,6 @@ public class PacketDispatcher {
wrapper.registerMessage(TEMissileMultipartPacket.Handler.class, TEMissileMultipartPacket.class, i++, Side.CLIENT);
//Aux Particle Packet, New Technology: like the APP but with NBT
wrapper.registerMessage(AuxParticlePacketNT.Handler.class, AuxParticlePacketNT.class, i++, Side.CLIENT);
//Signals server to do coord based satellite stuff
wrapper.registerMessage(SatCoordPacket.Handler.class, SatCoordPacket.class, i++, Side.SERVER);
//Triggers gun animations of the client
wrapper.registerMessage(HbmAnimationPacket.Handler.class, HbmAnimationPacket.class, i++, Side.CLIENT);
//Sends a funi text to display like a music disc announcement

View File

@ -1,88 +0,0 @@
package com.hbm.packet.toclient;
import java.io.IOException;
import com.hbm.items.tool.ItemSatInterface;
import com.hbm.saveddata.satellites.Satellite;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.client.Minecraft;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.PacketBuffer;
public class SatPanelPacket implements IMessage {
PacketBuffer buffer;
int type;
public SatPanelPacket() {
}
public SatPanelPacket(Satellite sat) {
type = sat.getID();
this.buffer = new PacketBuffer(Unpooled.buffer());
NBTTagCompound nbt = new NBTTagCompound();
sat.writeToNBT(nbt);
try {
buffer.writeNBTTagCompoundToBuffer(nbt);
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public void fromBytes(ByteBuf buf) {
type = buf.readInt();
if (buffer == null) {
buffer = new PacketBuffer(Unpooled.buffer());
}
buffer.writeBytes(buf);
}
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(type);
if (buffer == null) {
buffer = new PacketBuffer(Unpooled.buffer());
}
buf.writeBytes(buffer);
}
public static class Handler implements IMessageHandler<SatPanelPacket, IMessage> {
@Override
@SideOnly(Side.CLIENT)
public IMessage onMessage(SatPanelPacket m, MessageContext ctx) {
Minecraft.getMinecraft();
try {
NBTTagCompound nbt = m.buffer.readNBTTagCompoundFromBuffer();
ItemSatInterface.currentSat = Satellite.create(m.type);
if(nbt != null)
ItemSatInterface.currentSat.readFromNBT(nbt);
} catch (Exception x) {
} finally {
m.buffer.release();
}
return null;
}
}
}

View File

@ -1,72 +0,0 @@
package com.hbm.packet.toserver;
import com.hbm.items.ISatChip;
import com.hbm.items.tool.ItemSatInterface;
import com.hbm.saveddata.SatelliteSavedData;
import com.hbm.saveddata.satellites.Satellite;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
public class SatCoordPacket implements IMessage {
int x;
int y;
int z;
int freq;
public SatCoordPacket()
{
}
public SatCoordPacket(int x, int y, int z, int freq)
{
this.x = x;
this.y = y;
this.z = z;
this.freq = freq;
}
@Override
public void fromBytes(ByteBuf buf) {
x = buf.readInt();
y = buf.readInt();
z = buf.readInt();
freq = buf.readInt();
}
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(x);
buf.writeInt(y);
buf.writeInt(z);
buf.writeInt(freq);
}
public static class Handler implements IMessageHandler<SatCoordPacket, IMessage> {
@Override
public IMessage onMessage(SatCoordPacket m, MessageContext ctx) {
EntityPlayer p = ctx.getServerHandler().playerEntity;
if(p.getHeldItem() != null && p.getHeldItem().getItem() instanceof ItemSatInterface) {
int freq = ISatChip.getFreqS(p.getHeldItem());
if(freq == m.freq) {
Satellite sat = SatelliteSavedData.getData(p.worldObj).getSatFromFreq(m.freq);
if(sat != null)
sat.onCoordAction(p.worldObj, p, m.x, m.y, m.z);
}
}
return null;
}
}
}

View File

@ -1,71 +0,0 @@
package com.hbm.packet.toserver;
import com.hbm.items.ISatChip;
import com.hbm.items.tool.ItemSatInterface;
import com.hbm.saveddata.SatelliteSavedData;
import com.hbm.saveddata.satellites.Satellite;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
public class SatLaserPacket implements IMessage {
//0: Add
//1: Subtract
//2: Set
int x;
int z;
int freq;
public SatLaserPacket()
{
}
public SatLaserPacket(int x, int z, int freq)
{
this.x = x;
this.z = z;
this.freq = freq;
}
@Override
public void fromBytes(ByteBuf buf) {
x = buf.readInt();
z = buf.readInt();
freq = buf.readInt();
}
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(x);
buf.writeInt(z);
buf.writeInt(freq);
}
public static class Handler implements IMessageHandler<SatLaserPacket, IMessage> {
@Override
public IMessage onMessage(SatLaserPacket m, MessageContext ctx) {
EntityPlayer p = ctx.getServerHandler().playerEntity;
if(p.getHeldItem() != null && p.getHeldItem().getItem() instanceof ItemSatInterface) {
int freq = ISatChip.getFreqS(p.getHeldItem());
if(freq == m.freq) {
Satellite sat = SatelliteSavedData.getData(p.worldObj).getSatFromFreq(m.freq);
if(sat != null)
sat.onClick(p.worldObj, m.x, m.z);
}
}
return null;
}
}
}

View File

@ -16,110 +16,106 @@ import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
public class RenderDeathBlast extends Render {
private static final IModelCustom sphere = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/Sphere.obj"));
@Override
public void doRender(Entity entity, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
GL11.glPushMatrix();
GL11.glTranslatef((float)x, (float)y, (float)z);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDepthMask(false);
public void doRender(Entity entity, double x, double y, double z, float f0, float interp) {
GL11.glPushMatrix();
//GL11.glRotatef((entity.ticksExisted % 360) * 10, 0, 1, 0);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
//GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glColor3f(1.0F, 0, 0);
Vec3 vector = Vec3.createVectorHelper(0.5D, 0, 0);
Tessellator tessellator = Tessellator.instance;
RenderHelper.disableStandardItemLighting();
for(int i = 0; i < 8; i++) {
tessellator.startDrawing(6);
tessellator.addVertex(vector.xCoord, 250.0D, vector.zCoord);
tessellator.addVertex(vector.xCoord, 0.0D, vector.zCoord);
vector.rotateAroundY(45);
tessellator.addVertex(vector.xCoord, 0.0D, vector.zCoord);
tessellator.addVertex(vector.xCoord, 250.0D, vector.zCoord);
tessellator.draw();
}
GL11.glTranslated(x, y, z);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDepthMask(false);
GL11.glColor3f(1.0F, 0, 1.0F);
for(int i = 0; i < 8; i++) {
tessellator.startDrawing(6);
tessellator.addVertex(vector.xCoord / 2, 250.0D, vector.zCoord / 2);
tessellator.addVertex(vector.xCoord / 2, 0.0D, vector.zCoord / 2);
vector.rotateAroundY(45);
tessellator.addVertex(vector.xCoord / 2, 0.0D, vector.zCoord / 2);
tessellator.addVertex(vector.xCoord / 2, 250.0D, vector.zCoord / 2);
tessellator.draw();
}
GL11.glPopMatrix();
GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glPopMatrix();
renderOrb(entity, x, y, z, p_76986_8_, p_76986_9_);
GL11.glColor3f(0F, 1F, 0F);
Vec3 vector = Vec3.createVectorHelper(0.5D, 0, 0);
Tessellator tessellator = Tessellator.instance;
RenderHelper.disableStandardItemLighting();
for(int i = 0; i < 8; i++) {
tessellator.startDrawing(6);
tessellator.addVertex(vector.xCoord, 250.0D, vector.zCoord);
tessellator.addVertex(vector.xCoord, 0.0D, vector.zCoord);
vector.rotateAroundY(45);
tessellator.addVertex(vector.xCoord, 0.0D, vector.zCoord);
tessellator.addVertex(vector.xCoord, 250.0D, vector.zCoord);
tessellator.draw();
}
GL11.glColor3f(1.0F, 0, 1.0F);
for(int i = 0; i < 8; i++) {
tessellator.startDrawing(6);
tessellator.addVertex(vector.xCoord / 2, 250.0D, vector.zCoord / 2);
tessellator.addVertex(vector.xCoord / 2, 0.0D, vector.zCoord / 2);
vector.rotateAroundY(45);
tessellator.addVertex(vector.xCoord / 2, 0.0D, vector.zCoord / 2);
tessellator.addVertex(vector.xCoord / 2, 250.0D, vector.zCoord / 2);
tessellator.draw();
}
GL11.glPopMatrix();
GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
renderOrb(entity, x, y, z, f0, interp);
}
public void renderOrb(Entity entity, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
public void renderOrb(Entity entity, double x, double y, double z, float f0, float interp) {
GL11.glPushMatrix();
GL11.glTranslatef((float)x, (float)y, (float)z);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glTranslatef((float) x, (float) y, (float) z);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glAlphaFunc(GL11.GL_GEQUAL, 0);
double scale = 10 - 10D * (((double)entity.ticksExisted) / ((double)EntityDeathBlast.maxAge));
double alpha = (((double)entity.ticksExisted) / ((double)EntityDeathBlast.maxAge));
if(scale < 0)
scale = 0;
GL11.glColor4d(1.0, 0, 1.0, alpha);
double scale = 10 - 10D * (((double) entity.ticksExisted + interp) / ((double) EntityDeathBlast.maxAge));
double alpha = (((double) entity.ticksExisted + interp) / ((double) EntityDeathBlast.maxAge));
if(scale < 0) scale = 0;
GL11.glColor4d(0.05, 1.0, 0.05, alpha);
GL11.glEnable(GL11.GL_BLEND);
GL11.glScaled(scale, scale, scale);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
sphere.renderAll();
GL11.glScaled(scale, scale, scale);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
sphere.renderAll();
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glScaled(1.25, 1.25, 1.25);
GL11.glColor4d(0, 1, 0, alpha * 0.125);
for(int i = 0; i < 8; i++) {
sphere.renderAll();
GL11.glScaled(1.05, 1.05, 1.05);
}
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glScaled(1.25, 1.25, 1.25);
GL11.glColor4d(1.0, 0, 0, alpha * 0.125);
for(int i = 0; i < 8; i++) {
sphere.renderAll();
GL11.glScaled(1.05, 1.05, 1.05);
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.1F);
GL11.glColor4d(1.0, 1.0, 1.0, 1.0);
GL11.glPopMatrix();
GL11.glColor4d(1.0, 1.0, 1.0, 1.0);
GL11.glPopMatrix();
}
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return null;
}
}

View File

@ -0,0 +1,70 @@
package com.hbm.render.entity.effect;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
public class RenderOrbitalLaser extends Render {
@Override
public void doRender(Entity entity, double x, double y, double z, float f0, float interp) {
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDepthMask(false);
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glColor3f(1F, 0F, 0F);
Vec3 vector = Vec3.createVectorHelper(0.5D, 0, 0);
Tessellator tessellator = Tessellator.instance;
RenderHelper.disableStandardItemLighting();
for(int i = 0; i < 8; i++) {
tessellator.startDrawing(6);
tessellator.addVertex(vector.xCoord, 250.0D, vector.zCoord);
tessellator.addVertex(vector.xCoord, 0.0D, vector.zCoord);
vector.rotateAroundY(45);
tessellator.addVertex(vector.xCoord, 0.0D, vector.zCoord);
tessellator.addVertex(vector.xCoord, 250.0D, vector.zCoord);
tessellator.draw();
}
for(int i = 0; i < 8; i++) {
tessellator.startDrawing(6);
tessellator.addVertex(vector.xCoord / 2, 250.0D, vector.zCoord / 2);
tessellator.addVertex(vector.xCoord / 2, 0.0D, vector.zCoord / 2);
vector.rotateAroundY(45);
tessellator.addVertex(vector.xCoord / 2, 0.0D, vector.zCoord / 2);
tessellator.addVertex(vector.xCoord / 2, 250.0D, vector.zCoord / 2);
tessellator.draw();
}
GL11.glPopMatrix();
GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return null;
}
}

View File

@ -1,6 +1,7 @@
package com.hbm.saveddata;
import com.hbm.saveddata.satellites.Satellite;
import com.hbm.saveddata.satellites.SatelliteBase;
import com.hbm.saveddata.satellites.XSatelliteRegistry;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraft.world.WorldSavedData;
@ -10,7 +11,7 @@ import java.util.Map.Entry;
public class SatelliteSavedData extends WorldSavedData {
public final HashMap<Integer, Satellite> sats = new HashMap<>();
public final HashMap<Integer, SatelliteBase> sats = new HashMap<>();
/**
* Constructor used for deserialization
@ -28,24 +29,18 @@ public class SatelliteSavedData extends WorldSavedData {
this.markDirty();
}
public boolean isFreqTaken(int freq) {
return getSatFromFreq(freq) != null;
}
public Satellite getSatFromFreq(int freq) {
return sats.get(freq);
}
public boolean isFreqTaken(int freq) { return getSatFromFreq(freq) != null; }
public SatelliteBase getSatFromFreq(int freq) { return sats.get(freq); }
@Override
public void readFromNBT(NBTTagCompound nbt) {
int satCount = nbt.getInteger("satCount");
for(int i = 0; i < satCount; i++) {
Satellite sat = Satellite.create(nbt.getInteger("sat_id_" + i));
SatelliteBase sat = XSatelliteRegistry.createFromId(nbt.getInteger("sat_id_" + i));
sat.readFromNBT((NBTTagCompound) nbt.getTag("sat_data_" + i));
int freq = nbt.getInteger("sat_freq_" + i);
sats.put(freq, sat);
}
}
@ -56,7 +51,7 @@ public class SatelliteSavedData extends WorldSavedData {
int i = 0;
for(Entry<Integer, Satellite> struct : sats.entrySet()) {
for(Entry<Integer, SatelliteBase> struct : sats.entrySet()) {
NBTTagCompound data = new NBTTagCompound();
struct.getValue().writeToNBT(data);
@ -74,7 +69,6 @@ public class SatelliteSavedData extends WorldSavedData {
data = (SatelliteSavedData) worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
}
return data;
}
}

View File

@ -1,129 +0,0 @@
package com.hbm.saveddata.satellites;
import com.hbm.items.ModItems;
import com.hbm.saveddata.SatelliteSavedData;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public abstract class Satellite {
public static final List<Class<? extends Satellite>> satellites = new ArrayList<>();
public static final HashMap<Item, Class<? extends Satellite>> itemToClass = new HashMap<>();
public enum InterfaceActions {
HAS_MAP, //lets the interface display loaded chunks
CAN_CLICK, //enables onClick events
SHOW_COORDS, //enables coordinates as a mouse tooltip
HAS_RADAR, //lets the interface display loaded entities
HAS_ORES //like HAS_MAP but only shows ores
}
public enum CoordActions {
HAS_Y //enables the Y-coord field which is disabled by default
}
public enum Interfaces {
NONE, //does not interact with any sat interface (i.e. asteroid miners)
SAT_PANEL, //allows to interact with the sat interface panel (for graphical applications)
SAT_COORD //allows to interact with the sat coord remote (for teleportation or other coord related actions)
}
public List<InterfaceActions> ifaceAcs = new ArrayList<>();
public List<CoordActions> coordAcs = new ArrayList<>();
public Interfaces satIface = Interfaces.NONE;
public static void register() {
registerSatellite(SatelliteMapper.class, ModItems.sat_mapper);
registerSatellite(SatelliteScanner.class, ModItems.sat_scanner);
registerSatellite(SatelliteRadar.class, ModItems.sat_radar);
registerSatellite(SatelliteLaser.class, ModItems.sat_laser);
registerSatellite(SatelliteResonator.class, ModItems.sat_resonator);
registerSatellite(SatelliteRelay.class, ModItems.sat_foeq);
registerSatellite(SatelliteMiner.class, ModItems.sat_miner);
registerSatellite(SatelliteLunarMiner.class, ModItems.sat_lunar_miner);
registerSatellite(SatelliteHorizons.class, ModItems.sat_gerald);
}
/**
* Register satellite.
* @param sat - Satellite class
* @param item - Satellite item (which will be placed in a rocket)
*/
public static void registerSatellite(Class<? extends Satellite> sat, Item item) {
if(!itemToClass.containsKey(item) && !itemToClass.containsValue(sat)) {
satellites.add(sat);
itemToClass.put(item, sat);
}
}
public static void orbit(World world, int id, int freq, double x, double y, double z) {
if(world.isRemote) {
return;
}
Satellite sat = create(id);
if(sat != null) {
SatelliteSavedData data = SatelliteSavedData.getData(world);
data.sats.put(freq, sat);
sat.onOrbit(world, x, y, z);
data.markDirty();
}
}
public static Satellite create(int id) {
Satellite sat = null;
try {
Class<? extends Satellite> c = satellites.get(id);
sat = c.newInstance();
} catch(Exception e) {
e.printStackTrace();
}
return sat;
}
public static int getIDFromItem(Item item) {
Class<? extends Satellite> sat = itemToClass.get(item);
return satellites.indexOf(sat);
}
public int getID() {
return satellites.indexOf(this.getClass());
}
public void writeToNBT(NBTTagCompound nbt) { }
public void readFromNBT(NBTTagCompound nbt) { }
/**
* Called when the satellite reaches space, used to trigger achievements and other funny stuff.
* @param x posX of the rocket
* @param y ditto
* @param z ditto
*/
public void onOrbit(World world, double x, double y, double z) { }
/**
* Called by the sat interface when clicking on the screen
* @param x the x-coordinate translated from the on-screen coords to actual world coordinates
* @param z ditto
*/
public void onClick(World world, int x, int z) { }
/**
* Called by the coord sat interface
* @param x the specified x-coordinate
* @param y ditto
* @param z ditto
*/
public void onCoordAction(World world, EntityPlayer player, int x, int y, int z) { }
}

View File

@ -0,0 +1,93 @@
package com.hbm.saveddata.satellites;
import com.hbm.tileentity.network.RTTYSystem;
import api.hbm.redstoneoverradio.IRORInteractive;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public abstract class SatelliteBase {
public static final String CHAN_SATLINK = "SAT_LINK";
public static final String CMD_SETTARGET = "settarget";
public static final String CMD_GETTARGET = "gettarget";
public static final String CMD_GETTARGETX = "gettargetx";
public static final String CMD_GETTARGETZ = "gettargetz";
public int range = 1_000;
public int targetX;
public int targetZ;
public String tx = "";
public int getID() {
return XSatelliteRegistry.satellites.indexOf(this.getClass());
}
public abstract String getType();
public void writeToNBT(NBTTagCompound nbt) {
nbt.setInteger("targetX", targetX);
nbt.setInteger("targetZ", targetZ);
nbt.setString("tx", tx);
}
public void readFromNBT(NBTTagCompound nbt) {
this.targetX = nbt.getInteger("targetX");
this.targetZ = nbt.getInteger("targetZ");
this.tx = nbt.getString("tx");
}
public void onOrbit(World world, double x, double y, double z) {
setTarget((int) Math.floor(x), (int) Math.floor(z));
RTTYSystem.broadcast(world, CHAN_SATLINK, "Established connection to " + getType() + " at " + targetX + " / " + targetZ);
}
public void onCommand(World world, String... cmd) {
onCommandTarget(world, cmd);
onCommandImpl(world, cmd);
}
public void onCommandTarget(World world, String... cmd) {
if(cmd.length <= 0) return;
if(cmd[0].equals(CMD_SETTARGET)) {
if(cmd.length == 3) {
targetX = IRORInteractive.parseInt(cmd[1]);
targetZ = IRORInteractive.parseInt(cmd[2]);
}
if(cmd.length == 4) {
targetX = IRORInteractive.parseInt(cmd[1]);
targetZ = IRORInteractive.parseInt(cmd[3]);
}
return;
}
if(cmd[0].equals(CMD_GETTARGET)) {
this.tx = targetX + ";" + targetZ;
return;
}
if(cmd[0].equals(CMD_GETTARGETX)) {
this.tx = "" + targetX;
return;
}
if(cmd[0].equals(CMD_GETTARGETZ)) {
this.tx = "" + targetZ;
return;
}
}
public void setTarget(int x, int z) {
this.targetX = x;
this.targetZ = z;
}
public void onCommandImpl(World world, String... cmd) { }
public void onCoordAction(World world, EntityPlayer player, int x, int y, int z) { }
}

View File

@ -0,0 +1,73 @@
package com.hbm.saveddata.satellites;
import java.util.Locale;
import com.hbm.entity.logic.EntityDeathBlast;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class SatelliteDeathRay extends SatelliteBase {
public static final String CMD_FIRE = "fire";
public static final String CMD_CANFIRE = "canfire";
public static final int CHARGE_TIME = 5 * 60 * 20;
public long lastShot;
public SatelliteDeathRay() { }
@Override public String getType() { return "ORBITAL_FUN_PLATFORM_:)"; }
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setLong("lastShot", lastShot);
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
lastShot = nbt.getLong("lastShot");
}
@Override
public void onCommandImpl(World world, String... cmd) {
if(cmd.length <= 0) return;
if(cmd[0].equals(CMD_FIRE)) {
deathBlast(world, targetX, targetZ);
return;
}
if(cmd[0].equals(CMD_CANFIRE)) {
this.tx = (lastShot + CHARGE_TIME < world.getTotalWorldTime()) + "";
this.tx = this.tx.toUpperCase(Locale.US);
return;
}
}
@Override
public void onCoordAction(World world, EntityPlayer player, int x, int y, int z) {
this.setTarget(x, z);
this.deathBlast(world, targetX, targetZ);
}
public void deathBlast(World world, int x, int z) {
if(lastShot + CHARGE_TIME < world.getTotalWorldTime()) {
lastShot = world.getTotalWorldTime();
int y = world.getHeightValue(x, z);
EntityDeathBlast blast = new EntityDeathBlast(world);
blast.posX = x;
blast.posY = y;
blast.posZ = z;
world.spawnEntityInWorld(blast);
}
}
}

View File

@ -1,5 +1,7 @@
package com.hbm.saveddata.satellites;
import java.util.Locale;
import com.hbm.entity.projectile.EntityTom;
import com.hbm.main.MainRegistry;
import com.hbm.saveddata.SatelliteSavedData;
@ -12,32 +14,59 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
public class SatelliteHorizons extends Satellite {
public class SatelliteHorizons extends SatelliteBase {
public static final String CMD_FIRE = "fire";
public static final String CMD_CANFIRE = "settarget";
boolean used = false;
public SatelliteHorizons() {
this.satIface = Interfaces.SAT_COORD;
}
public SatelliteHorizons() { }
@Override public String getType() { return "PAYLOAD_UNKNOWN"; }
@Override
public void onOrbit(World world, double x, double y, double z) {
super.onOrbit(world, x, y, z);
for(Object p : world.playerEntities)
((EntityPlayer)p).triggerAchievement(MainRegistry.horizonsStart);
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
nbt.setBoolean("used", used);
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
used = nbt.getBoolean("used");
}
public void onCoordAction(World world, EntityPlayer player, int x, int y, int z) {
@Override
public void onCommandImpl(World world, String... cmd) {
if(cmd.length <= 0) return;
if(used)
if(cmd[0].equals(CMD_FIRE)) {
theHorizons(world, targetX, targetZ);
return;
}
if(cmd[0].equals(CMD_CANFIRE)) {
this.tx = (!used) + "";
this.tx = this.tx.toUpperCase(Locale.US);
return;
}
}
@Override
public void onCoordAction(World world, EntityPlayer player, int x, int y, int z) {
this.setTarget(x, z);
this.theHorizons(world, x, z);
}
public void theHorizons(World world, int x, int z) {
if(used) return;
used = true;
SatelliteSavedData.getData(world).markDirty();

View File

@ -1,42 +0,0 @@
package com.hbm.saveddata.satellites;
import com.hbm.entity.logic.EntityDeathBlast;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class SatelliteLaser extends Satellite {
public long lastOp;
public SatelliteLaser() {
this.ifaceAcs.add(InterfaceActions.HAS_MAP);
this.ifaceAcs.add(InterfaceActions.SHOW_COORDS);
this.ifaceAcs.add(InterfaceActions.CAN_CLICK);
this.satIface = Interfaces.SAT_PANEL;
}
public void writeToNBT(NBTTagCompound nbt) {
nbt.setLong("lastOp", lastOp);
}
public void readFromNBT(NBTTagCompound nbt) {
lastOp = nbt.getLong("lastOp");
}
public void onClick(World world, int x, int z) {
if(lastOp + 10000 < System.currentTimeMillis()) {
lastOp = System.currentTimeMillis();
int y = world.getHeightValue(x, z);
EntityDeathBlast blast = new EntityDeathBlast(world);
blast.posX = x;
blast.posY = y;
blast.posZ = z;
world.spawnEntityInWorld(blast);
}
}
}

View File

@ -5,6 +5,6 @@ import com.hbm.itempool.ItemPoolsSatellite;
public class SatelliteLunarMiner extends SatelliteMiner {
static {
registerCargo(SatelliteLunarMiner.class, ItemPoolsSatellite.POOL_SAT_LUNAR);
SatelliteMiner.registerCargo(SatelliteLunarMiner.class, ItemPoolsSatellite.POOL_SAT_LUNAR);
}
}

View File

@ -1,9 +1,59 @@
package com.hbm.saveddata.satellites;
public class SatelliteMapper extends Satellite {
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class SatelliteMapper extends SatelliteBase {
public static final String CMD_TARGET_LOADED = "targetloaded";
public static final String CMD_SPOT_PLAYER = "spotplayers";
public SatelliteMapper() {
this.ifaceAcs.add(InterfaceActions.HAS_MAP);
this.satIface = Interfaces.SAT_PANEL;
public static final int SPOT_PLAYER_MAX_RANGE = 250;
public SatelliteMapper() { }
@Override public String getType() { return "NOT_A_SPY_SATELLITE_:)"; }
@Override
public void onCommandImpl(World world, String... cmd) {
if(cmd.length <= 0) return;
if(cmd[0].equals(CMD_TARGET_LOADED)) {
this.tx = "" + world.getChunkProvider().chunkExists(targetX >> 4, targetZ >> 4);
this.tx = this.tx.toUpperCase(Locale.US);
return;
}
if(cmd[0].equals(CMD_SPOT_PLAYER)) {
List<String> names = new ArrayList();
for(Object o : world.playerEntities) {
EntityPlayer player = (EntityPlayer) o;
int x = (int) Math.floor(player.posX);
int z = (int) Math.floor(player.posZ);
double dX = x - targetX;
double dZ = z - targetZ;
if(dX * dX + dZ * dZ <= SPOT_PLAYER_MAX_RANGE * SPOT_PLAYER_MAX_RANGE) {
int height = world.getHeightValue(x, z);
if(height < player.posY + 2) names.add(player.getCommandSenderName());
}
}
if(names.isEmpty()) {
this.tx = "NONE";
return;
}
this.tx = String.join(";", names);
return;
}
}
}

View File

@ -7,7 +7,7 @@ import net.minecraft.nbt.NBTTagCompound;
import java.util.HashMap;
public class SatelliteMiner extends Satellite {
public class SatelliteMiner extends SatelliteBase {
/**
* {@link WeightedRandomObject} array with loot the satellite will deliver.
*/
@ -15,9 +15,9 @@ public class SatelliteMiner extends Satellite {
public long lastOp;
public SatelliteMiner() {
this.satIface = Interfaces.NONE;
}
public SatelliteMiner() { }
@Override public String getType() { return "ASTEROID_MINER"; }
public void writeToNBT(NBTTagCompound nbt) {
nbt.setLong("lastOp", lastOp);
@ -49,7 +49,7 @@ public class SatelliteMiner extends Satellite {
* @return - Returns {@link com.hbm.itempool.ItemPool} key or null if the item is not a mining satellite.
*/
public static String getCargoForItem(Item satelliteItem) {
Class<? extends Satellite> satelliteClass = itemToClass.getOrDefault(satelliteItem, null);
Class<? extends SatelliteBase> satelliteClass = XSatelliteRegistry.itemToClass.getOrDefault(satelliteItem, null);
return satelliteClass != null ? CARGO.getOrDefault(satelliteClass, null) : null;
}

View File

@ -0,0 +1,108 @@
package com.hbm.saveddata.satellites;
import java.util.Locale;
import com.hbm.entity.logic.EntityOrbitalLaser;
import api.hbm.redstoneoverradio.IRORInteractive;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class SatellitePrecisionLaser extends SatelliteBase {
public static final String CMD_FIRE = "fire";
public static final String CMD_CANFIRE = "canfire";
public static final String CMD_SETENTITYTARGET = "setentitytarget";
public static final int MAX_TARGET_RANGE = 1_000;
public static final int CHARGE_TIME = 5 * 20;
public long lastShot;
public int targetedEntity = -1;
public SatellitePrecisionLaser() { }
@Override public String getType() { return "ORBITAL_TATOO_REMOVER"; }
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setLong("lastShot", lastShot);
nbt.setInteger("targetedEntity", targetedEntity);
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
lastShot = nbt.getLong("lastShot");
targetedEntity = nbt.getInteger("targetedEntity");
}
@Override
public void onCommandImpl(World world, String... cmd) {
if(cmd.length <= 0) return;
if(cmd[0].equals(CMD_FIRE)) {
if(this.targetedEntity != -1) {
Entity e = world.getEntityByID(this.targetedEntity);
this.targetedEntity = -1;
if(e == null || e.isDead) return;
int x = (int) Math.floor(e.posX);
int z = (int) Math.floor(e.posZ);
double dX = x - targetX;
double dZ = z - targetZ;
if(dX * dX + dZ * dZ <= MAX_TARGET_RANGE * MAX_TARGET_RANGE) {
this.deathBlast(world, e.posX, e.posY, e.posZ);
return;
}
}
deathBlast(world, targetX, targetZ);
return;
}
if(cmd[0].equals(CMD_CANFIRE)) {
this.tx = (lastShot + CHARGE_TIME < world.getTotalWorldTime()) + "";
this.tx = this.tx.toUpperCase(Locale.US);
return;
}
if(cmd[0].equals(CMD_SETENTITYTARGET)) {
this.targetedEntity = IRORInteractive.parseInt(cmd[1]);
return;
}
}
@Override
public void onCoordAction(World world, EntityPlayer player, int x, int y, int z) {
this.setTarget(x, z);
this.deathBlast(world, targetX, targetZ);
}
public void deathBlast(World world, int x, int z) {
int y = world.getHeightValue(x, z);
deathBlast(world, x + 0.5, y, z + 0.5);
}
public void deathBlast(World world, double x, double y, double z) {
if(lastShot + CHARGE_TIME < world.getTotalWorldTime()) {
lastShot = world.getTotalWorldTime();
EntityOrbitalLaser blast = new EntityOrbitalLaser(world);
blast.posX = x;
blast.posY = y;
blast.posZ = z;
blast.explode();
world.spawnEntityInWorld(blast);
}
}
}

View File

@ -1,10 +1,111 @@
package com.hbm.saveddata.satellites;
public class SatelliteRadar extends Satellite {
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import com.hbm.tileentity.machine.TileEntityMachineRadarNT;
import api.hbm.entity.IRadarDetectableNT.RadarScanParams;
import api.hbm.redstoneoverradio.IRORInteractive;
import net.minecraft.entity.Entity;
import net.minecraft.world.World;
/**
* Basically the AUTOCAL is now mandatory lol lmao
*/
public class SatelliteRadar extends SatelliteBase {
public SatelliteRadar() {
this.ifaceAcs.add(InterfaceActions.HAS_MAP);
this.ifaceAcs.add(InterfaceActions.HAS_RADAR);
this.satIface = Interfaces.SAT_PANEL;
public static final int MAX_SCAN_RANGE = 1_000;
public static RadarScanParams scanParams = new RadarScanParams(true, true, true, false);
public static final String CMD_SURVEY = "survey";
public static final String CMD_FILTER = "filter";
public static final String CMD_COUNT = "count";
public static final String CMD_GETTARGETID = "gettargetid";
public static final String CMD_GETPOSITION = "getposition";
public static final String CMD_GETNAME = "getname";
public List<Entity> cachedRadarResults = new ArrayList();
public List<Entity> filteredRadarResults = new ArrayList();
public SatelliteRadar() { }
@Override public String getType() { return "LEO_RADAR"; }
@Override
public void onCommandImpl(World world, String... cmd) {
if(cmd.length <= 0) return;
if(cmd[0].equals(CMD_SURVEY)) {
cachedRadarResults.clear();
for(Entity entity : TileEntityMachineRadarNT.matchingEntities) {
if(entity.dimension != world.provider.dimensionId) continue;
int x = (int) Math.floor(entity.posX);
int z = (int) Math.floor(entity.posZ);
double dX = x - targetX;
double dZ = z - targetZ;
if(dX * dX + dZ * dZ <= MAX_SCAN_RANGE * MAX_SCAN_RANGE) {
cachedRadarResults.add(entity);
}
}
filteredRadarResults = new ArrayList(cachedRadarResults);
return;
}
if(cmd[0].equals(CMD_FILTER) && cmd.length == 2) {
filteredRadarResults.clear();
String filter = cmd[1].toLowerCase(Locale.US);
for(Entity entity : cachedRadarResults) {
if(entity.isDead) continue;
String classname = entity.getClass().getSimpleName().toLowerCase(Locale.US);
if(classname.contains(filter)) {
filteredRadarResults.add(entity);
}
}
return;
}
if(cmd[0].equals(CMD_COUNT)) {
this.tx = "" + filteredRadarResults.size();
return;
}
if(cmd[0].equals(CMD_GETTARGETID) && cmd.length == 2) {
Entity target = getTargetFromIndex(cmd[1]);
if(target == null) { this.tx = ""; return; }
this.tx = "" + target.getEntityId();
return;
}
if(cmd[0].equals(CMD_GETPOSITION) && cmd.length == 2) {
Entity target = getTargetFromIndex(cmd[1]);
if(target == null) { this.tx = ""; return; }
this.tx = (int) Math.floor(target.posX) + ";" + (int) Math.floor(target.posY) + ";" + (int) Math.floor(target.posZ);
return;
}
if(cmd[0].equals(CMD_GETNAME) && cmd.length == 2) {
Entity target = getTargetFromIndex(cmd[1]);
if(target == null) { this.tx = ""; return; }
this.tx = target.getClass().getSimpleName().toLowerCase(Locale.US);
return;
}
}
public Entity getTargetFromIndex(String cmd) {
if(filteredRadarResults.size() <= 0) return null;
int index = IRORInteractive.parseInt(cmd, 0, filteredRadarResults.size());
Entity target = filteredRadarResults.get(index);
if(target.isDead) return null;
return target;
}
}

View File

@ -5,11 +5,11 @@ import com.hbm.main.MainRegistry;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class SatelliteRelay extends Satellite {
public class SatelliteRelay extends SatelliteBase {
public SatelliteRelay() {
this.satIface = Interfaces.NONE;
}
public SatelliteRelay() { }
@Override public String getType() { return "RX/TX"; }
public void onOrbit(World world, double x, double y, double z) {

View File

@ -4,17 +4,15 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.World;
public class SatelliteResonator extends Satellite {
public class SatelliteResonator extends SatelliteBase {
public SatelliteResonator() {
this.coordAcs.add(CoordActions.HAS_Y);
this.satIface = Interfaces.SAT_COORD;
}
public SatelliteResonator() { }
@Override public String getType() { return "XEN_RELAY"; }
public void onCoordAction(World world, EntityPlayer player, int x, int y, int z) {
if(!(player instanceof EntityPlayerMP))
return;
if(!(player instanceof EntityPlayerMP)) return;
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.endermen.portal", 1.0F, 1.0F);
player.mountEntity(null);

View File

@ -1,9 +1,8 @@
package com.hbm.saveddata.satellites;
public class SatelliteScanner extends Satellite {
public class SatelliteScanner extends SatelliteBase {
public SatelliteScanner() {
this.ifaceAcs.add(InterfaceActions.HAS_ORES);
this.satIface = Interfaces.SAT_PANEL;
}
public SatelliteScanner() { }
@Override public String getType() { return "DEPTH_SCANNER"; }
}

View File

@ -0,0 +1,90 @@
package com.hbm.saveddata.satellites;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.special.ItemSatellite.EnumSatType;
import com.hbm.saveddata.SatelliteSavedData;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class XSatelliteRegistry {
public static final List<Class<? extends SatelliteBase>> satellites = new ArrayList<>();
public static final HashMap<ComparableStack, Class<? extends SatelliteBase>> itemToClass = new HashMap<>();
public static void register() {
registerSatellite(SatelliteMapper.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.SPY));
registerSatellite(SatelliteScanner.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.SCANNER));
registerSatellite(SatelliteRadar.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.RADAR));
registerSatellite(SatelliteDeathRay.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.DEATH_RAY));
registerSatellite(SatelliteResonator.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.XENIUM_RESONATOR));
registerSatellite(SatelliteRelay.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.XENIUM_RESONATOR));
registerSatellite(SatelliteMiner.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.MINER_ASTRO));
registerSatellite(SatelliteLunarMiner.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.MINER_LUNAR));
registerSatellite(SatelliteHorizons.class, ModItems.sat_gerald);
registerSatellite(SatellitePrecisionLaser.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.PRECISION_LASER));
registerSatellite(SatelliteMapper.class, ModItems.sat_mapper);
registerSatellite(SatelliteScanner.class, ModItems.sat_scanner);
registerSatellite(SatelliteRadar.class, ModItems.sat_radar);
registerSatellite(SatelliteDeathRay.class, ModItems.sat_laser);
registerSatellite(SatelliteResonator.class, ModItems.sat_resonator);
registerSatellite(SatelliteRelay.class, ModItems.sat_foeq);
registerSatellite(SatelliteMiner.class, ModItems.sat_miner);
registerSatellite(SatelliteLunarMiner.class, ModItems.sat_lunar_miner);
}
/**
* Register satellite.
* @param sat - Satellite class
* @param item - Satellite item (which will be placed in a rocket)
*/
@Deprecated
public static void registerSatellite(Class<? extends SatelliteBase> sat, Item item) {
if(!itemToClass.containsKey(item) && !itemToClass.containsValue(sat)) {
satellites.add(sat);
itemToClass.put(new ComparableStack(item), sat);
}
}
public static void registerSatellite(Class<? extends SatelliteBase> sat, ComparableStack item) {
if(!itemToClass.containsKey(item) && !itemToClass.containsValue(sat)) {
satellites.add(sat);
itemToClass.put(item, sat);
}
}
public static void orbit(World world, ItemStack stack, int freq, double x, double y, double z) {
if(world.isRemote) return;
SatelliteBase sat = createFromItem(stack);
if(sat != null) {
SatelliteSavedData data = SatelliteSavedData.getData(world);
data.sats.put(freq, sat);
sat.onOrbit(world, x, y, z);
data.markDirty();
}
}
public static SatelliteBase createFromId(int i) {
try {
return satellites.get(i).newInstance();
} catch(Exception e) { }
return null;
}
public static SatelliteBase createFromItem(ItemStack stack) {
try {
return itemToClass.get(new ComparableStack(stack).makeSingular()).newInstance();
} catch(Exception e) { }
return null;
}
}

View File

@ -19,10 +19,7 @@ import com.hbm.items.tool.ItemCoordinateBase;
import com.hbm.lib.Library;
import com.hbm.main.MainRegistry;
import com.hbm.saveddata.SatelliteSavedData;
import com.hbm.saveddata.satellites.Satellite;
import com.hbm.saveddata.satellites.SatelliteHorizons;
import com.hbm.saveddata.satellites.SatelliteLaser;
import com.hbm.saveddata.satellites.SatelliteResonator;
import com.hbm.saveddata.satellites.SatelliteBase;
import com.hbm.tileentity.IConfigurableMachine;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.IRadarCommandReceiver;
@ -446,32 +443,14 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
if(link != null && link.getItem() == ModItems.sat_relay) {
World world = player.getEntityWorld();
Satellite sat = SatelliteSavedData.getData(world).getSatFromFreq(ISatChip.getFreqS(link));
if(sat instanceof SatelliteLaser) {
if(data.hasKey("launchPosX")) {
int x = data.getInteger("launchPosX");
int z = data.getInteger("launchPosZ");
worldObj.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F);
sat.onClick(world, x, z);
}
}
if(sat instanceof SatelliteHorizons) {
if(data.hasKey("launchPosX")) {
int x = data.getInteger("launchPosX");
int z = data.getInteger("launchPosZ");
int y = 60; //one day I will make radars transmit Y coordinate as well and you will be butchered alhamdulila
worldObj.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F);
sat.onCoordAction(world, player, x, y, z);
}
}
if(sat instanceof SatelliteResonator) {
if(data.hasKey("launchPosX")) {
int x = data.getInteger("launchPosX");
int z = data.getInteger("launchPosZ");
int y = world.getTopSolidOrLiquidBlock(x, z); //the top fucking block because I will never make radars transmit Y coordinates as well!
worldObj.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F);
sat.onCoordAction(world, player, x, y, z);
}
SatelliteBase sat = SatelliteSavedData.getData(world).getSatFromFreq(ISatChip.getFreqS(link));
if(data.hasKey("launchPosX")) {
int x = data.getInteger("launchPosX");
int z = data.getInteger("launchPosZ");
int y = 60; //one day I will make radars transmit Y coordinate as well and you will be butchered alhamdulila
worldObj.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F);
sat.onCoordAction(world, player, x, y, z);
}
}
if(link != null && link.getItem() == ModItems.radar_linker) {

View File

@ -7,7 +7,7 @@ import com.hbm.inventory.gui.GUISatDock;
import com.hbm.itempool.ItemPool;
import com.hbm.items.ISatChip;
import com.hbm.saveddata.SatelliteSavedData;
import com.hbm.saveddata.satellites.Satellite;
import com.hbm.saveddata.satellites.SatelliteBase;
import com.hbm.saveddata.satellites.SatelliteMiner;
import com.hbm.tileentity.IGUIProvider;
import cpw.mods.fml.relauncher.Side;
@ -147,7 +147,7 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
if(slots[15] != null) {
int freq = ISatChip.getFreqS(slots[15]);
Satellite sat = data.getSatFromFreq(freq);
SatelliteBase sat = data.getSatFromFreq(freq);
int delay = 10 * 60 * 1000;
@ -181,7 +181,7 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
}
if(rocket.getDataWatcher().getWatchableObjectInt(16) == 1 && rocket.timer == 50) {
Satellite sat = data.getSatFromFreq(ISatChip.getFreqS(slots[15]));
SatelliteBase sat = data.getSatFromFreq(ISatChip.getFreqS(slots[15]));
if(sat != null) unloadCargo((SatelliteMiner) sat);
}
}

View File

@ -1,6 +1,7 @@
package com.hbm.tileentity.machine;
import com.hbm.saveddata.SatelliteSavedData;
import com.hbm.saveddata.satellites.SatelliteBase;
import com.hbm.tileentity.TileEntityTickingBase;
import api.hbm.redstoneoverradio.IRORInteractive;
@ -110,11 +111,45 @@ public class TileEntityMachineSatLink extends TileEntityTickingBase implements I
@Override
public String provideRORValue(String name) {
if(name.equals(PREFIX_VALUE + connected)) {
return this.connected ? "TRUE" : "FALSE";
}
if(name.equals(PREFIX_VALUE + "freq")) {
return "" + this.freq;
}
if(name.equals(PREFIX_VALUE + "rx")) {
SatelliteSavedData dat = SatelliteSavedData.getData(worldObj);
SatelliteBase sat = dat.getSatFromFreq(this.freq);
if(sat != null) {
return sat.tx;
}
return "";
}
return null;
}
@Override
public String runRORFunction(String name, String[] params) {
if(name.equals(PREFIX_FUNCTION + "setfreq") && params.length == 1) {
this.freq = IRORInteractive.parseInt(params[0], 0, 100_000);
this.markChanged();
}
if(name.equals(PREFIX_FUNCTION + "tx")) {
SatelliteSavedData dat = SatelliteSavedData.getData(worldObj);
SatelliteBase sat = dat.getSatFromFreq(this.freq);
String[] cmd = String.join(IRORInteractive.PARAM_SEPARATOR, params).split(" ");
if(sat != null) {
sat.onCommand(worldObj, cmd);
}
this.markChanged();
}
return null;
}
}

View File

@ -3284,25 +3284,19 @@ item.rune_isa.name=Cool Catalyst Matrix
item.rune_jera.name=Multiplicative Catalyst Matrix
item.rune_thurisaz.name=Additive Catalyst Matrix
item.safety_fuse.name=Zündschnur
item.sat_base.name=Satellitenkörper
item.sat_chip.name=Satelliten-ID-Chip
item.sat_coord.name=Satelliten-Zielmarkierer
item.sat_designator.name=Satelliten-Laserzielmarkierer
item.sat_foeq.name=PEAF - Mk.I FOEQ Dunasonde mit experimenter nuklearer Schubdüse
item.sat_gerald.name=Gerald der Konstruktionsandroid
item.sat_head_laser.name=Todesstrahl
item.sat_head_mapper.name=Hochleistungskamera
item.sat_head_radar.name=Radarschüssel
item.sat_head_resonator.name=Xenium-Resonator
item.sat_head_scanner.name=M700 Oberflächenabtaster
item.sat_interface.name=Satelliten-Kontrollinterface
item.sat_laser.name=Orbitaler Todesstrahl
item.sat_lunar_miner.name=Mond-Förderschiff
item.sat_mapper.name=Oberflächen-Abtastungssatellit
item.sat_miner.name=Asteroiden-Förderschiff
item.sat_radar.name=Radar-Überwachungssatellit
item.sat_resonator.name=Xenium-Resonator-Satellit
item.sat_scanner.name=Satellit mit Tiefenscanning-Modul
item.sat_laser.name=Orbitaler Todesstrahl (LEGACY)
item.sat_lunar_miner.name=Mond-Förderschiff (LEGACY)
item.sat_mapper.name=Oberflächen-Abtastungssatellit (LEGACY)
item.sat_miner.name=Asteroiden-Förderschiff (LEGACY)
item.sat_radar.name=Radar-Überwachungssatellit (LEGACY)
item.sat_resonator.name=Xenium-Resonator-Satellit (LEGACY)
item.sat_scanner.name=Satellit mit Tiefenscanning-Modul (LEGACY)
item.sawblade.name=Sägeblatt
item.schnitzel_vegan.name=Veganes Schnitzel
item.schrabidium_axe.name=Schrabidiumaxt
@ -3889,11 +3883,11 @@ tile.block_fiberglass.name=Fiberglasrolle
tile.block_fluorite.name=Fluoritblock
tile.block_foam.name=Schaum
tile.block_graphite.name=Graphitblock
tile.block_graphite_drilled.name=Gebohrtes Graphit
tile.block_graphite_fuel.name=Pile Brennstoff
tile.block_graphite_plutonium.name=Pile Brennstoff (Gebrütet)
tile.block_graphite_rod.name=Pile Steuerstab
tile.block_graphite_source.name=Pile Neutronenquelle
tile.block_graphite_drilled.name=Gebohrtes Graphit (LEGACY)
tile.block_graphite_fuel.name=Pile Brennstoff (LEGACY)
tile.block_graphite_plutonium.name=Pile Brennstoff (Gebrütet) (LEGACY)
tile.block_graphite_rod.name=Pile Steuerstab (LEGACY)
tile.block_graphite_source.name=Pile Neutronenquelle (LEGACY)
tile.block_insulator.name=Isolatorrolle
tile.block_lead.name=Bleiblock
tile.block_lanthanium.name=Lanthanblock
@ -4545,6 +4539,7 @@ tile.machine_rtg_orange.name=Starker RTG
tile.machine_rtg_purple.name=Paarvernichtungsgenerator
tile.machine_rtg_red.name=Fulminationsgenerator
tile.machine_rtg_yellow.name=Australium Supergenerator
tile.machine_satlink.name=Satelliten-Bodenstation
tile.machine_satlinker.name=Satelliten-ID-Manager
tile.machine_sawmill.name=Stirling-Sägemühle
tile.machine_sawmill.desc=Benötigt externe Hitzequelle.$Wärmestransferrate: T*0.1 TU/t$Minimalaufnahme: 100 TU/t, Maximalaufnahme: 300 TU/t

View File

@ -3839,20 +3839,20 @@ item.pile_rod.waste.name=Chicago Pile Nuclear Waste Rod
item.pile_rod.waste.desc=Highly reactive end product from leaving a Chicago Pile fuel rod in the reactor for too long.
item.pile_rod.zr.name=Chicago Pile Zirconium Rod
item.pile_rod.zr.desc=Inert zirconium rod which is transparent to neutrons. Ideal for pushing other rods safely out of the reactor.
item.pile_rod_boron.name=Chicago Pile Control Rod
item.pile_rod_boron.desc=§9[Neutron Absorber]$§eClick to toggle
item.pile_rod_detector.name=Chicago Pile Control & Detector Rod
item.pile_rod_detector.desc=§9[Neutron Detector/Absorber]$§eUse defuser to increase/decrease neutron limit$§eUse screwdriver w/o sneaking to inspect flux
item.pile_rod_lithium.name=Chicago Pile Lithium Cell
item.pile_rod_lithium.desc=§a[Breedable Fuel]$§eUse hand drill to inspect core
item.pile_rod_plutonium.name=Chicago Pile Plutonium Rod
item.pile_rod_plutonium.desc=§d[Neutron Source]
item.pile_rod_pu239.name=Chicago Pile Bred Uranium Rod
item.pile_rod_pu239.desc=§a[Reactive Fuel]$§eRich in Plutonium-239.
item.pile_rod_source.name=Chicago Pile Ra226Be Neutron Source
item.pile_rod_source.desc=§d[Neutron Source]
item.pile_rod_uranium.name=Chicago Pile Uranium Rod
item.pile_rod_uranium.desc=§a[Reactive Fuel]$§eUse hand drill to take core sample
item.pile_rod_boron.name=Chicago Pile Control Rod (LEGACY)
item.pile_rod_boron.desc=§9[Neutron Absorber]$§eClick to toggle (LEGACY)
item.pile_rod_detector.name=Chicago Pile Control & Detector Rod (LEGACY)
item.pile_rod_detector.desc=§9[Neutron Detector/Absorber]$§eUse defuser to increase/decrease neutron limit$§eUse screwdriver w/o sneaking to inspect flux (LEGACY)
item.pile_rod_lithium.name=Chicago Pile Lithium Cell (LEGACY)
item.pile_rod_lithium.desc=§a[Breedable Fuel]$§eUse hand drill to inspect core (LEGACY)
item.pile_rod_plutonium.name=Chicago Pile Plutonium Rod (LEGACY)
item.pile_rod_plutonium.desc=§d[Neutron Source] (LEGACY)
item.pile_rod_pu239.name=Chicago Pile Bred Uranium Rod (LEGACY)
item.pile_rod_pu239.desc=§a[Reactive Fuel]$§eRich in Plutonium-239. (LEGACY)
item.pile_rod_source.name=Chicago Pile Ra226Be Neutron Source (LEGACY)
item.pile_rod_source.desc=§d[Neutron Source] (LEGACY)
item.pile_rod_uranium.name=Chicago Pile Uranium Rod (LEGACY)
item.pile_rod_uranium.desc=§a[Reactive Fuel]$§eUse hand drill to take core sample (LEGACY)
item.pill_iodine.name=Iodine Pill
item.pill_iodine.desc=Removes negative effects
item.pill_herbal.name=Herbal Paste
@ -4395,26 +4395,29 @@ item.rune_isa.name=Cool Catalyst Matrix
item.rune_jera.name=Multiplicative Catalyst Matrix
item.rune_thurisaz.name=Additive Catalyst Matrix
item.safety_fuse.name=Safety Fuse
item.sat_base.name=Satellite Base
item.sat_chip.name=Satellite ID-Chip
item.sat_coord.name=Satellite Designator
item.sat_designator.name=Satellite Laser Designator
item.sat_relay.name=Satellite Radar Relay
item.sat_foeq.name=PEAF - Mk.I FOEQ Duna Probe with experimental Nuclear Propulsion
item.sat_relay.name=Satellite Radar Relay (LEGACY)
item.sat_foeq.name=PEAF - Mk.I FOEQ Duna Probe with experimental Nuclear Propulsion (LEGACY)
item.sat_gerald.name=Gerald The Construction Android
item.sat_head_laser.name=Death Ray
item.sat_head_mapper.name=High-Gain Optical Camera
item.sat_head_radar.name=Radar Dish
item.sat_head_resonator.name=Xenium Resonator
item.sat_head_scanner.name=M700 Survey Scanner
item.sat_interface.name=Satellite Control Interface
item.sat_laser.name=Orbital Death Ray
item.sat_lunar_miner.name=Lunar Mining Ship
item.sat_mapper.name=Surface Mapping Satellite
item.sat_miner.name=Asteroid Mining Ship
item.sat_radar.name=Radar Survey Satellite
item.sat_resonator.name=Xenium Resonator Satellite
item.sat_scanner.name=Satellite with Depth-Resource Scanning Module
item.sat_laser.name=Orbital Death Ray (LEGACY)
item.sat_lunar_miner.name=Lunar Mining Ship (LEGACY)
item.sat_mapper.name=Surface Mapping Satellite (LEGACY)
item.sat_miner.name=Asteroid Mining Ship (LEGACY)
item.sat_radar.name=Radar Survey Satellite (LEGACY)
item.sat_resonator.name=Xenium Resonator Satellite (LEGACY)
item.sat_scanner.name=Satellite with Depth-Resource Scanning Module (LEGACY)
item.satellite.death_ray.name=Orbital Death Ray
item.satellite.miner_astro.name=Asteroid Mining Ship
item.satellite.miner_lunar.name=Lunar Mining Ship
item.satellite.precision_laser.name=Orbital Precision Laser
item.satellite.radar.name=Radar Satellite
item.satellite.relay.name=Relay Satellite
item.satellite.scanner.name=Depth Scanning Satellite
item.satellite.spy.name=Spy Satellite
item.satellite.xenium_resonator.name=Xenium Resonator Satellite
item.sawblade.name=Sawblade
item.schnitzel_vegan.name=Vegan Schnitzel
item.schrabidium_axe.name=Schrabidium Axe
@ -5100,14 +5103,14 @@ tile.block_fluorite.name=Block of Fluorite
tile.block_foam.name=Foam
tile.block_insulator.name=Roll of Insulation
tile.block_graphite.name=Block of Graphite
tile.block_graphite_detector.name=Pile Neutron Detector
tile.block_graphite_drilled.name=Drilled Graphite
tile.block_graphite_fuel.name=Pile Fuel
tile.block_graphite_lithium.name=Pile Lithium Fuel
tile.block_graphite_plutonium.name=Pile Fuel (Bred)
tile.block_graphite_rod.name=Pile Control Rod
tile.block_graphite_source.name=Pile Neutron Source
tile.block_graphite_tritium.name=Pile Lithium Fuel (Bred)
tile.block_graphite_detector.name=Pile Neutron Detector (LEGACY)
tile.block_graphite_drilled.name=Drilled Graphite (LEGACY)
tile.block_graphite_fuel.name=Pile Fuel (LEGACY)
tile.block_graphite_lithium.name=Pile Lithium Fuel (LEGACY)
tile.block_graphite_plutonium.name=Pile Fuel (Bred) (LEGACY)
tile.block_graphite_rod.name=Pile Control Rod (LEGACY)
tile.block_graphite_source.name=Pile Neutron Source (LEGACY)
tile.block_graphite_tritium.name=Pile Lithium Fuel (Bred) (LEGACY)
tile.block_lead.name=Block of Lead
tile.block_lanthanium.name=Block of Lanthanium
tile.block_lithium.name=Block of Lithium
@ -5816,6 +5819,7 @@ tile.machine_rtg_orange.name=Strong RT Generator
tile.machine_rtg_purple.name=Antimatter Annihilation Generator
tile.machine_rtg_red.name=Fulmination Generator
tile.machine_rtg_yellow.name=Australium Superfuel Reactor
tile.machine_satlink.name=Satellite Ground Station
tile.machine_satlinker.name=Satellite ID Manager
tile.machine_sawmill.name=Stirling Sawmill
tile.machine_sawmill.desc=Requires external heat source.$Heat transfer rate: T*0.1 TU/t$Min intake: 100 TU/t, Max intake: 300 TU/t

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 B

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 515 B

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B