Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. Jesus Christ. IInventory#canInsertItem and IInventory#isItemValidForSlot
  2. It is because you put the "stop flying now" code inside the "if wearing chest piece" block.
  3. Well, I continue to study tesselator The Tessellator is just a wrapper class around OpenGL calls. So at this point what you probably need is a starter course on GL commands.
  4. I don't think the blocks need to be registered with the GameRegistry, but they do need to be instantiated.
  5. 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.
  6. 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.
  7. Yes, but that would require an hour of my time. I have better things I could be doing with that hour.
  8. 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
  9. 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
  10. 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).
  11. 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.
  12. //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; }
  13. 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.
  14. I am at a loss, then.
  15. 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.
  16. 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.
  17. 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!
  18. 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)
  19. Hum. Then I don't know. I had a similar swimming problem, but it was for a mob that was ~1 block tall.
  20. Is your entity less than 2 blocks tall?
  21. 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.
  22. It depends on your use-case. If it isn't your item, you can't use Item#addInformation.
  23. Best way to find events is to start at any event, go up to the base Event class, then look at the class hierarchy.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.