More cleanup

This commit is contained in:
Zontreck 2024-02-19 23:27:13 -07:00
parent 302ac87784
commit a220487d66
9 changed files with 162 additions and 168 deletions

View file

@ -3,6 +3,7 @@ package dev.zontreck.otemod.blocks;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
@Deprecated
public class DeprecatedBlock extends Block
{
public DeprecatedBlock(){

View file

@ -11,6 +11,7 @@ import net.minecraft.world.level.block.Block;
import java.util.List;
@Deprecated
public class DeprecatedBlockItem extends BlockItem
{
public DeprecatedBlockItem(Block a)

View file

@ -20,12 +20,14 @@ import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
@Deprecated
public class DeprecatedModBlocks
{
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, OTEMod.MOD_ID);
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, OTEMod.MOD_ID);
private static boolean never(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos) {
return false;
}
@ -34,10 +36,6 @@ public class DeprecatedModBlocks
}
public static final Map<String, RegistryObject<Block>> REGISTERED_BLOCKS;
public static final Map<String, RegistryObject<? extends BlockItem>> REGISTERED_ITEMS;
public static void register(IEventBus bus){
BLOCKS.register(bus);
ITEMS.register(bus);
@ -50,15 +48,12 @@ public class DeprecatedModBlocks
* @param blocky
* @return
*/
public static RegistryObject<Block> registerWithItem(String name, Supplier<Blocky> blocky)
public static RegistryObj registerWithItem(String name, Supplier<Blocky> blocky)
{
RegistryObject<Block> ret = BLOCKS.register(name, ()->blocky.get().block);
var item = CreativeModeTabs.addToOTEModTab(ITEMS.register(name, ()->blocky.get().item));
REGISTERED_BLOCKS.put(name, ret);
REGISTERED_ITEMS.put(name, item);
return ret;
return new RegistryObj(ret,item);
}
/**
@ -68,26 +63,20 @@ public class DeprecatedModBlocks
* @param props
* @return
*/
public static RegistryObject<Block> registerWithItem(String name, Block a, Item.Properties props)
public static RegistryObj registerWithItem(String name, Block a, Item.Properties props)
{
RegistryObject<Block> ret = BLOCKS.register(name, ()->a);
var item = CreativeModeTabs.addToOTEModTab(ITEMS.register(name, ()->new BlockItem(ret.get(), props)));
REGISTERED_BLOCKS.put(name, ret);
REGISTERED_ITEMS.put(name, item);
return ret;
return new RegistryObj(ret,item);
}
public static RegistryObject<Block> registerDeprecated(String name)
public static RegistryObj registerDeprecated(String name)
{
RegistryObject<Block> ret = BLOCKS.register(name, ()->new DeprecatedBlock());
var item = CreativeModeTabs.addToOTEModTab(ITEMS.register(name, ()->new DeprecatedBlockItem(ret.get())));
REGISTERED_BLOCKS.put(name, ret);
REGISTERED_ITEMS.put(name, item);
return ret;
return new RegistryObj(ret,item);
}
private static class Blocky
{
@ -101,28 +90,60 @@ public class DeprecatedModBlocks
}
}
static {
REGISTERED_ITEMS = new HashMap<>();
REGISTERED_BLOCKS=new HashMap<>();
registerDeprecated("ilusium_ore_block");
registerDeprecated("deepslate_ilusium_ore_block");
registerDeprecated("ilusium_block");
registerDeprecated("clear_glass_block");
registerDeprecated("liminal_tiles");
registerDeprecated("black");
registerDeprecated("liminal_tile_stairs");
registerDeprecated("liminal_tile_slab");
registerDeprecated("liminal_window");
registerDeprecated("lime");
registerDeprecated("lime_tile");
registerDeprecated("lime_stairs");
registerDeprecated("lime_tile_br");
registerDeprecated("lime_tile_to_wall");
registerDeprecated("lime_wall_variant_1");
registerDeprecated("lime_wall_variant_2");
private static BlockBehaviour.Properties standardBehavior()
{
return BlockBehaviour.Properties.of().requiresCorrectToolForDrops().strength(7F).destroyTime(6);
}
private static BlockBehaviour.Properties stoneLikeBehavior()
{
return BlockBehaviour.Properties.copy(Blocks.COBBLESTONE);
}
private static BlockBehaviour.Properties explosionResistance()
{
return standardBehavior().explosionResistance(1200);
}
private static BlockBehaviour.Properties noViewBlocking()
{
return standardBehavior().noOcclusion().isViewBlocking(DeprecatedModBlocks::never);
}
private static BlockBehaviour.Properties fullBright()
{
return standardBehavior().lightLevel((X)->{
return 15;
}).noOcclusion();
}
private static BlockBehaviour.Properties standard = standardBehavior();
private static BlockBehaviour.Properties explosionResistance = explosionResistance();
private static BlockBehaviour.Properties noViewBlocking = noViewBlocking();
private static BlockBehaviour.Properties stone = stoneLikeBehavior();
private static BlockBehaviour.Properties poolLightClean = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 15);
private static BlockBehaviour.Properties poolLightDirty = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 12);
private static BlockBehaviour.Properties poolLightFilthy = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 4);
public static final RegistryObj ILUSIUM_ORE_BLOCK = registerDeprecated("ilusium_ore_block");
public static final RegistryObj DEEPSLATE_ILUSIUM_ORE_BLOCK = registerDeprecated("deepslate_ilusium_ore_block");
public static final RegistryObj ILUSIUM_BLOCK = registerDeprecated("ilusium_block");
public static final RegistryObj CLEAR_GLASS_BLOCK = registerDeprecated("clear_glass_block");
public static final RegistryObj LIMINAL_TILES = registerDeprecated("liminal_tiles");
public static final RegistryObj BLACK = registerDeprecated("black");
public static final RegistryObj LIMINAL_TILE_STAIRS = registerDeprecated("liminal_tile_stairs");
public static final RegistryObj LIMINAL_TILE_SLAB = registerDeprecated("liminal_tile_slab");
public static final RegistryObj LIMINAL_WINDOW = registerDeprecated("liminal_window");
public static final RegistryObj LIME = registerDeprecated("lime");
public static final RegistryObj LIME_TILE = registerDeprecated("lime_tile");
public static final RegistryObj LIME_STAIRS = registerDeprecated("lime_stairs");
public static final RegistryObj LIME_TILE_BR = registerDeprecated("lime_tile_br");
public static final RegistryObj LIME_TILE_TO_WALL = registerDeprecated("lime_tile_to_wall");
public static final RegistryObj LIME_WALL_V1 = registerDeprecated("lime_wall_variant_1");
public static final RegistryObj LIME_WALL_V2 = registerDeprecated("lime_wall_variant_2");
}

View file

@ -4,10 +4,8 @@ import dev.zontreck.otemod.OTEMod;
import dev.zontreck.otemod.implementation.CreativeModeTabs;
import net.minecraft.core.BlockPos;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.FlintAndSteelItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
@ -16,8 +14,6 @@ import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
public class ModBlocks {
@ -31,8 +27,6 @@ public class ModBlocks {
return true;
}
public static final Map<String, RegistryObject<Block>> REGISTERED_BLOCKS;
public static final Map<String, RegistryObject<? extends BlockItem>> REGISTERED_ITEMS;
public static void register(IEventBus bus){
@ -47,15 +41,12 @@ public class ModBlocks {
* @param blocky
* @return
*/
public static RegistryObject<Block> registerWithItem(String name, Supplier<Blocky> blocky)
public static RegistryObj registerWithItem(String name, Supplier<Blocky> blocky)
{
RegistryObject<Block> ret = BLOCKS.register(name, ()->blocky.get().block);
var item = CreativeModeTabs.addToOTEModTab(ITEMS.register(name, ()->blocky.get().item));
REGISTERED_BLOCKS.put(name, ret);
REGISTERED_ITEMS.put(name, item);
return ret;
return new RegistryObj(ret,item);
}
/**
@ -65,26 +56,20 @@ public class ModBlocks {
* @param props
* @return
*/
public static RegistryObject<Block> registerWithItem(String name, Block a, Item.Properties props)
public static RegistryObj registerWithItem(String name, Block a, Item.Properties props)
{
RegistryObject<Block> ret = BLOCKS.register(name, ()->a);
var item = CreativeModeTabs.addToOTEModTab(ITEMS.register(name, ()->new BlockItem(ret.get(), props)));
REGISTERED_BLOCKS.put(name, ret);
REGISTERED_ITEMS.put(name, item);
return ret;
return new RegistryObj(ret,item);
}
public static RegistryObject<Block> registerDeprecated(String name)
public static RegistryObj registerDeprecated(String name)
{
RegistryObject<Block> ret = BLOCKS.register(name, ()->new DeprecatedBlock());
var item = CreativeModeTabs.addToOTEModTab(ITEMS.register(name, ()->new DeprecatedBlockItem(ret.get())));
REGISTERED_BLOCKS.put(name, ret);
REGISTERED_ITEMS.put(name, item);
return ret;
return new RegistryObj(ret,item);
}
private static class Blocky
{
@ -97,19 +82,6 @@ public class ModBlocks {
this.item=item;
}
}
public static Block getModdedBlock(String name)
{
if(REGISTERED_BLOCKS.containsKey(name)) return REGISTERED_BLOCKS.get(name).get();
return null;
}
public static BlockItem getModdedBlockItem(String name)
{
if(REGISTERED_ITEMS.containsKey(name)) return REGISTERED_ITEMS.get(name).get();
return null;
}
private static BlockBehaviour.Properties standardBehavior()
{
@ -137,139 +109,120 @@ public class ModBlocks {
}).noOcclusion();
}
static {
REGISTERED_BLOCKS = new HashMap<>();
REGISTERED_ITEMS = new HashMap<>();
private static BlockBehaviour.Properties standard = standardBehavior();
BlockBehaviour.Properties standard = standardBehavior();
private static BlockBehaviour.Properties explosionResistance = explosionResistance();
BlockBehaviour.Properties explosionResistance = explosionResistance();
private static BlockBehaviour.Properties noViewBlocking = noViewBlocking();
BlockBehaviour.Properties noViewBlocking = noViewBlocking();
private static BlockBehaviour.Properties stone = stoneLikeBehavior();
BlockBehaviour.Properties stone = stoneLikeBehavior();
private static BlockBehaviour.Properties poolLightClean = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 15);
private static BlockBehaviour.Properties poolLightDirty = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 12);
private static BlockBehaviour.Properties poolLightFilthy = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 4);
BlockBehaviour.Properties poolLightClean = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 15);
BlockBehaviour.Properties poolLightDirty = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 12);
BlockBehaviour.Properties poolLightFilthy = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 4);
public static final RegistryObj ETERNIUM_ORE_BLOCK = registerWithItem("eternium_ore_block", new DropExperienceBlock(explosionResistance), new Item.Properties());
registerWithItem("eternium_ore_block", new Block(explosionResistance), new Item.Properties());
public static final RegistryObj VAULT_STEEL_ORE_BLOCK = registerWithItem("vault_steel_ore_block", new DropExperienceBlock(explosionResistance), new Item.Properties());
registerWithItem("vault_steel_ore_block", new Block(explosionResistance), new Item.Properties());
public static final RegistryObj NETHER_VAULT_STEEL_ORE_BLOCK = registerWithItem("nether_vault_steel_ore_block", new DropExperienceBlock(explosionResistance), new Item.Properties());
registerWithItem("nether_vault_steel_ore_block", new Block(explosionResistance), new Item.Properties());
public static final RegistryObj ETERNIUM_BLOCK = registerWithItem("eternium_block", new Block(explosionResistance), new Item.Properties());
public static final RegistryObj DEEPSLATE_ETERNIUM_ORE_BLOCK = registerWithItem("deepslate_eternium_ore_block", new DropExperienceBlock(explosionResistance), new Item.Properties());
public static final RegistryObj ITEM_SCRUBBER = registerWithItem("item_scrubber", new ItemScrubberBlock(noViewBlocking), new Item.Properties());
public static final RegistryObj MAGICAL_SCRUBBER = registerWithItem("magical_scrubber", new MagicalScrubberBlock(noViewBlocking), new Item.Properties());
public static final RegistryObj STABLE_SINGULARITY = registerWithItem("stable_singularity", new Block(noViewBlocking), new Item.Properties());
public static final RegistryObj COMPRESSION_CHAMBER = registerWithItem("compression_chamber", new CompressionChamberBlock(noViewBlocking), new Item.Properties());
public static final RegistryObj COMPRESSED_OBSIDIAN_BLOCK = registerWithItem("compressed_obsidian_block", new Block(BlockBehaviour.Properties.copy(Blocks.OBSIDIAN)), new Item.Properties());
public static final RegistryObj LAYERED_COMPRESSED_OBSIDIAN_BLOCK = registerWithItem("layered_compressed_obsidian_block", new Block(BlockBehaviour.Properties.copy(Blocks.OBSIDIAN)), new Item.Properties());
public static final RegistryObj VOID = registerWithItem("void", new Block(fullBright().noCollission()), new Item.Properties());
public static final RegistryObj WHITEOUT = registerWithItem("whiteout", new Block(fullBright().noCollission()), new Item.Properties());
public static final RegistryObj BLOOD_RED = registerWithItem("blood_red", new Block(fullBright()), new Item.Properties());
public static final RegistryObj RED_TILE = registerWithItem("red_tile", new Block(fullBright()), new Item.Properties());
public static final RegistryObj RED_STAIRS = registerWithItem("red_stairs", new StairBlock(BLOOD_RED.block.get()::defaultBlockState, fullBright()), new Item.Properties());
public static final RegistryObj RED_TILE_BR = registerWithItem("red_tile_br", new RotatableBlock(fullBright()), new Item.Properties());
registerWithItem("eternium_block", new Block(explosionResistance), new Item.Properties());
public static final RegistryObj RED_TILE_TO_WALL = registerWithItem("red_tile_to_wall", new Block(fullBright()), new Item.Properties());
registerWithItem("deepslate_eternium_ore_block", new Block(explosionResistance), new Item.Properties());
public static final RegistryObj RED_WALL_V1 = registerWithItem("red_wall_variant_1", new Block(fullBright()), new Item.Properties());
registerWithItem("item_scrubber", new ItemScrubberBlock(noViewBlocking), new Item.Properties());
public static final RegistryObj RED_WALL_V2 = registerWithItem("red_wall_variant_2", new Block(fullBright()), new Item.Properties());
registerWithItem("magical_scrubber", new MagicalScrubberBlock(noViewBlocking), new Item.Properties());
public static final RegistryObj CYAN = registerWithItem("cyan", new Block(fullBright()), new Item.Properties());
registerWithItem("stable_singularity", new Block(noViewBlocking), new Item.Properties());
public static final RegistryObj CYAN_TILE = registerWithItem("cyan_tile", new Block(fullBright()), new Item.Properties());
registerWithItem("compression_chamber", new CompressionChamberBlock(noViewBlocking), new Item.Properties());
public static final RegistryObj CYAN_STAIRS = registerWithItem("cyan_stairs", new StairBlock(CYAN.block.get()::defaultBlockState, fullBright()), new Item.Properties());
registerWithItem("compressed_obsidian_block", new Block(BlockBehaviour.Properties.copy(Blocks.OBSIDIAN)), new Item.Properties());
public static final RegistryObj CYAN_TILE_BR = registerWithItem("cyan_tile_br", new RotatableBlock(fullBright()), new Item.Properties());
registerWithItem("layered_compressed_obsidian_block", new Block(BlockBehaviour.Properties.copy(Blocks.OBSIDIAN)), new Item.Properties());
public static final RegistryObj CYAN_TILE_TO_WALL = registerWithItem("cyan_tile_to_wall", new Block(fullBright()), new Item.Properties());
registerWithItem("void", new Block(fullBright().noCollission()), new Item.Properties());
public static final RegistryObj CYAN_WALL_V1 = registerWithItem("cyan_wall_variant_1", new Block(fullBright()), new Item.Properties());
registerWithItem("whiteout", new Block(fullBright().noCollission()), new Item.Properties());
public static final RegistryObj CYAN_WALL_V2 = registerWithItem("cyan_wall_variant_2", new Block(fullBright()), new Item.Properties());
registerWithItem("blood_red", new Block(fullBright()), new Item.Properties());
public static final RegistryObj POOL_TILE = registerWithItem("pool_tile", new Block(stone), new Item.Properties());
registerWithItem("red_tile", new Block(fullBright()), new Item.Properties());
public static final RegistryObj POOL_TILE_STAIRS = registerWithItem("pool_tile_stairs", new StairBlock(POOL_TILE.block.get()::defaultBlockState, stone), new Item.Properties());
registerWithItem("red_stairs", new StairBlock(getModdedBlock("blood_red")::defaultBlockState, fullBright()), new Item.Properties());
public static final RegistryObj POOL_TILE_SLAB = registerWithItem("pool_tile_slab", new SlabBlock(stone), new Item.Properties());
registerWithItem("red_tile_br", new RotatableBlock(fullBright()), new Item.Properties());
public static final RegistryObj POOL_LIGHT = registerWithItem("pool_light", new Block(poolLightClean), new Item.Properties());
registerWithItem("red_tile_to_wall", new Block(fullBright()), new Item.Properties());
public static final RegistryObj DIRTY_POOL_TILE = registerWithItem("dirty_pool_tile", new Block(stone), new Item.Properties());
registerWithItem("red_wall_variant_1", new Block(fullBright()), new Item.Properties());
public static final RegistryObj DIRTY_POOL_TILE_STAIRS = registerWithItem("dirty_pool_tile_stairs", new StairBlock(DIRTY_POOL_TILE.block.get()::defaultBlockState, stone), new Item.Properties());
registerWithItem("red_wall_variant_2", new Block(fullBright()), new Item.Properties());
public static final RegistryObj DIRTY_POOL_TILE_SLAB = registerWithItem("dirty_pool_tile_slab", new SlabBlock(stone), new Item.Properties());
registerWithItem("cyan", new Block(fullBright()), new Item.Properties());
public static final RegistryObj DIRTY_POOL_LIGHT = registerWithItem("dirty_pool_light", new Block(poolLightDirty), new Item.Properties());
registerWithItem("cyan_tile", new Block(fullBright()), new Item.Properties());
public static final RegistryObj FILTHY_POOL_LIGHT = registerWithItem("filthy_pool_light", new Block(poolLightFilthy), new Item.Properties());
registerWithItem("cyan_stairs", new StairBlock(getModdedBlock("cyan")::defaultBlockState, fullBright()), new Item.Properties());
public static final RegistryObj DARK_POOL_TILE = registerWithItem("dark_pool_tile", new Block(stone), new Item.Properties());
registerWithItem("cyan_tile_br", new RotatableBlock(fullBright()), new Item.Properties());
public static final RegistryObj DARK_POOL_LIGHT = registerWithItem("dark_pool_light", new Block(poolLightClean), new Item.Properties());
registerWithItem("cyan_tile_to_wall", new Block(fullBright()), new Item.Properties());
public static final RegistryObj DARK_POOL_TILE_STAIRS = registerWithItem("dark_pool_tile_stairs", new StairBlock(DARK_POOL_TILE.block.get()::defaultBlockState, stone), new Item.Properties());
registerWithItem("cyan_wall_variant_1", new Block(fullBright()), new Item.Properties());
public static final RegistryObj DARK_POOL_TILE_SLAB = registerWithItem("dark_pool_tile_slab", new SlabBlock(stone), new Item.Properties());
registerWithItem("cyan_wall_variant_2", new Block(fullBright()), new Item.Properties());
public static final RegistryObj BLUE_POOL_TILE = registerWithItem("blue_pool_tile", new Block(stone), new Item.Properties());
registerWithItem("pool_tile", new Block(stone), new Item.Properties());
public static final RegistryObj BLUE_POOL_TILE_STAIRS = registerWithItem("blue_pool_tile_stairs", new StairBlock(BLUE_POOL_TILE.block.get()::defaultBlockState, stone), new Item.Properties());
registerWithItem("pool_tile_stairs", new StairBlock(getModdedBlock("pool_tile")::defaultBlockState, stone), new Item.Properties());
public static final RegistryObj BLUE_POOL_TILE_SLAB = registerWithItem("blue_pool_tile_slab", new SlabBlock(stone), new Item.Properties());
registerWithItem("pool_tile_slab", new SlabBlock(stone), new Item.Properties());
public static final RegistryObj BLUE_POOL_LIGHT = registerWithItem("blue_pool_light", new Block(poolLightClean), new Item.Properties());
registerWithItem("pool_light", new Block(poolLightClean), new Item.Properties());
public static final RegistryObj DIRTY_BLUE_POOL_TILE = registerWithItem("dirty_blue_pool_tile", new Block(stone), new Item.Properties());
registerWithItem("dirty_pool_tile", new Block(stone), new Item.Properties());
public static final RegistryObj DIRTY_BLUE_POOL_TILE_STAIRS = registerWithItem("dirty_blue_pool_tile_stairs", new StairBlock(DIRTY_BLUE_POOL_TILE.block.get()::defaultBlockState, stone), new Item.Properties());
registerWithItem("dirty_pool_tile_stairs", new StairBlock(getModdedBlock("dirty_pool_tile")::defaultBlockState, stone), new Item.Properties());
public static final RegistryObj DIRTY_BLUE_POOL_TILE_SLAB = registerWithItem("dirty_blue_pool_tile_slab", new SlabBlock(stone), new Item.Properties());
registerWithItem("dirty_pool_tile_slab", new SlabBlock(stone), new Item.Properties());
public static final RegistryObj DIRTY_BLUE_POOL_LIGHT = registerWithItem("dirty_blue_pool_light", new Block(poolLightDirty), new Item.Properties());
registerWithItem("dirty_pool_light", new Block(poolLightDirty), new Item.Properties());
public static final RegistryObj FILTHY_BLUE_POOL_LIGHT = registerWithItem("filthy_blue_pool_light", new Block(poolLightFilthy), new Item.Properties());
registerWithItem("filthy_pool_light", new Block(poolLightFilthy), new Item.Properties());
public static final RegistryObj RED_POOL_TILE = registerWithItem("red_pool_tile", new Block(stone), new Item.Properties());
registerWithItem("dark_pool_tile", new Block(stone), new Item.Properties());
public static final RegistryObj RED_POOL_TILE_STAIRS = registerWithItem("red_pool_tile_stairs", new StairBlock(RED_POOL_TILE.block.get()::defaultBlockState, stone), new Item.Properties());
registerWithItem("dark_pool_light", new Block(poolLightClean), new Item.Properties());
public static final RegistryObj RED_POOL_TILE_SLAB = registerWithItem("red_pool_tile_slab", new SlabBlock(stone), new Item.Properties());
registerWithItem("dark_pool_tile_stairs", new StairBlock(getModdedBlock("dark_pool_tile")::defaultBlockState, stone), new Item.Properties());
public static final RegistryObj RED_POOL_LIGHT = registerWithItem("red_pool_light", new Block(poolLightClean), new Item.Properties());
registerWithItem("dark_pool_tile_slab", new SlabBlock(stone), new Item.Properties());
public static final RegistryObj DIRTY_RED_POOL_TILE = registerWithItem("dirty_red_pool_tile", new Block(stone), new Item.Properties());
registerWithItem("blue_pool_tile", new Block(stone), new Item.Properties());
public static final RegistryObj DIRTY_RED_POOL_LIGHT = registerWithItem("dirty_red_pool_light", new Block(poolLightDirty), new Item.Properties());
registerWithItem("blue_pool_tile_stairs", new StairBlock(getModdedBlock("blue_pool_tile")::defaultBlockState, stone), new Item.Properties());
public static final RegistryObj FILTHY_RED_POOL_LIGHT = registerWithItem("filthy_red_pool_light", new Block(poolLightFilthy), new Item.Properties());
registerWithItem("blue_pool_tile_slab", new SlabBlock(stone), new Item.Properties());
public static final RegistryObj DIRTY_RED_POOL_TILE_STAIRS = registerWithItem("dirty_red_pool_tile_stairs", new StairBlock(DIRTY_RED_POOL_TILE.block.get()::defaultBlockState, stone), new Item.Properties());
registerWithItem("blue_pool_light", new Block(poolLightClean), new Item.Properties());
public static final RegistryObj DIRTY_RED_POOL_TILE_SLAB = registerWithItem("dirty_red_pool_tile_slab", new SlabBlock(stone), new Item.Properties());
registerWithItem("dirty_red_pool_light", new Block(poolLightDirty), new Item.Properties());
registerWithItem("filthy_red_pool_light", new Block(poolLightFilthy), new Item.Properties());
registerWithItem("dirty_blue_pool_tile", new Block(stone), new Item.Properties());
registerWithItem("dirty_blue_pool_tile_stairs", new StairBlock(getModdedBlock("dirty_blue_pool_tile")::defaultBlockState, stone), new Item.Properties());
registerWithItem("dirty_blue_pool_tile_slab", new SlabBlock(stone), new Item.Properties());
registerWithItem("dirty_blue_pool_light", new Block(poolLightDirty), new Item.Properties());
registerWithItem("filthy_blue_pool_light", new Block(poolLightFilthy), new Item.Properties());
registerWithItem("red_pool_tile", new Block(stone), new Item.Properties());
registerWithItem("red_pool_tile_stairs", new StairBlock(getModdedBlock("red_pool_tile")::defaultBlockState, stone), new Item.Properties());
registerWithItem("red_pool_tile_slab", new SlabBlock(stone), new Item.Properties());
registerWithItem("red_pool_light", new Block(poolLightClean), new Item.Properties());
registerWithItem("dirty_red_pool_tile", new Block(stone), new Item.Properties());
registerWithItem("dirty_red_pool_tile_stairs", new StairBlock(getModdedBlock("dirty_red_pool_tile")::defaultBlockState, stone), new Item.Properties());
registerWithItem("dirty_red_pool_tile_slab", new SlabBlock(stone), new Item.Properties());
}
}

View file

@ -0,0 +1,18 @@
package dev.zontreck.otemod.blocks;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.registries.RegistryObject;
public class RegistryObj
{
public RegistryObject<Block> block;
public RegistryObject<? extends Item> item;
public RegistryObj(RegistryObject<Block> blk, RegistryObject<? extends Item> item)
{
this.block=blk;
this.item=item;
}
}

View file

@ -14,15 +14,15 @@ public class ModEntities {
public static final DeferredRegister<BlockEntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, OTEMod.MOD_ID);
public static final RegistryObject <BlockEntityType <ItemScrubberBlockEntity>> ITEM_SCRUBBER = ENTITIES.register("item_scrubber", ()-> BlockEntityType.Builder.of(ItemScrubberBlockEntity::new, ModBlocks.ITEM_SCRUBBER.get()).build(null));
public static final RegistryObject <BlockEntityType <ItemScrubberBlockEntity>> ITEM_SCRUBBER = ENTITIES.register("item_scrubber", ()-> BlockEntityType.Builder.of(ItemScrubberBlockEntity::new, ModBlocks.ITEM_SCRUBBER.block.get()).build(null));
public static final RegistryObject <BlockEntityType <MagicalScrubberBlockEntity>> MAGICAL_SCRUBBER = ENTITIES.register("magical_scrubber", ()-> BlockEntityType.Builder.of(MagicalScrubberBlockEntity::new, ModBlocks.MAGICAL_SCRUBBER.get()).build(null));
public static final RegistryObject <BlockEntityType <MagicalScrubberBlockEntity>> MAGICAL_SCRUBBER = ENTITIES.register("magical_scrubber", ()-> BlockEntityType.Builder.of(MagicalScrubberBlockEntity::new, ModBlocks.MAGICAL_SCRUBBER.block.get()).build(null));
public static final ResourceLocation PARALLAX_BLOCK = new ResourceLocation(OTEMod.MOD_ID, "parallax_block");
//public static final ResourceLocation PARALLAX_BLOCK = new ResourceLocation(OTEMod.MOD_ID, "parallax_block");
public static final RegistryObject<BlockEntityType<CompressionChamberBlockEntity>> COMPRESSION_CHAMBER = ENTITIES.register("compression_chamber", ()->BlockEntityType.Builder.of(CompressionChamberBlockEntity::new, ModBlocks.COMPRESSION_CHAMBER_BLOCK.get()).build(null));
public static final RegistryObject<BlockEntityType<CompressionChamberBlockEntity>> COMPRESSION_CHAMBER = ENTITIES.register("compression_chamber", ()->BlockEntityType.Builder.of(CompressionChamberBlockEntity::new, ModBlocks.COMPRESSION_CHAMBER.block.get()).build(null));
public static final RegistryObject <BlockEntityType <ParallaxWindowEntity>> PARALLAX_WINDOW_ENTITY = ENTITIES.register("parallax_window", ()->BlockEntityType.Builder.of(ParallaxWindowEntity::new, ModBlocks.LIMINAL_WINDOW.get()).build(null));
//public static final RegistryObject <BlockEntityType <ParallaxWindowEntity>> PARALLAX_WINDOW_ENTITY = ENTITIES.register("parallax_window", ()->BlockEntityType.Builder.of(ParallaxWindowEntity::new, ModBlocks.LIMINAL_WINDOW.get()).build(null));
public static void register(IEventBus eventBus)

View file

@ -133,7 +133,7 @@ public class CompressionChamberMenu extends AbstractContainerMenu
@Override
public boolean stillValid(Player player) {
return stillValid(ContainerLevelAccess.create(level, entity.getBlockPos()), player, ModBlocks.COMPRESSION_CHAMBER_BLOCK.get());
return stillValid(ContainerLevelAccess.create(level, entity.getBlockPos()), player, ModBlocks.COMPRESSION_CHAMBER.block.get());
}
private static final int PLAYER_INVENTORY_FIRST_SLOT_HEIGHT = 85;

View file

@ -124,7 +124,7 @@ public class ItemScrubberMenu extends AbstractContainerMenu
@Override
public boolean stillValid(Player player) {
return stillValid(ContainerLevelAccess.create(level, entity.getBlockPos()), player, ModBlocks.ITEM_SCRUBBER.get());
return stillValid(ContainerLevelAccess.create(level, entity.getBlockPos()), player, ModBlocks.ITEM_SCRUBBER.block.get());
}
private static final int PLAYER_INVENTORY_FIRST_SLOT_HEIGHT = 69;

View file

@ -124,7 +124,7 @@ public class MagicalScrubberMenu extends AbstractContainerMenu
@Override
public boolean stillValid(Player player) {
return stillValid(ContainerLevelAccess.create(level, entity.getBlockPos()), player, ModBlocks.MAGICAL_SCRUBBER.get());
return stillValid(ContainerLevelAccess.create(level, entity.getBlockPos()), player, ModBlocks.MAGICAL_SCRUBBER.block.get());
}
private static final int PLAYER_INVENTORY_FIRST_SLOT_HEIGHT = 69;