mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
a lot of small stuff, FEL, anvil and shredder recipes
This commit is contained in:
parent
768c5a4fde
commit
f9da6e1d58
11
src/main/java/api/hbm/block/ILaserable.java
Normal file
11
src/main/java/api/hbm/block/ILaserable.java
Normal file
@ -0,0 +1,11 @@
|
||||
package api.hbm.block;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
//applicable to blocks and tile entities
|
||||
public interface ILaserable {
|
||||
|
||||
public void addEnergy(World world, int x, int y, int z, long energy, ForgeDirection dir);
|
||||
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
package com.hbm.interfaces;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface ILaserable {
|
||||
|
||||
public void addEnergy(long energy, ForgeDirection dir);
|
||||
|
||||
}
|
||||
@ -59,6 +59,8 @@ public class AnvilRecipes {
|
||||
smithingRecipes.add(new AnvilSmithingHotRecipe(3, new ItemStack(ModItems.meteorite_sword_reforged, 1), new ComparableStack(ModItems.meteorite_sword_seared), new ComparableStack(ModItems.ingot_meteorite_forged)));
|
||||
smithingRecipes.add(new AnvilSmithingRecipe(1, new ItemStack(ModItems.gun_ar15, 1), new ComparableStack(ModItems.gun_thompson), new ComparableStack(ModItems.pipe_lead)));
|
||||
smithingRecipes.add(new AnvilSmithingRecipe(1916169, new ItemStack(ModItems.wings_murk, 1), new ComparableStack(ModItems.wings_limp), new ComparableStack(ModItems.particle_tachyon)));
|
||||
|
||||
smithingRecipes.add(new AnvilSmithingCyanideRecipe());
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
package com.hbm.inventory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class AnvilSmithingCyanideRecipe extends AnvilSmithingRecipe {
|
||||
|
||||
public AnvilSmithingCyanideRecipe() {
|
||||
super(0, new ItemStack(Items.bread), new ComparableStack(Items.bread), new ComparableStack(ModItems.plan_c));
|
||||
|
||||
if(!this.output.hasTagCompound())
|
||||
this.output.stackTagCompound = new NBTTagCompound();
|
||||
|
||||
this.output.stackTagCompound.setBoolean("ntmCyanide", true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(ItemStack left, ItemStack right) {
|
||||
return doesStackMatch(right, this.right) && left.getItem() instanceof ItemFood;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int matchesInt(ItemStack left, ItemStack right) {
|
||||
return matches(left, right) ? 0 : -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getOutput(ItemStack left, ItemStack right) {
|
||||
|
||||
ItemStack out = left.copy();
|
||||
if(!out.hasTagCompound())
|
||||
out.stackTagCompound = new NBTTagCompound();
|
||||
|
||||
out.stackTagCompound.setBoolean("ntmCyanide", true);
|
||||
|
||||
return out;
|
||||
}
|
||||
}
|
||||
@ -68,6 +68,8 @@ public class OreDictManager {
|
||||
OreDictionary.registerOre("ingotTcAlloy", ModItems.ingot_tcalloy);
|
||||
OreDictionary.registerOre("ingotGold198", ModItems.ingot_au198);
|
||||
OreDictionary.registerOre("ingotColtan", ModItems.fragment_coltan);
|
||||
|
||||
OreDictionary.registerOre("crystalCinnabar", ModItems.cinnebar);
|
||||
|
||||
OreDictionary.registerOre("nuggetLead", ModItems.nugget_lead);
|
||||
OreDictionary.registerOre("nuggetBeryllium", ModItems.nugget_beryllium);
|
||||
@ -241,6 +243,7 @@ public class OreDictManager {
|
||||
OreDictionary.registerOre("oreLithium", ModBlocks.ore_meteor_lithium);
|
||||
OreDictionary.registerOre("oreStarmetal", ModBlocks.ore_meteor_starmetal);
|
||||
OreDictionary.registerOre("oreAsbestos", ModBlocks.ore_asbestos);
|
||||
OreDictionary.registerOre("oreCinnabar", ModBlocks.ore_cinnebar);
|
||||
|
||||
OreDictionary.registerOre("oreSulfur", ModBlocks.basalt_sulfur);
|
||||
OreDictionary.registerOre("oreAsbestos", ModBlocks.basalt_asbestos);
|
||||
|
||||
@ -232,6 +232,7 @@ public class ShredderRecipes {
|
||||
ShredderRecipes.setRecipe(Blocks.anvil, new ItemStack(ModItems.powder_iron, 31));
|
||||
ShredderRecipes.setRecipe(ModBlocks.chain, new ItemStack(ModItems.powder_steel_tiny, 1));
|
||||
ShredderRecipes.setRecipe(ModBlocks.steel_grate, new ItemStack(ModItems.powder_steel_tiny, 3));
|
||||
ShredderRecipes.setRecipe(ModItems.pipes_steel, new ItemStack(ModItems.powder_steel, 27));
|
||||
|
||||
ShredderRecipes.setRecipe(ModBlocks.deco_pipe, new ItemStack(ModItems.powder_steel, 1));
|
||||
ShredderRecipes.setRecipe(ModBlocks.deco_pipe_rusted, new ItemStack(ModItems.powder_steel, 1));
|
||||
|
||||
@ -2470,7 +2470,7 @@ public class ModItems {
|
||||
plate_lead = new Item().setUnlocalizedName("plate_lead").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_lead");
|
||||
ingot_schraranium = new ItemSchraranium(ItemHazard.sr * ItemHazard.ingot, false, true).setUnlocalizedName("ingot_schraranium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_schraranium");
|
||||
ingot_schrabidium = new ItemHazard(ItemHazard.sa326 * ItemHazard.ingot, false, true).setUnlocalizedName("ingot_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_schrabidium");
|
||||
ingot_schrabidate = new ItemHazard(ItemHazard.sa326 * ItemHazard.ingot, false, true).setUnlocalizedName("ingot_schrabidate").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_schrabidate");
|
||||
ingot_schrabidate = new ItemHazard(ItemHazard.sa326 * 0.1F * ItemHazard.ingot, false, true).setUnlocalizedName("ingot_schrabidate").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_schrabidate");
|
||||
plate_schrabidium = new ItemHazard(ItemHazard.sa326 * ItemHazard.ingot, false, true).setUnlocalizedName("plate_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_schrabidium");
|
||||
plate_copper = new Item().setUnlocalizedName("plate_copper").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_copper");
|
||||
plate_gold = new Item().setUnlocalizedName("plate_gold").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_gold");
|
||||
|
||||
@ -273,7 +273,7 @@ public class ItemChemistryTemplate extends Item {
|
||||
case SCHRABIDIC:
|
||||
return 100;
|
||||
case SCHRABIDATE:
|
||||
return 600;
|
||||
return 150;
|
||||
case COLTAN_CLEANING:
|
||||
return 60;
|
||||
case COLTAN_PAIN:
|
||||
|
||||
@ -87,6 +87,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
@ -115,6 +116,7 @@ import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerUseItemEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
import net.minecraftforge.event.world.BlockEvent.BreakEvent;
|
||||
|
||||
@ -1185,4 +1187,19 @@ public class ModEventHandler {
|
||||
event.cost = 10;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onFoodEaten(PlayerUseItemEvent.Finish event) {
|
||||
|
||||
ItemStack stack = event.item;
|
||||
|
||||
if(stack != null && stack.getItem() instanceof ItemFood) {
|
||||
|
||||
if(stack.hasTagCompound() && stack.getTagCompound().getBoolean("ntmCyanide")) {
|
||||
for(int i = 0; i < 10; i++) {
|
||||
event.entityPlayer.attackEntityFrom(rand.nextBoolean() ? ModDamageSource.euthanizedSelf : ModDamageSource.euthanizedSelf2, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,11 +6,11 @@ import java.util.List;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.ILaserable;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.block.ILaserable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
@ -20,6 +20,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCoreEmitter extends TileEntityMachineBase implements IConsumer, IFluidAcceptor, ILaserable {
|
||||
@ -92,11 +93,18 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements ICon
|
||||
int y = yCoord + dir.offsetY * i;
|
||||
int z = zCoord + dir.offsetZ * i;
|
||||
|
||||
Block block = worldObj.getBlock(x, y, z);
|
||||
TileEntity te = worldObj.getTileEntity(x, y, z);
|
||||
|
||||
if(block instanceof ILaserable) {
|
||||
|
||||
((ILaserable)block).addEnergy(worldObj, x, y, z, out * 98 / 100, dir);
|
||||
break;
|
||||
}
|
||||
|
||||
if(te instanceof ILaserable) {
|
||||
|
||||
((ILaserable)te).addEnergy(out * 98 / 100, dir);
|
||||
((ILaserable)te).addEnergy(worldObj, x, y, z, out * 98 / 100, dir);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -231,7 +239,7 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements ICon
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEnergy(long energy, ForgeDirection dir) {
|
||||
public void addEnergy(World world, int x, int y, int z, long energy, ForgeDirection dir) {
|
||||
|
||||
//do not accept lasers from the front
|
||||
if(dir.getOpposite().ordinal() != this.getBlockMetadata())
|
||||
|
||||
@ -6,18 +6,19 @@ import java.util.List;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.ILaserable;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.block.ILaserable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCoreReceiver extends TileEntityMachineBase implements ISource, IFluidAcceptor, ILaserable {
|
||||
@ -170,7 +171,7 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements ISo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEnergy(long energy, ForgeDirection dir) {
|
||||
public void addEnergy(World world, int x, int y, int z, long energy, ForgeDirection dir) {
|
||||
|
||||
//only accept lasers from the front
|
||||
if(dir.getOpposite().ordinal() == this.getBlockMetadata()) {
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.interfaces.ILaserable;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import api.hbm.block.ILaserable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCrateTungsten extends TileEntityLockableBase implements ISidedInventory, ILaserable {
|
||||
@ -209,7 +210,7 @@ public class TileEntityCrateTungsten extends TileEntityLockableBase implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEnergy(long energy, ForgeDirection dir) {
|
||||
public void addEnergy(World world, int x, int y, int z, long energy, ForgeDirection dir) {
|
||||
heatTimer = 5;
|
||||
|
||||
for(int i = 0; i < slots.length; i++) {
|
||||
|
||||
@ -1,13 +1,18 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityFEL extends TileEntityMachineBase {
|
||||
|
||||
@ -33,6 +38,36 @@ public class TileEntityFEL extends TileEntityMachineBase {
|
||||
|
||||
this.power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
|
||||
int range = 50;
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
int length = 5;
|
||||
|
||||
for(int i = 5; i < range; i++) {
|
||||
|
||||
length = i;
|
||||
|
||||
int x = xCoord + dir.offsetX * i;
|
||||
int y = yCoord + 1;
|
||||
int z = zCoord + dir.offsetZ * i;
|
||||
|
||||
Block b = worldObj.getBlock(x, y, z);
|
||||
|
||||
if(b.getMaterial().isOpaque())
|
||||
continue;
|
||||
|
||||
if(b == ModBlocks.machine_silex) {
|
||||
|
||||
TileEntity te = worldObj.getTileEntity(x + dir.offsetX, yCoord, z + dir.offsetZ);
|
||||
|
||||
if(te instanceof TileEntitySILEX) {
|
||||
TileEntitySILEX silex = (TileEntitySILEX) te;
|
||||
silex.laser += this.watts;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setByte("mode", (byte)mode);
|
||||
|
||||
@ -25,6 +25,7 @@ import net.minecraft.util.WeightedRandom;
|
||||
|
||||
public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcceptor {
|
||||
|
||||
public int laser = 0;
|
||||
public FluidTank tank;
|
||||
public ComparableStack current;
|
||||
public int currentFill;
|
||||
|
||||
@ -22,6 +22,8 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.INpc;
|
||||
import net.minecraft.entity.boss.EntityDragon;
|
||||
import net.minecraft.entity.boss.EntityDragonPart;
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.passive.IAnimals;
|
||||
@ -541,8 +543,16 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
|
||||
return true;
|
||||
}
|
||||
|
||||
if(targetMobs && e instanceof IMob)
|
||||
return true;
|
||||
if(targetMobs) {
|
||||
|
||||
//never target the ender dragon directly
|
||||
if(e instanceof EntityDragon)
|
||||
return false;
|
||||
if(e instanceof EntityDragonPart)
|
||||
return true;
|
||||
if(e instanceof IMob)
|
||||
return true;
|
||||
}
|
||||
|
||||
if(targetMachines) {
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 409 B |
Binary file not shown.
|
After Width: | Height: | Size: 285 B |
Loading…
x
Reference in New Issue
Block a user