Comments (2)
Thanks for your response on Discord, Blay. I've modified the "Icon" to now be a tag, but I'm still getting nothing - no categories, nor anything in the logs. Here's the code.
@Mod.EventBusSubscriber(modid = "seasonal_seed_shop", bus = Mod.EventBusSubscriber.Bus.MOD)
public class Events {
@SubscribeEvent
public static void onIMCEvent(InterModEnqueueEvent event) {
final Logger LOGGER = LogManager.getLogger();
ItemStack autumnIcon = new ItemStack(Items.STONE_HOE);
CompoundTag iconTag = new CompoundTag();
autumnIcon.save(iconTag);
LOGGER.fatal(ItemStack.of(iconTag).getItem().getRegistryName());
CompoundTag winterData = new CompoundTag();
winterData.putString("RegistryName", "seasonal_seed_shop:winter_crops");
winterData.putString("Tooltip", "Winter");
winterData.put("Icon", iconTag);
winterData.putInt("SortIndex", 4);
CompoundTag springData = new CompoundTag();
springData.putString("RegistryName", "seasonal_seed_shop:spring_crops");
springData.putString("Tooltip", "Spring");
springData.put("Icon", iconTag);
springData.putInt("SortIndex", 1);
CompoundTag summerData = new CompoundTag();
summerData.putString("RegistryName", "seasonal_seed_shop:summer_crops");
summerData.putString("Tooltip", "Summer");
summerData.put("Icon", iconTag);
summerData.putInt("SortIndex", 2);
CompoundTag autumnData = new CompoundTag();
autumnData.putString("RegistryName", "seasonal_seed_shop:autumn_crops");
autumnData.putString("Tooltip", "Autumn");
autumnData.put("Icon", iconTag);
autumnData.putInt("SortIndex", 3);
InterModComms.sendTo("farmingforblockheads", "RegisterMarketCategory", () -> winterData );
InterModComms.sendTo("farmingforblockheads", "RegisterMarketCategory", () -> springData );
InterModComms.sendTo("farmingforblockheads", "RegisterMarketCategory", () -> summerData );
InterModComms.sendTo("farmingforblockheads", "RegisterMarketCategory", () -> autumnData );
ItemStack boat = new ItemStack(Items.ACACIA_BOAT);
CompoundTag boatTag = new CompoundTag();
boat.save(boatTag);
CompoundTag test = new CompoundTag();
test.put("OutputItem", boatTag);
test.put("CostItem", boatTag);
test.putString("Category", "seasonal_seed_shop:summer_crops");
InterModComms.sendTo("farmingforblockheads", "RegisterMarketEntry", () -> { return test; });
LOGGER.fatal("Hello from Seasonal Seeds Shop!");
}
}
I also tested by adding a boat item to the category, but still nothing appears in the market.
from farmingforblockheads.
You are right, it seems the IMC API is currently non-functional because its registrations are reset when a world is loaded.
I recommend using the data pack API instead by placing json files like this in your mod's resources, since I probably won't be fixing IMC before 1.19:
Example file: https://gist.github.com/blay09/93a48d092d6dc570a64c81e1912dc4d0
from farmingforblockheads.
Related Issues (20)
- [1.19] Registry errors in Market Data
- When closing the market, return items in the GUI to the inventory instead of tossing them on the ground
- Shift click a trade in the market to automatically insert currency HOT 1
- Make registry errors less intrusive if they're from inbuilt data
- ja_jp translation. HOT 1
- Allow Tags support for Default Payments in Market for 1.16.5 and above HOT 1
- JEI Plugin Error HOT 1
- OvenRenderer Crash on latest 1.12.2 version HOT 1
- Caught Error from mod plugin HOT 1
- Feeding Trough not feeding Mooshrooms HOT 1
- Feeding trough not feeding correctly HOT 1
- Harvesters.. I know, I know... HOT 2
- No trades showing? HOT 1
- Vanilla seeds not added?
- Parsing error loading Farming for Blockheads Byg Compat
- Fertilized farmland not all accounted for HOT 1
- Config issue HOT 1
- The chicken coop is too weak. HOT 1
- Fertilized Farmland appears to be incompatible with Immersive Engineering Hemp HOT 3
- Feeding trough not breeding animals HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from farmingforblockheads.