mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
screm
This commit is contained in:
parent
e9bd39693a
commit
61c5d932b0
@ -2470,7 +2470,7 @@ tile.hadron_plating_glass.name=Particle Accelerator Plating (Window)
|
||||
tile.hadron_plating_striped.name=Particle Accelerator Plating (Cool Hazard Stripes)
|
||||
tile.hadron_plating_voltz.name=Particle Accelerator Plating (VOLTZ)
|
||||
tile.hadron_plating_yellow.name=Particle Accelerator Plating (YelloDye)
|
||||
tile.hadron_power.name=Particle Accelerator Power Plugtankish wanted
|
||||
tile.hadron_power.name=Particle Accelerator Power Plug
|
||||
tile.hazmat.name=Hazmat Cloth Block
|
||||
tile.iter.name=Fusion Reactor
|
||||
tile.lamp_tritium_blue_off.name=Blue Tritium Lamp
|
||||
@ -2798,4 +2798,4 @@ weapon.ability.chainsaw=Painsaw
|
||||
weapon.ability.radiation=Radioactive Blade
|
||||
weapon.ability.phosphorus=Phosphorus Tip
|
||||
weapon.ability.stun=Stunning
|
||||
weapon.ability.vampire=Vampire
|
||||
weapon.ability.vampire=Vampire
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
BIN
src/main/java/assets/hbm/textures/gui/weapon/gui_turret_base.png
Normal file
BIN
src/main/java/assets/hbm/textures/gui/weapon/gui_turret_base.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
@ -6,7 +6,7 @@ import com.hbm.config.WeaponConfig;
|
||||
import com.hbm.entity.particle.EntityGasFlameFX;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretCIWS;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretCIWS;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.hbm.blocks.bomb;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBullet;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretCheapo;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretCheapo;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.hbm.blocks.bomb;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretChekhov;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretChekhov;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.hbm.blocks.bomb;
|
||||
|
||||
import com.hbm.entity.projectile.EntityFire;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretFlamer;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretFlamer;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -2,7 +2,7 @@ package com.hbm.blocks.bomb;
|
||||
|
||||
import com.hbm.entity.particle.EntityGasFlameFX;
|
||||
import com.hbm.entity.projectile.EntityBullet;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretHeavy;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretHeavy;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.hbm.blocks.bomb;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBullet;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretLight;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretLight;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -2,7 +2,7 @@ package com.hbm.blocks.bomb;
|
||||
|
||||
import com.hbm.entity.particle.EntityGasFlameFX;
|
||||
import com.hbm.entity.projectile.EntityRocket;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretRocket;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretRocket;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -2,7 +2,7 @@ package com.hbm.blocks.bomb;
|
||||
|
||||
import com.hbm.entity.particle.EntityGasFlameFX;
|
||||
import com.hbm.entity.projectile.EntityAAShell;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretSpitfire;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretSpitfire;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.hbm.blocks.bomb;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBullet;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretTau;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretTau;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -9,14 +9,22 @@ import com.hbm.tileentity.machine.TileEntityForceField;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineForceField extends BlockContainer {
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private static boolean keepInventory;
|
||||
|
||||
public MachineForceField(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
@ -25,42 +33,39 @@ public class MachineForceField extends BlockContainer {
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityForceField();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote)
|
||||
{
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
} else if(!player.isSneaking()) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_forcefield, world, x, y, z);
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
TileEntityForceField te = (TileEntityForceField)world.getTileEntity(x, y, z);
|
||||
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
TileEntityForceField te = (TileEntityForceField) world.getTileEntity(x, y, z);
|
||||
|
||||
if(te.isOn && te.cooldown == 0 && te.power > 0) {
|
||||
for(int i = 0; i < 4; i++) {
|
||||
float f = x;
|
||||
@ -68,7 +73,7 @@ public class MachineForceField extends BlockContainer {
|
||||
float f2 = z;
|
||||
float f4 = rand.nextFloat();
|
||||
float f5 = rand.nextFloat();
|
||||
|
||||
|
||||
if(te.color == 0xFF0000)
|
||||
world.spawnParticle("lava", f + f4, f1, f2 + f5, 0.0D, 0.0D, 0.0D);
|
||||
else
|
||||
@ -81,10 +86,54 @@ public class MachineForceField extends BlockContainer {
|
||||
float f2 = z;
|
||||
float f4 = rand.nextFloat();
|
||||
float f5 = rand.nextFloat();
|
||||
|
||||
|
||||
world.spawnParticle("smoke", f + f4, f1, f2 + f5, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {
|
||||
if(!keepInventory) {
|
||||
ISidedInventory tileentityfurnace = (ISidedInventory) p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
if(tileentityfurnace != null) {
|
||||
for(int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1) {
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
|
||||
if(itemstack != null) {
|
||||
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while(itemstack.stackSize > 0) {
|
||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||
|
||||
if(j1 > itemstack.stackSize) {
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
|
||||
if(itemstack.hasTagCompound()) {
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float) this.field_149933_a.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) this.field_149933_a.nextGaussian() * f3;
|
||||
p_149749_1_.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretBase;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
|
||||
import cofh.api.energy.IEnergyProvider;
|
||||
|
||||
@ -2,7 +2,7 @@ package com.hbm.items.machine;
|
||||
|
||||
import java.util.Arrays;
|
||||
import com.hbm.blocks.bomb.TurretBase;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretBase;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@ -3,8 +3,8 @@ package com.hbm.items.tool;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.bomb.TurretBase;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretCheapo;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretCheapo;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.hbm.items.weapon;
|
||||
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretBase;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@ -50,10 +50,7 @@ import com.hbm.entity.projectile.*;
|
||||
import com.hbm.handler.HbmKeybinds.EnumKeybind;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.particle.*;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationKeyframe;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
import com.hbm.render.anim.*;
|
||||
import com.hbm.render.anim.HbmAnimations.Animation;
|
||||
import com.hbm.render.block.*;
|
||||
import com.hbm.render.entity.*;
|
||||
@ -74,6 +71,7 @@ import com.hbm.tileentity.bomb.*;
|
||||
import com.hbm.tileentity.conductor.*;
|
||||
import com.hbm.tileentity.deco.*;
|
||||
import com.hbm.tileentity.machine.*;
|
||||
import com.hbm.tileentity.turret.*;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
@ -72,6 +72,7 @@ import com.hbm.tileentity.conductor.*;
|
||||
import com.hbm.tileentity.deco.*;
|
||||
import com.hbm.tileentity.machine.*;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge.ReactorFuelType;
|
||||
import com.hbm.tileentity.turret.*;
|
||||
import com.hbm.world.generator.CellularDungeonFactory;
|
||||
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
|
||||
@ -7,8 +7,6 @@ import com.hbm.tileentity.bomb.TileEntityCompactLauncher;
|
||||
import com.hbm.tileentity.bomb.TileEntityLaunchTable;
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeCustom;
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeN45;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretCIWS;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretCheapo;
|
||||
import com.hbm.tileentity.deco.TileEntityBomber;
|
||||
import com.hbm.tileentity.machine.TileEntityAMSBase;
|
||||
import com.hbm.tileentity.machine.TileEntityAMSEmitter;
|
||||
@ -23,6 +21,8 @@ import com.hbm.tileentity.machine.TileEntityMachineElectricFurnace;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineGasCent;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge.ReactorFuelType;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretCIWS;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretCheapo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorSmall;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineSeleniumEngine;
|
||||
import com.hbm.tileentity.machine.TileEntityRadioRec;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.packet;
|
||||
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretBase;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
|
||||
@ -3,8 +3,8 @@ package com.hbm.render.tileentity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretCIWS;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretCIWS;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -3,8 +3,8 @@ package com.hbm.render.tileentity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretCheapo;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretCheapo;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.render.tileentity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretBase;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -3,7 +3,8 @@ package com.hbm.render.tileentity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretBase;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.render.tileentity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretBase;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.render.tileentity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretBase;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.render.tileentity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretBase;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.render.tileentity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.bomb.TileEntityTurretBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretBase;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityTurretChekhov extends TileEntity {
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
package com.hbm.tileentity.turret;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -0,0 +1,212 @@
|
||||
package com.hbm.tileentity.turret;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
/**
|
||||
* More over-engineered than ever, but chopping this thing into the smallest possible pieces makes it easier for my demented brain to comprehend
|
||||
* @author hbm
|
||||
*
|
||||
*/
|
||||
public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase {
|
||||
|
||||
//what way are we facing?
|
||||
public double rotationYaw;
|
||||
public double rotationPitch;
|
||||
//only used by clients for interpolation
|
||||
public double lastRotationYaw;
|
||||
public double lastRotationPitch;
|
||||
//is the turret on?
|
||||
public boolean isOn = false;
|
||||
//is the turret aimed at the target?
|
||||
public boolean aligned = false;
|
||||
|
||||
public boolean targetPlayers = false;
|
||||
public boolean targetAnimals = false;
|
||||
public boolean targetMobs = true;
|
||||
public boolean targetMachines = true;
|
||||
|
||||
public Entity target;
|
||||
|
||||
//tally marks!
|
||||
public int stattrak;
|
||||
|
||||
/**
|
||||
* X
|
||||
*
|
||||
* YYY
|
||||
* YYY
|
||||
* YYY Z
|
||||
*
|
||||
* X -> ai slot (0)
|
||||
* Y -> ammo slots (1 - 9)
|
||||
* Z -> battery slot (10)
|
||||
*/
|
||||
|
||||
public TileEntityTurretBaseNT() {
|
||||
super(11);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the namelist from the AI chip in slot 0
|
||||
* @return null if there is either no chip to be found or if the name list is empty, otherwise it just reads the strings from the chip's NBT
|
||||
*/
|
||||
public List<String> getWhitelist() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the nearest acceptable target within range aand in line of sight
|
||||
*/
|
||||
protected void seekNewTarget() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns the turret by a specific amount of degrees towards the target
|
||||
*/
|
||||
protected void alignTurret() {
|
||||
|
||||
/* TODO */
|
||||
|
||||
//if the delta is smaller than the angular velocity, just snap directly to the optimal position
|
||||
//check if the delta exceeds 180 and choose an appropriate shortest turning direction based on that
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks line of sight to the passed entity along with whether the angle falls within swivel range
|
||||
* @return
|
||||
*/
|
||||
public boolean entityInLOS(Entity e) {
|
||||
return false; //TODO: for the love of god don't forget to check the swivel range
|
||||
}
|
||||
|
||||
/**
|
||||
* How many degrees the turret can deviate from the target to be acceptable to fire at
|
||||
* @return
|
||||
*/
|
||||
public double getAcceptableInaccuracy() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
/**
|
||||
* How many degrees the turret can rotate per tick (4.5°/t = 90°/s or a half turn in two seconds)
|
||||
* @return
|
||||
*/
|
||||
public double getTurretYawSpeed() {
|
||||
return 4.5D;
|
||||
}
|
||||
|
||||
/**
|
||||
* How many degrees the turret can lift per tick (3°/t = 60°/s or roughly the lowest to the highest point of an average turret in one second)
|
||||
* @return
|
||||
*/
|
||||
public double getTurretPitchSpeed() {
|
||||
return 3D;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes turrets sad :'(
|
||||
* @return
|
||||
*/
|
||||
public double getTurretDepression() {
|
||||
return 30D;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes turrets feel privileged
|
||||
* @return
|
||||
*/
|
||||
public double getTurretElevation() {
|
||||
return 30D;
|
||||
}
|
||||
|
||||
/**
|
||||
* How many ticks until a target rescan is required
|
||||
* @return
|
||||
*/
|
||||
public int getDecetorInterval() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
/**
|
||||
* The pivot point of the turret, larger models have a default of 1.5
|
||||
* @return
|
||||
*/
|
||||
public double getHeightOffset() {
|
||||
return 1.5D;
|
||||
}
|
||||
|
||||
/**
|
||||
* Horizontal offset for the spawn point of bullets
|
||||
* @return
|
||||
*/
|
||||
public double getBarrelLength() {
|
||||
return 1.0D;
|
||||
}
|
||||
|
||||
/**
|
||||
* The pivot point of the turret, this position is used for LOS calculation and more
|
||||
* @return
|
||||
*/
|
||||
public Vec3 getTurretPos() {
|
||||
//TODO: account for multiblock rotation
|
||||
return Vec3.createVectorHelper(xCoord, yCoord + getHeightOffset(), zCoord);
|
||||
}
|
||||
|
||||
/**
|
||||
* Yes, new turrets fire BulletNTs.
|
||||
* @return
|
||||
*/
|
||||
protected abstract List<BulletConfiguration> getAmmoList();
|
||||
|
||||
/*
|
||||
* the void
|
||||
*
|
||||
*
|
||||
* more stuff pending: the thing that makes the pew pew
|
||||
* probably a separate method that consumes or checks ammo
|
||||
* mayhaps some dangly bits that tie together the GUI with the AI chip's whitelist
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
//hinga dinga durgen
|
||||
|
||||
//let's see
|
||||
|
||||
//check power, if it's turned on, all that jazz
|
||||
|
||||
//is there an active enemy? good, aim at it (alignTurret does all that)
|
||||
|
||||
//is the gun aimed? now shøøt
|
||||
|
||||
//check ammo, spawn boolets if present, make empty clicking if not
|
||||
|
||||
//decrement the timer, if the timer runs out, set the timer to the detector interval and choose a new target
|
||||
|
||||
//target choosing time? seekNewTarget does all the work
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared()
|
||||
{
|
||||
return 65536.0D;
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
package com.hbm.tileentity.turret;
|
||||
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
package com.hbm.tileentity.turret;
|
||||
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
@ -0,0 +1,30 @@
|
||||
package com.hbm.tileentity.turret;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.guncfg.Gun75BoltFactory;
|
||||
|
||||
public class TileEntityTurretChekhov extends TileEntityTurretBaseNT {
|
||||
|
||||
static List<BulletConfiguration> configs = new ArrayList();
|
||||
|
||||
//because cramming it into the ArrayList's constructor with nested curly brackets and all that turned out to be not as pretty
|
||||
//also having a floaty `static` like this looks fun
|
||||
//idk if it's just me though
|
||||
static {
|
||||
configs.add(Gun75BoltFactory.get75BoltConfig());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<BulletConfiguration> getAmmoList() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.turretChekhov";
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
package com.hbm.tileentity.turret;
|
||||
|
||||
public class TileEntityTurretFlamer extends TileEntityTurretBase {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
package com.hbm.tileentity.turret;
|
||||
|
||||
public class TileEntityTurretHeavy extends TileEntityTurretBase {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
package com.hbm.tileentity.turret;
|
||||
|
||||
public class TileEntityTurretLight extends TileEntityTurretBase {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
package com.hbm.tileentity.turret;
|
||||
|
||||
public class TileEntityTurretRocket extends TileEntityTurretBase {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
package com.hbm.tileentity.turret;
|
||||
|
||||
public class TileEntityTurretSpitfire extends TileEntityTurretBase {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
package com.hbm.tileentity.turret;
|
||||
|
||||
public class TileEntityTurretTau extends TileEntityTurretBase {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user