mirror of
https://github.com/architectury/architectury-api.git
synced 2026-04-01 21:17:45 -05:00
Remove most deprecated features marked for removal in previous versions
Signed-off-by: Max <maxh2709@gmail.com>
This commit is contained in:
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* This file is part of architectury.
|
||||
* Copyright (C) 2020, 2021, 2022 architectury
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
package dev.architectury.registry.block.fabric;
|
||||
|
||||
import dev.architectury.registry.block.BlockProperties;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public class BlockPropertiesImpl {
|
||||
public static BlockProperties of(Material material, MaterialColor color) {
|
||||
return new Impl(material, (state) -> color);
|
||||
}
|
||||
|
||||
public static BlockProperties of(Material material, Function<BlockState, MaterialColor> color) {
|
||||
return new Impl(material, color);
|
||||
}
|
||||
|
||||
public static BlockProperties copy(BlockBehaviour old) {
|
||||
return copy(old.properties);
|
||||
}
|
||||
|
||||
public static BlockProperties copy(BlockBehaviour.Properties old) {
|
||||
var properties = of(old.material, old.materialColor);
|
||||
properties.material = old.material;
|
||||
properties.destroyTime = old.destroyTime;
|
||||
properties.explosionResistance = old.explosionResistance;
|
||||
properties.hasCollision = old.hasCollision;
|
||||
properties.isRandomlyTicking = old.isRandomlyTicking;
|
||||
properties.lightEmission = old.lightEmission;
|
||||
properties.materialColor = old.materialColor;
|
||||
properties.soundType = old.soundType;
|
||||
properties.friction = old.friction;
|
||||
properties.speedFactor = old.speedFactor;
|
||||
properties.dynamicShape = old.dynamicShape;
|
||||
properties.canOcclude = old.canOcclude;
|
||||
properties.isAir = old.isAir;
|
||||
properties.requiresCorrectToolForDrops = old.requiresCorrectToolForDrops;
|
||||
return properties;
|
||||
}
|
||||
|
||||
private static final class Impl extends BlockProperties {
|
||||
public Impl(Material material, Function<BlockState, MaterialColor> function) {
|
||||
super(material, function);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user