Jump to content

Blaez

Members
  • Posts

    23
  • Joined

  • Last visited

Recent Profile Visitors

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

Blaez's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. 1.5.2 .... 1.5.2... sorry this place doesn't support even 1.7.10 anymore. good luck getting any kind of support here.
  2. honestly for this stuff your better off keeping your old recipes. though if your trying to keep the enchantments ItemStack input = playerIn.getHeldItem(hand); ItemStack morph1 = new ItemStack(Item.getByNameOrId(this.morph), is.getCount(), is.getMetadata()); if (is.hasTagCompound()) { morph1.setTagCompound(is.getTagCompound()); } if (hand == EnumHand.MAIN_HAND) { playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, morph1); }} this might not be entirely related or the best way to handle it but if your wanting it to work with enchanted items you should have it take the nbtdata from the input item and set it to the output something similar to this. there might be better ways but I figured I'd toss this here incase its of help
  3. XX figured it out is.gettagcompound().merge(atag) incase someone finds that they need this info cause I didn't notice it for quite awhile
  4. if (!world.isRemote && this.data != null) { NBTTagCompound atag = is.getTagCompound(); if (atag == null) atag = new NBTTagCompound(); if (!atag.hasKey(KEY)) { atag.setBoolean(KEY, true); is.setTagCompound(atag); try { is.setTagCompound(JsonToNBT.getTagFromJson(this.data)); is.getTagCompound().setBoolean(KEY, true); } catch (NBTException nbtexception) { LogManager.getLogger(RWBYModels.MODID).error("Couldn't load data tag for " + this.getRegistryName()); } } } atag is the first part of this which is the current data of the item. the portion inside of try is replacing the tag compound from before while this might be all well and good.it doesn't pass along Enchantments which is why I'm curious if there's a way to merge the two data sets rather then completely override the data though I suspect that's not possible just from looking around. though there is this is.getEnchantmentTagList() which would appear to get a retrievable list of the enchantments in the tagcompound though I'm not sure if there is a way to use that data to reapply the enchantments after the data is wiped. **please keep in mind I am not really familiar with nbt stuff so this all could be entirely wrong and I'm missing a simpler way to do this. but live and learn the reason I'm wiping the data in the first place is because the items have attribute modifiers and I don't want those passed to the new item when they transform however I'd like to keep enchantments if possible.
  5. actually no its producing empty jar files now what the hell.. I'm so confused
  6. odd, I did delete those files and refresh gradle. it seems to be working now though **after feeding in a new build.gradle file from my old 1.11.2 mod and updating the mappings and such to match the latest.. technology its strange I swear atleast its working now. thanks for that though much appreciated.
  7. Everything was fine until today, I'm not sure exactly what to make of this or how to fix it. though I have tried with latest versions of forgemdk aswell as the latest stable. I'm not sure entirely but I think it might be that something in MC's source is messed up. though I'm not sure if thats the case or not and if it is I'm not sure how to trigger a redownload of the files. but I'd appreciate any help, and keep in mind I understand abit about what I'm doing but I'm definitely not a expert or anything of the sort so bear with me.if the solution is abit complex.. incase it matter's I'm using Intellij/Idea
  8. Thanks for that information. it is much appreciated. I worked it out with a bit of a timer delay and have achieved the desired effect for the most part. however this currently cancels rendering of all players. is there a way to specify just one player say with a player instance? or something like that?
  9. Canceling the event does work. however as I said not entirely, It won't start rendering the player again unless you restart the game. I'm just wondering if there is a way to force the player to be rendered again after canceling the event as it doesn't seem to want to restart or render the player again on its own.
  10. I've Tried this with success however I can't re-enable the rendering event so player remains invisible aswell as being unsure if this would just target one player or if it disables all. which isn't my intent.. @SubscribeEvent public void pre(RenderPlayerEvent.Pre event) { if (RWBYSword.runhideevent){ event.setCanceled(true); } } This has same problem as above not being able to reset the render of the player aswell as the problems of below. @SubscribeEvent public void renderPlayerPostEvent(RenderPlayerEvent.Post e) { FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; EntityPlayer player = Minecraft.getMinecraft().player; ModelPlayer model = (ModelPlayer) e.getRenderer().getMainModel(); if (e.getEntityPlayer() != null && e.getRenderer().getMainModel() instanceof ModelPlayer) { if (RWBYSword.runhideevent) model.bipedLeftArm.isHidden = model.bipedLeftArmwear.isHidden = model.bipedBody.isHidden = model.bipedBodyWear.isHidden = model.bipedHead.isHidden = model.bipedHeadwear.isHidden = model.bipedRightArm.isHidden = model.bipedRightArmwear.isHidden = model.bipedLeftLeg.isHidden = model.bipedLeftLegwear.isHidden = model.bipedRightLeg.isHidden = model.bipedLeftLegwear.isHidden = true; }} These all have similar effects ie armour and held item will still render which isn't what I'm trying to accomplish player.setInvisible(true); PotionEffect potioneff = new PotionEffect(MobEffects.INVISIBILITY, 10, 5, true, false); playerIn.addPotionEffect(potioneff); In Addition to These: Which didn't do anything, which I've put down to being deprecated as my event handler will fire the other events just fine @SubscribeEvent public void onArmorEvent(RenderPlayerEvent.SetArmorModel e) { if (e.getEntityPlayer() !=null) { if (RWBYSword.runhideevent){ e.setCanceled(true); }} } @SubscribeEvent public void onSpecials(RenderPlayerEvent.Specials en){ if (en.getEntityPlayer() !=null){ if (RWBYSword.runhideevent){ en.setCanceled(true); }} } I'm open to any suggestions on how to get complete toggle-able invisibility of the target player as my attempts don't seem to be working. the effect I'd like to achieve is very similar to /vanish from bukkit or similar. any help would be appreciated.
  11. I'm more so asking how to go about do it as you can no longer use getlookvec with Entityliving or Player Classes
  12. I'm Trying to apply a Similar Effect to the Code below Where by on hit of an entity the player is bounced backwards in the opposite direction the player is facing. Although the below code is for 1.7.2 so its not of much use as reference I figured it would help convey the point. public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { Entity entity = par3EntityLivingBase; Vec3 look = par3EntityLivingBase.getLookVec(); par3EntityLivingBase.motionX = look.xCoord ; par3EntityLivingBase.motionZ = look.zCoord ; par3EntityLivingBase.motionY = look.yCoord ; par3EntityLivingBase.lastTickPosZ = look.xCoord; par3EntityLivingBase.lastTickPosX = look.zCoord; set_Item_State(par1ItemStack, false); par1ItemStack.damageItem(1, par3EntityLivingBase); return true; }
  13. @SubscribeEvent public void onItemCrafted(PlayerEvent.ItemCraftedEvent evt) { evt.player.inventory.addItemStackToInventory(new ItemStack(Blocks.DIRT, 64)); System.out.println("random event fired"); } This work's however, I'm wondering if there is a way to modify this to accept loot from a custom loot table. I'm not too familiar with loot table's and most of what I can find is older and for out of date versions and only handling loot chests. is there a simple way of doing this or if there isn't please don't strain yourself however, I'd appreciate a point in the right direction if nothing else. thanks in advance. Also yes I know this is a bad example and will fire for every item crafted however I'm trying to work out what works first.
  14. erm sorry it seems I messed up when setting up a new workspace x.x
×
×
  • Create New...

Important Information

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