Skip to content

Commit

Permalink
take it
Browse files Browse the repository at this point in the history
  • Loading branch information
WarTechMod committed Apr 15, 2024
1 parent 1ef4251 commit 16aa6df
Show file tree
Hide file tree
Showing 36 changed files with 1,659 additions and 871 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ dependencies {
//compileOnly 'inventory-tweaks:InventoryTweaks:1.62+beta.84:api'
implementation "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api"

implementation 'com.github.HbmMods:Hbm-s-Nuclear-Tech-GIT:71cdc4c'
implementation 'com.github.HbmMods:Hbm-s-Nuclear-Tech-GIT:9206755'
}

processResources {
Expand Down
81 changes: 81 additions & 0 deletions src/main/java/com/wartec/wartecmod/EntityChecker.java
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@


import com.wartec.wartecmod.entity.missile.*;
import com.wartec.wartecmod.entity.missile.EntityCruiseMissileSubsonic.EntityCruiseMissileNuclear;
import com.wartec.wartecmod.items.wartecmodItems;
import com.wartec.wartecmod.render.item.*;
import com.wartec.wartecmod.render.item.ItemRenderCj10Missile;
import com.wartec.wartecmod.render.item.ItemRenderIskanderMissile;
import com.wartec.wartecmod.render.item.ItemRenderKalibrMissile;
import com.wartec.wartecmod.render.item.ItemRenderTomahawkMissile;
import com.wartec.wartecmod.render.missile.*;
import com.wartec.wartecmod.render.tileentity.RenderTileEntityBallisticMissileLauncher;
import com.wartec.wartecmod.render.tileentity.*;
import com.wartec.wartecmod.render.tileentity.vls.RenderTileEntityVlsLaunchTube;
import com.wartec.wartecmod.render.tileentity.RenderTileEntityDecoBlock;
import com.wartec.wartecmod.render.tileentity.vls.RenderTileEntityVlsExhaust;
import com.wartec.wartecmod.render.tileentity.vls.RenderTileEntityVlsLaunchTube;
import com.wartec.wartecmod.render.tileentity.vls.RenderVerticalLaunchTube;
import com.wartec.wartecmod.tileentity.deco.TileEntityDecoBlock;
import com.wartec.wartecmod.tileentity.launcher.TileEntityBallisticMissileLauncher;
import com.wartec.wartecmod.tileentity.vls.TileEntityVlsLaunchTube;


import com.wartec.wartecmod.tileentity.vls.TileEntityVerticalLaunchTube;
import com.wartec.wartecmod.tileentity.vls.TileEntityVlsExhaust;
import com.wartec.wartecmod.tileentity.vls.TileEntityVlsLaunchTube;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraftforge.client.MinecraftForgeClient;
Expand All @@ -28,20 +32,21 @@ public void registerRenderers() {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityVlsLaunchTube.class, new RenderTileEntityVlsLaunchTube());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityVlsExhaust.class, new RenderTileEntityVlsExhaust());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBallisticMissileLauncher.class, new RenderTileEntityBallisticMissileLauncher());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityVerticalLaunchTube.class, new RenderVerticalLaunchTube());

//Entities
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileHE.class, new RenderCruiseMissileHE());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileH.class, new RenderCruiseMissileH());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileSubsonic.EntityCruiseMissileHE.class, new RenderCruiseMissileHE());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileSubsonic.EntityCruiseMissileH.class, new RenderCruiseMissileH());
RenderingRegistry.registerEntityRenderingHandler(EntityMissileSlbm.class, new RenderMissileSlbm());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileNuclear.class, new RenderCruiseMissileNuclear());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileTB.class, new RenderCruiseMissileFAE());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileBuster.class, new RenderCruiseMissileBuster());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileEmp.class, new RenderCruiseMissileEmp());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileCluster.class, new RenderCruiseMissileCluster());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileFragmentation.class, new RenderCruiseMissileFragmentation());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileSubsonic.EntityCruiseMissileTest.class, new RenderCruiseMissileDecoy()); //Decoy
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileMiniNuke.class, new RenderCruiseMissileMiniNuke());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileWP.class, new RenderCruiseMissileWP());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileSubsonic.EntityCruiseMissileTB.class, new RenderCruiseMissileFAE());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileSubsonic.EntityCruiseMissileBuster.class, new RenderCruiseMissileBuster());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileSubsonic.EntityCruiseMissileEmp.class, new RenderCruiseMissileEmp());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileSubsonic.EntityCruiseMissileCluster.class, new RenderCruiseMissileCluster());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileSubsonic.EntityCruiseMissileFragmentation.class, new RenderCruiseMissileFragmentation());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileSubsonic.EntityCruiseMissileDecoy.class, new RenderCruiseMissileDecoy());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileSubsonic.EntityCruiseMissileMiniNuke.class, new RenderCruiseMissileMiniNuke());
RenderingRegistry.registerEntityRenderingHandler(EntityCruiseMissileSubsonic.EntityCruiseMissileWP.class, new RenderCruiseMissileWP());


RenderingRegistry.registerEntityRenderingHandler(EntityHypersonicCruiseMissileHE.class, new RenderHypersonicCruiseMissileHE());
Expand Down
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

import com.hbm.blocks.BlockDummyable;
import com.hbm.handler.MultiblockHandlerXR;
import com.hbm.interfaces.IBomb;
import com.wartec.wartecmod.blocks.wartecmodBlocks;
import com.wartec.wartecmod.interfaces.ILauncher;
import com.wartec.wartecmod.tileentity.vls.TileEntityVlsLaunchTube;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.wartec.wartecmod.blocks;

import com.hbm.blocks.generic.BlockGeneric;
import com.hbm.lib.RefStrings;
import com.wartec.wartecmod.blocks.vls.VerticalLaunchTube;
import com.wartec.wartecmod.blocks.vls.VlsVerticalLauncher;
import com.wartec.wartecmod.wartecmod;
import com.wartec.wartecmod.tileentity.deco.TileEntityDecoBlock;
Expand All @@ -20,6 +22,8 @@ public static void Blocks()
//Missile equipment
public static final int guiID_LaunchTube = 1;
public static Block LaunchTube;

public static Block VerticalLaunchTube;
public static Block VlsExhaust;
public static final int guiID_BallisticMissileLauncher = 2;
public static Block BallisticMissileLauncher;
Expand Down Expand Up @@ -51,6 +55,7 @@ private static void initializeBlock() {

//Missile Equipment
LaunchTube = new VlsVerticalLauncher(Material.iron).setBlockName("LaunchTube").setHardness(5.0F).setResistance(10.0F).setCreativeTab(com.wartec.wartecmod.wartecmod.tabwartecmodcruisemissiles).setBlockTextureName(com.wartec.wartecmod.lib.RefStrings.MODID + ":LaunchTube");
VerticalLaunchTube = new VerticalLaunchTube(Material.iron).setBlockName("VerticalLaunchTube").setHardness(5.0F).setResistance(10.0F).setCreativeTab(com.wartec.wartecmod.wartecmod.tabwartecmodcruisemissiles).setBlockTextureName(RefStrings.MODID + ":Launch_pad");
VlsExhaust = new com.wartec.wartecmod.blocks.vls.VlsExhaust(Material.iron).setBlockName("VlsExhaust").setHardness(5.0F).setResistance(10.0F).setCreativeTab(com.wartec.wartecmod.wartecmod.tabwartecmodcruisemissiles).setBlockTextureName(com.wartec.wartecmod.lib.RefStrings.MODID + ":VlsExhaust");
BallisticMissileLauncher = new com.wartec.wartecmod.blocks.launcher.BallisticMissileLauncher(Material.iron).setBlockName("BallisticMissileLauncher").setHardness(5.0F).setResistance(10.0F).setCreativeTab(com.wartec.wartecmod.wartecmod.tabwartecmodcruisemissiles).setBlockTextureName(com.wartec.wartecmod.lib.RefStrings.MODID + ":BallisticMissileLauncher");

Expand Down Expand Up @@ -94,6 +99,7 @@ private static void registerBlock() {
GameRegistry.registerBlock(decoBlockHypersonicCruiseMissileNuclear, "DecoBlockHypersonicCruiseMissileNuclear");
GameRegistry.registerBlock(decoBlockSatelliteNuclear, "DecoBlockSatelliteNuclear");
//Missile equipment
GameRegistry.registerBlock(VerticalLaunchTube, VerticalLaunchTube.getUnlocalizedName());
GameRegistry.registerBlock(LaunchTube, LaunchTube.getUnlocalizedName());
GameRegistry.registerBlock(VlsExhaust, VlsExhaust.getUnlocalizedName());
GameRegistry.registerBlock(BallisticMissileLauncher, BallisticMissileLauncher.getUnlocalizedName());
Expand Down
Loading

0 comments on commit 16aa6df

Please sign in to comment.