Jump to content

Maciej916

Members
  • Posts

    57
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Maciej916's Achievements

Stone Miner

Stone Miner (3/8)

0

Reputation

  1. That's what I saw. But there must be a way to do that I can see that one mod already doing that and i know i could easly do this by adding custom crafting table but i would prefear to do it in standard crafting table.
  2. Hello my first question is if can i use custom recipe type in Crafting Table, my goal is to create crafting table recipes with require more than one item in the same slot of crafting grid. I achieved this in half way, i would say. I created custom Crafting Recipe and serializer with store count of items needed to craft. I made so it check if there is enough items in slot with are needed for craft and it is working just fine, but the issue with that is when i craft it removes only one item per slot instead of required amount and i don't know how can i achieve so it removes the correct number of items.
  3. I want to make so when the player press shift, item texture change to whatever item id is stored in the nbt data. How I can do that, where should i look for examples.
  4. Thank you, I will update the tag but the issue i have is still valid. Btw is there list of available tags in documentation?
  5. Hello I'm having problems with three generations on the 1.19.2. Basically the tree has the proper blockstates and look when it is growth from sapling but when it comes to worldgen it have the shape and look like standard oak tree and all of them looks the same. Here is what im talking about: This is how the tree should looks like and how it looks when it is growth from sapling: And this is how it looks like in worldgen: It used to work in 1.18.2 but after I updated to 1.19.2 it started to behave like this. Here is my tree classes: https://github.com/Maciej916/Industrial-Reborn/tree/1.19/src/main/java/com/maciej916/indreb/common/world/feature/tree And the configured futures and placed futures: https://github.com/Maciej916/Industrial-Reborn/blob/1.19/src/main/java/com/maciej916/indreb/common/world/feature/ModConfiguredFeatures.java https://github.com/Maciej916/Industrial-Reborn/blob/1.19/src/main/java/com/maciej916/indreb/common/world/feature/ModPlacedFeatures.java And biome modifiers: https://github.com/Maciej916/Industrial-Reborn/tree/1.19/src/main/resources/data/indreb/forge/biome_modifier Can someone help me with that I probably missed something.
  6. So basically I want to register compatibility with TheOneProbe, something like that: private void onCommonSetup(final FMLCommonSetupEvent event) { ModNetworking.setup(); ModGeneration.init(); // if the one probe is installed TOPPlugin.registerCompatibility(); } I didn't test it without mod installed but i think it will fail when it's not present.
  7. How can i check if other mod is present?
  8. That was easier than i expected, thank you for the advice, i'll use: if (level.getGameTime() % 20 == 0)
  9. I have problem with item reapearing in players hand after changing capability value. Here is what I mean by reapearing: It only happens when item has tag "active" and energy.consumeEnergy is called. Does it have something to to with capability or im doing something wrong or do i need to sync it with client? Here is the code: int tickCounter = 0; @Override public void inventoryTick(ItemStack stack, Level level, Entity entity, int p_41407_, boolean p_41408_) { if (!level.isClientSide()) { if (++tickCounter == 20) { tickCounter = 0; stack.getCapability(ModCapabilities.ENERGY).ifPresent(energy -> { CompoundTag tag = stack.getTag(); if (tag != null) { if (tag.getBoolean("active")) { energy.consumeEnergy(Math.min(energy.energyStored(), 100), false); } if (energy.energyStored() == 0) { tag.putBoolean("active", false); stack.setTag(tag); } } }); } } super.inventoryTick(stack, level, entity, p_41407_, p_41408_); }
  10. Thank you for anser, I didn't know that event even exist, I'll use it instead.
  11. Hello, I'm having troubles with adding custom generation on 1.16.3. I used solution from this post https://forums.minecraftforge.net/topic/90560-1162-how-to-add-custom-ore-to-world-generation/ and it's working for ores but i also want to add new tree and Im getting cast error RubberTreeBlockStateProvider cannot be cast to net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider Code I use: public static void initGen() { Registry.register( WorldGenRegistries.CONFIGURED_FEATURE, ModBlocks.COPPER_ORE.getRegistryName(), Feature.ORE .withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.field_241882_a /* base_stone_overworld */, ModBlocks.COPPER_ORE.getDefaultState(), ModConfig.worldgen_copper_size)) .withPlacement(Placement.field_242907_l/* RANGE */.configure(new TopSolidRangeConfig(ModConfig.worldgen_copper_min_height, 0, ModConfig.worldgen_copper_max_height))) .func_242728_a() /* spreadHorizontally */ .func_242731_b(ModConfig.worldgen_copper_size) /* repeat */ ); Registry.register( WorldGenRegistries.CONFIGURED_FEATURE /* Feature Registering */, ModBlocks.RUBBER_SAPLING.getRegistryName() /* Resource Location */, Feature.TREE /* no_surface_ore */.withConfiguration(RUBBER_TREE_CONFIG) .withPlacement(Placement.field_242902_f/* RANGE */.configure(new AtSurfaceWithExtraConfig(12, 12, 72))) ); } public static void setupGen() { for (Map.Entry<RegistryKey<Biome>, Biome> biome : WorldGenRegistries.BIOME.getEntries() /* Collection of Biome Entries */) { if (!biome.getValue().getCategory().equals(Biome.Category.NETHER) && !biome.getValue().getCategory().equals(Biome.Category.THEEND)) { addFeatureToBiome( biome.getValue(), GenerationStage.Decoration.UNDERGROUND_ORES, WorldGenRegistries.CONFIGURED_FEATURE.getOrDefault(ModBlocks.COPPER_ORE.getRegistryName()) ); addFeatureToBiome( biome.getValue(), GenerationStage.Decoration.VEGETAL_DECORATION, WorldGenRegistries.CONFIGURED_FEATURE.getOrDefault(ModBlocks.RUBBER_SAPLING.getRegistryName()) ); } } } public static void addFeatureToBiome(Biome biome, GenerationStage.Decoration decoration, ConfiguredFeature<?, ?> configuredFeature) { List<List<Supplier<ConfiguredFeature<?, ?>>>> biomeFeatures = new ArrayList<>( biome.getGenerationSettings().getFeatures()/* List of Configured Features */ ); while (biomeFeatures.size() <= decoration.ordinal()) { biomeFeatures.add(Lists.newArrayList()); } List<Supplier<ConfiguredFeature<?, ?>>> features = new ArrayList<>(biomeFeatures.get(decoration.ordinal())); features.add(() -> configuredFeature); biomeFeatures.set(decoration.ordinal(), features); ObfuscationReflectionHelper.setPrivateValue(BiomeGenerationSettings.class, biome.getGenerationSettings(), biomeFeatures, "features"); } Rubber tree: public class RubberTree extends Tree { public static final BaseTreeFeatureConfig RUBBER_TREE_CONFIG = ( new BaseTreeFeatureConfig.Builder( new RubberTreeBlockStateProvider(ModBlocks.RUBBER_LOG.getDefaultState()), new SimpleBlockStateProvider(ModBlocks.RUBBER_LEAVES.getDefaultState()), new RubberFoliagePlacer(2, 0), new StraightTrunkPlacer(4, 2, 0), new TwoLayerFeature(1, 0, 1)) ).build(); @Nullable @Override protected ConfiguredFeature<BaseTreeFeatureConfig, ?> getTreeFeature(Random randomIn, boolean p_225546_2_) { return Feature.TREE.withConfiguration(RUBBER_TREE_CONFIG); } } Is there a simple solution to fix this? I can add that tree is working correctly in game, Im only having troubles to add it to generation.
  12. Yes i mean directory. I know i almost always use capabilities when I can, but in this case I need it. I knew how to do it in versions before 1.16 but they change it.
  13. Hello I want to save file in current world catalog and Im having problems how to get current world catalog. I tryed to use String worldName = event.getServer().func_240793_aU_().getWorldName(); But this only gives me world name not actual catalog and multiple worlds can have same name but different catalog. Any ideas how to get proper catalog?
  14. You just proved im an idiot Thank you!
×
×
  • Create New...

Important Information

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