Jump to content

dmillerw

Forge Modder
  • Posts

    52
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    Sup!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

dmillerw's Achievements

Stone Miner

Stone Miner (3/8)

1

Reputation

  1. BugSnag4MC allows modders to easily utilize the full power of BugSnag with no extra work on their part, other than a few simple method calls. This allows modders to easily keep track of crash reports automatically, so they don't have to rely on the player to supply it. What is BugSnag you ask? Well, I think the devs themselves explain it best. Okay, so I'm your average player. What does this mean for me? On the surface, nothing. All you have to do is include this mod along with whatever mods you choose to play with. If any of those mods have support, those authors will instantly be informed of any crashes you may encounter, without any work on your end. It means less hassle for the Player, less hassle for the mod author, and hopefully less work for everyone involved. Okay, so I'm a modder. What does this mean for me? BugSnag logs all crashes sent to it, and categorizes them in an easy to read format. It also has automatic submission support for most of the main issue trackers out there, including GitHub issues and JIRA. By implementing this mod you no longer have to rely on users to report crashes, they're instantly stored to your BugSnag account and you're notified in whatever way you choose. Now unfortunately, even if you do use the API supplied, it won't do anything unless the Player has BugSnag4MC installed along with their other mods, but I would highly advise you to recommend it! API Usage: This section is only useful for modders. If you're just interested in including this mod, skip down to the section marked Download In the download section there is a separate link for the API. I've tried to make this API as simple to use as possible, while still retaining all the features of BugSnap I feel like modders will use. If there's a feature you'd like added specifically, please let me know and I'll accommodate if I can. All functionality of the mod is centered around the ICrashHandler interface. Said interface does have a complete JavaDoc included, so I won't go over it here, I'll just explain the most basic implementation. Included with the API is a class called BasicCrashHandler. Simply making a new instance of this class, supplying it with an ID, API key, and base package, and registering it, will give you all the basic functionality you'll need. If you'd like more, either extend this class or make a new one implementing the appropriate interface. Examples: By simply doing as listed above, you'll receive this info each time there's a crash relating to your mod. You'll receive the full stacktrace, as well as information relevant to Minecraft (Cause of the crash, the full Mincraft crash log, and the side that crashed). Download: For modders and Players: Mod File For modders: API If you encounter any issues, report them to my issue tracker here Feel like supporting my work? https://www.paypal.com/en_US/i/btn/x-click-but21.gif[/img] Buy me a miscellaneous beverage of my own choosing.
  2. You know there's an EntityLivingDrops event, right?
  3. Tile entities store their coordinates. While you can't use those coordinates to check upon creation via the block, you can check in the constructor of the TileEntity.
  4. Can't see your code, but set your block's Material to "circuits"
  5. Can't see your code, but set your block's Material to "circuits"
  6. Jesus Christ. This is a JavaDoc. It explains all of Forge's code in simple English. Go, read it, and read up on what you're trying to do.
  7. Also getting this. Not a vanilla bug, just tested. The recipe is being registered though, at least as far as I can tell. EDIT: Disabling the ore dictionary replacement recipes fixed it, so the issues is most likely in there. Don't have time to figure out/fix it though, but I'll submit a GitHub issue.
  8. Pretty self explanatory. Have a class extending TileEntity, and I'm overriding updateEntity(). It's only being called on the client though, so nothing that happens sticks, and if I tell it to not run on the client, then nothing happens. Yes, my TileEntity is registered, and yes, it's being created. package com.dmillerw.liquidVis.tileentity; import java.util.Random; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.liquids.ILiquidTank; import net.minecraftforge.liquids.ITankContainer; import net.minecraftforge.liquids.LiquidContainerRegistry; import net.minecraftforge.liquids.LiquidDictionary; import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.liquids.LiquidTank; import thaumcraft.api.EnumTag; import thaumcraft.api.ObjectTags; import thaumcraft.api.ThaumcraftApi; import com.dmillerw.liquidVis.core.helper.CoreHelper; import com.dmillerw.liquidVis.item.ItemHandler; public class TileEntityVisExtractor extends TileEntity implements ITankContainer { public static LiquidTank tank = new LiquidTank(LiquidContainerRegistry.BUCKET_VOLUME * 10); private int timeSinceLastPull = 0; private Random rand; public TileEntityVisExtractor() { rand = new Random(); this.validate(); } @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); timeSinceLastPull = nbt.getInteger("timeSinceLastPull"); int liquidID = nbt.getInteger("liquidID"); int liquidMeta = nbt.getInteger("liquidMeta"); int liquidAmount = nbt.getInteger("liquidAmount"); LiquidStack toSet = new LiquidStack(liquidID, liquidMeta, liquidAmount); tank.setLiquid(toSet); } @Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); nbt.setInteger("timeSinceLastPull", timeSinceLastPull); if (tank.getLiquid() != null) { int liquidID = tank.getLiquid().itemID; int liquidMeta = tank.getLiquid().itemMeta; int liquidAmount = tank.getLiquid().amount; nbt.setInteger("liquidID", liquidID); nbt.setInteger("liquidMeta", liquidMeta); nbt.setInteger("liquidAmount", liquidAmount); } } public Packet getDescriptionPacket() { NBTTagCompound data = new NBTTagCompound(); writeToNBT(data); Packet132TileEntityData tePacket = new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 0, data); return tePacket; } public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) { if (pkt.xPosition == this.xCoord && pkt.yPosition == this.yCoord && pkt.zPosition == this.zCoord) { readFromNBT(pkt.customParam1); } } public void updateEntity() { if (CoreHelper.isClient(this.worldObj)) { return; } if (timeSinceLastPull == 0) { if (tank.getLiquid() == null || tank.getLiquid().amount < tank.getCapacity()) { int toPull = rand.nextInt(10); int fluxToAdd = rand.nextInt(10); int toAdd = toPull * 10; LiquidStack liquidVis = LiquidDictionary.getOrCreateLiquid("liquidVis", ItemHandler.liquidVisLS); liquidVis.amount = toAdd; if (ThaumcraftApi.decreaseClosestAura(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 100, true)) { ThaumcraftApi.addFluxToClosest(this.worldObj, this.xCoord, this.yCoord, this.zCoord, new ObjectTags().add(EnumTag.MAGIC, fluxToAdd)); tank.fill(liquidVis, true); } else { timeSinceLastPull = 1000; } } timeSinceLastPull = 200; } else { timeSinceLastPull--; } } @Override public int fill(ForgeDirection from, LiquidStack resource, boolean doFill) { return 0; } @Override public int fill(int tankIndex, LiquidStack resource, boolean doFill) { return 0; } @Override public LiquidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { if (from != ForgeDirection.UP) { return drain(0, maxDrain, doDrain); } return null; } @Override public LiquidStack drain(int tankIndex, int maxDrain, boolean doDrain) { return tank.drain(maxDrain, doDrain); } @Override public ILiquidTank[] getTanks(ForgeDirection direction) { ILiquidTank[] array = {tank}; return array; } @Override public ILiquidTank getTank(ForgeDirection direction, LiquidStack type) { if (type.itemID == ItemHandler.liquidVis.itemID) { return tank; } return null; } public int getScaledLiquid(int i) { return tank.getLiquid() != null ? (int) (((float) tank.getLiquid().amount / (float) (tank.getCapacity())) * i) : 0; } }
  9. I've got a block that can act as a small liquid tank or a one slot inventory. I can store items/liquid and pump it out just fine, but I'm wondering if there's a good way to do it automatically, by finding any connected inventories?
  10. or use onItemUseFirst. It runs whenever a block is used with your item in hand.
  11. This might not be the right (or best) way of doing things, but you can replace Block.oreGold and Block.oreIron with your ores, since they're not set to final.
  12. Check to see if the player has existing player data. (Files stored in the world-dir/players)
  13. Actually, that may not work so well. Containers are managed by the server and correct me if I'm wrong, containers contain the check as to whether the player can interact or not.
  14. I tried doing that once, and this explains why it never worked. Since it is just using the onUpdate method, then your simple boolean idea should work. I still don't know how the server would handle it though.
  15. Oddly enough, I believe I'd have more of an issue with BBC than her.
×
×
  • Create New...

Important Information

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