-
Posts
878 -
Joined
-
Last visited
Everything posted by Elix_x
-
[1.7.10] Custom Furnace save items only in slot 0.
Elix_x replied to TheTroop's topic in Modder Support
@61352151511 He is using NBTTagList and list.appendtag. So for following contents: 1 - something 2 - null 3 - someyhing This happens: list.appendTag(slot1.writeToNbt) do nothing list.appendTag(slot3.writeToNbt) Which results in append tag of 3rd item to 2nd. Because append tag puts tag to the end of the list. And when he reads he says that what in list is first - is in first slot. What is second is in second slot... @TheTroop What i personally use is: Saving: For each slot, if it contents is not null, write content to nbt and save it with name "slot" + slotId Loading: For each existent slot, check if tag with name "slot" + slotId exists, and if it does, load contents from this tag... -
[1.7.10] Custom Furnace save items only in slot 0.
Elix_x replied to TheTroop's topic in Modder Support
Well, you don't save empty slots. So when you have in slots: 1- something 2 - null 3 - something You save: 1 - yes 2 - no 3 - yes In result you get: 1 - something 2 - something Because you haven't added anything to 2nd place of list, so all moves down... -
Who told that? Going through onItemUse call hierarchy and i haven't found where it is blocked... Can you specify then where it is blocked by isReplaceable?
-
Feather Falling would be like knockback resistance. How would i apply the enchantments attribute modifiers? Are you sure, that it's attribute based enchantement? There's no such attribute as fall damage negation. Look deeper in code, and check where and how it is used in vanilla... Then come back...
-
You mean like to player, as if he was wearing armor with this enchantement? Well, it's not easy. It depends of what this enchantement does. Enchantements like knockback resistance is easy: just apply enchntement's attribute modifiers each tick. Enchantements like looting will require event handling, and advanced dynamic coding. Enchantements that are calculated on place of code, where no events exist (like if there were "no falling anvil damage" enchantement), will require asm...
-
1 of all) Please don't use global ids... 2) Try to make texture nonstatic and initialize it in constructor...
-
Make that an animal is breaded without an item?
Elix_x replied to ItsAMysteriousYT's topic in Modder Support
Which button? Which animals? If right click, and vanilla/your animals (known) - then it's easy... -
The main 2 differences between TESR and Some Kind of Model are: -Rendering on screen: --TESR: each frame --Model: only when responsible for worldrenderer updates (for example - you break block near it) -Perforance (comes out of first): --TESR: Eats more, because... --Model: Eats less, because...
-
Anyways, both are changeable... Without enchantements...
-
Yes, but this will not work for creative take, dungeon loot, smelting, modded processing, /give... onItemCreated works for everything...
-
[1.8] Is it possible to check the stats from the player?
Elix_x replied to PlayPrey's topic in Modder Support
net.minecraft.stats and player classes may help you... -
1) Third param in itemstack is metadata/damage... 2) Look through ItemStack, answer must be somewhere in getTooltip...
-
Do you mean that when you craft it, it gets enchanted? If yes - there's method in item class - onItemCreated (or something similar) - which gets called when new itemstack with this item is created somewhere. You can do anything you want with itemstack there and resulting stack will change...
-
I don't know what happened with your apis, but normally they are installed: 1) If api is folder - drop it in src/api/java 2) If api is jar - (as far as i am doing it) link it in eclipse For me it's all i have to do (excluding ATs)...
-
[1.7.10]How to add slots to the Playerinventory?
Elix_x replied to ItsAMysteriousYT's topic in Modder Support
Do you want to create new tab like TiC or just add new slots to main inventory? Both are possible. 2nd can be done via gui init event, check if it is player's inventory and then add new slots using reflection... EDIT: If with 2nd you want to also draw additional "rectangle" somewhere - there's gui draw event (or something similar), which is fired when gui is drawn... -
Show the code please...
-
[1.8] Is there a way to replace a specific block in a specific biome?
Elix_x replied to Kander16's topic in Modder Support
An idea that may work for you is to create a world generator that would replace leaves with new leaves and bumping chances up. Because basically default world generator replaces stone with ores, but you can use it to replace (with chance if needed) any other blocks... As for new grown trees - there's event, as diesieben said... -
Sorry but we don't undrestand what you want and why have you posted new empty IIcemRenderer code?
-
Ok, try this: Precise model in blockstate with modid:modelname without blocks/ and .json....
-
Post screenshot of eclipse's directory explorer with this file selected...
-
[1.7.10] [UNSOLVED] Worldgen isn't generating anything
Elix_x replied to SantacreeperLP's topic in Modder Support
Check if the actuall block placing method is getting called (console)... -
[1.7.10] [UNSOLVED] Worldgen isn't generating anything
Elix_x replied to SantacreeperLP's topic in Modder Support
1) Post code in code blocks ([ code]code here[ /code] (without spaces)) 2) Wherer&how did you register it? -
Ok, i'll try... EDIT 1: this works... let me re-add my previouscode... EDIT 2: :o wtf? re-adding my previous code, and it works like i wanted... :o Thanks... And i still don't understand why be removing and then re adding code, it worked... but it's working now... so yeah, thanks... ...
-
Ok, that the code responsible for spawning particles next to player. It is called from [event], and succesfully reaches spawnParticle (console). @Override public void createParticles(EntityLivingBase entity, boolean b){ if(b){ if(vectoredAffect(entity)){ World world = entity.worldObj; Vec3 look = entity.getLookVec(); for(int i = 0; i < particleAmount(); i++){ world.spawnParticle(getParticle(), entity.posX + randomRangedPNDouble(getParticlePosRandomizerRange()), entity.posY + randomRangedPNDouble(getParticlePosRandomizerRange()), entity.posZ + randomRangedPNDouble(getParticlePosRandomizerRange()), look.xCoord * 10 + randomRangedPNDouble(getParticleVelocityRandomizerRange()), look.yCoord * 10 + randomRangedPNDouble(getParticleVelocityRandomizerRange()), look.zCoord * 10 + randomRangedPNDouble(getParticleVelocityRandomizerRange())); } } } } Helper methods: public String getParticle() { return "smoke"; } public double randomRangedPNDouble(double range) { return random.nextBoolean() ? random.nextInt((int) (range * 1000000)) / 1000000 : -random.nextInt((int) (range * 1000000)) / 1000000; } public double getParticlePosRandomizerRange() { return 0.5; } public double getParticleVelocityRandomizerRange() { return 0.125; } public int particleAmount(){ return 10 * getAmplifier(); }
-
Hello everybody,, i have a question: When/where am i supposed to spawn particles on client? So: I have a config option for particle rendering which can be different for each client, that's why i'm spawning it on client and not on server||&client. I tried to spawn it at ClientTick.pre, RenderTick.pre and WorldTick.pre and non of them is working. I know that code for spawning (world.spawnParticle) is reached (console). But i don't see any particles... If you know when/where i have to spawn particles on client - tell me please! I don't think you need any code, but if you do - i can give it! Thanks for help! If you have any questions - just ask!