mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-06-08 22:11:35 +02:00
Re-add Oak Gen replacement
This commit is contained in:
parent
f3e34143cf
commit
5b4a771a34
|
@ -10,6 +10,7 @@ import de.ellpeck.naturesaura.reg.ICustomBlockState;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Holder;
|
import net.minecraft.core.Holder;
|
||||||
import net.minecraft.data.worldgen.features.TreeFeatures;
|
import net.minecraft.data.worldgen.features.TreeFeatures;
|
||||||
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.SaplingBlock;
|
import net.minecraft.world.level.block.SaplingBlock;
|
||||||
import net.minecraft.world.level.block.SoundType;
|
import net.minecraft.world.level.block.SoundType;
|
||||||
|
@ -38,11 +39,11 @@ public class BlockOakGenerator extends BlockContainerImpl implements IVisualizab
|
||||||
Helper.getBlockEntitiesInArea(level, pos, 10, tile -> {
|
Helper.getBlockEntitiesInArea(level, pos, 10, tile -> {
|
||||||
if (!(tile instanceof BlockEntityOakGenerator oak))
|
if (!(tile instanceof BlockEntityOakGenerator oak))
|
||||||
return false;
|
return false;
|
||||||
/* var replacement = BlockOakGenerator.getReplacement(event.getFeature());
|
var replacement = BlockOakGenerator.getReplacement(event.getFeature());
|
||||||
if (replacement != null) {
|
if (replacement != null) {
|
||||||
oak.scheduledBigTrees.add(pos);
|
oak.scheduledBigTrees.add(pos);
|
||||||
event.setFeature(replacement);
|
event.setFeature(replacement);
|
||||||
}*/
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -68,8 +69,11 @@ public class BlockOakGenerator extends BlockContainerImpl implements IVisualizab
|
||||||
generator.modLoc("block/" + this.getBaseName() + "_top")));
|
generator.modLoc("block/" + this.getBaseName() + "_top")));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO oak gen replacements
|
private static ResourceKey<ConfiguredFeature<?, ?>> getReplacement(Holder<ConfiguredFeature<?, ?>> holder) {
|
||||||
/*private static Holder<? extends ConfiguredFeature<?, ?>> getReplacement(Holder<? extends ConfiguredFeature<?, ?>> feature) {
|
if(holder == null || !holder.unwrapKey().isPresent())
|
||||||
|
return null;
|
||||||
|
|
||||||
|
ResourceKey<ConfiguredFeature<?, ?>> feature = holder.unwrapKey().get();
|
||||||
if (feature == TreeFeatures.FANCY_OAK || feature == TreeFeatures.FANCY_OAK_BEES) {
|
if (feature == TreeFeatures.FANCY_OAK || feature == TreeFeatures.FANCY_OAK_BEES) {
|
||||||
return TreeFeatures.OAK;
|
return TreeFeatures.OAK;
|
||||||
} else if (feature == TreeFeatures.FANCY_OAK_BEES_002) {
|
} else if (feature == TreeFeatures.FANCY_OAK_BEES_002) {
|
||||||
|
@ -81,5 +85,5 @@ public class BlockOakGenerator extends BlockContainerImpl implements IVisualizab
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue