Jump to content

karelmikie3

Members
  • Posts

    14
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Personal Text
    What are you looking at?

Recent Profile Visitors

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

karelmikie3's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I am Transforming the CommandBase.checkPermission method so I can run the permission check through custom checks of my mod that includes setting custom permission requirements for the commands themselves. I first had one of methods injected into it but it crashed so to eliminate any possible coding error I removed it and made it simply return true. PS. I know about the CommandEvent in CommandHandler.executeCommand but that doesn't reach every call to the method such as the /help command checks if the player can use the command and so does auto tab completion.
  2. I've made an ASM transformer to transform a method in the CommandBase class when I used it in the dev environment it worked fine but when I compiled it, it crashed. I tested both on MultiMC and the normal minecraft client both end up with the same result. Right now I have it stripped down to a minimal transformation, so I could see where the fault lies, but I can't find it. crash: https://paste.ee/p/nP0is log: https://paste.ee/p/BEpYD Transformer: https://gist.github.com/karelmikie3/f26a6ccc1495678f7c897d359e2961b7 Loader: https://gist.github.com/karelmikie3/e1f5fe78e49f3dbbfecc64c9bc9d4a57 jar: http://puu.sh/rHPtD.jar
  3. I want the white box to be on the laser itself and expand it over the whole beam.
  4. I currently use the setSize method to resize the entity bounding box is there a way to change the size of the entity boudingbox manually and to make it float. package HxCKDMS.HxCLasers.Entity; import HxCKDMS.HxCLasers.Api.ILens; import HxCKDMS.HxCLasers.Api.LaserHandler; import HxCKDMS.HxCLasers.Api.LaserRegistry; import HxCKDMS.HxCLasers.Registry.Registry; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import java.awt.*; import java.util.UUID; public class EntityLaserBeam extends Entity { public UUID uuid; public ForgeDirection direction; public int length; public boolean shouldDrawTop; public ItemStack lens; public int powerLevel; public boolean transparent; private LaserHandler laserHandler; private boolean first = true; public EntityLaserBeam(World world) { super(world); } public EntityLaserBeam(World world, double x, double y, double z, UUID uuid, ForgeDirection direction, int length, ItemStack lens) { super(world); setPosition(x, y, z); this.uuid = uuid; this.direction = direction; this.length = length; this.lens = lens; } @Override protected void entityInit() { dataWatcher.addObject(24, (byte) 0); //transparent dataWatcher.addObject(25, 1); //powerLevel dataWatcher.addObject(26, 0); //red dataWatcher.addObject(27, 0); //green dataWatcher.addObject(28, 0); //blue dataWatcher.addObject(29, (float) posY); dataWatcher.addObject(30, 1); //direction dataWatcher.addObject(31, 0); //length setSize(0.2F, 0.2F); } @Override protected void readEntityFromNBT(NBTTagCompound tagCompound) { } @Override protected void writeEntityToNBT(NBTTagCompound tagCompound) { } @Override public void onUpdate() { if(!worldObj.isRemote){ Color color = Color.white; if(lens != null && lens.hasTagCompound()) color = ((ILens) lens.getItem()).getColor(lens); if(first) { laserHandler = LaserRegistry.getLaserHandler(color); transparent = lens != null && Registry.itemLens.isTransparent(lens); powerLevel = lens != null ? Registry.itemLens.getPowerLevel(lens) : 1; laserHandler.laserBeam = this; first = false; } dataWatcher.updateObject(24, transparent ? (byte) 1 : (byte) 0); dataWatcher.updateObject(25, powerLevel); dataWatcher.updateObject(26, color.getRed()); dataWatcher.updateObject(27, color.getGreen()); dataWatcher.updateObject(28, color.getBlue()); dataWatcher.updateObject(30, direction.ordinal()); dataWatcher.updateObject(31, length); dataWatcher.updateObject(29, (float) posY); } else { direction = ForgeDirection.getOrientation(dataWatcher.getWatchableObjectInt(30)); //posY = dataWatcher.getWatchableObjectFloat(29); //lastTickPosY = dataWatcher.getWatchableObjectFloat(29); } } @Override public void moveEntity(double motionX, double motionY, double motionZ) { } @Override public boolean doesEntityNotTriggerPressurePlate() { return true; } @Override public void writeToNBT(NBTTagCompound tagCompound) { tagCompound.setString("UUID", uuid.toString()); tagCompound.setInteger("Direction", direction.ordinal()); tagCompound.setInteger("Length", length); if(lens != null) tagCompound.setTag("Lens", lens.writeToNBT(new NBTTagCompound())); super.writeToNBT(tagCompound); } @Override public void readFromNBT(NBTTagCompound tagCompound) { uuid = UUID.fromString(tagCompound.getString("UUID")); direction = ForgeDirection.getOrientation(tagCompound.getInteger("Direction")); length = tagCompound.getInteger("Length"); lens = ItemStack.loadItemStackFromNBT(tagCompound.getCompoundTag("Lens")); super.readFromNBT(tagCompound); } @Override public boolean shouldRenderInPass(int pass) { return pass == 1; } } what it looks like currently:
  5. I am talking about ItemBlocks aka the block in the inventory.
  6. thanks what probably will help but I have one more question how would I do this if I have a block?
  7. I have been trying this for a while now and I can not figure out a way to do this. is there anyway to do this and if so how?
  8. got that working thank you. But while I'm asking is there a way to add a Custom EventType for something like copper or any ore type?
  9. I would like to know how to make a custom ore trigger the event OreGenEvent.GenerateMineable.
  10. get item doesn't seem to work. I tried this: it says: The method getItem() is undefined for the type Item
  11. another question: how to get the player name from event.entityPlayer?
  12. for question 1 i ment it says that you need to use a IChatCompent, how do i use that if i want to send a string? for question 2: how do i compare the item picked to if it is iquel to a item a created?
  13. Hello, i have 2 question question 1: how to use player.addChatMessage question 2: with the event EntityItemPickupEvent. How get what item is picked up? here's my event handler code:
×
×
  • Create New...

Important Information

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