Apply more refactoring

This commit is contained in:
Zontreck 2024-02-28 18:12:30 -07:00
parent e124c9a616
commit c85119bb02
30 changed files with 921 additions and 1430 deletions

View file

@ -1,487 +0,0 @@
/*
* @file ModConfig.java
* @author Stefan Wilhelm (wile)
* @copyright (C) 2020 Stefan Wilhelm
* @license MIT (see https://opensource.org/licenses/MIT)
*
* Main class for module settings. Handles reading and
* saving the config file.
*/
package dev.zontreck.engineersdecor;
import dev.zontreck.engineersdecor.blocks.*;
import dev.zontreck.engineersdecor.detail.TreeCutting;
import dev.zontreck.libzontreck.edlibmc.Auxiliaries;
import dev.zontreck.libzontreck.edlibmc.OptionalRecipeCondition;
import dev.zontreck.libzontreck.edlibmc.SlabSliceBlock;
import dev.zontreck.libzontreck.edlibmc.VariantSlabBlock;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.common.ForgeConfigSpec;
import org.apache.commons.lang3.tuple.Pair;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
public class ModConfig {
public static final CommonConfig COMMON;
public static final ServerConfig SERVER;
public static final ForgeConfigSpec COMMON_CONFIG_SPEC;
public static final ForgeConfigSpec SERVER_CONFIG_SPEC;
//--------------------------------------------------------------------------------------------------------------------
private static final String MODID = ModEngineersDecor.MODID;
private static final CompoundTag server_config_ = new CompoundTag();
//--------------------------------------------------------------------------------------------------------------------
public static boolean immersiveengineering_installed = false;
//--------------------------------------------------------------------------------------------------------------------
public static boolean without_direct_slab_pickup = false;
//--------------------------------------------------------------------------------------------------------------------
// Optout checks
//--------------------------------------------------------------------------------------------------------------------
public static boolean with_creative_mode_device_drops = false;
private static HashSet<String> optouts_ = new HashSet<>();
private static boolean with_experimental_features_ = false;
private static boolean with_config_logging_ = false;
private static boolean with_debug_logs_ = false;
static {
final Pair<CommonConfig, ForgeConfigSpec> common_ = (new ForgeConfigSpec.Builder()).configure(CommonConfig::new);
COMMON_CONFIG_SPEC = common_.getRight();
COMMON = common_.getLeft();
final Pair<ServerConfig, ForgeConfigSpec> server_ = (new ForgeConfigSpec.Builder()).configure(ServerConfig::new);
SERVER_CONFIG_SPEC = server_.getRight();
SERVER = server_.getLeft();
}
//--------------------------------------------------------------------------------------------------------------------
// Cache
//--------------------------------------------------------------------------------------------------------------------
public static boolean isOptedOut(final @Nullable Block block) {
return (block == null) || isOptedOut(block.asItem());
}
public static boolean isOptedOut(final @Nullable Item item) {
return (item != null) && optouts_.contains(Auxiliaries.getResourceLocation(item).getPath());
}
public static boolean withExperimental() {
return with_experimental_features_;
}
public static boolean withoutRecipes() {
return false;
}
public static boolean withDebug() {
return with_debug_logs_;
}
public static boolean withDebugLogging() {
return with_experimental_features_ && with_config_logging_;
}
public static CompoundTag getServerConfig() // config that may be synchronized from server to client via net pkg.
{
return server_config_;
}
private static void updateOptouts() {
final ArrayList<String> includes = new ArrayList<>();
final ArrayList<String> excludes = new ArrayList<>();
{
String inc = COMMON.pattern_includes.get().toLowerCase().replaceAll(MODID + ":", "").replaceAll("[^*_,a-z\\d]", "");
if (!COMMON.pattern_includes.get().equals(inc)) COMMON.pattern_includes.set(inc);
String[] incl = inc.split(",");
for (int i = 0; i < incl.length; ++i) {
incl[i] = incl[i].replaceAll("[*]", ".*?");
if (!incl[i].isEmpty()) includes.add(incl[i]);
}
}
{
String exc = COMMON.pattern_excludes.get().toLowerCase().replaceAll(MODID + ":", "").replaceAll("[^*_,a-z\\d]", "");
String[] excl = exc.split(",");
for (int i = 0; i < excl.length; ++i) {
excl[i] = excl[i].replaceAll("[*]", ".*?");
if (!excl[i].isEmpty()) excludes.add(excl[i]);
}
}
if (!excludes.isEmpty()) log("Config pattern excludes: '" + String.join(",", excludes) + "'");
if (!includes.isEmpty()) log("Config pattern includes: '" + String.join(",", includes) + "'");
try {
HashSet<String> optouts = new HashSet<>();
ModContent.getRegisteredBlocks().stream().filter((Block block) -> {
if (block == null) return true;
if (block == ModContent.getBlock("sign_decor")) return true;
try {
if (!with_experimental_features_) {
if (block instanceof Auxiliaries.IExperimentalFeature) return true;
}
// Force-include/exclude pattern matching
final String rn = Auxiliaries.getResourceLocation(block).getPath();
try {
for (String e : includes) {
if (rn.matches(e)) {
log("Optout force include: " + rn);
return false;
}
}
for (String e : excludes) {
if (rn.matches(e)) {
log("Optout force exclude: " + rn);
return true;
}
}
} catch (Throwable ex) {
Auxiliaries.logger().error("optout include pattern failed, disabling.");
includes.clear();
excludes.clear();
}
} catch (Exception ex) {
Auxiliaries.logger().error("Exception evaluating the optout config: '" + ex.getMessage() + "'");
}
return false;
}).forEach(
e -> optouts.add(Auxiliaries.getResourceLocation(e).getPath())
);
optouts_ = optouts;
OptionalRecipeCondition.on_config(withExperimental(), withoutRecipes(), ModConfig::isOptedOut, ModConfig::isOptedOut);
} catch (Throwable ex) {
Auxiliaries.logger().error("Exception evaluating the optout config: '" + ex.getMessage() + "'"); // Compat issue: config-apply may be called before the registries are all loaded.
}
}
public static void apply() {
with_config_logging_ = COMMON.with_config_logging.get();
with_experimental_features_ = COMMON.with_experimental.get();
with_debug_logs_ = COMMON.with_debug_logging.get();
if (with_experimental_features_) Auxiliaries.logger().info("Config: EXPERIMENTAL FEATURES ENABLED.");
if (with_debug_logs_)
Auxiliaries.logger().info("Config: DEBUG LOGGING ENABLED, WARNING, THIS MAY SPAM THE LOG.");
immersiveengineering_installed = Auxiliaries.isModLoaded("immersiveengineering");
updateOptouts();
if (!SERVER_CONFIG_SPEC.isLoaded()) return;
without_direct_slab_pickup = SERVER.without_direct_slab_pickup.get();
// -----------------------------------------------------------------------------------------------------------------
EdChair.on_config(SERVER.without_chair_sitting.get(), SERVER.without_mob_chair_sitting.get(), SERVER.chair_mob_sitting_probability_percent.get(), SERVER.chair_mob_standup_probability_percent.get());
EdLadderBlock.on_config(SERVER.without_ladder_speed_boost.get());
VariantSlabBlock.on_config(!SERVER.without_direct_slab_pickup.get());
SlabSliceBlock.on_config(!SERVER.without_direct_slab_pickup.get());
EdFluidBarrel.on_config(12000, 1000);
EdFluidFunnel.on_config(with_experimental_features_);
EdPipeValve.on_config(SERVER.pipevalve_max_flowrate.get(), SERVER.pipevalve_redstone_gain.get());
EdHopper.on_config();
EdDropper.on_config(true);
EdPlacer.on_config();
EdBreaker.on_config(SERVER.block_breaker_power_consumption.get(), SERVER.block_breaker_reluctance.get(), SERVER.block_breaker_min_breaking_time.get(), SERVER.block_breaker_requires_power.get());
EdTreeCutter.on_config(SERVER.tree_cutter_energy_consumption.get(), SERVER.tree_cutter_cutting_time_needed.get(), SERVER.tree_cutter_requires_power.get());
EdFurnace.on_config(SERVER.furnace_smelting_speed_percent.get(), SERVER.furnace_fuel_efficiency_percent.get(), SERVER.furnace_boost_energy_consumption.get(), SERVER.furnace_accepted_heaters.get());
EdElectricalFurnace.on_config(SERVER.e_furnace_speed_percent.get(), SERVER.e_furnace_power_consumption.get(), SERVER.e_furnace_automatic_pulling.get());
EdSolarPanel.on_config(SERVER.small_solar_panel_peak_production.get(), 64000, 1024);
EdMilker.on_config(SERVER.milking_machine_energy_consumption.get(), SERVER.milking_machine_milking_delay.get());
EdFreezer.on_config(144, 2);
EdMineralSmelter.on_config(144, 2);
EdWasteIncinerator.on_config(8);
// -----------------------------------------------------------------------------------------------------------------
{
final List<String> universal_logs = new ArrayList<>(SERVER.tree_cutter_universal_logs.get());
// Fixed known blocks. @todo, also check AE/menril, etc.
universal_logs.add("myrtrees:filled_rubberwood_log");
TreeCutting.on_config(universal_logs);
}
// -----------------------------------------------------------------------------------------------------------------
{
// Check if the config is already synchronized or has to be synchronised.
server_config_.putBoolean("tree_cutter_requires_power", SERVER.tree_cutter_requires_power.get());
server_config_.putBoolean("block_breaker_requires_power", SERVER.block_breaker_requires_power.get());
{
String s = String.join(",", optouts_);
server_config_.putString("optout", s);
if (!s.isEmpty()) log("Opt-outs:" + s);
}
}
}
public static void log(String config_message) {
if (!with_config_logging_) return;
Auxiliaries.logger().info(config_message);
}
public static class CommonConfig {
// Optout
public final ForgeConfigSpec.ConfigValue<String> pattern_excludes;
public final ForgeConfigSpec.ConfigValue<String> pattern_includes;
// MISC
public final ForgeConfigSpec.BooleanValue with_creative_mode_device_drops;
public final ForgeConfigSpec.BooleanValue with_experimental;
public final ForgeConfigSpec.BooleanValue with_config_logging;
public final ForgeConfigSpec.BooleanValue with_debug_logging;
CommonConfig(ForgeConfigSpec.Builder builder) {
builder.comment("Settings affecting the logical server side.")
.push("server");
// --- OPTOUTS ------------------------------------------------------------
{
builder.comment("Opt-out settings")
.push("optout");
pattern_excludes = builder
.translation(MODID + ".config.pattern_excludes")
.comment("Opt-out any block by its registry name ('*' wildcard matching, "
+ "comma separated list, whitespaces ignored. You must match the whole name, "
+ "means maybe add '*' also at the begin and end. Example: '*wood*,*steel*' "
+ "excludes everything that has 'wood' or 'steel' in the registry name. "
+ "The matching result is also traced in the log file. ")
.define("pattern_excludes", "");
pattern_includes = builder
.translation(MODID + ".config.pattern_includes")
.comment("Prevent blocks from being opt'ed by registry name ('*' wildcard matching, "
+ "comma separated list, whitespaces ignored. Evaluated before all other opt-out checks. "
+ "You must match the whole name, means maybe add '*' also at the begin and end. Example: "
+ "'*wood*,*steel*' includes everything that has 'wood' or 'steel' in the registry name."
+ "The matching result is also traced in the log file.")
.define("pattern_includes", "");
builder.pop();
}
// --- MISC ---------------------------------------------------------------
{
builder.comment("Miscellaneous settings")
.push("miscellaneous");
with_experimental = builder
.translation(MODID + ".config.with_experimental")
.comment("Enables experimental features. Use at own risk.")
.define("with_experimental", false);
with_creative_mode_device_drops = builder
.translation(MODID + ".config.with_creative_mode_device_drops")
.comment("Enable that devices are dropped as item also in creative mode, allowing " +
" to relocate them with contents and settings.")
.define("with_creative_mode_device_drops", false);
with_config_logging = builder
.translation(MODID + ".config.with_debug_logging")
.comment("Enable detailed logging of the config values and resulting calculations in each mod feature config.")
.define("with_debug_logging", false);
with_debug_logging = builder
.translation(MODID + ".config.with_debug_logging")
.comment("Enable debug log messages for trouble shooting. Don't activate if not really needed, this can spam the log file.")
.define("with_debug_logging", false);
builder.pop();
}
}
}
public static class ServerConfig {
// Optout
public final ForgeConfigSpec.BooleanValue without_chair_sitting;
public final ForgeConfigSpec.BooleanValue without_mob_chair_sitting;
public final ForgeConfigSpec.BooleanValue without_ladder_speed_boost;
public final ForgeConfigSpec.BooleanValue without_crafting_table_history;
// Misc
public final ForgeConfigSpec.BooleanValue without_direct_slab_pickup;
// Tweaks
public final ForgeConfigSpec.IntValue furnace_smelting_speed_percent;
public final ForgeConfigSpec.IntValue furnace_fuel_efficiency_percent;
public final ForgeConfigSpec.IntValue furnace_boost_energy_consumption;
public final ForgeConfigSpec.ConfigValue<String> furnace_accepted_heaters;
public final ForgeConfigSpec.IntValue e_furnace_speed_percent;
public final ForgeConfigSpec.IntValue e_furnace_power_consumption;
public final ForgeConfigSpec.IntValue small_solar_panel_peak_production;
public final ForgeConfigSpec.BooleanValue e_furnace_automatic_pulling;
public final ForgeConfigSpec.DoubleValue chair_mob_sitting_probability_percent;
public final ForgeConfigSpec.DoubleValue chair_mob_standup_probability_percent;
public final ForgeConfigSpec.BooleanValue without_crafting_mouse_scrolling;
public final ForgeConfigSpec.IntValue pipevalve_max_flowrate;
public final ForgeConfigSpec.IntValue pipevalve_redstone_gain;
public final ForgeConfigSpec.IntValue block_breaker_power_consumption;
public final ForgeConfigSpec.IntValue block_breaker_reluctance;
public final ForgeConfigSpec.IntValue block_breaker_min_breaking_time;
public final ForgeConfigSpec.BooleanValue block_breaker_requires_power;
public final ForgeConfigSpec.IntValue tree_cutter_energy_consumption;
public final ForgeConfigSpec.IntValue tree_cutter_cutting_time_needed;
public final ForgeConfigSpec.BooleanValue tree_cutter_requires_power;
public final ForgeConfigSpec.ConfigValue<List<String>> tree_cutter_universal_logs;
public final ForgeConfigSpec.IntValue milking_machine_energy_consumption;
public final ForgeConfigSpec.IntValue milking_machine_milking_delay;
ServerConfig(ForgeConfigSpec.Builder builder) {
builder.comment("Settings affecting the logical server side.")
.push("server");
// --- OPTOUTS ------------------------------------------------------------
{
builder.comment("Server dev opt-out settings !WARNING THE OPT-OUTs will be moved to common-config.toml in the next MC version!")
.push("optout");
without_chair_sitting = builder
.translation(MODID + ".config.without_chair_sitting")
.comment("Disable possibility to sit on stools and chairs.")
.define("without_chair_sitting", false);
without_mob_chair_sitting = builder
.translation(MODID + ".config.without_mob_chair_sitting")
.comment("Disable that mobs will sit on chairs and stools.")
.define("without_mob_chair_sitting", false);
without_ladder_speed_boost = builder
.translation(MODID + ".config.without_ladder_speed_boost")
.comment("Disable the speed boost of ladders in this mod.")
.define("without_ladder_speed_boost", false);
without_crafting_table_history = builder
.translation(MODID + ".config.without_crafting_table_history")
.comment("Disable history refabrication feature of the crafting table.")
.define("without_crafting_table_history", false);
builder.pop();
}
// --- MISC ---------------------------------------------------------------
{
builder.comment("Miscellaneous settings")
.push("miscellaneous");
without_direct_slab_pickup = builder
.translation(MODID + ".config.without_direct_slab_pickup")
.comment("Disable directly picking up layers from slabs and slab " +
" slices by left clicking while looking up/down.")
.define("without_direct_slab_pickup", false);
builder.pop();
}
// --- TWEAKS -------------------------------------------------------------
{
builder.comment("Tweaks")
.push("tweaks");
furnace_smelting_speed_percent = builder
.translation(MODID + ".config.furnace_smelting_speed_percent")
.comment("Defines, in percent, how fast the lab furnace smelts compared to " +
"a vanilla furnace. 100% means vanilla furnace speed, 150% means the " +
"lab furnace is faster. The value can be changed on-the-fly for tuning.")
.defineInRange("furnace_smelting_speed_percent", 130, 50, 800);
furnace_fuel_efficiency_percent = builder
.translation(MODID + ".config.furnace_fuel_efficiency_percent")
.comment("Defines, in percent, how fuel efficient the lab furnace is, compared " +
"to a vanilla furnace. 100% means vanilla furnace consumiton, 200% means " +
"the lab furnace needs about half the fuel of a vanilla furnace, " +
"The value can be changed on-the-fly for tuning.")
.defineInRange("furnace_fuel_efficiency_percent", 100, 50, 400);
furnace_boost_energy_consumption = builder
.translation(MODID + ".config.furnace_boost_energy_consumption")
.comment("Defines the energy consumption (per tick) for speeding up the smelting process. " +
"If IE is installed, an external heater has to be inserted into an auxiliary slot " +
"of the lab furnace. The power source needs to be able to provide at least 4 times " +
"this consumption (fixed threshold value). The value can be changed on-the-fly for tuning. " +
"The default value corresponds to the IE heater consumption.")
.defineInRange("furnace_boost_energy_consumption", 24, 2, 1024);
furnace_accepted_heaters = builder
.translation(MODID + ".config.furnace_accepted_heaters")
.comment("Defines (as comma separated list of full registry names) which items are allowed as external " +
"heaters in the Aux slot for powered speed boosting.")
.define("furnace_accepted_heaters", "immersiveengineering:furnace_heater");
chair_mob_sitting_probability_percent = builder
.translation(MODID + ".config.chair_mob_sitting_probability_percent")
.comment("Defines, in percent, how high the probability is that a mob sits on a chair " +
"when colliding with it. Can be changed on-the-fly for tuning.")
.defineInRange("chair_mob_sitting_probability_percent", 10.0, 0.0, 80.0);
chair_mob_standup_probability_percent = builder
.translation(MODID + ".config.chair_mob_standup_probability_percent")
.comment("Defines, in percent, probable it is that a mob leaves a chair when sitting " +
"on it. The 'dice is rolled' about every 20 ticks. There is also a minimum " +
"Sitting time of about 3s. The config value can be changed on-the-fly for tuning.")
.defineInRange("chair_mob_standup_probability_percent", 1.0, 1e-3, 10.0);
without_crafting_mouse_scrolling = builder
.translation(MODID + ".config.without_crafting_mouse_scrolling")
.comment("Disables increasing/decreasing the crafting grid items by scrolling over the crafting result slot.")
.define("without_crafting_mouse_scrolling", false);
pipevalve_max_flowrate = builder
.translation(MODID + ".config.pipevalve_max_flowrate")
.comment("Defines how many millibuckets can be transferred (per tick) through the valves. " +
"That is technically the 'storage size' specified for blocks that want to fill " +
"fluids into the valve (the valve has no container and forward that to the output " +
"block), The value can be changed on-the-fly for tuning. ")
.defineInRange("pipevalve_max_flowrate", 1000, 1, 32000);
pipevalve_redstone_gain = builder
.translation(MODID + ".config.pipevalve_redstone_gain")
.comment("Defines how many millibuckets per redstone signal strength can be transferred per tick " +
"through the analog redstone controlled valves. Note: power 0 is always off, power 15 is always " +
"the max flow rate. Between power 1 and 14 this scaler will result in a flow = 'redstone slope' * 'current redstone power'. " +
"The value can be changed on-the-fly for tuning. ")
.defineInRange("pipevalve_redstone_gain", 20, 1, 32000);
e_furnace_speed_percent = builder
.translation(MODID + ".config.e_furnace_speed_percent")
.comment("Defines, in percent, how fast the electrical furnace smelts compared to " +
"a vanilla furnace. 100% means vanilla furnace speed, 150% means the " +
"electrical furnace is faster. The value can be changed on-the-fly for tuning.")
.defineInRange("e_furnace_speed_percent", EdElectricalFurnace.ElectricalFurnaceTileEntity.DEFAULT_SPEED_PERCENT, 50, 800);
e_furnace_power_consumption = builder
.translation(MODID + ".config.e_furnace_power_consumption")
.comment("Defines how much RF per tick the the electrical furnace consumed (average) for smelting. " +
"The feeders transferring items from/to adjacent have this consumption/8 for each stack transaction. " +
"The default value is only slightly higher than a furnace with an IE external heater (and no burning fuel inside)." +
"The config value can be changed on-the-fly for tuning.")
.defineInRange("e_furnace_power_consumption", EdElectricalFurnace.ElectricalFurnaceTileEntity.DEFAULT_ENERGY_CONSUMPTION, 8, 4096);
e_furnace_automatic_pulling = builder
.translation(MODID + ".config.e_furnace_automatic_pulling")
.comment("Defines if the electrical furnace automatically pulls items from an inventory at the input side." +
"The config value can be changed on-the-fly for tuning.")
.define("e_furnace_automatic_pulling", false);
small_solar_panel_peak_production = builder
.translation(MODID + ".config.small_solar_panel_peak_production")
.comment("Defines the peak power production (at noon) of the Small Solar Panel. " +
"Note that the agerage power is much less, as no power is produced at all during the night, " +
"and the power curve is nonlinear rising/falling during the day. Bad weather conditions also " +
"decrease the production. The config value can be changed on-the-fly for tuning.")
.defineInRange("small_solar_panel_peak_production", EdSolarPanel.DEFAULT_PEAK_POWER, 2, 4096);
block_breaker_power_consumption = builder
.translation(MODID + ".config.block_breaker_power_consumption")
.comment("Defines how much RF power the Small Block Breaker requires to magnificently increase the processing speed. " +
"The config value can be changed on-the-fly for tuning.")
.defineInRange("block_breaker_power_consumption", EdBreaker.DEFAULT_BOOST_ENERGY, 4, 1024);
block_breaker_reluctance = builder
.translation(MODID + ".config.block_breaker_reluctance")
.comment("Defines how much time the Small Block Breaker needs per block hardness, " +
"means: 'reluctance' * hardness + min_time, you change the 'reluctance' here." +
"The unit is ticks/hardness. " + "The config value can be changed on-the-fly for tuning.")
.defineInRange("block_breaker_reluctance", EdBreaker.DEFAULT_BREAKING_RELUCTANCE, 5, 50);
block_breaker_min_breaking_time = builder
.translation(MODID + ".config.block_breaker_min_breaking_time")
.comment("Defines how much time the Small Block Breaker needs at least, better said it's an offset: " +
"'reluctance' * hardness + min_time, you change the 'min_time' here, value " +
"in ticks." + "The config value can be changed on-the-fly for tuning.")
.defineInRange("block_breaker_min_breaking_time", EdBreaker.DEFAULT_MIN_BREAKING_TIME, 10, 100);
block_breaker_requires_power = builder
.translation(MODID + ".config.block_breaker_requires_power")
.comment("Defines if the Small Block Breaker does not work without RF power.")
.define("block_breaker_requires_power", false);
tree_cutter_energy_consumption = builder
.translation(MODID + ".config.tree_cutter_energy_consumption")
.comment("Defines how much RF power the Small Tree Cutter requires to magnificently increase the processing speed. " +
"The config value can be changed on-the-fly for tuning.")
.defineInRange("tree_cutter_energy_consumption", EdTreeCutter.TreeCutterTileEntity.DEFAULT_BOOST_ENERGY, 4, 1024);
tree_cutter_cutting_time_needed = builder
.translation(MODID + ".config.tree_cutter_cutting_time_needed")
.comment("Defines how much time the Small Tree Cutter needs to cut a tree without RF power. " +
"The value is in seconds. With energy it is 6 times faster. " +
"The config value can be changed on-the-fly for tuning.")
.defineInRange("tree_cutter_cutting_time_needed", EdTreeCutter.TreeCutterTileEntity.DEFAULT_CUTTING_TIME_NEEDED, 10, 240);
tree_cutter_requires_power = builder
.translation(MODID + ".config.tree_cutter_requires_power")
.comment("Defines if the Small Tree Cutter does not work without RF power.")
.define("tree_cutter_requires_power", false);
tree_cutter_universal_logs = builder
.translation(MODID + ".config.tree_cutter_universal_logs")
.comment("Defines a list of resource locations which blocks are always to be treated as part of a tree. This is usefull for special log blocks containing resources like rubber.")
.define("tree_cutter_universal_logs", new ArrayList<>());
milking_machine_energy_consumption = builder
.translation(MODID + ".config.milking_machine_energy_consumption")
.comment("Defines how much time the Small Milking Machine needs work. " +
"Note this is a permanent standby power, not only when the device does something. " +
"Use zero to disable energy dependency and energy handling of the machine. " +
"The config value can be changed on-the-fly for tuning.")
.defineInRange("milking_machine_energy_consumption", EdMilker.DEFAULT_ENERGY_CONSUMPTION, 0, 1024);
milking_machine_milking_delay = builder
.translation(MODID + ".config.milking_machine_milking_delay")
.comment("Defines (for each individual cow) the minimum time between milking.")
.defineInRange("milking_machine_milking_delay", EdMilker.DEFAULT_MILKING_DELAY_PER_COW, 1000, 24000);
builder.pop();
}
}
}
}

View file

@ -12,891 +12,30 @@
*/
package dev.zontreck.engineersdecor;
import dev.zontreck.engineersdecor.blocks.*;
import dev.zontreck.engineersdecor.blocks.implementation.*;
import dev.zontreck.engineersdecor.detail.ModRenderers;
import dev.zontreck.engineersdecor.items.EdItem;
import dev.zontreck.engineersdecor.items.implementation.EdItem;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.client.gui.screens.MenuScreens;
import net.minecraft.client.renderer.entity.EntityRenderers;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.inventory.MenuType;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@SuppressWarnings("unused")
public class ModContent {
public static void init(String modid) {
detail.MODID = modid;
initTags();
initBlocks();
initItems();
initEntities();
}
public static void initTags() {
Registries.addOptionalBlockTag("accepted_mineral_smelter_input", new ResourceLocation("minecraft", "diorite"), new ResourceLocation("minecraft", "cobblestone"));
}
public static void initBlocks() {
Registries.addBlock("clinker_brick_block", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
));
Registries.addBlock("clinker_brick_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
));
Registries.addBlock("clinker_brick_stairs", () -> new StandardStairsBlock(
StandardBlocks.CFG_DEFAULT,
() -> Registries.getBlock("clinker_brick_block").defaultBlockState(),
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
));
Registries.addBlock("clinker_brick_wall", () -> new EdWallBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
));
Registries.addBlock("clinker_brick_stained_block", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
));
Registries.addBlock("clinker_brick_stained_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
));
Registries.addBlock("clinker_brick_stained_stairs", () -> new StandardStairsBlock(
StandardBlocks.CFG_DEFAULT,
() -> Registries.getBlock("clinker_brick_stained_block").defaultBlockState(),
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
));
Registries.addBlock("clinker_brick_sastor_corner_block", () -> new EdCornerOrnamentedBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE),
new Block[]{
Registries.getBlock("clinker_brick_block"),
Registries.getBlock("clinker_brick_slab"),
Registries.getBlock("clinker_brick_stairs"),
Registries.getBlock("clinker_brick_stained_block"),
Registries.getBlock("clinker_brick_stained_slab"),
Registries.getBlock("clinker_brick_stained_stairs")
}
));
Registries.addBlock("clinker_brick_recessed", () -> new StandardBlocks.HorizontalWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE),
new AABB[]{
Auxiliaries.getPixeledAABB(3, 0, 0, 13, 16, 1),
Auxiliaries.getPixeledAABB(0, 0, 1, 16, 16, 11),
Auxiliaries.getPixeledAABB(4, 0, 11, 12, 16, 13)
}
));
Registries.addBlock("clinker_brick_vertically_slit", () -> new StandardBlocks.HorizontalWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE),
new AABB[]{
Auxiliaries.getPixeledAABB(3, 0, 0, 13, 16, 1),
Auxiliaries.getPixeledAABB(3, 0, 15, 13, 16, 16),
Auxiliaries.getPixeledAABB(0, 0, 1, 16, 16, 15)
}
));
Registries.addBlock("clinker_brick_vertical_slab_structured", () -> new StandardBlocks.HorizontalWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 16, 8),
}
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("slag_brick_block", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
));
Registries.addBlock("slag_brick_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
));
Registries.addBlock("slag_brick_stairs", () -> new StandardStairsBlock(
StandardBlocks.CFG_DEFAULT,
() -> Registries.getBlock("slag_brick_block").defaultBlockState(),
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
));
Registries.addBlock("slag_brick_wall", () -> new EdWallBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("rebar_concrete", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
));
Registries.addBlock("rebar_concrete_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
));
Registries.addBlock("rebar_concrete_stairs", () -> new StandardStairsBlock(
StandardBlocks.CFG_DEFAULT,
() -> Registries.getBlock("rebar_concrete").defaultBlockState(),
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
));
Registries.addBlock("rebar_concrete_wall", () -> new EdWallBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
));
Registries.addBlock("halfslab_rebar_concrete", () -> new SlabSliceBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("rebar_concrete_tile", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
));
Registries.addBlock("rebar_concrete_tile_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
));
Registries.addBlock("rebar_concrete_tile_stairs", () -> new StandardStairsBlock(
StandardBlocks.CFG_DEFAULT,
() -> Registries.getBlock("rebar_concrete_tile").defaultBlockState(),
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("panzerglass_block", () -> new EdGlassBlock(
StandardBlocks.CFG_TRANSLUCENT,
BlockBehaviour.Properties.of().strength(0.5f, 2000f).sound(SoundType.METAL).noOcclusion().isValidSpawn(detail::disallowSpawn)
));
Registries.addBlock("panzerglass_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_TRANSLUCENT,
BlockBehaviour.Properties.of().strength(0.5f, 2000f).sound(SoundType.METAL).noOcclusion().isValidSpawn(detail::disallowSpawn)
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("dark_shingle_roof", () -> new EdRoofBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn)
));
Registries.addBlock("dark_shingle_roof_metallized", () -> new EdRoofBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn)
));
Registries.addBlock("dark_shingle_roof_skylight", () -> new EdRoofBlock(
StandardBlocks.CFG_TRANSLUCENT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn)
));
Registries.addBlock("dark_shingle_roof_chimneytrunk", () -> new EdChimneyTrunkBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn),
Shapes.create(Auxiliaries.getPixeledAABB(3, 0, 3, 13, 16, 13)),
Shapes.create(Auxiliaries.getPixeledAABB(5, 0, 5, 11, 16, 11))
));
Registries.addBlock("dark_shingle_roof_wireconduit", () -> new EdChimneyTrunkBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn),
Shapes.join(
Shapes.create(Auxiliaries.getPixeledAABB(3, 0, 3, 13, 13, 13)),
Shapes.create(Auxiliaries.getPixeledAABB(5, 13, 5, 11, 16, 11)),
BooleanOp.OR
),
Shapes.join(
Shapes.create(Auxiliaries.getPixeledAABB(5, 0, 5, 11, 15, 11)),
Shapes.create(Auxiliaries.getPixeledAABB(7, 15, 7, 9, 16, 9)),
BooleanOp.OR
)
));
Registries.addBlock("dark_shingle_roof_chimney", () -> new EdChimneyBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE).dynamicShape().isValidSpawn(detail::disallowSpawn),
Auxiliaries.getPixeledAABB(3, 0, 3, 13, 6, 13)
));
Registries.addBlock("dark_shingle_roof_block", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE)
));
Registries.addBlock("dark_shingle_roof_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE)
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("dense_grit_sand_block", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.1f, 3f).sound(SoundType.GRAVEL)
));
Registries.addBlock("dense_grit_dirt_block", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.1f, 3f).sound(SoundType.GRAVEL)
));
Registries.addBlock("dark_shingle_roof_slabslice", () -> new SlabSliceBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE)
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("metal_rung_ladder", () -> new EdLadderBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion()
));
Registries.addBlock("metal_rung_steps", () -> new EdLadderBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion()
));
Registries.addBlock("iron_hatch", () -> new EdHatchBlock(
StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 2000f).sound(SoundType.METAL),
new AABB[]{Auxiliaries.getPixeledAABB(0, 0, 0, 16, 3, 16)},
new AABB[]{
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 16, 3),
Auxiliaries.getPixeledAABB(0, 0, 3, 1, 1, 16),
Auxiliaries.getPixeledAABB(15, 0, 3, 16, 1, 16),
Auxiliaries.getPixeledAABB(1, 0, 14, 15, 1, 16)
}
));
Registries.addBlock("metal_sliding_door", () -> new StandardDoorBlock(
StandardBlocks.CFG_TRANSLUCENT | StandardBlocks.CFG_HORIZIONTAL,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion()
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("old_industrial_wood_planks", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.WOOD)
));
Registries.addBlock("old_industrial_wood_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.WOOD)
));
Registries.addBlock("old_industrial_wood_stairs", () -> new StandardStairsBlock(
StandardBlocks.CFG_DEFAULT,
() -> Registries.getBlock("old_industrial_wood_planks").defaultBlockState(),
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.WOOD)
));
Registries.addBlock("old_industrial_wood_slabslice", () -> new SlabSliceBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.WOOD).noOcclusion()
));
Registries.addBlock("old_industrial_wood_door", () -> new StandardDoorBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.WOOD).noOcclusion()
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("treated_wood_stool", () -> new EdChair.ChairBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(4, 7, 4, 12, 8.8, 12),
Auxiliaries.getPixeledAABB(7, 0, 7, 9, 7, 9),
Auxiliaries.getPixeledAABB(4, 0, 7, 12, 1, 9),
Auxiliaries.getPixeledAABB(7, 0, 4, 9, 1, 12),
}
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("iron_inset_light", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state) -> 15).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(5, 7, 0, 11, 9, 0.375),
Auxiliaries.getPixeledAABB(6, 6, 0, 10, 10, 0.375),
Auxiliaries.getPixeledAABB(7, 5, 0, 9, 11, 0.375)
}
));
Registries.addBlock("iron_floor_edge_light", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state) -> 15).noOcclusion(),
Auxiliaries.getPixeledAABB(5, 0, 0, 11, 1.8125, 0.375)
));
Registries.addBlock("iron_ceiling_edge_light", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state) -> 15).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 15.5, 0, 16, 16, 2.0),
Auxiliaries.getPixeledAABB(0, 14.0, 0, 16, 16, 0.5),
Auxiliaries.getPixeledAABB(0, 14.0, 0, 1, 16, 2.0),
Auxiliaries.getPixeledAABB(15, 14.0, 0, 16, 16, 2.0),
}
));
Registries.addBlock("iron_bulb_light", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state) -> 15).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(6.5, 6.5, 1, 9.5, 9.5, 4),
Auxiliaries.getPixeledAABB(6.0, 6.0, 0, 10.0, 10.0, 1.0)
}
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("steel_table", () -> new StandardBlocks.WaterLoggable(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 16, 16)
));
Registries.addBlock("steel_floor_grating", () -> new EdFloorGratingBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 14, 0, 16, 15.5, 16)
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("steel_framed_window", () -> new EdWindowBlock(
StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 7.5, 16, 16, 8.5)
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("treated_wood_pole", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME,
BlockBehaviour.Properties.of().strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(5.8, 5.8, 0, 10.2, 10.2, 16),
null
));
Registries.addBlock("treated_wood_pole_head", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME,
BlockBehaviour.Properties.of().strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(5.8, 5.8, 0, 10.2, 10.2, 16),
(EdStraightPoleBlock) Registries.getBlock("treated_wood_pole") // TREATED_WOOD_POLE
));
Registries.addBlock("treated_wood_pole_support", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME,
BlockBehaviour.Properties.of().strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(5.8, 5.8, 0, 10.2, 10.2, 16),
(EdStraightPoleBlock) Registries.getBlock("treated_wood_pole") // TREATED_WOOD_POLE
));
Registries.addBlock("thin_steel_pole", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(6, 6, 0, 10, 10, 16),
null
));
Registries.addBlock("thin_steel_pole_head", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME,
BlockBehaviour.Properties.of().strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(6, 6, 0, 10, 10, 16),
(EdStraightPoleBlock) Registries.getBlock("thin_steel_pole") // THIN_STEEL_POLE
));
Registries.addBlock("thick_steel_pole", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(5, 5, 0, 11, 11, 16),
null
));
Registries.addBlock("thick_steel_pole_head", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME,
BlockBehaviour.Properties.of().strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(5, 5, 0, 11, 11, 16),
(EdStraightPoleBlock) Registries.getBlock("thin_steel_pole")
));
Registries.addBlock("steel_double_t_support", () -> new EdHorizontalSupportBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(5, 11, 0, 11, 16, 16), // main beam
Auxiliaries.getPixeledAABB(10, 11, 5, 16, 16, 11), // east beam (also for west 180deg)
Auxiliaries.getPixeledAABB(6, 0, 6, 10, 16, 10), // down thin
Auxiliaries.getPixeledAABB(5, 0, 5, 11, 16, 11) // down thick
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("steel_mesh_fence", () -> new EdFenceBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
1.5, 16, 0.25, 0, 16, 16
));
Registries.addBlock("steel_mesh_fence_gate", () -> new EdDoubleGateBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 6.5, 16, 16, 9.5)
));
Registries.addBlock("steel_railing", () -> new EdgeAlignedRailingBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 0, 0, 0, 0),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 15.9, 1)
));
Registries.addBlock("steel_catwalk", () -> new EdCatwalkBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 2, 16),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 15.9, 1),
Registries.getBlock("steel_railing")
));
Registries.addBlock("steel_catwalk_ta", () -> new EdCatwalkTopAlignedBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new VoxelShape[]{
Shapes.create(Auxiliaries.getPixeledAABB(0, 14, 0, 16, 16, 16)), // only base
Auxiliaries.getUnionShape( // base with thick pole
Auxiliaries.getPixeledAABB(0, 14, 0, 16, 16, 16),
Auxiliaries.getPixeledAABB(5, 0, 5, 11, 15, 11)
),
Auxiliaries.getUnionShape( // base with thin pole
Auxiliaries.getPixeledAABB(0, 14, 0, 16, 16, 16),
Auxiliaries.getPixeledAABB(6, 0, 6, 10, 15, 10)
),
Auxiliaries.getUnionShape( // structure frame-like
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 2, 16),
Auxiliaries.getPixeledAABB(0, 14, 0, 16, 16, 16),
Auxiliaries.getPixeledAABB(0, 0, 0, 1, 16, 1),
Auxiliaries.getPixeledAABB(15, 0, 0, 16, 16, 1),
Auxiliaries.getPixeledAABB(15, 0, 15, 16, 16, 16),
Auxiliaries.getPixeledAABB(0, 0, 15, 1, 16, 16)
),
Auxiliaries.getUnionShape( // base with inset light
Auxiliaries.getPixeledAABB(0, 14, 0, 16, 16, 16)
)
},
Registries.getBlock("iron_inset_light")
));
Registries.addBlock("steel_catwalk_stairs", () -> new EdCatwalkStairsBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{ // base
Auxiliaries.getPixeledAABB(1, 2, 8, 15, 4, 16),
Auxiliaries.getPixeledAABB(1, 10, 0, 15, 12, 8),
},
new AABB[]{ // railing left
Auxiliaries.getPixeledAABB(0.4, 0, 15, 0.6, 15, 16),
Auxiliaries.getPixeledAABB(0.4, 1, 14, 0.6, 16, 15),
Auxiliaries.getPixeledAABB(0.4, 2, 13, 0.6, 17, 14),
Auxiliaries.getPixeledAABB(0.4, 3, 12, 0.6, 18, 13),
Auxiliaries.getPixeledAABB(0.4, 4, 11, 0.6, 19, 12),
Auxiliaries.getPixeledAABB(0.4, 5, 10, 0.6, 20, 11),
Auxiliaries.getPixeledAABB(0.4, 6, 9, 0.6, 21, 10),
Auxiliaries.getPixeledAABB(0.4, 7, 8, 0.6, 22, 9),
Auxiliaries.getPixeledAABB(0.4, 8, 7, 0.6, 23, 8),
Auxiliaries.getPixeledAABB(0.4, 9, 6, 0.6, 24, 7),
Auxiliaries.getPixeledAABB(0.4, 10, 5, 0.6, 25, 6),
Auxiliaries.getPixeledAABB(0.4, 11, 4, 0.6, 26, 5),
Auxiliaries.getPixeledAABB(0.4, 12, 3, 0.6, 27, 4),
Auxiliaries.getPixeledAABB(0.4, 13, 2, 0.6, 28, 3),
Auxiliaries.getPixeledAABB(0.4, 14, 1, 0.6, 29, 2),
Auxiliaries.getPixeledAABB(0.4, 15, 0, 0.6, 30, 1)
}
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("sign_decor", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.3f, 1000f).sound(SoundType.WOOD).lightLevel((state) -> 1).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 15.6, 16, 16, 16.0)
));
Registries.addBlock("sign_hotwire", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
));
Registries.addBlock("sign_danger", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
));
Registries.addBlock("sign_radioactive", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
));
Registries.addBlock("sign_laser", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
));
Registries.addBlock("sign_caution", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
));
Registries.addBlock("sign_magichazard", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
));
Registries.addBlock("sign_firehazard", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
));
Registries.addBlock("sign_hotsurface", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
));
Registries.addBlock("sign_magneticfield", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
));
Registries.addBlock("sign_frost", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
));
Registries.addBlock("sign_exit", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(3, 7, 15.6, 13, 13, 16)
));
Registries.addBlock("sign_defense", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
));
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("small_lab_furnace",
() -> new EdFurnace.FurnaceBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(1, 0, 1, 15, 1, 15),
Auxiliaries.getPixeledAABB(0, 1, 1, 16, 16, 16),
}
),
EdFurnace.FurnaceTileEntity::new
);
Registries.addBlock("small_electrical_furnace",
() -> new EdElectricalFurnace.ElectricalFurnaceBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 11, 16),
Auxiliaries.getPixeledAABB(1, 11, 0, 15, 12, 16),
Auxiliaries.getPixeledAABB(2, 12, 0, 14, 13, 16),
Auxiliaries.getPixeledAABB(3, 13, 0, 13, 14, 16),
Auxiliaries.getPixeledAABB(4, 14, 0, 12, 16, 16),
}
),
EdElectricalFurnace.ElectricalFurnaceTileEntity::new
);
Registries.addBlock("factory_dropper",
() -> new EdDropper.DropperBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 1, 16, 16, 16)
),
EdDropper.DropperTileEntity::new
);
Registries.addBlock("factory_placer",
() -> new EdPlacer.PlacerBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_SHIFTCLICK | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 0, 2, 16, 16, 16),
Auxiliaries.getPixeledAABB(0, 0, 0, 1, 16, 2),
Auxiliaries.getPixeledAABB(15, 0, 0, 16, 16, 2)
}
),
EdPlacer.PlacerTileEntity::new
);
Registries.addBlock("small_block_breaker",
() -> new EdBreaker.BreakerBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_SHIFTCLICK,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(1, 0, 0, 15, 4, 7),
Auxiliaries.getPixeledAABB(1, 0, 7, 15, 12, 16),
Auxiliaries.getPixeledAABB(0, 0, 0, 1, 5, 4),
Auxiliaries.getPixeledAABB(0, 0, 4, 1, 12, 16),
Auxiliaries.getPixeledAABB(15, 0, 0, 16, 5, 4),
Auxiliaries.getPixeledAABB(15, 0, 4, 16, 12, 16)
}
),
EdBreaker.BreakerTileEntity::new
);
Registries.addBlock("factory_hopper",
() -> new EdHopper.HopperBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), () -> {
final AABB[] down_aabbs = new AABB[]{
Auxiliaries.getPixeledAABB(5, 0, 5, 11, 1, 11),
Auxiliaries.getPixeledAABB(4, 1, 4, 12, 7, 12),
Auxiliaries.getPixeledAABB(2, 7, 2, 14, 10, 14),
Auxiliaries.getPixeledAABB(0, 10, 0, 16, 16, 16),
Auxiliaries.getPixeledAABB(0, 4, 5, 2, 10, 11),
Auxiliaries.getPixeledAABB(14, 4, 5, 16, 10, 11),
Auxiliaries.getPixeledAABB(5, 4, 0, 11, 10, 2),
Auxiliaries.getPixeledAABB(5, 4, 14, 11, 10, 16),
};
final AABB[] up_aabbs = new AABB[]{
Auxiliaries.getPixeledAABB(5, 15, 5, 11, 16, 11),
Auxiliaries.getPixeledAABB(4, 14, 4, 12, 9, 12),
Auxiliaries.getPixeledAABB(2, 9, 2, 14, 6, 14),
Auxiliaries.getPixeledAABB(0, 6, 0, 16, 0, 16),
Auxiliaries.getPixeledAABB(0, 12, 5, 2, 6, 11),
Auxiliaries.getPixeledAABB(14, 12, 5, 16, 6, 11),
Auxiliaries.getPixeledAABB(5, 12, 0, 11, 6, 2),
Auxiliaries.getPixeledAABB(5, 12, 14, 11, 6, 16),
};
final AABB[] north_aabbs = new AABB[]{
Auxiliaries.getPixeledAABB(5, 0, 5, 11, 1, 11),
Auxiliaries.getPixeledAABB(4, 1, 4, 12, 7, 12),
Auxiliaries.getPixeledAABB(2, 7, 2, 14, 10, 14),
Auxiliaries.getPixeledAABB(0, 10, 0, 16, 16, 16),
Auxiliaries.getPixeledAABB(0, 4, 5, 2, 10, 11),
Auxiliaries.getPixeledAABB(14, 4, 5, 16, 10, 11),
Auxiliaries.getPixeledAABB(5, 1, 0, 11, 7, 4),
Auxiliaries.getPixeledAABB(5, 4, 14, 11, 10, 16),
};
return new ArrayList<>(Arrays.asList(
Auxiliaries.getUnionShape(down_aabbs),
Auxiliaries.getUnionShape(up_aabbs),
Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.NORTH, false)),
Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.SOUTH, false)),
Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.WEST, false)),
Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.EAST, false)),
Shapes.block(),
Shapes.block()
));
}
),
EdHopper.HopperTileEntity::new
);
Registries.addBlock("small_waste_incinerator",
() -> new EdWasteIncinerator.WasteIncineratorBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 16, 16)
),
EdWasteIncinerator.WasteIncineratorTileEntity::new
);
Registries.addBlock("small_mineral_smelter",
() -> new EdMineralSmelter.MineralSmelterBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(1.1, 0, 1.1, 14.9, 16, 14.9)
),
EdMineralSmelter.MineralSmelterTileEntity::new
);
Registries.addBlock("small_freezer",
() -> new EdFreezer.FreezerBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(1.1, 0, 1.1, 14.9, 16, 14.9)
),
EdFreezer.FreezerTileEntity::new
);
Registries.addBlock("small_solar_panel",
() -> new EdSolarPanel.SolarPanelBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 2, 16),
Auxiliaries.getPixeledAABB(6, 1.5, 3, 10, 10.5, 13),
}
),
EdSolarPanel.SolarPanelTileEntity::new
);
Registries.addBlock("small_milking_machine",
() -> new EdMilker.MilkerBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(1, 1, 0, 15, 14, 10),
Auxiliaries.getPixeledAABB(0, 14, 0, 16, 16, 13),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 1, 13),
Auxiliaries.getPixeledAABB(0, 1, 1, 1, 14, 11),
Auxiliaries.getPixeledAABB(15, 1, 1, 16, 14, 11)
}
),
EdMilker.MilkerTileEntity::new
);
Registries.addBlock("small_tree_cutter",
() -> new EdTreeCutter.TreeCutterBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_SHIFTCLICK,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 3, 16),
Auxiliaries.getPixeledAABB(0, 3, 0, 3, 8, 16),
Auxiliaries.getPixeledAABB(3, 7, 0, 5, 8, 16),
Auxiliaries.getPixeledAABB(15, 0, 0, 16, 6, 16),
Auxiliaries.getPixeledAABB(0, 0, 13, 16, 8, 16),
Auxiliaries.getPixeledAABB(5, 6, 12, 16, 8, 13),
}
),
EdTreeCutter.TreeCutterTileEntity::new
);
Registries.addBlock("straight_pipe_valve", () -> new EdPipeValve.PipeValveBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_SHIFTCLICK,
EdPipeValve.CFG_CHECK_VALVE,
BlockBehaviour.Properties.of().strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(2, 2, 0, 14, 14, 2),
Auxiliaries.getPixeledAABB(2, 2, 14, 14, 14, 16),
Auxiliaries.getPixeledAABB(3, 3, 5, 13, 13, 11),
Auxiliaries.getPixeledAABB(4, 4, 2, 12, 12, 14),
}
));
Registries.addBlock("straight_pipe_valve_redstone", () -> new EdPipeValve.PipeValveBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
EdPipeValve.CFG_REDSTONE_CONTROLLED_VALVE,
BlockBehaviour.Properties.of().strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(2, 2, 0, 14, 14, 2),
Auxiliaries.getPixeledAABB(2, 2, 14, 14, 14, 16),
Auxiliaries.getPixeledAABB(3, 3, 5, 13, 13, 11),
Auxiliaries.getPixeledAABB(4, 4, 2, 12, 12, 14),
}
));
Registries.addBlock("straight_pipe_valve_redstone_analog",
() -> new EdPipeValve.PipeValveBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
EdPipeValve.CFG_REDSTONE_CONTROLLED_VALVE | EdPipeValve.CFG_ANALOG_VALVE,
BlockBehaviour.Properties.of().strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(2, 2, 0, 14, 14, 2),
Auxiliaries.getPixeledAABB(2, 2, 14, 14, 14, 16),
Auxiliaries.getPixeledAABB(3, 3, 5, 13, 13, 11),
Auxiliaries.getPixeledAABB(4, 4, 2, 12, 12, 14),
}
)
);
Registries.addBlockEntityType("tet_straight_pipe_valve",
EdPipeValve.PipeValveTileEntity::new,
"straight_pipe_valve", "straight_pipe_valve_redstone", "straight_pipe_valve_redstone_analog"
);
Registries.addBlock("fluid_barrel",
() -> new EdFluidBarrel.FluidBarrelBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(2, 0, 0, 14, 1, 16),
Auxiliaries.getPixeledAABB(1, 1, 0, 15, 2, 16),
Auxiliaries.getPixeledAABB(0, 2, 0, 16, 14, 16),
Auxiliaries.getPixeledAABB(1, 14, 0, 15, 15, 16),
Auxiliaries.getPixeledAABB(2, 15, 0, 14, 16, 16),
}
),
EdFluidBarrel.FluidBarrelItem::new,
EdFluidBarrel.FluidBarrelTileEntity::new
);
Registries.addBlock("small_fluid_funnel",
() -> new EdFluidFunnel.FluidFunnelBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 14, 16),
Auxiliaries.getPixeledAABB(1, 14, 1, 15, 15, 15),
Auxiliaries.getPixeledAABB(0, 15, 0, 16, 16, 16)
}
),
EdFluidFunnel.FluidFunnelTileEntity::new
);
// -------------------------------------------------------------------------------------------------------------------
Registries.addBlock("test_block",
() -> new EdTestBlock.TestBlock(
StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0f, 32000f).sound(SoundType.METAL),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 16, 16)
),
EdTestBlock.TestTileEntity::new
);
}
public static void initItems() {
Registries.addItem("metal_bar", () -> new EdItem((new Item.Properties())));
}
public static void initEntities() {
Registries.addEntityType("et_chair", () ->
EntityType.Builder.of(EdChair.EntityChair::new, MobCategory.MISC)
.fireImmune().sized(1e-3f, 1e-3f).noSave()
.setShouldReceiveVelocityUpdates(false).setUpdateInterval(4)
.setCustomClientFactory(EdChair.EntityChair::customClientFactory)
.build(new ResourceLocation(Auxiliaries.modid(), "et_chair").toString())
);
}
public static Block getBlock(String name) {
return Registries.getBlock(name);
}
//--------------------------------------------------------------------------------------------------------------------
// Registry wrappers
//--------------------------------------------------------------------------------------------------------------------
public static Item getItem(String name) {
return Registries.getItem(name);
}
public static TagKey<Block> getBlockTagKey(String name) {
return Registries.getBlockTagKey(name);
}
public static TagKey<Item> getItemTagKey(String name) {
return Registries.getItemTagKey(name);
}
public static BlockEntityType<?> getBlockEntityTypeOfBlock(String block_name) {
return Registries.getBlockEntityTypeOfBlock(block_name);
}
public static BlockEntityType<?> getBlockEntityTypeOfBlock(Block block) {
return Registries.getBlockEntityTypeOfBlock(block);
}
public static EntityType<?> getEntityType(String name) {
return Registries.getEntityType(name);
}
public static MenuType<?> getMenuType(String block_name) {
return Registries.getMenuTypeOfBlock(block_name);
}
@Nonnull
public static List<Block> getRegisteredBlocks() {
return Registries.getRegisteredBlocks();
}
@Nonnull
public static List<Item> getRegisteredItems() {
return Registries.getRegisteredItems();
}
@OnlyIn(Dist.CLIENT)
@SuppressWarnings("unchecked")
public static void registerMenuGuis(final FMLClientSetupEvent event) {
@ -936,12 +75,5 @@ public class ModContent {
EntityRenderers.register(Registries.getEntityType("et_chair"), ModRenderers.InvisibleEntityRenderer::new);
}
private static class detail {
public static String MODID = "";
public static Boolean disallowSpawn(BlockState state, BlockGetter reader, BlockPos pos, EntityType<?> entity) {
return false;
}
}
}

View file

@ -1,6 +1,9 @@
package dev.zontreck.engineersdecor;
import dev.zontreck.engineersdecor.blocks.EdLadderBlock;
import dev.zontreck.engineersdecor.blocks.ModBlocks;
import dev.zontreck.engineersdecor.blocks.implementation.EdLadderBlock;
import dev.zontreck.engineersdecor.entities.ModEntities;
import dev.zontreck.engineersdecor.items.ModItems;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.api.distmarker.Dist;
@ -8,6 +11,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.crafting.CraftingHelper;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
@ -26,16 +30,18 @@ public class ModEngineersDecor {
private static final Logger LOGGER = com.mojang.logging.LogUtils.getLogger();
public ModEngineersDecor() {
Auxiliaries.init(MODID, LOGGER, ModConfig::getServerConfig);
IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();
Auxiliaries.logGitVersion(MODNAME);
Registries.init(MODID, "sign_decor", FMLJavaModLoadingContext.get().getModEventBus());
ModContent.init(MODID);
OptionalRecipeCondition.init(MODID, LOGGER);
ModLoadingContext.get().registerConfig(net.minecraftforge.fml.config.ModConfig.Type.SERVER, ModConfig.SERVER_CONFIG_SPEC);
ModLoadingContext.get().registerConfig(net.minecraftforge.fml.config.ModConfig.Type.COMMON, ModConfig.COMMON_CONFIG_SPEC);
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onSetup);
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onClientSetup);
MinecraftForge.EVENT_BUS.register(this);
ModBlocks.register(bus);
ModItems.register(bus);
ModEntities.register(bus);
}
private void onSetup(final FMLCommonSetupEvent event) {
@ -57,23 +63,6 @@ public class ModEngineersDecor {
if (player.onClimbable()) EdLadderBlock.onPlayerUpdateEvent(player);
}
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public static class ForgeEvents {
@SubscribeEvent
public static void onConfigLoad(final ModConfigEvent.Loading event) {
ModConfig.apply();
}
@SubscribeEvent
public static void onConfigReload(final ModConfigEvent.Reloading event) {
try {
Auxiliaries.logger().info("Config file changed {}", event.getConfig().getFileName());
ModConfig.apply();
} catch (Throwable e) {
Auxiliaries.logger().error("Failed to load changed config: " + e.getMessage());
}
}
}
@OnlyIn(Dist.CLIENT)
@Mod.EventBusSubscriber(Dist.CLIENT)

View file

@ -1,5 +1,772 @@
package dev.zontreck.engineersdecor.blocks;
public class ModBlocks
{
import dev.zontreck.engineersdecor.ModEngineersDecor;
import dev.zontreck.engineersdecor.blocks.implementation.*;
import dev.zontreck.engineersdecor.items.CreativeModeTabs;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import java.util.ArrayList;
import java.util.Arrays;
public class ModBlocks {
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, ModEngineersDecor.MODID);
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ModEngineersDecor.MODID);
public static final RegistryObject<Block> CLINKER_BRICK_BLOCK = registerWithItem(BLOCKS.register("clinker_brick_block", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> CLINKER_BRICK_STAIRS = registerWithItem(BLOCKS.register("clinker_brick_stairs", () -> new StandardStairsBlock(
StandardBlocks.CFG_DEFAULT,
() -> CLINKER_BRICK_BLOCK.get().defaultBlockState(),
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> CLINKER_BRICK_SLAB = registerWithItem(BLOCKS.register("clinker_brick_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> CLINKER_BRICK_WALL = registerWithItem(BLOCKS.register("clinker_brick_wall", () -> new EdWallBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> CLINKER_BRICK_STAINED_BLOCK = registerWithItem(BLOCKS.register("clinker_brick_stained_block", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> CLINKER_BRICK_STAINED_STAIRS = registerWithItem(BLOCKS.register("clinker_brick_stained_stairs", () -> new StandardStairsBlock(
StandardBlocks.CFG_DEFAULT,
() -> CLINKER_BRICK_STAINED_BLOCK.get().defaultBlockState(),
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> CLINKER_BRICK_STAINED_SLAB = registerWithItem(BLOCKS.register("clinker_brick_stained_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> CLINKER_BRICK_SASTOR_CORNER_BLOCK = registerWithItem(BLOCKS.register("clinker_brick_sastor_corner_block", () -> new EdCornerOrnamentedBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE),
new Block[]{
CLINKER_BRICK_BLOCK.get(),
CLINKER_BRICK_SLAB.get(),
CLINKER_BRICK_STAIRS.get(),
CLINKER_BRICK_STAINED_BLOCK.get(),
CLINKER_BRICK_STAINED_SLAB.get(),
CLINKER_BRICK_STAINED_STAIRS.get()
}
)), new Item.Properties());
public static final RegistryObject<Block> CLINKER_BRICK_RECESSED = registerWithItem(BLOCKS.register("clinker_brick_recessed", () -> new StandardBlocks.HorizontalWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE),
new AABB[]{
Auxiliaries.getPixeledAABB(3, 0, 0, 13, 16, 1),
Auxiliaries.getPixeledAABB(0, 0, 1, 16, 16, 11),
Auxiliaries.getPixeledAABB(4, 0, 11, 12, 16, 13)
}
)), new Item.Properties());
public static final RegistryObject<Block> CLINKER_BRICK_VERTICALLY_SLIT = registerWithItem(BLOCKS.register("clinker_brick_vertically_slit", () -> new StandardBlocks.HorizontalWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE),
new AABB[]{
Auxiliaries.getPixeledAABB(3, 0, 0, 13, 16, 1),
Auxiliaries.getPixeledAABB(3, 0, 15, 13, 16, 16),
Auxiliaries.getPixeledAABB(0, 0, 1, 16, 16, 15)
}
)), new Item.Properties());
public static final RegistryObject<Block> CLINKER_BRICK_VERTICAL_SLAB_STRUCTURED = registerWithItem(BLOCKS.register("clinker_brick_vertical_slab_structured", () -> new StandardBlocks.HorizontalWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 16, 8),
}
)), new Item.Properties());
public static final RegistryObject<Block> SLAG_BRICK_BLOCK = registerWithItem(BLOCKS.register("slag_brick_block", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> SLAG_BRICK_SLAB = registerWithItem(BLOCKS.register("slag_brick_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> SLAG_BRICK_STAIRS = registerWithItem(BLOCKS.register("slag_brick_stairs", () -> new StandardStairsBlock(
StandardBlocks.CFG_DEFAULT,
() -> SLAG_BRICK_BLOCK.get().defaultBlockState(),
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> SLAG_BRICK_WALL = registerWithItem(BLOCKS.register("slag_brick_wall", () -> new EdWallBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 7f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> REBAR_CONCRETE = registerWithItem(BLOCKS.register("rebar_concrete", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
)), new Item.Properties());
public static final RegistryObject<Block> REBAR_CONCRETE_SLAB = registerWithItem(BLOCKS.register("rebar_concrete_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
)), new Item.Properties());
public static final RegistryObject<Block> REBAR_CONCRETE_STAIRS = registerWithItem(BLOCKS.register("rebar_concrete_stairs", () -> new StandardStairsBlock(
StandardBlocks.CFG_DEFAULT,
() -> REBAR_CONCRETE.get().defaultBlockState(),
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
)), new Item.Properties());
public static final RegistryObject<Block> REBAR_CONCRETE_WALL = registerWithItem(BLOCKS.register("rebar_concrete_wall", () -> new EdWallBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
)), new Item.Properties());
public static final RegistryObject<Block> REBAR_CONCRETE_HALFSLAB = registerWithItem(BLOCKS.register("halfslab_rebar_concrete", () -> new SlabSliceBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
)), new Item.Properties());
public static final RegistryObject<Block> REBAR_CONCRETE_TILE = registerWithItem(BLOCKS.register("rebar_concrete_tile", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
)), new Item.Properties());
public static final RegistryObject<Block> REBAR_CONCRETE_TILE_SLAB = registerWithItem(BLOCKS.register("rebar_concrete_tile_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
)), new Item.Properties());
public static final RegistryObject<Block> REBAR_CONCRETE_TILE_STAIRS = registerWithItem(BLOCKS.register("rebar_concrete_tile_stairs", () -> new StandardStairsBlock(
StandardBlocks.CFG_DEFAULT,
() -> REBAR_CONCRETE_TILE.get().defaultBlockState(),
BlockBehaviour.Properties.of().strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn)
)), new Item.Properties());
public static final RegistryObject<Block> PANZERGLASS_BLOCK = registerWithItem(BLOCKS.register("panzerglass_block", () -> new EdGlassBlock(
StandardBlocks.CFG_TRANSLUCENT,
BlockBehaviour.Properties.of().strength(0.5f, 2000f).sound(SoundType.METAL).noOcclusion().isValidSpawn(detail::disallowSpawn)
)), new Item.Properties());
public static final RegistryObject<Block> PANZERGLASS_SLAB = registerWithItem(BLOCKS.register("panzerglass_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_TRANSLUCENT,
BlockBehaviour.Properties.of().strength(0.5f, 2000f).sound(SoundType.METAL).noOcclusion().isValidSpawn(detail::disallowSpawn)
)), new Item.Properties());
public static final RegistryObject<Block> DARK_SHINGLE_ROOF = registerWithItem(BLOCKS.register("dark_shingle_roof", () -> new EdRoofBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn)
)), new Item.Properties());
public static final RegistryObject<Block> DARK_SHINGLE_ROOF_METALLIZED = registerWithItem(BLOCKS.register("dark_shingle_roof_metallized", () -> new EdRoofBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn)
)), new Item.Properties());
public static final RegistryObject<Block> DARK_SHINGLE_ROOF_SKYLIGHT = registerWithItem(BLOCKS.register("dark_shingle_roof_skylight", () -> new EdRoofBlock(
StandardBlocks.CFG_TRANSLUCENT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn)
)), new Item.Properties());
public static final RegistryObject<Block> DARK_SHINGLE_ROOF_CHIMNEYTRUNK = registerWithItem(BLOCKS.register("dark_shingle_roof_chimneytrunk", () -> new EdChimneyTrunkBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn),
Shapes.create(Auxiliaries.getPixeledAABB(3, 0, 3, 13, 16, 13)),
Shapes.create(Auxiliaries.getPixeledAABB(5, 0, 5, 11, 16, 11))
)), new Item.Properties());
public static final RegistryObject<Block> DARK_SHINGLE_ROOF_WIRECONDUIT = registerWithItem(BLOCKS.register("dark_shingle_roof_wireconduit", () -> new EdChimneyTrunkBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn),
Shapes.join(
Shapes.create(Auxiliaries.getPixeledAABB(3, 0, 3, 13, 13, 13)),
Shapes.create(Auxiliaries.getPixeledAABB(5, 13, 5, 11, 16, 11)),
BooleanOp.OR
),
Shapes.join(
Shapes.create(Auxiliaries.getPixeledAABB(5, 0, 5, 11, 15, 11)),
Shapes.create(Auxiliaries.getPixeledAABB(7, 15, 7, 9, 16, 9)),
BooleanOp.OR
)
)), new Item.Properties());
public static final RegistryObject<Block> DARK_SHINGLE_ROOF_CHIMNEY = registerWithItem(BLOCKS.register("dark_shingle_roof_chimney", () -> new EdChimneyBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE).dynamicShape().isValidSpawn(detail::disallowSpawn),
Auxiliaries.getPixeledAABB(3, 0, 3, 13, 6, 13)
)), new Item.Properties());
public static final RegistryObject<Block> DARK_SHINGLE_ROOF_BLOCK = registerWithItem(BLOCKS.register("dark_shingle_roof_block", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> DARK_SHINGLE_ROOF_SLAB = registerWithItem(BLOCKS.register("dark_shingle_roof_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> DENSE_GRIT_SAND_BLOCK = registerWithItem(BLOCKS.register("dense_grit_sand_block", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.1f, 3f).sound(SoundType.GRAVEL)
)), new Item.Properties());
public static final RegistryObject<Block> DENSE_GRIT_DART_BLOCK = registerWithItem(BLOCKS.register("dense_grit_dirt_block", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.1f, 3f).sound(SoundType.GRAVEL)
)), new Item.Properties());
public static final RegistryObject<Block> DARK_SHINGLE_ROOF_SLABSLICE = registerWithItem(BLOCKS.register("dark_shingle_roof_slabslice", () -> new SlabSliceBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.STONE)
)), new Item.Properties());
public static final RegistryObject<Block> OLD_INDUSTRIAL_WOOD_PLANKS = registerWithItem(BLOCKS.register("old_industrial_wood_planks", () -> new StandardBlocks.BaseBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.WOOD)
)), new Item.Properties());
public static final RegistryObject<Block> OLD_INDUSTRIAL_WOOD_SLAB = registerWithItem(BLOCKS.register("old_industrial_wood_slab", () -> new VariantSlabBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.WOOD)
)), new Item.Properties());
public static final RegistryObject<Block> OLD_INDUSTRIAL_WOOD_STAIRS = registerWithItem(BLOCKS.register("old_industrial_wood_stairs", () -> new StandardStairsBlock(
StandardBlocks.CFG_DEFAULT,
() -> OLD_INDUSTRIAL_WOOD_PLANKS.get().defaultBlockState(),
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.WOOD)
)), new Item.Properties());
public static final RegistryObject<Block> OLD_INDUSTRIAL_WOOD_SLABSLICE = registerWithItem(BLOCKS.register("old_industrial_wood_slabslice", () -> new SlabSliceBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.WOOD).noOcclusion()
)), new Item.Properties());
public static final RegistryObject<Block> OLD_INDUSTRIAL_WOOD_DOOR = registerWithItem(BLOCKS.register("old_industrial_wood_door", () -> new StandardDoorBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.5f, 6f).sound(SoundType.WOOD).noOcclusion()
)), new Item.Properties());
public static final RegistryObject<Block> TREATED_WOOD_STOOL = registerWithItem(BLOCKS.register("treated_wood_stool", () -> new EdChair.ChairBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(4, 7, 4, 12, 8.8, 12),
Auxiliaries.getPixeledAABB(7, 0, 7, 9, 7, 9),
Auxiliaries.getPixeledAABB(4, 0, 7, 12, 1, 9),
Auxiliaries.getPixeledAABB(7, 0, 4, 9, 1, 12),
}
)), new Item.Properties());
public static final RegistryObject<Block> IRON_INSET_LIGHT = registerWithItem(BLOCKS.register("iron_inset_light", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state) -> 15).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(5, 7, 0, 11, 9, 0.375),
Auxiliaries.getPixeledAABB(6, 6, 0, 10, 10, 0.375),
Auxiliaries.getPixeledAABB(7, 5, 0, 9, 11, 0.375)
}
)), new Item.Properties());
public static final RegistryObject<Block> STEEL_CATWALK_TA = registerWithItem(BLOCKS.register("steel_catwalk_ta", () -> new EdCatwalkTopAlignedBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new VoxelShape[]{
Shapes.create(Auxiliaries.getPixeledAABB(0, 14, 0, 16, 16, 16)), // only base
Auxiliaries.getUnionShape( // base with thick pole
Auxiliaries.getPixeledAABB(0, 14, 0, 16, 16, 16),
Auxiliaries.getPixeledAABB(5, 0, 5, 11, 15, 11)
),
Auxiliaries.getUnionShape( // base with thin pole
Auxiliaries.getPixeledAABB(0, 14, 0, 16, 16, 16),
Auxiliaries.getPixeledAABB(6, 0, 6, 10, 15, 10)
),
Auxiliaries.getUnionShape( // structure frame-like
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 2, 16),
Auxiliaries.getPixeledAABB(0, 14, 0, 16, 16, 16),
Auxiliaries.getPixeledAABB(0, 0, 0, 1, 16, 1),
Auxiliaries.getPixeledAABB(15, 0, 0, 16, 16, 1),
Auxiliaries.getPixeledAABB(15, 0, 15, 16, 16, 16),
Auxiliaries.getPixeledAABB(0, 0, 15, 1, 16, 16)
),
Auxiliaries.getUnionShape( // base with inset light
Auxiliaries.getPixeledAABB(0, 14, 0, 16, 16, 16)
)
},
IRON_INSET_LIGHT.get()
)), new Item.Properties());
public static final RegistryObject<Block> IRON_FLOOR_EDGE_LIGHT = registerWithItem(BLOCKS.register("iron_floor_edge_light", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state) -> 15).noOcclusion(),
Auxiliaries.getPixeledAABB(5, 0, 0, 11, 1.8125, 0.375)
)), new Item.Properties());
public static final RegistryObject<Block> IRON_CEILING_EDGE_LIGHT = registerWithItem(BLOCKS.register("iron_ceiling_edge_light", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state) -> 15).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 15.5, 0, 16, 16, 2.0),
Auxiliaries.getPixeledAABB(0, 14.0, 0, 16, 16, 0.5),
Auxiliaries.getPixeledAABB(0, 14.0, 0, 1, 16, 2.0),
Auxiliaries.getPixeledAABB(15, 14.0, 0, 16, 16, 2.0),
}
)), new Item.Properties());
public static final RegistryObject<Block> IRON_BULB_LIGHT = registerWithItem(BLOCKS.register("iron_bulb_light", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state) -> 15).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(6.5, 6.5, 1, 9.5, 9.5, 4),
Auxiliaries.getPixeledAABB(6.0, 6.0, 0, 10.0, 10.0, 1.0)
}
)), new Item.Properties());
public static final RegistryObject<Block> STEEL_TABLE = registerWithItem(BLOCKS.register("steel_table", () -> new StandardBlocks.WaterLoggable(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 16, 16)
)), new Item.Properties());
public static final RegistryObject<Block> STEEL_FLOOR_GRATING = registerWithItem(BLOCKS.register("steel_floor_grating", () -> new EdFloorGratingBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 14, 0, 16, 15.5, 16)
)), new Item.Properties());
public static final RegistryObject<Block> STEEL_FRAMED_WINDOW = registerWithItem(BLOCKS.register("steel_framed_window", () -> new EdWindowBlock(
StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 7.5, 16, 16, 8.5)
)), new Item.Properties());
public static final RegistryObject<Block> TREATED_WOOD_POLE = registerWithItem(BLOCKS.register("treated_wood_pole", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME,
BlockBehaviour.Properties.of().strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(5.8, 5.8, 0, 10.2, 10.2, 16),
null
)), new Item.Properties());
public static final RegistryObject<Block> TREATED_WOOD_POLE_HEAD = registerWithItem(BLOCKS.register("treated_wood_pole_head", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME,
BlockBehaviour.Properties.of().strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(5.8, 5.8, 0, 10.2, 10.2, 16),
(EdStraightPoleBlock) TREATED_WOOD_POLE.get() // TREATED_WOOD_POLE
)), new Item.Properties());
public static final RegistryObject<Block> TREATED_WOOD_POLE_SUPPORT = registerWithItem(BLOCKS.register("treated_wood_pole_support", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME,
BlockBehaviour.Properties.of().strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(5.8, 5.8, 0, 10.2, 10.2, 16),
(EdStraightPoleBlock) TREATED_WOOD_POLE.get() // TREATED_WOOD_POLE
)), new Item.Properties());
public static final RegistryObject<Block> THIN_STEEL_POLE = registerWithItem(BLOCKS.register("thin_steel_pole", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(6, 6, 0, 10, 10, 16),
null
)), new Item.Properties());
public static final RegistryObject<Block> THIN_STEEL_POLE_HEAD = registerWithItem(BLOCKS.register("thin_steel_pole_head", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME,
BlockBehaviour.Properties.of().strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(6, 6, 0, 10, 10, 16),
(EdStraightPoleBlock) THIN_STEEL_POLE.get() // THIN_STEEL_POLE
)), new Item.Properties());
public static final RegistryObject<Block> THICK_STEEL_POLE = registerWithItem(BLOCKS.register("thick_steel_pole", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(5, 5, 0, 11, 11, 16),
null
)), new Item.Properties());
public static final RegistryObject<Block> THICK_STEEL_POLE_HEAD = registerWithItem(BLOCKS.register("thick_steel_pole_head", () -> new EdStraightPoleBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME,
BlockBehaviour.Properties.of().strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(5, 5, 0, 11, 11, 16),
(EdStraightPoleBlock) THIN_STEEL_POLE.get()
)), new Item.Properties());
public static final RegistryObject<Block> STEEL_DOUBLE_T_SUPPORT = registerWithItem(BLOCKS.register("steel_double_t_support", () -> new EdHorizontalSupportBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(5, 11, 0, 11, 16, 16), // main beam
Auxiliaries.getPixeledAABB(10, 11, 5, 16, 16, 11), // east beam (also for west 180deg)
Auxiliaries.getPixeledAABB(6, 0, 6, 10, 16, 10), // down thin
Auxiliaries.getPixeledAABB(5, 0, 5, 11, 16, 11) // down thick
)), new Item.Properties());
public static final RegistryObject<Block> STEEL_MESH_FENCE = registerWithItem(BLOCKS.register("steel_mesh_fence", () -> new EdFenceBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
1.5, 16, 0.25, 0, 16, 16
)), new Item.Properties());
public static final RegistryObject<Block> STEEL_MESH_FENCE_GATE = registerWithItem(BLOCKS.register("steel_mesh_fence_gate", () -> new EdDoubleGateBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 6.5, 16, 16, 9.5)
)), new Item.Properties());
public static final RegistryObject<Block> STEEL_RAILING = registerWithItem(BLOCKS.register("steel_railing", () -> new EdgeAlignedRailingBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 0, 0, 0, 0),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 15.9, 1)
)), new Item.Properties());
public static final RegistryObject<Block> STEEL_CATWALK = registerWithItem(BLOCKS.register("steel_catwalk", () -> new EdCatwalkBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 2, 16),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 15.9, 1),
STEEL_RAILING.get()
)), new Item.Properties());
public static final RegistryObject<Block> STEEL_CATWALK_STAIRS = registerWithItem(BLOCKS.register("steel_catwalk_stairs", () -> new EdCatwalkStairsBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{ // base
Auxiliaries.getPixeledAABB(1, 2, 8, 15, 4, 16),
Auxiliaries.getPixeledAABB(1, 10, 0, 15, 12, 8),
},
new AABB[]{ // railing left
Auxiliaries.getPixeledAABB(0.4, 0, 15, 0.6, 15, 16),
Auxiliaries.getPixeledAABB(0.4, 1, 14, 0.6, 16, 15),
Auxiliaries.getPixeledAABB(0.4, 2, 13, 0.6, 17, 14),
Auxiliaries.getPixeledAABB(0.4, 3, 12, 0.6, 18, 13),
Auxiliaries.getPixeledAABB(0.4, 4, 11, 0.6, 19, 12),
Auxiliaries.getPixeledAABB(0.4, 5, 10, 0.6, 20, 11),
Auxiliaries.getPixeledAABB(0.4, 6, 9, 0.6, 21, 10),
Auxiliaries.getPixeledAABB(0.4, 7, 8, 0.6, 22, 9),
Auxiliaries.getPixeledAABB(0.4, 8, 7, 0.6, 23, 8),
Auxiliaries.getPixeledAABB(0.4, 9, 6, 0.6, 24, 7),
Auxiliaries.getPixeledAABB(0.4, 10, 5, 0.6, 25, 6),
Auxiliaries.getPixeledAABB(0.4, 11, 4, 0.6, 26, 5),
Auxiliaries.getPixeledAABB(0.4, 12, 3, 0.6, 27, 4),
Auxiliaries.getPixeledAABB(0.4, 13, 2, 0.6, 28, 3),
Auxiliaries.getPixeledAABB(0.4, 14, 1, 0.6, 29, 2),
Auxiliaries.getPixeledAABB(0.4, 15, 0, 0.6, 30, 1)
}
)), new Item.Properties());
public static final RegistryObject<Block> SIGN_DECOR = registerWithItem(BLOCKS.register("sign_decor", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.3f, 1000f).sound(SoundType.WOOD).lightLevel((state) -> 1).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 15.6, 16, 16, 16.0)
)), new Item.Properties());
public static final RegistryObject<Block> SIGN_HOTWIRE = registerWithItem(BLOCKS.register("sign_hotwire", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
)), new Item.Properties());
public static final RegistryObject<Block> SIGN_DANGER = registerWithItem(BLOCKS.register("sign_danger", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
)), new Item.Properties());
public static final RegistryObject<Block> SIGN_RADIOACTIVE = registerWithItem(BLOCKS.register("sign_radioactive", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
)), new Item.Properties());
public static final RegistryObject<Block> SIGN_LASER = registerWithItem(BLOCKS.register("sign_laser", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
)), new Item.Properties());
public static final RegistryObject<Block> SIGN_CAUTION = registerWithItem(BLOCKS.register("sign_caution", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
)), new Item.Properties());
public static final RegistryObject<Block> SIGN_MAGICHAZARD = registerWithItem(BLOCKS.register("sign_magichazard", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
)), new Item.Properties());
public static final RegistryObject<Block> SIGN_FIREHAZARD = registerWithItem(BLOCKS.register("sign_firehazard", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
)), new Item.Properties());
public static final RegistryObject<Block> SIGN_HOTSURFACE = registerWithItem(BLOCKS.register("sign_hotsurface", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
)), new Item.Properties());
public static final RegistryObject<Block> SIGN_MAGNETICFIELD = registerWithItem(BLOCKS.register("sign_magneticfield", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
)), new Item.Properties());
public static final RegistryObject<Block> SIGN_FROST = registerWithItem(BLOCKS.register("sign_frost", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
)), new Item.Properties());
public static final RegistryObject<Block> SIGN_EXIT = registerWithItem(BLOCKS.register("sign_exit", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(3, 7, 15.6, 13, 13, 16)
)), new Item.Properties());
public static final RegistryObject<Block> SIGN_DEFENSE = registerWithItem(BLOCKS.register("sign_defense", () -> new StandardBlocks.DirectedWaterLoggable(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_AI_PASSABLE,
BlockBehaviour.Properties.of().strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(),
Auxiliaries.getPixeledAABB(2, 2, 15.6, 14, 14, 16)
)), new Item.Properties());
public static final RegistryObject<Block> SMALL_LAB_FURNACE = registerWithItem(BLOCKS.register("small_lab_furnace",
() -> new EdFurnace.FurnaceBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(1, 0, 1, 15, 1, 15),
Auxiliaries.getPixeledAABB(0, 1, 1, 16, 16, 16),
}
)
), new Item.Properties());
public static final RegistryObject<Block> SMALL_ELECTRICAL_FURNACE = registerWithItem(BLOCKS.register("small_electrical_furnace",
() -> new EdElectricalFurnace.ElectricalFurnaceBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 11, 16),
Auxiliaries.getPixeledAABB(1, 11, 0, 15, 12, 16),
Auxiliaries.getPixeledAABB(2, 12, 0, 14, 13, 16),
Auxiliaries.getPixeledAABB(3, 13, 0, 13, 14, 16),
Auxiliaries.getPixeledAABB(4, 14, 0, 12, 16, 16),
}
)
), new Item.Properties());
public static final RegistryObject<Block> FACTORY_DROPPER = registerWithItem(BLOCKS.register("factory_dropper",
() -> new EdDropper.DropperBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(0, 0, 1, 16, 16, 16)
)
), new Item.Properties());
public static final RegistryObject<Block> FACTORY_PLACER = registerWithItem(BLOCKS.register("factory_placer",
() -> new EdPlacer.PlacerBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_SHIFTCLICK | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 0, 2, 16, 16, 16),
Auxiliaries.getPixeledAABB(0, 0, 0, 1, 16, 2),
Auxiliaries.getPixeledAABB(15, 0, 0, 16, 16, 2)
}
)
), new Item.Properties());
public static final RegistryObject<Block> SMALL_BLOCK_BREAKER = registerWithItem(BLOCKS.register("small_block_breaker",
() -> new EdBreaker.BreakerBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_SHIFTCLICK,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(1, 0, 0, 15, 4, 7),
Auxiliaries.getPixeledAABB(1, 0, 7, 15, 12, 16),
Auxiliaries.getPixeledAABB(0, 0, 0, 1, 5, 4),
Auxiliaries.getPixeledAABB(0, 0, 4, 1, 12, 16),
Auxiliaries.getPixeledAABB(15, 0, 0, 16, 5, 4),
Auxiliaries.getPixeledAABB(15, 0, 4, 16, 12, 16)
}
)
), new Item.Properties());
public static final RegistryObject<Block> FACTORY_HOPPER = registerWithItem(BLOCKS.register("factory_hopper",
() -> new EdHopper.HopperBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), () -> {
final AABB[] down_aabbs = new AABB[]{
Auxiliaries.getPixeledAABB(5, 0, 5, 11, 1, 11),
Auxiliaries.getPixeledAABB(4, 1, 4, 12, 7, 12),
Auxiliaries.getPixeledAABB(2, 7, 2, 14, 10, 14),
Auxiliaries.getPixeledAABB(0, 10, 0, 16, 16, 16),
Auxiliaries.getPixeledAABB(0, 4, 5, 2, 10, 11),
Auxiliaries.getPixeledAABB(14, 4, 5, 16, 10, 11),
Auxiliaries.getPixeledAABB(5, 4, 0, 11, 10, 2),
Auxiliaries.getPixeledAABB(5, 4, 14, 11, 10, 16),
};
final AABB[] up_aabbs = new AABB[]{
Auxiliaries.getPixeledAABB(5, 15, 5, 11, 16, 11),
Auxiliaries.getPixeledAABB(4, 14, 4, 12, 9, 12),
Auxiliaries.getPixeledAABB(2, 9, 2, 14, 6, 14),
Auxiliaries.getPixeledAABB(0, 6, 0, 16, 0, 16),
Auxiliaries.getPixeledAABB(0, 12, 5, 2, 6, 11),
Auxiliaries.getPixeledAABB(14, 12, 5, 16, 6, 11),
Auxiliaries.getPixeledAABB(5, 12, 0, 11, 6, 2),
Auxiliaries.getPixeledAABB(5, 12, 14, 11, 6, 16),
};
final AABB[] north_aabbs = new AABB[]{
Auxiliaries.getPixeledAABB(5, 0, 5, 11, 1, 11),
Auxiliaries.getPixeledAABB(4, 1, 4, 12, 7, 12),
Auxiliaries.getPixeledAABB(2, 7, 2, 14, 10, 14),
Auxiliaries.getPixeledAABB(0, 10, 0, 16, 16, 16),
Auxiliaries.getPixeledAABB(0, 4, 5, 2, 10, 11),
Auxiliaries.getPixeledAABB(14, 4, 5, 16, 10, 11),
Auxiliaries.getPixeledAABB(5, 1, 0, 11, 7, 4),
Auxiliaries.getPixeledAABB(5, 4, 14, 11, 10, 16),
};
return new ArrayList<>(Arrays.asList(
Auxiliaries.getUnionShape(down_aabbs),
Auxiliaries.getUnionShape(up_aabbs),
Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.NORTH, false)),
Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.SOUTH, false)),
Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.WEST, false)),
Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.EAST, false)),
Shapes.block(),
Shapes.block()
));
}
)
), new Item.Properties());
public static final RegistryObject<Block> SMALL_WASTE_INCINERATOR = registerWithItem(BLOCKS.register("small_waste_incinerator",
() -> new EdWasteIncinerator.WasteIncineratorBlock(
StandardBlocks.CFG_DEFAULT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 16, 16)
)
), new Item.Properties());
public static final RegistryObject<Block> SMALL_MINERAL_SMELTER = registerWithItem(BLOCKS.register("small_mineral_smelter",
() -> new EdMineralSmelter.MineralSmelterBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(1.1, 0, 1.1, 14.9, 16, 14.9)
)
), new Item.Properties());
public static final RegistryObject<Block> SMALL_FREEZER = registerWithItem(BLOCKS.register("small_freezer",
() -> new EdFreezer.FreezerBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),
Auxiliaries.getPixeledAABB(1.1, 0, 1.1, 14.9, 16, 14.9)
)
), new Item.Properties());
public static final RegistryObject<Block> SMALL_SOLAR_PANEL = registerWithItem(BLOCKS.register("small_solar_panel",
() -> new EdSolarPanel.SolarPanelBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 2, 16),
Auxiliaries.getPixeledAABB(6, 1.5, 3, 10, 10.5, 13),
}
)
), new Item.Properties());
public static final RegistryObject<Block> SMALL_MILKING_MACHINE = registerWithItem(BLOCKS.register("small_milking_machine",
() -> new EdMilker.MilkerBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(1, 1, 0, 15, 14, 10),
Auxiliaries.getPixeledAABB(0, 14, 0, 16, 16, 13),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 1, 13),
Auxiliaries.getPixeledAABB(0, 1, 1, 1, 14, 11),
Auxiliaries.getPixeledAABB(15, 1, 1, 16, 14, 11)
}
)
), new Item.Properties());
public static final RegistryObject<Block> SMALL_TREE_CUTTER = registerWithItem(BLOCKS.register("small_tree_cutter",
() -> new EdTreeCutter.TreeCutterBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_HORIZIONTAL | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_SHIFTCLICK,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 3, 16),
Auxiliaries.getPixeledAABB(0, 3, 0, 3, 8, 16),
Auxiliaries.getPixeledAABB(3, 7, 0, 5, 8, 16),
Auxiliaries.getPixeledAABB(15, 0, 0, 16, 6, 16),
Auxiliaries.getPixeledAABB(0, 0, 13, 16, 8, 16),
Auxiliaries.getPixeledAABB(5, 6, 12, 16, 8, 13),
}
)
), new Item.Properties());
public static final RegistryObject<Block> STRAIGHT_PIPE_VALVE = registerWithItem(BLOCKS.register("straight_pipe_valve", () -> new EdPipeValve.PipeValveBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT | StandardBlocks.CFG_FLIP_PLACEMENT_SHIFTCLICK,
EdPipeValve.CFG_CHECK_VALVE,
BlockBehaviour.Properties.of().strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(2, 2, 0, 14, 14, 2),
Auxiliaries.getPixeledAABB(2, 2, 14, 14, 14, 16),
Auxiliaries.getPixeledAABB(3, 3, 5, 13, 13, 11),
Auxiliaries.getPixeledAABB(4, 4, 2, 12, 12, 14),
}
)), new Item.Properties());
public static final RegistryObject<Block> STRAIGHT_PIPE_VALVE_REDSTONE = registerWithItem(BLOCKS.register("straight_pipe_valve_redstone", () -> new EdPipeValve.PipeValveBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
EdPipeValve.CFG_REDSTONE_CONTROLLED_VALVE,
BlockBehaviour.Properties.of().strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(2, 2, 0, 14, 14, 2),
Auxiliaries.getPixeledAABB(2, 2, 14, 14, 14, 16),
Auxiliaries.getPixeledAABB(3, 3, 5, 13, 13, 11),
Auxiliaries.getPixeledAABB(4, 4, 2, 12, 12, 14),
}
)), new Item.Properties());
public static final RegistryObject<Block> STRAIGHT_PIPE_VALVE_REDSTONE_ANALOG = registerWithItem(BLOCKS.register("straight_pipe_valve_redstone_analog",
() -> new EdPipeValve.PipeValveBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_FACING_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
EdPipeValve.CFG_REDSTONE_CONTROLLED_VALVE | EdPipeValve.CFG_ANALOG_VALVE,
BlockBehaviour.Properties.of().strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(2, 2, 0, 14, 14, 2),
Auxiliaries.getPixeledAABB(2, 2, 14, 14, 14, 16),
Auxiliaries.getPixeledAABB(3, 3, 5, 13, 13, 11),
Auxiliaries.getPixeledAABB(4, 4, 2, 12, 12, 14),
}
)
), new Item.Properties());
public static final RegistryObject<Block> FLUID_BARREL = registerWithItem(BLOCKS.register("fluid_barrel",
() -> new EdFluidBarrel.FluidBarrelBlock(
StandardBlocks.CFG_CUTOUT | StandardBlocks.CFG_LOOK_PLACEMENT | StandardBlocks.CFG_OPPOSITE_PLACEMENT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(2, 0, 0, 14, 1, 16),
Auxiliaries.getPixeledAABB(1, 1, 0, 15, 2, 16),
Auxiliaries.getPixeledAABB(0, 2, 0, 16, 14, 16),
Auxiliaries.getPixeledAABB(1, 14, 0, 15, 15, 16),
Auxiliaries.getPixeledAABB(2, 15, 0, 14, 16, 16),
}
)
), new Item.Properties());
public static final RegistryObject<Block> SMALL_FLUID_FUNNEL = registerWithItem(BLOCKS.register("small_fluid_funnel",
() -> new EdFluidFunnel.FluidFunnelBlock(
StandardBlocks.CFG_CUTOUT,
BlockBehaviour.Properties.of().strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(),
new AABB[]{
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 14, 16),
Auxiliaries.getPixeledAABB(1, 14, 1, 15, 15, 15),
Auxiliaries.getPixeledAABB(0, 15, 0, 16, 16, 16)
}
)
), new Item.Properties());
public static final RegistryObject<Block> TEST_BLOCK = registerWithItem(BLOCKS.register("test_block",
() -> new EdTestBlock.TestBlock(
StandardBlocks.CFG_LOOK_PLACEMENT,
BlockBehaviour.Properties.of().strength(0f, 32000f).sound(SoundType.METAL),
Auxiliaries.getPixeledAABB(0, 0, 0, 16, 16, 16)
)
), new Item.Properties());
private static BlockBehaviour.Properties standard = standardBehavior();
private static BlockBehaviour.Properties explosionResistance = explosionResistance();
private static BlockBehaviour.Properties noViewBlocking = noViewBlocking();
private static BlockBehaviour.Properties stone = stoneLikeBehavior();
private static BlockBehaviour.Properties poolLightClean = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 15);
private static BlockBehaviour.Properties poolLightDirty = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 12);
private static BlockBehaviour.Properties poolLightFilthy = BlockBehaviour.Properties.copy(Blocks.GLASS).lightLevel((X) -> 4);
private static boolean never(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos) {
return false;
}
private static boolean always(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos) {
return true;
}
private static boolean neverSpawn(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, EntityType<?> entityType) {
return false;
}
public static void register(IEventBus bus) {
BLOCKS.register(bus);
ITEMS.register(bus);
}
private static BlockBehaviour.Properties standardBehavior() {
return BlockBehaviour.Properties.of().requiresCorrectToolForDrops().strength(7F).destroyTime(6);
}
private static BlockBehaviour.Properties stoneLikeBehavior() {
return BlockBehaviour.Properties.copy(Blocks.COBBLESTONE);
}
private static BlockBehaviour.Properties explosionResistance() {
return standardBehavior().explosionResistance(1200);
}
private static BlockBehaviour.Properties noViewBlocking() {
return standardBehavior().noOcclusion().isViewBlocking(ModBlocks::never);
}
private static BlockBehaviour.Properties fullBright() {
return standardBehavior().lightLevel((X) -> {
return 15;
}).noOcclusion();
}
public static RegistryObject<Block> registerWithItem(RegistryObject<Block> blk, Item.Properties props) {
CreativeModeTabs.addToTab(ITEMS.register(blk.getId().getPath(), () -> new BlockItem(blk.get(), props)));
return blk;
}
private static class detail {
public static String MODID = "";
public static Boolean disallowSpawn(BlockState state, BlockGetter reader, BlockPos pos, EntityType<?> entity) {
return false;
}
}
}

View file

@ -8,8 +8,8 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.engineersdecor.blocks.ModBlocks;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
@ -72,7 +72,7 @@ public class EdBreaker {
breaking_reluctance = Mth.clamp(breaking_time_per_hardness, 5, 50);
min_breaking_time = Mth.clamp(min_breaking_time_ticks, 10, 100);
requires_power = power_required;
ModConfig.log("Config block breaker: Boost energy consumption:" + (boost_energy_consumption / interval) + "rf/t, reluctance=" + breaking_reluctance + "t/hrdn, break time offset=" + min_breaking_time + "t.");
//ModConfig.log("Config block breaker: Boost energy consumption:" + (boost_energy_consumption / interval) + "rf/t, reluctance=" + breaking_reluctance + "t/hrdn, break time offset=" + min_breaking_time + "t.");
}
//--------------------------------------------------------------------------------------------------------------------
@ -232,7 +232,7 @@ public class EdBreaker {
// Maybe make a tag for that. The question is if it is actually worth it, or if that would be only
// tag spamming the game. So for now only FH and VH.
final BlockState state = world.getBlockState(pos);
return (state.getBlock() == ModContent.getBlock("factory_hopper")) || (state.getBlock() == Blocks.HOPPER);
return (state.getBlock() == ModBlocks.FACTORY_HOPPER.get()) || (state.getBlock() == Blocks.HOPPER);
}
public void block_updated() {

View file

@ -9,6 +9,7 @@
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.engineersdecor.blocks.ModBlocks;
import dev.zontreck.libzontreck.edlibmc.Auxiliaries;
import dev.zontreck.libzontreck.edlibmc.StandardBlocks;
import net.minecraft.core.BlockPos;
@ -132,18 +133,18 @@ public class EdCatwalkStairsBlock extends StandardBlocks.HorizontalWaterLoggable
place_state = place_state.setValue(WATERLOGGED, adjacent_state.getFluidState().getType() == Fluids.WATER);
EdCatwalkBlock.place_consume(place_state, world, adjacent_pos, player, hand, 1);
return world.isClientSide() ? InteractionResult.SUCCESS : InteractionResult.CONSUME;
} else if ((block == ModContent.getBlock("steel_catwalk")) || (block == ModContent.getBlock("steel_catwalk_ta"))) {
} else if ((block == ModBlocks.STEEL_CATWALK.get()) || (block == ModBlocks.STEEL_CATWALK_TA.get())) {
BlockPos adjacent_pos;
adjacent_pos = pos.relative(facing);
final BlockState adjacent_state = world.getBlockState(adjacent_pos);
if (adjacent_state == null) return InteractionResult.CONSUME;
if (!adjacent_state.canBeReplaced(new DirectionalPlaceContext(world, adjacent_pos, hit.getDirection().getOpposite(), player.getItemInHand(hand), hit.getDirection())))
return InteractionResult.CONSUME;
BlockState place_state = ModContent.getBlock("steel_catwalk_ta").defaultBlockState(); // ModContent.STEEL_CATWALK_TOP_ALIGNED
BlockState place_state = ModBlocks.STEEL_CATWALK_TA.get().defaultBlockState(); // ModContent.STEEL_CATWALK_TOP_ALIGNED
place_state = place_state.setValue(WATERLOGGED, adjacent_state.getFluidState().getType() == Fluids.WATER);
EdCatwalkBlock.place_consume(place_state, world, adjacent_pos, player, hand, 1);
return world.isClientSide() ? InteractionResult.SUCCESS : InteractionResult.CONSUME;
} else if (block == ModContent.getBlock("steel_railing")) {
} else if (block == ModBlocks.STEEL_RAILING.get()) {
Direction face = hit.getDirection();
int shrink = 0;
BlockState place_state = state;
@ -185,7 +186,7 @@ public class EdCatwalkStairsBlock extends StandardBlocks.HorizontalWaterLoggable
List<ItemStack> drops = new ArrayList<>();
drops.add(new ItemStack(state.getBlock().asItem()));
int n = (state.getValue(LEFT_RAILING) ? 1 : 0) + (state.getValue(RIGHT_RAILING) ? 1 : 0);
if (n > 0) drops.add(new ItemStack(ModContent.getBlock("steel_railing"), n));
if (n > 0) drops.add(new ItemStack(ModBlocks.STEEL_RAILING.get(), n));
return drops;
}

View file

@ -9,6 +9,7 @@
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.engineersdecor.blocks.ModBlocks;
import dev.zontreck.libzontreck.edlibmc.StandardBlocks;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
@ -123,9 +124,9 @@ public class EdCatwalkTopAlignedBlock extends StandardBlocks.WaterLoggable {
private BlockState adapted_state(BlockState state, LevelAccessor world, BlockPos pos) {
BlockState below = world.getBlockState(pos.below());
if (state == null || state.getValue(VARIANT) == 4) return state;
if ((below.getBlock() == ModContent.getBlock("thick_steel_pole")) || (below.getBlock() == ModContent.getBlock("thick_steel_pole_head")))
if ((below.getBlock() == ModBlocks.THICK_STEEL_POLE.get()) || (below.getBlock() == ModBlocks.THICK_STEEL_POLE_HEAD.get()))
return state.setValue(VARIANT, 1);
if ((below.getBlock() == ModContent.getBlock("thin_steel_pole")) || (below.getBlock() == ModContent.getBlock("thin_steel_pole_head")))
if ((below.getBlock() == ModBlocks.THIN_STEEL_POLE.get()) || (below.getBlock() == ModBlocks.THIN_STEEL_POLE_HEAD.get()))
return state.setValue(VARIANT, 2);
return state;
}

View file

@ -8,7 +8,6 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.libzontreck.edlibmc.StandardBlocks;
import net.minecraft.core.BlockPos;
@ -48,7 +47,7 @@ public class EdChair {
sitting_enabled = (!without_sitting);
sitting_probability = (without_sitting || without_mob_sitting) ? 0.0 : Mth.clamp(sitting_probability_percent / 100, 0, 0.9);
standup_probability = (without_sitting || without_mob_sitting) ? 1.0 : Mth.clamp(standup_probability_percent / 100, 1e-6, 1e-2);
ModConfig.log("Config chairs: sit:" + sitting_enabled + ", mob-sit: " + (sitting_probability * 100) + "%, standup: " + (standup_probability) + "%.");
//ModConfig.log("Config chairs: sit:" + sitting_enabled + ", mob-sit: " + (sitting_probability * 100) + "%, standup: " + (standup_probability) + "%.");
}
//--------------------------------------------------------------------------------------------------------------------

View file

@ -8,8 +8,8 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.engineersdecor.blocks.ModBlocks;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.core.BlockPos;
@ -62,7 +62,7 @@ public class EdDropper {
public static void on_config(boolean with_item_insertion) {
with_adjacent_item_insertion = with_item_insertion;
ModConfig.log("Config dropper: item-insertion:" + with_adjacent_item_insertion + ".");
//ModConfig.log("Config dropper: item-insertion:" + with_adjacent_item_insertion + ".");
}
//--------------------------------------------------------------------------------------------------------------------
@ -800,7 +800,7 @@ public class EdDropper {
public void init() {
super.init();
{
final Block block = ModContent.getBlock(Auxiliaries.getResourceLocation(getMenu().getType()).getPath().replaceAll("^ct_", ""));
final Block block = ModBlocks.FACTORY_DROPPER.get();
final String prefix = block.getDescriptionId() + ".tooltips.";
final int x0 = getGuiLeft(), y0 = getGuiTop();
tooltip_.init(

View file

@ -8,8 +8,8 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.engineersdecor.blocks.ModBlocks;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.core.BlockPos;
@ -297,7 +297,7 @@ public class EdElectricalFurnace {
energy_consumption_ = Mth.clamp(standard_energy_per_tick, 4, 4096) * TICK_INTERVAL;
transfer_energy_consumption_ = Mth.clamp(energy_consumption_ / 8, 8, HEAT_INCREMENT);
with_automatic_inventory_pulling_ = with_automatic_inventory_pulling;
ModConfig.log("Config electrical furnace speed:" + proc_speed_percent_ + "%, heat-loss: 1K/t, heating consumption:" + (energy_consumption_ / TICK_INTERVAL) + "rf/t.");
//ModConfig.log("Config electrical furnace speed:" + proc_speed_percent_ + "%, heat-loss: 1K/t, heating consumption:" + (energy_consumption_ / TICK_INTERVAL) + "rf/t.");
}
@Nullable
@ -515,7 +515,7 @@ public class EdElectricalFurnace {
}
private boolean is_accepted_hopper(final ItemStack stack) {
return (stack.getItem() == Blocks.HOPPER.asItem()) || (stack.getItem() == ModContent.getBlock("factory_hopper").asItem());
return (stack.getItem() == Blocks.HOPPER.asItem()) || (stack.getItem() == ModBlocks.FACTORY_HOPPER.get().asItem());
}
private boolean transferItems(final int index_from, final int index_to, int count) {
@ -888,7 +888,7 @@ public class EdElectricalFurnace {
@Override
public void init() {
super.init();
final Block block = ModContent.getBlock(Auxiliaries.getResourceLocation(getMenu().getType()).getPath().replaceAll("^ct_", ""));
final Block block = ModBlocks.SMALL_ELECTRICAL_FURNACE.get();
final String prefix = block.getDescriptionId() + ".tooltips.";
final int x0 = getGuiLeft(), y0 = getGuiTop();
final Slot aux = menu.getSlot(ElectricalFurnaceTileEntity.SMELTING_AUX_SLOT_NO);

View file

@ -8,7 +8,6 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.core.BlockPos;
@ -72,7 +71,7 @@ public class EdFluidBarrel {
capacity_ = Mth.clamp(tank_capacity, 2000, 64000);
tile_fluid_handler_transfer_rate_ = Mth.clamp(tank_capacity, 50, 4096);
item_fluid_handler_transfer_rate_ = tile_fluid_handler_transfer_rate_;
ModConfig.log("Config fluid barrel: capacity:" + capacity_ + "mb, transfer-rate:" + tile_fluid_handler_transfer_rate_ + "mb/t.");
//ModConfig.log("Config fluid barrel: capacity:" + capacity_ + "mb, transfer-rate:" + tile_fluid_handler_transfer_rate_ + "mb/t.");
}
//--------------------------------------------------------------------------------------------------------------------

View file

@ -10,7 +10,6 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.libzontreck.edlibmc.Fluidics;
import dev.zontreck.libzontreck.edlibmc.StandardBlocks;
@ -59,7 +58,7 @@ public class EdFluidFunnel {
public static void on_config(boolean with_tank_fluid_collection) {
with_device_fluid_handler_collection = with_tank_fluid_collection;
ModConfig.log("Config fluid funnel: tank-fluid-collection:" + with_device_fluid_handler_collection + ".");
//ModConfig.log("Config fluid funnel: tank-fluid-collection:" + with_device_fluid_handler_collection + ".");
}
//--------------------------------------------------------------------------------------------------------------------

View file

@ -9,7 +9,6 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.libzontreck.edlibmc.Fluidics;
import dev.zontreck.libzontreck.edlibmc.StandardBlocks;
@ -210,7 +209,7 @@ public class EdFreezer {
energy_consumption = Mth.clamp(consumption, 8, 4096);
cooldown_rate = Mth.clamp(cooldown_per_second, 1, 5);
reheat_rate = Mth.clamp(cooldown_per_second / 2, 1, 5);
ModConfig.log("Config freezer energy consumption:" + energy_consumption + "rf/t, cooldown-rate: " + cooldown_rate + "%/s.");
//ModConfig.log("Config freezer energy consumption:" + energy_consumption + "rf/t, cooldown-rate: " + cooldown_rate + "%/s.");
}
public int progress() {

View file

@ -8,7 +8,6 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.libzontreck.edlibmc.*;
import dev.zontreck.libzontreck.edlibmc.Inventories.MappedItemHandler;
@ -328,7 +327,7 @@ public class EdFurnace {
ResourceLocation rl = new ResourceLocation(rlstr);
Item heater = ForgeRegistries.ITEMS.getValue(rl);
if ((heater == null) || (heater == Items.AIR)) {
ModConfig.log("Furnace accepted heater config: Skipped '" + rl + "', item not found/mod not installed.");
//ModConfig.log("Furnace accepted heater config: Skipped '" + rl + "', item not found/mod not installed.");
} else {
accepted_heaters_.add(heater);
}

View file

@ -9,6 +9,7 @@
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.engineersdecor.blocks.ModBlocks;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.core.BlockPos;
@ -765,7 +766,7 @@ public class EdHopper {
public void init() {
super.init();
{
final Block block = ModContent.getBlock(Auxiliaries.getResourceLocation(getMenu().getType()).getPath().replaceAll("^ct_", ""));
final Block block = ModBlocks.FACTORY_HOPPER.get();
final String prefix = block.getDescriptionId() + ".tooltips.";
final int x0 = getGuiLeft(), y0 = getGuiTop();
tooltip_.init(

View file

@ -9,6 +9,7 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.blocks.ModBlocks;
import dev.zontreck.libzontreck.edlibmc.Auxiliaries;
import dev.zontreck.libzontreck.edlibmc.Inventories;
import dev.zontreck.libzontreck.edlibmc.StandardBlocks;
@ -120,9 +121,9 @@ public class EdHorizontalSupportBlock extends StandardBlocks.WaterLoggable
if((dstate.getBlock() instanceof final EdStraightPoleBlock pole)) {
final Direction dfacing = dstate.getValue(EdStraightPoleBlock.FACING);
if((dfacing.getAxis() == Direction.Axis.Y)) {
if((pole==ModContent.getBlock("thick_steel_pole")) || ((pole==ModContent.getBlock("thick_steel_pole_head")) && (dfacing==Direction.UP))) {
if((pole== ModBlocks.THICK_STEEL_POLE.get()) || ((pole==ModBlocks.THICK_STEEL_POLE_HEAD.get()) && (dfacing==Direction.UP))) {
down_connector = 2;
} else if((pole==ModContent.getBlock("thin_steel_pole")) || ((pole==ModContent.getBlock("thin_steel_pole_head")) && (dfacing==Direction.UP))) {
} else if((pole==ModBlocks.THIN_STEEL_POLE.get()) || ((pole==ModBlocks.THIN_STEEL_POLE_HEAD.get()) && (dfacing==Direction.UP))) {
down_connector = 1;
}
}

View file

@ -12,7 +12,6 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.libzontreck.edlibmc.Auxiliaries;
import dev.zontreck.libzontreck.edlibmc.StandardBlocks;
import net.minecraft.core.BlockPos;
@ -56,7 +55,7 @@ public class EdLadderBlock extends LadderBlock implements StandardBlocks.IStanda
public static void on_config(boolean without_speed_boost) {
without_speed_boost_ = without_speed_boost;
ModConfig.log("Config ladder: without-speed-boost:" + without_speed_boost_);
//ModConfig.log("Config ladder: without-speed-boost:" + without_speed_boost_);
}
// Player update event, forwarded from the main mod instance.

View file

@ -9,7 +9,6 @@
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.core.BlockPos;
@ -93,10 +92,10 @@ public class EdMilker {
{
milk_containers_.put(new ItemStack(Items.BUCKET), new ItemStack(Items.MILK_BUCKET));
}
ModConfig.log(
/*ModConfig.log(
"Config milker: energy consumption:" + energy_consumption_ + "rf/t"
+ ((milk_fluid_ == NO_MILK_FLUID) ? "[no milk fluid registered]" : " [milk fluid available]")
);
);*/
}
//--------------------------------------------------------------------------------------------------------------------

View file

@ -9,7 +9,6 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.core.BlockPos;
@ -281,7 +280,7 @@ public class EdMineralSmelter {
energy_consumption = Mth.clamp(consumption, 8, 4096);
heatup_rate = Mth.clamp(heatup_per_second, 1, 5);
cooldown_rate = Mth.clamp(heatup_per_second / 2, 1, 5);
ModConfig.log("Config mineal smelter: energy consumption:" + energy_consumption + "rf/t, heat-up rate: " + heatup_rate + "%/s.");
//ModConfig.log("Config mineal smelter: energy consumption:" + energy_consumption + "rf/t, heat-up rate: " + heatup_rate + "%/s.");
}
public int progress() {

View file

@ -9,7 +9,6 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.libzontreck.edlibmc.RsSignals;
import dev.zontreck.libzontreck.edlibmc.StandardBlocks;
@ -53,7 +52,7 @@ public class EdPipeValve {
public static void on_config(int container_size_decl, int redstone_slope) {
PipeValveTileEntity.fluid_maxflow_mb = Mth.clamp(container_size_decl, 1, 10000);
PipeValveTileEntity.redstone_flow_slope_mb = Mth.clamp(redstone_slope, 1, 10000);
ModConfig.log("Config pipe valve: maxflow:" + PipeValveTileEntity.fluid_maxflow_mb + "mb, redstone amp:" + PipeValveTileEntity.redstone_flow_slope_mb + "mb/sig.");
//ModConfig.log("Config pipe valve: maxflow:" + PipeValveTileEntity.fluid_maxflow_mb + "mb, redstone amp:" + PipeValveTileEntity.redstone_flow_slope_mb + "mb/sig.");
}
//--------------------------------------------------------------------------------------------------------------------

View file

@ -9,6 +9,7 @@
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.engineersdecor.blocks.ModBlocks;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.core.BlockPos;
@ -691,7 +692,7 @@ public class EdPlacer {
public void init() {
super.init();
{
final Block block = ModContent.getBlock(Auxiliaries.getResourceLocation(getMenu().getType()).getPath().replaceAll("^ct_", ""));
final Block block = ModBlocks.FACTORY_PLACER.get();
final String prefix = block.getDescriptionId() + ".tooltips.";
final int x0 = getGuiLeft(), y0 = getGuiTop();
tooltip_.init(

View file

@ -8,7 +8,6 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.core.BlockPos;
@ -52,7 +51,7 @@ public class EdSolarPanel {
balancing_threshold = Math.max(max_power_storage_ / 10, 1000);
max_power_storage_ = battery_capacity;
max_feed_power = max_feed_in_power * t;
ModConfig.log("Config small solar panel: Peak production:" + peak_power_per_tick_ + "/t, capacity:" + max_power_storage_ + "rf, max-feed:" + (max_feed_power / t) + "rf/t");
//ModConfig.log("Config small solar panel: Peak production:" + peak_power_per_tick_ + "/t, capacity:" + max_power_storage_ + "rf, max-feed:" + (max_feed_power / t) + "rf/t");
}
//--------------------------------------------------------------------------------------------------------------------

View file

@ -9,6 +9,7 @@
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.engineersdecor.blocks.ModBlocks;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
@ -237,7 +238,7 @@ public class EdTestBlock {
Overlay.show(player, Component.literal("RF feed rate: " + rf_feed_setting + "rf/t"), 1000);
} else {
BlockState adjacent_state = level.getBlockState(worldPosition.relative(block_facing));
if (adjacent_state.getBlock() == Blocks.HOPPER || adjacent_state.getBlock() == ModContent.getBlock("factory_hopper")) {
if (adjacent_state.getBlock() == Blocks.HOPPER || adjacent_state.getBlock() == ModBlocks.FACTORY_HOPPER.get()) {
insertion_item = held.copy();
Overlay.show(player, Component.literal("Insertion item: " + (insertion_item.getItem() == Items.LEVER ? "random" : insertion_item.toString()) + "/s"), 1000);
}
@ -292,7 +293,7 @@ public class EdTestBlock {
if ((tick_timer == 1) && (!insertion_item.isEmpty())) {
BlockState adjacent_state = level.getBlockState(worldPosition.relative(block_facing));
ItemStack stack = (insertion_item.getItem() == Items.LEVER) ? getRandomItemstack() : insertion_item.copy();
if (adjacent_state.getBlock() == Blocks.HOPPER || adjacent_state.getBlock() == ModContent.getBlock("factory_hopper")) {
if (adjacent_state.getBlock() == Blocks.HOPPER || adjacent_state.getBlock() == ModBlocks.FACTORY_HOPPER.get()) {
ItemStack remaining = Inventories.insert(getLevel(), getBlockPos().relative(block_facing), block_facing.getOpposite(), stack, false);
int n = stack.getCount() - remaining.getCount();
items_inserted_total += n;

View file

@ -8,7 +8,6 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.engineersdecor.detail.TreeCutting;
import dev.zontreck.libzontreck.edlibmc.Auxiliaries;
@ -147,7 +146,7 @@ public class EdTreeCutter {
energy_max = Math.max(boost_energy_consumption * 10, 10000);
cutting_time_needed = 20 * Mth.clamp(cutting_time_seconds, 10, 240);
requires_power = power_required;
ModConfig.log("Config tree cutter: energy consumption:" + (boost_energy_consumption / TICK_INTERVAL) + "rf/t" + (requires_power ? " (power required for operation) " : "") + ", cutting time:" + cutting_time_needed + "t.");
//ModConfig.log("Config tree cutter: energy consumption:" + (boost_energy_consumption / TICK_INTERVAL) + "rf/t" + (requires_power ? " (power required for operation) " : "") + ", cutting time:" + cutting_time_needed + "t.");
}
public void readnbt(CompoundTag nbt) {

View file

@ -8,7 +8,6 @@
*/
package dev.zontreck.engineersdecor.blocks.implementation;
import dev.zontreck.engineersdecor.ModConfig;
import dev.zontreck.engineersdecor.ModContent;
import dev.zontreck.libzontreck.edlibmc.*;
import net.minecraft.core.BlockPos;
@ -57,7 +56,7 @@ public class EdWasteIncinerator {
public static void on_config(int boost_energy_per_tick) {
energy_consumption = Mth.clamp(boost_energy_per_tick, 4, 4096);
ModConfig.log("Config waste incinerator: boost energy consumption:" + energy_consumption + ".");
//ModConfig.log("Config waste incinerator: boost energy consumption:" + energy_consumption + ".");
}
//--------------------------------------------------------------------------------------------------------------------

View file

@ -0,0 +1,29 @@
package dev.zontreck.engineersdecor.entities;
import dev.zontreck.engineersdecor.ModEngineersDecor;
import dev.zontreck.engineersdecor.blocks.implementation.EdChair;
import dev.zontreck.libzontreck.edlibmc.Auxiliaries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
public class ModEntities
{
public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, ModEngineersDecor.MODID);
public static final RegistryObject<EntityType<?>> CHAIR = ENTITIES.register("chair", () ->
EntityType.Builder.of(EdChair.EntityChair::new, MobCategory.MISC)
.fireImmune().sized(1e-3f, 1e-3f).noSave()
.setShouldReceiveVelocityUpdates(false).setUpdateInterval(4)
.setCustomClientFactory(EdChair.EntityChair::customClientFactory)
.build(new ResourceLocation(ModEngineersDecor.MODID, "chair").toString()));
public static void register(IEventBus bus)
{
ENTITIES.register(bus);
}
}

View file

@ -0,0 +1,40 @@
package dev.zontreck.engineersdecor.items;
import dev.zontreck.engineersdecor.ModEngineersDecor;
import dev.zontreck.engineersdecor.blocks.ModBlocks;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.ItemLike;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;
@Mod.EventBusSubscriber(modid = ModEngineersDecor.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class CreativeModeTabs
{
public static final DeferredRegister<CreativeModeTab> REGISTER = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, ModEngineersDecor.MODID);
public static final List<Supplier<? extends ItemLike>> TAB_ITEMS = new ArrayList<>();
public static final RegistryObject<CreativeModeTab> TAB = REGISTER.register("otemod", () -> CreativeModeTab.builder()
.title(Component.translatable("itemGroup.tabs.engineersdecor"))
.icon(ModBlocks.CLINKER_BRICK_BLOCK.get().asItem()::getDefaultInstance)
.displayItems((display, output) -> TAB_ITEMS.forEach(it->output.accept(it.get())))
.build()
);
public static <T extends Item> RegistryObject<T> addToTab(RegistryObject<T> itemLike)
{
TAB_ITEMS.add(itemLike);
return itemLike;
}
}

View file

@ -0,0 +1,21 @@
package dev.zontreck.engineersdecor.items;
import dev.zontreck.engineersdecor.ModEngineersDecor;
import net.minecraft.world.item.Item;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
public class ModItems
{
public static DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ModEngineersDecor.MODID);
public static final RegistryObject<Item> METAL_BAR = CreativeModeTabs.addToTab(ITEMS.register("metal_bar", ()-> new Item(new Item.Properties())));
public static void register(IEventBus bus)
{
ITEMS.register(bus);
}
}

View file

@ -6,7 +6,7 @@
*
* Basic item functionality for mod items.
*/
package dev.zontreck.engineersdecor.items;
package dev.zontreck.engineersdecor.items.implementation;
import dev.zontreck.libzontreck.edlibmc.Auxiliaries;
import net.minecraft.network.chat.Component;

View file

@ -0,0 +1,6 @@
{
"values": [
"minecraft:diorite",
"minecraft:cobblestone"
]
}