Everything posted by Ragnar
-
Custom Hit box of Block 1.12
I'm going to do it, and I did not sleep, I'm still too sleepy to sue hahaha, and I'm sorry I judged you before, I sincerely apologize
-
Custom Hit box of Block 1.12
I'm sorry, I'm Brazilian, my code is all in English but as my google is activated the translator, when I put the code he translated and did not see and sent translated, sorry
-
Custom Hit box of Block 1.12
https://github.com/Ragnarrrr/Hit-box/tree/master/.gitignore
-
Custom Hit box of Block 1.12
but my code still does not work, what's wrong?
-
Custom Hit box of Block 1.12
the event is working, you said it yourself have to create account ... this it came from the code that you sent me, I have removed it, but it continues in the same way as the previous print
-
Custom Hit box of Block 1.12
import java.util.ArrayList; import java.util.List; import java.util.Random; import javax.annotation.Nullable; import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult.Type; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.client.event.DrawBlockHighlightEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class Pedestal extends BlockBase{ public static final AxisAlignedBB under = new AxisAlignedBB(0.0625D, 0, 0.0625D, 0.9375D, 0.125D, 0.9375D); public static final AxisAlignedBB middle = new AxisAlignedBB(0.1875D, 0.125D, 0.1875D, 0.8125D, 0.75D, 0.8125D); public static final AxisAlignedBB top = new AxisAlignedBB(0.1875D, 0.125D, 0.1875D, 0.8125D, 0.75D, 0.8125D); public static final ArrayList<AxisAlignedBB> all = new ArrayList<AxisAlignedBB>(); public Pedestal(String name, Material material, CreativeTabs creativetab) { super(name, material, creativetab); setSoundType(SoundType.STONE); setHardness(3.0F); setHarvestLevel("pickaxe", 1); setResistance(35.0F); } public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.CUTOUT; } public boolean isFullCube(IBlockState state) { return false; } public boolean isOpaqueCube(IBlockState state) { return false; } @SideOnly(Side.CLIENT) public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) { double x = (double)pos.getX(); double y = (double)pos.getY() + 1.14D; double z = (double)pos.getZ(); worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x + 0.5D, y + 0.2D, z + 0.5D , 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(EnumParticleTypes.FLAME, x + 0.5D, y, z + 0.5D, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x + 0.25D, y + 0.2D, z + 0.25D , 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(EnumParticleTypes.FLAME, x + 0.25D, y, z + 0.25D, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x + 0.25D, y + 0.2D, z + 0.75D , 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(EnumParticleTypes.FLAME, x + 0.25D, y, z + 0.75D, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x + 0.75D, y + 0.2D, z + 0.25D , 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(EnumParticleTypes.FLAME, x + 0.75D, y, z + 0.25D, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x + 0.75D, y + 0.2D, z + 0.75D , 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(EnumParticleTypes.FLAME, x + 0.75D, y, z + 0.75D, 0.0D, 0.0D, 0.0D); } @SubscribeEvent public static void drawBlockHighlightEvent(final DrawBlockHighlightEvent event) { try { final EntityPlayer player = event.getPlayer(); if (player == null) { return; } final RayTraceResult rayTraceResult = event.getTarget(); if ((rayTraceResult == null) || (rayTraceResult.typeOfHit != RayTraceResult.Type.BLOCK)) { return; } final World world = player.world; if (world == null) { return; } final float partialTicks = event.getPartialTicks(); final BlockPos pos = rayTraceResult.getBlockPos(); final IBlockState blockState = world.getBlockState(pos); if ((blockState.getMaterial() == Material.AIR) || !world.getWorldBorder().contains(pos)) { return; } final Block block = blockState.getBlock(); if (!(block instanceof Pedestal)) { return; } event.setCanceled(true); all.add(under); all.add(middle); all.add(top); all.add(candle1); all.add(candle2); all.add(candle3); all.add(candle4); all.add(candle5); blockState.addCollisionBoxToList(world, pos, new AxisAlignedBB(pos), all, player, false); final double renderX = player.lastTickPosX + ((player.posX - player.lastTickPosX) * partialTicks); final double renderY = player.lastTickPosY + ((player.posY - player.lastTickPosY) * partialTicks); final double renderZ = player.lastTickPosZ + ((player.posZ - player.lastTickPosZ) * partialTicks); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.glLineWidth(2.0F); GlStateManager.disableTexture2D(); GlStateManager.depthMask(false); for (AxisAlignedBB box : all) { if (box==Block.NULL_AABB) { continue; } final AxisAlignedBB renderBox = box.grow(0.0020000000949949026D).offset(-renderX, -renderY, -renderZ); event.getContext().drawSelectionBoundingBox(renderBox, 0.0F, 0.0F, 0.0F, 0.4F); } GlStateManager.depthMask(true); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); } catch (final Exception e) { event.setCanceled(false); } } public static void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn) { addCollisionBoxToList(pos, entityBox, collidingBoxes, under); addCollisionBoxToList(pos, entityBox, collidingBoxes, middle); addCollisionBoxToList(pos, entityBox, collidingBoxes, top); } }
-
Custom Hit box of Block 1.12
-
Custom Hit box of Block 1.12
It did not work, I gave up, I can not do it.
-
Custom Hit box of Block 1.12
I really did not understand how DrawBlockHighlightEvent works, so I did not do this But anyway, thank you
-
Custom Hit box of Block 1.12
Could you do the drawing for me this? public static final AxisAlignedBB under = new AxisAlignedBB(0.0625D, 0, 0.0625D, 0.9375D, 0.125D, 0.9375D); public static final AxisAlignedBB middle = new AxisAlignedBB(0.1875D, 0.125D, 0.1875D, 0.8125D, 0.75D, 0.8125D); public static final AxisAlignedBB top = new AxisAlignedBB(0.1875D, 0.125D, 0.1875D, 0.8125D, 0.75D, 0.8125D); for using in DrawBlockHighlightEvent
-
Custom Hit box of Block 1.12
"union" will not make the right format? is it just going to make a square according to all unions?
-
Custom Hit box of Block 1.12
and this not work public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn) { super.addCollisionBoxToList(pos, entityBox, collidingBoxes, under); super.addCollisionBoxToList(pos, entityBox, collidingBoxes, middle); super.addCollisionBoxToList(pos, entityBox, collidingBoxes, top); } but this @Override public AxisAlignedBB getBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { return under; } with this public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn) { super.addCollisionBoxToList(pos, entityBox, collidingBoxes, under); super.addCollisionBoxToList(pos, entityBox, collidingBoxes, middle); super.addCollisionBoxToList(pos, entityBox, collidingBoxes, top); } work, my hitbox stay in this format (under), but no middle and top, I think because getBoundingBox just returns under
-
Custom Hit box of Block 1.12
can you make me some example of the event to do what I want?
-
Custom Hit box of Block 1.12
the block (model) is also defined by AxisAlignedBB in event?
-
Custom Hit box of Block 1.12
the drawing block I will use in DrawBlockHighlightEvent is that? public static final AxisAlignedBB under = new AxisAlignedBB(0.0625D, 0, 0.0625D, 0.9375D, 0.125D, 0.9375D);
-
Custom Hit box of Block 1.12
that's not what @Animefan8888 said, he is a forge modder you are only a member so I think he knows more and I created another topic because it was about format, this that about hitbox But anyway, thank you (topic is not resolved)
-
Custom Hit box of Block 1.12
this is code but not working, what am I doing wrong? it is for that block format public static final AxisAlignedBB under = new AxisAlignedBB(0.0625D, 0, 0.0625D, 0.9375D, 0.125D, 0.9375D); public static final AxisAlignedBB middle = new AxisAlignedBB(0.1875D, 0.125D, 0.1875D, 0.8125D, 0.75D, 0.8125D); public static final AxisAlignedBB top = new AxisAlignedBB(0.1875D, 0.125D, 0.1875D, 0.8125D, 0.75D, 0.8125D); @Override public AxisAlignedBB getBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { return under; } public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn) { super.addCollisionBoxToList(pos, entityBox, collidingBoxes, under); super.addCollisionBoxToList(pos, entityBox, collidingBoxes, middle); super.addCollisionBoxToList(pos, entityBox, collidingBoxes, top); }
-
Format Block Forge 1.12
@Animefan8888 help me kkk
-
Format Block Forge 1.12
I already have the form, I just need to know how to use it in the method '-'
-
Format Block Forge 1.12
So how can I do this?
-
Format Block Forge 1.12
this is the format of my block and I want the hit box of its format, it is not possible to use only one AxisAlignedBB to do exactly that format ...
-
Format Block Forge 1.12
How do I do this?
-
Format Block Forge 1.12
the hitbox is just like the under, the middle and top not would I have to make a list to return in getBoundingBox? but he does not accept list
-
Format Block Forge 1.12
did not work this is full code public static final AxisAlignedBB under = new AxisAlignedBB(0.0625D, 0, 0.0625D, 0.9375D, 0.125D, 0.9375D); public static final AxisAlignedBB middle = new AxisAlignedBB(0.1875D, 0.125D, 0.1875D, 0.8125D, 0.75D, 0.8125D); public static final AxisAlignedBB top = new AxisAlignedBB(0.1875D, 0.125D, 0.1875D, 0.8125D, 0.75D, 0.8125D); public Pedestal(String name, Material material, CreativeTabs creativetab) { super(name, material, creativetab); setSoundType(SoundType.STONE); setHardness(3.0F); setHarvestLevel("pickaxe", 1); setResistance(35.0F); } public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.CUTOUT; } public boolean isFullCube(IBlockState state) { return false; } public boolean isOpaqueCube(IBlockState state) { return false; } @Override public AxisAlignedBB getBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { return under; } public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn) { super.addCollisionBoxToList(pos, entityBox, collidingBoxes, under); super.addCollisionBoxToList(pos, entityBox, collidingBoxes, middle); super.addCollisionBoxToList(pos, entityBox, collidingBoxes, top); }
-
Format Block Forge 1.12
@Override public AxisAlignedBB getBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { return under; } public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn) { super.addCollisionBoxToList(pos, entityBox, collidingBoxes, under); super.addCollisionBoxToList(pos, entityBox, collidingBoxes, middle); super.addCollisionBoxToList(pos, entityBox, collidingBoxes, top); } like this?
IPS spam blocked by CleanTalk.