misc trash from the past weekend
@ -70,8 +70,8 @@ potion.hbm_phosphorus=Phosphorverbrennung
|
||||
|
||||
tool.ability.recursion=Erzadern-Miner
|
||||
tool.ability.hammer=AoE
|
||||
tool.ability.silktouch=Präzisionswerkzeug
|
||||
tool.ability.fortune=Erz-Extraktor
|
||||
tool.ability.silktouch=Behutsamkeit
|
||||
tool.ability.luck=Glück
|
||||
tool.ability.smelter=Auto-Ofen
|
||||
tool.ability.shredder=Auto-Brecher
|
||||
tool.ability.cnetrifuge=Auto-Zentrifuge
|
||||
|
||||
@ -70,8 +70,8 @@ potion.hbm_phosphorus=Phosphorus Burns
|
||||
|
||||
tool.ability.recursion=Vein Miner
|
||||
tool.ability.hammer=AoE
|
||||
tool.ability.silktouch=Precision Miner
|
||||
tool.ability.fortune=Ore Extractor
|
||||
tool.ability.silktouch=Silk Touch
|
||||
tool.ability.luck=Fortune
|
||||
tool.ability.smelter=Auto-Smelter
|
||||
tool.ability.shredder=Auto-Shredder
|
||||
tool.ability.centrifuge=Auto-Centrifuge
|
||||
@ -1808,7 +1808,7 @@ item.plate_desh.name=Desh Compound Plate
|
||||
item.euphemium_helmet.name=Euphemium Helmet
|
||||
item.euphemium_plate.name=Euphemium Chestplate
|
||||
item.euphemium_legs.name=Euphemium Leggings
|
||||
item.euphemium_boots.name=Euphemiums Boots
|
||||
item.euphemium_boots.name=Euphemium Boots
|
||||
|
||||
item.schrabidium_helmet.name=Schrabidium Helmet
|
||||
item.schrabidium_plate.name=Schrabidium Chestplate
|
||||
|
||||
1724
assets/hbm/models/bombs/fstbmb.obj
Normal file
31
assets/hbm/models/nikonium.obj
Normal file
@ -0,0 +1,31 @@
|
||||
# Blender v2.82 (sub 7) OBJ File: ''
|
||||
# www.blender.org
|
||||
mtllib nikonium.mtl
|
||||
o Cube
|
||||
v 0.000000 1.605417 0.000000
|
||||
v 1.000000 0.086045 -1.000000
|
||||
v 1.000000 0.086045 1.000000
|
||||
v -1.000000 0.086045 -1.000000
|
||||
v -1.000000 0.086045 1.000000
|
||||
vt 0.190840 0.994935
|
||||
vt 0.485265 0.860547
|
||||
vt 0.752129 0.994935
|
||||
vt 1.003561 0.169485
|
||||
vt 0.548559 0.825081
|
||||
vt 0.433782 0.978118
|
||||
vt 0.433782 0.825081
|
||||
vt -0.033031 0.169485
|
||||
vt 0.548559 0.978118
|
||||
vn 0.0000 0.5498 0.8353
|
||||
vn -0.8353 0.5498 0.0000
|
||||
vn 0.0000 -1.0000 0.0000
|
||||
vn 0.8353 0.5498 0.0000
|
||||
vn 0.0000 0.5498 -0.8353
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 3/1/1 1/2/1 5/3/1
|
||||
f 5/3/2 1/2/2 4/4/2
|
||||
f 2/5/3 5/6/3 4/7/3
|
||||
f 2/8/4 1/2/4 3/1/4
|
||||
f 4/4/5 1/2/5 2/8/5
|
||||
f 2/5/3 3/9/3 5/6/3
|
||||
BIN
assets/hbm/sounds/weapon/countdown.ogg
Normal file
BIN
assets/hbm/textures/blocks/concrete_pillar_side.png
Normal file
|
After Width: | Height: | Size: 410 B |
BIN
assets/hbm/textures/blocks/concrete_pillar_top.png
Normal file
|
After Width: | Height: | Size: 706 B |
BIN
assets/hbm/textures/misc/glint.png
Normal file
|
After Width: | Height: | Size: 992 B |
BIN
assets/hbm/textures/misc/glintBF.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 754 B |
|
Before Width: | Height: | Size: 530 B |
|
Before Width: | Height: | Size: 688 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 950 B |
|
Before Width: | Height: | Size: 533 B |
|
Before Width: | Height: | Size: 113 KiB |
|
Before Width: | Height: | Size: 1.8 MiB |
BIN
assets/hbm/textures/models/bombs/fstbmb.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 94 B After Width: | Height: | Size: 94 B |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
BIN
assets/hbm/textures/models/explosion/tomblast.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
assets/hbm/textures/models/misc/nikonium.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
@ -355,6 +355,9 @@ public class ModBlocks {
|
||||
|
||||
public static Block nuke_n45;
|
||||
public static final int guiID_nuke_n45 = 77;
|
||||
|
||||
public static Block nuke_balefire;
|
||||
public static final int guiID_nuke_balefire = 0000;
|
||||
|
||||
public static Block bomb_multi;
|
||||
public static final int guiID_bomb_multi = 10;
|
||||
@ -1006,6 +1009,7 @@ public class ModBlocks {
|
||||
nuke_solinium = new NukeSolinium(Material.iron).setBlockName("nuke_solinium").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":nuke_solinium");
|
||||
nuke_n2 = new NukeN2(Material.iron).setBlockName("nuke_n2").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":nuke_n2");
|
||||
nuke_n45 = new NukeN45(Material.iron).setBlockName("nuke_n45").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":code");
|
||||
//nuke_balefire = new NukeBalefire(Material.iron).setBlockName("nuke_balefire").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":nuke_balefire");
|
||||
|
||||
cel_prime = new CelPrime(Material.iron).setBlockName("cel_prime").setCreativeTab(null).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":code");
|
||||
cel_prime_terminal = new CelPrimePart(Material.iron).setBlockName("cel_prime_terminal").setCreativeTab(null).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":code");
|
||||
|
||||
21
com/hbm/blocks/bomb/NukeBalefire.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.hbm.blocks.bomb;
|
||||
|
||||
import com.hbm.blocks.machine.BlockMachineBase;
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeBalefire;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class NukeBalefire extends BlockMachineBase {
|
||||
|
||||
protected NukeBalefire(Material mat, int guiID) {
|
||||
super(mat, guiID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityNukeBalefire();
|
||||
}
|
||||
|
||||
}
|
||||
@ -7,6 +7,7 @@ import java.util.Random;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.effect.EntityCloudTom;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@ -374,6 +375,12 @@ public class TestEventTester extends Block {
|
||||
EntityFallingBlock entityfallingblock = new EntityFallingBlock(worldObj, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this, worldObj.getBlockMetadata(par2, par3, par4));
|
||||
worldObj.spawnEntityInWorld(entityfallingblock);
|
||||
}*/
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
EntityCloudTom tom = new EntityCloudTom(worldObj, 100);
|
||||
tom.setPosition(par2 + 0.5, par3 + 2, par4 + 0.5);
|
||||
worldObj.spawnEntityInWorld(tom);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
79
com/hbm/entity/effect/EntityCloudTom.java
Normal file
@ -0,0 +1,79 @@
|
||||
package com.hbm.entity.effect;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityCloudTom extends Entity {
|
||||
|
||||
public int maxAge = 100;
|
||||
public int age;
|
||||
|
||||
public EntityCloudTom(World p_i1582_1_) {
|
||||
super(p_i1582_1_);
|
||||
this.setSize(1, 4);
|
||||
this.ignoreFrustumCheck = true;
|
||||
this.isImmuneToFire = true;
|
||||
this.age = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
this.dataWatcher.addObject(16, Integer.valueOf(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBrightnessForRender(float p_70070_1_) {
|
||||
return 15728880;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBrightness(float p_70013_1_) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
public EntityCloudTom(World p_i1582_1_, int maxAge) {
|
||||
super(p_i1582_1_);
|
||||
this.setSize(20, 40);
|
||||
this.isImmuneToFire = true;
|
||||
this.setMaxAge(maxAge);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
this.age++;
|
||||
this.worldObj.lastLightningBolt = 2;
|
||||
|
||||
if (this.age >= this.getMaxAge()) {
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
|
||||
age = p_70037_1_.getShort("age");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
|
||||
p_70014_1_.setShort("age", (short) age);
|
||||
}
|
||||
|
||||
public void setMaxAge(int i) {
|
||||
this.dataWatcher.updateObject(16, Integer.valueOf(i));
|
||||
}
|
||||
|
||||
public int getMaxAge() {
|
||||
return this.dataWatcher.getWatchableObjectInt(16);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isInRangeToRenderDist(double distance) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.entity.projectile;
|
||||
|
||||
import com.hbm.entity.effect.EntityCloudTom;
|
||||
import com.hbm.entity.logic.EntityTomBlast;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -39,6 +40,10 @@ public class EntityTom extends EntityThrowable {
|
||||
tom.posZ = posZ;
|
||||
tom.destructionRange = 500;
|
||||
worldObj.spawnEntityInWorld(tom);
|
||||
|
||||
EntityCloudTom cloud = new EntityCloudTom(worldObj, 500);
|
||||
cloud.setLocationAndAngles(posX, posY, posZ, 0, 0);
|
||||
worldObj.spawnEntityInWorld(cloud);
|
||||
}
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ import java.util.Set;
|
||||
import com.hbm.inventory.CentrifugeRecipes;
|
||||
import com.hbm.inventory.ShredderRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.tool.ItemToolAbility;
|
||||
import com.hbm.items.tool.IItemAbility;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.EnchantmentUtil;
|
||||
|
||||
@ -27,7 +27,7 @@ import net.minecraft.world.World;
|
||||
|
||||
public abstract class ToolAbility {
|
||||
|
||||
public abstract void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool);
|
||||
public abstract void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool);
|
||||
public abstract String getName();
|
||||
public abstract String getFullName();
|
||||
|
||||
@ -42,7 +42,7 @@ public abstract class ToolAbility {
|
||||
private Set<ThreeInts> pos = new HashSet();
|
||||
|
||||
@Override
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool) {
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) {
|
||||
|
||||
Block b = world.getBlock(x, y, z);
|
||||
|
||||
@ -68,7 +68,7 @@ public abstract class ToolAbility {
|
||||
}
|
||||
}
|
||||
|
||||
private void breakExtra(World world, int x, int y, int z, int refX, int refY, int refZ, EntityPlayer player, ItemToolAbility tool, int depth) {
|
||||
private void breakExtra(World world, int x, int y, int z, int refX, int refY, int refZ, EntityPlayer player, IItemAbility tool, int depth) {
|
||||
|
||||
if(pos.contains(new ThreeInts(x, y, z)))
|
||||
return;
|
||||
@ -139,7 +139,7 @@ public abstract class ToolAbility {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool) {
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) {
|
||||
|
||||
for(int a = x - range; a <= x + range; a++) {
|
||||
for(int b = y - range; b <= y + range; b++) {
|
||||
@ -168,7 +168,7 @@ public abstract class ToolAbility {
|
||||
public static class SilkAbility extends ToolAbility {
|
||||
|
||||
@Override
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool) {
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) {
|
||||
|
||||
//if the tool is already enchanted, do nothing
|
||||
if(EnchantmentHelper.getSilkTouchModifier(player) || player.getHeldItem() == null)
|
||||
@ -204,7 +204,7 @@ public abstract class ToolAbility {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool) {
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) {
|
||||
|
||||
//if the tool is already enchanted, do nothing
|
||||
if(EnchantmentHelper.getFortuneModifier(player) > 0 || player.getHeldItem() == null)
|
||||
@ -234,7 +234,7 @@ public abstract class ToolAbility {
|
||||
public static class SmelterAbility extends ToolAbility {
|
||||
|
||||
@Override
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool) {
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) {
|
||||
|
||||
//a band-aid on a gaping wound
|
||||
if(block == Blocks.lit_redstone_ore)
|
||||
@ -263,7 +263,7 @@ public abstract class ToolAbility {
|
||||
public static class ShredderAbility extends ToolAbility {
|
||||
|
||||
@Override
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool) {
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) {
|
||||
|
||||
//a band-aid on a gaping wound
|
||||
if(block == Blocks.lit_redstone_ore)
|
||||
@ -292,7 +292,7 @@ public abstract class ToolAbility {
|
||||
public static class CentrifugeAbility extends ToolAbility {
|
||||
|
||||
@Override
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool) {
|
||||
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) {
|
||||
|
||||
//a band-aid on a gaping wound
|
||||
if(block == Blocks.lit_redstone_ore)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.hbm.handler;
|
||||
|
||||
import com.hbm.items.tool.ItemToolAbility;
|
||||
import com.hbm.items.tool.IItemAbility;
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
@ -13,7 +13,7 @@ import net.minecraft.world.World;
|
||||
|
||||
public abstract class WeaponAbility {
|
||||
|
||||
public abstract void onHit(World world, EntityPlayer player, Entity victim, ItemToolAbility tool);
|
||||
public abstract void onHit(World world, EntityPlayer player, Entity victim, IItemAbility tool);
|
||||
public abstract String getName();
|
||||
public abstract String getFullName();
|
||||
|
||||
@ -26,7 +26,7 @@ public abstract class WeaponAbility {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHit(World world, EntityPlayer player, Entity victim, ItemToolAbility tool) {
|
||||
public void onHit(World world, EntityPlayer player, Entity victim, IItemAbility tool) {
|
||||
|
||||
Library.applyRadData(victim, rad);
|
||||
}
|
||||
@ -51,7 +51,7 @@ public abstract class WeaponAbility {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHit(World world, EntityPlayer player, Entity victim, ItemToolAbility tool) {
|
||||
public void onHit(World world, EntityPlayer player, Entity victim, IItemAbility tool) {
|
||||
|
||||
if(victim instanceof EntityLivingBase) {
|
||||
|
||||
@ -82,7 +82,7 @@ public abstract class WeaponAbility {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHit(World world, EntityPlayer player, Entity victim, ItemToolAbility tool) {
|
||||
public void onHit(World world, EntityPlayer player, Entity victim, IItemAbility tool) {
|
||||
|
||||
if(victim instanceof EntityLivingBase) {
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.items;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.BucketHandler;
|
||||
import com.hbm.handler.ToolAbility;
|
||||
import com.hbm.handler.ToolAbility.LuckAbility;
|
||||
import com.hbm.handler.WeaponAbility;
|
||||
import com.hbm.handler.guncfg.Gun12GaugeFactory;
|
||||
import com.hbm.handler.guncfg.Gun20GaugeFactory;
|
||||
@ -1973,7 +1974,7 @@ public class ModItems {
|
||||
nugget_thorium_fuel = new ItemRadioactive(0.025F).setUnlocalizedName("nugget_thorium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_thorium_fuel");
|
||||
nugget_plutonium_fuel = new ItemRadioactive(1F).setUnlocalizedName("nugget_plutonium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_plutonium_fuel");
|
||||
nugget_mox_fuel = new ItemRadioactive(1F).setUnlocalizedName("nugget_mox_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_mox_fuel");
|
||||
nugget_schrabidium_fuel = new ItemRadioactive(7.5F).setUnlocalizedName("nugget_schrabidium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_schrabidium_fuel");
|
||||
nugget_schrabidium_fuel = new ItemRadioactive(1.5F).setUnlocalizedName("nugget_schrabidium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_schrabidium_fuel");
|
||||
ingot_advanced_alloy = new Item().setUnlocalizedName("ingot_advanced_alloy").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_advanced_alloy");
|
||||
|
||||
niter = new Item().setUnlocalizedName("niter").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":salpeter");
|
||||
@ -3506,7 +3507,7 @@ public class ModItems {
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(5)).setUnlocalizedName("chainsaw").setTextureName(RefStrings.MODID + ":chainsaw");
|
||||
|
||||
schrabidium_sword = new ItemToolAbility(150, 0, MainRegistry.tMatSchrab, EnumToolType.SWORD)
|
||||
schrabidium_sword = new ItemSwordAbility(150, 0, MainRegistry.tMatSchrab)
|
||||
.addHitAbility(new WeaponAbility.RadiationAbility(50F))
|
||||
.addHitAbility(new WeaponAbility.VampireAbility(2F))
|
||||
.setRarity(EnumRarity.rare).setUnlocalizedName("schrabidium_sword").setTextureName(RefStrings.MODID + ":schrabidium_sword");
|
||||
@ -3516,6 +3517,7 @@ public class ModItems {
|
||||
.addBreakAbility(new ToolAbility.HammerAbility(2))
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(10))
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(5))
|
||||
.addBreakAbility(new ToolAbility.SmelterAbility())
|
||||
.addBreakAbility(new ToolAbility.ShredderAbility())
|
||||
.setRarity(EnumRarity.rare).setUnlocalizedName("schrabidium_pickaxe").setTextureName(RefStrings.MODID + ":schrabidium_pickaxe");
|
||||
@ -3525,6 +3527,7 @@ public class ModItems {
|
||||
.addBreakAbility(new ToolAbility.HammerAbility(2))
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(10))
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(5))
|
||||
.addBreakAbility(new ToolAbility.SmelterAbility())
|
||||
.addBreakAbility(new ToolAbility.ShredderAbility())
|
||||
.setRarity(EnumRarity.rare).setUnlocalizedName("schrabidium_axe").setTextureName(RefStrings.MODID + ":schrabidium_axe");
|
||||
@ -3534,24 +3537,25 @@ public class ModItems {
|
||||
.addBreakAbility(new ToolAbility.HammerAbility(2))
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(10))
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(5))
|
||||
.addBreakAbility(new ToolAbility.SmelterAbility())
|
||||
.addBreakAbility(new ToolAbility.ShredderAbility())
|
||||
.setRarity(EnumRarity.rare).setUnlocalizedName("schrabidium_shovel").setTextureName(RefStrings.MODID + ":schrabidium_shovel");
|
||||
|
||||
schrabidium_hoe = new HoeSchrabidium(MainRegistry.tMatSchrab).setUnlocalizedName("schrabidium_hoe").setTextureName(RefStrings.MODID + ":schrabidium_hoe");
|
||||
|
||||
titanium_sword = new ItemToolAbility(6.5F, 0, MainRegistry.tMatTitan, EnumToolType.SWORD).setUnlocalizedName("titanium_sword").setTextureName(RefStrings.MODID + ":titanium_sword");
|
||||
titanium_sword = new ItemSwordAbility(6.5F, 0, MainRegistry.tMatTitan).setUnlocalizedName("titanium_sword").setTextureName(RefStrings.MODID + ":titanium_sword");
|
||||
titanium_pickaxe = new ItemToolAbility(4.5F, 0, MainRegistry.tMatTitan, EnumToolType.PICKAXE).setUnlocalizedName("titanium_pickaxe").setTextureName(RefStrings.MODID + ":titanium_pickaxe");
|
||||
titanium_axe = new ItemToolAbility(5.5F, 0, MainRegistry.tMatTitan, EnumToolType.AXE).setUnlocalizedName("titanium_axe").setTextureName(RefStrings.MODID + ":titanium_axe");
|
||||
titanium_shovel = new ItemToolAbility(3.5F, 0, MainRegistry.tMatTitan, EnumToolType.SHOVEL).setUnlocalizedName("titanium_shovel").setTextureName(RefStrings.MODID + ":titanium_shovel");
|
||||
titanium_hoe = new ModHoe(MainRegistry.tMatTitan).setUnlocalizedName("titanium_hoe").setTextureName(RefStrings.MODID + ":titanium_hoe");
|
||||
steel_sword = new ItemToolAbility(6F, 0, MainRegistry.tMatSteel, EnumToolType.SWORD).setUnlocalizedName("steel_sword").setTextureName(RefStrings.MODID + ":steel_sword");
|
||||
steel_sword = new ItemSwordAbility(6F, 0, MainRegistry.tMatSteel).setUnlocalizedName("steel_sword").setTextureName(RefStrings.MODID + ":steel_sword");
|
||||
steel_pickaxe = new ItemToolAbility(4F, 0, MainRegistry.tMatSteel, EnumToolType.PICKAXE).setUnlocalizedName("steel_pickaxe").setTextureName(RefStrings.MODID + ":steel_pickaxe");
|
||||
steel_axe = new ItemToolAbility(5F, 0, MainRegistry.tMatSteel, EnumToolType.AXE).setUnlocalizedName("steel_axe").setTextureName(RefStrings.MODID + ":steel_axe");
|
||||
steel_shovel = new ItemToolAbility(3F, 0, MainRegistry.tMatSteel, EnumToolType.SHOVEL).setUnlocalizedName("steel_shovel").setTextureName(RefStrings.MODID + ":steel_shovel");
|
||||
steel_hoe = new ModHoe(MainRegistry.tMatSteel).setUnlocalizedName("steel_hoe").setTextureName(RefStrings.MODID + ":steel_hoe");
|
||||
|
||||
alloy_sword = new ItemToolAbility(9F, 0, MainRegistry.tMatAlloy, EnumToolType.SWORD)
|
||||
alloy_sword = new ItemSwordAbility(9F, 0, MainRegistry.tMatAlloy)
|
||||
.addHitAbility(new WeaponAbility.StunAbility(2)).setUnlocalizedName("alloy_sword").setTextureName(RefStrings.MODID + ":alloy_sword");
|
||||
|
||||
alloy_pickaxe = new ItemToolAbility(6F, 0, MainRegistry.tMatAlloy, EnumToolType.PICKAXE)
|
||||
@ -3565,78 +3569,90 @@ public class ModItems {
|
||||
|
||||
alloy_hoe = new ModHoe(MainRegistry.tMatAlloy).setUnlocalizedName("alloy_hoe").setTextureName(RefStrings.MODID + ":alloy_hoe");
|
||||
|
||||
cmb_sword = new ItemToolAbility(50F, 0, MainRegistry.tMatCMB, EnumToolType.SWORD)
|
||||
cmb_sword = new ItemSwordAbility(50F, 0, MainRegistry.tMatCMB)
|
||||
.addHitAbility(new WeaponAbility.StunAbility(2))
|
||||
.addHitAbility(new WeaponAbility.VampireAbility(2F)).setUnlocalizedName("cmb_sword").setTextureName(RefStrings.MODID + ":cmb_sword");
|
||||
|
||||
cmb_pickaxe = new ItemToolAbility(10F, 0, MainRegistry.tMatCMB, EnumToolType.PICKAXE)
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(5))
|
||||
.addBreakAbility(new ToolAbility.SmelterAbility())
|
||||
.addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("cmb_pickaxe").setTextureName(RefStrings.MODID + ":cmb_pickaxe");
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(3)).setUnlocalizedName("cmb_pickaxe").setTextureName(RefStrings.MODID + ":cmb_pickaxe");
|
||||
|
||||
cmb_axe = new ItemToolAbility(12.5F, 0, MainRegistry.tMatCMB, EnumToolType.AXE)
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(5))
|
||||
.addBreakAbility(new ToolAbility.SmelterAbility())
|
||||
.addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("cmb_axe").setTextureName(RefStrings.MODID + ":cmb_axe");
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(3)).setUnlocalizedName("cmb_axe").setTextureName(RefStrings.MODID + ":cmb_axe");
|
||||
|
||||
cmb_shovel = new ItemToolAbility(8F, 0, MainRegistry.tMatCMB, EnumToolType.SHOVEL)
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(5))
|
||||
.addBreakAbility(new ToolAbility.SmelterAbility())
|
||||
.addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("cmb_shovel").setTextureName(RefStrings.MODID + ":cmb_shovel");
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(3)).setUnlocalizedName("cmb_shovel").setTextureName(RefStrings.MODID + ":cmb_shovel");
|
||||
|
||||
cmb_hoe = new ModHoe(MainRegistry.tMatCMB).setUnlocalizedName("cmb_hoe").setTextureName(RefStrings.MODID + ":cmb_hoe");
|
||||
|
||||
elec_sword = new ItemToolAbilityPower(15F, 0, MainRegistry.tMatElec, EnumToolType.SWORD, 500000, 1000, 100)
|
||||
elec_sword = new ItemSwordAbilityPower(15F, 0, MainRegistry.tMatElec, 500000, 1000, 100)
|
||||
.addHitAbility(new WeaponAbility.StunAbility(5)).setUnlocalizedName("elec_sword").setTextureName(RefStrings.MODID + ":elec_sword_anim");
|
||||
|
||||
elec_pickaxe = new ItemToolAbilityPower(10F, 0, MainRegistry.tMatElec, EnumToolType.PICKAXE, 500000, 1000, 100)
|
||||
.addBreakAbility(new ToolAbility.HammerAbility(2))
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(5))
|
||||
.addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("elec_pickaxe").setTextureName(RefStrings.MODID + ":elec_drill_anim");
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(2)).setUnlocalizedName("elec_pickaxe").setTextureName(RefStrings.MODID + ":elec_drill_anim");
|
||||
|
||||
elec_axe = new ItemToolAbilityPower(12.5F, 0, MainRegistry.tMatElec, EnumToolType.AXE, 500000, 1000, 100)
|
||||
.addBreakAbility(new ToolAbility.HammerAbility(2))
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(5))
|
||||
.addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("elec_axe").setTextureName(RefStrings.MODID + ":elec_chainsaw_anim");
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(2)).setUnlocalizedName("elec_axe").setTextureName(RefStrings.MODID + ":elec_chainsaw_anim");
|
||||
|
||||
elec_shovel = new ItemToolAbilityPower(7.5F, 0, MainRegistry.tMatElec, EnumToolType.SHOVEL, 500000, 1000, 100)
|
||||
.addBreakAbility(new ToolAbility.HammerAbility(2))
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(5))
|
||||
.addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("elec_shovel").setTextureName(RefStrings.MODID + ":elec_shovel_anim");
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(2)).setUnlocalizedName("elec_shovel").setTextureName(RefStrings.MODID + ":elec_shovel_anim");
|
||||
|
||||
desh_sword = new ItemToolAbility(15F, 0, MainRegistry.tMatDesh, EnumToolType.SWORD)
|
||||
desh_sword = new ItemSwordAbility(15F, 0, MainRegistry.tMatDesh)
|
||||
.addHitAbility(new WeaponAbility.StunAbility(2)).setUnlocalizedName("desh_sword").setTextureName(RefStrings.MODID + ":desh_sword");
|
||||
|
||||
desh_pickaxe = new ItemToolAbility(5F, -0.05, MainRegistry.tMatDesh, EnumToolType.PICKAXE)
|
||||
.addBreakAbility(new ToolAbility.HammerAbility(1))
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(3))
|
||||
.addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("desh_pickaxe").setTextureName(RefStrings.MODID + ":desh_pickaxe");
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(2)).setUnlocalizedName("desh_pickaxe").setTextureName(RefStrings.MODID + ":desh_pickaxe");
|
||||
|
||||
desh_axe = new ItemToolAbility(6.5F, -0.05, MainRegistry.tMatDesh, EnumToolType.AXE)
|
||||
.addBreakAbility(new ToolAbility.HammerAbility(1))
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(3))
|
||||
.addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("desh_axe").setTextureName(RefStrings.MODID + ":desh_axe");
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(2)).setUnlocalizedName("desh_axe").setTextureName(RefStrings.MODID + ":desh_axe");
|
||||
|
||||
desh_shovel = new ItemToolAbility(4F, -0.05, MainRegistry.tMatDesh, EnumToolType.SHOVEL)
|
||||
.addBreakAbility(new ToolAbility.HammerAbility(1))
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(3))
|
||||
.addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("desh_shovel").setTextureName(RefStrings.MODID + ":desh_shovel");
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(2)).setUnlocalizedName("desh_shovel").setTextureName(RefStrings.MODID + ":desh_shovel");
|
||||
|
||||
desh_hoe = new ModHoe(MainRegistry.tMatDesh).setUnlocalizedName("desh_hoe").setTextureName(RefStrings.MODID + ":desh_hoe");
|
||||
|
||||
cobalt_sword = new ItemToolAbility(12F, 0, MainRegistry.tMatCobalt, EnumToolType.SWORD).setUnlocalizedName("cobalt_sword").setTextureName(RefStrings.MODID + ":cobalt_sword");
|
||||
cobalt_sword = new ItemSwordAbility(12F, 0, MainRegistry.tMatCobalt).setUnlocalizedName("cobalt_sword").setTextureName(RefStrings.MODID + ":cobalt_sword");
|
||||
|
||||
cobalt_pickaxe = new ItemToolAbility(4F, 0, MainRegistry.tMatCobalt, EnumToolType.PICKAXE)
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(4))
|
||||
.addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("cobalt_pickaxe").setTextureName(RefStrings.MODID + ":cobalt_pickaxe");
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(1)).setUnlocalizedName("cobalt_pickaxe").setTextureName(RefStrings.MODID + ":cobalt_pickaxe");
|
||||
|
||||
cobalt_axe = new ItemToolAbility(6F, 0, MainRegistry.tMatCobalt, EnumToolType.AXE)
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(4))
|
||||
.addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("cobalt_axe").setTextureName(RefStrings.MODID + ":cobalt_axe");
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(1)).setUnlocalizedName("cobalt_axe").setTextureName(RefStrings.MODID + ":cobalt_axe");
|
||||
|
||||
cobalt_shovel = new ItemToolAbility(3.5F, 0, MainRegistry.tMatCobalt, EnumToolType.SHOVEL)
|
||||
.addBreakAbility(new ToolAbility.RecursionAbility(4))
|
||||
.addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("cobalt_shovel").setTextureName(RefStrings.MODID + ":cobalt_shovel");
|
||||
.addBreakAbility(new ToolAbility.SilkAbility())
|
||||
.addBreakAbility(new LuckAbility(1)).setUnlocalizedName("cobalt_shovel").setTextureName(RefStrings.MODID + ":cobalt_shovel");
|
||||
|
||||
cobalt_hoe = new ModHoe(MainRegistry.tMatCobalt).setUnlocalizedName("cobalt_hoe").setTextureName(RefStrings.MODID + ":cobalt_hoe");
|
||||
|
||||
|
||||
9
com/hbm/items/tool/IItemAbility.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IItemAbility {
|
||||
|
||||
public void breakExtraBlock(World world, int x, int y, int z, EntityPlayer player, int refX, int refY, int refZ);
|
||||
}
|
||||
187
com/hbm/items/tool/ItemSwordAbility.java
Normal file
@ -0,0 +1,187 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.hbm.handler.WeaponAbility;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.play.client.C07PacketPlayerDigging;
|
||||
import net.minecraft.network.play.server.S23PacketBlockChange;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
|
||||
public class ItemSwordAbility extends ItemSword implements IItemAbility {
|
||||
|
||||
private EnumRarity rarity = EnumRarity.common;
|
||||
//was there a reason for this to be private?
|
||||
protected float damage;
|
||||
protected double movement;
|
||||
private List<WeaponAbility> hitAbility = new ArrayList();
|
||||
|
||||
public ItemSwordAbility(float damage, double movement, ToolMaterial material) {
|
||||
super(material);
|
||||
this.damage = damage;
|
||||
this.movement = movement;
|
||||
}
|
||||
|
||||
public ItemSwordAbility addHitAbility(WeaponAbility weaponAbility) {
|
||||
this.hitAbility.add(weaponAbility);
|
||||
return this;
|
||||
}
|
||||
|
||||
//<insert obvious Rarity joke here>
|
||||
public ItemSwordAbility setRarity(EnumRarity rarity) {
|
||||
this.rarity = rarity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public EnumRarity getRarity(ItemStack stack) {
|
||||
return this.rarity != EnumRarity.common ? this.rarity : super.getRarity(stack);
|
||||
}
|
||||
|
||||
public boolean hitEntity(ItemStack stack, EntityLivingBase victim, EntityLivingBase attacker) {
|
||||
|
||||
if(!attacker.worldObj.isRemote && !this.hitAbility.isEmpty() && attacker instanceof EntityPlayer && canOperate(stack)) {
|
||||
|
||||
for(WeaponAbility ability : this.hitAbility) {
|
||||
ability.onHit(attacker.worldObj, (EntityPlayer) attacker, victim, this);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getItemAttributeModifiers() {
|
||||
|
||||
Multimap multimap = HashMultimap.create();
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", (double)this.damage, 0));
|
||||
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", movement, 1));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
public void breakExtraBlock(World world, int x, int y, int z, EntityPlayer playerEntity, int refX, int refY, int refZ) {
|
||||
|
||||
if (world.isAirBlock(x, y, z))
|
||||
return;
|
||||
|
||||
if(!(playerEntity instanceof EntityPlayerMP))
|
||||
return;
|
||||
|
||||
EntityPlayerMP player = (EntityPlayerMP) playerEntity;
|
||||
ItemStack stack = player.getHeldItem();
|
||||
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(!canHarvestBlock(block, stack))
|
||||
return;
|
||||
|
||||
Block refBlock = world.getBlock(refX, refY, refZ);
|
||||
float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ);
|
||||
float strength = ForgeHooks.blockStrength(block, player, world, x,y,z);
|
||||
|
||||
if (!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength/strength > 10f)
|
||||
return;
|
||||
|
||||
BlockEvent.BreakEvent event = ForgeHooks.onBlockBreakEvent(world, player.theItemInWorldManager.getGameType(), player, x,y,z);
|
||||
if(event.isCanceled())
|
||||
return;
|
||||
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
block.onBlockHarvested(world, x, y, z, meta, player);
|
||||
if (block.removedByPlayer(world, player, x, y, z, false))
|
||||
block.onBlockDestroyedByPlayer(world, x, y, z, meta);
|
||||
|
||||
if (!world.isRemote) {
|
||||
player.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
player.getCurrentEquippedItem().func_150999_a(world, block, x, y, z, player);
|
||||
|
||||
if (!world.isRemote) {
|
||||
|
||||
block.onBlockHarvested(world, x,y,z, meta, player);
|
||||
|
||||
if(block.removedByPlayer(world, player, x,y,z, true))
|
||||
{
|
||||
block.onBlockDestroyedByPlayer( world, x,y,z, meta);
|
||||
block.harvestBlock(world, player, x,y,z, meta);
|
||||
block.dropXpOnBlockBreak(world, x,y,z, event.getExpToDrop());
|
||||
}
|
||||
|
||||
player.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world));
|
||||
|
||||
} else {
|
||||
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12));
|
||||
if(block.removedByPlayer(world, player, x,y,z, true))
|
||||
{
|
||||
block.onBlockDestroyedByPlayer(world, x,y,z, meta);
|
||||
}
|
||||
ItemStack itemstack = player.getCurrentEquippedItem();
|
||||
if (itemstack != null)
|
||||
{
|
||||
itemstack.func_150999_a(world, block, x, y, z, player);
|
||||
|
||||
if (itemstack.stackSize == 0)
|
||||
{
|
||||
player.destroyCurrentEquippedItem();
|
||||
}
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C07PacketPlayerDigging(2, x, y, z, Minecraft.getMinecraft().objectMouseOver.sideHit));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
if(!this.hitAbility.isEmpty()) {
|
||||
|
||||
list.add("Weapon modifiers: ");
|
||||
|
||||
for(WeaponAbility ability : this.hitAbility) {
|
||||
list.add(" " + EnumChatFormatting.RED + ability.getFullName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int getAbility(ItemStack stack) {
|
||||
|
||||
if(stack.hasTagCompound())
|
||||
return stack.stackTagCompound.getInteger("ability");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void setAbility(ItemStack stack, int ability) {
|
||||
|
||||
if(!stack.hasTagCompound())
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
|
||||
stack.stackTagCompound.setInteger("ability", ability);
|
||||
}
|
||||
|
||||
protected boolean canOperate(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
120
com/hbm/items/tool/ItemSwordAbilityPower.java
Normal file
@ -0,0 +1,120 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ItemSwordAbilityPower extends ItemSwordAbility {
|
||||
|
||||
public long maxPower = 1;
|
||||
public long chargeRate;
|
||||
public long consumption;
|
||||
|
||||
public ItemSwordAbilityPower(float damage, double movement, ToolMaterial material, long maxPower, long chargeRate, long consumption) {
|
||||
super(damage, movement, material);
|
||||
this.maxPower = maxPower;
|
||||
this.chargeRate = chargeRate;
|
||||
this.consumption = consumption;
|
||||
this.setMaxDamage(1);
|
||||
}
|
||||
|
||||
public void chargeBattery(ItemStack stack, long i) {
|
||||
if(stack.getItem() instanceof ItemSwordAbilityPower) {
|
||||
if(stack.hasTagCompound()) {
|
||||
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") + i);
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setCharge(ItemStack stack, long i) {
|
||||
if(stack.getItem() instanceof ItemSwordAbilityPower) {
|
||||
if(stack.hasTagCompound()) {
|
||||
stack.stackTagCompound.setLong("charge", i);
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void dischargeBattery(ItemStack stack, long i) {
|
||||
if(stack.getItem() instanceof ItemSwordAbilityPower) {
|
||||
if(stack.hasTagCompound()) {
|
||||
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") - i);
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", this.maxPower - i);
|
||||
}
|
||||
|
||||
if(stack.stackTagCompound.getLong("charge") < 0)
|
||||
stack.stackTagCompound.setLong("charge", 0);
|
||||
}
|
||||
}
|
||||
|
||||
public static long getCharge(ItemStack stack) {
|
||||
if(stack.getItem() instanceof ItemSwordAbilityPower) {
|
||||
if(stack.hasTagCompound()) {
|
||||
return stack.stackTagCompound.getLong("charge");
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", ((ItemSwordAbilityPower)stack.getItem()).maxPower);
|
||||
return stack.stackTagCompound.getLong("charge");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
list.add("Charge: " + Library.getShortNumber(getCharge(stack)) + " / " + Library.getShortNumber(maxPower));
|
||||
|
||||
super.addInformation(stack, player, list, ext);
|
||||
}
|
||||
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
|
||||
return getCharge(stack) < maxPower;
|
||||
}
|
||||
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
|
||||
return 1 - (double)getCharge(stack) / (double)maxPower;
|
||||
}
|
||||
|
||||
protected boolean canOperate(ItemStack stack) {
|
||||
|
||||
return getCharge(stack) >= this.consumption;
|
||||
}
|
||||
|
||||
public long getMaxCharge() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
public long getChargeRate() {
|
||||
return chargeRate;
|
||||
}
|
||||
|
||||
public static long getMaxChargeStatic(ItemStack stack) {
|
||||
return ((ItemSwordAbilityPower)stack.getItem()).maxPower;
|
||||
}
|
||||
|
||||
public void setDamage(ItemStack stack, int damage)
|
||||
{
|
||||
this.dischargeBattery(stack, damage * consumption);
|
||||
}
|
||||
|
||||
public boolean isDamageable() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -23,7 +23,6 @@ import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
@ -37,7 +36,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
|
||||
public class ItemToolAbility extends ItemTool {
|
||||
public class ItemToolAbility extends ItemTool implements IItemAbility {
|
||||
|
||||
private EnumToolType toolType;
|
||||
private EnumRarity rarity = EnumRarity.common;
|
||||
@ -49,9 +48,6 @@ public class ItemToolAbility extends ItemTool {
|
||||
|
||||
public static enum EnumToolType {
|
||||
|
||||
SWORD(
|
||||
Sets.newHashSet(new Material[] { Material.plants, Material.vine, Material.coral, Material.leaves, Material.gourd , Material.web })
|
||||
),
|
||||
PICKAXE(
|
||||
Sets.newHashSet(new Material[] { Material.iron, Material.anvil, Material.rock }),
|
||||
Sets.newHashSet(new Block[] { Blocks.cobblestone, Blocks.double_stone_slab, Blocks.stone_slab, Blocks.stone, Blocks.sandstone, Blocks.mossy_cobblestone, Blocks.iron_ore, Blocks.iron_block, Blocks.coal_ore, Blocks.gold_block, Blocks.gold_ore, Blocks.diamond_ore, Blocks.diamond_block, Blocks.ice, Blocks.netherrack, Blocks.lapis_ore, Blocks.lapis_block, Blocks.redstone_ore, Blocks.lit_redstone_ore, Blocks.rail, Blocks.detector_rail, Blocks.golden_rail, Blocks.activator_rail })
|
||||
@ -117,11 +113,6 @@ public class ItemToolAbility extends ItemTool {
|
||||
ability.onHit(attacker.worldObj, (EntityPlayer) attacker, victim, this);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.toolType == EnumToolType.SWORD)
|
||||
stack.damageItem(1, attacker);
|
||||
else
|
||||
stack.damageItem(2, attacker);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -288,9 +279,6 @@ public class ItemToolAbility extends ItemTool {
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
|
||||
if(this.toolType == EnumToolType.SWORD)
|
||||
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
|
||||
|
||||
if(world.isRemote || this.breakAbility.size() < 2 || !canOperate(stack))
|
||||
return super.onItemRightClick(stack, world, player);
|
||||
|
||||
@ -316,20 +304,6 @@ public class ItemToolAbility extends ItemTool {
|
||||
return stack;
|
||||
}
|
||||
|
||||
public int getMaxItemUseDuration(ItemStack stack) {
|
||||
if(this.toolType == EnumToolType.SWORD)
|
||||
return 72000;
|
||||
else
|
||||
return super.getMaxItemUseDuration(stack);
|
||||
}
|
||||
|
||||
public EnumAction getItemUseAction(ItemStack stack) {
|
||||
if(this.toolType == EnumToolType.SWORD)
|
||||
return EnumAction.block;
|
||||
else
|
||||
return super.getItemUseAction(stack);
|
||||
}
|
||||
|
||||
private ToolAbility getCurrentAbility(ItemStack stack) {
|
||||
|
||||
int ability = getAbility(stack) % this.breakAbility.size();
|
||||
|
||||
@ -223,6 +223,7 @@ public class ClientProxy extends ServerProxy
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCloudFleija.class, new RenderCloudFleija());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCloudFleijaRainbow.class, new RenderCloudRainbow());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCloudSolinium.class, new RenderCloudSolinium());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCloudTom.class, new RenderCloudTom());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityNukeCloudNoShroom.class, new RenderNoCloud());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityFalloutRain.class, new RenderFallout());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBlackHole.class, new RenderBlackHole());
|
||||
|
||||
@ -715,6 +715,7 @@ public class MainRegistry
|
||||
EntityRegistry.registerModEntity(EntitySoyuz.class, "entity_soyuz", 144, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntitySoyuzCapsule.class, "entity_soyuz_capsule", 145, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityMovingItem.class, "entity_c_item", 146, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityCloudTom.class, "entity_moonstone_blast", 147, this, 1000, 1, true);
|
||||
|
||||
EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00);
|
||||
EntityRegistry.registerGlobalEntityID(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x813b9b, 0xd71fdd);
|
||||
|
||||
@ -113,13 +113,14 @@ public class ResourceManager {
|
||||
public static final IModelCustom shredder_blade = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/shredder_blade.obj"));
|
||||
|
||||
//Bombs
|
||||
public static final IModelCustom bomb_solinium = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/ufp.obj"));
|
||||
public static final IModelCustom n2 = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/n2.obj"));
|
||||
public static final IModelCustom n45_globe = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/n45_globe.obj"));
|
||||
public static final IModelCustom n45_knob = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/n45_knob.obj"));
|
||||
public static final IModelCustom n45_rod = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/n45_rod.obj"));
|
||||
public static final IModelCustom n45_stand = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/n45_stand.obj"));
|
||||
public static final IModelCustom n45_chain = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/n45_chain.obj"));
|
||||
public static final IModelCustom bomb_solinium = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/bombs/ufp.obj"));
|
||||
public static final IModelCustom n2 = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/bombs/n2.obj"));
|
||||
public static final IModelCustom n45_globe = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/bombs/n45_globe.obj"));
|
||||
public static final IModelCustom n45_knob = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/bombs/n45_knob.obj"));
|
||||
public static final IModelCustom n45_rod = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/bombs/n45_rod.obj"));
|
||||
public static final IModelCustom n45_stand = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/bombs/n45_stand.obj"));
|
||||
public static final IModelCustom n45_chain = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/bombs/n45_chain.obj"));
|
||||
public static final IModelCustom fstbmb = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/bombs/fstbmb.obj"));
|
||||
|
||||
//Cel-Prime
|
||||
public static final IModelCustom cp_tower = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/cel_prime_tower.obj"));
|
||||
@ -263,13 +264,14 @@ public class ResourceManager {
|
||||
public static final ResourceLocation forcefield_top_tex = new ResourceLocation(RefStrings.MODID, "textures/models/forcefield_top.png");
|
||||
|
||||
//Bombs
|
||||
public static final ResourceLocation bomb_solinium_tex = new ResourceLocation(RefStrings.MODID, "textures/models/ufp.png");
|
||||
public static final ResourceLocation n2_tex = new ResourceLocation(RefStrings.MODID, "textures/models/n2.png");
|
||||
public static final ResourceLocation n45_globe_tex = new ResourceLocation(RefStrings.MODID, "textures/models/n45_globe.png");
|
||||
public static final ResourceLocation n45_knob_tex = new ResourceLocation(RefStrings.MODID, "textures/models/n45_knob.png");
|
||||
public static final ResourceLocation n45_rod_tex = new ResourceLocation(RefStrings.MODID, "textures/models/n45_rod.png");
|
||||
public static final ResourceLocation bomb_solinium_tex = new ResourceLocation(RefStrings.MODID, "textures/models/bombs/ufp.png");
|
||||
public static final ResourceLocation n2_tex = new ResourceLocation(RefStrings.MODID, "textures/models/bombs/n2.png");
|
||||
public static final ResourceLocation n45_globe_tex = new ResourceLocation(RefStrings.MODID, "textures/models/bombs/n45_globe.png");
|
||||
public static final ResourceLocation n45_knob_tex = new ResourceLocation(RefStrings.MODID, "textures/models/bombs/n45_knob.png");
|
||||
public static final ResourceLocation n45_rod_tex = new ResourceLocation(RefStrings.MODID, "textures/models/bombs/n45_rod.png");
|
||||
public static final ResourceLocation n45_stand_tex = new ResourceLocation(RefStrings.MODID, "textures/models/n45_stand.png");
|
||||
public static final ResourceLocation n45_chain_tex = new ResourceLocation(RefStrings.MODID, "textures/models/n45_chain.png");
|
||||
public static final ResourceLocation n45_chain_tex = new ResourceLocation(RefStrings.MODID, "textures/models/bombs/n45_chain.png");
|
||||
public static final ResourceLocation fstbmb_tex = new ResourceLocation(RefStrings.MODID, "textures/models/bombs/fstbmb.png");
|
||||
|
||||
//Satellites
|
||||
public static final ResourceLocation sat_base_tex = new ResourceLocation(RefStrings.MODID, "textures/models/sat_base.png");
|
||||
@ -367,6 +369,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom rpc = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/rpc.obj"));
|
||||
public static final IModelCustom tom_main = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/weapons/tom_main.obj"));
|
||||
public static final IModelCustom tom_flame = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/weapons/tom_flame.hmf"));
|
||||
public static final IModelCustom nikonium = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/nikonium.obj"));
|
||||
|
||||
//Bomber
|
||||
public static final IModelCustom dornier = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/dornier.obj"));
|
||||
@ -459,8 +462,9 @@ public class ResourceManager {
|
||||
////Texture Entities
|
||||
|
||||
//Blast
|
||||
public static final ResourceLocation fireball = new ResourceLocation(RefStrings.MODID, "textures/models/fireball.png");
|
||||
public static final ResourceLocation balefire = new ResourceLocation(RefStrings.MODID, "textures/models/balefire.png");
|
||||
public static final ResourceLocation fireball = new ResourceLocation(RefStrings.MODID, "textures/models/explosion/fireball.png");
|
||||
public static final ResourceLocation balefire = new ResourceLocation(RefStrings.MODID, "textures/models/explosion/balefire.png");
|
||||
public static final ResourceLocation tomblast = new ResourceLocation(RefStrings.MODID, "textures/models/explosion/tomblast.png");
|
||||
|
||||
//Boxcar
|
||||
public static final ResourceLocation boxcar_tex = new ResourceLocation(RefStrings.MODID, "textures/models/boxcar.png");
|
||||
@ -469,6 +473,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation rpc_tex = new ResourceLocation(RefStrings.MODID, "textures/models/rpc.png");
|
||||
public static final ResourceLocation tom_main_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/tom_main.png");
|
||||
public static final ResourceLocation tom_flame_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/tom_flame.png");
|
||||
public static final ResourceLocation nikonium_tex = new ResourceLocation(RefStrings.MODID, "textures/models/misc/nikonium.png");
|
||||
|
||||
//Bomber
|
||||
public static final ResourceLocation dornier_0_tex = new ResourceLocation(RefStrings.MODID, "textures/models/dornier_0.png");
|
||||
|
||||
103
com/hbm/render/entity/effect/RenderCloudTom.java
Normal file
@ -0,0 +1,103 @@
|
||||
package com.hbm.render.entity.effect;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.effect.EntityCloudTom;
|
||||
import com.hbm.main.ResourceManager;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class RenderCloudTom extends Render {
|
||||
|
||||
@Override
|
||||
public void doRender(Entity entity, double x, double y, double z, float f0, float f1) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glDepthMask(false);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
|
||||
EntityCloudTom blast = (EntityCloudTom)entity;
|
||||
|
||||
double scale = blast.age + f0;
|
||||
|
||||
int segments = 16;
|
||||
float angle = (float) Math.toRadians(360D/segments);
|
||||
int height = 20;
|
||||
int depth = 20;
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
|
||||
bindTexture(this.getEntityTexture(blast));
|
||||
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
|
||||
float movement = -(Minecraft.getMinecraft().thePlayer.ticksExisted + f0) * 0.005F * 10;
|
||||
GL11.glTranslatef(0, movement, 0);
|
||||
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
|
||||
for(int i = 0; i < segments; i++) {
|
||||
|
||||
for(int j = 0; j < 5; j++) {
|
||||
|
||||
double mod = 1 - j * 0.025;
|
||||
double h = height + j * 10;
|
||||
double off = 1D / j;
|
||||
|
||||
Vec3 vec = Vec3.createVectorHelper(scale, 0, 0);
|
||||
vec.rotateAroundY(angle * i);
|
||||
double x0 = vec.xCoord * mod;
|
||||
double z0 = vec.zCoord * mod;
|
||||
|
||||
tess.setColorRGBA_F(1.0F, 1.0F, 1.0F, 0.0F);
|
||||
tess.addVertexWithUV(x0, h, z0, 0, 1 + off);
|
||||
tess.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
tess.addVertexWithUV(x0, -depth, z0, 0, 0 + off);
|
||||
|
||||
vec.rotateAroundY(angle);
|
||||
x0 = vec.xCoord * mod;
|
||||
z0 = vec.zCoord * mod;
|
||||
|
||||
tess.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
tess.addVertexWithUV(x0, -depth, z0, 1, 0 + off);
|
||||
tess.setColorRGBA_F(1.0F, 1.0F, 1.0F, 0.0F);
|
||||
tess.addVertexWithUV(x0, h, z0, 1, 1 + off);
|
||||
}
|
||||
}
|
||||
|
||||
tess.draw();
|
||||
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity entity) {
|
||||
return ResourceManager.tomblast;
|
||||
}
|
||||
|
||||
}
|
||||
@ -31,9 +31,9 @@ public class RenderSmallNukeMK3 extends Render {
|
||||
public RenderSmallNukeMK3() {
|
||||
blastModel = AdvancedModelLoader.loadModel(objTesterModelRL);
|
||||
ringModel = AdvancedModelLoader.loadModel(ringModelRL);
|
||||
ringTexture = new ResourceLocation(RefStrings.MODID, "textures/models/Ring2.png");
|
||||
ringTexture = new ResourceLocation(RefStrings.MODID, "textures/models/explosion/Ring2.png");
|
||||
ringBigModel = AdvancedModelLoader.loadModel(ringBigModelRL);
|
||||
ringBigTexture = new ResourceLocation(RefStrings.MODID, "textures/models/Ring2.png");
|
||||
ringBigTexture = new ResourceLocation(RefStrings.MODID, "textures/models/explosion/Ring2.png");
|
||||
scale = 0;
|
||||
ring = 0;
|
||||
}
|
||||
|
||||
@ -4,7 +4,10 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.util.RenderMiscEffects;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@ -116,7 +119,7 @@ public class RendererObjTester extends TileEntitySpecialRenderer {
|
||||
//GL11.glRotatef(-25, 0, 1, 0);
|
||||
//GL11.glRotatef(15, 0, 0, 1);
|
||||
|
||||
long time = tileEntity.getWorldObj().getTotalWorldTime();
|
||||
/*long time = tileEntity.getWorldObj().getTotalWorldTime();
|
||||
double sine = Math.sin(time * 0.05) * 5;
|
||||
double sin3 = Math.sin(time * 0.05 + Math.PI * 0.5) * 5;
|
||||
double sin2 = Math.sin(time * 0.05 + Math.PI);
|
||||
@ -132,6 +135,34 @@ public class RendererObjTester extends TileEntitySpecialRenderer {
|
||||
ResourceManager.soyuz_lander.renderPart("Capsule");
|
||||
bindTexture(ResourceManager.soyuz_chute_tex);
|
||||
ResourceManager.soyuz_lander.renderPart("Chute");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);*/
|
||||
|
||||
GL11.glRotatef(-90, 0, 1, 0);
|
||||
GL11.glTranslated(0, 3, 0);
|
||||
bindTexture(ResourceManager.nikonium_tex);
|
||||
ResourceManager.nikonium.renderAll();
|
||||
GL11.glTranslated(0, -3, 0);
|
||||
GL11.glRotatef(90, 0, 1, 0);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.fstbmb_tex);
|
||||
ResourceManager.fstbmb.renderPart("Body");
|
||||
ResourceManager.fstbmb.renderPart("Balefire");
|
||||
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/misc/glintBF.png"));
|
||||
RenderMiscEffects.renderClassicGlint(tileEntity.getWorldObj(), f, ResourceManager.fstbmb, "Balefire", 0.0F, 0.8F, 0.15F, 5, 2F);
|
||||
|
||||
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
|
||||
float f3 = 0.04F;
|
||||
GL11.glTranslatef(0.815F, 0.9275F, 0.5F);
|
||||
GL11.glScalef(f3, -f3, f3);
|
||||
GL11.glNormal3f(0.0F, 0.0F, -1.0F * f3);
|
||||
GL11.glRotatef(90, 0, 1, 0);
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glTranslatef(0, 1, 0);
|
||||
font.drawString("00:15", 0, 0, 0xff0000);
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
69
com/hbm/render/util/RenderMiscEffects.java
Normal file
@ -0,0 +1,69 @@
|
||||
package com.hbm.render.util;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
public class RenderMiscEffects {
|
||||
|
||||
public static ResourceLocation glint = new ResourceLocation(RefStrings.MODID + ":textures/misc/glint.png");
|
||||
|
||||
public static void renderClassicGlint(World world, float interpol, IModelCustom model, String part, float colorMod, float r, float g, float b, float speed, float scale) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
float offset = Minecraft.getMinecraft().thePlayer.ticksExisted + interpol;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
float color = colorMod;
|
||||
GL11.glColor4f(color, color, color, 1.0F);
|
||||
GL11.glDepthFunc(GL11.GL_EQUAL);
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
for (int k = 0; k < 2; ++k) {
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
float glintColor = 0.76F;
|
||||
|
||||
GL11.glColor4f(r * glintColor, g * glintColor, b * glintColor, 1.0F);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
|
||||
float movement = offset * (0.001F + (float)k * 0.003F) * speed;
|
||||
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GL11.glRotatef(30.0F - (float)k * 60.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.0F, movement, 0.0F);
|
||||
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
|
||||
if("all".equals(part))
|
||||
model.renderAll();
|
||||
else
|
||||
model.renderPart(part);
|
||||
}
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public static void renderClassicGlint(World world, float interpol, IModelCustom model, String part, float r, float g, float b, float speed, float scale) {
|
||||
renderClassicGlint(world, interpol, model, part, 0.5F, r, g, b, speed, scale);
|
||||
}
|
||||
|
||||
public static void renderClassicGlint(World world, float interpol, IModelCustom model, String part) {
|
||||
renderClassicGlint(world, interpol, model, part, 0.5F, 0.25F, 0.8F, 20.0F, 1F/3F);
|
||||
}
|
||||
}
|
||||
21
com/hbm/tileentity/bomb/TileEntityNukeBalefire.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
public class TileEntityNukeBalefire extends TileEntityMachineBase {
|
||||
|
||||
public TileEntityNukeBalefire() {
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||