Skip to content

Commit

Permalink
prep work to update to arch loom 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Sep 15, 2023
1 parent 5d86571 commit 3fb6d01
Show file tree
Hide file tree
Showing 319 changed files with 534 additions and 1,263 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ subprojects{

shadowJar {
configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
archiveClassifier.set "dev-shadow"
}

remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
classifier null
archiveClassifier.set null
}

jar {
classifier "dev"
archiveClassifier.set "dev"
}

components.java {
Expand Down
1 change: 0 additions & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ dependencies{
modImplementation("com.gtnewhorizon.structurelib:structurelib-common:${project.structurelib_version}-${project.minecraft_version}")
modImplementation("net.minecraftforge:forgeconfigapiport-fabric:3.2.4")
modCompileOnly("curse.maven:the-one-probe-fabric-581847:${project.top_fabric_file}")
modCompileOnly "lol.bai.megane:megane-reborn-energy:${project.megane_version}"
modImplementation("earth.terrarium:botarium-common-1.18.2:${project.botarium_version}")
modImplementation "com.teamresourceful.resourcefullib:resourcefullib-common-1.18.2:${project.resourcefullib_version}"

Expand Down
1 change: 0 additions & 1 deletion common/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mod_version=0.2-rc46
ct_fabric_fluid_support_hash=1.0.1
top_fabric_file=3877300
megane_version=7.7.2
12 changes: 6 additions & 6 deletions common/src/main/java/muramasa/antimatter/AntimatterAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
import net.minecraft.world.level.block.state.BlockState;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.util.TriConsumer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Supplier;
Expand Down Expand Up @@ -172,13 +172,13 @@ public static <T extends ISharedAntimatterObject> T get(Class<? extends T> c, St
return getInternal(c, id);
}

@Nonnull
@NotNull
public static <T> T getOrDefault(Class<T> c, String id, String domain, NonNullSupplier<? extends T> supplier) {
Object obj = get(c, id, domain);
return obj != null ? c.cast(obj) : supplier.get();
}

@Nonnull
@NotNull
public static <T> T getOrThrow(Class<T> c, String id, String domain,
Supplier<? extends RuntimeException> supplier) {
Object obj = get(c, id, domain);
Expand All @@ -188,7 +188,7 @@ public static <T> T getOrThrow(Class<T> c, String id, String domain,
throw supplier.get();
}

@Nonnull
@NotNull
public static <T extends ISharedAntimatterObject> T getOrThrow(Class<T> c, String id,
Supplier<? extends RuntimeException> supplier) {
Object obj = get(c, id);
Expand Down Expand Up @@ -274,7 +274,7 @@ private static <T> Stream<T> allInternal(Class<T> c) {
: new Object2ObjectArrayMap<>(map).values().stream().flatMap(t -> t.map(Stream::of, right -> right.values().stream())).map(c::cast);
}

private static <T> Stream<T> allInternal(Class<T> c, @Nonnull String domain) {
private static <T> Stream<T> allInternal(Class<T> c, @NotNull String domain) {
return allInternal(c)
.filter(o -> o instanceof IAntimatterObject && ((IAntimatterObject) o).getDomain().equals(domain)
|| isRegistryEntry(o, domain));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import muramasa.antimatter.texture.Texture;
import muramasa.antimatter.tile.TileEntityMachine.DynamicKey;
import net.minecraft.core.Direction;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nullable;
import java.util.function.Function;

public class AntimatterProperties {
Expand Down
16 changes: 4 additions & 12 deletions common/src/main/java/muramasa/antimatter/Data.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
package muramasa.antimatter;

import muramasa.antimatter.capability.IGuiHandler;
import muramasa.antimatter.cover.CoverDebug;
import muramasa.antimatter.cover.CoverDynamo;
import muramasa.antimatter.cover.CoverEnergy;
import muramasa.antimatter.cover.CoverFactory;
import muramasa.antimatter.cover.CoverHeat;
import muramasa.antimatter.cover.CoverInput;
import muramasa.antimatter.cover.CoverMuffler;
import muramasa.antimatter.cover.CoverOutput;
import muramasa.antimatter.cover.ICover;
import muramasa.antimatter.cover.*;
import muramasa.antimatter.data.AntimatterMaterialTypes;
import muramasa.antimatter.gui.ButtonOverlay;
import muramasa.antimatter.gui.MenuHandlerCover;
Expand Down Expand Up @@ -38,15 +30,15 @@
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.material.PushReaction;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nullable;

;
import static muramasa.antimatter.gui.ButtonOverlay.APAD_RIGHT;
import static muramasa.antimatter.machine.MachineFlag.ENERGY;
import static muramasa.antimatter.machine.MachineFlag.GUI;
import static muramasa.antimatter.machine.Tier.MAX;

;

public class Data {

public static final Material WRENCH_MATERIAL = new Material(MaterialColor.METAL, false, true, true, true, false, false, PushReaction.NORMAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
import muramasa.antimatter.data.AntimatterMaterials;
import muramasa.antimatter.event.MaterialEvent;
import muramasa.antimatter.material.MaterialTags;
import net.minecraft.data.loot.BlockLoot;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.item.enchantment.Enchantments;

import static com.google.common.collect.ImmutableMap.of;
import static muramasa.antimatter.material.MaterialTags.MOLTEN;
import static muramasa.antimatter.material.MaterialTags.QUARTZ_LIKE_BLOCKS;
import static net.minecraft.world.item.Tiers.GOLD;
import static net.minecraft.world.item.Tiers.IRON;
import static net.minecraft.world.item.Tiers.NETHERITE;
import static net.minecraft.world.item.Tiers.*;

public class MaterialDataInit {
public static void onMaterialEvent(MaterialEvent event){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package muramasa.antimatter.behaviour;

import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.context.UseOnContext;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;

import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;

public class AntimatterItemBlock extends BlockItem {

public AntimatterItemBlock(Block block) {
super(block, new Properties().tab(block instanceof IItemBlockProvider ? ((IItemBlockProvider) block).getItemGroup() : Ref.TAB_BLOCKS));
}

@Nonnull
@NotNull
@Override
public Component getName(@Nonnull ItemStack stack) {
public Component getName(@NotNull ItemStack stack) {
return getBlock() instanceof IItemBlockProvider ? ((IItemBlockProvider) getBlock()).getDisplayName(stack) : new TranslatableComponent(stack.getDescriptionId());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;

import javax.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

public class BlockMaterialType extends BlockBasic implements IColorHandler {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package muramasa.antimatter.block;

import muramasa.antimatter.datagen.providers.AntimatterBlockStateProvider;
import muramasa.antimatter.ore.CobbleStoneType;
import muramasa.antimatter.ore.StoneType;
import muramasa.antimatter.registration.ISharedAntimatterObject;
import muramasa.antimatter.texture.Texture;
import net.minecraft.world.level.block.Block;

public class BlockStone extends BlockBasic implements ISharedAntimatterObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import muramasa.antimatter.data.AntimatterStoneTypes;
import muramasa.antimatter.datagen.builder.AntimatterBlockModelBuilder;
import muramasa.antimatter.datagen.builder.VariantBlockStateBuilder.VariantBuilder;
import net.minecraft.resources.ResourceLocation;
import muramasa.antimatter.datagen.providers.AntimatterBlockStateProvider;
import muramasa.antimatter.ore.CobbleStoneType;
import muramasa.antimatter.ore.StoneType;
import muramasa.antimatter.registration.IModelProvider;
import muramasa.antimatter.registration.ISharedAntimatterObject;
import muramasa.antimatter.registration.ITextureProvider;
import muramasa.antimatter.texture.Texture;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SlabBlock;
import net.minecraft.world.level.block.state.properties.SlabType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
import net.minecraft.world.level.block.state.properties.Half;
import net.minecraft.world.level.block.state.properties.StairsShape;

import static net.minecraft.core.Direction.EAST;
import static net.minecraft.core.Direction.NORTH;
import static net.minecraft.core.Direction.SOUTH;
import static net.minecraft.core.Direction.WEST;
import static net.minecraft.core.Direction.*;
import static net.minecraft.world.level.block.state.properties.StairsShape.STRAIGHT;

public class BlockStoneStair extends StairBlock implements ISharedAntimatterObject, ITextureProvider, IModelProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader;
Expand All @@ -26,9 +24,7 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;

import javax.annotation.Nullable;
import java.util.Map;
import org.jetbrains.annotations.Nullable;

public class BlockStorage extends BlockMaterialType implements IItemBlockProvider, ISharedAntimatterObject {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package muramasa.antimatter.block;

import com.google.common.collect.ImmutableMap;
import muramasa.antimatter.Data;
import muramasa.antimatter.Ref;
import muramasa.antimatter.data.AntimatterMaterialTypes;
import muramasa.antimatter.datagen.builder.AntimatterBlockModelBuilder;
Expand All @@ -18,7 +17,6 @@
import muramasa.antimatter.util.Utils;
import net.minecraft.core.BlockPos;
import net.minecraft.core.NonNullList;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.Containers;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import muramasa.antimatter.tile.multi.TileEntityMultiMachine;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Optional;
import java.util.Set;
Expand All @@ -33,13 +32,13 @@ public ComponentHandler(String componentId, T componentTile) {
this(componentId, componentId, componentTile);
}

@Nonnull
@NotNull
@Override
public String getId() {
return componentId;
}

@Nonnull
@NotNull
@Override
public T getTile() {
return componentTile;
Expand All @@ -50,31 +49,31 @@ public T getTile() {
return idForHandlers;
}

@Nonnull
@NotNull
@Override
public Optional<MachineItemHandler<?>> getItemHandler() {
return componentTile instanceof TileEntityMachine<?> machine ? machine.itemHandler.map(h -> h) : Optional.empty();
}

@Nonnull
@NotNull
@Override
public Optional<MachineFluidHandler<?>> getFluidHandler() {
return componentTile instanceof TileEntityMachine<?> machine ? machine.fluidHandler.map(f -> f) : Optional.empty();
}

@Nonnull
@NotNull
@Override
public Optional<MachineEnergyHandler<?>> getEnergyHandler() {
return componentTile instanceof TileEntityMachine<?> machine ? machine.energyHandler.map(e -> e) : Optional.empty();
}

@Override
public void onStructureFormed(@Nonnull TileEntityMultiMachine<?> controllerTile) {
public void onStructureFormed(@NotNull TileEntityMultiMachine<?> controllerTile) {
this.controllers.add(controllerTile);
}

@Override
public void onStructureInvalidated(@Nonnull TileEntityMultiMachine<?> controllerTile) {
public void onStructureInvalidated(@NotNull TileEntityMultiMachine<?> controllerTile) {
this.controllers.remove(controllerTile);
}

Expand All @@ -83,7 +82,7 @@ public boolean hasLinkedController() {
return StructureCache.has(getTile().getLevel(), getTile().getBlockPos());
}

@Nonnull
@NotNull
@Override
public Collection<TileEntityMultiMachine<?>> getControllers() {
return controllers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.*;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -53,7 +53,7 @@ public DynamicTexturer<ICover, ICover.DynamicKey> getTexturer(Direction dir) {
}

@Override
public boolean set(Direction side, @Nonnull ICover newCover, boolean sync) {
public boolean set(Direction side, @NotNull ICover newCover, boolean sync) {
if (!validCovers.contains(newCover.getLoc())) return false;
ICover old = covers.getOrDefault(side, ICover.empty);
return set(side, old, newCover, sync);
Expand Down Expand Up @@ -195,7 +195,7 @@ public boolean hasCover(Class<? extends ICover> clazz) {
}

@Override
public boolean isValid(@Nonnull Direction side, @Nonnull ICover replacement) {
public boolean isValid(@NotNull Direction side, @NotNull ICover replacement) {
return (get(side).isEmpty() || replacement.isEqual(ICover.empty)) && validCovers.contains(replacement.getId());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import tesseract.api.gt.GTConsumer;
import tesseract.api.gt.GTTransaction;
import tesseract.api.gt.IEnergyHandler;
import tesseract.api.gt.IGTNode;


public class EnergyHandler implements IEnergyHandler {
Expand Down
Loading

0 comments on commit 3fb6d01

Please sign in to comment.