Jump to content

Large rectangle appears when entity shot?


Fruitsalid

Recommended Posts

you would have to 1 change the entity size and 2 make a renderer (like i said earlier). EntityThrowable will always be rendered in a way that will make them look like the image is facing the player, if you want to have more realistic bullet you're gonna have to make a class extends Render and register it in your client proxy

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

<troll> pic or it didnt happen </troll>

 

no no just kidding, but srly can we have some pic / video so we can understand whats going on

 

because since you are usign a renderer, the problem can now be anything, maybe its you graphic card, maybe your opengl 1 setting are in an odd state causing this effect etc etc

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

It seems to appear on random living entities

It : the visual problem ?  as like, randomly cows will start flickering/changing color or wtv is it that your visual bug do ?

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

public class RenderLaser extends Render
{
int red = 200;
int green = 40;
int blue = 40;
int alpha = 250;

@Override
public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1)
{
	this.func_110777_b(entity);
	GL11.glPushMatrix();
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_LIGHTING);
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
	GL11.glEnable(GL12.GL_RESCALE_NORMAL);
	GL11.glTranslatef((float)d0, (float)d1, (float)d2);
	GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * f1 - 90.0F, 0.0F, 1.0F, 0.0F);
	GL11.glRotatef(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * f1, 0.0F, 0.0F, 1.0F);
	Tessellator tessellator = Tessellator.instance;
	tessellator.setColorRGBA(red, green, blue, alpha);
	byte b0 = 0;
	float f2 = 0.0F;
	float f3 = 0.5F;
	float f4 = (float)(0 + b0 * 10) / 32.0F;
	float f5 = (float)(5 + b0 * 10) / 32.0F;
	float f6 = 0.0F;
	float f7 = 0.15625F;
	float f8 = (float)(5 + b0 * 10) / 32.0F;
	float f9 = (float)(10 + b0 * 10) / 32.0F;
	float f10 = 0.05625F;
	GL11.glEnable(GL12.GL_RESCALE_NORMAL);

	GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
	GL11.glScalef(f10, f10, f10);
	GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
	GL11.glNormal3f(f10, 0.0F, 0.0F);

	for (int i = 0; i < 4; ++i)
	{
		GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
		GL11.glNormal3f(0.0F, 0.0F, f10);
		tessellator.startDrawingQuads();
		tessellator.setColorRGBA(red, green, blue, alpha);
		tessellator.addVertex(-8.0D, -2.0D, 0.0D);
		tessellator.addVertex(8.0D, -2.0D, 0.0D);
		tessellator.addVertex(8.0D, 2.0D, 0.0D);
		tessellator.addVertex(-8.0D, 2.0D, 0.0D);
		tessellator.draw();
	}

	GL11.glDisable(GL11.GL_BLEND);
	GL11.glEnable(GL11.GL_LIGHTING);
	GL11.glEnable(GL11.GL_TEXTURE_2D);

	GL11.glDisable(GL12.GL_RESCALE_NORMAL);
	GL11.glPopMatrix();
}

@Override
protected ResourceLocation func_110775_a(Entity entity)
{
	return null;
}
}

Link to comment
Share on other sites

ok, well 2 things, either this code is copy pasted, either you name your variable in very weird ways (f1, f2, f3, f4, f5, f6) in either case im not suuure exactly where the problem is because im not sure hat youre trying to do but honestly by looking at the code it seems that the picture is doign EXACTLY what you asked it to do...

 

tessellator.addVertex(-8.0D, -2.0D, 0.0D);
		tessellator.addVertex(8.0D, -2.0D, 0.0D);
		tessellator.addVertex(8.0D, 2.0D, 0.0D);
		tessellator.addVertex(-8.0D, 2.0D, 0.0D);

^ this is a pretty big rectangle actually

 

GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_LIGHTING);
	GL11.glEnable(GL11.GL_BLEND);

 

^ blending is enabled so you expect your bolt to be transparent, texture2D are DISABLED, so no image on your bullets and lighting disabled... result may vary since its LWJGL and opengl1

 

i would try to play with glEnable/glDisable those 3 thing above.

other then that, if you want to play if safe, remove a MAX ammount of code and add little by little

 

and hum ..... if you dont know what the code is doing ... try understanding first ... usually copy paste dont get prople very far ..... sorry if its mean :\

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • They were already updated, and just to double check I even did a cleanup and fresh update from that same page. I'm quite sure drivers are not the problem here. 
    • i tried downloading the drivers but it says no AMD graphics hardware has been detected    
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • As the title says i keep on crashing on forge 1.20.1 even without any mods downloaded, i have the latest drivers (nvidia) and vanilla minecraft works perfectly fine for me logs: https://pastebin.com/5UR01yG9
    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
  • Topics

×
×
  • Create New...

Important Information

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