Jump to content

drok0920

Forge Modder
  • Posts

    443
  • Joined

  • Last visited

Everything posted by drok0920

  1. And how would i add that? And will that method work for z aswell or just x and y
  2. ok so ill remove them during the load event but when does reload even get triggered? i am aware that there is no event but what would cause it to reload anyway.
  3. Im not very experienced with world generation but if you have the x and z coordinates of the spawn loop from 255 to 0 and find the first non log/leaf block and that is the y you want to work with. Then just clear all unwanted blocks from the area and flatten as normal
  4. So i should do something like this in my block state? { "variants": { "normal": [ {"model": "poverhaul:rock_block", "x": 90 } ] } }
  5. Ok i think i have figured out how to access the field via reflection but when should i remove the advancements? I would assume post init?
  6. Ok but which one do i use. I tried ground but that didnt work.
  7. Hello, I have been trying to make a block that looks like an item thats on the ground. I have gotten it to render the item properly but i cant see to get it to rotate or be offset. Here is my JSON: { "parent": "item/generated", "display": { "rotation": [90, 0, 0] }, "textures": { "layer0": "poverhaul:items/rock_0" } } Minecraft outputs no errors but the model is never rotated in the world.
  8. I have look into AdvancementManager and an instance of it is located in World but it is not accessible. Is there another way to remove the vanilla advancement other than deleting them from their folder.
  9. Thank you for explaining how to add them. I will take a look at Advancement manager to see if i can remove the vanilla ones. Worse case scenario i will advise users to delete the vanilla ones from their world folder. Assuming that minecraft wont just add them back in.
  10. I know that i could just delete the advancement files but i cant have my mod do that automatically and unless i misread something. I also cant include them in my mod i would have to add them to my data folder. Would i need to make my mod write the json files to the data folder every time a world is created or is there a different way of doing it.
  11. Hello again, I am very new to the whole advancement thing and i was wondering how i could A) add my own and B) remove vanilla ones I know that removing the vanilla ones may cause issues with other mods but it is necessary because i am complete changing the games progression.
  12. Well i change it through the generated UI how do i save it then.
  13. Where would i call the sync function? Is there an event?
  14. Hello, I have made a config using the annotation. It displays fine but the values dont seem to actually save nor do they change. Here is my config class: package net.drok.poverhaul; import net.minecraftforge.common.config.Config; @Config(modid = POHMod.MODID) public class ModConfig { public static Tools tools = new Tools(); public static class Tools { @Config.Comment("Defines whether or not to use a more realistic harvest system.") public boolean fixedHarvest = true; @Config.Comment("The speed scaling of tools with a quality of 0") public double minToolScaling = 0.3; @Config.Comment("The speed scaling of tools with a quality of 100") public double maxToolScaling = 1.2; } } And I am using ModConfig.tools.value to access the values. As i said i can change them in the gui but the value is always the default value when i print it to the console.
  15. So i need to use world.isremote?
  16. Hello, I have a question about how configs work. For example i have a tool that gets its speed from my mods config. I know that this will work fine in single player but will the config automatically sync with the server to prevent discrepancies. If not do i need to use packets to do so.
  17. I figured it out, if the item stack doesnt have an ore dictionary id it never gets to the code that checks if it is a rock.
  18. well its never actually evaluating to true
  19. Oh ok that makes sense one last question since all of my other problems seem to have been fixed is how do i check what item an item stack is? Do i do stack.equals(stack2)
  20. Ok then i misunderstood. If you recommended this instead of the Map that i am currently using then it does not fit what i am looking for. I am looking for a method where i dont have to manually register each Item via event.getRegistry().register(value); Is there a better way of doing that or is the only proper way to do each one manually.
  21. So if i just created a public static final field then set it to my item it will automatically registered so long as I annotate it?
  22. First I only check if the itemstack's item is the same as a rock so the oredictionary for that should not be a problem. Second I didnt think that an empty itemstack would be a problem but now that you mention it i see that it is. And third i knew that @ObjectHolder was a thing but doesn't it still need to be registered individually? I am using the Map because i can just convert it's values to an Array and register them all at once.
  23. First i am dicking with the nbt when i call celt.setQuality(celtStack, rock.getQuality(rockStack)); When I do this i am setting an nbt tag called Quality. Second I dont see why it is bad to use ModRegistry.items.get() as i can get the item based on the registry name and i can register all of the items in one line of code.
  24. Hello i have tried to use IRecipe to add NBT to an item when it is crafted. However the output item is never shown and the items i put in as components disappear when i take them out. Why is this happening? Am i doing something wrong? package net.drok.poverhaul.recipe; import net.drok.poverhaul.ModRegistry; import net.drok.poverhaul.item.ItemRock; import net.drok.poverhaul.item.ItemStoneCelt; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.NonNullList; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; public class RecipeStoneCelt extends net.minecraftforge.fml.common.registry.IForgeRegistryEntry.Impl<IRecipe> implements IRecipe { @Override public boolean matches(InventoryCrafting inv, World worldIn) { int rocks = 0; int sticks = 0; int other = 0; for(int i = 0; i < inv.getSizeInventory(); i++) { ItemStack stack = inv.getStackInSlot(i); int[] ids = OreDictionary.getOreIDs(stack); for (int o = 0; o < ids.length; o++) { String ore = OreDictionary.getOreName(ids[o]); if(stack.getItem() == ModRegistry.items.get("rock")) { rocks++; }else if(ore.equals("stick")) { sticks++; } else { other++; } } } if(rocks == 1 && sticks == 1 && other == 0) return true; return false; } @Override public ItemStack getCraftingResult(InventoryCrafting inv) { ItemStack rockStack = ItemStack.EMPTY; for(int i = 0; i < inv.getSizeInventory(); i++) { if(inv.getStackInSlot(i).getItem() == ModRegistry.items.get("stonecelt")) { rockStack = inv.getStackInSlot(i); break; } } ItemStack celtStack = new ItemStack(ModRegistry.items.get("stonecelt")); ItemStoneCelt celt = (ItemStoneCelt) ModRegistry.items.get("stonecelt"); ItemRock rock = (ItemRock) ModRegistry.items.get("rock"); celt.setQuality(celtStack, rock.getQuality(rockStack)); return celtStack; } @Override public boolean canFit(int width, int height) { return (width >= 2 && height >= 2); } @Override public ItemStack getRecipeOutput() { return new ItemStack(ModRegistry.items.get("stonecelt")); } @Override public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) { NonNullList<ItemStack> nonnulllist = NonNullList.<ItemStack>withSize(inv.getSizeInventory(), ItemStack.EMPTY); for (int i = 0; i < nonnulllist.size(); ++i) { ItemStack itemstack = inv.getStackInSlot(i); nonnulllist.set(i, net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack)); } return nonnulllist; } }
  25. Ok so i have this item that holds a custom nbt tag and i want that tag to effect its dig speed. What is the best way to do this? is it even possible? Im just looking for the method that i should put my conversion from nbt to the actual speed in. Thanks!
×
×
  • Create New...

Important Information

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