some siege tunneler work, finished dynamite block, meteor ingots in NEI

This commit is contained in:
Bob 2022-02-09 23:42:07 +01:00
parent 68ed3f1d36
commit 481e28f68b
11 changed files with 51 additions and 42 deletions

View File

@ -2665,6 +2665,7 @@ public class ModBlocks {
GameRegistry.registerBlock(bomb_multi, bomb_multi.getUnlocalizedName());
GameRegistry.registerBlock(crashed_balefire, crashed_balefire.getUnlocalizedName());
GameRegistry.registerBlock(fireworks, fireworks.getUnlocalizedName());
GameRegistry.registerBlock(dynamite, dynamite.getUnlocalizedName());
//Turrets
GameRegistry.registerBlock(turret_light, turret_light.getUnlocalizedName());

View File

@ -7,7 +7,6 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
@ -15,13 +14,13 @@ public class EntityTNTPrimedBase extends Entity {
public int fuse;
private EntityLivingBase tntPlacedBy;
public BlockTNTBase bomb;
public EntityTNTPrimedBase(World world) {
super(world);
this.preventEntitySpawning = true;
this.setSize(0.98F, 0.98F);
this.yOffset = this.height / 2.0F;
this.fuse = 80;
}
public EntityTNTPrimedBase(World world, double x, double y, double z, EntityLivingBase entity, BlockTNTBase bomb) {
@ -31,16 +30,17 @@ public class EntityTNTPrimedBase extends Entity {
this.motionX = (double) (-((float) Math.sin((double) f)) * 0.02F);
this.motionY = 0.2D;
this.motionZ = (double) (-((float) Math.cos((double) f)) * 0.02F);
this.fuse = 80;
this.prevPosX = x;
this.prevPosY = y;
this.prevPosZ = z;
this.tntPlacedBy = entity;
this.bomb = bomb;
this.dataWatcher.updateObject(12, Block.getIdFromBlock(bomb));
}
@Override
protected void entityInit() { }
protected void entityInit() {
this.dataWatcher.addObject(12, 0);
}
@Override
protected boolean canTriggerWalking() {
@ -55,11 +55,6 @@ public class EntityTNTPrimedBase extends Entity {
@Override
public void onUpdate() {
if(bomb == null) {
this.setDead();
return;
}
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
@ -87,19 +82,23 @@ public class EntityTNTPrimedBase extends Entity {
}
private void explode() {
this.bomb.explodeEntity(worldObj, posX, posZ, posZ, this);
this.getBomb().explodeEntity(worldObj, posX, posY, posZ, this);
}
public BlockTNTBase getBomb() {
return (BlockTNTBase) Block.getBlockById(this.dataWatcher.getWatchableObjectInt(12));
}
@Override
protected void writeEntityToNBT(NBTTagCompound nbt) {
nbt.setByte("Fuse", (byte) this.fuse);
nbt.setInteger("Tile", Block.getIdFromBlock(bomb));
nbt.setInteger("Tile", this.dataWatcher.getWatchableObjectInt(12));
}
@Override
protected void readEntityFromNBT(NBTTagCompound nbt) {
this.fuse = nbt.getByte("Fuse");
this.bomb = (BlockTNTBase) Block.getBlockById(nbt.getInteger("Tile"));
this.dataWatcher.updateObject(12, nbt.getInteger("Tile"));
}
@Override

View File

@ -1,6 +1,8 @@
package com.hbm.entity.mob;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
/**

View File

@ -20,7 +20,7 @@ import net.minecraft.world.World;
//well it ain't fucking funny
//this stupid fucking random ass bullshit is the P R E C I S E reason i loathe working with entities
//honest to fucking god was the entire mojang dev team on crack when they wrote this?
public class EntitySiegeTunneler extends EntityMob {
public class EntitySiegeTunneler extends EntityBurrowingSwingingBase {
public EntitySiegeTunneler(World world) {
super(world);
@ -30,44 +30,44 @@ public class EntitySiegeTunneler extends EntityMob {
@Override
protected void entityInit() {
super.entityInit();
//this.getDataWatcher().addObject(12, (int) 0);
this.getDataWatcher().addObject(12, (int) 0);
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
//this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D);
//this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23D);
this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23D);
}
public void setTier(SiegeTier tier) {
//this.getDataWatcher().updateObject(12, tier.id);
this.getDataWatcher().updateObject(12, tier.id);
//this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).applyModifier(new AttributeModifier("Tier Speed Mod", tier.speedMod, 1));
//this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(tier.health);
//this.setHealth(this.getMaxHealth());
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).applyModifier(new AttributeModifier("Tier Speed Mod", tier.speedMod, 1));
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(tier.health);
this.setHealth(this.getMaxHealth());
}
public SiegeTier getTier() {
//SiegeTier tier = SiegeTier.tiers[this.getDataWatcher().getWatchableObjectInt(12)];
return /*tier != null ? tier :*/ SiegeTier.CLAY;
SiegeTier tier = SiegeTier.tiers[this.getDataWatcher().getWatchableObjectInt(12)];
return tier != null ? tier : SiegeTier.CLAY;
}
@Override
public void writeEntityToNBT(NBTTagCompound nbt) {
super.writeEntityToNBT(nbt);
//nbt.setInteger("siegeTier", this.getTier().id);
nbt.setInteger("siegeTier", this.getTier().id);
}
@Override
public void readEntityFromNBT(NBTTagCompound nbt) {
super.readEntityFromNBT(nbt);
//this.setTier(SiegeTier.tiers[nbt.getInteger("siegeTier")]);
this.setTier(SiegeTier.tiers[nbt.getInteger("siegeTier")]);
}
@Override
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
//this.setTier(SiegeTier.tiers[rand.nextInt(SiegeTier.getLength())]);
this.setTier(SiegeTier.tiers[rand.nextInt(SiegeTier.getLength())]);
return super.onSpawnWithEgg(data);
}
}

View File

@ -428,6 +428,8 @@ public class MachineRecipes {
getFurnaceOutput(new ItemStack(ModItems.ingot_saturnite), new ItemStack(ModItems.powder_meteorite)).copy());
recipes.put(new ItemStack[] { new ItemStack(ModItems.ingot_steel), new ItemStack(ModItems.nugget_technetium) },
getFurnaceOutput(new ItemStack(ModItems.ingot_steel), new ItemStack(ModItems.nugget_technetium)).copy());
recipes.put(new ItemStack[] { new ItemStack(ModItems.ingot_cobalt), new ItemStack(ModBlocks.block_meteor) },
getFurnaceOutput(new ItemStack(ModItems.ingot_cobalt), new ItemStack(ModBlocks.block_meteor)).copy());
if(GeneralConfig.enableBabyMode) {
recipes.put(new ItemStack[] { new ItemStack(ModItems.canister_empty), new ItemStack(Items.coal) },

View File

@ -2,6 +2,7 @@ package com.hbm.items.tool;
import java.util.List;
import com.hbm.entity.mob.siege.EntitySiegeTunneler;
import com.hbm.items.ModItems;
import com.hbm.items.special.ItemKitCustom;
import com.hbm.lib.Library;
@ -26,14 +27,9 @@ public class ItemWandD extends Item {
if(pos != null) {
List<EntityLiving> list = world.getEntitiesWithinAABB(EntityLiving.class, player.boundingBox.expand(150, 150, 150));
for(EntityLiving e : list) {
e.setRevengeTarget(player);
e.setAttackTarget(player);
e.setLastAttacker(player);
e.getNavigator().tryMoveToXYZ(player.posX, player.posY, player.posZ, 2);
}
EntitySiegeTunneler tunneler = new EntitySiegeTunneler(world);
tunneler.setPosition(pos.blockX, pos.blockY + 1, pos.blockZ);
world.spawnEntityInWorld(tunneler);
//CellularDungeonFactory.meteor.generate(world, x, y, z, world.rand);

View File

@ -497,7 +497,8 @@ public class MainRegistry {
EntityRegistry.registerGlobalEntityID(EntitySiegeSkeleton.class, "entity_meme_skeleton", EntityRegistry.findGlobalUniqueEntityId(), 0x303030, 0x000080);
EntityRegistry.registerGlobalEntityID(EntitySiegeUFO.class, "entity_meme_ufo", EntityRegistry.findGlobalUniqueEntityId(), 0x303030, 0x800000);
EntityRegistry.registerGlobalEntityID(EntitySiegeCraft.class, "entity_meme_craft", EntityRegistry.findGlobalUniqueEntityId(), 0x303030, 0x808000);
EntityRegistry.registerGlobalEntityID(EntitySiegeTunneler.class, "entity_meme_tunneler", EntityRegistry.findGlobalUniqueEntityId(), 0x303030, 0x008080);
EntityRegistry.registerModEntity(EntitySiegeTunneler.class, "entity_meme_tunneler", 167, this, 1000, 1, true); //how about you have a taste of my fucking scrotum?
//EntityRegistry.registerGlobalEntityID(EntitySiegeTunneler.class, "entity_meme_tunneler", EntityRegistry.findGlobalUniqueEntityId(), 0x303030, 0x008080);
EntityRegistry.registerModEntity(EntitySPV.class, "entity_self_propelled_vehicle_mark_1", 160, this, 1000, 1, true);

View File

@ -4,6 +4,7 @@ import org.lwjgl.opengl.GL11;
import com.hbm.entity.item.EntityTNTPrimedBase;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.TextureMap;
@ -43,15 +44,20 @@ public class RenderTNTPrimedBase extends Render {
f2 = (1.0F - ((float) tnt.fuse - f1 + 1.0F) / 100.0F) * 0.8F;
this.bindEntityTexture(tnt);
this.blockRenderer.renderBlockAsItem(tnt.bomb, 0, tnt.getBrightness(f1));
this.blockRenderer.renderBlockAsItem(tnt.getBomb(), 0, tnt.getBrightness(f1));
if(tnt.fuse / 5 % 2 == 0) {
GL11.glScaled(1.01, 1.01, 1.01);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
GL11.glColor4f(1.0F, 1.0F, 1.0F, f2);
this.blockRenderer.renderBlockAsItem(tnt.bomb, 0, 1.0F);
boolean prev = this.blockRenderer.useInventoryTint;
this.blockRenderer.useInventoryTint = false;
this.blockRenderer.renderBlockAsItem(tnt.getBomb(), 0, 1.0F);
this.blockRenderer.useInventoryTint = prev;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);

View File

@ -87,9 +87,9 @@ public class RenderSiegeCraft extends Render {
Vec3 delta = ufo.getLockon().addVector(-ufo.posX, -ufo.posY, -ufo.posZ);
double length = delta.lengthVector();
double scale = 0.1D;
BeamPronter.prontBeam(delta, EnumWaveType.SPIRAL, EnumBeamType.SOLID, 0x101020, 0x101020, 0, (int)(length + 1), 0F, 6, (float)scale * 0.75F);
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x202060, 0x202060, entity.ticksExisted / 2, (int)(length / 2 + 1), (float)scale * 1.5F, 2, 0.0625F);
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x202060, 0x202060, entity.ticksExisted / 4, (int)(length / 2 + 1), (float)scale * 1.5F, 2, 0.0625F);
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x101020, 0x101020, entity.ticksExisted / 6, (int)(length / 2 + 1), (float)scale * 1F, 4, 0.25F);
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x202060, 0x202060, entity.ticksExisted / 2, (int)(length / 2 + 1), (float)scale * 7F, 2, 0.0625F);
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x202060, 0x202060, entity.ticksExisted / 4, (int)(length / 2 + 1), (float)scale * 7F, 2, 0.0625F);
GL11.glPopMatrix();
}

View File

@ -31,7 +31,9 @@ public class RenderSiegeTunneler extends Render {
this.bindEntityTexture(entity);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDisable(GL11.GL_CULL_FACE);
body.renderAll();
body.renderPart("Body");
GL11.glRotated(System.currentTimeMillis() / 3L % 360, 0, -1, 0);
body.renderPart("Drill");
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_FLAT);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 681 B

After

Width:  |  Height:  |  Size: 796 B