Skip to content

Commit

Permalink
Inline QuarkModule 🦀
Browse files Browse the repository at this point in the history
  • Loading branch information
quat1024 committed Oct 19, 2023
1 parent 0a3c32e commit 7213fed
Show file tree
Hide file tree
Showing 298 changed files with 686 additions and 759 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
import vazkii.quark.addons.oddities.block.be.CrateBlockEntity;
import vazkii.quark.addons.oddities.module.CrateModule;
import vazkii.quark.base.block.QuarkBlock;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;

public class CrateBlock extends QuarkBlock implements EntityBlock {

public static final BooleanProperty PROPERTY_OPEN = BlockStateProperties.OPEN;

public CrateBlock(QuarkModule module) {
public CrateBlock(ZetaModule module) {
super("crate", module, CreativeModeTab.TAB_DECORATIONS, Properties.copy(Blocks.BARREL));
registerDefaultState(stateDefinition.any().setValue(PROPERTY_OPEN, false));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
import vazkii.quark.addons.oddities.magnetsystem.MagnetSystem;
import vazkii.quark.addons.oddities.module.MagnetsModule;
import vazkii.quark.base.block.QuarkBlock;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;

public class MagnetBlock extends QuarkBlock implements EntityBlock {

public static final DirectionProperty FACING = BlockStateProperties.FACING;
public static final BooleanProperty POWERED = BlockStateProperties.POWERED;

public MagnetBlock(QuarkModule module) {
public MagnetBlock(ZetaModule module) {
super("magnet", module, CreativeModeTab.TAB_REDSTONE, Properties.copy(Blocks.IRON_BLOCK));
registerDefaultState(defaultBlockState().setValue(FACING, Direction.DOWN).setValue(POWERED, false));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
import vazkii.quark.base.block.IQuarkBlock;
import vazkii.quark.base.handler.CreativeTabHandler;
import vazkii.quark.base.module.ModuleLoader;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;

public class MatrixEnchantingTableBlock extends EnchantmentTableBlock implements IQuarkBlock {

private final QuarkModule module;
private final ZetaModule module;
private BooleanSupplier enabledSupplier = () -> true;

public MatrixEnchantingTableBlock(QuarkModule module) {
public MatrixEnchantingTableBlock(ZetaModule module) {
super(Block.Properties.copy(Blocks.ENCHANTING_TABLE));

this.module = module;
Expand Down Expand Up @@ -80,7 +80,7 @@ public boolean doesConditionApply() {

@Nullable
@Override
public QuarkModule getModule() {
public ZetaModule getModule() {
return module;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import vazkii.quark.addons.oddities.block.be.MagnetizedBlockBlockEntity;
import vazkii.quark.addons.oddities.module.MagnetsModule;
import vazkii.quark.base.block.QuarkBlock;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;

/**
* @author WireSegal
Expand All @@ -47,7 +47,7 @@
public class MovingMagnetizedBlock extends QuarkBlock implements EntityBlock {
public static final DirectionProperty FACING = PistonHeadBlock.FACING;

public MovingMagnetizedBlock(QuarkModule module) {
public MovingMagnetizedBlock(ZetaModule module) {
super("magnetized_block", module, null, Block.Properties.of(Material.PISTON).strength(-1.0F).dynamicShape().noLootTable().noOcclusion());
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import vazkii.quark.addons.oddities.item.TinyPotatoBlockItem;
import vazkii.quark.addons.oddities.module.TinyPotatoModule;
import vazkii.quark.base.block.QuarkBlock;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.zeta.registry.IZetaBlockItemProvider;

import javax.annotation.Nonnull;
Expand All @@ -68,7 +68,7 @@ public static boolean isAngry(ItemStack stack) {
return ItemNBTHelper.getBoolean(stack, ANGRY, false);
}

public TinyPotatoBlock(QuarkModule module) {
public TinyPotatoBlock(ZetaModule module) {
super("tiny_potato", module, CreativeModeTab.TAB_DECORATIONS,
BlockBehaviour.Properties.of(Material.WOOL).strength(0.25F));
registerDefaultState(defaultBlockState()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import vazkii.quark.addons.oddities.module.PipesModule;
import vazkii.quark.base.block.QuarkBlock;
import vazkii.quark.base.handler.RenderLayerHandler;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;

import javax.annotation.Nonnull;
import java.util.HashSet;
Expand Down Expand Up @@ -55,7 +55,7 @@ protected static BooleanProperty property(Direction direction) {
};
}

protected BasePipeBlock(String name, QuarkModule module) {
protected BasePipeBlock(String name, ZetaModule module) {
super(name, module, CreativeModeTab.TAB_REDSTONE,
Block.Properties.of(Material.GLASS)
.strength(3F, 10F)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import vazkii.quark.addons.oddities.block.be.PipeBlockEntity.ConnectionType;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;

public class EncasedPipeBlock extends BasePipeBlock {

public EncasedPipeBlock(QuarkModule module) {
public EncasedPipeBlock(ZetaModule module) {
super("encased_pipe", module);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import vazkii.quark.addons.oddities.block.be.PipeBlockEntity;
import vazkii.quark.addons.oddities.module.PipesModule;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;

import javax.annotation.Nonnull;

Expand All @@ -56,7 +56,7 @@ public class PipeBlock extends BasePipeBlock implements SimpleWaterloggedBlock {

public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;

public PipeBlock(QuarkModule module) {
public PipeBlock(ZetaModule module) {
super("pipe", module);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import vazkii.quark.base.client.handler.RequiredModTooltipHandler;
import vazkii.quark.base.handler.ProxiedItemStackHandler;
import vazkii.quark.base.item.IQuarkItem;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.zeta.registry.IZetaItemColorProvider;

import javax.annotation.Nonnull;
Expand All @@ -51,13 +51,13 @@ public class BackpackItem extends DyeableArmorItem implements IQuarkItem, MenuPr
private static final String WORN_TEXTURE = Quark.MOD_ID + ":textures/misc/backpack_worn.png";
private static final String WORN_OVERLAY_TEXTURE = Quark.MOD_ID + ":textures/misc/backpack_worn_overlay.png";

private final QuarkModule module;
private final ZetaModule module;

@OnlyIn(Dist.CLIENT)
@SuppressWarnings("rawtypes")
private HumanoidModel model;

public BackpackItem(QuarkModule module) {
public BackpackItem(ZetaModule module) {
super(ArmorMaterials.LEATHER, EquipmentSlot.CHEST,
new Item.Properties()
.stacksTo(1)
Expand All @@ -78,7 +78,7 @@ public int getDefaultTooltipHideFlags(@Nonnull ItemStack stack) {
}

@Override
public QuarkModule getModule() {
public ZetaModule getModule() {
return module;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import vazkii.quark.base.block.QuarkBlock;
import vazkii.quark.base.item.QuarkItem;
import vazkii.quark.base.module.LoadModule;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.quark.base.module.hint.Hint;
import vazkii.quark.base.network.QuarkNetwork;
Expand All @@ -50,7 +50,7 @@
import vazkii.zeta.event.client.ZClientSetup;

@LoadModule(category = "oddities", hasSubscriptions = true)
public class BackpackModule extends QuarkModule {
public class BackpackModule extends ZetaModule {

@Config(description = "Set this to true to allow the backpacks to be unequipped even with items in them")
public static boolean superOpMode = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
import vazkii.quark.addons.oddities.inventory.CrateMenu;
import vazkii.quark.base.Quark;
import vazkii.quark.base.module.LoadModule;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.quark.base.module.hint.Hint;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.event.client.ZClientSetup;

@LoadModule(category = "oddities")
public class CrateModule extends QuarkModule {
public class CrateModule extends ZetaModule {

public static BlockEntityType<CrateBlockEntity> blockEntityType;
public static MenuType<CrateMenu> menuType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import net.minecraft.core.Registry;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.event.TickEvent.LevelTickEvent;
import net.minecraftforge.event.TickEvent.Phase;
import net.minecraftforge.eventbus.api.SubscribeEvent;
Expand All @@ -22,15 +20,15 @@
import vazkii.quark.api.event.RecipeCrawlEvent;
import vazkii.quark.base.Quark;
import vazkii.quark.base.module.LoadModule;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.quark.base.module.hint.Hint;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.event.client.ZClientSetup;

@LoadModule(category = "oddities", hasSubscriptions = true)
public class MagnetsModule extends QuarkModule {
public class MagnetsModule extends ZetaModule {

public static BlockEntityType<MagnetBlockEntity> magnetType;
public static BlockEntityType<MagnetizedBlockBlockEntity> magnetizedBlockType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import vazkii.quark.base.handler.advancement.QuarkAdvancementHandler;
import vazkii.quark.base.handler.advancement.QuarkGenericTrigger;
import vazkii.quark.base.module.LoadModule;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;

import java.util.ArrayList;
Expand All @@ -54,7 +54,7 @@
import java.util.Map;

@LoadModule(category = "oddities", hasSubscriptions = true)
public class MatrixEnchantingModule extends QuarkModule {
public class MatrixEnchantingModule extends ZetaModule {

public static BlockEntityType<MatrixEnchantingTableBlockEntity> blockEntityType;
public static MenuType<MatrixEnchantingMenu> menuType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import vazkii.quark.addons.oddities.client.render.be.PipeRenderer;
import vazkii.quark.base.Quark;
import vazkii.quark.base.module.LoadModule;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.quark.base.module.hint.Hint;
import vazkii.zeta.event.ZCommonSetup;
Expand All @@ -27,7 +27,7 @@
import vazkii.zeta.event.client.ZClientSetup;

@LoadModule(category = "oddities")
public class PipesModule extends QuarkModule {
public class PipesModule extends ZetaModule {

public static BlockEntityType<PipeBlockEntity> blockEntityType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import vazkii.quark.base.handler.advancement.QuarkAdvancementHandler;
import vazkii.quark.base.handler.advancement.QuarkGenericTrigger;
import vazkii.quark.base.module.LoadModule;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.quark.base.module.hint.Hint;
import vazkii.zeta.event.ZRegister;
Expand All @@ -34,7 +34,7 @@
import vazkii.zeta.event.client.ZModelBakingCompleted;

@LoadModule(category = "oddities", antiOverlap = "botania", hasSubscriptions = true, subscribeOn = Dist.CLIENT)
public class TinyPotatoModule extends QuarkModule {
public class TinyPotatoModule extends ZetaModule {

public static BlockEntityType<TinyPotatoBlockEntity> blockEntityType;
public static QuarkGenericTrigger patPotatoTrigger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import vazkii.quark.addons.oddities.entity.TotemOfHoldingEntity;
import vazkii.quark.base.Quark;
import vazkii.quark.base.module.LoadModule;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
Expand All @@ -37,7 +37,7 @@
* Created at 1:21 PM on 3/30/20.
*/
@LoadModule(category = "oddities", hasSubscriptions = true)
public class TotemOfHoldingModule extends QuarkModule {
public class TotemOfHoldingModule extends ZetaModule {
private static final String TAG_LAST_TOTEM = "quark:lastTotemOfHolding";

private static final String TAG_DEATH_X = "quark:deathX";
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/vazkii/quark/base/block/IQuarkBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import net.minecraft.world.level.material.Material;
import net.minecraftforge.common.extensions.IForgeBlock;
import vazkii.quark.base.Quark;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;

import javax.annotation.Nullable;
import java.util.function.BooleanSupplier;
Expand All @@ -24,7 +24,7 @@
public interface IQuarkBlock extends IForgeBlock {

@Nullable
QuarkModule getModule();
ZetaModule getModule();

IQuarkBlock setCondition(BooleanSupplier condition);

Expand All @@ -35,7 +35,7 @@ default Block getBlock() {
}

default boolean isEnabled() {
QuarkModule module = getModule();
ZetaModule module = getModule();
return module != null && module.enabled && !module.disabledByOverlap && doesConditionApply();
}

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/vazkii/quark/base/block/QuarkBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
import vazkii.quark.base.Quark;
import vazkii.quark.base.client.handler.RequiredModTooltipHandler;
import vazkii.quark.base.handler.CreativeTabHandler;
import vazkii.quark.base.module.QuarkModule;
import vazkii.zeta.module.ZetaModule;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.function.BooleanSupplier;

public class QuarkBlock extends Block implements IQuarkBlock {

private final QuarkModule module;
private final ZetaModule module;
private BooleanSupplier enabledSupplier = () -> true;

public QuarkBlock(String regname, QuarkModule module, CreativeModeTab creativeTab, Properties properties) {
public QuarkBlock(String regname, ZetaModule module, CreativeModeTab creativeTab, Properties properties) {
super(properties);

Quark.ZETA.registry.registerBlock(this, regname);
Expand Down Expand Up @@ -52,7 +52,7 @@ public boolean doesConditionApply() {

@Nullable
@Override
public QuarkModule getModule() {
public ZetaModule getModule() {
return module;
}

Expand All @@ -64,7 +64,7 @@ protected static <E extends BlockEntity, A extends BlockEntity> BlockEntityTicke

public interface Constructor<T extends Block> {

T make(String regname, QuarkModule module, CreativeModeTab creativeTab, Properties properties);
T make(String regname, ZetaModule module, CreativeModeTab creativeTab, Properties properties);

}

Expand Down
Loading

0 comments on commit 7213fed

Please sign in to comment.