veinminer capability for excavator, annihilated siege coins

This commit is contained in:
Bob 2022-12-27 17:56:37 +01:00
parent cbb7013d29
commit 15677ccd6e
10 changed files with 94 additions and 28 deletions

View File

@ -318,8 +318,6 @@ public class EntitySiegeCraft extends EntityUFOBase implements IBossDisplayData
for(ItemStack drop : this.getTier().dropItem) {
this.entityDropItem(drop.copy(), 0F);
}
this.entityDropItem(new ItemStack(ModItems.source, 50), 0F);
}
}
}

View File

@ -180,8 +180,6 @@ public class EntitySiegeSkeleton extends EntityMob implements IRangedAttackMob,
for(ItemStack drop : this.getTier().dropItem) {
this.entityDropItem(drop.copy(), 0F);
}
this.entityDropItem(new ItemStack(ModItems.source, 3), 0F);
}
}
}

View File

@ -145,8 +145,6 @@ public class EntitySiegeUFO extends EntityUFOBase implements IRadiationImmune {
for(ItemStack drop : this.getTier().dropItem) {
this.entityDropItem(drop.copy(), 0F);
}
this.entityDropItem(new ItemStack(ModItems.source, 5), 0F);
}
}
}

View File

@ -130,8 +130,6 @@ public class EntitySiegeZombie extends EntityMob implements IRadiationImmune {
for(ItemStack drop : this.getTier().dropItem) {
this.entityDropItem(drop.copy(), 0F);
}
this.entityDropItem(new ItemStack(ModItems.source, 1), 0F);
}
}

View File

@ -32,15 +32,15 @@ public class SiegeTier {
public static SiegeTier DNT;
public static void registerTiers() {
DEFAULT_BUFF = new SiegeTier(20, "buff") .addDrop(new ItemStack(ModItems.coin_siege, 1, 0)) .setDR(0.2F) .setDMG(2F) .setLaser(0F, 0F, false);
CLAY = new SiegeTier(30, "clay") .addDrop(new ItemStack(ModItems.coin_siege, 1, 1)) .setDR(0.2F) .setDMG(3F) .setLaser(0F, 0F, false);
STONE = new SiegeTier(40, "stone") .addDrop(new ItemStack(ModItems.coin_siege, 1, 2)) .setDR(0.3F) .setDT(1F) .setFP() .setDMG(5F) .setLaser(0F, 0F, true);
IRON = new SiegeTier(50, "iron") .addDrop(new ItemStack(ModItems.coin_siege, 1, 3)) .setDR(0.3F) .setDT(2F) .setFP() .setDMG(7.5F) .setFF() .setLaser(0F, 1F, true);
SILVER = new SiegeTier(70, "silver") .addDrop(new ItemStack(ModItems.coin_siege, 1, 4)) .setDR(0.5F) .setDT(3F) .setNF() .setFP() .setDMG(10F) .setSP(0.5F) .setFF() .setLaser(0.01F, 1F, true);
GOLD = new SiegeTier(100, "gold") .addDrop(new ItemStack(ModItems.coin_siege, 1, 5)) .setDR(0.5F) .setDT(5F) .setNF() .setFP() .setDMG(15F) .setSP(0.5F) .setFF() .setLaser(0.02F, 1.5F, true);
DESH = new SiegeTier(150, "desh") .addDrop(new ItemStack(ModItems.coin_siege, 1, 6)) .setDR(0.7F) .setDT(7F) .setNF() .setFP() .setDMG(25F) .setSP(0.5F) .setFF() .setLaser(0.05F, 1.5F, true);
SCHRAB = new SiegeTier(250, "schrab") .addDrop(new ItemStack(ModItems.coin_siege, 1, 7)) .setDR(0.7F) .setDT(10F) .setNF() .setFP() .setDMG(50F) .setSP(1F) .setFF() .setLaser(0.1F, 2F, true);
DNT = new SiegeTier(500, "dnt") .addDrop(new ItemStack(ModItems.coin_siege, 1, 8)) .setDR(0.9F) .setDT(20F) .setNF() .setFP() .setDMG(100F) .setSP(1F) .setFF() .setLaser(0.2F, 2F, true);
DEFAULT_BUFF = new SiegeTier(20, "buff") .addDrop(new ItemStack(ModItems.ingot_steel, 1, 0)) .setDR(0.2F) .setDMG(2F) .setLaser(0F, 0F, false);
CLAY = new SiegeTier(30, "clay") .addDrop(new ItemStack(ModItems.ingot_steel, 1, 0)) .setDR(0.2F) .setDMG(3F) .setLaser(0F, 0F, false);
STONE = new SiegeTier(40, "stone") .addDrop(new ItemStack(ModItems.ingot_steel, 1, 0)) .setDR(0.3F) .setDT(1F) .setFP() .setDMG(5F) .setLaser(0F, 0F, true);
IRON = new SiegeTier(50, "iron") .addDrop(new ItemStack(ModItems.ingot_steel, 1, 0)) .setDR(0.3F) .setDT(2F) .setFP() .setDMG(7.5F) .setFF() .setLaser(0F, 1F, true);
SILVER = new SiegeTier(70, "silver") .addDrop(new ItemStack(ModItems.ingot_steel, 1, 0)) .setDR(0.5F) .setDT(3F) .setNF() .setFP() .setDMG(10F) .setSP(0.5F) .setFF() .setLaser(0.01F, 1F, true);
GOLD = new SiegeTier(100, "gold") .addDrop(new ItemStack(ModItems.ingot_steel, 1, 0)) .setDR(0.5F) .setDT(5F) .setNF() .setFP() .setDMG(15F) .setSP(0.5F) .setFF() .setLaser(0.02F, 1.5F, true);
DESH = new SiegeTier(150, "desh") .addDrop(new ItemStack(ModItems.ingot_steel, 1, 0)) .setDR(0.7F) .setDT(7F) .setNF() .setFP() .setDMG(25F) .setSP(0.5F) .setFF() .setLaser(0.05F, 1.5F, true);
SCHRAB = new SiegeTier(250, "schrab") .addDrop(new ItemStack(ModItems.ingot_steel, 1, 0)) .setDR(0.7F) .setDT(10F) .setNF() .setFP() .setDMG(50F) .setSP(1F) .setFF() .setLaser(0.1F, 2F, true);
DNT = new SiegeTier(500, "dnt") .addDrop(new ItemStack(ModItems.ingot_steel, 1, 0)) .setDR(0.9F) .setDT(20F) .setNF() .setFP() .setDMG(100F) .setSP(1F) .setFF() .setLaser(0.2F, 2F, true);
}
public int id;

View File

@ -1027,8 +1027,8 @@ public class ModItems {
public static Item coin_maskman;
public static Item coin_worm;
public static Item coin_ufo;
public static Item coin_siege;
public static Item source;
//public static Item coin_siege;
//public static Item source;
public static Item rod_empty;
public static Item rod;
@ -3612,8 +3612,6 @@ public class ModItems {
coin_maskman = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("coin_maskman").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":coin_maskman");
coin_worm = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("coin_worm").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":coin_worm");
coin_ufo = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("coin_ufo").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":coin_ufo");
coin_siege = new ItemSiegeCoin().setUnlocalizedName("coin_siege").setCreativeTab(null);
source = new ItemCustomLore().setRarity(EnumRarity.epic).setUnlocalizedName("source").setCreativeTab(null).setTextureName(RefStrings.MODID + ":source");
recycled_ground = new Item().setUnlocalizedName("recycled_ground").setCreativeTab(null).setTextureName(RefStrings.MODID + ":recycled_ground");
recycled_rock = new Item().setUnlocalizedName("recycled_rock").setCreativeTab(null).setTextureName(RefStrings.MODID + ":recycled_rock");
@ -7832,8 +7830,6 @@ public class ModItems {
GameRegistry.registerItem(coin_maskman, coin_maskman.getUnlocalizedName());
GameRegistry.registerItem(coin_worm, coin_worm.getUnlocalizedName());
GameRegistry.registerItem(coin_ufo, coin_ufo.getUnlocalizedName());
GameRegistry.registerItem(coin_siege, coin_siege.getUnlocalizedName());
GameRegistry.registerItem(source, source.getUnlocalizedName());
GameRegistry.registerItem(medal_liquidator, medal_liquidator.getUnlocalizedName());
GameRegistry.registerItem(v1, v1.getUnlocalizedName());
GameRegistry.registerItem(protection_charm, protection_charm.getUnlocalizedName());

View File

@ -994,6 +994,8 @@ public class MainRegistry {
ignoreMappings.add("hbm:item.telepad");
ignoreMappings.add("hbm:item.rubber_gloves");
ignoreMappings.add("hbm:item.pirfenidone");
ignoreMappings.add("hbm:item.coin_siege");
ignoreMappings.add("hbm:item.source");
/// REMAP ///
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);

View File

@ -86,8 +86,6 @@ public class NEIConfig implements IConfigureNEI {
API.hideItem(new ItemStack(ModBlocks.transission_hatch));
API.hideItem(new ItemStack(ModItems.euphemium_kit));
API.hideItem(new ItemStack(ModItems.bobmazon_hidden));
API.hideItem(new ItemStack(ModItems.coin_siege));
API.hideItem(new ItemStack(ModItems.source));
if(MainRegistry.polaroidID != 11) {
API.hideItem(new ItemStack(ModItems.book_secret));
API.hideItem(new ItemStack(ModItems.book_of_));

View File

@ -392,7 +392,7 @@ public class RenderBobble extends TileEntitySpecialRenderer {
GL11.glTranslated(0.3, 1.4, -0.2);
GL11.glRotated(-100, 1, 0, 0);
GL11.glScaled(0.5, 0.5, 0.5);
renderItem(new ItemStack(ModItems.coin_siege, 1, 5));
renderItem(new ItemStack(ModItems.coin_maskman, 1, 5));
break;
case ADAM29:
GL11.glTranslated(0.45, 1.15, 0.4);

View File

@ -1,5 +1,6 @@
package com.hbm.tileentity.machine;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
@ -17,6 +18,8 @@ import com.hbm.lib.Library;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.EnumUtil;
import com.hbm.util.ItemStackUtil;
import com.hbm.util.fauxpointtwelve.BlockPos;
import api.hbm.conveyor.IConveyorBelt;
import api.hbm.energy.IEnergyUser;
@ -31,6 +34,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
@ -207,14 +211,88 @@ public class TileEntityMachineExcavator extends TileEntityMachineBase implements
Block b = worldObj.getBlock(x, y, z);
if(!this.shouldIgnoreBlock(b, x, y, z)) {
b.dropBlockAsItem(worldObj, x, y, z, worldObj.getBlockMetadata(x, y, z), 0 /* fortune */);
worldObj.func_147480_a(x, y, z, false);
tryMineAtLocation(x, y, z);
}
}
}
}
}
public void tryMineAtLocation(int x ,int y, int z) {
if(this.enableVeinMiner && this.getInstalledDrill().vein) {
/* doing this isn't terribly accurate but just for figuring out if there's OD it works */
Item blockItem = Item.getItemFromBlock(worldObj.getBlock(x, y, z));
if(blockItem != null) {
List<String> names = ItemStackUtil.getOreDictNames(new ItemStack(blockItem));
for(String name : names) {
if(name.startsWith("ore")) {
minX = x;
minY = y;
minZ = z;
maxX = x;
maxY = y;
maxZ = z;
breakRecursively(x, y, z, 10);
recursionBrake.clear();
/* move all excavated items to the last drillable position which is also within collection range */
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(minX, minY, minZ, maxX + 1, maxY + 1, maxZ + 1));
for(EntityItem item : items) item.setPosition(x + 0.5, y + 0.5, z + 0.5);
return;
}
}
}
}
Block b = worldObj.getBlock(x, y, z);
breakSingleBlock(b, x, y, z);
}
private HashSet<BlockPos> recursionBrake = new HashSet();
private int minX = 0, minY = 0, minZ = 0, maxX = 0, maxY = 0, maxZ = 0;
protected void breakRecursively(int x ,int y, int z, int depth) {
if(depth < 0) return;
BlockPos pos = new BlockPos(x, y, z);
if(recursionBrake.contains(pos)) return;
recursionBrake.add(pos);
Block b = worldObj.getBlock(x, y, z);
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
int ix = x + dir.offsetX;
int iy = y + dir.offsetY;
int iz = z + dir.offsetZ;
if(worldObj.getBlock(ix, iy, iz) == b) {
breakRecursively(ix, iy, iz, depth - 1);
}
}
breakSingleBlock(b, x, y, z);
if(x < minX) minX = x;
if(x > maxX) maxX = x;
if(y < minY) minY = y;
if(y > maxY) maxY = y;
if(z < minZ) minZ = z;
if(z > maxZ) maxZ = z;
if(this.enableWalling) {
worldObj.setBlock(x, y, z, ModBlocks.barricade);
}
}
protected void breakSingleBlock(Block b, int x ,int y, int z) {
b.dropBlockAsItem(worldObj, x, y, z, worldObj.getBlockMetadata(x, y, z), 0 /* fortune */);
worldObj.func_147480_a(x, y, z, false);
}
/** builds a wall along the specified ring, replacing fluid blocks. if wallEverything is set, it will also wall off replacable blocks like air or grass */
protected void buildWall(int ring, boolean wallEverything) {
int y = getY();