-
Posts
82 -
Joined
-
Last visited
Everything posted by QuantumSoul
-
[1.16] How to dynamically change the texture of blocks individually
QuantumSoul replied to Zemelua's topic in Modder Support
You should research about "connected textures" -
1. Why do you call MyFeature.init() in the FMLModLoadingEvent ? MyFeature#init is an empty method, it's useless ? 2. Your log says your registry object (probably OIL_FEATURE) is null. It is null because you never registered your DeferredRegistry. You first should move these: public static final DeferredRegister<Feature<?>> FEATURES = DeferredRegister.create(ForgeRegistries.FEATURES,ExampleMod.MODID); public static final RegistryObject<OilFeature> OIL_FEATURE = FEATURES.register("oil_feature", () -> new OilFeature(OilFeatureConfig.CODEC)); Somewhere else outside of MyFeature class. I recommend creating a FeatureInit or GenerationInit class where you'd put all the feature registrations. After that you can register the DeferredRegistry in your Main file's constructor: final IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus(); FeatureInit.FEATURES.register(eventBus); 3, You should basically delete that whole MyFeature class since it's useless. And change MyFeature with FeatureInit in your WorldGen class
-
[Solved][1.16.5] Biomes make game crash
QuantumSoul replied to QuantumSoul's topic in Modder Support
Solved, the problem was that I gave a null BlockState to my SurfaceBuilderConfig. I also had to register features, placements(decorators) and ruletests -
Hello, When I try to load a world or open the world gen settings menu, the game crashes. I realized this error happens only when I register my Biomes but I don't understand why. My Biomes are registered like this: public static final DeferredRegister<Biome> BIOMES = DeferredRegister.create(ForgeRegistries.BIOMES, BinaryMod.MOD_ID); public static final RegistryObject<Biome> MY_BIOME = BIOMES.register("my_biome", Biomes::makeMyBiome); Biomes#makeMyBiome method: private static final Lazy<ConfiguredSurfaceBuilder<SurfaceBuilderConfig>> BINARY_SURFACE_BUILDER = () -> GenerationInit.BINARY_SURFACE_BUILDER.get().func_242929_a(new SurfaceBuilderConfig(BlockInit.BINARY_BLOCK.get().getDefaultState(), BlockInit.ON_BINARY_BLOCK.get().getDefaultState(), null)); public static Biome makeBinaryBiome() { MobSpawnInfo.Builder spawns = new MobSpawnInfo.Builder(); BinDimBiomeFeatures.addBinDimSpawns(spawns); BiomeGenerationSettings.Builder gen = new BiomeGenerationSettings.Builder(); gen.withSurfaceBuilder(BINARY_SURFACE_BUILDER::get); BinDimBiomeFeatures.addOres(gen); BinDimBiomeFeatures.addBugVirus(gen); BinDimBiomeFeatures.addStructures(gen); int color = 0x00ff00; return new Biome.Builder() .precipitation(Biome.RainType.NONE).category(Biome.Category.NONE).depth(0.1F).downfall(0F).scale(0.02F).temperature(1.5F) .setEffects(new BiomeAmbience.Builder().setWaterColor(color).setWaterFogColor(color).setFogColor(color).withSkyColor(color).build()) .withMobSpawnSettings(spawns.copy()) .withGenerationSettings(gen.build()).build(); } BinDimBiomeFeatures basically adds features to the BiomeGenerationSettings.Builder Here's my whole project: https://github.com/BinaryQuantumSoul/BinaryMod/tree/1.16.5/src/main/java/com/quantumsoul/binarymod/world/biomes (1.16.5 Branch) Has anyone an idea about why it crashes ? Thanks in advance.
-
You can use player.getServer().getWorld(DESTINATION); Where DESTINATION is the dimension RegistryKey<World> like World#THE_NETHER or your own
-
[SOLVED][1.16.5] Biome registering with SurfaceBuilder
QuantumSoul replied to QuantumSoul's topic in Modder Support
I fixed it using the supplier version of BiomeGenerationSettings.Builder#withSurfaceBuilder() -
[1.16] How to dynamically change the texture of blocks individually
QuantumSoul replied to Zemelua's topic in Modder Support
When you mean dynamically change: Is it a random change ? Do you configure texture in the block ? Does it have a small possibilities or can it be any block texture ? Depending of the case, you'd want to use blockstate or tileentities or neither. Concerning the render, you need custom IModelLoader, IModelGeometry and/or IDynamicBakedModel -
You should set the mappings in your build.gradle: mappings channel: 'snapshot', version: '20201028-1.16.3'
-
Hi, I have a custom biome which uses a custom surface builder: public static final RegistryObject<SurfaceBuilder<SurfaceBuilderConfig>> BINARY_SURFACE_BUILDER = SURFACE_BUILDERS.register("binary_surface_builder", () -> new BinarySurfaceBuilder(SurfaceBuilderConfig.field_237203_a_)); public static final RegistryObject<Biome> BINARY_BIOME = BIOMES.register("binary_biome", Biomes::makeBinaryBiome); However, the biome is registered frist so I have an error since it uses the unregistered SurfaceBuilder: public static Biome makeBinaryBiome() { MobSpawnInfo.Builder spawns = new MobSpawnInfo.Builder(); BinDimBiomeFeatures.addBinDimSpawns(spawns); BiomeGenerationSettings.Builder gen = new BiomeGenerationSettings.Builder(); gen.withSurfaceBuilder(GenerationInit.BINARY_SURFACE_BUILDER.get().func_242929_a(new SurfaceBuilderConfig(BlockInit.BINARY_BLOCK.get().getDefaultState(), BlockInit.ON_BINARY_BLOCK.get().getDefaultState(), null))); //^^ error ^^ BinDimBiomeFeatures.addOres(gen); BinDimBiomeFeatures.addBugVirus(gen); BinDimBiomeFeatures.addStructures(gen); int color = 0x00ff00; return new Biome.Builder() .precipitation(Biome.RainType.NONE).category(Biome.Category.NONE).depth(0.1F).downfall(0F).scale(0.02F).temperature(1.5F) .setEffects(new BiomeAmbience.Builder().setWaterColor(color).setWaterFogColor(color).setFogColor(color).withSkyColor(color).build()) .withMobSpawnSettings(spawns.copy()) .withGenerationSettings(gen.build()).build(); } I tried setting the BiomeGenerationSettings in the BiomeLoadingEvent but I have an error with makeBinaryBiome since it cannot build without BiomeGenerationSettings What is the right way to fix this ? Thanks in advance.
-
[1.15.1] [Solved] Baked models for different block states
QuantumSoul replied to PianoManu's topic in Modder Support
Can't you do the rotations in getMimicQuads using the provided BlockState ? -
Awesome !
-
I pushed to github so you can see the problem: https://github.com/BinaryQuantumSoul/BinaryMod Take bitcoins in your inventory Open a Computer, put a Dark Net and click load Buy any item Now drop the just bought item, and take it back, buy another one and mess around, You'll see what I mean
-
Well there's a list of items, I click on it and it used bitcoins in the inventory to buy it. It add the item to the inventory as well as the remaining money
-
It buys an item using bitcoins you have in your inventory
-
But I'm in client, should I send a packet in my packet ?
-
I right click on my block, there's a button on the gui. Well it adds the right items to my inventory, but when I drop them some don't come back in the inventory, others take half a second, and some come twice. I think the bug is because I call buyRecipe() twice. I was told if I change the inventory in the container both client and server are updated but idk why it did only the job client side. That's why I also send a packet
-
Well that's the point of this thread
-
all
- 1 reply
-
- 1
-
Yes use Block#onEntityCollision
-
What is it for ? Can't you use Block#onEntityCollision or Block#onEntityWalk?
-
Hey, I don't know what to do: I have a custom GUI which changes the content of the player's inventory. I first tried sending a packet, but change was done in server and not in client. I was then told using the container would not require packets, so that's what I've done but it was not done in server. I finally combined both and I still have some weird item-disappearing bugs. When I click in the GUI BuyRecipe function BtcBuyPacket The container Thanks in advance
-
My bad
-
Ok thanks Makes sense now https://mcforge.readthedocs.io/en/1.14.x/networking/simpleimpl/
-
1. Why ? I was not sure about it 2. I thought it was logical since it's sent by server 3. Problem solved using context.get().enqueueWork(() -> { TileEntity te = ((ClientPlayNetHandler)context.get().getNetworkManager().getNetHandler()).getWorld().getTileEntity(packet.pos); if (te instanceof BitcoinTileEntity) ((BitcoinTileEntity) te).resetValue(); }); context.get().setPacketHandled(true); 4. Forge docs talk about world.isBlockLoaded(BlockPos) should I add it here ? It's deprecated so idk
-
My Block: public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult rayTraceResult) { if (!world.isRemote) { final TileEntity tileEntity = world.getTileEntity(pos); if (tileEntity instanceof BitcoinMinerBlock) if (!((BitcoinMinerBlock) tileEntity).execute(player)) return ActionResultType.FAIL; } return ActionResultType.SUCCESS; } BitcoinTileEntity#execute: public boolean execute(PlayerEntity player) { if (value >= 1.0D) { for (ItemStack stack : getBitcoinStacks(value)) player.addItemStackToInventory(stack); value = 0.0D; NetworkInit.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) player), new BtcResetValuePacket(pos)); return true; } return false; } I checked and player is a ServerPlayerEntity And here's my handle function in BtcResetValuePacket: public static void handle(BtcResetValuePacket packet, Supplier<NetworkEvent.Context> context) { context.get().enqueueWork(() -> { TileEntity te = context.get().getSender().world.getTileEntity(packet.pos); if (te instanceof BitcoinTileEntity) ((BitcoinTileEntity) te).resetValue(); }); context.get().setPacketHandled(true); } I get a NPE at Context#getSender. And BitcoinTileEntity#resetValue @OnlyIn(Dist.CLIENT) public void resetValue() { value = 0; }