Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

DragonFerocity

Members
  • Posts

    114
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    http://dragonferocity.com/
  • Location
    The Nether
  • Personal Text
    Find me on Steam, Guild Wars 2, and Overwatch

Recent Profile Visitors

2135 profile views

DragonFerocity's Achievements

Creeper Killer

Creeper Killer (4/8)

0

Reputation

  1. Hello, I'm recently getting back to updating my mod (from 1.12.2), but I'm running into an issue. I went through the Getting Started section on the MCForge Docs page (https://mcforge.readthedocs.io/en/1.15.x/gettingstarted/#from-zero-to-modding), running the "gradlew genEclipseRuns". (When I run "gradlew build" obviously there are a bunch of errors that I need to fix) My issue is that in Eclipse, when I run my mod, it is still using Minecraft 1.12.2 so it doesn't encounter any errors. How can I make my Eclipse Project use Minecraft 1.16.2 and actually give me the errors that "gradlew build" does? (One of the errors is: src\main\java\com\DragonFerocity\expanded\blocks\ModBlock.java:8: error: cannot find symbol import net.minecraft.block.material.MapColor; But if I look at the "ModBlock.java" file in Eclipse and go to the definition of "MapColor", MapColor exists when obviously it's been changed) Thanks, EDIT: I think I have fixed it, not entirely sure how, but I double checked that everything in my build.gradle was correct and made a few adjustments.
  2. Hey guys, I'm attempting to implement custom villager trades for a mod I'm working on. I can't seem to get it to work, I followed the instructions here in this article, but I can't get a villager to spawn with the trade I'm wanting to add. Here's my code: SellTrades.java public class SellTrades implements EntityVillager.ITradeList { private ItemStack itemToSell; private EntityVillager.PriceInfo sellPrice; private boolean enchant; public SellTrades(Item sell, EntityVillager.PriceInfo price, boolean shouldBeEnchanted) { itemToSell = new ItemStack(sell, 1); sellPrice = price; enchant = shouldBeEnchanted; } public SellTrades(ItemStack sell, EntityVillager.PriceInfo price, boolean shouldBeEnchanted) { itemToSell = sell; sellPrice = price; enchant = shouldBeEnchanted; } @Override public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random) { if (enchant) itemToSell = EnchantmentHelper.addRandomEnchantment(random, new ItemStack(this.itemToSell.getItem(), 1, this.itemToSell.getMetadata()), 5 + random.nextInt(15), false); ItemStack itemstack = new ItemStack(Items.EMERALD, sellPrice.getPrice(random)); recipeList.add(new MerchantRecipe(itemstack, itemToSell)); } } Which works well. This allows me to specify a new trade with an item the villager is selling, and a price range for the number of emeralds required to buy said item. So, according to the article linked above, I need to add a recipe to the villagers using my class. Here's how I did that: VillagerRegistry.VillagerCareer smith = ForgeRegistries.VILLAGER_PROFESSIONS.getValue(new ResourceLocation("minecraft:smith")).getCareer(3); smith.addTrade(1, new SellTrades(BlockHandler.iMithrilPickaxe, new EntityVillager.PriceInfo(8, 11), true)); These two lines of code are in my ServerProxy/CommonProxy class. Initially, I had them in my init() method, and then I moved it to my preInit() method. Is this the correct way to register the trade? The article linked above doesn't mention anything about having to register the trade so I'm thinking I don't need to. Thanks,
  3. Hey guys, I'm not posting any code because that's not what I'm having trouble with. Here's my issue: I have successfully created a new dimension and it works properly. I can teleport there using an item and teleport back (although it crashes when teleporting to and fro because of an unrelated issue that would be solved if I can solve this issue.). I would like to be able to create a structure that the player has to interact with (like the nether portal) but made out of something else other than obsidian, but you still have to light it to "activate" it. I'd then like that portal to teleport the player to my custom dimension and have it create a portal of the same type (not a nether portal) at the "same" location in my dimension so the player can leave. Basically, a Nether Portal to another dimension made out of different materials is what I'd like to achieve. As far as I can tell, I have two options: Don't create a teleporter, or create a CoreMod... The WorldServer class by default uses the vanilla teleporter class, thus when you call the Entity.changeDimension function, it get's the current WorldServer's teleporter type and creates a new teleporter of that type, which happens to be a Nether Portal. Thus when I call the Entity.changeDimension function, it creates a nether portal in the dimension I'm leaving and the custom dimension I'm going to. I want a custom teleporter to be created instead but I don't think that's possible. I've looked into the possibility of creating my own WorldServer class that has the teleporter I want, however that won't affect the Overworld or the Nether. Only my dimension (thus a nether portal would still be created in whatever dimension I'm coming from.) If I used CoreMod stuff instead, I could override the WorldServer class with the proper fields, but that would also require overriding the Entity.ChangeDimension function and a few other things as well. What would you suggest I do? Or is there an easier way to do what I want? Is there a way to change the players dimension without it creating a nether portal in both dimensions? Thanks,
  4. Okay, am I getting the second parameter (the IRenderFactory) correctly? I found this thread which said to use RenderingRegistry.registerEntityRenderingHandler(EntityNewEntity.class, RenderNewEntity::new); Now that I have that implemented, my entity has the same texture as the player for some reason
  5. On my end, they both show as deprecated. These are the two different ones that I see: RenderingRegistry.registerEntityRenderingHandler(entityClass, renderFactory); RenderingRegistry.registerEntityRenderingHandler(entityClass, renderer); And both show Deprecated. use the factory version during Preinitialization. TODO Will be removed in 1.11.
  6. Is there another way to register entities now? Whenever I type in this function, Eclipse says "Deprecated. use the factory version during Preinitialization. TODO Will be removed in 1.11." What should I do instead? EDIT: I already have EntityEntry entry = EntityEntryBuilder.create() .entity(MyEntity.class) .id(new ResourceLocation(...), ID++) .name("my_entity") .egg(0xFFFFFF, 0xAAAAAA) .tracker(64, 20, false) .build(); event.getRegistry().register(entry); implemented. I'm assuming I still need to register the render though?
  7. Here's the difference in the files between my last version and the version that's giving me errors.
  8. I went back to version 14.23.0.2491 and the problems still persist. However, it does build correct now when I run gradlew build
  9. I guess I downloaded the most recent. Should I go back to the last stable?
  10. Are there eclipse files in the src directory? I couldn't see any. One thing I did try was creating a new project from scratch using forge, then I edited the build.gradle file with the correct info and copied my src folder over to the new project. The same thing occured.
  11. Hey guys, I don't know what I did, but after upgrading my mod to 1.12.2 from 1.12, many things seem to have broken. Here's my steps: I updated my build.gradle file (you can see it below) I ran gradlew clean Ran gradlew setupDecompWorkspace Ran gradlew eclipse Now things are broken. Whenever I run my mod from eclipse, it keeps telling me that every single one of my items are being registered twice If I run gradlew build, it tells me that there a variable that I can clearly see doesn't exist: As far as I know I didn't change anything significant between upgrading from 1.12.2 from 1.12. I can post more code, or a link to my github if needed. Your help is appreciated.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.