mirror of
https://github.com/DrPerkyLegit/LCEServerTest.git
synced 2026-06-12 07:31:56 +00:00
removed git history
This commit is contained in:
23
Minecraft.World/TemperatureMixerLayer.cpp
Normal file
23
Minecraft.World/TemperatureMixerLayer.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "stdafx.h"
|
||||
#include "net.minecraft.world.level.biome.h"
|
||||
#include "net.minecraft.world.level.newbiome.layer.h"
|
||||
|
||||
TemperatureMixerLayer::TemperatureMixerLayer(shared_ptr<Layer>temp, shared_ptr<Layer>parent, int layer) : Layer(0)
|
||||
{
|
||||
this->parent = parent;
|
||||
this->temp = temp;
|
||||
this->layer = layer;
|
||||
}
|
||||
|
||||
intArray TemperatureMixerLayer::getArea(int xo, int yo, int w, int h)
|
||||
{
|
||||
intArray b = parent->getArea(xo, yo, w, h);
|
||||
intArray t = temp->getArea(xo, yo, w, h);
|
||||
|
||||
intArray result = IntCache::allocate(w * h);
|
||||
for (int i = 0; i < w * h; i++) {
|
||||
result[i] = t[i] + (Biome::biomes[b[i]]->getTemperatureInt() - t[i]) / (layer * 2 + 1);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user