Skip to content

Commit

Permalink
fix: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulvdberge committed Aug 24, 2023
1 parent 3bf8670 commit e2e7ca7
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategyFactory;
import com.refinedmods.refinedstorage2.platform.api.grid.GridSynchronizer;
import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter;
import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerHelper;
import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerItemHelper;
import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.ExporterTransferStrategyFactory;
import com.refinedmods.refinedstorage2.platform.api.network.node.externalstorage.PlatformExternalStorageProviderFactory;
import com.refinedmods.refinedstorage2.platform.api.network.node.importer.ImporterTransferStrategyFactory;
Expand Down Expand Up @@ -48,7 +48,7 @@ public interface PlatformApi {

StorageRepository getStorageRepository(Level level);

StorageContainerHelper getStorageContainerHelper();
StorageContainerItemHelper getStorageContainerItemHelper();

PlatformRegistry<PlatformStorageChannelType<?>> getStorageChannelTypeRegistry();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategyFactory;
import com.refinedmods.refinedstorage2.platform.api.grid.GridSynchronizer;
import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter;
import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerHelper;
import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerItemHelper;
import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.ExporterTransferStrategyFactory;
import com.refinedmods.refinedstorage2.platform.api.network.node.externalstorage.PlatformExternalStorageProviderFactory;
import com.refinedmods.refinedstorage2.platform.api.network.node.importer.ImporterTransferStrategyFactory;
Expand Down Expand Up @@ -62,8 +62,8 @@ public StorageRepository getStorageRepository(final Level level) {
}

@Override
public StorageContainerHelper getStorageContainerHelper() {
return ensureLoaded().getStorageContainerHelper();
public StorageContainerItemHelper getStorageContainerItemHelper() {
return ensureLoaded().getStorageContainerItemHelper();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
// TODO: Tags/ore dict in recipes
@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0")
public abstract class AbstractStorageContainerItem<T> extends Item implements StorageContainerItem {
protected final StorageContainerHelper helper;
protected final StorageContainerItemHelper helper;
private final StorageChannelType<T> type;

protected AbstractStorageContainerItem(final Properties properties,
final StorageChannelType<T> type,
final StorageContainerHelper helper) {
final StorageContainerItemHelper helper) {
super(properties);
this.type = type;
this.helper = helper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.apiguardian.api.API;

@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.5")
public interface StorageContainerHelper {
public interface StorageContainerItemHelper {
Optional<Storage<?>> resolve(StorageRepository storageRepository, ItemStack stack);

void set(StorageRepository storageRepository, ItemStack stack, Storage<?> storage);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.refinedmods.refinedstorage2.platform.api.item.block;

import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerHelper;
import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerItemHelper;
import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository;

import java.util.List;
Expand All @@ -24,12 +24,12 @@

@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.4")
public abstract class AbstractStorageContainerBlockItem extends BlockItem {
protected final StorageContainerHelper helper;
protected final StorageContainerItemHelper helper;

protected AbstractStorageContainerBlockItem(
final Block block,
final Properties properties,
final StorageContainerHelper helper
final StorageContainerItemHelper helper
) {
super(block, properties);
this.helper = helper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategyFactory;
import com.refinedmods.refinedstorage2.platform.api.grid.GridSynchronizer;
import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter;
import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerHelper;
import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerItemHelper;
import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.ExporterTransferStrategyFactory;
import com.refinedmods.refinedstorage2.platform.api.network.node.externalstorage.PlatformExternalStorageProviderFactory;
import com.refinedmods.refinedstorage2.platform.api.network.node.importer.ImporterTransferStrategyFactory;
Expand All @@ -39,7 +39,7 @@
import com.refinedmods.refinedstorage2.platform.common.internal.grid.CompositeGridInsertionStrategy;
import com.refinedmods.refinedstorage2.platform.common.internal.grid.CompositeGridScrollingStrategy;
import com.refinedmods.refinedstorage2.platform.common.internal.grid.NoOpGridSynchronizer;
import com.refinedmods.refinedstorage2.platform.common.internal.item.StorageContainerHelperImpl;
import com.refinedmods.refinedstorage2.platform.common.internal.item.StorageContainerItemHelperImpl;
import com.refinedmods.refinedstorage2.platform.common.internal.network.LevelConnectionProvider;
import com.refinedmods.refinedstorage2.platform.common.internal.registry.PlatformRegistryImpl;
import com.refinedmods.refinedstorage2.platform.common.internal.resource.FluidResourceFactory;
Expand Down Expand Up @@ -108,7 +108,7 @@ public class PlatformApiImpl implements PlatformApi {
Comparator.comparingInt(ConstructorStrategyFactory::getPriority)
);
private final CompositeIngredientConverter compositeConverter = new CompositeIngredientConverter();
private final StorageContainerHelper storageContainerHelper = new StorageContainerHelperImpl();
private final StorageContainerItemHelper storageContainerItemHelper = new StorageContainerItemHelperImpl();
private final List<GridInsertionStrategyFactory> gridInsertionStrategyFactories = new ArrayList<>();
private final GridInsertionHintsImpl gridInsertionHints = new GridInsertionHintsImpl(
new ItemGridInsertionHint(),
Expand Down Expand Up @@ -142,8 +142,8 @@ public StorageRepository getStorageRepository(final Level level) {
}

@Override
public StorageContainerHelper getStorageContainerHelper() {
return storageContainerHelper;
public StorageContainerItemHelper getStorageContainerItemHelper() {
return storageContainerItemHelper;
}

private StorageRepositoryImpl createStorageRepository(final CompoundTag tag) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private void apply(final ItemStack stack, final AbstractStorageBlockBlockEntity<
final UUID storageId = storageBlockEntity.getStorageId();
if (storageId != null) {
LOGGER.debug("Transferred storage {} at {} to stack", storageId, storageBlockEntity.getBlockPos());
PlatformApi.INSTANCE.getStorageContainerHelper().setId(stack, storageId);
PlatformApi.INSTANCE.getStorageContainerItemHelper().setId(stack, storageId);
} else {
LOGGER.warn("Storage block {} has no associated storage ID!", storageBlockEntity.getBlockPos());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@
import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation;

public final class ContentNames {
private static final String BLOCK_CATEGORY = "block";

public static final MutableComponent CABLE = createTranslation(BLOCK_CATEGORY, "cable");
public static final MutableComponent GRID = createTranslation(BLOCK_CATEGORY, "grid");
public static final MutableComponent CRAFTING_GRID = createTranslation(BLOCK_CATEGORY, "crafting_grid");
public static final MutableComponent DETECTOR = createTranslation(BLOCK_CATEGORY, "detector");
public static final MutableComponent IMPORTER = createTranslation(BLOCK_CATEGORY, "importer");
public static final MutableComponent EXPORTER = createTranslation(BLOCK_CATEGORY, "exporter");
public static final MutableComponent EXTERNAL_STORAGE = createTranslation(BLOCK_CATEGORY, "external_storage");
public static final MutableComponent CONSTRUCTOR = createTranslation(BLOCK_CATEGORY, "constructor");
public static final MutableComponent DESTRUCTOR = createTranslation(BLOCK_CATEGORY, "destructor");
public static final MutableComponent CONTROLLER = createTranslation(BLOCK_CATEGORY, "controller");
public static final MutableComponent CREATIVE_CONTROLLER = createTranslation(BLOCK_CATEGORY, "creative_controller");
public static final MutableComponent CABLE = createTranslation("block", "cable");
public static final MutableComponent GRID = createTranslation("block", "grid");
public static final MutableComponent CRAFTING_GRID = createTranslation("block", "crafting_grid");
public static final MutableComponent DETECTOR = createTranslation("block", "detector");
public static final MutableComponent IMPORTER = createTranslation("block", "importer");
public static final MutableComponent EXPORTER = createTranslation("block", "exporter");
public static final MutableComponent EXTERNAL_STORAGE = createTranslation("block", "external_storage");
public static final MutableComponent CONSTRUCTOR = createTranslation("block", "constructor");
public static final MutableComponent DESTRUCTOR = createTranslation("block", "destructor");
public static final MutableComponent CONTROLLER = createTranslation("block", "controller");
public static final MutableComponent CREATIVE_CONTROLLER = createTranslation("block", "creative_controller");
public static final MutableComponent WIRELESS_GRID = createTranslation("item", "wireless_grid");

private ContentNames() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.refinedmods.refinedstorage2.api.storage.Storage;
import com.refinedmods.refinedstorage2.api.storage.StorageInfo;
import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerHelper;
import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerItemHelper;
import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository;
import com.refinedmods.refinedstorage2.platform.common.internal.storage.StorageTooltipHelper;

Expand All @@ -25,7 +25,7 @@
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;

public class StorageContainerHelperImpl implements StorageContainerHelper {
public class StorageContainerItemHelperImpl implements StorageContainerItemHelper {
private static final String TAG_ID = "id";

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public FluidStorageDiskItem(final FluidStorageType.Variant variant) {
super(
new Item.Properties().stacksTo(1).fireResistant(),
StorageChannelTypes.FLUID,
PlatformApi.INSTANCE.getStorageContainerHelper()
PlatformApi.INSTANCE.getStorageContainerItemHelper()
);
this.variant = variant;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public ItemStorageDiskItem(final ItemStorageType.Variant variant) {
super(
new Item.Properties().stacksTo(1).fireResistant(),
StorageChannelTypes.ITEM,
PlatformApi.INSTANCE.getStorageContainerHelper()
PlatformApi.INSTANCE.getStorageContainerItemHelper()
);
this.variant = variant;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public FluidStorageBlockBlockItem(final Block block, final FluidStorageType.Vari
super(
block,
new Item.Properties().stacksTo(1).fireResistant(),
PlatformApi.INSTANCE.getStorageContainerHelper()
PlatformApi.INSTANCE.getStorageContainerItemHelper()
);
this.variant = variant;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ItemStorageBlockBlockItem(final Block block, final ItemStorageType.Varian
super(
block,
new Item.Properties().stacksTo(1).fireResistant(),
PlatformApi.INSTANCE.getStorageContainerHelper()
PlatformApi.INSTANCE.getStorageContainerItemHelper()
);
this.variant = variant;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.api.client.model.loading.v1.ModelLoadingPlugin;
import net.fabricmc.fabric.api.client.model.loading.v1.ModelResolver;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.fabricmc.fabric.api.client.rendering.v1.TooltipComponentCallback;
import net.fabricmc.loader.api.FabricLoader;
Expand All @@ -51,13 +50,11 @@
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
import net.minecraft.client.renderer.item.ItemProperties;
import net.minecraft.client.resources.model.UnbakedModel;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.MenuType;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.level.block.Block;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.glfw.GLFW;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -225,15 +222,11 @@ private void registerCustomModels() {
final ResourceLocation diskDriveIdentifier = createIdentifier("block/disk_drive");
final ResourceLocation diskDriveIdentifierItem = createIdentifier("item/disk_drive");

ModelLoadingPlugin.register(pluginContext -> pluginContext.resolveModel().register(new ModelResolver() {
@Override
@Nullable
public UnbakedModel resolveModel(final Context context) {
if (context.id().equals(diskDriveIdentifier) || context.id().equals(diskDriveIdentifierItem)) {
return new DiskDriveUnbakedModel();
}
return null;
ModelLoadingPlugin.register(pluginContext -> pluginContext.resolveModel().register(context -> {
if (context.id().equals(diskDriveIdentifier) || context.id().equals(diskDriveIdentifierItem)) {
return new DiskDriveUnbakedModel();
}
return null;
}));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,9 @@ private class WirelessGridEntryImpl implements WirelessGridEntry {
.defineInRange("energyCapacity", DefaultEnergyUsage.WIRELESS_GRID_CAPACITY, 0, Long.MAX_VALUE);
openEnergyUsage = builder.comment("The energy used by the Wireless Grid to open")
.defineInRange("openEnergyUsage", DefaultEnergyUsage.WIRELESS_GRID_OPEN, 0, Long.MAX_VALUE);
extractEnergyUsage = builder.comment("The energy used by the Wireless Grid to extract items")
extractEnergyUsage = builder.comment("The energy used by the Wireless Grid to extract resources")
.defineInRange("extractEnergyUsage", DefaultEnergyUsage.WIRELESS_GRID_EXTRACT, 0, Long.MAX_VALUE);
insertEnergyUsage = builder.comment("The energy used by the Wireless Grid to insert items")
insertEnergyUsage = builder.comment("The energy used by the Wireless Grid to insert resources")
.defineInRange("insertEnergyUsage", DefaultEnergyUsage.WIRELESS_GRID_INSERT, 0, Long.MAX_VALUE);
builder.pop();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public <T> LazyOptional<T> getCapability(@Nonnull final Capability<T> cap, @Null
}
return LazyOptional.empty();
}
}
}

0 comments on commit e2e7ca7

Please sign in to comment.