This commit is contained in:
Bob 2021-06-16 21:22:23 +02:00
parent a4f469fab6
commit bb0341bdee
22 changed files with 199 additions and 36 deletions

View File

@ -1705,7 +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");
turret_maxwell = new TurretMaxwell(Material.iron).setBlockName("turret_maxwell").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
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");

View File

@ -1,6 +1,7 @@
package com.hbm.blocks.machine;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.BossSpawnHandler;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityProxyInventory;
@ -54,6 +55,8 @@ public class BlockHadronAccess extends BlockContainer {
return true;
} else if(!player.isSneaking()) {
BossSpawnHandler.markFBI(player);
ForgeDirection dir = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z));
/*for(ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) {

View File

@ -1,6 +1,7 @@
package com.hbm.blocks.machine;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.BossSpawnHandler;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityHadron;
@ -70,6 +71,8 @@ public class BlockHadronCore extends BlockContainer {
return true;
} else if(!player.isSneaking()) {
BossSpawnHandler.markFBI(player);
TileEntityHadron entity = (TileEntityHadron) world.getTileEntity(x, y, z);
if(entity != null) {
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_hadron, world, x, y, z);

View File

@ -3,6 +3,7 @@ package com.hbm.blocks.machine;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.BossSpawnHandler;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityMachineMissileAssembly;
@ -48,14 +49,14 @@ public class MachineMissileAssembly extends BlockContainer {
@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()) {
BossSpawnHandler.markFBI(player);
TileEntityMachineMissileAssembly entity = (TileEntityMachineMissileAssembly) world.getTileEntity(x, y, z);
if(entity != null)
{
if(entity != null) {
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_missile_assembly, world, x, y, z);
}
return true;

View File

@ -3,6 +3,7 @@ package com.hbm.blocks.machine;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.BossSpawnHandler;
import com.hbm.handler.MultiblockHandler;
import com.hbm.interfaces.IMultiblock;
import com.hbm.main.MainRegistry;
@ -142,14 +143,13 @@ public class MachineReactorSmall extends BlockContainer implements IMultiblock {
@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()) {
BossSpawnHandler.markFBI(player);
TileEntityMachineReactorSmall entity = (TileEntityMachineReactorSmall) world.getTileEntity(x, y, z);
if(entity != null)
{
if(entity != null) {
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_reactor_small, world, x, y, z);
}
return true;

View File

@ -4,6 +4,7 @@ import java.util.Random;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.BossSpawnHandler;
import com.hbm.handler.MultiblockHandlerXR;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntitySoyuzLauncher;
@ -54,6 +55,8 @@ public class SoyuzLauncher extends BlockDummyable {
if(pos == null)
return false;
BossSpawnHandler.markFBI(player);
TileEntitySoyuzLauncher entity = (TileEntitySoyuzLauncher) world.getTileEntity(pos[0], pos[1], pos[2]);
if(entity != null)
{

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.machine.rbmk;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.BossSpawnHandler;
import com.hbm.handler.MultiblockHandlerXR;
import com.hbm.items.ModItems;
import com.hbm.items.tool.ItemGuideBook.BookType;
@ -57,6 +58,8 @@ public class RBMKConsole extends BlockDummyable {
} else if(!player.isSneaking()) {
BossSpawnHandler.markFBI(player);
int[] pos = this.findCore(world, x, y, z);
if(pos == null)

View File

@ -1,6 +1,7 @@
package com.hbm.blocks.machine.rbmk;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.BossSpawnHandler;
import com.hbm.tileentity.TileEntityProxyInventory;
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKRod;
@ -24,7 +25,7 @@ public class RBMKRod extends RBMKBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
BossSpawnHandler.markFBI(player);
return openInv(world, x, y, z, player, ModBlocks.guiID_rbmk_rod);
}

View File

@ -49,18 +49,21 @@ public class BossSpawnHandler {
if(world.rand.nextInt(MobConfig.raidChance) == 0 && !world.playerEntities.isEmpty() && world.provider.isSurfaceWorld()) {
EntityPlayer player = (EntityPlayer) world.playerEntities.get(world.rand.nextInt(world.playerEntities.size()));
player.addChatComponentMessage(new ChatComponentText("FBI, OPEN UP!").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
Vec3 vec = Vec3.createVectorHelper(MobConfig.raidAttackDistance, 0, 0);
vec.rotateAroundY((float)(Math.PI * 2) * world.rand.nextFloat());
for(int i = 0; i < MobConfig.raidAmount; i++) {
double spawnX = player.posX + vec.xCoord + world.rand.nextGaussian() * 5;
double spawnZ = player.posZ + vec.zCoord + world.rand.nextGaussian() * 5;
double spawnY = world.getHeightValue((int)spawnX, (int)spawnZ);
if(player.getEntityData().getCompoundTag(player.PERSISTED_NBT_TAG).getLong("fbiMark") < world.getTotalWorldTime()) {
player.addChatComponentMessage(new ChatComponentText("FBI, OPEN UP!").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
trySpawn(world, (float)spawnX, (float)spawnY, (float)spawnZ, new EntityFBI(world));
Vec3 vec = Vec3.createVectorHelper(MobConfig.raidAttackDistance, 0, 0);
vec.rotateAroundY((float)(Math.PI * 2) * world.rand.nextFloat());
for(int i = 0; i < MobConfig.raidAmount; i++) {
double spawnX = player.posX + vec.xCoord + world.rand.nextGaussian() * 5;
double spawnZ = player.posZ + vec.zCoord + world.rand.nextGaussian() * 5;
double spawnY = world.getHeightValue((int)spawnX, (int)spawnZ);
trySpawn(world, (float)spawnX, (float)spawnY, (float)spawnZ, new EntityFBI(world));
}
}
}
}
@ -115,4 +118,9 @@ public class BossSpawnHandler {
}
}
public static void markFBI(EntityPlayer player) {
if(!player.worldObj.isRemote)
player.getEntityData().getCompoundTag(player.PERSISTED_NBT_TAG).setLong("fbiMark", player.worldObj.getTotalWorldTime() + 20 * 60 * 20);
}
}

View File

@ -681,6 +681,17 @@ public class AssemblerRecipes {
new ComparableStack(ModItems.mechanism_rifle_2, 2),
new ComparableStack(ModBlocks.crate_steel, 1)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.turret_maxwell, 1), new AStack[] {
new ComparableStack(ModBlocks.machine_lithium_battery, 1),
new OreDictStack("ingotSteel", 24),
new ComparableStack(ModItems.ingot_dura_steel, 6),
new ComparableStack(ModItems.motor, 2),
new ComparableStack(ModItems.circuit_targeting_tier4, 2),
new ComparableStack(ModItems.pipes_steel, 1),
new ComparableStack(ModItems.mechanism_special, 3),
new ComparableStack(ModItems.magnetron, 16),
new ComparableStack(ModItems.ingot_tcalloy, 8)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.machine_silex, 1), new AStack[] {
new ComparableStack(Blocks.glass, 12),
new ComparableStack(ModItems.motor, 2),
@ -892,7 +903,7 @@ public class AssemblerRecipes {
if(array.get(2).getAsJsonPrimitive().isNumber()) {
stacksize = Math.min(64, Math.max(1, array.get(2).getAsJsonPrimitive().getAsNumber().intValue()));
stacksize = Math.max(1, array.get(2).getAsJsonPrimitive().getAsNumber().intValue());
} else {

View File

@ -46,7 +46,7 @@ public class ItemRBMKRod extends Item implements IItemHazard {
* I I I I
* I I I I
* I I I I
* I I I I
* ,I I I I,
* |'-----'|
* | |
* '-----'

View File

@ -3,7 +3,7 @@ package com.hbm.lib;
public class RefStrings {
public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech Mod";
public static final String VERSION = "1.0.27 BETA (3899)";
public static final String VERSION = "1.0.27 BETA (3902)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version

View File

@ -1346,6 +1346,32 @@ public class ClientProxy extends ServerProxy {
int ent = data.getInteger("ent");
this.vanish(ent);
}
if("giblets".equals(type)) {
int ent = data.getInteger("ent");
this.vanish(ent);
Entity e = world.getEntityByID(ent);
if(e == null)
return;
float width = e.width;
float height = e.height;
int gW = (int)(width / 0.25F);
int gH = (int)(height / 0.25F);
boolean blowMeIntoTheGodDamnStratosphere = rand.nextInt(15) == 0;
double mult = 1D;
if(blowMeIntoTheGodDamnStratosphere)
mult *= 10;
for(int i = -(gW / 2); i <= gW; i++) {
for(int j = 0; j <= gH; j++) {
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleGiblet(man, world, x, y, z, rand.nextGaussian() * 0.25 * mult, rand.nextDouble() * mult, rand.nextGaussian() * 0.25 * mult));
}
}
}
}
private HashMap<Integer, Long> vanished = new HashMap();

View File

@ -0,0 +1,84 @@
package com.hbm.particle;
import org.lwjgl.opengl.GL11;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.init.Blocks;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
@SideOnly(Side.CLIENT)
public class ParticleGiblet extends EntityFX {
private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/particle/meat.png");
private TextureManager theRenderEngine;
private float momentumYaw;
private float momentumPitch;
public ParticleGiblet(TextureManager texman, World world, double x, double y, double z, double mX, double mY, double mZ) {
super(world, x, y, z);
this.motionX = mX;
this.motionY = mY;
this.motionZ = mZ;
this.theRenderEngine = texman;
this.particleMaxAge = 140 + rand.nextInt(20);
this.particleGravity = 2F;
this.momentumYaw = (float) rand.nextGaussian() * 15F;
this.momentumPitch = (float) rand.nextGaussian() * 15F;
}
@Override
public int getFXLayer() {
return 3;
}
@Override
public void onUpdate() {
super.onUpdate();
this.prevRotationPitch = this.rotationPitch;
this.prevRotationYaw = this.rotationYaw;
if(!this.onGround) {
this.rotationPitch += this.momentumPitch;
this.rotationYaw += this.momentumYaw;
EntityFX fx = new net.minecraft.client.particle.EntityBlockDustFX(worldObj, posX, posY, posZ, 0, 0, 0, Blocks.redstone_block, 0);
ReflectionHelper.setPrivateValue(EntityFX.class, fx, 20 + rand.nextInt(20), "particleMaxAge", "field_70547_e");
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
}
}
@Override
public void renderParticle(Tessellator tess, float interp, float x, float y, float z, float tx, float tz) {
GL11.glPushMatrix();
this.theRenderEngine.bindTexture(texture);
float f10 = this.particleScale * 0.1F;
float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) interp - interpPosX);
float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) interp - interpPosY);
float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - interpPosZ);
tess.startDrawingQuads();
tess.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
tess.addVertexWithUV((double) (f11 - x * f10 - tx * f10), (double) (f12 - y * f10), (double) (f13 - z * f10 - tz * f10), (double) 0, (double) 0);
tess.addVertexWithUV((double) (f11 - x * f10 + tx * f10), (double) (f12 + y * f10), (double) (f13 - z * f10 + tz * f10), (double) 0, (double) 1);
tess.addVertexWithUV((double) (f11 + x * f10 + tx * f10), (double) (f12 + y * f10), (double) (f13 + z * f10 + tz * f10), (double) 1, (double) 1);
tess.addVertexWithUV((double)(f11 + x * f10 - tx * f10), (double)(f12 - y * f10), (double)(f13 + z * f10 - tz * f10), (double)1, (double)0);
tess.draw();
GL11.glPopMatrix();
}
}

View File

@ -978,6 +978,19 @@ public class ItemRenderLibrary {
ResourceManager.chungus.renderPart("Blades");
GL11.glShadeModel(GL11.GL_FLAT);
}});
renderers.put(Item.getItemFromBlock(ModBlocks.turret_maxwell), new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(-1, -3, 0);
GL11.glScaled(4, 4, 4);
}
public void renderCommon() {
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.turret_base_tex); ResourceManager.turret_chekhov.renderPart("Base");
bindTexture(ResourceManager.turret_carriage_ciws_tex); ResourceManager.turret_howard.renderPart("Carriage");
bindTexture(ResourceManager.turret_maxwell_tex); ResourceManager.turret_maxwell.renderPart("Microwave");
GL11.glShadeModel(GL11.GL_FLAT);
}});
}
private static void bindTexture(ResourceLocation res) {

View File

@ -10,7 +10,6 @@ import com.hbm.render.util.BeamPronter.EnumWaveType;
import com.hbm.tileentity.turret.TileEntityTurretMaxwell;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
@ -63,7 +62,7 @@ public class RenderTurretMaxwell extends RenderTurretBase {
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDepthMask(false);
Tessellator tess = Tessellator.instance;
/*Tessellator tess = Tessellator.instance;
tess.startDrawingQuads();
Vec3 v = Vec3.createVectorHelper(0, 0.375, 0);
for(int i = 0; i < 16; i++) {
@ -79,7 +78,7 @@ public class RenderTurretMaxwell extends RenderTurretBase {
tess.addVertex(0, v.yCoord, v.zCoord);
}
tess.draw();
tess.draw();*/
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_TEXTURE_2D);
@ -88,7 +87,10 @@ public class RenderTurretMaxwell extends RenderTurretBase {
GL11.glDisable(GL11.GL_BLEND);
GL11.glShadeModel(GL11.GL_FLAT);
BeamPronter.prontBeam(Vec3.createVectorHelper(length, 0, 0), EnumWaveType.SPIRAL, EnumBeamType.LINE, 0x0000ff, 0x8080ff, (int)((te.getWorldObj().getTotalWorldTime() + interp) * -50) % 360, (int)((turret.lastDist + 1) * 10), 0.4325F, 0, 0);
for(int i = 0; i < 8; i++)
BeamPronter.prontBeam(Vec3.createVectorHelper(length, 0, 0), EnumWaveType.SPIRAL, EnumBeamType.SOLID, 0x2020ff, 0x2020ff, (int)((te.getWorldObj().getTotalWorldTime() + interp) * -50 + i * 45) % 360, (int)((turret.lastDist + 1)), 0.375F, 2, 0.05F);
//BeamPronter.prontBeam(Vec3.createVectorHelper(length, 0, 0), EnumWaveType.SPIRAL, EnumBeamType.LINE, 0x0000ff, 0x8080ff, (int)((te.getWorldObj().getTotalWorldTime() + interp) * -50) % 360, (int)((turret.lastDist + 1) * 10), 0.4325F, 0, 0);
GL11.glPopAttrib();
GL11.glPopMatrix();
}

View File

@ -123,18 +123,19 @@ public class TileEntityTurretMaxwell extends TileEntityTurretBaseNT {
float health = this.target instanceof EntityLivingBase ? ((EntityLivingBase)this.target).getMaxHealth() : 20F;
int count = Math.min((int)Math.ceil(health / 3D), 250);
NBTTagCompound data = new NBTTagCompound();
/*NBTTagCompound data = new NBTTagCompound();
data.setString("type", "vanillaburst");
data.setInteger("count", count * 4);
data.setDouble("motion", 0.1D);
data.setString("mode", "blockdust");
data.setInteger("block", Block.getIdFromBlock(Blocks.redstone_block));
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, this.target.posX, this.target.posY + this.target.height * 0.5, this.target.posZ), new TargetPoint(this.target.dimension, this.target.posX, this.target.posY + this.target.height * 0.5, this.target.posZ, 50));
*/
NBTTagCompound vdat = new NBTTagCompound();
vdat.setString("type", "vanish");
vdat.setString("type", "giblets");
vdat.setInteger("ent", this.target.getEntityId());
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(vdat, this.target.posX, this.target.posY + this.target.height * 0.5, this.target.posZ), new TargetPoint(this.target.dimension, this.target.posX, this.target.posY + this.target.height * 0.5, this.target.posZ, 50));
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(vdat, this.target.posX, this.target.posY + this.target.height * 0.5, this.target.posZ), new TargetPoint(this.target.dimension, this.target.posX, this.target.posY + this.target.height * 0.5, this.target.posZ, 150));
worldObj.playSoundEffect(this.target.posX, this.target.posY, this.target.posZ, "mob.zombie.woodbreak", 2.0F, 0.95F + worldObj.rand.nextFloat() * 0.2F);
}

View File

@ -270,6 +270,7 @@ container.turretChekhov=Tschechows Gewehr
container.turretFriendly=Mister Friendly
container.turretHoward=Howard
container.turretJeremy=Jeremy
container.turretMaxwell=Maxwell
container.turretRichard=Richard
container.turretTauon=Tauon
container.uf6_tank=UF6 Tank
@ -3057,6 +3058,7 @@ tile.turret_heavy.name=Schweres MG-Geschütz
tile.turret_howard.name=Goalkeeper-Zwilling CIWS "Howard"
tile.turret_jeremy.name=Autokanonengeschütz "Jeremy"
tile.turret_light.name=Leichtes MG-Geschütz
tile.turret_maxwell.name=Hochenergie-MASER-Geschütz "Maxwell"
tile.turret_rocket.name=Raketengeschütz
tile.turret_richard.name=Raketenwerfergeschütz "Richard"
tile.turret_spitfire.name=Geschütz für das ich noch keinen Namen habe [WIP]

View File

@ -338,6 +338,7 @@ container.turretChekhov=Chekhov's Gun
container.turretFriendly=Mister Friendly
container.turretHoward=Howard
container.turretJeremy=Jeremy
container.turretMaxwell=Maxwell
container.turretRichard=Richard
container.turretTauon=Tauon
container.uf6_tank=UF6 Tank
@ -3141,6 +3142,7 @@ tile.turret_heavy.name=Heavy Machine Gun Turret
tile.turret_howard.name=Goalkeeper Twin Chaingun CIWS "Howard"
tile.turret_jeremy.name=Autocannon Turret "Jeremy"
tile.turret_light.name=Light Machine Gun Turret
tile.turret_maxwell.name=High-Energy MASER Turret "Maxwell"
tile.turret_rocket.name=Rocket Turret
tile.turret_richard.name=Rocket Launcher Turret "Richard"
tile.turret_spitfire.name=Turret I have no name for right now [WIP]

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

View File

@ -3,7 +3,7 @@
"modid": "hbm",
"name": "Hbm's Nuclear Tech",
"description": "A mod that adds weapons, nuclear themed stuff and machines",
"version":"1.0.27-3899",
"version":"1.0.27-3902",
"mcversion": "1.7.10",
"url": "",
"updateUrl": "",