-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ef4251
commit 16aa6df
Showing
36 changed files
with
1,659 additions
and
871 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package com.wartec.wartecmod; | ||
|
||
import com.hbm.tileentity.turret.TileEntityTurretBaseNT; | ||
import com.hbm.util.CompatExternal; | ||
import com.wartec.wartecmod.entity.missile.EntityCruiseMissileBaseNT; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.world.World; | ||
|
||
import java.util.List; | ||
|
||
public class EntityChecker extends TileEntityTurretBaseNT { | ||
|
||
TileEntityTurretBaseNT Obj = new TileEntityTurretBaseNT() { | ||
|
||
@Override | ||
public void updateFiringTick() { | ||
|
||
} | ||
|
||
@Override | ||
protected List<Integer> getAmmoList() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public long getMaxPower() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return null; | ||
} | ||
}; | ||
@Override | ||
public boolean entityAcceptableTarget (Entity e){ | ||
|
||
|
||
if(Obj.targetMachines) { | ||
|
||
|
||
if (e instanceof EntityCruiseMissileBaseNT) return true; | ||
for (Class c : CompatExternal.turretTargetMachine) if (c.isAssignableFrom(e.getClass())) return true; | ||
} | ||
|
||
return super.entityAcceptableTarget(e); | ||
|
||
} | ||
|
||
@Override | ||
public void updateFiringTick () { | ||
|
||
} | ||
|
||
@Override | ||
protected List<Integer> getAmmoList () { | ||
return null; | ||
} | ||
|
||
@Override | ||
public long getMaxPower () { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public GuiScreen provideGUI ( int ID, EntityPlayer player, World world,int x, int y, int z){ | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getName () { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
src/main/java/com/wartec/wartecmod/blocks/vls/VerticalLaunchTube.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package com.wartec.wartecmod.blocks.vls; | ||
|
||
import com.hbm.blocks.BlockDummyable; | ||
import com.hbm.interfaces.IBomb; | ||
import com.hbm.tileentity.TileEntityProxyCombo; | ||
import com.wartec.wartecmod.tileentity.vls.TileEntityVerticalLaunchTube; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.material.Material; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.util.AxisAlignedBB; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.common.util.ForgeDirection; | ||
|
||
public class VerticalLaunchTube extends BlockDummyable implements IBomb { | ||
|
||
public VerticalLaunchTube(Material mat) { | ||
super(mat); | ||
this.bounding.add(AxisAlignedBB.getBoundingBox(-1.5D, 0D, -1.5D, -0.5D, 1D, -0.5D)); | ||
this.bounding.add(AxisAlignedBB.getBoundingBox(0.5D, 0D, -1.5D, 1.5D, 1D, -0.5D)); | ||
this.bounding.add(AxisAlignedBB.getBoundingBox(-1.5D, 0D, 0.5D, -0.5D, 1D, 1.5D)); | ||
this.bounding.add(AxisAlignedBB.getBoundingBox(0.5D, 0D, 0.5D, 1.5D, 1D, 1.5D)); | ||
this.bounding.add(AxisAlignedBB.getBoundingBox(-0.5D, 0.5D, -1.5D, 0.5D, 1D, 1.5D)); | ||
this.bounding.add(AxisAlignedBB.getBoundingBox(-1.5D, 0.5D, -0.5D, 1.5D, 1D, 0.5D)); | ||
} | ||
|
||
@Override | ||
public TileEntity createNewTileEntity(World world, int meta) { | ||
if(meta >= 12) return new TileEntityVerticalLaunchTube(); | ||
if(meta >= 6) return new TileEntityProxyCombo().inventory().power().fluid(); | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { | ||
return this.standardOpenBehavior(world, x, y, z, player, 0); | ||
} | ||
|
||
@Override | ||
public int[] getDimensions() { | ||
return new int[] {0, 0, 1, 1, 1, 1}; | ||
} | ||
|
||
@Override | ||
public int getOffset() { | ||
return 1; | ||
} | ||
|
||
@Override | ||
public BombReturnCode explode(World world, int x, int y, int z) { | ||
|
||
if(!world.isRemote) { | ||
|
||
int[] corePos = findCore(world, x, y, z); | ||
if(corePos != null){ | ||
TileEntity core = world.getTileEntity(corePos[0], corePos[1], corePos[2]); | ||
if(core instanceof TileEntityVerticalLaunchTube){ | ||
TileEntityVerticalLaunchTube entity = (TileEntityVerticalLaunchTube)core; | ||
return entity.launchFromDesignator(); | ||
} | ||
} | ||
} | ||
|
||
return BombReturnCode.UNDEFINED; | ||
} | ||
|
||
@Override | ||
public void onNeighborBlockChange(World world, int x, int y, int z, Block blockIn){ | ||
|
||
if(!world.isRemote){ | ||
|
||
int[] corePos = findCore(world, x, y, z); | ||
if(corePos != null){ | ||
TileEntity core = world.getTileEntity(corePos[0], corePos[1], corePos[2]); | ||
if(core instanceof TileEntityVerticalLaunchTube){ | ||
TileEntityVerticalLaunchTube launchTube = (TileEntityVerticalLaunchTube)core; | ||
launchTube.updateRedstonePower(x, y, z); | ||
} | ||
} | ||
} | ||
super.onNeighborBlockChange( world, x, y, z, blockIn); | ||
} | ||
|
||
@Override | ||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) { | ||
super.fillSpace(world, x, y, z, dir, o); | ||
|
||
x += dir.offsetX * o; | ||
z += dir.offsetZ * o; | ||
|
||
this.makeExtra(world, x + 1, y, z + 1); | ||
this.makeExtra(world, x + 1, y, z - 1); | ||
this.makeExtra(world, x - 1, y, z + 1); | ||
this.makeExtra(world, x - 1, y, z - 1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.