Continue mapping migration

This commit is contained in:
Aleksey 2021-04-12 21:38:22 +03:00
parent 99ade39404
commit f03fd03bd0
499 changed files with 12567 additions and 12723 deletions

View file

@ -1,14 +1,12 @@
package ru.betterend.registry;
import java.util.List;
import com.google.common.collect.Lists;
import net.minecraft.core.Registry;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.item.BlockItem;
import net.minecraft.core.Registry;
import com.google.common.collect.Lists;
import ru.betterend.BetterEnd;
import ru.betterend.blocks.EndStoneSmelter;
import ru.betterend.blocks.EternalPedestal;
@ -29,35 +27,30 @@ import ru.betterend.blocks.entities.InfusionPedestalEntity;
import ru.betterend.blocks.entities.PedestalBlockEntity;
public class EndBlockEntities {
public final static BlockEntityType<EndStoneSmelterBlockEntity> END_STONE_SMELTER = registerBlockEntity(
EndStoneSmelter.ID,
BlockEntityType.Builder.create(EndStoneSmelterBlockEntity::new, EndBlocks.END_STONE_SMELTER));
public final static BlockEntityType<EndStoneSmelterBlockEntity> END_STONE_SMELTER = registerBlockEntity(EndStoneSmelter.ID,
BlockEntityType.Builder.of(EndStoneSmelterBlockEntity::new, EndBlocks.END_STONE_SMELTER));
public final static BlockEntityType<PedestalBlockEntity> PEDESTAL = registerBlockEntity("pedestal",
BlockEntityType.Builder.create(PedestalBlockEntity::new, getPedestals()));
public final static BlockEntityType<EternalPedestalEntity> ETERNAL_PEDESTAL = registerBlockEntity(
"eternal_pedestal", BlockEntityType.Builder.create(EternalPedestalEntity::new, EndBlocks.ETERNAL_PEDESTAL));
public final static BlockEntityType<InfusionPedestalEntity> INFUSION_PEDESTAL = registerBlockEntity(
"infusion_pedestal",
BlockEntityType.Builder.create(InfusionPedestalEntity::new, EndBlocks.INFUSION_PEDESTAL));
public static final BlockEntityType<EChestBlockEntity> CHEST = registerBlockEntity("chest",
BlockEntityType.Builder.create(EChestBlockEntity::new, getChests()));
BlockEntityType.Builder.of(PedestalBlockEntity::new, getPedestals()));
public final static BlockEntityType<EternalPedestalEntity> ETERNAL_PEDESTAL = registerBlockEntity("eternal_pedestal",
BlockEntityType.Builder.of(EternalPedestalEntity::new, EndBlocks.ETERNAL_PEDESTAL));
public final static BlockEntityType<InfusionPedestalEntity> INFUSION_PEDESTAL = registerBlockEntity("infusion_pedestal",
BlockEntityType.Builder.of(InfusionPedestalEntity::new, EndBlocks.INFUSION_PEDESTAL));
public static final BlockEntityType<EChestBlockEntity> CHEST = registerBlockEntity("chest",
BlockEntityType.Builder.of(EChestBlockEntity::new, getChests()));
public static final BlockEntityType<EBarrelBlockEntity> BARREL = registerBlockEntity("barrel",
BlockEntityType.Builder.create(EBarrelBlockEntity::new, getBarrels()));
BlockEntityType.Builder.of(EBarrelBlockEntity::new, getBarrels()));
public static final BlockEntityType<ESignBlockEntity> SIGN = registerBlockEntity("sign",
BlockEntityType.Builder.create(ESignBlockEntity::new, getSigns()));
public final static BlockEntityType<BlockEntityHydrothermalVent> HYDROTHERMAL_VENT = registerBlockEntity(
"hydrother_malvent",
BlockEntityType.Builder.create(BlockEntityHydrothermalVent::new, EndBlocks.HYDROTHERMAL_VENT));
BlockEntityType.Builder.of(ESignBlockEntity::new, getSigns()));
public final static BlockEntityType<BlockEntityHydrothermalVent> HYDROTHERMAL_VENT = registerBlockEntity("hydrother_malvent",
BlockEntityType.Builder.of(BlockEntityHydrothermalVent::new, EndBlocks.HYDROTHERMAL_VENT));
public static final BlockEntityType<EFurnaceBlockEntity> FURNACE = registerBlockEntity("furnace",
BlockEntityType.Builder.create(EFurnaceBlockEntity::new, getFurnaces()));
BlockEntityType.Builder.of(EFurnaceBlockEntity::new, getFurnaces()));
public static <T extends BlockEntity> BlockEntityType<T> registerBlockEntity(String id,
BlockEntityType.Builder<T> builder) {
public static <T extends BlockEntity> BlockEntityType<T> registerBlockEntity(String id, BlockEntityType.Builder<T> builder) {
return Registry.register(Registry.BLOCK_ENTITY_TYPE, BetterEnd.makeID(id), builder.build(null));
}
public static void register() {
}
public static void register() {}
static Block[] getChests() {
List<Block> result = Lists.newArrayList();
@ -71,7 +64,7 @@ public class EndBlockEntities {
});
return result.toArray(new Block[] {});
}
static Block[] getBarrels() {
List<Block> result = Lists.newArrayList();
EndItems.getModBlocks().forEach((item) -> {
@ -84,7 +77,7 @@ public class EndBlockEntities {
});
return result.toArray(new Block[] {});
}
static Block[] getSigns() {
List<Block> result = Lists.newArrayList();
EndItems.getModBlocks().forEach((item) -> {
@ -97,14 +90,14 @@ public class EndBlockEntities {
});
return result.toArray(new Block[] {});
}
static Block[] getPedestals() {
List<Block> result = Lists.newArrayList();
EndItems.getModBlocks().forEach((item) -> {
if (item instanceof BlockItem) {
Block block = ((BlockItem) item).getBlock();
if (block instanceof EternalPedestal || block instanceof InfusionPedestal)
return;
if (block instanceof EternalPedestal ||
block instanceof InfusionPedestal) return;
if (block instanceof PedestalBlock) {
result.add(block);
}
@ -112,7 +105,7 @@ public class EndBlockEntities {
});
return result.toArray(new Block[] {});
}
static Block[] getFurnaces() {
List<Block> result = Lists.newArrayList();
EndItems.getModBlocks().forEach((item) -> {