Everything posted by Draco18s
-
[1.9] Allowing player to pick custom entity item up once
Really what should happen is that the item exists on the server with a "stack size" equal to the number of nearby players. Each player that comes along gets 1 of the stack (when the remaining is zero, the entity is deleted). Then use a custom renderer for the client-sided object: if the client-player has picked up the item (perform similar logic to the server side or use packets) then simply stop rendering the item.
-
Custom Npc's
That is not how words are pluralized. Please grammar properly. My psychic powers have told me that you have done something wrong and that you should fix it in this manner.
-
[1.8] Custom mob drop with specific tools
Yes, but that would require an hour of my time. I have better things I could be doing with that hour.
-
[1.7.10] How do I create a gui-less crafting block?
This is pretty much all you need. The associated block has no GUI and items go in/out based on TEs (note: the TE setup for it is weird) or by right-clicking. http://reasonable-realism.wikia.com/wiki/Tanning_Rack
-
[1.8.9] Raytrace or EntityBullet?
That's half as fast. You're an idiot. And what's this worldIn nonsense? Seriously, this.worldObj is already an accessible field property of this class! And for fuck's sake, use the god damn [code ] tag. Now I remember why I have you on ignore. :V
-
[1.8.9] Raytrace or EntityBullet?
1 bullet a tick is a lot of bullets. There's literally no need to be doing it that often. (By the way: there are ways around the damage immunity time, as your custom projectile--or the raytrace--can just set the damage immunity time to zero prior to inflicting damage; but it means that those weapons would simply bypass the immunity time entirely).
-
[1.9] Custom boat won't move
You can't override a method with a different return type. It appears that you're using this method internally, and only internally, which means you shouldn't need to override it at all: you just need to make a new method.
-
[1.7.10] Modifying the drop(s) of an existing block
Because I forget things.
-
[1.8.9][SOLVED] Problems with PacketHandler and getXP
//oh boy! we pass in an entity player! this is probably the one we want to do stuff to! public SkillPacket(EntityPlayer E, int[] s ){ //yeah! lets IGNORE THE FUCK OUT OF IT. MarkData p = MarkData.get(Minecraft.getMinecraft().thePlayer); p.XP = s; }
-
[1.7.10] Modifying the drop(s) of an existing block
Leaves still triggers HarvestDropsEvent . It overrides harvestBlock , but all it does is call super(). The block default method calls dropBlockAsItem which passes off to dropBlockAsItemWithChance which calls getDrops just prior to firing the event, which BlockLeaves overrides again (to possibly drop a sapling). Adding a stick to that is just as easy as event.drops.add(new ItemStack(...)) Removing is a bit trickier, as you should loop through the array to locate the item you want to remove, and for every other item add it to a new array (you don't want to just delete everything: some other mod may have added an item that should still drop!). Then call event.drops.clear() and then copy your saved list back to event.drops.
-
[1.9] Odd bug with Terrakon AI
I am at a loss, then.
-
[1.7.10] Modifying the drop(s) of an existing block
For 1.7.10, the event is fired on the MinecraftForge.EVENT_BUS , which you are doing. Show your current TemDrops class with the "TEST TEST TEST" line.
-
[1.9] Odd bug with Terrakon AI
The modifications are just there to figure out if the entity is underwater. The +0.4/-0.4 was to fake my entity being taller than it was.
-
[1.9] Can't assign class or instance variable in custom Item
I am aware of that, I advised him to remove them because it was bad practice. There is absolutely nothing wrong with the static keyword. It is not bad practice. It is merely the wrong tool for the job. I use static all over the place in my code. public class WildlifeEventHandler { public static boolean trackTrees; public static boolean autoSaplings; public static boolean doYearCycle; public static int weekLength; public static long yearLength; public static boolean doSnowMelt; public static boolean doSlowCrops; public static boolean doBiomeCrops; public static boolean doRawLeather; public static boolean doNativeTreeKill; public static int cropsWorst; public static boolean modifyAnimalDrops; public static int[] dimensionBlacklist; } Why? Because every single one of those is a config option. There is no need to store a copy per instance level (even if the class is a singleton) because I shouldn't need an instance reference in order to set or retrieve the values. Plus, if I did have two instances, they should absolutely share the same values!
-
[1.9] Odd bug with Terrakon AI
You can try this: @Override public boolean handleWaterMovement() { this.boundingBox.minY += 0.4D; if (this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, 0.4D, 0.0D).contract(0.001D, 0.001D, 0.001D), Material.water, this)) { if (!this.inWater) { float f = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.2F; if (f > 1.0F) { f = 1.0F; } this.playSound(this.getSplashSound(), f, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); float f1 = (float)MathHelper.floor_double(this.boundingBox.minY); int i; float f2; float f3; for (i = 0; (float)i < 1.0F + this.width * 20.0F; ++i) { f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; f3 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; this.worldObj.spawnParticle("bubble", this.posX + (double)f2, (double)(f1 + 1.0F), this.posZ + (double)f3, this.motionX, this.motionY - (double)(this.rand.nextFloat() * 0.2F), this.motionZ); } for (i = 0; (float)i < 1.0F + this.width * 20.0F; ++i) { f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; f3 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; this.worldObj.spawnParticle("splash", this.posX + (double)f2, (double)(f1 + 1.0F), this.posZ + (double)f3, this.motionX, this.motionY, this.motionZ); } } this.fallDistance = 0.0F; this.inWater = true; this.extinguish(); } else { this.inWater = false; } this.boundingBox.minY -= 0.4D; return this.inWater; } (May need tweaks for your entity's size)
-
[1.9] Odd bug with Terrakon AI
Hum. Then I don't know. I had a similar swimming problem, but it was for a mob that was ~1 block tall.
-
[1.9] Odd bug with Terrakon AI
Is your entity less than 2 blocks tall?
-
[1.8.9][SOLVED] Problems with PacketHandler and getXP
Why is candothis still static? It is the property you use to determine if the player being operated on can mine the block or not, yet this is still a shared value.
-
Change tooltip info throughout the game
It depends on your use-case. If it isn't your item, you can't use Item#addInformation.
-
Change tooltip info throughout the game
Best way to find events is to start at any event, go up to the base Event class, then look at the class hierarchy.
-
[1.9] [UNSOLVED] Let entities be thrown into my block
EntityMotion += (BlockPos - EntityPos) * 0.1f; //simple and arbitrary. Hooray vectors! Breakdown: (BlockPos - EntityPos) results in a vector from Entity to Block, with a magnitude of the total distance. * 0.1f results in a vector 1/10th this distance, still pointing from Entity to Block. EntityMotion += add this directed vector to the Entity's motion, pushing it towards the Block.
-
oredictionary
That's not how the OreDictionary works. The OreDictionary works on the basis of equality. "Does this item stack, registered as 'OreIron' work in this recipe? Why yes, the recipe looks for 'OreIron,' so this stack is valid." It doesn't convert things, it just treats them as equal. It's kind of like Coal and Charcoal being equivalent for the purposes of making torches and smelting ore, but they don't stack. (Not withstanding mods creating a distinction so that you can turn coal into diamonds, but not charcoal, as the latter is renewable).
-
[1.8.9] Multiple item textures in one file (image)
So how would I do this? EDIT: Also, why do you not recommend it? Locate the class, TextureAtlasCompass if I recall the class name correctly. It's how vanilla renders the compass texture (there's also one for the clock). This should be sufficient information necessary to display the correct portion of your texture file. The reason I don't recommend it, however, is that if things go south (crashes, bugs, etc) it is very hard to diagnose as the stack trace will not contain this custom class (it will be elsewhere and merely calling properties of said class). For a two-state texture file you're probably fine. Note: I am presuming that these classes still exist for 1.9 based on my knowledge of 1.7.10 and what I know about the changes made to the rendering engine: that is, I assume that there is still a class that interprets a multi-frame texture file for the clock and compass, rather than as an animation.
-
Change tooltip info throughout the game
Probably because its an event fired from the player related classes.
-
[1.8.9] Multiple item textures in one file (image)
You need a custom TextureAtlastSprite. I do not recommend.
IPS spam blocked by CleanTalk.