Jump to content

Recommended Posts

Posted

I can't figure out how to get the Config screen in the mods menu to work. It won't show a "Config" button and when I follow minaliens tutorial it doesn't work either. I can put the code I have up if need be

Posted

Forge has a nice tutorial for this in their own code. Open up your favorite IDE and look for classes implementing cpw.mods.fml.client.IGuiFactory. You will most likely see FMLConfigGuiFactory and ForgeGuiFactory. ForgeGuiClass provides a great tutorial by itself when you can read and understand code. Try it

Posted

Yah.. I was looking at that class... but it is confusing how they write the comments on how it works... I can't figure out what I need to implement... I thought it may be because the build number i'm using is twice the tutorials... so its a pain.. i'll figure it out eventually...

  • 1 month later...
Posted
  On 7/26/2014 at 5:21 AM, F1repl4ce said:

I know you followed the tutorial, but I have to ask...  If your mcmod.info set up correctly?

 

If it isn't, fix it. If it is, then please show your code.

Sorry for the late reply. I've been busy recently... I think it is setup properly take a look:

 

  Reveal hidden contents

 

Here are the code links:

http://bit.ly/1wT4JX9

http://bit.ly/VXY3Wr

http://bit.ly/1wT4Y4s

Posted
  On 8/30/2014 at 6:05 PM, theOriginalByte said:

  Quote

I know you followed the tutorial, but I have to ask...  If your mcmod.info set up correctly?

 

If it isn't, fix it. If it is, then please show your code.

Sorry for the late reply. I've been busy recently... I think it is setup properly take a look:

 

  Reveal hidden contents

 

Here are the code links:

http://bit.ly/1wT4JX9

http://bit.ly/VXY3Wr

http://bit.ly/1wT4Y4s

If anyone can help me please feel free to let me know whats wrong... I followed pahimar's tutorial on how to do it but it doesn't work for me.

Posted
  On 8/31/2014 at 8:53 PM, theOriginalByte said:

  Quote

  Quote

I know you followed the tutorial, but I have to ask...  If your mcmod.info set up correctly?

 

If it isn't, fix it. If it is, then please show your code.

Sorry for the late reply. I've been busy recently... I think it is setup properly take a look:

 

  Reveal hidden contents

 

Here are the code links:

http://bit.ly/1wT4JX9

http://bit.ly/VXY3Wr

http://bit.ly/1wT4Y4s

If anyone can help me please feel free to let me know whats wrong... I followed pahimar's tutorial on how to do it but it doesn't work for me.

Have you established a reference to your GuiFactory in your Main instance?

Posted
  On 8/31/2014 at 10:36 PM, NomNuggetNom said:

  Quote

  Quote

  Quote

I know you followed the tutorial, but I have to ask...  If your mcmod.info set up correctly?

 

If it isn't, fix it. If it is, then please show your code.

Sorry for the late reply. I've been busy recently... I think it is setup properly take a look:

 

  Reveal hidden contents

 

Here are the code links:

http://bit.ly/1wT4JX9

http://bit.ly/VXY3Wr

http://bit.ly/1wT4Y4s

If anyone can help me please feel free to let me know whats wrong... I followed pahimar's tutorial on how to do it but it doesn't work for me.

Have you established a reference to your GuiFactory in your Main instance?

LOL! I forgot to declare the init method in the main class... It works now sorry for wasting your time..

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • You are using Create 6 - some addons are not compatible with it Remove all addons and add these one by one littlecontraptions is mentioned - keep this one removed
    • Different problem now. https://paste.ee/p/iDo8lS35
    • I would like to have a BoP sapling drop from my block if it is also installed. I think I have done everything and I cannot pinpoint the problem, which is the error in the logs that appears when joining a world:   [Worker-Main-11/ERROR] [ne.mi.co.ForgeHooks/]: Couldn't parse element loot_tables:grasses:blocks/leaves_block com.google.gson.JsonSyntaxException: Expected name to be an item, was unknown string 'biomesoplenty:magic_sapling' My code:   LootItemConditions.CONDITIONS.register(modEventBus); public class LootItemConditions { public static final DeferredRegister<LootItemConditionType> CONDITIONS = DeferredRegister.create(Registries.LOOT_CONDITION_TYPE, Grasses.MOD_ID); public static final RegistryObject<LootItemConditionType> IS_MOD_LOADED = CONDITIONS.register("is_mod_loaded", () -> new LootItemConditionType(new IsModLoaded.ConditionSerializer())); } public class IsModLoaded implements LootItemCondition { private final boolean exists; private final String modID; public IsModLoaded(String modID) { this.exists = ModList.get().isLoaded(modID); this.modID = modID; } @Override public LootItemConditionType getType() { return LootItemConditions.IS_MOD_LOADED.get(); } @Override public boolean test(LootContext context) { return this.exists; } public static LootItemCondition.Builder builder(String modid) { return () -> new IsModLoaded(modid); } public static class ConditionSerializer implements Serializer<IsModLoaded> { @Override public void serialize(JsonObject json, IsModLoaded instance, JsonSerializationContext ctx) { json.addProperty("modid", instance.modID); } @Override public IsModLoaded deserialize(JsonObject json, JsonDeserializationContext ctx) { return new IsModLoaded(GsonHelper.getAsString(json, "modid")); } } } protected LootTable.Builder createLeavesDropsWithModIDCheck(Block selfBlock, Item sapling, Property<?>[] properties, String modIDToCheck, float... chances) { CopyBlockState.Builder blockStateCopyBuilder = CopyBlockState.copyState(selfBlock); for(Property<?> property : properties) { blockStateCopyBuilder.copy(property); } return LootTable.lootTable() .withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)) .add(LootItem.lootTableItem(selfBlock) .when(HAS_SHEARS_OR_SILK_TOUCH) .apply(blockStateCopyBuilder))) .withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)) .add(this.applyExplosionCondition(selfBlock, LootItem.lootTableItem(sapling)) .when(IsModLoaded.builder(modIDToCheck))) .when(BonusLevelTableCondition.bonusLevelFlatChance(Enchantments.BLOCK_FORTUNE, chances)) .when(HAS_NO_SHEARS_OR_SILK_TOUCH)) .withPool(LootPool.lootPool().name("sticks").setRolls(ConstantValue.exactly(1.0F)) .add(this.applyExplosionDecay(selfBlock, LootItem.lootTableItem(Items.STICK). apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 2.0F)))) .when(BonusLevelTableCondition.bonusLevelFlatChance(Enchantments.BLOCK_FORTUNE, NORMAL_LEAVES_STICK_CHANCES)) .when(HAS_NO_SHEARS_OR_SILK_TOUCH))); } I don't know. Am I making a mistake somewhere? Am I forgetting something? Should there be something else?
  • Topics

×
×
  • Create New...

Important Information

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