-
[SOLVED] [1.19.3] Partial Ticks in BlockEntityWithoutLevelRenderer
That did the trick, thank you!
-
[SOLVED] [1.19.3] Partial Ticks in BlockEntityWithoutLevelRenderer
Is it possible to get partial ticks for rendering in the BlockEntityWithoutLevelRenderer::renderByItem method? I'm trying to render a block similar to the jeb_ sheep, but to achieve this I need access to the rendering ticks, which are sadly not given in the renderByItem method. Or should I just use an animated texture for this? (I would prefer not to for flexibility reasons)
-
[SOLVED] BlockEntity rendering too dark
I finally got it working! For anyone wanting to achieve this in the future: public void render(CustomBlockEntity blockEntity, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, int packedOverlay) { VertexConsumer vertexConsumer = VertexMultiConsumer.create(bufferSource.getBuffer(RenderType.glintDirect()), bufferSource.getBuffer(RenderType.solid())); BlockState blockState = CustomBlocks.CUSTOM_BLOCK.get().defaultBlockState(); Level level = blockEntity.getLevel(); BakedModel model = this.blockRenderer.getBlockModel(blockState); this.modelRenderer.tesselateBlock(level, model, blockState, blockEntity.getBlockPos(), poseStack, vertexConsumer, false, level.getRandom(), 0, packedOverlay); } @warjort, thank you so much again!
-
[SOLVED] BlockEntity rendering too dark
Well, I'm actually trying to draw the enchanting glint over a block and that turned out way more difficult than it should be But I think your answer pushed me in the right direction. Thanks!
-
[SOLVED] BlockEntity rendering too dark
I have a custom block entity and whenever it renders something it appears completely dark. In it's render method, the value of packedLight is always 0. @Override public void render(CustomBlockEntity blockEntity, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, int packedOverlay) { // packedLight is always 0? } If I disable ambient occlusion in the corresponding block's properties, the block entity doesn't render dark anymore but the lighting still isn't correct. I'm basically only trying to render a solid block. Can anyone help me with this?
-
[1.19.2] Render overlay effect on item
I simply mean this effect: This effect is achieved by using TntMinecartRenderer.renderWhiteSolidBlock(this.blockRenderer, this.tntBlock.defaultBlockState(), poseStack, bufferSource, packedLight, i / 5 % 2 == 0); which executes following code int i; if (p_234667_) { i = OverlayTexture.pack(OverlayTexture.u(1.0F), 10); } else { i = OverlayTexture.NO_OVERLAY; } p_234662_.renderSingleBlock(p_234663_, p_234664_, p_234665_, p_234666_, i); but using OverlayTexture.pack(OverlayTexture.u(1.0F), 10); in ItemRenderer::renderStatic like so this.itemRenderer.renderStatic(stack, ItemTransforms.TransformType.FIXED, packedLight, OverlayTexture.pack(OverlayTexture.u(1.0F), 10), poseStack, bufferSource, pos); does not add a white overlay to the rendererd item. Would you know, how to achieve this?
-
[1.19.2] Render overlay effect on item
I have an entity that uses ItemRenderer::renderStatic to render an item. Now, how would I render an overlay effect, like the mob damage or TNT flashing effects, onto said item? I've tried a lot of different things from the OverlayTexture class but nothing worked.
-
Render enchanting glint on placed blocks?
I'm currently trying to render the enchanting glint on a custom block model. Using the different enchanting glint RenderTypes on the model obviously doesn't work because they are not of type DefaultVertexFormat.BLOCK. Does anyone have an idea on how I would need to tackle this? Thanks in advance!
-
[1.19.2] How to make a block enchantable at an enchanting table?
Thank you so much!
-
[1.19.2] How to make a block enchantable at an enchanting table?
I added a custom BlockItem for my block and now I want it to be enchantable with sword enchantments. I tried overwriting canApplyAtEnchantingTable but this doesn't work. Here is the whole class: public class SwordBlockItem extends BlockItem { public SwordBlockItem(Block block, Properties properties) { super(block, properties); } @Override public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment) { return true; } @Override public boolean isEnchantable(ItemStack stack) { return true; } @Override public boolean isBookEnchantable(ItemStack stack, ItemStack book) { return true; } } For testing purposes I made all three of those methods return true. Applying books in an anvil works completely fine. It's just that no enchantment shows up in the enchantment table.
-
[1.18.1] Shrinking player causes camera to clip through blocks
Hi all, I have a problem with shrinking the player. I'm using EntityEvent.Size to shrink the player's bounding box and lower the eye height and therefore the camera position. This is really simple and all working fine (and basically all of the mod's code), but whenever I get close to blocks, the camera starts clipping through them. I have looked at other shrinking mods but all of them use mixin which I preferably don't want to use. I hope someone can help me, thanks!
-
[1.15.2][Solved] Weird issue with adding blocks to creative tab
In the constructor of the block and by using DispenserBlock.registerDispenseBehavior() DispenserBlock.registerDispenseBehavior(this, new DefaultDispenseItemBehavior() { protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) { World world = source.getWorld(); BlockPos blockpos = source.getBlockPos().offset(source.getBlockState().get(DispenserBlock.FACING)); BlockTNTGhostsExplosives block = (BlockTNTGhostsExplosives) ((BlockItem) stack.getItem()).getBlock(); if (block.getProperties().isIgnitableByDispensers()) { EntityTNTGhostsExplosives tntentity = new EntityTNTGhostsExplosives(world, (double) blockpos.getX() + 0.5D, (double) blockpos.getY(), (double) blockpos.getZ() + 0.5D, (LivingEntity) null, block.getProperties()); world.addEntity(tntentity); world.playSound(null, tntentity.getPosX(), tntentity.getPosY(), tntentity.getPosZ(), SoundEvents.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1.0F, 1.0F); stack.shrink(1); } else { Direction direction = source.getBlockState().get(DispenserBlock.FACING); IPosition iposition = DispenserBlock.getDispensePosition(source); ItemStack itemstack = stack.split(1); doDispense(source.getWorld(), itemstack, 6, direction, iposition); } return stack; } });
-
[1.15.2][Solved] Weird issue with adding blocks to creative tab
I've examined what exactly caused the problem and it had nothing to do with the registry event but instead with registering the dispense behavior. I don't understand why this is happening but as soon as I register any sort of dispense behavior, even the default one, it won't show up in the creative inventory anymore. Really weird
-
[1.15.2][Solved] Weird issue with adding blocks to creative tab
Yes, I realized that as well, thank you anyways
-
[1.15.2][Solved] Weird issue with adding blocks to creative tab
So my blocks are being registered again just by subscribing to the registry event? Interesting, I though that event was just called after all blocks have been registered. But anyways, thanks for your help ?
IPS spam blocked by CleanTalk.