Jump to content
  • Home
  • Files
  • Docs
All Content
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Minecraft Forge
  • General Discussion
  • Why changes like this are even a thing?
  • Announcements

    • LexManos

      Forge 1.12 and Announcement   06/17/17

      Please read this: http://www.minecraftforge.net/forum/topic/58706-regarding-minecraft-112-and-policy-changes/  
Sign in to follow this  
Followers 0
American2050

Why changes like this are even a thing?

Started by American2050, January 20, 2017

4 posts in this topic

American2050    11

American2050

American2050    11

  • Dragon Slayer
  • American2050
  • Members
  • 11
  • 518 posts
  • Report post
Posted January 20, 2017

I was wondering why between version and versions we get minor changes like

 

1.10.2

Minecraft.getMinecraft().theWorld;

 

1.11.2

Minecraft.getMinecraft().world;

 

Is it really that important to rename those things, what's the overall idea behind this changes?

 

Well, just wondering this, thanks for the feedback.

Share this post


Link to post
Share on other sites

diesieben07    5803

diesieben07

diesieben07    5803

  • Reality Controller
  • diesieben07
  • Forum Team
  • 5803
  • 37027 posts
  • Report post
Posted January 20, 2017

The idea is to slowly but surely clean up old cruft that has built up in the mappings. It just makes things more pleasant to work with if you can do

 Minecraft.getMinecraft().player.sendMessage

instead of

Minecraft.getMinecraft().The player.addChatComponentMessage

. And this is just the first I've come up with.

Share this post


Link to post
Share on other sites

American2050    11

American2050

American2050    11

  • Dragon Slayer
  • American2050
  • Members
  • 11
  • 518 posts
  • Report post
Posted January 20, 2017

Ohh ok. Yes that was other one I was having to change while updating to 1.11.2 the Chat messages.

 

Interesting, and for sure, it makes things more clear and nice looking.

Share this post


Link to post
Share on other sites

diesieben07    5803

diesieben07

diesieben07    5803

  • Reality Controller
  • diesieben07
  • Forum Team
  • 5803
  • 37027 posts
  • Report post
Posted January 20, 2017

While looking at another thread I came across another class that just hat atrocious method names before: MathHelper.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0
Go To Topic Listing General Discussion

  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Pugz
      How to add custom anvil recipes?

      By Pugz · Posted 30 minutes ago

      What i meant was, making the scrolls able to be combined with gear like enchanted books are. They are gonna be used to give stronger enchants than books would.
    • Draco18s
      How to add custom anvil recipes?

      By Draco18s · Posted 35 minutes ago

      The anvil doesn't have recipes.
    • Pugz
      How to add custom anvil recipes?

      By Pugz · Posted 40 minutes ago

      Ive made custom enchanted scrolls that will be used in an anvil to make gear stronger, but i have no idea how to make them work in an anvil! Its not the same as regular recipes, im guessing theres some complicated stuff you gotta do. Any help? Maybe some githubs i can look at or tutorials?
    • LilyKat24
      How to make my custom shears not use durability on blocks it dont shear?

      By LilyKat24 · Posted 1 hour ago

      Hello! first of all I'm new to programming and this is my first mod, sop please go "easy" on me :3 I am making a mod that adds more kinds of shears, so far I've added the first shear, and it actually works, but i want to make it so when i break a block that a shear isn't able to "shear", I don't want the durability to go down. any way i can make this happen? here's the code of my Wooden Shears class, thanks!   package me.lilykat24.moarshears.items; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class ItemWoodenShears extends Item { public ItemWoodenShears(String name) { setUnlocalizedName(name); setRegistryName(name); } /** * Called when a Block is destroyed using this Item. Return true to trigger the "Use Item" statistic. */ public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving) { if (!worldIn.isRemote) { stack.damageItem(1, entityLiving); } Block block = state.getBlock(); if (block instanceof net.minecraftforge.common.IShearable) return true; return state.getMaterial() != Material.LEAVES && block != Blocks.WEB && block != Blocks.TALLGRASS && block != Blocks.VINE && block != Blocks.TRIPWIRE && block != Blocks.WOOL ? super.onBlockDestroyed(stack, worldIn, state, pos, entityLiving) : true; } /** * Check whether this Item can harvest the given Block */ public boolean canHarvestBlock(IBlockState blockIn) { Block block = blockIn.getBlock(); return block == Blocks.WEB || block == Blocks.REDSTONE_WIRE || block == Blocks.TRIPWIRE; } /** * Returns true if the item can be used on the given entity, e.g. shears on sheep. */ @Override public boolean itemInteractionForEntity(ItemStack itemstack, net.minecraft.entity.player.EntityPlayer player, EntityLivingBase entity, net.minecraft.util.EnumHand hand) { if (entity.world.isRemote) { return false; } if (entity instanceof net.minecraftforge.common.IShearable) { net.minecraftforge.common.IShearable target = (net.minecraftforge.common.IShearable)entity; BlockPos pos = new BlockPos(entity.posX, entity.posY, entity.posZ); if (target.isShearable(itemstack, entity.world, pos)) { java.util.List<ItemStack> drops = target.onSheared(itemstack, entity.world, pos, net.minecraft.enchantment.EnchantmentHelper.getEnchantmentLevel(net.minecraft.init.Enchantments.FORTUNE, itemstack)); java.util.Random rand = new java.util.Random(); for (ItemStack stack : drops) { net.minecraft.entity.item.EntityItem ent = entity.entityDropItem(stack, 1.0F); ent.motionY += rand.nextFloat() * 0.5F; ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F; ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F; } itemstack.damageItem(1, entity); } return true; } return false; } @Override public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, net.minecraft.entity.player.EntityPlayer player) { if (player.world.isRemote || player.capabilities.isCreativeMode) { return false; } Block block = player.world.getBlockState(pos).getBlock(); if (block instanceof net.minecraftforge.common.IShearable) { net.minecraftforge.common.IShearable target = (net.minecraftforge.common.IShearable)block; if (target.isShearable(itemstack, player.world, pos)) { java.util.List<ItemStack> drops = target.onSheared(itemstack, player.world, pos, net.minecraft.enchantment.EnchantmentHelper.getEnchantmentLevel(net.minecraft.init.Enchantments.FORTUNE, itemstack)); java.util.Random rand = new java.util.Random(); for (ItemStack stack : drops) { float f = 0.7F; double d = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; double d1 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; double d2 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; net.minecraft.entity.item.EntityItem entityitem = new EntityItem(player.world, (double)pos.getX() + d, (double)pos.getY() + d1, (double)pos.getZ() + d2, stack); entityitem.setDefaultPickupDelay(); player.world.spawnEntity(entityitem); } itemstack.damageItem(1, player); player.addStat(net.minecraft.stats.StatList.getBlockStats(block)); player.world.setBlockState(pos, Blocks.AIR.getDefaultState(), 11); return true; } } return false; } public float getDestroySpeed(ItemStack stack, IBlockState state) { Block block = state.getBlock(); if (block != Blocks.WEB && state.getMaterial() != Material.LEAVES) { return block == Blocks.WOOL ? 5.0F : super.getDestroySpeed(stack, state); } else { return 15.0F; } } }  
    • HalestormXV
      Best way to do a Master List of multiple List<ItemStack>

      By HalestormXV · Posted 1 hour ago

      Alright so just flatMap on that one then okay. But now how would i check each of those lists, it wouldnt be normal list iteration right? For example index 0 in that map would be a list that contains A,B,C,D and index 1 in that map would be a list that contains 1, 2, 3, 4. So how would I check and pull out the valus from each of those lists? Or would it simply be just normal list iteration?   What I am trying to acheive is the following. There is an item that has 4 slots. Based on the items within those 4 slots and the order that those items are in, that weapon is charged with a different ability. For instance in the example above you will notice that blastStrike is new ItemStack(ItemInit.ITEM_RUNE, 2, FIRE_RUNE.getMeta()), new ItemStack(ItemInit.ITEM_RUNE, 1, EARTH_RUNE.getMeta()), new ItemStack(ItemInit.ITEM_RUNE, 1, AIR_RUNE.getMeta()) Those are the requirements for blastStrike. So if a player has those items placed in the correct slots in the correct order their weapon will have a chance to inflict blastStrike on hit. My goal is to rather than create an independent check for every single ability to store all the requirments in the lists, like above, into a masterList and then simply just go through the masterList and see if what is currently in the weapon slots matches an entry in that master list.
  • Topics

    • Pugz
      2
      How to add custom anvil recipes?

      By Pugz
      Started 39 minutes ago

    • LilyKat24
      0
      How to make my custom shears not use durability on blocks it dont shear?

      By LilyKat24
      Started 1 hour ago

    • HalestormXV
      3
      Best way to do a Master List of multiple List<ItemStack>

      By HalestormXV
      Started April 7

    • AAnonymoos
      5
      Blue screen (Not blue screen of death)

      By AAnonymoos
      Started Sunday at 08:28 PM

    • TreyRuffy
      4
      [1.12.2] Cannot connect to multiplayer servers

      By TreyRuffy
      Started 21 hours ago

  • Who's Online (See full list)

    • hiotewdew
    • zucki
    • Pugz
  • All Activity
  • Home
  • Minecraft Forge
  • General Discussion
  • Why changes like this are even a thing?
  • Theme
  • Contact Us

Copyright © 2017 ForgeDevelopment LLC Powered by Invision Community