Skip 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. Yep, just got it working. Did a slightly larger volume, just in case the cart gets away for any reason. Thanks muchly.
  2. TE and cart will be in the same chunk. Specifically 1 block away from each other.
  3. Oh, I can get a persistent ID all I want. I have no way of going "Hey, server, find me this non-living entity by this UUID." I can get players by UUID, but not any thing else. I'll take a look at leashes. I was going that route, but I wasn't sure if that'd even work for entities like minecarts (its not transparent on if those are saved/loaded and keep the same UUID, or what. I would assume so, but you know what they say about about assuming...).
  4. Question: [/img] or [/img] ? Because as Diesieben says, Huge Mushrooms are BlockHugeMushroom.
  5. EXACTLY LIKE HOW YOU CHECK THE BLOCK BELOW IT FOR META 1! Yeesh.
  6. Blocks.red_mushroom; ? Blocks.brown_mushroom; ? It's amazing what you can find by using ctrl-f inside Block.java blockRegistry.addObject(39, "brown_mushroom", (new BlockMushroom()).setHardness(0.0F).setStepSound(soundTypeGrass).setLightLevel(0.125F).setBlockName("mushroom").setBlockTextureName("mushroom_brown")); blockRegistry.addObject(40, "red_mushroom", (new BlockMushroom()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("mushroom").setBlockTextureName("mushroom_red"));
  7. [nobbc][/nobbc] causes italics. You need to wrap it in [nobbc][nobbc][/nobbc]
  8. On this, you can change that, but I wouldn't bother. I think there's a piece that makes it so that it uses less network data, but I don't recall exactly. I don't remember what bits to fiddle with to do it, but I did make it update slower than normal (for one of my maps). It might be the mapData.setColumnDirty(...) function.
  9. You have a null pointer in your main mod file
  10. Then you're doing several things wrong. 1) That code sets the block to the north, not itself 2) That code never says "am I metadata 0?" 3) That code uses update flag 1, not 3 (you almost always want 3)
  11. I need to be able to save out and then reload a reference to a Minecart, because the TileEntity is "catching" it and hold it in place until its finished, then reapplying some momentum to it when its done, so that the cart continues on its merry way. Problem is, I can't seem to make that "reapplying some momentum to it when its done" part work after a save/load because I literally have no way of getting an entity from the World by anything other than incremental spawn ID (not guaranteed to persist, AFAIK) or by AABB (not save-able or not able to ensure match). What am I missing?
  12. Vanilla recipe objects are designed to only consume 1 item in a stack. If you want it to consume more, you need to create your own IRecipe class.
  13. Oh that. Not that I know of. All that info is stored in a CSV file: C:\Users\[username]\.gradle\caches\minecraft\net\minecraftforge\forge\[forge version]\unpacked\conf You want fields.csv and methods.csv and be aware that same-name objects in different classes have different obfuscated names.
  14. Heh. I only remember that I chewed on it back in 1.6.4, I remember almost nothing other than what I was able to glean from my code. I did some pretty neat shit, though. Thinking about using the ore map with this custom data block I have (er, data object, it's not a Block ). It'd be harder to get data into the map (using the existing prospecting method) but would have a little more permanence.
  15. totalWorldTime is the "number of ticks the world has been active in memory" (I don't believe that unloaded dimensions will see this number increase; e.g. mod-added dims, as the nether and end always have some portions loaded). worldTime on the other hand is closer to a "current date." It doesn't tick when DaylightCycle is false and is incremented to sunrise when the player sleeps. Use them well (and don't use setWorldTime() unless you have a damn good reason to).
  16. There's a way of detecting if you're in a deobf environment (I don't use reflection often enough to be using that method, or remember what it's called) and you can do an if(obf) { str = "p_1234_0_" } else { str = "theThing" } and do the reflection with the str variable.
  17. That may have been true once, but if you look at /** * Set current world time */ public void setWorldTime(long p_76068_1_) { this.worldTime = p_76068_1_; } in the same class, you'd notice that it doesn't enforce the note in the javadoc (which was written by someone contributing to MCP, not Mojang). And if you trace all usages back around to the things that actually make it go up, you'll notice a continuous lack of any %24000 math, except here in WorldServer.java: public void tick() { //... if (this.areAllPlayersAsleep()) { if (this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) { long i = this.worldInfo.getWorldTime() + 24000L; this.worldInfo.setWorldTime(i - i % 24000L); } this.wakeAllPlayers(); } //... } Which goes out of its way to insure that the value isn't truncated to 23999.
  18. No. http://www.minecraftforge.net/forum/index.php/topic,22764.0.html
  19. You'll have to excuse the obfuscated code. This is out of an old, old project (1.6.4 actually) and I never refactored the variable names. ItemMyEmptyMap.java public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { //the string here is the key in a key->value relationship in a HashMap. Really you can use whatever. //the item stack here is important, as this converts the item from the empty map to the filled map. ItemStack itemstack1 = new ItemStack(MapsBase.OreMapItem, 1, par2World.getUniqueDataId("map")); //get a unique name String s = "map_" + itemstack1.getItemDamage(); MapData mapdata = new MapData(s); //this line maps the specific map to its data for save/load par2World.setItemData(s, mapdata); //boring stuff mapdata.scale = 1; int i = 128 * (1 << mapdata.scale); mapdata.xCenter = (int)(Math.round(par3EntityPlayer.posX / (double)i) * (long)i); mapdata.zCenter = (int)(Math.round(par3EntityPlayer.posZ / (double)i) * (long)i); mapdata.dimension = (byte)par2World.provider.dimensionId; mapdata.markDirty(); --par1ItemStack.stackSize; itemstack1.setItemName("Ore Density Map ("+mapdata.xCenter+","+mapdata.zCenter+")"); if (par1ItemStack.stackSize <= 0) { return itemstack1; } else { if (!par3EntityPlayer.inventory.addItemStackToInventory(itemstack1.copy())) { par3EntityPlayer.dropPlayerItem(itemstack1); } return par1ItemStack; } } ItemMyFilledMap.java @Override public void updateMapData(World world, Entity player, MapData mapData) { short short1 = 128; //this line is likely the most important one for you //the MapInfo object is what contains the actual pixel data displayed MapInfo mapinfo = mapData.func_82568_a((EntityPlayer)player); //loop, blah blah for(x) { for(z) { int colorIndex = /*some color*/ mapData.colors[x + z * short1] = colorIndex; } } }
  20. Do you have a registered GUI handler? (That is, a class that implements IGuiHandler registered with the NetworkRegistry with registerGuiHandler )
  21. Yes, but that large texture sheet isn't referenced by anything anywhere. Well, it probably is, but it's buried so deep that I have never been able to find it. As for dealing with OGL, once you have raw pixel data, it's not too bad. I did this by operating on the raw bitmap data (arrays of integers). I actually utilized some code from that project for a block I'm working on, as I wanted to simulate rock fracture planes better than destroyed/not destroyed from explosions. So I snagged the 2D line-drawing code from that project, converted it to handle 3D, and did the research for the 3D rotation of an arbitrary vector around another arbitrary vector (so I could draw 3D lines that went from the destroyed block, away from the explosion, but at a random angular offset). Anyway, towards this problem: Neither will do much good if we can't save the data back into the texture sheet.
  22. Basically: Why the hell did you smash main-mod-file things into your sword class? What the fuck is this line? test_sword = new Item().setUnlocalizedName("test_sword").setCreativeTab(CreativeTabs.tabCombat); Where's your @Mod annotation?

Important Information

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

Account

Navigation

Search

Search

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.