Skip to content

Commit

Permalink
Ported Building modules to zeta
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Nov 5, 2023
1 parent 351f057 commit f92b968
Show file tree
Hide file tree
Showing 35 changed files with 270 additions and 198 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import vazkii.quark.base.block.QuarkBlock;
import vazkii.quark.base.handler.WoodSetHandler;
import vazkii.quark.base.handler.WoodSetHandler.WoodSet;
import vazkii.quark.base.module.LoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.module.ZetaLoadModule;
import vazkii.zeta.module.ZetaModule;

@LoadModule(category = "building")
@ZetaLoadModule(category = "building")
public class BambooBackportModule extends ZetaModule {

public static WoodSet woodSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import vazkii.quark.base.block.QuarkBlock;
import vazkii.quark.base.module.LoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.zeta.event.ZItemTooltip;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.event.bus.PlayEvent;
import vazkii.zeta.module.ZetaLoadModule;
import vazkii.zeta.module.ZetaModule;

@LoadModule(category = "building", hasSubscriptions = true, subscribeOn = Dist.CLIENT)
@ZetaLoadModule(category = "building")
public class CelebratoryLampsModule extends ZetaModule {

@Config
Expand All @@ -31,15 +29,17 @@ public final void register(ZRegister event) {
stone_lamp = new QuarkBlock("stone_lamp", this, CreativeModeTab.TAB_BUILDING_BLOCKS, Block.Properties.copy(Blocks.STONE).lightLevel(s -> lightLevel));
stone_brick_lamp = new QuarkBlock("stone_brick_lamp", this, CreativeModeTab.TAB_BUILDING_BLOCKS, Block.Properties.copy(Blocks.STONE_BRICKS).lightLevel(s -> lightLevel));
}

@SubscribeEvent
@OnlyIn(Dist.CLIENT)
public void onTooltip(ItemTooltipEvent event) {
if(event.getFlags().isAdvanced()) {
ItemStack stack = event.getItemStack();
Item item = stack.getItem();
if(item == stone_lamp.asItem() || item == stone_brick_lamp.asItem())
event.getToolTip().add(1, Component.translatable("quark.misc.celebration").withStyle(ChatFormatting.GRAY));

@ZetaLoadModule(clientReplacement = true)
public static class Client extends CelebratoryLampsModule {
@PlayEvent
public void onTooltip(ZItemTooltip event) {
if(event.getFlags().isAdvanced()) {
ItemStack stack = event.getItemStack();
Item item = stack.getItem();
if(item == stone_lamp.asItem() || item == stone_brick_lamp.asItem())
event.getToolTip().add(1, Component.translatable("quark.misc.celebration").withStyle(ChatFormatting.GRAY));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package vazkii.quark.content.building.module;

import java.util.List;
import java.util.function.BooleanSupplier;

import com.google.common.collect.Lists;

import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.level.block.Block;
Expand All @@ -18,15 +14,18 @@
import vazkii.quark.base.block.QuarkFlammablePillarBlock;
import vazkii.quark.base.handler.FuelHandler;
import vazkii.quark.base.handler.ToolInteractionHandler;
import vazkii.quark.base.module.LoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.zeta.util.Hint;
import vazkii.zeta.event.ZLoadComplete;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.module.ZetaLoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.zeta.util.Hint;

import java.util.List;
import java.util.function.BooleanSupplier;

@LoadModule(category = "building")
@ZetaLoadModule(category = "building")
public class CompressedBlocksModule extends ZetaModule {

@Config(name = "Charcoal Block and Blaze Lantern Stay On Fire Forever", flag = "compressed_blocks_burn_forever")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import net.minecraft.world.level.block.Blocks;
import vazkii.quark.base.block.QuarkBlock;
import vazkii.quark.base.handler.VariantHandler;
import vazkii.quark.base.module.LoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.module.ZetaLoadModule;
import vazkii.zeta.module.ZetaModule;

@LoadModule(category = "building")
@ZetaLoadModule(category = "building")
public class DuskboundBlocksModule extends ZetaModule {

@LoadEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
import net.minecraft.world.level.material.Material;
import vazkii.quark.base.block.QuarkGlassBlock;
import vazkii.quark.base.block.QuarkInheritedPaneBlock;
import vazkii.quark.base.module.LoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.module.ZetaLoadModule;
import vazkii.zeta.module.ZetaModule;

@LoadModule(category = "building")
@ZetaLoadModule(category = "building")
public class FramedGlassModule extends ZetaModule {

@LoadEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,24 @@
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.item.Item;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import vazkii.quark.base.Quark;
import vazkii.quark.base.module.LoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.zeta.util.Hint;
import vazkii.quark.content.building.client.render.entity.GlassItemFrameRenderer;
import vazkii.quark.content.building.entity.GlassItemFrame;
import vazkii.quark.content.building.item.QuarkItemFrameItem;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.client.event.ZAddModels;
import vazkii.zeta.client.event.ZClientSetup;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.module.ZetaLoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.zeta.util.Hint;

/**
* @author WireSegal
* Created at 11:00 AM on 8/25/19.
*/
@LoadModule(category = "building")
@ZetaLoadModule(category = "building")
public class GlassItemFrameModule extends ZetaModule {

@Config public static boolean glassItemFramesUpdateMaps = true;
Expand Down Expand Up @@ -65,9 +63,12 @@ public final void clientSetup(ZClientSetup event) {
EntityRenderers.register(glassFrameEntity, GlassItemFrameRenderer::new);
}

@LoadEvent
@OnlyIn(Dist.CLIENT)
public void registerAdditionalModels(ZAddModels event) {
event.register(new ModelResourceLocation(Quark.MOD_ID, "extra/glass_item_frame", "inventory"));
@ZetaLoadModule(clientReplacement = true)
public static class Client extends GlassItemFrameModule {
@LoadEvent
public void registerAdditionalModels(ZAddModels event) {
event.register(new ModelResourceLocation(Quark.MOD_ID, "extra/glass_item_frame", "inventory"));
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
import vazkii.quark.base.block.QuarkPaneBlock;
import vazkii.quark.base.handler.StructureBlockReplacementHandler;
import vazkii.quark.base.handler.StructureBlockReplacementHandler.StructureHolder;
import vazkii.quark.base.module.LoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.zeta.event.ZConfigChanged;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.module.ZetaLoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.zeta.registry.RenderLayerRegistry;

@LoadModule(category = "building")
@ZetaLoadModule(category = "building")
public class GoldBarsModule extends ZetaModule {

@Config public static boolean generateInNetherFortress = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package vazkii.quark.content.building.module;

import net.minecraft.world.level.block.Block;
import vazkii.quark.base.module.LoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.zeta.util.Hint;
import vazkii.quark.content.building.block.GrateBlock;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.module.ZetaLoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.zeta.util.Hint;

/**
* @author WireSegal
* Created at 8:57 AM on 8/27/19.
*/
@LoadModule(category = "building")
@ZetaLoadModule(category = "building")
public class GrateModule extends ZetaModule {

@Hint public static Block grate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,22 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.event.TickEvent.Phase;
import net.minecraftforge.event.TickEvent.PlayerTickEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import vazkii.quark.api.ICrawlSpaceBlock;
import vazkii.quark.base.Quark;
import vazkii.quark.base.handler.advancement.QuarkAdvancementHandler;
import vazkii.quark.base.handler.advancement.QuarkGenericTrigger;
import vazkii.quark.base.module.LoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.zeta.util.Hint;
import vazkii.quark.base.util.VanillaWoods;
import vazkii.quark.base.util.VanillaWoods.Wood;
import vazkii.quark.content.building.block.HollowLogBlock;
import vazkii.zeta.event.ZCommonSetup;
import vazkii.zeta.event.ZPlayerTick;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.event.bus.PlayEvent;
import vazkii.zeta.module.ZetaModule;
import vazkii.zeta.util.Hint;

@LoadModule(category = "building", hasSubscriptions = true)
public class HollowLogsModule extends ZetaModule {
Expand Down Expand Up @@ -57,10 +56,10 @@ public final void setup(ZCommonSetup event) {
hollowLogsTag = BlockTags.create(new ResourceLocation(Quark.MOD_ID, "hollow_logs"));
}

@SubscribeEvent
public void playerTick(PlayerTickEvent event) {
if(enableAutoCrawl && event.phase == Phase.START) {
Player player = event.player;
@PlayEvent
public void playerTick(ZPlayerTick.Start event) {
if(enableAutoCrawl) {
Player player = event.getPlayer();
BlockPos playerPos = player.blockPosition();
boolean isTrying = player.isVisuallyCrawling() ||
(player.isCrouching() && !player.isColliding(playerPos, player.level.getBlockState(playerPos)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
import vazkii.quark.base.block.QuarkBlock;
import vazkii.quark.base.block.QuarkPillarBlock;
import vazkii.quark.base.handler.VariantHandler;
import vazkii.quark.base.module.LoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.quark.content.building.block.VariantLadderBlock;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.module.ZetaLoadModule;
import vazkii.zeta.module.ZetaModule;

import java.util.function.BooleanSupplier;

@LoadModule(category = "building")
@ZetaLoadModule(category = "building")
public class IndustrialPaletteModule extends ZetaModule {

private static final SoundType IRON_LADDER_SOUND_TYPE = new ForgeSoundType(1.0F, 1.0F,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
*/
package vazkii.quark.content.building.module;

import java.util.function.BooleanSupplier;

import vazkii.quark.base.block.IQuarkBlock;
import vazkii.quark.base.module.LoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.quark.content.building.block.BambooMatBlock;
import vazkii.quark.content.building.block.BambooMatCarpetBlock;
import vazkii.quark.content.building.block.PaperLanternBlock;
import vazkii.quark.content.building.block.PaperWallBlock;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.module.ZetaLoadModule;
import vazkii.zeta.module.ZetaModule;

import java.util.function.BooleanSupplier;

@LoadModule(category = "building")
@ZetaLoadModule(category = "building")
public class JapanesePaletteModule extends ZetaModule {

@Config(flag = "paper_decor")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import vazkii.quark.base.block.QuarkPillarBlock;
import vazkii.quark.base.handler.VariantHandler;
import vazkii.quark.base.item.QuarkItem;
import vazkii.quark.base.module.LoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.zeta.event.ZLoadComplete;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.module.ZetaLoadModule;
import vazkii.zeta.module.ZetaModule;

@LoadModule(category = "building")
@ZetaLoadModule(category = "building")
public class MidoriModule extends ZetaModule {

private static Item moss_paste;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package vazkii.quark.content.building.module;

import java.util.function.BooleanSupplier;

import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import vazkii.quark.base.block.QuarkBlock;
import vazkii.quark.base.handler.VariantHandler;
import vazkii.quark.base.module.LoadModule;
import vazkii.quark.base.module.ModuleLoader;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.base.module.config.Config;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.module.ZetaLoadModule;
import vazkii.zeta.module.ZetaModule;

import java.util.function.BooleanSupplier;

@LoadModule(category = "building")
@ZetaLoadModule(category = "building")
public class MoreBrickTypesModule extends ZetaModule {

@Config(flag = "blue_nether_bricks", description = "This also comes with a utility recipe for Red Nether Bricks")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
import vazkii.quark.base.block.QuarkBlock;
import vazkii.quark.base.block.QuarkPillarBlock;
import vazkii.quark.base.module.LoadModule;
import vazkii.zeta.module.ZetaModule;
import vazkii.quark.content.building.block.MudBrickLatticeBlock;
import vazkii.zeta.event.ZRegister;
import vazkii.zeta.event.bus.LoadEvent;
import vazkii.zeta.module.ZetaLoadModule;
import vazkii.zeta.module.ZetaModule;

@LoadModule(category = "building")
@ZetaLoadModule(category = "building")
public class MoreMudBlocksModule extends ZetaModule {

@LoadEvent
Expand Down
Loading

0 comments on commit f92b968

Please sign in to comment.