Jump to content

statphantom

Members
  • Posts

    118
  • Joined

  • Last visited

Everything posted by statphantom

  1. so you want the 2nd flower that spawns to not drop a seed and only the original?
  2. do you mean it drops a seed and itself when broken, and then when placed will only drop itself?
  3. post some code. the entity.world is... well, world specific (dimension specific).
  4. Thanks, took me a while but found out I have to do this via an iterator as the method you taught me before (using a for each loop) cant remove. Got it working now
  5. this is what I'm doing, I'm catching it via getDigSpeed, but I want to only affect tools that are specially made for the right blocks (e.g. effective on). but to do that I have to either... use getHavestLevel / canHarvestBlock and check through every single block I want to be effective. Or... add my own 'effective blocks' to the tool, then check isToolEffective. My issue is adding effective blocks to my tool, I need to know the correct string to pass into the Set as it checks strings, but all guides I have found passes in Set<Block>, have tried this and doesn't work.
  6. Sorry, I stated that this works however this only worked for clearing the whole lot, how do I find the correct object to remove here in order to remove the correct one?
  7. ohh I see sorry, misread what you meant I have marked this one as solved but I am still having issues on the other topics you have been helping me with
  8. According to block.getBlock().isToolEffective(), it requires a string (and is working using strings) but any guide I have seen shows ItemTool() constructor passing in a block set, and it is not working in my method.
  9. I just assumed using as much vanilla code as possible was best for comparability, so should I never extend ItemTool? and instead just extend Item?
  10. 1. following tutorials it said to do this, and I have done this due to that my tool really is a tool and I take advantage of harvest levels, tool material etc. To me this seems simpler and more compatibly friendly 2. thanks fixed that 3. I had seen and fixed that but forgot to edit this post to show it 4. this is how I learnt to iterate through sets when learning java
  11. Hey, me again, probably getting annoying but I have another issue now. I am using a method... public boolean isEffective(ItemStack helditem, Block block) { if (helditem.getItem() instanceof ItemTool) { Set tooltypes = helditem.getItem().getToolClasses(helditem); Iterator<String> i = tooltypes.iterator(); while (i.hasNext()) { if (block.isToolEffective(i.next(), block.getDefaultState())) { return true; } } } return false; } In order to easily make an adaptable way to only allow blocks to be destroyed if it is the effective tool, however this gives me a problem, my custom tool I have made a custom tool class so I need to add my own 'effectiveon' Set but no guides I can find help me with this, the only one I find says to use the following.... public static final Set effectiveon = Sets.newHashSet(new Block[] { Blocks.grass, Blocks.dirt, Blocks.sand, Blocks.gravel, Blocks.snow_layer, Blocks.farmland}); however this passes in blocks where check effectiveness checks strings. What shall I do here please?!
  12. Hey all, a lot of forums have asked this but I have yet to find a 1.8 way to do what I want, I just want to REMOVE a vanilla recipe, not replace a recipe to have my item, not have a on craft event to change a made item to my new item, I just want to remove a vanilla recipe so my custom recipe is the only way to 'craft' the item. Thanks.
  13. I am wondering the best way to loop through a Item's isEffectiveOn() Block <set> in order to manually change the mining speed. Please help with your ideas? thanks. I am currently doing.... if (isEffective(helditem, block)) { event.newSpeed = event.originalSpeed * 0.3f; } private boolean isEffective(ItemStack helditem, Block block) { if (helditem.getItem() instanceof ItemTool) { Set tooltypes = helditem.getItem().getToolClasses(helditem); Iterator<String> i = tooltypes.iterator(); while (i.hasNext()) { if (block.isToolEffective(i.next(), block.getDefaultState())) { return true; } } } return false; }
  14. I am still learning so cant help you 100% but one thing that might help is, ItemStack (from player.getHeldItem()) is your object of the item, your damage, your adjustments, your enchantments etc. Where the Item (player.getHeldItem().getItem()) is kinda like a reference to the Class that your held item is a part of, e.g. testing if it is an instanceof ItemTool. If I'm wrong correct me please.
  15. I cant find any reference to .json model files in there this is what I have so far that seems to start to work, however I cant figure out while it is saying missing textures. { "textures": { "0": "blocks/barkwall" }, "elements": [ { "name": "Cube", "from": [ 0.0, 0.0, 0.0 ], "to": [ 16.0, 16.0, 3.0 ], "faces": { "north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ], "cullface": "north" }, "east": { "texture": "#0", "uv": [ 12.0, 0.0, 16.0, 16.0 ], "cullface": "east" }, "south": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ], "cullface": "south" }, "west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 16.0 ], "cullface": "west" }, "up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 3.0 ], "cullface": "up" }, "down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 3.0 ], "cullface": "down" } } } ] }
  16. hey all, been searching around, following tutorials etc but I am having a massive issue getting textures and models to work. can do a simple block but anything more complicated breaks, does anyone know of a good program / guide to follow that doesnt break my models / textures? I have tried MC Model editor, model creator, and followed bedrocks tutorials. Thanks.
  17. NEW VIDEO UPDATE
  18. There should be some errors in the log telling you what went wrong. The Grey Ghost has a guide to troubleshooting block and item rendering here. Thanks, had no idea you had to render it as an item AND a block, the guide I followed skipped that step
  19. I still have no texture in the crafting table or in my hand
  20. Thanks! worked like a charm, does your second sentence mean that I should move my public static Item sharpstick = new SharpStick(); etc. into a method like I did with blocks and call that in preInit also? PS: should I register the blocks in the constructor like I did in in items? package statslevelmod; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public class SharpStick extends Item { private final String name = "sharpstick"; public SharpStick() { super(); GameRegistry.registerItem(this, name); setCreativeTab(CreativeTabs.tabMisc); setUnlocalizedName(name); setMaxStackSize(64); } } or is doing it in a method like in blocks is the ideal way to go? seems like what I have done with items and blocks are two different ways to do the same thing but how should I do it?
  21. after following a few guides I have created a new block however when I craft it I get a crash, the crash report seems to point to the blocks meta data but I have no idea why. Spawning the block in works fine, but has no texture when holding. My Custom Block: My Main Class (where I register) blockstate > barkwall.json models > block > barkwall.json models > item > barkwall.json Crash Report http://pastebin.com/BHmvLFYJ
  22. Hey, I am wondering how to create blocks that are sorta like vertical slabs but thinner (similar to forge microblocks 'covers'). I am looking for any tutorials that can replicate this effect or for me to learn and place them how I want, learn to texture them right etc. Thanks.
  23. what is the exact name of random.break to check against? can't seem to find it at all
×
×
  • Create New...

Important Information

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