Skip to content

Commit

Permalink
Suppress unused
Browse files Browse the repository at this point in the history
  • Loading branch information
Griefed committed Nov 9, 2023
1 parent 7f9b138 commit 2725096
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public CommonSubProjectGenerator(Project project, String modName, BlockDefinitio
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.Material;
@SuppressWarnings("unused")
public class GeneratedModBlocks {
public static final RegistrationProvider<Block> BLOCKS = RegistrationProvider.get(Registry.BLOCK_REGISTRY, Constants.MOD_ID);
public static final RegistrationProvider<Item> ITEMS = RegistrationProvider.get(Registry.ITEM_REGISTRY, Constants.MOD_ID);
Expand All @@ -38,8 +39,7 @@ private static Item.Properties itemBuilder() {
}
// Called in the mod initializer / constructor in order to make sure that items are registered
public static void loadClass() {
}
public static void loadClass() {}
}
"""
.replace("GROUP", getGroup());
Expand All @@ -53,7 +53,8 @@ public static void loadClass() {
import GROUP.registry.RegistryObject;
import net.minecraft.core.Registry;
import net.minecraft.world.item.Item;
@SuppressWarnings("unused")
public class GeneratedModItems {
public static final RegistrationProvider<Item> ITEMS = RegistrationProvider.get(Registry.ITEM_REGISTRY, Constants.MOD_ID);
Expand All @@ -65,8 +66,7 @@ private static Item.Properties itemBuilder() {
}
// Called in the mod initializer / constructor in order to make sure that items are registered
public static void loadClass() {
}
public static void loadClass() {}
}
"""
Expand Down Expand Up @@ -99,7 +99,6 @@ public class CommonClass {
public static void init() {
Constants.LOG.info("Hello from Common init on {}! we are currently in a {} environment!", Services.PLATFORM.getPlatformName(), Services.PLATFORM.getEnvironmentName());
Constants.LOG.info("The ID for diamonds is {}", Registry.ITEM.getKey(Items.DIAMOND));
// It is common for all supported loaders to provide a similar feature that can not be used directly in the
// common code. A popular way to get around this is using Java's built-in service loader feature to create
Expand Down
6 changes: 1 addition & 5 deletions common/src/main/java/de/griefed/addemall/CommonClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
import de.griefed.addemall.platform.Services;
import net.minecraft.core.Registry;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.block.Block;

import java.util.List;

Expand All @@ -35,7 +31,7 @@ public static void init() {
// we have an interface in the common code and use a loader specific implementation to delegate our call to
// the platform specific approach.
if (Services.PLATFORM.isModLoaded("addemall")) {
Constants.LOG.info("Hello to AddEmAll");
Constants.LOG.info("Hello to addemall");
}

/*###GENERATED CODE - DO NOT EDIT - MANUALLY EDITED CODE WILL BE LOST###*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.Material;

@SuppressWarnings("unused")
public class GeneratedModBlocks {
public static final RegistrationProvider<Block> BLOCKS = RegistrationProvider.get(Registry.BLOCK_REGISTRY, Constants.MOD_ID);
public static final RegistrationProvider<Item> ITEMS = RegistrationProvider.get(Registry.ITEM_REGISTRY, Constants.MOD_ID);
Expand Down Expand Up @@ -371,12 +372,11 @@ public class GeneratedModBlocks {
() -> new BlockItem(WALLPAPER_1.get(), itemBuilder()));

/*###GENERATED CODE - DO NOT EDIT - MANUALLY EDITED CODE WILL BE LOST###*/

private static Item.Properties itemBuilder() {
return new Item.Properties().tab(Services.PLATFORM.getCreativeTab());
}

// Called in the mod initializer / constructor in order to make sure that items are registered
public static void loadClass() {
}
public static void loadClass() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.core.Registry;
import net.minecraft.world.item.Item;

@SuppressWarnings("unused")
public class GeneratedModItems {
public static final RegistrationProvider<Item> ITEMS = RegistrationProvider.get(Registry.ITEM_REGISTRY, Constants.MOD_ID);

Expand All @@ -19,7 +20,6 @@ private static Item.Properties itemBuilder() {
}

// Called in the mod initializer / constructor in order to make sure that items are registered
public static void loadClass() {
}
public static void loadClass() {}
}

0 comments on commit 2725096

Please sign in to comment.