Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

jordan30001

Members
  • Posts

    157
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

jordan30001's Achievements

Creeper Killer

Creeper Killer (4/8)

15

Reputation

  1. OP updated added fixed EntityZeusLightningbolt code tag
  2. Oh wait it is working but due to my listener being registered after vanilla registration it doesn't invoke my method for vanilla ores anyway to register my event before objects start getting registed?
  3. I found the following class within OreDictionary public static class OreRegisterEvent extends Event { public final String Name; public final ItemStack Ore; public OreRegisterEvent(String name, ItemStack ore) { this.Name = name; this.Ore = ore; } } and above this method is the forge event bus invoker private static void registerOre(String name, int id, ItemStack ore) { ArrayList<ItemStack> ores = getOres(id); ore = ore.copy(); ores.add(ore); MinecraftForge.EVENT_BUS.post(new OreRegisterEvent(name, ore)); } I have my ForgeEvents class setup to receive these events and have successfully received other events but not this one public class ForgeEvents { @ForgeSubscribe public void DropEvent(LivingDropsEvent e) { //working event snipped for less spam code } @ForgeSubscribe public void oreRegistrationEvent(OreRegisterEvent e) { Log.log("Recieved oreRegistrationEvent"); if (e.Name.toLowerCase().contains("ore")) { addOre(e.Name); } } } and in my preInit method I have MinecraftForge.EVENT_BUS.register(new ForgeEvents()); is there a reason why I am not receiving this particular event?
  4. I have a Throwable item but for some reason its not rendering the item when thrown. Main @Init method EntityRegistry.registerModEntity(EntityZeusLightningBolt.class, "Zeus Lightning Bolt", 2, this, 250, 5, false); RenderingRegistry.registerEntityRenderingHandler(EntityZeusLightningBolt.class, new RenderZeusLightningBolt(Main.ZeusSword)); [code] EntityZeusLightningBolt [code] public class ItemZuesLightningBolt extends ItemSword { @Override @SideOnly(Side.CLIENT) public void updateIcons(IconRegister iconRegistry) { this.iconIndex = iconRegistry.registerIcon("TestMod:EntityLightningBolt"); } public ItemZuesLightningBolt(int ID, EnumToolMaterial m, String name) { super(ID, m, name); } public ItemStack onItemRightClick(ItemStack item, World w, EntityPlayer p) { if (!p.capabilities.isCreativeMode) { item.damageItem(1, p); } if (!w.isRemote) { w.spawnEntityInWorld(new EntityZeusLightningBolt(w, p)); } return item; } } and finally my render class public class RenderZeusLightningBolt extends RenderSnowball { public RenderZeusLightningBolt(Item item) { super(item); } } public class EntityZeusLightningBolt extends EntityThrowable { public EntityZeusLightningBolt(World w) { super(w); } public EntityZeusLightningBolt(World w, EntityLiving par2EntityLiving) { super(w, par2EntityLiving); } public EntityZeusLightningBolt(World w, double par2, double par4, double par6) { super(w, par2, par4, par6); } protected void onImpact(MovingObjectPosition MOP) { if (MOP.entityHit != null) { EntityLiving e = (EntityLiving) MOP.entityHit; e.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0); WorldUtils.strikeThunderAtEntity(e, 0); } if(MOP.typeOfHit == EnumMovingObjectType.TILE) { World w = this.worldObj; WorldUtils.strikeThunderAtBlock(w, MOP.blockX, MOP.blockY, MOP.blockZ, 0); } if (!this.worldObj.isRemote) { this.setDead(); } } }
  5. note a block can be null but still contain a block for instance redpower blocks are all stored as null but they are actually not null
  6. maybe you could parse the ItemStack[] into a separate thread and then process it in the other thread so the main Minecraft thread doesn't take a huge hit every tick comparing old itemstack to new itemstack. obviously still going to get a hit if the CPU affinity is 1.
  7. as I said its not 100% perfect you would need to fix the errors yourself by decompiling it with something like JAD after BON has deobfuscated it which is what everyone does if they need to test with mods non open source but be careful when doing this as to not include anything in things like github ect ect
  8. Beared Octo nemesis can decompile a mod that's use able in the forge development mods folder although do note that I having certain mods together will cause it to craft as the decompiled isn't 100% perfect you can find it over @ chicken bones forum
  9. Just wondering, what version of forge is this running with and what mc version
  10. for the random picking Note this is probably not efficient at all within the second loop import java.util.LinkedList; import java.util.List; import java.util.Random; public class Main { static List<String> stringList = new LinkedList<String>(); static Random rand = new Random(); public static void main(String[] args) { for (int i = 0; i < 10; i++) stringList.add(i, Integer.toString(i)); for(int i = 0; i < stringList.size() + 1; i++) { int element = rand.nextInt(stringList.size()); System.out.println(stringList.get(element)); stringList.remove(element); i--; if(i < 0) i = 0; } } }
  11. I'm not 100% sure but I don't think grass (I think you mean fancy grass) renders two textures to one face it just has 3 Icons for the sides (dirt, bit of grass, full grass) and depending on surrounding blocks it will display one of the 3 icons
  12. vista? *shivers* running the file as administrator?
  13. is that the full code? if it is then you cannot save null as an integer
  14. is that the full code? if it is then you cannot save null as an integer
  15. within your onBlockActivated method use this http://jd.minecraftforge.net/net/minecraft/client/entity/EntityPlayerSP.html#isSneaking()
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.