mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-07-13 01:47:02 +00:00
Implement spigotbase's following changes
jeb_'s fix, and maps placed in item frames now fill the whole block.
This commit is contained in:
parent
2158cce6f1
commit
a398941521
Binary file not shown.
|
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 163 KiB |
|
|
@ -61,6 +61,9 @@ void ItemFrameRenderer::drawFrame(shared_ptr<ItemFrame> itemFrame)
|
|||
Tile *wood = Tile::wood;
|
||||
float depth = 1.0f / 16.0f;
|
||||
float width = 12.0f / 16.0f;
|
||||
if (itemFrame->getItem() && itemFrame->getItem()->getItem() == Item::map) {
|
||||
width = 1.0f;
|
||||
}
|
||||
float widthHalf = width / 2.0f;
|
||||
|
||||
// Back
|
||||
|
|
@ -142,15 +145,15 @@ void ItemFrameRenderer::drawItem(shared_ptr<ItemFrame> entity)
|
|||
|
||||
glRotatef(180, 0, 1, 0);
|
||||
glRotatef(180, 0, 0, 1);
|
||||
glScalef(1.0f / 256.0f, 1.0f / 256.0f, 1.0f / 256.0f);
|
||||
glTranslatef(-65, -107, -3);
|
||||
glScalef(1.0f / 128.0f, 1.0f / 128.0f, 1.0f / 128.0f);
|
||||
glTranslatef(-64.0f, -87.0f, -3.0f);
|
||||
glNormal3f(0, 0, -1);
|
||||
t->begin();
|
||||
int vo = 7;
|
||||
t->vertexUV(0 - vo, 128 + vo, 0, 0, 1);
|
||||
t->vertexUV(128 + vo, 128 + vo, 0, 1, 1);
|
||||
t->vertexUV(128 + vo, 0 - vo, 0, 1, 0);
|
||||
t->vertexUV(0 - vo, 0 - vo, 0, 0, 0);
|
||||
t->vertexUV(0.0f, 128.0f, 0.0f, 0.0f, 1.0f);
|
||||
t->vertexUV(128.0f, 128.0f, 0.0f, 1.0f, 1.0f);
|
||||
t->vertexUV(128.0f, 0.0f, 0.0f, 1.0f, 0.0f);
|
||||
t->vertexUV(0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
t->end();
|
||||
|
||||
shared_ptr<MapItemSavedData> data = Item::map->getSavedData(itemEntity->getItem(), entity->level);
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ void LivingEntityRenderer::renderArrows(shared_ptr<LivingEntity> mob, float a)
|
|||
|
||||
int LivingEntityRenderer::prepareArmorOverlay(shared_ptr<LivingEntity> mob, int layer, float a)
|
||||
{
|
||||
return prepareArmor(mob, layer, a);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int LivingEntityRenderer::prepareArmor(shared_ptr<LivingEntity> mob, int layer, float a)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ void MobRenderer::render(shared_ptr<Entity> _mob, double x, double y, double z,
|
|||
|
||||
bool MobRenderer::shouldShowName(shared_ptr<LivingEntity> mob)
|
||||
{
|
||||
return LivingEntityRenderer::shouldShowName(mob) && (mob->shouldShowName() || dynamic_pointer_cast<Mob>(mob)->hasCustomName() && mob == entityRenderDispatcher->crosshairPickMob);
|
||||
return LivingEntityRenderer::shouldShowName(mob) && (mob->shouldShowName() || dynamic_pointer_cast<Mob>(mob)->hasCustomName());
|
||||
}
|
||||
|
||||
void MobRenderer::renderLeash(shared_ptr<Mob> entity, double x, double y, double z, float rot, float a)
|
||||
|
|
|
|||
|
|
@ -51,19 +51,6 @@ void SheepFurModel::prepareMobModel(shared_ptr<LivingEntity> mob, float time, fl
|
|||
headXRot = sheep->getHeadEatAngleScale(a);
|
||||
|
||||
wstring name = mob->getAName();
|
||||
if (name == L"jeb_")
|
||||
{
|
||||
int i1 = 25;
|
||||
int i = mob->tickCount / 25;
|
||||
int j = Sheep::COLOR_LENGTH;
|
||||
int k = i % j;
|
||||
int l = (i + 1) % j;
|
||||
float f = ((float)(mob->tickCount % 25) + time) / 25.0F;
|
||||
const float* afloat1 = Sheep::COLOR[k];
|
||||
const float* afloat2 = Sheep::COLOR[l];
|
||||
|
||||
RenderManager.StateSetColour(afloat1[0] * (1.0F - f) + afloat2[0] * f, afloat1[1] * (1.0F - f) + afloat2[1] * f, afloat1[2] * (1.0F - f) + afloat2[2] * f, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void SheepFurModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr<Entity> entity, unsigned int uiBitmaskOverrideAnim)
|
||||
|
|
|
|||
|
|
@ -27,25 +27,30 @@ int SheepRenderer::prepareArmor(shared_ptr<LivingEntity> _sheep, int layer, floa
|
|||
{
|
||||
// easter egg...
|
||||
int colorDuration = 25;
|
||||
int value = (sheep->tickCount / colorDuration) + sheep->entityId;
|
||||
int value = (sheep->tickCount / colorDuration);
|
||||
int c1 = value % Sheep::COLOR_LENGTH;
|
||||
int c2 = (value + 1) % Sheep::COLOR_LENGTH;
|
||||
float subStep = ((sheep->tickCount % colorDuration) + a) / static_cast<float>(colorDuration);
|
||||
|
||||
glColor3f(Sheep::COLOR[c1][0] * (1.0f - subStep) + Sheep::COLOR[c2][0] * subStep, Sheep::COLOR[c1][1] * (1.0f - subStep) + Sheep::COLOR[c2][1] * subStep, Sheep::COLOR[c1][2]
|
||||
* (1.0f - subStep) + Sheep::COLOR[c2][2] * subStep);
|
||||
float r = Sheep::COLOR[c1][0] * (1.0f - subStep) + Sheep::COLOR[c2][0] * subStep;
|
||||
float g = Sheep::COLOR[c1][1] * (1.0f - subStep) + Sheep::COLOR[c2][1] * subStep;
|
||||
float b = Sheep::COLOR[c1][2] * (1.0f - subStep) + Sheep::COLOR[c2][2] * subStep;
|
||||
|
||||
float brightness = SharedConstants::TEXTURE_LIGHTING ? 1.0f : sheep->getBrightness(a);
|
||||
glColor3f(r * brightness, g * brightness, b * brightness);
|
||||
}
|
||||
else
|
||||
{
|
||||
int color = sheep->getColor();
|
||||
glColor3f(Sheep::COLOR[color][0], Sheep::COLOR[color][1], Sheep::COLOR[color][2]);
|
||||
|
||||
float r = Sheep::COLOR[color][0];
|
||||
float g = Sheep::COLOR[color][1];
|
||||
float b = Sheep::COLOR[color][2];
|
||||
|
||||
float brightness = SharedConstants::TEXTURE_LIGHTING ? 1.0f : sheep->getBrightness(a);
|
||||
glColor3f(r * brightness, g * brightness, b * brightness);
|
||||
}
|
||||
|
||||
|
||||
// 4J - change brought forward from 1.8.2
|
||||
float brightness = SharedConstants::TEXTURE_LIGHTING ? 1.0f : sheep->getBrightness(a);
|
||||
int color = sheep->getColor();
|
||||
glColor3f(brightness * Sheep::COLOR[color][0], brightness * Sheep::COLOR[color][1], brightness * Sheep::COLOR[color][2]);
|
||||
return 1;
|
||||
}
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -479,7 +479,7 @@ void Item::staticCtor()
|
|||
Item::potatoBaked = (new FoodItem(137, 6, FoodConstants::FOOD_SATURATION_NORMAL, false)) ->setIconName(L"potatoBaked")->setDescriptionId(IDS_ITEM_POTATO_BAKED)->setUseDescriptionId(IDS_DESC_POTATO_BAKED);
|
||||
Item::potatoPoisonous = (new FoodItem(138, 2, FoodConstants::FOOD_SATURATION_LOW, false)) ->setEatEffect(MobEffect::poison->id, 5, 0, .6f)->setIconName(L"potatoPoisonous")->setDescriptionId(IDS_ITEM_POTATO_POISONOUS)->setUseDescriptionId(IDS_DESC_POTATO_POISONOUS);
|
||||
|
||||
Item::emptyMap = static_cast<EmptyMapItem *>((new EmptyMapItem(139))->setIconName(L"map_empty")->setDescriptionId(IDS_ITEM_MAP_EMPTY)->setUseDescriptionId(IDS_DESC_MAP_EMPTY));
|
||||
Item::emptyMap = (EmptyMapItem*)(new EmptyMapItem(139))->setIconName(L"map_empty")->setBaseItemTypeAndMaterial(eBaseItemType_pockettool, eMaterial_map)->setDescriptionId(IDS_ITEM_MAP_EMPTY)->setUseDescriptionId(IDS_DESC_MAP_EMPTY);
|
||||
|
||||
Item::carrotGolden = (new FoodItem(140, 6, FoodConstants::FOOD_SATURATION_SUPERNATURAL, false)) ->setBaseItemTypeAndMaterial(eBaseItemType_giltFruit, eMaterial_carrot)->setIconName(L"carrotGolden")->setPotionBrewingFormula(PotionBrewing::MOD_GOLDENCARROT)->setDescriptionId(IDS_ITEM_CARROT_GOLDEN)->setUseDescriptionId(IDS_DESC_CARROT_GOLDEN);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue