Skip to content

Commit

Permalink
misc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Sep 3, 2024
1 parent 872a6b7 commit 3c13ffd
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static void addOptionalTag(ResourceLocation id, TagKey<Block>... tags) {
OPTIONAL_TAGS.computeIfAbsent(tag, (e) -> new ArrayList<>()).add(id);
}
}

public static void generateBlockTags(RegistrateTagsProvider<Block> tags) {
addTagToAllInRegistry(tags, BuiltInRegistries.BLOCK, NumismaticsTags.AllBlockTags.NUMISMATICS_BLOCKS.tag);

Expand All @@ -58,7 +59,7 @@ public static void generateBlockTags(RegistrateTagsProvider<Block> tags) {
});

for (TagKey<Block> tag : OPTIONAL_TAGS.keySet()) {
var appender = tagAppender(tags, tag);
TagsProvider.TagAppender<Block> appender = tagAppender(tags, tag);
for (ResourceLocation loc : OPTIONAL_TAGS.get(tag))
appender.addOptional(loc);
}
Expand Down Expand Up @@ -92,10 +93,9 @@ public static TagsProvider.TagAppender<Item> tagAppender(RegistrateItemTagsProvi
public static TagsProvider.TagAppender<Block> tagAppender(RegistrateTagsProvider<Block> prov, AllBlockTags tag) {
return tagAppender(prov, tag.tag);
}

@ExpectPlatform

public static <T> TagsProvider.TagAppender<T> tagAppender(RegistrateTagsProvider<T> prov, TagKey<T> tag) {
throw new AssertionError();
return prov.addTag(tag);
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public final boolean setFilter(MultiloaderFluidStack filter, Level salepointLeve
if (!filter.isEmpty() && salepointLevel.getBlockEntity(salepointPos) instanceof SalepointBlockEntity salepointBE) {
BlockPos targetedPos = salepointBE.getTargetedPos();
if (targetedPos != null) {
var behaviour = getBehaviour(salepointLevel, targetedPos);
SalepointTargetBehaviour<MultiloaderFluidStack> behaviour = getBehaviour(salepointLevel, targetedPos);
if (behaviour instanceof IFilteringSalepointBehaviour filteringSalepointBehaviour) {
if (!filteringSalepointBehaviour.canSetFilter(filter)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import org.slf4j.spi.LoggingEventBuilder;
import org.spongepowered.asm.service.MixinService;
import org.spongepowered.asm.util.Annotations;

Expand All @@ -43,7 +44,7 @@ public class ConditionalMixinHandler {
public static final Logger LOGGER = LoggerFactory.getLogger("Numismatics/MixinPlugin");

public static boolean shouldApply(String className) {
var logger = LOGGER.atLevel(Utils.isDevEnv() ? Level.INFO : Level.DEBUG);
LoggingEventBuilder logger = LOGGER.atLevel(Utils.isDevEnv() ? Level.INFO : Level.DEBUG);
try {
List<AnnotationNode> annotationNodes = MixinService.getService().getBytecodeProvider().getClassNode(className).visibleAnnotations;
if (annotationNodes == null) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package dev.ithundxr.createnumismatics.registry;

import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.tree.CommandNode;
import com.mojang.brigadier.tree.LiteralCommandNode;
import com.simibubi.create.infrastructure.command.AllCommands;
Expand All @@ -32,16 +33,13 @@

public class NumismaticsCommands {
public static void register(CommandDispatcher<CommandSourceStack> dispatcher, boolean dedicated) {
var numismaticsCommand = literal("numismatics")
LiteralArgumentBuilder<CommandSourceStack> numismaticsCommand = literal("numismatics")
.requires(cs -> cs.hasPermission(0))
.then(PayCommand.register())
.then(DeductCommand.register())
.then(ViewCommand.register())
.then(PayAllCommand.register())
.then(ToggleAdminModeCommand.register())
//.then(ClearCasingCacheCommand.register())
//.then(SplitTrainCommand.register())
//.then(TrainInfoCommand.register());
;

if (Utils.isDevEnv()) {
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 3c13ffd

Please sign in to comment.