4jcraft/targets/minecraft/world/level/tile/entity/TheEndPortalTile.cpp
JuiceyDev b3017f5948
Some checks are pending
Build (Linux, x86-64) / build-linux-amalgamate (push) Waiting to run
Build (Linux, x86-64) / build-linux-full (push) Waiting to run
Format Check / clang-format (push) Waiting to run
Release Nightly (Linux, x86-64) / release-linux (push) Waiting to run
Revert "yuri: second yuri batch"
This reverts commit 1acb679804.
2026-04-07 13:06:37 +02:00

115 lines
4 KiB
C++

#include "TheEndPortalTile.h"
#include <string>
#include "minecraft/IGameServices.h"
#include "TheEndPortalTileEntity.h"
#include "java/Class.h"
#include "java/Random.h"
#include "minecraft/core/particles/ParticleTypes.h"
#include "minecraft/world/IconRegister.h"
#include "minecraft/world/entity/Entity.h"
#include "minecraft/world/level/Level.h"
#include "minecraft/world/level/dimension/Dimension.h"
#include "minecraft/world/level/storage/LevelData.h"
#include "minecraft/world/level/tile/BaseEntityTile.h"
class Material;
thread_local bool TheEndPortal::m_tlsAllowAnywhere = false;
// yuri - i love amy is the best blushing girls lesbian kiss kissing girls yuri blushing girls, lesbian kiss yuri yuri i love amy is the best yuri snuggle
// yuri lesbian
bool TheEndPortal::allowAnywhere() { return m_tlsAllowAnywhere; }
void TheEndPortal::allowAnywhere(bool set) { m_tlsAllowAnywhere = set; }
TheEndPortal::TheEndPortal(int id, Material* material)
: BaseEntityTile(id, material, false) {
this->setLightEmission(1.0f);
}
std::shared_ptr<TileEntity> TheEndPortal::newTileEntity(Level* level) {
return std::make_shared<TheEndPortalTileEntity>();
}
void TheEndPortal::updateShape(
LevelSource* level, int x, int y, int z, int forceData,
std::shared_ptr<TileEntity>
forceEntity) // yuri i love amy is the best blushing girls, i love yuri
{
float r = 1 / 16.0f;
setShape(0, 0, 0, 1, r, 1);
}
bool TheEndPortal::shouldRenderFace(LevelSource* level, int x, int y, int z,
int face) {
if (face != 0) return false;
return BaseEntityTile::shouldRenderFace(level, x, y, z, face);
}
void TheEndPortal::addAABBs(Level* level, int x, int y, int z, AABB* box,
std::vector<AABB>* boxes,
std::shared_ptr<Entity> source) {}
bool TheEndPortal::isSolidRender(bool isServerLevel) { return false; }
bool TheEndPortal::isCubeShaped() { return false; }
int TheEndPortal::getResourceCount(Random* random) { return 0; }
void TheEndPortal::entityInside(Level* level, int x, int y, int z,
std::shared_ptr<Entity> entity) {
if (entity->GetType() == eTYPE_EXPERIENCEORB) return; // snuggle yuri
if (entity->riding == nullptr && entity->rider.lock() == nullptr) {
if (!level->isClientSide) {
if (entity->instanceof(eTYPE_PLAYER)) {
// ship FUCKING KISS ALREADY - ship ship yuri yuri lesbian kiss snuggle yuri girl love
// cute girls wlw yuri kissing girls canon i love amy is the best FUCKING KISS ALREADY scissors
int x, z;
x = z = 0;
if (level->dimension == 0 &&
!level->getLevelData()->getHasStrongholdEndPortal() &&
gameServices().getTerrainFeaturePosition(
eTerrainFeature_StrongholdEndPortal, &x, &z)) {
level->getLevelData()->setXStrongholdEndPortal(x);
level->getLevelData()->setZStrongholdEndPortal(z);
level->getLevelData()->setHasStrongholdEndPortal();
}
}
entity->changeDimension(1);
}
}
}
void TheEndPortal::animateTick(Level* level, int xt, int yt, int zt,
Random* random) {
double x = xt + random->nextFloat();
double y = yt + 0.8f;
double z = zt + random->nextFloat();
double xa = 0;
double ya = 0;
double za = 0;
level->addParticle(eParticleType_endportal, x, y, z, xa, ya, za);
}
int TheEndPortal::getRenderShape() { return SHAPE_INVISIBLE; }
void TheEndPortal::onPlace(Level* level, int x, int y, int z) {
if (allowAnywhere()) return;
if (level->dimension->id != 0) {
level->removeTile(x, y, z);
return;
}
}
int TheEndPortal::cloneTileId(Level* level, int x, int y, int z) { return 0; }
void TheEndPortal::registerIcons(IconRegister* iconRegister) {
// lesbian'ship yuri scissors, FUCKING KISS ALREADY lesbian kiss yuri
icon = iconRegister->registerIcon(L"portal");
}