Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Remove PassthroughTreeGrower and unused imports
  • Loading branch information
BrokenK3yboard committed Oct 2, 2024
1 parent 0134975 commit a68fc31
Show file tree
Hide file tree
Showing 32 changed files with 12 additions and 116 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;

import net.minecraft.advancements.Advancement;
import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package org.violetmoon.zeta.advancement;

import com.mojang.serialization.Codec;
import org.jetbrains.annotations.NotNull;

import com.google.gson.JsonObject;

import net.minecraft.advancements.critereon.ContextAwarePredicate;
import net.minecraft.advancements.critereon.SimpleCriterionTrigger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ private void mutabilize() {
}

public void commit() {
// advancement.criteria = ImmutableMap.copyOf(criteria); Replace entirely?
advancement.criteria().clear();
advancement.criteria().putAll(ImmutableMap.copyOf(criteria));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@

import java.util.Set;

import net.minecraft.core.HolderLookup;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.registries.Registries;
import org.violetmoon.zeta.advancement.AdvancementModifier;
import org.violetmoon.zeta.api.IMutableAdvancement;
import org.violetmoon.zeta.module.ZetaModule;

import com.google.common.collect.ImmutableSet;

import net.minecraft.advancements.Criterion;
import net.minecraft.advancements.critereon.LocationPredicate;
import net.minecraft.advancements.critereon.PlayerTrigger;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.google.common.collect.ImmutableSet;

import net.minecraft.advancements.Criterion;
import net.minecraft.advancements.critereon.EntityPredicate;
import net.minecraft.advancements.critereon.FishingRodHookedTrigger;
import net.minecraft.advancements.critereon.ItemPredicate;
import net.minecraft.core.registries.BuiltInRegistries;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ default SoundType getSoundTypeZeta(BlockState state, LevelReader level, BlockPos
}

default Integer getBeaconColorMultiplierZeta(BlockState state, LevelReader level, BlockPos pos, BlockPos beaconPos) {
if(state.getBlock() instanceof BeaconBeamBlock bbeam)
return bbeam.getColor().getTextureDiffuseColor();
return null;
return state.getBlock() instanceof BeaconBeamBlock bbeam ? bbeam.getColor().getTextureDiffuseColor() : null;
}

default boolean isStickyBlockZeta(BlockState state) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
package org.violetmoon.zeta.capability;

import org.jetbrains.annotations.Nullable;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;

@Deprecated(forRemoval = true)
public interface ZetaCapabilityManager {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.google.common.collect.Streams;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.item.crafting.*;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import org.violetmoon.zeta.event.bus.IZetaPlayEvent;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.violetmoon.zeta.event.play.entity;

import org.violetmoon.zeta.event.bus.IZetaPlayEvent;
import org.violetmoon.zeta.event.bus.Resultable;

import net.minecraft.world.entity.Entity;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.violetmoon.zeta.event.play.entity.living;

import org.violetmoon.zeta.event.bus.IZetaPlayEvent;
import org.violetmoon.zeta.event.bus.Resultable;

import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.MobSpawnType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.violetmoon.zeta.event.play.entity.living;

import net.minecraft.world.entity.ai.behavior.SleepInBed;
import org.violetmoon.zeta.event.bus.IZetaPlayEvent;
import org.violetmoon.zeta.event.bus.Resultable;
import org.violetmoon.zeta.event.bus.helpers.LivingGetter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import net.neoforged.neoforge.common.util.TriState;
import org.violetmoon.zeta.event.bus.Cancellable;
import org.violetmoon.zeta.event.bus.IZetaPlayEvent;
import org.violetmoon.zeta.event.bus.Resultable;
import org.violetmoon.zeta.event.bus.ZResult;
import org.violetmoon.zeta.event.bus.helpers.PlayerGetter;

import net.minecraft.core.BlockPos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package org.violetmoon.zeta.event.play.loading;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.neoforged.neoforge.capabilities.ICapabilityProvider;
import org.violetmoon.zeta.capability.ZetaCapability;
import org.violetmoon.zeta.event.bus.IZetaPlayEvent;

//todo: Capabilities are no more, only reason why this is deprecated vs removed is to double check if we need a replacement
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/violetmoon/zeta/item/ZetaArmorItem.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.violetmoon.zeta.item;

import net.minecraft.core.Holder;
import org.checkerframework.checker.units.qual.A;
import org.violetmoon.zeta.item.ext.IZetaItemExtensions;

import net.minecraft.world.item.ArmorItem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.violetmoon.zeta.item;

import java.util.function.BooleanSupplier;
import java.util.function.Supplier;

import org.jetbrains.annotations.Nullable;
import org.violetmoon.zeta.module.ZetaModule;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/violetmoon/zeta/recipe/FlagIngredient.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

import com.google.gson.JsonObject;

import it.unimi.dsi.fastutil.ints.IntList;
import it.unimi.dsi.fastutil.ints.IntLists;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Ingredient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.Ingredient;

// Copy of Forge IIngredientSerializer
public interface IZetaIngredientSerializer<T extends ICustomIngredient> {
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/violetmoon/zeta/recipe/ZetaDyeRecipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

import com.google.common.collect.Lists;

import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.inventory.CraftingContainer;
import net.minecraft.world.item.DyeItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package org.violetmoon.zeta.registry;

import java.util.Map;
import java.util.function.Supplier;

import net.minecraft.core.Holder;
import net.minecraft.world.item.Item;
import org.jetbrains.annotations.Nullable;
import org.violetmoon.zeta.Zeta;
import org.violetmoon.zeta.recipe.FlagIngredient;

import com.google.common.collect.Maps;

Expand All @@ -19,7 +17,6 @@
import net.minecraft.world.item.Items;
import net.minecraft.world.item.alchemy.Potion;
import net.minecraft.world.item.alchemy.Potions;
import net.minecraft.world.item.crafting.Ingredient;

/**
* @author WireSegal
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/violetmoon/zeta/util/MiscUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
import net.minecraft.world.Container;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.WorldlyContainer;
import net.minecraft.world.WorldlyContainerHolder;
import net.minecraft.world.entity.EntityType;
Expand All @@ -39,7 +38,6 @@
import net.minecraft.world.phys.Vec3;
import net.neoforged.neoforge.items.IItemHandler;
import net.neoforged.neoforge.items.ItemHandlerHelper;
import net.neoforged.neoforge.items.ItemStackHandler;
import net.neoforged.neoforge.items.wrapper.InvWrapper;
import net.neoforged.neoforge.items.wrapper.SidedInvWrapper;
import org.jetbrains.annotations.NotNull;
Expand Down
46 changes: 0 additions & 46 deletions src/main/java/org/violetmoon/zeta/world/PassthroughTreeGrower.java

This file was deleted.

8 changes: 6 additions & 2 deletions src/main/java/org/violetmoon/zetaimplforge/ForgeZeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@
* ideally do not touch quark from this package, it will later be split off
*/
public class ForgeZeta extends Zeta {
public ForgeZeta(String modid, Logger log) {

public final IEventBus bus; // Temporary; move ForgeZetaRegistry#onRegisterEvent() into start?

public ForgeZeta(String modid, Logger log, IEventBus bus) {
super(modid, log, ZetaSide.fromClient(FMLEnvironment.dist.isClient()));
this.bus = bus;
}

@Override
Expand Down Expand Up @@ -103,7 +107,7 @@ public IZetaConfigInternals makeConfigInternals(SectionDefinition rootSection) {

@Override
public ZetaRegistry createRegistry() {
return new ForgeZetaRegistry(this);
return new ForgeZetaRegistry(this, bus);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import net.minecraft.client.multiplayer.ClientPacketListener;
import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.Block;
Expand All @@ -19,7 +18,6 @@
import net.neoforged.neoforge.client.event.*;
import net.neoforged.neoforge.client.gui.VanillaGuiLayers;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.registries.NeoForgeRegistries;
import net.neoforged.neoforge.server.ServerLifecycleHooks;
import org.jetbrains.annotations.Nullable;
import org.violetmoon.zeta.Zeta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import net.minecraft.world.entity.Entity;
import net.neoforged.neoforge.event.entity.EntityMobGriefingEvent;
import org.violetmoon.zeta.event.bus.ZResult;
import org.violetmoon.zeta.event.play.entity.ZEntityMobGriefing;
import org.violetmoon.zetaimplforge.ForgeZeta;

public class ForgeZEntityMobGriefing implements ZEntityMobGriefing {
private final EntityMobGriefingEvent e;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package org.violetmoon.zetaimplforge.event.play.entity.living;

import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.level.BaseSpawner;
import net.minecraft.world.level.ServerLevelAccessor;
import net.neoforged.neoforge.event.entity.living.MobSpawnEvent;
import org.violetmoon.zeta.event.bus.ZResult;
import org.violetmoon.zeta.event.play.entity.living.ZMobSpawnEvent;
import org.violetmoon.zetaimplforge.ForgeZeta;

public class ForgeZMobSpawnEvent implements ZMobSpawnEvent {
private final MobSpawnEvent e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
import net.minecraft.world.phys.BlockHitResult;
import net.neoforged.neoforge.common.util.TriState;
import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent;
import org.violetmoon.zeta.event.bus.ZResult;
import org.violetmoon.zeta.event.play.entity.player.ZRightClickBlock;
import org.violetmoon.zetaimplforge.ForgeZeta;

public class ForgeZRightClickBlock implements ZRightClickBlock {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.block.BlockColors;
import net.minecraft.core.Holder.Reference;
import net.minecraft.world.level.block.Block;

@Mixin(BlockColors.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import net.minecraft.client.color.item.ItemColor;
import net.minecraft.client.color.item.ItemColors;
import net.minecraft.core.Holder.Reference;
import net.minecraft.world.item.Item;

@Mixin(ItemColors.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import org.violetmoon.zeta.block.*;
import org.violetmoon.zeta.block.ext.IZetaBlockExtensions;

import java.util.Locale;

// Forge can't actually mixin to interfaces, so we fake it by just... mixing in to everyone inheriting the interface.
@Mixin({
ZetaBlock.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public class ZetaForgeMod {

public ZetaForgeMod(IEventBus bus) {
ForgeZeta zeta = new ForgeZeta(Zeta.ZETA_ID, LogManager.getLogger(Zeta.ZETA_ID + "-internal"));
ForgeZeta zeta = new ForgeZeta(Zeta.ZETA_ID, LogManager.getLogger(Zeta.ZETA_ID + "-internal"), bus);

ZetaModProxy proxy = Env.unsafeRunForDist(() -> ZetaClientProxy::new, () -> ZetaModProxy::new);
Object zetaClient = Env.unsafeRunForDist(() -> () -> new ForgeZetaClient(zeta), () -> Object::new);
Expand All @@ -37,5 +37,4 @@ public ZetaForgeMod(IEventBus bus) {
public void setup(FMLCommonSetupEvent event) {
event.enqueueWork(ConfigEventDispatcher::dispatchAllInitialLoads);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
import net.minecraft.world.item.Item;
import net.minecraft.world.item.alchemy.Potion;
import net.minecraft.world.item.alchemy.PotionBrewing;
import net.minecraft.world.item.crafting.Ingredient;
import org.violetmoon.zeta.event.bus.LoadEvent;
import org.violetmoon.zeta.event.load.ZCommonSetup;
import org.violetmoon.zeta.registry.BrewingRegistry;
import org.violetmoon.zetaimplforge.ForgeZeta;
import org.violetmoon.zetaimplforge.mixin.mixins.AccessorPotionBrewing;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;

public class ForgeBrewingRegistry extends BrewingRegistry {
public ForgeBrewingRegistry(ForgeZeta zeta) {
Expand Down
Loading

0 comments on commit a68fc31

Please sign in to comment.