maxwell the microwave turret

This commit is contained in:
Bob 2021-06-14 23:42:50 +02:00
parent 83b45a7b2f
commit c6cc0fb735
14 changed files with 4516 additions and 7 deletions

View File

@ -905,6 +905,8 @@ public class ModBlocks {
public static final int guiID_richard = 108;
public static Block turret_howard;
public static final int guiID_howard = 112;
public static Block turret_maxwell;
public static final int guiID_maxwell = 112;
public static Block rbmk_rod;
public static Block rbmk_control;
@ -1703,6 +1705,7 @@ public class ModBlocks {
turret_tauon = new TurretTauon(Material.iron).setBlockName("turret_tauon").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
turret_richard = new TurretRichard(Material.iron).setBlockName("turret_richard").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
turret_howard = new TurretHoward(Material.iron).setBlockName("turret_howard").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
turret_maxwell = new TurretMaxwell(Material.iron).setBlockName("turret_maxwell").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":turret_maxwell");
rbmk_rod = new RBMKRod().setBlockName("rbmk_rod").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_element");
rbmk_control = new RBMKControl().setBlockName("rbmk_control").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_control");
@ -2282,6 +2285,7 @@ public class ModBlocks {
GameRegistry.registerBlock(turret_tauon, turret_tauon.getUnlocalizedName());
GameRegistry.registerBlock(turret_richard, turret_richard.getUnlocalizedName());
GameRegistry.registerBlock(turret_howard, turret_howard.getUnlocalizedName());
GameRegistry.registerBlock(turret_maxwell, turret_maxwell.getUnlocalizedName());
//Mines
GameRegistry.registerBlock(mine_ap, mine_ap.getUnlocalizedName());

View File

@ -0,0 +1,56 @@
package com.hbm.blocks.turret;
import com.hbm.blocks.BlockDummyable;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public abstract class TurretBaseNT extends BlockDummyable {
public TurretBaseNT(Material mat) {
super(mat);
}
@Override
public int[] getDimensions() {
return new int[] { 0, 0, 1, 0, 1, 0 };
}
@Override
public int getOffset() {
return 0;
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) {
return true;
} else if(!player.isSneaking()) {
int[] pos = this.findCore(world, x, y, z);
if(pos == null)
return false;
openGUI(world, player, pos[0], pos[1], pos[2]);
return true;
} else {
return false;
}
}
public abstract void openGUI(World world, EntityPlayer player, int x, int y, int z);
}

View File

@ -0,0 +1,32 @@
package com.hbm.blocks.turret;
import com.hbm.blocks.ModBlocks;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.turret.TileEntityTurretMaxwell;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class TurretMaxwell extends TurretBaseNT {
public TurretMaxwell(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12)
return new TileEntityTurretMaxwell();
return new TileEntityProxyCombo(true, true, false);
}
@Override
public void openGUI(World world, EntityPlayer player, int x, int y, int z) {
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_maxwell, world, x, y, z);
}
}

View File

@ -131,6 +131,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretTauon.class, new RenderTurretTauon());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretRichard.class, new RenderTurretRichard());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretHoward.class, new RenderTurretHoward());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretMaxwell.class, new RenderTurretMaxwell());
//mines
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLandmine.class, new RenderLandmine());
//cel prime

View File

@ -463,6 +463,7 @@ public class MainRegistry {
GameRegistry.registerTileEntity(TileEntityTurretFriendly.class, "tileentity_turret_friendly");
GameRegistry.registerTileEntity(TileEntityTurretRichard.class, "tileentity_turret_richard");
GameRegistry.registerTileEntity(TileEntityTurretHoward.class, "tileentity_turret_howard");
GameRegistry.registerTileEntity(TileEntityTurretMaxwell.class, "tileentity_turret_maxwell");
GameRegistry.registerTileEntity(TileEntitySILEX.class, "tileentity_silex");
GameRegistry.registerTileEntity(TileEntityFEL.class, "tileentity_fel");
GameRegistry.registerTileEntity(TileEntityDemonLamp.class, "tileentity_demonlamp");

View File

@ -43,6 +43,7 @@ public class ResourceManager {
public static final IModelCustom turret_tauon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/turrets/turret_tauon.obj"));
public static final IModelCustom turret_richard = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/turrets/turret_richard.obj"));
public static final IModelCustom turret_howard = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/turrets/turret_howard.obj"));
public static final IModelCustom turret_maxwell = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/turrets/turret_microwave.obj"));
//Landmines
public static final IModelCustom mine_ap = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/mine_ap.obj"));
@ -286,6 +287,7 @@ public class ResourceManager {
public static final ResourceLocation turret_richard_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/richard.png");
public static final ResourceLocation turret_howard_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/howard.png");
public static final ResourceLocation turret_howard_barrels_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/howard_barrels.png");
public static final ResourceLocation turret_maxwell_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/maxwell.png");
//Landmines
public static final ResourceLocation mine_ap_tex = new ResourceLocation(RefStrings.MODID, "textures/models/mine_ap.png");

View File

@ -0,0 +1,46 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.turret.TileEntityTurretMaxwell;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
public class RenderTurretMaxwell extends RenderTurretBase {
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) {
TileEntityTurretMaxwell turret = (TileEntityTurretMaxwell)te;
Vec3 pos = turret.getHorizontalOffset();
GL11.glPushMatrix();
GL11.glTranslated(x + pos.xCoord, y, z + pos.zCoord);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_SMOOTH);
this.renderConnectors(turret, true, false, FluidType.NONE);
bindTexture(ResourceManager.turret_base_tex);
ResourceManager.turret_chekhov.renderPart("Base");
double yaw = -Math.toDegrees(turret.lastRotationYaw + (turret.rotationYaw - turret.lastRotationYaw) * interp) - 90D;
double pitch = Math.toDegrees(turret.lastRotationPitch + (turret.rotationPitch - turret.lastRotationPitch) * interp);
GL11.glRotated(yaw, 0, 1, 0);
bindTexture(ResourceManager.turret_carriage_ciws_tex);
ResourceManager.turret_howard.renderPart("Carriage");
GL11.glTranslated(0, 1.5, 0);
GL11.glRotated(pitch, 0, 0, 1);
GL11.glTranslated(0, -1.5, 0);
bindTexture(ResourceManager.turret_maxwell_tex);
ResourceManager.turret_maxwell.renderPart("Microwave");
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
}

View File

@ -27,7 +27,7 @@ public class TileEntityRBMKControlManual extends TileEntityRBMKControl implement
double surge = 0;
if(this.targetLevel < this.startingLevel && this.level != this.targetLevel) {
if(this.targetLevel < this.startingLevel && Math.abs(this.level - this.targetLevel) > 0.01D) {
surge = Math.sin(Math.pow(this.level, 15) * Math.PI) * (this.startingLevel - this.targetLevel) * RBMKDials.getSurgeMod(worldObj);
}

View File

@ -60,6 +60,12 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
return;
}
if(!this.hasLid()) {
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, (float) ((this.fluxFast + this.fluxSlow) * 0.05F));
}
super.updateEntity();
//for spreading, we want the buffered flux to be 0 because we want to know exactly how much gets reflected back
this.fluxFast = 0;
this.fluxSlow = 0;
@ -68,12 +74,6 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
hasRod = true;
if(!this.hasLid()) {
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, (float) ((this.fluxFast + this.fluxSlow) * 0.05F));
}
super.updateEntity();
} else {
this.fluxFast = 0;

View File

@ -0,0 +1,30 @@
package com.hbm.tileentity.turret;
import java.util.List;
public class TileEntityTurretMaxwell extends TileEntityTurretBaseNT {
@Override
public long getMaxPower() {
// TODO Auto-generated method stub
return 0;
}
@Override
public void updateFiringTick() {
// TODO Auto-generated method stub
}
@Override
protected List<Integer> getAmmoList() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getName() {
// TODO Auto-generated method stub
return "container.turretMaxwell";
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB