Commit 04e6b561 authored by Bailey's avatar Bailey 🚟

sitting on chairs works properly now

parent ff0a8b0e
package com.legacy.rediscovered.client; package com.legacy.rediscovered.client;
import static com.legacy.rediscovered.entity.RediscoveredEntityTypes.FISH; import static com.legacy.rediscovered.entity.RediscoveredEntityTypes.*;
import static com.legacy.rediscovered.entity.RediscoveredEntityTypes.MELEE_PIGMAN;
import static com.legacy.rediscovered.entity.RediscoveredEntityTypes.PIGMAN;
import static com.legacy.rediscovered.entity.RediscoveredEntityTypes.PURPLE_ARROW;
import static com.legacy.rediscovered.entity.RediscoveredEntityTypes.RANGED_PIGMAN;
import static com.legacy.rediscovered.entity.RediscoveredEntityTypes.RED_DRAGON;
import static com.legacy.rediscovered.entity.RediscoveredEntityTypes.SCARECROW;
import com.legacy.rediscovered.client.render.entity.FishRenderer; import com.legacy.rediscovered.client.render.entity.FishRenderer;
import com.legacy.rediscovered.client.render.entity.MeleePigmanRenderer; import com.legacy.rediscovered.client.render.entity.MeleePigmanRenderer;
import com.legacy.rediscovered.client.render.entity.MountableBlockRenderer;
import com.legacy.rediscovered.client.render.entity.PigmanRenderer; import com.legacy.rediscovered.client.render.entity.PigmanRenderer;
import com.legacy.rediscovered.client.render.entity.PurpleArrowRenderer; import com.legacy.rediscovered.client.render.entity.PurpleArrowRenderer;
import com.legacy.rediscovered.client.render.entity.RangedPigmanRenderer; import com.legacy.rediscovered.client.render.entity.RangedPigmanRenderer;
...@@ -41,8 +36,8 @@ public class RediscoveredEntityRendering ...@@ -41,8 +36,8 @@ public class RediscoveredEntityRendering
register(RED_DRAGON, RedDragonRenderer::new); register(RED_DRAGON, RedDragonRenderer::new);
register(SCARECROW, ScarecrowRenderer::new); register(SCARECROW, ScarecrowRenderer::new);
register(PURPLE_ARROW, PurpleArrowRenderer::new); register(PURPLE_ARROW, PurpleArrowRenderer::new);
register(MOUNTABLE_BLOCK, MountableBlockRenderer::new);
} }
public static void initLayers() public static void initLayers()
......
package com.legacy.rediscovered.client.render.entity;
import com.legacy.rediscovered.entity.util.MountableBlockEntity;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.culling.ClippingHelperImpl;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.util.ResourceLocation;
public class MountableBlockRenderer extends EntityRenderer<MountableBlockEntity>
{
public MountableBlockRenderer(EntityRendererManager renderer)
{
super(renderer);
}
@Override
public void render(MountableBlockEntity entityIn, float entityYaw, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn)
{
}
@Override
public boolean shouldRender(MountableBlockEntity livingEntityIn, ClippingHelperImpl camera, double camX, double camY, double camZ)
{
return false;
}
@Override
public ResourceLocation getEntityTexture(MountableBlockEntity entity)
{
return new ResourceLocation("textures/entity/pig/pig.png");
}
}
\ No newline at end of file
...@@ -30,9 +30,7 @@ public class GearRenderer extends TileEntityRenderer<GearTileEntity> ...@@ -30,9 +30,7 @@ public class GearRenderer extends TileEntityRenderer<GearTileEntity>
public void render(GearTileEntity tileEntityIn, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) public void render(GearTileEntity tileEntityIn, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn)
{ {
matrixStackIn.push(); matrixStackIn.push();
// this.bindTexture(TEXTURE);
IVertexBuilder ivertexbuilder = ItemRenderer.getBuffer(bufferIn, RenderType.getEntityCutout(TEXTURE), false, false); IVertexBuilder ivertexbuilder = ItemRenderer.getBuffer(bufferIn, RenderType.getEntityCutout(TEXTURE), false, false);
matrixStackIn.translate(0.5, 0.5, 0.5); matrixStackIn.translate(0.5, 0.5, 0.5);
RenderSystem.disableLighting(); RenderSystem.disableLighting();
double scale = 1.1D; double scale = 1.1D;
...@@ -76,7 +74,4 @@ public class GearRenderer extends TileEntityRenderer<GearTileEntity> ...@@ -76,7 +74,4 @@ public class GearRenderer extends TileEntityRenderer<GearTileEntity>
matrixStackIn.pop(); matrixStackIn.pop();
} }
// public void render(GearTileEntity tile, double x, double y, double z, float
// partialTicks, int destroyStage)
} }
...@@ -62,6 +62,7 @@ public class RediscoveredEntityTypes ...@@ -62,6 +62,7 @@ public class RediscoveredEntityTypes
RediscoveredRegistry.register(event.getRegistry(), "scarecrow", SCARECROW); RediscoveredRegistry.register(event.getRegistry(), "scarecrow", SCARECROW);
/*RediscoveredRegistry.register(event.getRegistry(), "spawner", VANILLA_SPAWNER);*/ /*RediscoveredRegistry.register(event.getRegistry(), "spawner", VANILLA_SPAWNER);*/
RediscoveredRegistry.register(event.getRegistry(), "purple_arrow", PURPLE_ARROW); RediscoveredRegistry.register(event.getRegistry(), "purple_arrow", PURPLE_ARROW);
RediscoveredRegistry.register(event.getRegistry(), "mountable_block", MOUNTABLE_BLOCK);
registerSpawnConditions(); registerSpawnConditions();
} }
......
...@@ -86,13 +86,19 @@ public class MountableBlockEntity extends Entity ...@@ -86,13 +86,19 @@ public class MountableBlockEntity extends Entity
if ((this.getPosY() == Math.floor(this.getPosY())) && !Double.isInfinite(this.getPosY())) if ((this.getPosY() == Math.floor(this.getPosY())) && !Double.isInfinite(this.getPosY()))
{ {
float yLevel = 0; float yLevel = (float) this.getPosY();
yLevel -= 0.5F; yLevel -= 0.5F;
this.setPosition(this.getPosX(), yLevel, this.getPosZ()); ; this.setPosition(this.getPosX(), yLevel, this.getPosZ());
} }
} }
@Override
public double getMountedYOffset()
{
return super.getMountedYOffset();
}
@Override @Override
public boolean canBePushed() public boolean canBePushed()
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment