mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Merge remote-tracking branch 'origin/1.16' into 1.16
This commit is contained in:
commit
ab166cb0e4
50 changed files with 797 additions and 477 deletions
|
@ -28,10 +28,10 @@ public class BlockRecipeGenerator extends RecipeProvider {
|
|||
//Farmer
|
||||
Recipe.shaped(ActuallyBlocks.FARMER.get())
|
||||
.pattern("ISI", "SCS", "ISI")
|
||||
.define('I', ActuallyBlocks.CRYSTAL_ENORI.get())
|
||||
.define('C', ActuallyBlocks.IRON_CASING.get())
|
||||
.define('S', Tags.Items.SEEDS)
|
||||
.save(consumer);
|
||||
.key('I', ActuallyBlocks.ENORI_CRYSTAL.getItem())
|
||||
.key('C', ActuallyBlocks.IRON_CASING.get())
|
||||
.key('S', Tags.Items.SEEDS)
|
||||
.build(consumer);
|
||||
|
||||
//Empowerer
|
||||
Recipe.shaped(ActuallyBlocks.EMPOWERER.get())
|
||||
|
@ -76,7 +76,7 @@ public class BlockRecipeGenerator extends RecipeProvider {
|
|||
.save(consumer);
|
||||
|
||||
//Vertical Digger
|
||||
Recipe.shaped(ActuallyBlocks.MINER.get())
|
||||
Recipe.shaped(ActuallyBlocks.Vertical_DIGGER.get())
|
||||
.pattern("IRI", "RCR", "IDI")
|
||||
.define('R', Tags.Items.STORAGE_BLOCKS_REDSTONE)
|
||||
.define('I', ActuallyBlocks.IRON_CASING.get())
|
||||
|
@ -132,15 +132,59 @@ public class BlockRecipeGenerator extends RecipeProvider {
|
|||
// Atomic Reconstructor
|
||||
Recipe.shaped(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.get())
|
||||
.pattern("IRI", "RCR", "IRI")
|
||||
.define('R', Tags.Items.DUSTS_REDSTONE)
|
||||
.define('I', Tags.Items.INGOTS_IRON)
|
||||
.define('C', ActuallyBlocks.IRON_CASING.get())
|
||||
.save(consumer);
|
||||
.key('R', Tags.Items.DUSTS_REDSTONE)
|
||||
.key('I', Tags.Items.INGOTS_IRON)
|
||||
.key('C', ActuallyBlocks.IRON_CASING.get())
|
||||
.build(consumer);
|
||||
|
||||
// Laser Relay
|
||||
Recipe.shaped(ActuallyBlocks.LASER_RELAY.get(), 4)
|
||||
.pattern("OBO","RCR","OBO")
|
||||
.key('B', Tags.Items.STORAGE_BLOCKS_REDSTONE)
|
||||
.key('O', Tags.Items.OBSIDIAN)
|
||||
.key('R', ActuallyItems.RESTONIA_CRYSTAL.get())
|
||||
.key('C', ActuallyItems.COIL_ADVANCED.get())
|
||||
.build(consumer);
|
||||
|
||||
// Advanced Laser Relay
|
||||
Recipe.shaped(ActuallyBlocks.LASER_RELAY_ADVANCED.get())
|
||||
.pattern(" I ", "XRX", " I ")
|
||||
.key('I', ActuallyItems.ENORI_CRYSTAL.get())
|
||||
.key('R', ActuallyBlocks.LASER_RELAY.get())
|
||||
.key('X', ActuallyItems.RESTONIA_CRYSTAL.get())
|
||||
.build(consumer);
|
||||
|
||||
// Extreme Laser Relay
|
||||
Recipe.shaped(ActuallyBlocks.LASER_RELAY_EXTREME.get())
|
||||
.pattern(" I ", "XRX", " I ")
|
||||
.key('I', ActuallyItems.DIAMATINE_EMPOWERED_CRYSTAL.get())
|
||||
.key('R', ActuallyBlocks.LASER_RELAY_ADVANCED.get())
|
||||
.key('X', ActuallyItems.RESTONIA_CRYSTAL.get())
|
||||
.build(consumer);
|
||||
|
||||
// Whitelist Item Laser Relay
|
||||
Recipe.shapeless(ActuallyBlocks.LASER_RELAY_ITEM_ADVANCED.get())
|
||||
.ingredients(ActuallyBlocks.LASER_RELAY_ITEM.get(), ActuallyItems.COIL_ADVANCED.get(), ActuallyItems.BLACK_QUARTZ.get())
|
||||
.build(consumer);
|
||||
|
||||
// Item Interface
|
||||
Recipe.shaped(ActuallyBlocks.ITEM_VIEWER.get())
|
||||
.pattern("OBO", "RCR", "OBO")
|
||||
.key('B', Tags.Items.DUSTS_REDSTONE)
|
||||
.key('O', ActuallyItems.COIL.get())
|
||||
.key('R', ActuallyItems.RESTONIA_CRYSTAL.get())
|
||||
.key('C', Tags.Items.CHESTS_WOODEN)
|
||||
.build(consumer);
|
||||
|
||||
// Hopping Item Interface
|
||||
Recipe.shapeless(ActuallyBlocks.ITEM_VIEWER_HOPPING.get()).ingredients(ActuallyBlocks.ITEM_VIEWER.get()).build(consumer);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void saveAdvancement(DirectoryCache cache, JsonObject cache2, Path advancementJson) {
|
||||
//Nope...
|
||||
protected void saveRecipeAdvancement(DirectoryCache cache, JsonObject cache2, Path advancementJson) {
|
||||
//Nope... maybe later...
|
||||
}
|
||||
|
||||
public static class Recipe {
|
||||
|
|
|
@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.data.WorldData;
|
|||
import de.ellpeck.actuallyadditions.mod.entity.InitEntities;
|
||||
import de.ellpeck.actuallyadditions.mod.event.CommonEvents;
|
||||
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
||||
import de.ellpeck.actuallyadditions.mod.gen.AAWorldGen;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ActuallyContainers;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ItemCoffee;
|
||||
|
@ -82,7 +81,7 @@ public class ActuallyAdditions {
|
|||
IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus();
|
||||
|
||||
ActuallyBlocks.BLOCKS.register(eventBus);
|
||||
ActuallyTiles.TILES.register(eventBus);
|
||||
ActuallyBlocks.TILES.register(eventBus);
|
||||
ActuallyContainers.CONTAINERS.register(eventBus);
|
||||
|
||||
MinecraftForge.EVENT_BUS.addListener(this::serverStarted);
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package de.ellpeck.actuallyadditions.mod.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.BlockItem;
|
||||
|
||||
public class AABlockItem extends BlockItem {
|
||||
public AABlockItem(Block blockIn, Properties builder) {
|
||||
super(blockIn, builder);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package de.ellpeck.actuallyadditions.mod.blocks;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SlabBlock;
|
||||
import net.minecraft.block.StairsBlock;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* Using a custom class here to declare common rules between all of our blocks.
|
||||
* This also provides a simple instance of check for our blocks.
|
||||
*
|
||||
* @implNote Every block should extend this class in some form or use the {@link IActuallyBlock}
|
||||
*/
|
||||
public class ActuallyBlock extends Block implements IActuallyBlock {
|
||||
public ActuallyBlock(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AABlockItem createBlockItem() {
|
||||
return new AABlockItem(this, this.getItemProperties());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item.Properties getItemProperties() {
|
||||
return new Item.Properties().group(ActuallyAdditions.GROUP);
|
||||
}
|
||||
|
||||
public static class Stairs extends StairsBlock implements IActuallyBlock {
|
||||
public Stairs(Supplier<BlockState> state, Properties properties) {
|
||||
super(state, properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AABlockItem createBlockItem() {
|
||||
return new AABlockItem(this, this.getItemProperties());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item.Properties getItemProperties() {
|
||||
return new Item.Properties().group(ActuallyAdditions.GROUP);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Slabs extends SlabBlock implements IActuallyBlock {
|
||||
public Slabs(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AABlockItem createBlockItem() {
|
||||
return new AABlockItem(this, this.getItemProperties());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item.Properties getItemProperties() {
|
||||
return new Item.Properties().group(ActuallyAdditions.GROUP);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,9 +13,13 @@ package de.ellpeck.actuallyadditions.mod.blocks;
|
|||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||
import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals;
|
||||
import de.ellpeck.actuallyadditions.mod.items.metalists.Crystals;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.*;
|
||||
import de.ellpeck.actuallyadditions.registration.AABlockReg;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.common.ToolType;
|
||||
import net.minecraftforge.fml.RegistryObject;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
|
@ -23,134 +27,247 @@ import net.minecraftforge.registries.ForgeRegistries;
|
|||
|
||||
public final class ActuallyBlocks {
|
||||
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, ActuallyAdditions.MODID);
|
||||
public static final DeferredRegister<TileEntityType<?>> TILES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, ActuallyAdditions.MODID);
|
||||
|
||||
public static final AbstractBlock.Properties miscBlockProperties = AbstractBlock.Properties.of(Material.STONE).harvestLevel(1).harvestTool(ToolType.PICKAXE).strength(1.5f, 10f);
|
||||
@Deprecated
|
||||
public static final RegistryObject<Block> blockMisc = BLOCKS.register("misc", () -> new Block(miscBlockProperties)); // TODO this isnt a real block?
|
||||
public static final RegistryObject<Block> WOOD_CASING = BLOCKS.register("wood_casing", () -> new Block(miscBlockProperties));
|
||||
public static final RegistryObject<Block> IRON_CASING = BLOCKS.register("iron_casing", () -> new Block(miscBlockProperties));
|
||||
public static final RegistryObject<Block> ENDER_CASING = BLOCKS.register("ender_casing", () -> new Block(miscBlockProperties));
|
||||
public static final RegistryObject<Block> LAVA_CASING = BLOCKS.register("lava_casing", () -> new Block(miscBlockProperties));
|
||||
public static final RegistryObject<Block> WILD_PLANT = BLOCKS.register("wild", BlockWildPlant::new);
|
||||
public static final RegistryObject<Block> FEEDER = BLOCKS.register("feeder", BlockFeeder::new);
|
||||
public static final RegistryObject<Block> GRINDER = BLOCKS.register("grinder", () -> new BlockGrinder(false));
|
||||
public static final RegistryObject<Block> GRINDER_DOUBLE = BLOCKS.register("grinder_double", () -> new BlockGrinder(true));
|
||||
|
||||
public static final RegistryObject<Block> CRYSTAL_CLUSTER_REDSTONE = BLOCKS.register("crystal_cluster_redstone", () -> new BlockCrystalCluster(TheCrystals.REDSTONE));
|
||||
public static final RegistryObject<Block> CRYSTAL_CLUSTER_LAPIS = BLOCKS.register("crystal_cluster_lapis", () -> new BlockCrystalCluster(TheCrystals.LAPIS));
|
||||
public static final RegistryObject<Block> CRYSTAL_CLUSTER_DIAMOND = BLOCKS.register("crystal_cluster_diamond", () -> new BlockCrystalCluster(TheCrystals.DIAMOND));
|
||||
public static final RegistryObject<Block> CRYSTAL_CLUSTER_COAL = BLOCKS.register("crystal_cluster_coal", () -> new BlockCrystalCluster(TheCrystals.COAL));
|
||||
public static final RegistryObject<Block> CRYSTAL_CLUSTER_EMERALD = BLOCKS.register("crystal_cluster_emerald", () -> new BlockCrystalCluster(TheCrystals.EMERALD));
|
||||
public static final RegistryObject<Block> CRYSTAL_CLUSTER_IRON = BLOCKS.register("crystal_cluster_iron", () -> new BlockCrystalCluster(TheCrystals.IRON));
|
||||
public static final RegistryObject<Block> BATTERY_BOX = BLOCKS.register("battery_box", BlockBatteryBox::new);
|
||||
public static final RegistryObject<Block> ITEM_VIEWER_HOPPING = BLOCKS.register("item_viewer_hopping", BlockItemViewerHopping::new);
|
||||
public static final RegistryObject<Block> FARMER = BLOCKS.register("farmer", BlockFarmer::new);
|
||||
public static final RegistryObject<Block> BIOREACTOR = BLOCKS.register("bio_reactor", BlockBioReactor::new);
|
||||
public static final RegistryObject<Block> EMPOWERER = BLOCKS.register("empowerer", BlockEmpowerer::new);
|
||||
public static final RegistryObject<Block> TINY_TORCH = BLOCKS.register("tiny_torch", BlockTinyTorch::new);
|
||||
public static final RegistryObject<Block> SHOCK_SUPPRESSOR = BLOCKS.register("shock_suppressor", BlockShockSuppressor::new);
|
||||
public static final RegistryObject<Block> DISPLAY_STAND = BLOCKS.register("display_stand", BlockDisplayStand::new);
|
||||
public static final RegistryObject<Block> PLAYER_INTERFACE = BLOCKS.register("player_interface", BlockPlayerInterface::new);
|
||||
public static final RegistryObject<Block> ITEM_VIEWER = BLOCKS.register("item_viewer", BlockItemViewer::new);
|
||||
public static final RegistryObject<Block> FIREWORK_BOX = BLOCKS.register("firework_box", BlockFireworkBox::new);
|
||||
public static final RegistryObject<Block> MINER = BLOCKS.register("miner", BlockVerticalDigger::new);
|
||||
public static final RegistryObject<Block> ATOMIC_RECONSTRUCTOR = BLOCKS.register("atomic_reconstructor", BlockAtomicReconstructor::new);
|
||||
public static final RegistryObject<Block> LASER_RELAY = BLOCKS.register("laser_relay", () -> new BlockLaserRelay(BlockLaserRelay.Type.ENERGY_BASIC));
|
||||
public static final RegistryObject<Block> LASER_RELAY_ADVANCED = BLOCKS.register("laser_relay_advanced", () -> new BlockLaserRelay(BlockLaserRelay.Type.ENERGY_ADVANCED));
|
||||
public static final RegistryObject<Block> LASER_RELAY_EXTREME = BLOCKS.register("laser_relay_extreme", () -> new BlockLaserRelay(BlockLaserRelay.Type.ENERGY_EXTREME));
|
||||
public static final RegistryObject<Block> LASER_RELAY_FLUIDS = BLOCKS.register("laser_relay_fluids", () -> new BlockLaserRelay(BlockLaserRelay.Type.FLUIDS));
|
||||
public static final RegistryObject<Block> LASER_RELAY_ITEM = BLOCKS.register("laser_relay_item", () -> new BlockLaserRelay(BlockLaserRelay.Type.ITEM));
|
||||
public static final RegistryObject<Block> LASER_RELAY_ITEM_WHITELIST = BLOCKS.register("laser_relay_item_whitelist", () -> new BlockLaserRelay(BlockLaserRelay.Type.ITEM_WHITELIST));
|
||||
public static final RegistryObject<Block> RANGED_COLLECTOR = BLOCKS.register("ranged_collector", BlockRangedCollector::new);
|
||||
public static final RegistryObject<Block> DIRECTIONAL_BREAKER = BLOCKS.register("directional_breaker", BlockDirectionalBreaker::new);
|
||||
public static final RegistryObject<Block> LEAF_GENERATOR = BLOCKS.register("leaf_generator", BlockLeafGenerator::new);
|
||||
public static final RegistryObject<Block> XP_SOLIDIFIER = BLOCKS.register("xp_solidifier", BlockXPSolidifier::new);
|
||||
public static final RegistryObject<Block> ETHETIC_GREEN_BLOCK = BLOCKS.register("ethetic_green_block", BlockGeneric::new);
|
||||
public static final RegistryObject<Block> ETHETIC_WHITE_BLOCK = BLOCKS.register("ethetic_white_block", BlockGeneric::new);
|
||||
public static final RegistryObject<Block> ETHETIC_GREEN_STAIRS = BLOCKS.register("ethetic_green_stairs", () -> new StairsBlock(() -> ETHETIC_GREEN_BLOCK.get().defaultBlockState(), AbstractBlock.Properties.copy(ETHETIC_GREEN_BLOCK.get())));
|
||||
public static final RegistryObject<Block> ETHETIC_WHITE_STAIRS = BLOCKS.register("ethetic_white_stairs", () -> new StairsBlock(() -> ETHETIC_WHITE_BLOCK.get().defaultBlockState(), AbstractBlock.Properties.copy(ETHETIC_WHITE_BLOCK.get())));
|
||||
public static final RegistryObject<Block> ETHETIC_GREEN_SLAB = BLOCKS.register("ethetic_green_slab", () -> new SlabBlock(AbstractBlock.Properties.copy(ETHETIC_GREEN_BLOCK.get())));
|
||||
public static final RegistryObject<Block> ETHETIC_WHITE_SLAB = BLOCKS.register("ethetic_white_slab", () -> new SlabBlock(AbstractBlock.Properties.copy(ETHETIC_WHITE_BLOCK.get())));
|
||||
public static final RegistryObject<Block> ETHETIC_GREEN_WALL = BLOCKS.register("ethetic_green_wall", () -> new WallBlock(AbstractBlock.Properties.copy(ETHETIC_GREEN_BLOCK.get())));
|
||||
public static final RegistryObject<Block> ETHETIC_WHITE_WALL = BLOCKS.register("ethetic_white_wall", () -> new WallBlock(AbstractBlock.Properties.copy(ETHETIC_WHITE_BLOCK.get())));
|
||||
private static final Item.Properties defaultBlockItemProperties = new Item.Properties().group(ActuallyAdditions.GROUP).maxStackSize(64);
|
||||
|
||||
public static final RegistryObject<Block> CRYSTAL_ENORI = BLOCKS.register("crystal_enori_block", () -> new BlockCrystal(false));
|
||||
public static final RegistryObject<Block> CRYSTAL_RESTONIA = BLOCKS.register("crystal_restonia_block", () -> new BlockCrystal(false));
|
||||
public static final RegistryObject<Block> CRYSTAL_PALIS = BLOCKS.register("crystal_palis_block", () -> new BlockCrystal(false));
|
||||
public static final RegistryObject<Block> CRYSTAL_DIAMATINE = BLOCKS.register("crystal_diamatine_block", () -> new BlockCrystal(false));
|
||||
public static final RegistryObject<Block> CRYSTAL_VOID = BLOCKS.register("crystal_void_block", () -> new BlockCrystal(false));
|
||||
public static final RegistryObject<Block> CRYSTAL_EMERADIC = BLOCKS.register("crystal_emeradic_block", () -> new BlockCrystal(false));
|
||||
public static final AbstractBlock.Properties miscBlockProperties = AbstractBlock.Properties.create(Material.ROCK).harvestLevel(1).harvestTool(ToolType.PICKAXE).hardnessAndResistance(1.5f, 10f);
|
||||
|
||||
public static final RegistryObject<Block> CRYSTAL_EMPOWERED_ENORI = BLOCKS.register("crystal_enori_empowered_block", () -> new BlockCrystal(true));
|
||||
public static final RegistryObject<Block> CRYSTAL_EMPOWERED_RESTONIA = BLOCKS.register("crystal_restonia_empowered_block", () -> new BlockCrystal(true));
|
||||
public static final RegistryObject<Block> CRYSTAL_EMPOWERED_PALIS = BLOCKS.register("crystal_palis_empowered_block", () -> new BlockCrystal(true));
|
||||
public static final RegistryObject<Block> CRYSTAL_EMPOWERED_DIAMATINE = BLOCKS.register("crystal_diamatine_empowered_block", () -> new BlockCrystal(true));
|
||||
public static final RegistryObject<Block> CRYSTAL_EMPOWERED_VOID = BLOCKS.register("crystal_void_empowered_block", () -> new BlockCrystal(true));
|
||||
public static final RegistryObject<Block> CRYSTAL_EMPOWERED_EMERADIC = BLOCKS.register("crystal_emeradic_empowered_block", () -> new BlockCrystal(true));
|
||||
// Casings
|
||||
public static final AABlockReg<ActuallyBlock, AABlockItem, ?> WOOD_CASING = new AABlockReg<>("wood_casing", () -> new ActuallyBlock(miscBlockProperties), ActuallyBlock::createBlockItem);
|
||||
public static final AABlockReg<ActuallyBlock, AABlockItem, ?> IRON_CASING = new AABlockReg<>("iron_casing", () -> new ActuallyBlock(miscBlockProperties), ActuallyBlock::createBlockItem);
|
||||
public static final AABlockReg<ActuallyBlock, AABlockItem, ?> ENDER_CASING = new AABlockReg<>("ender_casing", () -> new ActuallyBlock(miscBlockProperties), ActuallyBlock::createBlockItem);
|
||||
public static final AABlockReg<ActuallyBlock, AABlockItem, ?> LAVA_FACTORY_CASING = new AABlockReg<>("lava_factory_casing", () -> new ActuallyBlock(miscBlockProperties), ActuallyBlock::createBlockItem);
|
||||
|
||||
public static final RegistryObject<Block> LAMP_WHITE = BLOCKS.register("lamp_white_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_ORANGE = BLOCKS.register("lamp_orange_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_MAGENTA = BLOCKS.register("lamp_magenta_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_LIGHT_BLUE = BLOCKS.register("lamp_light_blue_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_YELLOW = BLOCKS.register("lamp_yellow_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_LIME = BLOCKS.register("lamp_lime_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_PINK = BLOCKS.register("lamp_pink_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_GRAY = BLOCKS.register("lamp_gray_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_LIGHT_GRAY = BLOCKS.register("lamp_light_gray_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_CYAN = BLOCKS.register("lamp_cyan_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_PURPLE = BLOCKS.register("lamp_purple_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_BLUE = BLOCKS.register("lamp_blue_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_BROWN = BLOCKS.register("lamp_brown_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_GREEN = BLOCKS.register("lamp_green_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_RED = BLOCKS.register("lamp_red_block", BlockColoredLamp::new);
|
||||
public static final RegistryObject<Block> LAMP_BLACK = BLOCKS.register("lamp_black_block", BlockColoredLamp::new);
|
||||
// Machines
|
||||
public static final AABlockReg<BlockFeeder, AABlockItem, TileEntityFeeder> FEEDER = new AABlockReg<>("feeder", BlockFeeder::new, (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFeeder::new);
|
||||
public static final AABlockReg<BlockCrusher, AABlockItem, TileEntityCrusher> CRUSHER = new AABlockReg<>("crusher", () -> new BlockCrusher(false),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCrusher::new);
|
||||
public static final AABlockReg<BlockCrusher, AABlockItem, TileEntityCrusher> CRUSHER_DOUBLE = new AABlockReg<>("crusher_double", () -> new BlockCrusher(false),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCrusherDouble::new);
|
||||
|
||||
// public static final RegistryObject<Block> blockColoredLamp = BLOCKS.register("colored_lamp", () -> new BlockColoredLamp());
|
||||
// public static final RegistryObject<Block> blockColoredLampOn = BLOCKS.register("colored_lamp_on", () -> new BlockColoredLamp());
|
||||
public static final RegistryObject<Block> LAMP_POWERER = BLOCKS.register("lamp_powerer", BlockLampPowerer::new);
|
||||
// public static final RegistryObject<Block> blockTreasureChest = BLOCKS.register("treasure_chest", BlockTreasureChest::new);
|
||||
public static final RegistryObject<Block> ENERGIZER = BLOCKS.register("energizer", () -> new BlockEnergizer(true));
|
||||
public static final RegistryObject<Block> ENERVATOR = BLOCKS.register("enervator", () -> new BlockEnergizer(false));
|
||||
public static final RegistryObject<Block> LAVA_FACTORY_CONTROLLER = BLOCKS.register("lava_factory_controller", BlockLavaFactoryController::new);
|
||||
public static final RegistryObject<Block> CANOLA_PRESS = BLOCKS.register("canola_press", BlockCanolaPress::new);
|
||||
public static final RegistryObject<Block> PHANTOMFACE = BLOCKS.register("phantomface", () -> new BlockPhantom(BlockPhantom.Type.FACE));
|
||||
public static final RegistryObject<Block> PHANTOM_PLACER = BLOCKS.register("phantom_placer", () -> new BlockPhantom(BlockPhantom.Type.PLACER));
|
||||
public static final RegistryObject<Block> PHANTOM_LIQUIFACE = BLOCKS.register("phantom_liquiface", () -> new BlockPhantom(BlockPhantom.Type.LIQUIFACE));
|
||||
public static final RegistryObject<Block> PHANTOM_ENERGYFACE = BLOCKS.register("phantom_energyface", () -> new BlockPhantom(BlockPhantom.Type.ENERGYFACE));
|
||||
public static final RegistryObject<Block> PHANTOM_REDSTONEFACE = BLOCKS.register("phantom_redstoneface", () -> new BlockPhantom(BlockPhantom.Type.REDSTONEFACE));
|
||||
public static final RegistryObject<Block> PHANTOM_BREAKER = BLOCKS.register("phantom_breaker", () -> new BlockPhantom(BlockPhantom.Type.BREAKER));
|
||||
public static final RegistryObject<Block> COAL_GENERATOR = BLOCKS.register("coal_generator", BlockCoalGenerator::new);
|
||||
public static final RegistryObject<Block> OIL_GENERATOR = BLOCKS.register("oil_generator", BlockOilGenerator::new);
|
||||
public static final RegistryObject<Block> FERMENTING_BARREL = BLOCKS.register("fermenting_barrel", BlockFermentingBarrel::new);
|
||||
public static final RegistryObject<Block> RICE = BLOCKS.register("rice", () -> new BlockPlant(ActuallyItems.RICE_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(1, 2));
|
||||
public static final RegistryObject<Block> CANOLA = BLOCKS.register("canola", () -> new BlockPlant(ActuallyItems.CANOLA_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(2, 3));
|
||||
public static final RegistryObject<Block> FLAX = BLOCKS.register("flax", () -> new BlockPlant(ActuallyItems.FLAX_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(2, 4));
|
||||
public static final RegistryObject<Block> COFFEE = BLOCKS.register("coffee", () -> new BlockPlant(ActuallyItems.COFFEE_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(2, 2));
|
||||
public static final RegistryObject<Block> FURNACE_DOUBLE = BLOCKS.register("furnace_double", BlockFurnaceDouble::new);
|
||||
public static final RegistryObject<Block> INPUTTER = BLOCKS.register("inputter", () -> new BlockInputter(false));
|
||||
public static final RegistryObject<Block> INPUTTER_ADVANCED = BLOCKS.register("inputter_advanced", () -> new BlockInputter(true));
|
||||
// public static final RegistryObject<Block> blockFurnaceSolar = BLOCKS.register("furnace_solar", BlockFurnaceSolar::new);
|
||||
public static final RegistryObject<Block> HEAT_COLLECTOR = BLOCKS.register("heat_collector", BlockHeatCollector::new);
|
||||
public static final RegistryObject<Block> GREENHOUSE_GLASS = BLOCKS.register("greenhouse_glass", BlockGreenhouseGlass::new);
|
||||
public static final RegistryObject<Block> BREAKER = BLOCKS.register("breaker", () -> new BlockBreaker(false));
|
||||
public static final RegistryObject<Block> PLACER = BLOCKS.register("placer", () -> new BlockBreaker(true));
|
||||
public static final RegistryObject<Block> DROPPER = BLOCKS.register("dropper", BlockDropper::new);
|
||||
public static final RegistryObject<Block> FLUID_PLACER = BLOCKS.register("fluid_placer", () -> new BlockFluidCollector(true));
|
||||
public static final RegistryObject<Block> FLUID_COLLECTOR = BLOCKS.register("fluid_collector", () -> new BlockFluidCollector(false));
|
||||
public static final RegistryObject<Block> COFFEE_MACHINE = BLOCKS.register("coffee_machine", BlockCoffeeMachine::new);
|
||||
public static final RegistryObject<Block> PHANTOM_BOOSTER = BLOCKS.register("phantom_booster", BlockPhantomBooster::new);
|
||||
public static final RegistryObject<Block> BLACK_QUARTZ_BLOCK = BLOCKS.register("black_quartz_block", BlockGeneric::new);
|
||||
public static final RegistryObject<Block> BLACK_QUARTZ_PILLAR_BLOCK = BLOCKS.register("black_quartz_pillar_block", BlockGeneric::new);
|
||||
public static final RegistryObject<Block> CHISELED_BLACK_QUARTZ_BLOCK = BLOCKS.register("chiseled_black_quartz_block", BlockGeneric::new);
|
||||
public static final RegistryObject<Block> BLACK_QUARTZ_WALL = BLOCKS.register("black_quartz_wall", () -> new WallBlock(AbstractBlock.Properties.copy(blockMisc.get())));
|
||||
public static final RegistryObject<Block> CHISELED_BLACK_QUARTZ_WALL = BLOCKS.register("chiseled_black_quartz_wall", () -> new WallBlock(AbstractBlock.Properties.copy(blockMisc.get())));
|
||||
public static final RegistryObject<Block> BLACK_QUARTZ_PILLAR_WALL = BLOCKS.register("black_quartz_pillar_wall", () -> new WallBlock(AbstractBlock.Properties.copy(blockMisc.get())));
|
||||
public static final RegistryObject<Block> BLACK_QUARTZ_STAIR = BLOCKS.register("black_quartz_stair", () -> new StairsBlock(() -> blockMisc.get().defaultBlockState(), AbstractBlock.Properties.copy(blockMisc.get())));
|
||||
public static final RegistryObject<Block> CHISELED_BLACK_QUARTZ_STAIR = BLOCKS.register("chiseled_black_quartz_stair", () -> new StairsBlock(() -> blockMisc.get().defaultBlockState(), AbstractBlock.Properties.copy(blockMisc.get())));
|
||||
public static final RegistryObject<Block> BLACK_QUARTZ_PILLAR_STAIR = BLOCKS.register("black_quartz_pillar_stair", () -> new StairsBlock(() -> blockMisc.get().defaultBlockState(), AbstractBlock.Properties.copy(blockMisc.get())));
|
||||
public static final RegistryObject<Block> BLACK_QUARTZ_SLAB = BLOCKS.register("black_quartz_slab", () -> new SlabBlock(AbstractBlock.Properties.copy(blockMisc.get())));
|
||||
public static final RegistryObject<Block> CHISELED_BLACK_QUARTZ_SLAB = BLOCKS.register("chiseled_black_quartz_slab", () -> new SlabBlock(AbstractBlock.Properties.copy(blockMisc.get())));
|
||||
public static final RegistryObject<Block> BLACK_QUARTZ_PILLAR_SLAB = BLOCKS.register("black_quartz_pillar_slab", () -> new SlabBlock(AbstractBlock.Properties.copy(blockMisc.get())));
|
||||
public static final AABlockReg<BlockEnergizer, AABlockItem, TileEntityEnergizer> ENERGIZER = new AABlockReg<>("energizer", () -> new BlockEnergizer(true),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityEnergizer::new);
|
||||
public static final AABlockReg<BlockEnergizer, AABlockItem, TileEntityEnergizer> ENERVATOR = new AABlockReg<>("enervator", () -> new BlockEnergizer(false),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityEnergizer::new);
|
||||
|
||||
public static final AABlockReg<BlockLavaFactoryController, AABlockItem, TileEntityLavaFactoryController> LAVA_FACTORY_CONTROLLER
|
||||
= new AABlockReg<>("lava_factory_controller", BlockLavaFactoryController::new, (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLavaFactoryController::new);
|
||||
|
||||
public static final AABlockReg<BlockLampPowerer, AABlockItem, ?> LAMP_POWERER = new AABlockReg<>("lamp_powerer", BlockLampPowerer::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
|
||||
public static final AABlockReg<BlockCanolaPress, AABlockItem, TileEntityCanolaPress> CANOLA_PRESS = new AABlockReg<>("canola_press", BlockCanolaPress::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCanolaPress::new);
|
||||
|
||||
public static final AABlockReg<BlockFermentingBarrel, AABlockItem, TileEntityFermentingBarrel> FERMENTING_BARREL = new AABlockReg<>("fermenting_barrel", BlockFermentingBarrel::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFermentingBarrel::new);
|
||||
|
||||
public static final AABlockReg<BlockOilGenerator, AABlockItem, TileEntityOilGenerator> OIL_GENERATOR = new AABlockReg<>("oil_generator", BlockOilGenerator::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityOilGenerator::new);
|
||||
|
||||
public static final AABlockReg<BlockCoalGenerator, AABlockItem, TileEntityCoalGenerator> COAL_GENERATOR = new AABlockReg<>("coal_generator", BlockCoalGenerator::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCoalGenerator::new);
|
||||
|
||||
public static final AABlockReg<BlockLeafGenerator, AABlockItem, TileEntityLeafGenerator> LEAF_GENERATOR = new AABlockReg<>("leaf_generator", BlockLeafGenerator::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties) , TileEntityLeafGenerator::new);
|
||||
|
||||
public static final AABlockReg<BlockXPSolidifier, AABlockItem, TileEntityXPSolidifier> XP_SOLIDIFIER = new AABlockReg<>("xp_solidifier", BlockXPSolidifier::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityXPSolidifier::new);
|
||||
|
||||
public static final AABlockReg<BlockBreaker, AABlockItem, TileEntityBreaker> BREAKER = new AABlockReg<>("breaker", () -> new BlockBreaker(false),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityBreaker::new);
|
||||
public static final AABlockReg<BlockBreaker, AABlockItem, TileEntityPlacer> PLACER = new AABlockReg<>("placer", () -> new BlockBreaker(true),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPlacer::new);
|
||||
public static final AABlockReg<BlockDropper, AABlockItem, TileEntityDropper> DROPPER = new AABlockReg<>("dropper", BlockDropper::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityDropper::new);
|
||||
public static final AABlockReg<BlockFluidCollector, AABlockItem, TileEntityFluidCollector> FLUID_PLACER = new AABlockReg<>("fluid_placer", () -> new BlockFluidCollector(true),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFluidCollector::new);
|
||||
public static final AABlockReg<BlockFluidCollector, AABlockItem, TileEntityFluidPlacer> FLUID_COLLECTOR = new AABlockReg<>("fluid_collector", () -> new BlockFluidCollector(false),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFluidPlacer::new);
|
||||
|
||||
public static final AABlockReg<BlockFarmer, AABlockItem, TileEntityFarmer> FARMER = new AABlockReg<>("farmer", BlockFarmer::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFarmer::new);
|
||||
|
||||
public static final AABlockReg<BlockBioReactor, AABlockItem, TileEntityBioReactor> BIOREACTOR = new AABlockReg<>("bio_reactor", BlockBioReactor::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityBioReactor::new);
|
||||
|
||||
public static final AABlockReg<BlockVerticalDigger, AABlockItem, TileEntityVerticalDigger> Vertical_DIGGER = new AABlockReg<>("vertical_digger", BlockVerticalDigger::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityVerticalDigger::new);
|
||||
|
||||
public static final AABlockReg<BlockAtomicReconstructor, AABlockItem, TileEntityAtomicReconstructor> ATOMIC_RECONSTRUCTOR = new AABlockReg<>("atomic_reconstructor", BlockAtomicReconstructor::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityAtomicReconstructor::new);
|
||||
public static final AABlockReg<BlockRangedCollector, AABlockItem, TileEntityRangedCollector> RANGED_COLLECTOR = new AABlockReg<>("ranged_collector", BlockRangedCollector::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityRangedCollector::new);
|
||||
public static final AABlockReg<BlockLongRangeBreaker, AABlockItem, TileEntityLongRangeBreaker> LONG_RANGE_BREAKER = new AABlockReg<>("long_range_breaker", BlockLongRangeBreaker::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLongRangeBreaker::new);
|
||||
|
||||
public static final AABlockReg<BlockCoffeeMachine, AABlockItem, TileEntityCoffeeMachine> COFFEE_MACHINE = new AABlockReg<>("coffee_machine", BlockCoffeeMachine::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCoffeeMachine::new);
|
||||
public static final AABlockReg<BlockPoweredFurnace, AABlockItem, TileEntityPoweredFurnace> POWERED_FURNACE = new AABlockReg<>("powered_furnace", BlockPoweredFurnace::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPoweredFurnace::new);
|
||||
|
||||
|
||||
// Crystal Blocks
|
||||
public static final AABlockReg<BlockCrystal, AABlockItem,?> ENORI_CRYSTAL = new AABlockReg<>("enori_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem);
|
||||
public static final AABlockReg<BlockCrystal, AABlockItem,?> RESTONIA_CRYSTAL = new AABlockReg<>("restonia_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem);
|
||||
public static final AABlockReg<BlockCrystal, AABlockItem,?> PALIS_CRYSTAL = new AABlockReg<>("palis_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem);
|
||||
public static final AABlockReg<BlockCrystal, AABlockItem,?> DIAMATINE_CRYSTAL = new AABlockReg<>("diamatine_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem);
|
||||
public static final AABlockReg<BlockCrystal, AABlockItem,?> VOID_CRYSTAL = new AABlockReg<>("void_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem);
|
||||
public static final AABlockReg<BlockCrystal, AABlockItem,?> EMERADIC_CRYSTAL = new AABlockReg<>("emeradic_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem);
|
||||
// Empowered Crystal Blocks
|
||||
public static final AABlockReg<BlockCrystal, AABlockItem,?> EMPOWERED_ENORI_CRYSTAL = new AABlockReg<>("empowered_enori_crystal_block", () -> new BlockCrystal(true), BlockCrystal::createBlockItem);
|
||||
public static final AABlockReg<BlockCrystal, AABlockItem,?> EMPOWERED_RESTONIA_CRYSTAL = new AABlockReg<>("empowered_restonia_crystal_block", () -> new BlockCrystal(true), BlockCrystal::createBlockItem);
|
||||
public static final AABlockReg<BlockCrystal, AABlockItem,?> EMPOWERED_PALIS_CRYSTAL = new AABlockReg<>("empowered_palis_crystal_block", () -> new BlockCrystal(true), BlockCrystal::createBlockItem);
|
||||
public static final AABlockReg<BlockCrystal, AABlockItem,?> EMPOWERED_DIAMATINE_CRYSTAL = new AABlockReg<>("empowered_diamatine_crystal_block", () -> new BlockCrystal(true), BlockCrystal::createBlockItem);
|
||||
public static final AABlockReg<BlockCrystal, AABlockItem,?> EMPOWERED_VOID_CRYSTAL = new AABlockReg<>("empowered_void_crystal_block", () -> new BlockCrystal(true), BlockCrystal::createBlockItem);
|
||||
public static final AABlockReg<BlockCrystal, AABlockItem,?> EMPOWERED_EMERADIC_CRYSTAL = new AABlockReg<>("empowered_emeradic_crystal_block", () -> new BlockCrystal(true), BlockCrystal::createBlockItem);
|
||||
// Crystal Clusters
|
||||
public static final AABlockReg<CrystalClusterBlock, AABlockItem, ?> ENORI_CRYSTAL_CLUSTER = new AABlockReg<>("enori_crystal_cluster", () -> new CrystalClusterBlock(Crystals.IRON), (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<CrystalClusterBlock, AABlockItem, ?> RESTONIA_CRYSTAL_CLUSTER = new AABlockReg<>("restonia_crystal_cluster", () -> new CrystalClusterBlock(Crystals.REDSTONE), (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<CrystalClusterBlock, AABlockItem, ?> PALIS_CRYSTAL_CLUSTER = new AABlockReg<>("palis_crystal_cluster", () -> new CrystalClusterBlock(Crystals.LAPIS), (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<CrystalClusterBlock, AABlockItem, ?> DIAMATINE_CRYSTAL_CLUSTER = new AABlockReg<>("diamatine_crystal_cluster", () -> new CrystalClusterBlock(Crystals.DIAMOND), (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<CrystalClusterBlock, AABlockItem, ?> VOID_CRYSTAL_CLUSTER = new AABlockReg<>("void_crystal_cluster", () -> new CrystalClusterBlock(Crystals.COAL), (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<CrystalClusterBlock, AABlockItem, ?> EMERADIC_CRYSTAL_CLUSTER = new AABlockReg<>("emeradic_crystal_cluster", () -> new CrystalClusterBlock(Crystals.EMERALD), (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
|
||||
// LAMPS! SO MANY LAMPS
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_WHITE = new AABlockReg<>("lamp_white", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_ORANGE = new AABlockReg<>("lamp_orange", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_MAGENTA = new AABlockReg<>("lamp_magenta", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_LIGHT_BLUE = new AABlockReg<>("lamp_light_blue", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_YELLOW = new AABlockReg<>("lamp_yellow", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_LIME = new AABlockReg<>("lamp_lime", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_PINK = new AABlockReg<>("lamp_pink", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_GRAY = new AABlockReg<>("lamp_gray", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_LIGHT_GRAY = new AABlockReg<>("lamp_light_gray", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_CYAN = new AABlockReg<>("lamp_cyan", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_PURPLE = new AABlockReg<>("lamp_purple", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_BLUE = new AABlockReg<>("lamp_blue", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_BROWN = new AABlockReg<>("lamp_brown", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_GREEN = new AABlockReg<>("lamp_green", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_RED = new AABlockReg<>("lamp_red", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockColoredLamp, AABlockItem, ?> LAMP_BLACK = new AABlockReg<>("lamp_black", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
|
||||
// Empowerer / Display Stands
|
||||
public static final AABlockReg<BlockEmpowerer, AABlockItem, TileEntityEmpowerer> EMPOWERER = new AABlockReg<>("empowerer", BlockEmpowerer::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityEmpowerer::new);
|
||||
public static final AABlockReg<BlockDisplayStand, AABlockItem, TileEntityDisplayStand> DISPLAY_STAND = new AABlockReg<>("display_stand", BlockDisplayStand::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityDisplayStand::new);
|
||||
|
||||
// Interface Blocks
|
||||
public static final AABlockReg<BlockPlayerInterface, AABlockItem, TileEntityPlayerInterface> PLAYER_INTERFACE = new AABlockReg<>("player_interface", BlockPlayerInterface::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPlayerInterface::new);
|
||||
public static final AABlockReg<BlockItemInterface, AABlockItem, TileEntityItemInterface> ITEM_VIEWER = new AABlockReg<>("item_viewer", BlockItemInterface::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityItemInterface::new);
|
||||
public static final AABlockReg<BlockItemInterfaceHopping, AABlockItem, TileEntityItemInterfaceHopping> ITEM_VIEWER_HOPPING = new AABlockReg<>("item_viewer_hopping", BlockItemInterfaceHopping::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityItemInterfaceHopping::new);
|
||||
|
||||
// Phantom stuff
|
||||
public static final AABlockReg<BlockPhantom, AABlockItem, TileEntityPhantomItemface> PHANTOM_ITEMFACE = new AABlockReg<>("phantom_itemface", () -> new BlockPhantom(BlockPhantom.Type.ITEMFACE),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomItemface::new);
|
||||
public static final AABlockReg<BlockPhantom, AABlockItem, TileEntityPhantomPlacer> PHANTOM_PLACER = new AABlockReg<>("phantom_placer", () -> new BlockPhantom(BlockPhantom.Type.PLACER),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomPlacer::new);
|
||||
public static final AABlockReg<BlockPhantom, AABlockItem, TileEntityPhantomLiquiface> PHANTOM_LIQUIFACE = new AABlockReg<>("phantom_liquiface", () -> new BlockPhantom(BlockPhantom.Type.LIQUIFACE),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomLiquiface::new);
|
||||
public static final AABlockReg<BlockPhantom, AABlockItem, TileEntityPhantomEnergyface> PHANTOM_ENERGYFACE = new AABlockReg<>("phantom_energyface", () -> new BlockPhantom(BlockPhantom.Type.ENERGYFACE),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomEnergyface::new);
|
||||
public static final AABlockReg<BlockPhantom, AABlockItem, TileEntityPhantomRedstoneface> PHANTOM_REDSTONEFACE = new AABlockReg<>("phantom_redstoneface", () -> new BlockPhantom(BlockPhantom.Type.REDSTONEFACE),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomRedstoneface::new);
|
||||
public static final AABlockReg<BlockPhantom, AABlockItem, TileEntityPhantomBreaker> PHANTOM_BREAKER = new AABlockReg<>("phantom_breaker", () -> new BlockPhantom(BlockPhantom.Type.BREAKER),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomBreaker::new);
|
||||
public static final AABlockReg<BlockPhantomBooster, AABlockItem, TileEntityPhantomBooster> PHANTOM_BOOSTER = new AABlockReg<>("phantom_booster", BlockPhantomBooster::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomBooster::new);
|
||||
|
||||
// Misc Tiles
|
||||
public static final AABlockReg<BlockBatteryBox, AABlockItem, TileEntityBatteryBox> BATTERY_BOX = new AABlockReg<>("battery_box", BlockBatteryBox::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityBatteryBox::new);
|
||||
|
||||
public static final AABlockReg<BlockFireworkBox, AABlockItem, TileEntityFireworkBox> FIREWORK_BOX = new AABlockReg<>("firework_box", BlockFireworkBox::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFireworkBox::new);
|
||||
|
||||
public static final AABlockReg<BlockShockSuppressor, AABlockItem, TileEntityShockSuppressor> SHOCK_SUPPRESSOR = new AABlockReg<>("shock_suppressor", BlockShockSuppressor::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityShockSuppressor::new);
|
||||
public static final AABlockReg<BlockHeatCollector, AABlockItem, TileEntityHeatCollector> HEAT_COLLECTOR = new AABlockReg<>("heat_collector", BlockHeatCollector::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityHeatCollector::new);
|
||||
|
||||
// Freakin-Lasers
|
||||
public static final AABlockReg<BlockLaserRelay, AABlockItem, TileEntityLaserRelayEnergy> LASER_RELAY = new AABlockReg<>("laser_relay", () -> new BlockLaserRelay(BlockLaserRelay.Type.ENERGY_BASIC),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayEnergy::new);
|
||||
public static final AABlockReg<BlockLaserRelay, AABlockItem, TileEntityLaserRelayEnergyAdvanced> LASER_RELAY_ADVANCED = new AABlockReg<>("laser_relay_advanced", () -> new BlockLaserRelay(BlockLaserRelay.Type.ENERGY_ADVANCED),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayEnergyAdvanced::new);
|
||||
public static final AABlockReg<BlockLaserRelay, AABlockItem,TileEntityLaserRelayEnergyExtreme> LASER_RELAY_EXTREME = new AABlockReg<>("laser_relay_extreme", () -> new BlockLaserRelay(BlockLaserRelay.Type.ENERGY_EXTREME),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayEnergyExtreme::new);
|
||||
public static final AABlockReg<BlockLaserRelay, AABlockItem,TileEntityLaserRelayFluids> LASER_RELAY_FLUIDS = new AABlockReg<>("laser_relay_fluids", () -> new BlockLaserRelay(BlockLaserRelay.Type.FLUIDS),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayFluids::new);
|
||||
public static final AABlockReg<BlockLaserRelay, AABlockItem,TileEntityLaserRelayItem> LASER_RELAY_ITEM = new AABlockReg<>("laser_relay_item", () -> new BlockLaserRelay(BlockLaserRelay.Type.ITEM),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayItem::new);
|
||||
public static final AABlockReg<BlockLaserRelay, AABlockItem, TileEntityLaserRelayItemAdvanced> LASER_RELAY_ITEM_ADVANCED = new AABlockReg<>("laser_relay_item_advanced", () -> new BlockLaserRelay(BlockLaserRelay.Type.ITEM_WHITELIST),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayItemAdvanced::new);
|
||||
|
||||
|
||||
|
||||
// Misc building blocks
|
||||
public static final AABlockReg<ActuallyBlock, AABlockItem, ?> ETHETIC_GREEN_BLOCK = new AABlockReg<>("ethetic_green_block", () -> new ActuallyBlock(miscBlockProperties),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<ActuallyBlock, AABlockItem, ?> ETHETIC_WHITE_BLOCK = new AABlockReg<>("ethetic_white_block", () -> new ActuallyBlock(miscBlockProperties),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<ActuallyBlock, AABlockItem, ?> BLACK_QUARTZ_BLOCK = new AABlockReg<>("black_quartz_block", () -> new ActuallyBlock(miscBlockProperties),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<ActuallyBlock, AABlockItem, ?> BLACK_QUARTZ_PILLAR_BLOCK = new AABlockReg<>("black_quartz_pillar_block", () -> new ActuallyBlock(miscBlockProperties),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<ActuallyBlock, AABlockItem, ?> CHISELED_BLACK_QUARTZ_BLOCK = new AABlockReg<>("chiseled_black_quartz_block", () -> new ActuallyBlock(miscBlockProperties),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
|
||||
public static final AABlockReg<StairsBlock, AABlockItem, ?> ETHETIC_GREEN_STAIRS = new AABlockReg<>("ethetic_green_stairs", () -> new StairsBlock(() -> ETHETIC_GREEN_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<StairsBlock, AABlockItem, ?> ETHETIC_WHITE_STAIRS = new AABlockReg<>("ethetic_white_stairs", () -> new StairsBlock(() -> ETHETIC_WHITE_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<StairsBlock, AABlockItem, ?> BLACK_QUARTZ_STAIR = new AABlockReg<>("black_quartz_stair", () -> new StairsBlock(() -> BLACK_QUARTZ_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(BLACK_QUARTZ_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<StairsBlock, AABlockItem, ?> CHISELED_BLACK_QUARTZ_STAIR = new AABlockReg<>("chiseled_black_quartz_stair", () -> new StairsBlock(() -> CHISELED_BLACK_QUARTZ_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(CHISELED_BLACK_QUARTZ_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<StairsBlock, AABlockItem, ?> BLACK_QUARTZ_PILLAR_STAIR = new AABlockReg<>("black_quartz_pillar_stair", () -> new StairsBlock(() -> BLACK_QUARTZ_PILLAR_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(BLACK_QUARTZ_PILLAR_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
|
||||
public static final AABlockReg<WallBlock, AABlockItem, ?> ETHETIC_GREEN_WALL = new AABlockReg<>("ethetic_green_wall", () -> new WallBlock(AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<WallBlock, AABlockItem, ?> ETHETIC_WHITE_WALL = new AABlockReg<>("ethetic_white_wall", () -> new WallBlock(AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<WallBlock, AABlockItem, ?> BLACK_QUARTZ_WALL = new AABlockReg<>("black_quartz_wall", () -> new WallBlock(AbstractBlock.Properties.from(BLACK_QUARTZ_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<WallBlock, AABlockItem, ?> CHISELED_BLACK_QUARTZ_WALL = new AABlockReg<>("chiseled_black_quartz_wall", () -> new WallBlock(AbstractBlock.Properties.from(CHISELED_BLACK_QUARTZ_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<WallBlock, AABlockItem, ?> BLACK_QUARTZ_PILLAR_WALL = new AABlockReg<>("black_quartz_pillar_wall", () -> new WallBlock(AbstractBlock.Properties.from(BLACK_QUARTZ_PILLAR_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
|
||||
public static final AABlockReg<SlabBlock, AABlockItem, ?> ETHETIC_GREEN_SLAB = new AABlockReg<>("ethetic_green_slab", () -> new SlabBlock(AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<SlabBlock, AABlockItem, ?> ETHETIC_WHITE_SLAB = new AABlockReg<>("ethetic_white_slab", () -> new SlabBlock(AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<SlabBlock, AABlockItem, ?> BLACK_QUARTZ_SLAB = new AABlockReg<>("black_quartz_slab", () -> new SlabBlock(AbstractBlock.Properties.from(BLACK_QUARTZ_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<SlabBlock, AABlockItem, ?> CHISELED_BLACK_QUARTZ_SLAB = new AABlockReg<>("chiseled_black_quartz_slab", () -> new SlabBlock(AbstractBlock.Properties.from(CHISELED_BLACK_QUARTZ_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<SlabBlock, AABlockItem, ?> BLACK_QUARTZ_PILLAR_SLAB = new AABlockReg<>("black_quartz_pillar_slab", () -> new SlabBlock(AbstractBlock.Properties.from(BLACK_QUARTZ_PILLAR_BLOCK.get())),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
|
||||
|
||||
// Other Misc Blocks
|
||||
public static final AABlockReg<BlockTinyTorch, AABlockItem, ?> TINY_TORCH = new AABlockReg<>("tiny_torch", BlockTinyTorch::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
|
||||
//public static final AABlockReg<> WILD_PLANT = new AABlockReg<>("wild", BlockWildPlant::new); //TODO: what is this?
|
||||
|
||||
//TODO: Are plants normal blocks / blockitems? i have no idea... news at 11...
|
||||
public static final AABlockReg<BlockPlant, AABlockItem, ?> RICE = new AABlockReg<>("rice", () -> new BlockPlant(ActuallyItems.RICE_SEED.get()),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockPlant, AABlockItem, ?> CANOLA = new AABlockReg<>("canola", () -> new BlockPlant(ActuallyItems.CANOLA_SEED.get()),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockPlant, AABlockItem, ?> FLAX = new AABlockReg<>("flax", () -> new BlockPlant(ActuallyItems.FLAX_SEED.get()),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockPlant, AABlockItem, ?> COFFEE = new AABlockReg<>("coffee", () -> new BlockPlant(ActuallyItems.COFFEE_SEED.get()),
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
public static final AABlockReg<BlockGreenhouseGlass, AABlockItem, ?> GREENHOUSE_GLASS = new AABlockReg<>("greenhouse_glass", BlockGreenhouseGlass::new,
|
||||
(b) -> new AABlockItem(b, defaultBlockItemProperties));
|
||||
|
||||
public static AbstractBlock.Properties defaultPickProps(int harvestLevel, float hardness, float resistance) {
|
||||
return AbstractBlock.Properties.of(Material.STONE).harvestLevel(harvestLevel).harvestTool(ToolType.PICKAXE).strength(hardness, resistance).sound(SoundType.STONE);
|
||||
|
|
|
@ -14,8 +14,8 @@ import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FAC
|
|||
import static net.minecraft.state.properties.BlockStateProperties.LIT;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinderDouble;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCrusher;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCrusherDouble;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
@ -37,25 +37,25 @@ import net.minecraft.world.server.ServerWorld;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockGrinder extends BlockContainerBase {
|
||||
public class BlockCrusher extends BlockContainerBase {
|
||||
private final boolean isDouble;
|
||||
|
||||
public BlockGrinder(boolean isDouble) {
|
||||
super(ActuallyBlocks.defaultPickProps(0).randomTicks());
|
||||
public BlockCrusher(boolean isDouble) {
|
||||
super(ActuallyBlocks.defaultPickProps(0).tickRandomly());
|
||||
this.isDouble = isDouble;
|
||||
this.registerDefaultState(this.stateDefinition.any().setValue(HORIZONTAL_FACING, Direction.NORTH).setValue(LIT, false));
|
||||
this.setDefaultState(this.stateContainer.getBaseState().with(HORIZONTAL_FACING, Direction.NORTH).with(LIT, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity newBlockEntity(IBlockReader worldIn) {
|
||||
public TileEntity createNewTileEntity(IBlockReader worldIn) {
|
||||
return this.isDouble
|
||||
? new TileEntityGrinderDouble()
|
||||
: new TileEntityGrinder();
|
||||
? new TileEntityCrusherDouble()
|
||||
: new TileEntityCrusher();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random rand) {
|
||||
if (state.getValue(BlockStateProperties.LIT)) {
|
||||
if (state.get(BlockStateProperties.LIT)) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
double xRand = rand.nextDouble() / 0.75D - 0.5D;
|
||||
double zRand = rand.nextDouble() / 0.75D - 0.5D;
|
||||
|
@ -66,34 +66,34 @@ public class BlockGrinder extends BlockContainerBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType use(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (this.isDouble) {
|
||||
return this.openGui(world, player, pos, TileEntityGrinderDouble.class);
|
||||
return this.openGui(world, player, pos, TileEntityCrusherDouble.class);
|
||||
}
|
||||
|
||||
return this.openGui(world, player, pos, TileEntityGrinder.class);
|
||||
return this.openGui(world, player, pos, TileEntityCrusher.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
return this.defaultBlockState().setValue(HORIZONTAL_FACING, context.getNearestLookingDirection().getOpposite()).setValue(LIT, false);
|
||||
return this.getDefaultState().with(HORIZONTAL_FACING, context.getNearestLookingDirection().getOpposite()).with(LIT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(LIT).add(HORIZONTAL_FACING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(BlockState state, IBlockReader world, BlockPos pos) {
|
||||
return state.getValue(LIT)
|
||||
return state.get(LIT)
|
||||
? 12
|
||||
: 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
switch (state.getValue(HORIZONTAL_FACING)) {
|
||||
switch (state.get(HORIZONTAL_FACING)) {
|
||||
case EAST:
|
||||
return Shapes.GrinderShapes.SHAPE_E;
|
||||
case SOUTH:
|
|
@ -10,9 +10,9 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.blocks;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BlockCrystal extends BlockBase {
|
||||
public class BlockCrystal extends ActuallyBlock {
|
||||
private final boolean isEmpowered;
|
||||
|
||||
public BlockCrystal(boolean isEmpowered) {
|
||||
|
@ -20,6 +20,16 @@ public class BlockCrystal extends BlockBase {
|
|||
this.isEmpowered = isEmpowered;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AABlockItem createBlockItem() {
|
||||
return new AABlockItem(this, getItemProperties()) {
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack stack) {
|
||||
return isEmpowered;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// public static class TheItemBlock extends ItemBlockBase {
|
||||
//
|
||||
// public TheItemBlock(Block block) {
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
/*
|
||||
* This file ("BlockCrystalCluster.java") is part of the Actually Additions mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2017 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.blocks;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.FullyDirectionalBlock;
|
||||
import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
import net.minecraft.block.AbstractBlock.Properties;
|
||||
|
||||
public class BlockCrystalCluster extends FullyDirectionalBlock {
|
||||
|
||||
private final TheCrystals crystal;
|
||||
|
||||
public BlockCrystalCluster(TheCrystals crystal) {
|
||||
super(Properties.of(Material.GLASS).strength(0.25F, 1.0F).sound(SoundType.GLASS).lightLevel(state -> 7));
|
||||
this.crystal = crystal;
|
||||
|
||||
// this.setLightOpacity(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
return Shapes.CRYSTAL_CLUSTER_SHAPE;
|
||||
}
|
||||
}
|
|
@ -11,7 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.blocks;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewer;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemInterface;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -19,14 +19,14 @@ import net.minecraft.util.math.shapes.ISelectionContext;
|
|||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
public class BlockItemViewer extends BlockContainerBase {
|
||||
public BlockItemViewer() {
|
||||
public class BlockItemInterface extends BlockContainerBase {
|
||||
public BlockItemInterface() {
|
||||
super(ActuallyBlocks.defaultPickProps(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity newBlockEntity(IBlockReader worldIn) {
|
||||
return new TileEntityItemViewer();
|
||||
public TileEntity createNewTileEntity(IBlockReader worldIn) {
|
||||
return new TileEntityItemInterface();
|
||||
}
|
||||
|
||||
@Override
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.blocks;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewerHopping;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemInterfaceHopping;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -18,8 +18,8 @@ import net.minecraft.util.math.shapes.ISelectionContext;
|
|||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
public class BlockItemViewerHopping extends BlockItemViewer {
|
||||
public BlockItemViewerHopping() {
|
||||
public class BlockItemInterfaceHopping extends BlockItemInterface {
|
||||
public BlockItemInterfaceHopping() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ public class BlockItemViewerHopping extends BlockItemViewer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity newBlockEntity(IBlockReader worldIn) {
|
||||
return new TileEntityItemViewerHopping();
|
||||
public TileEntity createNewTileEntity(IBlockReader worldIn) {
|
||||
return new TileEntityItemInterfaceHopping();
|
||||
}
|
||||
}
|
|
@ -138,8 +138,8 @@ public class BlockLaserRelay extends FullyDirectionalBlock.Container implements
|
|||
}
|
||||
}
|
||||
|
||||
if (relay instanceof TileEntityLaserRelayItemWhitelist) {
|
||||
return this.openGui(world, player, pos, TileEntityLaserRelayItemWhitelist.class);
|
||||
if (relay instanceof TileEntityLaserRelayItemAdvanced) {
|
||||
return this.openGui(world, player, pos, TileEntityLaserRelayItemAdvanced.class);
|
||||
}
|
||||
}
|
||||
return ActionResultType.FAIL;
|
||||
|
@ -151,7 +151,7 @@ public class BlockLaserRelay extends FullyDirectionalBlock.Container implements
|
|||
case ITEM:
|
||||
return new TileEntityLaserRelayItem();
|
||||
case ITEM_WHITELIST:
|
||||
return new TileEntityLaserRelayItemWhitelist();
|
||||
return new TileEntityLaserRelayItemAdvanced();
|
||||
case ENERGY_ADVANCED:
|
||||
return new TileEntityLaserRelayEnergyAdvanced();
|
||||
case ENERGY_EXTREME:
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.blocks;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.FullyDirectionalBlock;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLongRangeBreaker;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -24,29 +24,29 @@ import net.minecraft.util.math.shapes.VoxelShape;
|
|||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDirectionalBreaker extends FullyDirectionalBlock.Container {
|
||||
public class BlockLongRangeBreaker extends FullyDirectionalBlock.Container {
|
||||
|
||||
public BlockDirectionalBreaker() {
|
||||
public BlockLongRangeBreaker() {
|
||||
super(ActuallyBlocks.defaultPickProps(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity newBlockEntity(IBlockReader worldIn) {
|
||||
return new TileEntityDirectionalBreaker();
|
||||
public TileEntity createNewTileEntity(IBlockReader worldIn) {
|
||||
return new TileEntityLongRangeBreaker();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType use(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (this.tryToggleRedstone(world, pos, player)) {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
return this.openGui(world, player, pos, TileEntityDirectionalBreaker.class);
|
||||
return this.openGui(world, player, pos, TileEntityLongRangeBreaker.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
switch (state.getValue(FACING)) {
|
||||
switch (state.get(FACING)) {
|
||||
case UP:
|
||||
return Shapes.DirectionalBlockBreakerShapes.SHAPE_U;
|
||||
case DOWN:
|
|
@ -152,7 +152,7 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay {
|
|||
}
|
||||
|
||||
public enum Type {
|
||||
FACE,
|
||||
ITEMFACE,
|
||||
PLACER,
|
||||
BREAKER,
|
||||
LIQUIFACE,
|
||||
|
|
|
@ -14,7 +14,7 @@ import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FAC
|
|||
import static net.minecraft.state.properties.BlockStateProperties.LIT;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPoweredFurnace;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
@ -35,24 +35,24 @@ import net.minecraft.world.server.ServerWorld;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockFurnaceDouble extends BlockContainerBase {
|
||||
public BlockFurnaceDouble() {
|
||||
public class BlockPoweredFurnace extends BlockContainerBase {
|
||||
public BlockPoweredFurnace() {
|
||||
// TODO: [port] confirm this is correct for light level... Might not be reactive.
|
||||
super(ActuallyBlocks.defaultPickProps(0).randomTicks().lightLevel(state -> state.getValue(LIT)
|
||||
super(ActuallyBlocks.defaultPickProps(0).tickRandomly().setLightLevel(state -> state.get(LIT)
|
||||
? 12
|
||||
: 0));
|
||||
|
||||
this.registerDefaultState(this.stateDefinition.any().setValue(HORIZONTAL_FACING, Direction.NORTH).setValue(LIT, false));
|
||||
this.setDefaultState(this.stateContainer.getBaseState().with(HORIZONTAL_FACING, Direction.NORTH).with(LIT, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity newBlockEntity(IBlockReader worldIn) {
|
||||
return new TileEntityFurnaceDouble();
|
||||
public TileEntity createNewTileEntity(IBlockReader worldIn) {
|
||||
return new TileEntityPoweredFurnace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomTick(BlockState state, ServerWorld worldIn, BlockPos pos, Random random) {
|
||||
if (state.getValue(LIT)) {
|
||||
if (state.get(LIT)) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
worldIn.addParticle(ParticleTypes.SMOKE, (double) pos.getX() + 0.5F, (double) pos.getY() + 1.0F, (double) pos.getZ() + 0.5F, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
@ -60,17 +60,17 @@ public class BlockFurnaceDouble extends BlockContainerBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType use(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
return this.openGui(worldIn, player, pos, TileEntityFurnaceDouble.class);
|
||||
public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
return this.openGui(worldIn, player, pos, TileEntityPoweredFurnace.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
return this.defaultBlockState().setValue(HORIZONTAL_FACING, context.getNearestLookingDirection().getOpposite()).setValue(LIT, false);
|
||||
return this.getDefaultState().with(HORIZONTAL_FACING, context.getNearestLookingDirection().getOpposite()).with(LIT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(LIT).add(HORIZONTAL_FACING);
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ public class BlockFurnaceDouble extends BlockContainerBase {
|
|||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
switch (state.getValue(HORIZONTAL_FACING)) {
|
||||
switch (state.get(HORIZONTAL_FACING)) {
|
||||
case EAST:
|
||||
return Shapes.FurnaceDoubleShapes.SHAPE_E;
|
||||
case SOUTH:
|
|
@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.blocks;
|
|||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.DirectionalBlock;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityVerticalDigger;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.MainWindow;
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* This file ("BlockCrystalCluster.java") is part of the Actually Additions mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2017 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.blocks;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.FullyDirectionalBlock;
|
||||
import de.ellpeck.actuallyadditions.mod.items.metalists.Crystals;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.state.DirectionProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.IBooleanFunction;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class CrystalClusterBlock extends FullyDirectionalBlock {
|
||||
public static final DirectionProperty FACING = BlockStateProperties.FACING;
|
||||
|
||||
public static final VoxelShape CRYSTAL_SHAPE = Stream.of(
|
||||
Block.makeCuboidShape(5, 4, 5, 10, 19, 10), Block.makeCuboidShape(4, 0, 4, 11, 5, 11),
|
||||
Block.makeCuboidShape(3, 0, 3, 5, 4, 5), Block.makeCuboidShape(10, 0, 3, 12, 2, 5),
|
||||
Block.makeCuboidShape(12, 0, 4, 13, 1, 5), Block.makeCuboidShape(11, 0, 5, 12, 1, 6),
|
||||
Block.makeCuboidShape(10, 0, 10, 12, 3, 12), Block.makeCuboidShape(3, 0, 10, 5, 1, 12),
|
||||
Block.makeCuboidShape(9, 0, 3, 10, 3, 4), Block.makeCuboidShape(8, 0, 2, 11, 1, 4),
|
||||
Block.makeCuboidShape(4, 0, 2, 5, 2, 3), Block.makeCuboidShape(5, 0, 3, 7, 1, 4),
|
||||
Block.makeCuboidShape(2, 0, 4, 4, 1, 6), Block.makeCuboidShape(3, 0, 5, 4, 3, 6.5),
|
||||
Block.makeCuboidShape(3, 0, 9, 4, 2, 10), Block.makeCuboidShape(2, 0, 8, 4, 1, 10),
|
||||
Block.makeCuboidShape(5, 0, 11, 7, 2, 13), Block.makeCuboidShape(7, 0, 11, 11, 1, 13),
|
||||
Block.makeCuboidShape(10, 0, 9, 13, 1, 11), Block.makeCuboidShape(11, 0, 7, 12, 3, 9)
|
||||
).reduce((v1, v2) -> {return VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR);}).get();
|
||||
|
||||
public CrystalClusterBlock(Crystals crystal) {
|
||||
super(Properties.create(Material.GLASS)
|
||||
.setLightLevel((e) -> 7)
|
||||
.sound(SoundType.GLASS)
|
||||
.hardnessAndResistance(0.25f, 1.0f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getBaseConstructorState() {
|
||||
return this.stateContainer.getBaseState().with(FACING, Direction.UP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTransparent(BlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
return CRYSTAL_SHAPE;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package de.ellpeck.actuallyadditions.mod.blocks;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public interface IActuallyBlock {
|
||||
/**
|
||||
* Defaults to the default class for mc. Don't run this other than on setup
|
||||
*
|
||||
* @return this blocks item pair
|
||||
*/
|
||||
AABlockItem createBlockItem();
|
||||
|
||||
/**
|
||||
* Defines the Block Item properties for all non-custom block items.
|
||||
*
|
||||
* @return block item properties for default block item.
|
||||
* @see for implementation {@link #createBlockItem()}
|
||||
*/
|
||||
Item.Properties getItemProperties();
|
||||
}
|
|
@ -12,10 +12,7 @@ package de.ellpeck.actuallyadditions.mod.blocks.base;
|
|||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public class BlockFluidFlowing extends BlockFluidClassic implements ItemBlockBase.ICustomRarity {
|
||||
|
||||
|
|
|
@ -27,6 +27,10 @@ public abstract class FullyDirectionalBlock extends BlockBase {
|
|||
|
||||
}
|
||||
|
||||
public BlockState getBaseConstructorState() {
|
||||
return this.stateContainer.getBaseState().with(FACING, Direction.NORTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(FACING);
|
||||
|
|
|
@ -19,10 +19,10 @@ import net.minecraft.util.IStringSerializable;
|
|||
@Deprecated
|
||||
public enum TheWildPlants implements IStringSerializable {
|
||||
|
||||
CANOLA("canola", Rarity.RARE, ActuallyBlocks.CANOLA),
|
||||
FLAX("flax", Rarity.RARE, ActuallyBlocks.FLAX),
|
||||
RICE("rice", Rarity.RARE, ActuallyBlocks.RICE),
|
||||
COFFEE("coffee", Rarity.RARE, ActuallyBlocks.COFFEE);
|
||||
CANOLA("canola", Rarity.RARE, ActuallyBlocks.CANOLA.getBlock()),
|
||||
FLAX("flax", Rarity.RARE, ActuallyBlocks.FLAX.getBlock()),
|
||||
RICE("rice", Rarity.RARE, ActuallyBlocks.RICE.getBlock()),
|
||||
COFFEE("coffee", Rarity.RARE, ActuallyBlocks.COFFEE.getBlock());
|
||||
|
||||
final String name;
|
||||
final Rarity rarity;
|
||||
|
|
|
@ -191,7 +191,7 @@ public final class InitBooklet {
|
|||
new BookletChapter("fluidLaser", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyBlocks.LASER_RELAY_FLUIDS.get()), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeFluidLaser).setWildcard().setNoText());
|
||||
new BookletChapter("itemRelays", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyBlocks.LASER_RELAY_ITEM.get()), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeItemLaser).setWildcard().setNoText()).setSpecial();
|
||||
new BookletChapter("itemInterfaces", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyBlocks.ITEM_VIEWER.get()), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeItemInterface).setNoText());
|
||||
new BookletChapter("itemRelaysAdvanced", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyBlocks.LASER_RELAY_ITEM_WHITELIST.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeLaserRelayItemWhitelist).setWildcard());
|
||||
new BookletChapter("itemRelaysAdvanced", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyBlocks.LASER_RELAY_ITEM_ADVANCED.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeLaserRelayItemWhitelist).setWildcard());
|
||||
new BookletChapter("itemInterfacesHopping", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyBlocks.ITEM_VIEWER_HOPPING.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeItemInterfaceHopping).setWildcard().setNoText());
|
||||
new BookletChapter("laserUpgradeInvisibility", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyItems.LASER_UPGRADE_INVISIBILITY.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLaserUpgradeInvisibility).setNoText()).setImportant();
|
||||
new BookletChapter("laserUpgradeRange", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyItems.LASER_UPGRADE_RANGE.get()), new PageTextOnly(1).addTextReplacement("<def>", TileEntityLaserRelay.MAX_DISTANCE).addTextReplacement("<upgraded>", TileEntityLaserRelay.MAX_DISTANCE_RANGED), new PageCrafting(2, ItemCrafting.recipeLaserUpgradeRange).setNoText()).setImportant();
|
||||
|
@ -199,7 +199,7 @@ public final class InitBooklet {
|
|||
//No RF Using Blocks
|
||||
new BookletChapter("breaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.BREAKER.get()), new PageCrafting(1, BlockCrafting.recipeBreaker).setWildcard(), new PageCrafting(2, BlockCrafting.recipePlacer).setWildcard(), new PageCrafting(3, BlockCrafting.recipeLiquidPlacer).setWildcard(), new PageCrafting(4, BlockCrafting.recipeLiquidCollector).setWildcard());
|
||||
new BookletChapter("dropper", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.DROPPER.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeDropper).setNoText());
|
||||
new BookletChapter("phantomfaces", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.PHANTOM_LIQUIFACE.get()), new PageTextOnly(1).addTextReplacement("<range>", TileEntityPhantomface.RANGE), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipePhantomface), new PageCrafting(4, BlockCrafting.recipeLiquiface), new PageCrafting(5, BlockCrafting.recipeEnergyface), new PageCrafting(6, ItemCrafting.recipePhantomConnector).setNoText(), new PageCrafting(7, BlockCrafting.recipePhantomBooster)).setImportant();
|
||||
new BookletChapter("phantomfaces", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.PHANTOM_LIQUIFACE.get()), new PageTextOnly(1).addTextReplacement("<range>", TileEntityPhantomFace.RANGE), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipePhantomface), new PageCrafting(4, BlockCrafting.recipeLiquiface), new PageCrafting(5, BlockCrafting.recipeEnergyface), new PageCrafting(6, ItemCrafting.recipePhantomConnector).setNoText(), new PageCrafting(7, BlockCrafting.recipePhantomBooster)).setImportant();
|
||||
new BookletChapter("phantomRedstoneface", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.PHANTOM_REDSTONEFACE.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipePhantomRedstoneface).setNoText());
|
||||
new BookletChapter("phantomBreaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.PHANTOM_BREAKER.get()), new PageTextOnly(1).addTextReplacement("<range>", TileEntityPhantomPlacer.RANGE), new PageCrafting(2, BlockCrafting.recipePhantomPlacer).setNoText(), new PageCrafting(3, BlockCrafting.recipePhantomBreaker).setNoText());
|
||||
new BookletChapter("esd", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.INPUTTER_ADVANCED.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial();
|
||||
|
@ -215,11 +215,11 @@ public final class InitBooklet {
|
|||
new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.FIREWORK_BOX.get()), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityFireworkBox.USE_PER_SHOT), new PageCrafting(2, BlockCrafting.recipeFireworkBox)).setSpecial();
|
||||
new BookletChapter("batteryBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.BATTERY_BOX.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBatteryBox).setNoText()).setSpecial();
|
||||
new BookletChapter("farmer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.FARMER.get()), new PageTextOnly(1), new PagePicture(2, "page_farmer_crops", 95).addItemsToPage(new ItemStack(Items.WHEAT_SEEDS)).addItemsToPage(new ItemStack(ActuallyItems.CANOLA_SEED.get())), new PagePicture(3, "page_farmer_cactus", 105).addItemsToPage(new ItemStack(Blocks.CACTUS)), new PagePicture(4, "page_farmer_wart", 95).addItemsToPage(new ItemStack(Items.NETHER_WART)), new PagePicture(5, "page_farmer_reeds", 105).addItemsToPage(new ItemStack(Items.REEDS)), new PagePicture(6, "page_farmer_melons", 105).addItemsToPage(new ItemStack(Items.MELON), new ItemStack(Blocks.PUMPKIN), new ItemStack(Blocks.MELON_BLOCK)), new PagePicture(7, "page_farmer_enderlilly", 105), new PagePicture(8, "page_farmer_redorchid", 105), new PageCrafting(4, BlockCrafting.recipeFarmer).setWildcard().setNoText()).setImportant();
|
||||
new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.MINER.get()), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityMiner.ENERGY_USE_PER_BLOCK).addTextReplacement("<range>", TileEntityMiner.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial();
|
||||
new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.Vertical_DIGGER.get()), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityVerticalDigger.ENERGY_USE_PER_BLOCK).addTextReplacement("<range>", TileEntityVerticalDigger.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial();
|
||||
new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.COFFEE_MACHINE.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(ActuallyItems.COFFEE_BEANS.get())).addTextReplacement("<rf>", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("<coffee>", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("<water>", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).addItemsToPage(new ItemStack(ActuallyItems.COFFEE.get())), new PagePicture(3, "page_coffee_machine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setWildcard().setNoText(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant();
|
||||
|
||||
List<IBookletPage> list = new ArrayList<>();
|
||||
list.add(new PageTextOnly(1).addTextReplacement("<rf>", TileEntityGrinder.ENERGY_USE));
|
||||
list.add(new PageTextOnly(1).addTextReplacement("<rf>", TileEntityCrusher.ENERGY_USE));
|
||||
list.add(new PageCrafting(2, BlockCrafting.recipeCrusher).setWildcard().setNoText());
|
||||
list.add(new PageCrafting(3, BlockCrafting.recipeDoubleCrusher).setWildcard().setNoText());
|
||||
if (CrusherCrafting.recipeIronHorseArmor != null) {
|
||||
|
@ -233,11 +233,11 @@ public final class InitBooklet {
|
|||
}
|
||||
|
||||
new BookletChapterCrusher("crusher", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.GRINDER_DOUBLE.get()), list.toArray(new IBookletPage[0]));
|
||||
new BookletChapter("furnaceDouble", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.FURNACE_DOUBLE.get()), new PageCrafting(1, BlockCrafting.recipeFurnace).setWildcard().addTextReplacement("<rf>", TileEntityFurnaceDouble.ENERGY_USE));
|
||||
new BookletChapter("furnaceDouble", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.POWERED_FURNACE.get()), new PageCrafting(1, BlockCrafting.recipeFurnace).setWildcard().addTextReplacement("<rf>", TileEntityPoweredFurnace.ENERGY_USE));
|
||||
new BookletChapter("lavaFactory", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.LAVA_FACTORY_CONTROLLER.get()), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityLavaFactoryController.ENERGY_USE), new PagePicture(2, "page_lava_factory", 0).setNoText(), new PageCrafting(3, BlockCrafting.recipeLavaFactory).setNoText(), new PageCrafting(4, BlockCrafting.recipeCasing).setNoText());
|
||||
new BookletChapter("energizer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.ENERGIZER.get()), new PageCrafting(1, BlockCrafting.recipeEnergizer), new PageCrafting(2, BlockCrafting.recipeEnervator));
|
||||
// new BookletChapter("repairer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockItemRepairer.get()), new PageCrafting(1, BlockCrafting.recipeRepairer).addTextReplacement("<rf>", TileEntityItemRepairer.ENERGY_USE));
|
||||
new BookletChapter("longRangeBreaker", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.DIRECTIONAL_BREAKER.get()), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityDirectionalBreaker.ENERGY_USE).addTextReplacement("<range>", TileEntityDirectionalBreaker.RANGE), new PageCrafting(2, BlockCrafting.recipeDirectionalBreaker).setWildcard());
|
||||
new BookletChapter("longRangeBreaker", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.LONG_RANGE_BREAKER.get()), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityLongRangeBreaker.ENERGY_USE).addTextReplacement("<range>", TileEntityLongRangeBreaker.RANGE), new PageCrafting(2, BlockCrafting.recipeDirectionalBreaker).setWildcard());
|
||||
new BookletChapter("playerInterface", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.PLAYER_INTERFACE.get()), new PageTextOnly(1).addTextReplacement("<range>", TileEntityPlayerInterface.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipePlayerInterface).setNoText()).setSpecial();
|
||||
new BookletChapter("displayStand", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.DISPLAY_STAND.get()), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeDisplayStand).setNoText()).setSpecial();
|
||||
new BookletChapter("shockSuppressor", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.SHOCK_SUPPRESSOR.get()), new PageTextOnly(1).addTextReplacement("<range>", TileEntityShockSuppressor.RANGE).addTextReplacement("<rf>", TileEntityShockSuppressor.USE_PER), new PageCrafting(2, BlockCrafting.recipeShockSuppressor));
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.inventory;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLongRangeBreaker;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
@ -24,13 +24,13 @@ import java.util.Objects;
|
|||
|
||||
public class ContainerDirectionalBreaker extends Container {
|
||||
|
||||
public final TileEntityDirectionalBreaker breaker;
|
||||
public final TileEntityLongRangeBreaker breaker;
|
||||
|
||||
public static ContainerDirectionalBreaker fromNetwork(int windowId, PlayerInventory inv, PacketBuffer data) {
|
||||
return new ContainerDirectionalBreaker(windowId, inv, (TileEntityDirectionalBreaker) Objects.requireNonNull(inv.player.level.getBlockEntity(data.readBlockPos())));
|
||||
}
|
||||
|
||||
public ContainerDirectionalBreaker(int windowId, PlayerInventory inventory, TileEntityDirectionalBreaker tile) {
|
||||
public ContainerDirectionalBreaker(int windowId, PlayerInventory inventory, TileEntityLongRangeBreaker tile) {
|
||||
super(ActuallyContainers.DIRECTIONAL_BREAKER_CONTAINER.get(), windowId);
|
||||
this.breaker = tile;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.inventory;
|
|||
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPoweredFurnace;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
@ -28,20 +28,20 @@ import java.util.Objects;
|
|||
|
||||
public class ContainerFurnaceDouble extends Container {
|
||||
|
||||
public final TileEntityFurnaceDouble furnace;
|
||||
public final TileEntityPoweredFurnace furnace;
|
||||
|
||||
public static ContainerFurnaceDouble fromNetwork(int windowId, PlayerInventory inv, PacketBuffer data) {
|
||||
return new ContainerFurnaceDouble(windowId, inv, (TileEntityFurnaceDouble) Objects.requireNonNull(inv.player.level.getBlockEntity(data.readBlockPos())));
|
||||
}
|
||||
|
||||
public ContainerFurnaceDouble(int windowId, PlayerInventory inventory, TileEntityFurnaceDouble tile) {
|
||||
public ContainerFurnaceDouble(int windowId, PlayerInventory inventory, TileEntityPoweredFurnace tile) {
|
||||
super(ActuallyContainers.FURNACE_DOUBLE_CONTAINER.get(), windowId);
|
||||
this.furnace = tile;
|
||||
|
||||
this.addSlot(new SlotItemHandlerUnconditioned(this.furnace.inv, TileEntityFurnaceDouble.SLOT_INPUT_1, 51, 21));
|
||||
this.addSlot(new SlotOutput(this.furnace.inv, TileEntityFurnaceDouble.SLOT_OUTPUT_1, 51, 69));
|
||||
this.addSlot(new SlotItemHandlerUnconditioned(this.furnace.inv, TileEntityFurnaceDouble.SLOT_INPUT_2, 109, 21));
|
||||
this.addSlot(new SlotOutput(this.furnace.inv, TileEntityFurnaceDouble.SLOT_OUTPUT_2, 108, 69));
|
||||
this.addSlot(new SlotItemHandlerUnconditioned(this.furnace.inv, TileEntityPoweredFurnace.SLOT_INPUT_1, 51, 21));
|
||||
this.addSlot(new SlotOutput(this.furnace.inv, TileEntityPoweredFurnace.SLOT_OUTPUT_1, 51, 69));
|
||||
this.addSlot(new SlotItemHandlerUnconditioned(this.furnace.inv, TileEntityPoweredFurnace.SLOT_INPUT_2, 109, 21));
|
||||
this.addSlot(new SlotOutput(this.furnace.inv, TileEntityPoweredFurnace.SLOT_OUTPUT_2, 108, 69));
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 9; j++) {
|
||||
|
|
|
@ -13,7 +13,7 @@ package de.ellpeck.actuallyadditions.mod.inventory;
|
|||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput;
|
||||
import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCrusher;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
@ -25,31 +25,31 @@ import net.minecraft.network.PacketBuffer;
|
|||
import java.util.Objects;
|
||||
|
||||
public class ContainerGrinder extends Container {
|
||||
public final TileEntityGrinder tileGrinder;
|
||||
public final TileEntityCrusher tileGrinder;
|
||||
public final boolean isDouble;
|
||||
|
||||
public static ContainerGrinder fromNetwork(int windowId, PlayerInventory inv, PacketBuffer data) {
|
||||
return new ContainerGrinder(windowId, inv, (TileEntityGrinder) Objects.requireNonNull(inv.player.level.getBlockEntity(data.readBlockPos())));
|
||||
}
|
||||
|
||||
public ContainerGrinder(int windowId, PlayerInventory inventory, TileEntityGrinder tile) {
|
||||
public ContainerGrinder(int windowId, PlayerInventory inventory, TileEntityCrusher tile) {
|
||||
super(ActuallyContainers.GRINDER_CONTAINER.get(), windowId);
|
||||
this.tileGrinder = tile;
|
||||
this.isDouble = tile.isDouble;
|
||||
|
||||
this.addSlot(new SlotItemHandlerUnconditioned(this.tileGrinder.inv, TileEntityGrinder.SLOT_INPUT_1, this.isDouble
|
||||
this.addSlot(new SlotItemHandlerUnconditioned(this.tileGrinder.inv, TileEntityCrusher.SLOT_INPUT_1, this.isDouble
|
||||
? 51
|
||||
: 80, 21));
|
||||
this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityGrinder.SLOT_OUTPUT_1_1, this.isDouble
|
||||
this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityCrusher.SLOT_OUTPUT_1_1, this.isDouble
|
||||
? 37
|
||||
: 66, 69));
|
||||
this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityGrinder.SLOT_OUTPUT_1_2, this.isDouble
|
||||
this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityCrusher.SLOT_OUTPUT_1_2, this.isDouble
|
||||
? 64
|
||||
: 92, 69));
|
||||
if (this.isDouble) {
|
||||
this.addSlot(new SlotItemHandlerUnconditioned(this.tileGrinder.inv, TileEntityGrinder.SLOT_INPUT_2, 109, 21));
|
||||
this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityGrinder.SLOT_OUTPUT_2_1, 96, 69));
|
||||
this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityGrinder.SLOT_OUTPUT_2_2, 121, 69));
|
||||
this.addSlot(new SlotItemHandlerUnconditioned(this.tileGrinder.inv, TileEntityCrusher.SLOT_INPUT_2, 109, 21));
|
||||
this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityCrusher.SLOT_OUTPUT_2_1, 96, 69));
|
||||
this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityCrusher.SLOT_OUTPUT_2_2, 121, 69));
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.inventory;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotFilter;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemWhitelist;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemAdvanced;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
@ -25,13 +25,13 @@ import java.util.Objects;
|
|||
|
||||
public class ContainerLaserRelayItemWhitelist extends Container {
|
||||
|
||||
public final TileEntityLaserRelayItemWhitelist tile;
|
||||
public final TileEntityLaserRelayItemAdvanced tile;
|
||||
|
||||
public static ContainerLaserRelayItemWhitelist fromNetwork(int windowId, PlayerInventory inv, PacketBuffer data) {
|
||||
return new ContainerLaserRelayItemWhitelist(windowId, inv, (TileEntityLaserRelayItemWhitelist) Objects.requireNonNull(inv.player.level.getBlockEntity(data.readBlockPos())));
|
||||
}
|
||||
|
||||
public ContainerLaserRelayItemWhitelist(int windowId, PlayerInventory inventory, TileEntityLaserRelayItemWhitelist tile) {
|
||||
public ContainerLaserRelayItemWhitelist(int windowId, PlayerInventory inventory, TileEntityLaserRelayItemAdvanced tile) {
|
||||
super(ActuallyContainers.LASER_RELAY_ITEM_WHITELIST_CONTAINER.get(), windowId);
|
||||
this.tile = tile;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.inventory;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityVerticalDigger;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
@ -24,13 +24,13 @@ import java.util.Objects;
|
|||
|
||||
public class ContainerMiner extends Container {
|
||||
|
||||
public final TileEntityMiner miner;
|
||||
public final TileEntityVerticalDigger miner;
|
||||
|
||||
public static ContainerMiner fromNetwork(int windowId, PlayerInventory inv, PacketBuffer data) {
|
||||
return new ContainerMiner(windowId, inv, (TileEntityMiner) Objects.requireNonNull(inv.player.level.getBlockEntity(data.readBlockPos())));
|
||||
}
|
||||
|
||||
public ContainerMiner(int windowId, PlayerInventory inventory, TileEntityMiner tile) {
|
||||
public ContainerMiner(int windowId, PlayerInventory inventory, TileEntityVerticalDigger tile) {
|
||||
super(ActuallyContainers.MINER_CONTAINER.get(), windowId);
|
||||
this.miner = tile;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
|||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDirectionalBreaker;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLongRangeBreaker;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
@ -24,7 +24,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
|||
public class GuiDirectionalBreaker extends GuiWtfMojang<ContainerDirectionalBreaker> {
|
||||
|
||||
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_directional_breaker");
|
||||
private final TileEntityDirectionalBreaker breaker;
|
||||
private final TileEntityLongRangeBreaker breaker;
|
||||
private EnergyDisplay energy;
|
||||
|
||||
public GuiDirectionalBreaker(ContainerDirectionalBreaker container, PlayerInventory inventory, ITextComponent title) {
|
||||
|
|
|
@ -15,7 +15,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
|||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFurnaceDouble;
|
||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPoweredFurnace;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
|
@ -34,7 +34,7 @@ import java.util.Collections;
|
|||
public class GuiFurnaceDouble extends GuiWtfMojang<ContainerFurnaceDouble> {
|
||||
|
||||
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_furnace_double");
|
||||
private final TileEntityFurnaceDouble tileFurnace;
|
||||
private final TileEntityPoweredFurnace tileFurnace;
|
||||
private EnergyDisplay energy;
|
||||
|
||||
private Button buttonAutoSplit;
|
||||
|
|
|
@ -15,7 +15,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
|||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerGrinder;
|
||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCrusher;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
|
@ -35,7 +35,7 @@ public class GuiGrinder extends GuiWtfMojang<ContainerGrinder> {
|
|||
|
||||
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_grinder");
|
||||
private static final ResourceLocation RES_LOC_DOUBLE = AssetUtil.getGuiLocation("gui_grinder_double");
|
||||
private final TileEntityGrinder tileGrinder;
|
||||
private final TileEntityCrusher tileGrinder;
|
||||
private final boolean isDouble;
|
||||
private EnergyDisplay energy;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
|||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerLaserRelayItemWhitelist;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiInputter.SmallerButton;
|
||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemWhitelist;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemAdvanced;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
|
@ -34,7 +34,7 @@ import java.util.List;
|
|||
public class GuiLaserRelayItemWhitelist extends GuiWtfMojang<ContainerLaserRelayItemWhitelist> {
|
||||
|
||||
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_laser_relay_item_whitelist");
|
||||
private final TileEntityLaserRelayItemWhitelist tile;
|
||||
private final TileEntityLaserRelayItemAdvanced tile;
|
||||
|
||||
private FilterSettingsGui leftFilter;
|
||||
private FilterSettingsGui rightFilter;
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.mojang.blaze3d.matrix.MatrixStack;
|
|||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerMiner;
|
||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityVerticalDigger;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
|
@ -29,7 +29,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
|||
public class GuiMiner extends GuiWtfMojang<ContainerMiner> {
|
||||
|
||||
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_breaker");
|
||||
private final TileEntityMiner miner;
|
||||
private final TileEntityVerticalDigger miner;
|
||||
|
||||
public GuiMiner(ContainerMiner container, PlayerInventory inventory, ITextComponent title) {
|
||||
super(container, inventory);
|
||||
|
|
|
@ -12,9 +12,7 @@ package de.ellpeck.actuallyadditions.mod.items.metalists;
|
|||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
@Deprecated
|
||||
public enum TheCrystals implements IStringSerializable {
|
||||
|
||||
public enum Crystals implements IStringSerializable {
|
||||
REDSTONE("red", 0xFF2F21, 158F / 255F, 43F / 255F, 39F / 255F),
|
||||
LAPIS("blue", 0x5171FF, 37F / 255F, 49F / 255F, 147F / 255F),
|
||||
DIAMOND("light_blue", 0x35F1FF, 99F / 255F, 135F / 255F, 210F / 255F),
|
||||
|
@ -26,7 +24,7 @@ public enum TheCrystals implements IStringSerializable {
|
|||
public final float[] conversionColorParticles;
|
||||
public final int clusterColor;
|
||||
|
||||
TheCrystals(String name, int clusterColor, float... conversionColorParticles) {
|
||||
Crystals(String name, int clusterColor, float... conversionColorParticles) {
|
||||
this.name = name;
|
||||
this.conversionColorParticles = conversionColorParticles;
|
||||
this.clusterColor = clusterColor;
|
|
@ -1,68 +0,0 @@
|
|||
package de.ellpeck.actuallyadditions.mod.tile;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.fml.RegistryObject;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
public class ActuallyTiles {
|
||||
public static final DeferredRegister<TileEntityType<?>> TILES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, ActuallyAdditions.MODID);
|
||||
|
||||
// public static final RegistryObject<,<?>> COMPOST_TILE = TILES.register("compost", () -> TileEntityType.Builder.create(TileEntityCompost::new, InitBlocks.blockCompost.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityFeeder>> FEEDER_TILE = TILES.register("feeder", () -> TileEntityType.Builder.of(TileEntityFeeder::new, ActuallyBlocks.FEEDER.get()).build(null));
|
||||
// public static final RegistryObject<build<?>> GIANTCHEST_TILE = TILES.register("", () -> TileEntityType.Builder.create(TileEntityGiantChest::new, ).build(null));
|
||||
// public static final RegistryObject<build<?>> GIANTCHESTMEDIUM_TILE = TILES.register("", () -> TileEntityType.Builder.create(TileEntityGiantChestMedium::new, ).build(null));
|
||||
// public static final RegistryObject<build<?>> GIANTCHESTLARGE_TILE = TILES.register("", () -> TileEntityType.Builder.create(TileEntityGiantChestLarge::new, ).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityGrinder>> GRINDER_TILE = TILES.register("grinder", () -> TileEntityType.Builder.of(TileEntityGrinder::new, ActuallyBlocks.GRINDER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityFurnaceDouble>> FURNACE_DOUBLE_TILE = TILES.register("furnaceDouble", () -> TileEntityType.Builder.of(TileEntityFurnaceDouble::new, ActuallyBlocks.FURNACE_DOUBLE.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityInputter>> INPUTTER_TILE = TILES.register("inputter", () -> TileEntityType.Builder.of(TileEntityInputter::new, ActuallyBlocks.INPUTTER.get()).build(null));
|
||||
// public static final RegistryObject<TileEntityType<TileEntityFurnaceSolar>> SOLAR_TILE = TILES.register("solarPanel", () -> TileEntityType.Builder.create(TileEntityFurnaceSolar::new, ActuallyBlocks.blockFurnaceSolar.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityHeatCollector>> HEATCOLLECTOR_TILE = TILES.register("heatCollector", () -> TileEntityType.Builder.of(TileEntityHeatCollector::new, ActuallyBlocks.HEAT_COLLECTOR.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityBreaker>> BREAKER_TILE = TILES.register("breaker", () -> TileEntityType.Builder.of(TileEntityBreaker::new, ActuallyBlocks.BREAKER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityDropper>> DROPPER_TILE = TILES.register("dropper", () -> TileEntityType.Builder.of(TileEntityDropper::new, ActuallyBlocks.DROPPER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityInputterAdvanced>> INPUTTERADVANCED_TILE = TILES.register("inputterAdvanced", () -> TileEntityType.Builder.of(TileEntityInputterAdvanced::new, ActuallyBlocks.INPUTTER_ADVANCED.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityPlacer>> PLACER_TILE = TILES.register("placer", () -> TileEntityType.Builder.of(TileEntityPlacer::new, ActuallyBlocks.PLACER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityGrinderDouble>> GRINDER_DOUBLE_TILE = TILES.register("grinderDouble", () -> TileEntityType.Builder.of(TileEntityGrinderDouble::new, ActuallyBlocks.GRINDER_DOUBLE.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityCanolaPress>> CANOLAPRESS_TILE = TILES.register("canolaPress", () -> TileEntityType.Builder.of(TileEntityCanolaPress::new, ActuallyBlocks.CANOLA_PRESS.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityFermentingBarrel>> FERMENTINGBARREL_TILE = TILES.register("fermentingBarrel", () -> TileEntityType.Builder.of(TileEntityFermentingBarrel::new, ActuallyBlocks.FERMENTING_BARREL.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityOilGenerator>> OILGENERATOR_TILE = TILES.register("oilGenerator", () -> TileEntityType.Builder.of(TileEntityOilGenerator::new, ActuallyBlocks.OIL_GENERATOR.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityCoalGenerator>> COALGENERATOR_TILE = TILES.register("coalGenerator", () -> TileEntityType.Builder.of(TileEntityCoalGenerator::new, ActuallyBlocks.COAL_GENERATOR.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityPhantomItemface>> PHANTOMITEMFACE_TILE = TILES.register("phantomface", () -> TileEntityType.Builder.of(TileEntityPhantomItemface::new, ActuallyBlocks.PHANTOMFACE.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityPhantomLiquiface>> PHANTOMLIQUIFACE_TILE = TILES.register("liquiface", () -> TileEntityType.Builder.of(TileEntityPhantomLiquiface::new, ActuallyBlocks.PHANTOM_LIQUIFACE.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityPhantomEnergyface>> PHANTOMENERGYFACE_TILE = TILES.register("energyface", () -> TileEntityType.Builder.of(TileEntityPhantomEnergyface::new, ActuallyBlocks.PHANTOM_ENERGYFACE.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityPlayerInterface>> PLAYERINTERFACE_TILE = TILES.register("playerInterface", () -> TileEntityType.Builder.of(TileEntityPlayerInterface::new, ActuallyBlocks.PLAYER_INTERFACE.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityPhantomPlacer>> PHANTOMPLACER_TILE = TILES.register("phantomPlacer", () -> TileEntityType.Builder.of(TileEntityPhantomPlacer::new, ActuallyBlocks.PHANTOM_PLACER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityPhantomBreaker>> PHANTOMBREAKER_TILE = TILES.register("phantomBreaker", () -> TileEntityType.Builder.of(TileEntityPhantomBreaker::new, ActuallyBlocks.PHANTOM_BREAKER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityFluidCollector>> FLUIDCOLLECTOR_TILE = TILES.register("fluidCollector", () -> TileEntityType.Builder.of(TileEntityFluidCollector::new, ActuallyBlocks.FLUID_COLLECTOR.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityFluidPlacer>> FLUIDPLACER_TILE = TILES.register("fluidPlacer", () -> TileEntityType.Builder.of(TileEntityFluidPlacer::new, ActuallyBlocks.FLUID_PLACER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityLavaFactoryController>> LAVAFACTORYCONTROLLER_TILE = TILES.register("lavaFactory", () -> TileEntityType.Builder.of(TileEntityLavaFactoryController::new, ActuallyBlocks.LAVA_FACTORY_CONTROLLER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityCoffeeMachine>> COFFEEMACHINE_TILE = TILES.register("coffeeMachine", () -> TileEntityType.Builder.of(TileEntityCoffeeMachine::new, ActuallyBlocks.COFFEE_MACHINE.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityPhantomBooster>> PHANTOM_BOOSTER_TILE = TILES.register("phantomBooster", () -> TileEntityType.Builder.of(TileEntityPhantomBooster::new, ActuallyBlocks.PHANTOM_BOOSTER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityEnergizer>> ENERGIZER_TILE = TILES.register("energizer", () -> TileEntityType.Builder.of(TileEntityEnergizer::new, ActuallyBlocks.ENERGIZER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityEnervator>> ENERVATOR_TILE = TILES.register("enervator", () -> TileEntityType.Builder.of(TileEntityEnervator::new, ActuallyBlocks.ENERVATOR.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityXPSolidifier>> XPSOLIDIFIER_TILE = TILES.register("xpSolidifier", () -> TileEntityType.Builder.of(TileEntityXPSolidifier::new, ActuallyBlocks.XP_SOLIDIFIER.get()).build(null));
|
||||
// public static final RegistryObject<.<?>> SMILEYCLOUD_TILE = TILES.register("", () -> TileEntityType.Builder.create(TileEntitySmileyCloud::new, InitBlocks.blockSmileyCloud.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityLeafGenerator>> LEAFGENERATOR_TILE = TILES.register("leafGenerator", () -> TileEntityType.Builder.of(TileEntityLeafGenerator::new, ActuallyBlocks.LEAF_GENERATOR.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityDirectionalBreaker>> DIRECTIONALBREAKER_TILE = TILES.register("directionalBreaker", () -> TileEntityType.Builder.of(TileEntityDirectionalBreaker::new, ActuallyBlocks.DIRECTIONAL_BREAKER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityRangedCollector>> RANGEDCOLLECTOR_TILE = TILES.register("rangedCollector", () -> TileEntityType.Builder.of(TileEntityRangedCollector::new, ActuallyBlocks.RANGED_COLLECTOR.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityAtomicReconstructor>> ATOMICRECONSTRUCTOR_TILE = TILES.register("reconstructor", () -> TileEntityType.Builder.of(TileEntityAtomicReconstructor::new, ActuallyBlocks.ATOMIC_RECONSTRUCTOR.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityMiner>> MINER_TILE = TILES.register("miner", () -> TileEntityType.Builder.of(TileEntityMiner::new, ActuallyBlocks.MINER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityFireworkBox>> FIREWORKBOX_TILE = TILES.register("fireworkBox", () -> TileEntityType.Builder.of(TileEntityFireworkBox::new, ActuallyBlocks.FIREWORK_BOX.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityPhantomRedstoneface>> PHANTOMREDSTONEFACE_TILE = TILES.register("redstoneface", () -> TileEntityType.Builder.of(TileEntityPhantomRedstoneface::new, ActuallyBlocks.PHANTOM_REDSTONEFACE.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityLaserRelayItem>> LASERRELAYITEM_TILE = TILES.register("laserRelayItem", () -> TileEntityType.Builder.of(TileEntityLaserRelayItem::new, ActuallyBlocks.LASER_RELAY_ITEM.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityLaserRelayEnergy>> LASERRELAYENERGY_TILE = TILES.register("laserRelay", () -> TileEntityType.Builder.of(TileEntityLaserRelayEnergy::new, ActuallyBlocks.LASER_RELAY.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityLaserRelayEnergyAdvanced>> LASERRELAYENERGYADVANCED_TILE = TILES.register("laserRelayAdvanced", () -> TileEntityType.Builder.of(TileEntityLaserRelayEnergyAdvanced::new, ActuallyBlocks.LASER_RELAY_ADVANCED.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityLaserRelayEnergyExtreme>> LASERRELAYENERGYEXTREME_TILE = TILES.register("laserRelayExtreme", () -> TileEntityType.Builder.of(TileEntityLaserRelayEnergyExtreme::new, ActuallyBlocks.LASER_RELAY_EXTREME.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityLaserRelayItemWhitelist>> LASERRELAYITEMWHITELIST_TILE = TILES.register("laserRelayItemWhitelist", () -> TileEntityType.Builder.of(TileEntityLaserRelayItemWhitelist::new, ActuallyBlocks.LASER_RELAY_ITEM_WHITELIST.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityItemViewer>> ITEMVIEWER_TILE = TILES.register("itemViewer", () -> TileEntityType.Builder.of(TileEntityItemViewer::new, ActuallyBlocks.ITEM_VIEWER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityDisplayStand>> DISPLAYSTAND_TILE = TILES.register("displayStand", () -> TileEntityType.Builder.of(TileEntityDisplayStand::new, ActuallyBlocks.DISPLAY_STAND.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityShockSuppressor>> SHOCKSUPPRESSOR_TILE = TILES.register("shockSuppressor", () -> TileEntityType.Builder.of(TileEntityShockSuppressor::new, ActuallyBlocks.SHOCK_SUPPRESSOR.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityEmpowerer>> EMPOWERER_TILE = TILES.register("empowerer", () -> TileEntityType.Builder.of(TileEntityEmpowerer::new, ActuallyBlocks.EMPOWERER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityLaserRelayFluids>> LASERRELAYFLUIDS_TILE = TILES.register("laserRelayFluids", () -> TileEntityType.Builder.of(TileEntityLaserRelayFluids::new, ActuallyBlocks.LASER_RELAY_FLUIDS.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityBioReactor>> BIOREACTOR_TILE = TILES.register("bioReactor", () -> TileEntityType.Builder.of(TileEntityBioReactor::new, ActuallyBlocks.BIOREACTOR.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityFarmer>> FARMER_TILE = TILES.register("farmer", () -> TileEntityType.Builder.of(TileEntityFarmer::new, ActuallyBlocks.FARMER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityItemViewerHopping>> ITEMVIEWERHOPPING_TILE = TILES.register("itemViewerHopping", () -> TileEntityType.Builder.of(TileEntityItemViewerHopping::new, ActuallyBlocks.ITEM_VIEWER.get()).build(null));
|
||||
public static final RegistryObject<TileEntityType<TileEntityBatteryBox>> BATTERYBOX_TILE = TILES.register("batteryBox", () -> TileEntityType.Builder.of(TileEntityBatteryBox::new, ActuallyBlocks.BATTERY_BOX.get()).build(null));
|
||||
}
|
|
@ -11,7 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.tile;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.BlockFurnaceDouble;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.BlockPoweredFurnace;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerGrinder;
|
||||
import de.ellpeck.actuallyadditions.mod.misc.SoundHandler;
|
||||
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
|
||||
|
@ -37,9 +37,7 @@ import net.minecraftforge.energy.IEnergyStorage;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
||||
|
||||
public class TileEntityGrinder extends TileEntityInventoryBase implements IButtonReactor, INamedContainerProvider {
|
||||
public class TileEntityCrusher extends TileEntityInventoryBase implements IButtonReactor, INamedContainerProvider {
|
||||
|
||||
public static final int SLOT_INPUT_1 = 0;
|
||||
public static final int SLOT_OUTPUT_1_1 = 1;
|
||||
|
@ -60,11 +58,11 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto
|
|||
private boolean lastAutoSplit;
|
||||
private boolean lastCrushed;
|
||||
|
||||
public TileEntityGrinder(TileEntityType<?> type, int slots) {
|
||||
public TileEntityCrusher(TileEntityType<?> type, int slots) {
|
||||
super(type, slots);
|
||||
}
|
||||
|
||||
public TileEntityGrinder() {
|
||||
public TileEntityCrusher() {
|
||||
super(ActuallyTiles.GRINDER_TILE.get(), 3);
|
||||
this.isDouble = false;
|
||||
}
|
||||
|
@ -94,9 +92,9 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!this.level.isClientSide) {
|
||||
if (!this.world.isRemote) {
|
||||
if (this.isDouble && this.isAutoSplit) {
|
||||
TileEntityFurnaceDouble.autoSplit(this.inv, SLOT_INPUT_1, SLOT_INPUT_2);
|
||||
TileEntityPoweredFurnace.autoSplit(this.inv, SLOT_INPUT_1, SLOT_INPUT_2);
|
||||
}
|
||||
|
||||
boolean crushed = false;
|
||||
|
@ -145,8 +143,8 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto
|
|||
}
|
||||
}
|
||||
|
||||
BlockState currState = this.level.getBlockState(this.worldPosition);
|
||||
boolean current = currState.getValue(BlockFurnaceDouble.IS_ON);
|
||||
BlockState currState = this.world.getBlockState(this.pos);
|
||||
boolean current = currState.get(BlockPoweredFurnace.IS_ON);
|
||||
boolean changeTo = current;
|
||||
if (this.lastCrushed != crushed) {
|
||||
changeTo = crushed;
|
||||
|
@ -159,7 +157,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto
|
|||
}
|
||||
|
||||
if (changeTo != current) {
|
||||
this.level.setBlockAndUpdate(this.worldPosition, currState.setValue(BlockFurnaceDouble.IS_ON, changeTo));
|
||||
this.world.setBlockState(this.pos, currState.with(BlockPoweredFurnace.IS_ON, changeTo));
|
||||
}
|
||||
|
||||
this.lastCrushed = crushed;
|
||||
|
@ -172,7 +170,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto
|
|||
}
|
||||
|
||||
if (shouldPlaySound) {
|
||||
this.level.playSound(null, this.getBlockPos().getX(), this.getBlockPos().getY(), this.getBlockPos().getZ(), SoundHandler.crusher, SoundCategory.BLOCKS, 0.025F, 1.0F);
|
||||
this.world.playSound(null, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), SoundHandler.crusher, SoundCategory.BLOCKS, 0.025F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -196,13 +194,13 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto
|
|||
ItemStack outputOne = recipe.getOutputOne();
|
||||
ItemStack outputTwo = recipe.getOutputTwo();
|
||||
if (StackUtil.isValid(outputOne)) {
|
||||
if (outputOne.getDamageValue() == Util.WILDCARD) {
|
||||
outputOne.setDamageValue(0);
|
||||
if (outputOne.getDamage() == Util.WILDCARD) {
|
||||
outputOne.setDamage(0);
|
||||
}
|
||||
if (StackUtil.isValid(outputTwo) && outputTwo.getDamageValue() == Util.WILDCARD) {
|
||||
outputTwo.setDamageValue(0);
|
||||
if (StackUtil.isValid(outputTwo) && outputTwo.getDamage() == Util.WILDCARD) {
|
||||
outputTwo.setDamage(0);
|
||||
}
|
||||
if ((!StackUtil.isValid(this.inv.getStackInSlot(theFirstOutput)) || this.inv.getStackInSlot(theFirstOutput).sameItem(outputOne) && this.inv.getStackInSlot(theFirstOutput).getCount() <= this.inv.getStackInSlot(theFirstOutput).getMaxStackSize() - outputOne.getCount()) && (!StackUtil.isValid(outputTwo) || !StackUtil.isValid(this.inv.getStackInSlot(theSecondOutput)) || this.inv.getStackInSlot(theSecondOutput).sameItem(outputTwo) && this.inv.getStackInSlot(theSecondOutput).getCount() <= this.inv.getStackInSlot(theSecondOutput).getMaxStackSize() - outputTwo.getCount())) {
|
||||
if ((!StackUtil.isValid(this.inv.getStackInSlot(theFirstOutput)) || this.inv.getStackInSlot(theFirstOutput).isItemEqual(outputOne) && this.inv.getStackInSlot(theFirstOutput).getCount() <= this.inv.getStackInSlot(theFirstOutput).getMaxStackSize() - outputOne.getCount()) && (!StackUtil.isValid(outputTwo) || !StackUtil.isValid(this.inv.getStackInSlot(theSecondOutput)) || this.inv.getStackInSlot(theSecondOutput).isItemEqual(outputTwo) && this.inv.getStackInSlot(theSecondOutput).getCount() <= this.inv.getStackInSlot(theSecondOutput).getMaxStackSize() - outputTwo.getCount())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -223,8 +221,8 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto
|
|||
}
|
||||
ItemStack outputOne = recipe.getOutputOne();
|
||||
if (StackUtil.isValid(outputOne)) {
|
||||
if (outputOne.getDamageValue() == Util.WILDCARD) {
|
||||
outputOne.setDamageValue(0);
|
||||
if (outputOne.getDamage() == Util.WILDCARD) {
|
||||
outputOne.setDamage(0);
|
||||
}
|
||||
if (!StackUtil.isValid(this.inv.getStackInSlot(theFirstOutput))) {
|
||||
this.inv.setStackInSlot(theFirstOutput, outputOne.copy());
|
||||
|
@ -235,10 +233,10 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto
|
|||
|
||||
ItemStack outputTwo = recipe.getOutputTwo();
|
||||
if (StackUtil.isValid(outputTwo)) {
|
||||
if (outputTwo.getDamageValue() == Util.WILDCARD) {
|
||||
outputTwo.setDamageValue(0);
|
||||
if (outputTwo.getDamage() == Util.WILDCARD) {
|
||||
outputTwo.setDamage(0);
|
||||
}
|
||||
int rand = this.level.random.nextInt(100) + 1;
|
||||
int rand = this.world.rand.nextInt(100) + 1;
|
||||
if (rand <= recipe.getSecondChance()) {
|
||||
if (!StackUtil.isValid(this.inv.getStackInSlot(theSecondOutput))) {
|
||||
this.inv.setStackInSlot(theSecondOutput, outputTwo.copy());
|
||||
|
@ -267,7 +265,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto
|
|||
public void onButtonPressed(int buttonID, PlayerEntity player) {
|
||||
if (buttonID == 0) {
|
||||
this.isAutoSplit = !this.isAutoSplit;
|
||||
this.setChanged();
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
|
|
@ -10,9 +10,9 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.tile;
|
||||
|
||||
public class TileEntityGrinderDouble extends TileEntityGrinder {
|
||||
public class TileEntityCrusherDouble extends TileEntityCrusher {
|
||||
|
||||
public TileEntityGrinderDouble() {
|
||||
public TileEntityCrusherDouble() {
|
||||
super(ActuallyTiles.GRINDER_DOUBLE_TILE.get(), 6);
|
||||
this.isDouble = true;
|
||||
}
|
|
@ -99,7 +99,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
|||
? null
|
||||
: this.leftFilter);
|
||||
|
||||
if (this.placeToPull instanceof TileEntityItemViewer) {
|
||||
if (this.placeToPull instanceof TileEntityItemInterface) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
|||
for (Direction side : this.placeToPut.keySet()) {
|
||||
WorldUtil.doItemInteraction(this.wrapper, this.placeToPut.get(side), Integer.MAX_VALUE, 0, 1, this.slotToPutStart, this.slotToPutEnd, null);
|
||||
|
||||
if (this.placeToPut instanceof TileEntityItemViewer) {
|
||||
if (this.placeToPut instanceof TileEntityItemInterface) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import javax.annotation.Nonnull;
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.*;
|
||||
|
||||
public class TileEntityItemViewer extends TileEntityBase {
|
||||
public class TileEntityItemInterface extends TileEntityBase {
|
||||
|
||||
public final List<GenericItemHandlerInfo> genericInfos = new ArrayList<>();
|
||||
public final Map<Integer, IItemHandlerInfo> itemHandlerInfos = new HashMap<>();
|
||||
|
@ -43,18 +43,18 @@ public class TileEntityItemViewer extends TileEntityBase {
|
|||
private int lastNetworkChangeAmount = -1;
|
||||
private int slotCount;
|
||||
|
||||
public TileEntityItemViewer(TileEntityType<?> type) {
|
||||
public TileEntityItemInterface(TileEntityType<?> type) {
|
||||
super(type);
|
||||
|
||||
IItemHandler normalHandler = new IItemHandler() {
|
||||
@Override
|
||||
public int getSlots() {
|
||||
return TileEntityItemViewer.this.getSlotCount();
|
||||
return TileEntityItemInterface.this.getSlotCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot) {
|
||||
IItemHandlerInfo handler = TileEntityItemViewer.this.getSwitchedIndexHandler(slot);
|
||||
IItemHandlerInfo handler = TileEntityItemInterface.this.getSwitchedIndexHandler(slot);
|
||||
if (handler != null && handler.isLoaded()) {
|
||||
return handler.handler.getStackInSlot(handler.switchedIndex);
|
||||
}
|
||||
|
@ -63,12 +63,12 @@ public class TileEntityItemViewer extends TileEntityBase {
|
|||
|
||||
@Override
|
||||
public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) {
|
||||
IItemHandlerInfo info = TileEntityItemViewer.this.getSwitchedIndexHandler(slot);
|
||||
if (info != null && info.isLoaded() && TileEntityItemViewer.this.isWhitelisted(info, stack, false)) {
|
||||
IItemHandlerInfo info = TileEntityItemInterface.this.getSwitchedIndexHandler(slot);
|
||||
if (info != null && info.isLoaded() && TileEntityItemInterface.this.isWhitelisted(info, stack, false)) {
|
||||
ItemStack remain = info.handler.insertItem(info.switchedIndex, stack, simulate);
|
||||
if (!ItemStack.matches(remain, stack) && !simulate) {
|
||||
TileEntityItemViewer.this.setChanged();
|
||||
TileEntityItemViewer.this.doItemParticle(stack, info.relayInQuestion.getBlockPos(), TileEntityItemViewer.this.connectedRelay.getBlockPos());
|
||||
if (!ItemStack.areItemStacksEqual(remain, stack) && !simulate) {
|
||||
TileEntityItemInterface.this.markDirty();
|
||||
TileEntityItemInterface.this.doItemParticle(stack, info.relayInQuestion.getPos(), TileEntityItemInterface.this.connectedRelay.getPos());
|
||||
}
|
||||
return remain;
|
||||
}
|
||||
|
@ -79,12 +79,12 @@ public class TileEntityItemViewer extends TileEntityBase {
|
|||
public ItemStack extractItem(int slot, int amount, boolean simulate) {
|
||||
ItemStack stackIn = this.getStackInSlot(slot);
|
||||
if (StackUtil.isValid(stackIn)) {
|
||||
IItemHandlerInfo info = TileEntityItemViewer.this.getSwitchedIndexHandler(slot);
|
||||
if (info != null && info.isLoaded() && TileEntityItemViewer.this.isWhitelisted(info, stackIn, true)) {
|
||||
IItemHandlerInfo info = TileEntityItemInterface.this.getSwitchedIndexHandler(slot);
|
||||
if (info != null && info.isLoaded() && TileEntityItemInterface.this.isWhitelisted(info, stackIn, true)) {
|
||||
ItemStack extracted = info.handler.extractItem(info.switchedIndex, amount, simulate);
|
||||
if (StackUtil.isValid(extracted) && !simulate) {
|
||||
TileEntityItemViewer.this.setChanged();
|
||||
TileEntityItemViewer.this.doItemParticle(extracted, TileEntityItemViewer.this.connectedRelay.getBlockPos(), info.relayInQuestion.getBlockPos());
|
||||
TileEntityItemInterface.this.markDirty();
|
||||
TileEntityItemInterface.this.doItemParticle(extracted, TileEntityItemInterface.this.connectedRelay.getPos(), info.relayInQuestion.getPos());
|
||||
}
|
||||
return extracted;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class TileEntityItemViewer extends TileEntityBase {
|
|||
|
||||
@Override
|
||||
public int getSlotLimit(int slot) {
|
||||
IItemHandlerInfo info = TileEntityItemViewer.this.getSwitchedIndexHandler(slot);
|
||||
IItemHandlerInfo info = TileEntityItemInterface.this.getSwitchedIndexHandler(slot);
|
||||
if (info != null && info.isLoaded()) {
|
||||
return info.handler.getSlotLimit(info.switchedIndex);
|
||||
} else {
|
||||
|
@ -117,7 +117,7 @@ public class TileEntityItemViewer extends TileEntityBase {
|
|||
this.itemHandler = new SlotlessableItemHandlerWrapper(this.lazyHandlers, slotlessHandler);
|
||||
}
|
||||
|
||||
public TileEntityItemViewer() {
|
||||
public TileEntityItemInterface() {
|
||||
this(ActuallyTiles.ITEMVIEWER_TILE.get());
|
||||
}
|
||||
|
||||
|
@ -153,9 +153,9 @@ public class TileEntityItemViewer extends TileEntityBase {
|
|||
}
|
||||
|
||||
public void doItemParticle(ItemStack stack, BlockPos input, BlockPos output) {
|
||||
if (!this.level.isClientSide) {
|
||||
if (!this.world.isRemote) {
|
||||
CompoundNBT compound = new CompoundNBT();
|
||||
stack.save(compound);
|
||||
stack.write(compound);
|
||||
|
||||
compound.putDouble("InX", input.getX());
|
||||
compound.putDouble("InY", input.getY());
|
||||
|
@ -166,9 +166,9 @@ public class TileEntityItemViewer extends TileEntityBase {
|
|||
compound.putDouble("OutZ", output.getZ());
|
||||
|
||||
int rangeSq = 16 * 16;
|
||||
for (PlayerEntity player : this.level.players()) {
|
||||
for (PlayerEntity player : this.world.getPlayers()) {
|
||||
if (player instanceof ServerPlayerEntity) {
|
||||
if (player.distanceToSqr(input.getX(), input.getY(), input.getZ()) <= rangeSq || player.distanceToSqr(output.getX(), output.getY(), output.getZ()) <= rangeSq) {
|
||||
if (player.getDistanceSq(input.getX(), input.getY(), input.getZ()) <= rangeSq || player.getDistanceSq(output.getX(), output.getY(), output.getZ()) <= rangeSq) {
|
||||
PacketHandler.sendTo(new PacketServerToClient(compound, PacketHandler.LASER_PARTICLE_HANDLER), (ServerPlayerEntity) player);
|
||||
}
|
||||
}
|
||||
|
@ -249,13 +249,13 @@ public class TileEntityItemViewer extends TileEntityBase {
|
|||
@Override
|
||||
public void saveDataOnChangeOrWorldStart() {
|
||||
TileEntityLaserRelayItem tileFound = null;
|
||||
if (this.level != null) { //Why is that even possible..?
|
||||
if (this.world != null) { //Why is that even possible..?
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
Direction side = WorldUtil.getDirectionBySidesInOrder(i);
|
||||
BlockPos pos = this.getBlockPos().relative(side);
|
||||
BlockPos pos = this.getPos().offset(side);
|
||||
|
||||
if (this.level.hasChunkAt(pos)) {
|
||||
TileEntity tile = this.level.getBlockEntity(pos);
|
||||
if (this.world.isBlockLoaded(pos)) {
|
||||
TileEntity tile = this.world.getTileEntity(pos);
|
||||
|
||||
if (tile instanceof TileEntityLaserRelayItem) {
|
||||
if (tileFound != null) {
|
||||
|
@ -312,7 +312,7 @@ public class TileEntityItemViewer extends TileEntityBase {
|
|||
}
|
||||
|
||||
public boolean isLoaded() {
|
||||
return this.relayInQuestion.hasLevel() && this.relayInQuestion.getLevel().hasChunkAt(this.relayInQuestion.getBlockPos());
|
||||
return this.relayInQuestion.hasWorld() && this.relayInQuestion.getWorld().isBlockLoaded(this.relayInQuestion.getPos());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,7 @@ public class TileEntityItemViewer extends TileEntityBase {
|
|||
}
|
||||
|
||||
public boolean isLoaded() {
|
||||
return this.relayInQuestion.hasLevel() && this.relayInQuestion.getLevel().hasChunkAt(this.relayInQuestion.getBlockPos());
|
||||
return this.relayInQuestion.hasWorld() && this.relayInQuestion.getWorld().isBlockLoaded(this.relayInQuestion.getPos());
|
||||
}
|
||||
|
||||
@Override
|
|
@ -28,12 +28,12 @@ import net.minecraftforge.items.IItemHandler;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
public class TileEntityItemViewerHopping extends TileEntityItemViewer {
|
||||
public class TileEntityItemInterfaceHopping extends TileEntityItemInterface {
|
||||
|
||||
private SlotlessableItemHandlerWrapper handlerToPullFrom;
|
||||
private SlotlessableItemHandlerWrapper handlerToPushTo;
|
||||
|
||||
public TileEntityItemViewerHopping() {
|
||||
public TileEntityItemInterfaceHopping() {
|
||||
super(ActuallyTiles.ITEMVIEWERHOPPING_TILE.get());
|
||||
}
|
||||
|
||||
|
@ -42,12 +42,12 @@ public class TileEntityItemViewerHopping extends TileEntityItemViewer {
|
|||
super.updateEntity();
|
||||
|
||||
// TODO: [port] validate this is the correct way to get total game time getGameTime
|
||||
if (!this.level.isClientSide && this.level.getLevelData().getGameTime() % 10 == 0) {
|
||||
if (!this.world.isRemote && this.world.getWorldInfo().getGameTime() % 10 == 0) {
|
||||
if (this.handlerToPullFrom != null) {
|
||||
WorldUtil.doItemInteraction(this.handlerToPullFrom, this.itemHandler, 4);
|
||||
} else {
|
||||
if (this.level.getLevelData().getGameTime() % 20 == 0) {
|
||||
List<ItemEntity> items = this.level.getEntitiesOfClass(ItemEntity.class, new AxisAlignedBB(this.worldPosition.getX(), this.worldPosition.getY() + 0.5, this.worldPosition.getZ(), this.worldPosition.getX() + 1, this.worldPosition.getY() + 2, this.worldPosition.getZ() + 1));
|
||||
if (this.world.getWorldInfo().getGameTime() % 20 == 0) {
|
||||
List<ItemEntity> items = this.world.getEntitiesWithinAABB(ItemEntity.class, new AxisAlignedBB(this.pos.getX(), this.pos.getY() + 0.5, this.pos.getZ(), this.pos.getX() + 1, this.pos.getY() + 2, this.pos.getZ() + 1));
|
||||
if (items != null && !items.isEmpty()) {
|
||||
for (ItemEntity item : items) {
|
||||
if (item != null && item.isAlive()) {
|
||||
|
@ -96,8 +96,8 @@ public class TileEntityItemViewerHopping extends TileEntityItemViewer {
|
|||
this.handlerToPullFrom = null;
|
||||
this.handlerToPushTo = null;
|
||||
|
||||
TileEntity from = this.level.getBlockEntity(this.worldPosition.relative(Direction.UP));
|
||||
if (from != null && !(from instanceof TileEntityItemViewer)) {
|
||||
TileEntity from = this.world.getTileEntity(this.pos.offset(Direction.UP));
|
||||
if (from != null && !(from instanceof TileEntityItemInterface)) {
|
||||
LazyOptional<IItemHandler> normal = from.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, Direction.DOWN);
|
||||
|
||||
Object slotless = null;
|
||||
|
@ -112,13 +112,13 @@ public class TileEntityItemViewerHopping extends TileEntityItemViewer {
|
|||
this.handlerToPullFrom = new SlotlessableItemHandlerWrapper(normal, slotless);
|
||||
}
|
||||
|
||||
BlockState state = this.level.getBlockState(this.worldPosition);
|
||||
Direction facing = state.getValue(BlockStateProperties.FACING);
|
||||
BlockState state = this.world.getBlockState(this.pos);
|
||||
Direction facing = state.get(BlockStateProperties.FACING);
|
||||
|
||||
BlockPos toPos = this.worldPosition.relative(facing);
|
||||
if (this.level.hasChunkAt(toPos)) {
|
||||
TileEntity to = this.level.getBlockEntity(toPos);
|
||||
if (to != null && !(to instanceof TileEntityItemViewer)) {
|
||||
BlockPos toPos = this.pos.offset(facing);
|
||||
if (this.world.isBlockLoaded(toPos)) {
|
||||
TileEntity to = this.world.getTileEntity(toPos);
|
||||
if (to != null && !(to instanceof TileEntityItemInterface)) {
|
||||
LazyOptional<IItemHandler> normal = to.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing.getOpposite());
|
||||
|
||||
Object slotless = null;
|
|
@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.api.laser.IConnectionPair;
|
|||
import de.ellpeck.actuallyadditions.api.laser.LaserType;
|
||||
import de.ellpeck.actuallyadditions.api.laser.Network;
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewer.GenericItemHandlerInfo;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemInterface.GenericItemHandlerInfo;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.compat.SlotlessableItemHandlerWrapper;
|
||||
|
|
|
@ -29,14 +29,12 @@ import net.minecraft.util.text.StringTextComponent;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
||||
|
||||
public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem implements IButtonReactor, INamedContainerProvider {
|
||||
public class TileEntityLaserRelayItemAdvanced extends TileEntityLaserRelayItem implements IButtonReactor, INamedContainerProvider {
|
||||
|
||||
public FilterSettings leftFilter = new FilterSettings(12, true, true, false, false, 0, -1000);
|
||||
public FilterSettings rightFilter = new FilterSettings(12, true, true, false, false, 0, -2000);
|
||||
|
||||
public TileEntityLaserRelayItemWhitelist() {
|
||||
public TileEntityLaserRelayItemAdvanced() {
|
||||
super(ActuallyTiles.LASERRELAYITEMWHITELIST_TILE.get());
|
||||
}
|
||||
|
||||
|
@ -133,7 +131,7 @@ public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem
|
|||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
if (!this.level.isClientSide) {
|
||||
if (!this.world.isRemote) {
|
||||
if ((this.leftFilter.needsUpdateSend() || this.rightFilter.needsUpdateSend()) && this.sendUpdateWithInterval()) {
|
||||
this.leftFilter.updateLasts();
|
||||
this.rightFilter.updateLasts();
|
|
@ -34,9 +34,7 @@ import net.minecraftforge.energy.IEnergyStorage;
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
||||
|
||||
public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implements INamedContainerProvider {
|
||||
public class TileEntityLongRangeBreaker extends TileEntityInventoryBase implements INamedContainerProvider {
|
||||
|
||||
public static final int RANGE = 8;
|
||||
public static final int ENERGY_USE = 5;
|
||||
|
@ -45,7 +43,7 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem
|
|||
private int lastEnergy;
|
||||
private int currentTime;
|
||||
|
||||
public TileEntityDirectionalBreaker() {
|
||||
public TileEntityLongRangeBreaker() {
|
||||
super(ActuallyTiles.DIRECTIONALBREAKER_TILE.get(), 9);
|
||||
}
|
||||
|
||||
|
@ -70,7 +68,7 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!this.level.isClientSide) {
|
||||
if (!this.world.isRemote) {
|
||||
if (!this.isRedstonePowered && !this.isPulseMode) {
|
||||
if (this.currentTime > 0) {
|
||||
this.currentTime--;
|
||||
|
@ -90,24 +88,24 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem
|
|||
|
||||
private void doWork() {
|
||||
if (this.storage.getEnergyStored() >= ENERGY_USE * RANGE) {
|
||||
BlockState state = this.level.getBlockState(this.worldPosition);
|
||||
BlockState state = this.world.getBlockState(this.pos);
|
||||
Direction sideToManipulate = WorldUtil.getDirectionByPistonRotation(state);
|
||||
|
||||
for (int i = 0; i < RANGE; i++) {
|
||||
BlockPos coordsBlock = this.worldPosition.relative(sideToManipulate, i + 1);
|
||||
BlockState breakState = this.level.getBlockState(coordsBlock);
|
||||
BlockPos coordsBlock = this.pos.offset(sideToManipulate, i + 1);
|
||||
BlockState breakState = this.world.getBlockState(coordsBlock);
|
||||
Block blockToBreak = breakState.getBlock();
|
||||
if (blockToBreak != null && !this.level.isEmptyBlock(coordsBlock) && this.level.getBlockState(coordsBlock).getDestroySpeed(this.level, coordsBlock) > -1.0F) {
|
||||
List<ItemStack> drops = Block.getDrops(breakState, (ServerWorld) this.level, coordsBlock, this.level.getBlockEntity(coordsBlock));
|
||||
float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, drops, this.level, coordsBlock);
|
||||
if (blockToBreak != null && !this.world.isAirBlock(coordsBlock) && this.world.getBlockState(coordsBlock).getBlockHardness(this.world, coordsBlock) > -1.0F) {
|
||||
List<ItemStack> drops = Block.getDrops(breakState, (ServerWorld) this.world, coordsBlock, this.world.getTileEntity(coordsBlock));
|
||||
float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, drops, this.world, coordsBlock);
|
||||
|
||||
if (chance > 0 && this.level.random.nextFloat() <= chance) {
|
||||
if (chance > 0 && this.world.rand.nextFloat() <= chance) {
|
||||
if (StackUtil.canAddAll(this.inv, drops, false)) {
|
||||
this.level.levelEvent(2001, coordsBlock, Block.getId(this.level.getBlockState(coordsBlock)));
|
||||
this.level.setBlockAndUpdate(coordsBlock, Blocks.AIR.defaultBlockState());
|
||||
this.world.playEvent(2001, coordsBlock, Block.getStateId(this.world.getBlockState(coordsBlock)));
|
||||
this.world.setBlockState(coordsBlock, Blocks.AIR.getDefaultState());
|
||||
StackUtil.addAll(this.inv, drops, false);
|
||||
this.storage.extractEnergyInternal(ENERGY_USE, false);
|
||||
this.setChanged();
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,16 +10,17 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.tile;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.energy.CapabilityEnergy;
|
||||
|
||||
public class TileEntityPhantomEnergyface extends TileEntityPhantomface implements ISharingEnergyProvider {
|
||||
public class TileEntityPhantomEnergyface extends TileEntityPhantomFace implements ISharingEnergyProvider {
|
||||
|
||||
public TileEntityPhantomEnergyface() {
|
||||
super(ActuallyTiles.PHANTOMENERGYFACE_TILE.get());
|
||||
super(ActuallyBlocks.PHANTOM_ENERGYFACE.getTileEntityType());
|
||||
this.type = BlockPhantom.Type.ENERGYFACE;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.tile;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
|
||||
|
@ -18,11 +19,11 @@ import net.minecraft.util.Direction;
|
|||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
|
||||
public class TileEntityPhantomItemface extends TileEntityPhantomface {
|
||||
public class TileEntityPhantomItemface extends TileEntityPhantomFace {
|
||||
|
||||
public TileEntityPhantomItemface() {
|
||||
super(ActuallyTiles.PHANTOMITEMFACE_TILE.get());
|
||||
this.type = BlockPhantom.Type.FACE;
|
||||
super(ActuallyBlocks.PHANTOM_ITEMFACE.getTileEntityType());
|
||||
this.type = BlockPhantom.Type.ITEMFACE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,16 +10,17 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.tile;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
|
||||
public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements ISharingFluidHandler {
|
||||
public class TileEntityPhantomLiquiface extends TileEntityPhantomFace implements ISharingFluidHandler {
|
||||
|
||||
public TileEntityPhantomLiquiface() {
|
||||
super(ActuallyTiles.PHANTOMLIQUIFACE_TILE.get());
|
||||
super(ActuallyBlocks.PHANTOM_LIQUIFACE.getTileEntityType());
|
||||
this.type = BlockPhantom.Type.LIQUIFACE;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.tile;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.tile.IPhantomTile;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerPhantomPlacer;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
|
||||
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
|
||||
|
@ -55,7 +56,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
|
|||
}
|
||||
|
||||
public TileEntityPhantomPlacer() {
|
||||
super(ActuallyTiles.PHANTOMPLACER_TILE.get(), 9);
|
||||
super(ActuallyBlocks.PHANTOM_PLACER.getTileEntityType(), 9);
|
||||
this.isBreaker = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import net.minecraftforge.common.capabilities.Capability;
|
|||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class TileEntityPhantomRedstoneface extends TileEntityPhantomface {
|
||||
public class TileEntityPhantomRedstoneface extends TileEntityPhantomFace {
|
||||
|
||||
public final int[] providesStrong = new int[Direction.values().length];
|
||||
public final int[] providesWeak = new int[Direction.values().length];
|
||||
|
|
|
@ -43,7 +43,7 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
|
|||
private Block boundBlockBefore;
|
||||
private int lastStrength;
|
||||
|
||||
public TileEntityPhantomface(TileEntityType<?> type) {
|
||||
public TileEntityPhantomFace(TileEntityType<?> type) {
|
||||
super(type, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,9 +35,7 @@ import net.minecraftforge.energy.IEnergyStorage;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
||||
|
||||
public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements IButtonReactor, INamedContainerProvider {
|
||||
public class TileEntityPoweredFurnace extends TileEntityInventoryBase implements IButtonReactor, INamedContainerProvider {
|
||||
|
||||
public static final int SLOT_INPUT_1 = 0;
|
||||
public static final int SLOT_OUTPUT_1 = 1;
|
||||
|
@ -56,7 +54,7 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements
|
|||
private boolean lastAutoSplit;
|
||||
private boolean lastSmelted;
|
||||
|
||||
public TileEntityFurnaceDouble() {
|
||||
public TileEntityPoweredFurnace() {
|
||||
super(ActuallyTiles.FURNACE_DOUBLE_TILE.get(), 4);
|
||||
}
|
||||
|
||||
|
@ -113,7 +111,7 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!this.level.isClientSide) {
|
||||
if (!this.world.isRemote) {
|
||||
if (this.isAutoSplit) {
|
||||
autoSplit(this.inv, SLOT_INPUT_1, SLOT_INPUT_2);
|
||||
}
|
||||
|
@ -151,8 +149,8 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements
|
|||
this.secondSmeltTime = 0;
|
||||
}
|
||||
|
||||
BlockState currState = this.level.getBlockState(this.worldPosition);
|
||||
boolean current = currState.getValue(BlockStateProperties.LIT);
|
||||
BlockState currState = this.world.getBlockState(this.pos);
|
||||
boolean current = currState.get(BlockStateProperties.LIT);
|
||||
boolean changeTo = current;
|
||||
if (this.lastSmelted != smelted) {
|
||||
changeTo = smelted;
|
||||
|
@ -165,7 +163,7 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements
|
|||
}
|
||||
|
||||
if (changeTo != current) {
|
||||
this.level.setBlockAndUpdate(this.worldPosition, currState.setValue(BlockStateProperties.LIT, changeTo));
|
||||
this.world.setBlockState(this.pos, currState.with(BlockStateProperties.LIT, changeTo));
|
||||
}
|
||||
|
||||
this.lastSmelted = smelted;
|
||||
|
@ -193,7 +191,7 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements
|
|||
if (StackUtil.isValid(this.inv.getStackInSlot(theInput))) {
|
||||
ItemStack output = FurnaceRecipes.instance().getSmeltingResult(this.inv.getStackInSlot(theInput));
|
||||
if (StackUtil.isValid(output)) {
|
||||
if (!StackUtil.isValid(this.inv.getStackInSlot(theOutput)) || this.inv.getStackInSlot(theOutput).sameItem(output) && this.inv.getStackInSlot(theOutput).getCount() <= this.inv.getStackInSlot(theOutput).getMaxStackSize() - output.getCount()) {
|
||||
if (!StackUtil.isValid(this.inv.getStackInSlot(theOutput)) || this.inv.getStackInSlot(theOutput).isItemEqual(output) && this.inv.getStackInSlot(theOutput).getCount() <= this.inv.getStackInSlot(theOutput).getMaxStackSize() - output.getCount()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -225,7 +223,7 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements
|
|||
public void onButtonPressed(int buttonID, PlayerEntity player) {
|
||||
if (buttonID == 0) {
|
||||
this.isAutoSplit = !this.isAutoSplit;
|
||||
this.setChanged();
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
|
|
@ -42,9 +42,7 @@ import net.minecraftforge.fluids.IFluidBlock;
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
|
||||
|
||||
public class TileEntityMiner extends TileEntityInventoryBase implements IButtonReactor, IEnergyDisplay, INamedContainerProvider {
|
||||
public class TileEntityVerticalDigger extends TileEntityInventoryBase implements IButtonReactor, IEnergyDisplay, INamedContainerProvider {
|
||||
|
||||
public static final int ENERGY_USE_PER_BLOCK = 650;
|
||||
public static final int DEFAULT_RANGE = 2;
|
||||
|
@ -59,7 +57,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IButtonR
|
|||
private int oldCheckY;
|
||||
private int oldCheckZ;
|
||||
|
||||
public TileEntityMiner() {
|
||||
public TileEntityVerticalDigger() {
|
||||
super(ActuallyTiles.MINER_TILE.get(), 9);
|
||||
}
|
||||
|
||||
|
@ -92,13 +90,13 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IButtonR
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!this.level.isClientSide) {
|
||||
if (!this.world.isRemote) {
|
||||
|
||||
if (!this.isRedstonePowered && this.ticksElapsed % 5 == 0) {
|
||||
if (this.checkY != 0) {
|
||||
int range = TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, this.level, this.worldPosition);
|
||||
int range = TileEntityPhantomFace.upgradeRange(DEFAULT_RANGE, this.world, this.pos);
|
||||
if (this.checkY < 0) {
|
||||
this.checkY = this.worldPosition.getY() - 1;
|
||||
this.checkY = this.pos.getY() - 1;
|
||||
this.checkX = -range;
|
||||
this.checkZ = -range;
|
||||
}
|
||||
|
@ -133,23 +131,23 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IButtonR
|
|||
? 3
|
||||
: 1);
|
||||
if (this.storage.getEnergyStored() >= actualUse) {
|
||||
BlockPos pos = new BlockPos(this.worldPosition.getX() + this.checkX, this.checkY, this.worldPosition.getZ() + this.checkZ);
|
||||
BlockPos pos = new BlockPos(this.pos.getX() + this.checkX, this.checkY, this.pos.getZ() + this.checkZ);
|
||||
|
||||
BlockState state = this.level.getBlockState(pos);
|
||||
BlockState state = this.world.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
ItemStack stack = block.getPickBlock(state, new BlockRayTraceResult(new Vector3d(0, 0, 0), Direction.DOWN, pos, false), this.level, pos, FakePlayerFactory.getMinecraft((ServerWorld) this.level));
|
||||
if (!block.isAir(this.level.getBlockState(pos), this.level, pos)) {
|
||||
if (block.getHarvestLevel(this.level.getBlockState(pos)) <= ItemDrill.HARVEST_LEVEL && state.getDestroySpeed(this.level, pos) >= 0F && !(block instanceof IFluidBlock) && this.isMinable(block, stack)) {
|
||||
List<ItemStack> drops = Block.getDrops(state, (ServerWorld) this.level, pos, this.level.getBlockEntity(pos));
|
||||
float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, drops, this.level, pos);
|
||||
ItemStack stack = block.getPickBlock(state, new BlockRayTraceResult(new Vector3d(0, 0, 0), Direction.DOWN, pos, false), this.world, pos, FakePlayerFactory.getMinecraft((ServerWorld) this.world));
|
||||
if (!block.isAir(this.world.getBlockState(pos), this.world, pos)) {
|
||||
if (block.getHarvestLevel(this.world.getBlockState(pos)) <= ItemDrill.HARVEST_LEVEL && state.getBlockHardness(this.world, pos) >= 0F && !(block instanceof IFluidBlock) && this.isMinable(block, stack)) {
|
||||
List<ItemStack> drops = Block.getDrops(state, (ServerWorld) this.world, pos, this.world.getTileEntity(pos));
|
||||
float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, drops, this.world, pos);
|
||||
|
||||
if (chance > 0 && this.level.random.nextFloat() <= chance) {
|
||||
if (chance > 0 && this.world.rand.nextFloat() <= chance) {
|
||||
if (StackUtil.canAddAll(this.inv, drops, false)) {
|
||||
this.level.levelEvent(2001, pos, Block.getId(this.level.getBlockState(pos)));
|
||||
this.level.setBlockAndUpdate(pos, Blocks.AIR.defaultBlockState());
|
||||
this.world.playEvent(2001, pos, Block.getStateId(this.world.getBlockState(pos)));
|
||||
this.world.setBlockState(pos, Blocks.AIR.getDefaultState());
|
||||
|
||||
StackUtil.addAll(this.inv, drops, false);
|
||||
this.setChanged();
|
||||
this.markDirty();
|
||||
|
||||
this.storage.extractEnergyInternal(actualUse, false);
|
||||
this.shootParticles(pos.getX(), pos.getY(), pos.getZ());
|
||||
|
@ -198,7 +196,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IButtonR
|
|||
}
|
||||
|
||||
private void shootParticles(int endX, int endY, int endZ) {
|
||||
AssetUtil.spawnLaserWithTimeServer(this.level, this.getBlockPos().getX(), this.getBlockPos().getY(), this.getBlockPos().getZ(), endX, endY, endZ, new float[]{65F / 255F, 150F / 255F, 2F / 255F}, 10, 120, 0.1F, 0.8F);
|
||||
AssetUtil.spawnLaserWithTimeServer(this.world, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), endX, endY, endZ, new float[]{65F / 255F, 150F / 255F, 2F / 255F}, 10, 120, 0.1F, 0.8F);
|
||||
}
|
||||
|
||||
private boolean isBlacklisted(Block block) {
|
|
@ -0,0 +1,102 @@
|
|||
package de.ellpeck.actuallyadditions.registration;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.fml.RegistryObject;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class AABlockReg<B extends Block, I extends Item, T extends TileEntity> implements Supplier<Block> {
|
||||
//public class AABlock implements Supplier<Block> {
|
||||
private final String name;
|
||||
private final RegistryObject<B> block;
|
||||
private final RegistryObject<I> item;
|
||||
private RegistryObject<TileEntityType<T>> tileEntityType;
|
||||
|
||||
public AABlockReg(String name, Supplier<B> blockSupplier, Function<B, I> itemSupplier, Supplier<T> tileSupplier) {
|
||||
this.name = name;
|
||||
this.block = ActuallyBlocks.BLOCKS.register(name, blockSupplier);
|
||||
this.item = ActuallyItems.ITEMS.register(name, () -> itemSupplier.apply(block.get()));
|
||||
this.tileEntityType = ActuallyBlocks.TILES.register(name, () -> TileEntityType.Builder.create(tileSupplier, block.get()).build(null));
|
||||
}
|
||||
public AABlockReg(String name, Supplier<B> blockSupplier, Function<B, I> itemSupplier) {
|
||||
this.name = name;
|
||||
this.block = ActuallyBlocks.BLOCKS.register(name, blockSupplier);
|
||||
this.item = ActuallyItems.ITEMS.register(name, () -> itemSupplier.apply(block.get()));
|
||||
}
|
||||
|
||||
/*
|
||||
public AABlock(BlockBuilder builder) {
|
||||
this.name = builder.name;
|
||||
this.block = ActuallyBlocks.BLOCKS.register(name, builder.blockSupplier);
|
||||
this.item = ActuallyItems.ITEMS.register(name, () -> builder.itemSupplier.apply(block.get()));
|
||||
if (builder.hasTile)
|
||||
this.tileEntityType = ActuallyTiles.TILES.register(name, () -> TileEntityType.Builder.create(builder.tileSupplier, block.get()).build(null));
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
public String getName() {return name;}
|
||||
|
||||
@Override
|
||||
public Block get() {
|
||||
return block.get();
|
||||
}
|
||||
|
||||
public B getBlock() {
|
||||
return block.get();
|
||||
}
|
||||
|
||||
public I getItem() {
|
||||
return item.get();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public TileEntityType<T> getTileEntityType() { return Objects.requireNonNull(tileEntityType.get());}
|
||||
|
||||
|
||||
public static class BlockBuilder {
|
||||
private final String name;
|
||||
private Supplier<Block> blockSupplier;
|
||||
private Function<Block, Item> itemSupplier = (b) -> new BlockItem(b, ActuallyItems.defaultProps());
|
||||
private boolean hasTile = false;
|
||||
private Supplier<TileEntityType<?>> tileSupplier;
|
||||
|
||||
private BlockBuilder(String nameIn, Supplier<Block> blockSupplierIn) {
|
||||
this.name = nameIn;
|
||||
this.blockSupplier = blockSupplierIn;
|
||||
}
|
||||
|
||||
public static BlockBuilder block(String nameIn, Supplier<Block> blockSupplierIn) {
|
||||
return new BlockBuilder(nameIn, blockSupplierIn);
|
||||
}
|
||||
|
||||
public BlockBuilder item(Function<Block, Item> itemSupplierIn) {
|
||||
itemSupplier = itemSupplierIn;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public BlockBuilder tile(Supplier<TileEntityType<?>> tileSupplierIn) {
|
||||
tileSupplier = tileSupplierIn;
|
||||
hasTile = true;
|
||||
|
||||
return this;
|
||||
}
|
||||
/*
|
||||
public AABlock build() {
|
||||
return new AABlock(this);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue