
xTekBlue
Members-
Posts
45 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
xTekBlue's Achievements

Tree Puncher (2/8)
0
Reputation
-
Oh sorry, do you know a good forum that does before i remove this topic?
-
Good Afternoon, I have been trying to create a launcher for about 3-5 days now using C#. I have been able to get everything done but the launching. I can authenticate the user with the new auth system and can even pull the information from the auth server. My trouble is when I start to work on "Launching the Client". I named the function "StartMinecraft" for simplicity. I literally copied the entire folder of .minecraft to my own custom folder ".AkumaMC" as a way of testing. I used a batch file to get the default launcher params when launching the client. When I launch/run this function I get no error and the client simply does not open. Does anyone know why this could be? Code: Pictures: UPDATE: I have found that changing the default ".minecraft" folder is causing the problem. Even though i specify that the gamedir is somewhere else, it is still having issues launching the game. Does anyon know a fix to this? Warning, there is a lot of Libs All variables are set up correctly. Quick Note: the path for "-Djava.library.path=", I launched the client, found the temp folder while the game was running and copied the files from the folder it called. I plan on downloading these from my own webserver to players ".AkumaMC" folders so that I will not have to download these files. (If there is a way to get these dll files, please let me know this too <3) Thanks for any help given. Cheers.
-
Problem solved, i wasn't calling the method on client's. package xtekblue.mod.objects.blocks; import java.util.Random; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; import xtekblue.mod.Main; import xtekblue.mod.init.ItemInit; public class SmoothObsidian extends BlockBase { public SmoothObsidian(String name, Material material) { super(name, material); setCreativeTab(Main.xtrablocks); setHardness(50.0F); setHarvestLevel("pickaxe", 3); setResistance(2000.0F); } public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if(worldIn.isRemote) { return this.DoDropsOB(worldIn, pos, state, playerIn, hand); }else { return this.DoDropsOB(worldIn, pos, state, playerIn, hand); } } private boolean DoDropsOB(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand) { if (player.getHeldItem(hand) != null) { Item item = player.getHeldItem(hand).getItem(); if (item != ItemInit.INGOT_SAW && item != ItemInit.ENCHANTED_SAW) { return false; }else if(item == ItemInit.INGOT_SAW && item.getDamage(player.getHeldItem(hand)) == player.getHeldItem(hand).getMaxDamage()) { player.inventory.deleteStack(player.getHeldItem(hand)); worldIn.destroyBlock(pos, false); player.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 9)); return true; }else if (item == ItemInit.INGOT_SAW && item.getDamage(player.getHeldItem(hand)) != player.getHeldItem(hand).getMaxDamage()) { player.getHeldItem(hand).setItemDamage(player.getHeldItem(hand).getItemDamage() + 1); worldIn.destroyBlock(pos, false); player.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 9)); return true; }else if (item == ItemInit.ENCHANTED_SAW) { worldIn.destroyBlock(pos, false); player.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 9)); return true; } } return true; } } Working code ^^^ Last thing, is there a method i'm missing to allow a item to harvest a block regardless of level or even whether its a tool period? I can not find it.
-
NEW CODE FOR METHOD private boolean DoDropsOB(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand) { if (player.getHeldItem(hand) != null) { Item item = player.getHeldItem(hand).getItem(); if (item != ItemInit.INGOT_SAW && item != ItemInit.ENCHANTED_SAW) { return false; }else if(item == ItemInit.INGOT_SAW && item.getDamage(player.getHeldItem(hand)) == player.getHeldItem(hand).getMaxDamage()) { player.inventory.deleteStack(player.getHeldItem(hand)); worldIn.destroyBlock(pos, false); player.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 9)); return true; }else if (item == ItemInit.INGOT_SAW && item.getDamage(player.getHeldItem(hand)) != player.getHeldItem(hand).getMaxDamage()) { player.getHeldItem(hand).setItemDamage(player.getHeldItem(hand).getItemDamage() + 1); worldIn.destroyBlock(pos, false); player.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 9)); return true; }else if (item == ItemInit.ENCHANTED_SAW) { worldIn.destroyBlock(pos, false); player.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 9)); return true; } } return true; } The code below still does not seem to work, like it reverts back to normal. worldIn.destroyBlock(pos, false); player.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 9));
-
ok, any idea why the is not working?
-
Wow, that actually helped a lot! Thanks. so now i can tell that private boolean DoDropsOB(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand) { if(player.getHeldItem(hand) == new ItemStack(ItemInit.INGOT_SAW, 1, OreDictionary.WILDCARD_VALUE)) { worldIn.destroyBlock(pos, false); player.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 2)); return true; }else { return true; } } this method is being called but the "if" statement is being called regardless of having a "INGOT_SAW" in my hand or not, meaning any item will call true on this "if" statement. Any reason why. EDIT: also when i changed the code to private boolean DoDropsOB(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand) { worldIn.destroyBlock(pos, false); player.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 2)); return true; } this, it removed the block, gave me the itemstack but replaced the block. no idea why on that one either. EDIT #2: The itemstack that is being added "OBSIDIAN_INGOT" is also not being put in the inventory, ill be using a video to demonstrate below
-
How do you know when that breakpoint is hit? If i know this then debugging will be easier to understand.
-
I mean i get the debugger its just i don't understand where i need to place break points and watch points as such. I also do not know how to read the debugger correctly. The link is fine and will take me sometime to go over it but a video would be clearer than a few screenshots with limited knowledge/text.
-
Still seems to not work, no idea why its not. i do not understand the debugger at all so i'm going to post it on the github and see if someone can debug it properly or if someones willing to show me a video of how to use it thoroughly then that will also work. https://github.com/EzGunzBlazzinn/XtraItems
-
debugger shows nothing besides bad checks on chunk loading [22:25:49] [Server thread/WARN] [FML]: XtraItems loaded a new chunk [-38, 18] in dimension 0 (overworld) while populating chunk [-37, 18], causing cascading worldgen lag. [22:25:49] [Server thread/WARN] [FML]: Please report this to the mod's issue tracker. This log can be disabled in the Forge config. EXAMPLE ^^^ I use eclipse btw
-
The crash had to do with 2 setRegistryName() methods on the same block going to different paths, thats fixed and was not big of a deal. But currently the onBlockActivated is not working how id like it to be and i dont understand why, any idea?
-
package xtekblue.mod.objects.blocks; import net.minecraft.block.BlockObsidian; import net.minecraft.block.SoundType; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; import xtekblue.mod.init.BlockInit; import xtekblue.mod.init.ItemInit; public class OBA extends BlockObsidian { public OBA(String name){ setUnlocalizedName(name); setRegistryName("minecraft", name); setHardness(50.0F); setResistance(2000.0F); setSoundType(SoundType.STONE); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if(playerIn.getHeldItemMainhand() != (new ItemStack(ItemInit.INGOT_SAW, 1, OreDictionary.WILDCARD_VALUE))) { return false; }else if(playerIn.getHeldItemMainhand() != (new ItemStack(ItemInit.ENCHANTED_SAW, 1))) { return false; }else { return this.DoDropsOB(worldIn, pos, state, playerIn); } } private boolean DoDropsOB(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) { if(player.isCreative() && player.getHeldItemMainhand() == new ItemStack(ItemInit.INGOT_SAW, 1, OreDictionary.WILDCARD_VALUE)) { worldIn.destroyBlock(pos, false); player.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 2)); return true; }else if(player.isCreative() && player.getHeldItemMainhand() == new ItemStack(ItemInit.ENCHANTED_SAW, 1)) { worldIn.destroyBlock(pos, false); player.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 2)); return true; }else if(!player.isCreative() && player.getHeldItemMainhand() == new ItemStack(ItemInit.INGOT_SAW, 1, OreDictionary.WILDCARD_VALUE)) { worldIn.destroyBlock(pos, false); if(player.getHeldItemMainhand().getItemDamage() == player.getHeldItemMainhand().getMaxDamage()) { player.inventory.deleteStack(player.getHeldItemMainhand()); }else { player.getHeldItemMainhand().setItemDamage(player.getHeldItemMainhand().getItemDamage() + 1); } player.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 2)); return true; }else if(!player.isCreative() && player.getHeldItemMainhand() == new ItemStack(ItemInit.ENCHANTED_SAW, 1)) { worldIn.destroyBlock(pos, false); player.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 2)); return true; }else { return false; } } } New code and still have no idea why this is not working.
-
I said that because setRegistryName() i had twice which caused a crash. What is a the boolean onBlockActivated return, true meaning what and false meaning what also when the block is right clicked does it do everything in the method?
-
@Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if(playerIn.getHeldItem(hand) == new ItemStack(ItemInit.ENCHANTED_SAW)) { worldIn.destroyBlock(pos, false); playerIn.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 2)); return true; }else if(playerIn.getHeldItem(hand) == new ItemStack(ItemInit.INGOT_SAW, 1, OreDictionary.WILDCARD_VALUE)) { if(playerIn.getHeldItem(hand).getMaxDamage() == playerIn.getHeldItem(hand).getItemDamage()) { playerIn.inventory.deleteStack(playerIn.getHeldItem(hand)); worldIn.destroyBlock(pos, false); playerIn.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 2)); return true; }else { playerIn.getHeldItem(hand).setItemDamage(playerIn.getHeldItem(hand).getItemDamage() + 1); worldIn.destroyBlock(pos, false); playerIn.addItemStackToInventory(new ItemStack(ItemInit.OBSIDIAN_INGOT, 2)); return true; } }else return false; } Also does this not work, that could be the reason i believe its not working, i want the obsidian to break and drop two "Obsidian_ingots" when right clicked with a "ingot_saw", also damage the ingot saw when right clicking with it.
-
would "setRegistryName("minecraft", name);" not work?