Commit d4d891e9 authored by Bailey's avatar Bailey 🚟

red dragon, and most structures

parent a237abe5
......@@ -19,7 +19,7 @@ archivesBaseName = 'rediscovered-1.15.2'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
minecraft {
mappings channel: 'snapshot', version: '20200225-1.15.1'
mappings channel: 'snapshot', version: '20200428-1.15.1'
runs {
client {
workingDirectory project.file('run')
......
......@@ -5,6 +5,9 @@ import com.legacy.rediscovered.client.RediscoveredEntityRendering;
import com.legacy.rediscovered.entity.RediscoveredEntityTypes;
import com.legacy.rediscovered.event.RediscoveredEvents;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.RenderTypeLookup;
import net.minecraft.entity.EntityClassification;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.biome.Biome;
......@@ -83,5 +86,19 @@ public class RediscoveredMod
public void clientInit(FMLClientSetupEvent event)
{
RediscoveredEntityRendering.init();
RenderTypeLookup.setRenderLayer(RediscoveredBlocks.cherry_leaves, RenderType.getCutoutMipped());
renderCutout(RediscoveredBlocks.paeonia);
renderCutout(RediscoveredBlocks.rose);
renderCutout(RediscoveredBlocks.empty_peony_bush);
renderCutout(RediscoveredBlocks.empty_rose_bush);
renderCutout(RediscoveredBlocks.gear);
renderCutout(RediscoveredBlocks.cherry_sapling);
renderCutout(RediscoveredBlocks.spikes);
}
private static void renderCutout(Block block)
{
RenderTypeLookup.setRenderLayer(block, RenderType.getCutout());
}
}
package com.legacy.rediscovered.client;
import static com.legacy.rediscovered.entity.RediscoveredEntityTypes.*;
import static com.legacy.rediscovered.entity.RediscoveredEntityTypes.FISH;
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.BeastBoyRenderer;
import com.legacy.rediscovered.client.render.entity.BlackSteveRenderer;
import com.legacy.rediscovered.client.render.entity.FishRenderer;
import com.legacy.rediscovered.client.render.entity.MeleePigmanRenderer;
import com.legacy.rediscovered.client.render.entity.PigmanRenderer;
import com.legacy.rediscovered.client.render.entity.PurpleArrowRenderer;
import com.legacy.rediscovered.client.render.entity.RanaRenderer;
import com.legacy.rediscovered.client.render.entity.RangedPigmanRenderer;
import com.legacy.rediscovered.client.render.entity.RedDragonRenderer;
import com.legacy.rediscovered.client.render.entity.ScarecrowRenderer;
import com.legacy.rediscovered.client.render.entity.SteveRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
......@@ -27,11 +30,11 @@ public class RediscoveredEntityRendering
register(MELEE_PIGMAN, MeleePigmanRenderer::new);
register(RANGED_PIGMAN, RangedPigmanRenderer::new);
register(STEVE, SteveRenderer::new);
/*register(STEVE, SteveRenderer::new);
register(BLACK_STEVE, BlackSteveRenderer::new);
register(BEAST_BOY, BeastBoyRenderer::new);
register(RANA, RanaRenderer::new);
//register(RED_DRAGON, RedDragonRenderer::new);
register(RANA, RanaRenderer::new);*/
register(RED_DRAGON, RedDragonRenderer::new);
register(SCARECROW, ScarecrowRenderer::new);
......
/*package com.legacy.rediscovered.client.render.entity;
package com.legacy.rediscovered.client.render.entity;
import java.util.Random;
import com.legacy.rediscovered.RediscoveredMod;
import com.legacy.rediscovered.client.render.model.RedDragonModel;
import com.legacy.rediscovered.entity.RedDragonEntity;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.Vector3f;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class RedDragonRenderer extends MobRenderer<RedDragonEntity, RedDragonModel>
public class RedDragonRenderer extends EntityRenderer<RedDragonEntity>
{
private static final ResourceLocation DRAGON_TEXTURES = RediscoveredMod.locate("textures/entity/reddragon/red.png");
private static final ResourceLocation DRAGON_EXPLODING_TEXTURES = new ResourceLocation("textures/entity/enderdragon/dragon_exploding.png");
private static final ResourceLocation EYES = RediscoveredMod.locate("textures/entity/reddragon/red_eyes.png");
private static final RenderType TEXTURE_CUTOUT = RenderType.getEntityCutoutNoCull(DRAGON_TEXTURES);
private static final RenderType TEXTURE_DECAL = RenderType.getEntityDecal(DRAGON_TEXTURES);
private static final RenderType EMISSIVE_EYES = RenderType.getEyes(EYES);
private final RedDragonModel model = new RedDragonModel();
private static final float field_229057_l_ = (float) (Math.sqrt(3.0D) / 2.0D);
public RedDragonRenderer(EntityRendererManager renderManagerIn)
{
super(renderManagerIn, new RedDragonModel(), 0.5F);
//this.addLayer(new RedDragonEyesLayer(this));
//this.addLayer(new RedDragonDeathLayer(this));
super(renderManagerIn);
// this.addLayer(new RedDragonEyesLayer(this));
// this.addLayer(new RedDragonDeathLayer(this));
}
protected void applyRotations(RedDragonEntity entityLiving, float ageInTicks, float rotationYaw, float partialTicks)
@Override
public void render(RedDragonEntity entityIn, float entityYaw, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn)
{
float f = (float) entityLiving.getMovementOffsets(7, partialTicks)[0];
float f1 = (float) (entityLiving.getMovementOffsets(5, partialTicks)[1] - entityLiving.getMovementOffsets(10, partialTicks)[1]);
GlStateManager.rotatef(-f, 0.0F, 1.0F, 0.0F);
GlStateManager.rotatef(f1 * 10.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translatef(0.0F, 0.0F, 1.0F);
if (entityLiving.deathTime > 0)
matrixStackIn.push();
float f = (float) entityIn.getMovementOffsets(7, partialTicks)[0];
float f1 = (float) (entityIn.getMovementOffsets(5, partialTicks)[1] - entityIn.getMovementOffsets(10, partialTicks)[1]);
matrixStackIn.rotate(Vector3f.YP.rotationDegrees(-f));
matrixStackIn.rotate(Vector3f.XP.rotationDegrees(f1 * 10.0F));
matrixStackIn.translate(0.0D, 0.0D, 1.0D);
matrixStackIn.scale(-1.0F, -1.0F, 1.0F);
matrixStackIn.translate(0.0D, (double) -1.501F, 0.0D);
boolean flag = entityIn.hurtTime > 0;
this.model.setLivingAnimations(entityIn, 0.0F, 0.0F, partialTicks);
if (entityIn.deathTicks > 0)
{
float f2 = (float) entityIn.deathTicks / 200.0F;
IVertexBuilder ivertexbuilder = bufferIn.getBuffer(RenderType.getEntityAlpha(DRAGON_EXPLODING_TEXTURES, f2));
this.model.render(matrixStackIn, ivertexbuilder, packedLightIn, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F);
IVertexBuilder ivertexbuilder1 = bufferIn.getBuffer(TEXTURE_DECAL);
this.model.render(matrixStackIn, ivertexbuilder1, packedLightIn, OverlayTexture.getPackedUV(0.0F, flag), 1.0F, 1.0F, 1.0F, 1.0F);
}
else
{
float f2 = ((float) entityLiving.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
f2 = MathHelper.sqrt(f2);
if (f2 > 1.0F)
IVertexBuilder ivertexbuilder3 = bufferIn.getBuffer(TEXTURE_CUTOUT);
this.model.render(matrixStackIn, ivertexbuilder3, packedLightIn, OverlayTexture.getPackedUV(0.0F, flag), 1.0F, 1.0F, 1.0F, 1.0F);
}
IVertexBuilder ivertexbuilder4 = bufferIn.getBuffer(EMISSIVE_EYES);
this.model.render(matrixStackIn, ivertexbuilder4, packedLightIn, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F);
if (entityIn.deathTicks > 0)
{
float f5 = ((float) entityIn.deathTicks + partialTicks) / 200.0F;
float f7 = 0.0F;
if (f5 > 0.8F)
{
f7 = (f5 - 0.8F) / 0.2F;
}
Random random = new Random(432L);
IVertexBuilder ivertexbuilder2 = bufferIn.getBuffer(RenderType.getLightning());
matrixStackIn.push();
matrixStackIn.translate(0.0D, -1.0D, -2.0D);
for (int i = 0; (float) i < (f5 + f5 * f5) / 2.0F * 60.0F; ++i)
{
f2 = 1.0F;
matrixStackIn.rotate(Vector3f.XP.rotationDegrees(random.nextFloat() * 360.0F));
matrixStackIn.rotate(Vector3f.YP.rotationDegrees(random.nextFloat() * 360.0F));
matrixStackIn.rotate(Vector3f.ZP.rotationDegrees(random.nextFloat() * 360.0F));
matrixStackIn.rotate(Vector3f.XP.rotationDegrees(random.nextFloat() * 360.0F));
matrixStackIn.rotate(Vector3f.YP.rotationDegrees(random.nextFloat() * 360.0F));
matrixStackIn.rotate(Vector3f.ZP.rotationDegrees(random.nextFloat() * 360.0F + f5 * 90.0F));
float f3 = random.nextFloat() * 20.0F + 5.0F + f7 * 10.0F;
float f4 = random.nextFloat() * 2.0F + 1.0F + f7 * 2.0F;
Matrix4f matrix4f = matrixStackIn.getLast().getMatrix();
int j = (int) (255.0F * (1.0F - f7));
defaultVertex(ivertexbuilder2, matrix4f, j);
func_229060_a_(ivertexbuilder2, matrix4f, f3, f4);
func_229062_b_(ivertexbuilder2, matrix4f, f3, f4);
defaultVertex(ivertexbuilder2, matrix4f, j);
func_229062_b_(ivertexbuilder2, matrix4f, f3, f4);
func_229063_c_(ivertexbuilder2, matrix4f, f3, f4);
defaultVertex(ivertexbuilder2, matrix4f, j);
func_229063_c_(ivertexbuilder2, matrix4f, f3, f4);
func_229060_a_(ivertexbuilder2, matrix4f, f3, f4);
}
GlStateManager.rotatef(f2 * this.getDeathMaxRotation(entityLiving), 0.0F, 0.0F, 1.0F);
matrixStackIn.pop();
}
matrixStackIn.pop();
super.render(entityIn, entityYaw, partialTicks, matrixStackIn, bufferIn, packedLightIn);
}
protected void renderModel(RedDragonEntity entitylivingbaseIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor)
private static void defaultVertex(IVertexBuilder vertexBuilder, Matrix4f matrix, int p_229061_2_)
{
//this.bindEntityTexture(entitylivingbaseIn);
//this.entityModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);
if (entitylivingbaseIn.hurtTime > 0)
{
GlStateManager.depthFunc(514);
GlStateManager.disableTexture();
GlStateManager.enableBlend();
//GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.color4f(1.0F, 0.0F, 0.0F, 0.5F);
//this.entityModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);
GlStateManager.enableTexture();
GlStateManager.disableBlend();
GlStateManager.depthFunc(515);
}
vertexBuilder.pos(matrix, 0.0F, 0.0F, 0.0F).color(255, 255, 255, p_229061_2_).endVertex();
vertexBuilder.pos(matrix, 0.0F, 0.0F, 0.0F).color(255, 255, 255, p_229061_2_).endVertex();
}
private static void func_229060_a_(IVertexBuilder vertexBuilder, Matrix4f matrix, float p_229060_2_, float p_229060_3_)
{
vertexBuilder.pos(matrix, -field_229057_l_ * p_229060_3_, p_229060_2_, -0.5F * p_229060_3_).color(0, 255, 255, 0).endVertex();
}
private static void func_229062_b_(IVertexBuilder vertexBuilder, Matrix4f matrix, float p_229062_2_, float p_229062_3_)
{
vertexBuilder.pos(matrix, field_229057_l_ * p_229062_3_, p_229062_2_, -0.5F * p_229062_3_).color(0, 255, 255, 0).endVertex();
}
private static void func_229063_c_(IVertexBuilder vertexBuilder, Matrix4f matrix, float p_229063_2_, float p_229063_3_)
{
vertexBuilder.pos(matrix, 0.0F, p_229063_2_, 1.0F * p_229063_3_).color(0, 255, 255, 0).endVertex();
}
public ResourceLocation getEntityTexture(RedDragonEntity entity)
{
return DRAGON_TEXTURES;
}
}*/
\ No newline at end of file
}
\ No newline at end of file
/*package com.legacy.rediscovered.client.render.model;
package com.legacy.rediscovered.client.render.model;
import net.minecraft.client.renderer.entity.model.BipedModel;
import com.google.common.collect.ImmutableList;
import net.minecraft.client.renderer.entity.model.SegmentedModel;
import net.minecraft.client.renderer.model.ModelRenderer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.MathHelper;
public class RanaModel<T extends LivingEntity> extends BipedModel<T>
public class RanaModel<T extends LivingEntity> extends SegmentedModel<T>
{
// fields
ModelRenderer froghat;
......@@ -142,7 +144,7 @@ public class RanaModel<T extends LivingEntity> extends BipedModel<T>
setRotation(leftpigtail, 0F, 0F, 0F);
}
public void render(T entity, float f, float f1, float f2, float f3, float f4, float f5)
/*public void render(T entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5);
......@@ -164,6 +166,12 @@ public class RanaModel<T extends LivingEntity> extends BipedModel<T>
leftbandpigtail.render(f5);
rightpigtail.render(f5);
leftpigtail.render(f5);
}*/
@Override
public Iterable<ModelRenderer> getParts()
{
return ImmutableList.of(leftleg, rightleg, lefttoe, righttoe, head, body, rightarm, leftarm, rightleg, leftleg, rightfrogeye, rightbandpigtail, leftbandpigtail, rightpigtail, leftpigtail, rightarm, leftarm, backpack, leftfrogeye, froghat);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
......@@ -173,82 +181,82 @@ public class RanaModel<T extends LivingEntity> extends BipedModel<T>
model.rotateAngleZ = z;
}
*//**
* Sets the models various rotation angles.
*//*
public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6)
{
head.rotateAngleY = par4 / (180F / (float) Math.PI);
head.rotateAngleX = par5 / (180F / (float) Math.PI);
froghat.rotateAngleY = par4 / (180F / (float) Math.PI);
froghat.rotateAngleX = par5 / (180F / (float) Math.PI);
rightfrogeye.rotateAngleY = par4 / (180F / (float) Math.PI);
rightfrogeye.rotateAngleX = par5 / (180F / (float) Math.PI);
leftfrogeye.rotateAngleY = par4 / (180F / (float) Math.PI);
leftfrogeye.rotateAngleX = par5 / (180F / (float) Math.PI);
rightbandpigtail.rotateAngleY = par4 / (180F / (float) Math.PI);
rightbandpigtail.rotateAngleX = par5 / (180F / (float) Math.PI);
leftbandpigtail.rotateAngleY = par4 / (180F / (float) Math.PI);
leftbandpigtail.rotateAngleX = par5 / (180F / (float) Math.PI);
rightpigtail.rotateAngleY = par4 / (180F / (float) Math.PI);
rightpigtail.rotateAngleX = par5 / (180F / (float) Math.PI);
leftpigtail.rotateAngleY = par4 / (180F / (float) Math.PI);
leftpigtail.rotateAngleX = par5 / (180F / (float) Math.PI);
rightleg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2 * 0.5F;
leftleg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float) Math.PI) * 1.4F * par2 * 0.5F;
rightleg.rotateAngleY = 0.0F;
leftleg.rotateAngleY = 0.0F;
lefttoe.rotateAngleX = leftleg.rotateAngleX;
lefttoe.rotateAngleY = leftleg.rotateAngleY;
righttoe.rotateAngleX = rightleg.rotateAngleX;
righttoe.rotateAngleY = rightleg.rotateAngleY;
toplefttoe.rotateAngleX = leftleg.rotateAngleX;
toplefttoe.rotateAngleY = leftleg.rotateAngleY;
toprighttoe.rotateAngleX = rightleg.rotateAngleX;
toprighttoe.rotateAngleY = rightleg.rotateAngleY;
rightarm.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float) Math.PI) * 2.0F * par2 * 0.5F;
leftarm.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F;
rightarm.rotateAngleZ = 0.0F;
leftarm.rotateAngleZ = 0.0F;
rightarm.rotateAngleY = 0.0F;
leftarm.rotateAngleY = 0.0F;
head.rotationPointY = 0.0F;
froghat.rotationPointY = 0.0F;
rightfrogeye.rotationPointY = 0.0F;
leftfrogeye.rotationPointY = 0.0F;
rightbandpigtail.rotationPointY = 0.0F;
leftbandpigtail.rotationPointY = 0.0F;
rightpigtail.rotationPointY = 0.0F;
leftpigtail.rotationPointY = 0.0F;
if (swingProgress > -9990F)
{
float f = swingProgress;
body.rotateAngleY = MathHelper.sin(MathHelper.sqrt(f) * (float) Math.PI * 2.0F);
rightarm.rotationPointZ = MathHelper.sin(body.rotateAngleY) * 4F;
rightarm.rotationPointX = -MathHelper.cos(body.rotateAngleY) * 4F;
leftarm.rotationPointZ = -MathHelper.sin(body.rotateAngleY) * 4F;
leftarm.rotationPointX = MathHelper.cos(body.rotateAngleY) * 5F;
rightarm.rotateAngleY += body.rotateAngleY;
leftarm.rotateAngleY += body.rotateAngleY;
leftarm.rotateAngleX += body.rotateAngleY;
f = 1.0F - swingProgress;
f *= f;
f *= f;
f = 1.0F - f;
float f2 = MathHelper.sin(f * (float) Math.PI);
float f4 = MathHelper.sin(swingProgress * (float) Math.PI) * -(head.rotateAngleX - 0.7F) * 0.75F;
rightarm.rotateAngleX -= (double) f2 * 1.2D + (double) f4;
rightarm.rotateAngleY += body.rotateAngleY * 2.0F;
rightarm.rotateAngleZ = MathHelper.sin(swingProgress * (float) Math.PI * 0.4F);
}
rightarm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
leftarm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
rightarm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F;
leftarm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F;
}
}
*/
\ No newline at end of file
/**
* Sets the models various rotation angles.
*/
@Override
public void setRotationAngles(T entityIn, float par1, float par2, float par3, float par4, float par5)
{
head.rotateAngleY = par4 / (180F / (float) Math.PI);
head.rotateAngleX = par5 / (180F / (float) Math.PI);
froghat.rotateAngleY = par4 / (180F / (float) Math.PI);
froghat.rotateAngleX = par5 / (180F / (float) Math.PI);
rightfrogeye.rotateAngleY = par4 / (180F / (float) Math.PI);
rightfrogeye.rotateAngleX = par5 / (180F / (float) Math.PI);
leftfrogeye.rotateAngleY = par4 / (180F / (float) Math.PI);
leftfrogeye.rotateAngleX = par5 / (180F / (float) Math.PI);
rightbandpigtail.rotateAngleY = par4 / (180F / (float) Math.PI);
rightbandpigtail.rotateAngleX = par5 / (180F / (float) Math.PI);
leftbandpigtail.rotateAngleY = par4 / (180F / (float) Math.PI);
leftbandpigtail.rotateAngleX = par5 / (180F / (float) Math.PI);
rightpigtail.rotateAngleY = par4 / (180F / (float) Math.PI);
rightpigtail.rotateAngleX = par5 / (180F / (float) Math.PI);
leftpigtail.rotateAngleY = par4 / (180F / (float) Math.PI);
leftpigtail.rotateAngleX = par5 / (180F / (float) Math.PI);
rightleg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2 * 0.5F;
leftleg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float) Math.PI) * 1.4F * par2 * 0.5F;
rightleg.rotateAngleY = 0.0F;
leftleg.rotateAngleY = 0.0F;
lefttoe.rotateAngleX = leftleg.rotateAngleX;
lefttoe.rotateAngleY = leftleg.rotateAngleY;
righttoe.rotateAngleX = rightleg.rotateAngleX;
righttoe.rotateAngleY = rightleg.rotateAngleY;
toplefttoe.rotateAngleX = leftleg.rotateAngleX;
toplefttoe.rotateAngleY = leftleg.rotateAngleY;
toprighttoe.rotateAngleX = rightleg.rotateAngleX;
toprighttoe.rotateAngleY = rightleg.rotateAngleY;
rightarm.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float) Math.PI) * 2.0F * par2 * 0.5F;
leftarm.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F;
rightarm.rotateAngleZ = 0.0F;
leftarm.rotateAngleZ = 0.0F;
rightarm.rotateAngleY = 0.0F;
leftarm.rotateAngleY = 0.0F;
head.rotationPointY = 0.0F;
froghat.rotationPointY = 0.0F;
rightfrogeye.rotationPointY = 0.0F;
leftfrogeye.rotationPointY = 0.0F;
rightbandpigtail.rotationPointY = 0.0F;
leftbandpigtail.rotationPointY = 0.0F;
rightpigtail.rotationPointY = 0.0F;
leftpigtail.rotationPointY = 0.0F;
if (swingProgress > -9990F)
{
float f = swingProgress;
body.rotateAngleY = MathHelper.sin(MathHelper.sqrt(f) * (float) Math.PI * 2.0F);
rightarm.rotationPointZ = MathHelper.sin(body.rotateAngleY) * 4F;
rightarm.rotationPointX = -MathHelper.cos(body.rotateAngleY) * 4F;
leftarm.rotationPointZ = -MathHelper.sin(body.rotateAngleY) * 4F;
leftarm.rotationPointX = MathHelper.cos(body.rotateAngleY) * 5F;
rightarm.rotateAngleY += body.rotateAngleY;
leftarm.rotateAngleY += body.rotateAngleY;
leftarm.rotateAngleX += body.rotateAngleY;
f = 1.0F - swingProgress;
f *= f;
f *= f;
f = 1.0F - f;
float f2 = MathHelper.sin(f * (float) Math.PI);
float f4 = MathHelper.sin(swingProgress * (float) Math.PI) * -(head.rotateAngleX - 0.7F) * 0.75F;
rightarm.rotateAngleX -= (double) f2 * 1.2D + (double) f4;
rightarm.rotateAngleY += body.rotateAngleY * 2.0F;
rightarm.rotateAngleZ = MathHelper.sin(swingProgress * (float) Math.PI * 0.4F);
}
rightarm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
leftarm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
rightarm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F;
leftarm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F;
}
}
......@@ -33,10 +33,10 @@ public class RediscoveredEntityTypes
public static final EntityType<MeleePigmanEntity> MELEE_PIGMAN = buildEntity("melee_pigman", EntityType.Builder.create(MeleePigmanEntity::new, EntityClassification.CREATURE).size(0.6F, 1.9F));
public static final EntityType<RangedPigmanEntity> RANGED_PIGMAN = buildEntity("ranged_pigman", EntityType.Builder.create(RangedPigmanEntity::new, EntityClassification.CREATURE).size(0.6F, 1.9F));
public static final EntityType<SteveEntity> STEVE = buildEntity("steve", EntityType.Builder.create(SteveEntity::new, EntityClassification.CREATURE).size(0.6F, 1.9F));
/*public static final EntityType<SteveEntity> STEVE = buildEntity("steve", EntityType.Builder.create(SteveEntity::new, EntityClassification.CREATURE).size(0.6F, 1.9F));
public static final EntityType<RanaEntity> RANA = buildEntity("rana", EntityType.Builder.create(RanaEntity::new, EntityClassification.CREATURE).size(0.6F, 1.9F));
public static final EntityType<BlackSteveEntity> BLACK_STEVE = buildEntity("black_steve", EntityType.Builder.create(BlackSteveEntity::new, EntityClassification.MONSTER).size(0.6F, 1.9F));
public static final EntityType<BeastBoyEntity> BEAST_BOY = buildEntity("beast_boy", EntityType.Builder.create(BeastBoyEntity::new, EntityClassification.MONSTER).size(0.6F, 1.9F));
public static final EntityType<BeastBoyEntity> BEAST_BOY = buildEntity("beast_boy", EntityType.Builder.create(BeastBoyEntity::new, EntityClassification.MONSTER).size(0.6F, 1.9F));*/
public static final EntityType<RedDragonEntity> RED_DRAGON = buildEntity("red_dragon", EntityType.Builder.create(RedDragonEntity::new, EntityClassification.CREATURE).size(8.0F, 4.5F));
......@@ -52,16 +52,15 @@ public class RediscoveredEntityTypes
RediscoveredRegistry.register(event.getRegistry(), "melee_pigman", MELEE_PIGMAN);
RediscoveredRegistry.register(event.getRegistry(), "ranged_pigman", RANGED_PIGMAN);
RediscoveredRegistry.register(event.getRegistry(), "steve", STEVE);
/*RediscoveredRegistry.register(event.getRegistry(), "steve", STEVE);
RediscoveredRegistry.register(event.getRegistry(), "rana", RANA);
RediscoveredRegistry.register(event.getRegistry(), "black_steve", BLACK_STEVE);
RediscoveredRegistry.register(event.getRegistry(), "beast_boy", BEAST_BOY);
RediscoveredRegistry.register(event.getRegistry(), "beast_boy", BEAST_BOY);*/
RediscoveredRegistry.register(event.getRegistry(), "red_dragon", RED_DRAGON);
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);
registerSpawnConditions();
......@@ -85,11 +84,11 @@ public class RediscoveredEntityTypes
private static void registerSpawnConditions()
{
EntitySpawnPlacementRegistry.register(RediscoveredEntityTypes.PIGMAN, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, RediscoveredEntityTypes::mobSpawnConditions);
EntitySpawnPlacementRegistry.register(RediscoveredEntityTypes.STEVE, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, RediscoveredEntityTypes::mobSpawnConditions);
/*EntitySpawnPlacementRegistry.register(RediscoveredEntityTypes.STEVE, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, RediscoveredEntityTypes::mobSpawnConditions);
EntitySpawnPlacementRegistry.register(RediscoveredEntityTypes.RANA, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, RediscoveredEntityTypes::mobSpawnConditions);
EntitySpawnPlacementRegistry.register(RediscoveredEntityTypes.BLACK_STEVE, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, RediscoveredEntityTypes::monsterSpawnConditions);
EntitySpawnPlacementRegistry.register(RediscoveredEntityTypes.BEAST_BOY, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, RediscoveredEntityTypes::monsterSpawnConditions);
EntitySpawnPlacementRegistry.register(RediscoveredEntityTypes.BEAST_BOY, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, RediscoveredEntityTypes::monsterSpawnConditions);*/
EntitySpawnPlacementRegistry.register(RediscoveredEntityTypes.MELEE_PIGMAN, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, RediscoveredEntityTypes::monsterSpawnConditions);
EntitySpawnPlacementRegistry.register(RediscoveredEntityTypes.RANGED_PIGMAN, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, RediscoveredEntityTypes::monsterSpawnConditions);
EntitySpawnPlacementRegistry.register(RediscoveredEntityTypes.RED_DRAGON, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, RediscoveredEntityTypes::monsterSpawnConditions);
......
......@@ -380,7 +380,7 @@ public class PigmanEntity extends AbstractVillagerEntity
BiPredicate<PigmanEntity, PointOfInterestType> bipredicate = VALID_POI.get(p_213742_1_);
if (optional.isPresent() && bipredicate.test(this, optional.get()))
{
pointofinterestmanager.func_219142_b(p_213752_3_.getPos());
pointofinterestmanager.release(p_213752_3_.getPos());
DebugPacketSender.func_218801_c(serverworld, p_213752_3_.getPos());
}
......
......@@ -28,24 +28,24 @@ public class PigmanWalkToPOITask extends Task<PigmanEntity>
protected boolean shouldExecute(ServerWorld worldIn, PigmanEntity owner)
{
return !worldIn.func_217483_b_(new BlockPos(owner));
return !worldIn.isVillage(new BlockPos(owner));
}
protected void startExecuting(ServerWorld worldIn, PigmanEntity entityIn, long gameTimeIn)
{
PointOfInterestManager pointofinterestmanager = worldIn.getPointOfInterestManager();
int i = pointofinterestmanager.func_219150_a(SectionPos.from(new BlockPos(entityIn)));
int i = pointofinterestmanager.sectionsToVillage(SectionPos.from(new BlockPos(entityIn)));
Vec3d vec3d = null;
for (int j = 0; j < 5; ++j)
{
Vec3d vec3d1 = RandomPositionGenerator.func_221024_a(entityIn, 15, 7, (p_225444_1_) ->
{
return (double) (-worldIn.func_217486_a(SectionPos.from(p_225444_1_)));
return (double) (-worldIn.sectionsToVillage(SectionPos.from(p_225444_1_)));
});
if (vec3d1 != null)
{
int k = pointofinterestmanager.func_219150_a(SectionPos.from(new BlockPos(vec3d1)));
int k = pointofinterestmanager.sectionsToVillage(SectionPos.from(new BlockPos(vec3d1)));
if (k < i)
{
vec3d = vec3d1;
......
......@@ -47,10 +47,10 @@ public class RediscoveredItems
pigman_spawn_egg = register("pigman_spawn_egg", new SpawnEggItem(RediscoveredEntityTypes.PIGMAN, 0xf0a5a2, 0xa1a1a1, new Item.Properties().group(ItemGroup.MISC)));
melee_pigman_spawn_egg = register("melee_pigman_spawn_egg", new SpawnEggItem(RediscoveredEntityTypes.MELEE_PIGMAN, 0xf0a5a2, 0xa1a1a1, new Item.Properties().group(ItemGroup.MISC)));
ranged_pigman_spawn_egg = register("ranged_pigman_spawn_egg", new SpawnEggItem(RediscoveredEntityTypes.RANGED_PIGMAN, 0xf0a5a2, 0xa1a1a1, new Item.Properties().group(ItemGroup.MISC)));
steve_spawn_egg = register("steve_spawn_egg", new SpawnEggItem(RediscoveredEntityTypes.STEVE, 44975, 0xf6b201, new Item.Properties().group(ItemGroup.MISC)));
/*steve_spawn_egg = register("steve_spawn_egg", new SpawnEggItem(RediscoveredEntityTypes.STEVE, 44975, 0xf6b201, new Item.Properties().group(ItemGroup.MISC)));
rana_spawn_egg = register("rana_spawn_egg", new SpawnEggItem(RediscoveredEntityTypes.RANA, 0x4c7129, 0xf0a5a2, new Item.Properties().group(ItemGroup.MISC)));
black_steve_spawn_egg = register("black_steve_spawn_egg", new SpawnEggItem(RediscoveredEntityTypes.BLACK_STEVE, 10489616, 894731, new Item.Properties().group(ItemGroup.MISC)));
beast_boy_spawn_egg = register("beast_boy_spawn_egg", new SpawnEggItem(RediscoveredEntityTypes.BEAST_BOY, 0x9932cc, 5349438, new Item.Properties().group(ItemGroup.MISC)));
beast_boy_spawn_egg = register("beast_boy_spawn_egg", new SpawnEggItem(RediscoveredEntityTypes.BEAST_BOY, 0x9932cc, 5349438, new Item.Properties().group(ItemGroup.MISC)));*/
fish_spawn_egg = register("fish_spawn_egg", new SpawnEggItem(RediscoveredEntityTypes.FISH, 44975, 2243405, new Item.Properties().group(ItemGroup.MISC)));
dream_pillow = register("dream_pillow", new Item(new Item.Properties().maxStackSize(1).group(ItemGroup.MISC)));
......
......@@ -4,6 +4,7 @@ import com.legacy.rediscovered.block.RediscoveredBlocks;
import com.legacy.rediscovered.entity.RediscoveredEntityTypes;
import com.legacy.rediscovered.world.biome.feature.IceAndSnowSkyFeature;
import com.legacy.rediscovered.world.biome.feature.RediscoveredFeatures;
import com.legacy.rediscovered.world.biome.feature.structure.SmallPigmanVillageConfig;
import net.minecraft.block.Blocks;
import net.minecraft.entity.EntityClassification;
......@@ -36,15 +37,14 @@ public final class SkylandsBiome extends Biome
{
super((new Biome.Builder()).surfaceBuilder(SurfaceBuilder.DEFAULT, SurfaceBuilder.GRASS_DIRT_GRAVEL_CONFIG).precipitation(Biome.RainType.NONE).category(Biome.Category.EXTREME_HILLS).depth(0.1F).scale(0.2F).temperature(0.5F).downfall(0.4F).waterColor(4159204).waterFogColor(329011).parent((String) null));
//this.addStructure(RediscoveredFeatures.SMALL_PIGMAN_VILLAGE, new SmallPigmanVillageConfig());
//this.addFeature(GenerationStage.Decoration.SURFACE_STRUCTURES, createDecoratedFeature(RediscoveredFeatures.SKY_SPAWN, IFeatureConfig.NO_FEATURE_CONFIG, Placement.NOPE, IPlacementConfig.NO_PLACEMENT_CONFIG));
//this.addFeature(GenerationStage.Decoration.SURFACE_STRUCTURES, Biome.createDecoratedFeature(RediscoveredFeatures.SMALL_PIGMAN_VILLAGE, new SmallPigmanVillageConfig(), Placement.NOPE, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addStructure(RediscoveredFeatures.SMALL_PIGMAN_VILLAGE.withConfiguration(new SmallPigmanVillageConfig()));
this.addFeature(GenerationStage.Decoration.SURFACE_STRUCTURES, RediscoveredFeatures.SKY_SPAWN.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG).withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)));
this.addFeature(GenerationStage.Decoration.SURFACE_STRUCTURES, RediscoveredFeatures.SMALL_PIGMAN_VILLAGE.withConfiguration(new SmallPigmanVillageConfig()).withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, RediscoveredFeatures.CHERRY_TREE.withConfiguration(DefaultBiomeFeatures.OAK_TREE_CONFIG).withPlacement(Placement.COUNT_EXTRA_HEIGHTMAP.configure(new AtSurfaceWithExtraConfig(0, 0.7F, 1))));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.RANDOM_PATCH.withConfiguration(CLASSIC_FLOWER_CONFIG).withPlacement(Placement.COUNT_HEIGHTMAP_32.configure(new FrequencyConfig(2))));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.FLOWER.withConfiguration(CLASSIC_FLOWER_CONFIG).withPlacement(Placement.COUNT_HEIGHTMAP_32.configure(new FrequencyConfig(2))));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.RANDOM_PATCH.withConfiguration(DefaultBiomeFeatures.GRASS_CONFIG).withPlacement(Placement.COUNT_HEIGHTMAP_DOUBLE.configure(new FrequencyConfig(1))));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.RANDOM_PATCH.withConfiguration(DefaultBiomeFeatures.GRASS_CONFIG).withPlacement(Placement.COUNT_HEIGHTMAP_DOUBLE.configure(new FrequencyConfig(3))));
this.addFeature(GenerationStage.Decoration.